diff --git a/patches/mcl_clang_template_fix.patch b/patches/mcl_clang_template_fix.patch new file mode 100644 index 000000000..352a6c55b --- /dev/null +++ b/patches/mcl_clang_template_fix.patch @@ -0,0 +1,112 @@ +diff --git a/externals/mcl/include/mcl/mp/metafunction/map.hpp b/externals/mcl/include/mcl/mp/metafunction/map.hpp +index 13fcaecd..6bbe1a23 100644 +--- a/externals/mcl/include/mcl/mp/metafunction/map.hpp ++++ b/externals/mcl/include/mcl/mp/metafunction/map.hpp +@@ -4,22 +4,32 @@ + + #pragma once + ++#include "mcl/mp/typelist/list.hpp" ++ + namespace mcl::mp { + +-namespace detail { ++ namespace detail { ++ ++ template class F, class L> ++ struct map_impl; ++ ++ template class F, template class LT, class... Es> ++ struct map_impl> { ++ using type = LT...>; ++ }; + +-template class F, class L> +-struct map_impl; + +-template class F, template class LT, class... Es> +-struct map_impl> { +- using type = LT...>; +-}; ++ #if defined(__clang__) && !defined(_MSC_VER) ++ template class F, class... Es> ++ struct map_impl> { ++ using type = mcl::mp::list...>; ++ }; ++ #endif + +-} // namespace detail ++ } // namespace detail + +-/// Applies each element of list L to metafunction F +-template class F, class L> +-using map = typename detail::map_impl::type; ++ /// Applies each element of list L to metafunction F ++ template class F, class L> ++ using map = typename detail::map_impl::type; + + } // namespace mcl::mp +diff --git a/externals/mcl/include/mcl/mp/typelist/lift_sequence.hpp b/externals/mcl/include/mcl/mp/typelist/lift_sequence.hpp +index ba2617b8..10f7d6c5 100644 +--- a/externals/mcl/include/mcl/mp/typelist/lift_sequence.hpp ++++ b/externals/mcl/include/mcl/mp/typelist/lift_sequence.hpp +@@ -5,25 +5,36 @@ + #pragma once + + #include ++#include + + #include "mcl/mp/typelist/list.hpp" + + namespace mcl::mp { + +-namespace detail { ++ namespace detail { + +-template +-struct lift_sequence_impl; ++ template ++ struct lift_sequence_impl; // Forward declaration + +-template class VLT, T... values> +-struct lift_sequence_impl> { +- using type = list...>; +-}; ++ // Original specialization (works for GCC/MSVC) ++ template class VLT, T... values> ++ struct lift_sequence_impl> { ++ using type = list...>; ++ }; + +-} // namespace detail ++ // Clang-specific fix: Add a more explicit specialization that Clang can match. ++ // We check for __clang__ but not _MSC_VER, as clang-cl on Windows might not need this. ++ #if defined(__clang__) && !defined(_MSC_VER) ++ template ++ struct lift_sequence_impl> { ++ using type = list...>; ++ }; ++ #endif + +-/// Lifts values in value list VL to create a type list. +-template +-using lift_sequence = typename detail::lift_sequence_impl::type; ++ } // namespace detail ++ ++ /// Lifts values in value list VL to create a type list. ++ template ++ using lift_sequence = typename detail::lift_sequence_impl::type; + + } // namespace mcl::mp +diff --git a/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp b/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp +index b8aa3eb6..b6eda4e4 100644 +--- a/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp ++++ b/src/dynarmic/backend/x64/emit_x64_vector_floating_point.cpp +@@ -1285,6 +1285,7 @@ void EmitX64::EmitFPVectorMul64(EmitContext& ctx, IR::Inst* inst) { + + template + static void EmitFPVectorMulAddFallback(VectorArray& result, const VectorArray& addend, const VectorArray& op1, const VectorArray& op2, FP::FPCR fpcr, [[maybe_unused]] FP::FPSR& fpsr) { ++ #pragma clang loop vectorize(enable) + for (size_t i = 0; i < result.size(); i++) { + if constexpr (needs_rounding_correction) { + constexpr FPT non_sign_mask = FP::FPInfo::exponent_mask | FP::FPInfo::mantissa_mask;