Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion libcxx/include/__algorithm/simd_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ _LIBCPP_PUSH_MACROS
#include <__undef_macros>

// TODO: Find out how altivec changes things and allow vectorizations there too.
#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_CLANG_VER) && !defined(__ALTIVEC__)
// TODO: Simplify this condition once we stop building with AppleClang 15 in the CI.
#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_COMPILER_CLANG_BASED) && !defined(__ALTIVEC__) && \
!(defined(_LIBCPP_APPLE_CLANG_VER) && _LIBCPP_APPLE_CLANG_VER < 1600)
# define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 1
#else
# define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 0
Expand Down
34 changes: 34 additions & 0 deletions libcxx/test/libcxx/algorithms/vectorization.compile.pass.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// We don't know how to vectorize algorithms on GCC
// XFAIL: gcc

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

// We don't vectorize algorithms before C++14
// XFAIL: c++03, c++11

// We don't vectorize algorithms on AIX right now.
// XFAIL: target={{.+}}-aix{{.*}}

// We don't vectorize on AppleClang 15 since that apparently breaks std::mismatch
// XFAIL: apple-clang-15

// This test ensures that we enable the vectorization of algorithms on the expected
// platforms.

#include <algorithm>

#ifndef _LIBCPP_VECTORIZE_ALGORITHMS
# error It looks like the test needs to be updated since _LIBCPP_VECTORIZE_ALGORITHMS isn't defined anymore
#endif

#if !_LIBCPP_VECTORIZE_ALGORITHMS
# error Algorithms should be vectorized on this platform
#endif
Loading