summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-05-07 10:41:31 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-05-07 10:41:31 +0200
commit49c4ab3c394a6e18ab09582bccf6a26d88c4a616 (patch)
treebea820e4abae81a37b0ea8be2a390041154a42c0
parent91a91c6c8b862a823154451912350ae1b4a21e0b (diff)
parent68a7578243635c9dd83580ebbb32cdf5390a1984 (diff)
downloadphp-git-49c4ab3c394a6e18ab09582bccf6a26d88c4a616.tar.gz
Merge branch 'PHP-7.4'
-rw-r--r--Zend/README.ZEND_MM10
-rw-r--r--ext/standard/string.c15
2 files changed, 15 insertions, 10 deletions
diff --git a/Zend/README.ZEND_MM b/Zend/README.ZEND_MM
index cfdcdaa4a1..017b937665 100644
--- a/Zend/README.ZEND_MM
+++ b/Zend/README.ZEND_MM
@@ -25,13 +25,3 @@ Since PHP 5.3.11 it is possible to prevent shared extensions from unloading so
that valgrind can correctly track the memory leaks in shared extensions. For
this there is the ZEND_DONT_UNLOAD_MODULES environment variable. If set, then
DL_UNLOAD() is skipped during the shutdown of shared extensions.
-
-
-Tweaking:
----------
-
-The Zend MM can be tweaked using ZEND_MM_MEM_TYPE and ZEND_MM_SEG_SIZE environment
-variables. Default values are "malloc" and "256K". Dependent on target system you
-can also use "mmap_anon", "mmap_zero" and "win32" storage managers.
-
- $ ZEND_MM_MEM_TYPE=mmap_anon ZEND_MM_SEG_SIZE=1M sapi/cli/php ..etc.
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 2aebfa77db..d0797725bd 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -3376,6 +3376,8 @@ PHP_FUNCTION(strtr)
Reverse a string */
#if ZEND_INTRIN_SSSE3_NATIVE
#include <tmmintrin.h>
+#elif defined(__aarch64__)
+#include <arm_neon.h>
#endif
PHP_FUNCTION(strrev)
{
@@ -3408,6 +3410,19 @@ PHP_FUNCTION(strrev)
e -= 16;
} while (e - s > 15);
}
+#elif defined(__aarch64__)
+ if (e - s > 15) {
+ do {
+ const uint8x16_t str = vld1q_u8((uint8_t *)(e - 15));
+ /* Synthesize rev128 with a rev64 + ext. */
+ const uint8x16_t rev = vrev64q_u8(str);
+ const uint8x16_t ext = (uint8x16_t)
+ vextq_u64((uint64x2_t)rev, (uint64x2_t)rev, 1);
+ vst1q_u8((uint8_t *)p, ext);
+ p += 16;
+ e -= 16;
+ } while (e - s > 15);
+ }
#endif
while (e >= s) {
*p++ = *e--;