Skip to content

Commit 50cda17

Browse files
[Clang][AArch64] Relax SVE2 requirement for builtins available via +sme. (#162457)
Having both SVE and SME environments essentially means the majority of SVE2 instructions are always available. This PR reflects this at the builtins level whereby +sve+sme is enough to enable this subset. It's a similar story for +sve2p1 whereby the feature means a subset of SME2 instructions are always available.
1 parent 86ab519 commit 50cda17

12 files changed

+12983
-20757
lines changed

clang/include/clang/Basic/arm_sve.td

Lines changed: 32 additions & 32 deletions
Large diffs are not rendered by default.
Lines changed: 74 additions & 219 deletions
Large diffs are not rendered by default.
Lines changed: 26 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
// NOTE: File has been autogenerated by utils/aarch64_builtins_test_generator.py
22
// RUN: %clang_cc1 %s -fsyntax-only -triple aarch64-none-linux-gnu -target-feature +fp8 -target-feature +sme -target-feature +sve -target-feature +sve2 -verify=guard
3-
// RUN: %clang_cc1 %s -fsyntax-only -triple aarch64-none-linux-gnu -target-feature +fp8 -target-feature +sme -target-feature +sme2 -target-feature +sve -verify=streaming-guard
4-
// RUN: %clang_cc1 %s -fsyntax-only -triple aarch64-none-linux-gnu -target-feature +fp8 -target-feature +sme -target-feature +sme2 -target-feature +sve -target-feature +sve2 -verify
3+
// RUN: %clang_cc1 %s -fsyntax-only -triple aarch64-none-linux-gnu -target-feature +fp8 -target-feature +sme -target-feature +sme2 -target-feature +sve -verify
54
// expected-no-diagnostics
65

76
// REQUIRES: aarch64-registered-target
87

98
#include <arm_sve.h>
109

11-
// Properties: guard="sve,sve2,fp8" streaming_guard="sme,sme2,fp8" flags="feature-dependent"
10+
// Properties: guard="sve,(sve2|sme2),fp8" streaming_guard="sme,sme2,fp8" flags="feature-dependent"
1211

1312
void test(void) {
1413
fpm_t fpm_t_val;
@@ -17,53 +16,29 @@ void test(void) {
1716
svfloat32x2_t svfloat32x2_t_val;
1817
svmfloat8_t svmfloat8_t_val;
1918

20-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
2119
svcvt1_bf16_fpm(svmfloat8_t_val, fpm_t_val);
22-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
2320
svcvt1_bf16_mf8_fpm(svmfloat8_t_val, fpm_t_val);
24-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
2521
svcvt1_f16_fpm(svmfloat8_t_val, fpm_t_val);
26-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
2722
svcvt1_f16_mf8_fpm(svmfloat8_t_val, fpm_t_val);
28-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
2923
svcvt2_bf16_fpm(svmfloat8_t_val, fpm_t_val);
30-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
3124
svcvt2_bf16_mf8_fpm(svmfloat8_t_val, fpm_t_val);
32-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
3325
svcvt2_f16_fpm(svmfloat8_t_val, fpm_t_val);
34-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
3526
svcvt2_f16_mf8_fpm(svmfloat8_t_val, fpm_t_val);
36-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
3727
svcvtlt1_bf16_fpm(svmfloat8_t_val, fpm_t_val);
38-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
3928
svcvtlt1_bf16_mf8_fpm(svmfloat8_t_val, fpm_t_val);
40-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
4129
svcvtlt1_f16_fpm(svmfloat8_t_val, fpm_t_val);
42-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
4330
svcvtlt1_f16_mf8_fpm(svmfloat8_t_val, fpm_t_val);
44-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
4531
svcvtlt2_bf16_fpm(svmfloat8_t_val, fpm_t_val);
46-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
4732
svcvtlt2_bf16_mf8_fpm(svmfloat8_t_val, fpm_t_val);
48-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
4933
svcvtlt2_f16_fpm(svmfloat8_t_val, fpm_t_val);
50-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
5134
svcvtlt2_f16_mf8_fpm(svmfloat8_t_val, fpm_t_val);
52-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
5335
svcvtn_mf8_bf16_x2_fpm(svbfloat16x2_t_val, fpm_t_val);
54-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
5536
svcvtn_mf8_f16_x2_fpm(svfloat16x2_t_val, fpm_t_val);
56-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
5737
svcvtn_mf8_fpm(svbfloat16x2_t_val, fpm_t_val);
58-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
5938
svcvtn_mf8_fpm(svfloat16x2_t_val, fpm_t_val);
60-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
6139
svcvtnb_mf8_f32_x2_fpm(svfloat32x2_t_val, fpm_t_val);
62-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
6340
svcvtnb_mf8_fpm(svfloat32x2_t_val, fpm_t_val);
64-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
6541
svcvtnt_mf8_f32_x2_fpm(svmfloat8_t_val, svfloat32x2_t_val, fpm_t_val);
66-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
6742
svcvtnt_mf8_fpm(svmfloat8_t_val, svfloat32x2_t_val, fpm_t_val);
6843
}
6944

@@ -131,76 +106,52 @@ void test_streaming_compatible(void) __arm_streaming_compatible{
131106
svfloat32x2_t svfloat32x2_t_val;
132107
svmfloat8_t svmfloat8_t_val;
133108

134-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
135-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
109+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
136110
svcvt1_bf16_fpm(svmfloat8_t_val, fpm_t_val);
137-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
138-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
111+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
139112
svcvt1_bf16_mf8_fpm(svmfloat8_t_val, fpm_t_val);
140-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
141-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
113+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
142114
svcvt1_f16_fpm(svmfloat8_t_val, fpm_t_val);
143-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
144-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
115+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
145116
svcvt1_f16_mf8_fpm(svmfloat8_t_val, fpm_t_val);
146-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
147-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
117+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
148118
svcvt2_bf16_fpm(svmfloat8_t_val, fpm_t_val);
149-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
150-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
119+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
151120
svcvt2_bf16_mf8_fpm(svmfloat8_t_val, fpm_t_val);
152-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
153-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
121+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
154122
svcvt2_f16_fpm(svmfloat8_t_val, fpm_t_val);
155-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
156-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
123+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
157124
svcvt2_f16_mf8_fpm(svmfloat8_t_val, fpm_t_val);
158-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
159-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
125+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
160126
svcvtlt1_bf16_fpm(svmfloat8_t_val, fpm_t_val);
161-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
162-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
127+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
163128
svcvtlt1_bf16_mf8_fpm(svmfloat8_t_val, fpm_t_val);
164-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
165-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
129+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
166130
svcvtlt1_f16_fpm(svmfloat8_t_val, fpm_t_val);
167-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
168-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
131+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
169132
svcvtlt1_f16_mf8_fpm(svmfloat8_t_val, fpm_t_val);
170-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
171-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
133+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
172134
svcvtlt2_bf16_fpm(svmfloat8_t_val, fpm_t_val);
173-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
174-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
135+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
175136
svcvtlt2_bf16_mf8_fpm(svmfloat8_t_val, fpm_t_val);
176-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
177-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
137+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
178138
svcvtlt2_f16_fpm(svmfloat8_t_val, fpm_t_val);
179-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
180-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
139+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
181140
svcvtlt2_f16_mf8_fpm(svmfloat8_t_val, fpm_t_val);
182-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
183-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
141+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
184142
svcvtn_mf8_bf16_x2_fpm(svbfloat16x2_t_val, fpm_t_val);
185-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
186-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
143+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
187144
svcvtn_mf8_f16_x2_fpm(svfloat16x2_t_val, fpm_t_val);
188-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
189-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
145+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
190146
svcvtn_mf8_fpm(svbfloat16x2_t_val, fpm_t_val);
191-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
192-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
147+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
193148
svcvtn_mf8_fpm(svfloat16x2_t_val, fpm_t_val);
194-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
195-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
149+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
196150
svcvtnb_mf8_f32_x2_fpm(svfloat32x2_t_val, fpm_t_val);
197-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
198-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
151+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
199152
svcvtnb_mf8_fpm(svfloat32x2_t_val, fpm_t_val);
200-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
201-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
153+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
202154
svcvtnt_mf8_f32_x2_fpm(svmfloat8_t_val, svfloat32x2_t_val, fpm_t_val);
203-
// guard-error@+2 {{builtin can only be called from a non-streaming function}}
204-
// streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
155+
// guard-error@+1 {{builtin can only be called from a non-streaming function}}
205156
svcvtnt_mf8_fpm(svmfloat8_t_val, svfloat32x2_t_val, fpm_t_val);
206157
}

0 commit comments

Comments
 (0)