Re: [PATCH 1/2] simplify-rtx: Simplify trunc of and of shiftrt

2015-11-13 Thread Uros Bizjak
On Fri, Nov 13, 2015 at 3:36 PM, Segher Boessenkool wrote: > Hi! > > On Fri, Nov 13, 2015 at 11:02:55AM +0100, Uros Bizjak wrote: >> on alpha-linux-gnu. >> >> The difference starts in combine, where before the patch, we were able >> to combine insns: >> >> (insn 7 6 8 2 (set (reg:DI 82) >>

Re: [PATCH 1/2] simplify-rtx: Simplify trunc of and of shiftrt

2015-11-13 Thread Segher Boessenkool
Hi! On Fri, Nov 13, 2015 at 11:02:55AM +0100, Uros Bizjak wrote: > on alpha-linux-gnu. > > The difference starts in combine, where before the patch, we were able > to combine insns: > > (insn 7 6 8 2 (set (reg:DI 82) > (lshiftrt:DI (reg:DI 81 [ x ]) > (const_int 16 [0x10])))

Re: [PATCH 1/2] simplify-rtx: Simplify trunc of and of shiftrt

2015-11-13 Thread Uros Bizjak
Hello! > 2015-11-09 Segher Boessenkool > > * gcc/simplify-rtx.c (simplify_truncation): Simplify TRUNCATE > of AND of [LA]SHIFTRT. Revision r230164 (the above patch) regressed: FAIL: gcc.target/alpha/pr42269-1.c scan-assembler-not addl on alpha-linux-gnu. The difference starts in combine, wh

Re: [PATCH 1/2] simplify-rtx: Simplify trunc of and of shiftrt

2015-11-11 Thread Segher Boessenkool
On Tue, Nov 10, 2015 at 10:04:30PM +0100, Bernd Schmidt wrote: > On 11/10/2015 06:44 PM, Segher Boessenkool wrote: > > >Yes I know. All the rest of the code around is it like this though. > >Do you want this written in a saner way? > > I won't object to leaving it as-is for now, but in the futur

Re: [PATCH 1/2] simplify-rtx: Simplify trunc of and of shiftrt

2015-11-10 Thread Bernd Schmidt
On 11/10/2015 06:44 PM, Segher Boessenkool wrote: Yes I know. All the rest of the code around is it like this though. Do you want this written in a saner way? I won't object to leaving it as-is for now, but in the future it would be good to keep this in mind. I'm not entirely sure what th

Re: [PATCH 1/2] simplify-rtx: Simplify trunc of and of shiftrt

2015-11-10 Thread Segher Boessenkool
On Tue, Nov 10, 2015 at 12:16:09PM +0100, Bernd Schmidt wrote: > On 11/09/2015 08:33 AM, Segher Boessenkool wrote: > >If we have > > > > (truncate:M1 (and:M2 (lshiftrt:M2 (x:M2) C) C2)) > > > >we can write it instead as > > > > (and:M1 (lshiftrt:M1 (truncate:M1 (x:M2)) C) C2) > > > > > >+

Re: [PATCH 1/2] simplify-rtx: Simplify trunc of and of shiftrt

2015-11-10 Thread Bernd Schmidt
On 11/09/2015 08:33 AM, Segher Boessenkool wrote: If we have (truncate:M1 (and:M2 (lshiftrt:M2 (x:M2) C) C2)) we can write it instead as (and:M1 (lshiftrt:M1 (truncate:M1 (x:M2)) C) C2) + /* Likewise (truncate:QI (and:SI (lshiftrt:SI (x:SI) C) C2)) into + (and:QI (lshift

[PATCH 1/2] simplify-rtx: Simplify trunc of and of shiftrt

2015-11-08 Thread Segher Boessenkool
If we have (truncate:M1 (and:M2 (lshiftrt:M2 (x:M2) C) C2)) we can write it instead as (and:M1 (lshiftrt:M1 (truncate:M1 (x:M2)) C) C2) (if that is valid, of course), which has smaller modes for the binary ops, and the truncate can often simplify further (if "x" is a register, f