public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amacleod at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/24021] VRP does not work with floating points
Date: Wed, 09 Feb 2022 18:31:11 +0000	[thread overview]
Message-ID: <bug-24021-4-HZavrqZpi0@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-24021-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24021

--- Comment #12 from Andrew Macleod <amacleod at redhat dot com> ---
(In reply to Aldy Hernandez from comment #8)
> (In reply to Jeffrey A. Law from comment #7)
> > Very cool.  ANd no, I'm not enough of an expert on the FP side to shepherd
> > that though.  I would expect it to be exceptionally tricky on the solver
> > side.
> 
> The solver, or ranger/gori, should be isolated from changes.  The main goal
> is to make ranger work with generic vrange's, not iranges or franges.  Once
> I'm done with the abstraction, it should only be value-range.* (class
> frange) and range-ops* that should be affected.  That's the theory anyhow
> ;-).

Yeah, once we get things in place, there will be a skeleton frange class
representation that does some set of basic operations.

One or more floating point experts are welcome then to flush out additional
representational requirements in the frange class and range-op implementations
of any tree-codes operations.   There shouldn't be any changed required
anywhere else. VRP/threader/relations/folding/etc are all driven by range-ops.

And we are of course happy to help when the time comes and GCC13 opens up and
the abstraction code goes in.  If someone is really keen, they may be able to
work on a development branch a bit earlier than that... 

I also have a short list of practical floating point considerations I collected
a couple of years ago. So I don't lose it:

finite
non-zero/positive/negative
normalized
in the range [-1,1] (for trig functions)
which I would expect to come from adding some domain/range knowledge from
standard math functions, and propagating range info from integer stuff from
which floating point values are derived, on top of the usual stuff.

e.g. in embedded world floating-point values from peripherals would commonly
come from some PWM feature via integer division by a constant denominator,
which could tell us a fair bit (even more if it could use builtin expect
information about the numerator).

as far as existing consumers for this info - I'm not sure if glibc still has
special finite versions of functions, but those could be used based on range
info. likewise, knowing a value is normal or in a bounded range could allow for
'relaxed' versions of library functions to be used. there should also be some
inline sequences or other code transforms that are controlled by
finite-math-only and also enabled for provably finite values.

  parent reply	other threads:[~2022-02-09 18:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-24021-4@http.gcc.gnu.org/bugzilla/>
2021-08-25 20:29 ` amacleod at redhat dot com
2022-02-07 16:07 ` aldyh at gcc dot gnu.org
2022-02-09 16:35 ` aldyh at gcc dot gnu.org
2022-02-09 17:04 ` law at gcc dot gnu.org
2022-02-09 17:27 ` aldyh at gcc dot gnu.org
2022-02-09 17:29 ` vincent-gcc at vinc17 dot net
2022-02-09 17:31 ` vincent-gcc at vinc17 dot net
2022-02-09 18:30 ` jakub at gcc dot gnu.org
2022-02-09 18:31 ` amacleod at redhat dot com [this message]
2022-02-09 18:35 ` amacleod at redhat dot com
2022-02-09 19:05 ` vincent-gcc at vinc17 dot net
2022-02-10  9:33 ` rguenth at gcc dot gnu.org
2022-02-10 12:02 ` jakub at gcc dot gnu.org
2022-02-10 12:21 ` rguenther at suse dot de
2022-02-10 14:17 ` vincent-gcc at vinc17 dot net
2022-04-05 19:34 ` amacleod at redhat dot com
2022-04-06  9:34 ` aldyh at gcc dot gnu.org
2022-04-06  9:46 ` jakub at gcc dot gnu.org
2022-04-06  9:57 ` aldyh at gcc dot gnu.org
2022-04-06 10:30 ` aldyh at gcc dot gnu.org
2022-04-06 10:47 ` jakub at gcc dot gnu.org
2022-08-01 13:27 ` aldyh at gcc dot gnu.org
2022-08-01 14:30 ` aldyh at gcc dot gnu.org
2022-11-08 15:54 ` cvs-commit at gcc dot gnu.org
2022-11-08 15:57 ` aldyh at gcc dot gnu.org
2022-11-28 22:15 ` pinskia at gcc dot gnu.org
     [not found] <bug-24021-6528@http.gcc.gnu.org/bugzilla/>
2005-10-23 23:43 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-24021-4-HZavrqZpi0@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).