[Mesa-dev] [PATCH v1 1/5] meson: compilation flags for sse

Dylan Baker dylan at pnwbakers.com
Mon Oct 29 16:03:36 UTC 2018

Quoting Sergii Romantsov (2018-10-29 01:44:28)
> Hello,
>     What problem are we solving?
>     That we don't get fast paths in rounding.h by default on i686, I think?
> Yes, it adds optimization for rounding.h. On x86_64 msse is enabled by default
> (as example by gcc).
> And additionally helps to fix autotools 32b build (missed linkage with m-lib if
> no optimization).
>     This will make the code non-portable from an SSE capable system to a
>     non-sse
>     capable system. That's a pretty old system at this point (Pentium III and
>     Athlon
>     XP)
> As i found in gcc-docs (https://gcc.gnu.org/onlinedocs/gcc-4.5.3/gcc/
> i386-and-x86_002d64-Options.html) exactly mentioned systems are supports SSE.
> But in the patch i'm checking if -msse supported by compiler.
> If its incorrect than does it mean that compiler doesn't based on system
> capabilities? And does it mean that adding option -msse4.1 is also enabled in
> wrong way?

Right, the compiler can support instructions the "build" machine (computer
running the compiler) can't run. Even for builds of the same architecture.

No, the -msee4.1 case in src/mesa is different. We have a runtime check in
libmesa that detects sse4.1 features at run time and loads the sse4.1 optimized
functions if it can, or falls back to non-sse4.1 versions if it can't.

> I'm cloning gcc to check how it supports 'sse' and if it based on system
> capabilities. Also we may try to add some possibility to check cpu-capabilities
> (around cpuid).
> But if we don't need such optimization, than it will be nice at least to fix
> autotools 32b build (https://patchwork.freedesktop.org/patch/258659/) - i will
> update patch just by linking -lm with mesautil.

Yeah, I think we should land that if it fixes the build for 32bit x86.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181029/a2fbf18e/attachment-0001.sig>

More information about the mesa-dev mailing list