On Sun, 2 Jul 2017, Yuri Gribov wrote:

On Sun, Jul 2, 2017 at 6:32 PM, Marc Glisse <marc.gli...@inria.fr> wrote:
On Sun, 2 Jul 2017, Yuri Gribov wrote:

This is initial patch for
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57371 .

Thanks. I have had this unfinished, probably wrong patch on my hard drive
for 4 years, I doubt there is much you can extract from it, but just in
case...

Thanks, this will indeed help! I only don't like !uns here:

+      bool uns = TYPE_UNSIGNED (itype);
+      bool fits = mantissa >= prec - !uns;

as I believe for INT?_MIN we need 'prec' number of bits.

INT_MIN is (minus) a power of 2, so 1 bit of mantissa is sufficient to represent it exactly (as long as the exponent also fits). At least for an IEEE754 representation using base 2, but I expect non-IEEE representations of floats are similar enough.

--
Marc Glisse

Reply via email to