Bug 1374726: Rename MAsmJSNeg to MWasmNeg; r=jolesen
authorBenjamin Bouvier <benj@benj.me>
Tue, 20 Jun 2017 19:59:47 +0200
changeset 365291 ef2130b763e5540ed8854d73c5bab5843e9ca3ba
parent 365290 c132f4ee269d3df06916f15e5c465e2c97a00468
child 365292 57b1aa6bfa2e43322cc2318916352a3fea19d19d
push id32068
push userkwierso@gmail.com
push dateThu, 22 Jun 2017 00:58:38 +0000
treeherdermozilla-central@f8bb96fb5c4f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjolesen
bugs1374726
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1374726: Rename MAsmJSNeg to MWasmNeg; r=jolesen MozReview-Commit-ID: IIbuvqFFUkE
js/src/jit/MIR.h
js/src/jit/MOpcodes.h
js/src/jit/arm/Lowering-arm.cpp
js/src/jit/arm/Lowering-arm.h
js/src/jit/arm64/Lowering-arm64.cpp
js/src/jit/arm64/Lowering-arm64.h
js/src/jit/mips-shared/Lowering-mips-shared.cpp
js/src/jit/mips-shared/Lowering-mips-shared.h
js/src/jit/none/Lowering-none.h
js/src/jit/x86-shared/Lowering-x86-shared.cpp
js/src/jit/x86-shared/Lowering-x86-shared.h
js/src/wasm/WasmIonCompile.cpp
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -13762,29 +13762,32 @@ class MDebugCheckSelfHosted
 
   public:
     INSTRUCTION_HEADER(DebugCheckSelfHosted)
     TRIVIAL_NEW_WRAPPERS
     NAMED_OPERANDS((0, checkValue))
 
 };
 
