2016-07-27 09:56:23 +03:00
|
|
|
#define GEN_VXFORM(name, opc2, opc3) \
|
|
|
|
GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC)
|
|
|
|
|
|
|
|
#define GEN_VXFORM_207(name, opc2, opc3) \
|
|
|
|
GEN_HANDLER_E(name, 0x04, opc2, opc3, 0x00000000, PPC_NONE, PPC2_ALTIVEC_207)
|
|
|
|
|
2016-07-28 21:14:16 +03:00
|
|
|
#define GEN_VXFORM_300(name, opc2, opc3) \
|
|
|
|
GEN_HANDLER_E(name, 0x04, opc2, opc3, 0x00000000, PPC_NONE, PPC2_ISA300)
|
|
|
|
|
2016-09-06 08:04:06 +03:00
|
|
|
#define GEN_VXFORM_300_EXT(name, opc2, opc3, inval) \
|
|
|
|
GEN_HANDLER_E(name, 0x04, opc2, opc3, inval, PPC_NONE, PPC2_ISA300)
|
|
|
|
|
2016-09-06 08:04:08 +03:00
|
|
|
#define GEN_VXFORM_300_EO(name, opc2, opc3, opc4) \
|
|
|
|
GEN_HANDLER_E_2(name, 0x04, opc2, opc3, opc4, 0x00000000, PPC_NONE, \
|
|
|
|
PPC2_ISA300)
|
|
|
|
|
2020-07-02 02:43:40 +03:00
|
|
|
#define GEN_VXFORM_310(name, opc2, opc3) \
|
|
|
|
GEN_HANDLER_E(name, 0x04, opc2, opc3, 0x00000000, PPC_NONE, PPC2_ISA310)
|
|
|
|
|
2016-07-27 09:56:23 +03:00
|
|
|
#define GEN_VXFORM_DUAL(name0, name1, opc2, opc3, type0, type1) \
|
|
|
|
GEN_HANDLER_E(name0##_##name1, 0x4, opc2, opc3, 0x00000000, type0, type1)
|
|
|
|
|
|
|
|
#define GEN_VXRFORM_DUAL(name0, name1, opc2, opc3, tp0, tp1) \
|
|
|
|
GEN_HANDLER_E(name0##_##name1, 0x4, opc2, opc3, 0x00000000, tp0, tp1), \
|
|
|
|
GEN_HANDLER_E(name0##_##name1, 0x4, opc2, (opc3 | 0x10), 0x00000000, tp0, tp1),
|
|
|
|
|
2016-10-24 12:14:58 +03:00
|
|
|
GEN_VXFORM_DUAL(vaddubm, vmul10cuq, 0, 0, PPC_ALTIVEC, PPC_NONE),
|
|
|
|
GEN_VXFORM_DUAL(vadduhm, vmul10ecuq, 0, 1, PPC_ALTIVEC, PPC_NONE),
|
2016-07-27 09:56:23 +03:00
|
|
|
GEN_VXFORM(vadduwm, 0, 2),
|
|
|
|
GEN_VXFORM_207(vaddudm, 0, 3),
|
|
|
|
GEN_VXFORM_DUAL(vsububm, bcdadd, 0, 16, PPC_ALTIVEC, PPC_NONE),
|
|
|
|
GEN_VXFORM_DUAL(vsubuhm, bcdsub, 0, 17, PPC_ALTIVEC, PPC_NONE),
|
2017-01-10 05:10:11 +03:00
|
|
|
GEN_VXFORM_DUAL(vsubuwm, bcdus, 0, 18, PPC_ALTIVEC, PPC2_ISA300),
|
2017-01-10 05:10:10 +03:00
|
|
|
GEN_VXFORM_DUAL(vsubudm, bcds, 0, 19, PPC2_ALTIVEC_207, PPC2_ISA300),
|
|
|
|
GEN_VXFORM_300(bcds, 0, 27),
|
2016-07-27 09:56:23 +03:00
|
|
|
GEN_VXFORM(vmrghb, 6, 0),
|
|
|
|
GEN_VXFORM(vmrghh, 6, 1),
|
|
|
|
GEN_VXFORM(vmrghw, 6, 2),
|
|
|
|
GEN_VXFORM(vmrglb, 6, 4),
|
|
|
|
GEN_VXFORM(vmrglh, 6, 5),
|
|
|
|
GEN_VXFORM(vmrglw, 6, 6),
|
2016-11-28 10:56:42 +03:00
|
|
|
GEN_VXFORM_300(vextublx, 6, 24),
|
|
|
|
GEN_VXFORM_300(vextuhlx, 6, 25),
|
|
|
|
GEN_VXFORM_DUAL(vmrgow, vextuwlx, 6, 26, PPC_NONE, PPC2_ALTIVEC_207),
|
|
|
|
GEN_VXFORM_300(vextubrx, 6, 28),
|
|
|
|
GEN_VXFORM_300(vextuhrx, 6, 29),
|
|
|
|
GEN_VXFORM_DUAL(vmrgew, vextuwrx, 6, 30, PPC_NONE, PPC2_ALTIVEC_207),
|
target/ppc: moved vector even and odd multiplication to decodetree
Moved the instructions vmulesb, vmulosb, vmuleub, vmuloub,
vmulesh, vmulosh, vmuleuh, vmulouh, vmulesw, vmulosw,
muleuw and vmulouw from legacy to decodetree. Implemented
the instructions vmulesd, vmulosd, vmuleud, vmuloud.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Lucas Mateus Castro (alqotel) <lucas.araujo@eldorado.org.br>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Message-Id: <20220225210936.1749575-3-matheus.ferst@eldorado.org.br>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2022-03-02 08:51:36 +03:00
|
|
|
GEN_VXFORM_207(vmuluwm, 4, 2),
|
2016-07-28 21:14:17 +03:00
|
|
|
GEN_VXFORM_300(vsrv, 2, 28),
|
2016-07-28 21:14:16 +03:00
|
|
|
GEN_VXFORM_300(vslv, 2, 29),
|
2016-07-27 09:56:23 +03:00
|
|
|
GEN_VXFORM(vslo, 6, 16),
|
|
|
|
GEN_VXFORM(vsro, 6, 17),
|
2016-10-30 06:14:58 +03:00
|
|
|
|
target/ppc: Move V(ADD|SUB)CUW to decodetree and use gvec
This patch moves VADDCUW and VSUBCUW to decodtree with gvec using an
implementation based on the helper, with the main difference being
changing the -1 (aka all bits set to 1) result returned by cmp when
true to +1. It also implemented a .fni4 version of those instructions
and dropped the helper.
vaddcuw:
rept loop master patch
8 12500 0,01008200 0,00612400 (-39.3%)
25 4000 0,01091500 0,00471600 (-56.8%)
100 1000 0,01332500 0,00593700 (-55.4%)
500 200 0,01998500 0,01275700 (-36.2%)
2500 40 0,04704300 0,04364300 (-7.2%)
8000 12 0,10748200 0,11241000 (+4.6%)
vsubcuw:
rept loop master patch
8 12500 0,01226200 0,00571600 (-53.4%)
25 4000 0,01493500 0,00462100 (-69.1%)
100 1000 0,01522700 0,00455100 (-70.1%)
500 200 0,02384600 0,01133500 (-52.5%)
2500 40 0,04935200 0,03178100 (-35.6%)
8000 12 0,09039900 0,09440600 (+4.4%)
Overall there was a gain in performance, but the TCGop code was still
slightly bigger in the new version (it went from 4 to 5).
Signed-off-by: Lucas Mateus Castro (alqotel) <lucas.araujo@eldorado.org.br>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20221019125040.48028-4-lucas.araujo@eldorado.org.br>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2022-10-19 15:50:31 +03:00
|
|
|
GEN_VXFORM(xpnd04_1, 0, 22),
|
2017-01-10 05:10:12 +03:00
|
|
|
GEN_VXFORM_300(bcdsr, 0, 23),
|
|
|
|
GEN_VXFORM_300(bcdsr, 0, 31),
|
2024-05-23 12:44:53 +03:00
|
|
|
GEN_VXFORM_300_EXT(vmul10uq, 0, 8, 0x0000F800),
|
|
|
|
GEN_VXFORM_300(vmul10euq, 0, 9),
|
|
|
|
GEN_VXFORM_300(bcdcpsgn, 0, 13),
|
|
|
|
GEN_VXFORM_207(bcdadd, 0, 24),
|
|
|
|
GEN_VXFORM_207(bcdsub, 0, 25),
|
|
|
|
GEN_VXFORM_300(bcdtrunc, 0, 28),
|
|
|
|
GEN_VXFORM_300(xpnd04_2, 0, 30),
|
2022-06-06 18:00:35 +03:00
|
|
|
GEN_VXFORM_300(bcdtrunc, 0, 20),
|
2022-06-06 18:00:37 +03:00
|
|
|
GEN_VXFORM_300(bcdutrunc, 0, 21),
|
2022-03-02 08:51:37 +03:00
|
|
|
GEN_VXFORM(vsl, 2, 7),
|
2016-07-27 09:56:23 +03:00
|
|
|
GEN_VXFORM(vsr, 2, 11),
|
|
|
|
GEN_VXFORM(vpkuhum, 7, 0),
|
|
|
|
GEN_VXFORM(vpkuwum, 7, 1),
|
|
|
|
GEN_VXFORM_207(vpkudum, 7, 17),
|
|
|
|
GEN_VXFORM(vpkuhus, 7, 2),
|
|
|
|
GEN_VXFORM(vpkuwus, 7, 3),
|
|
|
|
GEN_VXFORM_207(vpkudus, 7, 19),
|
|
|
|
GEN_VXFORM(vpkshus, 7, 4),
|
|
|
|
GEN_VXFORM(vpkswus, 7, 5),
|
|
|
|
GEN_VXFORM_207(vpksdus, 7, 21),
|
|
|
|
GEN_VXFORM(vpkshss, 7, 6),
|
|
|
|
GEN_VXFORM(vpkswss, 7, 7),
|
|
|
|
GEN_VXFORM_207(vpksdss, 7, 23),
|
|
|
|
GEN_VXFORM(vpkpx, 7, 12),
|
|
|
|
GEN_VXFORM(vsum4ubs, 4, 24),
|
|
|
|
GEN_VXFORM(vsum4sbs, 4, 28),
|
|
|
|
GEN_VXFORM(vsum4shs, 4, 25),
|
|
|
|
GEN_VXFORM(vsum2sws, 4, 26),
|
|
|
|
GEN_VXFORM(vsumsws, 4, 30),
|
|
|
|
GEN_VXFORM(vaddfp, 5, 0),
|
|
|
|
GEN_VXFORM(vsubfp, 5, 1),
|
|
|
|
GEN_VXFORM(vmaxfp, 5, 16),
|
|
|
|
GEN_VXFORM(vminfp, 5, 17),
|
|
|
|
|
|
|
|
#define GEN_VXRFORM1(opname, name, str, opc2, opc3) \
|
|
|
|
GEN_HANDLER2(name, str, 0x4, opc2, opc3, 0x00000000, PPC_ALTIVEC),
|
2016-07-28 21:14:15 +03:00
|
|
|
#define GEN_VXRFORM1_300(opname, name, str, opc2, opc3) \
|
|
|
|
GEN_HANDLER2_E(name, str, 0x4, opc2, opc3, 0x00000000, PPC_NONE, PPC2_ISA300),
|
2016-07-27 09:56:23 +03:00
|
|
|
#define GEN_VXRFORM(name, opc2, opc3) \
|
|
|
|
GEN_VXRFORM1(name, name, #name, opc2, opc3) \
|
|
|
|
GEN_VXRFORM1(name##_dot, name##_, #name ".", opc2, (opc3 | (0x1 << 4)))
|
2016-07-28 21:14:15 +03:00
|
|
|
#define GEN_VXRFORM_300(name, opc2, opc3) \
|
|
|
|
GEN_VXRFORM1_300(name, name, #name, opc2, opc3) \
|
|
|
|
GEN_VXRFORM1_300(name##_dot, name##_, #name ".", opc2, (opc3 | (0x1 << 4)))
|
|
|
|
|
2022-03-02 08:51:37 +03:00
|
|
|
GEN_VXRFORM(vcmpeqfp, 3, 3)
|
2016-07-27 09:56:23 +03:00
|
|
|
GEN_VXRFORM(vcmpgefp, 3, 7)
|
2022-03-02 08:51:37 +03:00
|
|
|
GEN_VXRFORM(vcmpgtfp, 3, 11)
|
|
|
|
GEN_VXRFORM(vcmpbfp, 3, 15)
|
2016-07-27 09:56:23 +03:00
|
|
|
|
2016-09-06 08:04:06 +03:00
|
|
|
#define GEN_VXFORM_DUAL_INV(name0, name1, opc2, opc3, inval0, inval1, type) \
|
|
|
|
GEN_OPCODE_DUAL(name0##_##name1, 0x04, opc2, opc3, inval0, inval1, type, \
|
|
|
|
PPC_NONE)
|
2016-09-06 08:04:07 +03:00
|
|
|
GEN_VXFORM_DUAL_INV(vspltb, vextractub, 6, 8, 0x00000000, 0x100000,
|
2016-09-29 13:22:37 +03:00
|
|
|
PPC_ALTIVEC),
|
2016-09-06 08:04:07 +03:00
|
|
|
GEN_VXFORM_DUAL_INV(vsplth, vextractuh, 6, 9, 0x00000000, 0x100000,
|
2016-09-29 13:22:37 +03:00
|
|
|
PPC_ALTIVEC),
|
2016-09-06 08:04:07 +03:00
|
|
|
GEN_VXFORM_DUAL_INV(vspltw, vextractuw, 6, 10, 0x00000000, 0x100000,
|
2016-09-29 13:22:37 +03:00
|
|
|
PPC_ALTIVEC),
|
2016-09-06 08:04:07 +03:00
|
|
|
GEN_VXFORM_300_EXT(vextractd, 6, 11, 0x100000),
|
2021-11-04 15:37:02 +03:00
|
|
|
GEN_VXFORM(vspltisb, 6, 12),
|
|
|
|
GEN_VXFORM(vspltish, 6, 13),
|
|
|
|
GEN_VXFORM(vspltisw, 6, 14),
|
2016-09-06 08:04:08 +03:00
|
|
|
GEN_VXFORM_300_EO(vctzb, 0x01, 0x18, 0x1C),
|
|
|
|
GEN_VXFORM_300_EO(vctzh, 0x01, 0x18, 0x1D),
|
|
|
|
GEN_VXFORM_300_EO(vctzw, 0x01, 0x18, 0x1E),
|
|
|
|
GEN_VXFORM_300_EO(vctzd, 0x01, 0x18, 0x1F),
|
2016-09-28 08:45:18 +03:00
|
|
|
GEN_VXFORM_300_EO(vclzlsbb, 0x01, 0x18, 0x0),
|
|
|
|
GEN_VXFORM_300_EO(vctzlsbb, 0x01, 0x18, 0x1),
|
2016-07-27 09:56:23 +03:00
|
|
|
|
|
|
|
#define GEN_VXFORM_NOA(name, opc2, opc3) \
|
|
|
|
GEN_HANDLER(name, 0x04, opc2, opc3, 0x001f0000, PPC_ALTIVEC)
|
|
|
|
GEN_VXFORM_NOA(vupkhsb, 7, 8),
|
|
|
|
GEN_VXFORM_NOA(vupkhsh, 7, 9),
|
|
|
|
GEN_VXFORM_207(vupkhsw, 7, 25),
|
|
|
|
GEN_VXFORM_NOA(vupklsb, 7, 10),
|
|
|
|
GEN_VXFORM_NOA(vupklsh, 7, 11),
|
|
|
|
GEN_VXFORM_207(vupklsw, 7, 27),
|
|
|
|
GEN_VXFORM_NOA(vupkhpx, 7, 13),
|
|
|
|
GEN_VXFORM_NOA(vupklpx, 7, 15),
|
|
|
|
GEN_VXFORM_NOA(vrefp, 5, 4),
|
|
|
|
GEN_VXFORM_NOA(vrsqrtefp, 5, 5),
|
|
|
|
GEN_VXFORM_NOA(vexptefp, 5, 6),
|
|
|
|
GEN_VXFORM_NOA(vlogefp, 5, 7),
|
|
|
|
GEN_VXFORM_NOA(vrfim, 5, 11),
|
|
|
|
GEN_VXFORM_NOA(vrfin, 5, 8),
|
|
|
|
GEN_VXFORM_NOA(vrfip, 5, 10),
|
|
|
|
GEN_VXFORM_NOA(vrfiz, 5, 9),
|
|
|
|
|
|
|
|
#define GEN_VXFORM_UIMM(name, opc2, opc3) \
|
|
|
|
GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC)
|
|
|
|
GEN_VXFORM_UIMM(vcfux, 5, 12),
|
|
|
|
GEN_VXFORM_UIMM(vcfsx, 5, 13),
|
|
|
|
GEN_VXFORM_UIMM(vctuxs, 5, 14),
|
|
|
|
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(vmaddfp, vnmsubfp, 23),
|
|
|
|
|
|
|
|
GEN_VXFORM_DUAL(vclzb, vpopcntb, 1, 28, PPC_NONE, PPC2_ALTIVEC_207),
|
|
|
|
GEN_VXFORM_DUAL(vclzh, vpopcnth, 1, 29, PPC_NONE, PPC2_ALTIVEC_207),
|
|
|
|
GEN_VXFORM_DUAL(vclzw, vpopcntw, 1, 30, PPC_NONE, PPC2_ALTIVEC_207),
|
|
|
|
GEN_VXFORM_DUAL(vclzd, vpopcntd, 1, 31, PPC_NONE, PPC2_ALTIVEC_207),
|
|
|
|
|
2016-09-06 08:04:09 +03:00
|
|
|
GEN_VXFORM_300(vbpermd, 6, 23),
|
2016-07-27 09:56:23 +03:00
|
|
|
GEN_VXFORM_207(vbpermq, 6, 21),
|
|
|
|
GEN_VXFORM_207(vgbbd, 6, 20),
|
|
|
|
GEN_VXFORM_207(vpmsumb, 4, 16),
|
|
|
|
GEN_VXFORM_207(vpmsumh, 4, 17),
|
|
|
|
GEN_VXFORM_207(vpmsumw, 4, 18),
|
|
|
|
|
|
|
|
GEN_VXFORM_207(vsbox, 4, 23),
|
|
|
|
|
|
|
|
GEN_VXFORM_DUAL(vcipher, vcipherlast, 4, 20, PPC_NONE, PPC2_ALTIVEC_207),
|
|
|
|
GEN_VXFORM_DUAL(vncipher, vncipherlast, 4, 21, PPC_NONE, PPC2_ALTIVEC_207),
|
|
|
|
|
|
|
|
GEN_VXFORM_207(vshasigmaw, 1, 26),
|
|
|
|
GEN_VXFORM_207(vshasigmad, 1, 27),
|
|
|
|
|
|
|
|
GEN_VXFORM_DUAL(vsldoi, vpermxor, 22, 0xFF, PPC_ALTIVEC, PPC_NONE),
|