summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2014-12-15 23:48:39 -0500
committerGravatar Lioncash2014-12-16 00:11:51 -0500
commit4c537992290cf143bd9d4585c164698f1473376d (patch)
tree414799897babc4276ae706d76047d5c344818b04 /src
parentarmemu: Join QADD16 and QSUB16 together. (diff)
downloadyuzu-4c537992290cf143bd9d4585c164698f1473376d.tar.gz
yuzu-4c537992290cf143bd9d4585c164698f1473376d.tar.xz
yuzu-4c537992290cf143bd9d4585c164698f1473376d.zip
armemu: Fix lower-bound signed saturation clamping for QADD16/QSUB16.
Diffstat (limited to '')
-rw-r--r--src/core/arm/interpreter/armemu.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/arm/interpreter/armemu.cpp b/src/core/arm/interpreter/armemu.cpp
index 8ee8badd5..e46b4d15b 100644
--- a/src/core/arm/interpreter/armemu.cpp
+++ b/src/core/arm/interpreter/armemu.cpp
@@ -5867,12 +5867,12 @@ L_stm_s_takeabort:
5867 5867
5868 if (lo_result > 0x7FFF) 5868 if (lo_result > 0x7FFF)
5869 lo_result = 0x7FFF; 5869 lo_result = 0x7FFF;
5870 else if (lo_result < 0x7FFF) 5870 else if (lo_result < -0x8000)
5871 lo_result = -0x8000; 5871 lo_result = -0x8000;
5872 5872
5873 if (hi_result > 0x7FFF) 5873 if (hi_result > 0x7FFF)
5874 hi_result = 0x7FFF; 5874 hi_result = 0x7FFF;
5875 else if (hi_result < 0x7FFF) 5875 else if (hi_result < -0x8000)
5876 hi_result = -0x8000; 5876 hi_result = -0x8000;
5877 5877
5878 state->Reg[rd_idx] = (lo_result & 0xFFFF) | ((hi_result & 0xFFFF) << 16); 5878 state->Reg[rd_idx] = (lo_result & 0xFFFF) | ((hi_result & 0xFFFF) << 16);