forked from NUDT-compiler/nudt-compiler-cpp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.2 KiB
71 lines
2.2 KiB
#include "mir/MIR.h"
|
|
|
|
#include <stdexcept>
|
|
|
|
#include "utils/Log.h"
|
|
|
|
namespace mir {
|
|
|
|
const char* PhysRegName(PhysReg reg) {
|
|
switch (reg) {
|
|
case PhysReg::W0: return "w0";
|
|
case PhysReg::W1: return "w1";
|
|
case PhysReg::W2: return "w2";
|
|
case PhysReg::W3: return "w3";
|
|
case PhysReg::W4: return "w4";
|
|
case PhysReg::W5: return "w5";
|
|
case PhysReg::W6: return "w6";
|
|
case PhysReg::W7: return "w7";
|
|
case PhysReg::W8: return "w8";
|
|
case PhysReg::W9: return "w9";
|
|
case PhysReg::W10: return "w10";
|
|
case PhysReg::W11: return "w11";
|
|
case PhysReg::W12: return "w12";
|
|
case PhysReg::W13: return "w13";
|
|
case PhysReg::W14: return "w14";
|
|
case PhysReg::W15: return "w15";
|
|
case PhysReg::X0: return "x0";
|
|
case PhysReg::X1: return "x1";
|
|
case PhysReg::X2: return "x2";
|
|
case PhysReg::X3: return "x3";
|
|
case PhysReg::X4: return "x4";
|
|
case PhysReg::X5: return "x5";
|
|
case PhysReg::X6: return "x6";
|
|
case PhysReg::X7: return "x7";
|
|
case PhysReg::X8: return "x8";
|
|
case PhysReg::X9: return "x9";
|
|
case PhysReg::X10: return "x10";
|
|
case PhysReg::X11: return "x11";
|
|
case PhysReg::X12: return "x12";
|
|
case PhysReg::X13: return "x13";
|
|
case PhysReg::X14: return "x14";
|
|
case PhysReg::X15: return "x15";
|
|
case PhysReg::X16: return "x16";
|
|
case PhysReg::X17: return "x17";
|
|
case PhysReg::S0: return "s0";
|
|
case PhysReg::S1: return "s1";
|
|
case PhysReg::S2: return "s2";
|
|
case PhysReg::S3: return "s3";
|
|
case PhysReg::S4: return "s4";
|
|
case PhysReg::S5: return "s5";
|
|
case PhysReg::S6: return "s6";
|
|
case PhysReg::S7: return "s7";
|
|
case PhysReg::S8: return "s8";
|
|
case PhysReg::S9: return "s9";
|
|
case PhysReg::S10: return "s10";
|
|
case PhysReg::S11: return "s11";
|
|
case PhysReg::S12: return "s12";
|
|
case PhysReg::S13: return "s13";
|
|
case PhysReg::S14: return "s14";
|
|
case PhysReg::S15: return "s15";
|
|
case PhysReg::X29: return "x29";
|
|
case PhysReg::X30: return "x30";
|
|
case PhysReg::SP: return "sp";
|
|
case PhysReg::WZR: return "wzr";
|
|
case PhysReg::XZR: return "xzr";
|
|
}
|
|
throw std::runtime_error(FormatError("mir", "未知物理寄存器"));
|
|
}
|
|
|
|
} // namespace mir
|