xref: /llvm-project/clang/test/CodeGen/AArch64/sve-intrinsics/acle_sve_ptrue.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 -triple aarch64 -target-feature +sve -S -disable-O0-optnone -Werror -o /dev/null %s
6*207e5cccSFangrui Song // RUN: %clang_cc1 -triple aarch64 -target-feature +sme -S -disable-O0-optnone -Werror -o /dev/null %s
7*207e5cccSFangrui Song 
8*207e5cccSFangrui Song #include <arm_sve.h>
9*207e5cccSFangrui Song 
10*207e5cccSFangrui Song #if defined __ARM_FEATURE_SME
11*207e5cccSFangrui Song #define MODE_ATTR __arm_streaming
12*207e5cccSFangrui Song #else
13*207e5cccSFangrui Song #define MODE_ATTR
14*207e5cccSFangrui Song #endif
15*207e5cccSFangrui Song 
16*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_b8(
17*207e5cccSFangrui Song // CHECK-NEXT:  entry:
18*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 31)
19*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
20*207e5cccSFangrui Song //
21*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z15test_svptrue_b8v(
22*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
23*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 31)
24*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
25*207e5cccSFangrui Song //
26*207e5cccSFangrui Song svbool_t test_svptrue_b8(void) MODE_ATTR
27*207e5cccSFangrui Song {
28*207e5cccSFangrui Song   return svptrue_b8();
29*207e5cccSFangrui Song }
30*207e5cccSFangrui Song 
31*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_b16(
32*207e5cccSFangrui Song // CHECK-NEXT:  entry:
33*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.ptrue.nxv8i1(i32 31)
34*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]])
35*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
36*207e5cccSFangrui Song //
37*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z16test_svptrue_b16v(
38*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
39*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.ptrue.nxv8i1(i32 31)
40*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]])
41*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
42*207e5cccSFangrui Song //
43*207e5cccSFangrui Song svbool_t test_svptrue_b16(void) MODE_ATTR
44*207e5cccSFangrui Song {
45*207e5cccSFangrui Song   return svptrue_b16();
46*207e5cccSFangrui Song }
47*207e5cccSFangrui Song 
48*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_b32(
49*207e5cccSFangrui Song // CHECK-NEXT:  entry:
50*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.ptrue.nxv4i1(i32 31)
51*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]])
52*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
53*207e5cccSFangrui Song //
54*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z16test_svptrue_b32v(
55*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
56*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.ptrue.nxv4i1(i32 31)
57*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]])
58*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
59*207e5cccSFangrui Song //
60*207e5cccSFangrui Song svbool_t test_svptrue_b32(void) MODE_ATTR
61*207e5cccSFangrui Song {
62*207e5cccSFangrui Song   return svptrue_b32();
63*207e5cccSFangrui Song }
64*207e5cccSFangrui Song 
65*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_b64(
66*207e5cccSFangrui Song // CHECK-NEXT:  entry:
67*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.ptrue.nxv2i1(i32 31)
68*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]])
69*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
70*207e5cccSFangrui Song //
71*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z16test_svptrue_b64v(
72*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
73*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.ptrue.nxv2i1(i32 31)
74*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]])
75*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
76*207e5cccSFangrui Song //
77*207e5cccSFangrui Song svbool_t test_svptrue_b64(void) MODE_ATTR
78*207e5cccSFangrui Song {
79*207e5cccSFangrui Song   return svptrue_b64();
80*207e5cccSFangrui Song }
81*207e5cccSFangrui Song 
82*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8(
83*207e5cccSFangrui Song // CHECK-NEXT:  entry:
84*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 0)
85*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
86*207e5cccSFangrui Song //
87*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z19test_svptrue_pat_b8v(
88*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
89*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 0)
90*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
91*207e5cccSFangrui Song //
92*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8(void) MODE_ATTR
93*207e5cccSFangrui Song {
94*207e5cccSFangrui Song   return svptrue_pat_b8(SV_POW2);
95*207e5cccSFangrui Song }
96*207e5cccSFangrui Song 
97*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8_1(
98*207e5cccSFangrui Song // CHECK-NEXT:  entry:
99*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 1)
100*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
101*207e5cccSFangrui Song //
102*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z21test_svptrue_pat_b8_1v(
103*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
104*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 1)
105*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
106*207e5cccSFangrui Song //
107*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8_1(void) MODE_ATTR
108*207e5cccSFangrui Song {
109*207e5cccSFangrui Song   return svptrue_pat_b8(SV_VL1);
110*207e5cccSFangrui Song }
111*207e5cccSFangrui Song 
112*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8_2(
113*207e5cccSFangrui Song // CHECK-NEXT:  entry:
114*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 2)
115*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
116*207e5cccSFangrui Song //
117*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z21test_svptrue_pat_b8_2v(
118*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
119*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 2)
120*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
121*207e5cccSFangrui Song //
122*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8_2(void) MODE_ATTR
123*207e5cccSFangrui Song {
124*207e5cccSFangrui Song   return svptrue_pat_b8(SV_VL2);
125*207e5cccSFangrui Song }
126*207e5cccSFangrui Song 
127*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8_3(
128*207e5cccSFangrui Song // CHECK-NEXT:  entry:
129*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 3)
130*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
131*207e5cccSFangrui Song //
132*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z21test_svptrue_pat_b8_3v(
133*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
134*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 3)
135*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
136*207e5cccSFangrui Song //
137*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8_3(void) MODE_ATTR
138*207e5cccSFangrui Song {
139*207e5cccSFangrui Song   return svptrue_pat_b8(SV_VL3);
140*207e5cccSFangrui Song }
141*207e5cccSFangrui Song 
142*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8_4(
143*207e5cccSFangrui Song // CHECK-NEXT:  entry:
144*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 4)
145*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
146*207e5cccSFangrui Song //
147*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z21test_svptrue_pat_b8_4v(
148*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
149*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 4)
150*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
151*207e5cccSFangrui Song //
152*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8_4(void) MODE_ATTR
153*207e5cccSFangrui Song {
154*207e5cccSFangrui Song   return svptrue_pat_b8(SV_VL4);
155*207e5cccSFangrui Song }
156*207e5cccSFangrui Song 
157*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8_5(
158*207e5cccSFangrui Song // CHECK-NEXT:  entry:
159*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 5)
160*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
161*207e5cccSFangrui Song //
162*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z21test_svptrue_pat_b8_5v(
163*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
164*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 5)
165*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
166*207e5cccSFangrui Song //
167*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8_5(void) MODE_ATTR
168*207e5cccSFangrui Song {
169*207e5cccSFangrui Song   return svptrue_pat_b8(SV_VL5);
170*207e5cccSFangrui Song }
171*207e5cccSFangrui Song 
172*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8_6(
173*207e5cccSFangrui Song // CHECK-NEXT:  entry:
174*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 6)
175*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
176*207e5cccSFangrui Song //
177*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z21test_svptrue_pat_b8_6v(
178*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
179*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 6)
180*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
181*207e5cccSFangrui Song //
182*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8_6(void) MODE_ATTR
183*207e5cccSFangrui Song {
184*207e5cccSFangrui Song   return svptrue_pat_b8(SV_VL6);
185*207e5cccSFangrui Song }
186*207e5cccSFangrui Song 
187*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8_7(
188*207e5cccSFangrui Song // CHECK-NEXT:  entry:
189*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 7)
190*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
191*207e5cccSFangrui Song //
192*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z21test_svptrue_pat_b8_7v(
193*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
194*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 7)
195*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
196*207e5cccSFangrui Song //
197*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8_7(void) MODE_ATTR
198*207e5cccSFangrui Song {
199*207e5cccSFangrui Song   return svptrue_pat_b8(SV_VL7);
200*207e5cccSFangrui Song }
201*207e5cccSFangrui Song 
202*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8_8(
203*207e5cccSFangrui Song // CHECK-NEXT:  entry:
204*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 8)
205*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
206*207e5cccSFangrui Song //
207*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z21test_svptrue_pat_b8_8v(
208*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
209*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 8)
210*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
211*207e5cccSFangrui Song //
212*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8_8(void) MODE_ATTR
213*207e5cccSFangrui Song {
214*207e5cccSFangrui Song   return svptrue_pat_b8(SV_VL8);
215*207e5cccSFangrui Song }
216*207e5cccSFangrui Song 
217*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8_9(
218*207e5cccSFangrui Song // CHECK-NEXT:  entry:
219*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 9)
220*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
221*207e5cccSFangrui Song //
222*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z21test_svptrue_pat_b8_9v(
223*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
224*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 9)
225*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
226*207e5cccSFangrui Song //
227*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8_9(void) MODE_ATTR
228*207e5cccSFangrui Song {
229*207e5cccSFangrui Song   return svptrue_pat_b8(SV_VL16);
230*207e5cccSFangrui Song }
231*207e5cccSFangrui Song 
232*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8_10(
233*207e5cccSFangrui Song // CHECK-NEXT:  entry:
234*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 10)
235*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
236*207e5cccSFangrui Song //
237*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svptrue_pat_b8_10v(
238*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
239*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 10)
240*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
241*207e5cccSFangrui Song //
242*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8_10(void) MODE_ATTR
243*207e5cccSFangrui Song {
244*207e5cccSFangrui Song   return svptrue_pat_b8(SV_VL32);
245*207e5cccSFangrui Song }
246*207e5cccSFangrui Song 
247*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8_11(
248*207e5cccSFangrui Song // CHECK-NEXT:  entry:
249*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 11)
250*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
251*207e5cccSFangrui Song //
252*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svptrue_pat_b8_11v(
253*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
254*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 11)
255*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
256*207e5cccSFangrui Song //
257*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8_11(void) MODE_ATTR
258*207e5cccSFangrui Song {
259*207e5cccSFangrui Song   return svptrue_pat_b8(SV_VL64);
260*207e5cccSFangrui Song }
261*207e5cccSFangrui Song 
262*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8_12(
263*207e5cccSFangrui Song // CHECK-NEXT:  entry:
264*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 12)
265*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
266*207e5cccSFangrui Song //
267*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svptrue_pat_b8_12v(
268*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
269*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 12)
270*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
271*207e5cccSFangrui Song //
272*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8_12(void) MODE_ATTR
273*207e5cccSFangrui Song {
274*207e5cccSFangrui Song   return svptrue_pat_b8(SV_VL128);
275*207e5cccSFangrui Song }
276*207e5cccSFangrui Song 
277*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8_13(
278*207e5cccSFangrui Song // CHECK-NEXT:  entry:
279*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 13)
280*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
281*207e5cccSFangrui Song //
282*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svptrue_pat_b8_13v(
283*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
284*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 13)
285*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
286*207e5cccSFangrui Song //
287*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8_13(void) MODE_ATTR
288*207e5cccSFangrui Song {
289*207e5cccSFangrui Song   return svptrue_pat_b8(SV_VL256);
290*207e5cccSFangrui Song }
291*207e5cccSFangrui Song 
292*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8_14(
293*207e5cccSFangrui Song // CHECK-NEXT:  entry:
294*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 29)
295*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
296*207e5cccSFangrui Song //
297*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svptrue_pat_b8_14v(
298*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
299*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 29)
300*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
301*207e5cccSFangrui Song //
302*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8_14(void) MODE_ATTR
303*207e5cccSFangrui Song {
304*207e5cccSFangrui Song   return svptrue_pat_b8(SV_MUL4);
305*207e5cccSFangrui Song }
306*207e5cccSFangrui Song 
307*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8_15(
308*207e5cccSFangrui Song // CHECK-NEXT:  entry:
309*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 30)
310*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
311*207e5cccSFangrui Song //
312*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svptrue_pat_b8_15v(
313*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
314*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 30)
315*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
316*207e5cccSFangrui Song //
317*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8_15(void) MODE_ATTR
318*207e5cccSFangrui Song {
319*207e5cccSFangrui Song   return svptrue_pat_b8(SV_MUL3);
320*207e5cccSFangrui Song }
321*207e5cccSFangrui Song 
322*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b8_16(
323*207e5cccSFangrui Song // CHECK-NEXT:  entry:
324*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 31)
325*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
326*207e5cccSFangrui Song //
327*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z22test_svptrue_pat_b8_16v(
328*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
329*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 31)
330*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP0]]
331*207e5cccSFangrui Song //
332*207e5cccSFangrui Song svbool_t test_svptrue_pat_b8_16(void) MODE_ATTR
333*207e5cccSFangrui Song {
334*207e5cccSFangrui Song   return svptrue_pat_b8(SV_ALL);
335*207e5cccSFangrui Song }
336*207e5cccSFangrui Song 
337*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b16(
338*207e5cccSFangrui Song // CHECK-NEXT:  entry:
339*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.ptrue.nxv8i1(i32 0)
340*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]])
341*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
342*207e5cccSFangrui Song //
343*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z20test_svptrue_pat_b16v(
344*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
345*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.ptrue.nxv8i1(i32 0)
346*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]])
347*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
348*207e5cccSFangrui Song //
349*207e5cccSFangrui Song svbool_t test_svptrue_pat_b16(void) MODE_ATTR
350*207e5cccSFangrui Song {
351*207e5cccSFangrui Song   return svptrue_pat_b16(SV_POW2);
352*207e5cccSFangrui Song }
353*207e5cccSFangrui Song 
354*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b32(
355*207e5cccSFangrui Song // CHECK-NEXT:  entry:
356*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.ptrue.nxv4i1(i32 1)
357*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]])
358*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
359*207e5cccSFangrui Song //
360*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z20test_svptrue_pat_b32v(
361*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
362*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.ptrue.nxv4i1(i32 1)
363*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]])
364*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
365*207e5cccSFangrui Song //
366*207e5cccSFangrui Song svbool_t test_svptrue_pat_b32(void) MODE_ATTR
367*207e5cccSFangrui Song {
368*207e5cccSFangrui Song   return svptrue_pat_b32(SV_VL1);
369*207e5cccSFangrui Song }
370*207e5cccSFangrui Song 
371*207e5cccSFangrui Song // CHECK-LABEL: @test_svptrue_pat_b64(
372*207e5cccSFangrui Song // CHECK-NEXT:  entry:
373*207e5cccSFangrui Song // CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.ptrue.nxv2i1(i32 2)
374*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]])
375*207e5cccSFangrui Song // CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
376*207e5cccSFangrui Song //
377*207e5cccSFangrui Song // CPP-CHECK-LABEL: @_Z20test_svptrue_pat_b64v(
378*207e5cccSFangrui Song // CPP-CHECK-NEXT:  entry:
379*207e5cccSFangrui Song // CPP-CHECK-NEXT:    [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.ptrue.nxv2i1(i32 2)
380*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]])
381*207e5cccSFangrui Song // CPP-CHECK-NEXT:    ret <vscale x 16 x i1> [[TMP1]]
382*207e5cccSFangrui Song //
383*207e5cccSFangrui Song svbool_t test_svptrue_pat_b64(void) MODE_ATTR
384*207e5cccSFangrui Song {
385*207e5cccSFangrui Song   return svptrue_pat_b64(SV_VL2);
386*207e5cccSFangrui Song }
387