Re: [PATCH, PR90030] Fortran OpenMP/OpenACC array mapping alignment fix
On Thu, Nov 04, 2021 at 04:23:43PM +0800, Chung-Lin Tang wrote: > 2021-11-04 Chung-Lin Tang > Thomas Schwinge > > PR fortran/90030 > > gcc/fortran/ChangeLog: > > * trans-openmp.c (gfc_omp_finish_clause): Remove fold_convert to pointer > to char_type_node, add gcc_assert of POINTER_TYPE_P. > (gfc_trans_omp_array_section): Likewise. > (gfc_trans_omp_clauses): Likewise. > > gcc/testsuite/ChangeLog: > > * gfortran.dg/goacc/finalize-1.f: Adjust scan test. > * gfortran.dg/gomp/affinity-clause-1.f90: Likewise. > * gfortran.dg/gomp/affinity-clause-5.f90: Likewise. > * gfortran.dg/gomp/defaultmap-4.f90: Likewise. > * gfortran.dg/gomp/defaultmap-5.f90: Likewise. > * gfortran.dg/gomp/defaultmap-6.f90: Likewise. > * gfortran.dg/gomp/map-3.f90: Likewise. > * gfortran.dg/gomp/pr78260-2.f90: Likewise. > * gfortran.dg/gomp/pr78260-3.f90: Likewise. > > libgomp/ChangeLog: > > * testsuite/libgomp.oacc-fortran/pr90030.f90: New test. > * testsuite/libgomp.fortran/pr90030.f90: New test. Ok, thanks. Jakub
[power-ieee128] What should the math functions be annotated with?
I am currently working on implementing the IEEE 128-bit floating on POWER. One of the things to decide is what to call the math functions for the library calls. Example: libgfortran/generated/bessel_r16.c currently has #if defined(GFC_REAL_16_IS_FLOAT128) #define MATHFUNC(funcname) funcname ## q #else #define MATHFUNC(funcname) funcname ## l #endif (This is actually generated from an m4 file). For the BesselJ functions, for example, either the library functions jnq or jnl will be called. We have chosen *_r17.c and _c17.c as the naming conventions for library functions using IEEE 128-bit, and the files will be compiled with mabi=ieeelongdouble. So, what should the suffix for math functions be? I assume they will be picked up from some library. Somebody else than me will have to make sure this is done correctly, though :-) Regards Thomas So, what should the math functions be called so that they are actually found in the library?
Re: [power-ieee128] What should the math functions be annotated with?
On Wed, Dec 01, 2021 at 09:34:47PM +0100, Thomas Koenig via Gcc wrote: > I am currently working on implementing the IEEE 128-bit floating > on POWER. One of the things to decide is what to call the > math functions for the library calls. > > Example: libgfortran/generated/bessel_r16.c currently has > > #if defined(GFC_REAL_16_IS_FLOAT128) > #define MATHFUNC(funcname) funcname ## q > #else > #define MATHFUNC(funcname) funcname ## l > #endif > > (This is actually generated from an m4 file). > > For the BesselJ functions, for example, either the library functions jnq > or jnl will be called. I think it depends. Inside of libgfortran, I think it should depend on some macro defined in libgfortran.h. #if defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ \ && defined __GLIBC_PREREQ && __GLIBC_PREREQ (2, 32) then #define MATHFUNC(funcname) __ ## funcname ## ieee128 (i.e. use the functions that will be used when one uses e.g. sinl in C when compiled with -mabi=ieeelongdouble), but I'm not sure if those need to be declared by libgfortran or math.h declares them). Otherwise (when libgfortran is compiled against glibc older than 2.32) it should use #define MATHFUNC(funcname) funcname ## q i.e. use the libquadmath APIs). Now, when compiler itself actually emits calls like sinl etc. itself, IMHO it should use solely those __ ## funcname ## ieee128 functions, because that means either user uses explicit -mabi=ieeelongdouble and at that point he needs to make sure he has glibc 2.32 or later, or the compiler is configured to default to -mabi=ieeelongdouble and user doesn't use -mabi=ibmlongdouble (then presumably again user has to make sure glibc 2.32 or later is used). The reason to use libquadmath as fallback inside of libgfortran is so that one can build gcc against older glibc and keep the libgfortran ABI, and then use the compiler against newer glibc (or the older glibc assuming ibmlongdouble is used). Jakub
Re: [power-ieee128] What should the math functions be annotated with?
On Wed, Dec 01, 2021 at 09:54:50PM +0100, Jakub Jelinek wrote: > sinl in C when compiled with -mabi=ieeelongdouble), but I'm not sure > if those need to be declared by libgfortran or math.h declares them). To answer this myself, just tried on Fedora 34 and we'd need to declare those ourselves. Because math.h for -mabi=ibmlongdouble (which we want to compile the libgfortran *.c files with so that REAL16 is long double as before) only has prototypes like: extern long double sinl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); extern long double __sinl (long double __x) __attribute__ ((__nothrow__ , __leaf__)); and with -mabi=ieeelongdouble it has: extern long double sinl (long double __x) __asm__ ("" "__sinieee128") __attribute__ ((__nothrow__ , __leaf__)); extern long double __sinl (long double __x) __asm__ ("" "sinieee128") __attribute__ ((__nothrow__ , __leaf__)); but in neither case there is what we actually need for libgfortran, which is extern __float128 __sinieee128 (__float128) __attribute__ ((__nothrow__, __leaf__)); Jakub