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 <stdfloat> 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

Reply via email to