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

--- Comment #36 from David C. Partridge <david.partridge at perdrix dot co.uk> 
---
> you shouldn't be doing that

One needs to do that to create code that will run as one executable that
supports both AVX and non-AVX processors.  The AVX code needs to be compiled
with one set of options, the rest of the code without the options that enable
AVX.

If you do anything else you WILL get a SIGILL somewhere along the way when the
compiler decides it would be a good idea to generate code that exploits the AVX
instructions.

By doing what I describe above you can partition the code so the functions in
the AVX supporting code are only ever called if (the right flavour of) AVX is
actually supported on the processer.   The remaining code that's built without
AVX options specified can run on ANY processor, but the AVX code very much not.

Reply via email to