From 605a43d23e46e2f16197a36d2bb15ee6a8433c69 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Thu, 2 May 2019 21:41:22 +0100 Subject: [PATCH] Suppress MSVC warning C4702: unreachable code --- .../x64/emit_x64_vector_floating_point.cpp | 5 +++-- src/common/fp/unpacked.cpp | 18 +++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/backend/x64/emit_x64_vector_floating_point.cpp b/src/backend/x64/emit_x64_vector_floating_point.cpp index 6e4482de..6408a5dd 100644 --- a/src/backend/x64/emit_x64_vector_floating_point.cpp +++ b/src/backend/x64/emit_x64_vector_floating_point.cpp @@ -261,9 +261,10 @@ struct PairedLowerIndexer { return std::make_tuple(a[0], b[0]); } return std::make_tuple(0, 0); + } else { + UNREACHABLE(); + return {}; } - UNREACHABLE(); - return {}; } }; diff --git a/src/common/fp/unpacked.cpp b/src/common/fp/unpacked.cpp index 4ae48396..91b4cce9 100644 --- a/src/common/fp/unpacked.cpp +++ b/src/common/fp/unpacked.cpp @@ -15,7 +15,7 @@ namespace Dynarmic::FP { template -std::tuple FPUnpackBase(FPT op, FPCR fpcr, FPSR& fpsr) { +std::tuple FPUnpackBase(FPT op, FPCR fpcr, [[maybe_unused]] FPSR& fpsr) { constexpr size_t sign_bit = FPInfo::exponent_width + FPInfo::explicit_mantissa_width; constexpr size_t exponent_high_bit = FPInfo::exponent_width + FPInfo::explicit_mantissa_width - 1; constexpr size_t exponent_low_bit = FPInfo::explicit_mantissa_width; @@ -34,16 +34,16 @@ std::tuple FPUnpackBase(FPT op, FPCR fpcr, FPSR& fpsr) return {FPType::Zero, sign, {sign, 0, 0}}; } return {FPType::Nonzero, sign, ToNormalized(sign, denormal_exponent, frac_raw)}; - } - - if (frac_raw == 0 || fpcr.FZ()) { - if (frac_raw != 0) { - FPProcessException(FPExc::InputDenorm, fpcr, fpsr); + } else { + if (frac_raw == 0 || fpcr.FZ()) { + if (frac_raw != 0) { + FPProcessException(FPExc::InputDenorm, fpcr, fpsr); + } + return {FPType::Zero, sign, {sign, 0, 0}}; } - return {FPType::Zero, sign, {sign, 0, 0}}; - } - return {FPType::Nonzero, sign, ToNormalized(sign, denormal_exponent, frac_raw)}; + return {FPType::Nonzero, sign, ToNormalized(sign, denormal_exponent, frac_raw)}; + } } const bool exp_all_ones = exp_raw == Common::Ones(FPInfo::exponent_width);