IR/DumpBlock: Print references to ExtRegs

This commit is contained in:
MerryMage 2016-08-11 17:15:02 +01:00
parent b4c586d5ef
commit 8964b38cf9
3 changed files with 13 additions and 0 deletions

View file

@ -24,6 +24,16 @@ const char* RegToString(Reg reg) {
return reg_strs.at(static_cast<size_t>(reg));
}
const char* ExtRegToString(ExtReg reg) {
constexpr std::array<const char*, 64> reg_strs = {
"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",
"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 reg_strs.at(static_cast<size_t>(reg));
}
std::string RegListToString(RegList reg_list) {
std::string ret = "";
bool first_reg = true;

View file

@ -121,6 +121,7 @@ struct LocationDescriptorHash {
const char* CondToString(Cond cond, bool explicit_al = false);
const char* RegToString(Reg reg);
const char* ExtRegToString(ExtReg reg);
std::string RegListToString(RegList reg_list);
inline Reg operator+(Reg reg, int number) {

View file

@ -219,6 +219,8 @@ std::string DumpBlock(const IR::Block& block) {
return Common::StringFromFormat("#%#x", arg.GetU32());
case Type::RegRef:
return Arm::RegToString(arg.GetRegRef());
case Type::ExtRegRef:
return Arm::ExtRegToString(arg.GetExtRegRef());
default:
return "<unknown immediate type>";
}