Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorRon <ron@debian.org>2013-06-04 09:51:43 +0400
committerRon <ron@debian.org>2013-06-04 10:00:40 +0400
commitaa6a1a16ad84a58484d4550d661118fe7b8bb310 (patch)
treea3570d3c080ebba4568eb76706aa0f1dcf77b6f2 /m4
parent58d80ab9ea3b2d54042debb445c08bf490758fce (diff)
Test the compiler configuration, not the assembler
With gcc-4.4 at least, the raw asm.s files will always successfully compile even if the default -march for the compiler would not support those instructions. So switch to testing the inline asm versions, where the compiler will barf if they aren't supported by the default arch if no -march is explicitly given, or if they aren't supported by the requested -march when it is.
Diffstat (limited to 'm4')
-rw-r--r--m4/as-gcc-inline-assembly.m469
1 files changed, 15 insertions, 54 deletions
diff --git a/m4/as-gcc-inline-assembly.m4 b/m4/as-gcc-inline-assembly.m4
index 4437a9d0..a6c44a52 100644
--- a/m4/as-gcc-inline-assembly.m4
+++ b/m4/as-gcc-inline-assembly.m4
@@ -4,8 +4,6 @@ dnl autostars m4 macro for detection of gcc inline assembly
dnl David Schleef <ds@schleef.org>
-dnl $Id$
-
dnl AS_COMPILER_FLAG(ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
dnl Tries to compile with the given CFLAGS.
dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
@@ -33,42 +31,15 @@ __asm__ (""::) ], [flag_ok=yes], [flag_ok=no])
AC_MSG_RESULT([$flag_ok])
])
-AC_DEFUN([AC_TRY_ASSEMBLE],
-[ac_c_ext=$ac_ext
- ac_ext=${ac_s_ext-s}
- cat > conftest.$ac_ext <<EOF
- .file "configure"
-[$1]
-EOF
-if AC_TRY_EVAL(ac_compile); then
- ac_ext=$ac_c_ext
- ifelse([$2], , :, [ $2
- rm -rf conftest*])
-else
- echo "configure: failed program was:" >&AC_FD_CC
- cat conftest.$ac_ext >&AC_FD_CC
- ac_ext=$ac_c_ext
-ifelse([$3], , , [ rm -rf conftest*
- $3
-])dnl
-fi
-rm -rf conftest*])
-
-
AC_DEFUN([AS_ASM_ARM_NEON],
[
AC_MSG_CHECKING([if assembler supports NEON instructions on ARM])
- AC_TRY_ASSEMBLE([vorr d0,d0,d0], [flag_ok=yes], [flag_ok=no])
-
- if test "X$flag_ok" = Xyes ; then
- $1
- true
- else
- $2
- true
- fi
- AC_MSG_RESULT([$flag_ok])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[__asm__("vorr d0,d0,d0")])],
+ [AC_MSG_RESULT([yes])
+ $1],
+ [AC_MSG_RESULT([no])
+ $2])
])
@@ -76,16 +47,11 @@ AC_DEFUN([AS_ASM_ARM_MEDIA],
[
AC_MSG_CHECKING([if assembler supports ARMv6 media instructions on ARM])
- AC_TRY_ASSEMBLE([shadd8 r3,r3,r3], [flag_ok=yes], [flag_ok=no])
-
- if test "X$flag_ok" = Xyes ; then
- $1
- true
- else
- $2
- true
- fi
- AC_MSG_RESULT([$flag_ok])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[__asm__("shadd8 r3,r3,r3")])],
+ [AC_MSG_RESULT([yes])
+ $1],
+ [AC_MSG_RESULT([no])
+ $2])
])
@@ -93,14 +59,9 @@ AC_DEFUN([AS_ASM_ARM_EDSP],
[
AC_MSG_CHECKING([if assembler supports EDSP instructions on ARM])
- AC_TRY_ASSEMBLE([qadd r3,r3,r3], [flag_ok=yes], [flag_ok=no])
-
- if test "X$flag_ok" = Xyes ; then
- $1
- true
- else
- $2
- true
- fi
- AC_MSG_RESULT([$flag_ok])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[__asm__("qadd r3,r3,r3")])],
+ [AC_MSG_RESULT([yes])
+ $1],
+ [AC_MSG_RESULT([no])
+ $2])
])