From 6cc6181261f2d737322f5861d84a7dfb30d81c00 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 2 Oct 2024 11:12:33 -0400 Subject: [PATCH] OpcodeDispatcher/Flags: dont emit zero Signed-off-by: Alyssa Rosenzweig --- FEXCore/Source/Interface/Core/OpcodeDispatcher/Flags.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher/Flags.cpp b/FEXCore/Source/Interface/Core/OpcodeDispatcher/Flags.cpp index 3237f057b..1d8db1cae 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher/Flags.cpp +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher/Flags.cpp @@ -76,16 +76,13 @@ Ref OpDispatchBuilder::GetPackedRFLAG(uint32_t FlagsMask) { // Calculate flags early. CalculateDeferredFlags(); - Ref Original = _Constant(0); - // SF/ZF and N/Z are together on both arm64 and x86_64, so we special case that. bool GetNZ = (FlagsMask & (1 << FEXCore::X86State::RFLAG_SF_RAW_LOC)) && (FlagsMask & (1 << FEXCore::X86State::RFLAG_ZF_RAW_LOC)); // Handle CF first, since it's at bit 0 and hence doesn't need shift or OR. - if (FlagsMask & (1 << FEXCore::X86State::RFLAG_CF_RAW_LOC)) { - static_assert(FEXCore::X86State::RFLAG_CF_RAW_LOC == 0); - Original = GetRFLAG(FEXCore::X86State::RFLAG_CF_RAW_LOC); - } + LOGMAN_THROW_A_FMT(FlagsMask & (1 << FEXCore::X86State::RFLAG_CF_RAW_LOC), "CF always handled"); + static_assert(FEXCore::X86State::RFLAG_CF_RAW_LOC == 0); + Ref Original = GetRFLAG(FEXCore::X86State::RFLAG_CF_RAW_LOC); for (size_t i = 0; i < FlagOffsets.size(); ++i) { const auto FlagOffset = FlagOffsets[i];