[libcxx-commits] [libcxx] [libc++] Fix endianness for algorithm mismatch (PR #93082)
Zibi Sarbinowski via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jun 3 11:30:27 PDT 2024
================
@@ -56,6 +56,112 @@ __mismatch(_Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Pred& __pred, _Pro
#if _LIBCPP_VECTORIZE_ALGORITHMS
+template <class _ValueType>
+_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __simd_vector<long long, 2>
+__reverse_vector(__simd_vector<long long, 2>& __cmp_res) {
+# if defined(_LIBCPP_BIG_ENDIAN)
+ __cmp_res = __builtin_shufflevector(__cmp_res, __cmp_res, 1, 0);
+# endif
+ return __cmp_res;
+}
----------------
zibi2 wrote:
Thanks for suggestion, let me know if the current code is fine otherwise, please elaborate on the idea of modifying `__find_first_set` since I'm not sure how the code be common on all platforms.
https://github.com/llvm/llvm-project/pull/93082
More information about the libcxx-commits
mailing list