[Mesa-stable] [PATCH] swr: fix -march flag for AVX

Rowley, Timothy O timothy.o.rowley at intel.com
Fri Jun 10 20:37:26 UTC 2016


> On Jun 10, 2016, at 3:01 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> 
> On 10 June 2016 at 20:43, Tim Rowley <timothy.o.rowley at intel.com> wrote:
>> Previously used core-avx-i was for ivybridge;
>> corei7-avx allows sandybridge.
> Which GCC version was required by the previous and which by the
> current version ?

Both options work back to gcc 4.8.x.  I picked the wrong architecture flag when setting up the build system initially.

>> ---
>> src/gallium/drivers/swr/Makefile.am | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/src/gallium/drivers/swr/Makefile.am b/src/gallium/drivers/swr/Makefile.am
>> index d211f2e..8156cf2 100644
>> --- a/src/gallium/drivers/swr/Makefile.am
>> +++ b/src/gallium/drivers/swr/Makefile.am
>> @@ -124,7 +124,7 @@ COMMON_LDFLAGS = \
>> lib_LTLIBRARIES = libswrAVX.la libswrAVX2.la
>> 
>> libswrAVX_la_CXXFLAGS = \
>> -       -march=core-avx-i \
>> +       -march=corei7-avx \
> I'm likely missing something but neither one seems listed in the 5.4
> [1] and 6.1 [2] manual. Should we be using one that's officially
> supported ?

According to Chuck Atkins, while the older options aren’t documented anymore, they still work on gcc 5.x and 6.x.

Another possibility which Ilia also mentioned was to use feature flags instead which have stayed consistent between gcc versions, i.e. “-mavx” and “-mavx2 -mfma -mf16c” respectively for the avx and avx2 configurations.  Not too opposed to this except that we’ve had extensive testing with the -march flags and changing the build configuration during the release candidate stage seems a bit late.

-Tim

> That aside, we might want to ensure that these are in sync with the
> configure ones. One way it to set a variable, AC_SUBST it in configure
> and use it in the makefile. Grep for SSE41 for example how we handle
> it.
> 
> Thanks
> Emil
> 
> [1] https://gcc.gnu.org/onlinedocs/gcc-5.4.0/gcc/x86-Options.html#x86-Options
> [2] https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/x86-Options.html#x86-Options
> _______________________________________________
> mesa-stable mailing list
> mesa-stable at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-stable



More information about the mesa-stable mailing list