diff options
| author | Aldy Hernandez <aldyh@redhat.com> | 2022-10-13 08:14:16 +0200 | 
|---|---|---|
| committer | Aldy Hernandez <aldyh@redhat.com> | 2022-11-08 16:53:41 +0100 | 
| commit | 9d96a286992a0fd9ecdd6a58cd9a413c8c49f477 (patch) | |
| tree | 4bd4bc254eaf5645d478cb2a6d2a757a29f4bed2 /gcc/doc/cppinternals/files.rst | |
| parent | 3e0ab430c0441ea3921e8b3a3987f73156412088 (diff) | |
| download | gcc-9d96a286992a0fd9ecdd6a58cd9a413c8c49f477.zip gcc-9d96a286992a0fd9ecdd6a58cd9a413c8c49f477.tar.gz gcc-9d96a286992a0fd9ecdd6a58cd9a413c8c49f477.tar.bz2  | |
[PR24021] Implement PLUS_EXPR range-op entry for floats.
This is the range-op entry for floating point PLUS_EXPR.  It's the
most intricate range entry we have so far, because we need to keep
track of rounding and target FP formats.  This will be the last FP
entry I commit, mostly to avoid disturbing the tree any further, and
also because what we have so far is enough for a solid VRP.
So far we track NANs and signs correctly.  We also handle relationals
(symbolics and numeric), both ordered and unordered, ABS_EXPR and
NEGATE_EXPR which are used to fold __builtin_isinf, and __builtin_sign
(__builtin_copysign is coming up).  All in all, I think this provide
more than enough for basic VRP on floats, as well as provide a basis
to flesh out the rest if there's interest.
My goal with this entry is to provide a template for additional binary
operators, as they tend to follow a similar pattern: handle NANs, do
the arithmetic while keeping track of rounding, and adjust for NAN.  I
may abstract the general parts as we do for irange's fold_range and
wi_fold.
	PR tree-optimization/24021
gcc/ChangeLog:
	* range-op-float.cc (propagate_nans): New.
	(frange_nextafter): New.
	(frange_arithmetic): New.
	(class foperator_plus): New.
	(floating_op_table::floating_op_table): Add PLUS_EXPR entry.
gcc/testsuite/ChangeLog:
	* gcc.dg/tree-ssa/vrp-float-plus.c: New test.
Diffstat (limited to 'gcc/doc/cppinternals/files.rst')
0 files changed, 0 insertions, 0 deletions
