__BIGGEST_ALIGNMENT / more on arch compiler defines
Toebs Douglass
toby@winterflaw.net
Fri Jun 23 14:36:00 GMT 2017
Hej, all.
Just to say what was done in the end, since it might help future archive
readers.
I'm now using __i386__ to detect and only 32-bit. Beyond detecting
32-bit I don't think I can tell which processor I'm on, from the
compiler predefines.
What I then turn to however are the __GCC_HAVE_SYNC_COMPARE_AND_SWAP_N
predefines.
I use __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 as a proxy for being an i486 or
better (i386 lacks atomic operations).
Additionally, when __x86_64__ is defined, I then use
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 to let me know if 128-bit CAS is
available (as some very early Opterons do not have it, and I can deal
with its absence gracefully and for free, so why not).
More information about the Gcc-help
mailing list