tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to handle "-march=native"?

> It seems there are multiple things going on:
>   1) there may be some bugs about cpu detection, particulaly in various
>   vm environments, or about the mapping of flags to instructions.
>   2) upstream code is trying to build a binary that is optimized for the
>   CPU it is built on, which is basically the wrong thing to do in the
>   general case
> You may be running into problem (1), which is just bugs to fix.  But
> problem 2 is (from the pkgsrc viewpoint) a bug in the upstream code.
> In my opinion, code should be produced that conforms to the system ABI,
> which means not using cpu-specific instructions.

Additionally you need OS support for some of the extensions as well as
cpu support for them.
If, for example, you try to run a binary that uses the x86 AVX instructions
it will fail because process switching doesn't save those registers.


David Laight:

Home | Main Index | Thread Index | Old Index