diff options
author | Tobias Burnus <burnus@gcc.gnu.org> | 2010-08-21 12:12:53 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2010-08-21 12:12:53 +0200 |
commit | 47b996944dcb50a831c1332b8ea667ff6f95fa95 (patch) | |
tree | f963b78e966a67d516f6105c26a4b775d5c2dcfd /libgfortran | |
parent | 508e475706c3560a86b08446e1bb764773b93ed9 (diff) | |
download | gcc-47b996944dcb50a831c1332b8ea667ff6f95fa95.zip gcc-47b996944dcb50a831c1332b8ea667ff6f95fa95.tar.gz gcc-47b996944dcb50a831c1332b8ea667ff6f95fa95.tar.bz2 |
re PR fortran/36158 (Transformational function BESSEL_YN(n1,n2,x) and BESSEL_JN missing)
2010-08-21 Tobias Burnus <burnus@net-b.de>
PR fortran/36158
PR fortran/33197
* intrinsic.c (add_sym): Init value attribute.
(set_attr_value): New function.
(add_functions) Use it and add JN/YN resolvers.
* symbol.c (gfc_copy_formal_args_intr): Copy value attr.
* intrinsic.h (gfc_resolve_bessel_n2): New prototype.
* gfortran.h (gfc_intrinsic_arg): Add value attribute.
* iresolve.c (gfc_resolve_bessel_n2): New function.
* trans-intrinsic.c (gfc_get_symbol_for_expr): Create
formal arg list.
(gfc_conv_intrinsic_function,gfc_is_intrinsic_libcall):
Add GFC_ISYM_JN2/GFC_ISYM_YN2 as case value.
* simplify.c (): For YN set to -INF if previous values
was -INF.
* trans-expr.c (gfc_conv_procedure_call): Don't crash
if sym->as is NULL.
* iresolve.c (gfc_resolve_extends_type_of): Set the
type of the dummy argument to the one of the actual.
2010-08-21 Tobias Burnus <burnus@net-b.de>
PR fortran/36158
PR fortran/33197
* m4/bessel.m4: Implement bessel_jn and bessel_yn.
* gfortran.map: Add the generated bessel_jn_r{4,8,10,16}
and bessel_yn_r{4,8,10,16}.
* Makefile.am: Add bessel.m4.
* Makefile.in: Regenerated.
* generated/bessel_r4.c: Generated.
* generated/bessel_r16.c: Generated.
* generated/bessel_r8.c: Generated.
* generated/bessel_r10.c: Generated.
2010-08-21 Tobias Burnus <burnus@net-b.de>
PR fortran/36158
PR fortran/33197
* gfortran.dg/bessel_6.f90: New.
* gfortran.dg/bessel_7.f90: New.
From-SVN: r163440
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 18 | ||||
-rw-r--r-- | libgfortran/Makefile.am | 13 | ||||
-rw-r--r-- | libgfortran/Makefile.in | 112 | ||||
-rw-r--r-- | libgfortran/generated/bessel_r10.c | 183 | ||||
-rw-r--r-- | libgfortran/generated/bessel_r16.c | 183 | ||||
-rw-r--r-- | libgfortran/generated/bessel_r4.c | 183 | ||||
-rw-r--r-- | libgfortran/generated/bessel_r8.c | 183 | ||||
-rw-r--r-- | libgfortran/gfortran.map | 8 | ||||
-rw-r--r-- | libgfortran/m4/bessel.m4 | 185 |
9 files changed, 1029 insertions, 39 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 3ffb788..2e2ba26 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,17 @@ +2010-08-19 Tobias Burnus <burnus@net-b.de> + + PR fortran/36158 + PR fortran/33197 + * m4/bessel.m4: Implement bessel_jn and bessel_yn. + * gfortran.map: Add the generated bessel_jn_r{4,8,10,16} + and bessel_yn_r{4,8,10,16}. + * Makefile.am: Add bessel.m4. + * Makefile.in: Regenerated. + * generated/bessel_r4.c: Generated. + * generated/bessel_r16.c: Generated. + * generated/bessel_r8.c: Generated. + * generated/bessel_r10.c: Generated. + 2010-08-19 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/45108 @@ -33,8 +47,8 @@ 2010-08-01 Janne Blomqvist <jb@gcc.gnu.org> - * io/unix.c (file_exists): Use access(2) instead of stat(2) to - test file existence. + * io/unix.c (file_exists): Use access(2) instead of stat(2) to + test file existence. (fallback_access): Move up in file, implement F_OK. 2010-07-31 David Edelsohn <edelsohn@gnu.org> diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am index 9940caf..8d470b7 100644 --- a/libgfortran/Makefile.am +++ b/libgfortran/Makefile.am @@ -175,6 +175,12 @@ $(srcdir)/generated/any_l4.c \ $(srcdir)/generated/any_l8.c \ $(srcdir)/generated/any_l16.c +i_bessel_c= \ +$(srcdir)/generated/bessel_r4.c \ +$(srcdir)/generated/bessel_r8.c \ +$(srcdir)/generated/bessel_r10.c \ +$(srcdir)/generated/bessel_r16.c + i_count_c= \ $(srcdir)/generated/count_1_l.c \ $(srcdir)/generated/count_2_l.c \ @@ -583,11 +589,11 @@ m4_files= m4/iparm.m4 m4/ifunction.m4 m4/iforeach.m4 m4/all.m4 \ m4/transpose.m4 m4/eoshift1.m4 m4/eoshift3.m4 m4/exponent.m4 \ m4/fraction.m4 m4/nearest.m4 m4/set_exponent.m4 m4/pow.m4 \ m4/misc_specifics.m4 m4/rrspacing.m4 m4/spacing.m4 m4/pack.m4 \ - m4/unpack.m4 m4/spread.m4 + m4/unpack.m4 m4/spread.m4 m4/bessel.m4 gfor_built_src= $(i_all_c) $(i_any_c) $(i_count_c) $(i_maxloc0_c) \ $(i_maxloc1_c) $(i_maxval_c) $(i_minloc0_c) $(i_minloc1_c) $(i_minval_c) \ - $(i_product_c) $(i_sum_c) \ + $(i_product_c) $(i_sum_c) $(i_bessel_c) \ $(i_matmul_c) $(i_matmull_c) $(i_transpose_c) $(i_shape_c) $(i_eoshift1_c) \ $(i_eoshift3_c) $(i_cshift1_c) $(i_reshape_c) $(in_pack_c) $(in_unpack_c) \ $(i_exponent_c) $(i_fraction_c) $(i_nearest_c) $(i_set_exponent_c) \ @@ -821,6 +827,9 @@ if MAINTAINER_MODE $(i_all_c): m4/all.m4 $(I_M4_DEPS2) $(M4) -Dfile=$@ -I$(srcdir)/m4 all.m4 > $@ +$(i_bessel_c): m4/bessel.m4 $(I_M4_DEPS) + $(M4) -Dfile=$@ -I$(srcdir)/m4 bessel.m4 > $@ + $(i_any_c): m4/any.m4 $(I_M4_DEPS2) $(M4) -Dfile=$@ -I$(srcdir)/m4 any.m4 > $@ diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in index 880d00d..d4b5146 100644 --- a/libgfortran/Makefile.in +++ b/libgfortran/Makefile.in @@ -143,40 +143,41 @@ am__objects_11 = product_i1.lo product_i2.lo product_i4.lo \ am__objects_12 = sum_i1.lo sum_i2.lo sum_i4.lo sum_i8.lo sum_i16.lo \ sum_r4.lo sum_r8.lo sum_r10.lo sum_r16.lo sum_c4.lo sum_c8.lo \ sum_c10.lo sum_c16.lo -am__objects_13 = matmul_i1.lo matmul_i2.lo matmul_i4.lo matmul_i8.lo \ +am__objects_13 = bessel_r4.lo bessel_r8.lo bessel_r10.lo bessel_r16.lo +am__objects_14 = matmul_i1.lo matmul_i2.lo matmul_i4.lo matmul_i8.lo \ matmul_i16.lo matmul_r4.lo matmul_r8.lo matmul_r10.lo \ matmul_r16.lo matmul_c4.lo matmul_c8.lo matmul_c10.lo \ matmul_c16.lo -am__objects_14 = matmul_l4.lo matmul_l8.lo matmul_l16.lo -am__objects_15 = transpose_i4.lo transpose_i8.lo transpose_i16.lo \ +am__objects_15 = matmul_l4.lo matmul_l8.lo matmul_l16.lo +am__objects_16 = transpose_i4.lo transpose_i8.lo transpose_i16.lo \ transpose_r4.lo transpose_r8.lo transpose_r10.lo \ transpose_r16.lo transpose_c4.lo transpose_c8.lo \ transpose_c10.lo transpose_c16.lo -am__objects_16 = shape_i4.lo shape_i8.lo shape_i16.lo -am__objects_17 = eoshift1_4.lo eoshift1_8.lo eoshift1_16.lo -am__objects_18 = eoshift3_4.lo eoshift3_8.lo eoshift3_16.lo -am__objects_19 = cshift1_4.lo cshift1_8.lo cshift1_16.lo -am__objects_20 = reshape_i4.lo reshape_i8.lo reshape_i16.lo \ +am__objects_17 = shape_i4.lo shape_i8.lo shape_i16.lo +am__objects_18 = eoshift1_4.lo eoshift1_8.lo eoshift1_16.lo +am__objects_19 = eoshift3_4.lo eoshift3_8.lo eoshift3_16.lo +am__objects_20 = cshift1_4.lo cshift1_8.lo cshift1_16.lo +am__objects_21 = reshape_i4.lo reshape_i8.lo reshape_i16.lo \ reshape_r4.lo reshape_r8.lo reshape_r10.lo reshape_r16.lo \ reshape_c4.lo reshape_c8.lo reshape_c10.lo reshape_c16.lo -am__objects_21 = in_pack_i1.lo in_pack_i2.lo in_pack_i4.lo \ +am__objects_22 = in_pack_i1.lo in_pack_i2.lo in_pack_i4.lo \ in_pack_i8.lo in_pack_i16.lo in_pack_r4.lo in_pack_r8.lo \ in_pack_r10.lo in_pack_r16.lo in_pack_c4.lo in_pack_c8.lo \ in_pack_c10.lo in_pack_c16.lo -am__objects_22 = in_unpack_i1.lo in_unpack_i2.lo in_unpack_i4.lo \ +am__objects_23 = in_unpack_i1.lo in_unpack_i2.lo in_unpack_i4.lo \ in_unpack_i8.lo in_unpack_i16.lo in_unpack_r4.lo \ in_unpack_r8.lo in_unpack_r10.lo in_unpack_r16.lo \ in_unpack_c4.lo in_unpack_c8.lo in_unpack_c10.lo \ in_unpack_c16.lo -am__objects_23 = exponent_r4.lo exponent_r8.lo exponent_r10.lo \ +am__objects_24 = exponent_r4.lo exponent_r8.lo exponent_r10.lo \ exponent_r16.lo -am__objects_24 = fraction_r4.lo fraction_r8.lo fraction_r10.lo \ +am__objects_25 = fraction_r4.lo fraction_r8.lo fraction_r10.lo \ fraction_r16.lo -am__objects_25 = nearest_r4.lo nearest_r8.lo nearest_r10.lo \ +am__objects_26 = nearest_r4.lo nearest_r8.lo nearest_r10.lo \ nearest_r16.lo -am__objects_26 = set_exponent_r4.lo set_exponent_r8.lo \ +am__objects_27 = set_exponent_r4.lo set_exponent_r8.lo \ set_exponent_r10.lo set_exponent_r16.lo -am__objects_27 = pow_i4_i4.lo pow_i8_i4.lo pow_i16_i4.lo pow_c4_i4.lo \ +am__objects_28 = pow_i4_i4.lo pow_i8_i4.lo pow_i16_i4.lo pow_c4_i4.lo \ pow_c8_i4.lo pow_c10_i4.lo pow_c16_i4.lo pow_i4_i8.lo \ pow_i8_i8.lo pow_i16_i8.lo pow_r4_i8.lo pow_r8_i8.lo \ pow_r10_i8.lo pow_r16_i8.lo pow_c4_i8.lo pow_c8_i8.lo \ @@ -184,26 +185,26 @@ am__objects_27 = pow_i4_i4.lo pow_i8_i4.lo pow_i16_i4.lo pow_c4_i4.lo \ pow_i16_i16.lo pow_r4_i16.lo pow_r8_i16.lo pow_r10_i16.lo \ pow_r16_i16.lo pow_c4_i16.lo pow_c8_i16.lo pow_c10_i16.lo \ pow_c16_i16.lo -am__objects_28 = rrspacing_r4.lo rrspacing_r8.lo rrspacing_r10.lo \ +am__objects_29 = rrspacing_r4.lo rrspacing_r8.lo rrspacing_r10.lo \ rrspacing_r16.lo -am__objects_29 = spacing_r4.lo spacing_r8.lo spacing_r10.lo \ +am__objects_30 = spacing_r4.lo spacing_r8.lo spacing_r10.lo \ spacing_r16.lo -am__objects_30 = pack_i1.lo pack_i2.lo pack_i4.lo pack_i8.lo \ +am__objects_31 = pack_i1.lo pack_i2.lo pack_i4.lo pack_i8.lo \ pack_i16.lo pack_r4.lo pack_r8.lo pack_r10.lo pack_r16.lo \ pack_c4.lo pack_c8.lo pack_c10.lo pack_c16.lo -am__objects_31 = unpack_i1.lo unpack_i2.lo unpack_i4.lo unpack_i8.lo \ +am__objects_32 = unpack_i1.lo unpack_i2.lo unpack_i4.lo unpack_i8.lo \ unpack_i16.lo unpack_r4.lo unpack_r8.lo unpack_r10.lo \ unpack_r16.lo unpack_c4.lo unpack_c8.lo unpack_c10.lo \ unpack_c16.lo -am__objects_32 = spread_i1.lo spread_i2.lo spread_i4.lo spread_i8.lo \ +am__objects_33 = spread_i1.lo spread_i2.lo spread_i4.lo spread_i8.lo \ spread_i16.lo spread_r4.lo spread_r8.lo spread_r10.lo \ spread_r16.lo spread_c4.lo spread_c8.lo spread_c10.lo \ spread_c16.lo -am__objects_33 = cshift0_i1.lo cshift0_i2.lo cshift0_i4.lo \ +am__objects_34 = cshift0_i1.lo cshift0_i2.lo cshift0_i4.lo \ cshift0_i8.lo cshift0_i16.lo cshift0_r4.lo cshift0_r8.lo \ cshift0_r10.lo cshift0_r16.lo cshift0_c4.lo cshift0_c8.lo \ cshift0_c10.lo cshift0_c16.lo -am__objects_34 = $(am__objects_2) $(am__objects_3) $(am__objects_4) \ +am__objects_35 = $(am__objects_2) $(am__objects_3) $(am__objects_4) \ $(am__objects_5) $(am__objects_6) $(am__objects_7) \ $(am__objects_8) $(am__objects_9) $(am__objects_10) \ $(am__objects_11) $(am__objects_12) $(am__objects_13) \ @@ -213,11 +214,11 @@ am__objects_34 = $(am__objects_2) $(am__objects_3) $(am__objects_4) \ $(am__objects_23) $(am__objects_24) $(am__objects_25) \ $(am__objects_26) $(am__objects_27) $(am__objects_28) \ $(am__objects_29) $(am__objects_30) $(am__objects_31) \ - $(am__objects_32) $(am__objects_33) -am__objects_35 = close.lo file_pos.lo format.lo inquire.lo \ + $(am__objects_32) $(am__objects_33) $(am__objects_34) +am__objects_36 = close.lo file_pos.lo format.lo inquire.lo \ intrinsics.lo list_read.lo lock.lo open.lo read.lo \ size_from_kind.lo transfer.lo unit.lo unix.lo write.lo fbuf.lo -am__objects_36 = associated.lo abort.lo access.lo args.lo \ +am__objects_37 = associated.lo abort.lo access.lo args.lo \ bit_intrinsics.lo c99_functions.lo chdir.lo chmod.lo clock.lo \ cpu_time.lo cshift0.lo ctime.lo date_and_time.lo dtime.lo \ env.lo eoshift0.lo eoshift2.lo erfc_scaled.lo etime.lo exit.lo \ @@ -232,8 +233,8 @@ am__objects_36 = associated.lo abort.lo access.lo args.lo \ system_clock.lo time.lo transpose_generic.lo umask.lo \ unlink.lo unpack_generic.lo in_pack_generic.lo \ in_unpack_generic.lo -am__objects_37 = -am__objects_38 = _abs_c4.lo _abs_c8.lo _abs_c10.lo _abs_c16.lo \ +am__objects_38 = +am__objects_39 = _abs_c4.lo _abs_c8.lo _abs_c10.lo _abs_c16.lo \ _abs_i4.lo _abs_i8.lo _abs_i16.lo _abs_r4.lo _abs_r8.lo \ _abs_r10.lo _abs_r16.lo _aimag_c4.lo _aimag_c8.lo \ _aimag_c10.lo _aimag_c16.lo _exp_r4.lo _exp_r8.lo _exp_r10.lo \ @@ -257,18 +258,18 @@ am__objects_38 = _abs_c4.lo _abs_c8.lo _abs_c10.lo _abs_c16.lo \ _conjg_c4.lo _conjg_c8.lo _conjg_c10.lo _conjg_c16.lo \ _aint_r4.lo _aint_r8.lo _aint_r10.lo _aint_r16.lo _anint_r4.lo \ _anint_r8.lo _anint_r10.lo _anint_r16.lo -am__objects_39 = _sign_i4.lo _sign_i8.lo _sign_i16.lo _sign_r4.lo \ +am__objects_40 = _sign_i4.lo _sign_i8.lo _sign_i16.lo _sign_r4.lo \ _sign_r8.lo _sign_r10.lo _sign_r16.lo _dim_i4.lo _dim_i8.lo \ _dim_i16.lo _dim_r4.lo _dim_r8.lo _dim_r10.lo _dim_r16.lo \ _atan2_r4.lo _atan2_r8.lo _atan2_r10.lo _atan2_r16.lo \ _mod_i4.lo _mod_i8.lo _mod_i16.lo _mod_r4.lo _mod_r8.lo \ _mod_r10.lo _mod_r16.lo -am__objects_40 = misc_specifics.lo -am__objects_41 = $(am__objects_38) $(am__objects_39) $(am__objects_40) \ +am__objects_41 = misc_specifics.lo +am__objects_42 = $(am__objects_39) $(am__objects_40) $(am__objects_41) \ dprod_r8.lo f2c_specifics.lo -am__objects_42 = $(am__objects_1) $(am__objects_34) $(am__objects_35) \ - $(am__objects_36) $(am__objects_37) $(am__objects_41) -@onestep_FALSE@am_libgfortran_la_OBJECTS = $(am__objects_42) +am__objects_43 = $(am__objects_1) $(am__objects_35) $(am__objects_36) \ + $(am__objects_37) $(am__objects_38) $(am__objects_42) +@onestep_FALSE@am_libgfortran_la_OBJECTS = $(am__objects_43) @onestep_TRUE@am_libgfortran_la_OBJECTS = libgfortran_c.lo libgfortran_la_OBJECTS = $(am_libgfortran_la_OBJECTS) libgfortranbegin_la_LIBADD = @@ -590,6 +591,12 @@ $(srcdir)/generated/any_l4.c \ $(srcdir)/generated/any_l8.c \ $(srcdir)/generated/any_l16.c +i_bessel_c = \ +$(srcdir)/generated/bessel_r4.c \ +$(srcdir)/generated/bessel_r8.c \ +$(srcdir)/generated/bessel_r10.c \ +$(srcdir)/generated/bessel_r16.c + i_count_c = \ $(srcdir)/generated/count_1_l.c \ $(srcdir)/generated/count_2_l.c \ @@ -997,11 +1004,11 @@ m4_files = m4/iparm.m4 m4/ifunction.m4 m4/iforeach.m4 m4/all.m4 \ m4/transpose.m4 m4/eoshift1.m4 m4/eoshift3.m4 m4/exponent.m4 \ m4/fraction.m4 m4/nearest.m4 m4/set_exponent.m4 m4/pow.m4 \ m4/misc_specifics.m4 m4/rrspacing.m4 m4/spacing.m4 m4/pack.m4 \ - m4/unpack.m4 m4/spread.m4 + m4/unpack.m4 m4/spread.m4 m4/bessel.m4 gfor_built_src = $(i_all_c) $(i_any_c) $(i_count_c) $(i_maxloc0_c) \ $(i_maxloc1_c) $(i_maxval_c) $(i_minloc0_c) $(i_minloc1_c) $(i_minval_c) \ - $(i_product_c) $(i_sum_c) \ + $(i_product_c) $(i_sum_c) $(i_bessel_c) \ $(i_matmul_c) $(i_matmull_c) $(i_transpose_c) $(i_shape_c) $(i_eoshift1_c) \ $(i_eoshift3_c) $(i_cshift1_c) $(i_reshape_c) $(in_pack_c) $(in_unpack_c) \ $(i_exponent_c) $(i_fraction_c) $(i_nearest_c) $(i_set_exponent_c) \ @@ -1328,6 +1335,10 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/args.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/associated.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backtrace.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bessel_r10.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bessel_r16.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bessel_r4.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bessel_r8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bit_intrinsics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bounds.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c99_functions.Plo@am__quote@ @@ -3456,6 +3467,34 @@ sum_c16.lo: $(srcdir)/generated/sum_c16.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sum_c16.lo `test -f '$(srcdir)/generated/sum_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/sum_c16.c +bessel_r4.lo: $(srcdir)/generated/bessel_r4.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bessel_r4.lo -MD -MP -MF $(DEPDIR)/bessel_r4.Tpo -c -o bessel_r4.lo `test -f '$(srcdir)/generated/bessel_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r4.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/bessel_r4.Tpo $(DEPDIR)/bessel_r4.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/bessel_r4.c' object='bessel_r4.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bessel_r4.lo `test -f '$(srcdir)/generated/bessel_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r4.c + +bessel_r8.lo: $(srcdir)/generated/bessel_r8.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bessel_r8.lo -MD -MP -MF $(DEPDIR)/bessel_r8.Tpo -c -o bessel_r8.lo `test -f '$(srcdir)/generated/bessel_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r8.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/bessel_r8.Tpo $(DEPDIR)/bessel_r8.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/bessel_r8.c' object='bessel_r8.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bessel_r8.lo `test -f '$(srcdir)/generated/bessel_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r8.c + +bessel_r10.lo: $(srcdir)/generated/bessel_r10.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bessel_r10.lo -MD -MP -MF $(DEPDIR)/bessel_r10.Tpo -c -o bessel_r10.lo `test -f '$(srcdir)/generated/bessel_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r10.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/bessel_r10.Tpo $(DEPDIR)/bessel_r10.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/bessel_r10.c' object='bessel_r10.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bessel_r10.lo `test -f '$(srcdir)/generated/bessel_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r10.c + +bessel_r16.lo: $(srcdir)/generated/bessel_r16.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bessel_r16.lo -MD -MP -MF $(DEPDIR)/bessel_r16.Tpo -c -o bessel_r16.lo `test -f '$(srcdir)/generated/bessel_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r16.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/bessel_r16.Tpo $(DEPDIR)/bessel_r16.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/bessel_r16.c' object='bessel_r16.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bessel_r16.lo `test -f '$(srcdir)/generated/bessel_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/bessel_r16.c + matmul_i1.lo: $(srcdir)/generated/matmul_i1.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT matmul_i1.lo -MD -MP -MF $(DEPDIR)/matmul_i1.Tpo -c -o matmul_i1.lo `test -f '$(srcdir)/generated/matmul_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/matmul_i1.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/matmul_i1.Tpo $(DEPDIR)/matmul_i1.Plo @@ -5525,6 +5564,9 @@ fpu-target.h: $(srcdir)/$(FPU_HOST_HEADER) @MAINTAINER_MODE_TRUE@$(i_all_c): m4/all.m4 $(I_M4_DEPS2) @MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 all.m4 > $@ +@MAINTAINER_MODE_TRUE@$(i_bessel_c): m4/bessel.m4 $(I_M4_DEPS) +@MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 bessel.m4 > $@ + @MAINTAINER_MODE_TRUE@$(i_any_c): m4/any.m4 $(I_M4_DEPS2) @MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 any.m4 > $@ diff --git a/libgfortran/generated/bessel_r10.c b/libgfortran/generated/bessel_r10.c new file mode 100644 index 0000000..579de84 --- /dev/null +++ b/libgfortran/generated/bessel_r10.c @@ -0,0 +1,183 @@ +/* Implementation of the BESSEL_JN and BESSEL_YN transformational + function using a recurrence algorithm. + Copyright 2010 Free Software Foundation, Inc. + Contributed by Tobias Burnus <burnus@net-b.de> + +This file is part of the GNU Fortran 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. + +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/>. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h> + + +#if defined (HAVE_GFC_REAL_10) + + + +#if defined (HAVE_JNL) +extern void bessel_jn_r10 (gfc_array_r10 * const restrict ret, int n1, + int n2, GFC_REAL_10 x); +export_proto(bessel_jn_r10); + +void +bessel_jn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2, GFC_REAL_10 x) +{ + int i; + index_type stride; + + GFC_REAL_10 last1, last2, x2rev; + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (ret->data == NULL) + { + size_t size = n2 < n1 ? 0 : n2-n1+1; + GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1); + ret->data = internal_malloc_size (sizeof (GFC_REAL_10) * size); + ret->offset = 0; + } + + if (unlikely (n2 < n1)) + return; + + if (unlikely (compile_options.bounds_check) + && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1)) + runtime_error("Incorrect extent in return value of BESSEL_JN " + "(%ld vs. %ld)", (long int) n2-n1, + GFC_DESCRIPTOR_EXTENT(ret,0)); + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (unlikely (x == 0.0L)) + { + ret->data[0] = 1.0L; + for (i = 1; i <= n2-n1; i++) + ret->data[i*stride] = 0.0L; + return; + } + + ret->data = ret->data; + last1 = jnl (n2, x); + ret->data[(n2-n1)*stride] = last1; + + if (n1 == n2) + return; + + last2 = jnl (n2 - 1, x); + ret->data[(n2-n1-1)*stride] = last2; + + if (n1 + 1 == n2) + return; + + x2rev = 2.0L/x; + + for (i = n2-n1-2; i >= 0; i--) + { + ret->data[i*stride] = x2rev * (i+1+n1) * last2 - last1; + last1 = last2; + last2 = ret->data[i*stride]; + } +} + +#endif + +#if defined (HAVE_YNL) +extern void bessel_yn_r10 (gfc_array_r10 * const restrict ret, + int n1, int n2, GFC_REAL_10 x); +export_proto(bessel_yn_r10); + +void +bessel_yn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2, + GFC_REAL_10 x) +{ + int i; + index_type stride; + + GFC_REAL_10 last1, last2, x2rev; + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (ret->data == NULL) + { + size_t size = n2 < n1 ? 0 : n2-n1+1; + GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1); + ret->data = internal_malloc_size (sizeof (GFC_REAL_10) * size); + ret->offset = 0; + } + + if (unlikely (n2 < n1)) + return; + + if (unlikely (compile_options.bounds_check) + && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1)) + runtime_error("Incorrect extent in return value of BESSEL_JN " + "(%ld vs. %ld)", (long int) n2-n1, + GFC_DESCRIPTOR_EXTENT(ret,0)); + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (unlikely (x == 0.0L)) + { + for (i = 0; i <= n2-n1; i++) +#if defined(GFC_REAL_10_INFINITY) + ret->data[i*stride] = -GFC_REAL_10_INFINITY; +#else + ret->data[i*stride] = -GFC_REAL_10_HUGE; +#endif + return; + } + + ret->data = ret->data; + last1 = ynl (n1, x); + ret->data[0] = last1; + + if (n1 == n2) + return; + + last2 = ynl (n1 + 1, x); + ret->data[1*stride] = last2; + + if (n1 + 1 == n2) + return; + + x2rev = 2.0L/x; + + for (i = 2; i <= n1+n2; i++) + { +#if defined(GFC_REAL_10_INFINITY) + if (unlikely (last2 == -GFC_REAL_10_INFINITY)) + { + ret->data[i*stride] = -GFC_REAL_10_INFINITY; + } + else +#endif + { + ret->data[i*stride] = x2rev * (i-1+n1) * last2 - last1; + last1 = last2; + last2 = ret->data[i*stride]; + } + } +} +#endif + +#endif + diff --git a/libgfortran/generated/bessel_r16.c b/libgfortran/generated/bessel_r16.c new file mode 100644 index 0000000..a3ef181 --- /dev/null +++ b/libgfortran/generated/bessel_r16.c @@ -0,0 +1,183 @@ +/* Implementation of the BESSEL_JN and BESSEL_YN transformational + function using a recurrence algorithm. + Copyright 2010 Free Software Foundation, Inc. + Contributed by Tobias Burnus <burnus@net-b.de> + +This file is part of the GNU Fortran 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. + +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/>. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h> + + +#if defined (HAVE_GFC_REAL_16) + + + +#if defined (HAVE_JNL) +extern void bessel_jn_r16 (gfc_array_r16 * const restrict ret, int n1, + int n2, GFC_REAL_16 x); +export_proto(bessel_jn_r16); + +void +bessel_jn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2, GFC_REAL_16 x) +{ + int i; + index_type stride; + + GFC_REAL_16 last1, last2, x2rev; + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (ret->data == NULL) + { + size_t size = n2 < n1 ? 0 : n2-n1+1; + GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1); + ret->data = internal_malloc_size (sizeof (GFC_REAL_16) * size); + ret->offset = 0; + } + + if (unlikely (n2 < n1)) + return; + + if (unlikely (compile_options.bounds_check) + && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1)) + runtime_error("Incorrect extent in return value of BESSEL_JN " + "(%ld vs. %ld)", (long int) n2-n1, + GFC_DESCRIPTOR_EXTENT(ret,0)); + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (unlikely (x == 0.0L)) + { + ret->data[0] = 1.0L; + for (i = 1; i <= n2-n1; i++) + ret->data[i*stride] = 0.0L; + return; + } + + ret->data = ret->data; + last1 = jnl (n2, x); + ret->data[(n2-n1)*stride] = last1; + + if (n1 == n2) + return; + + last2 = jnl (n2 - 1, x); + ret->data[(n2-n1-1)*stride] = last2; + + if (n1 + 1 == n2) + return; + + x2rev = 2.0L/x; + + for (i = n2-n1-2; i >= 0; i--) + { + ret->data[i*stride] = x2rev * (i+1+n1) * last2 - last1; + last1 = last2; + last2 = ret->data[i*stride]; + } +} + +#endif + +#if defined (HAVE_YNL) +extern void bessel_yn_r16 (gfc_array_r16 * const restrict ret, + int n1, int n2, GFC_REAL_16 x); +export_proto(bessel_yn_r16); + +void +bessel_yn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2, + GFC_REAL_16 x) +{ + int i; + index_type stride; + + GFC_REAL_16 last1, last2, x2rev; + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (ret->data == NULL) + { + size_t size = n2 < n1 ? 0 : n2-n1+1; + GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1); + ret->data = internal_malloc_size (sizeof (GFC_REAL_16) * size); + ret->offset = 0; + } + + if (unlikely (n2 < n1)) + return; + + if (unlikely (compile_options.bounds_check) + && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1)) + runtime_error("Incorrect extent in return value of BESSEL_JN " + "(%ld vs. %ld)", (long int) n2-n1, + GFC_DESCRIPTOR_EXTENT(ret,0)); + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (unlikely (x == 0.0L)) + { + for (i = 0; i <= n2-n1; i++) +#if defined(GFC_REAL_16_INFINITY) + ret->data[i*stride] = -GFC_REAL_16_INFINITY; +#else + ret->data[i*stride] = -GFC_REAL_16_HUGE; +#endif + return; + } + + ret->data = ret->data; + last1 = ynl (n1, x); + ret->data[0] = last1; + + if (n1 == n2) + return; + + last2 = ynl (n1 + 1, x); + ret->data[1*stride] = last2; + + if (n1 + 1 == n2) + return; + + x2rev = 2.0L/x; + + for (i = 2; i <= n1+n2; i++) + { +#if defined(GFC_REAL_16_INFINITY) + if (unlikely (last2 == -GFC_REAL_16_INFINITY)) + { + ret->data[i*stride] = -GFC_REAL_16_INFINITY; + } + else +#endif + { + ret->data[i*stride] = x2rev * (i-1+n1) * last2 - last1; + last1 = last2; + last2 = ret->data[i*stride]; + } + } +} +#endif + +#endif + diff --git a/libgfortran/generated/bessel_r4.c b/libgfortran/generated/bessel_r4.c new file mode 100644 index 0000000..961c67c --- /dev/null +++ b/libgfortran/generated/bessel_r4.c @@ -0,0 +1,183 @@ +/* Implementation of the BESSEL_JN and BESSEL_YN transformational + function using a recurrence algorithm. + Copyright 2010 Free Software Foundation, Inc. + Contributed by Tobias Burnus <burnus@net-b.de> + +This file is part of the GNU Fortran 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. + +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/>. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h> + + +#if defined (HAVE_GFC_REAL_4) + + + +#if defined (HAVE_JNF) +extern void bessel_jn_r4 (gfc_array_r4 * const restrict ret, int n1, + int n2, GFC_REAL_4 x); +export_proto(bessel_jn_r4); + +void +bessel_jn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2, GFC_REAL_4 x) +{ + int i; + index_type stride; + + GFC_REAL_4 last1, last2, x2rev; + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (ret->data == NULL) + { + size_t size = n2 < n1 ? 0 : n2-n1+1; + GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1); + ret->data = internal_malloc_size (sizeof (GFC_REAL_4) * size); + ret->offset = 0; + } + + if (unlikely (n2 < n1)) + return; + + if (unlikely (compile_options.bounds_check) + && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1)) + runtime_error("Incorrect extent in return value of BESSEL_JN " + "(%ld vs. %ld)", (long int) n2-n1, + GFC_DESCRIPTOR_EXTENT(ret,0)); + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (unlikely (x == 0.0F)) + { + ret->data[0] = 1.0F; + for (i = 1; i <= n2-n1; i++) + ret->data[i*stride] = 0.0F; + return; + } + + ret->data = ret->data; + last1 = jnf (n2, x); + ret->data[(n2-n1)*stride] = last1; + + if (n1 == n2) + return; + + last2 = jnf (n2 - 1, x); + ret->data[(n2-n1-1)*stride] = last2; + + if (n1 + 1 == n2) + return; + + x2rev = 2.0F/x; + + for (i = n2-n1-2; i >= 0; i--) + { + ret->data[i*stride] = x2rev * (i+1+n1) * last2 - last1; + last1 = last2; + last2 = ret->data[i*stride]; + } +} + +#endif + +#if defined (HAVE_YNF) +extern void bessel_yn_r4 (gfc_array_r4 * const restrict ret, + int n1, int n2, GFC_REAL_4 x); +export_proto(bessel_yn_r4); + +void +bessel_yn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2, + GFC_REAL_4 x) +{ + int i; + index_type stride; + + GFC_REAL_4 last1, last2, x2rev; + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (ret->data == NULL) + { + size_t size = n2 < n1 ? 0 : n2-n1+1; + GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1); + ret->data = internal_malloc_size (sizeof (GFC_REAL_4) * size); + ret->offset = 0; + } + + if (unlikely (n2 < n1)) + return; + + if (unlikely (compile_options.bounds_check) + && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1)) + runtime_error("Incorrect extent in return value of BESSEL_JN " + "(%ld vs. %ld)", (long int) n2-n1, + GFC_DESCRIPTOR_EXTENT(ret,0)); + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (unlikely (x == 0.0F)) + { + for (i = 0; i <= n2-n1; i++) +#if defined(GFC_REAL_4_INFINITY) + ret->data[i*stride] = -GFC_REAL_4_INFINITY; +#else + ret->data[i*stride] = -GFC_REAL_4_HUGE; +#endif + return; + } + + ret->data = ret->data; + last1 = ynf (n1, x); + ret->data[0] = last1; + + if (n1 == n2) + return; + + last2 = ynf (n1 + 1, x); + ret->data[1*stride] = last2; + + if (n1 + 1 == n2) + return; + + x2rev = 2.0F/x; + + for (i = 2; i <= n1+n2; i++) + { +#if defined(GFC_REAL_4_INFINITY) + if (unlikely (last2 == -GFC_REAL_4_INFINITY)) + { + ret->data[i*stride] = -GFC_REAL_4_INFINITY; + } + else +#endif + { + ret->data[i*stride] = x2rev * (i-1+n1) * last2 - last1; + last1 = last2; + last2 = ret->data[i*stride]; + } + } +} +#endif + +#endif + diff --git a/libgfortran/generated/bessel_r8.c b/libgfortran/generated/bessel_r8.c new file mode 100644 index 0000000..c896ae4 --- /dev/null +++ b/libgfortran/generated/bessel_r8.c @@ -0,0 +1,183 @@ +/* Implementation of the BESSEL_JN and BESSEL_YN transformational + function using a recurrence algorithm. + Copyright 2010 Free Software Foundation, Inc. + Contributed by Tobias Burnus <burnus@net-b.de> + +This file is part of the GNU Fortran 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. + +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/>. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h> + + +#if defined (HAVE_GFC_REAL_8) + + + +#if defined (HAVE_JN) +extern void bessel_jn_r8 (gfc_array_r8 * const restrict ret, int n1, + int n2, GFC_REAL_8 x); +export_proto(bessel_jn_r8); + +void +bessel_jn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2, GFC_REAL_8 x) +{ + int i; + index_type stride; + + GFC_REAL_8 last1, last2, x2rev; + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (ret->data == NULL) + { + size_t size = n2 < n1 ? 0 : n2-n1+1; + GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1); + ret->data = internal_malloc_size (sizeof (GFC_REAL_8) * size); + ret->offset = 0; + } + + if (unlikely (n2 < n1)) + return; + + if (unlikely (compile_options.bounds_check) + && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1)) + runtime_error("Incorrect extent in return value of BESSEL_JN " + "(%ld vs. %ld)", (long int) n2-n1, + GFC_DESCRIPTOR_EXTENT(ret,0)); + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (unlikely (x == 0.0)) + { + ret->data[0] = 1.0; + for (i = 1; i <= n2-n1; i++) + ret->data[i*stride] = 0.0; + return; + } + + ret->data = ret->data; + last1 = jn (n2, x); + ret->data[(n2-n1)*stride] = last1; + + if (n1 == n2) + return; + + last2 = jn (n2 - 1, x); + ret->data[(n2-n1-1)*stride] = last2; + + if (n1 + 1 == n2) + return; + + x2rev = 2.0/x; + + for (i = n2-n1-2; i >= 0; i--) + { + ret->data[i*stride] = x2rev * (i+1+n1) * last2 - last1; + last1 = last2; + last2 = ret->data[i*stride]; + } +} + +#endif + +#if defined (HAVE_YN) +extern void bessel_yn_r8 (gfc_array_r8 * const restrict ret, + int n1, int n2, GFC_REAL_8 x); +export_proto(bessel_yn_r8); + +void +bessel_yn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2, + GFC_REAL_8 x) +{ + int i; + index_type stride; + + GFC_REAL_8 last1, last2, x2rev; + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (ret->data == NULL) + { + size_t size = n2 < n1 ? 0 : n2-n1+1; + GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1); + ret->data = internal_malloc_size (sizeof (GFC_REAL_8) * size); + ret->offset = 0; + } + + if (unlikely (n2 < n1)) + return; + + if (unlikely (compile_options.bounds_check) + && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1)) + runtime_error("Incorrect extent in return value of BESSEL_JN " + "(%ld vs. %ld)", (long int) n2-n1, + GFC_DESCRIPTOR_EXTENT(ret,0)); + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (unlikely (x == 0.0)) + { + for (i = 0; i <= n2-n1; i++) +#if defined(GFC_REAL_8_INFINITY) + ret->data[i*stride] = -GFC_REAL_8_INFINITY; +#else + ret->data[i*stride] = -GFC_REAL_8_HUGE; +#endif + return; + } + + ret->data = ret->data; + last1 = yn (n1, x); + ret->data[0] = last1; + + if (n1 == n2) + return; + + last2 = yn (n1 + 1, x); + ret->data[1*stride] = last2; + + if (n1 + 1 == n2) + return; + + x2rev = 2.0/x; + + for (i = 2; i <= n1+n2; i++) + { +#if defined(GFC_REAL_8_INFINITY) + if (unlikely (last2 == -GFC_REAL_8_INFINITY)) + { + ret->data[i*stride] = -GFC_REAL_8_INFINITY; + } + else +#endif + { + ret->data[i*stride] = x2rev * (i-1+n1) * last2 - last1; + last1 = last2; + last2 = ret->data[i*stride]; + } + } +} +#endif + +#endif + diff --git a/libgfortran/gfortran.map b/libgfortran/gfortran.map index ce5aa77..8c0978d 100644 --- a/libgfortran/gfortran.map +++ b/libgfortran/gfortran.map @@ -1107,6 +1107,14 @@ GFORTRAN_1.4 { global: _gfortran_error_stop_numeric; _gfortran_selected_real_kind2008; + _gfortran_bessel_jn_r4; + _gfortran_bessel_jn_r8; + _gfortran_bessel_jn_r10; + _gfortran_bessel_jn_r16; + _gfortran_bessel_yn_r4; + _gfortran_bessel_yn_r8; + _gfortran_bessel_yn_r10; + _gfortran_bessel_yn_r16; } GFORTRAN_1.3; F2C_1.0 { diff --git a/libgfortran/m4/bessel.m4 b/libgfortran/m4/bessel.m4 new file mode 100644 index 0000000..a4790dd --- /dev/null +++ b/libgfortran/m4/bessel.m4 @@ -0,0 +1,185 @@ +`/* Implementation of the BESSEL_JN and BESSEL_YN transformational + function using a recurrence algorithm. + Copyright 2010 Free Software Foundation, Inc. + Contributed by Tobias Burnus <burnus@net-b.de> + +This file is part of the GNU Fortran 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. + +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/>. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h>' + +include(iparm.m4)dnl +include(`mtype.m4')dnl + +`#if defined (HAVE_'rtype_name`) + + + +#if defined (HAVE_JN'Q`) +extern void bessel_jn_r'rtype_kind` ('rtype` * const restrict ret, int n1, + int n2, 'rtype_name` x); +export_proto(bessel_jn_r'rtype_kind`); + +void +bessel_jn_r'rtype_kind` ('rtype` * const restrict ret, int n1, int n2, 'rtype_name` x) +{ + int i; + index_type stride; + + 'rtype_name` last1, last2, x2rev; + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (ret->data == NULL) + { + size_t size = n2 < n1 ? 0 : n2-n1+1; + GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1); + ret->data = internal_malloc_size (sizeof ('rtype_name`) * size); + ret->offset = 0; + } + + if (unlikely (n2 < n1)) + return; + + if (unlikely (compile_options.bounds_check) + && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1)) + runtime_error("Incorrect extent in return value of BESSEL_JN " + "(%ld vs. %ld)", (long int) n2-n1, + GFC_DESCRIPTOR_EXTENT(ret,0)); + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (unlikely (x == 0.0'Q`)) + { + ret->data[0] = 1.0'Q`; + for (i = 1; i <= n2-n1; i++) + ret->data[i*stride] = 0.0'Q`; + return; + } + + ret->data = ret->data; + last1 = jn'q` (n2, x); + ret->data[(n2-n1)*stride] = last1; + + if (n1 == n2) + return; + + last2 = jn'q` (n2 - 1, x); + ret->data[(n2-n1-1)*stride] = last2; + + if (n1 + 1 == n2) + return; + + x2rev = 2.0'Q`/x; + + for (i = n2-n1-2; i >= 0; i--) + { + ret->data[i*stride] = x2rev * (i+1+n1) * last2 - last1; + last1 = last2; + last2 = ret->data[i*stride]; + } +} + +#endif + +#if defined (HAVE_YN'Q`) +extern void bessel_yn_r'rtype_kind` ('rtype` * const restrict ret, + int n1, int n2, 'rtype_name` x); +export_proto(bessel_yn_r'rtype_kind`); + +void +bessel_yn_r'rtype_kind` ('rtype` * const restrict ret, int n1, int n2, + 'rtype_name` x) +{ + int i; + index_type stride; + + 'rtype_name` last1, last2, x2rev; + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (ret->data == NULL) + { + size_t size = n2 < n1 ? 0 : n2-n1+1; + GFC_DIMENSION_SET(ret->dim[0], 0, size-1, 1); + ret->data = internal_malloc_size (sizeof ('rtype_name`) * size); + ret->offset = 0; + } + + if (unlikely (n2 < n1)) + return; + + if (unlikely (compile_options.bounds_check) + && GFC_DESCRIPTOR_EXTENT(ret,0) != (n2-n1+1)) + runtime_error("Incorrect extent in return value of BESSEL_JN " + "(%ld vs. %ld)", (long int) n2-n1, + GFC_DESCRIPTOR_EXTENT(ret,0)); + + stride = GFC_DESCRIPTOR_STRIDE(ret,0); + + if (unlikely (x == 0.0'Q`)) + { + for (i = 0; i <= n2-n1; i++) +#if defined('rtype_name`_INFINITY) + ret->data[i*stride] = -'rtype_name`_INFINITY; +#else + ret->data[i*stride] = -'rtype_name`_HUGE; +#endif + return; + } + + ret->data = ret->data; + last1 = yn'q` (n1, x); + ret->data[0] = last1; + + if (n1 == n2) + return; + + last2 = yn'q` (n1 + 1, x); + ret->data[1*stride] = last2; + + if (n1 + 1 == n2) + return; + + x2rev = 2.0'Q`/x; + + for (i = 2; i <= n1+n2; i++) + { +#if defined('rtype_name`_INFINITY) + if (unlikely (last2 == -'rtype_name`_INFINITY)) + { + ret->data[i*stride] = -'rtype_name`_INFINITY; + } + else +#endif + { + ret->data[i*stride] = x2rev * (i-1+n1) * last2 - last1; + last1 = last2; + last2 = ret->data[i*stride]; + } + } +} +#endif + +#endif' + |