This is the mail archive of the gcc-patches@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]

Re: [PATCH] Fix PR49715, (float)unsigned -> (float)signed


On Thu, 21 Jul 2011, Richard Henderson wrote:

> On 07/21/2011 08:09 AM, Richard Guenther wrote:
> > +   /* It's not interesting to widen anything smaller than SImode.  */
> > +   if (TYPE_PRECISION (TREE_TYPE (rhs1)) < GET_MODE_PRECISION (SImode)
> > +       || (!TYPE_UNSIGNED (TREE_TYPE (rhs1))
> > + 	  && TYPE_PRECISION (TREE_TYPE (rhs1)) == GET_MODE_PRECISION (SImode)))
> > +     return false;
> 
> Hard-coding SImode?  Really?  You might as well hard-code 32.  At least
> that's "more correct" when someone does have BITS_PER_UNIT != 8.

I'd guess this is intended to match the hardcoding of SImode in 
optabs.c:expand_float - both of which should maybe use the same target 
hook (that defaults to using SImode) rather than hardcoding SImode.  
(Strictly, in the model that the very existence of SImode should be 
target-dependent, the default hook definition would go in a file in 
config/ that's shared by all targets with BITS_PER_UNIT == 8 and the 
classic set of machine modes, rather than in targhooks.c, but I don't 
think we need to worry about that for now.)

-- 
Joseph S. Myers
joseph@codesourcery.com


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