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 208200 4fc9c8d8a4ae
parent 208199 1efe42b45348
child 208201 97b81de9d1a5
push id3764
push userryanvm@gmail.com
push date2014-07-30 15:35 +0000
treeherdermozilla-beta@97b81de9d1a5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier, abillings
bugs1034349
milestone32.0
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
@@ -1443,16 +1443,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);
@@ -1469,16 +1473,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;