diff --git a/lib/x86simdsort.cpp b/lib/x86simdsort.cpp index a5bbc57..ecc80bf 100644 --- a/lib/x86simdsort.cpp +++ b/lib/x86simdsort.cpp @@ -10,7 +10,8 @@ static int check_cpu_feature_support(std::string_view cpufeature) const char *disable_avx512 = std::getenv("XSS_DISABLE_AVX512"); if ((cpufeature == "avx512_spr") && (!disable_avx512)) -#if defined(__FLT16_MAX__) && !defined(__INTEL_LLVM_COMPILER) +#if defined(__FLT16_MAX__) && !defined(__INTEL_LLVM_COMPILER) \ + && __clang_major__ >= 18 return __builtin_cpu_supports("avx512f") && __builtin_cpu_supports("avx512fp16") && __builtin_cpu_supports("avx512vbmi2"); diff --git a/src/avx2-64bit-qsort.hpp b/src/avx2-64bit-qsort.hpp index 32e5e38..d8b094d 100644 --- a/src/avx2-64bit-qsort.hpp +++ b/src/avx2-64bit-qsort.hpp @@ -406,10 +406,10 @@ struct avx2_vector { }; /* - * workaround on 64-bit macOS which defines size_t as unsigned long and defines - * uint64_t as unsigned long long, both of which are 8 bytes + * workaround on 64-bit macOS and OpenBSD which both define size_t as unsigned + * long and define uint64_t as unsigned long long, both of which are 8 bytes */ -#if defined(__APPLE__) && defined(__x86_64__) +#if (defined(__APPLE__) || defined(__OpenBSD__)) && defined(__x86_64__) static_assert(sizeof(size_t) == sizeof(uint64_t), "Size of size_t and uint64_t are not the same"); template <> diff --git a/src/avx512-64bit-common.h b/src/avx512-64bit-common.h index 6e2b6ef..689c317 100644 --- a/src/avx512-64bit-common.h +++ b/src/avx512-64bit-common.h @@ -960,10 +960,10 @@ struct zmm_vector { }; /* - * workaround on 64-bit macOS which defines size_t as unsigned long and defines - * uint64_t as unsigned long long, both of which are 8 bytes + * workaround on 64-bit macOS and OpenBSD which both define size_t as unsigned + * long and define uint64_t as unsigned long long, both of which are 8 bytes */ -#if defined(__APPLE__) && defined(__x86_64__) +#if (defined(__APPLE__) || defined(__OpenBSD__)) && defined(__x86_64__) static_assert(sizeof(size_t) == sizeof(uint64_t), "Size of size_t and uint64_t are not the same"); template <>