|
From: <sv...@va...> - 2006-03-12 17:12:23
|
Author: sewardj
Date: 2006-03-12 16:47:10 +0000 (Sun, 12 Mar 2006)
New Revision: 5757
Log:
Work around lameness in older ppc assemblers.
Modified:
trunk/configure.in
trunk/none/tests/ppc32/mftocrf.c
/usr/local/etc/subversion//commit-email.pl: `/usr/local/bin/svnlook diff =
/home/svn/repos/valgrind -r 5757' failed with this output:
Modified: trunk/configure.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/configure.in 2006-03-12 16:44:05 UTC (rev 5756)
+++ trunk/configure.in 2006-03-12 16:47:10 UTC (rev 5757)
@@ -545,6 +545,7 @@
CFLAGS=3D"$CFLAGS -Wdeclaration-after-statement"
fi
=20
+
# does this compiler support __builtin_expect?
AC_MSG_CHECKING([if gcc supports __builtin_expect])
=20
@@ -563,6 +564,25 @@
fi
=20
=20
+# 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=3Dyes
+AC_MSG_RESULT([yes])
+], [
+ac_have_as_ppc_mftocrf=3Dno
+AC_MSG_RESULT([no])
+])
+if test x$ac_have_as_ppc_mftocrf =3D xyes ; then
+ AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/m=
focrf.])
+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],
Modified: trunk/none/tests/ppc32/mftocrf.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/ppc32/mftocrf.c 2006-03-12 16:44:05 UTC (rev 5756)
+++ trunk/none/tests/ppc32/mftocrf.c 2006-03-12 16:47:10 UTC (rev 5757)
@@ -1,12 +1,13 @@
=20
#include <stdio.h>
+#include <config.h>
=20
static
int try_mtocrf ( int x )
{
int base =3D 0x31415927;
int res;
-
+#ifdef HAVE_AS_PPC_MFTOCRF
/* pre-set CR */
__asm__ __volatile__(
"mtcr %0"
@@ -21,7 +22,9 @@
__asm__ __volatile__(
"mfcr %0"
: /*w*/"=3Db"(res) : /*r*/ );
-
+#else
+ res =3D 42;
+#endif
return res;
}
=20
@@ -29,6 +32,7 @@
int try_mfocrf ( int x )=20
{
int res;
+#ifdef HAVE_AS_PPC_MFTOCRF
/* CR =3D x */
__asm__ __volatile__(
"mtcr %0"
@@ -39,7 +43,9 @@
"li %0,0\n\t"
"mfocrf %0,64"
: /*w*/"=3Db"(res) : /*r*/ );
-
+#else
+ res =3D 42;
+#endif
return res;
}
=20
svnlook: Can't open directory '/tmp/svnlook.2': No such file or directory
|