List of CPU architecture-specific macros?

Liu Hao lh_mouse@126.com
Mon Feb 13 03:57:00 GMT 2017


On 2017/2/13 10:36, Jeffrey Walton wrote:
> I've never seen them change from GCC release to GCC release. Once they
> are added, they appear to be written in stone. Changing them would
> probably be a bad idea.
>
> The defines will change as you move from one processor to another.
> Xeon's seem to cause a lot of confusion. Folks will compile on one
> Xeon model, and then experience a SIGILL on another one. The
> difference between Xeon E5-2699v4 and Xeon E5-2699v3 is not very
> obvious until you realize its Broadwell (E5-2699v4) vs Haswell (
> E5-2699v3).
>
> There are a few odd ones, like -mrdrnd and __RDRND__ for the rdrand
> instruction. In contrast, rdseed uses all the vowels: -mrdseed and
> __RDSEED__.
Thanks so much. So basically I think it is viable to guess those macros 
from `gcc -dM -E </dev/null` then expect they never change. The command 
line options are documented well.

-- 
Best regards,
LH_Mouse



More information about the Gcc-help mailing list