mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 04:29:13 +12:00
[Shader JIT] Fix CMP instruction when cmpX == cmpY
This commit is contained in:
parent
4655ae0842
commit
b5dbc40587
1 changed files with 4 additions and 3 deletions
|
@ -557,10 +557,11 @@ void ShaderEmitter::recCMP(const PICAShader& shader, u32 instruction) {
|
||||||
// Cmp x and y are the same compare function, we can use a single cmp instruction
|
// Cmp x and y are the same compare function, we can use a single cmp instruction
|
||||||
if (cmpX == cmpY) {
|
if (cmpX == cmpY) {
|
||||||
cmpps(lhs_x, rhs_x, compareFuncX);
|
cmpps(lhs_x, rhs_x, compareFuncX);
|
||||||
movd(eax, lhs_x);
|
movq(rax, lhs_x); // Move both comparison results to rax
|
||||||
test(eax, eax);
|
test(eax, eax); // Check bottom 32 bits first
|
||||||
|
setne(byte[statePointer + cmpRegXOffset]); // set cmp.x
|
||||||
|
|
||||||
setne(byte[statePointer + cmpRegXOffset]);
|
shr(rax, 32); // Check top 32 bits (shr will set the zero flag properly)
|
||||||
setne(byte[statePointer + cmpRegYOffset]);
|
setne(byte[statePointer + cmpRegYOffset]);
|
||||||
} else {
|
} else {
|
||||||
movaps(scratch1, lhs_x); // Copy the left hand operands to temp registers
|
movaps(scratch1, lhs_x); // Copy the left hand operands to temp registers
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue