On 9/2/21 2:40 PM, Song Gao wrote:
+static bool gen_r2_ui6(DisasContext *ctx, arg_slli_d *a,
+ void(*func)(TCGv, TCGv, TCGv))
+{
+ TCGv dest = gpr_dst(ctx, a->rd);
+ TCGv src1 = gpr_src(ctx, a->rj, EXT_NONE);
+ TCGv src2 = tcg_constant_tl(a->ui6);
+
+ TCGv t0 = temp_new(ctx);
+
+ tcg_gen_andi_tl(t0, src2, 0x7f);
0x3f.
That said, these shouldn't require masking, because they've just come from the decoder as
5 and 6-bit operands.
You should prefer to use the tcg_gen_* functions that take integers:
void (*func)(TCGv, TCGv, target_long)
passing tcg_gen_shli_tl, etc. It will make all of these simpler.
r~