On 3/27/23 20:06, Song Gao wrote:
+static void do_vminmax(unsigned vece, TCGv_vec t, TCGv_vec a, int64_t imm, + void(*gen_vminmax_vec)(unsigned, + TCGv_vec, TCGv_vec, TCGv_vec)) +{ + TCGv_vec t1; + + t1 = tcg_temp_new_vec_matching(t); + tcg_gen_dupi_vec(vece, t1, imm);
t1 = tcg_constant_vec_matching(t, vece, imm);
+static void gen_vmini_s(unsigned vece, TCGv_vec t, TCGv_vec a, int64_t imm) +{ + do_vminmax(vece, t, a, imm, tcg_gen_smin_vec); +} + +static void gen_vmini_u(unsigned vece, TCGv_vec t, TCGv_vec a, int64_t imm) +{ + do_vminmax(vece, t, a, imm, tcg_gen_umin_vec); +} + +static void gen_vmaxi_s(unsigned vece, TCGv_vec t, TCGv_vec a, int64_t imm) +{ + do_vminmax(vece, t, a, imm, tcg_gen_smax_vec); +} + +static void gen_vmaxi_u(unsigned vece, TCGv_vec t, TCGv_vec a, int64_t imm) +{ + do_vminmax(vece, t, a, imm, tcg_gen_umax_vec); +}
Perhaps easier to expand tcg_gen_umax_vec(vece, t, a, tcg_constant_vec_matching(t, vece, imm)); in each instance? r~