summaryrefslogtreecommitdiffstats
path: root/src/core/arm/interpreter/armemu.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2014-12-19 20:05:18 +0100
committerLioncash <mathew1800@gmail.com>2014-12-19 20:09:18 +0100
commit4b506cec017dab0244349780b70f53dc762d61f8 (patch)
treecb26ffc0e02df607f6954fbf5ea27b53f3bfb3d8 /src/core/arm/interpreter/armemu.cpp
parentMerge pull request #302 from purpasmart96/flushshutup (diff)
downloadyuzu-4b506cec017dab0244349780b70f53dc762d61f8.tar
yuzu-4b506cec017dab0244349780b70f53dc762d61f8.tar.gz
yuzu-4b506cec017dab0244349780b70f53dc762d61f8.tar.bz2
yuzu-4b506cec017dab0244349780b70f53dc762d61f8.tar.lz
yuzu-4b506cec017dab0244349780b70f53dc762d61f8.tar.xz
yuzu-4b506cec017dab0244349780b70f53dc762d61f8.tar.zst
yuzu-4b506cec017dab0244349780b70f53dc762d61f8.zip
Diffstat (limited to 'src/core/arm/interpreter/armemu.cpp')
-rw-r--r--src/core/arm/interpreter/armemu.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/core/arm/interpreter/armemu.cpp b/src/core/arm/interpreter/armemu.cpp
index 07d205755..bafeb024c 100644
--- a/src/core/arm/interpreter/armemu.cpp
+++ b/src/core/arm/interpreter/armemu.cpp
@@ -5885,8 +5885,10 @@ L_stm_s_takeabort:
printf("Unhandled v6 insn: %08x", BITS(20, 27));
}
break;
- case 0x62: // QSUB16 and QADD16
- if ((instr & 0xFF0) == 0xf70 || (instr & 0xFF0) == 0xf10) {
+ case 0x62: // QADD16, QASX, QSAX, and QSUB16
+ if ((instr & 0xFF0) == 0xf10 || (instr & 0xFF0) == 0xf30 ||
+ (instr & 0xFF0) == 0xf50 || (instr & 0xFF0) == 0xf70)
+ {
const u8 rd_idx = BITS(12, 15);
const u8 rn_idx = BITS(16, 19);
const u8 rm_idx = BITS(0, 3);
@@ -5898,15 +5900,26 @@ L_stm_s_takeabort:
s32 lo_result;
s32 hi_result;
+ // QADD16
+ if ((instr & 0xFF0) == 0xf10) {
+ lo_result = (rn_lo + rm_lo);
+ hi_result = (rn_hi + rm_hi);
+ }
+ // QASX
+ else if ((instr & 0xFF0) == 0xf30) {
+ lo_result = (rn_lo - rm_hi);
+ hi_result = (rn_hi + rm_lo);
+ }
+ // QSAX
+ else if ((instr & 0xFF0) == 0xf50) {
+ lo_result = (rn_lo + rm_hi);
+ hi_result = (rn_hi - rm_lo);
+ }
// QSUB16
- if ((instr & 0xFF0) == 0xf70) {
+ else {
lo_result = (rn_lo - rm_lo);
hi_result = (rn_hi - rm_hi);
}
- else { // QADD16
- lo_result = (rn_lo + rm_lo);
- hi_result = (rn_hi + rm_hi);
- }
if (lo_result > 0x7FFF)
lo_result = 0x7FFF;