1 /* ACLE support for AArch64 SME.
2 Copyright (C
) 2023-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 DEF_SME_FUNCTION
21 #define
DEF_SME_FUNCTION(NAME
, SHAPE
, TYPES
, PREDS
) \
22 DEF_SME_FUNCTION_GS (NAME
, SHAPE
, TYPES
, none
, PREDS
)
25 #ifndef DEF_SME_ZA_FUNCTION_GS
26 #define
DEF_SME_ZA_FUNCTION_GS(NAME
, SHAPE
, TYPES
, GROUP
, PREDS
) \
27 DEF_SME_FUNCTION_GS (NAME
, SHAPE
, TYPES
, GROUP
, PREDS
)
30 #ifndef DEF_SME_ZA_FUNCTION
31 #define
DEF_SME_ZA_FUNCTION(NAME
, SHAPE
, TYPES
, PREDS
) \
32 DEF_SME_ZA_FUNCTION_GS (NAME
, SHAPE
, TYPES
, none
, PREDS
)
35 #define REQUIRED_EXTENSIONS
0
36 DEF_SME_FUNCTION (arm_has_sme
, bool_inherent
, none
, none
)
37 DEF_SME_FUNCTION (arm_in_streaming_mode
, bool_inherent
, none
, none
)
38 #undef REQUIRED_EXTENSIONS
40 #define REQUIRED_EXTENSIONS AARCH64_FL_SME
41 DEF_SME_FUNCTION (svcntsb
, count_inherent
, none
, none
)
42 DEF_SME_FUNCTION (svcntsd
, count_inherent
, none
, none
)
43 DEF_SME_FUNCTION (svcntsh
, count_inherent
, none
, none
)
44 DEF_SME_FUNCTION (svcntsw
, count_inherent
, none
, none
)
45 DEF_SME_ZA_FUNCTION (svldr
, ldr_za
, za
, none
)
46 DEF_SME_ZA_FUNCTION (svstr
, str_za
, za
, none
)
47 DEF_SME_ZA_FUNCTION (svundef
, inherent_za
, za
, none
)
48 DEF_SME_ZA_FUNCTION (svzero
, inherent_za
, za
, none
)
49 DEF_SME_ZA_FUNCTION (svzero_mask
, inherent_mask_za
, za
, none
)
50 #undef REQUIRED_EXTENSIONS
52 #define REQUIRED_EXTENSIONS AARCH64_FL_SME | AARCH64_FL_SM_ON
53 DEF_SME_ZA_FUNCTION (svaddha
, unary_za_m
, za_s_integer
, za_m
)
54 DEF_SME_ZA_FUNCTION (svaddva
, unary_za_m
, za_s_integer
, za_m
)
55 DEF_SME_ZA_FUNCTION (svld1_hor
, load_za
, all_za
, none
)
56 DEF_SME_ZA_FUNCTION (svld1_ver
, load_za
, all_za
, none
)
57 DEF_SME_ZA_FUNCTION (svmopa
, binary_za_m
, mop_base
, za_m
)
58 DEF_SME_ZA_FUNCTION (svmopa
, binary_za_m
, d_za
, za_m
)
59 DEF_SME_ZA_FUNCTION (svmops
, binary_za_m
, mop_base
, za_m
)
60 DEF_SME_ZA_FUNCTION (svmops
, binary_za_m
, d_za
, za_m
)
61 DEF_SME_ZA_FUNCTION (svread_hor
, read_za_m
, za_all_data
, m
)
62 DEF_SME_ZA_FUNCTION (svread_ver
, read_za_m
, za_all_data
, m
)
63 DEF_SME_ZA_FUNCTION (svst1_hor
, store_za
, all_za
, none
)
64 DEF_SME_ZA_FUNCTION (svst1_ver
, store_za
, all_za
, none
)
65 DEF_SME_ZA_FUNCTION (svsumopa
, binary_za_uint_m
, mop_base_signed
, za_m
)
66 DEF_SME_ZA_FUNCTION (svsumops
, binary_za_uint_m
, mop_base_signed
, za_m
)
67 DEF_SME_ZA_FUNCTION (svusmopa
, binary_za_int_m
, mop_base_unsigned
, za_m
)
68 DEF_SME_ZA_FUNCTION (svusmops
, binary_za_int_m
, mop_base_unsigned
, za_m
)
69 DEF_SME_ZA_FUNCTION (svwrite_hor
, write_za_m
, za_all_data
, za_m
)
70 DEF_SME_ZA_FUNCTION (svwrite_ver
, write_za_m
, za_all_data
, za_m
)
71 #undef REQUIRED_EXTENSIONS
73 #define
REQUIRED_EXTENSIONS (AARCH64_FL_SME \
74 | AARCH64_FL_SME_I16I64 \
76 DEF_SME_ZA_FUNCTION (svaddha
, unary_za_m
, za_d_integer
, za_m
)
77 DEF_SME_ZA_FUNCTION (svaddva
, unary_za_m
, za_d_integer
, za_m
)
78 DEF_SME_ZA_FUNCTION (svmopa
, binary_za_m
, mop_i16i64
, za_m
)
79 DEF_SME_ZA_FUNCTION (svmops
, binary_za_m
, mop_i16i64
, za_m
)
80 DEF_SME_ZA_FUNCTION (svsumopa
, binary_za_uint_m
, mop_i16i64_signed
, za_m
)
81 DEF_SME_ZA_FUNCTION (svsumops
, binary_za_uint_m
, mop_i16i64_signed
, za_m
)
82 DEF_SME_ZA_FUNCTION (svusmopa
, binary_za_int_m
, mop_i16i64_unsigned
, za_m
)
83 DEF_SME_ZA_FUNCTION (svusmops
, binary_za_int_m
, mop_i16i64_unsigned
, za_m
)
84 #undef REQUIRED_EXTENSIONS
86 #define
REQUIRED_EXTENSIONS (AARCH64_FL_SME \
87 | AARCH64_FL_SME_F64F64 \
89 DEF_SME_ZA_FUNCTION (svmopa
, binary_za_m
, za_d_float
, za_m
)
90 DEF_SME_ZA_FUNCTION (svmops
, binary_za_m
, za_d_float
, za_m
)
91 #undef REQUIRED_EXTENSIONS
93 #define REQUIRED_EXTENSIONS AARCH64_FL_SME | AARCH64_FL_SME2
94 DEF_SME_FUNCTION (svldr_zt
, ldr_zt
, none
, none
)
95 DEF_SME_FUNCTION (svstr_zt
, str_zt
, none
, none
)
96 DEF_SME_FUNCTION (svzero_zt
, inherent_zt
, none
, none
)
97 #undef REQUIRED_EXTENSIONS
99 /* The d_za entries in this section just declare C _za64 overloads
,
100 which will then be resolved to either an integer function or a
101 floating
-point function. They are needed because the integer and
102 floating
-point functions have different architecture requirements.
*/
103 #define REQUIRED_EXTENSIONS AARCH64_FL_SME | AARCH64_FL_SME2 | AARCH64_FL_SM_ON
104 DEF_SME_ZA_FUNCTION_GS (svadd
, unary_za_slice
, za_s_data
, vg1x24
, none
)
105 DEF_SME_ZA_FUNCTION_GS (svadd
, unary_za_slice
, d_za
, vg1x24
, none
)
106 DEF_SME_ZA_FUNCTION_GS (svadd_write
, binary_za_slice_opt_single
, za_s_integer
,
108 DEF_SME_ZA_FUNCTION (svbmopa
, binary_za_m
, za_s_unsigned
, za_m
)
109 DEF_SME_ZA_FUNCTION (svbmops
, binary_za_m
, za_s_unsigned
, za_m
)
110 DEF_SME_ZA_FUNCTION_GS (svdot
, binary_za_slice_opt_single
, za_s_h_data
,
112 DEF_SME_ZA_FUNCTION_GS (svdot
, binary_za_slice_opt_single
, za_s_b_integer
,
114 DEF_SME_ZA_FUNCTION_GS (svdot_lane
, dot_za_slice_lane
, za_s_h_data
,
116 DEF_SME_ZA_FUNCTION_GS (svdot_lane
, dot_za_slice_lane
, za_s_b_integer
,
118 DEF_SME_FUNCTION_GS (svluti2_lane_zt
, luti2_lane_zt
, bhs_data
, x124
, none
)
119 DEF_SME_FUNCTION_GS (svluti4_lane_zt
, luti4_lane_zt
, bhs_data
, x12
, none
)
120 DEF_SME_FUNCTION_GS (svluti4_lane_zt
, luti4_lane_zt
, hs_data
, x4
, none
)
121 DEF_SME_ZA_FUNCTION_GS (svmla
, binary_za_slice_opt_single
, za_s_float
,
123 DEF_SME_ZA_FUNCTION_GS (svmla
, binary_za_slice_opt_single
, za_s_h_data
,
125 DEF_SME_ZA_FUNCTION_GS (svmla
, binary_za_slice_opt_single
, za_s_b_integer
,
127 DEF_SME_ZA_FUNCTION_GS (svmla_lane
, binary_za_slice_lane
, za_s_float
,
129 DEF_SME_ZA_FUNCTION_GS (svmla_lane
, binary_za_slice_lane
, za_s_h_data
,
131 DEF_SME_ZA_FUNCTION_GS (svmla_lane
, binary_za_slice_lane
, za_s_b_integer
,
133 DEF_SME_ZA_FUNCTION_GS (svmls
, binary_za_slice_opt_single
, za_s_float
,
135 DEF_SME_ZA_FUNCTION_GS (svmls
, binary_za_slice_opt_single
, za_s_h_data
,
137 DEF_SME_ZA_FUNCTION_GS (svmls
, binary_za_slice_opt_single
, za_s_b_integer
,
139 DEF_SME_ZA_FUNCTION_GS (svmls_lane
, binary_za_slice_lane
, za_s_float
,
141 DEF_SME_ZA_FUNCTION_GS (svmls_lane
, binary_za_slice_lane
, za_s_h_data
,
143 DEF_SME_ZA_FUNCTION_GS (svmls_lane
, binary_za_slice_lane
, za_s_b_integer
,
145 DEF_SME_ZA_FUNCTION (svmopa
, binary_za_m
, za_s_h_integer
, za_m
)
146 DEF_SME_ZA_FUNCTION (svmops
, binary_za_m
, za_s_h_integer
, za_m
)
147 DEF_SME_ZA_FUNCTION_GS (svread
, read_za_slice
, za_bhsd_data
, vg1x24
, none
)
148 DEF_SME_ZA_FUNCTION_GS (svread_hor
, read_za
, za_bhsd_data
, vg24
, none
)
149 DEF_SME_ZA_FUNCTION_GS (svread_ver
, read_za
, za_bhsd_data
, vg24
, none
)
150 DEF_SME_ZA_FUNCTION_GS (svsub
, unary_za_slice
, za_s_data
, vg1x24
, none
)
151 DEF_SME_ZA_FUNCTION_GS (svsub
, unary_za_slice
, d_za
, vg1x24
, none
)
152 DEF_SME_ZA_FUNCTION_GS (svsub_write
, binary_za_slice_opt_single
, za_s_integer
,
154 DEF_SME_ZA_FUNCTION_GS (svsudot
, binary_za_slice_uint_opt_single
,
155 za_s_b_signed
, vg1x24
, none
)
156 DEF_SME_ZA_FUNCTION_GS (svsudot_lane
, dot_za_slice_uint_lane
,
157 za_s_b_signed
, vg1x24
, none
)
158 DEF_SME_ZA_FUNCTION_GS (svsuvdot_lane
, dot_za_slice_uint_lane
,
159 za_s_b_signed
, vg1x4
, none
)
160 DEF_SME_ZA_FUNCTION_GS (svusdot
, binary_za_slice_int_opt_single
,
161 za_s_b_unsigned
, vg1x24
, none
)
162 DEF_SME_ZA_FUNCTION_GS (svusdot_lane
, dot_za_slice_int_lane
,
163 za_s_b_unsigned
, vg1x24
, none
)
164 DEF_SME_ZA_FUNCTION_GS (svusvdot_lane
, dot_za_slice_int_lane
,
165 za_s_b_unsigned
, vg1x4
, none
)
166 DEF_SME_ZA_FUNCTION_GS (svvdot_lane
, dot_za_slice_lane
, za_s_h_data
,
168 DEF_SME_ZA_FUNCTION_GS (svvdot_lane
, dot_za_slice_lane
, za_s_b_integer
,
170 DEF_SME_ZA_FUNCTION_GS (svwrite
, write_za_slice
, za_bhsd_data
, vg1x24
, none
)
171 DEF_SME_ZA_FUNCTION_GS (svwrite_hor
, write_za
, za_bhsd_data
, vg24
, none
)
172 DEF_SME_ZA_FUNCTION_GS (svwrite_ver
, write_za
, za_bhsd_data
, vg24
, none
)
173 #undef REQUIRED_EXTENSIONS
175 #define
REQUIRED_EXTENSIONS (AARCH64_FL_SME \
177 | AARCH64_FL_SME_I16I64 \
179 DEF_SME_ZA_FUNCTION_GS (svadd
, unary_za_slice
, za_d_integer
, vg1x24
, none
)
180 DEF_SME_ZA_FUNCTION_GS (svadd_write
, binary_za_slice_opt_single
, za_d_integer
,
182 DEF_SME_ZA_FUNCTION_GS (svdot
, binary_za_slice_opt_single
, za_d_h_integer
,
184 DEF_SME_ZA_FUNCTION_GS (svdot_lane
, dot_za_slice_lane
, za_d_h_integer
,
186 DEF_SME_ZA_FUNCTION_GS (svmla
, binary_za_slice_opt_single
, za_d_h_integer
,
188 DEF_SME_ZA_FUNCTION_GS (svmla_lane
, binary_za_slice_lane
, za_d_h_integer
,
190 DEF_SME_ZA_FUNCTION_GS (svmls
, binary_za_slice_opt_single
, za_d_h_integer
,
192 DEF_SME_ZA_FUNCTION_GS (svmls_lane
, binary_za_slice_lane
, za_d_h_integer
,
194 DEF_SME_ZA_FUNCTION_GS (svsub
, unary_za_slice
, za_d_integer
, vg1x24
, none
)
195 DEF_SME_ZA_FUNCTION_GS (svsub_write
, binary_za_slice_opt_single
, za_d_integer
,
197 DEF_SME_ZA_FUNCTION_GS (svvdot_lane
, dot_za_slice_lane
, za_d_h_integer
,
199 #undef REQUIRED_EXTENSIONS
201 #define
REQUIRED_EXTENSIONS (AARCH64_FL_SME \
203 | AARCH64_FL_SME_F64F64 \
205 DEF_SME_ZA_FUNCTION_GS (svadd
, unary_za_slice
, za_d_float
, vg1x24
, none
)
206 DEF_SME_ZA_FUNCTION_GS (svmla
, binary_za_slice_opt_single
, za_d_float
,
208 DEF_SME_ZA_FUNCTION_GS (svmla_lane
, binary_za_slice_lane
, za_d_float
,
210 DEF_SME_ZA_FUNCTION_GS (svmls
, binary_za_slice_opt_single
, za_d_float
,
212 DEF_SME_ZA_FUNCTION_GS (svmls_lane
, binary_za_slice_lane
, za_d_float
,
214 DEF_SME_ZA_FUNCTION_GS (svsub
, unary_za_slice
, za_d_float
, vg1x24
, none
)
215 #undef REQUIRED_EXTENSIONS
217 #undef DEF_SME_ZA_FUNCTION
218 #undef DEF_SME_ZA_FUNCTION_GS
219 #undef DEF_SME_FUNCTION