diff options
author | jgreenhalgh <jgreenhalgh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-02-13 13:45:27 +0000 |
---|---|---|
committer | jgreenhalgh <jgreenhalgh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-02-13 13:45:27 +0000 |
commit | ed2f6b7930bbbb36f5b90c8a981461c0978d7a7d (patch) | |
tree | 078ac28b71e6c46571b41dee00b97fb0f56bf3f2 | |
parent | 86c33d8e4d5be77eaf8676d27bb917095b61a177 (diff) |
[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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/ARM/aarch64-4.7-branch@196014 138bc75d-0d04-0410-961f-82ee72b054a4
-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 1fe2146d322..c6504679b33 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" |