Merge pull request #4441 from unknownbrackets/vertex-decoder-jit

Force 5 byte jumps to avoid jump target issues (vertex jit, x86)
This commit is contained in:
Henrik Rydgård committed 2013-11-04 01:25:40 -08:00
commit 5886ccffdc
2 files changed
+4 -6

No files matched your search

+1 -3
View File
@@ -1081,9 +1081,7 @@ u32 TransformDrawEngine::ComputeHash() {
}
}
if (uvScale) {
for (int i = 0; i < numDrawCalls; i++) {
fullhash += XXH32(&uvScale[i], sizeof(uvScale[0]), 0x0123e658);
}
fullhash += XXH32(&uvScale[0], sizeof(uvScale[0]) * numDrawCalls, 0x0123e658);
}
return fullhash;
+3 -3
View File
@@ -1196,7 +1196,7 @@ JittedVertexDecoder VertexDecoderJitCache::Compile(const VertexDecoder &dec) {
ADD(32, R(dstReg), Imm32(dec.decFmt.stride));
#endif
SUB(32, R(counterReg), Imm8(1));
J_CC(CC_NZ, loopStart);
J_CC(CC_NZ, loopStart, true);
#ifdef _M_IX86
// Restore register values
@@ -1317,7 +1317,7 @@ void VertexDecoderJitCache::Jit_Color4444() {
// tempReg1 -> ABGR0000, then double A backwards.
SHL(32, R(tempReg1), Imm8(8));
MOV(32, R(tempReg3), R(tempReg1));
AND(32, R(tempReg3), Imm32(0xF000000));
AND(32, R(tempReg3), Imm32(0xF0000000));
OR(32, R(tempReg2), R(tempReg3));
SHR(32, R(tempReg3), Imm8(4));
OR(32, R(tempReg2), R(tempReg3));
@@ -1345,7 +1345,7 @@ void VertexDecoderJitCache::Jit_Color565() {
AND(32, R(tempReg2), Imm32(0x00FF00FF));
// Now's as good a time to put in A as any.
OR(32, R(tempReg2), Imm8(0xFF000000));
OR(32, R(tempReg2), Imm32(0xFF000000));
// Last, we need to align, extract, and expand G.
// 3 to align to G, and then 2 to expand to 8.