1# Machine description for AArch64 architecture.
2#  Copyright (C) 2009-2020 Free Software Foundation, Inc.
3#  Contributed by ARM Ltd.
4#
5#  This file is part of GCC.
6#
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.
11#
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.
16#
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/>.
20
21TM_H += $(srcdir)/config/aarch64/aarch64-cores.def
22OPTIONS_H_EXTRA += $(srcdir)/config/aarch64/aarch64-cores.def \
23		   $(srcdir)/config/aarch64/aarch64-arches.def \
24		   $(srcdir)/config/aarch64/aarch64-fusion-pairs.def \
25		   $(srcdir)/config/aarch64/aarch64-tuning-flags.def
26
27$(srcdir)/config/aarch64/aarch64-tune.md: s-aarch64-tune-md; @true
28s-aarch64-tune-md: $(srcdir)/config/aarch64/gentune.sh \
29	$(srcdir)/config/aarch64/aarch64-cores.def
30	@echo "NOT REBUILDING $@"
31NetBSD_DISABLED_aarch64-tune.md:
32	$(SHELL) $(srcdir)/config/aarch64/gentune.sh \
33		$(srcdir)/config/aarch64/aarch64-cores.def > \
34		tmp-aarch64-tune.md
35	$(SHELL) $(srcdir)/../move-if-change tmp-aarch64-tune.md \
36		$(srcdir)/config/aarch64/aarch64-tune.md
37	$(STAMP) s-aarch64-tune-md
38
39aarch64-builtins.o: $(srcdir)/config/aarch64/aarch64-builtins.c $(CONFIG_H) \
40  $(SYSTEM_H) coretypes.h $(TM_H) \
41  $(RTL_H) $(TREE_H) expr.h $(TM_P_H) $(RECOG_H) langhooks.h \
42  $(DIAGNOSTIC_CORE_H) $(OPTABS_H) \
43  $(srcdir)/config/aarch64/aarch64-simd-builtins.def \
44  $(srcdir)/config/aarch64/aarch64-simd-builtin-types.def \
45  aarch64-builtin-iterators.h
46	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
47		$(srcdir)/config/aarch64/aarch64-builtins.c
48
49aarch64-sve-builtins.o: $(srcdir)/config/aarch64/aarch64-sve-builtins.cc \
50  $(srcdir)/config/aarch64/aarch64-sve-builtins.def \
51  $(srcdir)/config/aarch64/aarch64-sve-builtins-base.def \
52  $(srcdir)/config/aarch64/aarch64-sve-builtins-sve2.def \
53  $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
54  $(TM_P_H) memmodel.h insn-codes.h $(OPTABS_H) $(RECOG_H) $(DIAGNOSTIC_H) \
55  $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) fold-const.h $(GIMPLE_H) \
56  gimple-iterator.h gimplify.h explow.h $(EMIT_RTL_H) tree-vector-builder.h \
57  stor-layout.h $(REG_H) alias.h gimple-fold.h langhooks.h \
58  stringpool.h \
59  $(srcdir)/config/aarch64/aarch64-sve-builtins.h \
60  $(srcdir)/config/aarch64/aarch64-sve-builtins-shapes.h \
61  $(srcdir)/config/aarch64/aarch64-sve-builtins-base.h \
62  $(srcdir)/config/aarch64/aarch64-sve-builtins-sve2.h
63	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
64		$(srcdir)/config/aarch64/aarch64-sve-builtins.cc
65
66aarch64-sve-builtins-shapes.o: \
67  $(srcdir)/config/aarch64/aarch64-sve-builtins-shapes.cc \
68  $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
69  $(TM_P_H) memmodel.h insn-codes.h $(OPTABS_H) \
70  $(srcdir)/config/aarch64/aarch64-sve-builtins.h \
71  $(srcdir)/config/aarch64/aarch64-sve-builtins-shapes.h
72	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
73		$(srcdir)/config/aarch64/aarch64-sve-builtins-shapes.cc
74
75aarch64-sve-builtins-base.o: \
76  $(srcdir)/config/aarch64/aarch64-sve-builtins-base.cc \
77  $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
78  $(TM_P_H) memmodel.h insn-codes.h $(OPTABS_H) $(RECOG_H) \
79  $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) fold-const.h $(GIMPLE_H) \
80  gimple-iterator.h gimplify.h explow.h $(EMIT_RTL_H) tree-vector-builder.h \
81  rtx-vector-builder.h vec-perm-indices.h \
82  $(srcdir)/config/aarch64/aarch64-sve-builtins.h \
83  $(srcdir)/config/aarch64/aarch64-sve-builtins-shapes.h \
84  $(srcdir)/config/aarch64/aarch64-sve-builtins-base.h \
85  $(srcdir)/config/aarch64/aarch64-sve-builtins-functions.h
86	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
87		$(srcdir)/config/aarch64/aarch64-sve-builtins-base.cc
88
89aarch64-sve-builtins-sve2.o: \
90  $(srcdir)/config/aarch64/aarch64-sve-builtins-sve2.cc \
91  $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
92  $(TM_P_H) memmodel.h insn-codes.h $(OPTABS_H) $(RECOG_H) \
93  $(EXPR_H) $(BASIC_BLOCK_H) $(FUNCTION_H) fold-const.h $(GIMPLE_H) \
94  gimple-iterator.h gimplify.h explow.h $(EMIT_RTL_H) tree-vector-builder.h \
95  rtx-vector-builder.h vec-perm-indices.h \
96  $(srcdir)/config/aarch64/aarch64-sve-builtins.h \
97  $(srcdir)/config/aarch64/aarch64-sve-builtins-shapes.h \
98  $(srcdir)/config/aarch64/aarch64-sve-builtins-sve2.h \
99  $(srcdir)/config/aarch64/aarch64-sve-builtins-functions.h
100	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
101		$(srcdir)/config/aarch64/aarch64-sve-builtins-sve2.cc
102
103aarch64-builtin-iterators.h: $(srcdir)/config/aarch64/geniterators.sh \
104	$(srcdir)/config/aarch64/iterators.md
105	$(SHELL) $(srcdir)/config/aarch64/geniterators.sh \
106		$(srcdir)/config/aarch64/iterators.md > \
107		aarch64-builtin-iterators.h
108
109aarch-common.o: $(srcdir)/config/arm/aarch-common.c $(CONFIG_H) $(SYSTEM_H) \
110    coretypes.h $(TM_H) $(TM_P_H) $(RTL_H) $(TREE_H) output.h $(C_COMMON_H)
111	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
112		$(srcdir)/config/arm/aarch-common.c
113
114aarch64-c.o: $(srcdir)/config/aarch64/aarch64-c.c $(CONFIG_H) $(SYSTEM_H) \
115    coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H) $(TARGET_H)
116	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
117		$(srcdir)/config/aarch64/aarch64-c.c
118
119aarch64-d.o: $(srcdir)/config/aarch64/aarch64-d.c
120	$(COMPILE) $<
121	$(POSTCOMPILE)
122
123PASSES_EXTRA += $(srcdir)/config/aarch64/aarch64-passes.def
124
125cortex-a57-fma-steering.o: $(srcdir)/config/aarch64/cortex-a57-fma-steering.c \
126    $(CONFIG_H) $(SYSTEM_H) $(TM_H) $(REGS_H) insn-config.h $(RTL_BASE_H) \
127    dominance.h cfg.h cfganal.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(RECOG_H) \
128    output.h hash-map.h $(DF_H) $(OBSTACK_H) $(TARGET_H) $(RTL_H) \
129    $(CONTEXT_H) $(TREE_PASS_H) regrename.h \
130    $(srcdir)/config/aarch64/aarch64-protos.h
131	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
132		$(srcdir)/config/aarch64/cortex-a57-fma-steering.c
133
134aarch64-speculation.o: $(srcdir)/config/aarch64/aarch64-speculation.cc \
135    $(CONFIG_H) \
136    $(SYSTEM_H) \
137    $(TM_H) \
138    $(TARGET_H) \
139    $(RTL_BASE_H) \
140    $(TREE_PASS_H)
141	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_SPPFLAGS) $(INCLUDES) \
142	  $(srcdir)/config/aarch64/aarch64-speculation.cc
143
144falkor-tag-collision-avoidance.o: \
145    $(srcdir)/config/aarch64/falkor-tag-collision-avoidance.c \
146    $(CONFIG_H) $(SYSTEM_H) $(TM_H) $(REGS_H) insn-config.h $(RTL_BASE_H) \
147    dominance.h cfg.h cfganal.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(RECOG_H) \
148    output.h hash-map.h $(DF_H) $(OBSTACK_H) $(TARGET_H) $(RTL_H) \
149    $(CONTEXT_H) $(TREE_PASS_H) regrename.h \
150    $(srcdir)/config/aarch64/aarch64-protos.h
151	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
152		$(srcdir)/config/aarch64/falkor-tag-collision-avoidance.c
153
154aarch64-bti-insert.o: $(srcdir)/config/aarch64/aarch64-bti-insert.c \
155    $(CONFIG_H) $(SYSTEM_H) $(TM_H) $(REGS_H) insn-config.h $(RTL_BASE_H) \
156    dominance.h cfg.h cfganal.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(RECOG_H) \
157    output.h hash-map.h $(DF_H) $(OBSTACK_H) $(TARGET_H) $(RTL_H) \
158    $(CONTEXT_H) $(TREE_PASS_H) regrename.h \
159    $(srcdir)/config/aarch64/aarch64-protos.h
160	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
161		$(srcdir)/config/aarch64/aarch64-bti-insert.c
162
163comma=,
164MULTILIB_OPTIONS    = $(subst $(comma),/, $(patsubst %, mabi=%, $(subst $(comma),$(comma)mabi=,$(TM_MULTILIB_CONFIG))))
165MULTILIB_DIRNAMES   = $(subst $(comma), ,$(TM_MULTILIB_CONFIG))
166
167insn-conditions.md: s-check-sve-md
168s-check-sve-md: $(srcdir)/config/aarch64/check-sve-md.awk \
169		$(srcdir)/config/aarch64/aarch64-sve.md \
170		$(srcdir)/config/aarch64/aarch64-sve2.md
171	$(AWK) -f $(srcdir)/config/aarch64/check-sve-md.awk \
172	  $(srcdir)/config/aarch64/aarch64-sve.md
173	$(AWK) -f $(srcdir)/config/aarch64/check-sve-md.awk \
174	  $(srcdir)/config/aarch64/aarch64-sve2.md
175	$(STAMP) s-check-sve-md
176