emit_x64_data_processing: Exclude edge case from lea path in EmitSub
-0xffff'ffff'8000'0000 = 0x0000'0000'8000'0000 which is not a representable displacement
This commit is contained in:
parent
24bf921ff9
commit
75235ffedb
1 changed files with 1 additions and 1 deletions
|
@ -1014,7 +1014,7 @@ static void EmitSub(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst, int bit
|
||||||
const bool is_cmp = inst->UseCount() == size_t(!!carry_inst + !!overflow_inst + !!nzcv_inst) && carry_in.IsImmediate() && carry_in.GetImmediateU1();
|
const bool is_cmp = inst->UseCount() == size_t(!!carry_inst + !!overflow_inst + !!nzcv_inst) && carry_in.IsImmediate() && carry_in.GetImmediateU1();
|
||||||
|
|
||||||
// Consider using LEA.
|
// Consider using LEA.
|
||||||
if (!carry_inst && !overflow_inst && !nzcv_inst && carry_in.IsImmediate() && carry_in.GetImmediateU1() && args[1].IsImmediate() && args[1].FitsInImmediateS32()) {
|
if (!carry_inst && !overflow_inst && !nzcv_inst && carry_in.IsImmediate() && carry_in.GetImmediateU1() && args[1].IsImmediate() && args[1].FitsInImmediateS32() && args[1].GetImmediateS32() != 0xffff'ffff'8000'0000) {
|
||||||
const Xbyak::Reg op1 = ctx.reg_alloc.UseGpr(args[0]).changeBit(bitsize);
|
const Xbyak::Reg op1 = ctx.reg_alloc.UseGpr(args[0]).changeBit(bitsize);
|
||||||
const Xbyak::Reg result = ctx.reg_alloc.ScratchGpr().changeBit(bitsize);
|
const Xbyak::Reg result = ctx.reg_alloc.ScratchGpr().changeBit(bitsize);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue