This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Simplify (subreg:SI (ashiftrt:DI a 32) 4)
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: pinskia at physics dot uc dot edu (Andrew Pinski)
- Cc: pinskia at physics dot uc dot edu (Andrew Pinski), gcc-patches at gcc dot gnu dot org
- Date: Wed, 6 Aug 2003 21:10:09 +0100 (BST)
- Subject: Re: Simplify (subreg:SI (ashiftrt:DI a 32) 4)
> This patch simplifies (subreg:SI (ashiftrt:DI a 32) 4) into (subreg:SI
> a 0) which should help SPEC (mostly crafty).
But this is only valid for big endian.
> On PPC before the patch, gcc produces:
> _foo:
> srawi r9,r3,31
> srawi r10,r3,0
> mr r3,r10
> blr
> but after:
> _foo:
> blr
I wonder how you did this, since the numbers you test for are wrong, too.
> ChangeLog:
> * simplify-rtx.c (simplify_subreg): Simplify (subreg:M1 (ashiftrt:M2 a
> n) m)
> into (subreg:M1 a 0) where n is 2<<m and and m is unit size of m1.
n should be m * BITS_PER_UNIT.
2<<m in your example is 16. Besides, why do you use the unit size?
consider:
(subreg:V2HI (ashiftrt:DI a 32) 4)