Skip to content

Commit 882466b

Browse files
committed
enable ARM Neon optimizations (tested on Oracle Cloud)
1 parent 6f40213 commit 882466b

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

configure.ac

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,10 @@ PHP_C_BIGENDIAN
342342
dnl Check if we're targeting x86 / x86_64
343343
PHP_CHECK_X86_TARGET
344344

345+
dnl Check if we're targeting ARM Neon CPUs
346+
PHP_CHECK_ARM_NEON_SUPPORT
347+
348+
345349
dnl Check if we're targeting Windows
346350
PHP_CHECK_WINDOWS_TARGET
347351

ext/hash/config.m4

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ fi
1010

1111
EXT_HASH_BLAKE3_SOURCES="hash_blake3.c blake3/upstream_blake3/c/blake3.c blake3/upstream_blake3/c/blake3_dispatch.c blake3/upstream_blake3/c/blake3_portable.c"
1212

13-
dnl if test $ac_cv_target_arm_neon = yes; then
14-
dnl EXT_HASH_BLAKE3_SOURCES="$EXT_HASH_BLAKE3_SOURCES blake3/upstream_blake3/c/blake3_neon.c"
15-
dnl EXT_HASH_BLAKE3_HEADERS="$EXT_HASH_BLAKE3_HEADERS ext/hash/blake3/upstream_blake3/c/blake3_impl.h"
16-
dnl fi
17-
PHP_HASH_CFLAGS="$PHP_HASH_CFLAGS -DBLAKE3_USE_NEON=0"
18-
13+
if test $ac_cv_target_arm_neon = yes; then
14+
EXT_HASH_BLAKE3_SOURCES="$EXT_HASH_BLAKE3_SOURCES blake3/upstream_blake3/c/blake3_neon.c"
15+
EXT_HASH_BLAKE3_HEADERS="$EXT_HASH_BLAKE3_HEADERS ext/hash/blake3/upstream_blake3/c/blake3_impl.h"
16+
else
17+
PHP_HASH_CFLAGS="$PHP_HASH_CFLAGS -DBLAKE3_USE_NEON=0"
18+
fi
1919

2020
if test $ac_cv_c_bigendian_php = yes; then
2121
EXT_HASH_SHA3_SOURCES="hash_sha3.c"

0 commit comments

Comments
 (0)