aboutsummaryrefslogtreecommitdiff
path: root/gcc/real.h
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-05-06 03:14:10 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-05-06 03:14:10 +0000
commite82a312b55f88fc3d035e0c24409c71e043e9633 (patch)
tree2a99b03c08d036a34af9b1b5c844c11e3d67a3af /gcc/real.h
parentd7b4a590279f012756741c12f2027d714ea776c4 (diff)
downloadgcc-e82a312b55f88fc3d035e0c24409c71e043e9633.zip
gcc-e82a312b55f88fc3d035e0c24409c71e043e9633.tar.gz
gcc-e82a312b55f88fc3d035e0c24409c71e043e9633.tar.bz2
real.c (real_powi): New function to calculate the value of a real raised to an integer power, i.e.
* 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. From-SVN: r66515
Diffstat (limited to 'gcc/real.h')
-rw-r--r--gcc/real.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/real.h b/gcc/real.h
index 0a470a5..1611392 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 */