File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,8 @@ typedef int gid_t;
9898#include <immintrin.h>
9999#endif
100100
101+ #include "zend_simd.h"
102+
101103ZEND_EXTENSION ();
102104
103105#ifndef ZTS
@@ -171,16 +173,16 @@ static void bzero_aligned(void *mem, size_t size)
171173 _mm256_store_si256 ((__m256i * )(p + 32 ), ymm0 );
172174 p += 64 ;
173175 }
174- #elif defined(__SSE2__ )
176+ #elif defined(ZEND_HAVE_SIMD )
175177 char * p = (char * )mem ;
176178 char * end = p + size ;
177- __m128i xmm0 = _mm_setzero_si128 ();
179+ zend_vec_8x16_t xmm0 = zend_vec_setzero_8x16 ();
178180
179181 while (p < end ) {
180- _mm_store_si128 (( __m128i * ) p , xmm0 );
181- _mm_store_si128 (( __m128i * ) (p + 16 ), xmm0 );
182- _mm_store_si128 (( __m128i * ) (p + 32 ), xmm0 );
183- _mm_store_si128 (( __m128i * ) (p + 48 ), xmm0 );
182+ zend_vec_store_8x16 ( p , xmm0 );
183+ zend_vec_store_8x16 ( (p + 16 ), xmm0 );
184+ zend_vec_store_8x16 ( (p + 32 ), xmm0 );
185+ zend_vec_store_8x16 ( (p + 48 ), xmm0 );
184186 p += 64 ;
185187 }
186188#else
You can’t perform that action at this time.
0 commit comments