Skip to content

Commit 5181c61

Browse files
committed
arch: arm: Add unified floating-point configuration symbols
This commit adds the unified floating-point configuration symbols for the ARM architectures. These configuration symbols allow specification of the floating-point coprocessors, such as VFP (also known as FP for Cortex-M) and NEON, for the ARM architectures. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent afef64e commit 5181c61

File tree

2 files changed

+202
-0
lines changed

2 files changed

+202
-0
lines changed

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@ config CODE_DATA_RELOCATION_SRAM
5555
relocation.
5656

5757
rsource "core/aarch32/Kconfig"
58+
rsource "core/aarch32/Kconfig.vfp"
5859

5960
endmenu

arch/arm/core/aarch32/Kconfig.vfp

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2022 Lexmark International, Inc.
3+
4+
# ARM architecture VFP configuration options
5+
6+
# Math coprocessor symbols; these should be selected by the CPU symbol to
7+
# indicate that the CPU core can be configured with the specified
8+
# coprocessor(s).
9+
10+
config CPU_HAS_VFP
11+
bool
12+
select CPU_HAS_FPU
13+
help
14+
This option signifies the support for a Vectored Floating-Point (VFP)
15+
coprocessor.
16+
17+
config CPU_HAS_NEON
18+
bool
19+
select CPU_HAS_FPU
20+
help
21+
This option signifies the support for a NEON (Advanced SIMD) coprocessor.
22+
23+
# VFP type symbols; these should be selected by the SoC symbol to specify the
24+
# type of the VFP core instantiated by the SoC.
25+
26+
config VFP_SP_D16
27+
bool
28+
select CPU_HAS_VFP
29+
select VFP_FEATURE_SINGLE_PRECISION
30+
select VFP_FEATURE_REGS_S32_D16
31+
help
32+
This option signifies the use of a VFP floating-point coprocessor
33+
that supports only single-precision operations with 16 double-word
34+
registers.
35+
36+
config VFP_SP_D16_FP16
37+
bool
38+
select CPU_HAS_VFP
39+
select VFP_FEATURE_HALF_PRECISION
40+
select VFP_FEATURE_SINGLE_PRECISION
41+
select VFP_FEATURE_REGS_S32_D16
42+
help
43+
This option signifies the use of a VFP floating-point coprocessor
44+
that supports half- and single-precision operations with 16
45+
double-word registers.
46+
47+
config VFP_SP_D16_FP16_FMAC
48+
bool
49+
select CPU_HAS_VFP
50+
select VFP_FEATURE_HALF_PRECISION
51+
select VFP_FEATURE_SINGLE_PRECISION
52+
select VFP_FEATURE_FMAC
53+
select VFP_FEATURE_REGS_S32_D16
54+
help
55+
This option signifies the use of a VFP floating-point coprocessor
56+
that supports half- and single-precision operations (including fused
57+
multiply-accumulate) with 16 double-word registers.
58+
59+
config VFP_DP_D16
60+
bool
61+
select CPU_HAS_VFP
62+
select VFP_FEATURE_SINGLE_PRECISION
63+
select VFP_FEATURE_DOUBLE_PRECISION
64+
select VFP_FEATURE_REGS_S32_D16
65+
help
66+
This option signifies the use of a VFP floating-point coprocessor
67+
that supports single- and double-precision operations with 16
68+
double-word registers.
69+
70+
config VFP_DP_D16_FP16
71+
bool
72+
select CPU_HAS_VFP
73+
select VFP_FEATURE_HALF_PRECISION
74+
select VFP_FEATURE_SINGLE_PRECISION
75+
select VFP_FEATURE_DOUBLE_PRECISION
76+
select VFP_FEATURE_REGS_S32_D16
77+
help
78+
This option signifies the use of a VFP floating-point coprocessor
79+
that supports half-, single- and double-precision operations with 16
80+
double-word registers.
81+
82+
config VFP_DP_D16_FP16_FMAC
83+
bool
84+
select CPU_HAS_VFP
85+
select VFP_FEATURE_HALF_PRECISION
86+
select VFP_FEATURE_SINGLE_PRECISION
87+
select VFP_FEATURE_DOUBLE_PRECISION
88+
select VFP_FEATURE_FMAC
89+
select VFP_FEATURE_REGS_S32_D16
90+
help
91+
This option signifies the use of a VFP floating-point coprocessor
92+
that supports half-, single- and double-precision operations
93+
(including fused multiply-accumulate) with 16 double-word registers.
94+
95+
config VFP_U_DP_D16_FP16_FMAC
96+
bool
97+
select CPU_HAS_VFP
98+
select VFP_FEATURE_HALF_PRECISION
99+
select VFP_FEATURE_SINGLE_PRECISION
100+
select VFP_FEATURE_DOUBLE_PRECISION
101+
select VFP_FEATURE_FMAC
102+
select VFP_FEATURE_REGS_S32_D16
103+
select VFP_FEATURE_TRAP
104+
help
105+
This option signifies the use of a VFP floating-point coprocessor
106+
that supports half-, single-, double-precision operations (including
107+
fused multiply-accumulate) and floating-point exception trapping with 16
108+
double-word registers.
109+
110+
config VFP_DP_D32_FP16_FMAC
111+
bool
112+
select CPU_HAS_VFP
113+
select VFP_FEATURE_HALF_PRECISION
114+
select VFP_FEATURE_SINGLE_PRECISION
115+
select VFP_FEATURE_DOUBLE_PRECISION
116+
select VFP_FEATURE_FMAC
117+
select VFP_FEATURE_REGS_S64_D32
118+
help
119+
This option signifies the use of a VFP floating-point coprocessor
120+
that supports half-, single- and double-precision operations
121+
(including fused multiply-accumulate) with 32 double-word registers.
122+
123+
config VFP_U_DP_D32_FP16_FMAC
124+
bool
125+
select CPU_HAS_VFP
126+
select VFP_FEATURE_HALF_PRECISION
127+
select VFP_FEATURE_SINGLE_PRECISION
128+
select VFP_FEATURE_DOUBLE_PRECISION
129+
select VFP_FEATURE_FMAC
130+
select VFP_FEATURE_REGS_S64_D32
131+
select VFP_FEATURE_TRAP
132+
help
133+
This option signifies the use of a VFP floating-point coprocessor
134+
that supports half-, single-, double-precision operations (including
135+
fused multiply-accumulate) and floating-point exception trapping with 32
136+
double-word registers.
137+
138+
if CPU_HAS_VFP
139+
140+
# VFP feature symbols; these are the helper symbols used by the floating-point
141+
# support code to resolve the supported VFP features.
142+
143+
config VFP_FEATURE_HALF_PRECISION
144+
bool
145+
help
146+
This option signifies that the VFP coprocessor supports
147+
half-precision operations (half-precision extension).
148+
149+
config VFP_FEATURE_SINGLE_PRECISION
150+
bool
151+
help
152+
This option signifies that the VFP coprocessor supports
153+
single-precision operations.
154+
155+
config VFP_FEATURE_DOUBLE_PRECISION
156+
bool
157+
help
158+
This option signifies that the VFP coprocessor supports
159+
double-precision operations.
160+
161+
config VFP_FEATURE_VECTOR
162+
bool
163+
help
164+
This option signifies that the VFP coprocessor supports vector
165+
operations.
166+
167+
config VFP_FEATURE_FMAC
168+
bool
169+
help
170+
This option signifies that the VFP coprocessor supports the fused
171+
multiply-accumulate operations.
172+
173+
config VFP_FEATURE_REGS_S32_D16
174+
bool
175+
help
176+
This option signifies that the VFP coprocessor implements 16
177+
double-precision (32 single-precision) floating-point registers.
178+
179+
config VFP_FEATURE_REGS_S64_D32
180+
bool
181+
help
182+
This option signifies that the VFP coprocessor implements 32
183+
double-precision (64 single-precision) floating-point registers.
184+
185+
config VFP_FEATURE_TRAP
186+
bool
187+
help
188+
This option signifies that the VFP coprocessor supports the trapping
189+
of floating-point exceptions to allow software implementation of
190+
the unsupported VFP instructions.
191+
192+
endif # CPU_HAS_VFP
193+
194+
# Advanced SIMD type symbols; these should be selected by the SoC symbol to
195+
# specify the type of the VFP core instantiated by the SoC.
196+
197+
config NEON
198+
bool
199+
select CPU_HAS_NEON
200+
help
201+
This option signifies the use of a NEON Advanced SIMD coprocessor.

0 commit comments

Comments
 (0)