xref: /llvm-project/clang/test/CodeGen/AArch64/sve-intrinsics/acle_sve_whilele.c (revision 207e5ccceec8d3cc3f32723e78f2a142bc61b07d)
1*207e5cccSFangrui Song // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2*207e5cccSFangrui Song // REQUIRES: aarch64-registered-target
3*207e5cccSFangrui Song // 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*207e5cccSFangrui Song // 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*207e5cccSFangrui Song // 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*207e5cccSFangrui Song // 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*207e5cccSFangrui Song // RUN: %clang_cc1 -triple aarch64 -target-feature +sve -S -disable-O0-optnone -Werror -o /dev/null %s
8*207e5cccSFangrui Song // RUN: %clang_cc1 -triple aarch64 -target-feature +sme -S -disable-O0-optnone -Werror -o /dev/null %s
9*207e5cccSFangrui Song 
10*207e5cccSFangrui Song #include <arm_sve.h>
11*207e5cccSFangrui Song 
12*207e5cccSFangrui Song #if defined __ARM_FEATURE_SME
13*207e5cccSFangrui Song #define MODE_ATTR __arm_streaming
14*207e5cccSFangrui Song #else
15*207e5cccSFangrui Song #define MODE_ATTR
16*207e5cccSFangrui Song #endif
17*207e5cccSFangrui Song 
18*207e5cccSFangrui Song #ifdef SVE_OVERLOADED_FORMS
19*207e5cccSFangrui Song // A simple used,unused... macro, long enough to represent any SVE builtin.
20*207e5cccSFangrui Song #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
21*207e5cccSFangrui Song #else
22*207e5cccSFangrui Song #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
23*207e5cccSFangrui Song #endif
24*207e5cccSFangrui Song 
25*207e5cccSFangrui Song // CHECK-LABEL: @test_svwhilele_b8_s32(
26*207e5cccSFangrui Song // CHECK-NEXT:  entry:
27*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.whilele.nxv16i1.i32(i32 [[OP1:%.*]], i32 [[OP2:%.*]])
28*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
29*207e5cccSFangrui Song //
30*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z21test_svwhilele_b8_s32ii(
31*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
32*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.whilele.nxv16i1.i32(i32 [[OP1:%.*]], i32 [[OP2:%.*]])
33*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
34*207e5cccSFangrui Song //
35*207e5cccSFangrui Song svbool_t test_svwhilele_b8_s32(int32_t op1, int32_t op2) MODE_ATTR
36*207e5cccSFangrui Song {
37*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svwhilele_b8,_s32,,)(op1, op2);
38*207e5cccSFangrui Song }
39*207e5cccSFangrui Song 
40*207e5cccSFangrui Song // CHECK-LABEL: @test_svwhilele_b16_s32(
41*207e5cccSFangrui Song // CHECK-NEXT:  entry:
42*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilele.nxv8i1.i32(i32 [[OP1:%.*]], i32 [[OP2:%.*]])
43*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
44*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
45*207e5cccSFangrui Song //
46*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svwhilele_b16_s32ii(
47*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
48*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilele.nxv8i1.i32(i32 [[OP1:%.*]], i32 [[OP2:%.*]])
49*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
50*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
51*207e5cccSFangrui Song //
52*207e5cccSFangrui Song svbool_t test_svwhilele_b16_s32(int32_t op1, int32_t op2) MODE_ATTR
53*207e5cccSFangrui Song {
54*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svwhilele_b16,_s32,,)(op1, op2);
55*207e5cccSFangrui Song }
56*207e5cccSFangrui Song 
57*207e5cccSFangrui Song // CHECK-LABEL: @test_svwhilele_b32_s32(
58*207e5cccSFangrui Song // CHECK-NEXT:  entry:
59*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilele.nxv4i1.i32(i32 [[OP1:%.*]], i32 [[OP2:%.*]])
60*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])
61*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
62*207e5cccSFangrui Song //
63*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svwhilele_b32_s32ii(
64*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
65*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilele.nxv4i1.i32(i32 [[OP1:%.*]], i32 [[OP2:%.*]])
66*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])
67*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
68*207e5cccSFangrui Song //
69*207e5cccSFangrui Song svbool_t test_svwhilele_b32_s32(int32_t op1, int32_t op2) MODE_ATTR
70*207e5cccSFangrui Song {
71*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svwhilele_b32,_s32,,)(op1, op2);
72*207e5cccSFangrui Song }
73*207e5cccSFangrui Song 
74*207e5cccSFangrui Song // CHECK-LABEL: @test_svwhilele_b64_s32(
75*207e5cccSFangrui Song // CHECK-NEXT:  entry:
76*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilele.nxv2i1.i32(i32 [[OP1:%.*]], i32 [[OP2:%.*]])
77*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])
78*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
79*207e5cccSFangrui Song //
80*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svwhilele_b64_s32ii(
81*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
82*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilele.nxv2i1.i32(i32 [[OP1:%.*]], i32 [[OP2:%.*]])
83*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])
84*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
85*207e5cccSFangrui Song //
86*207e5cccSFangrui Song svbool_t test_svwhilele_b64_s32(int32_t op1, int32_t op2) MODE_ATTR
87*207e5cccSFangrui Song {
88*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svwhilele_b64,_s32,,)(op1, op2);
89*207e5cccSFangrui Song }
90*207e5cccSFangrui Song 
91*207e5cccSFangrui Song // CHECK-LABEL: @test_svwhilele_b8_u32(
92*207e5cccSFangrui Song // CHECK-NEXT:  entry:
93*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.whilels.nxv16i1.i32(i32 [[OP1:%.*]], i32 [[OP2:%.*]])
94*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
95*207e5cccSFangrui Song //
96*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z21test_svwhilele_b8_u32jj(
97*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
98*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.whilels.nxv16i1.i32(i32 [[OP1:%.*]], i32 [[OP2:%.*]])
99*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
100*207e5cccSFangrui Song //
101*207e5cccSFangrui Song svbool_t test_svwhilele_b8_u32(uint32_t op1, uint32_t op2) MODE_ATTR
102*207e5cccSFangrui Song {
103*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svwhilele_b8,_u32,,)(op1, op2);
104*207e5cccSFangrui Song }
105*207e5cccSFangrui Song 
106*207e5cccSFangrui Song // CHECK-LABEL: @test_svwhilele_b16_u32(
107*207e5cccSFangrui Song // CHECK-NEXT:  entry:
108*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilels.nxv8i1.i32(i32 [[OP1:%.*]], i32 [[OP2:%.*]])
109*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
110*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
111*207e5cccSFangrui Song //
112*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svwhilele_b16_u32jj(
113*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
114*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilels.nxv8i1.i32(i32 [[OP1:%.*]], i32 [[OP2:%.*]])
115*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
116*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
117*207e5cccSFangrui Song //
118*207e5cccSFangrui Song svbool_t test_svwhilele_b16_u32(uint32_t op1, uint32_t op2) MODE_ATTR
119*207e5cccSFangrui Song {
120*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svwhilele_b16,_u32,,)(op1, op2);
121*207e5cccSFangrui Song }
122*207e5cccSFangrui Song 
123*207e5cccSFangrui Song // CHECK-LABEL: @test_svwhilele_b32_u32(
124*207e5cccSFangrui Song // CHECK-NEXT:  entry:
125*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilels.nxv4i1.i32(i32 [[OP1:%.*]], i32 [[OP2:%.*]])
126*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])
127*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
128*207e5cccSFangrui Song //
129*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svwhilele_b32_u32jj(
130*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
131*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilels.nxv4i1.i32(i32 [[OP1:%.*]], i32 [[OP2:%.*]])
132*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])
133*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
134*207e5cccSFangrui Song //
135*207e5cccSFangrui Song svbool_t test_svwhilele_b32_u32(uint32_t op1, uint32_t op2) MODE_ATTR
136*207e5cccSFangrui Song {
137*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svwhilele_b32,_u32,,)(op1, op2);
138*207e5cccSFangrui Song }
139*207e5cccSFangrui Song 
140*207e5cccSFangrui Song // CHECK-LABEL: @test_svwhilele_b64_u32(
141*207e5cccSFangrui Song // CHECK-NEXT:  entry:
142*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilels.nxv2i1.i32(i32 [[OP1:%.*]], i32 [[OP2:%.*]])
143*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])
144*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
145*207e5cccSFangrui Song //
146*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svwhilele_b64_u32jj(
147*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
148*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilels.nxv2i1.i32(i32 [[OP1:%.*]], i32 [[OP2:%.*]])
149*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])
150*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
151*207e5cccSFangrui Song //
152*207e5cccSFangrui Song svbool_t test_svwhilele_b64_u32(uint32_t op1, uint32_t op2) MODE_ATTR
153*207e5cccSFangrui Song {
154*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svwhilele_b64,_u32,,)(op1, op2);
155*207e5cccSFangrui Song }
156*207e5cccSFangrui Song 
157*207e5cccSFangrui Song // CHECK-LABEL: @test_svwhilele_b8_s64(
158*207e5cccSFangrui Song // CHECK-NEXT:  entry:
159*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.whilele.nxv16i1.i64(i64 [[OP1:%.*]], i64 [[OP2:%.*]])
160*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
161*207e5cccSFangrui Song //
162*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z21test_svwhilele_b8_s64ll(
163*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
164*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.whilele.nxv16i1.i64(i64 [[OP1:%.*]], i64 [[OP2:%.*]])
165*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
166*207e5cccSFangrui Song //
167*207e5cccSFangrui Song svbool_t test_svwhilele_b8_s64(int64_t op1, int64_t op2) MODE_ATTR
168*207e5cccSFangrui Song {
169*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svwhilele_b8,_s64,,)(op1, op2);
170*207e5cccSFangrui Song }
171*207e5cccSFangrui Song 
172*207e5cccSFangrui Song // CHECK-LABEL: @test_svwhilele_b16_s64(
173*207e5cccSFangrui Song // CHECK-NEXT:  entry:
174*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilele.nxv8i1.i64(i64 [[OP1:%.*]], i64 [[OP2:%.*]])
175*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
176*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
177*207e5cccSFangrui Song //
178*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svwhilele_b16_s64ll(
179*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
180*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilele.nxv8i1.i64(i64 [[OP1:%.*]], i64 [[OP2:%.*]])
181*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
182*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
183*207e5cccSFangrui Song //
184*207e5cccSFangrui Song svbool_t test_svwhilele_b16_s64(int64_t op1, int64_t op2) MODE_ATTR
185*207e5cccSFangrui Song {
186*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svwhilele_b16,_s64,,)(op1, op2);
187*207e5cccSFangrui Song }
188*207e5cccSFangrui Song 
189*207e5cccSFangrui Song // CHECK-LABEL: @test_svwhilele_b32_s64(
190*207e5cccSFangrui Song // CHECK-NEXT:  entry:
191*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilele.nxv4i1.i64(i64 [[OP1:%.*]], i64 [[OP2:%.*]])
192*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])
193*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
194*207e5cccSFangrui Song //
195*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svwhilele_b32_s64ll(
196*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
197*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilele.nxv4i1.i64(i64 [[OP1:%.*]], i64 [[OP2:%.*]])
198*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])
199*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
200*207e5cccSFangrui Song //
201*207e5cccSFangrui Song svbool_t test_svwhilele_b32_s64(int64_t op1, int64_t op2) MODE_ATTR
202*207e5cccSFangrui Song {
203*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svwhilele_b32,_s64,,)(op1, op2);
204*207e5cccSFangrui Song }
205*207e5cccSFangrui Song 
206*207e5cccSFangrui Song // CHECK-LABEL: @test_svwhilele_b64_s64(
207*207e5cccSFangrui Song // CHECK-NEXT:  entry:
208*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilele.nxv2i1.i64(i64 [[OP1:%.*]], i64 [[OP2:%.*]])
209*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])
210*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
211*207e5cccSFangrui Song //
212*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svwhilele_b64_s64ll(
213*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
214*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilele.nxv2i1.i64(i64 [[OP1:%.*]], i64 [[OP2:%.*]])
215*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])
216*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
217*207e5cccSFangrui Song //
218*207e5cccSFangrui Song svbool_t test_svwhilele_b64_s64(int64_t op1, int64_t op2) MODE_ATTR
219*207e5cccSFangrui Song {
220*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svwhilele_b64,_s64,,)(op1, op2);
221*207e5cccSFangrui Song }
222*207e5cccSFangrui Song 
223*207e5cccSFangrui Song // CHECK-LABEL: @test_svwhilele_b8_u64(
224*207e5cccSFangrui Song // CHECK-NEXT:  entry:
225*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.whilels.nxv16i1.i64(i64 [[OP1:%.*]], i64 [[OP2:%.*]])
226*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
227*207e5cccSFangrui Song //
228*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z21test_svwhilele_b8_u64mm(
229*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
230*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.whilels.nxv16i1.i64(i64 [[OP1:%.*]], i64 [[OP2:%.*]])
231*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
232*207e5cccSFangrui Song //
233*207e5cccSFangrui Song svbool_t test_svwhilele_b8_u64(uint64_t op1, uint64_t op2) MODE_ATTR
234*207e5cccSFangrui Song {
235*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svwhilele_b8,_u64,,)(op1, op2);
236*207e5cccSFangrui Song }
237*207e5cccSFangrui Song 
238*207e5cccSFangrui Song // CHECK-LABEL: @test_svwhilele_b16_u64(
239*207e5cccSFangrui Song // CHECK-NEXT:  entry:
240*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilels.nxv8i1.i64(i64 [[OP1:%.*]], i64 [[OP2:%.*]])
241*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
242*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
243*207e5cccSFangrui Song //
244*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svwhilele_b16_u64mm(
245*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
246*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.whilels.nxv8i1.i64(i64 [[OP1:%.*]], i64 [[OP2:%.*]])
247*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
248*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
249*207e5cccSFangrui Song //
250*207e5cccSFangrui Song svbool_t test_svwhilele_b16_u64(uint64_t op1, uint64_t op2) MODE_ATTR
251*207e5cccSFangrui Song {
252*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svwhilele_b16,_u64,,)(op1, op2);
253*207e5cccSFangrui Song }
254*207e5cccSFangrui Song 
255*207e5cccSFangrui Song // CHECK-LABEL: @test_svwhilele_b32_u64(
256*207e5cccSFangrui Song // CHECK-NEXT:  entry:
257*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilels.nxv4i1.i64(i64 [[OP1:%.*]], i64 [[OP2:%.*]])
258*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])
259*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
260*207e5cccSFangrui Song //
261*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svwhilele_b32_u64mm(
262*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
263*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilels.nxv4i1.i64(i64 [[OP1:%.*]], i64 [[OP2:%.*]])
264*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> [[TMP0]])
265*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
266*207e5cccSFangrui Song //
267*207e5cccSFangrui Song svbool_t test_svwhilele_b32_u64(uint64_t op1, uint64_t op2) MODE_ATTR
268*207e5cccSFangrui Song {
269*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svwhilele_b32,_u64,,)(op1, op2);
270*207e5cccSFangrui Song }
271*207e5cccSFangrui Song 
272*207e5cccSFangrui Song // CHECK-LABEL: @test_svwhilele_b64_u64(
273*207e5cccSFangrui Song // CHECK-NEXT:  entry:
274*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilels.nxv2i1.i64(i64 [[OP1:%.*]], i64 [[OP2:%.*]])
275*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])
276*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
277*207e5cccSFangrui Song //
278*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svwhilele_b64_u64mm(
279*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
280*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.whilels.nxv2i1.i64(i64 [[OP1:%.*]], i64 [[OP2:%.*]])
281*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv2i1(<vscale x 2 x i1> [[TMP0]])
282*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
283*207e5cccSFangrui Song //
284*207e5cccSFangrui Song svbool_t test_svwhilele_b64_u64(uint64_t op1, uint64_t op2) MODE_ATTR
285*207e5cccSFangrui Song {
286*207e5cccSFangrui Song   return SVE_ACLE_FUNC(svwhilele_b64,_u64,,)(op1, op2);
287*207e5cccSFangrui Song }
288