diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-05-14 09:48:46 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:31 +0200 |
commit | bf5e48ffe4bd48ea681f2a01c8919c97125e88df (patch) | |
tree | 2127c2f01aa19b98672f1ac9f34395b9b0240b3e /src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp | |
parent | glasm: Write result to scalar on integer comparison instructions (diff) | |
download | yuzu-bf5e48ffe4bd48ea681f2a01c8919c97125e88df.tar yuzu-bf5e48ffe4bd48ea681f2a01c8919c97125e88df.tar.gz yuzu-bf5e48ffe4bd48ea681f2a01c8919c97125e88df.tar.bz2 yuzu-bf5e48ffe4bd48ea681f2a01c8919c97125e88df.tar.lz yuzu-bf5e48ffe4bd48ea681f2a01c8919c97125e88df.tar.xz yuzu-bf5e48ffe4bd48ea681f2a01c8919c97125e88df.tar.zst yuzu-bf5e48ffe4bd48ea681f2a01c8919c97125e88df.zip |
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.cpp | 27 |
1 files changed, 23 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 f37ad5587..969b91a81 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp @@ -17,13 +17,32 @@ namespace Shader::Backend::GLASM { #define NotImplemented() throw NotImplementedException("GLASM instruction {}", __LINE__) -void EmitPhi(EmitContext& ctx, IR::Inst& inst) { - NotImplemented(); -} +void EmitPhi(EmitContext&, IR::Inst&) {} void EmitVoid(EmitContext&) {} -void EmitBranchConditionRef(EmitContext&) {} +void EmitDummyReference(EmitContext&) {} + +void EmitPhiMove(EmitContext& ctx, const IR::Value& phi, const IR::Value& 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.InstRecursive()->Arg(0).Type()) { + case IR::Type::U1: + case IR::Type::U32: + case IR::Type::F32: + ctx.Add("MOV.S {}.x,{};", phi_reg, ScalarS32{eval_value}); + break; + case IR::Type::U64: + case IR::Type::F64: + ctx.Add("MOV.U64 {}.x,{};", phi_reg, ScalarRegister{eval_value}); + break; + default: + throw NotImplementedException("Phi node type {}", phi.Type()); + } +} void EmitJoin(EmitContext& ctx) { NotImplemented(); |