Skip to content

Commit d58f704

Browse files
committed
Simplify check (in mb_fast_check_utf8) for seeing if 16 bytes are all ASCII characters
1 parent fa1e3f9 commit d58f704

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/mbstring/mbstring.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -4621,7 +4621,7 @@ static bool mb_fast_check_utf8(zend_string *str)
46214621

46224622
check_operand:
46234623
/* If all 16 bytes are single-byte characters, then a number of checks can be skipped */
4624-
if (!_mm_movemask_epi8(_mm_cmplt_epi8(operand, _mm_setzero_si128()))) {
4624+
if (!_mm_movemask_epi8(operand)) {
46254625
/* Even if this block only contains single-byte characters, there may have been a
46264626
* multi-byte character at the end of the previous block, which was supposed to
46274627
* have continuation bytes in this block
@@ -4641,7 +4641,7 @@ static bool mb_fast_check_utf8(zend_string *str)
46414641
goto finish_up_remaining_bytes;
46424642
}
46434643
operand = _mm_loadu_si128((__m128i*)p);
4644-
if (_mm_movemask_epi8(_mm_cmplt_epi8(operand, _mm_setzero_si128()))) {
4644+
if (_mm_movemask_epi8(operand)) {
46454645
break;
46464646
}
46474647
}

0 commit comments

Comments
 (0)