diff options
author | Joern Rennecke <joern.rennecke@embecosm.com> | 2014-04-11 18:40:04 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2014-04-11 19:40:04 +0100 |
commit | d9bb58007e769e747896eb134370d08d8e250123 (patch) | |
tree | bd2ddc451cd395bd4cbcd63344363a4cedf06d81 /gcc/config | |
parent | b5d0ecea7981806ffb1277f3087b242104722d36 (diff) | |
download | gcc-d9bb58007e769e747896eb134370d08d8e250123.zip gcc-d9bb58007e769e747896eb134370d08d8e250123.tar.gz gcc-d9bb58007e769e747896eb134370d08d8e250123.tar.bz2 |
gcc:
* common/config/epiphany/epiphany-common.c
(epiphany_option_optimization_table): Enable section anchors by
default at -O1 or higher.
* config/epiphany/epiphany.c (TARGET_MAX_ANCHOR_OFFSET): Define.
(TARGET_MIN_ANCHOR_OFFSET): Likewise.
(epiphany_rtx_costs) <SET>: For binary operators, the set as such
carries no extra cost.
(epiphany_legitimate_address_p): For BLKmode, apply SImode check.
* config/epiphany/epiphany.h (ASM_OUTPUT_DEF): Define.
* config/epiphany/predicates.md (memclob_operand): New predicate.
* config/epiphany/epiphany.md (stack_adjust_add, stack_adjust_str):
Use memclob_operand predicate and X constraint for operand 3.
gcc/testsuite:
* gcc.target/epiphany/t1068-2.c: New file.
From-SVN: r209320
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/epiphany/epiphany.c | 18 | ||||
-rw-r--r-- | gcc/config/epiphany/epiphany.h | 11 | ||||
-rw-r--r-- | gcc/config/epiphany/epiphany.md | 4 | ||||
-rw-r--r-- | gcc/config/epiphany/predicates.md | 5 |
4 files changed, 35 insertions, 3 deletions
diff --git a/gcc/config/epiphany/epiphany.c b/gcc/config/epiphany/epiphany.c index 8e45ea7..f3955b9 100644 --- a/gcc/config/epiphany/epiphany.c +++ b/gcc/config/epiphany/epiphany.c @@ -145,6 +145,13 @@ static rtx frame_insn (rtx); hook_bool_const_tree_hwi_hwi_const_tree_true #define TARGET_ASM_OUTPUT_MI_THUNK epiphany_output_mi_thunk +/* ??? we can use larger offsets for wider-mode sized accesses, but there + is no concept of anchors being dependent on the modes that they are used + for, so we can only use an offset range that would suit all modes. */ +#define TARGET_MAX_ANCHOR_OFFSET (optimize_size ? 31 : 2047) +/* We further restrict the minimum to be a multiple of eight. */ +#define TARGET_MIN_ANCHOR_OFFSET (optimize_size ? 0 : -2040) + #include "target-def.h" #undef TARGET_ASM_ALIGNED_HI_OP @@ -776,6 +783,15 @@ epiphany_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED, return false; } + + case SET: + { + rtx src = SET_SRC (x); + if (BINARY_P (src)) + *total = 0; + return false; + } + default: return false; } @@ -2016,7 +2032,7 @@ epiphany_legitimate_address_p (enum machine_mode mode, rtx x, bool strict) && LEGITIMATE_OFFSET_ADDRESS_P (mode, XEXP ((x), 1))) return true; if (mode == BLKmode) - return true; + return epiphany_legitimate_address_p (SImode, x, strict); return false; } diff --git a/gcc/config/epiphany/epiphany.h b/gcc/config/epiphany/epiphany.h index cffb00c..1ca92e0 100644 --- a/gcc/config/epiphany/epiphany.h +++ b/gcc/config/epiphany/epiphany.h @@ -942,4 +942,15 @@ extern rtl_opt_pass *make_pass_resolve_sw_modes (gcc::context *ctxt); #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ epiphany_start_function ((FILE), (NAME), (DECL)) +/* This is how we tell the assembler that two symbols have the same value. */ +#define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \ + do \ + { \ + assemble_name (FILE, NAME1); \ + fputs (" = ", FILE); \ + assemble_name (FILE, NAME2); \ + fputc ('\n', FILE); \ + } \ + while (0) + #endif /* !GCC_EPIPHANY_H */ diff --git a/gcc/config/epiphany/epiphany.md b/gcc/config/epiphany/epiphany.md index 2844eee..d8d5555 100644 --- a/gcc/config/epiphany/epiphany.md +++ b/gcc/config/epiphany/epiphany.md @@ -2380,7 +2380,7 @@ (plus:SI (reg:SI GPR_SP) (match_operand:SI 0 "arith_operand" "rL"))) (clobber (reg:CC CC_REGNUM)) (clobber (reg:SI STATUS_REGNUM)) - (clobber (match_operand:BLK 1 "memory_operand" "=m"))] + (clobber (match_operand:BLK 1 "memclob_operand" "=X"))] "reload_completed" "add sp,sp,%0") @@ -2396,7 +2396,7 @@ (match_operand 1 "any_gpr_operand" "r")) (set (reg:SI GPR_SP) (plus:SI (reg:SI GPR_SP) (match_operand:SI 2 "nonmemory_operand" "rn"))) - (clobber (match_operand:BLK 3 "memory_operand" "=m"))] + (clobber (match_operand:BLK 3 "memclob_operand" "=X"))] "reload_completed" { return (GET_MODE_SIZE (GET_MODE (operands[0])) <= 4 diff --git a/gcc/config/epiphany/predicates.md b/gcc/config/epiphany/predicates.md index fb8fd88..fb5ee12 100644 --- a/gcc/config/epiphany/predicates.md +++ b/gcc/config/epiphany/predicates.md @@ -358,6 +358,11 @@ (and (match_code "mem") (match_test "post_modify_address (XEXP (op, 0), Pmode)"))) +; used in the memory clobber of stack_adjust_str, allows addresses with +; large offsets. +(define_predicate "memclob_operand" + (match_code "mem")) + (define_predicate "nonsymbolic_immediate_operand" (ior (match_test "immediate_operand (op, mode)") (match_code "const_vector"))) /* Is this specific enough? */ |