1 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
4 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
5
6 #include <arm_sve.h>
7
8 #ifdef SVE_OVERLOADED_FORMS
9 // A simple used,unused... macro, long enough to represent any SVE builtin.
10 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
11 #else
12 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
13 #endif
14
test_svbsl1n_s8(svint8_t op1,svint8_t op2,svint8_t op3)15 svint8_t test_svbsl1n_s8(svint8_t op1, svint8_t op2, svint8_t op3)
16 {
17 // CHECK-LABEL: test_svbsl1n_s8
18 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.bsl1n.nxv16i8(<vscale x 16 x i8> %op1, <vscale x 16 x i8> %op2, <vscale x 16 x i8> %op3)
19 // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
20 // overload-warning@+2 {{implicit declaration of function 'svbsl1n'}}
21 // expected-warning@+1 {{implicit declaration of function 'svbsl1n_s8'}}
22 return SVE_ACLE_FUNC(svbsl1n,_s8,,)(op1, op2, op3);
23 }
24
test_svbsl1n_s16(svint16_t op1,svint16_t op2,svint16_t op3)25 svint16_t test_svbsl1n_s16(svint16_t op1, svint16_t op2, svint16_t op3)
26 {
27 // CHECK-LABEL: test_svbsl1n_s16
28 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.bsl1n.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %op3)
29 // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
30 // overload-warning@+2 {{implicit declaration of function 'svbsl1n'}}
31 // expected-warning@+1 {{implicit declaration of function 'svbsl1n_s16'}}
32 return SVE_ACLE_FUNC(svbsl1n,_s16,,)(op1, op2, op3);
33 }
34
test_svbsl1n_s32(svint32_t op1,svint32_t op2,svint32_t op3)35 svint32_t test_svbsl1n_s32(svint32_t op1, svint32_t op2, svint32_t op3)
36 {
37 // CHECK-LABEL: test_svbsl1n_s32
38 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.bsl1n.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %op3)
39 // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
40 // overload-warning@+2 {{implicit declaration of function 'svbsl1n'}}
41 // expected-warning@+1 {{implicit declaration of function 'svbsl1n_s32'}}
42 return SVE_ACLE_FUNC(svbsl1n,_s32,,)(op1, op2, op3);
43 }
44
test_svbsl1n_s64(svint64_t op1,svint64_t op2,svint64_t op3)45 svint64_t test_svbsl1n_s64(svint64_t op1, svint64_t op2, svint64_t op3)
46 {
47 // CHECK-LABEL: test_svbsl1n_s64
48 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.bsl1n.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %op3)
49 // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
50 // overload-warning@+2 {{implicit declaration of function 'svbsl1n'}}
51 // expected-warning@+1 {{implicit declaration of function 'svbsl1n_s64'}}
52 return SVE_ACLE_FUNC(svbsl1n,_s64,,)(op1, op2, op3);
53 }
54
test_svbsl1n_u8(svuint8_t op1,svuint8_t op2,svuint8_t op3)55 svuint8_t test_svbsl1n_u8(svuint8_t op1, svuint8_t op2, svuint8_t op3)
56 {
57 // CHECK-LABEL: test_svbsl1n_u8
58 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.bsl1n.nxv16i8(<vscale x 16 x i8> %op1, <vscale x 16 x i8> %op2, <vscale x 16 x i8> %op3)
59 // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
60 // overload-warning@+2 {{implicit declaration of function 'svbsl1n'}}
61 // expected-warning@+1 {{implicit declaration of function 'svbsl1n_u8'}}
62 return SVE_ACLE_FUNC(svbsl1n,_u8,,)(op1, op2, op3);
63 }
64
test_svbsl1n_u16(svuint16_t op1,svuint16_t op2,svuint16_t op3)65 svuint16_t test_svbsl1n_u16(svuint16_t op1, svuint16_t op2, svuint16_t op3)
66 {
67 // CHECK-LABEL: test_svbsl1n_u16
68 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.bsl1n.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %op3)
69 // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
70 // overload-warning@+2 {{implicit declaration of function 'svbsl1n'}}
71 // expected-warning@+1 {{implicit declaration of function 'svbsl1n_u16'}}
72 return SVE_ACLE_FUNC(svbsl1n,_u16,,)(op1, op2, op3);
73 }
74
test_svbsl1n_u32(svuint32_t op1,svuint32_t op2,svuint32_t op3)75 svuint32_t test_svbsl1n_u32(svuint32_t op1, svuint32_t op2, svuint32_t op3)
76 {
77 // CHECK-LABEL: test_svbsl1n_u32
78 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.bsl1n.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %op3)
79 // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
80 // overload-warning@+2 {{implicit declaration of function 'svbsl1n'}}
81 // expected-warning@+1 {{implicit declaration of function 'svbsl1n_u32'}}
82 return SVE_ACLE_FUNC(svbsl1n,_u32,,)(op1, op2, op3);
83 }
84
test_svbsl1n_u64(svuint64_t op1,svuint64_t op2,svuint64_t op3)85 svuint64_t test_svbsl1n_u64(svuint64_t op1, svuint64_t op2, svuint64_t op3)
86 {
87 // CHECK-LABEL: test_svbsl1n_u64
88 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.bsl1n.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %op3)
89 // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
90 // overload-warning@+2 {{implicit declaration of function 'svbsl1n'}}
91 // expected-warning@+1 {{implicit declaration of function 'svbsl1n_u64'}}
92 return SVE_ACLE_FUNC(svbsl1n,_u64,,)(op1, op2, op3);
93 }
94
test_svbsl1n_n_s8(svint8_t op1,svint8_t op2,int8_t op3)95 svint8_t test_svbsl1n_n_s8(svint8_t op1, svint8_t op2, int8_t op3)
96 {
97 // CHECK-LABEL: test_svbsl1n_n_s8
98 // CHECK: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op3)
99 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.bsl1n.nxv16i8(<vscale x 16 x i8> %op1, <vscale x 16 x i8> %op2, <vscale x 16 x i8> %[[DUP]])
100 // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
101 // overload-warning@+2 {{implicit declaration of function 'svbsl1n'}}
102 // expected-warning@+1 {{implicit declaration of function 'svbsl1n_n_s8'}}
103 return SVE_ACLE_FUNC(svbsl1n,_n_s8,,)(op1, op2, op3);
104 }
105
test_svbsl1n_n_s16(svint16_t op1,svint16_t op2,int16_t op3)106 svint16_t test_svbsl1n_n_s16(svint16_t op1, svint16_t op2, int16_t op3)
107 {
108 // CHECK-LABEL: test_svbsl1n_n_s16
109 // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op3)
110 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.bsl1n.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %[[DUP]])
111 // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
112 // overload-warning@+2 {{implicit declaration of function 'svbsl1n'}}
113 // expected-warning@+1 {{implicit declaration of function 'svbsl1n_n_s16'}}
114 return SVE_ACLE_FUNC(svbsl1n,_n_s16,,)(op1, op2, op3);
115 }
116
test_svbsl1n_n_s32(svint32_t op1,svint32_t op2,int32_t op3)117 svint32_t test_svbsl1n_n_s32(svint32_t op1, svint32_t op2, int32_t op3)
118 {
119 // CHECK-LABEL: test_svbsl1n_n_s32
120 // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op3)
121 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.bsl1n.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %[[DUP]])
122 // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
123 // overload-warning@+2 {{implicit declaration of function 'svbsl1n'}}
124 // expected-warning@+1 {{implicit declaration of function 'svbsl1n_n_s32'}}
125 return SVE_ACLE_FUNC(svbsl1n,_n_s32,,)(op1, op2, op3);
126 }
127
test_svbsl1n_n_s64(svint64_t op1,svint64_t op2,int64_t op3)128 svint64_t test_svbsl1n_n_s64(svint64_t op1, svint64_t op2, int64_t op3)
129 {
130 // CHECK-LABEL: test_svbsl1n_n_s64
131 // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op3)
132 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.bsl1n.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %[[DUP]])
133 // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
134 // overload-warning@+2 {{implicit declaration of function 'svbsl1n'}}
135 // expected-warning@+1 {{implicit declaration of function 'svbsl1n_n_s64'}}
136 return SVE_ACLE_FUNC(svbsl1n,_n_s64,,)(op1, op2, op3);
137 }
138
test_svbsl1n_n_u8(svuint8_t op1,svuint8_t op2,uint8_t op3)139 svuint8_t test_svbsl1n_n_u8(svuint8_t op1, svuint8_t op2, uint8_t op3)
140 {
141 // CHECK-LABEL: test_svbsl1n_n_u8
142 // CHECK: %[[DUP:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 %op3)
143 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.bsl1n.nxv16i8(<vscale x 16 x i8> %op1, <vscale x 16 x i8> %op2, <vscale x 16 x i8> %[[DUP]])
144 // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
145 // overload-warning@+2 {{implicit declaration of function 'svbsl1n'}}
146 // expected-warning@+1 {{implicit declaration of function 'svbsl1n_n_u8'}}
147 return SVE_ACLE_FUNC(svbsl1n,_n_u8,,)(op1, op2, op3);
148 }
149
test_svbsl1n_n_u16(svuint16_t op1,svuint16_t op2,uint16_t op3)150 svuint16_t test_svbsl1n_n_u16(svuint16_t op1, svuint16_t op2, uint16_t op3)
151 {
152 // CHECK-LABEL: test_svbsl1n_n_u16
153 // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op3)
154 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.bsl1n.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %[[DUP]])
155 // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
156 // overload-warning@+2 {{implicit declaration of function 'svbsl1n'}}
157 // expected-warning@+1 {{implicit declaration of function 'svbsl1n_n_u16'}}
158 return SVE_ACLE_FUNC(svbsl1n,_n_u16,,)(op1, op2, op3);
159 }
160
test_svbsl1n_n_u32(svuint32_t op1,svuint32_t op2,uint32_t op3)161 svuint32_t test_svbsl1n_n_u32(svuint32_t op1, svuint32_t op2, uint32_t op3)
162 {
163 // CHECK-LABEL: test_svbsl1n_n_u32
164 // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op3)
165 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.bsl1n.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %[[DUP]])
166 // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
167 // overload-warning@+2 {{implicit declaration of function 'svbsl1n'}}
168 // expected-warning@+1 {{implicit declaration of function 'svbsl1n_n_u32'}}
169 return SVE_ACLE_FUNC(svbsl1n,_n_u32,,)(op1, op2, op3);
170 }
171
test_svbsl1n_n_u64(svuint64_t op1,svuint64_t op2,uint64_t op3)172 svuint64_t test_svbsl1n_n_u64(svuint64_t op1, svuint64_t op2, uint64_t op3)
173 {
174 // CHECK-LABEL: test_svbsl1n_n_u64
175 // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op3)
176 // CHECK: %[[INTRINSIC:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.bsl1n.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %[[DUP]])
177 // CHECK: ret <vscale x 2 x i64> %[[INTRINSIC]]
178 // overload-warning@+2 {{implicit declaration of function 'svbsl1n'}}
179 // expected-warning@+1 {{implicit declaration of function 'svbsl1n_n_u64'}}
180 return SVE_ACLE_FUNC(svbsl1n,_n_u64,,)(op1, op2, op3);
181 }
182