[arch-dev-public] Create guidelines regarding SIMD instructions/x86 extensions

Allan McRae allan at archlinux.org
Sat May 25 00:35:41 UTC 2019

On 25/5/19 10:17 am, Filipe Laíns via arch-dev-public wrote:
> Hello,
> Currently there are no guidelines stating which x86 extensions (ex.
> SSE2, SEE3, SSE4, AVX, etc.) we support. This is a bit problematic
> since it lets compilers do what they want and possible generate code
> that can't run on some systems.
> Even though this is an issue, it's not complete anarchy, at least yet!
> Just kidding :p. The vast majority of our native packages are compiled
> with GCC and we do default to `-mtune=generic` which is good but not
> optimal. `-mtune=generic` tells GCC to compile for a generic processor
> so it's up to GCC to decide which architecture extensions would compose
> a generic processor. I haven't been able to find any documentation on
> what x86 extensions are enabled for a "generic" processor but I was
> able to track them down to MMX, SSE (or KNI) and SSE2. Being
> undocumented they could change at any time so I don't think we should
> rely on `-mtune=generic`.

I think you need to look at the difference between -march and -mtune.
We use "-march=x86-64", which defines the instruction sets that can be
used.  Adding "-mtune=generic" does not allow the inclusion of
additional instruction sets.

Look at the output of:
gcc -march=x86-64 -Q --help=target


More information about the arch-dev-public mailing list