@@ -126,58 +126,86 @@ ZEND_API int zend_cpu_supports(zend_cpu_feature feature);
126126 * functions */
127127ZEND_NO_SANITIZE_ADDRESS
128128static inline int zend_cpu_supports_sse2 (void ) {
129+ #if (defined(__APPLE__ ) && defined(__aarch64__ ) && defined(__clang_major__ ) && __clang_major__ >= 17 )
130+ return 0 ;
131+ #else
129132#if PHP_HAVE_BUILTIN_CPU_INIT
130133 __builtin_cpu_init ();
131134#endif
132135 return __builtin_cpu_supports ("sse2" );
136+ #endif
133137}
134138
135139ZEND_NO_SANITIZE_ADDRESS
136140static inline int zend_cpu_supports_sse3 (void ) {
141+ #if (defined(__APPLE__ ) && defined(__aarch64__ ) && defined(__clang_major__ ) && __clang_major__ >= 17 )
142+ return 0 ;
143+ #else
137144#if PHP_HAVE_BUILTIN_CPU_INIT
138145 __builtin_cpu_init ();
139146#endif
140147 return __builtin_cpu_supports ("sse3" );
148+ #endif
141149}
142150
143151ZEND_NO_SANITIZE_ADDRESS
144152static inline int zend_cpu_supports_ssse3 (void ) {
153+ #if (defined(__APPLE__ ) && defined(__aarch64__ ) && defined(__clang_major__ ) && __clang_major__ >= 17 )
154+ return 0 ;
155+ #else
145156#if PHP_HAVE_BUILTIN_CPU_INIT
146157 __builtin_cpu_init ();
147158#endif
148159 return __builtin_cpu_supports ("ssse3" );
160+ #endif
149161}
150162
151163ZEND_NO_SANITIZE_ADDRESS
152164static inline int zend_cpu_supports_sse41 (void ) {
165+ #if (defined(__APPLE__ ) && defined(__aarch64__ ) && defined(__clang_major__ ) && __clang_major__ >= 17 )
166+ return 0 ;
167+ #else
153168#if PHP_HAVE_BUILTIN_CPU_INIT
154169 __builtin_cpu_init ();
155170#endif
156171 return __builtin_cpu_supports ("sse4.1" );
172+ #endif
157173}
158174
159175ZEND_NO_SANITIZE_ADDRESS
160176static inline int zend_cpu_supports_sse42 (void ) {
177+ #if (defined(__APPLE__ ) && defined(__aarch64__ ) && defined(__clang_major__ ) && __clang_major__ >= 17 )
178+ return 0 ;
179+ #else
161180#if PHP_HAVE_BUILTIN_CPU_INIT
162181 __builtin_cpu_init ();
163182#endif
164183 return __builtin_cpu_supports ("sse4.2" );
184+ #endif
165185}
166186
167187ZEND_NO_SANITIZE_ADDRESS
168188static inline int zend_cpu_supports_avx (void ) {
189+ #if (defined(__APPLE__ ) && defined(__aarch64__ ) && defined(__clang_major__ ) && __clang_major__ >= 17 )
190+ return 0 ;
191+ #else
169192#if PHP_HAVE_BUILTIN_CPU_INIT
170193 __builtin_cpu_init ();
171194#endif
172195 return __builtin_cpu_supports ("avx" );
196+ #endif
173197}
174198
175199ZEND_NO_SANITIZE_ADDRESS
176200static inline int zend_cpu_supports_avx2 (void ) {
201+ #if (defined(__APPLE__ ) && defined(__aarch64__ ) && defined(__clang_major__ ) && __clang_major__ >= 17 )
202+ return 0 ;
203+ #else
177204#if PHP_HAVE_BUILTIN_CPU_INIT
178205 __builtin_cpu_init ();
179206#endif
180207 return __builtin_cpu_supports ("avx2" );
208+ #endif
181209}
182210
183211#if PHP_HAVE_AVX512_SUPPORTS
0 commit comments