[Mesa-dev] [Bug 83669] fix build with gcc link time optimizer

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Apr 16 10:04:19 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=83669

Steven Newbury <s_j_newbury at yahoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |s_j_newbury at yahoo.co.uk

--- Comment #12 from Steven Newbury <s_j_newbury at yahoo.co.uk> ---
(In reply to Marc Dietrich from comment #11)
> sorry for spamming this bug, here is a better patch to fix the problem
> 
> diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am
> index e71bccb..bbdb36f 100644
> --- a/src/mesa/Makefile.am
> +++ b/src/mesa/Makefile.am
> @@ -152,7 +152,6 @@ libmesagallium_la_LIBADD = \
>  
>  libmesa_sse41_la_SOURCES = \
>         main/streaming-load-memcpy.c
> -libmesa_sse41_la_CFLAGS = $(AM_CFLAGS) -msse4.1
>  
>  pkgconfigdir = $(libdir)/pkgconfig
>  pkgconfig_DATA = gl.pc
> diff --git a/src/mesa/main/streaming-load-memcpy.c
> b/src/mesa/main/streaming-load-memcpy.c
> index 8427149..94b0e0a 100644
> --- a/src/mesa/main/streaming-load-memcpy.c
> +++ b/src/mesa/main/streaming-load-memcpy.c
> @@ -26,7 +26,7 @@
>   *
>   */
>  
> -#ifdef __SSE4_1__
> +#ifdef USE_SSE41
>  #include "main/macros.h"
>  #include "main/streaming-load-memcpy.h"
>  #include <smmintrin.h>
> @@ -34,7 +34,7 @@
>  /* Copies memory from src to dst, using SSE 4.1's MOVNTDQA to get streaming
>   * read performance from uncached memory.
>   */
> -void
> +void __attribute__ ((target("sse4.1")))
>  _mesa_streaming_load_memcpy(void *restrict dst, void *restrict src, size_t
> len)
>  {
>     char *restrict d = dst;

Maybe you have, but can you ensure USE_SSE41 is only defined when __SSE4_1__ is
also defined.  There's a common misconception that all ISA extensions are
always available with recent gcc releases, but this is only the case with the
popular binary distribution generic compiler packages.  If gcc is built for a
specific CPU target it does not support code generation for other CPUs even if
the assembler does.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160416/bd55585a/attachment.html>


More information about the mesa-dev mailing list