[PR64164] Drop copyrename, use coalescible partition as base when optimizing.
[official-gcc.git] / gcc / config / aarch64 / aarch64-elf.h
blob1ce6343632784cd568efb3151ce621b38b6c9e86
1 /* Machine description for AArch64 architecture.
2 Copyright (C) 2009-2015 Free Software Foundation, Inc.
3 Contributed by ARM Ltd.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
12 GCC is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 #ifndef GCC_AARCH64_ELF_H
22 #define GCC_AARCH64_ELF_H
25 #define ASM_OUTPUT_LABELREF(FILE, NAME) \
26 aarch64_asm_output_labelref (FILE, NAME)
28 #define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \
29 do \
30 { \
31 assemble_name (FILE, NAME1); \
32 fputs (" = ", FILE); \
33 assemble_name (FILE, NAME2); \
34 fputc ('\n', FILE); \
35 } while (0)
37 #define TEXT_SECTION_ASM_OP "\t.text"
38 #define DATA_SECTION_ASM_OP "\t.data"
39 #define BSS_SECTION_ASM_OP "\t.bss"
41 #define CTORS_SECTION_ASM_OP "\t.section\t.init_array,\"aw\",%init_array"
42 #define DTORS_SECTION_ASM_OP "\t.section\t.fini_array,\"aw\",%fini_array"
44 #undef INIT_SECTION_ASM_OP
45 #undef FINI_SECTION_ASM_OP
46 #define INIT_ARRAY_SECTION_ASM_OP CTORS_SECTION_ASM_OP
47 #define FINI_ARRAY_SECTION_ASM_OP DTORS_SECTION_ASM_OP
49 /* Since we use .init_array/.fini_array we don't need the markers at
50 the start and end of the ctors/dtors arrays. */
51 #define CTOR_LIST_BEGIN asm (CTORS_SECTION_ASM_OP)
52 #define CTOR_LIST_END /* empty */
53 #define DTOR_LIST_BEGIN asm (DTORS_SECTION_ASM_OP)
54 #define DTOR_LIST_END /* empty */
56 #undef TARGET_ASM_CONSTRUCTOR
57 #define TARGET_ASM_CONSTRUCTOR aarch64_elf_asm_constructor
59 #undef TARGET_ASM_DESTRUCTOR
60 #define TARGET_ASM_DESTRUCTOR aarch64_elf_asm_destructor
62 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
63 /* Support for -falign-* switches. Use .p2align to ensure that code
64 sections are padded with NOP instructions, rather than zeros. */
65 #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE, LOG, MAX_SKIP) \
66 do \
67 { \
68 if ((LOG) != 0) \
69 { \
70 if ((MAX_SKIP) == 0) \
71 fprintf ((FILE), "\t.p2align %d\n", (int) (LOG)); \
72 else \
73 fprintf ((FILE), "\t.p2align %d,,%d\n", \
74 (int) (LOG), (int) (MAX_SKIP)); \
75 } \
76 } while (0)
78 #endif /* HAVE_GAS_MAX_SKIP_P2ALIGN */
80 #define JUMP_TABLES_IN_TEXT_SECTION 0
82 #define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
83 do { \
84 switch (GET_MODE (BODY)) \
85 { \
86 case QImode: \
87 asm_fprintf (STREAM, "\t.byte\t(%LL%d - %LLrtx%d) / 4\n", \
88 VALUE, REL); \
89 break; \
90 case HImode: \
91 asm_fprintf (STREAM, "\t.2byte\t(%LL%d - %LLrtx%d) / 4\n", \
92 VALUE, REL); \
93 break; \
94 case SImode: \
95 case DImode: /* See comment in aarch64_output_casesi. */ \
96 asm_fprintf (STREAM, "\t.word\t(%LL%d - %LLrtx%d) / 4\n", \
97 VALUE, REL); \
98 break; \
99 default: \
100 gcc_unreachable (); \
102 } while (0)
104 #define ASM_OUTPUT_ALIGN(STREAM, POWER) \
105 fprintf(STREAM, "\t.align\t%d\n", (int)POWER)
107 #define ASM_COMMENT_START "//"
109 #define LOCAL_LABEL_PREFIX "."
110 #define USER_LABEL_PREFIX ""
112 #define GLOBAL_ASM_OP "\t.global\t"
114 #ifdef TARGET_BIG_ENDIAN_DEFAULT
115 #define ENDIAN_SPEC "-mbig-endian"
116 #else
117 #define ENDIAN_SPEC "-mlittle-endian"
118 #endif
120 #if TARGET_DATA_MODEL == 1
121 #define ABI_SPEC "-mabi=lp64"
122 #define MULTILIB_DEFAULTS { "mabi=lp64" }
123 #elif TARGET_DATA_MODEL == 2
124 #define ABI_SPEC "-mabi=ilp32"
125 #define MULTILIB_DEFAULTS { "mabi=ilp32" }
126 #else
127 #error "Unknown or undefined TARGET_DATA_MODEL!"
128 #endif
130 /* Force the default endianness and ABI flags onto the command line
131 in order to make the other specs easier to write. */
132 #undef DRIVER_SELF_SPECS
133 #define DRIVER_SELF_SPECS \
134 " %{!mbig-endian:%{!mlittle-endian:" ENDIAN_SPEC "}}" \
135 " %{!mabi=*:" ABI_SPEC "}" \
136 MCPU_MTUNE_NATIVE_SPECS
138 #ifdef HAVE_AS_MABI_OPTION
139 #define ASM_MABI_SPEC "%{mabi=*:-mabi=%*}"
140 #else
141 #define ASM_MABI_SPEC "%{mabi=lp64:}"
142 #endif
144 #ifndef ASM_SPEC
145 #define ASM_SPEC "\
146 %{mbig-endian:-EB} \
147 %{mlittle-endian:-EL} \
148 %{march=*:-march=%*} \
149 %(asm_cpu_spec)" \
150 ASM_MABI_SPEC
151 #endif
153 #undef TYPE_OPERAND_FMT
154 #define TYPE_OPERAND_FMT "%%%s"
156 #undef TARGET_ASM_NAMED_SECTION
157 #define TARGET_ASM_NAMED_SECTION aarch64_elf_asm_named_section
159 /* Stabs debug not required. */
160 #undef DBX_DEBUGGING_INFO
162 #endif /* GCC_AARCH64_ELF_H */