diff options
| author | lizzie <lizzie@eden-emu.dev> | 2025-10-22 02:56:28 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2025-10-22 02:56:28 +0200 |
| commit | 992bae4e2a14ca2547c09637b7dc6fc5f73b353a (patch) | |
| tree | 4b7df7f2cf95255551ccfad40ea33ed354b1f8ec /src/shader_recompiler/ir_opt/constant_propagation_pass.cpp | |
| parent | 6ff043c4fbd5dae5e0b1ec73a3bb4003e8cef20b (diff) | |
[common] replace Common::BitCast with libc++ provided one (#2774)
Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2774
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: crueter <crueter@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
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))}); } } |
