public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [AArch64] Move iterators from atomics.md to iterators.md
@ 2015-11-02 11:44 Matthew Wahab
  2015-11-10 15:34 ` James Greenhalgh
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Wahab @ 2015-11-02 11:44 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 768 bytes --]

Hello

One of the review comments for the v8.1 atomics patches was that the
iterators and unspec declarations should be moved out of the atomics.md
file (https://gcc.gnu.org/ml/gcc-patches/2015-09/msg01375.html).

The iterators in atomics.md are tied to the unspecv definition in the
same file. This patch moves both into iterators.md.

Tested aarch64-none-elf with cross-compiled check-gcc and
aarch64-none-linux-gnu with native bootstrap and make check.

Ok for trunk?
Matthew

gcc/
2015-11-02  Matthew Wahab  <matthew.wahab@arm.com>

	* config/aarch64/atomics.md (unspecv): Move to iterators.md.
	(ATOMIC_LDOP): Likewise.
	(atomic_ldop): Likewise.
	* config/aarch64/iterators.md (unspecv): Moved from atomics.md.
	(ATOMIC_LDOP): Likewise.
	(atomic_ldop): Likewise.

[-- Attachment #2: 0001-AArch64-Move-atomics-iterators-into-iteraors.md.patch --]
[-- Type: text/x-patch, Size: 4216 bytes --]

From 90471e373421b838d1069cddb54abe0377fdc244 Mon Sep 17 00:00:00 2001
From: Matthew Wahab <matthew.wahab@arm.com>
Date: Thu, 29 Oct 2015 15:44:41 +0000
Subject: [PATCH] [AArch64] Move atomics iterators into iteraors.md

Change-Id: Ie83ae9c983762c10920db6bf3f2e2d4fa33167b2
---
 gcc/config/aarch64/atomics.md   | 28 ----------------------------
 gcc/config/aarch64/iterators.md | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 28 deletions(-)

diff --git a/gcc/config/aarch64/atomics.md b/gcc/config/aarch64/atomics.md
index e7ac5f6..3c034fb 100644
--- a/gcc/config/aarch64/atomics.md
+++ b/gcc/config/aarch64/atomics.md
@@ -18,34 +18,6 @@
 ;; along with GCC; see the file COPYING3.  If not see
 ;; <http://www.gnu.org/licenses/>.
 
-(define_c_enum "unspecv"
- [
-    UNSPECV_LX				; Represent a load-exclusive.
-    UNSPECV_SX				; Represent a store-exclusive.
-    UNSPECV_LDA				; Represent an atomic load or load-acquire.
-    UNSPECV_STL				; Represent an atomic store or store-release.
-    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.
-    UNSPECV_ATOMIC_LDOP			; Represent an atomic load-operation
-    UNSPECV_ATOMIC_LDOP_OR		; Represent an atomic load-or
-    UNSPECV_ATOMIC_LDOP_BIC		; Represent an atomic load-bic
-    UNSPECV_ATOMIC_LDOP_XOR		; Represent an atomic load-xor
-    UNSPECV_ATOMIC_LDOP_PLUS		; Represent an atomic load-add
-])
-
-;; Iterators for load-operate instructions.
-
-(define_int_iterator ATOMIC_LDOP
- [UNSPECV_ATOMIC_LDOP_OR UNSPECV_ATOMIC_LDOP_BIC
-  UNSPECV_ATOMIC_LDOP_XOR UNSPECV_ATOMIC_LDOP_PLUS])
-
-(define_int_attr atomic_ldop
- [(UNSPECV_ATOMIC_LDOP_OR "set") (UNSPECV_ATOMIC_LDOP_BIC "clr")
-  (UNSPECV_ATOMIC_LDOP_XOR "eor") (UNSPECV_ATOMIC_LDOP_PLUS "add")])
-
 ;; Instruction patterns.
 
 (define_expand "atomic_compare_and_swap<mode>"
diff --git a/gcc/config/aarch64/iterators.md b/gcc/config/aarch64/iterators.md
index 964f8f1..fe7ca39 100644
--- a/gcc/config/aarch64/iterators.md
+++ b/gcc/config/aarch64/iterators.md
@@ -305,6 +305,29 @@
     UNSPEC_VEC_SHR      ; Used in aarch64-simd.md.
 ])
 
+;; ------------------------------------------------------------------
+;; Unspec enumerations for Atomics.  They are here so that they can be
+;; used in the int_iterators for atomic operations.
+;; ------------------------------------------------------------------
+
+(define_c_enum "unspecv"
+ [
+    UNSPECV_LX			; Represent a load-exclusive.
+    UNSPECV_SX			; Represent a store-exclusive.
+    UNSPECV_LDA			; Represent an atomic load or load-acquire.
+    UNSPECV_STL			; Represent an atomic store or store-release.
+    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.
+    UNSPECV_ATOMIC_LDOP		; Represent an atomic load-operation
+    UNSPECV_ATOMIC_LDOP_OR	; Represent an atomic load-or
+    UNSPECV_ATOMIC_LDOP_BIC	; Represent an atomic load-bic
+    UNSPECV_ATOMIC_LDOP_XOR	; Represent an atomic load-xor
+    UNSPECV_ATOMIC_LDOP_PLUS	; Represent an atomic load-add
+])
+
 ;; -------------------------------------------------------------------
 ;; Mode attributes
 ;; -------------------------------------------------------------------
@@ -958,6 +981,16 @@
 
 (define_int_iterator CRYPTO_SHA256 [UNSPEC_SHA256H UNSPEC_SHA256H2])
 
+;; Iterators for atomic operations.
+
+(define_int_iterator ATOMIC_LDOP
+ [UNSPECV_ATOMIC_LDOP_OR UNSPECV_ATOMIC_LDOP_BIC
+  UNSPECV_ATOMIC_LDOP_XOR UNSPECV_ATOMIC_LDOP_PLUS])
+
+(define_int_attr atomic_ldop
+ [(UNSPECV_ATOMIC_LDOP_OR "set") (UNSPECV_ATOMIC_LDOP_BIC "clr")
+  (UNSPECV_ATOMIC_LDOP_XOR "eor") (UNSPECV_ATOMIC_LDOP_PLUS "add")])
+
 ;; -------------------------------------------------------------------
 ;; Int Iterators Attributes.
 ;; -------------------------------------------------------------------
-- 
2.1.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [AArch64] Move iterators from atomics.md to iterators.md
  2015-11-02 11:44 [AArch64] Move iterators from atomics.md to iterators.md Matthew Wahab
@ 2015-11-10 15:34 ` James Greenhalgh
  0 siblings, 0 replies; 2+ messages in thread
