diff options
author | Matthew Gretton-Dann <matthew.gretton-dann@linaro.org> | 2013-02-26 12:35:30 +0000 |
---|---|---|
committer | Matthew Gretton-Dann <matthew.gretton-dann@linaro.org> | 2013-02-26 12:35:30 +0000 |
commit | dbc440b5b02f909263706b3448f6ffdd9c90031b (patch) | |
tree | 34b477a443af515d8d7c04b5e2abbd24a3b03cf8 | |
parent | cd167851d8e4a9cc8afc28b4708b5e8d3a05161a (diff) |
Backport /work/sources/gcc-bzr/arm-aarch64-4.7 r196014.
[AArch64-4.7] Backport: Implement section anchors
gcc/
* common/config/aarch64/aarch64-common.c
(aarch_option_optimization_table): New.
(TARGET_OPTION_OPTIMIZATION_TABLE): Define.
* gcc/config/aarch64/aarch64-elf.h (ASM_OUTPUT_DEF): New definition.
* gcc/config/aarch64/aarch64.c (TARGET_MIN_ANCHOR_OFFSET): Define.
(TARGET_MAX_ANCHOR_OFFSET): Likewise.
-rw-r--r-- | gcc/ChangeLog.aarch64 | 13 | ||||
-rw-r--r-- | gcc/common/config/aarch64/aarch64-common.c | 11 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64-elf.h | 9 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 11 |
4 files changed, 44 insertions, 0 deletions
diff --git a/gcc/ChangeLog.aarch64 b/gcc/ChangeLog.aarch64 index be507d633b1..0c34d52378a 100644 --- a/gcc/ChangeLog.aarch64 +++ b/gcc/ChangeLog.aarch64 @@ -1,3 +1,16 @@ +2013-02-13 James Greenhalgh <james.greenhalgh@arm.com> + + Backport from aarch64-branch. + 2012-09-06 James Greenhalgh <james.greenhalgh@arm.com> + Richard Earnshaw <rearnsha@arm.com> + + * common/config/aarch64/aarch64-common.c + (aarch_option_optimization_table): New. + (TARGET_OPTION_OPTIMIZATION_TABLE): Define. + * gcc/config/aarch64/aarch64-elf.h (ASM_OUTPUT_DEF): New definition. + * gcc/config/aarch64/aarch64.c (TARGET_MIN_ANCHOR_OFFSET): Define. + (TARGET_MAX_ANCHOR_OFFSET): Likewise. + 2013-02-04 James Greenhalgh <james.greenhalgh@arm.com> Backport from mainline. diff --git a/gcc/common/config/aarch64/aarch64-common.c b/gcc/common/config/aarch64/aarch64-common.c index df724063d27..bd249e126ee 100644 --- a/gcc/common/config/aarch64/aarch64-common.c +++ b/gcc/common/config/aarch64/aarch64-common.c @@ -36,6 +36,17 @@ #undef TARGET_HANDLE_OPTION #define TARGET_HANDLE_OPTION aarch64_handle_option +#undef TARGET_OPTION_OPTIMIZATION_TABLE +#define TARGET_OPTION_OPTIMIZATION_TABLE aarch_option_optimization_table + +/* Set default optimization options. */ +static const struct default_options aarch_option_optimization_table[] = + { + /* Enable section anchors by default at -O1 or higher. */ + { OPT_LEVELS_1_PLUS, OPT_fsection_anchors, NULL, 1 }, + { OPT_LEVELS_NONE, 0, NULL, 0 } + }; + /* Implement TARGET_HANDLE_OPTION. This function handles the target specific options for CPU/target selection. diff --git a/gcc/config/aarch64/aarch64-elf.h b/gcc/config/aarch64/aarch64-elf.h index 6d8b933729a..1c021d0ec05 100644 --- a/gcc/config/aarch64/aarch64-elf.h +++ b/gcc/config/aarch64/aarch64-elf.h @@ -25,6 +25,15 @@ #define ASM_OUTPUT_LABELREF(FILE, NAME) \ aarch64_asm_output_labelref (FILE, NAME) +#define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \ + do \ + { \ + assemble_name (FILE, NAME1); \ + fputs (" = ", FILE); \ + assemble_name (FILE, NAME2); \ + fputc ('\n', FILE); \ + } while (0) + #define TEXT_SECTION_ASM_OP "\t.text" #define DATA_SECTION_ASM_OP "\t.data" #define BSS_SECTION_ASM_OP "\t.bss" diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 1e546ccd37b..ed5b6bbf270 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -7950,6 +7950,17 @@ aarch64_vectorize_vec_perm_const_ok (enum machine_mode vmode, #define TARGET_VECTORIZE_VEC_PERM_CONST_OK \ aarch64_vectorize_vec_perm_const_ok +/* Section anchor support. */ + +#undef TARGET_MIN_ANCHOR_OFFSET +#define TARGET_MIN_ANCHOR_OFFSET -256 + +/* Limit the maximum anchor offset to 4k-1, since that's the limit for a + byte offset; we can do much more for larger data types, but have no way + to determine the size of the access. We assume accesses are aligned. */ +#undef TARGET_MAX_ANCHOR_OFFSET +#define TARGET_MAX_ANCHOR_OFFSET 4095 + struct gcc_target targetm = TARGET_INITIALIZER; #include "gt-aarch64.h" |