SeqAn3 3.4.3-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
builtin_simd_intrinsics.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2026 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2026 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
13
14// Exclude powerpc since it may have this header and triggers a warning (-DNO_WARN_X86_INTRINSICS) which tells you that
15// x86intrin.h is only there to allow porting x86_64 code to powerpc, specifically Intel intrinsics to powerpc64le.
16// Since we will not support powerpc for the builtin simd backend, we will avoid including this header.
17//
18// See the following link for a full description of the x86intrin.h header on powerpc
19// https://github.com/gcc-mirror/gcc/blob/41d6b10e96a1de98e90a7c0378437c3255814b16/gcc/config/rs6000/xmmintrin.h#L27-L55
20//
21// We also exclude clang with libc++ on any non-x86 platform.
22// `x86intrin.h` includes `immintrin.h`, which will error:
23// https://github.com/llvm/llvm-project/blob/9886788a8a500a1b429a6db64397c849b112251c/clang/lib/Headers/immintrin.h#L14
24#if __has_include(<x86intrin.h>) && \
25 !(defined(__powerpc__) || defined(__ppc__) || defined(__PPC__)) && \
26 !(defined(__clang__) && defined(_LIBCPP_VERSION) && !defined(__i386__) && !defined(__x86_64__))
27# include <x86intrin.h> // x86 intrinsics (linux)
28#endif
29
30#if defined(_WIN32) && __has_include(<intrin.h>)
31# include <intrin.h> // x86 intrinsics (windows)
32#endif
33
34// MSVC doesn't define SSE4 macros, even if the instruction set is available (e.g. when AVX is defined)
35// See https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-160
36#if defined(_MSC_VER) && defined(__AVX__) && !defined(__SSE4_1__) && !defined(__SSE4_2__)
37# define __SSE4_1__ 1
38# define __SSE4_2__ 1
39#endif
Provides platform and dependency checks.
Hide me