mirror of
https://github.com/PabloMK7/citra.git
synced 2025-09-09 04:10:05 +00:00
shader_jit_x64: Fix conditional evaluation extended-bit hazard
The unit test seems to have identified a bug in the x64 jit too. The x64 jit was doing 32-bit comparisons despite the condition flags being 8-bit values and is sensitive to garbage being in the upper 24 bits of the register. This is fixed by using the proper 8-bit register types rather than the 32-bit ones(`eax,`ebx` -> `al`, `bl`).
This commit is contained in:
parent
e99f7da24e
commit
a510de0e4c
1 changed files with 14 additions and 14 deletions
|
@ -401,29 +401,29 @@ void JitShader::Compile_EvaluateCondition(Instruction instr) {
|
||||||
// Note: NXOR is used below to check for equality
|
// Note: NXOR is used below to check for equality
|
||||||
switch (instr.flow_control.op) {
|
switch (instr.flow_control.op) {
|
||||||
case Instruction::FlowControlType::Or:
|
case Instruction::FlowControlType::Or:
|
||||||
mov(eax, COND0);
|
mov(al, COND0.cvt8());
|
||||||
mov(ebx, COND1);
|
mov(bl, COND1.cvt8());
|
||||||
xor_(eax, (instr.flow_control.refx.Value() ^ 1));
|
xor_(al, (instr.flow_control.refx.Value() ^ 1));
|
||||||
xor_(ebx, (instr.flow_control.refy.Value() ^ 1));
|
xor_(bl, (instr.flow_control.refy.Value() ^ 1));
|
||||||
or_(eax, ebx);
|
or_(al, bl);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Instruction::FlowControlType::And:
|
case Instruction::FlowControlType::And:
|
||||||
mov(eax, COND0);
|
mov(al, COND0);
|
||||||
mov(ebx, COND1);
|
mov(bl, COND1);
|
||||||
xor_(eax, (instr.flow_control.refx.Value() ^ 1));
|
xor_(al, (instr.flow_control.refx.Value() ^ 1));
|
||||||
xor_(ebx, (instr.flow_control.refy.Value() ^ 1));
|
xor_(bl, (instr.flow_control.refy.Value() ^ 1));
|
||||||
and_(eax, ebx);
|
and_(al, bl);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Instruction::FlowControlType::JustX:
|
case Instruction::FlowControlType::JustX:
|
||||||
mov(eax, COND0);
|
mov(al, COND0);
|
||||||
xor_(eax, (instr.flow_control.refx.Value() ^ 1));
|
xor_(al, (instr.flow_control.refx.Value() ^ 1));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Instruction::FlowControlType::JustY:
|
case Instruction::FlowControlType::JustY:
|
||||||
mov(eax, COND1);
|
mov(al, COND1);
|
||||||
xor_(eax, (instr.flow_control.refy.Value() ^ 1));
|
xor_(al, (instr.flow_control.refy.Value() ^ 1));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue