From: Kyrill Tkachov <kyrylo.tkachov@foss.arm.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Marcus Shawcroft <marcus.shawcroft@arm.com>,
Richard Earnshaw <Richard.Earnshaw@arm.com>,
James Greenhalgh <james.greenhalgh@arm.com>
Subject: Re: [PATCH][AArch64] Allow const0_rtx operand for atomic compare-exchange patterns
Date: Thu, 01 Jun 2017 14:02:00 -0000 [thread overview]
Message-ID: <59301E59.5080404@foss.arm.com> (raw)
In-Reply-To: <59104F9E.4060700@foss.arm.com>
Ping.
Thanks,
Kyrill
On 08/05/17 11:59, Kyrill Tkachov wrote:
> Ping.
>
> Thanks,
> Kyrill
>
> On 24/04/17 10:37, Kyrill Tkachov wrote:
>> Pinging this back into context so that I don't forget about it...
>>
>> https://gcc.gnu.org/ml/gcc-patches/2017-02/msg01648.html
>>
>> Thanks,
>> Kyrill
>>
>> On 28/02/17 12:29, Kyrill Tkachov wrote:
>>> Hi all,
>>>
>>> For the testcase in this patch we currently generate:
>>> foo:
>>> mov w1, 0
>>> ldaxr w2, [x0]
>>> cmp w2, 3
>>> bne .L2
>>> stxr w3, w1, [x0]
>>> cmp w3, 0
>>> .L2:
>>> cset w0, eq
>>> ret
>>>
>>> Note that the STXR could have been storing the WZR register instead of moving zero into w1.
>>> This is due to overly strict predicates and constraints in the store exclusive pattern and the
>>> atomic compare exchange expanders and splitters.
>>> This simple patch fixes that in the patterns concerned and with it we can generate:
>>> foo:
>>> ldaxr w1, [x0]
>>> cmp w1, 3
>>> bne .L2
>>> stxr w2, wzr, [x0]
>>> cmp w2, 0
>>> .L2:
>>> cset w0, eq
>>> ret
>>>
>>>
>>> Bootstrapped and tested on aarch64-none-linux-gnu.
>>> Ok for GCC 8?
>>>
>>> Thanks,
>>> Kyrill
>>>
>>> 2017-02-28 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>>>
>>> * config/aarch64/atomics.md (atomic_compare_and_swap<mode> expander):
>>> Use aarch64_reg_or_zero predicate for operand 4.
>>> (aarch64_compare_and_swap<mode> define_insn_and_split):
>>> Use aarch64_reg_or_zero predicate for operand 3. Add 'Z' constraint.
>>> (aarch64_store_exclusive<mode>): Likewise for operand 2.
>>>
>>> 2017-02-28 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>>>
>>> * gcc.target/aarch64/atomic_cmp_exchange_zero_reg_1.c: New test.
>>
>
next prev parent reply other threads:[~2017-06-01 14:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-28 12:59 Kyrill Tkachov
2017-04-24 9:40 ` Kyrill Tkachov
2017-05-08 11:00 ` Kyrill Tkachov
2017-06-01 14:02 ` Kyrill Tkachov [this message]
2017-06-06 13:16 ` James Greenhalgh
2017-06-20 5:06 ` Andrew Pinski
2017-06-20 8:30 ` Kyrill Tkachov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=59301E59.5080404@foss.arm.com \
--to=kyrylo.tkachov@foss.arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=james.greenhalgh@arm.com \
--cc=marcus.shawcroft@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).