diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-02-26 00:02:16 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-02-26 00:03:28 +0000 |
commit | 94b95cc2fc63457903a7b7b6eaa09bc27f25750c (patch) | |
tree | a8bdd1dbb1cb5f1381df4658c4c599fee2a0c5d3 /src/sna/compiler.h | |
parent | f095678125b25aeae80d838729a7f89d09007e10 (diff) |
sna/gen4+: Begin specialising vertex programs for ISA
Allow use of advanced ISA when available by detecting support at
runtime. This initial work just uses GCC to emit varying ISA, future
work could use hand written code for these hot spots.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/compiler.h')
-rw-r--r-- | src/sna/compiler.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sna/compiler.h b/src/sna/compiler.h index 23ec31c3..fe2e3214 100644 --- a/src/sna/compiler.h +++ b/src/sna/compiler.h @@ -52,6 +52,16 @@ #define flatten #endif +#if defined(__GNUC__) && (__GNUC__ >= 4) /* 4.4 */ +#define sse2 __attribute__((target("sse2"))) +#define sse4_2 __attribute__((target("sse4.2,sse2"))) +#define avx2 __attribute__((target("avx2,sse4.2,sse2"))) +#else +#define sse2 +#define sse4_2 +#define avx2 +#endif + #ifdef HAVE_VALGRIND #define VG(x) x #else |