Bug 1115388 - Make Simd instructions, accepting Float32 operands, valid Float32 consumers. r=bbouvier
☠☠ backed out by 0d28603f938a ☠ ☠
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Tue, 30 Dec 2014 15:01:53 +0100
changeset 247474 d8a111f0fb640baa50e3b485b364bfd9dcdebbdf
parent 247473 1c9c64027cacf7f9bbc0203b0f6bcff8f4887784
child 247475 94a046dfcb4902467e8cd0af4a3f3819aaa9b7d0
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();
     }