diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-02-26 11:28:05 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-02-26 11:28:05 +0000 |
commit | dc885d350ec53d08e0d4d529bb938bf2568d61ae (patch) | |
tree | 6eda9e3ebc8c79bb5e67646c296f2a63785756ca /src/sna/compiler.h | |
parent | 8cdebf3b72467f63a35888f38cd83658575fcf10 (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.h | 8 |
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 |