Bug 1034349 - Skip Float32 specialization for int32 operations. r=bbouvier, a=abillings
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Tue, 29 Jul 2014 04:49:19 -0700
changeset 217301 2954916649492036a4072f85b3e3cb63538ad6f5
parent 217300 eba57bc45d2e455f3881198dc5e0cf592a45dd2e
child 217302 add6dcab0ca77182dab55a523505af68b63b9489
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier, abillings
bugs1034349
milestone33.0a2
Bug 1034349 - Skip Float32 specialization for int32 operations. r=bbouvier, a=abillings
js/src/jit/MIR.cpp
--- a/js/src/jit/MIR.cpp
+++ b/js/src/jit/MIR.cpp
@@ -1496,16 +1496,20 @@ MBinaryArithInstruction::foldsTo(TempAll
         return rhs; // x op id => x
 
     return this;
 }
 
 void
 MBinaryArithInstruction::trySpecializeFloat32(TempAllocator &alloc)
 {
+    // Do not use Float32 if we can use int32.
+    if (specialization_ == MIRType_Int32)
+        return;
+
     MDefinition *left = lhs();
     MDefinition *right = rhs();
 
     if (!left->canProduceFloat32() || !right->canProduceFloat32()
         || !CheckUsesAreFloat32Consumers(this))
     {
         if (left->type() == MIRType_Float32)
             ConvertDefinitionToDouble<0>(alloc, left, this);
@@ -1522,16 +1526,20 @@ bool
 MAbs::fallible() const
 {
     return !implicitTruncate_ && (!range() || !range()->hasInt32Bounds());
 }
 
 void
 MAbs::trySpecializeFloat32(TempAllocator &alloc)
 {
+    // Do not use Float32 if we can use int32.
+    if (input()->type() == MIRType_Int32)
+        return;
+
     if (!input()->canProduceFloat32() || !CheckUsesAreFloat32Consumers(this)) {
         if (input()->type() == MIRType_Float32)
             ConvertDefinitionToDouble<0>(alloc, input(), this);
         return;
     }
 
     setResultType(MIRType_Float32);
     specialization_ = MIRType_Float32;