From: Ivan Maidanski Date: Tue, 28 Feb 2017 20:41:03 +0000 (+0300) Subject: Define GC_PREFETCH_FOR_WRITE to __builtin_prefetch in gc_inline.h (GCC) X-Git-Tag: v8.0.0~902 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0141312b38db1934d6b65380a70a7c26180ff80a;p=platform%2Fupstream%2Flibgc.git Define GC_PREFETCH_FOR_WRITE to __builtin_prefetch in gc_inline.h (GCC) Also add GC_ prefix to NO_PREFETCH_FOR_WRITE. * include/gc_inline.h [!GC_PREFETCH_FOR_WRITE] (GC_PREFETCH_FOR_WRITE): Copy the definition from gcconfig.h. * include/private/gcconfig.h (NO_PREFETCH_FOR_WRITE): Rename to GC_NO_PREFETCH_FOR_WRITE. --- diff --git a/include/gc_inline.h b/include/gc_inline.h index a4fb4e3..71f9f90 100644 --- a/include/gc_inline.h +++ b/include/gc_inline.h @@ -43,7 +43,11 @@ #endif #ifndef GC_PREFETCH_FOR_WRITE -# define GC_PREFETCH_FOR_WRITE(x) (void)0 +# if defined(__GNUC__) && __GNUC__ >= 3 && !defined(GC_NO_PREFETCH_FOR_WRITE) +# define GC_PREFETCH_FOR_WRITE(x) __builtin_prefetch((x), 1) +# else +# define GC_PREFETCH_FOR_WRITE(x) (void)0 +# endif #endif /* Object kinds; must match PTRFREE, NORMAL in gc_priv.h. */ diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index af7ff3e..6016b47 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -1412,7 +1412,7 @@ # define GC_PREFETCH_FOR_WRITE(x) \ __asm__ __volatile__ ("prefetcht0 %0" : : "m"(*(char *)(x))) # else -# define NO_PREFETCH_FOR_WRITE +# define GC_NO_PREFETCH_FOR_WRITE # endif # elif defined(USE_3DNOW_PREFETCH) # define PREFETCH(x) \ @@ -2900,7 +2900,7 @@ #endif #ifndef GC_PREFETCH_FOR_WRITE -# if defined(__GNUC__) && __GNUC__ >= 3 && !defined(NO_PREFETCH_FOR_WRITE) +# if defined(__GNUC__) && __GNUC__ >= 3 && !defined(GC_NO_PREFETCH_FOR_WRITE) # define GC_PREFETCH_FOR_WRITE(x) __builtin_prefetch((x), 1) # else # define GC_PREFETCH_FOR_WRITE(x) (void)0