[PATCH] Add acosh, asinh, and atanh to intrinsics

Steve Kargl sgk@troutmask.apl.washington.edu
Fri Jun 24 18:18:00 GMT 2005


On Mon, Jun 13, 2005 at 11:25:42PM -0700, Jerry DeLisle wrote:
> This is a round 1 on this.
> 
> The attached patch adds acosh, asinh, and atanh intrinsic functions. 
> The new file hyper.c provides wrapper functions for float versions.
> 
> I am not exactly clear on what must be done to "connect" 
> libgfortran/intrinsics/hyper.c into the workings.  I edited configure.ac 
>  to include the checks for the float versions, but do not know what 
> else to do there.
> 
> Steve, I will incorporate your patch from:
> 
> http://gcc.gnu.org/ml/fortran/2005-06/txt00025.txt
> 
> In this patch if you wish.
> 
> I will develop test cases in round 2.
> 
> Comments will be much appreciated.
> 

Jerry, I've finally found some time to look over and test 
your patch.  I think it's okay to commit to mainline.
Note, you should include a ChangeLog entry in your 
emails to the list with the patch.

I'm CC'ing Paul Brook to see if he has any comments.
The attached diff is your diff for hooking everything
up to the library.  Paul, do you have any comments.

-- 
Steve
-------------- next part --------------
Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/Makefile.am,v
retrieving revision 1.36
diff -c -3 -p -r1.36 Makefile.am
*** Makefile.am	11 Jun 2005 19:39:09 -0000	1.36
--- Makefile.am	21 Jun 2005 01:06:58 -0000
*************** intrinsics/gerror.c \
*** 61,66 ****
--- 61,67 ----
  intrinsics/getcwd.c \
  intrinsics/getlog.c \
  intrinsics/getXid.c \
+ intrinsics/hyper.c \
  intrinsics/hostnm.c \
  intrinsics/kill.c \
  intrinsics/ierrno.c \
Index: config.h.in
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/config.h.in,v
retrieving revision 1.20
diff -c -3 -p -r1.20 config.h.in
*** config.h.in	15 Jun 2005 08:40:31 -0000	1.20
--- config.h.in	21 Jun 2005 01:06:58 -0000
***************
*** 6,20 ****
--- 6,29 ----
  /* libm includes acosf */
  #undef HAVE_ACOSF
  
+ /* libm includes acoshf */
+ #undef HAVE_ACOSHF
+ 
  /* libm includes asinf */
  #undef HAVE_ASINF
  
+ /* libm includes asinhf */
+ #undef HAVE_ASINHF
+ 
  /* libm includes atan2f */
  #undef HAVE_ATAN2F
  
  /* libm includes atanf */
  #undef HAVE_ATANF
  
+ /* libm includes atanhf */
+ #undef HAVE_ATANHF
+ 
  /* Define to 1 if the target supports __attribute__((alias(...))). */
  #undef HAVE_ATTRIBUTE_ALIAS
  
Index: configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/configure.ac,v
retrieving revision 1.28
diff -c -3 -p -r1.28 configure.ac
*** configure.ac	15 Jun 2005 08:40:33 -0000	1.28
--- configure.ac	21 Jun 2005 01:06:58 -0000
*************** AC_CHECK_LIB([c],[getuid],[AC_DEFINE([HA
*** 181,189 ****
--- 181,192 ----
  # Check for C99 (and other IEEE) math functions
  # ??? This list seems awful long. Is there a better way to test for these?
  AC_CHECK_LIB([m],[acosf],[AC_DEFINE([HAVE_ACOSF],[1],[libm includes acosf])])
+ AC_CHECK_LIB([m],[acoshf],[AC_DEFINE([HAVE_ACOSHF],[1],[libm includes acoshf])])
  AC_CHECK_LIB([m],[asinf],[AC_DEFINE([HAVE_ASINF],[1],[libm includes asinf])])
+ AC_CHECK_LIB([m],[asinhf],[AC_DEFINE([HAVE_ASINHF],[1],[libm includes asinhf])])
  AC_CHECK_LIB([m],[atan2f],[AC_DEFINE([HAVE_ATAN2F],[1],[libm includes atan2f])])
  AC_CHECK_LIB([m],[atanf],[AC_DEFINE([HAVE_ATANF],[1],[libm includes atanf])])
+ AC_CHECK_LIB([m],[atanhf],[AC_DEFINE([HAVE_ATANHF],[1],[libm includes atanhf])])
  AC_CHECK_LIB([m],[ceilf],[AC_DEFINE([HAVE_CEILF],[1],[libm includes ceilf])])
  AC_CHECK_LIB([m],[copysignf],[AC_DEFINE([HAVE_COPYSIGNF],[1],[libm includes copysignf])])
  AC_CHECK_LIB([m],[cosf],[AC_DEFINE([HAVE_COSF],[1],[libm includes cosf])])
Index: c99_protos.h
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/c99_protos.h,v
retrieving revision 1.4
diff -c -3 -p -r1.4 c99_protos.h
*** c99_protos.h	15 Jun 2005 08:40:31 -0000	1.4
--- c99_protos.h	21 Jun 2005 01:06:58 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 33,42 ****
--- 33,50 ----
  extern float acosf(float);
  #endif
  
+ #ifndef HAVE_ACOSHF
+ extern float acoshf(float);
+ #endif
+ 
  #ifndef HAVE_ASINF
  extern float asinf(float);
  #endif
  
+ #ifndef HAVE_ASINHF
+ extern float asinhf(float);
+ #endif
+ 
  #ifndef HAVE_ATAN2F
  extern float atan2f(float, float);
  #endif
*************** extern float atan2f(float, float);
*** 45,50 ****
--- 53,62 ----
  extern float atanf(float);
  #endif
  
+ #ifndef HAVE_ATANHF
+ extern float atanhf(float);
+ #endif
+ 
  #ifndef HAVE_CEILF
  extern float ceilf(float);
  #endif


More information about the Fortran mailing list