From 9bfa3c407c2101f59f5fa43105b565a1c862a0a0 Mon Sep 17 00:00:00 2001 From: emufan4568 Date: Sun, 28 Aug 2022 20:08:37 +0300 Subject: [PATCH] Revert "emit_x64_vector_floating_point: Implement workaround for issue 678" * The regression has been fixed in newer versions of MSVC This reverts commit 9f88f234a180a5e8d5620b4803c971fb6dc2d9f2. --- src/backend/x64/emit_x64_vector_floating_point.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backend/x64/emit_x64_vector_floating_point.cpp b/src/backend/x64/emit_x64_vector_floating_point.cpp index 57742d74..0405e6c9 100644 --- a/src/backend/x64/emit_x64_vector_floating_point.cpp +++ b/src/backend/x64/emit_x64_vector_floating_point.cpp @@ -1170,6 +1170,8 @@ void EmitX64::EmitFPVectorRecipStepFused64(EmitContext& ctx, IR::Inst* inst) { template void EmitFPVectorRoundInt(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst) { + using FPT = mp::unsigned_integer_of_size; + const auto rounding = static_cast(inst->GetArg(1).GetU8()); const bool exact = inst->GetArg(2).GetU1(); @@ -1209,7 +1211,6 @@ void EmitFPVectorRoundInt(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst) { static const auto lut = Common::GenerateLookupTableFromList( [](auto arg) { - using FPT = mp::unsigned_integer_of_size; return std::pair{ mp::lower_to_tuple_v, Common::FptrCast( @@ -1355,6 +1356,8 @@ void EmitX64::EmitFPVectorSub64(EmitContext& ctx, IR::Inst* inst) { template void EmitFPVectorToFixed(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst) { + using FPT = mp::unsigned_integer_of_size; + const size_t fbits = inst->GetArg(1).GetU8(); const auto rounding = static_cast(inst->GetArg(2).GetU8()); @@ -1443,7 +1446,6 @@ void EmitFPVectorToFixed(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst) { // Saturate to max FCODE(orp)(src, exceed_unsigned); } else { - using FPT = mp::unsigned_integer_of_size; // WORKAROUND: For issue 678 on MSVC constexpr u64 integer_max = static_cast(std::numeric_limits>>::max()); code.movaps(xmm0, GetVectorOf(code)); @@ -1468,7 +1470,6 @@ void EmitFPVectorToFixed(BlockOfCode& code, EmitContext& ctx, IR::Inst* inst) { static const auto lut = Common::GenerateLookupTableFromList( [](auto arg) { - using FPT = mp::unsigned_integer_of_size; // WORKAROUND: For issue 678 on MSVC return std::pair{ mp::lower_to_tuple_v, Common::FptrCast(