diff options
author | David Schleef <ds@schleef.org> | 2005-10-28 03:12:05 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2005-10-28 03:12:05 +0000 |
commit | 2082b8c46c63aa6bbf9f032e8e087b8c25b64e12 (patch) | |
tree | 4bd1f2fa2036771a07893d12531a9a4aec528757 | |
parent | cd41364d4678a0c9c07f9312783c738dc25d690c (diff) |
* autogen.sh: Refactor how we check for intrinsics and flags.
Remove hard-coded CFLAGS that don't work on Forte. This is
not complete, specifically, some of the makefiles aren't up
to the new order.
* configure.ac:
* liboil/Makefile.am:
* liboil/conv/Makefile.am:
* liboil/fb/Makefile.am:
* liboil/i386/Makefile.am:
* liboil/math/Makefile.am:
* liboil/motovec/Makefile.am:
* liboil/powerpc/Makefile.am:
* liboil/sse/Makefile.am:
* liboil/utf8/Makefile.am:
* m4/as-gcc-inline-assembly.m4:
* m4/as-intrinsics.m4:
* testsuite/instruction/Makefile.am:
-rw-r--r-- | ChangeLog | 20 | ||||
-rwxr-xr-x | autogen.sh | 1 | ||||
-rw-r--r-- | configure.ac | 113 | ||||
-rw-r--r-- | liboil/Makefile.am | 25 | ||||
-rw-r--r-- | liboil/conv/Makefile.am | 4 | ||||
-rw-r--r-- | liboil/fb/Makefile.am | 4 | ||||
-rw-r--r-- | liboil/i386/Makefile.am | 4 | ||||
-rw-r--r-- | liboil/math/Makefile.am | 20 | ||||
-rw-r--r-- | liboil/motovec/Makefile.am | 2 | ||||
-rw-r--r-- | liboil/powerpc/Makefile.am | 18 | ||||
-rw-r--r-- | liboil/sse/Makefile.am | 4 | ||||
-rw-r--r-- | liboil/utf8/Makefile.am | 23 | ||||
-rw-r--r-- | m4/as-gcc-inline-assembly.m4 | 29 | ||||
-rw-r--r-- | m4/as-intrinsics.m4 | 189 | ||||
-rw-r--r-- | testsuite/instruction/Makefile.am | 2 |
15 files changed, 334 insertions, 124 deletions
@@ -1,3 +1,23 @@ +2005-10-27 David Schleef <ds@schleef.org> + + * autogen.sh: Refactor how we check for intrinsics and flags. + Remove hard-coded CFLAGS that don't work on Forte. This is + not complete, specifically, some of the makefiles aren't up + to the new order. + * configure.ac: + * liboil/Makefile.am: + * liboil/conv/Makefile.am: + * liboil/fb/Makefile.am: + * liboil/i386/Makefile.am: + * liboil/math/Makefile.am: + * liboil/motovec/Makefile.am: + * liboil/powerpc/Makefile.am: + * liboil/sse/Makefile.am: + * liboil/utf8/Makefile.am: + * m4/as-gcc-inline-assembly.m4: + * m4/as-intrinsics.m4: + * testsuite/instruction/Makefile.am: + 2005-10-17 Eric Anholt <anholt@FreeBSD.org> * liboil/liboilcpu.c: (oil_cpu_i386_kernel_restrict_flags), @@ -2,3 +2,4 @@ autoreconf -i -f && ./configure --enable-maintainer-mode --disable-static $@ +#./configure --enable-maintainer-mode --disable-static --with-alternate-optimization="-O3 -funroll-all-loops" $@ diff --git a/configure.ac b/configure.ac index cf03902..1bd106c 100644 --- a/configure.ac +++ b/configure.ac @@ -46,11 +46,13 @@ if test "x$enable_proto_check" = xyes ; then AC_DEFINE(LIBOIL_STRICT_PROTOTYPES,1,[Defined if prototype checking enabled]) fi -AC_ARG_ENABLE(alternate-optimization, - AC_HELP_STRING([--enable-alternate-optimization],[compile with alternate optimization flags]), - enable_alt_opt=$enableval,enable_alt_opt=no) +AC_ARG_WITH(alternate-optimization, + AC_HELP_STRING([--with-alternate-optimization=CFLAGS],[compile with alternate optimization flags]), + [enable_alt_opt=yes; LIBOIL_OPT_CFLAGS=$withval],enable_alt_opt=no) +if test "x$enable_alt_opt" = xyes ; then + LIBOIL_OPT_CFLAGS="$LIBOIL_OPT_CFLAGS -D'OIL_OPT_MANGLE(a)=a\#\#_alt' -D'OIL_OPT_SUFFIX=\"_alt\"'" +fi AM_CONDITIONAL(USE_ALT_OPT, test "x$enable_alt_opt" = xyes) -LIBOIL_OPT_CFLAGS="-O3 -fomit-frame-pointer -funroll-all-loops -Wno-unused-function -D'OIL_OPT_MANGLE(a)=a\#\#_O3' -D'OIL_OPT_SUFFIX=\"_O3\"'" AC_SUBST(LIBOIL_OPT_CFLAGS) AC_ARG_ENABLE(broken-implementations, @@ -64,43 +66,42 @@ fi # Check for gtk-doc. ################################################## +if test "x$cross_compiling" = "xyes" ; then + enable_gtk_doc=no +fi GTK_DOC_CHECK([1.0]) -dnl Set up conditionals for (target) architecture: -dnl ============================================== +AS_GCC_INLINE_ASSEMBLY([HAVE_GCC_INLINE_ASSEMBLY=yes], + [HAVE_GCC_INLINE_ASSEMBLY=no]) +if test x$HAVE_GCC_INLINE_ASSEMBLY = xyes ; then + AC_DEFINE(HAVE_GCC_INLINE_ASSEMBLY, 1, + [Define if compiler supports gcc inline assembly for powerpc]) +fi +AM_CONDITIONAL(HAVE_GCC_INLINE_ASSEMBLY, + test "x$HAVE_GCC_INLINE_ASSEMBLY" = "xyes") dnl Determine CPU -case "x${target_cpu}" in - xi?86 | k?) HAVE_CPU_I386=yes - AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an x86]) ;; - xx86_64) HAVE_CPU_AMD64=yes - AC_DEFINE(HAVE_CPU_AMD64, 1, [Define if the target CPU is an amd64]) ;; - xpowerpc) HAVE_CPU_POWERPC=yes - AC_DEFINE(HAVE_CPU_POWERPC, 1, [Define if the target CPU is a powerpc]) ;; - xalpha) HAVE_CPU_ALPHA=yes - AC_DEFINE(HAVE_CPU_ALPHA, 1, [Define if the target CPU is an Alpha]) ;; - xarm*) HAVE_CPU_ARM=yes - AC_DEFINE(HAVE_CPU_ARM, 1, [Define if the target CPU is an ARM]) ;; - xsparc*) HAVE_CPU_SPARC=yes - AC_DEFINE(HAVE_CPU_SPARC, 1, [Define if the target CPU is a Sparc]) ;; - xmips*) HAVE_CPU_MIPS=yes - AC_DEFINE(HAVE_CPU_MIPS, 1, [Define if the target CPU is a MIPS]) ;; - xhppa*) HAVE_CPU_HPPA=yes - AC_DEFINE(HAVE_CPU_HPPA, 1, [Define if the target CPU is a HPPA]) ;; - xia64*) HAVE_CPU_IA64=yes - AC_DEFINE(HAVE_CPU_IA64, 1, [Define if the target CPU is a IA64]) ;; -esac - -AM_CONDITIONAL(HAVE_CPU_I386, test "x$HAVE_CPU_I386" = "xyes") -AM_CONDITIONAL(HAVE_CPU_AMD64, test "x$HAVE_CPU_AMD64" = "xyes") -AM_CONDITIONAL(HAVE_CPU_POWERPC, test "x$HAVE_CPU_POWERPC" = "xyes") -AM_CONDITIONAL(HAVE_CPU_ALPHA, test "x$HAVE_CPU_ALPHA" = "xyes") -AM_CONDITIONAL(HAVE_CPU_ARM, test "x$HAVE_CPU_ARM" = "xyes") -AM_CONDITIONAL(HAVE_CPU_SPARC, test "x$HAVE_CPU_SPARC" = "xyes") -AM_CONDITIONAL(HAVE_CPU_MIPS, test "x$HAVE_CPU_MIPS" = "xyes") -AM_CONDITIONAL(HAVE_CPU_HPPA, test "x$HAVE_CPU_HPPA" = "xyes") -AM_CONDITIONAL(HAVE_CPU_IA64, test "x$HAVE_CPU_IA64" = "xyes") +if test "x$HAVE_GCC_INLINE_ASSEMBLY" = xyes ; then + case "x${host_cpu}" in + xi?86 | k?) + HAVE_GCC_I386=yes + AC_DEFINE(HAVE_GCC_I386, 1, [Define if compiler supports gcc inline assembly for i386]) + ;; + xx86_64) + HAVE_GCC_AMD64=yes + AC_DEFINE(HAVE_GCC_AMD64, 1, [Define if compiler supports gcc inline assembly for amd64]) + ;; + xpowerpc) + HAVE_GCC_POWERPC=yes + AC_DEFINE(HAVE_GCC_POWERPC, 1, [Define if compiler supports gcc inline assembly for powerpc]) + ;; + esac +fi + +AM_CONDITIONAL(HAVE_GCC_I386, test "x$HAVE_GCC_I386" = "xyes") +AM_CONDITIONAL(HAVE_GCC_AMD64, test "x$HAVE_GCC_AMD64" = "xyes") +AM_CONDITIONAL(HAVE_GCC_POWERPC, test "x$HAVE_GCC_POWERPC" = "xyes") AC_C_BIGENDIAN @@ -110,7 +111,6 @@ if test x${ac_cv_sys_symbol_underscore} = xyes ; then fi - AC_FUNC_MMAP() AC_CHECK_LIB(m, rintf, AC_DEFINE(HAVE_RINTF, 1, [Define if rintf() is available])) @@ -118,6 +118,8 @@ AC_CHECK_LIB(m, lrint, AC_DEFINE(HAVE_LRINT, 1, [Define if lrint() is available])) AC_CHECK_LIB(m, lrintf, AC_DEFINE(HAVE_LRINTF, 1, [Define if lrintf() is available])) +AC_CHECK_LIB(m, sincos, + AC_DEFINE(HAVE_SINCOS, 1, [Define if sincos() is available])) AC_CHECK_HEADER(ieee754.h, AC_DEFINE(HAVE_IEEE754_H, 1, [Define if ieee754.h exists])) @@ -133,12 +135,9 @@ if test "x$LIBOIL_CVS" = "xyes" then AS_COMPILER_FLAG(-Werror, LIBOIL_CFLAGS="$LIBOIL_CFLAGS -Werror") fi -if test x$HAVE_CPU_POWERPC = xyes ; then - AS_COMPILER_FLAG(["-Wa,-mregnames"], - [LIBOIL_CFLAGS="$LIBOIL_CFLAGS -Wa,-mregnames"], - true) - AS_COMPILER_FLAG(["-Wa,-maltivec"], - [LIBOIL_CFLAGS="$LIBOIL_CFLAGS -Wa,-maltivec"], +if test x$HAVE_GCC_POWERPC = xyes ; then + AS_COMPILER_FLAG(["-mregnames"], + [LIBOIL_CFLAGS="$LIBOIL_CFLAGS -mregnames"], true) AS_COMPILER_FLAG(["-force_cpusubtype_ALL"], [LIBOIL_CFLAGS="$LIBOIL_CFLAGS -force_cpusubtype_ALL"], @@ -152,18 +151,29 @@ then fi AM_CONDITIONAL(HAVE_ASM_BLOCKS, test "x$HAVE_ASM_BLOCKS" = "xyes") -if test x$HAVE_CPU_I386 = xyes -o x$HAVE_CPU_AMD64 = xyes ; then - AS_COMPILER_FLAG(["-mmmx"], [MMX_CFLAGS="-mmmx"], true) - AS_COMPILER_FLAG(["-msse"], [SSE_CFLAGS="-msse"], true) - AS_COMPILER_FLAG(["-msse2"], [SSE2_CFLAGS="-msse2"], true) - AS_COMPILER_FLAG(["-msse3"], [SSE3_CFLAGS="-msse3"], true) - AS_COMPILER_FLAG(["-m3dnow"], [_3DNOW_CFLAGS="-m3dnow"], true) -fi +AS_MMX_INTRINSICS(MMX_CFLAGS, HAVE_MMX_INTRINSICS=yes, HAVE_MMX_INTRINSICS=no) +AS_SSE_INTRINSICS(SSE_CFLAGS, HAVE_SSE_INTRINSICS=yes, HAVE_SSE_INTRINSICS=no) +AS_SSE2_INTRINSICS(SSE2_CFLAGS, HAVE_SSE2_INTRINSICS=yes, HAVE_SSE2_INTRINSICS=no) +AS_SSE3_INTRINSICS(SSE3_CFLAGS, HAVE_SSE3_INTRINSICS=yes, HAVE_SSE3_INTRINSICS=no) +AS_3DNOW_INTRINSICS(_3DNOW_CFLAGS, HAVE_3DNOW_INTRINSICS=yes, HAVE_3DNOW_INTRINSICS=no) +AS_3DNOWEXT_INTRINSICS(_3DNOWEXT_CFLAGS, HAVE_3DNOWEXT_INTRINSICS=yes, HAVE_3DNOWEXT_INTRINSICS=no) +AS_ALTIVEC_INTRINSICS(ALTIVEC_CFLAGS, HAVE_ALTIVEC_INTRINSICS=yes, HAVE_ALTIVEC_INTRINSICS=no) + +AM_CONDITIONAL(HAVE_MMX_INTRINSICS, test "x$HAVE_MMX_INTRINSICS" = "xyes") +AM_CONDITIONAL(HAVE_SSE_INTRINSICS, test "x$HAVE_SSE_INTRINSICS" = "xyes") +AM_CONDITIONAL(HAVE_SSE2_INTRINSICS, test "x$HAVE_SSE2_INTRINSICS" = "xyes") +AM_CONDITIONAL(HAVE_SSE3_INTRINSICS, test "x$HAVE_SSE3_INTRINSICS" = "xyes") +AM_CONDITIONAL(HAVE_3DNOW_INTRINSICS, test "x$HAVE_3DNOW_INTRINSICS" = "xyes") +AM_CONDITIONAL(HAVE_3DNOWEXT_INTRINSICS, test "x$HAVE_3DNOWEXT_INTRINSICS" = "xyes") +AM_CONDITIONAL(HAVE_ALTIVEC_INTRINSICS, test "x$HAVE_ALTIVEC_INTRINSICS" = "xyes") + AC_SUBST(MMX_CFLAGS) AC_SUBST(SSE_CFLAGS) AC_SUBST(SSE2_CFLAGS) AC_SUBST(SSE3_CFLAGS) AC_SUBST(_3DNOW_CFLAGS) +AC_SUBST(_3DNOWEXT_CFLAGS) +AC_SUBST(ALTIVEC_CFLAGS) LIBOIL_CFLAGS="$LIBOIL_CFLAGS -D_BSD_SOURCE -D_GNU_SOURCE -I\$(top_srcdir) -O2" AC_SUBST(LIBOIL_CFLAGS) @@ -174,9 +184,6 @@ AC_SUBST(LIBOIL_LIBS) pkgconfigdir="\$(libdir)/pkgconfig" AC_SUBST(pkgconfigdir) -#CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9*]//g'` -#CFLAGS="-g" - AC_CONFIG_FILES([ Makefile doc/Makefile diff --git a/liboil/Makefile.am b/liboil/Makefile.am index 7e6bfec..53908af 100644 --- a/liboil/Makefile.am +++ b/liboil/Makefile.am @@ -1,7 +1,25 @@ pkgincludedir = $(includedir)/liboil-@LIBOIL_MAJORMINOR@/liboil -SUBDIRS = colorspace conv copy dct fb i386 jpeg math md5 motovec powerpc ref simdpack sse utf8 +if HAVE_GCC_I386 +subdir_i386 = i386 +libs_i386 = i386/libi386.la +else +subdir_i386 = +libs_i386 = +endif + +if HAVE_GCC_POWERPC +subdir_powerpc = powerpc motovec +libs_powerpc = powerpc/libpowerpc.la motovec/libmotovec.la +else +subdir_powerpc = +libs_powerpc = +endif + + +DIST_SUBDIRS = colorspace conv copy dct fb i386 jpeg math md5 motovec powerpc ref simdpack sse utf8 +SUBDIRS = colorspace conv copy dct fb $(subdir_i386) jpeg math md5 $(subdir_powerpc) ref simdpack sse utf8 lib_LTLIBRARIES = liboiltmp1.la liboil-@LIBOIL_MAJORMINOR@.la @@ -32,12 +50,11 @@ liboilfunctions_la_LIBADD = \ copy/libcopy.la \ dct/libdct.la \ fb/libfb.la \ - i386/libi386.la \ + $(i386_libs) \ jpeg/libjpeg.la \ math/libmath.la \ md5/libmd5.la \ - motovec/libmotovec.la \ - powerpc/libpowerpc.la \ + $(powerpc_libs) ref/libref.la \ simdpack/libsimdpack.la \ sse/libsse.la \ diff --git a/liboil/conv/Makefile.am b/liboil/conv/Makefile.am index 39d1a1d..cda9e01 100644 --- a/liboil/conv/Makefile.am +++ b/liboil/conv/Makefile.am @@ -11,13 +11,13 @@ c_sources = \ conv_bitstuff.c \ conv_misc.c -if HAVE_CPU_I386 +if HAVE_GCC_I386 i386_sources = conv_sse.c conv_3dnow.c else i386_sources = endif -if HAVE_CPU_AMD64 +if HAVE_GCC_AMD64 amd64_sources = conv_sse.c conv_3dnow.c else amd64_sources = diff --git a/liboil/fb/Makefile.am b/liboil/fb/Makefile.am index 309ad5d..e023635 100644 --- a/liboil/fb/Makefile.am +++ b/liboil/fb/Makefile.am @@ -8,11 +8,11 @@ opt_libs = endif noinst_LTLIBRARIES = libfb.la $(opt_libs) -if HAVE_CPU_I386 +if HAVE_GCC_I386 c_sources = \ fbmmx.c else -if HAVE_CPU_AMD64 +if HAVE_GCC_AMD64 c_sources = \ fbmmx.c else diff --git a/liboil/i386/Makefile.am b/liboil/i386/Makefile.am index 5a7af2c..4325610 100644 --- a/liboil/i386/Makefile.am +++ b/liboil/i386/Makefile.am @@ -24,13 +24,13 @@ sources = \ splat_i386.c \ trans8x8_i386.c -if HAVE_CPU_I386 +if HAVE_GCC_I386 i386_sources = $(sources) else i386_sources = empty.c endif -if HAVE_CPU_AMD64 +if HAVE_GCC_AMD64 amd64_sources = $(sources) else amd64_sources = empty.c diff --git a/liboil/math/Makefile.am b/liboil/math/Makefile.am index 9922c62..064178d 100644 --- a/liboil/math/Makefile.am +++ b/liboil/math/Makefile.am @@ -6,25 +6,7 @@ opt_libs = endif noinst_LTLIBRARIES = libmath.la $(opt_libs) -c_sources = \ - math.c - -if HAVE_CPU_POWERPC -powerpc_sources = -else -powerpc_sources = -endif - -if HAVE_CPU_I386 -i386_sources = -else -i386_sources = -endif - -libmath_la_SOURCES = \ - $(c_sources) \ - $(powerpc_sources) \ - $(i386_sources) +libmath_la_SOURCES = math.c libmath_la_LIBADD = $(opt_libs) libmath_la_CFLAGS = $(LIBOIL_CFLAGS) diff --git a/liboil/motovec/Makefile.am b/liboil/motovec/Makefile.am index 12bf0af..59665ff 100644 --- a/liboil/motovec/Makefile.am +++ b/liboil/motovec/Makefile.am @@ -3,7 +3,7 @@ noinst_LTLIBRARIES = libmotovec.la c_sources = -if HAVE_CPU_POWERPC +if HAVE_GCC_POWERPC powerpc_sources = \ motovec.c \ vec_memcpy.S \ diff --git a/liboil/powerpc/Makefile.am b/liboil/powerpc/Makefile.am index d50a884..c8663e3 100644 --- a/liboil/powerpc/Makefile.am +++ b/liboil/powerpc/Makefile.am @@ -1,14 +1,6 @@ noinst_LTLIBRARIES = libpowerpc.la -if HAVE_ASM_BLOCKS -asm_block_sources = \ - recon8x8_ppc.c \ - recon8x8_altivec.c -else -asm_block_sources = -endif - sources = \ abs.c \ clip.c \ @@ -27,15 +19,7 @@ sources = \ splat.c \ zigzag8x8.c -if HAVE_CPU_POWERPC libpowerpc_la_SOURCES = \ - $(asm_block_sources) $(sources) -libpowerpc_la_CFLAGS = $(LIBOIL_CFLAGS) -maltivec -mabi=altivec -fasm-blocks -else -libpowerpc_la_SOURCES = \ - empty.c -endif +libpowerpc_la_CFLAGS = $(LIBOIL_CFLAGS) -empty.c: - echo >empty.c diff --git a/liboil/sse/Makefile.am b/liboil/sse/Makefile.am index b706a27..1dffefd 100644 --- a/liboil/sse/Makefile.am +++ b/liboil/sse/Makefile.am @@ -8,11 +8,11 @@ opt_libs = endif noinst_LTLIBRARIES = libsse.la $(opt_libs) -if HAVE_CPU_I386 +if HAVE_GCC_I386 c_sources = \ conv_sse.c else -if HAVE_CPU_AMD64 +if HAVE_GCC_AMD64 c_sources = \ conv_sse.c else diff --git a/liboil/utf8/Makefile.am b/liboil/utf8/Makefile.am index eda880c..d6c7fa0 100644 --- a/liboil/utf8/Makefile.am +++ b/liboil/utf8/Makefile.am @@ -9,31 +9,12 @@ noinst_LTLIBRARIES = libutf8.la $(opt_libs) noinst_HEADERS = utf8.h -c_sources = utf8.c utf8_fast.c - -if HAVE_CPU_I386 -#i386_sources = utf8_i386.c -else -#i386_sources = -endif - -if HAVE_CPU_AMD64 -#amd64_sources = utf8_i386.c -else -#amd64_sources = -endif - -if HAVE_CPU_POWERPC -#powerpc_sources = utf8_powerpc.c -else -#powerpc_sources = -endif libutf8_la_SOURCES = \ - $(c_sources) $(i386_sources) $(powerpc_sources) $(amd64_sources) + utf8.c utf8_fast.c libutf8_la_LIBADD = $(opt_libs) libutf8_la_CFLAGS = $(LIBOIL_CFLAGS) -libutf8_opt_la_SOURCES = $(c_sources) +libutf8_opt_la_SOURCES = $(libutf8_la_SOURCES) libutf8_opt_la_CFLAGS = $(LIBOIL_CFLAGS) $(LIBOIL_OPT_CFLAGS) diff --git a/m4/as-gcc-inline-assembly.m4 b/m4/as-gcc-inline-assembly.m4 new file mode 100644 index 0000000..3c3cb84 --- /dev/null +++ b/m4/as-gcc-inline-assembly.m4 @@ -0,0 +1,29 @@ +dnl as-gcc-inline-assembly.m4 0.1.0 + +dnl autostars m4 macro for detection of gcc inline assembly + +dnl David Schleef <ds@schleef.org> + +dnl $Id: as-gcc-inline-assembly.m4,v 1.1 2005-10-28 03:12:05 ds Exp $ + +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, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_GCC_INLINE_ASSEMBLY], +[ + AC_MSG_CHECKING([if compiler supports gcc-style inline assembly]) + + AC_TRY_COMPILE([], [__asm__ (""::) ], [flag_ok=yes], [flag_ok=no]) + + if test "X$flag_ok" = Xyes ; then + $1 + true + else + $2 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + diff --git a/m4/as-intrinsics.m4 b/m4/as-intrinsics.m4 new file mode 100644 index 0000000..946e9da --- /dev/null +++ b/m4/as-intrinsics.m4 @@ -0,0 +1,189 @@ +dnl as-intrinsics.m4 0.1.0 + +dnl autostars m4 macro for detection of gcc inline assembly + +dnl David Schleef <ds@schleef.org> + +dnl $Id: as-intrinsics.m4,v 1.1 2005-10-28 03:12:05 ds Exp $ + +dnl AS_MMX_INTRINSICS(CFLAGS, 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, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_MMX_INTRINSICS], +[ + AC_MSG_CHECKING([if compiler supports MMX intrinsics]) + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -mmmx" + AC_TRY_COMPILE([#include <mmintrin.h>], [_mm_empty()], [flag_ok=yes], [flag_ok=no]) + CFLAGS="$save_CFLAGS" + + $1="-mmmx" + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + + +dnl AS_SSE_INTRINSICS(CFLAGS, 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, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_SSE_INTRINSICS], +[ + AC_MSG_CHECKING([if compiler supports SSE intrinsics]) + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -msse" + AC_TRY_COMPILE([#include <xmmintrin.h>], [__m128 a; a = _mm_or_ps(a,a)], [flag_ok=yes], [flag_ok=no]) + CFLAGS="$save_CFLAGS" + + $1="-msse" + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + + +dnl AS_SSE2_INTRINSICS(CFLAGS, 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, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_SSE2_INTRINSICS], +[ + AC_MSG_CHECKING([if compiler supports SSE2 intrinsics]) + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -msse2" + AC_TRY_COMPILE([#include <emmintrin.h>], [__m128 a; a = _mm_setzero_pd()], [flag_ok=yes], [flag_ok=no]) + CFLAGS="$save_CFLAGS" + + $1="-msse2" + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + + +dnl AS_SSE3_INTRINSICS(CFLAGS, 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, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_SSE3_INTRINSICS], +[ + AC_MSG_CHECKING([if compiler supports SSE3 intrinsics]) + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -msse3" + AC_TRY_COMPILE([#include <pmmintrin.h>], [__m128 a; a = _mm_addsub_ps(a,a)], [flag_ok=yes], [flag_ok=no]) + CFLAGS="$save_CFLAGS" + + $1="-msse3" + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + + +dnl AS_3DNOW_INTRINSICS(CFLAGS, 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, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_3DNOW_INTRINSICS], +[ + AC_MSG_CHECKING([if compiler supports 3DNOW intrinsics]) + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -m3dnow" + AC_TRY_COMPILE([#include <mm3dnow.h>], [_m_femms()], [flag_ok=yes], [flag_ok=no]) + CFLAGS="$save_CFLAGS" + + $1="-m3dnow" + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + + +dnl AS_3DNOWEXT_INTRINSICS(CFLAGS, 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, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_3DNOWEXT_INTRINSICS], +[ + AC_MSG_CHECKING([if compiler supports 3DNOWEXT intrinsics]) + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -m3dnow -march=athlon" + AC_TRY_COMPILE([#include <mm3dnow.h>], [__m64 a;a=_m_pf2iw(a)], [flag_ok=yes], [flag_ok=no]) + CFLAGS="$save_CFLAGS" + + $1="-m3dnow -march=athlon" + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + + +dnl AS_ALTIVEC_INTRINSICS(CFLAGS, 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, +dnl and ACTION-IF-NOT-ACCEPTED otherwise. + +AC_DEFUN([AS_ALTIVEC_INTRINSICS], +[ + AC_MSG_CHECKING([if compiler supports ALTIVEC intrinsics]) + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -maltivec" + AC_TRY_COMPILE([#include <altivec.h>], [__vector_float a; a = vec_or(a,a)], [flag_ok=yes], [flag_ok=no]) + CFLAGS="$save_CFLAGS" + + $1="-maltivec" + if test "X$flag_ok" = Xyes ; then + $2 + true + else + $3 + true + fi + AC_MSG_RESULT([$flag_ok]) +]) + diff --git a/testsuite/instruction/Makefile.am b/testsuite/instruction/Makefile.am index 47d2a84..fd7c30c 100644 --- a/testsuite/instruction/Makefile.am +++ b/testsuite/instruction/Makefile.am @@ -3,7 +3,7 @@ EXTRA_DIST = check-instructions.pl check_PROGRAMS = list-impls -if HAVE_CPU_I386 +if HAVE_GCC_I386 #check_DATA = report else #check_DATA = |