[Intel-gfx] [PATCH i-g-t] tests: Fix compilation when some gcc configurations

Damien Lespiau damien.lespiau at intel.com
Fri Jul 15 11:07:42 UTC 2016


Depending how the gcc was compiled it may be necessary to enable SSE4
instructions explicitly. Otherwise:

  CC       gem_gtt_speed.o
In file included from gem_gtt_speed.c:54:0:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/smmintrin.h:31:3: error: #error "SSE4.1 instruction set not enabled"
 # error "SSE4.1 instruction set not enabled"
   ^

v2: Use a pragma directive (Chris)

Cc: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 tests/gem_exec_flush.c | 1 +
 tests/gem_gtt_speed.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/tests/gem_exec_flush.c b/tests/gem_exec_flush.c
index c81a977..b43d511 100644
--- a/tests/gem_exec_flush.c
+++ b/tests/gem_exec_flush.c
@@ -41,6 +41,7 @@ IGT_TEST_DESCRIPTION("Basic check of flushing after batches");
 #define MOVNT 512
 
 #if defined(__x86_64__)
+#pragma GCC target ("sse4.1")
 #include <smmintrin.h>
 __attribute__((noinline))
 __attribute__((target("sse4.1")))
diff --git a/tests/gem_gtt_speed.c b/tests/gem_gtt_speed.c
index 94b3de3..ed8cfda 100644
--- a/tests/gem_gtt_speed.c
+++ b/tests/gem_gtt_speed.c
@@ -51,6 +51,7 @@ static double elapsed(const struct timeval *start,
 }
 
 #if defined(__x86_64__)
+#pragma GCC target ("sse4.1")
 #include <smmintrin.h>
 __attribute__((noinline))
 __attribute__((target("sse4.1")))
-- 
2.5.0



More information about the Intel-gfx mailing list