From a6e0bfa7ca349b889d4a2c689984b63680ada211 Mon Sep 17 00:00:00 2001 From: Jiong Wang Date: Thu, 24 Sep 2015 16:02:08 +0000 Subject: [PATCH] [AArch64] Delete aarch64_symbol_context which is not used 2015-09-24 Jiong Wang * config/aarch64/aarch64-protos.h (aarch64_symbol_context): Delete. * config/aarch64/aarch64.c (aarch64_expand_mov_immediate): Likewise. (aarch64_cannot_force_const_mem): Likewise. (aarch64_classify_address): Likewise. (aarch64_classify_symbolic_expression): Likewise. (aarch64_print_operand): Likewise. (aarch64_classify_symbol): Likewise. (aarch64_mov_operand_p): Likewise. * config/aarch64/predicates.md (aarch64_valid_symref): Likewise. (aarch64_mov_operand): Likewise. From-SVN: r228092 --- gcc/ChangeLog | 13 ++++++++++++ gcc/config/aarch64/aarch64-protos.h | 21 +++---------------- gcc/config/aarch64/aarch64.c | 32 ++++++++++++----------------- gcc/config/aarch64/predicates.md | 4 ++-- 4 files changed, 31 insertions(+), 39 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 57ec1f6c271..0b7b59fd9de 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2015-09-24 Jiong Wang + + * config/aarch64/aarch64-protos.h (aarch64_symbol_context): Delete. + * config/aarch64/aarch64.c (aarch64_expand_mov_immediate): Likewise. + (aarch64_cannot_force_const_mem): Likewise. + (aarch64_classify_address): Likewise. + (aarch64_classify_symbolic_expression): Likewise. + (aarch64_print_operand): Likewise. + (aarch64_classify_symbol): Likewise. + (aarch64_mov_operand_p): Likewise. + * config/aarch64/predicates.md (aarch64_valid_symref): Likewise. + (aarch64_mov_operand): Likewise. + 2015-09-24 Segher Boessenkool * config/rs6000/rs6000.c (debug_stack_info): Invert the test diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index dd8ebcca167..baaf1bd776d 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -24,18 +24,6 @@ #include "input.h" -/* - SYMBOL_CONTEXT_ADR - The symbol is used in a load-address operation. - SYMBOL_CONTEXT_MEM - The symbol is used as the address in a MEM. - */ -enum aarch64_symbol_context -{ - SYMBOL_CONTEXT_MEM, - SYMBOL_CONTEXT_ADR -}; - /* SYMBOL_SMALL_ABSOLUTE: Generate symbol accesses through high and lo relocs that calculate the base address using a PC relative reloc. @@ -258,8 +246,7 @@ HOST_WIDE_INT aarch64_initial_elimination_offset (unsigned, unsigned); int aarch64_get_condition_code (rtx); bool aarch64_bitmask_imm (HOST_WIDE_INT val, machine_mode); int aarch64_branch_cost (bool, bool); -enum aarch64_symbol_type -aarch64_classify_symbolic_expression (rtx, enum aarch64_symbol_context); +enum aarch64_symbol_type aarch64_classify_symbolic_expression (rtx); bool aarch64_const_vec_all_same_int_p (rtx, HOST_WIDE_INT); bool aarch64_constant_address_p (rtx); bool aarch64_expand_movmem (rtx *); @@ -278,8 +265,7 @@ bool aarch64_legitimate_pic_operand_p (rtx); bool aarch64_modes_tieable_p (machine_mode mode1, machine_mode mode2); bool aarch64_move_imm (HOST_WIDE_INT, machine_mode); -bool aarch64_mov_operand_p (rtx, enum aarch64_symbol_context, - machine_mode); +bool aarch64_mov_operand_p (rtx, machine_mode); int aarch64_simd_attr_length_rglist (enum machine_mode); rtx aarch64_reverse_mask (enum machine_mode); bool aarch64_offset_7bit_signed_scaled_p (machine_mode, HOST_WIDE_INT); @@ -304,8 +290,7 @@ const char *aarch64_mangle_builtin_type (const_tree); const char *aarch64_output_casesi (rtx *); const char *aarch64_rewrite_selected_cpu (const char *name); -enum aarch64_symbol_type aarch64_classify_symbol (rtx, rtx, - enum aarch64_symbol_context); +enum aarch64_symbol_type aarch64_classify_symbol (rtx, rtx); enum aarch64_symbol_type aarch64_classify_tls_symbol (rtx); enum reg_class aarch64_regno_regclass (unsigned); int aarch64_asm_preferred_eh_data_format (int, int); diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 3c8c058edda..f7346ec13db 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -1547,7 +1547,7 @@ aarch64_expand_mov_immediate (rtx dest, rtx imm) before we start classifying the symbol. */ split_const (imm, &base, &offset); - sty = aarch64_classify_symbol (base, offset, SYMBOL_CONTEXT_ADR); + sty = aarch64_classify_symbol (base, offset); switch (sty) { case SYMBOL_FORCE_TO_MEM: @@ -3250,7 +3250,7 @@ aarch64_cannot_force_const_mem (machine_mode mode ATTRIBUTE_UNUSED, rtx x) split_const (x, &base, &offset); if (GET_CODE (base) == SYMBOL_REF || GET_CODE (base) == LABEL_REF) { - if (aarch64_classify_symbol (base, offset, SYMBOL_CONTEXT_ADR) + if (aarch64_classify_symbol (base, offset) != SYMBOL_FORCE_TO_MEM) return true; else @@ -3696,8 +3696,7 @@ aarch64_classify_address (struct aarch64_address_info *info, rtx sym, offs; split_const (info->offset, &sym, &offs); if (GET_CODE (sym) == SYMBOL_REF - && (aarch64_classify_symbol (sym, offs, SYMBOL_CONTEXT_MEM) - == SYMBOL_SMALL_ABSOLUTE)) + && (aarch64_classify_symbol (sym, offs) == SYMBOL_SMALL_ABSOLUTE)) { /* The symbol and offset must be aligned to the access size. */ unsigned int align; @@ -3743,17 +3742,15 @@ aarch64_symbolic_address_p (rtx x) return GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF; } -/* Classify the base of symbolic expression X, given that X appears in - context CONTEXT. */ +/* Classify the base of symbolic expression X. */ enum aarch64_symbol_type -aarch64_classify_symbolic_expression (rtx x, - enum aarch64_symbol_context context) +aarch64_classify_symbolic_expression (rtx x) { rtx offset; split_const (x, &x, &offset); - return aarch64_classify_symbol (x, offset, context); + return aarch64_classify_symbol (x, offset); } @@ -4441,7 +4438,7 @@ aarch64_print_operand (FILE *f, rtx x, char code) if (GET_CODE (x) == HIGH) x = XEXP (x, 0); - switch (aarch64_classify_symbolic_expression (x, SYMBOL_CONTEXT_ADR)) + switch (aarch64_classify_symbolic_expression (x)) { case SYMBOL_SMALL_GOT_4G: asm_fprintf (asm_out_file, ":got:"); @@ -4474,7 +4471,7 @@ aarch64_print_operand (FILE *f, rtx x, char code) break; case 'L': - switch (aarch64_classify_symbolic_expression (x, SYMBOL_CONTEXT_ADR)) + switch (aarch64_classify_symbolic_expression (x)) { case SYMBOL_SMALL_GOT_4G: asm_fprintf (asm_out_file, ":lo12:"); @@ -4516,7 +4513,7 @@ aarch64_print_operand (FILE *f, rtx x, char code) case 'G': - switch (aarch64_classify_symbolic_expression (x, SYMBOL_CONTEXT_ADR)) + switch (aarch64_classify_symbolic_expression (x)) { case SYMBOL_TLSLE24: asm_fprintf (asm_out_file, ":tprel_hi12:"); @@ -8753,11 +8750,10 @@ aarch64_classify_tls_symbol (rtx x) } /* Return the method that should be used to access SYMBOL_REF or - LABEL_REF X in context CONTEXT. */ + LABEL_REF X. */ enum aarch64_symbol_type -aarch64_classify_symbol (rtx x, rtx offset, - enum aarch64_symbol_context context ATTRIBUTE_UNUSED) +aarch64_classify_symbol (rtx x, rtx offset) { if (GET_CODE (x) == LABEL_REF) { @@ -10185,9 +10181,7 @@ aarch64_simd_imm_scalar_p (rtx x, machine_mode mode ATTRIBUTE_UNUSED) } bool -aarch64_mov_operand_p (rtx x, - enum aarch64_symbol_context context, - machine_mode mode) +aarch64_mov_operand_p (rtx x, machine_mode mode) { if (GET_CODE (x) == HIGH && aarch64_valid_symref (XEXP (x, 0), GET_MODE (XEXP (x, 0)))) @@ -10199,7 +10193,7 @@ aarch64_mov_operand_p (rtx x, if (GET_CODE (x) == SYMBOL_REF && mode == DImode && CONSTANT_ADDRESS_P (x)) return true; - return aarch64_classify_symbolic_expression (x, context) + return aarch64_classify_symbolic_expression (x) == SYMBOL_TINY_ABSOLUTE; } diff --git a/gcc/config/aarch64/predicates.md b/gcc/config/aarch64/predicates.md index 7b852a43ff5..7841378a5da 100644 --- a/gcc/config/aarch64/predicates.md +++ b/gcc/config/aarch64/predicates.md @@ -165,7 +165,7 @@ (define_predicate "aarch64_valid_symref" (match_code "const, symbol_ref, label_ref") { - return (aarch64_classify_symbolic_expression (op, SYMBOL_CONTEXT_ADR) + return (aarch64_classify_symbolic_expression (op) != SYMBOL_FORCE_TO_MEM); }) @@ -215,7 +215,7 @@ (and (match_code "reg,subreg,mem,const,const_int,symbol_ref,label_ref,high") (ior (match_operand 0 "register_operand") (ior (match_operand 0 "memory_operand") - (match_test "aarch64_mov_operand_p (op, SYMBOL_CONTEXT_ADR, mode)"))))) + (match_test "aarch64_mov_operand_p (op, mode)"))))) (define_predicate "aarch64_movti_operand" (and (match_code "reg,subreg,mem,const_int") -- 2.30.2