gcconfig.h (PREFETCH): Use __builtin_prefetch for gcc >= 3.0.
authorH.J. Lu <hongjiu.lu@intel.com>
Tue, 6 Apr 2004 18:05:05 +0000 (18:05 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Tue, 6 Apr 2004 18:05:05 +0000 (11:05 -0700)
2004-04-06  H.J. Lu  <hongjiu.lu@intel.com>

* include/private/gcconfig.h (PREFETCH): Use __builtin_prefetch
for gcc >= 3.0.
(PREFETCH_FOR_WRITE): Likewise.

From-SVN: r80459

boehm-gc/ChangeLog
boehm-gc/include/private/gcconfig.h

index a8409143c1e1d16070f538cd70de55e3d324bfeb..182fef1cab35022f291a42b3ac7140322654cd4f 100644 (file)
@@ -1,3 +1,9 @@
+2004-04-06  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * include/private/gcconfig.h (PREFETCH): Use __builtin_prefetch
+       for gcc >= 3.0.
+       (PREFETCH_FOR_WRITE): Likewise.
+
 2004-03-10  Kelley Cook  <kcook@gcc.gnu.org>
 
        * configure.ac: Bump AC_PREREQ to 2.59.
index a13ad2ef835fb3bc334f17418b21825a2ee9b3e2..32b6e482cfe95bac6b9912919c6729dfaccaca1f 100644 (file)
             extern int etext[];
 #            define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
 #       endif
-#      define PREFETCH(x) \
-         __asm__ __volatile__ ("       prefetch        %0": : "m"(*(char *)(x)))
-#      define PREFETCH_FOR_WRITE(x) \
-         __asm__ __volatile__ ("       prefetchw       %0": : "m"(*(char *)(x)))
+#      if defined(__GNUC__) && __GNUC__ >= 3
+#          define PREFETCH(x) __builtin_prefetch ((x), 0, 0)
+#          define PREFETCH_FOR_WRITE(x) __builtin_prefetch ((x), 1)
+#      endif
 #   endif
 # endif