https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116854

--- Comment #5 from Thiago Macieira <thiago at kde dot org> ---
(In reply to Andrew Pinski from comment #4)
> > Since the BIOS and/or OS can disable it,
> 
> From the way I understand it, even things like avx can be turned on/off too.
> Does that mean gcc should disable avx by default for most targets, NO.
> 
> Again the issue is qt is trying to reinterpret -march=native which is
> incorrect thing to always.

Qt is interpreting __RDRND__ being defined the same way as __AVX__: if it is
defined, then we're free to use the instructions without a CPU check. For AVX
or BMI or CET or most of the others, GCC will itself generate code with those
instructions without performing a runtime check. There are a couple of ISA
extensions that, even if you can assume the processor always supports it, you
have to ask the OS for permission (notably, AMX and FSGSBASE).

This has nothing to do with -march=native. In fact, for the Gentoo people who
are using -march=native, everything is fine because __RDRND__ is *not* defined
(I think; I don't have such a CPU to check, but on my TGL, -march=native and
-march=tigerlake differ).

The argument was that -march=bdver4 should not imply -mrdrnd, the same way that
we had to fix -march=westmere to -march=haswell not to imply -maes: not all
SKUs have this feature. That's what I had asked the reporters to file with GCC.

Reply via email to