summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorMullin <matyas.rama@gmail.com>2015-02-13 14:15:00 +0100
committerMullin <matyas.rama@gmail.com>2015-02-17 21:29:01 +0100
commit39aa2432a65e2f0fe8bd6bc6ebcaa3b4e2750835 (patch)
tree34763adbbe9ba93280ee8ae3f8eedbaa2ae1ade6 /Source/Core
parentdb690a18628ec492ed91b49623f717ea6c4640e5 (diff)
Fix signed/unsigned stores
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/PowerPC/JitArm32/JitAsm.cpp104
1 files changed, 100 insertions, 4 deletions
diff --git a/Source/Core/Core/PowerPC/JitArm32/JitAsm.cpp b/Source/Core/Core/PowerPC/JitArm32/JitAsm.cpp
index ff65bf6393..782a225d7e 100644
--- a/Source/Core/Core/PowerPC/JitArm32/JitAsm.cpp
+++ b/Source/Core/Core/PowerPC/JitArm32/JitAsm.cpp
@@ -399,7 +399,6 @@ void JitArmAsmRoutineManager::GenerateCommon()
POP(5, R0, R1, R2, R3, _PC);
}
const u8* storePairedU8 = GetCodePtr();
- const u8* storePairedS8 = GetCodePtr();
{
// R10 is the addr
// R11 is the scale
@@ -424,8 +423,32 @@ void JitArmAsmRoutineManager::GenerateCommon()
POP(5, R0, R1, R2, R3, _PC);
}
+ const u8* storePairedS8 = GetCodePtr();
+ {
+ // R10 is the addr
+ // R11 is the scale
+ // R12 is scratch
+ // S0, S1 is the values
+ PUSH(5, R0, R1, R2, R3, _LR);
+
+ MOVI2R(R12, (u32)&m_quantizeTableS);
+ ADD(R12, R12, R11);
+ VLDR(S2, R12, 0);
+ VMUL(S0, S0, S2);
+ VMUL(S1, S1, S2);
+
+ VCVT(S0, S0, TO_INT | ROUND_TO_ZERO | IS_SIGNED);
+ VCVT(S1, S1, TO_INT | ROUND_TO_ZERO | IS_SIGNED);
+
+ VMOV(R0, S0);
+ VMOV(R1, S1);
+ MOV(R2, R10);
+ MOVI2R(R12, (u32)&WriteDual8);
+ BL(R12);
+
+ POP(5, R0, R1, R2, R3, _PC);
+ }
const u8* storePairedU16 = GetCodePtr();
- const u8* storePairedS16 = GetCodePtr();
{
PUSH(5, R0, R1, R2, R3, _LR);
@@ -446,6 +469,27 @@ void JitArmAsmRoutineManager::GenerateCommon()
POP(5, R0, R1, R2, R3, _PC);
}
+ const u8* storePairedS16 = GetCodePtr();
+ {
+ PUSH(5, R0, R1, R2, R3, _LR);
+
+ MOVI2R(R12, (u32)&m_quantizeTableS);
+ ADD(R12, R12, R11);
+ VLDR(S2, R12, 0);
+ VMUL(S0, S0, S2);
+ VMUL(S1, S1, S2);
+
+ VCVT(S0, S0, TO_INT | ROUND_TO_ZERO | IS_SIGNED);
+ VCVT(S1, S1, TO_INT | ROUND_TO_ZERO | IS_SIGNED);
+
+ VMOV(R0, S0);
+ VMOV(R1, S1);
+ MOV(R2, R10);
+ MOVI2R(R12, (u32)&WriteDual16);
+ BL(R12);
+
+ POP(5, R0, R1, R2, R3, _PC);
+ }
const u8* storeSingleIllegal = GetCodePtr();
BKPT(0x27);
const u8* storeSingleFloat = GetCodePtr();
@@ -471,7 +515,6 @@ void JitArmAsmRoutineManager::GenerateCommon()
POP(5, R0, R1, R2, R3, _PC);
}
const u8* storeSingleU8 = GetCodePtr(); // Used by MKWii
- const u8* storeSingleS8 = GetCodePtr();
{
MOVI2R(R12, (u32)&m_quantizeTableS);
ADD(R12, R12, R11);
@@ -497,8 +540,33 @@ void JitArmAsmRoutineManager::GenerateCommon()
BL(R10);
POP(5, R0, R1, R2, R3, _PC);
}
+ const u8* storeSingleS8 = GetCodePtr();
+ {
+ MOVI2R(R12, (u32)&m_quantizeTableS);
+ ADD(R12, R12, R11);
+ VLDR(S2, R12, 0);
+ VMUL(S0, S0, S2);
+
+ TST(R10, arghmask);
+ FixupBranch argh = B_CC(CC_NEQ);
+ BIC(R10, R10, mask);
+ ADD(R10, R10, R8);
+
+ VCVT(S0, S0, TO_INT | ROUND_TO_ZERO | IS_SIGNED);
+ VMOV(R12, S0);
+ STRB(R12, R10);
+ MOV(_PC, _LR);
+
+ SetJumpTarget(argh);
+
+ PUSH(5, R0, R1, R2, R3, _LR);
+ VMOV(R0, S0);
+ MOV(R1, R10);
+ MOVI2R(R10, (u32)&Memory::Write_U8);
+ BL(R10);
+ POP(5, R0, R1, R2, R3, _PC);
+ }
const u8* storeSingleU16 = GetCodePtr(); // Used by MKWii
- const u8* storeSingleS16 = GetCodePtr();
{
MOVI2R(R12, (u32)&m_quantizeTableS);
ADD(R12, R12, R11);
@@ -526,6 +594,34 @@ void JitArmAsmRoutineManager::GenerateCommon()
POP(5, R0, R1, R2, R3, _PC);
}
+ const u8* storeSingleS16 = GetCodePtr();
+ {
+ MOVI2R(R12, (u32)&m_quantizeTableS);
+ ADD(R12, R12, R11);
+ VLDR(S2, R12, 0);
+ VMUL(S0, S0, S2);
+
+ TST(R10, arghmask);
+ FixupBranch argh = B_CC(CC_NEQ);
+ BIC(R10, R10, mask);
+ ADD(R10, R10, R8);
+
+ VCVT(S0, S0, TO_INT | ROUND_TO_ZERO | IS_SIGNED);
+ VMOV(R12, S0);
+ REV16(R12, R12);
+ STRH(R12, R10);
+ MOV(_PC, _LR);
+
+ SetJumpTarget(argh);
+
+ PUSH(5, R0, R1, R2, R3, _LR);
+ VMOV(R0, S0);
+ MOV(R1, R10);
+ MOVI2R(R10, (u32)&Memory::Write_U16);
+ BL(R10);
+
+ POP(5, R0, R1, R2, R3, _PC);
+ }
pairedStoreQuantized = reinterpret_cast<const u8**>(const_cast<u8*>(AlignCode16()));
ReserveCodeSpace(16 * sizeof(u8*));