backend/x64: Temporarily avoid use of DefineValue(Argument&)

Issues with inappropriate values in upper bits of values
This commit is contained in:
Merry 2020-06-27 10:51:10 +01:00
parent 337498823c
commit b1ff971a92
3 changed files with 33 additions and 17 deletions

View file

@ -212,7 +212,11 @@ void EmitX64::EmitSignedSaturation(EmitContext& ctx, IR::Inst* inst) {
const auto no_overflow = IR::Value(false);
overflow_inst->ReplaceUsesWith(no_overflow);
}
ctx.reg_alloc.DefineValue(inst, args[0]);
// TODO: DefineValue directly on Argument
const Xbyak::Reg64 result = ctx.reg_alloc.ScratchGpr();
const Xbyak::Reg64 source = ctx.reg_alloc.UseGpr(args[0]);
code.mov(result.cvt32(), source.cvt32());
ctx.reg_alloc.DefineValue(inst, result);
return;
}