gh-123748: Add conditional compilation rules for HACL SIMD256 and SIMD128 on macOS (#123989)

Add conditional compilation rules to allow HACL SIMD256 and SIMD128 to be ignored on the ARM64 pass of universal2 macOS builds.
This commit is contained in:
Russell Keith-Magee 2024-09-16 12:23:05 +08:00 committed by GitHub
parent 56470004e5
commit ef530ce7c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 143 additions and 4 deletions

View file

@ -41,6 +41,16 @@
#include <stdbool.h>
// SIMD256 can't be compiled on macOS ARM64, and performance of SIMD128 isn't
// great; but when compiling a universal2 binary, autoconf will set
// HACL_CAN_COMPILE_SIMD128 and HACL_CAN_COMPILE_SIMD256 because they *can* be
// compiled on x86_64. If we're on macOS ARM64, disable these preprocessor
// symbols.
#if defined(__APPLE__) && defined(__arm64__)
# undef HACL_CAN_COMPILE_SIMD128
# undef HACL_CAN_COMPILE_SIMD256
#endif
// ECX
#define ECX_SSE3 (1 << 0)
#define ECX_SSSE3 (1 << 9)