forked from ppxf25tqu/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.
28 lines
491 B
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
|