summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2014-12-20 21:18:05 +0100
committerbunnei <bunneidev@gmail.com>2014-12-20 21:18:05 +0100
commit1c50a036ddfedf92306c895eff091a306f53785e (patch)
tree6a3373f4211755dfae54b43b46def15b6319dc4b /src/core
parentMerge pull request #284 from neobrain/pica_progress (diff)
parentarmemu: Implement QASX and QSAX (diff)
downloadyuzu-1c50a036ddfedf92306c895eff091a306f53785e.tar
yuzu-1c50a036ddfedf92306c895eff091a306f53785e.tar.gz
yuzu-1c50a036ddfedf92306c895eff091a306f53785e.tar.bz2
yuzu-1c50a036ddfedf92306c895eff091a306f53785e.tar.lz
yuzu-1c50a036ddfedf92306c895eff091a306f53785e.tar.xz
yuzu-1c50a036ddfedf92306c895eff091a306f53785e.tar.zst
yuzu-1c50a036ddfedf92306c895eff091a306f53785e.zip
Diffstat (limited to '')
-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:
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);
@@ -5895,15 +5897,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;