This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/49715] Could do more efficient unsigned-to-float to conversions based on range information
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 12 Jul 2011 12:18:06 +0000
- Subject: [Bug tree-optimization/49715] Could do more efficient unsigned-to-float to conversions based on range information
- Auto-submitted: auto-generated
- References: <bug-49715-4@http.gcc.gnu.org/bugzilla/>
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 ...