On 10/17/21 4:59 PM, Alistair Francis wrote:
+#if defined(TARGET_RISCV64)
+    /* 16 bits -> 64 bits */
+    tcg_gen_ext16s_tl(dest, cpu_fpr[a->rs1]);
+#else
+    /* 16 bits -> 32 bits */
+    tcg_gen_extrl_i64_i32(dest, cpu_fpr[a->rs1]);
+    tcg_gen_ext16s_tl(dest, dest);
+#endif
Can we use is_32bit(ctx) instead?

No.  This is about sizeof(target_long), not the current cpu state.

It would be possible to use

    tcg_gen_trunc_i64_tl
    tcg_gen_ext16s_tl

but we have a couple of other instances of the same thing.

r~

Reply via email to