Debian Codegraph @

clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_set2.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 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
4 // RUN: %clang_cc1 -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
5 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
6 // RUN: %clang_cc1 -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
7 // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sme -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
8 // RUN: %clang_cc1 -triple aarch64 -target-feature +sme -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
9
10 #include <arm_sve.h>
11
12 #ifdef SVE_OVERLOADED_FORMS
13 // A simple used,unused... macro, long enough to represent any SVE builtin.
14 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
15 #else
16 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
17 #endif
18
19 #ifdef __ARM_FEATURE_SME
20 #define ATTR __arm_streaming
21 #else
22 #define ATTR
23 #endif
24
25 // CHECK-LABEL: @test_svset2_s8(
26 // CHECK-NEXT: entry:
27 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 32 x i8> @llvm.vector.insert.nxv32i8.nxv16i8(<vscale x 32 x i8> [[TUPLE:%.*]], <vscale x 16 x i8> [[X:%.*]], i64 16)
28 // CHECK-NEXT: ret <vscale x 32 x i8> [[TMP0]]
29 //
30 // CPP-CHECK-LABEL: @_Z14test_svset2_s810svint8x2_tu10__SVInt8_t(
31 // CPP-CHECK-NEXT: entry:
32 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 32 x i8> @llvm.vector.insert.nxv32i8.nxv16i8(<vscale x 32 x i8> [[TUPLE:%.*]], <vscale x 16 x i8> [[X:%.*]], i64 16)
33 // CPP-CHECK-NEXT: ret <vscale x 32 x i8> [[TMP0]]
34 //
35 svint8x2_t test_svset2_s8(svint8x2_t tuple, svint8_t x) ATTR
36 {
37 return SVE_ACLE_FUNC(svset2,_s8,,)(tuple, 1, x);
38 }
39
40 // CHECK-LABEL: @test_svset2_s16(
41 // CHECK-NEXT: entry:
42 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i16> @llvm.vector.insert.nxv16i16.nxv8i16(<vscale x 16 x i16> [[TUPLE:%.*]], <vscale x 8 x i16> [[X:%.*]], i64 0)
43 // CHECK-NEXT: ret <vscale x 16 x i16> [[TMP0]]
44 //
45 // CPP-CHECK-LABEL: @_Z15test_svset2_s1611svint16x2_tu11__SVInt16_t(
46 // CPP-CHECK-NEXT: entry:
47 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i16> @llvm.vector.insert.nxv16i16.nxv8i16(<vscale x 16 x i16> [[TUPLE:%.*]], <vscale x 8 x i16> [[X:%.*]], i64 0)
48 // CPP-CHECK-NEXT: ret <vscale x 16 x i16> [[TMP0]]
49 //
50 svint16x2_t test_svset2_s16(svint16x2_t tuple, svint16_t x) ATTR
51 {
52 return SVE_ACLE_FUNC(svset2,_s16,,)(tuple, 0, x);
53 }
54
55 // CHECK-LABEL: @test_svset2_s32(
56 // CHECK-NEXT: entry:
57 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i32> @llvm.vector.insert.nxv8i32.nxv4i32(<vscale x 8 x i32> [[TUPLE:%.*]], <vscale x 4 x i32> [[X:%.*]], i64 4)
58 // CHECK-NEXT: ret <vscale x 8 x i32> [[TMP0]]
59 //
60 // CPP-CHECK-LABEL: @_Z15test_svset2_s3211svint32x2_tu11__SVInt32_t(
61 // CPP-CHECK-NEXT: entry:
62 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i32> @llvm.vector.insert.nxv8i32.nxv4i32(<vscale x 8 x i32> [[TUPLE:%.*]], <vscale x 4 x i32> [[X:%.*]], i64 4)
63 // CPP-CHECK-NEXT: ret <vscale x 8 x i32> [[TMP0]]
64 //
65 svint32x2_t test_svset2_s32(svint32x2_t tuple, svint32_t x) ATTR
66 {
67 return SVE_ACLE_FUNC(svset2,_s32,,)(tuple, 1, x);
68 }
69
70 // CHECK-LABEL: @test_svset2_s64(
71 // CHECK-NEXT: entry:
72 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i64> @llvm.vector.insert.nxv4i64.nxv2i64(<vscale x 4 x i64> [[TUPLE:%.*]], <vscale x 2 x i64> [[X:%.*]], i64 0)
73 // CHECK-NEXT: ret <vscale x 4 x i64> [[TMP0]]
74 //
75 // CPP-CHECK-LABEL: @_Z15test_svset2_s6411svint64x2_tu11__SVInt64_t(
76 // CPP-CHECK-NEXT: entry:
77 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i64> @llvm.vector.insert.nxv4i64.nxv2i64(<vscale x 4 x i64> [[TUPLE:%.*]], <vscale x 2 x i64> [[X:%.*]], i64 0)
78 // CPP-CHECK-NEXT: ret <vscale x 4 x i64> [[TMP0]]
79 //
80 svint64x2_t test_svset2_s64(svint64x2_t tuple, svint64_t x) ATTR
81 {
82 return SVE_ACLE_FUNC(svset2,_s64,,)(tuple, 0, x);
83 }
84
85 // CHECK-LABEL: @test_svset2_u8(
86 // CHECK-NEXT: entry:
87 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 32 x i8> @llvm.vector.insert.nxv32i8.nxv16i8(<vscale x 32 x i8> [[TUPLE:%.*]], <vscale x 16 x i8> [[X:%.*]], i64 16)
88 // CHECK-NEXT: ret <vscale x 32 x i8> [[TMP0]]
89 //
90 // CPP-CHECK-LABEL: @_Z14test_svset2_u811svuint8x2_tu11__SVUint8_t(
91 // CPP-CHECK-NEXT: entry:
92 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 32 x i8> @llvm.vector.insert.nxv32i8.nxv16i8(<vscale x 32 x i8> [[TUPLE:%.*]], <vscale x 16 x i8> [[X:%.*]], i64 16)
93 // CPP-CHECK-NEXT: ret <vscale x 32 x i8> [[TMP0]]
94 //
95 svuint8x2_t test_svset2_u8(svuint8x2_t tuple, svuint8_t x) ATTR
96 {
97 return SVE_ACLE_FUNC(svset2,_u8,,)(tuple, 1, x);
98 }
99
100 // CHECK-LABEL: @test_svset2_u16(
101 // CHECK-NEXT: entry:
102 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i16> @llvm.vector.insert.nxv16i16.nxv8i16(<vscale x 16 x i16> [[TUPLE:%.*]], <vscale x 8 x i16> [[X:%.*]], i64 0)
103 // CHECK-NEXT: ret <vscale x 16 x i16> [[TMP0]]
104 //
105 // CPP-CHECK-LABEL: @_Z15test_svset2_u1612svuint16x2_tu12__SVUint16_t(
106 // CPP-CHECK-NEXT: entry:
107 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i16> @llvm.vector.insert.nxv16i16.nxv8i16(<vscale x 16 x i16> [[TUPLE:%.*]], <vscale x 8 x i16> [[X:%.*]], i64 0)
108 // CPP-CHECK-NEXT: ret <vscale x 16 x i16> [[TMP0]]
109 //
110 svuint16x2_t test_svset2_u16(svuint16x2_t tuple, svuint16_t x) ATTR
111 {
112 return SVE_ACLE_FUNC(svset2,_u16,,)(tuple, 0, x);
113 }
114
115 // CHECK-LABEL: @test_svset2_u32(
116 // CHECK-NEXT: entry:
117 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i32> @llvm.vector.insert.nxv8i32.nxv4i32(<vscale x 8 x i32> [[TUPLE:%.*]], <vscale x 4 x i32> [[X:%.*]], i64 4)
118 // CHECK-NEXT: ret <vscale x 8 x i32> [[TMP0]]
119 //
120 // CPP-CHECK-LABEL: @_Z15test_svset2_u3212svuint32x2_tu12__SVUint32_t(
121 // CPP-CHECK-NEXT: entry:
122 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i32> @llvm.vector.insert.nxv8i32.nxv4i32(<vscale x 8 x i32> [[TUPLE:%.*]], <vscale x 4 x i32> [[X:%.*]], i64 4)
123 // CPP-CHECK-NEXT: ret <vscale x 8 x i32> [[TMP0]]
124 //
125 svuint32x2_t test_svset2_u32(svuint32x2_t tuple, svuint32_t x) ATTR
126 {
127 return SVE_ACLE_FUNC(svset2,_u32,,)(tuple, 1, x);
128 }
129
130 // CHECK-LABEL: @test_svset2_u64(
131 // CHECK-NEXT: entry:
132 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i64> @llvm.vector.insert.nxv4i64.nxv2i64(<vscale x 4 x i64> [[TUPLE:%.*]], <vscale x 2 x i64> [[X:%.*]], i64 0)
133 // CHECK-NEXT: ret <vscale x 4 x i64> [[TMP0]]
134 //
135 // CPP-CHECK-LABEL: @_Z15test_svset2_u6412svuint64x2_tu12__SVUint64_t(
136 // CPP-CHECK-NEXT: entry:
137 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i64> @llvm.vector.insert.nxv4i64.nxv2i64(<vscale x 4 x i64> [[TUPLE:%.*]], <vscale x 2 x i64> [[X:%.*]], i64 0)
138 // CPP-CHECK-NEXT: ret <vscale x 4 x i64> [[TMP0]]
139 //
140 svuint64x2_t test_svset2_u64(svuint64x2_t tuple, svuint64_t x) ATTR
141 {
142 return SVE_ACLE_FUNC(svset2,_u64,,)(tuple, 0, x);
143 }
144
145 // CHECK-LABEL: @test_svset2_f16(
146 // CHECK-NEXT: entry:
147 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x half> @llvm.vector.insert.nxv16f16.nxv8f16(<vscale x 16 x half> [[TUPLE:%.*]], <vscale x 8 x half> [[X:%.*]], i64 8)
148 // CHECK-NEXT: ret <vscale x 16 x half> [[TMP0]]
149 //
150 // CPP-CHECK-LABEL: @_Z15test_svset2_f1613svfloat16x2_tu13__SVFloat16_t(
151 // CPP-CHECK-NEXT: entry:
152 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x half> @llvm.vector.insert.nxv16f16.nxv8f16(<vscale x 16 x half> [[TUPLE:%.*]], <vscale x 8 x half> [[X:%.*]], i64 8)
153 // CPP-CHECK-NEXT: ret <vscale x 16 x half> [[TMP0]]
154 //
155 svfloat16x2_t test_svset2_f16(svfloat16x2_t tuple, svfloat16_t x) ATTR
156 {
157 return SVE_ACLE_FUNC(svset2,_f16,,)(tuple, 1, x);
158 }
159
160 // CHECK-LABEL: @test_svset2_f32(
161 // CHECK-NEXT: entry:
162 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x float> @llvm.vector.insert.nxv8f32.nxv4f32(<vscale x 8 x float> [[TUPLE:%.*]], <vscale x 4 x float> [[X:%.*]], i64 0)
163 // CHECK-NEXT: ret <vscale x 8 x float> [[TMP0]]
164 //
165 // CPP-CHECK-LABEL: @_Z15test_svset2_f3213svfloat32x2_tu13__SVFloat32_t(
166 // CPP-CHECK-NEXT: entry:
167 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x float> @llvm.vector.insert.nxv8f32.nxv4f32(<vscale x 8 x float> [[TUPLE:%.*]], <vscale x 4 x float> [[X:%.*]], i64 0)
168 // CPP-CHECK-NEXT: ret <vscale x 8 x float> [[TMP0]]
169 //
170 svfloat32x2_t test_svset2_f32(svfloat32x2_t tuple, svfloat32_t x) ATTR
171 {
172 return SVE_ACLE_FUNC(svset2,_f32,,)(tuple, 0, x);
173 }
174
175 // CHECK-LABEL: @test_svset2_f64(
176 // CHECK-NEXT: entry:
177 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x double> @llvm.vector.insert.nxv4f64.nxv2f64(<vscale x 4 x double> [[TUPLE:%.*]], <vscale x 2 x double> [[X:%.*]], i64 2)
178 // CHECK-NEXT: ret <vscale x 4 x double> [[TMP0]]
179 //
180 // CPP-CHECK-LABEL: @_Z15test_svset2_f6413svfloat64x2_tu13__SVFloat64_t(
181 // CPP-CHECK-NEXT: entry:
182 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x double> @llvm.vector.insert.nxv4f64.nxv2f64(<vscale x 4 x double> [[TUPLE:%.*]], <vscale x 2 x double> [[X:%.*]], i64 2)
183 // CPP-CHECK-NEXT: ret <vscale x 4 x double> [[TMP0]]
184 //
185 svfloat64x2_t test_svset2_f64(svfloat64x2_t tuple, svfloat64_t x) ATTR
186 {
187 return SVE_ACLE_FUNC(svset2,_f64,,)(tuple, 1, x);
188 }