CFLAGS="$CFLAGS -Wdeclaration-after-statement"
fi
+
# does this compiler support __builtin_expect?
AC_MSG_CHECKING([if gcc supports __builtin_expect])
fi
+# does the ppc assembler support "mtocrf" et al?
+AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf])
+
+AC_TRY_COMPILE(, [
+__asm__ __volatile__("mtocrf 0,0");
+__asm__ __volatile__("mfocrf 0,0");
+],
+[
+ac_have_as_ppc_mftocrf=yes
+AC_MSG_RESULT([yes])
+], [
+ac_have_as_ppc_mftocrf=no
+AC_MSG_RESULT([no])
+])
+if test x$ac_have_as_ppc_mftocrf = xyes ; then
+ AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.])
+fi
+
+
# Check for TLS support in the compiler and linker
AC_CACHE_CHECK([for TLS support], vg_cv_tls,
[AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS],
#include <stdio.h>
+#include <config.h>
static
int try_mtocrf ( int x )
{
int base = 0x31415927;
int res;
-
+#ifdef HAVE_AS_PPC_MFTOCRF
/* pre-set CR */
__asm__ __volatile__(
"mtcr %0"
__asm__ __volatile__(
"mfcr %0"
: /*w*/"=b"(res) : /*r*/ );
-
+#else
+ res = 42;
+#endif
return res;
}
int try_mfocrf ( int x )
{
int res;
+#ifdef HAVE_AS_PPC_MFTOCRF
/* CR = x */
__asm__ __volatile__(
"mtcr %0"
"li %0,0\n\t"
"mfocrf %0,64"
: /*w*/"=b"(res) : /*r*/ );
-
+#else
+ res = 42;
+#endif
return res;
}