public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: James Greenhalgh <james.greenhalgh@arm.com>
To: Matthew Wahab <matthew.wahab@foss.arm.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [AArch64][PATCH 1/5] Use atomic instructions for swap and fetch-update operations.
Date: Mon, 21 Sep 2015 11:25:00 -0000	[thread overview]
Message-ID: <20150921112451.GA22771@arm.com> (raw)
In-Reply-To: <55FFE4C0.6010106@foss.arm.com>

On Mon, Sep 21, 2015 at 12:06:40PM +0100, Matthew Wahab wrote:
> On 18/09/15 08:58, James Greenhalgh wrote:
> > On Thu, Sep 17, 2015 at 05:37:55PM +0100, Matthew Wahab wrote:
> 
> >> diff --git a/gcc/config/aarch64/atomics.md b/gcc/config/aarch64/atomics.md
> >> index 65d2cc9..0e71002 100644
> >> --- a/gcc/config/aarch64/atomics.md
> >> +++ b/gcc/config/aarch64/atomics.md
> >> @@ -27,6 +27,7 @@
> >>       UNSPECV_ATOMIC_CMPSW		; Represent an atomic compare swap.
> >>       UNSPECV_ATOMIC_EXCHG		; Represent an atomic exchange.
> >>       UNSPECV_ATOMIC_CAS			; Represent an atomic CAS.
> >> +    UNSPECV_ATOMIC_SWP			; Represent an atomic SWP.
> >>       UNSPECV_ATOMIC_OP			; Represent an atomic operation.
> >>   ])
> >>
> >> @@ -122,19 +123,19 @@
> >>   )
> >>
> >>   (define_insn_and_split "aarch64_compare_and_swap<mode>_lse"
> >> -  [(set (reg:CC CC_REGNUM)					;; bool out
> >> +  [(set (reg:CC CC_REGNUM)
> >>       (unspec_volatile:CC [(const_int 0)] UNSPECV_ATOMIC_CMPSW))
> >> -   (set (match_operand:GPI 0 "register_operand" "=&r")		;; val out
> >> -    (match_operand:GPI 1 "aarch64_sync_memory_operand" "+Q"))   ;; memory
> >> +   (set (match_operand:GPI 0 "register_operand" "=&r")
> >> +    (match_operand:GPI 1 "aarch64_sync_memory_operand" "+Q"))
> >>      (set (match_dup 1)
> >>       (unspec_volatile:GPI
> >> -      [(match_operand:GPI 2 "aarch64_plus_operand" "rI")	;; expect
> >> -       (match_operand:GPI 3 "register_operand" "r")		;; desired
> >> -       (match_operand:SI 4 "const_int_operand")			;; is_weak
> >> -       (match_operand:SI 5 "const_int_operand")			;; mod_s
> >> -       (match_operand:SI 6 "const_int_operand")]		;; mod_f
> >> +      [(match_operand:GPI 2 "aarch64_plus_operand" "rI")
> >> +       (match_operand:GPI 3 "register_operand" "r")
> >> +       (match_operand:SI 4 "const_int_operand")
> >> +       (match_operand:SI 5 "const_int_operand")
> >> +       (match_operand:SI 6 "const_int_operand")]
> >
> > I'm not sure I understand the change here, those comments still look helpful
> > enough for understanding the pattern, what have a I missed?
> 
> That was part of an attempt to clean up some code. It's unnecessary and I've dropped 
> the change.
> 
> Attached is the updated patch with some other changes:
> - Simplified the atomic_exchange<mode> expander in line with reviews for
>    other patches in the series.
> - Removed the CC clobber from aarch64_atomic_exchange<mode>_lse, it was
>    over-cautious.
> - Added a missing entry to the change log (noting a whitespace fix).
> 
> Ok for trunk?
> Matthew

OK.

Thanks,
James

> gcc/
> 2015-09-21  Matthew Wahab  <matthew.wahab@arm.com>
> 
> 	* config/aarch64/aarch64-protos.h (aarch64_gen_atomic_ldop):
> 	Declare.
> 	* config/aarch64/aarch64.c (aarch64_emit_atomic_swap): New.
> 	(aarch64_gen_atomic_ldop): New.
> 	(aarch64_split_atomic_op): Fix whitespace and add a comment.
> 	* config/aarch64/atomics.md (UNSPECV_ATOMIC_SWP): New.
> 	(aarch64_compare_and_swap<mode>_lse): Fix some whitespace.
> 	(atomic_exchange<mode>): Replace with an expander.
> 	(aarch64_atomic_exchange<mode>): New.
> 	(aarch64_atomic_exchange<mode>_lse): New.
> 	(aarch64_atomic_<atomic_optab><mode>): Fix some whitespace.
> 	(aarch64_atomic_swp<mode>): New.
> 
> 
> gcc/testsuite/
> 2015-09-21  Matthew Wahab  <matthew.wahab@arm.com>
> 
> 	* gcc.target/aarch64/atomic-inst-ops.inc: (TEST_MODEL): New.
> 	(TEST_ONE): New.
>          * gcc.target/aarch64/atomic-inst-swap.c: New.
> 
> 


      reply	other threads:[~2015-09-21 11:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-17 16:39 Matthew Wahab
2015-09-17 16:42 ` [AArch64][PATCH 2/5] Add BIC instruction Matthew Wahab
2015-09-18  8:11   ` James Greenhalgh
2015-09-21 11:16     ` [AArch64][PATCH 2/5] Make BIC, other logical instructions, available. (was: Add BIC instruction.) Matthew Wahab
2015-09-21 11:31       ` James Greenhalgh
2015-09-17 16:47 ` [AArch64][PATCH 3/5] Add atomic load-operate instructions Matthew Wahab
2015-09-18  8:39   ` James Greenhalgh
2015-09-21 11:23     ` Matthew Wahab
2015-09-17 16:49 ` [AArch64][PATCH 4/5] Use atomic load-operate instructions for fetch-update patterns Matthew Wahab
2015-09-18  9:05   ` James Greenhalgh
2015-09-21 11:32     ` Matthew Wahab
2015-09-21 14:15       ` James Greenhalgh
2015-09-17 16:56 ` [AArch64][PATCH 5/5] Use atomic load-operate instructions for update-fetch patterns Matthew Wahab
2015-09-17 18:56   ` Andrew Pinski
2015-09-18 16:27     ` Ramana Radhakrishnan
2015-09-21 11:44   ` Matthew Wahab
2015-09-21 14:27     ` James Greenhalgh
2015-09-18  7:59 ` [AArch64][PATCH 1/5] Use atomic instructions for swap and fetch-update operations James Greenhalgh
2015-09-21 11:06   ` Matthew Wahab
2015-09-21 11:25     ` James Greenhalgh [this message]

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=20150921112451.GA22771@arm.com \
    --to=james.greenhalgh@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=matthew.wahab@foss.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).