On 2/27/22 17:02, Weiwei Li wrote:
Thanks for your comments.
在 2022/2/28 上午2:47, Richard Henderson 写道:
On 2/27/22 04:25, Weiwei Li wrote:
+static void gen_packh(TCGv ret, TCGv src1, TCGv src2)
+{
+ TCGv t = tcg_temp_new();
+
+ tcg_gen_ext8u_tl(t, src2);
+ tcg_gen_deposit_tl(ret, src1, t, 8, TARGET_LONG_BITS - 8);
+ tcg_temp_free(t);
+}
+
+static void gen_packw(TCGv ret, TCGv src1, TCGv src2)
+{
+ TCGv t = tcg_temp_new();
+
+ tcg_gen_ext16s_tl(t, src2);
+ tcg_gen_deposit_tl(ret, src1, t, 16, 48);
+ tcg_temp_free(t);
+}
Missing TARGET_LONG_BITS here; would break on RV32.
packw is RV64-only instruction. Is it necessary to use TARGET_LONG_BITS here?
Ah, I see. So it's not buggy, as-is, but it certainly looks odd next to the previous, and
it wouldn't be buggy to use TARGET_LONG_BITS either.
This points out that it would be a good idea to keep these generator functions next to the
trans function that uses them, for context.
r~