From ddb08349bbb2b6cae700ea4dd4cc4a85609bff5f Mon Sep 17 00:00:00 2001 From: NicJA Date: Tue, 16 Apr 2019 12:44:59 +0000 Subject: [PATCH] detect the availability of -ftree-vectorize and -fassociative-math git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@56274 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- config/compiler.cfg.in | 5 +++++ config/features | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ config/features.in | 18 +++++++++++++++++ 3 files changed, 77 insertions(+) diff --git a/config/compiler.cfg.in b/config/compiler.cfg.in index 362f41fcc3..9840d5a578 100644 --- a/config/compiler.cfg.in +++ b/config/compiler.cfg.in @@ -10,8 +10,13 @@ CFLAGS_NO_EXCEPTIONS := @aros_cflags_noexceptions@ # CFLAGS_FAST_MATH := @aros_cflags_fast_math@ +CFLAGS_ASSOCIATIVE_MATH := @aros_cflags_associative_math@ CFLAGS_NO_MATH_ERRNO := @aros_cflags_no_math_errno@ CFLAGS_NO_TRAPPING_MATH := @aros_cflags_no_trapping_math@ + +# Auto vectorize +CFLAGS_TREE_VECTORIZE := @aros_cflags_tree_vectorize@ + # # LTO/Graphite optimization flags # diff --git a/config/features b/config/features index c92dbe4e43..a47179bce4 100755 --- a/config/features +++ b/config/features @@ -2837,8 +2837,10 @@ $as_echo "$aros_targetcfg_dir" >&6; } # C/ObjC # -fexceptions # -ffast-math +# -fassociative-math # -fno-math-errno # -fno-trapping-math +# -ftree-vectorize # -flto # -fwhole-program # -floop-block @@ -2931,6 +2933,32 @@ if test "x-$aros_fast_math" = "x-yes" ; then aros_cflags_fast_math=-ffast-math fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -fassociative-math" >&5 +$as_echo_n "checking whether ${CC} accepts -fassociative-math... " >&6; } +CFLAGS=-fassociative-math +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + aros_associative_math="yes" +else + aros_associative_math="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aros_associative_math" >&5 +$as_echo "$aros_associative_math" >&6; } +if test "x-$aros_associative_math" = "x-yes" ; then + aros_cflags_associative_math=-fassociative-math +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -fno-math-errno" >&5 $as_echo_n "checking whether ${CC} accepts -fno-math-errno... " >&6; } CFLAGS=-fno-math-errno @@ -2983,6 +3011,32 @@ if test "x-$aros_no_trapping_math" = "x-yes" ; then aros_cflags_no_trapping_math=-fno-trapping-math fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -ftree-vectorize" >&5 +$as_echo_n "checking whether ${CC} accepts -ftree-vectorize... " >&6; } +CFLAGS=-ftree-vectorize +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + aros_tree_vectorize="yes" +else + aros_tree_vectorize="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aros_tree_vectorize" >&5 +$as_echo "$aros_tree_vectorize" >&6; } +if test "x-$aros_tree_vectorize" = "x-yes" ; then + aros_cflags_tree_vectorize=-ftree-vectorize +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -flto" >&5 $as_echo_n "checking whether ${CC} accepts -flto... " >&6; } CFLAGS=-flto diff --git a/config/features.in b/config/features.in index 86cb17d718..c49b7ee488 100644 --- a/config/features.in +++ b/config/features.in @@ -37,8 +37,10 @@ AC_MSG_RESULT($aros_targetcfg_dir) # C/ObjC # -fexceptions # -ffast-math +# -fassociative-math # -fno-math-errno # -fno-trapping-math +# -ftree-vectorize # -flto # -fwhole-program # -floop-block @@ -89,6 +91,14 @@ if test "x-$aros_fast_math" = "x-yes" ; then aros_cflags_fast_math=-ffast-math fi +AC_MSG_CHECKING([whether ${CC} accepts -fassociative-math]) +CFLAGS=-fassociative-math +AC_TRY_COMPILE(,, aros_associative_math="yes", aros_associative_math="no") +AC_MSG_RESULT($aros_associative_math) +if test "x-$aros_associative_math" = "x-yes" ; then + aros_cflags_associative_math=-fassociative-math +fi + AC_MSG_CHECKING([whether ${CC} accepts -fno-math-errno]) CFLAGS=-fno-math-errno AC_TRY_COMPILE(,, aros_no_math_errno="yes", aros_no_math_errno="no") @@ -105,6 +115,14 @@ if test "x-$aros_no_trapping_math" = "x-yes" ; then aros_cflags_no_trapping_math=-fno-trapping-math fi +AC_MSG_CHECKING([whether ${CC} accepts -ftree-vectorize]) +CFLAGS=-ftree-vectorize +AC_TRY_COMPILE(,, aros_tree_vectorize="yes", aros_tree_vectorize="no") +AC_MSG_RESULT($aros_tree_vectorize) +if test "x-$aros_tree_vectorize" = "x-yes" ; then + aros_cflags_tree_vectorize=-ftree-vectorize +fi + AC_MSG_CHECKING([whether ${CC} accepts -flto]) CFLAGS=-flto AC_TRY_COMPILE(,, aros_lto="yes", aros_lto="no") -- 2.11.4.GIT