ir_opt/a64_get_set_elimination_pass: Add handling for NZCV raw get and set operations
This commit is contained in:
parent
aa22db534b
commit
6aed4036ef
1 changed files with 9 additions and 1 deletions
|
@ -23,7 +23,7 @@ void A64GetSetElimination(IR::Block& block) {
|
||||||
enum class TrackingType {
|
enum class TrackingType {
|
||||||
W, X,
|
W, X,
|
||||||
S, D, Q,
|
S, D, Q,
|
||||||
SP, NZCV,
|
SP, NZCV, NZCVRaw,
|
||||||
};
|
};
|
||||||
struct RegisterInfo {
|
struct RegisterInfo {
|
||||||
IR::Value register_value;
|
IR::Value register_value;
|
||||||
|
@ -100,6 +100,10 @@ void A64GetSetElimination(IR::Block& block) {
|
||||||
do_get(sp_info, inst, TrackingType::SP);
|
do_get(sp_info, inst, TrackingType::SP);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case IR::Opcode::A64GetNZCVRaw: {
|
||||||
|
do_get(nzcv_info, inst, TrackingType::NZCVRaw);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case IR::Opcode::A64SetW: {
|
case IR::Opcode::A64SetW: {
|
||||||
const size_t index = A64::RegNumber(inst->GetArg(0).GetA64RegRef());
|
const size_t index = A64::RegNumber(inst->GetArg(0).GetA64RegRef());
|
||||||
do_set(reg_info.at(index), inst->GetArg(1), inst, TrackingType::W);
|
do_set(reg_info.at(index), inst->GetArg(1), inst, TrackingType::W);
|
||||||
|
@ -133,6 +137,10 @@ void A64GetSetElimination(IR::Block& block) {
|
||||||
do_set(nzcv_info, inst->GetArg(0), inst, TrackingType::NZCV);
|
do_set(nzcv_info, inst->GetArg(0), inst, TrackingType::NZCV);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case IR::Opcode::A64SetNZCVRaw: {
|
||||||
|
do_set(nzcv_info, inst->GetArg(0), inst, TrackingType::NZCVRaw);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
if (inst->ReadsFromCPSR() || inst->WritesToCPSR()) {
|
if (inst->ReadsFromCPSR() || inst->WritesToCPSR()) {
|
||||||
nzcv_info = {};
|
nzcv_info = {};
|
||||||
|
|
Loading…
Reference in a new issue