Skip to content

Commit

Permalink
Merge pull request #157 from ron-at-swgy/main
Browse files Browse the repository at this point in the history
Add flags to support OpenBSD
  • Loading branch information
r-devulap authored Jun 21, 2024
2 parents 33a4a1d + 3bb9296 commit 9a1b616
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion lib/x86simdsort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
6 changes: 3 additions & 3 deletions src/avx2-64bit-qsort.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,10 @@ struct avx2_vector<uint64_t> {
};

/*
* 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 <>
Expand Down
6 changes: 3 additions & 3 deletions src/avx512-64bit-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -960,10 +960,10 @@ struct zmm_vector<uint64_t> {
};

/*
* 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 <>
Expand Down

0 comments on commit 9a1b616

Please sign in to comment.