summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2015-08-23 11:22:46 +0200
committerdegasus <wickmarkus@web.de>2015-08-23 23:28:28 +0200
commit025e7c835ab310119ee1a4e7c5505459efe29258 (patch)
tree291189877c5fa270e7677a74d71e7206a3493612 /Source/Core
parent550a90e69197619fe858b95f61e3944008f09ba5 (diff)
JitArm64: Implement subfcx
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/PowerPC/JitArm64/Jit.h1
-rw-r--r--Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp32
-rw-r--r--Source/Core/Core/PowerPC/JitArm64/JitArm64_Tables.cpp4
3 files changed, 35 insertions, 2 deletions
diff --git a/Source/Core/Core/PowerPC/JitArm64/Jit.h b/Source/Core/Core/PowerPC/JitArm64/Jit.h
index 9d44f967ef..6022e9eb64 100644
--- a/Source/Core/Core/PowerPC/JitArm64/Jit.h
+++ b/Source/Core/Core/PowerPC/JitArm64/Jit.h
@@ -100,6 +100,7 @@ public:
void slwx(UGeckoInstruction inst);
void rlwimix(UGeckoInstruction inst);
void subfex(UGeckoInstruction inst);
+ void subfcx(UGeckoInstruction inst);
// System Registers
void mtmsr(UGeckoInstruction inst);
diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp
index 937bd07f3d..8c27c56ad8 100644
--- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp
+++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp
@@ -784,6 +784,38 @@ void JitArm64::subfex(UGeckoInstruction inst)
ComputeRC(gpr.R(d), 0);
}
+void JitArm64::subfcx(UGeckoInstruction inst)
+{
+ INSTRUCTION_START
+ JITDISABLE(bJITIntegerOff);
+ FALLBACK_IF(inst.OE);
+
+ int a = inst.RA, b = inst.RB, d = inst.RD;
+
+ if (gpr.IsImm(a) && gpr.IsImm(b))
+ {
+ u32 a_imm = gpr.GetImm(a), b_imm = gpr.GetImm(b);
+
+ gpr.SetImmediate(d, b_imm - a_imm);
+ ComputeCarry(a_imm == 0 || Interpreter::Helper_Carry(b_imm, 0u - a_imm));
+
+ if (inst.Rc)
+ ComputeRC(gpr.GetImm(d), 0);
+ }
+ else
+ {
+ gpr.BindToRegister(d, d == a || d == b);
+
+ // d = b - a
+ SUBS(gpr.R(d), gpr.R(b), gpr.R(a));
+
+ ComputeCarry();
+
+ if (inst.Rc)
+ ComputeRC(gpr.R(d), 0);
+ }
+}
+
void JitArm64::addcx(UGeckoInstruction inst)
{
INSTRUCTION_START
diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Tables.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Tables.cpp
index 7b3327706e..6111e33e5a 100644
--- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Tables.cpp
+++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Tables.cpp
@@ -192,8 +192,8 @@ static GekkoOPTemplate table31[] =
{616, &JitArm64::negx}, // negox
{40, &JitArm64::subfx}, // subfx
{552, &JitArm64::subfx}, // subfox
- {8, &JitArm64::FallBackToInterpreter}, // subfcx
- {520, &JitArm64::FallBackToInterpreter}, // subfcox
+ {8, &JitArm64::subfcx}, // subfcx
+ {520, &JitArm64::subfcx}, // subfcox
{136, &JitArm64::subfex}, // subfex
{648, &JitArm64::subfex}, // subfeox
{232, &JitArm64::FallBackToInterpreter}, // subfmex