Skip to content

Commit 58f30ff

Browse files
committed
SSE2 guard
1 parent 7d485a9 commit 58f30ff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ext/json/json_encoder.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ zend_result php_json_escape_string(
474474
0xffffffff, 0x500080c4, 0x10000000, 0x00000000,
475475
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff};
476476

477+
#ifdef __SSE2__
477478
while (len >= sizeof(__m128i)) {
478479
const __m128i input = _mm_loadu_si128((__m128i *) (s + pos));
479480
const __m128i input_range = _mm_cmpgt_epi8(input, _mm_set1_epi8(31));
@@ -538,6 +539,7 @@ zend_result php_json_escape_string(
538539
if (!len) {
539540
break;
540541
}
542+
#endif
541543

542544
us = (unsigned char)s[pos];
543545
if (EXPECTED(!ZEND_BIT_TEST(charmap, us))) {

0 commit comments

Comments
 (0)