Chromium Code Reviews| Index: src/IceRegistersARM32.h |
| diff --git a/src/IceRegistersARM32.h b/src/IceRegistersARM32.h |
| index 0caa9ccdf4e225ccfd0e40bcd6838c36bbb4011b..2434a4d29d3acdd64335e3518e808f76b4ca1bc7 100644 |
| --- a/src/IceRegistersARM32.h |
| +++ b/src/IceRegistersARM32.h |
| @@ -152,6 +152,21 @@ public: |
| return GPRRegister(Table[RegNum].Encoding); |
| } |
| + static inline SizeT getNumGPRs() { |
|
John
2016/01/11 13:40:36
You don't need this method if you use Table[] -- s
Karl
2016/01/11 17:59:44
This form is used because it allows it to be a con
|
| + return 0 |
| +#define X(val, encode, name, cc_arg, scratch, preserved, stackptr, frameptr, \ |
| + isGPR, isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) \ |
| + +(isGPR) |
| + REGARM32_TABLE |
| +#undef X |
| + ; |
| + } |
| + |
| + static inline IceString getGPRName(SizeT RegNum) { |
| + assert(RegNum <= getNumGPRs()); |
|
Jim Stichnoth
2016/01/10 18:22:00
Should this be "<" instead of "<=" ?
(same commen
John
2016/01/11 13:40:36
Now that we have RegARM32::Table[], this should be
Karl
2016/01/11 17:59:44
As far as John's comment, I was making too many as
Karl
2016/01/11 17:59:44
Done.
|
| + return getRegName(Reg_GPR_First + RegNum); |
| + } |
| + |
| static inline GPRRegister getI64PairFirstGPRNum(int32_t RegNum) { |
| assert(Reg_I64PAIR_First <= RegNum); |
| assert(RegNum <= Reg_I64PAIR_Last); |
| @@ -173,7 +188,18 @@ public: |
| } |
| static inline SizeT getNumSRegs() { |
|
John
2016/01/11 13:40:36
can you remove inline here, and add constexpr?
st
Karl
2016/01/11 17:59:44
Done.
|
| - return Reg_SREG_Last + 1 - Reg_SREG_First; |
| + return 0 |
| +#define X(val, encode, name, cc_arg, scratch, preserved, stackptr, frameptr, \ |
| + isGPR, isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) \ |
| + +(isFP32) |
| + REGARM32_TABLE |
| +#undef X |
| + ; |
| + } |
| + |
| + static inline IceString getSRegName(SizeT RegNum) { |
| + assert(RegNum <= getNumSRegs()); |
|
John
2016/01/11 13:40:36
Please use Table[].
assert(RegNum < Reg_NUM);
Karl
2016/01/11 17:59:44
Done.
|
| + return getRegName(Reg_SREG_First + RegNum); |
| } |
| static inline SRegister getEncodedSReg(int32_t RegNum) { |