Skip to content

Commit e02cd8c

Browse files
committed
use zend_simd.h in mbstring
1 parent 9cbc9ac commit e02cd8c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ext/mbstring/mbstring.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@
6565

6666
#include "rare_cp_bitvec.h"
6767

68-
#ifdef __SSE2__
69-
#include <emmintrin.h>
70-
#endif
68+
#include "zend_simd.h"
7169

7270
#ifdef __SSE3__
7371
#include <immintrin.h>
@@ -1749,7 +1747,7 @@ PHP_FUNCTION(mb_str_split)
17491747
}
17501748
}
17511749

1752-
#ifdef __SSE2__
1750+
#ifdef XSSE2
17531751
/* Thanks to StackOverflow user 'Paul R' (https://stackoverflow.com/users/253056/paul-r)
17541752
* From: https://stackoverflow.com/questions/36998538/fastest-way-to-horizontally-sum-sse-unsigned-byte-vector
17551753
* Takes a 128-bit XMM register, treats each byte as an 8-bit integer, and sums up all
@@ -1780,7 +1778,7 @@ static size_t mb_fast_strlen_utf8(unsigned char *p, size_t len)
17801778
{
17811779
unsigned char *e = p + len;
17821780

1783-
#ifdef __SSE2__
1781+
#ifdef XSSE2
17841782
if (len >= sizeof(__m128i)) {
17851783
e -= sizeof(__m128i);
17861784

@@ -4919,7 +4917,7 @@ MBSTRING_API bool php_mb_check_encoding(const char *input, size_t length, const
49194917
static bool mb_fast_check_utf8_default(zend_string *str)
49204918
{
49214919
unsigned char *p = (unsigned char*)ZSTR_VAL(str);
4922-
# ifdef __SSE2__
4920+
# ifdef XSSE2
49234921
/* `e` points 1 byte past the last full 16-byte block of string content
49244922
* Note that we include the terminating null byte which is included in each zend_string
49254923
* as part of the content to check; this ensures that multi-byte characters which are

0 commit comments

Comments
 (0)