qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 01/13] target/riscv: Sign extend pc for different ol


From: Richard Henderson
Subject: Re: [PATCH 01/13] target/riscv: Sign extend pc for different ol
Date: Mon, 1 Nov 2021 06:29:57 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 11/1/21 6:01 AM, LIU Zhiwei wrote:
+static void gen_set_pc(DisasContext *ctx, target_ulong dest)
+{
+    TCGv t = tcg_constant_tl(dest);
+    switch (get_ol(ctx)) {
+    case MXL_RV32:
+        tcg_gen_ext32s_tl(cpu_pc, t);

Don't compute with tcg to do what you can in C.  Dest is constant.
And I think that XL is more appropriate than OL (which *should* be the same, but still looks weird).

    if (get_xl(ctx) == MXL_RV32) {
        dest = (int32_t)dest;
    }
    tcg_gen_movi_tl(cpu_pc, dest);


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]