Debian Codegraph @

clang/test/CodeGen/AArch64/sve2p2-intrinsics/acle_sve2p2_expand.c

raw
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // REQUIRES: aarch64-registered-target
3 // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2p2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
4 // RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +sme2p2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
5 // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sme2p2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
6
7 // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2p2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
8 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2p2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
9 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2p2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
10 // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2p2 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
11 // RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +sme2p2 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
12
13 #ifdef __ARM_FEATURE_SME
14 #include "arm_sme.h"
15 #define STREAMING __arm_streaming
16 #else
17 #include "arm_sve.h"
18 #define STREAMING
19 #endif
20
21 #ifdef SVE_OVERLOADED_FORMS
22 // A simple used,unused... macro, long enough to represent any SVE builtin.
23 #define SVE_ACLE_FUNC(A1,A2_UNUSED) A1
24 #else
25 #define SVE_ACLE_FUNC(A1,A2) A1##A2
26 #endif
27
28 // CHECK-LABEL: @test_svexpand_s8(
29 // CHECK-NEXT: entry:
30 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.expand.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
31 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
32 //
33 // CPP-CHECK-LABEL: @_Z16test_svexpand_s8u10__SVBool_tu10__SVInt8_t(
34 // CPP-CHECK-NEXT: entry:
35 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.expand.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
36 // CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
37 //
38 svint8_t test_svexpand_s8(svbool_t pg, svint8_t op) STREAMING
39 {
40 return SVE_ACLE_FUNC(svexpand,_s8)(pg, op);
41 }
42
43 // CHECK-LABEL: @test_svexpand_s16(
44 // CHECK-NEXT: entry:
45 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
46 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.expand.nxv8i16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
47 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
48 //
49 // CPP-CHECK-LABEL: @_Z17test_svexpand_s16u10__SVBool_tu11__SVInt16_t(
50 // CPP-CHECK-NEXT: entry:
51 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
52 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.expand.nxv8i16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
53 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
54 //
55 svint16_t test_svexpand_s16(svbool_t pg, svint16_t op) STREAMING
56 {
57 return SVE_ACLE_FUNC(svexpand,_s16)(pg, op);
58 }
59
60 // CHECK-LABEL: @test_svexpand_u8(
61 // CHECK-NEXT: entry:
62 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.expand.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
63 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
64 //
65 // CPP-CHECK-LABEL: @_Z16test_svexpand_u8u10__SVBool_tu11__SVUint8_t(
66 // CPP-CHECK-NEXT: entry:
67 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.expand.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
68 // CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
69 //
70 svuint8_t test_svexpand_u8(svbool_t pg, svuint8_t op) STREAMING
71 {
72 return SVE_ACLE_FUNC(svexpand,_u8)(pg, op);
73 }
74
75 // CHECK-LABEL: @test_svexpand_u16(
76 // CHECK-NEXT: entry:
77 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
78 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.expand.nxv8i16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
79 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
80 //
81 // CPP-CHECK-LABEL: @_Z17test_svexpand_u16u10__SVBool_tu12__SVUint16_t(
82 // CPP-CHECK-NEXT: entry:
83 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
84 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.expand.nxv8i16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
85 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
86 //
87 svuint16_t test_svexpand_u16(svbool_t pg, svuint16_t op) STREAMING
88 {
89 return SVE_ACLE_FUNC(svexpand,_u16)(pg, op);
90 }
91
92 // CHECK-LABEL: @test_svexpand_mf8(
93 // CHECK-NEXT: entry:
94 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.expand.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
95 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
96 //
97 // CPP-CHECK-LABEL: @_Z17test_svexpand_mf8u10__SVBool_tu13__SVMfloat8_t(
98 // CPP-CHECK-NEXT: entry:
99 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.expand.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
100 // CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
101 //
102 svmfloat8_t test_svexpand_mf8(svbool_t pg, svmfloat8_t op) STREAMING
103 {
104 return SVE_ACLE_FUNC(svexpand,_mf8)(pg, op);
105 }
106
107 // CHECK-LABEL: @test_svexpand_f16(
108 // CHECK-NEXT: entry:
109 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
110 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.expand.nxv8f16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x half> [[OP:%.*]])
111 // CHECK-NEXT: ret <vscale x 8 x half> [[TMP1]]
112 //
113 // CPP-CHECK-LABEL: @_Z17test_svexpand_f16u10__SVBool_tu13__SVFloat16_t(
114 // CPP-CHECK-NEXT: entry:
115 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
116 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.expand.nxv8f16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x half> [[OP:%.*]])
117 // CPP-CHECK-NEXT: ret <vscale x 8 x half> [[TMP1]]
118 //
119 svfloat16_t test_svexpand_f16(svbool_t pg, svfloat16_t op) STREAMING
120 {
121 return SVE_ACLE_FUNC(svexpand,_f16)(pg, op);
122 }
123
124 // CHECK-LABEL: @test_svexpand_bf16(
125 // CHECK-NEXT: entry:
126 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
127 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x bfloat> @llvm.aarch64.sve.expand.nxv8bf16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x bfloat> [[OP:%.*]])
128 // CHECK-NEXT: ret <vscale x 8 x bfloat> [[TMP1]]
129 //
130 // CPP-CHECK-LABEL: @_Z18test_svexpand_bf16u10__SVBool_tu14__SVBfloat16_t(
131 // CPP-CHECK-NEXT: entry:
132 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
133 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x bfloat> @llvm.aarch64.sve.expand.nxv8bf16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x bfloat> [[OP:%.*]])
134 // CPP-CHECK-NEXT: ret <vscale x 8 x bfloat> [[TMP1]]
135 //
136 svbfloat16_t test_svexpand_bf16(svbool_t pg, svbfloat16_t op) STREAMING
137 {
138 return SVE_ACLE_FUNC(svexpand,_bf16)(pg, op);
139 }
140
141 // CHECK-LABEL: @test_svexpand_s32(
142 // CHECK-NEXT: entry:
143 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
144 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.expand.nxv4i32(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
145 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
146 //
147 // CPP-CHECK-LABEL: @_Z17test_svexpand_s32u10__SVBool_tu11__SVInt32_t(
148 // CPP-CHECK-NEXT: entry:
149 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
150 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.expand.nxv4i32(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
151 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
152 //
153 svint32_t test_svexpand_s32(svbool_t pg, svint32_t op) STREAMING
154 {
155 return SVE_ACLE_FUNC(svexpand,_s32)(pg, op);
156 }
157
158 // CHECK-LABEL: @test_svexpand_s64(
159 // CHECK-NEXT: entry:
160 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
161 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.expand.nxv2i64(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
162 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
163 //
164 // CPP-CHECK-LABEL: @_Z17test_svexpand_s64u10__SVBool_tu11__SVInt64_t(
165 // CPP-CHECK-NEXT: entry:
166 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
167 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.expand.nxv2i64(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
168 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
169 //
170 svint64_t test_svexpand_s64(svbool_t pg, svint64_t op) STREAMING
171 {
172 return SVE_ACLE_FUNC(svexpand,_s64)(pg, op);
173 }
174
175 // CHECK-LABEL: @test_svexpand_u32(
176 // CHECK-NEXT: entry:
177 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
178 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.expand.nxv4i32(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
179 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
180 //
181 // CPP-CHECK-LABEL: @_Z17test_svexpand_u32u10__SVBool_tu12__SVUint32_t(
182 // CPP-CHECK-NEXT: entry:
183 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
184 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.expand.nxv4i32(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
185 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
186 //
187 svuint32_t test_svexpand_u32(svbool_t pg, svuint32_t op) STREAMING
188 {
189 return SVE_ACLE_FUNC(svexpand,_u32)(pg, op);
190 }
191
192 // CHECK-LABEL: @test_svexpand_u64(
193 // CHECK-NEXT: entry:
194 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
195 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.expand.nxv2i64(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
196 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
197 //
198 // CPP-CHECK-LABEL: @_Z17test_svexpand_u64u10__SVBool_tu12__SVUint64_t(
199 // CPP-CHECK-NEXT: entry:
200 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
201 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.expand.nxv2i64(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
202 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
203 //
204 svuint64_t test_svexpand_u64(svbool_t pg, svuint64_t op) STREAMING
205 {
206 return SVE_ACLE_FUNC(svexpand,_u64)(pg, op);
207 }
208
209 // CHECK-LABEL: @test_svexpand_f32(
210 // CHECK-NEXT: entry:
211 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
212 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.expand.nxv4f32(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x float> [[OP:%.*]])
213 // CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
214 //
215 // CPP-CHECK-LABEL: @_Z17test_svexpand_f32u10__SVBool_tu13__SVFloat32_t(
216 // CPP-CHECK-NEXT: entry:
217 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
218 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.expand.nxv4f32(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x float> [[OP:%.*]])
219 // CPP-CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
220 //
221 svfloat32_t test_svexpand_f32(svbool_t pg, svfloat32_t op) STREAMING
222 {
223 return SVE_ACLE_FUNC(svexpand,_f32)(pg, op);
224 }
225
226 // CHECK-LABEL: @test_svexpand_f64(
227 // CHECK-NEXT: entry:
228 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
229 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x double> @llvm.aarch64.sve.expand.nxv2f64(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x double> [[OP:%.*]])
230 // CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
231 //
232 // CPP-CHECK-LABEL: @_Z17test_svexpand_f64u10__SVBool_tu13__SVFloat64_t(
233 // CPP-CHECK-NEXT: entry:
234 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
235 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x double> @llvm.aarch64.sve.expand.nxv2f64(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x double> [[OP:%.*]])
236 // CPP-CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
237 //
238 svfloat64_t test_svexpand_f64(svbool_t pg, svfloat64_t op) STREAMING
239 {
240 return SVE_ACLE_FUNC(svexpand,_f64)(pg, op);
241 }