[PATCH] more g77 runtime library functions for gfortran
Paul Brook
paul@codesourcery.com
Sun Aug 29 15:58:00 GMT 2004
On Saturday 28 August 2004 22:46, Steve Kargl wrote:
> The attached files update this patch set to include the additions
> of erf, derf, erfc, derfc, getpid, getgid, and getuid. Bootstrap
> and regression tested. No new failures are caused by this patch.
> Here's updated ChangeLogs.
I changed you patch to use the GCC builtins, rather than than calling library
functions directly, providing libgfortran wrappers for the C99 "float"
versions where necessary.
I also copied over the old g77 tests for these functions.
Tested on i686-linux.
Applied to mainline as follows.
2004-08-29 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
* check.c (gfc_check_besn, gfc_check_g77_math1): New functions.
* f95-lang.c (DO_DEFINE_MATH_BUILTIN): Define.
(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
(build_builtin_fntypes): New function.
(gfc_init_builtin_functions): Use it.
* gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_{J,Y}{0,1,N}
and GFC_ISYM_ERF{,C}.
(gfc_c_int_kind): Declare.
* intrinsic.c (add_functions): Add [d]bes* and [d]erf*.
* intrinsic.h (gfc_check_besn, gfc_check_g77_math1, gfc_resolve_besn,
gfc_resolve_g77_math1): Add prototypes.
* resolve.c (gfc_resolve_besn, gfc_resolve_g77_math1): New functions.
* mathbuiltins.def: Add comment. Change third argument. Use
DEFINE_MATH_BUILTIN_C. Add bessel and error functions.
* trans-intrinsic.c (BUILT_IN_FUNCTION): Define.
(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
* trans-types.c (gfc_c_int_kind): Declare.
(gfc_init_kinds): Set it.
testsuite/
* gfortran.dg/g77/README: Update.
* gfortran.dg/g77/erfc.f: Copy from g77.f-torture.
* gfortran.dg/g77/intrinsic-unix-bessel.f: Ditto.
* gfortran.dg/g77/intrinsic-unix-erf.f: Ditto.
libgfortran/
* intrinsics/bessel.c: New file.
* intrinsics/erf.c: New file.
* Makefie.am: Add intrinsics/bessel.c and intrinsics/erf.c.
* configure.ac: Test for C99 Bessel and Error functions.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* configure: Regenerate.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: text/x-diff
Size: 68706 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20040829/c94e53db/attachment.bin>
More information about the Fortran
mailing list