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

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
It looks like trunk now defines __SIZEOF_FLOAT128__ on powerpc-ibm-aix* and
powerpc64*-*-linux-gnu, but it seems to be defined unconditionally, even if the
__float128 type *isn't* available!


On power8-aix (e.g. gcc119 in the cfarm):

./gcc/cc1plus -E -dM /dev/null -quiet -maix64  | fgrep FLOAT128#define
__SIZEOF_FLOAT128__ 16
./gcc/cc1plus - -quiet   <<<  '__float128 f;'
<stdin>:1:1: error: '__float128' does not name a type; did you mean '__int128'?

You need to add -mfloat128 -mvsx to be able to use the type.

On power8 ppc64le linux (e.g. gcc112 in the cfarm):

./gcc/cc1plus -E -dM /dev/null -quiet   | fgrep FLOAT128
#define __FLOAT128__ 1
#define __SIZEOF_FLOAT128__ 16
#define __FLOAT128_TYPE__ 1

That's fine, the type is usable.

But for power7 ppc64 (BE) linux (e.g. gcc110 in the cfarm):

./gcc/cc1plus -E -dM /dev/null -quiet   | fgrep FLOAT128
#define __SIZEOF_FLOAT128__ 16



That means __SIZEOF_FLOAT128__ still can't be used to detect whether a type
called "__float128" is supported for the current target.

On power it looks like we can use __FLOAT128__ for that purpose, but other
targets such as x86 don't define that one, only __SIZEOF_FLOAT128__. So you
have to use a different macro to detect __float128 depending on the target.

Reply via email to