diff --git a/FEXCore/Source/Interface/Core/ArchHelpers/Arm64Emitter.cpp b/FEXCore/Source/Interface/Core/ArchHelpers/Arm64Emitter.cpp index 71ea18d7c..b2893308d 100644 --- a/FEXCore/Source/Interface/Core/ArchHelpers/Arm64Emitter.cpp +++ b/FEXCore/Source/Interface/Core/ArchHelpers/Arm64Emitter.cpp @@ -495,7 +495,7 @@ void Arm64Emitter::LoadConstant(ARMEmitter::Size s, ARMEmitter::Register Reg, ui uint64_t AlignedPC = PC & ~0xFFFULL; // Offset from aligned PC - int64_t AlignedOffset = static_cast(Constant) - static_cast(AlignedPC); + auto AlignedOffset = std::bit_cast(Constant - AlignedPC); int NumMoves = 0; @@ -511,7 +511,7 @@ void Arm64Emitter::LoadConstant(ARMEmitter::Size s, ARMEmitter::Register Reg, ui } else { // If the constant is within 1MB of PC then we can still use ADR to load in a single instruction // 21-bit signed integer here - int64_t SmallOffset = static_cast(Constant) - static_cast(PC); + auto SmallOffset = std::bit_cast(Constant - PC); if (ARMEmitter::Emitter::IsInt21(SmallOffset)) { adr(Reg, SmallOffset); } else {