Skip to content

Commit b8972bc

Browse files
committed
use zend_simd.h in ZendAccelerator.c
1 parent 2efaa46 commit b8972bc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

ext/opcache/ZendAccelerator.c

+8-6
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ typedef int gid_t;
9898
#include <immintrin.h>
9999
#endif
100100

101+
#include "zend_simd.h"
102+
101103
ZEND_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_VECTOR_128)
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

0 commit comments

Comments
 (0)