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: 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)


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