Message ID | 7d5786fe88c6fb3555cb4c24846d7cfae97994ae.1269617187.git.riku.voipio@nokia.com |
---|---|
State | New |
Headers | show |
diff --git a/target-arm/neon_helper.c b/target-arm/neon_helper.c index 4604698..910f84a 100644 --- a/target-arm/neon_helper.c +++ b/target-arm/neon_helper.c @@ -1183,9 +1183,13 @@ uint32_t HELPER(neon_narrow_sat_u32)(CPUState *env, uint64_t x) uint32_t HELPER(neon_narrow_sat_s32)(CPUState *env, uint64_t x) { - if ((int64_t)x != (int32_t)x) { + if ((int64_t)x < -2147483648ll) { SET_QC(); - return (x >> 63) ^ 0x7fffffff; + return 0x80000000; + } + if ((int64_t)x > 2147483647ll) { + SET_QC(); + return 0x7fffffff; } return x; }