@@ -146,6 +146,8 @@ bool aarch64_is_long_call_p (rtx);
bool aarch64_label_mentioned_p (rtx);
bool aarch64_legitimate_pic_operand_p (rtx);
bool aarch64_move_imm (HOST_WIDE_INT, enum machine_mode);
+bool aarch64_mov_operand_p (rtx, enum aarch64_symbol_context,
+ enum machine_mode);
bool aarch64_pad_arg_upward (enum machine_mode, const_tree);
bool aarch64_pad_reg_upward (enum machine_mode, const_tree, bool);
bool aarch64_regno_ok_for_base_p (int, bool);
@@ -6455,6 +6455,25 @@ aarch64_simd_imm_scalar_p (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
return true;
}
+bool
+aarch64_mov_operand_p (rtx x,
+ enum aarch64_symbol_context context ATTRIBUTE_UNUSED,
+ enum machine_mode mode)
+{
+
+ if (GET_CODE (x) == HIGH
+ && aarch64_valid_symref (XEXP (x, 0), GET_MODE (XEXP (x, 0))))
+ return true;
+
+ if (CONST_INT_P (x) && aarch64_move_imm (INTVAL (x), mode))
+ return true;
+
+ if (GET_CODE (x) == SYMBOL_REF && mode == DImode && CONSTANT_ADDRESS_P (x))
+ return true;
+
+ return false;
+}
+
/* Return a const_int vector of VAL. */
rtx
aarch64_simd_gen_const_vector_dup (enum machine_mode mode, int val)
@@ -115,10 +115,6 @@
(match_test "aarch64_legitimate_address_p (mode, XEXP (op, 0), PARALLEL,
0)")))
-(define_predicate "aarch64_const_address"
- (and (match_code "symbol_ref")
- (match_test "mode == DImode && CONSTANT_ADDRESS_P (op)")))
-
(define_predicate "aarch64_valid_symref"
(match_code "const, symbol_ref, label_ref")
{
@@ -173,12 +169,7 @@
(and (match_code "reg,subreg,mem,const_int,symbol_ref,high")
(ior (match_operand 0 "register_operand")
(ior (match_operand 0 "memory_operand")
- (ior (match_test "GET_CODE (op) == HIGH
- && aarch64_valid_symref (XEXP (op, 0),
- GET_MODE (XEXP (op, 0)))")
- (ior (match_test "CONST_INT_P (op)
- && aarch64_move_imm (INTVAL (op), mode)")
- (match_test "aarch64_const_address (op, mode)")))))))
+ (match_test "aarch64_mov_operand_p (op, SYMBOL_CONTEXT_ADR, mode)")))))
(define_predicate "aarch64_movti_operand"
(and (match_code "reg,subreg,mem,const_int")