emit_x64_floating_point: Fix EmitFPU64ToDouble for TowardsMinusInfinity rounding mode

This commit is contained in:
MerryMage 2018-07-14 07:08:44 +01:00
parent a2eb9a02e0
commit 0b97e9bd8d

View file

@ -1112,6 +1112,9 @@ void EmitX64::EmitFPU64ToDouble(EmitContext& ctx, IR::Inst* inst) {
code.subpd(tmp, code.MConst(xword, 0x4330000000000000, 0x4530000000000000));
code.pshufd(result, tmp, 0b01001110);
code.addpd(result, tmp);
if (ctx.FPSCR_RMode() == FP::RoundingMode::TowardsMinusInfinity) {
code.pand(result, code.MConst(xword, f64_non_sign_mask));
}
}
ctx.reg_alloc.DefineValue(inst, result);