Skip to content

Commit

Permalink
enable ARM Neon optimizations (tested on Oracle Cloud)
Browse files Browse the repository at this point in the history
  • Loading branch information
divinity76 committed Jan 19, 2024
1 parent 6f40213 commit 882466b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,10 @@ PHP_C_BIGENDIAN
dnl Check if we're targeting x86 / x86_64
PHP_CHECK_X86_TARGET

dnl Check if we're targeting ARM Neon CPUs
PHP_CHECK_ARM_NEON_SUPPORT


dnl Check if we're targeting Windows
PHP_CHECK_WINDOWS_TARGET

Expand Down
12 changes: 6 additions & 6 deletions ext/hash/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ fi

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"

dnl if test $ac_cv_target_arm_neon = yes; then
dnl EXT_HASH_BLAKE3_SOURCES="$EXT_HASH_BLAKE3_SOURCES blake3/upstream_blake3/c/blake3_neon.c"
dnl EXT_HASH_BLAKE3_HEADERS="$EXT_HASH_BLAKE3_HEADERS ext/hash/blake3/upstream_blake3/c/blake3_impl.h"
dnl fi
PHP_HASH_CFLAGS="$PHP_HASH_CFLAGS -DBLAKE3_USE_NEON=0"

if test $ac_cv_target_arm_neon = yes; then
EXT_HASH_BLAKE3_SOURCES="$EXT_HASH_BLAKE3_SOURCES blake3/upstream_blake3/c/blake3_neon.c"
EXT_HASH_BLAKE3_HEADERS="$EXT_HASH_BLAKE3_HEADERS ext/hash/blake3/upstream_blake3/c/blake3_impl.h"
else
PHP_HASH_CFLAGS="$PHP_HASH_CFLAGS -DBLAKE3_USE_NEON=0"
fi

if test $ac_cv_c_bigendian_php = yes; then
EXT_HASH_SHA3_SOURCES="hash_sha3.c"
Expand Down

0 comments on commit 882466b

Please sign in to comment.