Skip to content

Commit

Permalink
Merge pull request #18026 from unknownbrackets/x86-jit-float
Browse files Browse the repository at this point in the history
x86jit: Fix vsat0 saturate
  • Loading branch information
hrydgard authored Aug 31, 2023
2 parents fbc1fc4 + bcac804 commit 351de6e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Core/MIPS/x86/X64IRCompFPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,14 +622,11 @@ void X64JitBackend::CompIR_FSat(IRInst inst) {

// Now for NAN, we want known first again.
// Unfortunately, this will retain -0.0, which we'll fix next.
XORPS(tempReg, R(tempReg));
XORPS(regs_.FX(inst.dest), regs_.F(inst.dest));
MAXSS(tempReg, regs_.F(inst.dest));

// Important: this should clamp -0.0 to +0.0.
XORPS(regs_.FX(inst.dest), regs_.F(inst.dest));
CMPEQSS(regs_.FX(inst.dest), R(tempReg));
// This will zero all bits if it was -0.0, and keep them otherwise.
ANDNPS(regs_.FX(inst.dest), R(tempReg));
ADDSS(regs_.FX(inst.dest), R(tempReg));
break;

case IROp::FSatMinus1_1:
Expand Down

0 comments on commit 351de6e

Please sign in to comment.