* [PATCH i-g-t] tests: Fix compilation when some gcc configurations
@ 2016-07-14 17:31 Damien Lespiau
2016-07-14 17:44 ` Chris Wilson
0 siblings, 1 reply; 6+ messages in thread
From: Damien Lespiau @ 2016-07-14 17:31 UTC (permalink / raw)
To: intel-gfx
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 Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH i-g-t] tests: Fix compilation when some gcc configurations
2016-07-14 17:31 [PATCH i-g-t] tests: Fix compilation when some gcc configurations Damien Lespiau
@ 2016-07-14 17:44 ` Chris Wilson
2016-07-14 17:48 ` Chris Wilson
0 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2016-07-14 17:44 UTC (permalink / raw)
To: Damien Lespiau; +Cc: intel-gfx
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH i-g-t] tests: Fix compilation when some gcc configurations
2016-07-14 17:44 ` Chris Wilson
@ 2016-07-14 17:48 ` Chris Wilson
2016-07-15 11:07 ` Damien Lespiau
2016-07-15 11:09 ` Damien Lespiau
0 siblings, 2 replies; 6+ messages in thread
From: Chris Wilson @ 2016-07-14 17:48 UTC (permalink / raw)
To: Damien Lespiau, intel-gfx
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH i-g-t] tests: Fix compilation when some gcc configurations
2016-07-14 17:48 ` Chris Wilson
@ 2016-07-15 11:07 ` Damien Lespiau
2016-07-15 11:35 ` Chris Wilson
2016-07-15 11:09 ` Damien Lespiau
1 sibling, 1 reply; 6+ messages in thread
From: Damien Lespiau @ 2016-07-15 11:07 UTC (permalink / raw)
To: intel-gfx
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@chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH i-g-t] tests: Fix compilation when some gcc configurations
2016-07-14 17:48 ` Chris Wilson
2016-07-15 11:07 ` Damien Lespiau
@ 2016-07-15 11:09 ` Damien Lespiau
1 sibling, 0 replies; 6+ messages in thread
From: Damien Lespiau @ 2016-07-15 11:09 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH i-g-t] tests: Fix compilation when some gcc configurations
2016-07-15 11:07 ` Damien Lespiau
@ 2016-07-15 11:35 ` Chris Wilson
0 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2016-07-15 11:35 UTC (permalink / raw)
To: Damien Lespiau; +Cc: intel-gfx
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 <chris@chris-wilson.co.uk>
> Signed-off-by: Damien Lespiau <damien.lespiau@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")
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-07-15 11:35 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-14 17:31 [PATCH i-g-t] tests: Fix compilation when some gcc configurations Damien Lespiau
2016-07-14 17:44 ` Chris Wilson
2016-07-14 17:48 ` Chris Wilson
2016-07-15 11:07 ` Damien Lespiau
2016-07-15 11:35 ` Chris Wilson
2016-07-15 11:09 ` Damien Lespiau
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.