Re: [power-ieee128] fortran, libgfortran: Assorted -mabi=ieeelongdouble I/O fixes

2022-01-04 Thread Thomas Koenig via Gcc-patches

On 04.01.22 15:23, Jakub Jelinek via Fortran wrote:

Ok for power-ieee128?


Also OK.

Best regards

Thomas


Re: [power-ieee128] fortran, libgfortran: Assorted -mabi=ieeelongdouble I/O fixes

2022-01-04 Thread Jakub Jelinek via Gcc-patches
Hi!

This test FAILs because
f951: Error: '-mabi=ieeelongdouble' requires full ISA 2.06 support
compiler exited with status 1
FAIL: gfortran.dg/pr47614.f   -O0  (test for excess errors)
As powerpc64le* only supports -mcpu=power8 and newer, I think we shouldn't
be testing with that option.

Ok for power-ieee128?

All the remaining FAILs I get are due to the -flto -mgnu-attribute issues
or FAIL also with -mabi=ibmlongdouble.

Though, I'm still unsure on what we should do with the array descriptors.
typedef struct dtype_type
{
  size_t elem_len;
  int version;
  signed char rank;
  signed char type;
  signed short attribute;
}
dtype_type;

Is elem_len really element length, or kind, or both?

It seems a lot of code uses that interchangeably, is there anything where
we'd rely on whether it is the IBM extended real(kind=16) or IEEE quad
real(kind=16) (either in libgfortran or elsewhere)?
At least in libgfortran/generates/*, GFC_DESCRIPTOR_SIZE is mostly used
as mask_kind (I think the mask arrays are always logical not real/complex,
right?), or for logical stuff like matmul_l*.

2022-01-04  Jakub Jelinek  

* gfortran.dg/pr47614.f: Don't use -mcpu=power4 for
powerpc64le*-*-linux*.

--- gcc/testsuite/gfortran.dg/pr47614.f.jj  2021-12-31 11:00:53.733041354 
+
+++ gcc/testsuite/gfortran.dg/pr47614.f 2022-01-04 17:51:05.422663254 +
@@ -1,6 +1,7 @@
 ! { dg-do run { target { powerpc*-*-* } } }
 ! { dg-skip-if "" { powerpc*-*-darwin* } }
 ! { dg-options "-O3 -funroll-loops -ffast-math -mcpu=power4" }
+! { dg-options "-O3 -funroll-loops -ffast-math" { target powerpc64le*-*-linux* 
} }
 
 
   SUBROUTINE SFCPAR(ZET,NZ,ZMH,TSL,TMES)

Jakub



Re: [power-ieee128] fortran, libgfortran: Assorted -mabi=ieeelongdouble I/O fixes

2022-01-04 Thread Thomas Koenig via Gcc-patches



Hi Jakub,


This test FAILs because
f951: Error: '-mabi=ieeelongdouble' requires full ISA 2.06 support
compiler exited with status 1
FAIL: gfortran.dg/pr47614.f   -O0  (test for excess errors)
As powerpc64le* only supports -mcpu=power8 and newer, I think we shouldn't
be testing with that option.

Ok for power-ieee128?


OK (I would also consider it obvious).



Though, I'm still unsure on what we should do with the array descriptors.
typedef struct dtype_type
{
   size_t elem_len;
   int version;
   signed char rank;
   signed char type;
   signed short attribute;
}
dtype_type;

Is elem_len really element length, or kind, or both?


It is specified as a length, and should be set correctly also
for complex (where it is twice the length).


It seems a lot of code uses that interchangeably, is there anything where
we'd rely on whether it is the IBM extended real(kind=16) or IEEE quad
real(kind=16) (either in libgfortran or elsewhere)?


I think we use sizeof in all relevant files.


At least in libgfortran/generates/*, GFC_DESCRIPTOR_SIZE is mostly used
as mask_kind (I think the mask arrays are always logical not real/complex,
right?), or for logical stuff like matmul_l*.


Yes, masks are always of type logical, so that should not be an issue.

There are two direct uses of elem_len in caf/singe.c, one in
date_and_time.c and one in io/transfer.c.  There is also some
use of a variable of that name ISO_Fortran_binding.c, which can
be checked later.

Best regards

Thomas