Backed out changeset 94a046dfcb49 (bug 1115388)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 30 Dec 2014 15:26:51 +0100
changeset 247477 8380f052db41109b92f364d1bd06963ff2b13c05
parent 247476 ecc306809984ee2d4a6ae3d4d9a448794ebda210
child 247478 0d28603f938ad50ccd0a8c348ae9c01476d9aa90
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)
bugs1115388
milestone37.0a1
backs out94a046dfcb4902467e8cd0af4a3f3819aaa9b7d0
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
Backed out changeset 94a046dfcb49 (bug 1115388)
js/src/jit/IonTypes.h
--- a/js/src/jit/IonTypes.h
+++ b/js/src/jit/IonTypes.h
@@ -384,16 +384,29 @@ enum MIRType
     MIRType_ForkJoinContext,           // js::ForkJoinContext*
     MIRType_Last = MIRType_ForkJoinContext,
     MIRType_Float32x4 = MIRType_Float32 | (2 << VECTOR_SCALE_SHIFT),
     MIRType_Int32x4   = MIRType_Int32   | (2 << VECTOR_SCALE_SHIFT),
     MIRType_Doublex2  = MIRType_Double  | (1 << VECTOR_SCALE_SHIFT)
 };
 
 static inline MIRType
+ElementType(MIRType type)
+{
+    JS_STATIC_ASSERT(MIRType_Last <= ELEMENT_TYPE_MASK);
+    return static_cast<MIRType>((type >> ELEMENT_TYPE_SHIFT) & ELEMENT_TYPE_MASK);
+}
+
+static inline uint32_t
+VectorSize(MIRType type)
+{
+    return 1 << ((type >> VECTOR_SCALE_SHIFT) & VECTOR_SCALE_MASK);
+}
+
+static inline MIRType
 MIRTypeFromValueType(JSValueType type)
 {
     // This function does not deal with magic types. Magic constants should be
     // filtered out in MIRTypeFromValue.
     switch (type) {
       case JSVAL_TYPE_DOUBLE:
         return MIRType_Double;
       case JSVAL_TYPE_INT32:
@@ -548,26 +561,37 @@ IsMagicType(MIRType type)
 }
 
 // Returns the number of vector elements (hereby called "length") for a given
 // SIMD kind. It is the Y part of the name "Foo x Y".
 static inline unsigned
 SimdTypeToLength(MIRType type)
 {
     MOZ_ASSERT(IsSimdType(type));
-    return 1 << ((type >> VECTOR_SCALE_SHIFT) & VECTOR_SCALE_MASK);
+    switch (type) {
+      case MIRType_Int32x4:
+      case MIRType_Float32x4:
+        return 4;
+      default: break;
+    }
+    MOZ_CRASH("unexpected SIMD kind");
 }
 
 static inline MIRType
 SimdTypeToScalarType(MIRType type)
 {
     MOZ_ASSERT(IsSimdType(type));
-    static_assert(MIRType_Last <= ELEMENT_TYPE_MASK,
-                  "ELEMENT_TYPE_MASK should be larger than the last MIRType");
-    return MIRType((type >> ELEMENT_TYPE_SHIFT) & ELEMENT_TYPE_MASK);
+    switch (type) {
+      case MIRType_Int32x4:
+        return MIRType_Int32;
+      case MIRType_Float32x4:
+        return MIRType_Float32;
+      default: break;
+    }
+    MOZ_CRASH("unexpected SIMD kind");
 }
 
 // Indicates a lane in a SIMD register: X for the first lane, Y for the second,
 // Z for the third (if any), W for the fourth (if any).
 enum SimdLane {
     LaneX = 0x0,
     LaneY = 0x1,
     LaneZ = 0x2,