From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 1B68E3854179 for ; Fri, 30 Sep 2022 15:51:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1B68E3854179 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 28UFo3dM018975; Fri, 30 Sep 2022 10:50:04 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 28UFo3FH018974; Fri, 30 Sep 2022 10:50:03 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 30 Sep 2022 10:50:02 -0500 From: Segher Boessenkool To: Jakub Jelinek Cc: richard.sandiford@arm.com, gcc-patches@gcc.gnu.org, "Joseph S. Myers" , Richard Earnshaw Subject: Re: [PATCH] i386, rs6000, ia64, s390: Fix C++ ICEs with _Float64x or _Float128 [PR107080] Message-ID: <20220930155002.GI25951@gate.crashing.org> References: <20220930150759.GH25951@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Sep 30, 2022 at 05:31:26PM +0200, Jakub Jelinek wrote: > On Fri, Sep 30, 2022 at 10:07:59AM -0500, Segher Boessenkool wrote: > > On Thu, Sep 29, 2022 at 12:01:43PM +0200, Jakub Jelinek via Gcc-patches wrote: > > > --- gcc/config/i386/i386.cc.jj 2022-09-29 09:13:25.713718513 +0200 > > > +++ gcc/config/i386/i386.cc 2022-09-29 11:29:20.828358152 +0200 > > > @@ -22725,6 +22725,9 @@ ix86_mangle_type (const_tree type) > > > && TREE_CODE (type) != INTEGER_TYPE && TREE_CODE (type) != REAL_TYPE) > > > return NULL; > > > > > > + if (type == float128_type_node || type == float64x_type_node) > > > + return NULL; > > > > Is float128_type_node always IEEE QP, never double-double? I couldn't > > find this documented anywhere. If this is not true, this part of the > > patch is incorrect. > > It is always IEEE quad, if there is no IEEE quad support, it is NULL. > The C++ wording is: > > "If the implementation supports an extended floating-point type whose > properties are specified by the ISO/IEC/IEEE 60559 floating-point > interchange format binary128, then the typedef-name std::float128_t is > defined in the header and names such a type, the macro > __STDCPP_FLOAT128_T__ is defined, and the floating-point literal suffixes > f128 and F128 are supported." > and C: > Types designated: > _FloatN > where N is 16, 32, 64, or ≥128 and a multiple of 32; and, types designated > _DecimalN > where N ≥ 32 and a multiple of 32, are collectively called the interchange floating types. Each > interchange floating type has the IEC 60559 interchange format corresponding to its width (N) and > radix (2 for _FloatN, 10 for _DecimalN). Each interchange floating type is not compatible with any > other type." > > So, _Float128 and std::float128_t which we use float128_type_node for > must be IEEE binary128, nothing else. Great :-) > Internally, it is implemented by using targetm.floatn_mode hook to query > which mode if any is the IEEE one with corresponding width. tree.h says just /* Names for individual types (code should normally iterate over all such types; these are only for back-end use, or in contexts such as *.def where iteration is not possible). */ and there is nothing whatsoever in doc/. Looking at the current implementation never shows intent :-( Segher