gcc/libgfortran/generated/rrspacing_r16.c

59 lines
1.8 KiB
C
Raw Normal View History

re PR fortran/15441 (RRSPACING broken for denormals) 2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.h: Define GFC_MPFR_TOO_OLD via mpfr version info. * arith.c (arctangent, gfc_check_real_range): Use it. * simplify.c (gfc_simplify_atan2, gfc_simplify_exponent, gfc_simplify_log, gfc_simplify_nearest): Use it. PR fortran/15441 PR fortran/29312 * iresolve.c (gfc_resolve_rrspacing): Give rrspacing library routine hidden precision argument. (gfc_resolve_spacing): Give spacing library routine hidden precision, emin - 1, and tiny(x) arguments. * simplify.c (gfc_simplify_nearest): Remove explicit subnormalization. (gfc_simplify_rrspacing): Implement formula from Fortran 95 standard. (gfc_simplify_spacing): Implement formula from Fortran 2003 standard. * trans-intrinsic.c (gfc_intrinsic_map_t) Declare rrspacing and spacing via LIBF_FUNCTION (prepare_arg_info, call_builtin_clz, gfc_conv_intrinsic_spacing, gfc_conv_intrinsic_rrspacing): Remove functions. (gfc_conv_intrinsic_function): Remove calls to gfc_conv_intrinsic_spacing and gfc_conv_intrinsic_rrspacing. * f95-lang.c (gfc_init_builtin_functions): Remove __builtin_clz, __builtin_clzl and __builtin_clzll 2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/15441 PR fortran/29312 * configure.ac: Add HAVE_LDEXPF, HAVE_LDEXP, and HAVE_LDEXPL * m4/spacing.m4: New file. Use new HAVE_* defines. * m4/rrspacing.m4: Ditto. * Makefile.am: Handle new files. * configure: Regenerated. * Makefile.in: Ditto. * config.h.in: Ditto. * generated/spacing_r4.c: Generated. * generated/spacing_r8.c: Ditto. * generated/spacing_r10.c: Ditto. * generated/spacing_r16.c: Ditto. * generated/rrspacing_r4.c: Ditto. * generated/rrspacing_r8.c: Ditto. * generated/rrspacing_r10.c: Ditto. * generated/rrspacing_r16.c: Ditto. From-SVN: r117584
2006-10-09 22:55:29 +02:00
/* Implementation of the RRSPACING intrinsic
Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
re PR fortran/15441 (RRSPACING broken for denormals) 2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.h: Define GFC_MPFR_TOO_OLD via mpfr version info. * arith.c (arctangent, gfc_check_real_range): Use it. * simplify.c (gfc_simplify_atan2, gfc_simplify_exponent, gfc_simplify_log, gfc_simplify_nearest): Use it. PR fortran/15441 PR fortran/29312 * iresolve.c (gfc_resolve_rrspacing): Give rrspacing library routine hidden precision argument. (gfc_resolve_spacing): Give spacing library routine hidden precision, emin - 1, and tiny(x) arguments. * simplify.c (gfc_simplify_nearest): Remove explicit subnormalization. (gfc_simplify_rrspacing): Implement formula from Fortran 95 standard. (gfc_simplify_spacing): Implement formula from Fortran 2003 standard. * trans-intrinsic.c (gfc_intrinsic_map_t) Declare rrspacing and spacing via LIBF_FUNCTION (prepare_arg_info, call_builtin_clz, gfc_conv_intrinsic_spacing, gfc_conv_intrinsic_rrspacing): Remove functions. (gfc_conv_intrinsic_function): Remove calls to gfc_conv_intrinsic_spacing and gfc_conv_intrinsic_rrspacing. * f95-lang.c (gfc_init_builtin_functions): Remove __builtin_clz, __builtin_clzl and __builtin_clzll 2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/15441 PR fortran/29312 * configure.ac: Add HAVE_LDEXPF, HAVE_LDEXP, and HAVE_LDEXPL * m4/spacing.m4: New file. Use new HAVE_* defines. * m4/rrspacing.m4: Ditto. * Makefile.am: Handle new files. * configure: Regenerated. * Makefile.in: Ditto. * config.h.in: Ditto. * generated/spacing_r4.c: Generated. * generated/spacing_r8.c: Ditto. * generated/spacing_r10.c: Ditto. * generated/spacing_r16.c: Ditto. * generated/rrspacing_r4.c: Ditto. * generated/rrspacing_r8.c: Ditto. * generated/rrspacing_r10.c: Ditto. * generated/rrspacing_r16.c: Ditto. From-SVN: r117584
2006-10-09 22:55:29 +02:00
Contributed by Steven G. Kargl <kargl@gcc.gnu.org>
This file is part of the GNU Fortran 95 runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
re PR fortran/15441 (RRSPACING broken for denormals) 2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.h: Define GFC_MPFR_TOO_OLD via mpfr version info. * arith.c (arctangent, gfc_check_real_range): Use it. * simplify.c (gfc_simplify_atan2, gfc_simplify_exponent, gfc_simplify_log, gfc_simplify_nearest): Use it. PR fortran/15441 PR fortran/29312 * iresolve.c (gfc_resolve_rrspacing): Give rrspacing library routine hidden precision argument. (gfc_resolve_spacing): Give spacing library routine hidden precision, emin - 1, and tiny(x) arguments. * simplify.c (gfc_simplify_nearest): Remove explicit subnormalization. (gfc_simplify_rrspacing): Implement formula from Fortran 95 standard. (gfc_simplify_spacing): Implement formula from Fortran 2003 standard. * trans-intrinsic.c (gfc_intrinsic_map_t) Declare rrspacing and spacing via LIBF_FUNCTION (prepare_arg_info, call_builtin_clz, gfc_conv_intrinsic_spacing, gfc_conv_intrinsic_rrspacing): Remove functions. (gfc_conv_intrinsic_function): Remove calls to gfc_conv_intrinsic_spacing and gfc_conv_intrinsic_rrspacing. * f95-lang.c (gfc_init_builtin_functions): Remove __builtin_clz, __builtin_clzl and __builtin_clzll 2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/15441 PR fortran/29312 * configure.ac: Add HAVE_LDEXPF, HAVE_LDEXP, and HAVE_LDEXPL * m4/spacing.m4: New file. Use new HAVE_* defines. * m4/rrspacing.m4: Ditto. * Makefile.am: Handle new files. * configure: Regenerated. * Makefile.in: Ditto. * config.h.in: Ditto. * generated/spacing_r4.c: Generated. * generated/spacing_r8.c: Ditto. * generated/spacing_r10.c: Ditto. * generated/spacing_r16.c: Ditto. * generated/rrspacing_r4.c: Ditto. * generated/rrspacing_r8.c: Ditto. * generated/rrspacing_r10.c: Ditto. * generated/rrspacing_r16.c: Ditto. From-SVN: r117584
2006-10-09 22:55:29 +02:00
Libgfortran is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
re PR fortran/15441 (RRSPACING broken for denormals) 2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.h: Define GFC_MPFR_TOO_OLD via mpfr version info. * arith.c (arctangent, gfc_check_real_range): Use it. * simplify.c (gfc_simplify_atan2, gfc_simplify_exponent, gfc_simplify_log, gfc_simplify_nearest): Use it. PR fortran/15441 PR fortran/29312 * iresolve.c (gfc_resolve_rrspacing): Give rrspacing library routine hidden precision argument. (gfc_resolve_spacing): Give spacing library routine hidden precision, emin - 1, and tiny(x) arguments. * simplify.c (gfc_simplify_nearest): Remove explicit subnormalization. (gfc_simplify_rrspacing): Implement formula from Fortran 95 standard. (gfc_simplify_spacing): Implement formula from Fortran 2003 standard. * trans-intrinsic.c (gfc_intrinsic_map_t) Declare rrspacing and spacing via LIBF_FUNCTION (prepare_arg_info, call_builtin_clz, gfc_conv_intrinsic_spacing, gfc_conv_intrinsic_rrspacing): Remove functions. (gfc_conv_intrinsic_function): Remove calls to gfc_conv_intrinsic_spacing and gfc_conv_intrinsic_rrspacing. * f95-lang.c (gfc_init_builtin_functions): Remove __builtin_clz, __builtin_clzl and __builtin_clzll 2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/15441 PR fortran/29312 * configure.ac: Add HAVE_LDEXPF, HAVE_LDEXP, and HAVE_LDEXPL * m4/spacing.m4: New file. Use new HAVE_* defines. * m4/rrspacing.m4: Ditto. * Makefile.am: Handle new files. * configure: Regenerated. * Makefile.in: Ditto. * config.h.in: Ditto. * generated/spacing_r4.c: Generated. * generated/spacing_r8.c: Ditto. * generated/spacing_r10.c: Ditto. * generated/spacing_r16.c: Ditto. * generated/rrspacing_r4.c: Ditto. * generated/rrspacing_r8.c: Ditto. * generated/rrspacing_r10.c: Ditto. * generated/rrspacing_r16.c: Ditto. From-SVN: r117584
2006-10-09 22:55:29 +02:00
#include "libgfortran.h"
mtype.m4 (upcase, [...]): New macros. * m4/mtype.m4 (upcase, hasmathfunc, mathfunc_macro): New macros. * m4/fraction.m4: Use new macros to support quad-float types. * m4/set_exponent.m4: Likewise. * m4/spacing.m4: Likewise. * m4/exponent.m4: Likewise. * m4/nearest.m4: Likewise. * m4/norm2.m4: Likewise. * m4/bessel.m4: Likewise. * m4/rrspacing.m4: Likewise. * generated/bessel_r4.c:Regenerated. * generated/bessel_r8.c: Regenerated. * generated/bessel_r10.c: Regenerated. * generated/bessel_r16.c: Regenerated. * generated/exponent_r4.c: Regenerated. * generated/exponent_r8.c: Regenerated. * generated/exponent_r10.c: Regenerated. * generated/exponent_r16.c: Regenerated. * generated/fraction_r4.c: Regenerated. * generated/fraction_r8.c: Regenerated. * generated/fraction_r10.c: Regenerated. * generated/fraction_r16.c: Regenerated. * generated/nearest_r4.c: Regenerated. * generated/nearest_r8.c: Regenerated. * generated/nearest_r10.c: Regenerated. * generated/nearest_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/rrspacing_r4.c: Regenerated. * generated/rrspacing_r8.c: Regenerated. * generated/rrspacing_r10.c: Regenerated. * generated/rrspacing_r16.c: Regenerated. * generated/set_exponent_r4.c: Regenerated. * generated/set_exponent_r8.c: Regenerated. * generated/set_exponent_r10.c: Regenerated. * generated/set_exponent_r16.c: Regenerated. * generated/spacing_r4.c: Regenerated. * generated/spacing_r8.c: Regenerated. * generated/spacing_r10.c: Regenerated. * generated/spacing_r16.c: Regenerated. From-SVN: r163620
2010-08-29 00:10:52 +02:00
#if defined(GFC_REAL_16_IS_FLOAT128)
#define MATHFUNC(funcname) funcname ## q
#else
#define MATHFUNC(funcname) funcname ## l
#endif
re PR fortran/32049 (Support on x86_64 also kind=16) / 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * Makefile.def: Add libquadmath; build it with language=fortran. * configure.ac: Add libquadmath. * Makefile.tpl: Handle multiple libs in check-[+language+]. * Makefile.in: Regenerate. * configure: Regenerate. libquadmath/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 Initial implementation and checkin. gcc/fortran/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * gfortranspec.c (find_spec_file): New function. (lang_specific_driver): Try to find .spec file and use it. * trans-io.c (iocall): Define * IOCALL_X_REAL128/COMPLEX128(,write). (gfc_build_io_library_fndecls): Build decl for __float128 I/O. (transfer_expr): Call __float128 I/O functions. * trans-types.c (gfc_init_kinds): Allow kind-16 belonging to __float128. gcc/testsuite/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * gfortran.dg/quad_1.f90: New. * lib/gcc-defs.exp (gcc-set-multilib-library-path): Use also compiler arguments. * lib/gfortran.exp (gfortran_link_flags): Add libquadmath to library search path; call gcc-set-multilib-library-path with arguments such that libgfortran.spec is found. (gfortran_init): Add path for libgfortran.spec to GFORTRAN_UNDER_TEST. libgomp/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * configure.ac: * configure: Regenerate. libgfortran/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * Makefile.am: Add missing pow_r16_i4.c, add transfer128.c, link libquadmath, if used. * acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Add. * configure.ac: Use it, touch spec file. * gfortran.map: Add pow_r16_i4 and transfer_(real,complex)128(,write) functions. * intrinsics/cshift0.c (cshift0): Handle __float128 type. * intrinsics/erfc_scaled_inc.c: Ditto. * intrinsics/pack_generic.c (pack): Ditto * intrinsics/spread_generic.c (spread): Ditto. * intrinsics/unpack_generic.c (unpack1): Ditto. * io/read.c (convert_real): Ditto. * io/transfer.c: Update comments. * io/transfer128.c: New file. * io/write_float.def (write_float): Handle __float128 type. * libgfortran.h: #include quadmath_weak.h, define __builtin_infq and nanq. * m4/mtype.m4: Handle __float128 type. * runtime/in_pack_generic.c (internal_pack): Ditto. * runtime/in_unpack_generic.c (internal_unpack): Ditto. * kinds-override.h: New file. * libgfortran.spec.in: Ditto. * generated/pow_r16_i4.c: Generated. * Makefile.in: Regenerate. * configure: Regenerate. * config.h: Regenerate. * bessel_r10.c: Regenerate. * bessel_r16.c: Regenerate. * bessel_r4.c: Regenerate. * bessel_r8.c: Regenerate. * exponent_r16.c: Regenerate. * fraction_r16.c: Regenerate. * nearest_r16.c: Regenerate. * norm2_r10.c: Regenerate. * norm2_r16.c: Regenerate. * norm2_r4.c: Regenerate. * norm2_r8.c: Regenerate. * rrspacing_r16.c: Regenerate. * set_exponent_r16.c: Regenerate. * spacing_r16.c: Regenerate. Co-Authored-By: Tobias Burnus <burnus@net-b.de> From-SVN: r166825
2010-11-16 22:23:19 +01:00
#if defined (HAVE_GFC_REAL_16) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FABSL)) && (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_FREXPL))
re PR fortran/15441 (RRSPACING broken for denormals) 2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.h: Define GFC_MPFR_TOO_OLD via mpfr version info. * arith.c (arctangent, gfc_check_real_range): Use it. * simplify.c (gfc_simplify_atan2, gfc_simplify_exponent, gfc_simplify_log, gfc_simplify_nearest): Use it. PR fortran/15441 PR fortran/29312 * iresolve.c (gfc_resolve_rrspacing): Give rrspacing library routine hidden precision argument. (gfc_resolve_spacing): Give spacing library routine hidden precision, emin - 1, and tiny(x) arguments. * simplify.c (gfc_simplify_nearest): Remove explicit subnormalization. (gfc_simplify_rrspacing): Implement formula from Fortran 95 standard. (gfc_simplify_spacing): Implement formula from Fortran 2003 standard. * trans-intrinsic.c (gfc_intrinsic_map_t) Declare rrspacing and spacing via LIBF_FUNCTION (prepare_arg_info, call_builtin_clz, gfc_conv_intrinsic_spacing, gfc_conv_intrinsic_rrspacing): Remove functions. (gfc_conv_intrinsic_function): Remove calls to gfc_conv_intrinsic_spacing and gfc_conv_intrinsic_rrspacing. * f95-lang.c (gfc_init_builtin_functions): Remove __builtin_clz, __builtin_clzl and __builtin_clzll 2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/15441 PR fortran/29312 * configure.ac: Add HAVE_LDEXPF, HAVE_LDEXP, and HAVE_LDEXPL * m4/spacing.m4: New file. Use new HAVE_* defines. * m4/rrspacing.m4: Ditto. * Makefile.am: Handle new files. * configure: Regenerated. * Makefile.in: Ditto. * config.h.in: Ditto. * generated/spacing_r4.c: Generated. * generated/spacing_r8.c: Ditto. * generated/spacing_r10.c: Ditto. * generated/spacing_r16.c: Ditto. * generated/rrspacing_r4.c: Ditto. * generated/rrspacing_r8.c: Ditto. * generated/rrspacing_r10.c: Ditto. * generated/rrspacing_r16.c: Ditto. From-SVN: r117584
2006-10-09 22:55:29 +02:00
extern GFC_REAL_16 rrspacing_r16 (GFC_REAL_16 s, int p);
export_proto(rrspacing_r16);
GFC_REAL_16
rrspacing_r16 (GFC_REAL_16 s, int p)
{
int e;
GFC_REAL_16 x;
mtype.m4 (upcase, [...]): New macros. * m4/mtype.m4 (upcase, hasmathfunc, mathfunc_macro): New macros. * m4/fraction.m4: Use new macros to support quad-float types. * m4/set_exponent.m4: Likewise. * m4/spacing.m4: Likewise. * m4/exponent.m4: Likewise. * m4/nearest.m4: Likewise. * m4/norm2.m4: Likewise. * m4/bessel.m4: Likewise. * m4/rrspacing.m4: Likewise. * generated/bessel_r4.c:Regenerated. * generated/bessel_r8.c: Regenerated. * generated/bessel_r10.c: Regenerated. * generated/bessel_r16.c: Regenerated. * generated/exponent_r4.c: Regenerated. * generated/exponent_r8.c: Regenerated. * generated/exponent_r10.c: Regenerated. * generated/exponent_r16.c: Regenerated. * generated/fraction_r4.c: Regenerated. * generated/fraction_r8.c: Regenerated. * generated/fraction_r10.c: Regenerated. * generated/fraction_r16.c: Regenerated. * generated/nearest_r4.c: Regenerated. * generated/nearest_r8.c: Regenerated. * generated/nearest_r10.c: Regenerated. * generated/nearest_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/rrspacing_r4.c: Regenerated. * generated/rrspacing_r8.c: Regenerated. * generated/rrspacing_r10.c: Regenerated. * generated/rrspacing_r16.c: Regenerated. * generated/set_exponent_r4.c: Regenerated. * generated/set_exponent_r8.c: Regenerated. * generated/set_exponent_r10.c: Regenerated. * generated/set_exponent_r16.c: Regenerated. * generated/spacing_r4.c: Regenerated. * generated/spacing_r8.c: Regenerated. * generated/spacing_r10.c: Regenerated. * generated/spacing_r16.c: Regenerated. From-SVN: r163620
2010-08-29 00:10:52 +02:00
x = MATHFUNC(fabs) (s);
re PR fortran/15441 (RRSPACING broken for denormals) 2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.h: Define GFC_MPFR_TOO_OLD via mpfr version info. * arith.c (arctangent, gfc_check_real_range): Use it. * simplify.c (gfc_simplify_atan2, gfc_simplify_exponent, gfc_simplify_log, gfc_simplify_nearest): Use it. PR fortran/15441 PR fortran/29312 * iresolve.c (gfc_resolve_rrspacing): Give rrspacing library routine hidden precision argument. (gfc_resolve_spacing): Give spacing library routine hidden precision, emin - 1, and tiny(x) arguments. * simplify.c (gfc_simplify_nearest): Remove explicit subnormalization. (gfc_simplify_rrspacing): Implement formula from Fortran 95 standard. (gfc_simplify_spacing): Implement formula from Fortran 2003 standard. * trans-intrinsic.c (gfc_intrinsic_map_t) Declare rrspacing and spacing via LIBF_FUNCTION (prepare_arg_info, call_builtin_clz, gfc_conv_intrinsic_spacing, gfc_conv_intrinsic_rrspacing): Remove functions. (gfc_conv_intrinsic_function): Remove calls to gfc_conv_intrinsic_spacing and gfc_conv_intrinsic_rrspacing. * f95-lang.c (gfc_init_builtin_functions): Remove __builtin_clz, __builtin_clzl and __builtin_clzll 2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/15441 PR fortran/29312 * configure.ac: Add HAVE_LDEXPF, HAVE_LDEXP, and HAVE_LDEXPL * m4/spacing.m4: New file. Use new HAVE_* defines. * m4/rrspacing.m4: Ditto. * Makefile.am: Handle new files. * configure: Regenerated. * Makefile.in: Ditto. * config.h.in: Ditto. * generated/spacing_r4.c: Generated. * generated/spacing_r8.c: Ditto. * generated/spacing_r10.c: Ditto. * generated/spacing_r16.c: Ditto. * generated/rrspacing_r4.c: Ditto. * generated/rrspacing_r8.c: Ditto. * generated/rrspacing_r10.c: Ditto. * generated/rrspacing_r16.c: Ditto. From-SVN: r117584
2006-10-09 22:55:29 +02:00
if (x == 0.)
return 0.;
mtype.m4 (upcase, [...]): New macros. * m4/mtype.m4 (upcase, hasmathfunc, mathfunc_macro): New macros. * m4/fraction.m4: Use new macros to support quad-float types. * m4/set_exponent.m4: Likewise. * m4/spacing.m4: Likewise. * m4/exponent.m4: Likewise. * m4/nearest.m4: Likewise. * m4/norm2.m4: Likewise. * m4/bessel.m4: Likewise. * m4/rrspacing.m4: Likewise. * generated/bessel_r4.c:Regenerated. * generated/bessel_r8.c: Regenerated. * generated/bessel_r10.c: Regenerated. * generated/bessel_r16.c: Regenerated. * generated/exponent_r4.c: Regenerated. * generated/exponent_r8.c: Regenerated. * generated/exponent_r10.c: Regenerated. * generated/exponent_r16.c: Regenerated. * generated/fraction_r4.c: Regenerated. * generated/fraction_r8.c: Regenerated. * generated/fraction_r10.c: Regenerated. * generated/fraction_r16.c: Regenerated. * generated/nearest_r4.c: Regenerated. * generated/nearest_r8.c: Regenerated. * generated/nearest_r10.c: Regenerated. * generated/nearest_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/rrspacing_r4.c: Regenerated. * generated/rrspacing_r8.c: Regenerated. * generated/rrspacing_r10.c: Regenerated. * generated/rrspacing_r16.c: Regenerated. * generated/set_exponent_r4.c: Regenerated. * generated/set_exponent_r8.c: Regenerated. * generated/set_exponent_r10.c: Regenerated. * generated/set_exponent_r16.c: Regenerated. * generated/spacing_r4.c: Regenerated. * generated/spacing_r8.c: Regenerated. * generated/spacing_r10.c: Regenerated. * generated/spacing_r16.c: Regenerated. From-SVN: r163620
2010-08-29 00:10:52 +02:00
MATHFUNC(frexp) (s, &e);
re PR fortran/32049 (Support on x86_64 also kind=16) / 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * Makefile.def: Add libquadmath; build it with language=fortran. * configure.ac: Add libquadmath. * Makefile.tpl: Handle multiple libs in check-[+language+]. * Makefile.in: Regenerate. * configure: Regenerate. libquadmath/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 Initial implementation and checkin. gcc/fortran/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * gfortranspec.c (find_spec_file): New function. (lang_specific_driver): Try to find .spec file and use it. * trans-io.c (iocall): Define * IOCALL_X_REAL128/COMPLEX128(,write). (gfc_build_io_library_fndecls): Build decl for __float128 I/O. (transfer_expr): Call __float128 I/O functions. * trans-types.c (gfc_init_kinds): Allow kind-16 belonging to __float128. gcc/testsuite/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * gfortran.dg/quad_1.f90: New. * lib/gcc-defs.exp (gcc-set-multilib-library-path): Use also compiler arguments. * lib/gfortran.exp (gfortran_link_flags): Add libquadmath to library search path; call gcc-set-multilib-library-path with arguments such that libgfortran.spec is found. (gfortran_init): Add path for libgfortran.spec to GFORTRAN_UNDER_TEST. libgomp/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * configure.ac: * configure: Regenerate. libgfortran/ 2010-11-13 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32049 * Makefile.am: Add missing pow_r16_i4.c, add transfer128.c, link libquadmath, if used. * acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Add. * configure.ac: Use it, touch spec file. * gfortran.map: Add pow_r16_i4 and transfer_(real,complex)128(,write) functions. * intrinsics/cshift0.c (cshift0): Handle __float128 type. * intrinsics/erfc_scaled_inc.c: Ditto. * intrinsics/pack_generic.c (pack): Ditto * intrinsics/spread_generic.c (spread): Ditto. * intrinsics/unpack_generic.c (unpack1): Ditto. * io/read.c (convert_real): Ditto. * io/transfer.c: Update comments. * io/transfer128.c: New file. * io/write_float.def (write_float): Handle __float128 type. * libgfortran.h: #include quadmath_weak.h, define __builtin_infq and nanq. * m4/mtype.m4: Handle __float128 type. * runtime/in_pack_generic.c (internal_pack): Ditto. * runtime/in_unpack_generic.c (internal_unpack): Ditto. * kinds-override.h: New file. * libgfortran.spec.in: Ditto. * generated/pow_r16_i4.c: Generated. * Makefile.in: Regenerate. * configure: Regenerate. * config.h: Regenerate. * bessel_r10.c: Regenerate. * bessel_r16.c: Regenerate. * bessel_r4.c: Regenerate. * bessel_r8.c: Regenerate. * exponent_r16.c: Regenerate. * fraction_r16.c: Regenerate. * nearest_r16.c: Regenerate. * norm2_r10.c: Regenerate. * norm2_r16.c: Regenerate. * norm2_r4.c: Regenerate. * norm2_r8.c: Regenerate. * rrspacing_r16.c: Regenerate. * set_exponent_r16.c: Regenerate. * spacing_r16.c: Regenerate. Co-Authored-By: Tobias Burnus <burnus@net-b.de> From-SVN: r166825
2010-11-16 22:23:19 +01:00
#if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_LDEXPL))
mtype.m4 (upcase, [...]): New macros. * m4/mtype.m4 (upcase, hasmathfunc, mathfunc_macro): New macros. * m4/fraction.m4: Use new macros to support quad-float types. * m4/set_exponent.m4: Likewise. * m4/spacing.m4: Likewise. * m4/exponent.m4: Likewise. * m4/nearest.m4: Likewise. * m4/norm2.m4: Likewise. * m4/bessel.m4: Likewise. * m4/rrspacing.m4: Likewise. * generated/bessel_r4.c:Regenerated. * generated/bessel_r8.c: Regenerated. * generated/bessel_r10.c: Regenerated. * generated/bessel_r16.c: Regenerated. * generated/exponent_r4.c: Regenerated. * generated/exponent_r8.c: Regenerated. * generated/exponent_r10.c: Regenerated. * generated/exponent_r16.c: Regenerated. * generated/fraction_r4.c: Regenerated. * generated/fraction_r8.c: Regenerated. * generated/fraction_r10.c: Regenerated. * generated/fraction_r16.c: Regenerated. * generated/nearest_r4.c: Regenerated. * generated/nearest_r8.c: Regenerated. * generated/nearest_r10.c: Regenerated. * generated/nearest_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/rrspacing_r4.c: Regenerated. * generated/rrspacing_r8.c: Regenerated. * generated/rrspacing_r10.c: Regenerated. * generated/rrspacing_r16.c: Regenerated. * generated/set_exponent_r4.c: Regenerated. * generated/set_exponent_r8.c: Regenerated. * generated/set_exponent_r10.c: Regenerated. * generated/set_exponent_r16.c: Regenerated. * generated/spacing_r4.c: Regenerated. * generated/spacing_r8.c: Regenerated. * generated/spacing_r10.c: Regenerated. * generated/spacing_r16.c: Regenerated. From-SVN: r163620
2010-08-29 00:10:52 +02:00
return MATHFUNC(ldexp) (x, p - e);
#else
mtype.m4 (upcase, [...]): New macros. * m4/mtype.m4 (upcase, hasmathfunc, mathfunc_macro): New macros. * m4/fraction.m4: Use new macros to support quad-float types. * m4/set_exponent.m4: Likewise. * m4/spacing.m4: Likewise. * m4/exponent.m4: Likewise. * m4/nearest.m4: Likewise. * m4/norm2.m4: Likewise. * m4/bessel.m4: Likewise. * m4/rrspacing.m4: Likewise. * generated/bessel_r4.c:Regenerated. * generated/bessel_r8.c: Regenerated. * generated/bessel_r10.c: Regenerated. * generated/bessel_r16.c: Regenerated. * generated/exponent_r4.c: Regenerated. * generated/exponent_r8.c: Regenerated. * generated/exponent_r10.c: Regenerated. * generated/exponent_r16.c: Regenerated. * generated/fraction_r4.c: Regenerated. * generated/fraction_r8.c: Regenerated. * generated/fraction_r10.c: Regenerated. * generated/fraction_r16.c: Regenerated. * generated/nearest_r4.c: Regenerated. * generated/nearest_r8.c: Regenerated. * generated/nearest_r10.c: Regenerated. * generated/nearest_r16.c: Regenerated. * generated/norm2_r4.c: Regenerated. * generated/norm2_r8.c: Regenerated. * generated/norm2_r10.c: Regenerated. * generated/norm2_r16.c: Regenerated. * generated/rrspacing_r4.c: Regenerated. * generated/rrspacing_r8.c: Regenerated. * generated/rrspacing_r10.c: Regenerated. * generated/rrspacing_r16.c: Regenerated. * generated/set_exponent_r4.c: Regenerated. * generated/set_exponent_r8.c: Regenerated. * generated/set_exponent_r10.c: Regenerated. * generated/set_exponent_r16.c: Regenerated. * generated/spacing_r4.c: Regenerated. * generated/spacing_r8.c: Regenerated. * generated/spacing_r10.c: Regenerated. * generated/spacing_r16.c: Regenerated. From-SVN: r163620
2010-08-29 00:10:52 +02:00
return MATHFUNC(scalbn) (x, p - e);
#endif
re PR fortran/15441 (RRSPACING broken for denormals) 2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.h: Define GFC_MPFR_TOO_OLD via mpfr version info. * arith.c (arctangent, gfc_check_real_range): Use it. * simplify.c (gfc_simplify_atan2, gfc_simplify_exponent, gfc_simplify_log, gfc_simplify_nearest): Use it. PR fortran/15441 PR fortran/29312 * iresolve.c (gfc_resolve_rrspacing): Give rrspacing library routine hidden precision argument. (gfc_resolve_spacing): Give spacing library routine hidden precision, emin - 1, and tiny(x) arguments. * simplify.c (gfc_simplify_nearest): Remove explicit subnormalization. (gfc_simplify_rrspacing): Implement formula from Fortran 95 standard. (gfc_simplify_spacing): Implement formula from Fortran 2003 standard. * trans-intrinsic.c (gfc_intrinsic_map_t) Declare rrspacing and spacing via LIBF_FUNCTION (prepare_arg_info, call_builtin_clz, gfc_conv_intrinsic_spacing, gfc_conv_intrinsic_rrspacing): Remove functions. (gfc_conv_intrinsic_function): Remove calls to gfc_conv_intrinsic_spacing and gfc_conv_intrinsic_rrspacing. * f95-lang.c (gfc_init_builtin_functions): Remove __builtin_clz, __builtin_clzl and __builtin_clzll 2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/15441 PR fortran/29312 * configure.ac: Add HAVE_LDEXPF, HAVE_LDEXP, and HAVE_LDEXPL * m4/spacing.m4: New file. Use new HAVE_* defines. * m4/rrspacing.m4: Ditto. * Makefile.am: Handle new files. * configure: Regenerated. * Makefile.in: Ditto. * config.h.in: Ditto. * generated/spacing_r4.c: Generated. * generated/spacing_r8.c: Ditto. * generated/spacing_r10.c: Ditto. * generated/spacing_r16.c: Ditto. * generated/rrspacing_r4.c: Ditto. * generated/rrspacing_r8.c: Ditto. * generated/rrspacing_r10.c: Ditto. * generated/rrspacing_r16.c: Ditto. From-SVN: r117584
2006-10-09 22:55:29 +02:00
}
#endif