summaryrefslogtreecommitdiff
path: root/src/sna/compiler.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-02-26 11:28:05 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-02-26 11:28:05 +0000
commitdc885d350ec53d08e0d4d529bb938bf2568d61ae (patch)
tree6eda9e3ebc8c79bb5e67646c296f2a63785756ca /src/sna/compiler.h
parent8cdebf3b72467f63a35888f38cd83658575fcf10 (diff)
sna: Conditionally compile avx routines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/compiler.h')
-rw-r--r--src/sna/compiler.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sna/compiler.h b/src/sna/compiler.h
index 3dd8a6d9..dfaaaacc 100644
--- a/src/sna/compiler.h
+++ b/src/sna/compiler.h
@@ -52,14 +52,16 @@
#define flatten
#endif
-#if defined(__GNUC__) && (__GNUC__ >= 4) /* 4.4 */
+#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 4)
#define sse2 __attribute__((target("sse2,fpmath=sse+387")))
#define sse4_2 __attribute__((target("sse4.2,sse2,fpmath=sse+387")))
-#define avx2 __attribute__((target("avx2,sse4.2,sse2,fpmath=sse+387")))
#else
#define sse2
#define sse4_2
-#define avx2
+#endif
+
+#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 7)
+#define avx2 __attribute__((target("avx2,sse4.2,sse2,fpmath=sse+387")))
#endif
#ifdef HAVE_VALGRIND