[PATCH] Fix -mcpu=power8 atomic expansion (PR target/69644)

2016-02-03 Thread Jakub Jelinek
Hi! rs6000_expand_atomic_compare_and_swap uses oldval directly in a comparison instruction, but oldval might be a CONST_INT not suitable for the instruction (such as in the testcase below in SImode comparison 0x8000 constant). We need to force those into register if they don't satisfy the predica

Re: [PATCH] Fix -mcpu=power8 atomic expansion (PR target/69644)

2016-02-03 Thread David Edelsohn
On Wed, Feb 3, 2016 at 5:28 PM, Jakub Jelinek wrote: > Hi! > > rs6000_expand_atomic_compare_and_swap uses oldval directly in > a comparison instruction, but oldval might be a CONST_INT not suitable > for the instruction (such as in the testcase below in SImode comparison > 0x8000 constant). We ne

Re: [PATCH] Fix -mcpu=power8 atomic expansion (PR target/69644)

2016-02-04 Thread Alan Modra
On Wed, Feb 03, 2016 at 05:34:17PM -0500, David Edelsohn wrote: > On Wed, Feb 3, 2016 at 5:28 PM, Jakub Jelinek wrote: > > Hi! > > > > rs6000_expand_atomic_compare_and_swap uses oldval directly in > > a comparison instruction, but oldval might be a CONST_INT not suitable > > for the instruction (s

Re: [PATCH] Fix -mcpu=power8 atomic expansion (PR target/69644)

2016-02-04 Thread David Edelsohn
On Thu, Feb 4, 2016 at 6:33 AM, Alan Modra wrote: > On Wed, Feb 03, 2016 at 05:34:17PM -0500, David Edelsohn wrote: >> On Wed, Feb 3, 2016 at 5:28 PM, Jakub Jelinek wrote: >> > Hi! >> > >> > rs6000_expand_atomic_compare_and_swap uses oldval directly in >> > a comparison instruction, but oldval mi

Re: [PATCH] Fix -mcpu=power8 atomic expansion (PR target/69644)

2016-02-04 Thread Jakub Jelinek
On Thu, Feb 04, 2016 at 08:40:22AM -0500, David Edelsohn wrote: > On Thu, Feb 4, 2016 at 6:33 AM, Alan Modra wrote: > > On Wed, Feb 03, 2016 at 05:34:17PM -0500, David Edelsohn wrote: > >> On Wed, Feb 3, 2016 at 5:28 PM, Jakub Jelinek wrote: > >> > Hi! > >> > > >> > rs6000_expand_atomic_compare_a

Re: [PATCH] Fix -mcpu=power8 atomic expansion (PR target/69644)

2016-02-04 Thread Alan Modra
On Thu, Feb 04, 2016 at 02:42:38PM +0100, Jakub Jelinek wrote: > On Thu, Feb 04, 2016 at 08:40:22AM -0500, David Edelsohn wrote: > > On Thu, Feb 4, 2016 at 6:33 AM, Alan Modra wrote: > > > On Wed, Feb 03, 2016 at 05:34:17PM -0500, David Edelsohn wrote: > > >> On Wed, Feb 3, 2016 at 5:28 PM, Jakub