diff options
author | Chris Schlumberger-Socha <chris.schlumberger-socha@arm.com> | 2013-05-23 14:09:39 +0000 |
---|---|---|
committer | Marcus Shawcroft <mshawcroft@gcc.gnu.org> | 2013-05-23 14:09:39 +0000 |
commit | 83f8c41484c57a38a8749128ecdceb8dd963a69c (patch) | |
tree | 3349ef03e41dee3368a71151f22f556d0278223a /gcc | |
parent | 6ca935e617b8a290221de84ece668769a763fabf (diff) | |
download | gcc-83f8c41484c57a38a8749128ecdceb8dd963a69c.zip gcc-83f8c41484c57a38a8749128ecdceb8dd963a69c.tar.gz gcc-83f8c41484c57a38a8749128ecdceb8dd963a69c.tar.bz2 |
[AArch64] Refactor aarch64_mov_operand predicate.
Co-Authored-By: Marcus Shawcroft <marcus.shawcroft@arm.com>
From-SVN: r199259
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 19 | ||||
-rw-r--r-- | gcc/config/aarch64/predicates.md | 11 |
4 files changed, 30 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 02335f0..3ba9d4e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2013-05-23 Chris Schlumberger-Socha <chris.schlumberger-socha@arm.com> + Marcus Shawcroft <marcus.shawcroft@arm.com> + + * config/aarch64/aarch64-protos.h (aarch64_mov_operand_p): Define. + * config/aarch64/aarch64.c (aarch64_mov_operand_p): Define. + * config/aarch64/predicates.md (aarch64_const_address): Remove. + (aarch64_mov_operand): Use aarch64_mov_operand_p. + 2013-05-23 Vidya Praveen <vidyapraveen@arm.com> * config/aarch64/aarch64-simd.md (clzv4si2): Support for CLZ diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index 001842e..91fcde8 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -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); diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index a0aff58..12a7055 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -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) diff --git a/gcc/config/aarch64/predicates.md b/gcc/config/aarch64/predicates.md index 8514e8f..16c4385 100644 --- a/gcc/config/aarch64/predicates.md +++ b/gcc/config/aarch64/predicates.md @@ -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") |