summaryrefslogtreecommitdiff
path: root/src/shader_recompiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp2
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp2
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_floating_point.cpp2
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_integer.cpp4
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/integer_add_three_input.cpp2
5 files changed, 6 insertions, 6 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp
index 06599c1b0..49397c9b2 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_integer.cpp
@@ -39,7 +39,7 @@ void EmitIAdd32(EmitContext& ctx, IR::Inst& inst, std::string_view a, std::strin
39 // which may be overwritten by the result of the addition 39 // which may be overwritten by the result of the addition
40 if (IR::Inst * overflow{inst.GetAssociatedPseudoOperation(IR::Opcode::GetOverflowFromOp)}) { 40 if (IR::Inst * overflow{inst.GetAssociatedPseudoOperation(IR::Opcode::GetOverflowFromOp)}) {
41 // https://stackoverflow.com/questions/55468823/how-to-detect-integer-overflow-in-c 41 // https://stackoverflow.com/questions/55468823/how-to-detect-integer-overflow-in-c
42 constexpr static u32 s32_max{static_cast<u32>(std::numeric_limits<s32>::max())}; 42 constexpr u32 s32_max{static_cast<u32>(std::numeric_limits<s32>::max())};
43 const auto sub_a{fmt::format("{}u-{}", s32_max, a)}; 43 const auto sub_a{fmt::format("{}u-{}", s32_max, a)};
44 const auto positive_result{fmt::format("int({})>int({})", b, sub_a)}; 44 const auto positive_result{fmt::format("int({})>int({})", b, sub_a)};
45 const auto negative_result{fmt::format("int({})<int({})", b, sub_a)}; 45 const auto negative_result{fmt::format("int({})<int({})", b, sub_a)};
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp
index f6492dffd..960bdea6f 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp
@@ -42,7 +42,7 @@ Id EmitIAdd32(EmitContext& ctx, IR::Inst* inst, Id a, Id b) {
42 SetSignFlag(ctx, inst, result); 42 SetSignFlag(ctx, inst, result);
43 if (IR::Inst * overflow{inst->GetAssociatedPseudoOperation(IR::Opcode::GetOverflowFromOp)}) { 43 if (IR::Inst * overflow{inst->GetAssociatedPseudoOperation(IR::Opcode::GetOverflowFromOp)}) {
44 // https://stackoverflow.com/questions/55468823/how-to-detect-integer-overflow-in-c 44 // https://stackoverflow.com/questions/55468823/how-to-detect-integer-overflow-in-c
45 constexpr static u32 s32_max{static_cast<u32>(std::numeric_limits<s32>::max())}; 45 constexpr u32 s32_max{static_cast<u32>(std::numeric_limits<s32>::max())};
46 const Id is_positive{ctx.OpSGreaterThanEqual(ctx.U1, a, ctx.u32_zero_value)}; 46 const Id is_positive{ctx.OpSGreaterThanEqual(ctx.U1, a, ctx.u32_zero_value)};
47 const Id sub_a{ctx.OpISub(ctx.U32[1], ctx.Const(s32_max), a)}; 47 const Id sub_a{ctx.OpISub(ctx.U32[1], ctx.Const(s32_max), a)};
48 48
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_floating_point.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_floating_point.cpp
index 15ad55a43..7f3dccc52 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_floating_point.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_floating_point.cpp
@@ -48,7 +48,7 @@ void F2F(TranslatorVisitor& v, u64 insn, const IR::F16F32F64& src_a, bool abs) {
48 BitField<8, 2, FloatFormat> dst_size; 48 BitField<8, 2, FloatFormat> dst_size;
49 49
50 [[nodiscard]] RoundingOp RoundingOperation() const { 50 [[nodiscard]] RoundingOp RoundingOperation() const {
51 constexpr static u64 rounding_mask = 0x0B; 51 constexpr u64 rounding_mask = 0x0B;
52 return static_cast<RoundingOp>(rounding_op.Value() & rounding_mask); 52 return static_cast<RoundingOp>(rounding_op.Value() & rounding_mask);
53 } 53 }
54 } const f2f{insn}; 54 } const f2f{insn};
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_integer.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_integer.cpp
index 429733187..85c18d942 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_integer.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_conversion_integer.cpp
@@ -176,11 +176,11 @@ void TranslateF2I(TranslatorVisitor& v, u64 insn, const IR::F16F32F64& src_a) {
176 (f2i.src_format == SrcFormat::F64) != (f2i.dest_format == DestFormat::I64); 176 (f2i.src_format == SrcFormat::F64) != (f2i.dest_format == DestFormat::I64);
177 if (special_nan_cases) { 177 if (special_nan_cases) {
178 if (f2i.dest_format == DestFormat::I32) { 178 if (f2i.dest_format == DestFormat::I32) {
179 constexpr static u32 nan_value = 0x8000'0000U; 179 constexpr u32 nan_value = 0x8000'0000U;
180 handled_special_case = true; 180 handled_special_case = true;
181 result = IR::U32{v.ir.Select(v.ir.FPIsNan(op_a), v.ir.Imm32(nan_value), result)}; 181 result = IR::U32{v.ir.Select(v.ir.FPIsNan(op_a), v.ir.Imm32(nan_value), result)};
182 } else if (f2i.dest_format == DestFormat::I64) { 182 } else if (f2i.dest_format == DestFormat::I64) {
183 constexpr static u64 nan_value = 0x8000'0000'0000'0000ULL; 183 constexpr u64 nan_value = 0x8000'0000'0000'0000ULL;
184 handled_special_case = true; 184 handled_special_case = true;
185 result = IR::U64{v.ir.Select(v.ir.FPIsNan(op_a), v.ir.Imm64(nan_value), result)}; 185 result = IR::U64{v.ir.Select(v.ir.FPIsNan(op_a), v.ir.Imm64(nan_value), result)};
186 } 186 }
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_add_three_input.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_add_three_input.cpp
index 3c8ef62e2..3d9877359 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_add_three_input.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_add_three_input.cpp
@@ -19,7 +19,7 @@ enum class Half : u64 {
19}; 19};
20 20
21[[nodiscard]] IR::U32 IntegerHalf(IR::IREmitter& ir, const IR::U32& value, Half half) { 21[[nodiscard]] IR::U32 IntegerHalf(IR::IREmitter& ir, const IR::U32& value, Half half) {
22 constexpr static bool is_signed{false}; 22 constexpr bool is_signed{false};
23 switch (half) { 23 switch (half) {
24 case Half::All: 24 case Half::All:
25 return value; 25 return value;