24102 – floatdisf2_internal2 broken (original) (raw)
Description Mikael Vidstedt 2005-09-28 13:32:28 UTC
The floatdisf2_internal2 is broken since 2004-11-26, which will result in broken rounding for float casts.
long long l = (((1L << 24) + 1) << 29) + 1; float f = (float)l;
will eg. lead to f=9007199254740992.000000 instead of f=9007200328482816.000000
If I'm not mistaken, rs6000.md:5239 should read (const_int 2) instead of (const_int 3).
Comment 1 Mikael Vidstedt 2005-09-28 13:34:45 UTC
This is on AIX/PowerPC. If there is anything else you need to know, please just ask.
Comment 2 Drea Pinski 2005-09-28 13:38:42 UTC
Caused by:
[PR rtl-optimization/16356](show%5Fbug.cgi?id=16356 "RESOLVED FIXED - Failure to use count register (branch on count register)")
* config/rs6000/rs6000.md (floatdisf2_internal2): Rewrite with
separate output register and one less jump. Enable for powerpc64.
(floatdisf2): Adjust for above.Comment 3 Alan Modra 2005-09-28 15:54:12 UTC
Uhh, yes, it's a typo. The (const_int 3) in floatdisf2_internal2 should indeed be (const_int 2).
Comment 4 Alan Modra 2005-09-28 16:01:20 UTC
Bootstrapping the obvious fix.
Comment 6 Wolfgang Bangerth 2005-09-29 00:25:50 UTC
How about the other branches? W.
Comment 7 Drea Pinski 2005-09-29 00:51:13 UTC
(In reply to comment #6)
How about the other branches? 4.0 is frozen right now and you really don't want a 3.4.5 (which sounds like will be released before 4.0.3) to have a fix before 4.0.x has it.
Comment 10 Alan Modra 2005-09-29 04:51:47 UTC
Fixed all active branches