On Tue, 21 Jun 2016, FX wrote:

> > Fortran note: I took the conservative approach of renaming the
> > float128_type_node used in the Fortran front end, since I wasn't sure
> > if it's safe to make the front end always use the language-independent
> > node (which follows C rules - thus, being distinct from long double
> > even if that has binary128 format).
> 
> In the Fortran front-end, float128_type_node is defined as the 
> (expectedly unique) floating-point type for which mode_precision is 
> equal to 128 but not equal to LONG_DOUBLE_TYPE_SIZE. That is, it is 
> garanteed that float128_type_node is not long_double_type_node.
> 
> If fact, if there is a long double type with precision of 128, then 
> float128_type_node is NULL.
> 
> Would that match the (new) C behavior? I think it does.

Precision is a poorly defined concept in this context.

Precision of a type is meant to be the number of value bits, which is 128 
not just for binary128 but also for IBM long double.  I think the same 
applies to precision of a mode.  See Richard's comments in 
<https://gcc.gnu.org/ml/gcc-patches/2016-06/msg01140.html> on how the use 
of fractional float modes for IFmode and KFmode is a lie, because those 
modes both have 128 significant bits, not 106 and 113.  To avoid the 
misleading mode precision values becoming misleading type precision 
values, my patch includes a workaround in build_common_tree_nodes to give 
precedence to the N in binaryN (although it occurs to me that this is not 
in fact a sufficient workaround, because _Float64x needs such a fix as 
well) - that keeps _Float128 having type precision 128 in that case, like 
ieee128_float_type_node in the PowerPC back end does.

Language-independent float128_type_node has the following properties: it 
is always of binary128 format, never of another format that might have 
precision 128 (such as IBM long double).  If binary128 is supported, 
float128_type_node is non-NULL, whether or not long double also has 
precision 128.  That does not seem to match your semantics for Fortran in 
the case where long double is binary128, as for Fortran you'd have NULL 
but the language-independent node would be a distinct type from long 
double, not NULL.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to