diff --git a/src/cpu.cpp b/src/cpu.cpp index be9f1b1..ff79fe0 100644 --- a/src/cpu.cpp +++ b/src/cpu.cpp @@ -62,9 +62,13 @@ namespace randomx { cpuid(info, 0x00000007); avx2_ = (info[1] & (1 << 5)) != 0; } -#elif defined(__aarch64__) && defined(HWCAP_AES) +#elif defined(__aarch64__) + #if defined(HWCAP_AES) long hwcaps = getauxval(AT_HWCAP); aes_ = (hwcaps & HWCAP_AES) != 0; + #elif defined(__APPLE__) + aes_ = true; + #endif #endif //TODO POWER8 AES } diff --git a/src/jit_compiler.hpp b/src/jit_compiler.hpp index 70ffedd..17fdad4 100644 --- a/src/jit_compiler.hpp +++ b/src/jit_compiler.hpp @@ -36,6 +36,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "jit_compiler_fallback.hpp" #endif -#if defined(__OpenBSD__) || defined(__NetBSD__) +#if defined(__OpenBSD__) || defined(__NetBSD__) || (defined(__APPLE__) && defined(__aarch64__)) #define RANDOMX_FORCE_SECURE #endif