[Mesa-dev] [PATCH] mesa: Fix build to properly check for supported compiler flags

Chad Versace chad.versace at linux.intel.com
Fri Dec 20 15:32:31 PST 2013


On 12/19/2013 01:50 AM, Lauri Kasanen wrote:
> On Wed, 18 Dec 2013 17:57:16 -0800
> Matt Turner <mattst88 at gmail.com> wrote:
>
>> On Tue, Dec 17, 2013 at 7:15 AM, Lauri Kasanen <cand at gmx.com>

>>> It seems to me that the Intel code that uses this SSE4.1 function
>>> is still buggy, as it has no runtime check - would it not crash
>>> if built on a SSE4-capable system but used with a lower-class cpu?
>>
>> You haven't thought this through. :)
>>
>> The SSE 4.1 code is in i965 #ifdef __SSE4_1__. __SSE4_1__ is defined
>> if the code is compiled with the appropriate CFLAGS, e.g., -msse4.1 or
>> -march=native and your CPU support SSE 4.1.
>>
>> That is, your Mesa would have to be compiled with flags incompatible
>> with your CPU for this to break, and in that case gcc would already
>> have used instructions your CPU doesn't have.
>
> Yes, you're right that there is no crash risk on a normal build.
> However, it is practically useless for distro builds like that, as they
> can't ship a normal build and get the speedup at the same time.

I want to clarify how this is currently useful. Product-specific builds,
such as Chrome OS builds, do benefit from this SSE code, because they
are compiled with the appropriate CFLAGS.

Your point still stands though for regular distros.



More information about the mesa-dev mailing list