This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch for gamma, bessel and error function math builtins
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: roger at eyesopen dot com
- Date: Wed, 6 Aug 2003 00:40:50 -0400 (EDT)
- Subject: Patch for gamma, bessel and error function math builtins
Here's a few more math builtins for gamma, bessel and error functions.
(And I did significand.) This builtins patch requires the previous
one I posted here:
http://gcc.gnu.org/ml/gcc-patches/2003-08/msg00309.html
Bootstrapped on sparc-sun-solaris2.7 (minus java) no regressions and
the testcase additions all pass.
Ok for mainline?
Thanks,
--Kaveh
2003-08-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* builtin-types.def (BT_FN_FLOAT_INT_FLOAT,
BT_FN_DOUBLE_INT_DOUBLE, BT_FN_LONGDOUBLE_INT_LONGDOUBLE): New.
* builtins.def (BUILT_IN_ERF, BUILT_IN_ERFC, BUILT_IN_ERFCF,
BUILT_IN_ERFCL, BUILT_IN_ERFF, BUILT_IN_ERFL, BUILT_IN_GAMMA,
BUILT_IN_GAMMAF, BUILT_IN_GAMMAL, BUILT_IN_J0, BUILT_IN_J0F,
BUILT_IN_J0L, BUILT_IN_J1, BUILT_IN_J1F, BUILT_IN_J1L,
BUILT_IN_JN, BUILT_IN_JNF, BUILT_IN_JNL, BUILT_IN_LGAMMA,
BUILT_IN_LGAMMAF, BUILT_IN_LGAMMAL, BUILT_IN_SIGNIFICAND,
BUILT_IN_SIGNIFICANDF, BUILT_IN_SIGNIFICANDL, BUILT_IN_TGAMMA,
BUILT_IN_TGAMMAF, BUILT_IN_TGAMMAL, BUILT_IN_Y0, BUILT_IN_Y0F,
BUILT_IN_Y0L, BUILT_IN_Y1, BUILT_IN_Y1F, BUILT_IN_Y1L,
BUILT_IN_YN, BUILT_IN_YNF, BUILT_IN_YNL): New.
* doc/extend.texi: Document new builtins.
testsuite:
* gcc.dg/builtins-1.c: Add new cases.
* gcc.dg/torture/builtin-attr-1.c: Likewise.
diff -rup orig/egcc-CVS20030804/gcc/builtin-types.def egcc-CVS20030804/gcc/builtin-types.def
--- orig/egcc-CVS20030804/gcc/builtin-types.def 2003-08-05 18:03:24.997709000 -0400
+++ egcc-CVS20030804/gcc/builtin-types.def 2003-08-05 18:21:53.395521000 -0400
@@ -180,6 +180,12 @@ DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_DOUBLE
BT_DOUBLE, BT_DOUBLE, BT_INT)
DEF_FUNCTION_TYPE_2 (BT_FN_LONGDOUBLE_LONGDOUBLE_INT,
BT_LONGDOUBLE, BT_LONGDOUBLE, BT_INT)
+DEF_FUNCTION_TYPE_2 (BT_FN_FLOAT_INT_FLOAT,
+ BT_FLOAT, BT_INT, BT_FLOAT)
+DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_INT_DOUBLE,
+ BT_DOUBLE, BT_INT, BT_DOUBLE)
+DEF_FUNCTION_TYPE_2 (BT_FN_LONGDOUBLE_INT_LONGDOUBLE,
+ BT_LONGDOUBLE, BT_INT, BT_LONGDOUBLE)
DEF_FUNCTION_TYPE_2 (BT_FN_FLOAT_FLOAT_LONG,
BT_FLOAT, BT_FLOAT, BT_LONG)
DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_DOUBLE_LONG,
diff -rup orig/egcc-CVS20030804/gcc/builtins.def egcc-CVS20030804/gcc/builtins.def
--- orig/egcc-CVS20030804/gcc/builtins.def 2003-08-05 18:03:25.007707000 -0400
+++ egcc-CVS20030804/gcc/builtins.def 2003-08-05 18:27:13.166979000 -0400
@@ -182,6 +182,12 @@ DEF_C99_BUILTIN (BUILT_IN_CREALL,
DEF_EXT_LIB_BUILTIN (BUILT_IN_DREM, "drem", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_EXT_LIB_BUILTIN (BUILT_IN_DREMF, "dremf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_EXT_LIB_BUILTIN (BUILT_IN_DREML, "dreml", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ERF, "erf", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ERFC, "erfc", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ERFCF, "erfcf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ERFCL, "erfcl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ERFF, "erff", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_ERFL, "erfl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_LIB_BUILTIN (BUILT_IN_EXP, "exp", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_EXT_LIB_BUILTIN (BUILT_IN_EXP10, "exp10", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_EXT_LIB_BUILTIN (BUILT_IN_EXP10F, "exp10f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
@@ -215,6 +221,9 @@ DEF_C99_BUILTIN (BUILT_IN_FMINL,
DEF_LIB_BUILTIN (BUILT_IN_FMOD, "fmod", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_C90RES_BUILTIN (BUILT_IN_FMODF, "fmodf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_C90RES_BUILTIN (BUILT_IN_FMODL, "fmodl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMA, "gamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAF, "gammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAL, "gammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_GCC_BUILTIN (BUILT_IN_HUGE_VAL, "huge_val", BT_FN_DOUBLE, ATTR_CONST_NOTHROW_LIST)
DEF_GCC_BUILTIN (BUILT_IN_HUGE_VALF, "huge_valf", BT_FN_FLOAT, ATTR_CONST_NOTHROW_LIST)
DEF_GCC_BUILTIN (BUILT_IN_HUGE_VALL, "huge_vall", BT_FN_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
@@ -227,9 +236,21 @@ DEF_C99_BUILTIN (BUILT_IN_ILOGBL,
DEF_GCC_BUILTIN (BUILT_IN_INF, "inf", BT_FN_DOUBLE, ATTR_CONST_NOTHROW_LIST)
DEF_GCC_BUILTIN (BUILT_IN_INFF, "inff", BT_FN_FLOAT, ATTR_CONST_NOTHROW_LIST)
DEF_GCC_BUILTIN (BUILT_IN_INFL, "infl", BT_FN_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_J0, "j0", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_J0F, "j0f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_J0L, "j0l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_J1, "j1", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_J1F, "j1f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_J1L, "j1l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_JN, "jn", BT_FN_DOUBLE_INT_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_JNF, "jnf", BT_FN_FLOAT_INT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_JNL, "jnl", BT_FN_LONGDOUBLE_INT_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_LIB_BUILTIN (BUILT_IN_LDEXP, "ldexp", BT_FN_DOUBLE_DOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_C90RES_BUILTIN (BUILT_IN_LDEXPF, "ldexpf", BT_FN_FLOAT_FLOAT_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_C90RES_BUILTIN (BUILT_IN_LDEXPL, "ldexpl", BT_FN_LONGDOUBLE_LONGDOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LGAMMA, "lgamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LGAMMAF, "lgammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_LGAMMAL, "lgammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_LLRINT, "llrint", BT_FN_LONGLONG_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_LLRINTF, "llrintf", BT_FN_LONGLONG_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_LLRINTL, "llrintl", BT_FN_LONGLONG_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
@@ -296,6 +317,9 @@ DEF_C99_BUILTIN (BUILT_IN_SCALBLN
DEF_C99_BUILTIN (BUILT_IN_SCALBN, "scalbn", BT_FN_DOUBLE_DOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_SCALBNF, "scalbnf", BT_FN_FLOAT_FLOAT_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_SCALBNL, "scalbnl", BT_FN_LONGDOUBLE_LONGDOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICAND, "significand", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICANDF, "significandf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICANDL, "significandl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_LIB_BUILTIN (BUILT_IN_SIN, "sin", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
DEF_C99_C90RES_BUILTIN (BUILT_IN_SINF, "sinf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
DEF_LIB_BUILTIN (BUILT_IN_SINH, "sinh", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
@@ -311,9 +335,21 @@ DEF_LIB_BUILTIN (BUILT_IN_TANH, "
DEF_C99_C90RES_BUILTIN (BUILT_IN_TANHF, "tanhf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
DEF_C99_C90RES_BUILTIN (BUILT_IN_TANHL, "tanhl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
DEF_C99_C90RES_BUILTIN (BUILT_IN_TANL, "tanl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+DEF_C99_BUILTIN (BUILT_IN_TGAMMA, "tgamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_TGAMMAF, "tgammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_C99_BUILTIN (BUILT_IN_TGAMMAL, "tgammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
DEF_C99_BUILTIN (BUILT_IN_TRUNC, "trunc", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
DEF_C99_BUILTIN (BUILT_IN_TRUNCF, "truncf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
DEF_C99_BUILTIN (BUILT_IN_TRUNCL, "truncl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_Y0, "y0", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_Y0F, "y0f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_Y0L, "y0l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_Y1, "y1", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_Y1F, "y1f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_Y1L, "y1l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_YN, "yn", BT_FN_DOUBLE_INT_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_YNF, "ynf", BT_FN_FLOAT_INT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_YNL, "ynl", BT_FN_LONGDOUBLE_INT_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
/* Category: string/memory builtins. */
/* bcmp, bcopy and bzero have traditionally accepted NULL pointers
diff -rup orig/egcc-CVS20030804/gcc/doc/extend.texi egcc-CVS20030804/gcc/doc/extend.texi
--- orig/egcc-CVS20030804/gcc/doc/extend.texi 2003-08-05 18:03:25.047725000 -0400
+++ egcc-CVS20030804/gcc/doc/extend.texi 2003-08-05 18:31:22.326765000 -0400
@@ -4776,6 +4776,12 @@ v4si f (v4si a, v4si b, v4si c)
@findex drem
@findex dremf
@findex dreml
+@findex erf
+@findex erfc
+@findex erfcf
+@findex erfcl
+@findex erff
+@findex erfl
@findex exit
@findex exp
@findex exp10
@@ -4816,6 +4822,9 @@ v4si f (v4si a, v4si b, v4si c)
@findex fputs
@findex fputs_unlocked
@findex fscanf
+@findex gamma
+@findex gammaf
+@findex gammal
@findex gettext
@findex hypot
@findex hypotf
@@ -4825,10 +4834,22 @@ v4si f (v4si a, v4si b, v4si c)
@findex ilogbl
@findex imaxabs
@findex index
+@findex j0
+@findex j0f
+@findex j0l
+@findex j1
+@findex j1f
+@findex j1l
+@findex jn
+@findex jnf
+@findex jnl
@findex labs
@findex ldexp
@findex ldexpf
@findex ldexpl
+@findex lgamma
+@findex lgammaf
+@findex lgammal
@findex llabs
@findex llrint
@findex llrintf
@@ -4900,6 +4921,9 @@ v4si f (v4si a, v4si b, v4si c)
@findex scalbn
@findex scalbnf
@findex scanfnl
+@findex significand
+@findex significandf
+@findex significandl
@findex sin
@findex sinf
@findex sinh
@@ -4935,6 +4959,9 @@ v4si f (v4si a, v4si b, v4si c)
@findex tanhf
@findex tanhl
@findex tanl
+@findex tgamma
+@findex tgammaf
+@findex tgammal
@findex trunc
@findex truncf
@findex truncl
@@ -4945,6 +4972,15 @@ v4si f (v4si a, v4si b, v4si c)
@findex vsnprintf
@findex vsprintf
@findex vsscanf
+@findex y0
+@findex y0f
+@findex y0l
+@findex y1
+@findex y1f
+@findex y1l
+@findex yn
+@findex ynf
+@findex ynl
GCC provides a large number of built-in functions other than the ones
mentioned above. Some of these are for internal use in the processing
@@ -4971,10 +5007,15 @@ Outside strict ISO C mode (@option{-ansi
@code{dcgettext}, @code{dgettext}, @code{dremf}, @code{dreml},
@code{drem}, @code{exp10f}, @code{exp10l}, @code{exp10}, @code{ffsll},
@code{ffsl}, @code{ffs}, @code{fprintf_unlocked}, @code{fputs_unlocked},
-@code{gettext}, @code{index}, @code{mempcpy}, @code{pow10f},
-@code{pow10l}, @code{pow10}, @code{printf_unlocked}, @code{rindex},
-@code{scalbf}, @code{scalbl}, @code{scalb}, @code{stpcpy},
-@code{strdup} and @code{strfmon}
+@code{gammaf}, @code{gammal}, @code{gamma}, @code{gettext},
+@code{index}, @code{j0f}, @code{j0l}, @code{j0}, @code{j1f}, @code{j1l},
+@code{j1}, @code{jnf}, @code{jnl}, @code{jn}, @code{mempcpy},
+@code{pow10f}, @code{pow10l}, @code{pow10}, @code{printf_unlocked},
+@code{rindex}, @code{scalbf}, @code{scalbl}, @code{scalb},
+@code{significandf}, @code{significandl}, @code{significand},
+@code{stpcpy}, @code{strdup}, @code{strfmon}, @code{y0f}, @code{y0l},
+@code{y0}, @code{y1f}, @code{y1l}, @code{y1}, @code{ynf}, @code{ynl} and
+@code{yn}
may be handled as built-in functions.
All these functions have corresponding versions
prefixed with @code{__builtin_}, which may be used even in strict C89
@@ -4987,25 +5028,28 @@ The ISO C99 functions
@code{cbrt}, @code{cimagf}, @code{cimagl}, @code{cimag}, @code{conjf},
@code{conjl}, @code{conj}, @code{copysignf}, @code{copysignl},
@code{copysign}, @code{crealf}, @code{creall}, @code{creal},
-@code{exp2f}, @code{exp2l}, @code{exp2}, @code{expm1f}, @code{expm1l},
-@code{expm1}, @code{fdimf}, @code{fdiml}, @code{fdim}, @code{fmaf},
-@code{fmal}, @code{fmaxf}, @code{fmaxl}, @code{fmax}, @code{fma},
-@code{fminf}, @code{fminl}, @code{fmin}, @code{hypotf}, @code{hypotl},
-@code{hypot}, @code{ilogbf}, @code{ilogbl}, @code{ilogb},
-@code{imaxabs}, @code{llabs}, @code{llrintf}, @code{llrintl},
-@code{llrint}, @code{llroundf}, @code{llroundl}, @code{llround},
-@code{log1pf}, @code{log1pl}, @code{log1p}, @code{log2f}, @code{log2l},
-@code{log2}, @code{logbf}, @code{logbl}, @code{logb}, @code{lrintf},
-@code{lrintl}, @code{lrint}, @code{lroundf}, @code{lroundl},
-@code{lround}, @code{nearbyintf}, @code{nearbyintl}, @code{nearbyint},
+@code{erfcf}, @code{erfcl}, @code{erfc}, @code{erff}, @code{erfl},
+@code{erf}, @code{exp2f}, @code{exp2l}, @code{exp2}, @code{expm1f},
+@code{expm1l}, @code{expm1}, @code{fdimf}, @code{fdiml}, @code{fdim},
+@code{fmaf}, @code{fmal}, @code{fmaxf}, @code{fmaxl}, @code{fmax},
+@code{fma}, @code{fminf}, @code{fminl}, @code{fmin}, @code{hypotf},
+@code{hypotl}, @code{hypot}, @code{ilogbf}, @code{ilogbl}, @code{ilogb},
+@code{imaxabs}, @code{lgammaf}, @code{lgammal}, @code{lgamma},
+@code{llabs}, @code{llrintf}, @code{llrintl}, @code{llrint},
+@code{llroundf}, @code{llroundl}, @code{llround}, @code{log1pf},
+@code{log1pl}, @code{log1p}, @code{log2f}, @code{log2l}, @code{log2},
+@code{logbf}, @code{logbl}, @code{logb}, @code{lrintf}, @code{lrintl},
+@code{lrint}, @code{lroundf}, @code{lroundl}, @code{lround},
+@code{nearbyintf}, @code{nearbyintl}, @code{nearbyint},
@code{nextafterf}, @code{nextafterl}, @code{nextafter},
@code{nexttowardf}, @code{nexttowardl}, @code{nexttoward},
@code{remainderf}, @code{remainderl}, @code{remainder}, @code{rintf},
@code{rintl}, @code{rint}, @code{roundf}, @code{roundl}, @code{round},
@code{scalblnf}, @code{scalblnl}, @code{scalbln}, @code{scalbnf},
-@code{scalbnl}, @code{scalbn}, @code{snprintf}, @code{truncf},
-@code{truncl}, @code{trunc}, @code{vfscanf}, @code{vscanf},
-@code{vsnprintf} and @code{vsscanf},
+@code{scalbnl}, @code{scalbn}, @code{snprintf}, @code{tgammaf},
+@code{tgammal}, @code{tgamma}, @code{truncf}, @code{truncl},
+@code{trunc}, @code{vfscanf}, @code{vscanf}, @code{vsnprintf} and
+@code{vsscanf},
are handled as built-in functions
except in strict ISO C90 mode (@option{-ansi} or @option{-std=c89}).
diff -rup orig/egcc-CVS20030804/gcc/testsuite/gcc.dg/builtins-1.c egcc-CVS20030804/gcc/testsuite/gcc.dg/builtins-1.c
--- orig/egcc-CVS20030804/gcc/testsuite/gcc.dg/builtins-1.c 2003-08-05 18:03:25.087685000 -0400
+++ egcc-CVS20030804/gcc/testsuite/gcc.dg/builtins-1.c 2003-08-05 18:53:04.802250000 -0400
@@ -30,9 +30,16 @@ double test_##FN(TYPE x) { return __buil
float test_##FN##f(TYPE x) { return __builtin_##FN##f(x); } \
long double test_##FN##l(TYPE x) { return __builtin_##FN##l(x); }
+/* Test FP functions taking two arguments, the first argument is of a
+ supplied type. */
+#define FPTEST2ARG1(FN, TYPE) \
+double test_##FN(TYPE x, double y) { return __builtin_##FN(x, y); } \
+float test_##FN##f(TYPE x, float y) { return __builtin_##FN##f(x, y); } \
+long double test_##FN##l(TYPE x, long double y) { return __builtin_##FN##l(x, y); }
+
/* Test FP functions taking two arguments, the second argument is of a
supplied type. */
-#define FPTEST2ARG(FN, TYPE) \
+#define FPTEST2ARG2(FN, TYPE) \
double test_##FN(double x, TYPE y) { return __builtin_##FN(x, y); } \
float test_##FN##f(float x, TYPE y) { return __builtin_##FN##f(x, y); } \
long double test_##FN##l(long double x, TYPE y) { return __builtin_##FN##l(x, y); }
@@ -70,6 +77,8 @@ FPTEST2 (copysign)
FPTEST1 (cos)
FPTEST1 (cosh)
FPTEST2 (drem)
+FPTEST1 (erf)
+FPTEST1 (erfc)
FPTEST1 (exp)
FPTEST1 (exp10)
FPTEST1 (exp2)
@@ -81,11 +90,16 @@ FPTEST3 (fma)
FPTEST2 (fmax)
FPTEST2 (fmin)
FPTEST2 (fmod)
+FPTEST1 (gamma)
FPTEST0 (huge_val)
FPTEST2 (hypot)
FPTEST1 (ilogb)
FPTEST0 (inf)
-FPTEST2ARG (ldexp, int)
+FPTEST1 (j0)
+FPTEST1 (j1)
+FPTEST2ARG1 (jn, int)
+FPTEST2ARG2 (ldexp, int)
+FPTEST1 (lgamma)
FPTEST1RET (llrint, long long)
FPTEST1RET (llround, long long)
FPTEST1 (log)
@@ -106,11 +120,16 @@ FPTEST2 (remainder)
FPTEST1 (rint)
FPTEST1 (round)
FPTEST2 (scalb)
-FPTEST2ARG (scalbln, int)
-FPTEST2ARG (scalbn, int)
+FPTEST2ARG2 (scalbln, int)
+FPTEST2ARG2 (scalbn, int)
+FPTEST1 (significand)
FPTEST1 (sin)
FPTEST1 (sinh)
FPTEST1 (sqrt)
FPTEST1 (tan)
FPTEST1 (tanh)
+FPTEST1 (tgamma)
FPTEST1 (trunc)
+FPTEST1 (y0)
+FPTEST1 (y1)
+FPTEST2ARG1 (yn, int)
diff -rup orig/egcc-CVS20030804/gcc/testsuite/gcc.dg/torture/builtin-attr-1.c egcc-CVS20030804/gcc/testsuite/gcc.dg/torture/builtin-attr-1.c
--- orig/egcc-CVS20030804/gcc/testsuite/gcc.dg/torture/builtin-attr-1.c 2003-08-05 18:03:25.087695000 -0400
+++ egcc-CVS20030804/gcc/testsuite/gcc.dg/torture/builtin-attr-1.c 2003-08-05 18:58:09.278135000 -0400
@@ -83,9 +83,24 @@ void test_builtin_##FN##f(float f1, floa
void test_builtin_##FN##l(long double ld1, long double ld2) \
{ if (__builtin_##FN##l(ld1,ld2) != __builtin_##FN##l(ld1,ld2)) link_failure_builtin_##FN##l(); }
-/* Test the __builtin_ functions taking two arguments, one FP and one
- supplied type (with the "f" and "l" variants). */
-#define BUILTIN_FPTEST2ARG(FN, TYPE) \
+/* Test the __builtin_ functions taking two arguments, the first one
+ is of a supplied type and the second one one is of FP type (with
+ the "f" and "l" variants). */
+#define BUILTIN_FPTEST2ARG1(FN, TYPE) \
+extern void link_failure_builtin_##FN(void); \
+extern void link_failure_builtin_##FN##f(void); \
+extern void link_failure_builtin_##FN##l(void); \
+void test_builtin_##FN(TYPE x, double d) \
+{ if (__builtin_##FN(x,d) != __builtin_##FN(x,d)) link_failure_builtin_##FN(); } \
+void test_builtin_##FN##f(TYPE x, float f) \
+{ if (__builtin_##FN##f(x,f) != __builtin_##FN##f(x,f)) link_failure_builtin_##FN##f(); } \
+void test_builtin_##FN##l(TYPE x, long double ld) \
+{ if (__builtin_##FN##l(x,ld) != __builtin_##FN##l(x,ld)) link_failure_builtin_##FN##l(); }
+
+/* Test the __builtin_ functions taking two arguments, the first one
+ is of FP type and the second one one is of a supplied type (with
+ the "f" and "l" variants). */
+#define BUILTIN_FPTEST2ARG2(FN, TYPE) \
extern void link_failure_builtin_##FN(void); \
extern void link_failure_builtin_##FN##f(void); \
extern void link_failure_builtin_##FN##l(void); \
@@ -139,10 +154,26 @@ void test_##FN##f(float f1, float f2) \
void test_##FN##l(long double ld1, long double ld2) \
{ if (FN##l(ld1,ld2) != FN##l(ld1,ld2)) link_failure_##FN##l(); }
-/* Test the functions taking two arguments, one FP and one of supplied
- type (with the "f" and "l" variants). */
-#define FPTEST2ARG(FN, TYPE) \
-BUILTIN_FPTEST2ARG(FN, TYPE) \
+/* Test the functions taking two arguments, the first one is of a
+ supplied type and the second one one is of FP type (with the "f"
+ and "l" variants). */
+#define FPTEST2ARG1(FN, TYPE) \
+BUILTIN_FPTEST2ARG1(FN, TYPE) \
+extern void link_failure_##FN(void); \
+extern void link_failure_##FN##f(void); \
+extern void link_failure_##FN##l(void); \
+void test_##FN(TYPE x, double d) \
+{ if (FN(x,d) != FN(x,d)) link_failure_##FN(); } \
+void test_##FN##f(TYPE x, float f) \
+{ if (FN##f(x,f) != FN##f(x,f)) link_failure_##FN##f(); } \
+void test_##FN##l(TYPE x, long double ld) \
+{ if (FN##l(x,ld) != FN##l(x,ld)) link_failure_##FN##l(); }
+
+/* Test the functions taking two arguments, the first one is of FP
+ type and the second one one is of a supplied type (with the "f" and
+ "l" variants). */
+#define FPTEST2ARG2(FN, TYPE) \
+BUILTIN_FPTEST2ARG2(FN, TYPE) \
extern void link_failure_##FN(void); \
extern void link_failure_##FN##f(void); \
extern void link_failure_##FN##l(void); \
@@ -182,6 +213,8 @@ FPTEST2 (copysign)
FPTEST1 (cos)
FPTEST1 (cosh)
FPTEST2 (drem)
+FPTEST1 (erf)
+FPTEST1 (erfc)
FPTEST1 (exp)
FPTEST1 (exp10)
FPTEST1 (exp2)
@@ -193,11 +226,16 @@ FPTEST3 (fma)
FPTEST2 (fmax)
FPTEST2 (fmin)
FPTEST2 (fmod)
+FPTEST1 (gamma)
BUILTIN_FPTEST0 (huge_val)
FPTEST2 (hypot)
FPTEST1 (ilogb)
BUILTIN_FPTEST0 (inf)
-FPTEST2ARG (ldexp, int)
+FPTEST1 (j0)
+FPTEST1 (j1)
+FPTEST2ARG1 (jn, int)
+FPTEST2ARG2 (ldexp, int)
+FPTEST1 (lgamma)
FPTEST1 (llrint)
FPTEST1 (llround)
FPTEST1 (log)
@@ -218,14 +256,19 @@ FPTEST2 (remainder)
FPTEST1 (rint)
FPTEST1 (round)
FPTEST2 (scalb)
-FPTEST2ARG (scalbln, int)
-FPTEST2ARG (scalbn, int)
+FPTEST2ARG2 (scalbln, int)
+FPTEST2ARG2 (scalbn, int)
+FPTEST1 (significand)
FPTEST1 (sin)
FPTEST1 (sinh)
FPTEST1 (sqrt)
FPTEST1 (tan)
FPTEST1 (tanh)
+FPTEST1 (tgamma)
FPTEST1 (trunc)
+FPTEST1 (y0)
+FPTEST1 (y1)
+FPTEST2ARG1 (yn, int)
/* Various other const builtins. */
TEST1 (abs, int)