aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2003-08-28 19:41:16 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2003-08-28 19:41:16 +0000
commit98ff7c4dc1a08e4990a20268adaf934c805af6f9 (patch)
tree6ed737b2b94c4bea8b505ad8d68bea8c93ce1ecf /gcc/doc
parent0239631aa0ee0eaa607626fc5fe80c4c8081cad4 (diff)
downloadgcc-98ff7c4dc1a08e4990a20268adaf934c805af6f9.zip
gcc-98ff7c4dc1a08e4990a20268adaf934c805af6f9.tar.gz
gcc-98ff7c4dc1a08e4990a20268adaf934c805af6f9.tar.bz2
builtin-types.def (BT_FN_INT_FLOAT, [...]): New.
* builtin-types.def (BT_FN_INT_FLOAT, BT_FN_INT_DOUBLE, BT_FN_INT_LONGDOUBLE, BT_FN_LONG_FLOAT, BT_FN_LONG_DOUBLE, BT_FN_LONG_LONGDOUBLE, BT_FN_LONGLONG_FLOAT, BT_FN_LONGLONG_DOUBLE, BT_FN_LONGLONG_LONGDOUBLE, BT_FN_FLOAT_FLOAT_LONGDOUBLE, BT_FN_DOUBLE_DOUBLE_LONGDOUBLE, BT_FN_FLOAT_FLOAT_INT, BT_FN_DOUBLE_DOUBLE_INT, BT_FN_LONGDOUBLE_LONGDOUBLE_INT, BT_FN_FLOAT_FLOAT_LONG, BT_FN_DOUBLE_DOUBLE_LONG, BT_FN_LONGDOUBLE_LONGDOUBLE_LONG, BT_FN_FLOAT_FLOAT_FLOAT_FLOAT, BT_FN_DOUBLE_DOUBLE_DOUBLE_DOUBLE, BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE): New. * builtins.def (BUILT_IN_ACOS, BUILT_IN_ACOSF, BUILT_IN_ACOSH, BUILT_IN_ACOSHF, BUILT_IN_ACOSHL, BUILT_IN_ACOSL, BUILT_IN_ASIN, BUILT_IN_ASINF, BUILT_IN_ASINH, BUILT_IN_ASINHF, BUILT_IN_ASINHL, BUILT_IN_ASINL, BUILT_IN_ATANH, BUILT_IN_ATANHF, BUILT_IN_ATANHL, BUILT_IN_CBRT, BUILT_IN_CBRTF, BUILT_IN_CBRTL, BUILT_IN_COPYSIGN, BUILT_IN_COPYSIGNF, BUILT_IN_COPYSIGNL, BUILT_IN_COSH, BUILT_IN_COSHF, BUILT_IN_COSHL, BUILT_IN_DREM, BUILT_IN_DREMF, BUILT_IN_DREML, BUILT_IN_EXP10, BUILT_IN_EXP10F, BUILT_IN_EXP10L, BUILT_IN_EXP2, BUILT_IN_EXP2F, BUILT_IN_EXP2L, BUILT_IN_EXPM1, BUILT_IN_EXPM1F, BUILT_IN_EXPM1L, BUILT_IN_FDIM, BUILT_IN_FDIMF, BUILT_IN_FDIML, BUILT_IN_FMA, BUILT_IN_FMAF, BUILT_IN_FMAL, BUILT_IN_FMAX, BUILT_IN_FMAXF, BUILT_IN_FMAXL, BUILT_IN_FMIN, BUILT_IN_FMINF, BUILT_IN_FMINL, BUILT_IN_HYPOT, BUILT_IN_HYPOTF, BUILT_IN_HYPOTL, BUILT_IN_ILOGB, BUILT_IN_ILOGBF, BUILT_IN_ILOGBL, BUILT_IN_LDEXP, BUILT_IN_LDEXPF, BUILT_IN_LDEXPL, BUILT_IN_LLRINT, BUILT_IN_LLRINTF, BUILT_IN_LLRINTL, BUILT_IN_LLROUND, BUILT_IN_LLROUNDF, BUILT_IN_LLROUNDL, BUILT_IN_LOG10, BUILT_IN_LOG10F, BUILT_IN_LOG10L, BUILT_IN_LOG1P, BUILT_IN_LOG1PF, BUILT_IN_LOG1PL, BUILT_IN_LOG2, BUILT_IN_LOG2F, BUILT_IN_LOG2L, BUILT_IN_LOGB, BUILT_IN_LOGBF, BUILT_IN_LOGBL, BUILT_IN_LRINT, BUILT_IN_LRINTF, BUILT_IN_LRINTL, BUILT_IN_LROUND, BUILT_IN_LROUNDF, BUILT_IN_LROUNDL, BUILT_IN_NEXTAFTER, BUILT_IN_NEXTAFTERF, BUILT_IN_NEXTAFTERL, BUILT_IN_NEXTTOWARD, BUILT_IN_NEXTTOWARDF, BUILT_IN_NEXTTOWARDL, BUILT_IN_POW10, BUILT_IN_POW10F, BUILT_IN_POW10L, BUILT_IN_REMAINDER, BUILT_IN_REMAINDERF, BUILT_IN_REMAINDERL, BUILT_IN_RINT, BUILT_IN_RINTF, BUILT_IN_RINTL, BUILT_IN_SCALB, BUILT_IN_SCALBF, BUILT_IN_SCALBL, BUILT_IN_SCALBLN, BUILT_IN_SCALBLNF, BUILT_IN_SCALBLNL, BUILT_IN_SCALBN, BUILT_IN_SCALBNF, BUILT_IN_SCALBNL, BUILT_IN_SINH, BUILT_IN_SINHF, BUILT_IN_SINHL, BUILT_IN_TANH, BUILT_IN_TANHF, BUILT_IN_TANHL): New. * doc/extend.texi: Document new builtins. testsuite: * gcc.dg/builtins-1.c: Add more math builtin tests. * gcc.dg/torture/builtin-attr-1.c: New test. From-SVN: r70886
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi205
1 files changed, 168 insertions, 37 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index f9ac87e..d11774c 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -4725,14 +4725,31 @@ v4si f (v4si a, v4si b, v4si c)
@findex __builtin_islessequal
@findex __builtin_islessgreater
@findex __builtin_isunordered
+@findex _Exit
+@findex _exit
@findex abort
@findex abs
+@findex acos
+@findex acosf
+@findex acosh
+@findex acoshf
+@findex acoshl
+@findex acosl
@findex alloca
+@findex asin
+@findex asinf
+@findex asinh
+@findex asinhf
+@findex asinhl
+@findex asinl
@findex atan
@findex atan2
@findex atan2f
@findex atan2l
@findex atanf
+@findex atanh
+@findex atanhf
+@findex atanhl
@findex atanl
@findex bcmp
@findex bzero
@@ -4740,6 +4757,9 @@ v4si f (v4si a, v4si b, v4si c)
@findex cabsf
@findex cabsl
@findex calloc
+@findex cbrt
+@findex cbrtf
+@findex cbrtl
@findex ceil
@findex ceilf
@findex ceill
@@ -4749,27 +4769,55 @@ v4si f (v4si a, v4si b, v4si c)
@findex conj
@findex conjf
@findex conjl
+@findex copysign
+@findex copysignf
+@findex copysignl
@findex cos
@findex cosf
+@findex cosh
+@findex coshf
+@findex coshl
@findex cosl
@findex creal
@findex crealf
@findex creall
@findex dcgettext
@findex dgettext
+@findex drem
+@findex dremf
+@findex dreml
@findex exit
-@findex _exit
-@findex _Exit
@findex exp
+@findex exp10
+@findex exp10f
+@findex exp10l
+@findex exp2
+@findex exp2f
+@findex exp2l
@findex expf
@findex expl
+@findex expm1
+@findex expm1f
+@findex expm1l
@findex fabs
@findex fabsf
@findex fabsl
+@findex fdim
+@findex fdimf
+@findex fdiml
@findex ffs
@findex floor
@findex floorf
@findex floorl
+@findex fma
+@findex fmaf
+@findex fmal
+@findex fmax
+@findex fmaxf
+@findex fmaxl
+@findex fmin
+@findex fminf
+@findex fminl
@findex fmod
@findex fmodf
@findex fmodl
@@ -4779,13 +4827,46 @@ v4si f (v4si a, v4si b, v4si c)
@findex fputs_unlocked
@findex fscanf
@findex gettext
+@findex hypot
+@findex hypotf
+@findex hypotl
+@findex ilogb
+@findex ilogbf
+@findex ilogbl
@findex imaxabs
@findex index
@findex labs
+@findex ldexp
+@findex ldexpf
+@findex ldexpl
@findex llabs
+@findex llrint
+@findex llrintf
+@findex llrintl
+@findex llround
+@findex llroundf
+@findex llroundl
@findex log
+@findex log10
+@findex log10f
+@findex log10l
+@findex log1p
+@findex log1pf
+@findex log1pl
+@findex log2
+@findex log2f
+@findex log2l
+@findex logb
+@findex logbf
+@findex logbl
@findex logf
@findex logl
+@findex lrint
+@findex lrintf
+@findex lrintl
+@findex lround
+@findex lroundf
+@findex lroundl
@findex malloc
@findex memcmp
@findex memcpy
@@ -4794,20 +4875,46 @@ v4si f (v4si a, v4si b, v4si c)
@findex nearbyint
@findex nearbyintf
@findex nearbyintl
+@findex nextafter
+@findex nextafterf
+@findex nextafterl
+@findex nexttoward
+@findex nexttowardf
+@findex nexttowardl
@findex pow
+@findex pow10
+@findex pow10f
+@findex pow10l
@findex powf
@findex powl
@findex printf
@findex printf_unlocked
@findex putchar
@findex puts
+@findex remainder
+@findex remainderf
+@findex remainderl
@findex rindex
+@findex rint
+@findex rintf
+@findex rintl
@findex round
@findex roundf
@findex roundl
-@findex scanf
+@findex scalb
+@findex scalbf
+@findex scalbl
+@findex scalbln
+@findex scalblnf
+@findex scalblnf
+@findex scalbn
+@findex scalbnf
+@findex scanfnl
@findex sin
@findex sinf
+@findex sinh
+@findex sinhf
+@findex sinhl
@findex sinl
@findex snprintf
@findex sprintf
@@ -4834,6 +4941,9 @@ v4si f (v4si a, v4si b, v4si c)
@findex strstr
@findex tan
@findex tanf
+@findex tanh
+@findex tanhf
+@findex tanhl
@findex tanl
@findex trunc
@findex truncf
@@ -4866,54 +4976,75 @@ be emitted.
@opindex ansi
@opindex std
Outside strict ISO C mode (@option{-ansi}, @option{-std=c89} or
-@option{-std=c99}), the functions @code{alloca}, @code{bcmp},
-@code{bzero}, @code{dcgettext}, @code{dgettext}, @code{_exit},
-@code{ffs}, @code{fprintf_unlocked},
-@code{fputs_unlocked}, @code{gettext},
-@code{index}, @code{mempcpy}, @code{printf_unlocked},
-@code{rindex}, @code{stpcpy}, @code{strdup} and @code{strfmon}
+@option{-std=c99}), the functions
+@code{_exit}, @code{alloca}, @code{bcmp}, @code{bzero},
+@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}
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
mode.
The ISO C99 functions
-@code{cabs}, @code{cabsf}, @code{cabsl},
-@code{conj}, @code{conjf}, @code{conjl},
-@code{creal}, @code{crealf}, @code{creall},
-@code{cimag}, @code{cimagf}, @code{cimagl},
-@code{_Exit}, @code{imaxabs}, @code{llabs},
-@code{nearbyint}, @code{nearbyintf}, @code{nearbyintl},
-@code{round}, @code{roundf}, @code{roundl}, @code{snprintf},
-@code{trunc}, @code{truncf}, @code{truncl}, @code{vfscanf},
-@code{vscanf}, @code{vsnprintf} and @code{vsscanf}
+@code{_Exit}, @code{acoshf}, @code{acoshl}, @code{acosh}, @code{asinhf},
+@code{asinhl}, @code{asinh}, @code{atanhf}, @code{atanhl}, @code{atanh},
+@code{cabsf}, @code{cabsl}, @code{cabs}, @code{cbrtf}, @code{cbrtl},
+@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{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},
are handled as built-in functions
except in strict ISO C90 mode (@option{-ansi} or @option{-std=c89}).
-There are also built-in versions of the ISO C99 functions @code{atan2f},
+There are also built-in versions of the ISO C99 functions
+@code{acosf}, @code{acosl}, @code{asinf}, @code{asinl}, @code{atan2f},
@code{atan2l}, @code{atanf}, @code{atanl}, @code{ceilf}, @code{ceill},
-@code{cosf}, @code{cosl},
-@code{expf}, @code{expl}, @code{fabsf}, @code{fabsl}, @code{floorf},
-@code{floorl}, @code{fmodf}, @code{fmodl},
-@code{logf}, @code{logl}, @code{powf}, @code{powl},
-@code{sinf}, @code{sinl}, @code{sqrtf}, @code{sqrtl},
-@code{tanf} and @code{tanl}
+@code{cosf}, @code{coshf}, @code{coshl}, @code{cosl}, @code{expf},
+@code{expl}, @code{fabsf}, @code{fabsl}, @code{floorf}, @code{floorl},
+@code{fmodf}, @code{fmodl}, @code{ldexpf}, @code{ldexpl}, @code{log10f},
+@code{log10l}, @code{logf}, @code{logl}, @code{powf}, @code{powl},
+@code{sinf}, @code{sinhf}, @code{sinhl}, @code{sinl}, @code{sqrtf},
+@code{sqrtl}, @code{tanf}, @code{tanhf}, @code{tanhl} and @code{tanl}
that are recognized in any mode since ISO C90 reserves these names for
the purpose to which ISO C99 puts them. All these functions have
corresponding versions prefixed with @code{__builtin_}.
-The ISO C90 functions @code{abort}, @code{abs}, @code{atan}, @code{atan2},
-@code{calloc}, @code{ceil}, @code{cos}, @code{exit},
-@code{exp}, @code{fabs}, @code{floor}, @code{fmod},
-@code{fprintf}, @code{fputs}, @code{fscanf},
-@code{labs}, @code{log}, @code{malloc},
-@code{memcmp}, @code{memcpy}, @code{memset}, @code{pow}, @code{printf},
-@code{putchar}, @code{puts}, @code{scanf}, @code{sin}, @code{snprintf},
-@code{sprintf}, @code{sqrt}, @code{sscanf},
-@code{strcat}, @code{strchr}, @code{strcmp},
-@code{strcpy}, @code{strcspn}, @code{strlen}, @code{strncat}, @code{strncmp},
-@code{strncpy}, @code{strpbrk}, @code{strrchr}, @code{strspn}, @code{strstr},
-@code{tan}, @code{vfprintf}, @code{vprintf} and @code{vsprintf}
+The ISO C90 functions
+@code{abort}, @code{abs}, @code{acos}, @code{asin}, @code{atan2},
+@code{atan}, @code{calloc}, @code{ceil}, @code{cosh}, @code{cos},
+@code{exit}, @code{exp}, @code{fabs}, @code{floor}, @code{fmod},
+@code{fprintf}, @code{fputs}, @code{fscanf}, @code{labs}, @code{ldexp},
+@code{log10}, @code{log}, @code{malloc}, @code{memcmp}, @code{memcpy},
+@code{memset}, @code{pow}, @code{printf}, @code{putchar}, @code{puts},
+@code{scanf}, @code{sinh}, @code{sin}, @code{snprintf}, @code{sprintf},
+@code{sqrt}, @code{sscanf}, @code{strcat}, @code{strchr}, @code{strcmp},
+@code{strcpy}, @code{strcspn}, @code{strlen}, @code{strncat},
+@code{strncmp}, @code{strncpy}, @code{strpbrk}, @code{strrchr},
+@code{strspn}, @code{strstr}, @code{tanh}, @code{tan}, @code{vfprintf},
+@code{vprintf} and @code{vsprintf},
are all recognized as built-in functions unless
@option{-fno-builtin} is specified (or @option{-fno-builtin-@var{function}}
is specified for an individual function). All of these functions have