diff options
author | Jakub Jelinek <jakub@redhat.com> | 2021-12-31 16:59:38 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-01-11 23:41:13 +0100 |
commit | 90d6f0c71d0f65118cc7c195a4c3b29e98c77cfd (patch) | |
tree | 1a78ea8c0342d492d5c5c28d1f5fdc7267588c97 /gcc/fortran/trans-decl.c | |
parent | 23d11a0adc7dc735634d6a47b9efc13367b08155 (diff) | |
download | gcc-90d6f0c71d0f65118cc7c195a4c3b29e98c77cfd.zip gcc-90d6f0c71d0f65118cc7c195a4c3b29e98c77cfd.tar.gz gcc-90d6f0c71d0f65118cc7c195a4c3b29e98c77cfd.tar.bz2 |
gfortran: Introduce gfc_type_abi_kind
The following patch detects the powerpc64le-linux kind == 16 cases
and for the -mabi=ieeelongdouble case (no matter whether it is the
configured in default or just option used on the command line) uses
_r17 or _c17 instead of _r16 or _c17 in the library API names.
From what I can see, e.g. calls to sin on real(kind = 16) works fine
with or without this patch (we call __builtin_sinl and the backend
uses rs6000_mangle_decl_assembler_name which ensures __sinieee128
is called).
What is clearly still broken is IO, where for
real(kind=16) a
a = 1.0
print *, a
end
we call
_gfortran_transfer_real_write (&dt_parm.0, &a, 16);
for both -mabi=ibmlongdouble and -mabi=ieeelongdouble
I don't remember what was the agreement, do we want
_gfortran_transfer_real_write (&dt_parm.0, &a, 17);
for the ieeelongdouble case, or some new entrypoint for
the abi_kind == 17 real/complex IO?
Also, what about kind stored in array descriptors? Shall we use
there the abi_kind or kind?
I guess at least before the IO case is solved there is no point
in checking the testsuite, too many things will be majorly broken...
2021-12-31 Jakub Jelinek <jakub@redhat.com>
* gfortran.h (gfc_real_info): Add abi_kind member.
(gfc_type_abi_kind): Declare.
* trans-types.c (gfc_init_kinds): Initialize abi_kind.
* intrinsic.c (gfc_type_abi_kind): New function.
(conv_name): Use it.
* iresolve.c (resolve_transformational, gfc_resolve_abs,
gfc_resolve_char_achar, gfc_resolve_acos, gfc_resolve_acosh,
gfc_resolve_aimag, gfc_resolve_and, gfc_resolve_aint, gfc_resolve_all,
gfc_resolve_anint, gfc_resolve_any, gfc_resolve_asin,
gfc_resolve_asinh, gfc_resolve_atan, gfc_resolve_atanh,
gfc_resolve_atan2, gfc_resolve_bessel_n2, gfc_resolve_ceiling,
gfc_resolve_cmplx, gfc_resolve_complex, gfc_resolve_cos,
gfc_resolve_cosh, gfc_resolve_count, gfc_resolve_dble,
gfc_resolve_dim, gfc_resolve_dot_product, gfc_resolve_dprod,
gfc_resolve_exp, gfc_resolve_floor, gfc_resolve_hypot,
gfc_resolve_int, gfc_resolve_int2, gfc_resolve_int8, gfc_resolve_long,
gfc_resolve_log, gfc_resolve_log10, gfc_resolve_logical,
gfc_resolve_matmul, gfc_resolve_minmax, gfc_resolve_maxloc,
gfc_resolve_findloc, gfc_resolve_maxval, gfc_resolve_merge,
gfc_resolve_minloc, gfc_resolve_minval, gfc_resolve_mod,
gfc_resolve_modulo, gfc_resolve_nearest, gfc_resolve_or,
gfc_resolve_real, gfc_resolve_realpart, gfc_resolve_reshape,
gfc_resolve_sign, gfc_resolve_sin, gfc_resolve_sinh, gfc_resolve_sqrt,
gfc_resolve_tan, gfc_resolve_tanh, gfc_resolve_transpose,
gfc_resolve_trigd, gfc_resolve_xor, gfc_resolve_random_number):
Likewise.
* trans-decl.c (gfc_build_intrinsic_function_decls): Likewise.
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r-- | gcc/fortran/trans-decl.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 066fb3a..08eaa5a 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -3602,8 +3602,9 @@ gfc_build_intrinsic_function_decls (void) rtype = gfc_get_real_type (rkinds[rkind]); if (rtype && itype) { - sprintf (name, PREFIX("pow_r%d_i%d"), rkinds[rkind], - ikinds[ikind]); + sprintf (name, PREFIX("pow_r%d_i%d"), + gfc_type_abi_kind (BT_REAL, rkinds[rkind]), + ikinds[ikind]); gfor_fndecl_math_powi[rkind][ikind].real = gfc_build_library_function_decl (get_identifier (name), rtype, 2, rtype, itype); @@ -3614,8 +3615,9 @@ gfc_build_intrinsic_function_decls (void) ctype = gfc_get_complex_type (rkinds[rkind]); if (ctype && itype) { - sprintf (name, PREFIX("pow_c%d_i%d"), rkinds[rkind], - ikinds[ikind]); + sprintf (name, PREFIX("pow_c%d_i%d"), + gfc_type_abi_kind (BT_REAL, rkinds[rkind]), + ikinds[ikind]); gfor_fndecl_math_powi[rkind][ikind].cmplx = gfc_build_library_function_decl (get_identifier (name), ctype, 2,ctype, itype); |