aboutsummaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-05-24 20:59:49 -0300
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-22 21:51:33 -0400
commit9fbfe7d676790dea160368eda6492e8feb6e2f4a (patch)
tree81bc6a375849fc6b114ec5cf26880bd93656099c /src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp
parent40179282137370380387cab2610dcf21bd709efa (diff)
glasm: Fix usage counting on phi nodes
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp')
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp
index 756134d02..3d7a3ebb4 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp
@@ -17,18 +17,26 @@ namespace Shader::Backend::GLASM {
#define NotImplemented() throw NotImplementedException("GLASM instruction {}", __LINE__)
-void EmitPhi(EmitContext&, IR::Inst&) {}
+void EmitPhi(EmitContext& ctx, IR::Inst& inst) {
+ const size_t num_args{inst.NumArgs()};
+ for (size_t i = 0; i < num_args; ++i) {
+ ctx.reg_alloc.Consume(inst.Arg(i));
+ }
+}
void EmitVoid(EmitContext&) {}
-void EmitReference(EmitContext&) {}
+void EmitReference(EmitContext& ctx, const IR::Value& value) {
+ ctx.reg_alloc.Consume(value);
+}
void EmitPhiMove(EmitContext& ctx, const IR::Value& phi, const IR::Value& value) {
+ const Register phi_reg{ctx.reg_alloc.Consume(phi)};
+ const Value eval_value{ctx.reg_alloc.Consume(value)};
+
if (phi == value) {
return;
}
- const Register phi_reg{ctx.reg_alloc.Consume(phi)};
- const Value eval_value{ctx.reg_alloc.Consume(value)};
switch (phi.Inst()->Flags<IR::Type>()) {
case IR::Type::U1:
case IR::Type::U32: