frange: flush denormals to zero
authorAldy Hernandez <aldyh@redhat.com>
Sat, 17 Sep 2022 08:17:13 +0000 (10:17 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Tue, 20 Sep 2022 05:15:53 +0000 (07:15 +0200)
commit2b61ed838c7f3f4bf54d4530c0f053b420623beb
treefe47a01ed74f10a60e11a5514e3f1040125648a1
parent041812f584a1c82f1255bd96f3503493bd9fb127
frange: flush denormals to zero

For some architectures (or for -funsafe-math-optimizations) we may
flush denormals to zero, in which case we need to be careful to
extend the ranges to the appropriate zero.  This patch does exactly that.
For a range of [x, -DENORMAL] we flush to [x, -0.0] and for [+DENORMAL, x]
we flush to [+0.0, x].

gcc/ChangeLog:

* value-range.cc (frange::flush_denormals_to_zero): New.
(frange::set): Call flush_denormals_to_zero.
* value-range.h (class frange): Add flush_denormals_to_zero.
gcc/value-range.cc
gcc/value-range.h