1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2
2 // REQUIRES: aarch64-registered-target
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -target-feature +bf16\
4 // RUN: -Werror -emit-llvm -disable-O0-optnone -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s
5 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -target-feature +bf16\
6 // RUN: -Werror -emit-llvm -disable-O0-optnone -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s
7 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -target-feature +bf16\
8 // RUN: -Werror -emit-llvm -disable-O0-optnone -o - -x c++ %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
9 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -target-feature +bf16\
10 // RUN: -Werror -emit-llvm -disable-O0-optnone -o - -x c++ %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
11 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -target-feature +bf16\
12 // RUN: -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
16 #ifdef SVE_OVERLOADED_FORMS
17 // A simple used,unused... macro, long enough to represent any SVE builtin.
18 #define SVE_ACLE_FUNC(A1, A2_UNUSED) A1
20 #define SVE_ACLE_FUNC(A1, A2) A1##A2
23 // CHECK-LABEL: define dso_local <vscale x 16 x i8> @test_svuzpq1_u8
24 // CHECK-SAME: (<vscale x 16 x i8> [[ZN:%.*]], <vscale x 16 x i8> [[ZM:%.*]]) #[[ATTR0:[0-9]+]] {
26 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.uzpq1.nxv16i8(<vscale x 16 x i8> [[ZN]], <vscale x 16 x i8> [[ZM]])
27 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
29 // CPP-CHECK-LABEL: define dso_local <vscale x 16 x i8> @_Z15test_svuzpq1_u8u11__SVUint8_tS_
30 // CPP-CHECK-SAME: (<vscale x 16 x i8> [[ZN:%.*]], <vscale x 16 x i8> [[ZM:%.*]]) #[[ATTR0:[0-9]+]] {
31 // CPP-CHECK-NEXT: entry:
32 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.uzpq1.nxv16i8(<vscale x 16 x i8> [[ZN]], <vscale x 16 x i8> [[ZM]])
33 // CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
35 svuint8_t
test_svuzpq1_u8(svuint8_t zn
, svuint8_t zm
) {
36 return SVE_ACLE_FUNC(svuzpq1
,_u8
)(zn
, zm
);
39 // CHECK-LABEL: define dso_local <vscale x 8 x i16> @test_svuzpq1_u16
40 // CHECK-SAME: (<vscale x 8 x i16> [[ZN:%.*]], <vscale x 8 x i16> [[ZM:%.*]]) #[[ATTR0]] {
42 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.uzpq1.nxv8i16(<vscale x 8 x i16> [[ZN]], <vscale x 8 x i16> [[ZM]])
43 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
45 // CPP-CHECK-LABEL: define dso_local <vscale x 8 x i16> @_Z16test_svuzpq1_u16u12__SVUint16_tS_
46 // CPP-CHECK-SAME: (<vscale x 8 x i16> [[ZN:%.*]], <vscale x 8 x i16> [[ZM:%.*]]) #[[ATTR0]] {
47 // CPP-CHECK-NEXT: entry:
48 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.uzpq1.nxv8i16(<vscale x 8 x i16> [[ZN]], <vscale x 8 x i16> [[ZM]])
49 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
51 svuint16_t
test_svuzpq1_u16(svuint16_t zn
, svuint16_t zm
) {
52 return SVE_ACLE_FUNC(svuzpq1
,_u16
)(zn
, zm
);
55 // CHECK-LABEL: define dso_local <vscale x 4 x i32> @test_svuzpq1_u32
56 // CHECK-SAME: (<vscale x 4 x i32> [[ZN:%.*]], <vscale x 4 x i32> [[ZM:%.*]]) #[[ATTR0]] {
58 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.uzpq1.nxv4i32(<vscale x 4 x i32> [[ZN]], <vscale x 4 x i32> [[ZM]])
59 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
61 // CPP-CHECK-LABEL: define dso_local <vscale x 4 x i32> @_Z16test_svuzpq1_u32u12__SVUint32_tS_
62 // CPP-CHECK-SAME: (<vscale x 4 x i32> [[ZN:%.*]], <vscale x 4 x i32> [[ZM:%.*]]) #[[ATTR0]] {
63 // CPP-CHECK-NEXT: entry:
64 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.uzpq1.nxv4i32(<vscale x 4 x i32> [[ZN]], <vscale x 4 x i32> [[ZM]])
65 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
67 svuint32_t
test_svuzpq1_u32(svuint32_t zn
, svuint32_t zm
) {
68 return SVE_ACLE_FUNC(svuzpq1
,_u32
)(zn
, zm
);
71 // CHECK-LABEL: define dso_local <vscale x 2 x i64> @test_svuzpq1_u64
72 // CHECK-SAME: (<vscale x 2 x i64> [[ZN:%.*]], <vscale x 2 x i64> [[ZM:%.*]]) #[[ATTR0]] {
74 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.uzpq1.nxv2i64(<vscale x 2 x i64> [[ZN]], <vscale x 2 x i64> [[ZM]])
75 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
77 // CPP-CHECK-LABEL: define dso_local <vscale x 2 x i64> @_Z16test_svuzpq1_u64u12__SVUint64_tS_
78 // CPP-CHECK-SAME: (<vscale x 2 x i64> [[ZN:%.*]], <vscale x 2 x i64> [[ZM:%.*]]) #[[ATTR0]] {
79 // CPP-CHECK-NEXT: entry:
80 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.uzpq1.nxv2i64(<vscale x 2 x i64> [[ZN]], <vscale x 2 x i64> [[ZM]])
81 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
83 svuint64_t
test_svuzpq1_u64(svuint64_t zn
, svuint64_t zm
) {
84 return SVE_ACLE_FUNC(svuzpq1
,_u64
)(zn
, zm
);
88 // CHECK-LABEL: define dso_local <vscale x 16 x i8> @test_svuzpq1_s8
89 // CHECK-SAME: (<vscale x 16 x i8> [[ZN:%.*]], <vscale x 16 x i8> [[ZM:%.*]]) #[[ATTR0]] {
91 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.uzpq1.nxv16i8(<vscale x 16 x i8> [[ZN]], <vscale x 16 x i8> [[ZM]])
92 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
94 // CPP-CHECK-LABEL: define dso_local <vscale x 16 x i8> @_Z15test_svuzpq1_s8u10__SVInt8_tS_
95 // CPP-CHECK-SAME: (<vscale x 16 x i8> [[ZN:%.*]], <vscale x 16 x i8> [[ZM:%.*]]) #[[ATTR0]] {
96 // CPP-CHECK-NEXT: entry:
97 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.uzpq1.nxv16i8(<vscale x 16 x i8> [[ZN]], <vscale x 16 x i8> [[ZM]])
98 // CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
100 svint8_t
test_svuzpq1_s8(svint8_t zn
, svint8_t zm
) {
101 return SVE_ACLE_FUNC(svuzpq1
,_s8
)(zn
, zm
);
104 // CHECK-LABEL: define dso_local <vscale x 8 x i16> @test_svuzpq1_s16
105 // CHECK-SAME: (<vscale x 8 x i16> [[ZN:%.*]], <vscale x 8 x i16> [[ZM:%.*]]) #[[ATTR0]] {
106 // CHECK-NEXT: entry:
107 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.uzpq1.nxv8i16(<vscale x 8 x i16> [[ZN]], <vscale x 8 x i16> [[ZM]])
108 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
110 // CPP-CHECK-LABEL: define dso_local <vscale x 8 x i16> @_Z16test_svuzpq1_s16u11__SVInt16_tS_
111 // CPP-CHECK-SAME: (<vscale x 8 x i16> [[ZN:%.*]], <vscale x 8 x i16> [[ZM:%.*]]) #[[ATTR0]] {
112 // CPP-CHECK-NEXT: entry:
113 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.uzpq1.nxv8i16(<vscale x 8 x i16> [[ZN]], <vscale x 8 x i16> [[ZM]])
114 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
116 svint16_t
test_svuzpq1_s16(svint16_t zn
, svint16_t zm
) {
117 return SVE_ACLE_FUNC(svuzpq1
,_s16
)(zn
, zm
);
120 // CHECK-LABEL: define dso_local <vscale x 4 x i32> @test_svuzpq1_s32
121 // CHECK-SAME: (<vscale x 4 x i32> [[ZN:%.*]], <vscale x 4 x i32> [[ZM:%.*]]) #[[ATTR0]] {
122 // CHECK-NEXT: entry:
123 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.uzpq1.nxv4i32(<vscale x 4 x i32> [[ZN]], <vscale x 4 x i32> [[ZM]])
124 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
126 // CPP-CHECK-LABEL: define dso_local <vscale x 4 x i32> @_Z16test_svuzpq1_s32u11__SVInt32_tS_
127 // CPP-CHECK-SAME: (<vscale x 4 x i32> [[ZN:%.*]], <vscale x 4 x i32> [[ZM:%.*]]) #[[ATTR0]] {
128 // CPP-CHECK-NEXT: entry:
129 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.uzpq1.nxv4i32(<vscale x 4 x i32> [[ZN]], <vscale x 4 x i32> [[ZM]])
130 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
132 svint32_t
test_svuzpq1_s32(svint32_t zn
, svint32_t zm
) {
133 return SVE_ACLE_FUNC(svuzpq1
,_s32
)(zn
, zm
);
136 // CHECK-LABEL: define dso_local <vscale x 2 x i64> @test_svuzpq1_s64
137 // CHECK-SAME: (<vscale x 2 x i64> [[ZN:%.*]], <vscale x 2 x i64> [[ZM:%.*]]) #[[ATTR0]] {
138 // CHECK-NEXT: entry:
139 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.uzpq1.nxv2i64(<vscale x 2 x i64> [[ZN]], <vscale x 2 x i64> [[ZM]])
140 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
142 // CPP-CHECK-LABEL: define dso_local <vscale x 2 x i64> @_Z16test_svuzpq1_s64u11__SVInt64_tS_
143 // CPP-CHECK-SAME: (<vscale x 2 x i64> [[ZN:%.*]], <vscale x 2 x i64> [[ZM:%.*]]) #[[ATTR0]] {
144 // CPP-CHECK-NEXT: entry:
145 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.uzpq1.nxv2i64(<vscale x 2 x i64> [[ZN]], <vscale x 2 x i64> [[ZM]])
146 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
148 svint64_t
test_svuzpq1_s64(svint64_t zn
, svint64_t zm
) {
149 return SVE_ACLE_FUNC(svuzpq1
,_s64
)(zn
, zm
);
153 // CHECK-LABEL: define dso_local <vscale x 8 x half> @test_svuzpq1_f16
154 // CHECK-SAME: (<vscale x 8 x half> [[ZN:%.*]], <vscale x 8 x half> [[ZM:%.*]]) #[[ATTR0]] {
155 // CHECK-NEXT: entry:
156 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.uzpq1.nxv8f16(<vscale x 8 x half> [[ZN]], <vscale x 8 x half> [[ZM]])
157 // CHECK-NEXT: ret <vscale x 8 x half> [[TMP0]]
159 // CPP-CHECK-LABEL: define dso_local <vscale x 8 x half> @_Z16test_svuzpq1_f16u13__SVFloat16_tS_
160 // CPP-CHECK-SAME: (<vscale x 8 x half> [[ZN:%.*]], <vscale x 8 x half> [[ZM:%.*]]) #[[ATTR0]] {
161 // CPP-CHECK-NEXT: entry:
162 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.uzpq1.nxv8f16(<vscale x 8 x half> [[ZN]], <vscale x 8 x half> [[ZM]])
163 // CPP-CHECK-NEXT: ret <vscale x 8 x half> [[TMP0]]
165 svfloat16_t
test_svuzpq1_f16(svfloat16_t zn
, svfloat16_t zm
) {
166 return SVE_ACLE_FUNC(svuzpq1
,_f16
)(zn
, zm
);
169 // CHECK-LABEL: define dso_local <vscale x 4 x float> @test_svuzpq1_f32
170 // CHECK-SAME: (<vscale x 4 x float> [[ZN:%.*]], <vscale x 4 x float> [[ZM:%.*]]) #[[ATTR0]] {
171 // CHECK-NEXT: entry:
172 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.uzpq1.nxv4f32(<vscale x 4 x float> [[ZN]], <vscale x 4 x float> [[ZM]])
173 // CHECK-NEXT: ret <vscale x 4 x float> [[TMP0]]
175 // CPP-CHECK-LABEL: define dso_local <vscale x 4 x float> @_Z16test_svuzpq1_f32u13__SVFloat32_tS_
176 // CPP-CHECK-SAME: (<vscale x 4 x float> [[ZN:%.*]], <vscale x 4 x float> [[ZM:%.*]]) #[[ATTR0]] {
177 // CPP-CHECK-NEXT: entry:
178 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.uzpq1.nxv4f32(<vscale x 4 x float> [[ZN]], <vscale x 4 x float> [[ZM]])
179 // CPP-CHECK-NEXT: ret <vscale x 4 x float> [[TMP0]]
181 svfloat32_t
test_svuzpq1_f32(svfloat32_t zn
, svfloat32_t zm
) {
182 return SVE_ACLE_FUNC(svuzpq1
,_f32
)(zn
, zm
);
185 // CHECK-LABEL: define dso_local <vscale x 2 x double> @test_svuzpq1_f64
186 // CHECK-SAME: (<vscale x 2 x double> [[ZN:%.*]], <vscale x 2 x double> [[ZM:%.*]]) #[[ATTR0]] {
187 // CHECK-NEXT: entry:
188 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x double> @llvm.aarch64.sve.uzpq1.nxv2f64(<vscale x 2 x double> [[ZN]], <vscale x 2 x double> [[ZM]])
189 // CHECK-NEXT: ret <vscale x 2 x double> [[TMP0]]
191 // CPP-CHECK-LABEL: define dso_local <vscale x 2 x double> @_Z16test_svuzpq1_f64u13__SVFloat64_tS_
192 // CPP-CHECK-SAME: (<vscale x 2 x double> [[ZN:%.*]], <vscale x 2 x double> [[ZM:%.*]]) #[[ATTR0]] {
193 // CPP-CHECK-NEXT: entry:
194 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x double> @llvm.aarch64.sve.uzpq1.nxv2f64(<vscale x 2 x double> [[ZN]], <vscale x 2 x double> [[ZM]])
195 // CPP-CHECK-NEXT: ret <vscale x 2 x double> [[TMP0]]
197 svfloat64_t
test_svuzpq1_f64(svfloat64_t zn
, svfloat64_t zm
) {
198 return SVE_ACLE_FUNC(svuzpq1
,_f64
)(zn
, zm
);
201 // CHECK-LABEL: define dso_local <vscale x 8 x bfloat> @test_svuzpq1_bf16
202 // CHECK-SAME: (<vscale x 8 x bfloat> [[ZN:%.*]], <vscale x 8 x bfloat> [[ZM:%.*]]) #[[ATTR0]] {
203 // CHECK-NEXT: entry:
204 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x bfloat> @llvm.aarch64.sve.uzpq1.nxv8bf16(<vscale x 8 x bfloat> [[ZN]], <vscale x 8 x bfloat> [[ZM]])
205 // CHECK-NEXT: ret <vscale x 8 x bfloat> [[TMP0]]
207 // CPP-CHECK-LABEL: define dso_local <vscale x 8 x bfloat> @_Z17test_svuzpq1_bf16u14__SVBfloat16_tS_
208 // CPP-CHECK-SAME: (<vscale x 8 x bfloat> [[ZN:%.*]], <vscale x 8 x bfloat> [[ZM:%.*]]) #[[ATTR0]] {
209 // CPP-CHECK-NEXT: entry:
210 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x bfloat> @llvm.aarch64.sve.uzpq1.nxv8bf16(<vscale x 8 x bfloat> [[ZN]], <vscale x 8 x bfloat> [[ZM]])
211 // CPP-CHECK-NEXT: ret <vscale x 8 x bfloat> [[TMP0]]
213 svbfloat16_t
test_svuzpq1_bf16(svbfloat16_t zn
, svbfloat16_t zm
) {
214 return SVE_ACLE_FUNC(svuzpq1
,_bf16
)(zn
, zm
);