1 /* Machine description for AArch64 architecture.
2 Copyright (C) 2024 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 GCC is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef GCC_AARCH64_COFF_H
21 #define GCC_AARCH64_COFF_H
23 #ifndef LOCAL_LABEL_PREFIX
24 # define LOCAL_LABEL_PREFIX ""
27 /* Using long long breaks -ansi and -std=c90, so these will need to be
28 made conditional for an LLP64 ABI. */
30 #define SIZE_TYPE "long long unsigned int"
33 #define PTRDIFF_TYPE "long long int"
36 #define LONG_TYPE_SIZE 32
38 #ifndef ASM_GENERATE_INTERNAL_LABEL
39 # define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
40 sprintf (STRING, "*%s%s%u", LOCAL_LABEL_PREFIX, PREFIX, (unsigned int)(NUM))
43 #define ASM_OUTPUT_ALIGN(STREAM, POWER) \
44 fprintf (STREAM, "\t.align\t%d\n", (int)POWER)
46 /* Output a common block. */
47 #ifndef ASM_OUTPUT_COMMON
48 # define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
50 fprintf (STREAM, "\t.comm\t"); \
51 assemble_name (STREAM, NAME); \
52 asm_fprintf (STREAM, ", %d, %d\n", \
53 (int)(ROUNDED), (int)(SIZE)); \
57 /* Output a local common block. /bin/as can't do this, so hack a
58 `.space' into the bss segment. Note that this is *bad* practice,
59 which is guaranteed NOT to work since it doesn't define STATIC
60 COMMON space but merely STATIC BSS space. */
61 #ifndef ASM_OUTPUT_ALIGNED_LOCAL
62 # define ASM_OUTPUT_ALIGNED_LOCAL(STREAM, NAME, SIZE, ALIGN) \
64 switch_to_section (bss_section); \
65 ASM_OUTPUT_ALIGN (STREAM, floor_log2 (ALIGN / BITS_PER_UNIT)); \
66 ASM_OUTPUT_LABEL (STREAM, NAME); \
67 fprintf (STREAM, "\t.space\t%d\n", (int)(SIZE)); \
71 #define ASM_OUTPUT_SKIP(STREAM, NBYTES) \
72 fprintf (STREAM, "\t.space\t%d // skip\n", (int) (NBYTES))
74 /* Definitions that are not yet supported by binutils for the
75 aarch64-w64-mingw32 target. */
76 #define ASM_OUTPUT_TYPE_DIRECTIVE(STREAM, NAME, TYPE)
77 #define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)
79 #define TEXT_SECTION_ASM_OP "\t.text"
80 #define DATA_SECTION_ASM_OP "\t.data"
81 #define BSS_SECTION_ASM_OP "\t.bss"
83 #define CTORS_SECTION_ASM_OP "\t.section\t.ctors, \"aw\""
84 #define DTORS_SECTION_ASM_OP "\t.section\t.dtors, \"aw\""
86 #define GLOBAL_ASM_OP "\t.global\t"
88 #undef SUPPORTS_INIT_PRIORITY
89 #define SUPPORTS_INIT_PRIORITY 0