diff --git a/src/builtins/transpose.c b/src/builtins/transpose.c index 320eb7f6..2f93aed5 100644 --- a/src/builtins/transpose.c +++ b/src/builtins/transpose.c @@ -40,7 +40,7 @@ #include "../builtins.h" #include "../utils/calls.h" -#ifdef __BMI2__ +#if __BMI2__ && __x86_64__ #if !SLOW_PDEP #define FAST_PDEP 1 #endif @@ -198,7 +198,7 @@ static Arr* transpose_noshape(B* px, usz ia, usz w, usz h) { Arr* x1o = TI(x,slice)(incG(x),w,w); interleave_bits(rp, bitany_ptr(x), bitanyv_ptr(x1o), ia); mm_free((Value*)x1o); - #ifdef __BMI2__ + #if __BMI2__ && __x86_64__ } else if (w==2) { u64* xp = bitany_ptr(x); u64* r0; r=m_bitarrp(&r0, ia); diff --git a/src/utils/bits.c b/src/utils/bits.c index 9e5c53cc..a72437cb 100644 --- a/src/utils/bits.c +++ b/src/utils/bits.c @@ -25,7 +25,7 @@ INIT_GLOBAL BitSelFn* bitselFns = bitselFnsRaw; #endif -#if defined(__BMI2__) && !SLOW_PDEP +#if __BMI2__ && __x86_64__ && !SLOW_PDEP #define FAST_PDEP 1 #include #endif diff --git a/src/utils/wyhash.h b/src/utils/wyhash.h index ffb15a4d..742c3ca3 100644 --- a/src/utils/wyhash.h +++ b/src/utils/wyhash.h @@ -114,7 +114,7 @@ static inline uint64_t _wyr4(const uint8_t *p) { } #endif -#ifdef __BMI2__ +#if __BMI2__ && __x86_64__ #include #endif @@ -122,7 +122,7 @@ static inline uint64_t _wyr4(const uint8_t *p) { FORCE_INLINE uint64_t wyhash(const void *key, size_t len, uint64_t seed, const uint64_t *secret){ const uint8_t *p = (const uint8_t *)key; seed^=*secret; uint64_t a, b; if (_likely_(len<=16)) { - #ifdef __BMI2__ + #if __BMI2__ && __x86_64__ if (len>8) { a = _wyr8(p); b = _bzhi_u64(_wyr8(p+8), (len-8)*8); } else { a = 0; b = _bzhi_u64(_wyr8(p ), len *8); } #else diff --git a/src/vm.h b/src/vm.h index 236766fe..d771b101 100644 --- a/src/vm.h +++ b/src/vm.h @@ -4,7 +4,7 @@ #endif #if defined(JIT_ENABLED)? JIT_ENABLED : ( \ - (defined(__x86_64) || defined(__amd64__)) \ + defined(__x86_64__) \ && (__APPLE__ || __MACH__ || __linux__ || __FreeBSD__ || __unix || __unix__) \ && (defined(__linux__)? defined(MAP_FIXED_NOREPLACE) : 1) \ && defined(MAP_32BIT) && MM!=0 \