summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-05-26 20:41:53 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:33 +0200
commit586c785366307cb3c648bd33345b431b8312612d (patch)
tree69992ad1ddc8bb5c86f91b48b39c311bda605a26 /src/shader_recompiler
parentglasm: Implement undef instructions (diff)
downloadyuzu-586c785366307cb3c648bd33345b431b8312612d.tar
yuzu-586c785366307cb3c648bd33345b431b8312612d.tar.gz
yuzu-586c785366307cb3c648bd33345b431b8312612d.tar.bz2
yuzu-586c785366307cb3c648bd33345b431b8312612d.tar.lz
yuzu-586c785366307cb3c648bd33345b431b8312612d.tar.xz
yuzu-586c785366307cb3c648bd33345b431b8312612d.tar.zst
yuzu-586c785366307cb3c648bd33345b431b8312612d.zip
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp4
-rw-r--r--src/shader_recompiler/frontend/ir/value.h13
2 files changed, 16 insertions, 1 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 c76b45b8b..022b6584c 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp
@@ -58,7 +58,9 @@ void EmitPhiMove(EmitContext& ctx, const IR::Value& phi_value, const IR::Value&
}
const Register phi_reg{ctx.reg_alloc.Consume(IR::Value{&phi})};
const Value eval_value{ctx.reg_alloc.Consume(value)};
-
+ if (!value.IsImmediate() && IR::IsUndef(RegAlloc::AliasInst(*value.Inst()))) {
+ return;
+ }
if (phi_reg == eval_value) {
return;
}
diff --git a/src/shader_recompiler/frontend/ir/value.h b/src/shader_recompiler/frontend/ir/value.h
index 0c6bf684d..090cc1739 100644
--- a/src/shader_recompiler/frontend/ir/value.h
+++ b/src/shader_recompiler/frontend/ir/value.h
@@ -395,4 +395,17 @@ inline f64 Value::F64() const {
return inst.GetOpcode() == Opcode::Phi;
}
+[[nodiscard]] inline bool IsUndef(const Inst& inst) {
+ switch (inst.GetOpcode()) {
+ case Opcode::UndefU1:
+ case Opcode::UndefU8:
+ case Opcode::UndefU16:
+ case Opcode::UndefU32:
+ case Opcode::UndefU64:
+ return true;
+ default:
+ return false;
+ }
+}
+
} // namespace Shader::IR