-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add support for C23 interchange float types (_Float32
, _Float64
, _Float128
, ...)
#97335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
_Float32
and _Float64
in C_Float32
, _Float64
, and _Float128
in C
@llvm/issue-subscribers-clang-frontend Author: Trevor Gross (tgross35)
GCC supports `_Float32` and `_Float64` in both C and C++, with the associated `F32`, `F64`, and `F128` literal suffixes. Clang should add support for these to be compatible.
It sounds like these can't simply be redefines of |
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 |
_Float32
, _Float64
, and _Float128
in C_Float32
, _Float64
, and _Float128
)
_Float32
, _Float64
, and _Float128
)_Float32
, _Float64
, _Float128
, ...)
_Float32
, _Float64
, _Float128
, ...)_Float32
, _Float64
, _Float128
, ...)
tgmath3-macro-tests won't compile with <float.h> and <tgmath.h> from Clang due to missing C23 support: llvm/llvm-project#97335 Disable them for now when Clang is used for testing so that "make check" can finish. Signed-off-by: H.J. Lu <[email protected]>
Please note that glibc headers define |
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 #50110 (cc @AaronBallman)The text was updated successfully, but these errors were encountered: