summaryrefslogtreecommitdiff
path: root/Source/Core/Common/ArmEmitter.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2014-11-18 12:51:03 +1100
committerskidau <skidau@gmail.com>2014-11-18 12:51:03 +1100
commit2affe2519129834cfa26d3a150c9620a76543388 (patch)
tree24758850f330c67d537a1229778d7125127b821d /Source/Core/Common/ArmEmitter.cpp
parentdced84d4404b1f0346297c5941bfdf94cfdef4d5 (diff)
parent30e1749d004f78ff631baab3db93d61396cc9355 (diff)
Merge pull request #1559 from Sonicadvance1/armv7-minor-optimizations
ARMv7 block profiling + minor optimization
Diffstat (limited to 'Source/Core/Common/ArmEmitter.cpp')
-rw-r--r--Source/Core/Common/ArmEmitter.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/Core/Common/ArmEmitter.cpp b/Source/Core/Common/ArmEmitter.cpp
index dda13cb4c1..15ef41044b 100644
--- a/Source/Core/Common/ArmEmitter.cpp
+++ b/Source/Core/Common/ArmEmitter.cpp
@@ -388,6 +388,28 @@ void ARMXEmitter::YIELD()
Write32(condition | 0x0320F001);
}
+void ARMXEmitter::MRC(u32 coproc, u32 opc1, ARMReg Rt, u32 CRn, u32 CRm, u32 opc2)
+{
+ _assert_msg_(DYNA_REC, coproc <= 0xF, "%s has co-processor that is %d when it must be under 16!", __FUNCTION__, coproc);
+ _assert_msg_(DYNA_REC, opc1 <= 7, "%s has opc1 that is %d when it must be under 8!", __FUNCTION__, opc1);
+ _assert_msg_(DYNA_REC, CRn <= 0xF, "%s has CRn that is %d when it must be under 16!", __FUNCTION__, CRn);
+ _assert_msg_(DYNA_REC, opc2 <= 7, "%s has opc2 that is %d when it must be under 8!", __FUNCTION__, opc2);
+
+ Write32(condition | (0b1110 << 24) | (opc1 << 21) | (1 << 20) | (CRn << 16) \
+ | (Rt << 12) | (coproc << 8) | (opc2 << 5) | (1 << 4) | CRm);
+}
+
+void ARMXEmitter::MCR(u32 coproc, u32 opc1, ARMReg Rt, u32 CRn, u32 CRm, u32 opc2)
+{
+ _assert_msg_(DYNA_REC, coproc <= 0xF, "%s has co-processor that is %d when it must be under 16!", __FUNCTION__, coproc);
+ _assert_msg_(DYNA_REC, opc1 <= 7, "%s has opc1 that is %d when it must be under 8!", __FUNCTION__, opc1);
+ _assert_msg_(DYNA_REC, CRn <= 0xF, "%s has CRn that is %d when it must be under 16!", __FUNCTION__, CRn);
+ _assert_msg_(DYNA_REC, opc2 <= 7, "%s has opc2 that is %d when it must be under 8!", __FUNCTION__, opc2);
+
+ Write32(condition | (0b1110 << 24) | (opc1 << 21) | (CRn << 16) \
+ | (Rt << 12) | (coproc << 8) | (opc2 << 5) | (1 << 4) | CRm);
+}
+
FixupBranch ARMXEmitter::B()
{
FixupBranch branch;