diff options
author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-05-06 03:14:10 +0000 |
---|---|---|
committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-05-06 03:14:10 +0000 |
commit | 3be04962d3662d6b88db202a9d510f546d2b976a (patch) | |
tree | 2a99b03c08d036a34af9b1b5c844c11e3d67a3af /gcc/real.h | |
parent | e3b5d27718aabc0b1addfc17fe0e95cbb5c9c161 (diff) | |
download | gcc-3be04962d3662d6b88db202a9d510f546d2b976a.tar.gz |
* real.c (real_powi): New function to calculate the value of
a real raised to an integer power, i.e. pow(x,n) for int n.
(real_sqrt): Convert to using the faster do_add, do_multiply
and do_divide API for consistency with the rest of real.c.
* real.h (real_powi): Prototype here.
* builtins.c (fold_builtin): Avoid local variable mode when
evaluating sqrt at compile time. Attempt to evaluate pow at
compile-time, by checking for an integral exponent.
* gcc.dg/builtins-14.c: New test case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66515 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/real.h')
-rw-r--r-- | gcc/real.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/real.h b/gcc/real.h index 0a470a512f3..16113924ae5 100644 --- a/gcc/real.h +++ b/gcc/real.h @@ -365,4 +365,10 @@ extern bool real_sqrt PARAMS ((REAL_VALUE_TYPE *, enum machine_mode, const REAL_VALUE_TYPE *)); +/* Calculate R as X raised to the integer exponent N in mode MODE. */ +extern bool real_powi PARAMS ((REAL_VALUE_TYPE *, + enum machine_mode, + const REAL_VALUE_TYPE *, + HOST_WIDE_INT)); + #endif /* ! GCC_REAL_H */ |