From d36728e532aac8f5df765fdfaf72ce185285d7b5 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 24 Sep 2023 07:04:14 -0700 Subject: [PATCH] x86jit: Load common float vals from constants. --- Core/MIPS/x86/X64IRCompSystem.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Core/MIPS/x86/X64IRCompSystem.cpp b/Core/MIPS/x86/X64IRCompSystem.cpp index c038eee02d..b544c06854 100644 --- a/Core/MIPS/x86/X64IRCompSystem.cpp +++ b/Core/MIPS/x86/X64IRCompSystem.cpp @@ -62,6 +62,20 @@ void X64JitBackend::CompIR_Basic(IRInst inst) { regs_.Map(inst); if (inst.constant == 0) { XORPS(regs_.FX(inst.dest), regs_.F(inst.dest)); + } else if (inst.constant == 0x7FFFFFFF) { + MOVSS(regs_.FX(inst.dest), M(constants.noSignMask)); // rip accessible + } else if (inst.constant == 0x80000000) { + MOVSS(regs_.FX(inst.dest), M(constants.signBitAll)); // rip accessible + } else if (inst.constant == 0x7F800000) { + MOVSS(regs_.FX(inst.dest), M(constants.positiveInfinity)); // rip accessible + } else if (inst.constant == 0x7FC00000) { + MOVSS(regs_.FX(inst.dest), M(constants.qNAN)); // rip accessible + } else if (inst.constant == 0x3F800000) { + MOVSS(regs_.FX(inst.dest), M(constants.positiveOnes)); // rip accessible + } else if (inst.constant == 0xBF800000) { + MOVSS(regs_.FX(inst.dest), M(constants.negativeOnes)); // rip accessible + } else if (inst.constant == 0x4EFFFFFF) { + MOVSS(regs_.FX(inst.dest), M(constants.maxIntBelowAsFloat)); // rip accessible } else { MOV(32, R(SCRATCH1), Imm32(inst.constant)); MOVD_xmm(regs_.FX(inst.dest), R(SCRATCH1));