Bug 1115388 - Make Simd instructions, accepting Float32 operands, valid Float32 consumers. r=bbouvier
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Fri, 02 Jan 2015 18:14:45 +0100
changeset 247718 287d56de1d627facf137172dd0081286ba282845
parent 247717 404957f69d30309905310cfd404da965da5dd0a7
child 247719 5b4b340109fc4abb445910af048601429da4e74a
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1115388
milestone37.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 1115388 - Make Simd instructions, accepting Float32 operands, valid Float32 consumers. r=bbouvier
js/src/jit/MIR.h
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -1317,16 +1317,17 @@ class MConstant : public MNullaryInstruc
 // Generic constructor of SIMD valuesX4.
 class MSimdValueX4 : public MQuaternaryInstruction
 {
   protected:
     MSimdValueX4(MIRType type, MDefinition *x, MDefinition *y, MDefinition *z, MDefinition *w)
       : MQuaternaryInstruction(x, y, z, w)
     {
         MOZ_ASSERT(IsSimdType(type));
+        MOZ_ASSERT(SimdTypeToLength(type) == 4);
         mozilla::DebugOnly<MIRType> scalarType = SimdTypeToScalarType(type);
         MOZ_ASSERT(scalarType == x->type());
         MOZ_ASSERT(scalarType == y->type());
         MOZ_ASSERT(scalarType == z->type());
         MOZ_ASSERT(scalarType == w->type());
 
         setMovable();
         setResultType(type);
@@ -1336,16 +1337,20 @@ class MSimdValueX4 : public MQuaternaryI
     INSTRUCTION_HEADER(SimdValueX4)
 
     static MSimdValueX4 *New(TempAllocator &alloc, MIRType type, MDefinition *x,
                              MDefinition *y, MDefinition *z, MDefinition *w)
     {
         return new(alloc) MSimdValueX4(type, x, y, z, w);
     }
 
+    bool canConsumeFloat32(MUse *use) const {
+        return SimdTypeToScalarType(type()) == MIRType_Float32;
+    }
+
     AliasSet getAliasSet() const {
         return AliasSet::None();
     }
 
     bool congruentTo(const MDefinition *ins) const {
         return congruentIfOperandsEqual(ins);
     }
 
@@ -1372,16 +1377,20 @@ class MSimdSplatX4 : public MUnaryInstru
   public:
     INSTRUCTION_HEADER(SimdSplatX4)
 
     static MSimdSplatX4 *New(TempAllocator &alloc, MIRType type, MDefinition *v)
     {
         return new(alloc) MSimdSplatX4(type, v);
     }
 
+    bool canConsumeFloat32(MUse *use) const {
+        return SimdTypeToScalarType(type()) == MIRType_Float32;
+    }
+
     AliasSet getAliasSet() const {
         return AliasSet::None();
     }
 
     bool congruentTo(const MDefinition *ins) const {
         return congruentIfOperandsEqual(ins);
     }
 
@@ -1553,16 +1562,20 @@ class MSimdInsertElement : public MBinar
     }
     MDefinition *value() {
         return getOperand(1);
     }
     SimdLane lane() const {
         return lane_;
     }
 
+    bool canConsumeFloat32(MUse *use) const {
+        return use == getUseFor(1) && SimdTypeToScalarType(type()) == MIRType_Float32;
+    }
+
     AliasSet getAliasSet() const {
         return AliasSet::None();
     }
 
     bool congruentTo(const MDefinition *ins) const {
         return binaryCongruentTo(ins) && lane_ == ins->toSimdInsertElement()->lane();
     }