From 24f6c98a553467427d035c6c36df57ca889142e3 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Wed, 10 Sep 2014 17:52:54 -0500 Subject: [PATCH] Add sign extending aliases to the ARM64Emitter. --- Source/Core/Common/Arm64Emitter.cpp | 14 ++++++++++++++ Source/Core/Common/Arm64Emitter.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/Source/Core/Common/Arm64Emitter.cpp b/Source/Core/Common/Arm64Emitter.cpp index d0a0352df2..3db7b2587a 100644 --- a/Source/Core/Common/Arm64Emitter.cpp +++ b/Source/Core/Common/Arm64Emitter.cpp @@ -1081,6 +1081,20 @@ void ARM64XEmitter::UBFM(ARM64Reg Rd, ARM64Reg Rn, u32 immr, u32 imms) { EncodeBitfieldMOVInst(2, Rd, Rn, immr, imms); } +void ARM64XEmitter::SXTB(ARM64Reg Rd, ARM64Reg Rn) +{ + SBFM(Rd, Rn, 0, 7); +} +void ARM64XEmitter::SXTH(ARM64Reg Rd, ARM64Reg Rn) +{ + SBFM(Rd, Rn, 0, 15); +} +void ARM64XEmitter::SXTW(ARM64Reg Rd, ARM64Reg Rn) +{ + _assert_msg_(DYNA_REC, Is64Bit(Rd), "%s requires 64bit register as destination", __FUNCTION__); + + SBFM(Rd, Rn, 0, 31); +} // Load Register (Literal) void ARM64XEmitter::LDR(ARM64Reg Rt, u32 imm) diff --git a/Source/Core/Common/Arm64Emitter.h b/Source/Core/Common/Arm64Emitter.h index 145081f9ff..a60b453fdc 100644 --- a/Source/Core/Common/Arm64Emitter.h +++ b/Source/Core/Common/Arm64Emitter.h @@ -477,6 +477,9 @@ public: void BFM(ARM64Reg Rd, ARM64Reg Rn, u32 immr, u32 imms); void SBFM(ARM64Reg Rd, ARM64Reg Rn, u32 immr, u32 imms); void UBFM(ARM64Reg Rd, ARM64Reg Rn, u32 immr, u32 imms); + void SXTB(ARM64Reg Rd, ARM64Reg Rn); + void SXTH(ARM64Reg Rd, ARM64Reg Rn); + void SXTW(ARM64Reg Rd, ARM64Reg Rn); // Load Register (Literal) void LDR(ARM64Reg Rt, u32 imm);