This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] middle-end: add reentrant lgamma_r/gamma_r builtins

On 5/6/07, Kaveh R. GHAZI <> wrote:
This patch adds "extension" builtins for the reentrant versions of the
gamma functions, i.e. gamma_r/lgamma_r.  These functions exist on
solaris10 and glibc systems, (and possibly others).  The difference
between these and the regular C99 gamma/lgamma ones is that signgam is
passed in as an int* parameter to the reentrant versions, rather than
being a global variable as it is in the C99 style.

I plan to evaluate these functions at compile-time using MPFR in a follow
up patch, but this bit can be submitted separately.

Patch tested on sparc-sun-solaris2.10, no regressions.

Okay for mainline?

This is ok.




:ADDPATCH middle-end:

2007-05-05 Kaveh R. Ghazi <>

        * builtins.c (CASE_MATHFN_REENT): New macro.
        (mathfn_built_in): Use it.
        * builtins.def (BUILT_IN_GAMMA_R, BUILT_IN_GAMMAF_R,
        BUILT_IN_LGAMMAL_R): New.
        * doc/extend.texi: Document new builtins.

        * gcc.dg/builtins-1.c: Test reentrant gamma functions.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]