diff options
Diffstat (limited to 'src/shader_recompiler/backend/glasm')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_instructions.h | 12 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_shared_memory.cpp | 52 |
2 files changed, 29 insertions, 35 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h index 9f76fc6c2..ad640bcb9 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h +++ b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h | |||
| @@ -120,13 +120,13 @@ void EmitWriteStorage64(EmitContext& ctx, const IR::Value& binding, ScalarU32 of | |||
| 120 | Register value); | 120 | Register value); |
| 121 | void EmitWriteStorage128(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, | 121 | void EmitWriteStorage128(EmitContext& ctx, const IR::Value& binding, ScalarU32 offset, |
| 122 | Register value); | 122 | Register value); |
| 123 | void EmitLoadSharedU8(EmitContext& ctx, ScalarU32 offset); | 123 | void EmitLoadSharedU8(EmitContext& ctx, IR::Inst& inst, ScalarU32 offset); |
| 124 | void EmitLoadSharedS8(EmitContext& ctx, ScalarU32 offset); | 124 | void EmitLoadSharedS8(EmitContext& ctx, IR::Inst& inst, ScalarU32 offset); |
| 125 | void EmitLoadSharedU16(EmitContext& ctx, ScalarU32 offset); | 125 | void EmitLoadSharedU16(EmitContext& ctx, IR::Inst& inst, ScalarU32 offset); |
| 126 | void EmitLoadSharedS16(EmitContext& ctx, ScalarU32 offset); | 126 | void EmitLoadSharedS16(EmitContext& ctx, IR::Inst& inst, ScalarU32 offset); |
| 127 | void EmitLoadSharedU32(EmitContext& ctx, ScalarU32 offset); | 127 | void EmitLoadSharedU32(EmitContext& ctx, IR::Inst& inst, ScalarU32 offset); |
| 128 | void EmitLoadSharedU64(EmitContext& ctx, IR::Inst& inst, ScalarU32 offset); | 128 | void EmitLoadSharedU64(EmitContext& ctx, IR::Inst& inst, ScalarU32 offset); |
| 129 | void EmitLoadSharedU128(EmitContext& ctx, ScalarU32 offset); | 129 | void EmitLoadSharedU128(EmitContext& ctx, IR::Inst& inst, ScalarU32 offset); |
| 130 | void EmitWriteSharedU8(EmitContext& ctx, ScalarU32 offset, ScalarU32 value); | 130 | void EmitWriteSharedU8(EmitContext& ctx, ScalarU32 offset, ScalarU32 value); |
| 131 | void EmitWriteSharedU16(EmitContext& ctx, ScalarU32 offset, ScalarU32 value); | 131 | void EmitWriteSharedU16(EmitContext& ctx, ScalarU32 offset, ScalarU32 value); |
| 132 | void EmitWriteSharedU32(EmitContext& ctx, ScalarU32 offset, ScalarU32 value); | 132 | void EmitWriteSharedU32(EmitContext& ctx, ScalarU32 offset, ScalarU32 value); |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_shared_memory.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_shared_memory.cpp index 32cc5d92c..c1498f449 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_shared_memory.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_shared_memory.cpp | |||
| @@ -8,57 +8,51 @@ | |||
| 8 | #include "shader_recompiler/frontend/ir/value.h" | 8 | #include "shader_recompiler/frontend/ir/value.h" |
| 9 | 9 | ||
| 10 | namespace Shader::Backend::GLASM { | 10 | namespace Shader::Backend::GLASM { |
| 11 | void EmitLoadSharedU8([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 offset) { | 11 | void EmitLoadSharedU8(EmitContext& ctx, IR::Inst& inst, ScalarU32 offset) { |
| 12 | throw NotImplementedException("GLASM instruction"); | 12 | ctx.Add("LDS.U8 {},shared_mem[{}];", inst, offset); |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | void EmitLoadSharedS8([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 offset) { | 15 | void EmitLoadSharedS8(EmitContext& ctx, IR::Inst& inst, ScalarU32 offset) { |
| 16 | throw NotImplementedException("GLASM instruction"); | 16 | ctx.Add("LDS.S8 {},shared_mem[{}];", inst, offset); |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | void EmitLoadSharedU16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 offset) { | 19 | void EmitLoadSharedU16(EmitContext& ctx, IR::Inst& inst, ScalarU32 offset) { |
| 20 | throw NotImplementedException("GLASM instruction"); | 20 | ctx.Add("LDS.U16 {},shared_mem[{}];", inst, offset); |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | void EmitLoadSharedS16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 offset) { | 23 | void EmitLoadSharedS16(EmitContext& ctx, IR::Inst& inst, ScalarU32 offset) { |
| 24 | throw NotImplementedException("GLASM instruction"); | 24 | ctx.Add("LDS.S16 {},shared_mem[{}];", inst, offset); |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | void EmitLoadSharedU32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 offset) { | 27 | void EmitLoadSharedU32(EmitContext& ctx, IR::Inst& inst, ScalarU32 offset) { |
| 28 | throw NotImplementedException("GLASM instruction"); | 28 | ctx.Add("LDS.U32 {},shared_mem[{}];", inst, offset); |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | void EmitLoadSharedU64([[maybe_unused]] EmitContext& ctx, IR::Inst& inst, | 31 | void EmitLoadSharedU64(EmitContext& ctx, IR::Inst& inst, ScalarU32 offset) { |
| 32 | [[maybe_unused]] ScalarU32 offset) { | 32 | ctx.Add("LDS.U32X2 {},shared_mem[{}];", inst, offset); |
| 33 | ctx.LongAdd("LDS.U64 {},shared_mem[{}];", inst, offset); | ||
| 34 | } | 33 | } |
| 35 | 34 | ||
| 36 | void EmitLoadSharedU128([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 offset) { | 35 | void EmitLoadSharedU128(EmitContext& ctx, IR::Inst& inst, ScalarU32 offset) { |
| 37 | throw NotImplementedException("GLASM instruction"); | 36 | ctx.Add("LDS.U32X4 {},shared_mem[{}];", inst, offset); |
| 38 | } | 37 | } |
| 39 | 38 | ||
| 40 | void EmitWriteSharedU8([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 offset, | 39 | void EmitWriteSharedU8(EmitContext& ctx, ScalarU32 offset, ScalarU32 value) { |
| 41 | [[maybe_unused]] ScalarU32 value) { | 40 | ctx.Add("STS.U8 {},shared_mem[{}];", value, offset); |
| 42 | throw NotImplementedException("GLASM instruction"); | ||
| 43 | } | 41 | } |
| 44 | 42 | ||
| 45 | void EmitWriteSharedU16([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 offset, | 43 | void EmitWriteSharedU16(EmitContext& ctx, ScalarU32 offset, ScalarU32 value) { |
| 46 | [[maybe_unused]] ScalarU32 value) { | 44 | ctx.Add("STS.U16 {},shared_mem[{}];", value, offset); |
| 47 | throw NotImplementedException("GLASM instruction"); | ||
| 48 | } | 45 | } |
| 49 | 46 | ||
| 50 | void EmitWriteSharedU32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 offset, | 47 | void EmitWriteSharedU32(EmitContext& ctx, ScalarU32 offset, ScalarU32 value) { |
| 51 | [[maybe_unused]] ScalarU32 value) { | ||
| 52 | ctx.Add("STS.U32 {},shared_mem[{}];", value, offset); | 48 | ctx.Add("STS.U32 {},shared_mem[{}];", value, offset); |
| 53 | } | 49 | } |
| 54 | 50 | ||
| 55 | void EmitWriteSharedU64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 offset, | 51 | void EmitWriteSharedU64(EmitContext& ctx, ScalarU32 offset, Register value) { |
| 56 | [[maybe_unused]] Register value) { | 52 | ctx.Add("STS.U32X2 {},shared_mem[{}];", value, offset); |
| 57 | ctx.Add("STS.U64 {},shared_mem[{}];", value, offset); | ||
| 58 | } | 53 | } |
| 59 | 54 | ||
| 60 | void EmitWriteSharedU128([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] ScalarU32 offset, | 55 | void EmitWriteSharedU128(EmitContext& ctx, ScalarU32 offset, Register value) { |
| 61 | [[maybe_unused]] Register value) { | 56 | ctx.Add("STS.U32X4 {},shared_mem[{}];", value, offset); |
| 62 | throw NotImplementedException("GLASM instruction"); | ||
| 63 | } | 57 | } |
| 64 | } // namespace Shader::Backend::GLASM | 58 | } // namespace Shader::Backend::GLASM |