summaryrefslogtreecommitdiff
path: root/gcc/real.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-05-04 09:19:45 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2018-05-04 09:19:45 +0200
commit047823853d8324eab7d6ad8f266ee5395c4a76ff (patch)
tree577de47e3f2f5746febab4c2403441ef0d8abd9f /gcc/real.h
parent105073e1cc39fbeb03aa40e294ffc3c400cfa844 (diff)
re PR tree-optimization/85466 (Performance is slow when doing 'branchless' conditional style math operations)
PR libstdc++/85466 * real.h (real_nextafter): Declare. * real.c (real_nextafter): New function. * fold-const-call.c (fold_const_nextafter): New function. (fold_const_call_sss): Call it for CASE_CFN_NEXTAFTER and CASE_CFN_NEXTTOWARD. (fold_const_call_1): For CASE_CFN_NEXTTOWARD call fold_const_call_sss even when arg1_mode is different from arg0_mode. * gcc.dg/nextafter-1.c: New test. * gcc.dg/nextafter-2.c: New test. * gcc.dg/nextafter-3.c: New test. * gcc.dg/nextafter-4.c: New test. From-SVN: r259921
Diffstat (limited to 'gcc/real.h')
-rw-r--r--gcc/real.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/real.h b/gcc/real.h
index e51073b19b9..0ce42565708 100644
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -507,6 +507,10 @@ extern void real_copysign (REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *);
extern bool real_isinteger (const REAL_VALUE_TYPE *, format_helper);
extern bool real_isinteger (const REAL_VALUE_TYPE *, HOST_WIDE_INT *);
+/* Calculate nextafter (X, Y) in format FMT. */
+extern bool real_nextafter (REAL_VALUE_TYPE *, format_helper,
+ const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *);
+
/* Write into BUF the maximum representable finite floating-point
number, (1 - b**-p) * b**emax for a given FP format FMT as a hex
float string. BUF must be large enough to contain the result. */