summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-07-15 10:46:45 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-07-15 10:48:45 +0100
commit90be05d74b0b5db64442848af530a88ffb4569ae (patch)
tree21dc22ca70c95d9b72d087c56dd89556c450d6c8 /tests
parentc8ab577cbdeb5480f000f55ed2decae7b7932197 (diff)
Convert function target attributes to pragma
We need to not only cover the function in the target=sse4.1 but the include as well. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/gem_exec_flush.c16
-rw-r--r--tests/gem_gtt_speed.c4
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/gem_exec_flush.c b/tests/gem_exec_flush.c
index c81a9773..cad99aaa 100644
--- a/tests/gem_exec_flush.c
+++ b/tests/gem_exec_flush.c
@@ -41,9 +41,10 @@ IGT_TEST_DESCRIPTION("Basic check of flushing after batches");
#define MOVNT 512
#if defined(__x86_64__)
+#pragma GCC push_options
+#pragma GCC target("sse4.1")
#include <smmintrin.h>
__attribute__((noinline))
-__attribute__((target("sse4.1")))
static uint32_t movnt(uint32_t *map, int i)
{
__m128i tmp;
@@ -51,20 +52,17 @@ static uint32_t movnt(uint32_t *map, int i)
tmp = _mm_stream_load_si128((__m128i *)map + i/4);
switch (i%4) { /* gcc! */
default:
- case 0:
- return _mm_extract_epi32(tmp, 0);
- case 1:
- return _mm_extract_epi32(tmp, 1);
- case 2:
- return _mm_extract_epi32(tmp, 2);
- case 3:
- return _mm_extract_epi32(tmp, 3);
+ case 0: return _mm_extract_epi32(tmp, 0);
+ case 1: return _mm_extract_epi32(tmp, 1);
+ case 2: return _mm_extract_epi32(tmp, 2);
+ case 3: return _mm_extract_epi32(tmp, 3);
}
}
static inline unsigned x86_64_features(void)
{
return igt_x86_features();
}
+#pragma GCC pop_options
#else
static inline unsigned x86_64_features(void)
{
diff --git a/tests/gem_gtt_speed.c b/tests/gem_gtt_speed.c
index 94b3de30..baeb8f69 100644
--- a/tests/gem_gtt_speed.c
+++ b/tests/gem_gtt_speed.c
@@ -51,9 +51,10 @@ static double elapsed(const struct timeval *start,
}
#if defined(__x86_64__)
+#pragma GCC push_options
+#pragma GCC target("sse4.1")
#include <smmintrin.h>
__attribute__((noinline))
-__attribute__((target("sse4.1")))
static void streaming_load(void *src, int len)
{
__m128i tmp, *s = src;
@@ -73,6 +74,7 @@ static inline unsigned x86_64_features(void)
{
return igt_x86_features();
}
+#pragma GCC pop_options
#else
static inline unsigned x86_64_features(void)
{