summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 63cfd03c6..c0406943e 100644
--- a/src/core/arm/interpreter/armemu.cpp
+++ b/src/core/arm/interpreter/armemu.cpp
@@ -5882,8 +5882,10 @@ L_stm_s_takeabort:
5882 printf("Unhandled v6 insn: %08x", BITS(20, 27)); 5882 printf("Unhandled v6 insn: %08x", BITS(20, 27));
5883 } 5883 }
5884 break; 5884 break;
5885 case 0x62: // QSUB16 and QADD16 5885 case 0x62: // QADD16, QASX, QSAX, and QSUB16
5886 if ((instr & 0xFF0) == 0xf70 || (instr & 0xFF0) == 0xf10) { 5886 if ((instr & 0xFF0) == 0xf10 || (instr & 0xFF0) == 0xf30 ||
5887 (instr & 0xFF0) == 0xf50 || (instr & 0xFF0) == 0xf70)
5888 {
5887 const u8 rd_idx = BITS(12, 15); 5889 const u8 rd_idx = BITS(12, 15);
5888 const u8 rn_idx = BITS(16, 19); 5890 const u8 rn_idx = BITS(16, 19);
5889 const u8 rm_idx = BITS(0, 3); 5891 const u8 rm_idx = BITS(0, 3);
@@ -5895,15 +5897,26 @@ L_stm_s_takeabort:
5895 s32 lo_result; 5897 s32 lo_result;
5896 s32 hi_result; 5898 s32 hi_result;
5897 5899
5900 // QADD16
5901 if ((instr & 0xFF0) == 0xf10) {
5902 lo_result = (rn_lo + rm_lo);
5903 hi_result = (rn_hi + rm_hi);
5904 }
5905 // QASX
5906 else if ((instr & 0xFF0) == 0xf30) {
5907 lo_result = (rn_lo - rm_hi);
5908 hi_result = (rn_hi + rm_lo);
5909 }
5910 // QSAX
5911 else if ((instr & 0xFF0) == 0xf50) {
5912 lo_result = (rn_lo + rm_hi);
5913 hi_result = (rn_hi - rm_lo);
5914 }
5898 // QSUB16 5915 // QSUB16
5899 if ((instr & 0xFF0) == 0xf70) { 5916 else {
5900 lo_result = (rn_lo - rm_lo); 5917 lo_result = (rn_lo - rm_lo);
5901 hi_result = (rn_hi - rm_hi); 5918 hi_result = (rn_hi - rm_hi);
5902 } 5919 }
5903 else { // QADD16
5904 lo_result = (rn_lo + rm_lo);
5905 hi_result = (rn_hi + rm_hi);
5906 }
5907 5920
5908 if (lo_result > 0x7FFF) 5921 if (lo_result > 0x7FFF)
5909 lo_result = 0x7FFF; 5922 lo_result = 0x7FFF;