diff options
| author | 2021-05-08 18:50:10 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:30 -0400 | |
| commit | 941c6dc740ed368edbbc00913ace73dddecd43ba (patch) | |
| tree | 8747fc4328791cf32e793d85dc5eaca9d9cded0a /src/shader_recompiler/backend/glasm/emit_glasm_select.cpp | |
| parent | glasm: Use BitField instead of C bitfields (diff) | |
| download | yuzu-941c6dc740ed368edbbc00913ace73dddecd43ba.tar.gz yuzu-941c6dc740ed368edbbc00913ace73dddecd43ba.tar.xz yuzu-941c6dc740ed368edbbc00913ace73dddecd43ba.zip | |
glasm: Implement BFI, BFE
Along with implementations of common instructions along the way
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_glasm_select.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_select.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp index e69de29bb..636cbe8a0 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <string_view> | ||
| 6 | |||
| 7 | #include "shader_recompiler/backend/glasm/emit_context.h" | ||
| 8 | #include "shader_recompiler/backend/glasm/emit_glasm_instructions.h" | ||
| 9 | #include "shader_recompiler/frontend/ir/value.h" | ||
| 10 | |||
| 11 | namespace Shader::Backend::GLASM { | ||
| 12 | |||
| 13 | void EmitSelectU1(EmitContext&, std::string_view, std::string_view, std::string_view) { | ||
| 14 | throw NotImplementedException("GLASM instruction"); | ||
| 15 | } | ||
| 16 | |||
| 17 | void EmitSelectU8(EmitContext&, std::string_view, std::string_view, std::string_view) { | ||
| 18 | throw NotImplementedException("GLASM instruction"); | ||
| 19 | } | ||
| 20 | |||
| 21 | void EmitSelectU16(EmitContext&, std::string_view, std::string_view, std::string_view) { | ||
| 22 | throw NotImplementedException("GLASM instruction"); | ||
| 23 | } | ||
| 24 | |||
| 25 | void EmitSelectU32(EmitContext& ctx, IR::Inst& inst, std::string_view cond, | ||
| 26 | std::string_view true_value, std::string_view false_value) { | ||
| 27 | ctx.Add("MOV.U.CC RC,{};", cond); | ||
| 28 | ctx.Add("IF NE.x;"); | ||
| 29 | ctx.Add("MOV.U {},{};", inst, true_value); | ||
| 30 | ctx.Add("ELSE;"); | ||
| 31 | ctx.Add("MOV.U {},{};", inst, false_value); | ||
| 32 | ctx.Add("ENDIF;"); | ||
| 33 | } | ||
| 34 | |||
| 35 | void EmitSelectU64(EmitContext&, std::string_view, std::string_view, std::string_view) { | ||
| 36 | throw NotImplementedException("GLASM instruction"); | ||
| 37 | } | ||
| 38 | |||
| 39 | void EmitSelectF16(EmitContext&, std::string_view, std::string_view, std::string_view) { | ||
| 40 | throw NotImplementedException("GLASM instruction"); | ||
| 41 | } | ||
| 42 | |||
| 43 | void EmitSelectF32(EmitContext&, std::string_view, std::string_view, std::string_view) { | ||
| 44 | throw NotImplementedException("GLASM instruction"); | ||
| 45 | } | ||
| 46 | |||
| 47 | void EmitSelectF64(EmitContext&, std::string_view, std::string_view, std::string_view) { | ||
| 48 | throw NotImplementedException("GLASM instruction"); | ||
| 49 | } | ||
| 50 | } // namespace Shader::Backend::GLASM | ||