Re: [Intel-gfx] [PATCH i-g-t] tests: Fix compilation when some gcc configurations
On Fri, Jul 15, 2016 at 12:07:42PM +0100, Damien Lespiau wrote: > 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> Signed-off-by: Damien Lespiau > --- > 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") I jumped ahead and did #pragma GCC push_options #pragma GCC target ("sse4.1") .. #pragma GCC pop_options Compiling with gcc 4.2 or even older will be fixed whenever... -Chris -- Chris Wilson, Intel Open Source Technology Centre ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t] tests: Fix compilation when some gcc configurations
On Thu, Jul 14, 2016 at 06:48:26PM +0100, Chris Wilson wrote: > On Thu, Jul 14, 2016 at 06:44:59PM +0100, Chris Wilson wrote: > > On Thu, Jul 14, 2016 at 06:31:37PM +0100, Damien Lespiau wrote: > > > 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" > > > > So the challenge is getting the function attribute applied to the > > include. > > > > Ah, can you try > > #pragma GCC target ("sse4.1") > > in those blocks instead? Yup, that also seems to enable sse4.1 for the rest of the compilation unit. > Oh, and we probably need an #if GCC > 4.y to be fully backwards > compatible. Couldn't find in less than 5 mins this information, gave up. Someone exhibiting the problem will have to fix it :) -- Damien ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t] tests: Fix compilation when some gcc configurations
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 WilsonSigned-off-by: Damien Lespiau --- 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 __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 __attribute__((noinline)) __attribute__((target("sse4.1"))) -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t] tests: Fix compilation when some gcc configurations
On Thu, Jul 14, 2016 at 06:44:59PM +0100, Chris Wilson wrote: > On Thu, Jul 14, 2016 at 06:31:37PM +0100, Damien Lespiau wrote: > > 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" > > So the challenge is getting the function attribute applied to the > include. > > Ah, can you try > #pragma GCC target ("sse4.1") > in those blocks instead? Oh, and we probably need an #if GCC > 4.y to be fully backwards compatible. -Chris -- Chris Wilson, Intel Open Source Technology Centre ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH i-g-t] tests: Fix compilation when some gcc configurations
On Thu, Jul 14, 2016 at 06:31:37PM +0100, Damien Lespiau wrote: > 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" So the challenge is getting the function attribute applied to the include. Ah, can you try #pragma GCC target ("sse4.1") in those blocks instead? > @@ -76,6 +76,7 @@ gem_ctx_basic_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) > gem_ctx_basic_LDADD = $(LDADD) -lpthread > gem_ctx_thrash_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) > gem_ctx_thrash_LDADD = $(LDADD) -lpthread > +gem_exec_flush_CFLAGS = $(AM_CFLAGS) -msse4 Note, it should be -msse4.1 -Chris -- Chris Wilson, Intel Open Source Technology Centre ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH i-g-t] tests: Fix compilation when some gcc configurations
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" ^ gem_gtt_speed.c: In function ‘streaming_load’: gem_gtt_speed.c:59:2: error: unknown type name ‘__m128i’ __m128i tmp, *s = src; ^ gem_gtt_speed.c:65:3: error: implicit declaration of function ‘_mm_stream_load_si128’ [-Werror=implicit-function-declaration] tmp += _mm_stream_load_si128(s++); ^ gem_gtt_speed.c:65:3: warning: nested extern declaration of ‘_mm_stream_load_si128’ [-Wnested-externs] gem_gtt_speed.c:70:2: error: unknown type name ‘__m128i’ *(volatile __m128i *)src = tmp; ^ CC: Chris WilsonSigned-off-by: Damien Lespiau --- tests/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Makefile.am b/tests/Makefile.am index 102b8a6..8c6b0a3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -76,6 +76,7 @@ gem_ctx_basic_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) gem_ctx_basic_LDADD = $(LDADD) -lpthread gem_ctx_thrash_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) gem_ctx_thrash_LDADD = $(LDADD) -lpthread +gem_exec_flush_CFLAGS = $(AM_CFLAGS) -msse4 gem_exec_parallel_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) gem_exec_parallel_LDADD = $(LDADD) -lpthread gem_fence_thrash_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) @@ -84,6 +85,7 @@ gem_fence_upload_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) gem_fence_upload_LDADD = $(LDADD) -lpthread gem_flink_race_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) gem_flink_race_LDADD = $(LDADD) -lpthread +gem_gtt_speed_CFLAGS = $(AM_CFLAGS) -msse4 gem_mmap_gtt_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) gem_mmap_gtt_LDADD = $(LDADD) -lpthread gem_mmap_wc_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS) -- 2.5.0 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx