Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / aarch64-sve2-intrinsics / acle_sve2_whilerw.c
blob9dcb59905a0be1169bff60cfaaed3e88ef18f399
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2 -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2 -S -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
4 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
5 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -S -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
7 // REQUIRES: aarch64-registered-target
9 #include <arm_sve.h>
11 #ifdef SVE_OVERLOADED_FORMS
12 // A simple used,unused... macro, long enough to represent any SVE builtin.
13 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
14 #else
15 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
16 #endif
18 // CHECK-LABEL: @test_svwhilerw_s8(
19 // CHECK-NEXT: entry:
20 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.whilerw.b.nxv16i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
21 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]]
23 // CPP-CHECK-LABEL: @_Z17test_svwhilerw_s8PKaS0_(
24 // CPP-CHECK-NEXT: entry:
25 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.whilerw.b.nxv16i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
26 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]]
28 svbool_t test_svwhilerw_s8(const int8_t *op1, const int8_t *op2)
30 return SVE_ACLE_FUNC(svwhilerw,_s8,,)(op1, op2);
33 // CHECK-LABEL: @test_svwhilerw_s16(
34 // CHECK-NEXT: entry:
35 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilerw.h.nxv8i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
36 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
37 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
39 // CPP-CHECK-LABEL: @_Z18test_svwhilerw_s16PKsS0_(
40 // CPP-CHECK-NEXT: entry:
41 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilerw.h.nxv8i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
42 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
43 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
45 svbool_t test_svwhilerw_s16(const int16_t *op1, const int16_t *op2)
47 return SVE_ACLE_FUNC(svwhilerw,_s16,,)(op1, op2);
50 // CHECK-LABEL: @test_svwhilerw_s32(
51 // CHECK-NEXT: entry:
52 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilerw.s.nxv4i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
53 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])
54 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
56 // CPP-CHECK-LABEL: @_Z18test_svwhilerw_s32PKiS0_(
57 // CPP-CHECK-NEXT: entry:
58 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilerw.s.nxv4i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
59 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])
60 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
62 svbool_t test_svwhilerw_s32(const int32_t *op1, const int32_t *op2)
64 return SVE_ACLE_FUNC(svwhilerw,_s32,,)(op1, op2);
67 // CHECK-LABEL: @test_svwhilerw_s64(
68 // CHECK-NEXT: entry:
69 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilerw.d.nxv2i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
70 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])
71 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
73 // CPP-CHECK-LABEL: @_Z18test_svwhilerw_s64PKlS0_(
74 // CPP-CHECK-NEXT: entry:
75 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilerw.d.nxv2i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
76 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])
77 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
79 svbool_t test_svwhilerw_s64(const int64_t *op1, const int64_t *op2)
81 return SVE_ACLE_FUNC(svwhilerw,_s64,,)(op1, op2);
84 // CHECK-LABEL: @test_svwhilerw_u8(
85 // CHECK-NEXT: entry:
86 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.whilerw.b.nxv16i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
87 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]]
89 // CPP-CHECK-LABEL: @_Z17test_svwhilerw_u8PKhS0_(
90 // CPP-CHECK-NEXT: entry:
91 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.whilerw.b.nxv16i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
92 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP0]]
94 svbool_t test_svwhilerw_u8(const uint8_t *op1, const uint8_t *op2)
96 return SVE_ACLE_FUNC(svwhilerw,_u8,,)(op1, op2);
99 // CHECK-LABEL: @test_svwhilerw_u16(
100 // CHECK-NEXT: entry:
101 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilerw.h.nxv8i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
102 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
103 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
105 // CPP-CHECK-LABEL: @_Z18test_svwhilerw_u16PKtS0_(
106 // CPP-CHECK-NEXT: entry:
107 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilerw.h.nxv8i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
108 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
109 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
111 svbool_t test_svwhilerw_u16(const uint16_t *op1, const uint16_t *op2)
113 return SVE_ACLE_FUNC(svwhilerw,_u16,,)(op1, op2);
116 // CHECK-LABEL: @test_svwhilerw_u32(
117 // CHECK-NEXT: entry:
118 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilerw.s.nxv4i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
119 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])
120 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
122 // CPP-CHECK-LABEL: @_Z18test_svwhilerw_u32PKjS0_(
123 // CPP-CHECK-NEXT: entry:
124 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilerw.s.nxv4i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
125 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])
126 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
128 svbool_t test_svwhilerw_u32(const uint32_t *op1, const uint32_t *op2)
130 return SVE_ACLE_FUNC(svwhilerw,_u32,,)(op1, op2);
133 // CHECK-LABEL: @test_svwhilerw_u64(
134 // CHECK-NEXT: entry:
135 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilerw.d.nxv2i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
136 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])
137 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
139 // CPP-CHECK-LABEL: @_Z18test_svwhilerw_u64PKmS0_(
140 // CPP-CHECK-NEXT: entry:
141 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilerw.d.nxv2i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
142 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])
143 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
145 svbool_t test_svwhilerw_u64(const uint64_t *op1, const uint64_t *op2)
147 return SVE_ACLE_FUNC(svwhilerw,_u64,,)(op1, op2);
150 // CHECK-LABEL: @test_svwhilerw_f16(
151 // CHECK-NEXT: entry:
152 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilerw.h.nxv8i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
153 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
154 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
156 // CPP-CHECK-LABEL: @_Z18test_svwhilerw_f16PKDhS0_(
157 // CPP-CHECK-NEXT: entry:
158 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilerw.h.nxv8i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
159 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
160 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
162 svbool_t test_svwhilerw_f16(const float16_t *op1, const float16_t *op2)
164 return SVE_ACLE_FUNC(svwhilerw,_f16,,)(op1, op2);
167 // CHECK-LABEL: @test_svwhilerw_f32(
168 // CHECK-NEXT: entry:
169 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilerw.s.nxv4i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
170 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])
171 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
173 // CPP-CHECK-LABEL: @_Z18test_svwhilerw_f32PKfS0_(
174 // CPP-CHECK-NEXT: entry:
175 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilerw.s.nxv4i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
176 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])
177 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
179 svbool_t test_svwhilerw_f32(const float32_t *op1, const float32_t *op2)
181 return SVE_ACLE_FUNC(svwhilerw,_f32,,)(op1, op2);
184 // CHECK-LABEL: @test_svwhilerw_f64(
185 // CHECK-NEXT: entry:
186 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilerw.d.nxv2i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
187 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])
188 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
190 // CPP-CHECK-LABEL: @_Z18test_svwhilerw_f64PKdS0_(
191 // CPP-CHECK-NEXT: entry:
192 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilerw.d.nxv2i1.p0(ptr [[OP1:%.*]], ptr [[OP2:%.*]])
193 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])
194 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
196 svbool_t test_svwhilerw_f64(const float64_t *op1, const float64_t *op2)
198 return SVE_ACLE_FUNC(svwhilerw,_f64,,)(op1, op2);