diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2011-02-10 19:07:55 +0000 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2011-02-20 17:26:15 +0100 |
commit | e5ca24cba969b58eb3fe0e7c239df3abe21831c0 (patch) | |
tree | cbbfbf6bee61639a216efdc058425bb982b3e460 /target-arm/neon_helper.c | |
parent | 02615337ef295443daa03233e492194e289a807e (diff) |
target-arm: Implement VMULL.P8
Implement VMULL.P8 (the 32x32->64 version of the polynomial multiply
instruction).
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'target-arm/neon_helper.c')
-rw-r--r-- | target-arm/neon_helper.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/target-arm/neon_helper.c b/target-arm/neon_helper.c index dc09968c86..ee253bbd2e 100644 --- a/target-arm/neon_helper.c +++ b/target-arm/neon_helper.c @@ -895,6 +895,36 @@ uint32_t HELPER(neon_mul_p8)(uint32_t op1, uint32_t op2) return result; } +uint64_t HELPER(neon_mull_p8)(uint32_t op1, uint32_t op2) +{ + uint64_t result = 0; + uint64_t mask; + uint64_t op2ex = op2; + op2ex = (op2ex & 0xff) | + ((op2ex & 0xff00) << 8) | + ((op2ex & 0xff0000) << 16) | + ((op2ex & 0xff000000) << 24); + while (op1) { + mask = 0; + if (op1 & 1) { + mask |= 0xffff; + } + if (op1 & (1 << 8)) { + mask |= (0xffffU << 16); + } + if (op1 & (1 << 16)) { + mask |= (0xffffULL << 32); + } + if (op1 & (1 << 24)) { + mask |= (0xffffULL << 48); + } + result ^= op2ex & mask; + op1 = (op1 >> 1) & 0x7f7f7f7f; + op2ex <<= 1; + } + return result; +} + #define NEON_FN(dest, src1, src2) dest = (src1 & src2) ? -1 : 0 NEON_VOP(tst_u8, neon_u8, 4) NEON_VOP(tst_u16, neon_u16, 2) |