diff options
Diffstat (limited to 'src/shader_recompiler/backend/glasm')
3 files changed, 8 insertions, 12 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h index 13f47b253..222285021 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h +++ b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h | |||
| @@ -214,8 +214,8 @@ void EmitSelectU64(EmitContext& ctx, std::string_view cond, std::string_view tru | |||
| 214 | std::string_view false_value); | 214 | std::string_view false_value); |
| 215 | void EmitSelectF16(EmitContext& ctx, std::string_view cond, std::string_view true_value, | 215 | void EmitSelectF16(EmitContext& ctx, std::string_view cond, std::string_view true_value, |
| 216 | std::string_view false_value); | 216 | std::string_view false_value); |
| 217 | void EmitSelectF32(EmitContext& ctx, std::string_view cond, std::string_view true_value, | 217 | void EmitSelectF32(EmitContext& ctx, IR::Inst& inst, std::string_view cond, |
| 218 | std::string_view false_value); | 218 | std::string_view true_value, std::string_view false_value); |
| 219 | void EmitSelectF64(EmitContext& ctx, std::string_view cond, std::string_view true_value, | 219 | void EmitSelectF64(EmitContext& ctx, std::string_view cond, std::string_view true_value, |
| 220 | std::string_view false_value); | 220 | std::string_view false_value); |
| 221 | void EmitBitCastU16F16(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); | 221 | void EmitBitCastU16F16(EmitContext& ctx, IR::Inst& inst, const IR::Value& value); |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp index 1289d950f..579806c38 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_integer.cpp | |||
| @@ -12,7 +12,7 @@ namespace Shader::Backend::GLASM { | |||
| 12 | 12 | ||
| 13 | void EmitIAdd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 13 | void EmitIAdd32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 14 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 14 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { |
| 15 | ctx.Add("ADD {},{},{};", inst, a, b); | 15 | ctx.Add("ADD.U {},{},{};", inst, a, b); |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | void EmitIAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 18 | void EmitIAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| @@ -22,7 +22,7 @@ void EmitIAdd64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& in | |||
| 22 | 22 | ||
| 23 | void EmitISub32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 23 | void EmitISub32([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
| 24 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { | 24 | [[maybe_unused]] std::string_view a, [[maybe_unused]] std::string_view b) { |
| 25 | ctx.Add("SUB {},{},{};", inst, a, b); | 25 | ctx.Add("SUB.U {},{},{};", inst, a, b); |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, | 28 | void EmitISub64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] IR::Inst& inst, |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp index 636cbe8a0..16f6c33f3 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_select.cpp | |||
| @@ -24,12 +24,7 @@ void EmitSelectU16(EmitContext&, std::string_view, std::string_view, std::string | |||
| 24 | 24 | ||
| 25 | void EmitSelectU32(EmitContext& ctx, IR::Inst& inst, std::string_view cond, | 25 | void EmitSelectU32(EmitContext& ctx, IR::Inst& inst, std::string_view cond, |
| 26 | std::string_view true_value, std::string_view false_value) { | 26 | std::string_view true_value, std::string_view false_value) { |
| 27 | ctx.Add("MOV.U.CC RC,{};", cond); | 27 | ctx.Add("CMP.S {},{},{},{};", inst, cond, true_value, false_value); |
| 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 | } | 28 | } |
| 34 | 29 | ||
| 35 | void EmitSelectU64(EmitContext&, std::string_view, std::string_view, std::string_view) { | 30 | void EmitSelectU64(EmitContext&, std::string_view, std::string_view, std::string_view) { |
| @@ -40,8 +35,9 @@ void EmitSelectF16(EmitContext&, std::string_view, std::string_view, std::string | |||
| 40 | throw NotImplementedException("GLASM instruction"); | 35 | throw NotImplementedException("GLASM instruction"); |
| 41 | } | 36 | } |
| 42 | 37 | ||
| 43 | void EmitSelectF32(EmitContext&, std::string_view, std::string_view, std::string_view) { | 38 | void EmitSelectF32(EmitContext& ctx, IR::Inst& inst, std::string_view cond, |
| 44 | throw NotImplementedException("GLASM instruction"); | 39 | std::string_view true_value, std::string_view false_value) { |
| 40 | ctx.Add("CMP.S {},{},{},{};", inst, cond, true_value, false_value); | ||
| 45 | } | 41 | } |
| 46 | 42 | ||
| 47 | void EmitSelectF64(EmitContext&, std::string_view, std::string_view, std::string_view) { | 43 | void EmitSelectF64(EmitContext&, std::string_view, std::string_view, std::string_view) { |