]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
__builtin_prefetch did probably not exist before gcc 3.1. 1139/head
authorfbrosson <fbrosson@users.noreply.github.com>
Fri, 18 May 2018 18:40:11 +0000 (18:40 +0000)
committerfbrosson <fbrosson@users.noreply.github.com>
Fri, 18 May 2018 18:40:11 +0000 (18:40 +0000)
lib/common/compiler.h

index b588e110403f4dd30d2dc080a0aaac36bca28a6c..366ed2b4b4fe00595a945bad50a2f88dae9e4682 100644 (file)
@@ -92,7 +92,7 @@
 #if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86))  /* _mm_prefetch() is not defined outside of x86/x64 */
 #  include <mmintrin.h>   /* https://msdn.microsoft.com/fr-fr/library/84szxsww(v=vs.90).aspx */
 #  define PREFETCH(ptr)   _mm_prefetch((const char*)ptr, _MM_HINT_T0)
-#elif defined(__GNUC__)
+#elif defined(__GNUC__) && ( (__GNUC__ >= 4) || ( (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1) ) )
 #  define PREFETCH(ptr)   __builtin_prefetch(ptr, 0, 0)
 #else
 #  define PREFETCH(ptr)   /* disabled */