From b115cd7320dec89f9f6aee07eee7a79198980285 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 12 Feb 2013 18:53:04 +0100 Subject: [PATCH] VMOV gpr->fpu, fixes --- Common/ArmEmitter.cpp | 17 +++++++++++++++-- Common/ArmEmitter.h | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Common/ArmEmitter.cpp b/Common/ArmEmitter.cpp index 779d6a376..0b05c2a1c 100644 --- a/Common/ArmEmitter.cpp +++ b/Common/ArmEmitter.cpp @@ -621,16 +621,18 @@ ARMReg ARMXEmitter::SubBase(ARMReg Reg) // NEON Specific void ARMXEmitter::VADD(IntegerSize Size, ARMReg Vd, ARMReg Vn, ARMReg Vm) { - _assert_msg_(DYNA_REC, Vd >= Q0, "Pass invalid register to VADD(integer)"); + _assert_msg_(DYNA_REC, Vd >= D0, "Pass invalid register to VADD(integer)"); _assert_msg_(DYNA_REC, cpu_info.bNEON, "Can't use VADD(integer) when CPU doesn't support it"); + bool register_quad = Vd >= Q0; + // Gets encoded as a double register Vd = SubBase(Vd); Vn = SubBase(Vn); Vm = SubBase(Vm); Write32((0xF2 << 24) | ((Vd & 0x10) << 18) | (Size << 20) | ((Vn & 0xF) << 16) \ - | ((Vd & 0xF) << 12) | (0x8 << 8) | ((Vn & 0x10) << 3) | (1 << 6) \ + | ((Vd & 0xF) << 12) | (0x8 << 8) | ((Vn & 0x10) << 3) | (register_quad << 6) \ | ((Vm & 0x10) << 2) | (Vm & 0xF)); } @@ -896,6 +898,17 @@ void ARMXEmitter::VMUL(ARMReg Vd, ARMReg Vn, ARMReg Vm) } } +void ARMXEmitter::VMOV(ARMReg Dest, ARMReg Src, bool high) +{ + _assert_msg_(DYNA_REC, Src < S0, "This VMOV doesn't support SRC other than ARM Reg"); + _assert_msg_(DYNA_REC, Dest >= D0, "This VMOV doesn't support DEST other than VFP"); + + Dest = SubBase(Dest); + + Write32(NO_COND | (0xE << 24) | (high << 21) | ((Dest & 0xF) << 16) | (Src << 12) \ + | (11 << 8) | ((Dest & 0x10) << 3) | (1 << 4)); +} + void ARMXEmitter::VMOV(ARMReg Dest, ARMReg Src) { if (Dest > R15) diff --git a/Common/ArmEmitter.h b/Common/ArmEmitter.h index 236dde11f..b50179bf5 100644 --- a/Common/ArmEmitter.h +++ b/Common/ArmEmitter.h @@ -511,6 +511,7 @@ public: void VADD(ARMReg Vd, ARMReg Vn, ARMReg Vm); void VSUB(ARMReg Vd, ARMReg Vn, ARMReg Vm); void VMUL(ARMReg Vd, ARMReg Vn, ARMReg Vm); + void VMOV(ARMReg Dest, ARMReg Src, bool high); void VMOV(ARMReg Dest, ARMReg Src); void QuickCallFunction(ARMReg scratchreg, void *func);