Bug 1198628 - IonMonkey: ARM: Redefine FloatRegisters::Code and use it in the right way. r=nbp
authorHeiher <r@hev.cc>
Sun, 06 Sep 2015 23:36:00 +0200
changeset 293832 3ec50d69a2b29309355695042fe87d9990bd49b2
parent 293831 0a560ab743f8816be86994a67b0127b534fe8bb9
child 293833 18c50ebe2af346a940f392d171f9e96989d9e417
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1198628
milestone43.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 1198628 - IonMonkey: ARM: Redefine FloatRegisters::Code and use it in the right way. r=nbp
js/src/jit/arm/Architecture-arm.h
js/src/jit/arm/MacroAssembler-arm.h
--- a/js/src/jit/arm/Architecture-arm.h
+++ b/js/src/jit/arm/Architecture-arm.h
@@ -234,47 +234,47 @@ class FloatRegisters
         d27,
         d28,
         d29,
         d30,
         d31,
         invalid_freg
     };
 
-    typedef FPRegisterID Code;
+    typedef uint32_t Code;
     typedef FPRegisterID Encoding;
 
     // Content spilled during bailouts.
     union RegisterContent {
         double d;
     };
 
-    static const char* GetDoubleName(Code code) {
+    static const char* GetDoubleName(Encoding code) {
         static const char * const Names[] = { "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
                                               "d8", "d9", "d10", "d11", "d12", "d13", "d14", "d15",
                                               "d16", "d17", "d18", "d19", "d20", "d21", "d22", "d23",
                                               "d24", "d25", "d26", "d27", "d28", "d29", "d30", "d31"};
         return Names[code];
     }
-    static const char* GetSingleName(Code code) {
+    static const char* GetSingleName(Encoding code) {
         static const char * const Names[] = { "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
                                               "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15",
                                               "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23",
                                               "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31"};
         return Names[code];
     }
 
     static const char* GetName(uint32_t i) {
         MOZ_ASSERT(i < Total);
-        return GetName(Code(i));
+        return GetName(Encoding(i));
     }
 
     static Code FromName(const char* name);
 
-    static const Code Invalid = invalid_freg;
+    static const Encoding Invalid = invalid_freg;
     static const uint32_t Total = 48;
     static const uint32_t TotalDouble = 16;
     static const uint32_t TotalSingle = 32;
     static const uint32_t Allocatable = 45;
     // There are only 32 places that we can put values.
     static const uint32_t TotalPhys = 32;
     static uint32_t ActualTotalPhys();
 
@@ -427,35 +427,35 @@ class VFPRegister
         MOZ_ASSERT(!_isInvalid && !_isMissing);
         // This should only be used in areas where we only have doubles and
         // singles.
         MOZ_ASSERT(isFloat());
         return Code(code_ | (kind << 5));
     }
     Encoding encoding() const {
         MOZ_ASSERT(!_isInvalid && !_isMissing);
-        return Code(code_ | (kind << 5));
+        return Encoding(code_);
     }
     uint32_t id() const {
         return code_;
     }
     static VFPRegister FromCode(uint32_t i) {
         uint32_t code = i & 31;
         uint32_t kind = i >> 5;
         return VFPRegister(code, RegType(kind));
     }
     bool volatile_() const {
         if (isDouble())
             return !!((1 << (code_ >> 1)) & FloatRegisters::VolatileMask);
         return !!((1 << code_) & FloatRegisters::VolatileMask);
     }
     const char* name() const {
         if (isDouble())
-            return FloatRegisters::GetDoubleName(Code(code_));
-        return FloatRegisters::GetSingleName(Code(code_));
+            return FloatRegisters::GetDoubleName(Encoding(code_));
+        return FloatRegisters::GetSingleName(Encoding(code_));
     }
     bool operator != (const VFPRegister& other) const {
         return other.kind != kind || code_ != other.code_;
     }
     bool aliases(const VFPRegister& other) {
         if (kind == other.kind)
             return code_ == other.code_;
         return doubleOverlay() == other.doubleOverlay();
--- a/js/src/jit/arm/MacroAssembler-arm.h
+++ b/js/src/jit/arm/MacroAssembler-arm.h
@@ -471,17 +471,17 @@ private:
         while (iter.more()) {
             startFloatTransferM(ls, rm, mode, WriteBack);
             int32_t reg = (*iter).code();
             do {
                 offset += delta;
                 if ((*iter).isDouble())
                     offset += delta;
                 transferFloatReg(*iter);
-            } while ((++iter).more() && (*iter).code() == (reg += sign));
+            } while ((++iter).more() && int32_t((*iter).code()) == (reg += sign));
             finishFloatTransfer();
         }
         return offset;
     }
 };
 
 class MacroAssembler;