diff options
Diffstat (limited to 'src/shader_recompiler/ir_opt/constant_propagation_pass.cpp')
| -rw-r--r-- | src/shader_recompiler/ir_opt/constant_propagation_pass.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp index 2791703307..57c08588fb 100644 --- a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp +++ b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp @@ -8,8 +8,8 @@ #include <functional> #include <tuple> #include <type_traits> - -#include "common/bit_cast.h" +#include <bit> +#include <numeric> #include "shader_recompiler/environment.h" #include "shader_recompiler/exception.h" #include "shader_recompiler/frontend/ir/ir_emitter.h" @@ -536,7 +536,7 @@ template <IR::Opcode op, typename Dest, typename Source> void FoldBitCast(IR::Inst& inst, IR::Opcode reverse) { const IR::Value value{inst.Arg(0)}; if (value.IsImmediate()) { - inst.ReplaceUsesWith(IR::Value{Common::BitCast<Dest>(Arg<Source>(value))}); + inst.ReplaceUsesWith(IR::Value{std::bit_cast<Dest>(Arg<Source>(value))}); return; } IR::Inst* const arg_inst{value.InstRecursive()}; @@ -674,7 +674,7 @@ void FoldFSwizzleAdd(IR::Block& block, IR::Inst& inst) { if (!value_2.IsImmediate() || !value_3.IsImmediate()) { return; } - if (Common::BitCast<u32>(value_2.F32()) != value_3.U32()) { + if (std::bit_cast<u32>(value_2.F32()) != value_3.U32()) { return; } } @@ -821,7 +821,7 @@ bool FindGradient3DDerivatives(std::array<IR::Value, 3>& results, IR::Value coor void ConvertDerivatives(std::array<IR::Value, 3>& results, IR::IREmitter& ir) { for (size_t i = 0; i < 3; i++) { if (results[i].Type() == IR::Type::U32) { - results[i] = results[i].IsImmediate() ? ir.Imm32(Common::BitCast<f32>(results[i].U32())) + results[i] = results[i].IsImmediate() ? ir.Imm32(std::bit_cast<f32>(results[i].U32())) : ir.BitCast<IR::F32>(IR::U32(results[i])); } } @@ -927,7 +927,7 @@ void FoldDriverConstBuffer(Environment& env, IR::Block& block, IR::Inst& inst, u inst.ReplaceUsesWith(IR::Value{env.ReadCbufValue(bank_value, offset_value)}); } else { inst.ReplaceUsesWith( - IR::Value{Common::BitCast<f32>(env.ReadCbufValue(bank_value, offset_value))}); + IR::Value{std::bit_cast<f32>(env.ReadCbufValue(bank_value, offset_value))}); } } |
