Bug 1198628 - IonMonkey: ARM: Redefine FloatRegisters::Code and use it in the right way. r=nbp

This commit is contained in:
Heiher 2015-08-26 01:42:00 -04:00
parent f89c928f8a
commit 634e432196

View File

@ -239,7 +239,7 @@ class FloatRegisters
invalid_freg invalid_freg
}; };
typedef FPRegisterID Code; typedef uint32_t Code;
typedef FPRegisterID Encoding; typedef FPRegisterID Encoding;
// Content spilled during bailouts. // Content spilled during bailouts.
@ -247,14 +247,14 @@ class FloatRegisters
double d; 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", static const char * const Names[] = { "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
"d8", "d9", "d10", "d11", "d12", "d13", "d14", "d15", "d8", "d9", "d10", "d11", "d12", "d13", "d14", "d15",
"d16", "d17", "d18", "d19", "d20", "d21", "d22", "d23", "d16", "d17", "d18", "d19", "d20", "d21", "d22", "d23",
"d24", "d25", "d26", "d27", "d28", "d29", "d30", "d31"}; "d24", "d25", "d26", "d27", "d28", "d29", "d30", "d31"};
return Names[code]; 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", static const char * const Names[] = { "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
"s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15",
"s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23",
@ -264,12 +264,12 @@ class FloatRegisters
static const char* GetName(uint32_t i) { static const char* GetName(uint32_t i) {
MOZ_ASSERT(i < Total); MOZ_ASSERT(i < Total);
return GetName(Code(i)); return GetName(Encoding(i));
} }
static Code FromName(const char* name); 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 Total = 48;
static const uint32_t TotalDouble = 16; static const uint32_t TotalDouble = 16;
static const uint32_t TotalSingle = 32; static const uint32_t TotalSingle = 32;
@ -432,7 +432,7 @@ class VFPRegister
} }
Encoding encoding() const { Encoding encoding() const {
MOZ_ASSERT(!_isInvalid && !_isMissing); MOZ_ASSERT(!_isInvalid && !_isMissing);
return Code(code_ | (kind << 5)); return Encoding(code_);
} }
uint32_t id() const { uint32_t id() const {
return code_; return code_;
@ -449,8 +449,8 @@ class VFPRegister
} }
const char* name() const { const char* name() const {
if (isDouble()) if (isDouble())
return FloatRegisters::GetDoubleName(Code(code_)); return FloatRegisters::GetDoubleName(Encoding(code_));
return FloatRegisters::GetSingleName(Code(code_)); return FloatRegisters::GetSingleName(Encoding(code_));
} }
bool operator != (const VFPRegister& other) const { bool operator != (const VFPRegister& other) const {
return other.kind != kind || code_ != other.code_; return other.kind != kind || code_ != other.code_;