https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106652
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org, | |ppalka at gcc dot gnu.org, | |redi at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- On targets that do have __float128, I believe we want to mangle it as before and also handle usual arithmetic conversions etc. the same we did before unless the C++23 extended floating-point types are involved. Which is why I've introduced the float128t_type_node hack, where non-C++ can continue to do what it did before but for C++ __float128 will be a new distinct type. For mangling of std::float{16,32,64,128}_t I'm using the Itanium ABI _Float{16,32,64,128} mangling, i.e. DF{16,32,64,128}_ This collides with the apparently never really used mangling of FIXED_POINT_TYPEs (fixed points are really only supported in C on a few platforms, not in C++, and at some point they leaked into the C++ FE through 0r and similar literals, but that has been fixed shortly afterwards). The patch only introduces _Float{16,32,64,128}, not _Float{32,64,128}x that C also supports, so I've removed __FLT{32,64,128}X_* predefined macros. The patch is still incomplete and I'm getting stuck on it (except I can surely provide testsuite coverage for what is already implemented): 1) there is no bf16/BF16 constant suffix nor underlying type for std::bfloat16_t for now; I think we need to come to agreement on how the underlying type would be called (__bf16 like aarch64/arm/i386 currently have their extension type?) and how to mangle it (all 3 currently mangle it as u6__bf16) and if we choose a different keyword for it whether it is distinct from __bf16 2) I haven't implemented the [conv.double] addition: "with a greater or equal conversion rank ([conv.rank]). A prvalue of standard floating-point type can be converted to a prvalue of another standard floating-point type" - not really sure where it should be done (but the new cp_compare_floating_point_conversion_ranks function can be used to compare ranks and subranks) 3) for the [expr.static.cast] addition, I wonder if there is anything to do, I'd expect it would just work as is 4) for the [expr.arith.conv] changes, I think I've implement those in cp_common_type, except for the "Otherwise, the expression is ill-formed." part where I just return error_mark_node, but cp_common_type doesn't emit any diagnostics whatsoever, so I wonder if it should be done somewhere in the callers, or if the function and its wrappers should get tsubst_flags_t complain argument or what. 5) I've skipped the [over.ics.rank] changes, I'm afraid it is another thing I'm not really familiar with 6) the library part is unimplemented altogether, the __FLT* macros can be used to implement numerical limits, but e.g. for the <cmath>/<complex> stuff not really sure how far can we get for std::float128_t if not on glibc or on old glibc (guess the others at least when they match float/double which can be tested through preprocessor macros can be handled by casts to those types)