Debian Codegraph @

clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_set4.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_svset4_s8(
26 // CHECK-NEXT: entry:
27 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 64 x i8> @llvm.vector.insert.nxv64i8.nxv16i8(<vscale x 64 x i8> [[TUPLE:%.*]], <vscale x 16 x i8> [[X:%.*]], i64 16)
28 // CHECK-NEXT: ret <vscale x 64 x i8> [[TMP0]]
29 //
30 // CPP-CHECK-LABEL: @_Z14test_svset4_s810svint8x4_tu10__SVInt8_t(
31 // CPP-CHECK-NEXT: entry:
32 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 64 x i8> @llvm.vector.insert.nxv64i8.nxv16i8(<vscale x 64 x i8> [[TUPLE:%.*]], <vscale x 16 x i8> [[X:%.*]], i64 16)
33 // CPP-CHECK-NEXT: ret <vscale x 64 x i8> [[TMP0]]
34 //
35 svint8x4_t test_svset4_s8(svint8x4_t tuple, svint8_t x) ATTR
36 {
37 return SVE_ACLE_FUNC(svset4,_s8,,)(tuple, 1, x);
38 }
39
40 // CHECK-LABEL: @test_svset4_s16(
41 // CHECK-NEXT: entry:
42 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 32 x i16> @llvm.vector.insert.nxv32i16.nxv8i16(<vscale x 32 x i16> [[TUPLE:%.*]], <vscale x 8 x i16> [[X:%.*]], i64 24)
43 // CHECK-NEXT: ret <vscale x 32 x i16> [[TMP0]]
44 //
45 // CPP-CHECK-LABEL: @_Z15test_svset4_s1611svint16x4_tu11__SVInt16_t(
46 // CPP-CHECK-NEXT: entry:
47 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 32 x i16> @llvm.vector.insert.nxv32i16.nxv8i16(<vscale x 32 x i16> [[TUPLE:%.*]], <vscale x 8 x i16> [[X:%.*]], i64 24)
48 // CPP-CHECK-NEXT: ret <vscale x 32 x i16> [[TMP0]]
49 //
50 svint16x4_t test_svset4_s16(svint16x4_t tuple, svint16_t x) ATTR
51 {
52 return SVE_ACLE_FUNC(svset4,_s16,,)(tuple, 3, x);
53 }
54
55 // CHECK-LABEL: @test_svset4_s32(
56 // CHECK-NEXT: entry:
57 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i32> @llvm.vector.insert.nxv16i32.nxv4i32(<vscale x 16 x i32> [[TUPLE:%.*]], <vscale x 4 x i32> [[X:%.*]], i64 4)
58 // CHECK-NEXT: ret <vscale x 16 x i32> [[TMP0]]
59 //
60 // CPP-CHECK-LABEL: @_Z15test_svset4_s3211svint32x4_tu11__SVInt32_t(
61 // CPP-CHECK-NEXT: entry:
62 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i32> @llvm.vector.insert.nxv16i32.nxv4i32(<vscale x 16 x i32> [[TUPLE:%.*]], <vscale x 4 x i32> [[X:%.*]], i64 4)
63 // CPP-CHECK-NEXT: ret <vscale x 16 x i32> [[TMP0]]
64 //
65 svint32x4_t test_svset4_s32(svint32x4_t tuple, svint32_t x) ATTR
66 {
67 return SVE_ACLE_FUNC(svset4,_s32,,)(tuple, 1, x);
68 }
69
70 // CHECK-LABEL: @test_svset4_s64(
71 // CHECK-NEXT: entry:
72 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i64> @llvm.vector.insert.nxv8i64.nxv2i64(<vscale x 8 x i64> [[TUPLE:%.*]], <vscale x 2 x i64> [[X:%.*]], i64 2)
73 // CHECK-NEXT: ret <vscale x 8 x i64> [[TMP0]]
74 //
75 // CPP-CHECK-LABEL: @_Z15test_svset4_s6411svint64x4_tu11__SVInt64_t(
76 // CPP-CHECK-NEXT: entry:
77 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i64> @llvm.vector.insert.nxv8i64.nxv2i64(<vscale x 8 x i64> [[TUPLE:%.*]], <vscale x 2 x i64> [[X:%.*]], i64 2)
78 // CPP-CHECK-NEXT: ret <vscale x 8 x i64> [[TMP0]]
79 //
80 svint64x4_t test_svset4_s64(svint64x4_t tuple, svint64_t x) ATTR
81 {
82 return SVE_ACLE_FUNC(svset4,_s64,,)(tuple, 1, x);
83 }
84
85 // CHECK-LABEL: @test_svset4_u8(
86 // CHECK-NEXT: entry:
87 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 64 x i8> @llvm.vector.insert.nxv64i8.nxv16i8(<vscale x 64 x i8> [[TUPLE:%.*]], <vscale x 16 x i8> [[X:%.*]], i64 48)
88 // CHECK-NEXT: ret <vscale x 64 x i8> [[TMP0]]
89 //
90 // CPP-CHECK-LABEL: @_Z14test_svset4_u811svuint8x4_tu11__SVUint8_t(
91 // CPP-CHECK-NEXT: entry:
92 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 64 x i8> @llvm.vector.insert.nxv64i8.nxv16i8(<vscale x 64 x i8> [[TUPLE:%.*]], <vscale x 16 x i8> [[X:%.*]], i64 48)
93 // CPP-CHECK-NEXT: ret <vscale x 64 x i8> [[TMP0]]
94 //
95 svuint8x4_t test_svset4_u8(svuint8x4_t tuple, svuint8_t x) ATTR
96 {
97 return SVE_ACLE_FUNC(svset4,_u8,,)(tuple, 3, x);
98 }
99
100 // CHECK-LABEL: @test_svset4_u16(
101 // CHECK-NEXT: entry:
102 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 32 x i16> @llvm.vector.insert.nxv32i16.nxv8i16(<vscale x 32 x i16> [[TUPLE:%.*]], <vscale x 8 x i16> [[X:%.*]], i64 8)
103 // CHECK-NEXT: ret <vscale x 32 x i16> [[TMP0]]
104 //
105 // CPP-CHECK-LABEL: @_Z15test_svset4_u1612svuint16x4_tu12__SVUint16_t(
106 // CPP-CHECK-NEXT: entry:
107 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 32 x i16> @llvm.vector.insert.nxv32i16.nxv8i16(<vscale x 32 x i16> [[TUPLE:%.*]], <vscale x 8 x i16> [[X:%.*]], i64 8)
108 // CPP-CHECK-NEXT: ret <vscale x 32 x i16> [[TMP0]]
109 //
110 svuint16x4_t test_svset4_u16(svuint16x4_t tuple, svuint16_t x) ATTR
111 {
112 return SVE_ACLE_FUNC(svset4,_u16,,)(tuple, 1, x);
113 }
114
115 // CHECK-LABEL: @test_svset4_u32(
116 // CHECK-NEXT: entry:
117 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i32> @llvm.vector.insert.nxv16i32.nxv4i32(<vscale x 16 x i32> [[TUPLE:%.*]], <vscale x 4 x i32> [[X:%.*]], i64 4)
118 // CHECK-NEXT: ret <vscale x 16 x i32> [[TMP0]]
119 //
120 // CPP-CHECK-LABEL: @_Z15test_svset4_u3212svuint32x4_tu12__SVUint32_t(
121 // CPP-CHECK-NEXT: entry:
122 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i32> @llvm.vector.insert.nxv16i32.nxv4i32(<vscale x 16 x i32> [[TUPLE:%.*]], <vscale x 4 x i32> [[X:%.*]], i64 4)
123 // CPP-CHECK-NEXT: ret <vscale x 16 x i32> [[TMP0]]
124 //
125 svuint32x4_t test_svset4_u32(svuint32x4_t tuple, svuint32_t x) ATTR
126 {
127 return SVE_ACLE_FUNC(svset4,_u32,,)(tuple, 1, x);
128 }
129
130 // CHECK-LABEL: @test_svset4_u64(
131 // CHECK-NEXT: entry:
132 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i64> @llvm.vector.insert.nxv8i64.nxv2i64(<vscale x 8 x i64> [[TUPLE:%.*]], <vscale x 2 x i64> [[X:%.*]], i64 6)
133 // CHECK-NEXT: ret <vscale x 8 x i64> [[TMP0]]
134 //
135 // CPP-CHECK-LABEL: @_Z15test_svset4_u6412svuint64x4_tu12__SVUint64_t(
136 // CPP-CHECK-NEXT: entry:
137 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i64> @llvm.vector.insert.nxv8i64.nxv2i64(<vscale x 8 x i64> [[TUPLE:%.*]], <vscale x 2 x i64> [[X:%.*]], i64 6)
138 // CPP-CHECK-NEXT: ret <vscale x 8 x i64> [[TMP0]]
139 //
140 svuint64x4_t test_svset4_u64(svuint64x4_t tuple, svuint64_t x) ATTR
141 {
142 return SVE_ACLE_FUNC(svset4,_u64,,)(tuple, 3, x);
143 }
144
145 // CHECK-LABEL: @test_svset4_f16(
146 // CHECK-NEXT: entry:
147 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 32 x half> @llvm.vector.insert.nxv32f16.nxv8f16(<vscale x 32 x half> [[TUPLE:%.*]], <vscale x 8 x half> [[X:%.*]], i64 8)
148 // CHECK-NEXT: ret <vscale x 32 x half> [[TMP0]]
149 //
150 // CPP-CHECK-LABEL: @_Z15test_svset4_f1613svfloat16x4_tu13__SVFloat16_t(
151 // CPP-CHECK-NEXT: entry:
152 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 32 x half> @llvm.vector.insert.nxv32f16.nxv8f16(<vscale x 32 x half> [[TUPLE:%.*]], <vscale x 8 x half> [[X:%.*]], i64 8)
153 // CPP-CHECK-NEXT: ret <vscale x 32 x half> [[TMP0]]
154 //
155 svfloat16x4_t test_svset4_f16(svfloat16x4_t tuple, svfloat16_t x) ATTR
156 {
157 return SVE_ACLE_FUNC(svset4,_f16,,)(tuple, 1, x);
158 }
159
160 // CHECK-LABEL: @test_svset4_f32(
161 // CHECK-NEXT: entry:
162 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x float> @llvm.vector.insert.nxv16f32.nxv4f32(<vscale x 16 x float> [[TUPLE:%.*]], <vscale x 4 x float> [[X:%.*]], i64 4)
163 // CHECK-NEXT: ret <vscale x 16 x float> [[TMP0]]
164 //
165 // CPP-CHECK-LABEL: @_Z15test_svset4_f3213svfloat32x4_tu13__SVFloat32_t(
166 // CPP-CHECK-NEXT: entry:
167 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x float> @llvm.vector.insert.nxv16f32.nxv4f32(<vscale x 16 x float> [[TUPLE:%.*]], <vscale x 4 x float> [[X:%.*]], i64 4)
168 // CPP-CHECK-NEXT: ret <vscale x 16 x float> [[TMP0]]
169 //
170 svfloat32x4_t test_svset4_f32(svfloat32x4_t tuple, svfloat32_t x) ATTR
171 {
172 return SVE_ACLE_FUNC(svset4,_f32,,)(tuple, 1, x);
173 }
174
175 // CHECK-LABEL: @test_svset4_f64(
176 // CHECK-NEXT: entry:
177 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x double> @llvm.vector.insert.nxv8f64.nxv2f64(<vscale x 8 x double> [[TUPLE:%.*]], <vscale x 2 x double> [[X:%.*]], i64 6)
178 // CHECK-NEXT: ret <vscale x 8 x double> [[TMP0]]
179 //
180 // CPP-CHECK-LABEL: @_Z15test_svset4_f6413svfloat64x4_tu13__SVFloat64_t(
181 // CPP-CHECK-NEXT: entry:
182 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x double> @llvm.vector.insert.nxv8f64.nxv2f64(<vscale x 8 x double> [[TUPLE:%.*]], <vscale x 2 x double> [[X:%.*]], i64 6)
183 // CPP-CHECK-NEXT: ret <vscale x 8 x double> [[TMP0]]
184 //
185 svfloat64x4_t test_svset4_f64(svfloat64x4_t tuple, svfloat64_t x) ATTR
186 {
187 return SVE_ACLE_FUNC(svset4,_f64,,)(tuple, 3, x);
188 }