[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>
This commit is contained in:
lizzie 2025-10-22 02:56:28 +02:00 committed by crueter
parent 6ff043c4fb
commit 992bae4e2a
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6
25 changed files with 152 additions and 151 deletions

View file

@ -5,7 +5,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include <fmt/ranges.h>
#include <bit>
#include "shader_recompiler/backend/glasm/reg_alloc.h"
#include "shader_recompiler/exception.h"
#include "shader_recompiler/frontend/ir/value.h"
@ -78,7 +78,7 @@ Value RegAlloc::MakeImm(const IR::Value& value) {
break;
case IR::Type::F32:
ret.type = Type::U32;
ret.imm_u32 = Common::BitCast<u32>(value.F32());
ret.imm_u32 = std::bit_cast<u32>(value.F32());
break;
case IR::Type::U64:
ret.type = Type::U64;
@ -86,7 +86,7 @@ Value RegAlloc::MakeImm(const IR::Value& value) {
break;
case IR::Type::F64:
ret.type = Type::U64;
ret.imm_u64 = Common::BitCast<u64>(value.F64());
ret.imm_u64 = std::bit_cast<u64>(value.F64());
break;
default:
throw NotImplementedException("Immediate type {}", value.Type());

View file

@ -1,13 +1,16 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <bitset>
#include <bit>
#include <fmt/ranges.h>
#include <numeric>
#include "common/bit_cast.h"
#include "common/bit_field.h"
#include "common/common_types.h"
#include "shader_recompiler/exception.h"
@ -272,7 +275,7 @@ struct fmt::formatter<Shader::Backend::GLASM::ScalarF32> {
case Shader::Backend::GLASM::Type::Register:
return Shader::Backend::GLASM::FormatTo<true>(ctx, value.id);
case Shader::Backend::GLASM::Type::U32:
return fmt::format_to(ctx.out(), "{}", Common::BitCast<f32>(value.imm_u32));
return fmt::format_to(ctx.out(), "{}", std::bit_cast<f32>(value.imm_u32));
case Shader::Backend::GLASM::Type::U64:
break;
}
@ -295,7 +298,7 @@ struct fmt::formatter<Shader::Backend::GLASM::ScalarF64> {
case Shader::Backend::GLASM::Type::U32:
break;
case Shader::Backend::GLASM::Type::U64:
return fmt::format_to(ctx.out(), "{}", Common::BitCast<f64>(value.imm_u64));
return fmt::format_to(ctx.out(), "{}", std::bit_cast<f64>(value.imm_u64));
}
throw Shader::InvalidArgument("Invalid value type {}", value.type);
}