[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 11/12] target/ppc: declare vmsumuh[ms] helper with call flags
From: |
matheus . ferst |
Subject: |
[PATCH v2 11/12] target/ppc: declare vmsumuh[ms] helper with call flags |
Date: |
Thu, 19 May 2022 17:18:21 -0300 |
From: Matheus Ferst <matheus.ferst@eldorado.org.br>
Move vmsumuhm and vmsumuhs to decodetree, declare both helpers with
TCG_CALL_NO_RWG, and drop the unused env argument of vmsumuhm.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
---
target/ppc/helper.h | 4 ++--
target/ppc/insn32.decode | 2 ++
target/ppc/int_helper.c | 5 ++---
target/ppc/translate/vmx-impl.c.inc | 24 ++++++++++++++++++++++--
target/ppc/translate/vmx-ops.c.inc | 1 -
5 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/target/ppc/helper.h b/target/ppc/helper.h
index efbbd34feb..223b4c941a 100644
--- a/target/ppc/helper.h
+++ b/target/ppc/helper.h
@@ -242,8 +242,8 @@ DEF_HELPER_4(vpkudum, void, env, avr, avr, avr)
DEF_HELPER_FLAGS_3(vpkpx, TCG_CALL_NO_RWG, void, avr, avr, avr)
DEF_HELPER_5(vmhaddshs, void, env, avr, avr, avr, avr)
DEF_HELPER_5(vmhraddshs, void, env, avr, avr, avr, avr)
-DEF_HELPER_5(vmsumuhm, void, env, avr, avr, avr, avr)
-DEF_HELPER_5(vmsumuhs, void, env, avr, avr, avr, avr)
+DEF_HELPER_FLAGS_4(VMSUMUHM, TCG_CALL_NO_RWG, void, avr, avr, avr, avr)
+DEF_HELPER_FLAGS_5(VMSUMUHS, TCG_CALL_NO_RWG, void, env, avr, avr, avr, avr)
DEF_HELPER_5(vmsumshm, void, env, avr, avr, avr, avr)
DEF_HELPER_5(vmsumshs, void, env, avr, avr, avr, avr)
DEF_HELPER_FLAGS_4(vmladduhm, TCG_CALL_NO_RWG, void, avr, avr, avr, avr)
diff --git a/target/ppc/insn32.decode b/target/ppc/insn32.decode
index fdb8d76456..43ea03c3e7 100644
--- a/target/ppc/insn32.decode
+++ b/target/ppc/insn32.decode
@@ -601,6 +601,8 @@ VMULLD 000100 ..... ..... ..... 00111001001 @VX
VMSUMUBM 000100 ..... ..... ..... ..... 100100 @VA
VMSUMMBM 000100 ..... ..... ..... ..... 100101 @VA
+VMSUMUHM 000100 ..... ..... ..... ..... 100110 @VA
+VMSUMUHS 000100 ..... ..... ..... ..... 100111 @VA
VMSUMCUD 000100 ..... ..... ..... ..... 010111 @VA
VMSUMUDM 000100 ..... ..... ..... ..... 100011 @VA
diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c
index 85a7442103..9285a1c2a1 100644
--- a/target/ppc/int_helper.c
+++ b/target/ppc/int_helper.c
@@ -942,8 +942,7 @@ void helper_VMSUMUBM(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t
*b, ppc_avr_t *c)
}
}
-void helper_vmsumuhm(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a,
- ppc_avr_t *b, ppc_avr_t *c)
+void helper_VMSUMUHM(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
{
uint32_t prod[8];
int i;
@@ -957,7 +956,7 @@ void helper_vmsumuhm(CPUPPCState *env, ppc_avr_t *r,
ppc_avr_t *a,
}
}
-void helper_vmsumuhs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a,
+void helper_VMSUMUHS(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a,
ppc_avr_t *b, ppc_avr_t *c)
{
uint32_t prod[8];
diff --git a/target/ppc/translate/vmx-impl.c.inc
b/target/ppc/translate/vmx-impl.c.inc
index 4cbd724641..da81296b96 100644
--- a/target/ppc/translate/vmx-impl.c.inc
+++ b/target/ppc/translate/vmx-impl.c.inc
@@ -2587,11 +2587,31 @@ static bool trans_VSEL(DisasContext *ctx, arg_VA *a)
return true;
}
-GEN_VAFORM_PAIRED(vmsumuhm, vmsumuhs, 19)
GEN_VAFORM_PAIRED(vmsumshm, vmsumshs, 20)
-
TRANS_FLAGS(ALTIVEC, VMSUMUBM, do_va_helper, gen_helper_VMSUMUBM)
TRANS_FLAGS(ALTIVEC, VMSUMMBM, do_va_helper, gen_helper_VMSUMMBM)
+TRANS_FLAGS(ALTIVEC, VMSUMUHM, do_va_helper, gen_helper_VMSUMUHM)
+
+static bool do_va_env_helper(DisasContext *ctx, arg_VA *a,
+ void (*gen_helper)(TCGv_ptr, TCGv_ptr, TCGv_ptr, TCGv_ptr, TCGv_ptr))
+{
+ TCGv_ptr vrt, vra, vrb, vrc;
+ 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(cpu_env, 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, VMSUMUHS, do_va_env_helper, gen_helper_VMSUMUHS)
GEN_VAFORM_PAIRED(vmaddfp, vnmsubfp, 23)
diff --git a/target/ppc/translate/vmx-ops.c.inc
b/target/ppc/translate/vmx-ops.c.inc
index 5b85322c06..15b3e06410 100644
--- a/target/ppc/translate/vmx-ops.c.inc
+++ b/target/ppc/translate/vmx-ops.c.inc
@@ -224,7 +224,6 @@ GEN_VXFORM_UIMM(vctsxs, 5, 15),
#define GEN_VAFORM_PAIRED(name0, name1, opc2) \
GEN_HANDLER(name0##_##name1, 0x04, opc2, 0xFF, 0x00000000, PPC_ALTIVEC)
GEN_VAFORM_PAIRED(vmhaddshs, vmhraddshs, 16),
-GEN_VAFORM_PAIRED(vmsumuhm, vmsumuhs, 19),
GEN_VAFORM_PAIRED(vmsumshm, vmsumshs, 20),
GEN_VAFORM_PAIRED(vmaddfp, vnmsubfp, 23),
--
2.25.1
- [PATCH v2 02/12] target/ppc: use TCG_CALL_NO_RWG in vector helpers without env, (continued)
- [PATCH v2 02/12] target/ppc: use TCG_CALL_NO_RWG in vector helpers without env, matheus . ferst, 2022/05/19
- [PATCH v2 03/12] target/ppc: use TCG_CALL_NO_RWG in BCD helpers, matheus . ferst, 2022/05/19
- [PATCH v2 04/12] target/ppc: use TCG_CALL_NO_RWG in VSX helpers without env, matheus . ferst, 2022/05/19
- [PATCH v2 05/12] target/ppc: Use TCG_CALL_NO_RWG_SE in fsel helper, matheus . ferst, 2022/05/19
- [PATCH v2 06/12] target/ppc: implement xscvspdpn with helper_todouble, matheus . ferst, 2022/05/19
- [PATCH v2 07/12] target/ppc: declare xvxsigsp helper with call flags, matheus . ferst, 2022/05/19
- [PATCH v2 11/12] target/ppc: declare vmsumuh[ms] helper with call flags,
matheus . ferst <=
- [PATCH v2 08/12] target/ppc: declare xxextractuw and xxinsertw helpers with call flags, matheus . ferst, 2022/05/19
- [PATCH v2 09/12] target/ppc: introduce do_va_helper, matheus . ferst, 2022/05/19
- [PATCH v2 10/12] target/ppc: declare vmsum[um]bm helpers with call flags, matheus . ferst, 2022/05/19
- [PATCH v2 12/12] target/ppc: declare vmsumsh[ms] helper with call flags, matheus . ferst, 2022/05/19
- Re: [PATCH v2 00/12] Change helper declarations to use call flags, Daniel Henrique Barboza, 2022/05/23