mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-12-11 23:53:55 +00:00
Implement clz/clo in x86 jit.
This commit is contained in:
parent
e27ab6fa11
commit
654490566f
@ -172,11 +172,43 @@ namespace MIPSComp
|
||||
switch (op & 63)
|
||||
{
|
||||
case 22: //clz
|
||||
DISABLE;
|
||||
break;
|
||||
{
|
||||
gpr.Lock(rd, rs);
|
||||
gpr.BindToRegister(rd, rd == rs, true);
|
||||
BSR(32, EAX, gpr.R(rs));
|
||||
FixupBranch notFound = J_CC(CC_Z);
|
||||
|
||||
MOV(32, gpr.R(rd), Imm32(31));
|
||||
SUB(32, gpr.R(rd), R(EAX));
|
||||
FixupBranch skip = J();
|
||||
|
||||
SetJumpTarget(notFound);
|
||||
MOV(32, gpr.R(rd), Imm32(32));
|
||||
|
||||
SetJumpTarget(skip);
|
||||
gpr.UnlockAll();
|
||||
break;
|
||||
}
|
||||
case 23: //clo
|
||||
DISABLE;
|
||||
break;
|
||||
{
|
||||
gpr.Lock(rd, rs);
|
||||
gpr.BindToRegister(rd, rd == rs, true);
|
||||
MOV(32, R(EAX), gpr.R(rs));
|
||||
NOT(32, R(EAX));
|
||||
BSR(32, EAX, R(EAX));
|
||||
FixupBranch notFound = J_CC(CC_Z);
|
||||
|
||||
MOV(32, gpr.R(rd), Imm32(31));
|
||||
SUB(32, gpr.R(rd), R(EAX));
|
||||
FixupBranch skip = J();
|
||||
|
||||
SetJumpTarget(notFound);
|
||||
MOV(32, gpr.R(rd), Imm32(32));
|
||||
|
||||
SetJumpTarget(skip);
|
||||
gpr.UnlockAll();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
DISABLE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user