Re: [PATCH 3/6] microblaze: Fixes for RTL checking

2017-02-24 Thread Segher Boessenkool
On Tue, Feb 21, 2017 at 01:02:30PM -0800, Michael Eager wrote: > >>Why generate an unnecessary NOP? > > > >Why not? It will be optimised away anyway, and the code to get at the > >subregs is hairy... But could optimise away the useless move here > >already if both ops are a reg and both are the s

Re: [PATCH 3/6] microblaze: Fixes for RTL checking

2017-02-21 Thread Segher Boessenkool
On Tue, Feb 21, 2017 at 12:35:17PM -0800, Michael Eager wrote: > On 02/21/2017 12:15 PM, Jakub Jelinek wrote: > >On Tue, Feb 21, 2017 at 02:48:15PM +, Segher Boessenkool wrote: > >>- /* Shift by zero -- copy regs if necessary. */ > >>+ /* Shift by zero -- copy regs. */ > >>if ((GET_CODE

Re: [PATCH 3/6] microblaze: Fixes for RTL checking

2017-02-21 Thread Michael Eager
On 02/21/2017 12:25 PM, Segher Boessenkool wrote: On Tue, Feb 21, 2017 at 12:08:34PM -0800, Michael Eager wrote: - /* Shift by zero -- copy regs if necessary. */ + /* Shift by zero -- copy regs. */ if ((GET_CODE (operands[2]) == CONST_INT) && (INTVAL (operands[2]) == 0)) { -

Re: [PATCH 3/6] microblaze: Fixes for RTL checking

2017-02-21 Thread Jakub Jelinek
On Tue, Feb 21, 2017 at 12:35:17PM -0800, Michael Eager wrote: > On 02/21/2017 12:15 PM, Jakub Jelinek wrote: > > On Tue, Feb 21, 2017 at 02:48:15PM +, Segher Boessenkool wrote: > > > - /* Shift by zero -- copy regs if necessary. */ > > > + /* Shift by zero -- copy regs. */ > > > if ((G

Re: [PATCH 3/6] microblaze: Fixes for RTL checking

2017-02-21 Thread Michael Eager
On 02/21/2017 12:15 PM, Jakub Jelinek wrote: On Tue, Feb 21, 2017 at 02:48:15PM +, Segher Boessenkool wrote: - /* Shift by zero -- copy regs if necessary. */ + /* Shift by zero -- copy regs. */ if ((GET_CODE (operands[2]) == CONST_INT) && (INTVAL (operands[2]) == 0)) You could have

Re: [PATCH 3/6] microblaze: Fixes for RTL checking

2017-02-21 Thread Segher Boessenkool
On Tue, Feb 21, 2017 at 12:08:34PM -0800, Michael Eager wrote: > >- /* Shift by zero -- copy regs if necessary. */ > >+ /* Shift by zero -- copy regs. */ > >if ((GET_CODE (operands[2]) == CONST_INT) && (INTVAL (operands[2]) == > >0)) > > { > >- if (REGNO (operands[0]) != REGN

Re: [PATCH 3/6] microblaze: Fixes for RTL checking

2017-02-21 Thread Jakub Jelinek
On Tue, Feb 21, 2017 at 02:48:15PM +, Segher Boessenkool wrote: > - /* Shift by zero -- copy regs if necessary. */ > + /* Shift by zero -- copy regs. */ >if ((GET_CODE (operands[2]) == CONST_INT) && (INTVAL (operands[2]) == 0)) You could have changed this line to if (operands[2] == c

Re: [PATCH 3/6] microblaze: Fixes for RTL checking

2017-02-21 Thread Michael Eager
On 02/21/2017 06:48 AM, Segher Boessenkool wrote: REGNO can only be called on REGs, not SUBREGs; and INTVAL does not work on REGs. 2017-02-21 Segher Boessenkool * config/microblaze/microblaze.c (microblaze_expand_shift): Do not test for register moves to themselves. *

Re: [PATCH 3/6] microblaze: Fixes for RTL checking

2017-02-21 Thread Jeff Law
On 02/21/2017 07:48 AM, Segher Boessenkool wrote: REGNO can only be called on REGs, not SUBREGs; and INTVAL does not work on REGs. 2017-02-21 Segher Boessenkool * config/microblaze/microblaze.c (microblaze_expand_shift): Do not test for register moves to themselves. *

[PATCH 3/6] microblaze: Fixes for RTL checking

2017-02-21 Thread Segher Boessenkool
REGNO can only be called on REGs, not SUBREGs; and INTVAL does not work on REGs. 2017-02-21 Segher Boessenkool * config/microblaze/microblaze.c (microblaze_expand_shift): Do not test for register moves to themselves. * config/microblaze/microblaze.md (*ashlsi3_byone, *a