]> granicus.if.org Git - php/commitdiff
change layout
authorXinchen Hui <laruence@gmail.com>
Sun, 18 Feb 2018 11:47:41 +0000 (19:47 +0800)
committerXinchen Hui <laruence@gmail.com>
Sun, 18 Feb 2018 11:47:41 +0000 (19:47 +0800)
ext/standard/string.c

index fce878358a60cdd2dd4bf2936e0873efc9c3f624..1843844103910599f3dc087b5f9ca6bde9fef428 100644 (file)
@@ -3531,19 +3531,19 @@ PHP_FUNCTION(strrev)
        e = s + ZSTR_LEN(str);
        --e;
 #if ZEND_INTRIN_SSSE3_NATIVE
-       do {
+       if (e - s > 15) {
                const __m128i map = _mm_set_epi8(
                                0, 1, 2, 3,
                                4, 5, 6, 7,
                                8, 9, 10, 11,
                                12, 13, 14, 15);
-               while (e - s > 15) {
+               do {
                        const __m128i str = _mm_loadu_si128((__m128i *)(e - 15));
                        _mm_storeu_si128((__m128i *)p, _mm_shuffle_epi8(str, map));
                        p += 16;
                        e -= 16;
-               }
-       } while(0);
+               } while (e - s > 15);
+       }
 #endif
        while (e >= s) {
                *p++ = *e--;