On 6/30/23 08:58, Song Gao wrote:
+#define XVMADD_Q(NAME, FN, idx1, idx2) \ +static bool trans_## NAME(DisasContext *ctx, arg_vvv * a) \ +{ \ + TCGv_i64 rh, rl, arg1, arg2, th, tl; \ + int i; \ + \ + CHECK_VEC; \ + \ + rh = tcg_temp_new_i64(); \ + rl = tcg_temp_new_i64(); \ + arg1 = tcg_temp_new_i64(); \ + arg2 = tcg_temp_new_i64(); \ + th = tcg_temp_new_i64(); \ + tl = tcg_temp_new_i64(); \ + \ + for (i = 0; i < 2; i++) { \ + get_vreg64(arg1, a->vj, idx1 + i * 2); \ + get_vreg64(arg2, a->vk, idx2 + i * 2); \ + get_vreg64(rh, a->vd, 1 + i * 2); \ + get_vreg64(rl, a->vd, 0 + i * 2); \ + \ + tcg_gen_## FN ##_i64(tl, th, arg1, arg2); \ + tcg_gen_add2_i64(rl, rh, rl, rh, tl, th); \ + \ + set_vreg64(rh, a->vd, 1 + i * 2); \ + set_vreg64(rl, a->vd, 0 + i * 2); \ + } \ + \ + return true; \ +}
It's easier to debug if you make this a function, into which you pass parameters, like tcg_gen_muls2_i64.
+ len = (simd_oprsz(v) == 16) ? LSX_LEN : LASX_LEN; \ + for (i = 0; i < len / BIT; i++) { \
More of this. r~