aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2002-08-03 23:21:31 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2002-08-03 23:21:31 +0000
commite7b489c8c091c2210c01bcd35b9c7cdd2d6b559a (patch)
tree43f230abfa5b65f3cb384df85d588543c32be03e /gcc/doc
parentde8920be70e85d22a890bc99e0c3a20df4089af0 (diff)
downloadgcc-e7b489c8c091c2210c01bcd35b9c7cdd2d6b559a.zip
gcc-e7b489c8c091c2210c01bcd35b9c7cdd2d6b559a.tar.gz
gcc-e7b489c8c091c2210c01bcd35b9c7cdd2d6b559a.tar.bz2
builtins.def: Define new builtin functions exp...
* builtins.def: Define new builtin functions exp, expf, expl, log, logf and logl (and their __builtin_* variants). * optabs.h (enum optab_index): Add new OTI_exp and OTI_log. Define exp_optab and log_optab. * optabs.c (init_optans): Initialize exp_optab and log_optab. * genopinit.c (optabs): Implement exp_optab and log_optab using exp?f2 and log?f2 patterns. * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_EXP* and BUILT_IN_LOG* using exp_optab and log_optab respectively. (expand_builtin): Ignore the new builtins (and all cos and sin variants) when not optimizing. Expand new builtins via expand_builtin_mathfn when flag_unsafe_math_optimizations. * doc/extend.texi: Document new exp and log builtins. * doc/md.texi: Document new exp?f2 and log?f2 patterns (and previously undocumented cos?f2 and sin?f2 patterns). From-SVN: r56010
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi14
-rw-r--r--gcc/doc/md.texi40
2 files changed, 50 insertions, 4 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 70afc3b..4814b35 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -4500,6 +4500,9 @@ v4si f (v4si a, v4si b, v4si c)
@findex exit
@findex _exit
@findex _Exit
+@findex exp
+@findex expf
+@findex expl
@findex fabs
@findex fabsf
@findex fabsl
@@ -4512,6 +4515,9 @@ v4si f (v4si a, v4si b, v4si c)
@findex index
@findex labs
@findex llabs
+@findex log
+@findex logf
+@findex logl
@findex memcmp
@findex memcpy
@findex memset
@@ -4577,13 +4583,15 @@ The ISO C99 functions @code{conj}, @code{conjf}, @code{conjl},
@code{cimagl}, @code{llabs} and @code{imaxabs} are handled as built-in
functions except in strict ISO C90 mode. There are also built-in
versions of the ISO C99 functions @code{cosf}, @code{cosl},
-@code{fabsf}, @code{fabsl}, @code{sinf}, @code{sinl}, @code{sqrtf}, and
+@code{expf}, @code{expl}, @code{fabsf}, @code{fabsl},
+@code{logf}, @code{logl}, @code{sinf}, @code{sinl}, @code{sqrtf}, and
@code{sqrtl}, 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{abs}, @code{cos}, @code{fabs},
-@code{fprintf}, @code{fputs}, @code{labs}, @code{memcmp}, @code{memcpy},
+The ISO C90 functions @code{abs}, @code{cos}, @code{exp}, @code{fabs},
+@code{fprintf}, @code{fputs}, @code{labs}, @code{log},
+@code{memcmp}, @code{memcpy},
@code{memset}, @code{printf}, @code{sin}, @code{sqrt}, @code{strcat},
@code{strchr}, @code{strcmp}, @code{strcpy}, @code{strcspn},
@code{strlen}, @code{strncat}, @code{strncmp}, @code{strncpy},
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index 0935337..ceac9fd 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -2523,7 +2523,45 @@ Store the absolute value of operand 1 into operand 0.
Store the square root of operand 1 into operand 0.
The @code{sqrt} built-in function of C always uses the mode which
-corresponds to the C data type @code{double}.
+corresponds to the C data type @code{double} and the @code{sqrtf}
+built-in function uses the mode which corresponds to the C data
+type @code{float}.
+
+@cindex @code{cos@var{m}2} instruction pattern
+@item @samp{cos@var{m}2}
+Store the cosine of operand 1 into operand 0.
+
+The @code{cos} built-in function of C always uses the mode which
+corresponds to the C data type @code{double} and the @code{cosf}
+built-in function uses the mode which corresponds to the C data
+type @code{float}.
+
+@cindex @code{sin@var{m}2} instruction pattern
+@item @samp{sin@var{m}2}
+Store the sine of operand 1 into operand 0.
+
+The @code{sin} built-in function of C always uses the mode which
+corresponds to the C data type @code{double} and the @code{sinf}
+built-in function uses the mode which corresponds to the C data
+type @code{float}.
+
+@cindex @code{exp@var{m}2} instruction pattern
+@item @samp{exp@var{m}2}
+Store the exponential of operand 1 into operand 0.
+
+The @code{exp} built-in function of C always uses the mode which
+corresponds to the C data type @code{double} and the @code{expf}
+built-in function uses the mode which corresponds to the C data
+type @code{float}.
+
+@cindex @code{log@var{m}2} instruction pattern
+@item @samp{log@var{m}2}
+Store the natural logarithm of operand 1 into operand 0.
+
+The @code{log} built-in function of C always uses the mode which
+corresponds to the C data type @code{double} and the @code{logf}
+built-in function uses the mode which corresponds to the C data
+type @code{float}.
@cindex @code{ffs@var{m}2} instruction pattern
@item @samp{ffs@var{m}2}