aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYvan Roux <yvan.roux@linaro.org>2015-11-26 10:40:11 +0100
committerYvan Roux <yvan.roux@linaro.org>2015-11-26 10:40:11 +0100
commit33f4d65e57cc14fe04e8e5b5a3ab312e735f20f4 (patch)
treec7ead91f87478e264126bbb5da67c3b10cc64752
parent86f82424c4bd01b3d8f48afaecfc358264766eeb (diff)
gcc/
Backport from trunk r228092. 2015-09-24 Jiong Wang <jiong.wang@arm.com> * 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. Change-Id: Ief9c573dc60bb54e2b38713ca678d16e501687e2
-rw-r--r--gcc/config/aarch64/aarch64-protos.h21
-rw-r--r--gcc/config/aarch64/aarch64.c32
-rw-r--r--gcc/config/aarch64/predicates.md4
3 files changed, 18 insertions, 39 deletions
diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h
index f8da338b0d6..3c46222d659 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.
@@ -259,8 +247,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 *);
@@ -279,8 +266,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);
@@ -305,8 +291,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 c76fd8b7a6e..86037544dc2 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -1553,7 +1553,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:
@@ -3240,7 +3240,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
@@ -3697,8 +3697,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;
@@ -3744,17 +3743,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);
}
@@ -4443,7 +4440,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:");
@@ -4476,7 +4473,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:");
@@ -4518,7 +4515,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:");
@@ -8665,11 +8662,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)
{
@@ -10109,9 +10105,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))))
@@ -10123,7 +10117,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 39792097220..ee16dc88bd0 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")