-class MAsmJSNeg
+// Flips the input's sign bit, independently of the rest of the number's
+// payload. Note this is different from multiplying by minus-one, which has
+// side-effects for e.g. NaNs.
+class MWasmNeg
   : public MUnaryInstruction,
     public NoTypePolicy::Data
 {
-    MAsmJSNeg(MDefinition* op, MIRType type)
+    MWasmNeg(MDefinition* op, MIRType type)
       : MUnaryInstruction(op)
     {
         setResultType(type);
         setMovable();
     }
 
   public:
-    INSTRUCTION_HEADER(AsmJSNeg)
+    INSTRUCTION_HEADER(WasmNeg)
     TRIVIAL_NEW_WRAPPERS
 };
 
 class MWasmLoadTls
   : public MUnaryInstruction,
     public NoTypePolicy::Data
 {
     uint32_t offset_;
--- a/js/src/jit/MOpcodes.h
+++ b/js/src/jit/MOpcodes.h
@@ -289,22 +289,22 @@ namespace jit {
     _(Debugger)                                                             \
     _(NewTarget)                                                            \
     _(ArrowNewTarget)                                                       \
     _(CheckReturn)                                                          \
     _(CheckIsObj)                                                           \
     _(CheckIsCallable)                                                      \
     _(CheckObjCoercible)                                                    \
     _(DebugCheckSelfHosted)                                                 \
-    _(AsmJSNeg)                                                             \
     _(AsmJSLoadHeap)                                                        \
     _(AsmJSStoreHeap)                                                       \
     _(AsmJSCompareExchangeHeap)                                             \
     _(AsmJSAtomicExchangeHeap)                                              \
     _(AsmJSAtomicBinopHeap)                                                 \
+    _(WasmNeg)                                                              \
     _(WasmBoundsCheck)                                                      \
     _(WasmLoadTls)                                                          \
     _(WasmAddOffset)                                                        \
     _(WasmLoad)                                                             \
     _(WasmStore)                                                            \
     _(WasmTrap)                                                             \
     _(WasmTruncateToInt32)                                                  \
     _(WasmUnsignedToDouble)                                                 \
--- a/js/src/jit/arm/Lowering-arm.cpp
+++ b/js/src/jit/arm/Lowering-arm.cpp
@@ -532,17 +532,17 @@ LIRGeneratorARM::visitWasmSelect(MWasmSe
     auto* lir = new(alloc()) LWasmSelect(useRegisterAtStart(ins->trueExpr()),
                                          useRegister(ins->falseExpr()),
                                          useRegister(ins->condExpr()));
 
     defineReuseInput(lir, ins, LWasmSelect::TrueExprIndex);
 }
 
 void
-LIRGeneratorARM::visitAsmJSNeg(MAsmJSNeg* ins)
+LIRGeneratorARM::visitWasmNeg(MWasmNeg* ins)
 {
     if (ins->type() == MIRType::Int32) {
         define(new(alloc()) LNegI(useRegisterAtStart(ins->input())), ins);
     } else if (ins->type() == MIRType::Float32) {
         define(new(alloc()) LNegF(useRegisterAtStart(ins->input())), ins);
     } else {
         MOZ_ASSERT(ins->type() == MIRType::Double);
         define(new(alloc()) LNegD(useRegisterAtStart(ins->input())), ins);
--- a/js/src/jit/arm/Lowering-arm.h
+++ b/js/src/jit/arm/Lowering-arm.h
@@ -84,17 +84,17 @@ class LIRGeneratorARM : public LIRGenera
     void lowerDivI64(MDiv* div);
     void lowerModI64(MMod* mod);
     void lowerUDivI64(MDiv* div);
     void lowerUModI64(MMod* mod);
     void lowerMulI(MMul* mul, MDefinition* lhs, MDefinition* rhs);
     void lowerUDiv(MDiv* div);
     void lowerUMod(MMod* mod);
     void visitPowHalf(MPowHalf* ins);
-    void visitAsmJSNeg(MAsmJSNeg* ins);
+    void visitWasmNeg(MWasmNeg* ins);
 
     LTableSwitch* newLTableSwitch(const LAllocation& in, const LDefinition& inputCopy,
                                   MTableSwitch* ins);
     LTableSwitchV* newLTableSwitchV(MTableSwitch* ins);
 
   public:
     void visitBox(MBox* box);
     void visitUnbox(MUnbox* unbox);
--- a/js/src/jit/arm64/Lowering-arm64.cpp
+++ b/js/src/jit/arm64/Lowering-arm64.cpp
@@ -211,19 +211,19 @@ LIRGeneratorARM64::visitGuardObjectGroup
 
 void
 LIRGeneratorARM64::lowerUrshD(MUrsh* mir)
 {
     MOZ_CRASH("lowerUrshD");
 }
 
 void
-LIRGeneratorARM64::visitAsmJSNeg(MAsmJSNeg* ins)
+LIRGeneratorARM64::visitWasmNeg(MWasmNeg* ins)
 {
-    MOZ_CRASH("visitAsmJSNeg");
+    MOZ_CRASH("visitWasmNeg");
 }
 
 void
 LIRGeneratorARM64::visitWasmSelect(MWasmSelect* ins)
 {
     MOZ_CRASH("visitWasmSelect");
 }
 
--- a/js/src/jit/arm64/Lowering-arm64.h
+++ b/js/src/jit/arm64/Lowering-arm64.h
@@ -83,17 +83,17 @@ class LIRGeneratorARM64 : public LIRGene
     void lowerDivI(MDiv* div);
     void lowerModI(MMod* mod);
     void lowerDivI64(MDiv* div);
     void lowerModI64(MMod* mod);
     void lowerMulI(MMul* mul, MDefinition* lhs, MDefinition* rhs);
     void lowerUDiv(MDiv* div);
     void lowerUMod(MMod* mod);
     void visitPowHalf(MPowHalf* ins);
-    void visitAsmJSNeg(MAsmJSNeg* ins);
+    void visitWasmNeg(MWasmNeg* ins);
     void visitWasmSelect(MWasmSelect* ins);
 
     LTableSwitchV* newLTableSwitchV(MTableSwitch* ins);
     LTableSwitch* newLTableSwitch(const LAllocation& in,
                                   const LDefinition& inputCopy,
                                   MTableSwitch* ins);
 
   public:
--- a/js/src/jit/mips-shared/Lowering-mips-shared.cpp
+++ b/js/src/jit/mips-shared/Lowering-mips-shared.cpp
@@ -299,17 +299,17 @@ LIRGeneratorMIPSShared::lowerUrshD(MUrsh
     MOZ_ASSERT(lhs->type() == MIRType::Int32);
     MOZ_ASSERT(rhs->type() == MIRType::Int32);
 
     LUrshD* lir = new(alloc()) LUrshD(useRegister(lhs), useRegisterOrConstant(rhs), temp());
     define(lir, mir);
 }
 
 void
-LIRGeneratorMIPSShared::visitAsmJSNeg(MAsmJSNeg* ins)
+LIRGeneratorMIPSShared::visitWasmNeg(MWasmNeg* ins)
 {
     if (ins->type() == MIRType::Int32) {
         define(new(alloc()) LNegI(useRegisterAtStart(ins->input())), ins);
     } else if (ins->type() == MIRType::Float32) {
         define(new(alloc()) LNegF(useRegisterAtStart(ins->input())), ins);
     } else {
         MOZ_ASSERT(ins->type() == MIRType::Double);
         define(new(alloc()) LNegD(useRegisterAtStart(ins->input())), ins);
--- a/js/src/jit/mips-shared/Lowering-mips-shared.h
+++ b/js/src/jit/mips-shared/Lowering-mips-shared.h
@@ -65,17 +65,17 @@ class LIRGeneratorMIPSShared : public LI
     void lowerForBitAndAndBranch(LBitAndAndBranch* baab, MInstruction* mir,
                                  MDefinition* lhs, MDefinition* rhs);
     void lowerDivI(MDiv* div);
     void lowerModI(MMod* mod);
     void lowerMulI(MMul* mul, MDefinition* lhs, MDefinition* rhs);
     void lowerUDiv(MDiv* div);
     void lowerUMod(MMod* mod);
     void visitPowHalf(MPowHalf* ins);
-    void visitAsmJSNeg(MAsmJSNeg* ins);
+    void visitWasmNeg(MWasmNeg* ins);
     void visitWasmLoad(MWasmLoad* ins);
     void visitWasmStore(MWasmStore* ins);
     void visitWasmSelect(MWasmSelect* ins);
 
     LTableSwitch* newLTableSwitch(const LAllocation& in, const LDefinition& inputCopy,
                                   MTableSwitch* ins);
     LTableSwitchV* newLTableSwitchV(MTableSwitch* ins);
 
--- a/js/src/jit/none/Lowering-none.h
+++ b/js/src/jit/none/Lowering-none.h
@@ -69,17 +69,17 @@ class LIRGeneratorNone : public LIRGener
     void lowerModI64(MMod*) { MOZ_CRASH(); }
     void lowerMulI(MMul*, MDefinition*, MDefinition*) { MOZ_CRASH(); }
     void lowerUDiv(MDiv*) { MOZ_CRASH(); }
     void lowerUMod(MMod*) { MOZ_CRASH(); }
     void visitBox(MBox* box) { MOZ_CRASH(); }
     void visitUnbox(MUnbox* unbox) { MOZ_CRASH(); }
     void visitReturn(MReturn* ret) { MOZ_CRASH(); }
     void visitPowHalf(MPowHalf*) { MOZ_CRASH(); }
-    void visitAsmJSNeg(MAsmJSNeg*) { MOZ_CRASH(); }
+    void visitWasmNeg(MWasmNeg*) { MOZ_CRASH(); }
     void visitGuardShape(MGuardShape* ins) { MOZ_CRASH(); }
     void visitGuardObjectGroup(MGuardObjectGroup* ins) { MOZ_CRASH(); }
     void visitWasmUnsignedToDouble(MWasmUnsignedToDouble* ins) { MOZ_CRASH(); }
     void visitWasmUnsignedToFloat32(MWasmUnsignedToFloat32* ins) { MOZ_CRASH(); }
     void visitAsmJSLoadHeap(MAsmJSLoadHeap* ins) { MOZ_CRASH(); }
     void visitAsmJSStoreHeap(MAsmJSStoreHeap* ins) { MOZ_CRASH(); }
     void visitStoreTypedArrayElementStatic(MStoreTypedArrayElementStatic* ins) { MOZ_CRASH(); }
     void visitAtomicTypedArrayElementBinop(MAtomicTypedArrayElementBinop* ins) { MOZ_CRASH(); }
--- a/js/src/jit/x86-shared/Lowering-x86-shared.cpp
+++ b/js/src/jit/x86-shared/Lowering-x86-shared.cpp
@@ -302,17 +302,17 @@ LIRGeneratorX86Shared::visitWasmSelect(M
     auto* lir = new(alloc()) LWasmSelect(useRegisterAtStart(ins->trueExpr()),
                                          use(ins->falseExpr()),
                                          useRegister(ins->condExpr()));
 
     defineReuseInput(lir, ins, LWasmSelect::TrueExprIndex);
 }
 
 void
-LIRGeneratorX86Shared::visitAsmJSNeg(MAsmJSNeg* ins)
+LIRGeneratorX86Shared::visitWasmNeg(MWasmNeg* ins)
 {
     switch (ins->type()) {
       case MIRType::Int32:
         defineReuseInput(new(alloc()) LNegI(useRegisterAtStart(ins->input())), ins, 0);
         break;
       case MIRType::Float32:
         defineReuseInput(new(alloc()) LNegF(useRegisterAtStart(ins->input())), ins, 0);
         break;
--- a/js/src/jit/x86-shared/Lowering-x86-shared.h
+++ b/js/src/jit/x86-shared/Lowering-x86-shared.h
@@ -40,17 +40,17 @@ class LIRGeneratorX86Shared : public LIR
     void lowerForFPU(LInstructionHelper<1, 2, Temps>* ins, MDefinition* mir, MDefinition* lhs,
                      MDefinition* rhs);
     void lowerForCompIx4(LSimdBinaryCompIx4* ins, MSimdBinaryComp* mir,
                          MDefinition* lhs, MDefinition* rhs);
     void lowerForCompFx4(LSimdBinaryCompFx4* ins, MSimdBinaryComp* mir,
                          MDefinition* lhs, MDefinition* rhs);
     void lowerForBitAndAndBranch(LBitAndAndBranch* baab, MInstruction* mir,
                                  MDefinition* lhs, MDefinition* rhs);
-    void visitAsmJSNeg(MAsmJSNeg* ins);
+    void visitWasmNeg(MWasmNeg* ins);
     void visitWasmSelect(MWasmSelect* ins);
     void lowerMulI(MMul* mul, MDefinition* lhs, MDefinition* rhs);
     void lowerDivI(MDiv* div);
     void lowerModI(MMod* mod);
     void lowerUDiv(MDiv* div);
     void lowerUMod(MMod* mod);
     void lowerUrshD(MUrsh* mir);
     void lowerTruncateDToInt32(MTruncateToInt32* ins);
--- a/js/src/wasm/WasmIonCompile.cpp
+++ b/js/src/wasm/WasmIonCompile.cpp
@@ -3501,17 +3501,17 @@ EmitBodyExprs(FunctionCompiler& f)
           case uint16_t(Op::I64ShrU):
             CHECK(EmitBitwise<MUrsh>(f, ValType::I64, MIRType::Int64));
           case uint16_t(Op::I64Rotl):
           case uint16_t(Op::I64Rotr):
             CHECK(EmitRotate(f, ValType::I64, Op(op) == Op::I64Rotl));
           case uint16_t(Op::F32Abs):
             CHECK(EmitUnaryWithType<MAbs>(f, ValType::F32, MIRType::Float32));
           case uint16_t(Op::F32Neg):
-            CHECK(EmitUnaryWithType<MAsmJSNeg>(f, ValType::F32, MIRType::Float32));
+            CHECK(EmitUnaryWithType<MWasmNeg>(f, ValType::F32, MIRType::Float32));
           case uint16_t(Op::F32Ceil):
             CHECK(EmitUnaryMathBuiltinCall(f, SymbolicAddress::CeilF, ValType::F32));
           case uint16_t(Op::F32Floor):
             CHECK(EmitUnaryMathBuiltinCall(f, SymbolicAddress::FloorF, ValType::F32));
           case uint16_t(Op::F32Trunc):
             CHECK(EmitUnaryMathBuiltinCall(f, SymbolicAddress::TruncF, ValType::F32));
           case uint16_t(Op::F32Nearest):
             CHECK(EmitUnaryMathBuiltinCall(f, SymbolicAddress::NearbyIntF, ValType::F32));
@@ -3528,17 +3528,17 @@ EmitBodyExprs(FunctionCompiler& f)
           case uint16_t(Op::F32Min):
           case uint16_t(Op::F32Max):
             CHECK(EmitMinMax(f, ValType::F32, MIRType::Float32, Op(op) == Op::F32Max));
           case uint16_t(Op::F32CopySign):
             CHECK(EmitCopySign(f, ValType::F32));
           case uint16_t(Op::F64Abs):
             CHECK(EmitUnaryWithType<MAbs>(f, ValType::F64, MIRType::Double));
           case uint16_t(Op::F64Neg):
-            CHECK(EmitUnaryWithType<MAsmJSNeg>(f, ValType::F64, MIRType::Double));
+            CHECK(EmitUnaryWithType<MWasmNeg>(f, ValType::F64, MIRType::Double));
           case uint16_t(Op::F64Ceil):
             CHECK(EmitUnaryMathBuiltinCall(f, SymbolicAddress::CeilD, ValType::F64));
           case uint16_t(Op::F64Floor):
             CHECK(EmitUnaryMathBuiltinCall(f, SymbolicAddress::FloorD, ValType::F64));
           case uint16_t(Op::F64Trunc):
             CHECK(EmitUnaryMathBuiltinCall(f, SymbolicAddress::TruncD, ValType::F64));
           case uint16_t(Op::F64Nearest):
             CHECK(EmitUnaryMathBuiltinCall(f, SymbolicAddress::NearbyIntD, ValType::F64));
@@ -3608,17 +3608,17 @@ EmitBodyExprs(FunctionCompiler& f)
           // asm.js-specific operators
 
           case uint16_t(Op::TeeGlobal):
             CHECK_ASMJS(EmitTeeGlobal(f));
           case uint16_t(Op::I32Min):
           case uint16_t(Op::I32Max):
             CHECK_ASMJS(EmitMinMax(f, ValType::I32, MIRType::Int32, Op(op) == Op::I32Max));
           case uint16_t(Op::I32Neg):
-            CHECK_ASMJS(EmitUnaryWithType<MAsmJSNeg>(f, ValType::I32, MIRType::Int32));
+            CHECK_ASMJS(EmitUnaryWithType<MWasmNeg>(f, ValType::I32, MIRType::Int32));
           case uint16_t(Op::I32BitNot):
             CHECK_ASMJS(EmitBitNot(f, ValType::I32));
           case uint16_t(Op::I32Abs):
             CHECK_ASMJS(EmitUnaryWithType<MAbs>(f, ValType::I32, MIRType::Int32));
           case uint16_t(Op::F32TeeStoreF64):
             CHECK_ASMJS(EmitTeeStoreWithCoercion(f, ValType::F32, Scalar::Float64));
           case uint16_t(Op::F64TeeStoreF32):
             CHECK_ASMJS(EmitTeeStoreWithCoercion(f, ValType::F64, Scalar::Float32));