1 dnl as-gcc-inline-assembly.m4 0.1.0
3 dnl autostars m4 macro for detection of gcc inline assembly
5 dnl David Schleef <ds@schleef.org>
7 dnl $Id: as-gcc-inline-assembly.m4,v 1.5 2007-11-14 06:48:57 ds Exp $
9 dnl AS_COMPILER_FLAG(ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
10 dnl Tries to compile with the given CFLAGS.
11 dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
12 dnl and ACTION-IF-NOT-ACCEPTED otherwise.
14 AC_DEFUN([AS_GCC_INLINE_ASSEMBLY],
16 AC_MSG_CHECKING([if compiler supports gcc-style inline assembly])
23 #if (__GNUC__ * 1000 + __GNUC_MINOR__) < 3004
24 #error GCC before 3.4 has critical bugs compiling inline assembly
27 __asm__ (""::) ], [flag_ok=yes], [flag_ok=no])
29 if test "X$flag_ok" = Xyes ; then
36 AC_MSG_RESULT([$flag_ok])
40 AC_DEFUN([AS_GCC_ASM_POWERPC_FPU],
42 AC_MSG_CHECKING([if compiler supports FPU instructions on PowerPC])
44 AC_TRY_COMPILE([], [double x = 0; __asm__ ("fadd 0,0,0"::"f" (x):"32") ], [flag_ok=yes], [flag_ok=no])
46 if test "X$flag_ok" = Xyes ; then
53 AC_MSG_RESULT([$flag_ok])
56 AC_DEFUN([AS_GCC_INLINE_ASM_INSTRUCTION],
58 AC_MSG_CHECKING([if compiler supports '$1' asm instruction])
65 #if (__GNUC__ * 1000 + __GNUC_MINOR__) < 3004
66 #error GCC before 3.4 has critical bugs compiling inline assembly
69 __asm__ ("$1"::) ], [flag_ok=yes], [flag_ok=no])
71 if test "X$flag_ok" = Xyes ; then
78 AC_MSG_RESULT([$flag_ok])