1 # Copyright (C) 2016 Free Software Foundation, Inc.
3 # This file is part of GCC.
5 # GCC is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3, or (at your option)
10 # GCC is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with GCC; see the file COPYING3. If not see
17 # <http://www.gnu.org/licenses/>.
19 # This is a target makefile fragment that attempts to get
20 # multilibs built for the range of CPU's, FPU's and ABI's that
21 # are relevant for the ARM architecture. It should not be used in
22 # conjunction with another make file fragment and assumes --with-arch,
23 # --with-cpu, --with-fpu, --with-float, --with-mode have their default
24 # values during the configure step. We enforce this during the
25 # top-level configury.
35 tm_multilib_list := $(subst $(comma), ,$(TM_MULTILIB_CONFIG))
37 HAS_APROFILE := $(filter aprofile,$(tm_multilib_list))
38 HAS_RMPROFILE := $(filter rmprofile,$(tm_multilib_list))
40 # Produce the combinatorial list of extensions. Where there are
41 # multiple permutations for a combination, the ordering is the
42 # selected by the forward ordering of the original list. This matches
43 # the canonical ordering generated by the canonicalizer in the driver.
46 # $(call all_feat_combs, a b)
49 # but will not include
51 # The rule is recursive and can be called with any (reasonable) list of
53 all_feat_combs = +$(firstword $(1)) \
54 $(if $(wordlist 2, $(words $(1)), $(1)), \
56 $(call all_feat_combs, \
57 $(wordlist 2, $(words $(1)), $(1))), \
58 +$(firstword $(1))$(OPT) $(OPT)),)
61 all_early_arch := armv5e armv5tej armv6 armv6j armv6k armv6z armv6kz \
62 armv6zk armv6t2 iwmmxt iwmmxt2
63 v7_a_nosimd_variants := +fp +vfpv3 +vfpv3-d16-fp16 +vfpv3-fp16 +vfpv4-d16 +vfpv4
64 v7_a_simd_variants := +simd +neon-fp16 +neon-vfpv4
65 v7ve_nosimd_variants := +vfpv3-d16 +vfpv3 +vfpv3-d16-fp16 +vfpv3-fp16 +fp +vfpv4
66 v7ve_vfpv3_simd_variants := +neon +neon-fp16
67 v7ve_vfpv4_simd_variants := +simd
68 v8_a_nosimd_variants := +crc
69 v8_a_simd_variants := $(call all_feat_combs, simd crypto)
70 v8_1_a_simd_variants := $(call all_feat_combs, simd crypto)
71 v8_2_a_simd_variants := $(call all_feat_combs, simd fp16 crypto dotprod)
74 ifneq (,$(HAS_APROFILE))
75 include $(srcdir)/config/arm/t-aprofile
77 ifneq (,$(HAS_RMPROFILE))
78 include $(srcdir)/config/arm/t-rmprofile
80 SEP := $(and $(HAS_APROFILE),$(HAS_RMPROFILE),/)
83 MULTILIB_OPTIONS += marm/mthumb
84 MULTILIB_DIRNAMES += arm thumb
86 MULTILIB_OPTIONS += march=armv5te+fp/march=armv7/march=armv7+fp/$(MULTI_ARCH_OPTS_A)$(SEP)$(MULTI_ARCH_OPTS_RM)
87 MULTILIB_DIRNAMES += v5te v7 v7+fp $(MULTI_ARCH_DIRS_A) $(MULTI_ARCH_DIRS_RM)
89 MULTILIB_OPTIONS += mfloat-abi=soft/mfloat-abi=softfp/mfloat-abi=hard
90 MULTILIB_DIRNAMES += nofp softfp hard
92 MULTILIB_REQUIRED += mthumb/mfloat-abi=soft
93 MULTILIB_REQUIRED += marm/march=armv5te+fp/mfloat-abi=softfp
94 MULTILIB_REQUIRED += marm/march=armv5te+fp/mfloat-abi=hard
96 MULTILIB_REQUIRED += mthumb/march=armv7/mfloat-abi=soft
97 MULTILIB_REQUIRED += mthumb/march=armv7+fp/mfloat-abi=softfp
98 MULTILIB_REQUIRED += mthumb/march=armv7+fp/mfloat-abi=hard
100 # Map v7-r down onto common v7 code.
101 MULTILIB_MATCHES += march?armv7=march?armv7-r
102 MULTILIB_MATCHES += march?armv7=march?armv7-r+idiv
103 MULTILIB_MATCHES += march?armv7+fp=march?armv7-r+fp
104 MULTILIB_MATCHES += march?armv7+fp=march?armv7-r+fp+idiv
106 MULTILIB_MATCHES += $(foreach ARCH, $(all_early_arch), \
107 march?armv5te+fp=march?$(ARCH)+fp)
109 ifeq (,$(HAS_APROFILE))
111 MULTILIB_MATCHES += march?armv7=march?armv7-a
112 MULTILIB_MATCHES += $(foreach ARCH, $(v7_a_nosimd_variants) $(v7_a_simd_variants), \
113 march?armv7+fp=march?armv7-a$(ARCH))
115 MULTILIB_MATCHES += march?armv7=march?armv7ve
117 # ARMv7ve FP/SIMD variants: map down to v7+fp
118 MULTILIB_MATCHES += $(foreach ARCH, $(v7ve_nosimd_variants) $(v7ve_vfpv3_simd_variants) $(v7ve_vfpv4_simd_variants), \
119 march?armv7+fp=march?armv7ve$(ARCH))
122 MULTILIB_MATCHES += march?armv7=march?armv8-a
123 MULTILIB_MATCHES += $(foreach ARCH, $(v8_a_nosimd_variants), \
124 march?armv7=march?armv8-a$(ARCH))
127 MULTILIB_MATCHES += march?armv7+fp=march?armv8-a+crc+simd \
128 $(foreach ARCH, $(v8_a_simd_variants), \
129 march?armv7+fp=march?armv8-a$(ARCH) \
130 march?armv7+fp=march?armv8-a+crc$(ARCH))
133 MULTILIB_MATCHES += march?armv7=march?armv8.1-a
135 # Map all v8.1-a SIMD variants
136 MULTILIB_MATCHES += $(foreach ARCH, $(v8_1_a_simd_variants), \
137 march?armv7+fp=march?armv8.1-a$(ARCH))
139 # Baseline v8.2-a: map down to baseline v8-a
140 MULTILIB_MATCHES += march?armv7=march?armv8.2-a
142 # Map all v8.2-a SIMD variants
143 MULTILIB_MATCHES += $(foreach ARCH, $(v8_2_a_simd_variants), \
144 march?armv7+fp=march?armv8.2-a$(ARCH))
146 # Use Thumb libraries for everything.
148 MULTILIB_REUSE += mthumb/march.armv7/mfloat-abi.soft=marm/march.armv7/mfloat-abi.soft
150 MULTILIB_REUSE += $(foreach ABI, hard softfp, \
151 $(foreach ARCH, armv7+fp, \
152 mthumb/march.$(ARCH)/mfloat-abi.$(ABI)=marm/march.$(ARCH)/mfloat-abi.$(ABI)))
154 # Softfp but no FP, use the soft-float libraries.
155 MULTILIB_REUSE += $(foreach MODE, arm thumb, \
156 $(foreach ARCH, armv7, \
157 mthumb/march.$(ARCH)/mfloat-abi.soft=m$(MODE)/march.$(ARCH)/mfloat-abi.softfp))
159 endif # Not APROFILE.