mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix build on Apple Clang 17+ (#18629)
Fixing "invalid cpu feature string for builtin" errors that started to appear on Apple Clang 17.0.0
This commit is contained in:
parent
a44e3f442f
commit
772479ea2f
1 changed files with 28 additions and 0 deletions
|
@ -126,58 +126,86 @@ ZEND_API int zend_cpu_supports(zend_cpu_feature feature);
|
|||
* functions */
|
||||
ZEND_NO_SANITIZE_ADDRESS
|
||||
static inline int zend_cpu_supports_sse2(void) {
|
||||
#ifdef __aarch64__
|
||||
return 0;
|
||||
#else
|
||||
#if PHP_HAVE_BUILTIN_CPU_INIT
|
||||
__builtin_cpu_init();
|
||||
#endif
|
||||
return __builtin_cpu_supports("sse2");
|
||||
#endif
|
||||
}
|
||||
|
||||
ZEND_NO_SANITIZE_ADDRESS
|
||||
static inline int zend_cpu_supports_sse3(void) {
|
||||
#ifdef __aarch64__
|
||||
return 0;
|
||||
#else
|
||||
#if PHP_HAVE_BUILTIN_CPU_INIT
|
||||
__builtin_cpu_init();
|
||||
#endif
|
||||
return __builtin_cpu_supports("sse3");
|
||||
#endif
|
||||
}
|
||||
|
||||
ZEND_NO_SANITIZE_ADDRESS
|
||||
static inline int zend_cpu_supports_ssse3(void) {
|
||||
#ifdef __aarch64__
|
||||
return 0;
|
||||
#else
|
||||
#if PHP_HAVE_BUILTIN_CPU_INIT
|
||||
__builtin_cpu_init();
|
||||
#endif
|
||||
return __builtin_cpu_supports("ssse3");
|
||||
#endif
|
||||
}
|
||||
|
||||
ZEND_NO_SANITIZE_ADDRESS
|
||||
static inline int zend_cpu_supports_sse41(void) {
|
||||
#ifdef __aarch64__
|
||||
return 0;
|
||||
#else
|
||||
#if PHP_HAVE_BUILTIN_CPU_INIT
|
||||
__builtin_cpu_init();
|
||||
#endif
|
||||
return __builtin_cpu_supports("sse4.1");
|
||||
#endif
|
||||
}
|
||||
|
||||
ZEND_NO_SANITIZE_ADDRESS
|
||||
static inline int zend_cpu_supports_sse42(void) {
|
||||
#ifdef __aarch64__
|
||||
return 0;
|
||||
#else
|
||||
#if PHP_HAVE_BUILTIN_CPU_INIT
|
||||
__builtin_cpu_init();
|
||||
#endif
|
||||
return __builtin_cpu_supports("sse4.2");
|
||||
#endif
|
||||
}
|
||||
|
||||
ZEND_NO_SANITIZE_ADDRESS
|
||||
static inline int zend_cpu_supports_avx(void) {
|
||||
#ifdef __aarch64__
|
||||
return 0;
|
||||
#else
|
||||
#if PHP_HAVE_BUILTIN_CPU_INIT
|
||||
__builtin_cpu_init();
|
||||
#endif
|
||||
return __builtin_cpu_supports("avx");
|
||||
#endif
|
||||
}
|
||||
|
||||
ZEND_NO_SANITIZE_ADDRESS
|
||||
static inline int zend_cpu_supports_avx2(void) {
|
||||
#ifdef __aarch64__
|
||||
return 0;
|
||||
#else
|
||||
#if PHP_HAVE_BUILTIN_CPU_INIT
|
||||
__builtin_cpu_init();
|
||||
#endif
|
||||
return __builtin_cpu_supports("avx2");
|
||||
#endif
|
||||
}
|
||||
|
||||
#if PHP_HAVE_AVX512_SUPPORTS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue