This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/49715] Could do more efficient unsigned-to-float to conversions based on range information


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49715

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |missed-optimization
   Last reconfirmed|                            |2011.07.12 12:18:02
          Component|target                      |tree-optimization
                 CC|                            |rguenth at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-12 12:18:02 UTC ---
Confirmed.  VRP could do this transformation.  I'm not sure it's always
worth or if there is a target that can do faster unsigned -> float conversion
than signed -> float conversion (though I doubt that).  Probably similar
optimization can be applied for

float func (unsigned long long x)
{
  return (x & 0xfffff) * 0.01f;
}

that is, introduce a truncation so that the int->float expander can use
floatsi instead of floatdi which might not be available either.

It happens that i?86 defines floatunsssi, so depending on the availability
of a unsigned -> float expander isn't a good profitability check.

The odd thing is of course that VRP would _insert_ a conversion ...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]