summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authormshawcroft <mshawcroft@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-02 09:01:56 +0000
committermshawcroft <mshawcroft@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-02 09:01:56 +0000
commit9405661001d6a96c44dbb838da645611ddd0113c (patch)
tree4683e831dc007ccb3697f36037259384cf94f02c /gcc
parent66f19dbbbf8f748657fdc62fd9ee1eb2b3aead77 (diff)
downloadgcc-9405661001d6a96c44dbb838da645611ddd0113c.tar.gz
2010-09-02 Marcus Shawcroft <marcus.shawcroft@arm.com>
* config/arm/predicates.md (arm_sync_memory_operand): New. * config/arm/sync.md (arm_sync_compare_and_swapsi): Change predicate to arm_sync_memory_operand and constraint to Q. (arm_sync_compare_and_swap<mode>): Likewise. (arm_sync_compare_and_swap<mode>): Likewise. (arm_sync_lock_test_and_setsi): Likewise. (arm_sync_lock_test_and_set<mode>): Likewise. (arm_sync_new_<sync_optab>si): Likewise. (arm_sync_new_nandsi): Likewise. (arm_sync_new_<sync_optab><mode>): Likewise. (arm_sync_new_nand<mode>): Likewise. (arm_sync_old_<sync_optab>si): Likewise. (arm_sync_old_nandsi): Likewise. (arm_sync_old_<sync_optab><mode>): Likewise. (arm_sync_old_nand<mode>): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163765 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/arm/predicates.md5
-rw-r--r--gcc/config/arm/sync.md24
2 files changed, 17 insertions, 12 deletions
diff --git a/gcc/config/arm/predicates.md b/gcc/config/arm/predicates.md
index 032b2ecaaf3..54f4861a008 100644
--- a/gcc/config/arm/predicates.md
+++ b/gcc/config/arm/predicates.md
@@ -619,6 +619,11 @@
(and (match_test "TARGET_32BIT")
(match_operand 0 "arm_di_operand"))))
+;; True if the operand is memory reference suitable for a ldrex/strex.
+(define_predicate "arm_sync_memory_operand"
+ (and (match_operand 0 "memory_operand")
+ (match_code "reg" "0")))
+
;; Predicates for parallel expanders based on mode.
(define_special_predicate "vect_par_constant_high"
(match_code "parallel")
diff --git a/gcc/config/arm/sync.md b/gcc/config/arm/sync.md
index 7fd38d75484..f942d1f94e7 100644
--- a/gcc/config/arm/sync.md
+++ b/gcc/config/arm/sync.md
@@ -280,7 +280,7 @@
(define_insn "arm_sync_compare_and_swapsi"
[(set (match_operand:SI 0 "s_register_operand" "=&r")
(unspec_volatile:SI
- [(match_operand:SI 1 "memory_operand" "+m")
+ [(match_operand:SI 1 "arm_sync_memory_operand" "+Q")
(match_operand:SI 2 "s_register_operand" "r")
(match_operand:SI 3 "s_register_operand" "r")]
VUNSPEC_SYNC_COMPARE_AND_SWAP))
@@ -307,7 +307,7 @@
[(set (match_operand:SI 0 "s_register_operand" "=&r")
(zero_extend:SI
(unspec_volatile:NARROW
- [(match_operand:NARROW 1 "memory_operand" "+m")
+ [(match_operand:NARROW 1 "arm_sync_memory_operand" "+Q")
(match_operand:SI 2 "s_register_operand" "r")
(match_operand:SI 3 "s_register_operand" "r")]
VUNSPEC_SYNC_COMPARE_AND_SWAP)))
@@ -332,7 +332,7 @@
(define_insn "arm_sync_lock_test_and_setsi"
[(set (match_operand:SI 0 "s_register_operand" "=&r")
- (match_operand:SI 1 "memory_operand" "+m"))
+ (match_operand:SI 1 "arm_sync_memory_operand" "+Q"))
(set (match_dup 1)
(unspec_volatile:SI [(match_operand:SI 2 "s_register_operand" "r")]
VUNSPEC_SYNC_LOCK))
@@ -353,7 +353,7 @@
(define_insn "arm_sync_lock_test_and_set<mode>"
[(set (match_operand:SI 0 "s_register_operand" "=&r")
- (zero_extend:SI (match_operand:NARROW 1 "memory_operand" "+m")))
+ (zero_extend:SI (match_operand:NARROW 1 "arm_sync_memory_operand" "+Q")))
(set (match_dup 1)
(unspec_volatile:NARROW [(match_operand:SI 2 "s_register_operand" "r")]
VUNSPEC_SYNC_LOCK))
@@ -375,7 +375,7 @@
(define_insn "arm_sync_new_<sync_optab>si"
[(set (match_operand:SI 0 "s_register_operand" "=&r")
(unspec_volatile:SI [(syncop:SI
- (match_operand:SI 1 "memory_operand" "+m")
+ (match_operand:SI 1 "arm_sync_memory_operand" "+Q")
(match_operand:SI 2 "s_register_operand" "r"))
]
VUNSPEC_SYNC_NEW_OP))
@@ -400,7 +400,7 @@
(define_insn "arm_sync_new_nandsi"
[(set (match_operand:SI 0 "s_register_operand" "=&r")
(unspec_volatile:SI [(not:SI (and:SI
- (match_operand:SI 1 "memory_operand" "+m")
+ (match_operand:SI 1 "arm_sync_memory_operand" "+Q")
(match_operand:SI 2 "s_register_operand" "r")))
]
VUNSPEC_SYNC_NEW_OP))
@@ -426,7 +426,7 @@
[(set (match_operand:SI 0 "s_register_operand" "=&r")
(unspec_volatile:SI [(syncop:SI
(zero_extend:SI
- (match_operand:NARROW 1 "memory_operand" "+m"))
+ (match_operand:NARROW 1 "arm_sync_memory_operand" "+Q"))
(match_operand:SI 2 "s_register_operand" "r"))
]
VUNSPEC_SYNC_NEW_OP))
@@ -454,7 +454,7 @@
[(not:SI
(and:SI
(zero_extend:SI
- (match_operand:NARROW 1 "memory_operand" "+m"))
+ (match_operand:NARROW 1 "arm_sync_memory_operand" "+Q"))
(match_operand:SI 2 "s_register_operand" "r")))
] VUNSPEC_SYNC_NEW_OP))
(set (match_dup 1)
@@ -478,7 +478,7 @@
(define_insn "arm_sync_old_<sync_optab>si"
[(set (match_operand:SI 0 "s_register_operand" "=&r")
(unspec_volatile:SI [(syncop:SI
- (match_operand:SI 1 "memory_operand" "+m")
+ (match_operand:SI 1 "arm_sync_memory_operand" "+Q")
(match_operand:SI 2 "s_register_operand" "r"))
]
VUNSPEC_SYNC_OLD_OP))
@@ -504,7 +504,7 @@
(define_insn "arm_sync_old_nandsi"
[(set (match_operand:SI 0 "s_register_operand" "=&r")
(unspec_volatile:SI [(not:SI (and:SI
- (match_operand:SI 1 "memory_operand" "+m")
+ (match_operand:SI 1 "arm_sync_memory_operand" "+Q")
(match_operand:SI 2 "s_register_operand" "r")))
]
VUNSPEC_SYNC_OLD_OP))
@@ -531,7 +531,7 @@
[(set (match_operand:SI 0 "s_register_operand" "=&r")
(unspec_volatile:SI [(syncop:SI
(zero_extend:SI
- (match_operand:NARROW 1 "memory_operand" "+m"))
+ (match_operand:NARROW 1 "arm_sync_memory_operand" "+Q"))
(match_operand:SI 2 "s_register_operand" "r"))
]
VUNSPEC_SYNC_OLD_OP))
@@ -558,7 +558,7 @@
[(set (match_operand:SI 0 "s_register_operand" "=&r")
(unspec_volatile:SI [(not:SI (and:SI
(zero_extend:SI
- (match_operand:NARROW 1 "memory_operand" "+m"))
+ (match_operand:NARROW 1 "arm_sync_memory_operand" "+Q"))
(match_operand:SI 2 "s_register_operand" "r")))
]
VUNSPEC_SYNC_OLD_OP))