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
10config CPU_HAS_VFP
11	bool
12	select CPU_HAS_FPU
13	imply FPU
14	imply FPU_SHARING
15	help
16	  This option signifies the support for a Vectored Floating-Point (VFP)
17	  coprocessor.
18
19config CPU_HAS_NEON
20	bool
21	select CPU_HAS_FPU
22	help
23	  This option signifies the support for a NEON (Advanced SIMD) coprocessor.
24
25# VFP type symbols; these should be selected by the SoC symbol to specify the
26# type of the VFP core instantiated by the SoC.
27
28config VFP_SP_D16
29	bool
30	select CPU_HAS_VFP
31	select VFP_FEATURE_SINGLE_PRECISION
32	select VFP_FEATURE_REGS_S32_D16
33	help
34	  This option signifies the use of a VFP floating-point coprocessor
35	  that supports only single-precision operations with 16 double-word
36	  registers.
37
38config VFP_SP_D16_FP16
39	bool
40	select CPU_HAS_VFP
41	select VFP_FEATURE_HALF_PRECISION
42	select VFP_FEATURE_SINGLE_PRECISION
43	select VFP_FEATURE_REGS_S32_D16
44	help
45	  This option signifies the use of a VFP floating-point coprocessor
46	  that supports half- and single-precision operations with 16
47	  double-word registers.
48
49config VFP_SP_D16_FP16_FMAC
50	bool
51	select CPU_HAS_VFP
52	select VFP_FEATURE_HALF_PRECISION
53	select VFP_FEATURE_SINGLE_PRECISION
54	select VFP_FEATURE_FMAC
55	select VFP_FEATURE_REGS_S32_D16
56	help
57	  This option signifies the use of a VFP floating-point coprocessor
58	  that supports half- and single-precision operations (including fused
59	  multiply-accumulate) with 16 double-word registers.
60
61config VFP_DP_D16
62	bool
63	select CPU_HAS_VFP
64	select VFP_FEATURE_SINGLE_PRECISION
65	select VFP_FEATURE_DOUBLE_PRECISION
66	select VFP_FEATURE_REGS_S32_D16
67	help
68	  This option signifies the use of a VFP floating-point coprocessor
69	  that supports single- and double-precision operations with 16
70	  double-word registers.
71
72config VFP_DP_D16_FP16
73	bool
74	select CPU_HAS_VFP
75	select VFP_FEATURE_HALF_PRECISION
76	select VFP_FEATURE_SINGLE_PRECISION
77	select VFP_FEATURE_DOUBLE_PRECISION
78	select VFP_FEATURE_REGS_S32_D16
79	help
80	  This option signifies the use of a VFP floating-point coprocessor
81	  that supports half-, single- and double-precision operations with 16
82	  double-word registers.
83
84config VFP_DP_D16_FP16_FMAC
85	bool
86	select CPU_HAS_VFP
87	select VFP_FEATURE_HALF_PRECISION
88	select VFP_FEATURE_SINGLE_PRECISION
89	select VFP_FEATURE_DOUBLE_PRECISION
90	select VFP_FEATURE_FMAC
91	select VFP_FEATURE_REGS_S32_D16
92	help
93	  This option signifies the use of a VFP floating-point coprocessor
94	  that supports half-, single- and double-precision operations
95	  (including fused multiply-accumulate) with 16 double-word registers.
96
97config VFP_U_DP_D16_FP16_FMAC
98	bool
99	select CPU_HAS_VFP
100	select VFP_FEATURE_HALF_PRECISION
101	select VFP_FEATURE_SINGLE_PRECISION
102	select VFP_FEATURE_DOUBLE_PRECISION
103	select VFP_FEATURE_FMAC
104	select VFP_FEATURE_REGS_S32_D16
105	select VFP_FEATURE_TRAP
106	help
107	  This option signifies the use of a VFP floating-point coprocessor
108	  that supports half-, single-, double-precision operations (including
109	  fused multiply-accumulate) and floating-point exception trapping with 16
110	  double-word registers.
111
112config VFP_DP_D32
113	bool
114	select CPU_HAS_VFP
115	select VFP_FEATURE_SINGLE_PRECISION
116	select VFP_FEATURE_DOUBLE_PRECISION
117	select VFP_FEATURE_REGS_S64_D32
118	help
119	  This option signifies the use of a VFP floating-point coprocessor
120	  that supports single- and double-precision operations
121	  with 32 double-word registers.
122
123config VFP_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	help
132	  This option signifies the use of a VFP floating-point coprocessor
133	  that supports half-, single- and double-precision operations
134	  (including fused multiply-accumulate) with 32 double-word registers.
135
136config VFP_U_DP_D32_FP16_FMAC
137	bool
138	select CPU_HAS_VFP
139	select VFP_FEATURE_HALF_PRECISION
140	select VFP_FEATURE_SINGLE_PRECISION
141	select VFP_FEATURE_DOUBLE_PRECISION
142	select VFP_FEATURE_FMAC
143	select VFP_FEATURE_REGS_S64_D32
144	select VFP_FEATURE_TRAP
145	help
146	  This option signifies the use of a VFP floating-point coprocessor
147	  that supports half-, single-, double-precision operations (including
148	  fused multiply-accumulate) and floating-point exception trapping with 32
149	  double-word registers.
150
151if CPU_HAS_VFP
152
153# VFP feature symbols; these are the helper symbols used by the floating-point
154# support code to resolve the supported VFP features.
155
156config VFP_FEATURE_HALF_PRECISION
157	bool
158	help
159	  This option signifies that the VFP coprocessor supports
160	  half-precision operations (half-precision extension).
161
162config VFP_FEATURE_SINGLE_PRECISION
163	bool
164	help
165	  This option signifies that the VFP coprocessor supports
166	  single-precision operations.
167
168config VFP_FEATURE_DOUBLE_PRECISION
169	bool
170	select CPU_HAS_FPU_DOUBLE_PRECISION
171	help
172	  This option signifies that the VFP coprocessor supports
173	  double-precision operations.
174
175config VFP_FEATURE_VECTOR
176	bool
177	help
178	  This option signifies that the VFP coprocessor supports vector
179	  operations.
180
181config VFP_FEATURE_FMAC
182	bool
183	help
184	  This option signifies that the VFP coprocessor supports the fused
185	  multiply-accumulate operations.
186
187config VFP_FEATURE_REGS_S32_D16
188	bool
189	help
190	  This option signifies that the VFP coprocessor implements 16
191	  double-precision (32 single-precision) floating-point registers.
192
193config VFP_FEATURE_REGS_S64_D32
194	bool
195	help
196	  This option signifies that the VFP coprocessor implements 32
197	  double-precision (64 single-precision) floating-point registers.
198
199config VFP_FEATURE_TRAP
200	bool
201	help
202	  This option signifies that the VFP coprocessor supports the trapping
203	  of floating-point exceptions to allow software implementation of
204	  the unsupported VFP instructions.
205
206endif # CPU_HAS_VFP
207
208# Advanced SIMD type symbols; these should be selected by the SoC symbol to
209# specify the type of the VFP core instantiated by the SoC.
210
211config NEON
212	bool
213	select CPU_HAS_NEON
214	help
215	  This option signifies the use of a NEON Advanced SIMD coprocessor.
216