aboutsummaryrefslogtreecommitdiff
path: root/target/ppc/translate/vmx-impl.c.inc
diff options
context:
space:
mode:
authorMatheus Ferst <matheus.ferst@eldorado.org.br>2022-05-17 09:39:26 -0300
committerDaniel Henrique Barboza <danielhb413@gmail.com>2022-05-26 17:11:32 -0300
commitffc2a2818a6ae321830de2a8c93c78d437c64171 (patch)
tree01d0cf6aeee185e0a3d7bd8d0025db938bcdb77b /target/ppc/translate/vmx-impl.c.inc
parent8f5eeee3f1f1e7da4a1bf1ecb5527071fde1b2d5 (diff)
target/ppc: introduce do_va_helper
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220517123929.284511-10-matheus.ferst@eldorado.org.br> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Diffstat (limited to 'target/ppc/translate/vmx-impl.c.inc')
-rw-r--r--target/ppc/translate/vmx-impl.c.inc32
1 files changed, 5 insertions, 27 deletions
diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vmx-impl.c.inc
index 764ac45409..e66301c007 100644
--- a/target/ppc/translate/vmx-impl.c.inc
+++ b/target/ppc/translate/vmx-impl.c.inc
@@ -2553,20 +2553,17 @@ static void gen_vmladduhm(DisasContext *ctx)
tcg_temp_free_ptr(rd);
}
-static bool trans_VPERM(DisasContext *ctx, arg_VA *a)
+static bool do_va_helper(DisasContext *ctx, arg_VA *a,
+ void (*gen_helper)(TCGv_ptr, TCGv_ptr, TCGv_ptr, TCGv_ptr))
{
TCGv_ptr vrt, vra, vrb, vrc;
-
- REQUIRE_INSNS_FLAGS(ctx, ALTIVEC);
REQUIRE_VECTOR(ctx);
vrt = gen_avr_ptr(a->vrt);
vra = gen_avr_ptr(a->vra);
vrb = gen_avr_ptr(a->vrb);
vrc = gen_avr_ptr(a->rc);
-
- gen_helper_VPERM(vrt, vra, vrb, vrc);
-
+ gen_helper(vrt, vra, vrb, vrc);
tcg_temp_free_ptr(vrt);
tcg_temp_free_ptr(vra);
tcg_temp_free_ptr(vrb);
@@ -2575,27 +2572,8 @@ static bool trans_VPERM(DisasContext *ctx, arg_VA *a)
return true;
}
-static bool trans_VPERMR(DisasContext *ctx, arg_VA *a)
-{
- TCGv_ptr vrt, vra, vrb, vrc;
-
- REQUIRE_INSNS_FLAGS2(ctx, ISA300);
- REQUIRE_VECTOR(ctx);
-
- vrt = gen_avr_ptr(a->vrt);
- vra = gen_avr_ptr(a->vra);
- vrb = gen_avr_ptr(a->vrb);
- vrc = gen_avr_ptr(a->rc);
-
- gen_helper_VPERMR(vrt, vra, vrb, vrc);
-
- tcg_temp_free_ptr(vrt);
- tcg_temp_free_ptr(vra);
- tcg_temp_free_ptr(vrb);
- tcg_temp_free_ptr(vrc);
-
- return true;
-}
+TRANS_FLAGS(ALTIVEC, VPERM, do_va_helper, gen_helper_VPERM)
+TRANS_FLAGS2(ISA300, VPERMR, do_va_helper, gen_helper_VPERMR)
static bool trans_VSEL(DisasContext *ctx, arg_VA *a)
{