[Mesa-dev] [PATCH 1/4] meson: Enable SSE4.1 optimizations

Emil Velikov emil.l.velikov at gmail.com
Fri Nov 17 11:11:50 UTC 2017


On 16 November 2017 at 22:21, Dylan Baker <dylan at pnwbakers.com> wrote:
> Quoting Emil Velikov (2017-11-16 03:35:17)
>> Hi Dylan,
>>
>> On 16 November 2017 at 01:10, Dylan Baker <dylan at pnwbakers.com> wrote:
>> > This patch checks for an and then enables sse4.1 optimizations if the
>> > host machine will be x86/x86_64.
>> >
>> Hell yeah, SSE is coming to town :-)
>>
>> Will this work if the user disables SSE4.1, say via CFLAGS=-mno-sse4.1
>> meson ...?
>> My meson is still bit rough, so I could not quite grok ^^ by reading
>> through the patch.
>>
>> Thanks
>> Emil
>
> It'll explode horribly. Id didn't see any special handling of that in autotools
> build though either, did I miss something?
>
In autotools it's handled before the normal ld invocation.

Namely: configure.ac does:
 - construct a program using sse4.1 intrinsicts
Note: return _mm_...() is required otherwise the whole program will be
optimised away
 - the -msse is passed first and then the user flags (-mno-sse and/or
anything else)
 - the user -mno-sse takes precedence, hence the test program fails to build
 - set see_supported=false and don't build the SSE optimised static library

HTH
Emil


More information about the mesa-dev mailing list