[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/12] target/ppc: introduce do_va_helper
From: |
matheus . ferst |
Subject: |
[PATCH 09/12] target/ppc: introduce do_va_helper |
Date: |
Tue, 17 May 2022 09:39:26 -0300 |
From: Matheus Ferst <matheus.ferst@eldorado.org.br>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
---
target/ppc/translate/vmx-impl.c.inc | 32 +++++------------------------
1 file 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)
{
--
2.25.1
- [PATCH 05/12] target/ppc: Use TCG_CALL_NO_RWG_SE in fsel helper, (continued)
- [PATCH 05/12] target/ppc: Use TCG_CALL_NO_RWG_SE in fsel helper, matheus . ferst, 2022/05/17
- [PATCH 04/12] target/ppc: use TCG_CALL_NO_RWG in VSX helpers without env, matheus . ferst, 2022/05/17
- [PATCH 06/12] target/ppc: declare xscvspdpn helper with call flags, matheus . ferst, 2022/05/17
- [PATCH 07/12] target/ppc: declare xvxsigsp helper with call flags, matheus . ferst, 2022/05/17
- [PATCH 08/12] target/ppc: declare xxextractuw and xxinsertw helpers with call flags, matheus . ferst, 2022/05/17
- [PATCH 09/12] target/ppc: introduce do_va_helper,
matheus . ferst <=
- [PATCH 10/12] target/ppc: declare vmsum[um]bm helpers with call flags, matheus . ferst, 2022/05/17
- [PATCH 11/12] target/ppc: declare vmsumuhm helper with call flags, matheus . ferst, 2022/05/17
- [PATCH 12/12] target/ppc: declare vmsumshm helper with call flags, matheus . ferst, 2022/05/17