From 4c5de3905bf348bb0d1f89d99ec08bfe64342573 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sat, 1 Apr 2017 09:53:29 +0100 Subject: [PATCH] emit_x64: Correct mutation of immutable in FPThreeOp{32,64} operand (args[1]) was erroneously declared as non-scratch. operand's value could be modified if FTZ was enabled. --- src/backend_x64/emit_x64.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend_x64/emit_x64.cpp b/src/backend_x64/emit_x64.cpp index 5a3880e9..b13adace 100644 --- a/src/backend_x64/emit_x64.cpp +++ b/src/backend_x64/emit_x64.cpp @@ -2235,7 +2235,7 @@ static void FPThreeOp32(BlockOfCode* code, RegAlloc& reg_alloc, IR::Block& block auto args = reg_alloc.GetArgumentInfo(inst); Xbyak::Xmm result = reg_alloc.UseScratchXmm(args[0]); - Xbyak::Xmm operand = reg_alloc.UseXmm(args[1]); + Xbyak::Xmm operand = reg_alloc.UseScratchXmm(args[1]); Xbyak::Reg32 gpr_scratch = reg_alloc.ScratchGpr().cvt32(); if (block.Location().FPSCR().FTZ()) { @@ -2257,7 +2257,7 @@ static void FPThreeOp64(BlockOfCode* code, RegAlloc& reg_alloc, IR::Block& block auto args = reg_alloc.GetArgumentInfo(inst); Xbyak::Xmm result = reg_alloc.UseScratchXmm(args[0]); - Xbyak::Xmm operand = reg_alloc.UseXmm(args[1]); + Xbyak::Xmm operand = reg_alloc.UseScratchXmm(args[1]); Xbyak::Reg64 gpr_scratch = reg_alloc.ScratchGpr(); if (block.Location().FPSCR().FTZ()) {