diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2023-07-11 09:38:28 +0100 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2023-09-15 13:57:00 +0000 |
commit | a2c67342eed42f181aa123803bc246b8fad7d1d9 (patch) | |
tree | a679390884352c54f2c9e38d9604b8ac3df30f0b | |
parent | 25c304e93612b5a0ad75c55d43d596b6d3271aad (diff) | |
download | qemu-a2c67342eed42f181aa123803bc246b8fad7d1d9.zip qemu-a2c67342eed42f181aa123803bc246b8fad7d1d9.tar.gz qemu-a2c67342eed42f181aa123803bc246b8fad7d1d9.tar.bz2 |
target/ppc: Use clmul_16* routines
Use generic routines for 16-bit carry-less multiply.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r-- | target/ppc/int_helper.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index f45b24d..ebb2957 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -1437,6 +1437,14 @@ void helper_vpmsumb(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) } } +void helper_vpmsumh(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) +{ + for (int i = 0; i < 2; ++i) { + uint64_t aa = a->u64[i], bb = b->u64[i]; + r->u64[i] = clmul_16x2_even(aa, bb) ^ clmul_16x2_odd(aa, bb); + } +} + #define PMSUM(name, srcfld, trgfld, trgtyp) \ void helper_##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ { \ @@ -1457,7 +1465,6 @@ void helper_##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ } \ } -PMSUM(vpmsumh, u16, u32, uint32_t) PMSUM(vpmsumw, u32, u64, uint64_t) void helper_VPMSUMD(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) |