Open tgross35 opened 1 week ago
@llvm/issue-subscribers-clang-frontend
Author: Trevor Gross (tgross35)
Note this is not exactly a GNU extension but for compatibility with GCC (via C23 defined extended floating point types).
Yes thanks, I updated the top post to give more context. It seems like GCC does not restrict these types to only --std=c23
.
Newer versions of C allow the following relevant interchange types:
_Float16
: 16-bit IEEE floating point numbers_Float32
: 32-bit IEEE floating point numbers_Float64
: 64-bit IEEE floating point numbers_Float64x
: Extended 64-bit IEEE floating point numbers (e.g. x86 f80long double
)_Float128
: 128-bit IEEE floating point numbers_FloatN _Complex
F16
/f16
F32
/f32
F64
/f64
F64x
/f64x
F128
/f128
GCC currently supports all of these. Clang currently supports only
_Float16
, but should add the rest.Link to the draft: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2601.pdf Link to demo: https://clang.godbolt.org/z/5xbq9919z
C++ also supports the same suffixes for the
std
types, https://en.cppreference.com/w/cpp/types/floating-pointIt sounds like these can't simply be redefines of
float
anddouble
, see https://github.com/llvm/llvm-project/issues/50110 (cc @AaronBallman)