Skip to content

Commit b1d83e4

Browse files
sdesmalen-armAlexisPerry
authored andcommitted
[Clang][AArch64] Expose compatible SVE intrinsics with only +sme (llvm#95787)
This allows code with SVE intrinsics to be compiled with +sme,+nosve, assuming the encompassing function is in the correct mode (see llvm#93802)
1 parent 94e852b commit b1d83e4

File tree

228 files changed

+8015
-6297
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+8015
-6297
lines changed

clang/include/clang/Basic/arm_sve.td

Lines changed: 89 additions & 63 deletions
Large diffs are not rendered by default.

clang/include/clang/Basic/arm_sve_sme_incl.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ class Inst<string n, string p, string t, MergeType mt, string i,
272272
string Name = n;
273273
string Prototype = p;
274274
string Types = t;
275-
string TargetGuard = "sve";
275+
string TargetGuard = "sve|sme";
276276
int Merge = mt.Value;
277277
string MergeSuffix = mt.Suffix;
278278
string LLVMIntrinsic = i;

clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_abd.c

Lines changed: 74 additions & 66 deletions
Large diffs are not rendered by default.

clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_abs.c

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
66
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
77
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
8+
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sme -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
9+
810
#include <arm_sve.h>
911

12+
#if defined __ARM_FEATURE_SME
13+
#define MODE_ATTR __arm_streaming
14+
#else
15+
#define MODE_ATTR
16+
#endif
17+
1018
#ifdef SVE_OVERLOADED_FORMS
1119
// A simple used,unused... macro, long enough to represent any SVE builtin.
1220
#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
@@ -24,7 +32,7 @@
2432
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.abs.nxv16i8(<vscale x 16 x i8> zeroinitializer, <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
2533
// CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
2634
//
27-
svint8_t test_svabs_s8_z(svbool_t pg, svint8_t op)
35+
svint8_t test_svabs_s8_z(svbool_t pg, svint8_t op) MODE_ATTR
2836
{
2937
return SVE_ACLE_FUNC(svabs,_s8,_z,)(pg, op);
3038
}
@@ -41,7 +49,7 @@ svint8_t test_svabs_s8_z(svbool_t pg, svint8_t op)
4149
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.abs.nxv8i16(<vscale x 8 x i16> zeroinitializer, <vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
4250
// CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
4351
//
44-
svint16_t test_svabs_s16_z(svbool_t pg, svint16_t op)
52+
svint16_t test_svabs_s16_z(svbool_t pg, svint16_t op) MODE_ATTR
4553
{
4654
return SVE_ACLE_FUNC(svabs,_s16,_z,)(pg, op);
4755
}
@@ -58,7 +66,7 @@ svint16_t test_svabs_s16_z(svbool_t pg, svint16_t op)
5866
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.abs.nxv4i32(<vscale x 4 x i32> zeroinitializer, <vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
5967
// CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
6068
//
61-
svint32_t test_svabs_s32_z(svbool_t pg, svint32_t op)
69+
svint32_t test_svabs_s32_z(svbool_t pg, svint32_t op) MODE_ATTR
6270
{
6371
return SVE_ACLE_FUNC(svabs,_s32,_z,)(pg, op);
6472
}
@@ -75,7 +83,7 @@ svint32_t test_svabs_s32_z(svbool_t pg, svint32_t op)
7583
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.abs.nxv2i64(<vscale x 2 x i64> zeroinitializer, <vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
7684
// CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
7785
//
78-
svint64_t test_svabs_s64_z(svbool_t pg, svint64_t op)
86+
svint64_t test_svabs_s64_z(svbool_t pg, svint64_t op) MODE_ATTR
7987
{
8088
return SVE_ACLE_FUNC(svabs,_s64,_z,)(pg, op);
8189
}
@@ -90,7 +98,7 @@ svint64_t test_svabs_s64_z(svbool_t pg, svint64_t op)
9098
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.abs.nxv16i8(<vscale x 16 x i8> [[INACTIVE:%.*]], <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
9199
// CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
92100
//
93-
svint8_t test_svabs_s8_m(svint8_t inactive, svbool_t pg, svint8_t op)
101+
svint8_t test_svabs_s8_m(svint8_t inactive, svbool_t pg, svint8_t op) MODE_ATTR
94102
{
95103
return SVE_ACLE_FUNC(svabs,_s8,_m,)(inactive, pg, op);
96104
}
@@ -107,7 +115,7 @@ svint8_t test_svabs_s8_m(svint8_t inactive, svbool_t pg, svint8_t op)
107115
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.abs.nxv8i16(<vscale x 8 x i16> [[INACTIVE:%.*]], <vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
108116
// CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
109117
//
110-
svint16_t test_svabs_s16_m(svint16_t inactive, svbool_t pg, svint16_t op)
118+
svint16_t test_svabs_s16_m(svint16_t inactive, svbool_t pg, svint16_t op) MODE_ATTR
111119
{
112120
return SVE_ACLE_FUNC(svabs,_s16,_m,)(inactive, pg, op);
113121
}
@@ -124,7 +132,7 @@ svint16_t test_svabs_s16_m(svint16_t inactive, svbool_t pg, svint16_t op)
124132
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.abs.nxv4i32(<vscale x 4 x i32> [[INACTIVE:%.*]], <vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
125133
// CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
126134
//
127-
svint32_t test_svabs_s32_m(svint32_t inactive, svbool_t pg, svint32_t op)
135+
svint32_t test_svabs_s32_m(svint32_t inactive, svbool_t pg, svint32_t op) MODE_ATTR
128136
{
129137
return SVE_ACLE_FUNC(svabs,_s32,_m,)(inactive, pg, op);
130138
}
@@ -141,7 +149,7 @@ svint32_t test_svabs_s32_m(svint32_t inactive, svbool_t pg, svint32_t op)
141149
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.abs.nxv2i64(<vscale x 2 x i64> [[INACTIVE:%.*]], <vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
142150
// CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
143151
//
144-
svint64_t test_svabs_s64_m(svint64_t inactive, svbool_t pg, svint64_t op)
152+
svint64_t test_svabs_s64_m(svint64_t inactive, svbool_t pg, svint64_t op) MODE_ATTR
145153
{
146154
return SVE_ACLE_FUNC(svabs,_s64,_m,)(inactive, pg, op);
147155
}
@@ -156,7 +164,7 @@ svint64_t test_svabs_s64_m(svint64_t inactive, svbool_t pg, svint64_t op)
156164
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.abs.nxv16i8(<vscale x 16 x i8> undef, <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
157165
// CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
158166
//
159-
svint8_t test_svabs_s8_x(svbool_t pg, svint8_t op)
167+
svint8_t test_svabs_s8_x(svbool_t pg, svint8_t op) MODE_ATTR
160168
{
161169
return SVE_ACLE_FUNC(svabs,_s8,_x,)(pg, op);
162170
}
@@ -173,7 +181,7 @@ svint8_t test_svabs_s8_x(svbool_t pg, svint8_t op)
173181
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.abs.nxv8i16(<vscale x 8 x i16> undef, <vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
174182
// CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
175183
//
176-
svint16_t test_svabs_s16_x(svbool_t pg, svint16_t op)
184+
svint16_t test_svabs_s16_x(svbool_t pg, svint16_t op) MODE_ATTR
177185
{
178186
return SVE_ACLE_FUNC(svabs,_s16,_x,)(pg, op);
179187
}
@@ -190,7 +198,7 @@ svint16_t test_svabs_s16_x(svbool_t pg, svint16_t op)
190198
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.abs.nxv4i32(<vscale x 4 x i32> undef, <vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
191199
// CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
192200
//
193-
svint32_t test_svabs_s32_x(svbool_t pg, svint32_t op)
201+
svint32_t test_svabs_s32_x(svbool_t pg, svint32_t op) MODE_ATTR
194202
{
195203
return SVE_ACLE_FUNC(svabs,_s32,_x,)(pg, op);
196204
}
@@ -207,7 +215,7 @@ svint32_t test_svabs_s32_x(svbool_t pg, svint32_t op)
207215
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.abs.nxv2i64(<vscale x 2 x i64> undef, <vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
208216
// CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
209217
//
210-
svint64_t test_svabs_s64_x(svbool_t pg, svint64_t op)
218+
svint64_t test_svabs_s64_x(svbool_t pg, svint64_t op) MODE_ATTR
211219
{
212220
return SVE_ACLE_FUNC(svabs,_s64,_x,)(pg, op);
213221
}
@@ -224,7 +232,7 @@ svint64_t test_svabs_s64_x(svbool_t pg, svint64_t op)
224232
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.fabs.nxv8f16(<vscale x 8 x half> zeroinitializer, <vscale x 8 x i1> [[TMP0]], <vscale x 8 x half> [[OP:%.*]])
225233
// CPP-CHECK-NEXT: ret <vscale x 8 x half> [[TMP1]]
226234
//
227-
svfloat16_t test_svabs_f16_z(svbool_t pg, svfloat16_t op)
235+
svfloat16_t test_svabs_f16_z(svbool_t pg, svfloat16_t op) MODE_ATTR
228236
{
229237
return SVE_ACLE_FUNC(svabs,_f16,_z,)(pg, op);
230238
}
@@ -241,7 +249,7 @@ svfloat16_t test_svabs_f16_z(svbool_t pg, svfloat16_t op)
241249
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.fabs.nxv4f32(<vscale x 4 x float> zeroinitializer, <vscale x 4 x i1> [[TMP0]], <vscale x 4 x float> [[OP:%.*]])
242250
// CPP-CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
243251
//
244-
svfloat32_t test_svabs_f32_z(svbool_t pg, svfloat32_t op)
252+
svfloat32_t test_svabs_f32_z(svbool_t pg, svfloat32_t op) MODE_ATTR
245253
{
246254
return SVE_ACLE_FUNC(svabs,_f32,_z,)(pg, op);
247255
}
@@ -258,7 +266,7 @@ svfloat32_t test_svabs_f32_z(svbool_t pg, svfloat32_t op)
258266
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x double> @llvm.aarch64.sve.fabs.nxv2f64(<vscale x 2 x double> zeroinitializer, <vscale x 2 x i1> [[TMP0]], <vscale x 2 x double> [[OP:%.*]])
259267
// CPP-CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
260268
//
261-
svfloat64_t test_svabs_f64_z(svbool_t pg, svfloat64_t op)
269+
svfloat64_t test_svabs_f64_z(svbool_t pg, svfloat64_t op) MODE_ATTR
262270
{
263271
return SVE_ACLE_FUNC(svabs,_f64,_z,)(pg, op);
264272
}
@@ -275,7 +283,7 @@ svfloat64_t test_svabs_f64_z(svbool_t pg, svfloat64_t op)
275283
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.fabs.nxv8f16(<vscale x 8 x half> [[INACTIVE:%.*]], <vscale x 8 x i1> [[TMP0]], <vscale x 8 x half> [[OP:%.*]])
276284
// CPP-CHECK-NEXT: ret <vscale x 8 x half> [[TMP1]]
277285
//
278-
svfloat16_t test_svabs_f16_m(svfloat16_t inactive, svbool_t pg, svfloat16_t op)
286+
svfloat16_t test_svabs_f16_m(svfloat16_t inactive, svbool_t pg, svfloat16_t op) MODE_ATTR
279287
{
280288
return SVE_ACLE_FUNC(svabs,_f16,_m,)(inactive, pg, op);
281289
}
@@ -292,7 +300,7 @@ svfloat16_t test_svabs_f16_m(svfloat16_t inactive, svbool_t pg, svfloat16_t op)
292300
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.fabs.nxv4f32(<vscale x 4 x float> [[INACTIVE:%.*]], <vscale x 4 x i1> [[TMP0]], <vscale x 4 x float> [[OP:%.*]])
293301
// CPP-CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
294302
//
295-
svfloat32_t test_svabs_f32_m(svfloat32_t inactive, svbool_t pg, svfloat32_t op)
303+
svfloat32_t test_svabs_f32_m(svfloat32_t inactive, svbool_t pg, svfloat32_t op) MODE_ATTR
296304
{
297305
return SVE_ACLE_FUNC(svabs,_f32,_m,)(inactive, pg, op);
298306
}
@@ -309,7 +317,7 @@ svfloat32_t test_svabs_f32_m(svfloat32_t inactive, svbool_t pg, svfloat32_t op)
309317
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x double> @llvm.aarch64.sve.fabs.nxv2f64(<vscale x 2 x double> [[INACTIVE:%.*]], <vscale x 2 x i1> [[TMP0]], <vscale x 2 x double> [[OP:%.*]])
310318
// CPP-CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
311319
//
312-
svfloat64_t test_svabs_f64_m(svfloat64_t inactive, svbool_t pg, svfloat64_t op)
320+
svfloat64_t test_svabs_f64_m(svfloat64_t inactive, svbool_t pg, svfloat64_t op) MODE_ATTR
313321
{
314322
return SVE_ACLE_FUNC(svabs,_f64,_m,)(inactive, pg, op);
315323
}
@@ -326,7 +334,7 @@ svfloat64_t test_svabs_f64_m(svfloat64_t inactive, svbool_t pg, svfloat64_t op)
326334
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.fabs.nxv8f16(<vscale x 8 x half> undef, <vscale x 8 x i1> [[TMP0]], <vscale x 8 x half> [[OP:%.*]])
327335
// CPP-CHECK-NEXT: ret <vscale x 8 x half> [[TMP1]]
328336
//
329-
svfloat16_t test_svabs_f16_x(svbool_t pg, svfloat16_t op)
337+
svfloat16_t test_svabs_f16_x(svbool_t pg, svfloat16_t op) MODE_ATTR
330338
{
331339
return SVE_ACLE_FUNC(svabs,_f16,_x,)(pg, op);
332340
}
@@ -343,7 +351,7 @@ svfloat16_t test_svabs_f16_x(svbool_t pg, svfloat16_t op)
343351
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.fabs.nxv4f32(<vscale x 4 x float> undef, <vscale x 4 x i1> [[TMP0]], <vscale x 4 x float> [[OP:%.*]])
344352
// CPP-CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
345353
//
346-
svfloat32_t test_svabs_f32_x(svbool_t pg, svfloat32_t op)
354+
svfloat32_t test_svabs_f32_x(svbool_t pg, svfloat32_t op) MODE_ATTR
347355
{
348356
return SVE_ACLE_FUNC(svabs,_f32,_x,)(pg, op);
349357
}
@@ -360,7 +368,7 @@ svfloat32_t test_svabs_f32_x(svbool_t pg, svfloat32_t op)
360368
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x double> @llvm.aarch64.sve.fabs.nxv2f64(<vscale x 2 x double> undef, <vscale x 2 x i1> [[TMP0]], <vscale x 2 x double> [[OP:%.*]])
361369
// CPP-CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
362370
//
363-
svfloat64_t test_svabs_f64_x(svbool_t pg, svfloat64_t op)
371+
svfloat64_t test_svabs_f64_x(svbool_t pg, svfloat64_t op) MODE_ATTR
364372
{
365373
return SVE_ACLE_FUNC(svabs,_f64,_x,)(pg, op);
366374
}

clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_acge.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
66
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
77
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -S -disable-O0-optnone -Werror -o /dev/null %s
8+
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sme -S -disable-O0-optnone -Werror -o /dev/null %s
9+
810
#include <arm_sve.h>
911

12+
#if defined __ARM_FEATURE_SME
13+
#define MODE_ATTR __arm_streaming
14+
#else
15+
#define MODE_ATTR
16+
#endif
17+
1018
#ifdef SVE_OVERLOADED_FORMS
1119
// A simple used,unused... macro, long enough to represent any SVE builtin.
1220
#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
@@ -28,7 +36,7 @@
2836
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP1]])
2937
// CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP2]]
3038
//
31-
svbool_t test_svacge_f16(svbool_t pg, svfloat16_t op1, svfloat16_t op2)
39+
svbool_t test_svacge_f16(svbool_t pg, svfloat16_t op1, svfloat16_t op2) MODE_ATTR
3240
{
3341
return SVE_ACLE_FUNC(svacge,_f16,,)(pg, op1, op2);
3442
}
@@ -47,7 +55,7 @@ svbool_t test_svacge_f16(svbool_t pg, svfloat16_t op1, svfloat16_t op2)
4755
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP1]])
4856
// CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP2]]
4957
//
50-
svbool_t test_svacge_f32(svbool_t pg, svfloat32_t op1, svfloat32_t op2)
58+
svbool_t test_svacge_f32(svbool_t pg, svfloat32_t op1, svfloat32_t op2) MODE_ATTR
5159
{
5260
return SVE_ACLE_FUNC(svacge,_f32,,)(pg, op1, op2);
5361
}
@@ -66,7 +74,7 @@ svbool_t test_svacge_f32(svbool_t pg, svfloat32_t op1, svfloat32_t op2)
6674
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP1]])
6775
// CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP2]]
6876
//
69-
svbool_t test_svacge_f64(svbool_t pg, svfloat64_t op1, svfloat64_t op2)
77+
svbool_t test_svacge_f64(svbool_t pg, svfloat64_t op1, svfloat64_t op2) MODE_ATTR
7078
{
7179
return SVE_ACLE_FUNC(svacge,_f64,,)(pg, op1, op2);
7280
}
@@ -89,7 +97,7 @@ svbool_t test_svacge_f64(svbool_t pg, svfloat64_t op1, svfloat64_t op2)
8997
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP1]])
9098
// CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP2]]
9199
//
92-
svbool_t test_svacge_n_f32(svbool_t pg, svfloat32_t op1, float32_t op2)
100+
svbool_t test_svacge_n_f32(svbool_t pg, svfloat32_t op1, float32_t op2) MODE_ATTR
93101
{
94102
return SVE_ACLE_FUNC(svacge,_n_f32,,)(pg, op1, op2);
95103
}
@@ -112,7 +120,7 @@ svbool_t test_svacge_n_f32(svbool_t pg, svfloat32_t op1, float32_t op2)
112120
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP1]])
113121
// CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP2]]
114122
//
115-
svbool_t test_svacge_n_f64(svbool_t pg, svfloat64_t op1, float64_t op2)
123+
svbool_t test_svacge_n_f64(svbool_t pg, svfloat64_t op1, float64_t op2) MODE_ATTR
116124
{
117125
return SVE_ACLE_FUNC(svacge,_n_f64,,)(pg, op1, op2);
118126
}

clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_acgt.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
66
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
77
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -S -disable-O0-optnone -Werror -o /dev/null %s
8+
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sme -S -disable-O0-optnone -Werror -o /dev/null %s
9+
810
#include <arm_sve.h>
911

12+
#if defined __ARM_FEATURE_SME
13+
#define MODE_ATTR __arm_streaming
14+
#else
15+
#define MODE_ATTR
16+
#endif
17+
1018
#ifdef SVE_OVERLOADED_FORMS
1119
// A simple used,unused... macro, long enough to represent any SVE builtin.
1220
#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
@@ -28,7 +36,7 @@
2836
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP1]])
2937
// CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP2]]
3038
//
31-
svbool_t test_svacgt_f16(svbool_t pg, svfloat16_t op1, svfloat16_t op2)
39+
svbool_t test_svacgt_f16(svbool_t pg, svfloat16_t op1, svfloat16_t op2) MODE_ATTR
3240
{
3341
return SVE_ACLE_FUNC(svacgt,_f16,,)(pg, op1, op2);
3442
}
@@ -47,7 +55,7 @@ svbool_t test_svacgt_f16(svbool_t pg, svfloat16_t op1, svfloat16_t op2)
4755
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP1]])
4856
// CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP2]]
4957
//
50-
svbool_t test_svacgt_f32(svbool_t pg, svfloat32_t op1, svfloat32_t op2)
58+
svbool_t test_svacgt_f32(svbool_t pg, svfloat32_t op1, svfloat32_t op2) MODE_ATTR
5159
{
5260
return SVE_ACLE_FUNC(svacgt,_f32,,)(pg, op1, op2);
5361
}
@@ -66,7 +74,7 @@ svbool_t test_svacgt_f32(svbool_t pg, svfloat32_t op1, svfloat32_t op2)
6674
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP1]])
6775
// CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP2]]
6876
//
69-
svbool_t test_svacgt_f64(svbool_t pg, svfloat64_t op1, svfloat64_t op2)
77+
svbool_t test_svacgt_f64(svbool_t pg, svfloat64_t op1, svfloat64_t op2) MODE_ATTR
7078
{
7179
return SVE_ACLE_FUNC(svacgt,_f64,,)(pg, op1, op2);
7280
}
@@ -89,7 +97,7 @@ svbool_t test_svacgt_f64(svbool_t pg, svfloat64_t op1, svfloat64_t op2)
8997
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP1]])
9098
// CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP2]]
9199
//
92-
svbool_t test_svacgt_n_f32(svbool_t pg, svfloat32_t op1, float32_t op2)
100+
svbool_t test_svacgt_n_f32(svbool_t pg, svfloat32_t op1, float32_t op2) MODE_ATTR
93101
{
94102
return SVE_ACLE_FUNC(svacgt,_n_f32,,)(pg, op1, op2);
95103
}
@@ -112,7 +120,7 @@ svbool_t test_svacgt_n_f32(svbool_t pg, svfloat32_t op1, float32_t op2)
112120
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP1]])
113121
// CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP2]]
114122
//
115-
svbool_t test_svacgt_n_f64(svbool_t pg, svfloat64_t op1, float64_t op2)
123+
svbool_t test_svacgt_n_f64(svbool_t pg, svfloat64_t op1, float64_t op2) MODE_ATTR
116124
{
117125
return SVE_ACLE_FUNC(svacgt,_n_f64,,)(pg, op1, op2);
118126
}

0 commit comments

Comments
 (0)