From: James Greenhalgh @ 2015-11-10 15:34 UTC (permalink / raw)
  To: Matthew Wahab; +Cc: gcc-patches

On Mon, Nov 02, 2015 at 11:44:02AM +0000, Matthew Wahab wrote:
> Hello
> 
> One of the review comments for the v8.1 atomics patches was that the
> iterators and unspec declarations should be moved out of the atomics.md
> file (https://gcc.gnu.org/ml/gcc-patches/2015-09/msg01375.html).
> 
> The iterators in atomics.md are tied to the unspecv definition in the
> same file. This patch moves both into iterators.md.
> 
> Tested aarch64-none-elf with cross-compiled check-gcc and
> aarch64-none-linux-gnu with native bootstrap and make check.
> 
> Ok for trunk?

OK.

Thanks,
James

> Matthew
> 
> gcc/
> 2015-11-02  Matthew Wahab  <matthew.wahab@arm.com>
> 
> 	* config/aarch64/atomics.md (unspecv): Move to iterators.md.
> 	(ATOMIC_LDOP): Likewise.
> 	(atomic_ldop): Likewise.
> 	* config/aarch64/iterators.md (unspecv): Moved from atomics.md.
> 	(ATOMIC_LDOP): Likewise.
> 	(atomic_ldop): Likewise.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-10 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-02 11:44 [AArch64] Move iterators from atomics.md to iterators.md Matthew Wahab
2015-11-10 15:34 ` James Greenhalgh

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).