aboutsummaryrefslogtreecommitdiff
path: root/gcc/range-op-float.cc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-05-06 02:35:02 +0200
committerJakub Jelinek <jakub@redhat.com>2023-05-06 02:35:02 +0200
commit82aef047eda376f41eccf51ba1277e46160f6420 (patch)
tree5619489b40701b7b887b9643dc36184b3b15792d /gcc/range-op-float.cc
parent319aef8d2fde32be5cfed99f321c7f90e33d1f1d (diff)
downloadgcc-82aef047eda376f41eccf51ba1277e46160f6420.zip
gcc-82aef047eda376f41eccf51ba1277e46160f6420.tar.gz
gcc-82aef047eda376f41eccf51ba1277e46160f6420.tar.bz2
gimple-range-op: Improve handling of sqrt ranges
The previous patch just added basic intrinsic ranges for sqrt ([-0.0, +Inf] +-NAN being the general result range of the function and [-0.0, +Inf] the general operand range if result isn't NAN etc.), the following patch intersects those ranges with particular range computed from argument or result's exact range with the expected error in ulps taken into account and adds a function (frange_arithmetic variant) which can be used by other functions as well as helper. 2023-05-06 Jakub Jelinek <jakub@redhat.com> * value-range.h (frange_arithmetic): Declare. * range-op-float.cc (frange_arithmetic): No longer static. * gimple-range-op.cc (frange_mpfr_arg1): New function. (cfn_sqrt::fold_range): Intersect the generic boundaries range with range computed from sqrt of the particular bounds. (cfn_sqrt::op1_range): Intersect the generic boundaries range with range computed from squared particular bounds. * gcc.dg/tree-ssa/range-sqrt-2.c: New test.
Diffstat (limited to 'gcc/range-op-float.cc')
-rw-r--r--gcc/range-op-float.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc
index 9d18461..a99a6b0 100644
--- a/gcc/range-op-float.cc
+++ b/gcc/range-op-float.cc
@@ -305,7 +305,7 @@ frange_nextafter (enum machine_mode mode,
// SF/DFmode (when storing into memory from the 387 stack). Maybe
// this is ok as well though it is just occasionally more precise. ??
-static void
+void
frange_arithmetic (enum tree_code code, tree type,
REAL_VALUE_TYPE &result,
const REAL_VALUE_TYPE &op1,