From 6aed4036ef8abaa950663f0aa0175d27d3228223 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 6 Mar 2019 18:46:30 -0500 Subject: [PATCH] ir_opt/a64_get_set_elimination_pass: Add handling for NZCV raw get and set operations --- src/ir_opt/a64_get_set_elimination_pass.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ir_opt/a64_get_set_elimination_pass.cpp b/src/ir_opt/a64_get_set_elimination_pass.cpp index 748ed7c4..56da5046 100644 --- a/src/ir_opt/a64_get_set_elimination_pass.cpp +++ b/src/ir_opt/a64_get_set_elimination_pass.cpp @@ -23,7 +23,7 @@ void A64GetSetElimination(IR::Block& block) { enum class TrackingType { W, X, S, D, Q, - SP, NZCV, + SP, NZCV, NZCVRaw, }; struct RegisterInfo { IR::Value register_value; @@ -100,6 +100,10 @@ void A64GetSetElimination(IR::Block& block) { do_get(sp_info, inst, TrackingType::SP); break; } + case IR::Opcode::A64GetNZCVRaw: { + do_get(nzcv_info, inst, TrackingType::NZCVRaw); + break; + } case IR::Opcode::A64SetW: { const size_t index = A64::RegNumber(inst->GetArg(0).GetA64RegRef()); 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); break; } + case IR::Opcode::A64SetNZCVRaw: { + do_set(nzcv_info, inst->GetArg(0), inst, TrackingType::NZCVRaw); + break; + } default: { if (inst->ReadsFromCPSR() || inst->WritesToCPSR()) { nzcv_info = {};