Bug 1500231: Fix register allocation of copysign on AVX; r=sunfish
authorBenjamin Bouvier <benj@benj.me>
Mon, 22 Oct 2018 15:41:53 +0200
changeset 490852 6383d580c71308d8bc43e61f692a3cbafda54069
parent 490851 141e6f82a895f2f044ae87df08f7b9d69f59564c
child 490853 8238a4eeda863b0a947afef38dd6f0cc4d7aac47
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewerssunfish
bugs1500231
milestone65.0a1
Bug 1500231: Fix register allocation of copysign on AVX; r=sunfish
js/src/jit/x86-shared/Lowering-x86-shared.cpp
--- a/js/src/jit/x86-shared/Lowering-x86-shared.cpp
+++ b/js/src/jit/x86-shared/Lowering-x86-shared.cpp
@@ -699,15 +699,16 @@ LIRGenerator::visitCopySign(MCopySign* i
     if (lhs->type() == MIRType::Double) {
         lir = new(alloc()) LCopySignD();
     } else {
         lir = new(alloc()) LCopySignF();
     }
 
     // As lowerForFPU, but we want rhs to be in a FP register too.
     lir->setOperand(0, useRegisterAtStart(lhs));
-    lir->setOperand(1, lhs != rhs ? useRegister(rhs) : useRegisterAtStart(rhs));
     if (!Assembler::HasAVX()) {
+        lir->setOperand(1, lhs != rhs ? useRegister(rhs) : useRegisterAtStart(rhs));
         defineReuseInput(lir, ins, 0);
     } else {
+        lir->setOperand(1, useRegisterAtStart(rhs));
         define(lir, ins);
     }
 }