[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 38/48] target-arm: fix neon vrshl instruction
From: |
Riku Voipio |
Subject: |
[Qemu-devel] [PATCH 38/48] target-arm: fix neon vrshl instruction |
Date: |
Fri, 26 Mar 2010 16:06:58 +0000 |
From: Juha Riihimäki <address@hidden>
Signed-Off-By: Riku Voipio <address@hidden>
Signed-off-by: Juha Riihimäki <address@hidden>
---
target-arm/neon_helper.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/target-arm/neon_helper.c b/target-arm/neon_helper.c
index ec1964f..0df13f5 100644
--- a/target-arm/neon_helper.c
+++ b/target-arm/neon_helper.c
@@ -547,20 +547,33 @@ uint64_t HELPER(neon_rshl_s64)(uint64_t valop, uint64_t
shiftop)
}} while (0)
NEON_VOP(rshl_u8, neon_u8, 4)
NEON_VOP(rshl_u16, neon_u16, 2)
-NEON_VOP(rshl_u32, neon_u32, 1)
#undef NEON_FN
+uint32_t HELPER(neon_rshl_u32)(uint32_t val, uint32_t shiftop)
+{
+ int8_t shift = (int8_t)shiftop;
+ if (shift >= 32 || shift < -32) {
+ val = 0;
+ } else if (shift == -32) {
+ val >>= shift - 1;
+ } else if (shift < 0) {
+ val = ((uint64_t)val + (1 << (-1 - shift))) >> -shift;
+ } else {
+ val <<= shift;
+ }
+ return val;
+}
+
uint64_t HELPER(neon_rshl_u64)(uint64_t val, uint64_t shiftop)
{
int8_t shift = (uint8_t)shiftop;
- if (shift >= 64 || shift < 64) {
+ if (shift >= 64 || shift < -64) {
val = 0;
} else if (shift == -64) {
/* Rounding a 1-bit result just preserves that bit. */
val >>= 63;
} if (shift < 0) {
val = (val + ((uint64_t)1 << (-1 - shift))) >> -shift;
- val >>= -shift;
} else {
val <<= shift;
}
--
1.6.5
- [Qemu-devel] [PATCH 08/48] Cortex-A8 R2 support and trustzone, (continued)
- [Qemu-devel] [PATCH 08/48] Cortex-A8 R2 support and trustzone, Riku Voipio, 2010/03/26
- [Qemu-devel] [PATCH 06/48] Get rid of AREG1 and AREG2., Riku Voipio, 2010/03/26
- [Qemu-devel] [PATCH 07/48] Shrink tb_jmp_offset to two entries, the other two are never used., Riku Voipio, 2010/03/26
- [Qemu-devel] [PATCH 17/48] add multi-sd support, Riku Voipio, 2010/03/26
- [Qemu-devel] [PATCH 23/48] multi-mmc support in init call, Riku Voipio, 2010/03/26
- [Qemu-devel] [PATCH 01/48] arm-dis debug helper, Riku Voipio, 2010/03/26
- [Qemu-devel] [PATCH 18/48] make cursor grab optional, Riku Voipio, 2010/03/26
- [Qemu-devel] [PATCH 47/48] target-arm: fix neon vshll (shift < max), Riku Voipio, 2010/03/26
- [Qemu-devel] [PATCH 38/48] target-arm: fix neon vrshl instruction,
Riku Voipio <=
- [Qemu-devel] [PATCH 40/48] target-arm: fix neon v(r)sra instructions, Riku Voipio, 2010/03/26
- [Qemu-devel] [PATCH 39/48] target-arm: fix neon vrshr instruction, Riku Voipio, 2010/03/26
- [Qemu-devel] [PATCH 25/48] blizzard: fix for non-32bpp host displays, Riku Voipio, 2010/03/26
- [Qemu-devel] [PATCH 09/48] console change headers, Riku Voipio, 2010/03/26
- [Qemu-devel] [PATCH 48/48] usb: fix -usbdevice option handling with no parameters, Riku Voipio, 2010/03/26
- [Qemu-devel] [PATCH 46/48] target-arm: fix neon vrsqrts instruction, Riku Voipio, 2010/03/26
- [Qemu-devel] [PATCH 45/48] target-arm: fix neon vcvt fixed-point, Riku Voipio, 2010/03/26
- [Qemu-devel] [PATCH 43/48] target-arm: fix neon vq(r)dmulh.s16 instructions, Riku Voipio, 2010/03/26
- [Qemu-devel] [PATCH 42/48] target-arm: fix signed narrow 64->32 operation, Riku Voipio, 2010/03/26