Patchwork [3/5] ARM: Fix VQSHL of signed 64 bit values by shift counts >= 64

login
register
mail settings
Submitter Peter Maydell
Date Dec. 7, 2010, 2:13 p.m.
Message ID <1291731225-3155-4-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/74549/
State New
Headers show

Comments

Peter Maydell - Dec. 7, 2010, 2:13 p.m.
VQSHL of a signed 64 bit non-zero value by a shift count >= 64 should
saturate; return the correct value in this case.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/neon_helper.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/target-arm/neon_helper.c b/target-arm/neon_helper.c
index d29b884..2dc3d96 100644
--- a/target-arm/neon_helper.c
+++ b/target-arm/neon_helper.c
@@ -608,7 +608,7 @@  uint64_t HELPER(neon_qshl_s64)(CPUState *env, uint64_t valop, uint64_t shiftop)
     if (shift >= 64) {
         if (val) {
             SET_QC();
-            val = (val >> 63) & ~SIGNBIT64;
+            val = (val >> 63) ^ ~SIGNBIT64;
         }
     } else if (shift <= -64) {
         val >>= 63;