This is the mail archive of the
mailing list for the GCC project.
Re: Using gen_int_mode instead of GEN_INT minor testsuite fallout on MIPS
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Mike Stump <mikestump at comcast dot net>
- Cc: Richard Sandiford <rdsandiford at googlemail dot com>, Graham Stott <graham dot stott at btinternet dot com>, James Greenhalgh <james dot greenhalgh at arm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 16 Sep 2013 11:09:57 +0200
- Subject: Re: Using gen_int_mode instead of GEN_INT minor testsuite fallout on MIPS
- Authentication-results: sourceware.org; auth=none
- References: <CAFiYyc3o+GLpPnNb=E1ru9rOJxuVkxBMsMEeE99wRm8SRWrmCg at mail dot gmail dot com> <1378833157-11511-1-git-send-email-james dot greenhalgh at arm dot com> <87y574mr2h dot fsf at talisman dot default> <1378900963 dot 71148 dot YahooMailNeo at web87402 dot mail dot ir2 dot yahoo dot com> <87y573kxse dot fsf at talisman dot default> <CAFiYyc1aR91hKgkGMbLfVtH0vmXOBPruaiPRqQ5-FCA5gTDMWg at mail dot gmail dot com> <87ppseko71 dot fsf at talisman dot default> <CAFiYyc36vmFX0HneNXQFcBT5ajGZ2fapVCX08DBR-x+LY7h1mQ at mail dot gmail dot com> <87d2odkuu7 dot fsf at talisman dot default> <0F11E779-5DA9-43E6-A12F-64A66B147AF7 at comcast dot net>
On Fri, Sep 13, 2013 at 10:23 PM, Mike Stump <firstname.lastname@example.org> wrote:
> On Sep 13, 2013, at 1:08 AM, Richard Sandiford <email@example.com> wrote:
>>>> We don't really model that properly yet. Partial modes are just defined
>>>> using something like:
>>>> PARTIAL_INT_MODE (SI);
> True, but, all ports are trivial to fix so that the precision is included and for the interface to change to include the precision.
>>> Well I was asking because if you change a GEN_INT (x) to
>>> gen_int_mode (PSImode, x) then you'll end up in trunc_int_for_mode with
>>> PSImode which looks at GET_MODE_PRECISION (PSImode is still
>>> a SCALAR_INT_MODE_P ...). We set precision of PSImode to -1U
> Easy to fix.
>> Yeah. I don't think it makes sense to canonise PSI to 32 bits when we
>> know it has fewer than 32 bits.
> Here is the patch to add precision to partial int modes. I included switching over the rs6000 port to the new scheme so one can get a feel for that it would look like.
> I could trivially convert the remaining ports:
> config/bfin/bfin-modes.def:PARTIAL_INT_MODE (DI);
> config/m32c/m32c-modes.def:PARTIAL_INT_MODE (SI);
> config/msp430/msp430-modes.def:PARTIAL_INT_MODE (SI);
> config/rs6000/rs6000-modes.def:PARTIAL_INT_MODE_N (TI, 128);
> config/sh/sh-modes.def:PARTIAL_INT_MODE (SI);
> config/sh/sh-modes.def:PARTIAL_INT_MODE (DI);
> to the new scheme so that _all_ ports would have a precision with all partial int modes. The newest port that I had not audited for how they use it (msp430):
> /* 20-bit address */
> PARTIAL_INT_MODE (SI);
> So, this, trivially would be SI, 20… I would define PARTIAL_INT_MODE with two parameters and not define PARTIAL_INT_MODE_N, if we did it for real. No need for partial conversions here, too easy to convert things.
> Ok for the non-powerpc bits?
Can you instead of adding PARTIAL_INT_MODE_N change all existing
PARTIAL_INT_MODE ()s to PARTIAL_INT_MODE_LEGACY () and change
> Want me to convert all the ports and change the interface instead of merely extending it and submit those? I'd hate to do the work, if no one wants to review/approve it.
I volunteer to approve it (after giving target maintainers time to do
so on their own).
So, if you send a whole conversion patch then we don't have to play games
with having both variants recognized. (now it just occurs to me we can use
a variadic macro here ...?)
> We've been using this scheme on our port for a while and it seems to work nicely.