Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / aarch64-sve-intrinsics / acle_sve_qdech.c
bloba040227b45238277e39d1c3fe7a99cead705e91a
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // REQUIRES: aarch64-registered-target
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
4 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -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-none-linux-gnu -target-feature +sve -S -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-none-linux-gnu -target-feature +sve -S -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-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
8 #include <arm_sve.h>
10 #ifdef SVE_OVERLOADED_FORMS
11 // A simple used,unused... macro, long enough to represent any SVE builtin.
12 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
13 #else
14 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
15 #endif
17 // CHECK-LABEL: @test_svqdech_n_s32(
18 // CHECK-NEXT: entry:
19 // CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.sqdech.n32(i32 [[OP:%.*]], i32 31, i32 1)
20 // CHECK-NEXT: ret i32 [[TMP0]]
22 // CPP-CHECK-LABEL: @_Z18test_svqdech_n_s32i(
23 // CPP-CHECK-NEXT: entry:
24 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.sqdech.n32(i32 [[OP:%.*]], i32 31, i32 1)
25 // CPP-CHECK-NEXT: ret i32 [[TMP0]]
27 int32_t test_svqdech_n_s32(int32_t op)
29 return SVE_ACLE_FUNC(svqdech,_n_s32,,)(op, 1);
32 // CHECK-LABEL: @test_svqdech_n_s32_1(
33 // CHECK-NEXT: entry:
34 // CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.sqdech.n32(i32 [[OP:%.*]], i32 31, i32 16)
35 // CHECK-NEXT: ret i32 [[TMP0]]
37 // CPP-CHECK-LABEL: @_Z20test_svqdech_n_s32_1i(
38 // CPP-CHECK-NEXT: entry:
39 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.sqdech.n32(i32 [[OP:%.*]], i32 31, i32 16)
40 // CPP-CHECK-NEXT: ret i32 [[TMP0]]
42 int32_t test_svqdech_n_s32_1(int32_t op)
44 return SVE_ACLE_FUNC(svqdech,_n_s32,,)(op, 16);
47 // CHECK-LABEL: @test_svqdech_n_s64(
48 // CHECK-NEXT: entry:
49 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.sqdech.n64(i64 [[OP:%.*]], i32 31, i32 1)
50 // CHECK-NEXT: ret i64 [[TMP0]]
52 // CPP-CHECK-LABEL: @_Z18test_svqdech_n_s64l(
53 // CPP-CHECK-NEXT: entry:
54 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.sqdech.n64(i64 [[OP:%.*]], i32 31, i32 1)
55 // CPP-CHECK-NEXT: ret i64 [[TMP0]]
57 int64_t test_svqdech_n_s64(int64_t op)
59 return SVE_ACLE_FUNC(svqdech,_n_s64,,)(op, 1);
62 // CHECK-LABEL: @test_svqdech_n_u32(
63 // CHECK-NEXT: entry:
64 // CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.uqdech.n32(i32 [[OP:%.*]], i32 31, i32 16)
65 // CHECK-NEXT: ret i32 [[TMP0]]
67 // CPP-CHECK-LABEL: @_Z18test_svqdech_n_u32j(
68 // CPP-CHECK-NEXT: entry:
69 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.uqdech.n32(i32 [[OP:%.*]], i32 31, i32 16)
70 // CPP-CHECK-NEXT: ret i32 [[TMP0]]
72 uint32_t test_svqdech_n_u32(uint32_t op)
74 return SVE_ACLE_FUNC(svqdech,_n_u32,,)(op, 16);
77 // CHECK-LABEL: @test_svqdech_n_u64(
78 // CHECK-NEXT: entry:
79 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.uqdech.n64(i64 [[OP:%.*]], i32 31, i32 1)
80 // CHECK-NEXT: ret i64 [[TMP0]]
82 // CPP-CHECK-LABEL: @_Z18test_svqdech_n_u64m(
83 // CPP-CHECK-NEXT: entry:
84 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.uqdech.n64(i64 [[OP:%.*]], i32 31, i32 1)
85 // CPP-CHECK-NEXT: ret i64 [[TMP0]]
87 uint64_t test_svqdech_n_u64(uint64_t op)
89 return SVE_ACLE_FUNC(svqdech,_n_u64,,)(op, 1);
92 // CHECK-LABEL: @test_svqdech_pat_n_s32(
93 // CHECK-NEXT: entry:
94 // CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.sqdech.n32(i32 [[OP:%.*]], i32 10, i32 16)
95 // CHECK-NEXT: ret i32 [[TMP0]]
97 // CPP-CHECK-LABEL: @_Z22test_svqdech_pat_n_s32i(
98 // CPP-CHECK-NEXT: entry:
99 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.sqdech.n32(i32 [[OP:%.*]], i32 10, i32 16)
100 // CPP-CHECK-NEXT: ret i32 [[TMP0]]
102 int32_t test_svqdech_pat_n_s32(int32_t op)
104 return SVE_ACLE_FUNC(svqdech_pat,_n_s32,,)(op, SV_VL32, 16);
107 // CHECK-LABEL: @test_svqdech_pat_n_s64(
108 // CHECK-NEXT: entry:
109 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.sqdech.n64(i64 [[OP:%.*]], i32 11, i32 1)
110 // CHECK-NEXT: ret i64 [[TMP0]]
112 // CPP-CHECK-LABEL: @_Z22test_svqdech_pat_n_s64l(
113 // CPP-CHECK-NEXT: entry:
114 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.sqdech.n64(i64 [[OP:%.*]], i32 11, i32 1)
115 // CPP-CHECK-NEXT: ret i64 [[TMP0]]
117 int64_t test_svqdech_pat_n_s64(int64_t op)
119 return SVE_ACLE_FUNC(svqdech_pat,_n_s64,,)(op, SV_VL64, 1);
122 // CHECK-LABEL: @test_svqdech_pat_n_u32(
123 // CHECK-NEXT: entry:
124 // CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.uqdech.n32(i32 [[OP:%.*]], i32 12, i32 16)
125 // CHECK-NEXT: ret i32 [[TMP0]]
127 // CPP-CHECK-LABEL: @_Z22test_svqdech_pat_n_u32j(
128 // CPP-CHECK-NEXT: entry:
129 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i32 @llvm.aarch64.sve.uqdech.n32(i32 [[OP:%.*]], i32 12, i32 16)
130 // CPP-CHECK-NEXT: ret i32 [[TMP0]]
132 uint32_t test_svqdech_pat_n_u32(uint32_t op)
134 return SVE_ACLE_FUNC(svqdech_pat,_n_u32,,)(op, SV_VL128, 16);
137 // CHECK-LABEL: @test_svqdech_pat_n_u64(
138 // CHECK-NEXT: entry:
139 // CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.uqdech.n64(i64 [[OP:%.*]], i32 13, i32 1)
140 // CHECK-NEXT: ret i64 [[TMP0]]
142 // CPP-CHECK-LABEL: @_Z22test_svqdech_pat_n_u64m(
143 // CPP-CHECK-NEXT: entry:
144 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.uqdech.n64(i64 [[OP:%.*]], i32 13, i32 1)
145 // CPP-CHECK-NEXT: ret i64 [[TMP0]]
147 uint64_t test_svqdech_pat_n_u64(uint64_t op)
149 return SVE_ACLE_FUNC(svqdech_pat,_n_u64,,)(op, SV_VL256, 1);
152 // CHECK-LABEL: @test_svqdech_s16(
153 // CHECK-NEXT: entry:
154 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sqdech.nxv8i16(<vscale x 8 x i16> [[OP:%.*]], i32 31, i32 16)
155 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
157 // CPP-CHECK-LABEL: @_Z16test_svqdech_s16u11__SVInt16_t(
158 // CPP-CHECK-NEXT: entry:
159 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sqdech.nxv8i16(<vscale x 8 x i16> [[OP:%.*]], i32 31, i32 16)
160 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
162 svint16_t test_svqdech_s16(svint16_t op)
164 return SVE_ACLE_FUNC(svqdech,_s16,,)(op, 16);
167 // CHECK-LABEL: @test_svqdech_u16(
168 // CHECK-NEXT: entry:
169 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.uqdech.nxv8i16(<vscale x 8 x i16> [[OP:%.*]], i32 31, i32 1)
170 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
172 // CPP-CHECK-LABEL: @_Z16test_svqdech_u16u12__SVUint16_t(
173 // CPP-CHECK-NEXT: entry:
174 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.uqdech.nxv8i16(<vscale x 8 x i16> [[OP:%.*]], i32 31, i32 1)
175 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
177 svuint16_t test_svqdech_u16(svuint16_t op)
179 return SVE_ACLE_FUNC(svqdech,_u16,,)(op, 1);
182 // CHECK-LABEL: @test_svqdech_pat_s16(
183 // CHECK-NEXT: entry:
184 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sqdech.nxv8i16(<vscale x 8 x i16> [[OP:%.*]], i32 29, i32 16)
185 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
187 // CPP-CHECK-LABEL: @_Z20test_svqdech_pat_s16u11__SVInt16_t(
188 // CPP-CHECK-NEXT: entry:
189 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sqdech.nxv8i16(<vscale x 8 x i16> [[OP:%.*]], i32 29, i32 16)
190 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
192 svint16_t test_svqdech_pat_s16(svint16_t op)
194 return SVE_ACLE_FUNC(svqdech_pat,_s16,,)(op, SV_MUL4, 16);
197 // CHECK-LABEL: @test_svqdech_pat_u16(
198 // CHECK-NEXT: entry:
199 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.uqdech.nxv8i16(<vscale x 8 x i16> [[OP:%.*]], i32 30, i32 1)
200 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
202 // CPP-CHECK-LABEL: @_Z20test_svqdech_pat_u16u12__SVUint16_t(
203 // CPP-CHECK-NEXT: entry:
204 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.uqdech.nxv8i16(<vscale x 8 x i16> [[OP:%.*]], i32 30, i32 1)
205 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
207 svuint16_t test_svqdech_pat_u16(svuint16_t op)
209 return SVE_ACLE_FUNC(svqdech_pat,_u16,,)(op, SV_MUL3, 1);