From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 10635385C416; Wed, 24 Aug 2022 14:49:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10635385C416 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661352599; bh=b/q3ZS+ORgiEzNh/TETX4gfmY/KV3f/rVeteURH7KRY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=m+RmOnFVWTufM0pAB42HcaxxlVXYHRs77bHVRlAQ0ClUPcLMQNZwnLSGGa1UXNgZu efPCIToRjiZhKR44ms0rw0SjaYgfAWCz9jCZu5nzsEXCmBIBNZq+gdVzTN36taElpj CaQbMhbGk2YpFVkwaQ2JPwYCqutasUso3kamOqS0= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106652] [C++23] P1467 - Extended floating-point types and standard names Date: Wed, 24 Aug 2022 14:49:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106652 Jakub Jelinek 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 --- 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 un= less 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 dist= inct 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=20 (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 litera= ls, 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 sur= ely 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 exten= sion 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 __bf= 16 2) I haven't implemented the [conv.double] addition: "with a greater or equal conversion rank ([conv.rank]). A prvalue of standard=20 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 u= sed to implement numerical limits, but e.g. for the / 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)=