This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Remove mode argument from gen_rtx_SET
- From: DJ Delorie <dj at redhat dot com>
- To: Richard Sandiford <richard dot sandiford at arm dot com>
- Cc: Franz dot Sirl-kernel at lauterbach dot com, segher at kernel dot crashing dot org, gcc-patches at gcc dot gnu dot org, richard dot sandiford at arm dot com
- Date: Fri, 8 May 2015 12:42:58 -0400
- Subject: Re: Remove mode argument from gen_rtx_SET
- Authentication-results: sourceware.org; auth=none
- References: <87ioc4vct9 dot fsf at e105548-lin dot cambridge dot arm dot com> <554C90BE dot 5080105 at lauterbach dot com> <20150508115747 dot GA11371 at gate dot crashing dot org> <554CB17E dot 4040406 at lauterbach dot com> <877fsjupyh dot fsf at e105548-lin dot cambridge dot arm dot com>
> ; This pattern is identical to the truncsipsi2 pattern except
> ; that it uses a SUBREG instead of a TRUNC. It is needed in
> ; order to prevent reload from converting (set:SI (SUBREG:PSI (SI)))
> ; into (SET:PSI (PSI)).
>
> I'm not sure what that's supposed to mean (what's an SI set of a PSI
> subreg?), but I suspect removing the mode would lose information,
> so I left it alone.
MSP430 has 20-bit registers (PSImode-sized). One register can hold an
HI or PSI sized value, but if you have an SI value it's stored as two
HI registers.
Thus, a PSImode value in a register is *not* just the 20 LSB of an
SImode value. Also, a PSImode subset of an SI value is stored
different than a PSImode value on its own.
Thus, consider code like this:
(set (reg:SI 1)
(subreg:PSI (reg:SI 2)))
(set (reg:PSI 1)
(reg:PSI 2))
On most architectures, you'd say "these do the same thing" but on
MSP430 they don't.