emit_x64_data_processing: Reduce codesize of RotateRight32 for carry case
This commit is contained in:
parent
f77b98de36
commit
68088c277c
1 changed files with 3 additions and 15 deletions
|
@ -745,28 +745,16 @@ void EmitX64::EmitRotateRight32(EmitContext& ctx, IR::Inst* inst) {
|
|||
const Xbyak::Reg32 result = ctx.reg_alloc.UseScratchGpr(operand_arg).cvt32();
|
||||
const Xbyak::Reg8 carry = ctx.reg_alloc.UseScratchGpr(carry_arg).cvt8();
|
||||
|
||||
// TODO: Optimize
|
||||
Xbyak::Label end;
|
||||
|
||||
code.inLocalLabel();
|
||||
|
||||
// if (Rs & 0xFF == 0) goto end;
|
||||
code.test(code.cl, code.cl);
|
||||
code.jz(".end");
|
||||
code.jz(end);
|
||||
|
||||
code.and_(code.ecx, u32(0x1F));
|
||||
code.jz(".zero_1F");
|
||||
// if (Rs & 0x1F != 0) {
|
||||
code.ror(result, code.cl);
|
||||
code.setc(carry);
|
||||
code.jmp(".end");
|
||||
// } else {
|
||||
code.L(".zero_1F");
|
||||
code.bt(result, u8(31));
|
||||
code.setc(carry);
|
||||
// }
|
||||
code.L(".end");
|
||||
|
||||
code.outLocalLabel();
|
||||
code.L(end);
|
||||
|
||||
ctx.reg_alloc.DefineValue(carry_inst, carry);
|
||||
ctx.EraseInstruction(carry_inst);
|
||||
|
|
Loading…
Reference in a new issue