diff options
Diffstat (limited to '')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp | 4 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/value.h | 13 |
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& | |||
| 58 | } | 58 | } |
| 59 | const Register phi_reg{ctx.reg_alloc.Consume(IR::Value{&phi})}; | 59 | const Register phi_reg{ctx.reg_alloc.Consume(IR::Value{&phi})}; |
| 60 | const Value eval_value{ctx.reg_alloc.Consume(value)}; | 60 | const Value eval_value{ctx.reg_alloc.Consume(value)}; |
| 61 | 61 | if (!value.IsImmediate() && IR::IsUndef(RegAlloc::AliasInst(*value.Inst()))) { | |
| 62 | return; | ||
| 63 | } | ||
| 62 | if (phi_reg == eval_value) { | 64 | if (phi_reg == eval_value) { |
| 63 | return; | 65 | return; |
| 64 | } | 66 | } |
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 { | |||
| 395 | return inst.GetOpcode() == Opcode::Phi; | 395 | return inst.GetOpcode() == Opcode::Phi; |
| 396 | } | 396 | } |
| 397 | 397 | ||
| 398 | [[nodiscard]] inline bool IsUndef(const Inst& inst) { | ||
| 399 | switch (inst.GetOpcode()) { | ||
| 400 | case Opcode::UndefU1: | ||
| 401 | case Opcode::UndefU8: | ||
| 402 | case Opcode::UndefU16: | ||
| 403 | case Opcode::UndefU32: | ||
| 404 | case Opcode::UndefU64: | ||
| 405 | return true; | ||
| 406 | default: | ||
| 407 | return false; | ||
| 408 | } | ||
| 409 | } | ||
| 410 | |||
| 398 | } // namespace Shader::IR | 411 | } // namespace Shader::IR |