I'm not really sure how I can find out of a system does or doesn't support the __float128
type. What system requirements have to be met for this to be available, and is there a way to check if those requirements are met in C code? (For reference, my system supports __int128
but not __float128
.)
Suppose you are asking about GCC, clause 6.12 of the documentation for GCC 10.2 says:
…
__float128
is available on i386, x86_64, IA-64, and hppa HP-UX, as well as on PowerPC GNU/Linux targets that enable the vector scalar (VSX) instruction set.__float128
supports the 128-bit floating type. On i386, x86_64, PowerPC, and IA-64 other than HP-UX,__float128
is an alias for_Float128
. On hppa and IA-64 HP-UX,__float128
is an alias forlong double
…
and:
… In order to use
_Float128
,__float128
, and__ibm128
on PowerPC Linux systems, you must use the-mfloat128
option. It is expected in future versions of GCC that_Float128
and__float128
will be enabled automatically…
I do not see an in-source test for the type, such as a preprocessor macro that would indicate it.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.