From cd2656b0851f5ef4932b99fc5c42161e076a3bc3 Mon Sep 17 00:00:00 2001 From: ghazi Date: Fri, 18 May 2007 01:42:15 +0000 Subject: * builtins.c (CASE_MATHFN_REENT): New macro. (mathfn_built_in): Use it. * builtins.def (BUILT_IN_GAMMA_R, BUILT_IN_GAMMAF_R, BUILT_IN_GAMMAL_R, BUILT_IN_LGAMMA_R, BUILT_IN_LGAMMAF_R, BUILT_IN_LGAMMAL_R): New. * doc/extend.texi: Document new builtins. testsuite: * gcc.dg/builtins-1.c: Test reentrant gamma functions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124821 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/builtins.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/builtins.c') diff --git a/gcc/builtins.c b/gcc/builtins.c index 96c1c032fa0..de62d15b3f4 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -1653,6 +1653,11 @@ expand_builtin_classify_type (tree exp) case BUILT_IN_MATHFN: case BUILT_IN_MATHFN##F: case BUILT_IN_MATHFN##L: \ fcode = BUILT_IN_MATHFN; fcodef = BUILT_IN_MATHFN##F ; \ fcodel = BUILT_IN_MATHFN##L ; break; +/* Similar to above, but appends _R after any F/L suffix. */ +#define CASE_MATHFN_REENT(BUILT_IN_MATHFN) \ + case BUILT_IN_MATHFN##_R: case BUILT_IN_MATHFN##F_R: case BUILT_IN_MATHFN##L_R: \ + fcode = BUILT_IN_MATHFN##_R; fcodef = BUILT_IN_MATHFN##F_R ; \ + fcodel = BUILT_IN_MATHFN##L_R ; break; /* Return mathematic function equivalent to FN but operating directly on TYPE, if available. If we can't do the conversion, return zero. */ @@ -1692,6 +1697,7 @@ mathfn_built_in (tree type, enum built_in_function fn) CASE_MATHFN (BUILT_IN_FMOD) CASE_MATHFN (BUILT_IN_FREXP) CASE_MATHFN (BUILT_IN_GAMMA) + CASE_MATHFN_REENT (BUILT_IN_GAMMA) /* GAMMA_R */ CASE_MATHFN (BUILT_IN_HUGE_VAL) CASE_MATHFN (BUILT_IN_HYPOT) CASE_MATHFN (BUILT_IN_ILOGB) @@ -1704,6 +1710,7 @@ mathfn_built_in (tree type, enum built_in_function fn) CASE_MATHFN (BUILT_IN_LDEXP) CASE_MATHFN (BUILT_IN_LFLOOR) CASE_MATHFN (BUILT_IN_LGAMMA) + CASE_MATHFN_REENT (BUILT_IN_LGAMMA) /* LGAMMA_R */ CASE_MATHFN (BUILT_IN_LLCEIL) CASE_MATHFN (BUILT_IN_LLFLOOR) CASE_MATHFN (BUILT_IN_LLRINT) -- cgit v1.2.1