target/ppc: use int128.h methods in vaddcuq
And also move the insn to decodetree. Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br> Reviewed-by: Víctor Colombo <victor.colombo@eldorado.org.br> Message-Id: <20220606150037.338931-5-matheus.ferst@eldorado.org.br> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
896d92c81d
commit
8290ea509f
@ -207,7 +207,7 @@ DEF_HELPER_FLAGS_5(vsubuws, TCG_CALL_NO_RWG, void, avr, avr, avr, avr, i32)
|
||||
DEF_HELPER_FLAGS_3(VADDUQM, TCG_CALL_NO_RWG, void, avr, avr, avr)
|
||||
DEF_HELPER_FLAGS_4(VADDECUQ, TCG_CALL_NO_RWG, void, avr, avr, avr, avr)
|
||||
DEF_HELPER_FLAGS_4(VADDEUQM, TCG_CALL_NO_RWG, void, avr, avr, avr, avr)
|
||||
DEF_HELPER_FLAGS_3(vaddcuq, TCG_CALL_NO_RWG, void, avr, avr, avr)
|
||||
DEF_HELPER_FLAGS_3(VADDCUQ, TCG_CALL_NO_RWG, void, avr, avr, avr)
|
||||
DEF_HELPER_FLAGS_3(vsubuqm, TCG_CALL_NO_RWG, void, avr, avr, avr)
|
||||
DEF_HELPER_FLAGS_4(vsubecuq, TCG_CALL_NO_RWG, void, avr, avr, avr, avr)
|
||||
DEF_HELPER_FLAGS_4(vsubeuqm, TCG_CALL_NO_RWG, void, avr, avr, avr, avr)
|
||||
|
@ -550,6 +550,7 @@ VRLQNM 000100 ..... ..... ..... 00101000101 @VX
|
||||
|
||||
## Vector Integer Arithmetic Instructions
|
||||
|
||||
VADDCUQ 000100 ..... ..... ..... 00101000000 @VX
|
||||
VADDUQM 000100 ..... ..... ..... 00100000000 @VX
|
||||
|
||||
VADDEUQM 000100 ..... ..... ..... ..... 111100 @VA
|
||||
|
@ -2225,18 +2225,10 @@ void helper_VADDEUQM(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
|
||||
int128_make64(int128_getlo(c->s128) & 1));
|
||||
}
|
||||
|
||||
void helper_vaddcuq(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
|
||||
void helper_VADDCUQ(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
|
||||
{
|
||||
#ifdef CONFIG_INT128
|
||||
r->u128 = (~a->u128 < b->u128);
|
||||
#else
|
||||
ppc_avr_t not_a;
|
||||
|
||||
avr_qw_not(¬_a, *a);
|
||||
|
||||
r->VsrD(1) = int128_ult(int128_not(a->s128), b->s128);
|
||||
r->VsrD(0) = 0;
|
||||
r->VsrD(1) = (avr_qw_cmpu(not_a, *b) < 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void helper_VADDECUQ(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
|
||||
|
@ -1234,7 +1234,6 @@ GEN_VXFORM_SAT(vsubuws, MO_32, sub, ussub, 0, 26);
|
||||
GEN_VXFORM_SAT(vsubsbs, MO_8, sub, sssub, 0, 28);
|
||||
GEN_VXFORM_SAT(vsubshs, MO_16, sub, sssub, 0, 29);
|
||||
GEN_VXFORM_SAT(vsubsws, MO_32, sub, sssub, 0, 30);
|
||||
GEN_VXFORM(vaddcuq, 0, 5);
|
||||
GEN_VXFORM(vsubuqm, 0, 20);
|
||||
GEN_VXFORM(vsubcuq, 0, 21);
|
||||
GEN_VXFORM3(vsubeuqm, 31, 0);
|
||||
@ -3098,6 +3097,7 @@ static bool do_vx_helper(DisasContext *ctx, arg_VX *a,
|
||||
return true;
|
||||
}
|
||||
|
||||
TRANS_FLAGS2(ALTIVEC_207, VADDCUQ, do_vx_helper, gen_helper_VADDCUQ)
|
||||
TRANS_FLAGS2(ALTIVEC_207, VADDUQM, do_vx_helper, gen_helper_VADDUQM)
|
||||
|
||||
TRANS_FLAGS2(ALTIVEC_207, VPMSUMD, do_vx_helper, gen_helper_VPMSUMD)
|
||||
|
@ -126,7 +126,6 @@ GEN_VXFORM(vsubuws, 0, 26),
|
||||
GEN_VXFORM_DUAL(vsubsbs, bcdtrunc, 0, 28, PPC_ALTIVEC, PPC2_ISA300),
|
||||
GEN_VXFORM(vsubshs, 0, 29),
|
||||
GEN_VXFORM_DUAL(vsubsws, xpnd04_2, 0, 30, PPC_ALTIVEC, PPC_NONE),
|
||||
GEN_VXFORM_207(vaddcuq, 0, 5),
|
||||
GEN_VXFORM_DUAL(vsubuqm, bcdtrunc, 0, 20, PPC2_ALTIVEC_207, PPC2_ISA300),
|
||||
GEN_VXFORM_DUAL(vsubcuq, bcdutrunc, 0, 21, PPC2_ALTIVEC_207, PPC2_ISA300),
|
||||
GEN_VXFORM_DUAL(vsubeuqm, vsubecuq, 31, 0xFF, PPC_NONE, PPC2_ALTIVEC_207),
|
||||
|
Loading…
Reference in New Issue
Block a user