This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][AArch64] Fix FAIL: gcc.target/aarch64/cmn.c scan-assembler cmn\tw[0-9]
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Kyrylo Tkachov <Kyrylo dot Tkachov at arm dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>
- Date: Mon, 09 Sep 2013 14:29:04 +0100
- Subject: Re: [PATCH][AArch64] Fix FAIL: gcc.target/aarch64/cmn.c scan-assembler cmn\tw[0-9]
- Authentication-results: sourceware.org; auth=none
- References: <005c01ce8c63$b01a7d20$104f7760$ at tkachov@arm.com> <51F78A4F dot 3020808 at arm dot com> <013901cead5b$2e32bf70$8a983e50$ at tkachov@arm.com>
On 09/09/13 13:50, Kyrylo Tkachov wrote:
> Hi Richard,
>
>> On 29/07/13 14:58, Kyrylo Tkachov wrote:
>>> Hi all,
>>>
>>> Now that combine emits the canonical form for (eq (neg x) (y)) instead
>> of (eq
>>> (x) (neg y)), this patch fixes up the corresponding pattern in aarch64
>> to
>>> match that. This enables combine to properly generate the cmn
>> instruction
>>> where appropriate.
>>>
>>> Tested aarch64-none-elf on model.
>>>
>>> Ok for trunk?
>>>
>>
>> No, this is wrong for inequalities, since in reality it's the second
>> operand that's inverted.
>>
>> You'll need to use CC_SWP mode and then arrange for this to be correctly
>> picked by select_cc_mode.
>>
>
> How's this?
>
> aarch64_select_cc_mode is updated to return CC_SWPmode for these comparisons and
> the MD pattern is updated accordingly.
>
> Tested aarch64-none-elf on a model.
>
> Is this ok?
>
> Thanks,
> Kyrill
>
> 2013-09-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
> * config/aarch64/aarch64.c (aarch64_select_cc_mode): Return CC_SWP for
> comparison with negated operand.
> * config/aarch64/aarch64.md (compare_neg<mode>): Match canonical RTL form.
>
> 2013-09-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
> * gcc.target/aarch64/cmn-neg.c: New test.
>
>
>
OK.
R.