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.
nudt-compiler-cpp/src/mir/Register.cpp

28 lines
491 B

#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::W8:
return "w8";
case PhysReg::W9:
return "w9";
case PhysReg::X29:
return "x29";
case PhysReg::X30:
return "x30";
case PhysReg::SP:
return "sp";
}
throw std::runtime_error(FormatError("mir", "未知物理寄存器"));
}
} // namespace mir