aboutsummaryrefslogtreecommitdiff
path: root/gcc/real.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2015-10-05 13:37:15 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2015-10-05 13:37:15 +0000
commit73463c5e847ca23a8f51ef5b8ad8a19c99696799 (patch)
tree1e4a42eb36f306f1da5a94e136fcbde03c213296 /gcc/real.h
parent5b295a81dd8e7650d334dc71581e64d5736bc3ab (diff)
downloadgcc-73463c5e847ca23a8f51ef5b8ad8a19c99696799.zip
gcc-73463c5e847ca23a8f51ef5b8ad8a19c99696799.tar.gz
gcc-73463c5e847ca23a8f51ef5b8ad8a19c99696799.tar.bz2
Add a build_real_truncate helper function
...which simplifies the match.pd patterns I'm about to add. Bootstrapped & regression-tested on x86_64-linux-gnu. gcc/ * real.h (build_real_truncate): Declare. * tree.c (build_real_truncate): New function. (strip_float_extensions): Use it. * builtins.c (fold_builtin_cabs, fold_builtin_sqrt, fold_builtin_cbrt) (fold_builtin_hypot, fold_builtin_pow): Likewise. * match.pd: Likewise. From-SVN: r228483
Diffstat (limited to 'gcc/real.h')
-rw-r--r--gcc/real.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/real.h b/gcc/real.h
index ecbe563..1497279 100644
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -440,6 +440,9 @@ bool real_can_shorten_arithmetic (machine_mode, machine_mode);
/* In tree.c: wrap up a REAL_VALUE_TYPE in a tree node. */
extern tree build_real (tree, REAL_VALUE_TYPE);
+/* Likewise, but first truncate the value to the type. */
+extern tree build_real_truncate (tree, REAL_VALUE_TYPE);
+
/* Calculate R as X raised to the integer exponent N in mode MODE. */
extern bool real_powi (REAL_VALUE_TYPE *, machine_mode,
const REAL_VALUE_TYPE *, HOST_WIDE_INT);