This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR49715, (float)unsigned -> (float)signed
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Richard Guenther <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Jul 2011 15:27:20 +0000 (UTC)
- Subject: Re: [PATCH] Fix PR49715, (float)unsigned -> (float)signed
- References: <alpine.LNX.2.00.1107211701070.810@zhemvz.fhfr.qr> <4E284374.6090304@redhat.com>
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