aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>2012-10-02 01:38:30 +0159
committerBernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>2012-10-02 01:38:30 +0159
commit15394ef2506ec5b0e9ddb89c8bc153b9e2f39c8c (patch)
treef9879f68171adfb818068865d098b93bbb30c5f5
parent84c1139dabfcb7c4a02a39acef7b835cb0ad4584 (diff)
downloadgcc-aarch64-15394ef2506ec5b0e9ddb89c8bc153b9e2f39c8c.tar.gz
Sync with svn rev. 191923
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
-rw-r--r--gcc/ChangeLog.aarch649
-rw-r--r--gcc/config/aarch64/aarch64.c62
-rw-r--r--gcc/config/aarch64/aarch64.md2
-rw-r--r--gcc/config/aarch64/predicates.md4
4 files changed, 50 insertions, 27 deletions
diff --git a/gcc/ChangeLog.aarch64 b/gcc/ChangeLog.aarch64
index 983fa7bda..3ac47220f 100644
--- a/gcc/ChangeLog.aarch64
+++ b/gcc/ChangeLog.aarch64
@@ -1,3 +1,12 @@
+2012-10-01 Ian Bolton <ian.bolton@arm.com>
+ Richard Henderson <rth@redhat.com>
+
+ * config/aarch64/aarch64.c (aarch64_expand_mov_immediate): Fix a
+ functional typo and refactor code in switch statement.
+ * config/aarch64/aarch64.md (add_losym): Handle symbol + offset.
+ * config/aarch64/predicates.md (aarch64_tls_ie_symref): Match const.
+ (aarch64_tls_le_symref): Likewise.
+
2012-09-26 Marcus Shawcroft <marcus.shawcroft@arm.com>
* config/aarch64/predicates.md (aarch64_simd_reg_or_zero): Remove
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index fbee64dde..889d19e40 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -686,43 +686,57 @@ aarch64_expand_mov_immediate (rtx dest, rtx imm)
unsigned HOST_WIDE_INT val;
bool subtargets;
rtx subtarget;
- rtx base, offset;
int one_match, zero_match;
gcc_assert (mode == SImode || mode == DImode);
- /* If we have (const (plus symbol offset)), and that expression cannot
- be forced into memory, load the symbol first and add in the offset. */
- split_const (imm, &base, &offset);
- if (offset != const0_rtx
- && (targetm.cannot_force_const_mem (mode, imm)
- || (can_create_pseudo_p ())))
- {
- base = aarch64_force_temporary (dest, base);
- aarch64_emit_move (dest, aarch64_add_offset (mode, NULL, base, INTVAL (offset)));
- return;
- }
-
/* Check on what type of symbol it is. */
- if (GET_CODE (base) == SYMBOL_REF || GET_CODE (base) == LABEL_REF)
+ if (GET_CODE (imm) == SYMBOL_REF
+ || GET_CODE (imm) == LABEL_REF
+ || GET_CODE (imm) == CONST)
{
- rtx mem;
- switch (aarch64_classify_symbol (base, SYMBOL_CONTEXT_ADR))
+ rtx mem, base, offset;
+ enum aarch64_symbol_type sty;
+
+ /* If we have (const (plus symbol offset)), separate out the offset
+ before we start classifying the symbol. */
+ split_const (imm, &base, &offset);
+
+ sty = aarch64_classify_symbol (base, SYMBOL_CONTEXT_ADR);
+ switch (sty)
{
case SYMBOL_FORCE_TO_MEM:
- mem = force_const_mem (mode, imm);
+ if (offset != const0_rtx
+ && targetm.cannot_force_const_mem (mode, imm))
+ {
+ gcc_assert(can_create_pseudo_p ());
+ base = aarch64_force_temporary (dest, base);
+ base = aarch64_add_offset (mode, NULL, base, INTVAL (offset));
+ aarch64_emit_move (dest, base);
+ return;
+ }
+ mem = force_const_mem (mode, imm);
gcc_assert (mem);
emit_insn (gen_rtx_SET (VOIDmode, dest, mem));
return;
- case SYMBOL_SMALL_TLSGD:
- case SYMBOL_SMALL_TLSDESC:
- case SYMBOL_SMALL_GOTTPREL:
- case SYMBOL_SMALL_TPREL:
+ case SYMBOL_SMALL_TLSGD:
+ case SYMBOL_SMALL_TLSDESC:
+ case SYMBOL_SMALL_GOTTPREL:
case SYMBOL_SMALL_GOT:
+ if (offset != const0_rtx)
+ {
+ gcc_assert(can_create_pseudo_p ());
+ base = aarch64_force_temporary (dest, base);
+ base = aarch64_add_offset (mode, NULL, base, INTVAL (offset));
+ aarch64_emit_move (dest, base);
+ return;
+ }
+ /* FALLTHRU */
+
+ case SYMBOL_SMALL_TPREL:
case SYMBOL_SMALL_ABSOLUTE:
- aarch64_load_symref_appropriately
- (dest, imm, aarch64_classify_symbol (base, SYMBOL_CONTEXT_ADR));
+ aarch64_load_symref_appropriately (dest, imm, sty);
return;
default:
@@ -730,7 +744,7 @@ aarch64_expand_mov_immediate (rtx dest, rtx imm)
}
}
- if ((CONST_INT_P (imm) && aarch64_move_imm (INTVAL (imm), mode)))
+ if (CONST_INT_P (imm) && aarch64_move_imm (INTVAL (imm), mode))
{
emit_insn (gen_rtx_SET (VOIDmode, dest, imm));
return;
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index 38cbfcdff..241bc9213 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -2823,7 +2823,7 @@
(lo_sum:DI (match_operand:DI 1 "register_operand" "r")
(match_operand 2 "aarch64_valid_symref" "S")))]
""
- "add\\t%0, %1, :lo12:%2"
+ "add\\t%0, %1, :lo12:%a2"
[(set_attr "v8type" "alu")
(set_attr "mode" "DI")]
diff --git a/gcc/config/aarch64/predicates.md b/gcc/config/aarch64/predicates.md
index 1f01222bd..6f7903964 100644
--- a/gcc/config/aarch64/predicates.md
+++ b/gcc/config/aarch64/predicates.md
@@ -122,7 +122,7 @@
})
(define_predicate "aarch64_tls_ie_symref"
- (match_code "symbol_ref, label_ref")
+ (match_code "const, symbol_ref, label_ref")
{
switch (GET_CODE (op))
{
@@ -143,7 +143,7 @@
})
(define_predicate "aarch64_tls_le_symref"
- (match_code "symbol_ref, label_ref")
+ (match_code "const, symbol_ref, label_ref")
{
switch (GET_CODE (op))
{