@@ -18,18 +18,38 @@
;; along with GCC; see the file COPYING3. If not see
;; <http://www.gnu.org/licenses/>.
-(define_predicate "rl78_any_operand"
+(define_predicate "rl78_volatile_memory_operand"
+ (and (match_code "mem")
+ (match_test ("memory_address_addr_space_p (GET_MODE (op), XEXP
(op, 0), MEM_ADDR_SPACE (op))")))
+)
+
+; TRUE for any valid general operand. We do this because
+; general_operand refuses to match volatile memory refs.
+
+(define_predicate "rl78_general_operand"
(ior (match_operand 0 "general_operand")
+ (match_operand 0 "rl78_volatile_memory_operand"))
+)
+
+; Likewise for nonimmediate_operand.
+
+(define_predicate "rl78_nonimmediate_operand"
+ (ior (match_operand 0 "nonimmediate_operand")
+ (match_operand 0 "rl78_volatile_memory_operand"))
+)
+
+(define_predicate "rl78_any_operand"
+ (ior (match_operand 0 "rl78_general_operand")
(match_code "mem,const_int,const_double,reg"))
)
(define_predicate "rl78_nonfar_operand"
- (and (match_operand 0 "general_operand")
+ (and (match_operand 0 "rl78_general_operand")
(not (match_test "rl78_far_p (op)")))
)
(define_predicate "rl78_nonfar_nonimm_operand"
- (and (match_operand 0 "nonimmediate_operand")
+ (and (match_operand 0 "rl78_nonimmediate_operand")
(not (match_test "rl78_far_p (op)")))
)