diff options
| author | 2021-05-09 17:57:57 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:30 -0400 | |
| commit | 3e10709091ea6d126474dbac2f2c8f0b6e9a0d3f (patch) | |
| tree | 2ff037f85f9661b6f0cb94b416974520099748bb /src/shader_recompiler/backend/glasm/emit_glasm_select.cpp | |
| parent | glasm: Initial GLASM fp64 support (diff) | |
| download | yuzu-3e10709091ea6d126474dbac2f2c8f0b6e9a0d3f.tar.gz yuzu-3e10709091ea6d126474dbac2f2c8f0b6e9a0d3f.tar.xz yuzu-3e10709091ea6d126474dbac2f2c8f0b6e9a0d3f.zip | |
glasm: Reimplement bitwise ops and BFI/BFE
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_glasm_select.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_select.cpp | 52 |
1 files changed, 52 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..8f9df8e23 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | |||
| 2 | // Copyright 2021 yuzu Emulator Project | ||
| 3 | // Licensed under GPLv2 or any later version | ||
| 4 | // Refer to the license.txt file included. | ||
| 5 | |||
| 6 | #include "shader_recompiler/backend/glasm/emit_context.h" | ||
| 7 | #include "shader_recompiler/backend/glasm/emit_glasm_instructions.h" | ||
| 8 | #include "shader_recompiler/frontend/ir/value.h" | ||
| 9 | |||
| 10 | namespace Shader::Backend::GLASM { | ||
| 11 | |||
| 12 | void EmitSelectU1([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 cond, | ||
| 13 | [[maybe_unused]] ScalarS32 true_value, [[maybe_unused]] ScalarS32 false_value) { | ||
| 14 | throw NotImplementedException("GLASM instruction"); | ||
| 15 | } | ||
| 16 | |||
| 17 | void EmitSelectU8([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 cond, | ||
| 18 | [[maybe_unused]] ScalarS32 true_value, [[maybe_unused]] ScalarS32 false_value) { | ||
| 19 | throw NotImplementedException("GLASM instruction"); | ||
| 20 | } | ||
| 21 | |||
| 22 | void EmitSelectU16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 cond, | ||
| 23 | [[maybe_unused]] ScalarS32 true_value, [[maybe_unused]] ScalarS32 false_value) { | ||
| 24 | throw NotImplementedException("GLASM instruction"); | ||
| 25 | } | ||
| 26 | |||
| 27 | void EmitSelectU32(EmitContext& ctx, IR::Inst& inst, ScalarS32 cond, ScalarS32 true_value, | ||
| 28 | ScalarS32 false_value) { | ||
| 29 | ctx.Add("CMP.S {},{},{},{};", inst, cond, true_value, false_value); | ||
| 30 | } | ||
| 31 | |||
| 32 | void EmitSelectU64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 cond, | ||
| 33 | [[maybe_unused]] Register true_value, [[maybe_unused]] Register false_value) { | ||
| 34 | throw NotImplementedException("GLASM instruction"); | ||
| 35 | } | ||
| 36 | |||
| 37 | void EmitSelectF16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 cond, | ||
| 38 | [[maybe_unused]] Register true_value, [[maybe_unused]] Register false_value) { | ||
| 39 | throw NotImplementedException("GLASM instruction"); | ||
| 40 | } | ||
| 41 | |||
| 42 | void EmitSelectF32(EmitContext& ctx, IR::Inst& inst, ScalarS32 cond, ScalarS32 true_value, | ||
| 43 | ScalarS32 false_value) { | ||
| 44 | ctx.Add("CMP.S {},{},{},{};", inst, cond, true_value, false_value); | ||
| 45 | } | ||
| 46 | |||
| 47 | void EmitSelectF64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarS32 cond, | ||
| 48 | [[maybe_unused]] Register true_value, [[maybe_unused]] Register false_value) { | ||
| 49 | throw NotImplementedException("GLASM instruction"); | ||
| 50 | } | ||
| 51 | |||
| 52 | } // namespace Shader::Backend::GLASM | ||