CPU/Recompiler: Emit test/jz instead of bt/jnc for bits < 8
Likely very slightly faster.
This commit is contained in:
parent
55a2c73097
commit
b00f50c927
|
@ -1990,6 +1990,33 @@ void CodeGenerator::EmitConditionalBranch(Condition condition, bool invert, Labe
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeGenerator::EmitBranchIfBitClear(HostReg reg, RegSize size, u8 bit, LabelType* label)
|
void CodeGenerator::EmitBranchIfBitClear(HostReg reg, RegSize size, u8 bit, LabelType* label)
|
||||||
|
{
|
||||||
|
if (bit < 8)
|
||||||
|
{
|
||||||
|
// same size, probably faster
|
||||||
|
switch (size)
|
||||||
|
{
|
||||||
|
case RegSize_8:
|
||||||
|
m_emit->test(GetHostReg8(reg), (1u << bit));
|
||||||
|
m_emit->jz(*label);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RegSize_16:
|
||||||
|
m_emit->test(GetHostReg16(reg), (1u << bit));
|
||||||
|
m_emit->jz(*label);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RegSize_32:
|
||||||
|
m_emit->test(GetHostReg32(reg), (1u << bit));
|
||||||
|
m_emit->jz(*label);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
UnreachableCode();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
switch (size)
|
switch (size)
|
||||||
{
|
{
|
||||||
|
@ -2013,6 +2040,7 @@ void CodeGenerator::EmitBranchIfBitClear(HostReg reg, RegSize size, u8 bit, Labe
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CodeGenerator::EmitBindLabel(LabelType* label)
|
void CodeGenerator::EmitBindLabel(LabelType* label)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue