summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2014-12-19 14:05:18 -0500
committerGravatar Lioncash2014-12-19 14:09:18 -0500
commit4b506cec017dab0244349780b70f53dc762d61f8 (patch)
treecb26ffc0e02df607f6954fbf5ea27b53f3bfb3d8
parentMerge pull request #302 from purpasmart96/flushshutup (diff)
downloadyuzu-4b506cec017dab0244349780b70f53dc762d61f8.tar.gz
yuzu-4b506cec017dab0244349780b70f53dc762d61f8.tar.xz
yuzu-4b506cec017dab0244349780b70f53dc762d61f8.zip
armemu: Implement QASX and QSAX
-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:
5885 printf("Unhandled v6 insn: %08x", BITS(20, 27)); 5885 printf("Unhandled v6 insn: %08x", BITS(20, 27));
5886 } 5886 }
5887 break; 5887 break;
5888 case 0x62: // QSUB16 and QADD16 5888 case 0x62: // QADD16, QASX, QSAX, and QSUB16
5889 if ((instr & 0xFF0) == 0xf70 || (instr & 0xFF0) == 0xf10) { 5889 if ((instr & 0xFF0) == 0xf10 || (instr & 0xFF0) == 0xf30 ||
5890 (instr & 0xFF0) == 0xf50 || (instr & 0xFF0) == 0xf70)
5891 {
5890 const u8 rd_idx = BITS(12, 15); 5892 const u8 rd_idx = BITS(12, 15);
5891 const u8 rn_idx = BITS(16, 19); 5893 const u8 rn_idx = BITS(16, 19);
5892 const u8 rm_idx = BITS(0, 3); 5894 const u8 rm_idx = BITS(0, 3);
@@ -5898,15 +5900,26 @@ L_stm_s_takeabort:
5898 s32 lo_result; 5900 s32 lo_result;
5899 s32 hi_result; 5901 s32 hi_result;
5900 5902
5903 // QADD16
5904 if ((instr & 0xFF0) == 0xf10) {
5905 lo_result = (rn_lo + rm_lo);
5906 hi_result = (rn_hi + rm_hi);
5907 }
5908 // QASX
5909 else if ((instr & 0xFF0) == 0xf30) {
5910 lo_result = (rn_lo - rm_hi);
5911 hi_result = (rn_hi + rm_lo);
5912 }
5913 // QSAX
5914 else if ((instr & 0xFF0) == 0xf50) {
5915 lo_result = (rn_lo + rm_hi);
5916 hi_result = (rn_hi - rm_lo);
5917 }
5901 // QSUB16 5918 // QSUB16
5902 if ((instr & 0xFF0) == 0xf70) { 5919 else {
5903 lo_result = (rn_lo - rm_lo); 5920 lo_result = (rn_lo - rm_lo);
5904 hi_result = (rn_hi - rm_hi); 5921 hi_result = (rn_hi - rm_hi);
5905 } 5922 }
5906 else { // QADD16
5907 lo_result = (rn_lo + rm_lo);
5908 hi_result = (rn_hi + rm_hi);
5909 }
5910 5923
5911 if (lo_result > 0x7FFF) 5924 if (lo_result > 0x7FFF)
5912 lo_result = 0x7FFF; 5925 lo_result = 0x7FFF;