diff options
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/translate')
30 files changed, 90 insertions, 87 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/double_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/double_add.cpp index ac1433dea..5a1b3a8fc 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/double_add.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/double_add.cpp | |||
| @@ -31,9 +31,9 @@ void DADD(TranslatorVisitor& v, u64 insn, const IR::F64& src_b) { | |||
| 31 | const IR::F64 op_b{v.ir.FPAbsNeg(src_b, dadd.abs_b != 0, dadd.neg_b != 0)}; | 31 | const IR::F64 op_b{v.ir.FPAbsNeg(src_b, dadd.abs_b != 0, dadd.neg_b != 0)}; |
| 32 | 32 | ||
| 33 | const IR::FpControl control{ | 33 | const IR::FpControl control{ |
| 34 | .no_contraction{true}, | 34 | .no_contraction = true, |
| 35 | .rounding{CastFpRounding(dadd.fp_rounding)}, | 35 | .rounding = CastFpRounding(dadd.fp_rounding), |
| 36 | .fmz_mode{IR::FmzMode::None}, | 36 | .fmz_mode = IR::FmzMode::None, |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | v.D(dadd.dest_reg, v.ir.FPAdd(op_a, op_b, control)); | 39 | v.D(dadd.dest_reg, v.ir.FPAdd(op_a, op_b, control)); |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/double_fused_multiply_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/double_fused_multiply_add.cpp index ff7321862..723841496 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/double_fused_multiply_add.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/double_fused_multiply_add.cpp | |||
| @@ -25,9 +25,9 @@ void DFMA(TranslatorVisitor& v, u64 insn, const IR::F64& src_b, const IR::F64& s | |||
| 25 | const IR::F64 op_c{v.ir.FPAbsNeg(src_c, false, dfma.neg_c != 0)}; | 25 | const IR::F64 op_c{v.ir.FPAbsNeg(src_c, false, dfma.neg_c != 0)}; |
| 26 | 26 | ||
| 27 | const IR::FpControl control{ | 27 | const IR::FpControl control{ |
| 28 | .no_contraction{true}, | 28 | .no_contraction = true, |
| 29 | .rounding{CastFpRounding(dfma.fp_rounding)}, | 29 | .rounding = CastFpRounding(dfma.fp_rounding), |
| 30 | .fmz_mode{IR::FmzMode::None}, | 30 | .fmz_mode = IR::FmzMode::None, |
| 31 | }; | 31 | }; |
| 32 | 32 | ||
| 33 | v.D(dfma.dest_reg, v.ir.FPFma(src_a, op_b, op_c, control)); | 33 | v.D(dfma.dest_reg, v.ir.FPFma(src_a, op_b, op_c, control)); |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/double_multiply.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/double_multiply.cpp index 3e83d1c95..4a49299a0 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/double_multiply.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/double_multiply.cpp | |||
| @@ -21,9 +21,9 @@ void DMUL(TranslatorVisitor& v, u64 insn, const IR::F64& src_b) { | |||
| 21 | 21 | ||
| 22 | const IR::F64 src_a{v.ir.FPAbsNeg(v.D(dmul.src_a_reg), false, dmul.neg != 0)}; | 22 | const IR::F64 src_a{v.ir.FPAbsNeg(v.D(dmul.src_a_reg), false, dmul.neg != 0)}; |
| 23 | const IR::FpControl control{ | 23 | const IR::FpControl control{ |
| 24 | .no_contraction{true}, | 24 | .no_contraction = true, |
| 25 | .rounding{CastFpRounding(dmul.fp_rounding)}, | 25 | .rounding = CastFpRounding(dmul.fp_rounding), |
| 26 | .fmz_mode{IR::FmzMode::None}, | 26 | .fmz_mode = IR::FmzMode::None, |
| 27 | }; | 27 | }; |
| 28 | 28 | ||
| 29 | v.D(dmul.dest_reg, v.ir.FPMul(src_a, src_b, control)); | 29 | v.D(dmul.dest_reg, v.ir.FPMul(src_a, src_b, control)); |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_add.cpp index b39950c84..b8c89810c 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_add.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_add.cpp | |||
| @@ -23,9 +23,9 @@ void FADD(TranslatorVisitor& v, u64 insn, bool sat, bool cc, bool ftz, FpRoundin | |||
| 23 | const IR::F32 op_a{v.ir.FPAbsNeg(v.F(fadd.src_a), abs_a, neg_a)}; | 23 | const IR::F32 op_a{v.ir.FPAbsNeg(v.F(fadd.src_a), abs_a, neg_a)}; |
| 24 | const IR::F32 op_b{v.ir.FPAbsNeg(src_b, abs_b, neg_b)}; | 24 | const IR::F32 op_b{v.ir.FPAbsNeg(src_b, abs_b, neg_b)}; |
| 25 | IR::FpControl control{ | 25 | IR::FpControl control{ |
| 26 | .no_contraction{true}, | 26 | .no_contraction = true, |
| 27 | .rounding{CastFpRounding(fp_rounding)}, | 27 | .rounding = CastFpRounding(fp_rounding), |
| 28 | .fmz_mode{ftz ? IR::FmzMode::FTZ : IR::FmzMode::None}, | 28 | .fmz_mode = (ftz ? IR::FmzMode::FTZ : IR::FmzMode::None), |
| 29 | }; | 29 | }; |
| 30 | IR::F32 value{v.ir.FPAdd(op_a, op_b, control)}; | 30 | IR::F32 value{v.ir.FPAdd(op_a, op_b, control)}; |
| 31 | if (sat) { | 31 | if (sat) { |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare.cpp index c02a40209..80109ca0e 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare.cpp | |||
| @@ -19,8 +19,7 @@ void FCMP(TranslatorVisitor& v, u64 insn, const IR::U32& src_a, const IR::F32& o | |||
| 19 | } const fcmp{insn}; | 19 | } const fcmp{insn}; |
| 20 | 20 | ||
| 21 | const IR::F32 zero{v.ir.Imm32(0.0f)}; | 21 | const IR::F32 zero{v.ir.Imm32(0.0f)}; |
| 22 | const IR::F32 neg_zero{v.ir.Imm32(-0.0f)}; | 22 | const IR::FpControl control{.fmz_mode = (fcmp.ftz != 0 ? IR::FmzMode::FTZ : IR::FmzMode::None)}; |
| 23 | const IR::FpControl control{.fmz_mode{fcmp.ftz != 0 ? IR::FmzMode::FTZ : IR::FmzMode::None}}; | ||
| 24 | const IR::U1 cmp_result{FloatingPointCompare(v.ir, operand, zero, fcmp.compare_op, control)}; | 23 | const IR::U1 cmp_result{FloatingPointCompare(v.ir, operand, zero, fcmp.compare_op, control)}; |
| 25 | const IR::U32 src_reg{v.X(fcmp.src_reg)}; | 24 | const IR::U32 src_reg{v.X(fcmp.src_reg)}; |
| 26 | const IR::U32 result{v.ir.Select(cmp_result, src_reg, src_a)}; | 25 | const IR::U32 result{v.ir.Select(cmp_result, src_reg, src_a)}; |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare_and_set.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare_and_set.cpp index c5417775e..b9f4ee0d9 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare_and_set.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_compare_and_set.cpp | |||
| @@ -29,9 +29,9 @@ void FSET(TranslatorVisitor& v, u64 insn, const IR::F32& src_b) { | |||
| 29 | const IR::F32 op_a{v.ir.FPAbsNeg(v.F(fset.src_a_reg), fset.abs_a != 0, fset.negate_a != 0)}; | 29 | const IR::F32 op_a{v.ir.FPAbsNeg(v.F(fset.src_a_reg), fset.abs_a != 0, fset.negate_a != 0)}; |
| 30 | const IR::F32 op_b = v.ir.FPAbsNeg(src_b, fset.abs_b != 0, fset.negate_b != 0); | 30 | const IR::F32 op_b = v.ir.FPAbsNeg(src_b, fset.abs_b != 0, fset.negate_b != 0); |
| 31 | const IR::FpControl control{ | 31 | const IR::FpControl control{ |
| 32 | .no_contraction{false}, | 32 | .no_contraction = false, |
| 33 | .rounding{IR::FpRounding::DontCare}, | 33 | .rounding = IR::FpRounding::DontCare, |
| 34 | .fmz_mode{fset.ftz != 0 ? IR::FmzMode::FTZ : IR::FmzMode::None}, | 34 | .fmz_mode = (fset.ftz != 0 ? IR::FmzMode::FTZ : IR::FmzMode::None), |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | IR::U1 pred{v.ir.GetPred(fset.pred)}; | 37 | IR::U1 pred{v.ir.GetPred(fset.pred)}; |
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 1e366fde0..035f8782a 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 | |||
| @@ -57,9 +57,9 @@ void F2F(TranslatorVisitor& v, u64 insn, const IR::F16F32F64& src_a, bool abs) { | |||
| 57 | 57 | ||
| 58 | const bool any_fp64{f2f.src_size == FloatFormat::F64 || f2f.dst_size == FloatFormat::F64}; | 58 | const bool any_fp64{f2f.src_size == FloatFormat::F64 || f2f.dst_size == FloatFormat::F64}; |
| 59 | IR::FpControl fp_control{ | 59 | IR::FpControl fp_control{ |
| 60 | .no_contraction{false}, | 60 | .no_contraction = false, |
| 61 | .rounding{IR::FpRounding::DontCare}, | 61 | .rounding = IR::FpRounding::DontCare, |
| 62 | .fmz_mode{f2f.ftz != 0 && !any_fp64 ? IR::FmzMode::FTZ : IR::FmzMode::None}, | 62 | .fmz_mode = (f2f.ftz != 0 && !any_fp64 ? IR::FmzMode::FTZ : IR::FmzMode::None), |
| 63 | }; | 63 | }; |
| 64 | if (f2f.src_size != f2f.dst_size) { | 64 | if (f2f.src_size != f2f.dst_size) { |
| 65 | fp_control.rounding = CastFpRounding(f2f.rounding); | 65 | fp_control.rounding = CastFpRounding(f2f.rounding); |
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 21ae92be1..cf3cf1ba6 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 | |||
| @@ -123,9 +123,9 @@ void TranslateF2I(TranslatorVisitor& v, u64 insn, const IR::F16F32F64& src_a) { | |||
| 123 | fmz_mode = f2i.ftz != 0 ? IR::FmzMode::FTZ : IR::FmzMode::None; | 123 | fmz_mode = f2i.ftz != 0 ? IR::FmzMode::FTZ : IR::FmzMode::None; |
| 124 | } | 124 | } |
| 125 | const IR::FpControl fp_control{ | 125 | const IR::FpControl fp_control{ |
| 126 | .no_contraction{true}, | 126 | .no_contraction = true, |
| 127 | .rounding{IR::FpRounding::DontCare}, | 127 | .rounding = IR::FpRounding::DontCare, |
| 128 | .fmz_mode{fmz_mode}, | 128 | .fmz_mode = fmz_mode, |
| 129 | }; | 129 | }; |
| 130 | const IR::F16F32F64 op_a{v.ir.FPAbsNeg(src_a, f2i.abs != 0, f2i.neg != 0)}; | 130 | const IR::F16F32F64 op_a{v.ir.FPAbsNeg(src_a, f2i.abs != 0, f2i.neg != 0)}; |
| 131 | const IR::F16F32F64 rounded_value{[&] { | 131 | const IR::F16F32F64 rounded_value{[&] { |
| @@ -186,14 +186,14 @@ void TranslateF2I(TranslatorVisitor& v, u64 insn, const IR::F16F32F64& src_a) { | |||
| 186 | } else if (f2i.dest_format == DestFormat::I64) { | 186 | } else if (f2i.dest_format == DestFormat::I64) { |
| 187 | handled_special_case = true; | 187 | handled_special_case = true; |
| 188 | result = IR::U64{ | 188 | result = IR::U64{ |
| 189 | v.ir.Select(v.ir.FPIsNan(op_a), v.ir.Imm64(0x8000'0000'0000'0000ULL), result)}; | 189 | v.ir.Select(v.ir.FPIsNan(op_a), v.ir.Imm64(0x8000'0000'0000'0000UL), result)}; |
| 190 | } | 190 | } |
| 191 | } | 191 | } |
| 192 | if (!handled_special_case && is_signed) { | 192 | if (!handled_special_case && is_signed) { |
| 193 | if (bitsize != 64) { | 193 | if (bitsize != 64) { |
| 194 | result = IR::U32{v.ir.Select(v.ir.FPIsNan(op_a), v.ir.Imm32(0U), result)}; | 194 | result = IR::U32{v.ir.Select(v.ir.FPIsNan(op_a), v.ir.Imm32(0U), result)}; |
| 195 | } else { | 195 | } else { |
| 196 | result = IR::U64{v.ir.Select(v.ir.FPIsNan(op_a), v.ir.Imm64(0ULL), result)}; | 196 | result = IR::U64{v.ir.Select(v.ir.FPIsNan(op_a), v.ir.Imm64(0UL), result)}; |
| 197 | } | 197 | } |
| 198 | } | 198 | } |
| 199 | 199 | ||
| @@ -211,6 +211,7 @@ void TranslateF2I(TranslatorVisitor& v, u64 insn, const IR::F16F32F64& src_a) { | |||
| 211 | 211 | ||
| 212 | void TranslatorVisitor::F2I_reg(u64 insn) { | 212 | void TranslatorVisitor::F2I_reg(u64 insn) { |
| 213 | union { | 213 | union { |
| 214 | u64 raw; | ||
| 214 | F2I base; | 215 | F2I base; |
| 215 | BitField<20, 8, IR::Reg> src_reg; | 216 | BitField<20, 8, IR::Reg> src_reg; |
| 216 | } const f2i{insn}; | 217 | } const f2i{insn}; |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_fused_multiply_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_fused_multiply_add.cpp index 18561bc9c..fa2a7807b 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_fused_multiply_add.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_fused_multiply_add.cpp | |||
| @@ -24,9 +24,9 @@ void FFMA(TranslatorVisitor& v, u64 insn, const IR::F32& src_b, const IR::F32& s | |||
| 24 | const IR::F32 op_b{v.ir.FPAbsNeg(src_b, false, neg_b)}; | 24 | const IR::F32 op_b{v.ir.FPAbsNeg(src_b, false, neg_b)}; |
| 25 | const IR::F32 op_c{v.ir.FPAbsNeg(src_c, false, neg_c)}; | 25 | const IR::F32 op_c{v.ir.FPAbsNeg(src_c, false, neg_c)}; |
| 26 | const IR::FpControl fp_control{ | 26 | const IR::FpControl fp_control{ |
| 27 | .no_contraction{true}, | 27 | .no_contraction = true, |
| 28 | .rounding{CastFpRounding(fp_rounding)}, | 28 | .rounding = CastFpRounding(fp_rounding), |
| 29 | .fmz_mode{CastFmzMode(fmz_mode)}, | 29 | .fmz_mode = CastFmzMode(fmz_mode), |
| 30 | }; | 30 | }; |
| 31 | IR::F32 value{v.ir.FPFma(op_a, op_b, op_c, fp_control)}; | 31 | IR::F32 value{v.ir.FPFma(op_a, op_b, op_c, fp_control)}; |
| 32 | if (fmz_mode == FmzMode::FMZ && !sat) { | 32 | if (fmz_mode == FmzMode::FMZ && !sat) { |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_min_max.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_min_max.cpp index 343d91032..8ae437528 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_min_max.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_min_max.cpp | |||
| @@ -27,9 +27,9 @@ void FMNMX(TranslatorVisitor& v, u64 insn, const IR::F32& src_b) { | |||
| 27 | const IR::F32 op_b{v.ir.FPAbsNeg(src_b, fmnmx.abs_b != 0, fmnmx.negate_b != 0)}; | 27 | const IR::F32 op_b{v.ir.FPAbsNeg(src_b, fmnmx.abs_b != 0, fmnmx.negate_b != 0)}; |
| 28 | 28 | ||
| 29 | const IR::FpControl control{ | 29 | const IR::FpControl control{ |
| 30 | .no_contraction{false}, | 30 | .no_contraction = false, |
| 31 | .rounding{IR::FpRounding::DontCare}, | 31 | .rounding = IR::FpRounding::DontCare, |
| 32 | .fmz_mode{fmnmx.ftz != 0 ? IR::FmzMode::FTZ : IR::FmzMode::None}, | 32 | .fmz_mode = (fmnmx.ftz != 0 ? IR::FmzMode::FTZ : IR::FmzMode::None), |
| 33 | }; | 33 | }; |
| 34 | IR::F32 max{v.ir.FPMax(op_a, op_b, control)}; | 34 | IR::F32 max{v.ir.FPMax(op_a, op_b, control)}; |
| 35 | IR::F32 min{v.ir.FPMin(op_a, op_b, control)}; | 35 | IR::F32 min{v.ir.FPMin(op_a, op_b, control)}; |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_multiply.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_multiply.cpp index 72f0a18ae..06226b7ce 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_multiply.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_multiply.cpp | |||
| @@ -64,9 +64,9 @@ void FMUL(TranslatorVisitor& v, u64 insn, const IR::F32& src_b, FmzMode fmz_mode | |||
| 64 | } | 64 | } |
| 65 | const IR::F32 op_b{v.ir.FPAbsNeg(src_b, false, neg_b)}; | 65 | const IR::F32 op_b{v.ir.FPAbsNeg(src_b, false, neg_b)}; |
| 66 | const IR::FpControl fp_control{ | 66 | const IR::FpControl fp_control{ |
| 67 | .no_contraction{true}, | 67 | .no_contraction = true, |
| 68 | .rounding{CastFpRounding(fp_rounding)}, | 68 | .rounding = CastFpRounding(fp_rounding), |
| 69 | .fmz_mode{CastFmzMode(fmz_mode)}, | 69 | .fmz_mode = CastFmzMode(fmz_mode), |
| 70 | }; | 70 | }; |
| 71 | IR::F32 value{v.ir.FPMul(op_a, op_b, fp_control)}; | 71 | IR::F32 value{v.ir.FPMul(op_a, op_b, fp_control)}; |
| 72 | if (fmz_mode == FmzMode::FMZ && !sat) { | 72 | if (fmz_mode == FmzMode::FMZ && !sat) { |
| @@ -124,4 +124,4 @@ void TranslatorVisitor::FMUL32I(u64 insn) { | |||
| 124 | fmul32i.sat != 0, fmul32i.cc != 0, false); | 124 | fmul32i.sat != 0, fmul32i.cc != 0, false); |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | } // namespace Shader::Maxwell \ No newline at end of file | 127 | } // namespace Shader::Maxwell |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_set_predicate.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_set_predicate.cpp index 8ff9db843..5f93a1513 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_set_predicate.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_set_predicate.cpp | |||
| @@ -29,9 +29,9 @@ void FSETP(TranslatorVisitor& v, u64 insn, const IR::F32& src_b) { | |||
| 29 | const IR::F32 op_a{v.ir.FPAbsNeg(v.F(fsetp.src_a_reg), fsetp.abs_a != 0, fsetp.negate_a != 0)}; | 29 | const IR::F32 op_a{v.ir.FPAbsNeg(v.F(fsetp.src_a_reg), fsetp.abs_a != 0, fsetp.negate_a != 0)}; |
| 30 | const IR::F32 op_b = v.ir.FPAbsNeg(src_b, fsetp.abs_b != 0, fsetp.negate_b != 0); | 30 | const IR::F32 op_b = v.ir.FPAbsNeg(src_b, fsetp.abs_b != 0, fsetp.negate_b != 0); |
| 31 | const IR::FpControl control{ | 31 | const IR::FpControl control{ |
| 32 | .no_contraction{false}, | 32 | .no_contraction = false, |
| 33 | .rounding{IR::FpRounding::DontCare}, | 33 | .rounding = IR::FpRounding::DontCare, |
| 34 | .fmz_mode{fsetp.ftz != 0 ? IR::FmzMode::FTZ : IR::FmzMode::None}, | 34 | .fmz_mode = (fsetp.ftz != 0 ? IR::FmzMode::FTZ : IR::FmzMode::None), |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | const BooleanOp bop{fsetp.bop}; | 37 | const BooleanOp bop{fsetp.bop}; |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp index e42921a21..7550a8d4c 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/floating_point_swizzled_add.cpp | |||
| @@ -28,9 +28,9 @@ void TranslatorVisitor::FSWZADD(u64 insn) { | |||
| 28 | const IR::U32 swizzle{ir.Imm32(static_cast<u32>(fswzadd.swizzle))}; | 28 | const IR::U32 swizzle{ir.Imm32(static_cast<u32>(fswzadd.swizzle))}; |
| 29 | 29 | ||
| 30 | const IR::FpControl fp_control{ | 30 | const IR::FpControl fp_control{ |
| 31 | .no_contraction{false}, | 31 | .no_contraction = false, |
| 32 | .rounding{CastFpRounding(fswzadd.round)}, | 32 | .rounding = CastFpRounding(fswzadd.round), |
| 33 | .fmz_mode{fswzadd.ftz != 0 ? IR::FmzMode::FTZ : IR::FmzMode::None}, | 33 | .fmz_mode = (fswzadd.ftz != 0 ? IR::FmzMode::FTZ : IR::FmzMode::None), |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | const IR::F32 result{ir.FSwizzleAdd(src_a, src_b, swizzle, fp_control)}; | 36 | const IR::F32 result{ir.FSwizzleAdd(src_a, src_b, swizzle, fp_control)}; |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_add.cpp index 03e7bf047..f2738a93b 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_add.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_add.cpp | |||
| @@ -34,9 +34,9 @@ void HADD2(TranslatorVisitor& v, u64 insn, Merge merge, bool ftz, bool sat, bool | |||
| 34 | rhs_b = v.ir.FPAbsNeg(rhs_b, abs_b, neg_b); | 34 | rhs_b = v.ir.FPAbsNeg(rhs_b, abs_b, neg_b); |
| 35 | 35 | ||
| 36 | const IR::FpControl fp_control{ | 36 | const IR::FpControl fp_control{ |
| 37 | .no_contraction{true}, | 37 | .no_contraction = true, |
| 38 | .rounding{IR::FpRounding::DontCare}, | 38 | .rounding = IR::FpRounding::DontCare, |
| 39 | .fmz_mode{ftz ? IR::FmzMode::FTZ : IR::FmzMode::None}, | 39 | .fmz_mode = (ftz ? IR::FmzMode::FTZ : IR::FmzMode::None), |
| 40 | }; | 40 | }; |
| 41 | IR::F16F32F64 lhs{v.ir.FPAdd(lhs_a, lhs_b, fp_control)}; | 41 | IR::F16F32F64 lhs{v.ir.FPAdd(lhs_a, lhs_b, fp_control)}; |
| 42 | IR::F16F32F64 rhs{v.ir.FPAdd(rhs_a, rhs_b, fp_control)}; | 42 | IR::F16F32F64 rhs{v.ir.FPAdd(rhs_a, rhs_b, fp_control)}; |
| @@ -102,8 +102,9 @@ void TranslatorVisitor::HADD2_imm(u64 insn) { | |||
| 102 | BitField<20, 9, u64> low; | 102 | BitField<20, 9, u64> low; |
| 103 | } const hadd2{insn}; | 103 | } const hadd2{insn}; |
| 104 | 104 | ||
| 105 | const u32 imm{static_cast<u32>(hadd2.low << 6) | ((hadd2.neg_low != 0 ? 1 : 0) << 15) | | 105 | const u32 imm{ |
| 106 | static_cast<u32>(hadd2.high << 22) | ((hadd2.neg_high != 0 ? 1 : 0) << 31)}; | 106 | static_cast<u32>(hadd2.low << 6) | static_cast<u32>((hadd2.neg_low != 0 ? 1 : 0) << 15) | |
| 107 | static_cast<u32>(hadd2.high << 22) | static_cast<u32>((hadd2.neg_high != 0 ? 1 : 0) << 31)}; | ||
| 107 | HADD2(*this, insn, hadd2.sat != 0, false, false, Swizzle::H1_H0, ir.Imm32(imm)); | 108 | HADD2(*this, insn, hadd2.sat != 0, false, false, Swizzle::H1_H0, ir.Imm32(imm)); |
| 108 | } | 109 | } |
| 109 | 110 | ||
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_fused_multiply_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_fused_multiply_add.cpp index 8b234bd6a..fd7986701 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_fused_multiply_add.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_fused_multiply_add.cpp | |||
| @@ -41,9 +41,9 @@ void HFMA2(TranslatorVisitor& v, u64 insn, Merge merge, Swizzle swizzle_a, bool | |||
| 41 | rhs_c = v.ir.FPAbsNeg(rhs_c, false, neg_c); | 41 | rhs_c = v.ir.FPAbsNeg(rhs_c, false, neg_c); |
| 42 | 42 | ||
| 43 | const IR::FpControl fp_control{ | 43 | const IR::FpControl fp_control{ |
| 44 | .no_contraction{true}, | 44 | .no_contraction = true, |
| 45 | .rounding{IR::FpRounding::DontCare}, | 45 | .rounding = IR::FpRounding::DontCare, |
| 46 | .fmz_mode{HalfPrecision2FmzMode(precision)}, | 46 | .fmz_mode = HalfPrecision2FmzMode(precision), |
| 47 | }; | 47 | }; |
| 48 | IR::F16F32F64 lhs{v.ir.FPFma(lhs_a, lhs_b, lhs_c, fp_control)}; | 48 | IR::F16F32F64 lhs{v.ir.FPFma(lhs_a, lhs_b, lhs_c, fp_control)}; |
| 49 | IR::F16F32F64 rhs{v.ir.FPFma(rhs_a, rhs_b, rhs_c, fp_control)}; | 49 | IR::F16F32F64 rhs{v.ir.FPFma(rhs_a, rhs_b, rhs_c, fp_control)}; |
| @@ -143,8 +143,9 @@ void TranslatorVisitor::HFMA2_imm(u64 insn) { | |||
| 143 | BitField<57, 2, HalfPrecision> precision; | 143 | BitField<57, 2, HalfPrecision> precision; |
| 144 | } const hfma2{insn}; | 144 | } const hfma2{insn}; |
| 145 | 145 | ||
| 146 | const u32 imm{static_cast<u32>(hfma2.low << 6) | ((hfma2.neg_low != 0 ? 1 : 0) << 15) | | 146 | const u32 imm{ |
| 147 | static_cast<u32>(hfma2.high << 22) | ((hfma2.neg_high != 0 ? 1 : 0) << 31)}; | 147 | static_cast<u32>(hfma2.low << 6) | static_cast<u32>((hfma2.neg_low != 0 ? 1 : 0) << 15) | |
| 148 | static_cast<u32>(hfma2.high << 22) | static_cast<u32>((hfma2.neg_high != 0 ? 1 : 0) << 31)}; | ||
| 148 | 149 | ||
| 149 | HFMA2(*this, insn, false, hfma2.neg_c != 0, Swizzle::H1_H0, hfma2.swizzle_c, ir.Imm32(imm), | 150 | HFMA2(*this, insn, false, hfma2.neg_c != 0, Swizzle::H1_H0, hfma2.swizzle_c, ir.Imm32(imm), |
| 150 | GetReg39(insn), hfma2.saturate != 0, hfma2.precision); | 151 | GetReg39(insn), hfma2.saturate != 0, hfma2.precision); |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_multiply.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_multiply.cpp index 2451a6ef6..3f548ce76 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_multiply.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_multiply.cpp | |||
| @@ -35,9 +35,9 @@ void HMUL2(TranslatorVisitor& v, u64 insn, Merge merge, bool sat, bool abs_a, bo | |||
| 35 | rhs_b = v.ir.FPAbsNeg(rhs_b, abs_b, neg_b); | 35 | rhs_b = v.ir.FPAbsNeg(rhs_b, abs_b, neg_b); |
| 36 | 36 | ||
| 37 | const IR::FpControl fp_control{ | 37 | const IR::FpControl fp_control{ |
| 38 | .no_contraction{true}, | 38 | .no_contraction = true, |
| 39 | .rounding{IR::FpRounding::DontCare}, | 39 | .rounding = IR::FpRounding::DontCare, |
| 40 | .fmz_mode{HalfPrecision2FmzMode(precision)}, | 40 | .fmz_mode = HalfPrecision2FmzMode(precision), |
| 41 | }; | 41 | }; |
| 42 | IR::F16F32F64 lhs{v.ir.FPMul(lhs_a, lhs_b, fp_control)}; | 42 | IR::F16F32F64 lhs{v.ir.FPMul(lhs_a, lhs_b, fp_control)}; |
| 43 | IR::F16F32F64 rhs{v.ir.FPMul(rhs_a, rhs_b, fp_control)}; | 43 | IR::F16F32F64 rhs{v.ir.FPMul(rhs_a, rhs_b, fp_control)}; |
| @@ -119,8 +119,9 @@ void TranslatorVisitor::HMUL2_imm(u64 insn) { | |||
| 119 | BitField<44, 1, u64> abs_a; | 119 | BitField<44, 1, u64> abs_a; |
| 120 | } const hmul2{insn}; | 120 | } const hmul2{insn}; |
| 121 | 121 | ||
| 122 | const u32 imm{static_cast<u32>(hmul2.low << 6) | ((hmul2.neg_low != 0 ? 1 : 0) << 15) | | 122 | const u32 imm{ |
| 123 | static_cast<u32>(hmul2.high << 22) | ((hmul2.neg_high != 0 ? 1 : 0) << 31)}; | 123 | static_cast<u32>(hmul2.low << 6) | static_cast<u32>((hmul2.neg_low != 0 ? 1 : 0) << 15) | |
| 124 | static_cast<u32>(hmul2.high << 22) | static_cast<u32>((hmul2.neg_high != 0 ? 1 : 0) << 31)}; | ||
| 124 | HMUL2(*this, insn, hmul2.sat != 0, hmul2.abs_a != 0, hmul2.neg_a != 0, false, false, | 125 | HMUL2(*this, insn, hmul2.sat != 0, hmul2.abs_a != 0, hmul2.neg_a != 0, false, false, |
| 125 | Swizzle::H1_H0, ir.Imm32(imm)); | 126 | Swizzle::H1_H0, ir.Imm32(imm)); |
| 126 | } | 127 | } |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set.cpp index 7f1f4b88c..cca5b831f 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set.cpp | |||
| @@ -41,9 +41,9 @@ void HSET2(TranslatorVisitor& v, u64 insn, const IR::U32& src_b, bool bf, bool f | |||
| 41 | rhs_b = v.ir.FPAbsNeg(rhs_b, abs_b, neg_b); | 41 | rhs_b = v.ir.FPAbsNeg(rhs_b, abs_b, neg_b); |
| 42 | 42 | ||
| 43 | const IR::FpControl control{ | 43 | const IR::FpControl control{ |
| 44 | .no_contraction{false}, | 44 | .no_contraction = false, |
| 45 | .rounding{IR::FpRounding::DontCare}, | 45 | .rounding = IR::FpRounding::DontCare, |
| 46 | .fmz_mode{ftz ? IR::FmzMode::FTZ : IR::FmzMode::None}, | 46 | .fmz_mode = (ftz ? IR::FmzMode::FTZ : IR::FmzMode::None), |
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | IR::U1 pred{v.ir.GetPred(hset2.pred)}; | 49 | IR::U1 pred{v.ir.GetPred(hset2.pred)}; |
| @@ -106,8 +106,9 @@ void TranslatorVisitor::HSET2_imm(u64 insn) { | |||
| 106 | BitField<20, 9, u64> low; | 106 | BitField<20, 9, u64> low; |
| 107 | } const hset2{insn}; | 107 | } const hset2{insn}; |
| 108 | 108 | ||
| 109 | const u32 imm{static_cast<u32>(hset2.low << 6) | ((hset2.neg_low != 0 ? 1 : 0) << 15) | | 109 | const u32 imm{ |
| 110 | static_cast<u32>(hset2.high << 22) | ((hset2.neg_high != 0 ? 1 : 0) << 31)}; | 110 | static_cast<u32>(hset2.low << 6) | static_cast<u32>((hset2.neg_low != 0 ? 1 : 0) << 15) | |
| 111 | static_cast<u32>(hset2.high << 22) | static_cast<u32>((hset2.neg_high != 0 ? 1 : 0) << 31)}; | ||
| 111 | 112 | ||
| 112 | HSET2(*this, insn, ir.Imm32(imm), hset2.bf != 0, hset2.ftz != 0, false, false, hset2.compare_op, | 113 | HSET2(*this, insn, ir.Imm32(imm), hset2.bf != 0, hset2.ftz != 0, false, false, hset2.compare_op, |
| 113 | Swizzle::H1_H0); | 114 | Swizzle::H1_H0); |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set_predicate.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set_predicate.cpp index 3e2a23c92..b3931dae3 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set_predicate.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/half_floating_point_set_predicate.cpp | |||
| @@ -43,9 +43,9 @@ void HSETP2(TranslatorVisitor& v, u64 insn, const IR::U32& src_b, bool neg_b, bo | |||
| 43 | rhs_b = v.ir.FPAbsNeg(rhs_b, abs_b, neg_b); | 43 | rhs_b = v.ir.FPAbsNeg(rhs_b, abs_b, neg_b); |
| 44 | 44 | ||
| 45 | const IR::FpControl control{ | 45 | const IR::FpControl control{ |
| 46 | .no_contraction{false}, | 46 | .no_contraction = false, |
| 47 | .rounding{IR::FpRounding::DontCare}, | 47 | .rounding = IR::FpRounding::DontCare, |
| 48 | .fmz_mode{hsetp2.ftz != 0 ? IR::FmzMode::FTZ : IR::FmzMode::None}, | 48 | .fmz_mode = (hsetp2.ftz != 0 ? IR::FmzMode::FTZ : IR::FmzMode::None), |
| 49 | }; | 49 | }; |
| 50 | 50 | ||
| 51 | IR::U1 pred{v.ir.GetPred(hsetp2.pred)}; | 51 | IR::U1 pred{v.ir.GetPred(hsetp2.pred)}; |
| @@ -106,8 +106,10 @@ void TranslatorVisitor::HSETP2_imm(u64 insn) { | |||
| 106 | BitField<20, 9, u64> low; | 106 | BitField<20, 9, u64> low; |
| 107 | } const hsetp2{insn}; | 107 | } const hsetp2{insn}; |
| 108 | 108 | ||
| 109 | const u32 imm{static_cast<u32>(hsetp2.low << 6) | ((hsetp2.neg_low != 0 ? 1 : 0) << 15) | | 109 | const u32 imm{static_cast<u32>(hsetp2.low << 6) | |
| 110 | static_cast<u32>(hsetp2.high << 22) | ((hsetp2.neg_high != 0 ? 1 : 0) << 31)}; | 110 | static_cast<u32>((hsetp2.neg_low != 0 ? 1 : 0) << 15) | |
| 111 | static_cast<u32>(hsetp2.high << 22) | | ||
| 112 | static_cast<u32>((hsetp2.neg_high != 0 ? 1 : 0) << 31)}; | ||
| 111 | 113 | ||
| 112 | HSETP2(*this, insn, ir.Imm32(imm), false, false, Swizzle::H1_H0, hsetp2.compare_op, | 114 | HSETP2(*this, insn, ir.Imm32(imm), false, false, Swizzle::H1_H0, hsetp2.compare_op, |
| 113 | hsetp2.h_and != 0); | 115 | hsetp2.h_and != 0); |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp index 30b570ce4..88bbac0a5 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp | |||
| @@ -49,7 +49,7 @@ void TranslatorVisitor::L(IR::Reg dest_reg, const IR::U64& value) { | |||
| 49 | } | 49 | } |
| 50 | const IR::Value result{ir.UnpackUint2x32(value)}; | 50 | const IR::Value result{ir.UnpackUint2x32(value)}; |
| 51 | for (int i = 0; i < 2; i++) { | 51 | for (int i = 0; i < 2; i++) { |
| 52 | X(dest_reg + i, IR::U32{ir.CompositeExtract(result, i)}); | 52 | X(dest_reg + i, IR::U32{ir.CompositeExtract(result, static_cast<size_t>(i))}); |
| 53 | } | 53 | } |
| 54 | } | 54 | } |
| 55 | 55 | ||
| @@ -63,7 +63,7 @@ void TranslatorVisitor::D(IR::Reg dest_reg, const IR::F64& value) { | |||
| 63 | } | 63 | } |
| 64 | const IR::Value result{ir.UnpackDouble2x32(value)}; | 64 | const IR::Value result{ir.UnpackDouble2x32(value)}; |
| 65 | for (int i = 0; i < 2; i++) { | 65 | for (int i = 0; i < 2; i++) { |
| 66 | X(dest_reg + i, IR::U32{ir.CompositeExtract(result, i)}); | 66 | X(dest_reg + i, IR::U32{ir.CompositeExtract(result, static_cast<size_t>(i))}); |
| 67 | } | 67 | } |
| 68 | } | 68 | } |
| 69 | 69 | ||
| @@ -156,7 +156,7 @@ IR::F64 TranslatorVisitor::GetDoubleCbuf(u64 insn) { | |||
| 156 | const auto [binding, offset_value]{CbufAddr(insn)}; | 156 | const auto [binding, offset_value]{CbufAddr(insn)}; |
| 157 | const bool unaligned{cbuf.unaligned != 0}; | 157 | const bool unaligned{cbuf.unaligned != 0}; |
| 158 | const u32 offset{offset_value.U32()}; | 158 | const u32 offset{offset_value.U32()}; |
| 159 | const IR::Value addr{unaligned ? offset | 4 : (offset & ~7) | 4}; | 159 | const IR::Value addr{unaligned ? offset | 4u : (offset & ~7u) | 4u}; |
| 160 | 160 | ||
| 161 | const IR::U32 value{ir.GetCbuf(binding, IR::U32{addr})}; | 161 | const IR::U32 value{ir.GetCbuf(binding, IR::U32{addr})}; |
| 162 | const IR::U32 lower_bits{CbufLowerBits(ir, unaligned, binding, offset)}; | 162 | const IR::U32 lower_bits{CbufLowerBits(ir, unaligned, binding, offset)}; |
| @@ -200,7 +200,7 @@ IR::F32 TranslatorVisitor::GetFloatImm20(u64 insn) { | |||
| 200 | BitField<20, 19, u64> value; | 200 | BitField<20, 19, u64> value; |
| 201 | BitField<56, 1, u64> is_negative; | 201 | BitField<56, 1, u64> is_negative; |
| 202 | } const imm{insn}; | 202 | } const imm{insn}; |
| 203 | const u32 sign_bit{imm.is_negative != 0 ? (1ULL << 31) : 0}; | 203 | const u32 sign_bit{static_cast<u32>(imm.is_negative != 0 ? (1ULL << 31) : 0)}; |
| 204 | const u32 value{static_cast<u32>(imm.value) << 12}; | 204 | const u32 value{static_cast<u32>(imm.value) << 12}; |
| 205 | return ir.Imm32(Common::BitCast<f32>(value | sign_bit)); | 205 | return ir.Imm32(Common::BitCast<f32>(value | sign_bit)); |
| 206 | } | 206 | } |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_add.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_add.cpp index 1493e1815..8ffd84867 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_add.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_add.cpp | |||
| @@ -68,7 +68,6 @@ void IADD(TranslatorVisitor& v, u64 insn, IR::U32 op_b) { | |||
| 68 | } const iadd{insn}; | 68 | } const iadd{insn}; |
| 69 | 69 | ||
| 70 | const bool po{iadd.three_for_po == 3}; | 70 | const bool po{iadd.three_for_po == 3}; |
| 71 | const bool neg_a{!po && iadd.neg_a != 0}; | ||
| 72 | if (!po && iadd.neg_b != 0) { | 71 | if (!po && iadd.neg_b != 0) { |
| 73 | op_b = v.ir.INeg(op_b); | 72 | op_b = v.ir.INeg(op_b); |
| 74 | } | 73 | } |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_floating_point_conversion.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_floating_point_conversion.cpp index e8b5ae1d2..5a0fc36a0 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/integer_floating_point_conversion.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/integer_floating_point_conversion.cpp | |||
| @@ -131,7 +131,7 @@ void I2F(TranslatorVisitor& v, u64 insn, IR::U32U64 src) { | |||
| 131 | } | 131 | } |
| 132 | const IR::Value vector{v.ir.UnpackDouble2x32(value)}; | 132 | const IR::Value vector{v.ir.UnpackDouble2x32(value)}; |
| 133 | for (int i = 0; i < 2; ++i) { | 133 | for (int i = 0; i < 2; ++i) { |
| 134 | v.X(i2f.dest_reg + i, IR::U32{v.ir.CompositeExtract(vector, i)}); | 134 | v.X(i2f.dest_reg + i, IR::U32{v.ir.CompositeExtract(vector, static_cast<size_t>(i))}); |
| 135 | } | 135 | } |
| 136 | break; | 136 | break; |
| 137 | } | 137 | } |
| @@ -170,4 +170,4 @@ void TranslatorVisitor::I2F_imm(u64 insn) { | |||
| 170 | } | 170 | } |
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | } // namespace Shader::Maxwell \ No newline at end of file | 173 | } // namespace Shader::Maxwell |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/load_constant.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/load_constant.cpp index ae3ecea32..2300088e3 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/load_constant.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/load_constant.cpp | |||
| @@ -50,7 +50,7 @@ void TranslatorVisitor::LDC(u64 insn) { | |||
| 50 | } | 50 | } |
| 51 | const IR::Value vector{ir.GetCbuf(index, offset, 64, false)}; | 51 | const IR::Value vector{ir.GetCbuf(index, offset, 64, false)}; |
| 52 | for (int i = 0; i < 2; ++i) { | 52 | for (int i = 0; i < 2; ++i) { |
| 53 | X(ldc.dest_reg + i, IR::U32{ir.CompositeExtract(vector, i)}); | 53 | X(ldc.dest_reg + i, IR::U32{ir.CompositeExtract(vector, static_cast<size_t>(i))}); |
| 54 | } | 54 | } |
| 55 | break; | 55 | break; |
| 56 | } | 56 | } |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_local_shared.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_local_shared.cpp index 68963c8ea..e24b49721 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_local_shared.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_local_shared.cpp | |||
| @@ -40,7 +40,6 @@ std::pair<int, bool> GetSize(u64 insn) { | |||
| 40 | BitField<48, 3, Size> size; | 40 | BitField<48, 3, Size> size; |
| 41 | } const encoding{insn}; | 41 | } const encoding{insn}; |
| 42 | 42 | ||
| 43 | const Size nnn = encoding.size; | ||
| 44 | switch (encoding.size) { | 43 | switch (encoding.size) { |
| 45 | case Size::U8: | 44 | case Size::U8: |
| 46 | return {8, false}; | 45 | return {8, false}; |
| @@ -99,7 +98,7 @@ void TranslatorVisitor::LDL(u64 insn) { | |||
| 99 | case 32: | 98 | case 32: |
| 100 | case 64: | 99 | case 64: |
| 101 | case 128: | 100 | case 128: |
| 102 | if (!IR::IsAligned(dest, bit_size / 32)) { | 101 | if (!IR::IsAligned(dest, static_cast<size_t>(bit_size / 32))) { |
| 103 | throw NotImplementedException("Unaligned destination register {}", dest); | 102 | throw NotImplementedException("Unaligned destination register {}", dest); |
| 104 | } | 103 | } |
| 105 | X(dest, ir.LoadLocal(word_offset)); | 104 | X(dest, ir.LoadLocal(word_offset)); |
| @@ -123,11 +122,11 @@ void TranslatorVisitor::LDS(u64 insn) { | |||
| 123 | break; | 122 | break; |
| 124 | case 64: | 123 | case 64: |
| 125 | case 128: | 124 | case 128: |
| 126 | if (!IR::IsAligned(dest, bit_size / 32)) { | 125 | if (!IR::IsAligned(dest, static_cast<size_t>(bit_size / 32))) { |
| 127 | throw NotImplementedException("Unaligned destination register {}", dest); | 126 | throw NotImplementedException("Unaligned destination register {}", dest); |
| 128 | } | 127 | } |
| 129 | for (int element = 0; element < bit_size / 32; ++element) { | 128 | for (int element = 0; element < bit_size / 32; ++element) { |
| 130 | X(dest + element, IR::U32{ir.CompositeExtract(value, element)}); | 129 | X(dest + element, IR::U32{ir.CompositeExtract(value, static_cast<size_t>(element))}); |
| 131 | } | 130 | } |
| 132 | break; | 131 | break; |
| 133 | } | 132 | } |
| @@ -156,7 +155,7 @@ void TranslatorVisitor::STL(u64 insn) { | |||
| 156 | case 32: | 155 | case 32: |
| 157 | case 64: | 156 | case 64: |
| 158 | case 128: | 157 | case 128: |
| 159 | if (!IR::IsAligned(reg, bit_size / 32)) { | 158 | if (!IR::IsAligned(reg, static_cast<size_t>(bit_size / 32))) { |
| 160 | throw NotImplementedException("Unaligned source register"); | 159 | throw NotImplementedException("Unaligned source register"); |
| 161 | } | 160 | } |
| 162 | ir.WriteLocal(word_offset, src); | 161 | ir.WriteLocal(word_offset, src); |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_memory.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_memory.cpp index 71688b1d7..36c5cff2f 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_memory.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/load_store_memory.cpp | |||
| @@ -114,7 +114,7 @@ void TranslatorVisitor::LDG(u64 insn) { | |||
| 114 | } | 114 | } |
| 115 | const IR::Value vector{ir.LoadGlobal64(address)}; | 115 | const IR::Value vector{ir.LoadGlobal64(address)}; |
| 116 | for (int i = 0; i < 2; ++i) { | 116 | for (int i = 0; i < 2; ++i) { |
| 117 | X(dest_reg + i, IR::U32{ir.CompositeExtract(vector, i)}); | 117 | X(dest_reg + i, IR::U32{ir.CompositeExtract(vector, static_cast<size_t>(i))}); |
| 118 | } | 118 | } |
| 119 | break; | 119 | break; |
| 120 | } | 120 | } |
| @@ -125,7 +125,7 @@ void TranslatorVisitor::LDG(u64 insn) { | |||
| 125 | } | 125 | } |
| 126 | const IR::Value vector{ir.LoadGlobal128(address)}; | 126 | const IR::Value vector{ir.LoadGlobal128(address)}; |
| 127 | for (int i = 0; i < 4; ++i) { | 127 | for (int i = 0; i < 4; ++i) { |
| 128 | X(dest_reg + i, IR::U32{ir.CompositeExtract(vector, i)}); | 128 | X(dest_reg + i, IR::U32{ir.CompositeExtract(vector, static_cast<size_t>(i))}); |
| 129 | } | 129 | } |
| 130 | break; | 130 | break; |
| 131 | } | 131 | } |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch.cpp index b2da079f9..95d416586 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch.cpp | |||
| @@ -199,7 +199,7 @@ void Impl(TranslatorVisitor& v, u64 insn, bool aoffi, Blod blod, bool lc, | |||
| 199 | if (tex.dc != 0) { | 199 | if (tex.dc != 0) { |
| 200 | value = element < 3 ? IR::F32{sample} : v.ir.Imm32(1.0f); | 200 | value = element < 3 ? IR::F32{sample} : v.ir.Imm32(1.0f); |
| 201 | } else { | 201 | } else { |
| 202 | value = IR::F32{v.ir.CompositeExtract(sample, element)}; | 202 | value = IR::F32{v.ir.CompositeExtract(sample, static_cast<size_t>(element))}; |
| 203 | } | 203 | } |
| 204 | v.F(dest_reg, value); | 204 | v.F(dest_reg, value); |
| 205 | ++dest_reg; | 205 | ++dest_reg; |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch_swizzled.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch_swizzled.cpp index d5fda20f4..fe2c7db85 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch_swizzled.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_fetch_swizzled.cpp | |||
| @@ -53,7 +53,7 @@ constexpr std::array RGBA_LUT{ | |||
| 53 | R | G | B | A, // | 53 | R | G | B | A, // |
| 54 | }; | 54 | }; |
| 55 | 55 | ||
| 56 | void CheckAlignment(IR::Reg reg, int alignment) { | 56 | void CheckAlignment(IR::Reg reg, size_t alignment) { |
| 57 | if (!IR::IsAligned(reg, alignment)) { | 57 | if (!IR::IsAligned(reg, alignment)) { |
| 58 | throw NotImplementedException("Unaligned source register {}", reg); | 58 | throw NotImplementedException("Unaligned source register {}", reg); |
| 59 | } | 59 | } |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_gather_swizzled.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_gather_swizzled.cpp index beab515ad..2ba9c1018 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_gather_swizzled.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_gather_swizzled.cpp | |||
| @@ -37,7 +37,7 @@ union Encoding { | |||
| 37 | BitField<36, 13, u64> cbuf_offset; | 37 | BitField<36, 13, u64> cbuf_offset; |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | void CheckAlignment(IR::Reg reg, int alignment) { | 40 | void CheckAlignment(IR::Reg reg, size_t alignment) { |
| 41 | if (!IR::IsAligned(reg, alignment)) { | 41 | if (!IR::IsAligned(reg, alignment)) { |
| 42 | throw NotImplementedException("Unaligned source register {}", reg); | 42 | throw NotImplementedException("Unaligned source register {}", reg); |
| 43 | } | 43 | } |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_load_swizzled.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_load_swizzled.cpp index 623b8fc23..0863bdfcd 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_load_swizzled.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_load_swizzled.cpp | |||
| @@ -56,7 +56,7 @@ union Encoding { | |||
| 56 | BitField<53, 4, u64> encoding; | 56 | BitField<53, 4, u64> encoding; |
| 57 | }; | 57 | }; |
| 58 | 58 | ||
| 59 | void CheckAlignment(IR::Reg reg, int alignment) { | 59 | void CheckAlignment(IR::Reg reg, size_t alignment) { |
| 60 | if (!IR::IsAligned(reg, alignment)) { | 60 | if (!IR::IsAligned(reg, alignment)) { |
| 61 | throw NotImplementedException("Unaligned source register {}", reg); | 61 | throw NotImplementedException("Unaligned source register {}", reg); |
| 62 | } | 62 | } |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_query.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_query.cpp index 8c7e04bca..0459e5473 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_query.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_query.cpp | |||
| @@ -54,7 +54,7 @@ void Impl(TranslatorVisitor& v, u64 insn, std::optional<u32> cbuf_offset) { | |||
| 54 | if (((txq.mask >> element) & 1) == 0) { | 54 | if (((txq.mask >> element) & 1) == 0) { |
| 55 | continue; | 55 | continue; |
| 56 | } | 56 | } |
| 57 | v.X(dest_reg, IR::U32{v.ir.CompositeExtract(query, element)}); | 57 | v.X(dest_reg, IR::U32{v.ir.CompositeExtract(query, static_cast<size_t>(element))}); |
| 58 | ++dest_reg; | 58 | ++dest_reg; |
| 59 | } | 59 | } |
| 60 | } | 60 | } |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/video_set_predicate.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/video_set_predicate.cpp index af13b3fcc..ec5e74f6d 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/video_set_predicate.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/video_set_predicate.cpp | |||
| @@ -69,7 +69,6 @@ void TranslatorVisitor::VSETP(u64 insn) { | |||
| 69 | const IR::U32 src_b{is_b_imm ? ir.Imm32(static_cast<u32>(vsetp.src_b_imm)) : GetReg20(insn)}; | 69 | const IR::U32 src_b{is_b_imm ? ir.Imm32(static_cast<u32>(vsetp.src_b_imm)) : GetReg20(insn)}; |
| 70 | 70 | ||
| 71 | const u32 a_selector{static_cast<u32>(vsetp.src_a_selector)}; | 71 | const u32 a_selector{static_cast<u32>(vsetp.src_a_selector)}; |
| 72 | const u32 b_selector{is_b_imm ? 0U : static_cast<u32>(vsetp.src_b_selector)}; | ||
| 73 | const VideoWidth a_width{vsetp.src_a_width}; | 72 | const VideoWidth a_width{vsetp.src_a_width}; |
| 74 | const VideoWidth b_width{GetVideoSourceWidth(vsetp.src_b_width, is_b_imm)}; | 73 | const VideoWidth b_width{GetVideoSourceWidth(vsetp.src_b_width, is_b_imm)}; |
| 75 | 74 | ||