Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if NEON extension are actually available #4154

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,20 @@ case "${host_cpu}" in
;;

arm*)

AX_CHECK_COMPILE_FLAG([-mfpu=neon], [neon=true], [neon=false], [$WERROR])
AM_CONDITIONAL([HAVE_NEON], $neon)
if $neon; then
SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="-mfpu=neon $CXXFLAGS"
AC_MSG_CHECKING([for NEON support])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [[
#ifndef __ARM_NEON
#error
#endif
]])],
[neon=yes], [neon=no])
AC_MSG_RESULT([$neon])
CXXFLAGS="$SAVE_CXXFLAGS"
AM_CONDITIONAL([HAVE_NEON], test "xyes" = "x$neon")
if test "xyes" = "$neon"; then
AC_DEFINE([HAVE_NEON], [1], [Enable NEON instructions])
NEON_CXXFLAGS="-mfpu=neon"
AC_SUBST([NEON_CXXFLAGS])
Expand Down