1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabi -mattr=+mve,+fullfp16 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK-MVE
3; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabi -mattr=+mve.fp -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK-MVEFP
4
5define arm_aapcs_vfpcc <4 x float> @vcmp_oeq_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
6; CHECK-MVE-LABEL: vcmp_oeq_v4f32:
7; CHECK-MVE:       @ %bb.0: @ %entry
8; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
9; CHECK-MVE-NEXT:    movs r1, #0
10; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
11; CHECK-MVE-NEXT:    it eq
12; CHECK-MVE-NEXT:    moveq r1, #1
13; CHECK-MVE-NEXT:    cmp r1, #0
14; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
15; CHECK-MVE-NEXT:    cset r1, ne
16; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
17; CHECK-MVE-NEXT:    mov.w r2, #0
18; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
19; CHECK-MVE-NEXT:    it eq
20; CHECK-MVE-NEXT:    moveq r2, #1
21; CHECK-MVE-NEXT:    cmp r2, #0
22; CHECK-MVE-NEXT:    cset r2, ne
23; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
24; CHECK-MVE-NEXT:    mov.w r3, #0
25; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
26; CHECK-MVE-NEXT:    it eq
27; CHECK-MVE-NEXT:    moveq r3, #1
28; CHECK-MVE-NEXT:    cmp r3, #0
29; CHECK-MVE-NEXT:    cset r3, ne
30; CHECK-MVE-NEXT:    movs r0, #0
31; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
32; CHECK-MVE-NEXT:    it eq
33; CHECK-MVE-NEXT:    moveq r0, #1
34; CHECK-MVE-NEXT:    cmp r0, #0
35; CHECK-MVE-NEXT:    cset r0, ne
36; CHECK-MVE-NEXT:    lsls r0, r0, #31
37; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
38; CHECK-MVE-NEXT:    lsls r0, r3, #31
39; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
40; CHECK-MVE-NEXT:    lsls r0, r2, #31
41; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
42; CHECK-MVE-NEXT:    lsls r0, r1, #31
43; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
44; CHECK-MVE-NEXT:    bx lr
45;
46; CHECK-MVEFP-LABEL: vcmp_oeq_v4f32:
47; CHECK-MVEFP:       @ %bb.0: @ %entry
48; CHECK-MVEFP-NEXT:    vcmp.f32 eq, q0, zr
49; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
50; CHECK-MVEFP-NEXT:    bx lr
51entry:
52  %c = fcmp oeq <4 x float> %src, zeroinitializer
53  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
54  ret <4 x float> %s
55}
56
57define arm_aapcs_vfpcc <4 x float> @vcmp_one_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
58; CHECK-MVE-LABEL: vcmp_one_v4f32:
59; CHECK-MVE:       @ %bb.0: @ %entry
60; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
61; CHECK-MVE-NEXT:    movs r1, #0
62; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
63; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
64; CHECK-MVE-NEXT:    it mi
65; CHECK-MVE-NEXT:    movmi r1, #1
66; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
67; CHECK-MVE-NEXT:    it gt
68; CHECK-MVE-NEXT:    movgt r1, #1
69; CHECK-MVE-NEXT:    cmp r1, #0
70; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
71; CHECK-MVE-NEXT:    mov.w r2, #0
72; CHECK-MVE-NEXT:    cset r1, ne
73; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
74; CHECK-MVE-NEXT:    it mi
75; CHECK-MVE-NEXT:    movmi r2, #1
76; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
77; CHECK-MVE-NEXT:    it gt
78; CHECK-MVE-NEXT:    movgt r2, #1
79; CHECK-MVE-NEXT:    cmp r2, #0
80; CHECK-MVE-NEXT:    mov.w r3, #0
81; CHECK-MVE-NEXT:    cset r2, ne
82; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
83; CHECK-MVE-NEXT:    it mi
84; CHECK-MVE-NEXT:    movmi r3, #1
85; CHECK-MVE-NEXT:    it gt
86; CHECK-MVE-NEXT:    movgt r3, #1
87; CHECK-MVE-NEXT:    cmp r3, #0
88; CHECK-MVE-NEXT:    mov.w r0, #0
89; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
90; CHECK-MVE-NEXT:    cset r3, ne
91; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
92; CHECK-MVE-NEXT:    it mi
93; CHECK-MVE-NEXT:    movmi r0, #1
94; CHECK-MVE-NEXT:    it gt
95; CHECK-MVE-NEXT:    movgt r0, #1
96; CHECK-MVE-NEXT:    cmp r0, #0
97; CHECK-MVE-NEXT:    cset r0, ne
98; CHECK-MVE-NEXT:    lsls r0, r0, #31
99; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
100; CHECK-MVE-NEXT:    lsls r0, r3, #31
101; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
102; CHECK-MVE-NEXT:    lsls r0, r2, #31
103; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
104; CHECK-MVE-NEXT:    lsls r0, r1, #31
105; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
106; CHECK-MVE-NEXT:    bx lr
107;
108; CHECK-MVEFP-LABEL: vcmp_one_v4f32:
109; CHECK-MVEFP:       @ %bb.0: @ %entry
110; CHECK-MVEFP-NEXT:    vpt.f32 ge, q0, zr
111; CHECK-MVEFP-NEXT:    vcmpt.f32 le, q0, zr
112; CHECK-MVEFP-NEXT:    vpsel q0, q2, q1
113; CHECK-MVEFP-NEXT:    bx lr
114entry:
115  %c = fcmp one <4 x float> %src, zeroinitializer
116  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
117  ret <4 x float> %s
118}
119
120define arm_aapcs_vfpcc <4 x float> @vcmp_ogt_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
121; CHECK-MVE-LABEL: vcmp_ogt_v4f32:
122; CHECK-MVE:       @ %bb.0: @ %entry
123; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
124; CHECK-MVE-NEXT:    movs r1, #0
125; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
126; CHECK-MVE-NEXT:    it gt
127; CHECK-MVE-NEXT:    movgt r1, #1
128; CHECK-MVE-NEXT:    cmp r1, #0
129; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
130; CHECK-MVE-NEXT:    cset r1, ne
131; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
132; CHECK-MVE-NEXT:    mov.w r2, #0
133; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
134; CHECK-MVE-NEXT:    it gt
135; CHECK-MVE-NEXT:    movgt r2, #1
136; CHECK-MVE-NEXT:    cmp r2, #0
137; CHECK-MVE-NEXT:    cset r2, ne
138; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
139; CHECK-MVE-NEXT:    mov.w r3, #0
140; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
141; CHECK-MVE-NEXT:    it gt
142; CHECK-MVE-NEXT:    movgt r3, #1
143; CHECK-MVE-NEXT:    cmp r3, #0
144; CHECK-MVE-NEXT:    cset r3, ne
145; CHECK-MVE-NEXT:    movs r0, #0
146; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
147; CHECK-MVE-NEXT:    it gt
148; CHECK-MVE-NEXT:    movgt r0, #1
149; CHECK-MVE-NEXT:    cmp r0, #0
150; CHECK-MVE-NEXT:    cset r0, ne
151; CHECK-MVE-NEXT:    lsls r0, r0, #31
152; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
153; CHECK-MVE-NEXT:    lsls r0, r3, #31
154; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
155; CHECK-MVE-NEXT:    lsls r0, r2, #31
156; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
157; CHECK-MVE-NEXT:    lsls r0, r1, #31
158; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
159; CHECK-MVE-NEXT:    bx lr
160;
161; CHECK-MVEFP-LABEL: vcmp_ogt_v4f32:
162; CHECK-MVEFP:       @ %bb.0: @ %entry
163; CHECK-MVEFP-NEXT:    vcmp.f32 gt, q0, zr
164; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
165; CHECK-MVEFP-NEXT:    bx lr
166entry:
167  %c = fcmp ogt <4 x float> %src, zeroinitializer
168  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
169  ret <4 x float> %s
170}
171
172define arm_aapcs_vfpcc <4 x float> @vcmp_oge_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
173; CHECK-MVE-LABEL: vcmp_oge_v4f32:
174; CHECK-MVE:       @ %bb.0: @ %entry
175; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
176; CHECK-MVE-NEXT:    movs r1, #0
177; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
178; CHECK-MVE-NEXT:    it ge
179; CHECK-MVE-NEXT:    movge r1, #1
180; CHECK-MVE-NEXT:    cmp r1, #0
181; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
182; CHECK-MVE-NEXT:    cset r1, ne
183; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
184; CHECK-MVE-NEXT:    mov.w r2, #0
185; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
186; CHECK-MVE-NEXT:    it ge
187; CHECK-MVE-NEXT:    movge r2, #1
188; CHECK-MVE-NEXT:    cmp r2, #0
189; CHECK-MVE-NEXT:    cset r2, ne
190; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
191; CHECK-MVE-NEXT:    mov.w r3, #0
192; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
193; CHECK-MVE-NEXT:    it ge
194; CHECK-MVE-NEXT:    movge r3, #1
195; CHECK-MVE-NEXT:    cmp r3, #0
196; CHECK-MVE-NEXT:    cset r3, ne
197; CHECK-MVE-NEXT:    movs r0, #0
198; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
199; CHECK-MVE-NEXT:    it ge
200; CHECK-MVE-NEXT:    movge r0, #1
201; CHECK-MVE-NEXT:    cmp r0, #0
202; CHECK-MVE-NEXT:    cset r0, ne
203; CHECK-MVE-NEXT:    lsls r0, r0, #31
204; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
205; CHECK-MVE-NEXT:    lsls r0, r3, #31
206; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
207; CHECK-MVE-NEXT:    lsls r0, r2, #31
208; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
209; CHECK-MVE-NEXT:    lsls r0, r1, #31
210; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
211; CHECK-MVE-NEXT:    bx lr
212;
213; CHECK-MVEFP-LABEL: vcmp_oge_v4f32:
214; CHECK-MVEFP:       @ %bb.0: @ %entry
215; CHECK-MVEFP-NEXT:    vcmp.f32 ge, q0, zr
216; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
217; CHECK-MVEFP-NEXT:    bx lr
218entry:
219  %c = fcmp oge <4 x float> %src, zeroinitializer
220  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
221  ret <4 x float> %s
222}
223
224define arm_aapcs_vfpcc <4 x float> @vcmp_olt_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
225; CHECK-MVE-LABEL: vcmp_olt_v4f32:
226; CHECK-MVE:       @ %bb.0: @ %entry
227; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
228; CHECK-MVE-NEXT:    movs r1, #0
229; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
230; CHECK-MVE-NEXT:    it mi
231; CHECK-MVE-NEXT:    movmi r1, #1
232; CHECK-MVE-NEXT:    cmp r1, #0
233; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
234; CHECK-MVE-NEXT:    cset r1, ne
235; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
236; CHECK-MVE-NEXT:    mov.w r2, #0
237; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
238; CHECK-MVE-NEXT:    it mi
239; CHECK-MVE-NEXT:    movmi r2, #1
240; CHECK-MVE-NEXT:    cmp r2, #0
241; CHECK-MVE-NEXT:    cset r2, ne
242; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
243; CHECK-MVE-NEXT:    mov.w r3, #0
244; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
245; CHECK-MVE-NEXT:    it mi
246; CHECK-MVE-NEXT:    movmi r3, #1
247; CHECK-MVE-NEXT:    cmp r3, #0
248; CHECK-MVE-NEXT:    cset r3, ne
249; CHECK-MVE-NEXT:    movs r0, #0
250; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
251; CHECK-MVE-NEXT:    it mi
252; CHECK-MVE-NEXT:    movmi r0, #1
253; CHECK-MVE-NEXT:    cmp r0, #0
254; CHECK-MVE-NEXT:    cset r0, ne
255; CHECK-MVE-NEXT:    lsls r0, r0, #31
256; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
257; CHECK-MVE-NEXT:    lsls r0, r3, #31
258; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
259; CHECK-MVE-NEXT:    lsls r0, r2, #31
260; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
261; CHECK-MVE-NEXT:    lsls r0, r1, #31
262; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
263; CHECK-MVE-NEXT:    bx lr
264;
265; CHECK-MVEFP-LABEL: vcmp_olt_v4f32:
266; CHECK-MVEFP:       @ %bb.0: @ %entry
267; CHECK-MVEFP-NEXT:    vcmp.f32 lt, q0, zr
268; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
269; CHECK-MVEFP-NEXT:    bx lr
270entry:
271  %c = fcmp olt <4 x float> %src, zeroinitializer
272  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
273  ret <4 x float> %s
274}
275
276define arm_aapcs_vfpcc <4 x float> @vcmp_ole_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
277; CHECK-MVE-LABEL: vcmp_ole_v4f32:
278; CHECK-MVE:       @ %bb.0: @ %entry
279; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
280; CHECK-MVE-NEXT:    movs r1, #0
281; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
282; CHECK-MVE-NEXT:    it ls
283; CHECK-MVE-NEXT:    movls r1, #1
284; CHECK-MVE-NEXT:    cmp r1, #0
285; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
286; CHECK-MVE-NEXT:    cset r1, ne
287; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
288; CHECK-MVE-NEXT:    mov.w r2, #0
289; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
290; CHECK-MVE-NEXT:    it ls
291; CHECK-MVE-NEXT:    movls r2, #1
292; CHECK-MVE-NEXT:    cmp r2, #0
293; CHECK-MVE-NEXT:    cset r2, ne
294; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
295; CHECK-MVE-NEXT:    mov.w r3, #0
296; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
297; CHECK-MVE-NEXT:    it ls
298; CHECK-MVE-NEXT:    movls r3, #1
299; CHECK-MVE-NEXT:    cmp r3, #0
300; CHECK-MVE-NEXT:    cset r3, ne
301; CHECK-MVE-NEXT:    movs r0, #0
302; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
303; CHECK-MVE-NEXT:    it ls
304; CHECK-MVE-NEXT:    movls r0, #1
305; CHECK-MVE-NEXT:    cmp r0, #0
306; CHECK-MVE-NEXT:    cset r0, ne
307; CHECK-MVE-NEXT:    lsls r0, r0, #31
308; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
309; CHECK-MVE-NEXT:    lsls r0, r3, #31
310; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
311; CHECK-MVE-NEXT:    lsls r0, r2, #31
312; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
313; CHECK-MVE-NEXT:    lsls r0, r1, #31
314; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
315; CHECK-MVE-NEXT:    bx lr
316;
317; CHECK-MVEFP-LABEL: vcmp_ole_v4f32:
318; CHECK-MVEFP:       @ %bb.0: @ %entry
319; CHECK-MVEFP-NEXT:    vcmp.f32 le, q0, zr
320; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
321; CHECK-MVEFP-NEXT:    bx lr
322entry:
323  %c = fcmp ole <4 x float> %src, zeroinitializer
324  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
325  ret <4 x float> %s
326}
327
328define arm_aapcs_vfpcc <4 x float> @vcmp_ueq_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
329; CHECK-MVE-LABEL: vcmp_ueq_v4f32:
330; CHECK-MVE:       @ %bb.0: @ %entry
331; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
332; CHECK-MVE-NEXT:    movs r1, #0
333; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
334; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
335; CHECK-MVE-NEXT:    it eq
336; CHECK-MVE-NEXT:    moveq r1, #1
337; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
338; CHECK-MVE-NEXT:    it vs
339; CHECK-MVE-NEXT:    movvs r1, #1
340; CHECK-MVE-NEXT:    cmp r1, #0
341; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
342; CHECK-MVE-NEXT:    mov.w r2, #0
343; CHECK-MVE-NEXT:    cset r1, ne
344; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
345; CHECK-MVE-NEXT:    it eq
346; CHECK-MVE-NEXT:    moveq r2, #1
347; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
348; CHECK-MVE-NEXT:    it vs
349; CHECK-MVE-NEXT:    movvs r2, #1
350; CHECK-MVE-NEXT:    cmp r2, #0
351; CHECK-MVE-NEXT:    mov.w r3, #0
352; CHECK-MVE-NEXT:    cset r2, ne
353; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
354; CHECK-MVE-NEXT:    it eq
355; CHECK-MVE-NEXT:    moveq r3, #1
356; CHECK-MVE-NEXT:    it vs
357; CHECK-MVE-NEXT:    movvs r3, #1
358; CHECK-MVE-NEXT:    cmp r3, #0
359; CHECK-MVE-NEXT:    mov.w r0, #0
360; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
361; CHECK-MVE-NEXT:    cset r3, ne
362; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
363; CHECK-MVE-NEXT:    it eq
364; CHECK-MVE-NEXT:    moveq r0, #1
365; CHECK-MVE-NEXT:    it vs
366; CHECK-MVE-NEXT:    movvs r0, #1
367; CHECK-MVE-NEXT:    cmp r0, #0
368; CHECK-MVE-NEXT:    cset r0, ne
369; CHECK-MVE-NEXT:    lsls r0, r0, #31
370; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
371; CHECK-MVE-NEXT:    lsls r0, r3, #31
372; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
373; CHECK-MVE-NEXT:    lsls r0, r2, #31
374; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
375; CHECK-MVE-NEXT:    lsls r0, r1, #31
376; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
377; CHECK-MVE-NEXT:    bx lr
378;
379; CHECK-MVEFP-LABEL: vcmp_ueq_v4f32:
380; CHECK-MVEFP:       @ %bb.0: @ %entry
381; CHECK-MVEFP-NEXT:    vpt.f32 ge, q0, zr
382; CHECK-MVEFP-NEXT:    vcmpt.f32 le, q0, zr
383; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
384; CHECK-MVEFP-NEXT:    bx lr
385entry:
386  %c = fcmp ueq <4 x float> %src, zeroinitializer
387  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
388  ret <4 x float> %s
389}
390
391define arm_aapcs_vfpcc <4 x float> @vcmp_une_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
392; CHECK-MVE-LABEL: vcmp_une_v4f32:
393; CHECK-MVE:       @ %bb.0: @ %entry
394; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
395; CHECK-MVE-NEXT:    movs r1, #0
396; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
397; CHECK-MVE-NEXT:    it ne
398; CHECK-MVE-NEXT:    movne r1, #1
399; CHECK-MVE-NEXT:    cmp r1, #0
400; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
401; CHECK-MVE-NEXT:    cset r1, ne
402; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
403; CHECK-MVE-NEXT:    mov.w r2, #0
404; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
405; CHECK-MVE-NEXT:    it ne
406; CHECK-MVE-NEXT:    movne r2, #1
407; CHECK-MVE-NEXT:    cmp r2, #0
408; CHECK-MVE-NEXT:    cset r2, ne
409; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
410; CHECK-MVE-NEXT:    mov.w r3, #0
411; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
412; CHECK-MVE-NEXT:    it ne
413; CHECK-MVE-NEXT:    movne r3, #1
414; CHECK-MVE-NEXT:    cmp r3, #0
415; CHECK-MVE-NEXT:    cset r3, ne
416; CHECK-MVE-NEXT:    movs r0, #0
417; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
418; CHECK-MVE-NEXT:    it ne
419; CHECK-MVE-NEXT:    movne r0, #1
420; CHECK-MVE-NEXT:    cmp r0, #0
421; CHECK-MVE-NEXT:    cset r0, ne
422; CHECK-MVE-NEXT:    lsls r0, r0, #31
423; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
424; CHECK-MVE-NEXT:    lsls r0, r3, #31
425; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
426; CHECK-MVE-NEXT:    lsls r0, r2, #31
427; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
428; CHECK-MVE-NEXT:    lsls r0, r1, #31
429; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
430; CHECK-MVE-NEXT:    bx lr
431;
432; CHECK-MVEFP-LABEL: vcmp_une_v4f32:
433; CHECK-MVEFP:       @ %bb.0: @ %entry
434; CHECK-MVEFP-NEXT:    vcmp.f32 ne, q0, zr
435; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
436; CHECK-MVEFP-NEXT:    bx lr
437entry:
438  %c = fcmp une <4 x float> %src, zeroinitializer
439  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
440  ret <4 x float> %s
441}
442
443define arm_aapcs_vfpcc <4 x float> @vcmp_ugt_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
444; CHECK-MVE-LABEL: vcmp_ugt_v4f32:
445; CHECK-MVE:       @ %bb.0: @ %entry
446; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
447; CHECK-MVE-NEXT:    movs r1, #0
448; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
449; CHECK-MVE-NEXT:    it hi
450; CHECK-MVE-NEXT:    movhi r1, #1
451; CHECK-MVE-NEXT:    cmp r1, #0
452; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
453; CHECK-MVE-NEXT:    cset r1, ne
454; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
455; CHECK-MVE-NEXT:    mov.w r2, #0
456; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
457; CHECK-MVE-NEXT:    it hi
458; CHECK-MVE-NEXT:    movhi r2, #1
459; CHECK-MVE-NEXT:    cmp r2, #0
460; CHECK-MVE-NEXT:    cset r2, ne
461; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
462; CHECK-MVE-NEXT:    mov.w r3, #0
463; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
464; CHECK-MVE-NEXT:    it hi
465; CHECK-MVE-NEXT:    movhi r3, #1
466; CHECK-MVE-NEXT:    cmp r3, #0
467; CHECK-MVE-NEXT:    cset r3, ne
468; CHECK-MVE-NEXT:    movs r0, #0
469; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
470; CHECK-MVE-NEXT:    it hi
471; CHECK-MVE-NEXT:    movhi r0, #1
472; CHECK-MVE-NEXT:    cmp r0, #0
473; CHECK-MVE-NEXT:    cset r0, ne
474; CHECK-MVE-NEXT:    lsls r0, r0, #31
475; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
476; CHECK-MVE-NEXT:    lsls r0, r3, #31
477; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
478; CHECK-MVE-NEXT:    lsls r0, r2, #31
479; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
480; CHECK-MVE-NEXT:    lsls r0, r1, #31
481; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
482; CHECK-MVE-NEXT:    bx lr
483;
484; CHECK-MVEFP-LABEL: vcmp_ugt_v4f32:
485; CHECK-MVEFP:       @ %bb.0: @ %entry
486; CHECK-MVEFP-NEXT:    vcmp.f32 gt, q0, zr
487; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
488; CHECK-MVEFP-NEXT:    bx lr
489entry:
490  %c = fcmp ugt <4 x float> %src, zeroinitializer
491  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
492  ret <4 x float> %s
493}
494
495define arm_aapcs_vfpcc <4 x float> @vcmp_uge_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
496; CHECK-MVE-LABEL: vcmp_uge_v4f32:
497; CHECK-MVE:       @ %bb.0: @ %entry
498; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
499; CHECK-MVE-NEXT:    movs r1, #0
500; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
501; CHECK-MVE-NEXT:    it pl
502; CHECK-MVE-NEXT:    movpl r1, #1
503; CHECK-MVE-NEXT:    cmp r1, #0
504; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
505; CHECK-MVE-NEXT:    cset r1, ne
506; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
507; CHECK-MVE-NEXT:    mov.w r2, #0
508; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
509; CHECK-MVE-NEXT:    it pl
510; CHECK-MVE-NEXT:    movpl r2, #1
511; CHECK-MVE-NEXT:    cmp r2, #0
512; CHECK-MVE-NEXT:    cset r2, ne
513; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
514; CHECK-MVE-NEXT:    mov.w r3, #0
515; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
516; CHECK-MVE-NEXT:    it pl
517; CHECK-MVE-NEXT:    movpl r3, #1
518; CHECK-MVE-NEXT:    cmp r3, #0
519; CHECK-MVE-NEXT:    cset r3, ne
520; CHECK-MVE-NEXT:    movs r0, #0
521; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
522; CHECK-MVE-NEXT:    it pl
523; CHECK-MVE-NEXT:    movpl r0, #1
524; CHECK-MVE-NEXT:    cmp r0, #0
525; CHECK-MVE-NEXT:    cset r0, ne
526; CHECK-MVE-NEXT:    lsls r0, r0, #31
527; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
528; CHECK-MVE-NEXT:    lsls r0, r3, #31
529; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
530; CHECK-MVE-NEXT:    lsls r0, r2, #31
531; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
532; CHECK-MVE-NEXT:    lsls r0, r1, #31
533; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
534; CHECK-MVE-NEXT:    bx lr
535;
536; CHECK-MVEFP-LABEL: vcmp_uge_v4f32:
537; CHECK-MVEFP:       @ %bb.0: @ %entry
538; CHECK-MVEFP-NEXT:    vcmp.f32 ge, q0, zr
539; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
540; CHECK-MVEFP-NEXT:    bx lr
541entry:
542  %c = fcmp uge <4 x float> %src, zeroinitializer
543  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
544  ret <4 x float> %s
545}
546
547define arm_aapcs_vfpcc <4 x float> @vcmp_ult_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
548; CHECK-MVE-LABEL: vcmp_ult_v4f32:
549; CHECK-MVE:       @ %bb.0: @ %entry
550; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
551; CHECK-MVE-NEXT:    movs r1, #0
552; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
553; CHECK-MVE-NEXT:    it lt
554; CHECK-MVE-NEXT:    movlt r1, #1
555; CHECK-MVE-NEXT:    cmp r1, #0
556; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
557; CHECK-MVE-NEXT:    cset r1, ne
558; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
559; CHECK-MVE-NEXT:    mov.w r2, #0
560; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
561; CHECK-MVE-NEXT:    it lt
562; CHECK-MVE-NEXT:    movlt r2, #1
563; CHECK-MVE-NEXT:    cmp r2, #0
564; CHECK-MVE-NEXT:    cset r2, ne
565; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
566; CHECK-MVE-NEXT:    mov.w r3, #0
567; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
568; CHECK-MVE-NEXT:    it lt
569; CHECK-MVE-NEXT:    movlt r3, #1
570; CHECK-MVE-NEXT:    cmp r3, #0
571; CHECK-MVE-NEXT:    cset r3, ne
572; CHECK-MVE-NEXT:    movs r0, #0
573; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
574; CHECK-MVE-NEXT:    it lt
575; CHECK-MVE-NEXT:    movlt r0, #1
576; CHECK-MVE-NEXT:    cmp r0, #0
577; CHECK-MVE-NEXT:    cset r0, ne
578; CHECK-MVE-NEXT:    lsls r0, r0, #31
579; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
580; CHECK-MVE-NEXT:    lsls r0, r3, #31
581; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
582; CHECK-MVE-NEXT:    lsls r0, r2, #31
583; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
584; CHECK-MVE-NEXT:    lsls r0, r1, #31
585; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
586; CHECK-MVE-NEXT:    bx lr
587;
588; CHECK-MVEFP-LABEL: vcmp_ult_v4f32:
589; CHECK-MVEFP:       @ %bb.0: @ %entry
590; CHECK-MVEFP-NEXT:    vcmp.f32 lt, q0, zr
591; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
592; CHECK-MVEFP-NEXT:    bx lr
593entry:
594  %c = fcmp ult <4 x float> %src, zeroinitializer
595  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
596  ret <4 x float> %s
597}
598
599define arm_aapcs_vfpcc <4 x float> @vcmp_ule_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
600; CHECK-MVE-LABEL: vcmp_ule_v4f32:
601; CHECK-MVE:       @ %bb.0: @ %entry
602; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
603; CHECK-MVE-NEXT:    movs r1, #0
604; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
605; CHECK-MVE-NEXT:    it le
606; CHECK-MVE-NEXT:    movle r1, #1
607; CHECK-MVE-NEXT:    cmp r1, #0
608; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
609; CHECK-MVE-NEXT:    cset r1, ne
610; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
611; CHECK-MVE-NEXT:    mov.w r2, #0
612; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
613; CHECK-MVE-NEXT:    it le
614; CHECK-MVE-NEXT:    movle r2, #1
615; CHECK-MVE-NEXT:    cmp r2, #0
616; CHECK-MVE-NEXT:    cset r2, ne
617; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
618; CHECK-MVE-NEXT:    mov.w r3, #0
619; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
620; CHECK-MVE-NEXT:    it le
621; CHECK-MVE-NEXT:    movle r3, #1
622; CHECK-MVE-NEXT:    cmp r3, #0
623; CHECK-MVE-NEXT:    cset r3, ne
624; CHECK-MVE-NEXT:    movs r0, #0
625; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
626; CHECK-MVE-NEXT:    it le
627; CHECK-MVE-NEXT:    movle r0, #1
628; CHECK-MVE-NEXT:    cmp r0, #0
629; CHECK-MVE-NEXT:    cset r0, ne
630; CHECK-MVE-NEXT:    lsls r0, r0, #31
631; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
632; CHECK-MVE-NEXT:    lsls r0, r3, #31
633; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
634; CHECK-MVE-NEXT:    lsls r0, r2, #31
635; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
636; CHECK-MVE-NEXT:    lsls r0, r1, #31
637; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
638; CHECK-MVE-NEXT:    bx lr
639;
640; CHECK-MVEFP-LABEL: vcmp_ule_v4f32:
641; CHECK-MVEFP:       @ %bb.0: @ %entry
642; CHECK-MVEFP-NEXT:    vcmp.f32 le, q0, zr
643; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
644; CHECK-MVEFP-NEXT:    bx lr
645entry:
646  %c = fcmp ule <4 x float> %src, zeroinitializer
647  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
648  ret <4 x float> %s
649}
650
651define arm_aapcs_vfpcc <4 x float> @vcmp_ord_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
652; CHECK-MVE-LABEL: vcmp_ord_v4f32:
653; CHECK-MVE:       @ %bb.0: @ %entry
654; CHECK-MVE-NEXT:    vcmp.f32 s0, s0
655; CHECK-MVE-NEXT:    movs r1, #0
656; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
657; CHECK-MVE-NEXT:    it vc
658; CHECK-MVE-NEXT:    movvc r1, #1
659; CHECK-MVE-NEXT:    cmp r1, #0
660; CHECK-MVE-NEXT:    vcmp.f32 s1, s1
661; CHECK-MVE-NEXT:    cset r1, ne
662; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
663; CHECK-MVE-NEXT:    mov.w r2, #0
664; CHECK-MVE-NEXT:    vcmp.f32 s2, s2
665; CHECK-MVE-NEXT:    it vc
666; CHECK-MVE-NEXT:    movvc r2, #1
667; CHECK-MVE-NEXT:    cmp r2, #0
668; CHECK-MVE-NEXT:    cset r2, ne
669; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
670; CHECK-MVE-NEXT:    mov.w r3, #0
671; CHECK-MVE-NEXT:    vcmp.f32 s3, s3
672; CHECK-MVE-NEXT:    it vc
673; CHECK-MVE-NEXT:    movvc r3, #1
674; CHECK-MVE-NEXT:    cmp r3, #0
675; CHECK-MVE-NEXT:    cset r3, ne
676; CHECK-MVE-NEXT:    movs r0, #0
677; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
678; CHECK-MVE-NEXT:    it vc
679; CHECK-MVE-NEXT:    movvc r0, #1
680; CHECK-MVE-NEXT:    cmp r0, #0
681; CHECK-MVE-NEXT:    cset r0, ne
682; CHECK-MVE-NEXT:    lsls r0, r0, #31
683; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
684; CHECK-MVE-NEXT:    lsls r0, r3, #31
685; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
686; CHECK-MVE-NEXT:    lsls r0, r2, #31
687; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
688; CHECK-MVE-NEXT:    lsls r0, r1, #31
689; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
690; CHECK-MVE-NEXT:    bx lr
691;
692; CHECK-MVEFP-LABEL: vcmp_ord_v4f32:
693; CHECK-MVEFP:       @ %bb.0: @ %entry
694; CHECK-MVEFP-NEXT:    vpt.f32 ge, q0, zr
695; CHECK-MVEFP-NEXT:    vcmpt.f32 lt, q0, zr
696; CHECK-MVEFP-NEXT:    vpsel q0, q2, q1
697; CHECK-MVEFP-NEXT:    bx lr
698entry:
699  %c = fcmp ord <4 x float> %src, zeroinitializer
700  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
701  ret <4 x float> %s
702}
703
704define arm_aapcs_vfpcc <4 x float> @vcmp_uno_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
705; CHECK-MVE-LABEL: vcmp_uno_v4f32:
706; CHECK-MVE:       @ %bb.0: @ %entry
707; CHECK-MVE-NEXT:    vcmp.f32 s0, s0
708; CHECK-MVE-NEXT:    movs r1, #0
709; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
710; CHECK-MVE-NEXT:    it vs
711; CHECK-MVE-NEXT:    movvs r1, #1
712; CHECK-MVE-NEXT:    cmp r1, #0
713; CHECK-MVE-NEXT:    vcmp.f32 s1, s1
714; CHECK-MVE-NEXT:    cset r1, ne
715; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
716; CHECK-MVE-NEXT:    mov.w r2, #0
717; CHECK-MVE-NEXT:    vcmp.f32 s2, s2
718; CHECK-MVE-NEXT:    it vs
719; CHECK-MVE-NEXT:    movvs r2, #1
720; CHECK-MVE-NEXT:    cmp r2, #0
721; CHECK-MVE-NEXT:    cset r2, ne
722; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
723; CHECK-MVE-NEXT:    mov.w r3, #0
724; CHECK-MVE-NEXT:    vcmp.f32 s3, s3
725; CHECK-MVE-NEXT:    it vs
726; CHECK-MVE-NEXT:    movvs r3, #1
727; CHECK-MVE-NEXT:    cmp r3, #0
728; CHECK-MVE-NEXT:    cset r3, ne
729; CHECK-MVE-NEXT:    movs r0, #0
730; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
731; CHECK-MVE-NEXT:    it vs
732; CHECK-MVE-NEXT:    movvs r0, #1
733; CHECK-MVE-NEXT:    cmp r0, #0
734; CHECK-MVE-NEXT:    cset r0, ne
735; CHECK-MVE-NEXT:    lsls r0, r0, #31
736; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
737; CHECK-MVE-NEXT:    lsls r0, r3, #31
738; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
739; CHECK-MVE-NEXT:    lsls r0, r2, #31
740; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
741; CHECK-MVE-NEXT:    lsls r0, r1, #31
742; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
743; CHECK-MVE-NEXT:    bx lr
744;
745; CHECK-MVEFP-LABEL: vcmp_uno_v4f32:
746; CHECK-MVEFP:       @ %bb.0: @ %entry
747; CHECK-MVEFP-NEXT:    vpt.f32 ge, q0, zr
748; CHECK-MVEFP-NEXT:    vcmpt.f32 lt, q0, zr
749; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
750; CHECK-MVEFP-NEXT:    bx lr
751entry:
752  %c = fcmp uno <4 x float> %src, zeroinitializer
753  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
754  ret <4 x float> %s
755}
756
757
758
759define arm_aapcs_vfpcc <8 x half> @vcmp_oeq_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
760; CHECK-MVE-LABEL: vcmp_oeq_v8f16:
761; CHECK-MVE:       @ %bb.0: @ %entry
762; CHECK-MVE-NEXT:    .vsave {d8, d9}
763; CHECK-MVE-NEXT:    vpush {d8, d9}
764; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
765; CHECK-MVE-NEXT:    movs r1, #0
766; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
767; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
768; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
769; CHECK-MVE-NEXT:    it eq
770; CHECK-MVE-NEXT:    moveq r1, #1
771; CHECK-MVE-NEXT:    cmp r1, #0
772; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
773; CHECK-MVE-NEXT:    cset r1, ne
774; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
775; CHECK-MVE-NEXT:    lsls r1, r1, #31
776; CHECK-MVE-NEXT:    mov.w r2, #0
777; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
778; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
779; CHECK-MVE-NEXT:    it eq
780; CHECK-MVE-NEXT:    moveq r2, #1
781; CHECK-MVE-NEXT:    cmp r2, #0
782; CHECK-MVE-NEXT:    cset r2, ne
783; CHECK-MVE-NEXT:    vmov r1, s12
784; CHECK-MVE-NEXT:    lsls r2, r2, #31
785; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
786; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
787; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
788; CHECK-MVE-NEXT:    vmov r2, s12
789; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
790; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
791; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
792; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
793; CHECK-MVE-NEXT:    mov.w r1, #0
794; CHECK-MVE-NEXT:    it eq
795; CHECK-MVE-NEXT:    moveq r1, #1
796; CHECK-MVE-NEXT:    cmp r1, #0
797; CHECK-MVE-NEXT:    cset r1, ne
798; CHECK-MVE-NEXT:    movs r0, #0
799; CHECK-MVE-NEXT:    lsls r1, r1, #31
800; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
801; CHECK-MVE-NEXT:    vmov r1, s16
802; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
803; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
804; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
805; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
806; CHECK-MVE-NEXT:    mov.w r1, #0
807; CHECK-MVE-NEXT:    it eq
808; CHECK-MVE-NEXT:    moveq r1, #1
809; CHECK-MVE-NEXT:    cmp r1, #0
810; CHECK-MVE-NEXT:    cset r1, ne
811; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
812; CHECK-MVE-NEXT:    lsls r1, r1, #31
813; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
814; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
815; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
816; CHECK-MVE-NEXT:    vmov r1, s16
817; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
818; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
819; CHECK-MVE-NEXT:    mov.w r1, #0
820; CHECK-MVE-NEXT:    it eq
821; CHECK-MVE-NEXT:    moveq r1, #1
822; CHECK-MVE-NEXT:    cmp r1, #0
823; CHECK-MVE-NEXT:    cset r1, ne
824; CHECK-MVE-NEXT:    lsls r1, r1, #31
825; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
826; CHECK-MVE-NEXT:    vmov r1, s16
827; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
828; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
829; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
830; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
831; CHECK-MVE-NEXT:    mov.w r1, #0
832; CHECK-MVE-NEXT:    it eq
833; CHECK-MVE-NEXT:    moveq r1, #1
834; CHECK-MVE-NEXT:    cmp r1, #0
835; CHECK-MVE-NEXT:    cset r1, ne
836; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
837; CHECK-MVE-NEXT:    lsls r1, r1, #31
838; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
839; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
840; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
841; CHECK-MVE-NEXT:    vmov r1, s16
842; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
843; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
844; CHECK-MVE-NEXT:    mov.w r1, #0
845; CHECK-MVE-NEXT:    it eq
846; CHECK-MVE-NEXT:    moveq r1, #1
847; CHECK-MVE-NEXT:    cmp r1, #0
848; CHECK-MVE-NEXT:    cset r1, ne
849; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
850; CHECK-MVE-NEXT:    lsls r1, r1, #31
851; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
852; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
853; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
854; CHECK-MVE-NEXT:    it eq
855; CHECK-MVE-NEXT:    moveq r0, #1
856; CHECK-MVE-NEXT:    cmp r0, #0
857; CHECK-MVE-NEXT:    cset r0, ne
858; CHECK-MVE-NEXT:    vmov r1, s16
859; CHECK-MVE-NEXT:    lsls r0, r0, #31
860; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
861; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
862; CHECK-MVE-NEXT:    vmov r0, s0
863; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
864; CHECK-MVE-NEXT:    vmov q0, q3
865; CHECK-MVE-NEXT:    vpop {d8, d9}
866; CHECK-MVE-NEXT:    bx lr
867;
868; CHECK-MVEFP-LABEL: vcmp_oeq_v8f16:
869; CHECK-MVEFP:       @ %bb.0: @ %entry
870; CHECK-MVEFP-NEXT:    vcmp.f16 eq, q0, zr
871; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
872; CHECK-MVEFP-NEXT:    bx lr
873entry:
874  %c = fcmp oeq <8 x half> %src, zeroinitializer
875  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
876  ret <8 x half> %s
877}
878
879define arm_aapcs_vfpcc <8 x half> @vcmp_one_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
880; CHECK-MVE-LABEL: vcmp_one_v8f16:
881; CHECK-MVE:       @ %bb.0: @ %entry
882; CHECK-MVE-NEXT:    .vsave {d8, d9}
883; CHECK-MVE-NEXT:    vpush {d8, d9}
884; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
885; CHECK-MVE-NEXT:    movs r1, #0
886; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
887; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
888; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
889; CHECK-MVE-NEXT:    it mi
890; CHECK-MVE-NEXT:    movmi r1, #1
891; CHECK-MVE-NEXT:    it gt
892; CHECK-MVE-NEXT:    movgt r1, #1
893; CHECK-MVE-NEXT:    cmp r1, #0
894; CHECK-MVE-NEXT:    cset r1, ne
895; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
896; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
897; CHECK-MVE-NEXT:    lsls r1, r1, #31
898; CHECK-MVE-NEXT:    mov.w r2, #0
899; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
900; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
901; CHECK-MVE-NEXT:    it mi
902; CHECK-MVE-NEXT:    movmi r2, #1
903; CHECK-MVE-NEXT:    it gt
904; CHECK-MVE-NEXT:    movgt r2, #1
905; CHECK-MVE-NEXT:    cmp r2, #0
906; CHECK-MVE-NEXT:    cset r2, ne
907; CHECK-MVE-NEXT:    vmov r1, s12
908; CHECK-MVE-NEXT:    lsls r2, r2, #31
909; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
910; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
911; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
912; CHECK-MVE-NEXT:    vmov r2, s12
913; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
914; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
915; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
916; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
917; CHECK-MVE-NEXT:    mov.w r1, #0
918; CHECK-MVE-NEXT:    it mi
919; CHECK-MVE-NEXT:    movmi r1, #1
920; CHECK-MVE-NEXT:    mov.w r0, #0
921; CHECK-MVE-NEXT:    it gt
922; CHECK-MVE-NEXT:    movgt r1, #1
923; CHECK-MVE-NEXT:    cmp r1, #0
924; CHECK-MVE-NEXT:    cset r1, ne
925; CHECK-MVE-NEXT:    lsls r1, r1, #31
926; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
927; CHECK-MVE-NEXT:    vmov r1, s16
928; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
929; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
930; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
931; CHECK-MVE-NEXT:    movs r1, #0
932; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
933; CHECK-MVE-NEXT:    it mi
934; CHECK-MVE-NEXT:    movmi r1, #1
935; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
936; CHECK-MVE-NEXT:    it gt
937; CHECK-MVE-NEXT:    movgt r1, #1
938; CHECK-MVE-NEXT:    cmp r1, #0
939; CHECK-MVE-NEXT:    cset r1, ne
940; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
941; CHECK-MVE-NEXT:    lsls r1, r1, #31
942; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
943; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
944; CHECK-MVE-NEXT:    vmov r1, s16
945; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
946; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
947; CHECK-MVE-NEXT:    mov.w r1, #0
948; CHECK-MVE-NEXT:    it mi
949; CHECK-MVE-NEXT:    movmi r1, #1
950; CHECK-MVE-NEXT:    it gt
951; CHECK-MVE-NEXT:    movgt r1, #1
952; CHECK-MVE-NEXT:    cmp r1, #0
953; CHECK-MVE-NEXT:    cset r1, ne
954; CHECK-MVE-NEXT:    lsls r1, r1, #31
955; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
956; CHECK-MVE-NEXT:    vmov r1, s16
957; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
958; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
959; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
960; CHECK-MVE-NEXT:    movs r1, #0
961; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
962; CHECK-MVE-NEXT:    it mi
963; CHECK-MVE-NEXT:    movmi r1, #1
964; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
965; CHECK-MVE-NEXT:    it gt
966; CHECK-MVE-NEXT:    movgt r1, #1
967; CHECK-MVE-NEXT:    cmp r1, #0
968; CHECK-MVE-NEXT:    cset r1, ne
969; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
970; CHECK-MVE-NEXT:    lsls r1, r1, #31
971; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
972; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
973; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
974; CHECK-MVE-NEXT:    vmov r1, s16
975; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
976; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
977; CHECK-MVE-NEXT:    mov.w r1, #0
978; CHECK-MVE-NEXT:    it mi
979; CHECK-MVE-NEXT:    movmi r1, #1
980; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
981; CHECK-MVE-NEXT:    it gt
982; CHECK-MVE-NEXT:    movgt r1, #1
983; CHECK-MVE-NEXT:    cmp r1, #0
984; CHECK-MVE-NEXT:    cset r1, ne
985; CHECK-MVE-NEXT:    lsls r1, r1, #31
986; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
987; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
988; CHECK-MVE-NEXT:    it mi
989; CHECK-MVE-NEXT:    movmi r0, #1
990; CHECK-MVE-NEXT:    vmov r1, s16
991; CHECK-MVE-NEXT:    it gt
992; CHECK-MVE-NEXT:    movgt r0, #1
993; CHECK-MVE-NEXT:    cmp r0, #0
994; CHECK-MVE-NEXT:    cset r0, ne
995; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
996; CHECK-MVE-NEXT:    lsls r0, r0, #31
997; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
998; CHECK-MVE-NEXT:    vmov r0, s0
999; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
1000; CHECK-MVE-NEXT:    vmov q0, q3
1001; CHECK-MVE-NEXT:    vpop {d8, d9}
1002; CHECK-MVE-NEXT:    bx lr
1003;
1004; CHECK-MVEFP-LABEL: vcmp_one_v8f16:
1005; CHECK-MVEFP:       @ %bb.0: @ %entry
1006; CHECK-MVEFP-NEXT:    vpt.f16 ge, q0, zr
1007; CHECK-MVEFP-NEXT:    vcmpt.f16 le, q0, zr
1008; CHECK-MVEFP-NEXT:    vpsel q0, q2, q1
1009; CHECK-MVEFP-NEXT:    bx lr
1010entry:
1011  %c = fcmp one <8 x half> %src, zeroinitializer
1012  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
1013  ret <8 x half> %s
1014}
1015
1016define arm_aapcs_vfpcc <8 x half> @vcmp_ogt_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
1017; CHECK-MVE-LABEL: vcmp_ogt_v8f16:
1018; CHECK-MVE:       @ %bb.0: @ %entry
1019; CHECK-MVE-NEXT:    .vsave {d8, d9}
1020; CHECK-MVE-NEXT:    vpush {d8, d9}
1021; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
1022; CHECK-MVE-NEXT:    movs r1, #0
1023; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
1024; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
1025; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1026; CHECK-MVE-NEXT:    it gt
1027; CHECK-MVE-NEXT:    movgt r1, #1
1028; CHECK-MVE-NEXT:    cmp r1, #0
1029; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
1030; CHECK-MVE-NEXT:    cset r1, ne
1031; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
1032; CHECK-MVE-NEXT:    lsls r1, r1, #31
1033; CHECK-MVE-NEXT:    mov.w r2, #0
1034; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
1035; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1036; CHECK-MVE-NEXT:    it gt
1037; CHECK-MVE-NEXT:    movgt r2, #1
1038; CHECK-MVE-NEXT:    cmp r2, #0
1039; CHECK-MVE-NEXT:    cset r2, ne
1040; CHECK-MVE-NEXT:    vmov r1, s12
1041; CHECK-MVE-NEXT:    lsls r2, r2, #31
1042; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
1043; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
1044; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1045; CHECK-MVE-NEXT:    vmov r2, s12
1046; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
1047; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
1048; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
1049; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
1050; CHECK-MVE-NEXT:    mov.w r1, #0
1051; CHECK-MVE-NEXT:    it gt
1052; CHECK-MVE-NEXT:    movgt r1, #1
1053; CHECK-MVE-NEXT:    cmp r1, #0
1054; CHECK-MVE-NEXT:    cset r1, ne
1055; CHECK-MVE-NEXT:    movs r0, #0
1056; CHECK-MVE-NEXT:    lsls r1, r1, #31
1057; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
1058; CHECK-MVE-NEXT:    vmov r1, s16
1059; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
1060; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
1061; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
1062; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1063; CHECK-MVE-NEXT:    mov.w r1, #0
1064; CHECK-MVE-NEXT:    it gt
1065; CHECK-MVE-NEXT:    movgt r1, #1
1066; CHECK-MVE-NEXT:    cmp r1, #0
1067; CHECK-MVE-NEXT:    cset r1, ne
1068; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
1069; CHECK-MVE-NEXT:    lsls r1, r1, #31
1070; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
1071; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
1072; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1073; CHECK-MVE-NEXT:    vmov r1, s16
1074; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
1075; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
1076; CHECK-MVE-NEXT:    mov.w r1, #0
1077; CHECK-MVE-NEXT:    it gt
1078; CHECK-MVE-NEXT:    movgt r1, #1
1079; CHECK-MVE-NEXT:    cmp r1, #0
1080; CHECK-MVE-NEXT:    cset r1, ne
1081; CHECK-MVE-NEXT:    lsls r1, r1, #31
1082; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
1083; CHECK-MVE-NEXT:    vmov r1, s16
1084; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
1085; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
1086; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
1087; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1088; CHECK-MVE-NEXT:    mov.w r1, #0
1089; CHECK-MVE-NEXT:    it gt
1090; CHECK-MVE-NEXT:    movgt r1, #1
1091; CHECK-MVE-NEXT:    cmp r1, #0
1092; CHECK-MVE-NEXT:    cset r1, ne
1093; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
1094; CHECK-MVE-NEXT:    lsls r1, r1, #31
1095; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
1096; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
1097; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1098; CHECK-MVE-NEXT:    vmov r1, s16
1099; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
1100; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
1101; CHECK-MVE-NEXT:    mov.w r1, #0
1102; CHECK-MVE-NEXT:    it gt
1103; CHECK-MVE-NEXT:    movgt r1, #1
1104; CHECK-MVE-NEXT:    cmp r1, #0
1105; CHECK-MVE-NEXT:    cset r1, ne
1106; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
1107; CHECK-MVE-NEXT:    lsls r1, r1, #31
1108; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
1109; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
1110; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1111; CHECK-MVE-NEXT:    it gt
1112; CHECK-MVE-NEXT:    movgt r0, #1
1113; CHECK-MVE-NEXT:    cmp r0, #0
1114; CHECK-MVE-NEXT:    cset r0, ne
1115; CHECK-MVE-NEXT:    vmov r1, s16
1116; CHECK-MVE-NEXT:    lsls r0, r0, #31
1117; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
1118; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
1119; CHECK-MVE-NEXT:    vmov r0, s0
1120; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
1121; CHECK-MVE-NEXT:    vmov q0, q3
1122; CHECK-MVE-NEXT:    vpop {d8, d9}
1123; CHECK-MVE-NEXT:    bx lr
1124;
1125; CHECK-MVEFP-LABEL: vcmp_ogt_v8f16:
1126; CHECK-MVEFP:       @ %bb.0: @ %entry
1127; CHECK-MVEFP-NEXT:    vcmp.f16 gt, q0, zr
1128; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
1129; CHECK-MVEFP-NEXT:    bx lr
1130entry:
1131  %c = fcmp ogt <8 x half> %src, zeroinitializer
1132  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
1133  ret <8 x half> %s
1134}
1135
1136define arm_aapcs_vfpcc <8 x half> @vcmp_oge_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
1137; CHECK-MVE-LABEL: vcmp_oge_v8f16:
1138; CHECK-MVE:       @ %bb.0: @ %entry
1139; CHECK-MVE-NEXT:    .vsave {d8, d9}
1140; CHECK-MVE-NEXT:    vpush {d8, d9}
1141; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
1142; CHECK-MVE-NEXT:    movs r1, #0
1143; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
1144; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
1145; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1146; CHECK-MVE-NEXT:    it ge
1147; CHECK-MVE-NEXT:    movge r1, #1
1148; CHECK-MVE-NEXT:    cmp r1, #0
1149; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
1150; CHECK-MVE-NEXT:    cset r1, ne
1151; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
1152; CHECK-MVE-NEXT:    lsls r1, r1, #31
1153; CHECK-MVE-NEXT:    mov.w r2, #0
1154; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
1155; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1156; CHECK-MVE-NEXT:    it ge
1157; CHECK-MVE-NEXT:    movge r2, #1
1158; CHECK-MVE-NEXT:    cmp r2, #0
1159; CHECK-MVE-NEXT:    cset r2, ne
1160; CHECK-MVE-NEXT:    vmov r1, s12
1161; CHECK-MVE-NEXT:    lsls r2, r2, #31
1162; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
1163; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
1164; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1165; CHECK-MVE-NEXT:    vmov r2, s12
1166; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
1167; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
1168; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
1169; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
1170; CHECK-MVE-NEXT:    mov.w r1, #0
1171; CHECK-MVE-NEXT:    it ge
1172; CHECK-MVE-NEXT:    movge r1, #1
1173; CHECK-MVE-NEXT:    cmp r1, #0
1174; CHECK-MVE-NEXT:    cset r1, ne
1175; CHECK-MVE-NEXT:    movs r0, #0
1176; CHECK-MVE-NEXT:    lsls r1, r1, #31
1177; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
1178; CHECK-MVE-NEXT:    vmov r1, s16
1179; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
1180; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
1181; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
1182; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1183; CHECK-MVE-NEXT:    mov.w r1, #0
1184; CHECK-MVE-NEXT:    it ge
1185; CHECK-MVE-NEXT:    movge r1, #1
1186; CHECK-MVE-NEXT:    cmp r1, #0
1187; CHECK-MVE-NEXT:    cset r1, ne
1188; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
1189; CHECK-MVE-NEXT:    lsls r1, r1, #31
1190; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
1191; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
1192; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1193; CHECK-MVE-NEXT:    vmov r1, s16
1194; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
1195; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
1196; CHECK-MVE-NEXT:    mov.w r1, #0
1197; CHECK-MVE-NEXT:    it ge
1198; CHECK-MVE-NEXT:    movge r1, #1
1199; CHECK-MVE-NEXT:    cmp r1, #0
1200; CHECK-MVE-NEXT:    cset r1, ne
1201; CHECK-MVE-NEXT:    lsls r1, r1, #31
1202; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
1203; CHECK-MVE-NEXT:    vmov r1, s16
1204; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
1205; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
1206; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
1207; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1208; CHECK-MVE-NEXT:    mov.w r1, #0
1209; CHECK-MVE-NEXT:    it ge
1210; CHECK-MVE-NEXT:    movge r1, #1
1211; CHECK-MVE-NEXT:    cmp r1, #0
1212; CHECK-MVE-NEXT:    cset r1, ne
1213; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
1214; CHECK-MVE-NEXT:    lsls r1, r1, #31
1215; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
1216; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
1217; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1218; CHECK-MVE-NEXT:    vmov r1, s16
1219; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
1220; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
1221; CHECK-MVE-NEXT:    mov.w r1, #0
1222; CHECK-MVE-NEXT:    it ge
1223; CHECK-MVE-NEXT:    movge r1, #1
1224; CHECK-MVE-NEXT:    cmp r1, #0
1225; CHECK-MVE-NEXT:    cset r1, ne
1226; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
1227; CHECK-MVE-NEXT:    lsls r1, r1, #31
1228; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
1229; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
1230; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1231; CHECK-MVE-NEXT:    it ge
1232; CHECK-MVE-NEXT:    movge r0, #1
1233; CHECK-MVE-NEXT:    cmp r0, #0
1234; CHECK-MVE-NEXT:    cset r0, ne
1235; CHECK-MVE-NEXT:    vmov r1, s16
1236; CHECK-MVE-NEXT:    lsls r0, r0, #31
1237; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
1238; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
1239; CHECK-MVE-NEXT:    vmov r0, s0
1240; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
1241; CHECK-MVE-NEXT:    vmov q0, q3
1242; CHECK-MVE-NEXT:    vpop {d8, d9}
1243; CHECK-MVE-NEXT:    bx lr
1244;
1245; CHECK-MVEFP-LABEL: vcmp_oge_v8f16:
1246; CHECK-MVEFP:       @ %bb.0: @ %entry
1247; CHECK-MVEFP-NEXT:    vcmp.f16 ge, q0, zr
1248; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
1249; CHECK-MVEFP-NEXT:    bx lr
1250entry:
1251  %c = fcmp oge <8 x half> %src, zeroinitializer
1252  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
1253  ret <8 x half> %s
1254}
1255
1256define arm_aapcs_vfpcc <8 x half> @vcmp_olt_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
1257; CHECK-MVE-LABEL: vcmp_olt_v8f16:
1258; CHECK-MVE:       @ %bb.0: @ %entry
1259; CHECK-MVE-NEXT:    .vsave {d8, d9}
1260; CHECK-MVE-NEXT:    vpush {d8, d9}
1261; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
1262; CHECK-MVE-NEXT:    movs r1, #0
1263; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
1264; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
1265; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1266; CHECK-MVE-NEXT:    it mi
1267; CHECK-MVE-NEXT:    movmi r1, #1
1268; CHECK-MVE-NEXT:    cmp r1, #0
1269; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
1270; CHECK-MVE-NEXT:    cset r1, ne
1271; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
1272; CHECK-MVE-NEXT:    lsls r1, r1, #31
1273; CHECK-MVE-NEXT:    mov.w r2, #0
1274; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
1275; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1276; CHECK-MVE-NEXT:    it mi
1277; CHECK-MVE-NEXT:    movmi r2, #1
1278; CHECK-MVE-NEXT:    cmp r2, #0
1279; CHECK-MVE-NEXT:    cset r2, ne
1280; CHECK-MVE-NEXT:    vmov r1, s12
1281; CHECK-MVE-NEXT:    lsls r2, r2, #31
1282; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
1283; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
1284; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1285; CHECK-MVE-NEXT:    vmov r2, s12
1286; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
1287; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
1288; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
1289; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
1290; CHECK-MVE-NEXT:    mov.w r1, #0
1291; CHECK-MVE-NEXT:    it mi
1292; CHECK-MVE-NEXT:    movmi r1, #1
1293; CHECK-MVE-NEXT:    cmp r1, #0
1294; CHECK-MVE-NEXT:    cset r1, ne
1295; CHECK-MVE-NEXT:    movs r0, #0
1296; CHECK-MVE-NEXT:    lsls r1, r1, #31
1297; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
1298; CHECK-MVE-NEXT:    vmov r1, s16
1299; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
1300; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
1301; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
1302; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1303; CHECK-MVE-NEXT:    mov.w r1, #0
1304; CHECK-MVE-NEXT:    it mi
1305; CHECK-MVE-NEXT:    movmi r1, #1
1306; CHECK-MVE-NEXT:    cmp r1, #0
1307; CHECK-MVE-NEXT:    cset r1, ne
1308; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
1309; CHECK-MVE-NEXT:    lsls r1, r1, #31
1310; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
1311; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
1312; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1313; CHECK-MVE-NEXT:    vmov r1, s16
1314; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
1315; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
1316; CHECK-MVE-NEXT:    mov.w r1, #0
1317; CHECK-MVE-NEXT:    it mi
1318; CHECK-MVE-NEXT:    movmi r1, #1
1319; CHECK-MVE-NEXT:    cmp r1, #0
1320; CHECK-MVE-NEXT:    cset r1, ne
1321; CHECK-MVE-NEXT:    lsls r1, r1, #31
1322; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
1323; CHECK-MVE-NEXT:    vmov r1, s16
1324; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
1325; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
1326; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
1327; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1328; CHECK-MVE-NEXT:    mov.w r1, #0
1329; CHECK-MVE-NEXT:    it mi
1330; CHECK-MVE-NEXT:    movmi r1, #1
1331; CHECK-MVE-NEXT:    cmp r1, #0
1332; CHECK-MVE-NEXT:    cset r1, ne
1333; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
1334; CHECK-MVE-NEXT:    lsls r1, r1, #31
1335; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
1336; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
1337; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1338; CHECK-MVE-NEXT:    vmov r1, s16
1339; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
1340; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
1341; CHECK-MVE-NEXT:    mov.w r1, #0
1342; CHECK-MVE-NEXT:    it mi
1343; CHECK-MVE-NEXT:    movmi r1, #1
1344; CHECK-MVE-NEXT:    cmp r1, #0
1345; CHECK-MVE-NEXT:    cset r1, ne
1346; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
1347; CHECK-MVE-NEXT:    lsls r1, r1, #31
1348; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
1349; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
1350; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1351; CHECK-MVE-NEXT:    it mi
1352; CHECK-MVE-NEXT:    movmi r0, #1
1353; CHECK-MVE-NEXT:    cmp r0, #0
1354; CHECK-MVE-NEXT:    cset r0, ne
1355; CHECK-MVE-NEXT:    vmov r1, s16
1356; CHECK-MVE-NEXT:    lsls r0, r0, #31
1357; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
1358; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
1359; CHECK-MVE-NEXT:    vmov r0, s0
1360; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
1361; CHECK-MVE-NEXT:    vmov q0, q3
1362; CHECK-MVE-NEXT:    vpop {d8, d9}
1363; CHECK-MVE-NEXT:    bx lr
1364;
1365; CHECK-MVEFP-LABEL: vcmp_olt_v8f16:
1366; CHECK-MVEFP:       @ %bb.0: @ %entry
1367; CHECK-MVEFP-NEXT:    vcmp.f16 lt, q0, zr
1368; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
1369; CHECK-MVEFP-NEXT:    bx lr
1370entry:
1371  %c = fcmp olt <8 x half> %src, zeroinitializer
1372  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
1373  ret <8 x half> %s
1374}
1375
1376define arm_aapcs_vfpcc <8 x half> @vcmp_ole_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
1377; CHECK-MVE-LABEL: vcmp_ole_v8f16:
1378; CHECK-MVE:       @ %bb.0: @ %entry
1379; CHECK-MVE-NEXT:    .vsave {d8, d9}
1380; CHECK-MVE-NEXT:    vpush {d8, d9}
1381; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
1382; CHECK-MVE-NEXT:    movs r1, #0
1383; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
1384; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
1385; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1386; CHECK-MVE-NEXT:    it ls
1387; CHECK-MVE-NEXT:    movls r1, #1
1388; CHECK-MVE-NEXT:    cmp r1, #0
1389; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
1390; CHECK-MVE-NEXT:    cset r1, ne
1391; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
1392; CHECK-MVE-NEXT:    lsls r1, r1, #31
1393; CHECK-MVE-NEXT:    mov.w r2, #0
1394; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
1395; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1396; CHECK-MVE-NEXT:    it ls
1397; CHECK-MVE-NEXT:    movls r2, #1
1398; CHECK-MVE-NEXT:    cmp r2, #0
1399; CHECK-MVE-NEXT:    cset r2, ne
1400; CHECK-MVE-NEXT:    vmov r1, s12
1401; CHECK-MVE-NEXT:    lsls r2, r2, #31
1402; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
1403; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
1404; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1405; CHECK-MVE-NEXT:    vmov r2, s12
1406; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
1407; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
1408; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
1409; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
1410; CHECK-MVE-NEXT:    mov.w r1, #0
1411; CHECK-MVE-NEXT:    it ls
1412; CHECK-MVE-NEXT:    movls r1, #1
1413; CHECK-MVE-NEXT:    cmp r1, #0
1414; CHECK-MVE-NEXT:    cset r1, ne
1415; CHECK-MVE-NEXT:    movs r0, #0
1416; CHECK-MVE-NEXT:    lsls r1, r1, #31
1417; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
1418; CHECK-MVE-NEXT:    vmov r1, s16
1419; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
1420; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
1421; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
1422; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1423; CHECK-MVE-NEXT:    mov.w r1, #0
1424; CHECK-MVE-NEXT:    it ls
1425; CHECK-MVE-NEXT:    movls r1, #1
1426; CHECK-MVE-NEXT:    cmp r1, #0
1427; CHECK-MVE-NEXT:    cset r1, ne
1428; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
1429; CHECK-MVE-NEXT:    lsls r1, r1, #31
1430; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
1431; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
1432; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1433; CHECK-MVE-NEXT:    vmov r1, s16
1434; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
1435; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
1436; CHECK-MVE-NEXT:    mov.w r1, #0
1437; CHECK-MVE-NEXT:    it ls
1438; CHECK-MVE-NEXT:    movls r1, #1
1439; CHECK-MVE-NEXT:    cmp r1, #0
1440; CHECK-MVE-NEXT:    cset r1, ne
1441; CHECK-MVE-NEXT:    lsls r1, r1, #31
1442; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
1443; CHECK-MVE-NEXT:    vmov r1, s16
1444; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
1445; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
1446; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
1447; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1448; CHECK-MVE-NEXT:    mov.w r1, #0
1449; CHECK-MVE-NEXT:    it ls
1450; CHECK-MVE-NEXT:    movls r1, #1
1451; CHECK-MVE-NEXT:    cmp r1, #0
1452; CHECK-MVE-NEXT:    cset r1, ne
1453; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
1454; CHECK-MVE-NEXT:    lsls r1, r1, #31
1455; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
1456; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
1457; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1458; CHECK-MVE-NEXT:    vmov r1, s16
1459; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
1460; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
1461; CHECK-MVE-NEXT:    mov.w r1, #0
1462; CHECK-MVE-NEXT:    it ls
1463; CHECK-MVE-NEXT:    movls r1, #1
1464; CHECK-MVE-NEXT:    cmp r1, #0
1465; CHECK-MVE-NEXT:    cset r1, ne
1466; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
1467; CHECK-MVE-NEXT:    lsls r1, r1, #31
1468; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
1469; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
1470; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1471; CHECK-MVE-NEXT:    it ls
1472; CHECK-MVE-NEXT:    movls r0, #1
1473; CHECK-MVE-NEXT:    cmp r0, #0
1474; CHECK-MVE-NEXT:    cset r0, ne
1475; CHECK-MVE-NEXT:    vmov r1, s16
1476; CHECK-MVE-NEXT:    lsls r0, r0, #31
1477; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
1478; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
1479; CHECK-MVE-NEXT:    vmov r0, s0
1480; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
1481; CHECK-MVE-NEXT:    vmov q0, q3
1482; CHECK-MVE-NEXT:    vpop {d8, d9}
1483; CHECK-MVE-NEXT:    bx lr
1484;
1485; CHECK-MVEFP-LABEL: vcmp_ole_v8f16:
1486; CHECK-MVEFP:       @ %bb.0: @ %entry
1487; CHECK-MVEFP-NEXT:    vcmp.f16 le, q0, zr
1488; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
1489; CHECK-MVEFP-NEXT:    bx lr
1490entry:
1491  %c = fcmp ole <8 x half> %src, zeroinitializer
1492  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
1493  ret <8 x half> %s
1494}
1495
1496define arm_aapcs_vfpcc <8 x half> @vcmp_ueq_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
1497; CHECK-MVE-LABEL: vcmp_ueq_v8f16:
1498; CHECK-MVE:       @ %bb.0: @ %entry
1499; CHECK-MVE-NEXT:    .vsave {d8, d9}
1500; CHECK-MVE-NEXT:    vpush {d8, d9}
1501; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
1502; CHECK-MVE-NEXT:    movs r1, #0
1503; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
1504; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
1505; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1506; CHECK-MVE-NEXT:    it eq
1507; CHECK-MVE-NEXT:    moveq r1, #1
1508; CHECK-MVE-NEXT:    it vs
1509; CHECK-MVE-NEXT:    movvs r1, #1
1510; CHECK-MVE-NEXT:    cmp r1, #0
1511; CHECK-MVE-NEXT:    cset r1, ne
1512; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
1513; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
1514; CHECK-MVE-NEXT:    lsls r1, r1, #31
1515; CHECK-MVE-NEXT:    mov.w r2, #0
1516; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
1517; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1518; CHECK-MVE-NEXT:    it eq
1519; CHECK-MVE-NEXT:    moveq r2, #1
1520; CHECK-MVE-NEXT:    it vs
1521; CHECK-MVE-NEXT:    movvs r2, #1
1522; CHECK-MVE-NEXT:    cmp r2, #0
1523; CHECK-MVE-NEXT:    cset r2, ne
1524; CHECK-MVE-NEXT:    vmov r1, s12
1525; CHECK-MVE-NEXT:    lsls r2, r2, #31
1526; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
1527; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
1528; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1529; CHECK-MVE-NEXT:    vmov r2, s12
1530; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
1531; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
1532; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
1533; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
1534; CHECK-MVE-NEXT:    mov.w r1, #0
1535; CHECK-MVE-NEXT:    it eq
1536; CHECK-MVE-NEXT:    moveq r1, #1
1537; CHECK-MVE-NEXT:    mov.w r0, #0
1538; CHECK-MVE-NEXT:    it vs
1539; CHECK-MVE-NEXT:    movvs r1, #1
1540; CHECK-MVE-NEXT:    cmp r1, #0
1541; CHECK-MVE-NEXT:    cset r1, ne
1542; CHECK-MVE-NEXT:    lsls r1, r1, #31
1543; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
1544; CHECK-MVE-NEXT:    vmov r1, s16
1545; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
1546; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
1547; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
1548; CHECK-MVE-NEXT:    movs r1, #0
1549; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1550; CHECK-MVE-NEXT:    it eq
1551; CHECK-MVE-NEXT:    moveq r1, #1
1552; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
1553; CHECK-MVE-NEXT:    it vs
1554; CHECK-MVE-NEXT:    movvs r1, #1
1555; CHECK-MVE-NEXT:    cmp r1, #0
1556; CHECK-MVE-NEXT:    cset r1, ne
1557; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
1558; CHECK-MVE-NEXT:    lsls r1, r1, #31
1559; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
1560; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1561; CHECK-MVE-NEXT:    vmov r1, s16
1562; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
1563; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
1564; CHECK-MVE-NEXT:    mov.w r1, #0
1565; CHECK-MVE-NEXT:    it eq
1566; CHECK-MVE-NEXT:    moveq r1, #1
1567; CHECK-MVE-NEXT:    it vs
1568; CHECK-MVE-NEXT:    movvs r1, #1
1569; CHECK-MVE-NEXT:    cmp r1, #0
1570; CHECK-MVE-NEXT:    cset r1, ne
1571; CHECK-MVE-NEXT:    lsls r1, r1, #31
1572; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
1573; CHECK-MVE-NEXT:    vmov r1, s16
1574; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
1575; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
1576; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
1577; CHECK-MVE-NEXT:    movs r1, #0
1578; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1579; CHECK-MVE-NEXT:    it eq
1580; CHECK-MVE-NEXT:    moveq r1, #1
1581; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
1582; CHECK-MVE-NEXT:    it vs
1583; CHECK-MVE-NEXT:    movvs r1, #1
1584; CHECK-MVE-NEXT:    cmp r1, #0
1585; CHECK-MVE-NEXT:    cset r1, ne
1586; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
1587; CHECK-MVE-NEXT:    lsls r1, r1, #31
1588; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
1589; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
1590; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1591; CHECK-MVE-NEXT:    vmov r1, s16
1592; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
1593; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
1594; CHECK-MVE-NEXT:    mov.w r1, #0
1595; CHECK-MVE-NEXT:    it eq
1596; CHECK-MVE-NEXT:    moveq r1, #1
1597; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
1598; CHECK-MVE-NEXT:    it vs
1599; CHECK-MVE-NEXT:    movvs r1, #1
1600; CHECK-MVE-NEXT:    cmp r1, #0
1601; CHECK-MVE-NEXT:    cset r1, ne
1602; CHECK-MVE-NEXT:    lsls r1, r1, #31
1603; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
1604; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1605; CHECK-MVE-NEXT:    it eq
1606; CHECK-MVE-NEXT:    moveq r0, #1
1607; CHECK-MVE-NEXT:    vmov r1, s16
1608; CHECK-MVE-NEXT:    it vs
1609; CHECK-MVE-NEXT:    movvs r0, #1
1610; CHECK-MVE-NEXT:    cmp r0, #0
1611; CHECK-MVE-NEXT:    cset r0, ne
1612; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
1613; CHECK-MVE-NEXT:    lsls r0, r0, #31
1614; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
1615; CHECK-MVE-NEXT:    vmov r0, s0
1616; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
1617; CHECK-MVE-NEXT:    vmov q0, q3
1618; CHECK-MVE-NEXT:    vpop {d8, d9}
1619; CHECK-MVE-NEXT:    bx lr
1620;
1621; CHECK-MVEFP-LABEL: vcmp_ueq_v8f16:
1622; CHECK-MVEFP:       @ %bb.0: @ %entry
1623; CHECK-MVEFP-NEXT:    vpt.f16 ge, q0, zr
1624; CHECK-MVEFP-NEXT:    vcmpt.f16 le, q0, zr
1625; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
1626; CHECK-MVEFP-NEXT:    bx lr
1627entry:
1628  %c = fcmp ueq <8 x half> %src, zeroinitializer
1629  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
1630  ret <8 x half> %s
1631}
1632
1633define arm_aapcs_vfpcc <8 x half> @vcmp_une_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
1634; CHECK-MVE-LABEL: vcmp_une_v8f16:
1635; CHECK-MVE:       @ %bb.0: @ %entry
1636; CHECK-MVE-NEXT:    .vsave {d8, d9}
1637; CHECK-MVE-NEXT:    vpush {d8, d9}
1638; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
1639; CHECK-MVE-NEXT:    movs r1, #0
1640; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
1641; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
1642; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1643; CHECK-MVE-NEXT:    it ne
1644; CHECK-MVE-NEXT:    movne r1, #1
1645; CHECK-MVE-NEXT:    cmp r1, #0
1646; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
1647; CHECK-MVE-NEXT:    cset r1, ne
1648; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
1649; CHECK-MVE-NEXT:    lsls r1, r1, #31
1650; CHECK-MVE-NEXT:    mov.w r2, #0
1651; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
1652; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1653; CHECK-MVE-NEXT:    it ne
1654; CHECK-MVE-NEXT:    movne r2, #1
1655; CHECK-MVE-NEXT:    cmp r2, #0
1656; CHECK-MVE-NEXT:    cset r2, ne
1657; CHECK-MVE-NEXT:    vmov r1, s12
1658; CHECK-MVE-NEXT:    lsls r2, r2, #31
1659; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
1660; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
1661; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1662; CHECK-MVE-NEXT:    vmov r2, s12
1663; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
1664; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
1665; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
1666; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
1667; CHECK-MVE-NEXT:    mov.w r1, #0
1668; CHECK-MVE-NEXT:    it ne
1669; CHECK-MVE-NEXT:    movne r1, #1
1670; CHECK-MVE-NEXT:    cmp r1, #0
1671; CHECK-MVE-NEXT:    cset r1, ne
1672; CHECK-MVE-NEXT:    movs r0, #0
1673; CHECK-MVE-NEXT:    lsls r1, r1, #31
1674; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
1675; CHECK-MVE-NEXT:    vmov r1, s16
1676; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
1677; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
1678; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
1679; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1680; CHECK-MVE-NEXT:    mov.w r1, #0
1681; CHECK-MVE-NEXT:    it ne
1682; CHECK-MVE-NEXT:    movne r1, #1
1683; CHECK-MVE-NEXT:    cmp r1, #0
1684; CHECK-MVE-NEXT:    cset r1, ne
1685; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
1686; CHECK-MVE-NEXT:    lsls r1, r1, #31
1687; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
1688; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
1689; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1690; CHECK-MVE-NEXT:    vmov r1, s16
1691; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
1692; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
1693; CHECK-MVE-NEXT:    mov.w r1, #0
1694; CHECK-MVE-NEXT:    it ne
1695; CHECK-MVE-NEXT:    movne r1, #1
1696; CHECK-MVE-NEXT:    cmp r1, #0
1697; CHECK-MVE-NEXT:    cset r1, ne
1698; CHECK-MVE-NEXT:    lsls r1, r1, #31
1699; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
1700; CHECK-MVE-NEXT:    vmov r1, s16
1701; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
1702; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
1703; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
1704; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1705; CHECK-MVE-NEXT:    mov.w r1, #0
1706; CHECK-MVE-NEXT:    it ne
1707; CHECK-MVE-NEXT:    movne r1, #1
1708; CHECK-MVE-NEXT:    cmp r1, #0
1709; CHECK-MVE-NEXT:    cset r1, ne
1710; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
1711; CHECK-MVE-NEXT:    lsls r1, r1, #31
1712; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
1713; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
1714; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1715; CHECK-MVE-NEXT:    vmov r1, s16
1716; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
1717; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
1718; CHECK-MVE-NEXT:    mov.w r1, #0
1719; CHECK-MVE-NEXT:    it ne
1720; CHECK-MVE-NEXT:    movne r1, #1
1721; CHECK-MVE-NEXT:    cmp r1, #0
1722; CHECK-MVE-NEXT:    cset r1, ne
1723; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
1724; CHECK-MVE-NEXT:    lsls r1, r1, #31
1725; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
1726; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
1727; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1728; CHECK-MVE-NEXT:    it ne
1729; CHECK-MVE-NEXT:    movne r0, #1
1730; CHECK-MVE-NEXT:    cmp r0, #0
1731; CHECK-MVE-NEXT:    cset r0, ne
1732; CHECK-MVE-NEXT:    vmov r1, s16
1733; CHECK-MVE-NEXT:    lsls r0, r0, #31
1734; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
1735; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
1736; CHECK-MVE-NEXT:    vmov r0, s0
1737; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
1738; CHECK-MVE-NEXT:    vmov q0, q3
1739; CHECK-MVE-NEXT:    vpop {d8, d9}
1740; CHECK-MVE-NEXT:    bx lr
1741;
1742; CHECK-MVEFP-LABEL: vcmp_une_v8f16:
1743; CHECK-MVEFP:       @ %bb.0: @ %entry
1744; CHECK-MVEFP-NEXT:    vcmp.f16 ne, q0, zr
1745; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
1746; CHECK-MVEFP-NEXT:    bx lr
1747entry:
1748  %c = fcmp une <8 x half> %src, zeroinitializer
1749  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
1750  ret <8 x half> %s
1751}
1752
1753define arm_aapcs_vfpcc <8 x half> @vcmp_ugt_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
1754; CHECK-MVE-LABEL: vcmp_ugt_v8f16:
1755; CHECK-MVE:       @ %bb.0: @ %entry
1756; CHECK-MVE-NEXT:    .vsave {d8, d9}
1757; CHECK-MVE-NEXT:    vpush {d8, d9}
1758; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
1759; CHECK-MVE-NEXT:    movs r1, #0
1760; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
1761; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
1762; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1763; CHECK-MVE-NEXT:    it hi
1764; CHECK-MVE-NEXT:    movhi r1, #1
1765; CHECK-MVE-NEXT:    cmp r1, #0
1766; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
1767; CHECK-MVE-NEXT:    cset r1, ne
1768; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
1769; CHECK-MVE-NEXT:    lsls r1, r1, #31
1770; CHECK-MVE-NEXT:    mov.w r2, #0
1771; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
1772; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1773; CHECK-MVE-NEXT:    it hi
1774; CHECK-MVE-NEXT:    movhi r2, #1
1775; CHECK-MVE-NEXT:    cmp r2, #0
1776; CHECK-MVE-NEXT:    cset r2, ne
1777; CHECK-MVE-NEXT:    vmov r1, s12
1778; CHECK-MVE-NEXT:    lsls r2, r2, #31
1779; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
1780; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
1781; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1782; CHECK-MVE-NEXT:    vmov r2, s12
1783; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
1784; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
1785; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
1786; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
1787; CHECK-MVE-NEXT:    mov.w r1, #0
1788; CHECK-MVE-NEXT:    it hi
1789; CHECK-MVE-NEXT:    movhi r1, #1
1790; CHECK-MVE-NEXT:    cmp r1, #0
1791; CHECK-MVE-NEXT:    cset r1, ne
1792; CHECK-MVE-NEXT:    movs r0, #0
1793; CHECK-MVE-NEXT:    lsls r1, r1, #31
1794; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
1795; CHECK-MVE-NEXT:    vmov r1, s16
1796; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
1797; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
1798; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
1799; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1800; CHECK-MVE-NEXT:    mov.w r1, #0
1801; CHECK-MVE-NEXT:    it hi
1802; CHECK-MVE-NEXT:    movhi r1, #1
1803; CHECK-MVE-NEXT:    cmp r1, #0
1804; CHECK-MVE-NEXT:    cset r1, ne
1805; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
1806; CHECK-MVE-NEXT:    lsls r1, r1, #31
1807; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
1808; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
1809; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1810; CHECK-MVE-NEXT:    vmov r1, s16
1811; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
1812; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
1813; CHECK-MVE-NEXT:    mov.w r1, #0
1814; CHECK-MVE-NEXT:    it hi
1815; CHECK-MVE-NEXT:    movhi r1, #1
1816; CHECK-MVE-NEXT:    cmp r1, #0
1817; CHECK-MVE-NEXT:    cset r1, ne
1818; CHECK-MVE-NEXT:    lsls r1, r1, #31
1819; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
1820; CHECK-MVE-NEXT:    vmov r1, s16
1821; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
1822; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
1823; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
1824; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1825; CHECK-MVE-NEXT:    mov.w r1, #0
1826; CHECK-MVE-NEXT:    it hi
1827; CHECK-MVE-NEXT:    movhi r1, #1
1828; CHECK-MVE-NEXT:    cmp r1, #0
1829; CHECK-MVE-NEXT:    cset r1, ne
1830; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
1831; CHECK-MVE-NEXT:    lsls r1, r1, #31
1832; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
1833; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
1834; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1835; CHECK-MVE-NEXT:    vmov r1, s16
1836; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
1837; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
1838; CHECK-MVE-NEXT:    mov.w r1, #0
1839; CHECK-MVE-NEXT:    it hi
1840; CHECK-MVE-NEXT:    movhi r1, #1
1841; CHECK-MVE-NEXT:    cmp r1, #0
1842; CHECK-MVE-NEXT:    cset r1, ne
1843; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
1844; CHECK-MVE-NEXT:    lsls r1, r1, #31
1845; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
1846; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
1847; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1848; CHECK-MVE-NEXT:    it hi
1849; CHECK-MVE-NEXT:    movhi r0, #1
1850; CHECK-MVE-NEXT:    cmp r0, #0
1851; CHECK-MVE-NEXT:    cset r0, ne
1852; CHECK-MVE-NEXT:    vmov r1, s16
1853; CHECK-MVE-NEXT:    lsls r0, r0, #31
1854; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
1855; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
1856; CHECK-MVE-NEXT:    vmov r0, s0
1857; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
1858; CHECK-MVE-NEXT:    vmov q0, q3
1859; CHECK-MVE-NEXT:    vpop {d8, d9}
1860; CHECK-MVE-NEXT:    bx lr
1861;
1862; CHECK-MVEFP-LABEL: vcmp_ugt_v8f16:
1863; CHECK-MVEFP:       @ %bb.0: @ %entry
1864; CHECK-MVEFP-NEXT:    vcmp.f16 gt, q0, zr
1865; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
1866; CHECK-MVEFP-NEXT:    bx lr
1867entry:
1868  %c = fcmp ugt <8 x half> %src, zeroinitializer
1869  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
1870  ret <8 x half> %s
1871}
1872
1873define arm_aapcs_vfpcc <8 x half> @vcmp_uge_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
1874; CHECK-MVE-LABEL: vcmp_uge_v8f16:
1875; CHECK-MVE:       @ %bb.0: @ %entry
1876; CHECK-MVE-NEXT:    .vsave {d8, d9}
1877; CHECK-MVE-NEXT:    vpush {d8, d9}
1878; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
1879; CHECK-MVE-NEXT:    movs r1, #0
1880; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
1881; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
1882; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1883; CHECK-MVE-NEXT:    it pl
1884; CHECK-MVE-NEXT:    movpl r1, #1
1885; CHECK-MVE-NEXT:    cmp r1, #0
1886; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
1887; CHECK-MVE-NEXT:    cset r1, ne
1888; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
1889; CHECK-MVE-NEXT:    lsls r1, r1, #31
1890; CHECK-MVE-NEXT:    mov.w r2, #0
1891; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
1892; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1893; CHECK-MVE-NEXT:    it pl
1894; CHECK-MVE-NEXT:    movpl r2, #1
1895; CHECK-MVE-NEXT:    cmp r2, #0
1896; CHECK-MVE-NEXT:    cset r2, ne
1897; CHECK-MVE-NEXT:    vmov r1, s12
1898; CHECK-MVE-NEXT:    lsls r2, r2, #31
1899; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
1900; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
1901; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1902; CHECK-MVE-NEXT:    vmov r2, s12
1903; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
1904; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
1905; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
1906; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
1907; CHECK-MVE-NEXT:    mov.w r1, #0
1908; CHECK-MVE-NEXT:    it pl
1909; CHECK-MVE-NEXT:    movpl r1, #1
1910; CHECK-MVE-NEXT:    cmp r1, #0
1911; CHECK-MVE-NEXT:    cset r1, ne
1912; CHECK-MVE-NEXT:    movs r0, #0
1913; CHECK-MVE-NEXT:    lsls r1, r1, #31
1914; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
1915; CHECK-MVE-NEXT:    vmov r1, s16
1916; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
1917; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
1918; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
1919; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1920; CHECK-MVE-NEXT:    mov.w r1, #0
1921; CHECK-MVE-NEXT:    it pl
1922; CHECK-MVE-NEXT:    movpl r1, #1
1923; CHECK-MVE-NEXT:    cmp r1, #0
1924; CHECK-MVE-NEXT:    cset r1, ne
1925; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
1926; CHECK-MVE-NEXT:    lsls r1, r1, #31
1927; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
1928; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
1929; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1930; CHECK-MVE-NEXT:    vmov r1, s16
1931; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
1932; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
1933; CHECK-MVE-NEXT:    mov.w r1, #0
1934; CHECK-MVE-NEXT:    it pl
1935; CHECK-MVE-NEXT:    movpl r1, #1
1936; CHECK-MVE-NEXT:    cmp r1, #0
1937; CHECK-MVE-NEXT:    cset r1, ne
1938; CHECK-MVE-NEXT:    lsls r1, r1, #31
1939; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
1940; CHECK-MVE-NEXT:    vmov r1, s16
1941; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
1942; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
1943; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
1944; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1945; CHECK-MVE-NEXT:    mov.w r1, #0
1946; CHECK-MVE-NEXT:    it pl
1947; CHECK-MVE-NEXT:    movpl r1, #1
1948; CHECK-MVE-NEXT:    cmp r1, #0
1949; CHECK-MVE-NEXT:    cset r1, ne
1950; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
1951; CHECK-MVE-NEXT:    lsls r1, r1, #31
1952; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
1953; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
1954; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1955; CHECK-MVE-NEXT:    vmov r1, s16
1956; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
1957; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
1958; CHECK-MVE-NEXT:    mov.w r1, #0
1959; CHECK-MVE-NEXT:    it pl
1960; CHECK-MVE-NEXT:    movpl r1, #1
1961; CHECK-MVE-NEXT:    cmp r1, #0
1962; CHECK-MVE-NEXT:    cset r1, ne
1963; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
1964; CHECK-MVE-NEXT:    lsls r1, r1, #31
1965; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
1966; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
1967; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
1968; CHECK-MVE-NEXT:    it pl
1969; CHECK-MVE-NEXT:    movpl r0, #1
1970; CHECK-MVE-NEXT:    cmp r0, #0
1971; CHECK-MVE-NEXT:    cset r0, ne
1972; CHECK-MVE-NEXT:    vmov r1, s16
1973; CHECK-MVE-NEXT:    lsls r0, r0, #31
1974; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
1975; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
1976; CHECK-MVE-NEXT:    vmov r0, s0
1977; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
1978; CHECK-MVE-NEXT:    vmov q0, q3
1979; CHECK-MVE-NEXT:    vpop {d8, d9}
1980; CHECK-MVE-NEXT:    bx lr
1981;
1982; CHECK-MVEFP-LABEL: vcmp_uge_v8f16:
1983; CHECK-MVEFP:       @ %bb.0: @ %entry
1984; CHECK-MVEFP-NEXT:    vcmp.f16 ge, q0, zr
1985; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
1986; CHECK-MVEFP-NEXT:    bx lr
1987entry:
1988  %c = fcmp uge <8 x half> %src, zeroinitializer
1989  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
1990  ret <8 x half> %s
1991}
1992
1993define arm_aapcs_vfpcc <8 x half> @vcmp_ult_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
1994; CHECK-MVE-LABEL: vcmp_ult_v8f16:
1995; CHECK-MVE:       @ %bb.0: @ %entry
1996; CHECK-MVE-NEXT:    .vsave {d8, d9}
1997; CHECK-MVE-NEXT:    vpush {d8, d9}
1998; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
1999; CHECK-MVE-NEXT:    movs r1, #0
2000; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
2001; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
2002; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2003; CHECK-MVE-NEXT:    it lt
2004; CHECK-MVE-NEXT:    movlt r1, #1
2005; CHECK-MVE-NEXT:    cmp r1, #0
2006; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
2007; CHECK-MVE-NEXT:    cset r1, ne
2008; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
2009; CHECK-MVE-NEXT:    lsls r1, r1, #31
2010; CHECK-MVE-NEXT:    mov.w r2, #0
2011; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
2012; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2013; CHECK-MVE-NEXT:    it lt
2014; CHECK-MVE-NEXT:    movlt r2, #1
2015; CHECK-MVE-NEXT:    cmp r2, #0
2016; CHECK-MVE-NEXT:    cset r2, ne
2017; CHECK-MVE-NEXT:    vmov r1, s12
2018; CHECK-MVE-NEXT:    lsls r2, r2, #31
2019; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
2020; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
2021; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2022; CHECK-MVE-NEXT:    vmov r2, s12
2023; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
2024; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
2025; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
2026; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
2027; CHECK-MVE-NEXT:    mov.w r1, #0
2028; CHECK-MVE-NEXT:    it lt
2029; CHECK-MVE-NEXT:    movlt r1, #1
2030; CHECK-MVE-NEXT:    cmp r1, #0
2031; CHECK-MVE-NEXT:    cset r1, ne
2032; CHECK-MVE-NEXT:    movs r0, #0
2033; CHECK-MVE-NEXT:    lsls r1, r1, #31
2034; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
2035; CHECK-MVE-NEXT:    vmov r1, s16
2036; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
2037; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
2038; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
2039; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2040; CHECK-MVE-NEXT:    mov.w r1, #0
2041; CHECK-MVE-NEXT:    it lt
2042; CHECK-MVE-NEXT:    movlt r1, #1
2043; CHECK-MVE-NEXT:    cmp r1, #0
2044; CHECK-MVE-NEXT:    cset r1, ne
2045; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
2046; CHECK-MVE-NEXT:    lsls r1, r1, #31
2047; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
2048; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
2049; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2050; CHECK-MVE-NEXT:    vmov r1, s16
2051; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
2052; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
2053; CHECK-MVE-NEXT:    mov.w r1, #0
2054; CHECK-MVE-NEXT:    it lt
2055; CHECK-MVE-NEXT:    movlt r1, #1
2056; CHECK-MVE-NEXT:    cmp r1, #0
2057; CHECK-MVE-NEXT:    cset r1, ne
2058; CHECK-MVE-NEXT:    lsls r1, r1, #31
2059; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
2060; CHECK-MVE-NEXT:    vmov r1, s16
2061; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
2062; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
2063; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
2064; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2065; CHECK-MVE-NEXT:    mov.w r1, #0
2066; CHECK-MVE-NEXT:    it lt
2067; CHECK-MVE-NEXT:    movlt r1, #1
2068; CHECK-MVE-NEXT:    cmp r1, #0
2069; CHECK-MVE-NEXT:    cset r1, ne
2070; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
2071; CHECK-MVE-NEXT:    lsls r1, r1, #31
2072; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
2073; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
2074; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2075; CHECK-MVE-NEXT:    vmov r1, s16
2076; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
2077; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
2078; CHECK-MVE-NEXT:    mov.w r1, #0
2079; CHECK-MVE-NEXT:    it lt
2080; CHECK-MVE-NEXT:    movlt r1, #1
2081; CHECK-MVE-NEXT:    cmp r1, #0
2082; CHECK-MVE-NEXT:    cset r1, ne
2083; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
2084; CHECK-MVE-NEXT:    lsls r1, r1, #31
2085; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
2086; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
2087; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2088; CHECK-MVE-NEXT:    it lt
2089; CHECK-MVE-NEXT:    movlt r0, #1
2090; CHECK-MVE-NEXT:    cmp r0, #0
2091; CHECK-MVE-NEXT:    cset r0, ne
2092; CHECK-MVE-NEXT:    vmov r1, s16
2093; CHECK-MVE-NEXT:    lsls r0, r0, #31
2094; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
2095; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
2096; CHECK-MVE-NEXT:    vmov r0, s0
2097; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
2098; CHECK-MVE-NEXT:    vmov q0, q3
2099; CHECK-MVE-NEXT:    vpop {d8, d9}
2100; CHECK-MVE-NEXT:    bx lr
2101;
2102; CHECK-MVEFP-LABEL: vcmp_ult_v8f16:
2103; CHECK-MVEFP:       @ %bb.0: @ %entry
2104; CHECK-MVEFP-NEXT:    vcmp.f16 lt, q0, zr
2105; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
2106; CHECK-MVEFP-NEXT:    bx lr
2107entry:
2108  %c = fcmp ult <8 x half> %src, zeroinitializer
2109  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
2110  ret <8 x half> %s
2111}
2112
2113define arm_aapcs_vfpcc <8 x half> @vcmp_ule_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
2114; CHECK-MVE-LABEL: vcmp_ule_v8f16:
2115; CHECK-MVE:       @ %bb.0: @ %entry
2116; CHECK-MVE-NEXT:    .vsave {d8, d9}
2117; CHECK-MVE-NEXT:    vpush {d8, d9}
2118; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
2119; CHECK-MVE-NEXT:    movs r1, #0
2120; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
2121; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
2122; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2123; CHECK-MVE-NEXT:    it le
2124; CHECK-MVE-NEXT:    movle r1, #1
2125; CHECK-MVE-NEXT:    cmp r1, #0
2126; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
2127; CHECK-MVE-NEXT:    cset r1, ne
2128; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
2129; CHECK-MVE-NEXT:    lsls r1, r1, #31
2130; CHECK-MVE-NEXT:    mov.w r2, #0
2131; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
2132; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2133; CHECK-MVE-NEXT:    it le
2134; CHECK-MVE-NEXT:    movle r2, #1
2135; CHECK-MVE-NEXT:    cmp r2, #0
2136; CHECK-MVE-NEXT:    cset r2, ne
2137; CHECK-MVE-NEXT:    vmov r1, s12
2138; CHECK-MVE-NEXT:    lsls r2, r2, #31
2139; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
2140; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
2141; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2142; CHECK-MVE-NEXT:    vmov r2, s12
2143; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
2144; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
2145; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
2146; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
2147; CHECK-MVE-NEXT:    mov.w r1, #0
2148; CHECK-MVE-NEXT:    it le
2149; CHECK-MVE-NEXT:    movle r1, #1
2150; CHECK-MVE-NEXT:    cmp r1, #0
2151; CHECK-MVE-NEXT:    cset r1, ne
2152; CHECK-MVE-NEXT:    movs r0, #0
2153; CHECK-MVE-NEXT:    lsls r1, r1, #31
2154; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
2155; CHECK-MVE-NEXT:    vmov r1, s16
2156; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
2157; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
2158; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
2159; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2160; CHECK-MVE-NEXT:    mov.w r1, #0
2161; CHECK-MVE-NEXT:    it le
2162; CHECK-MVE-NEXT:    movle r1, #1
2163; CHECK-MVE-NEXT:    cmp r1, #0
2164; CHECK-MVE-NEXT:    cset r1, ne
2165; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
2166; CHECK-MVE-NEXT:    lsls r1, r1, #31
2167; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
2168; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
2169; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2170; CHECK-MVE-NEXT:    vmov r1, s16
2171; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
2172; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
2173; CHECK-MVE-NEXT:    mov.w r1, #0
2174; CHECK-MVE-NEXT:    it le
2175; CHECK-MVE-NEXT:    movle r1, #1
2176; CHECK-MVE-NEXT:    cmp r1, #0
2177; CHECK-MVE-NEXT:    cset r1, ne
2178; CHECK-MVE-NEXT:    lsls r1, r1, #31
2179; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
2180; CHECK-MVE-NEXT:    vmov r1, s16
2181; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
2182; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
2183; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
2184; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2185; CHECK-MVE-NEXT:    mov.w r1, #0
2186; CHECK-MVE-NEXT:    it le
2187; CHECK-MVE-NEXT:    movle r1, #1
2188; CHECK-MVE-NEXT:    cmp r1, #0
2189; CHECK-MVE-NEXT:    cset r1, ne
2190; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
2191; CHECK-MVE-NEXT:    lsls r1, r1, #31
2192; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
2193; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
2194; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2195; CHECK-MVE-NEXT:    vmov r1, s16
2196; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
2197; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
2198; CHECK-MVE-NEXT:    mov.w r1, #0
2199; CHECK-MVE-NEXT:    it le
2200; CHECK-MVE-NEXT:    movle r1, #1
2201; CHECK-MVE-NEXT:    cmp r1, #0
2202; CHECK-MVE-NEXT:    cset r1, ne
2203; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
2204; CHECK-MVE-NEXT:    lsls r1, r1, #31
2205; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
2206; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
2207; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2208; CHECK-MVE-NEXT:    it le
2209; CHECK-MVE-NEXT:    movle r0, #1
2210; CHECK-MVE-NEXT:    cmp r0, #0
2211; CHECK-MVE-NEXT:    cset r0, ne
2212; CHECK-MVE-NEXT:    vmov r1, s16
2213; CHECK-MVE-NEXT:    lsls r0, r0, #31
2214; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
2215; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
2216; CHECK-MVE-NEXT:    vmov r0, s0
2217; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
2218; CHECK-MVE-NEXT:    vmov q0, q3
2219; CHECK-MVE-NEXT:    vpop {d8, d9}
2220; CHECK-MVE-NEXT:    bx lr
2221;
2222; CHECK-MVEFP-LABEL: vcmp_ule_v8f16:
2223; CHECK-MVEFP:       @ %bb.0: @ %entry
2224; CHECK-MVEFP-NEXT:    vcmp.f16 le, q0, zr
2225; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
2226; CHECK-MVEFP-NEXT:    bx lr
2227entry:
2228  %c = fcmp ule <8 x half> %src, zeroinitializer
2229  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
2230  ret <8 x half> %s
2231}
2232
2233define arm_aapcs_vfpcc <8 x half> @vcmp_ord_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
2234; CHECK-MVE-LABEL: vcmp_ord_v8f16:
2235; CHECK-MVE:       @ %bb.0: @ %entry
2236; CHECK-MVE-NEXT:    .vsave {d8, d9}
2237; CHECK-MVE-NEXT:    vpush {d8, d9}
2238; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
2239; CHECK-MVE-NEXT:    movs r1, #0
2240; CHECK-MVE-NEXT:    vcmp.f16 s12, s12
2241; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
2242; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2243; CHECK-MVE-NEXT:    it vc
2244; CHECK-MVE-NEXT:    movvc r1, #1
2245; CHECK-MVE-NEXT:    cmp r1, #0
2246; CHECK-MVE-NEXT:    vcmp.f16 s0, s0
2247; CHECK-MVE-NEXT:    cset r1, ne
2248; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
2249; CHECK-MVE-NEXT:    lsls r1, r1, #31
2250; CHECK-MVE-NEXT:    mov.w r2, #0
2251; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
2252; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2253; CHECK-MVE-NEXT:    it vc
2254; CHECK-MVE-NEXT:    movvc r2, #1
2255; CHECK-MVE-NEXT:    cmp r2, #0
2256; CHECK-MVE-NEXT:    cset r2, ne
2257; CHECK-MVE-NEXT:    vmov r1, s12
2258; CHECK-MVE-NEXT:    lsls r2, r2, #31
2259; CHECK-MVE-NEXT:    vcmp.f16 s1, s1
2260; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
2261; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2262; CHECK-MVE-NEXT:    vmov r2, s12
2263; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
2264; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
2265; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
2266; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
2267; CHECK-MVE-NEXT:    mov.w r1, #0
2268; CHECK-MVE-NEXT:    it vc
2269; CHECK-MVE-NEXT:    movvc r1, #1
2270; CHECK-MVE-NEXT:    cmp r1, #0
2271; CHECK-MVE-NEXT:    cset r1, ne
2272; CHECK-MVE-NEXT:    movs r0, #0
2273; CHECK-MVE-NEXT:    lsls r1, r1, #31
2274; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
2275; CHECK-MVE-NEXT:    vmov r1, s16
2276; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
2277; CHECK-MVE-NEXT:    vcmp.f16 s16, s16
2278; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
2279; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2280; CHECK-MVE-NEXT:    mov.w r1, #0
2281; CHECK-MVE-NEXT:    it vc
2282; CHECK-MVE-NEXT:    movvc r1, #1
2283; CHECK-MVE-NEXT:    cmp r1, #0
2284; CHECK-MVE-NEXT:    cset r1, ne
2285; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
2286; CHECK-MVE-NEXT:    lsls r1, r1, #31
2287; CHECK-MVE-NEXT:    vcmp.f16 s2, s2
2288; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
2289; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2290; CHECK-MVE-NEXT:    vmov r1, s16
2291; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
2292; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
2293; CHECK-MVE-NEXT:    mov.w r1, #0
2294; CHECK-MVE-NEXT:    it vc
2295; CHECK-MVE-NEXT:    movvc r1, #1
2296; CHECK-MVE-NEXT:    cmp r1, #0
2297; CHECK-MVE-NEXT:    cset r1, ne
2298; CHECK-MVE-NEXT:    lsls r1, r1, #31
2299; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
2300; CHECK-MVE-NEXT:    vmov r1, s16
2301; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
2302; CHECK-MVE-NEXT:    vcmp.f16 s16, s16
2303; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
2304; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2305; CHECK-MVE-NEXT:    mov.w r1, #0
2306; CHECK-MVE-NEXT:    it vc
2307; CHECK-MVE-NEXT:    movvc r1, #1
2308; CHECK-MVE-NEXT:    cmp r1, #0
2309; CHECK-MVE-NEXT:    cset r1, ne
2310; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
2311; CHECK-MVE-NEXT:    lsls r1, r1, #31
2312; CHECK-MVE-NEXT:    vcmp.f16 s3, s3
2313; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
2314; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2315; CHECK-MVE-NEXT:    vmov r1, s16
2316; CHECK-MVE-NEXT:    vcmp.f16 s0, s0
2317; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
2318; CHECK-MVE-NEXT:    mov.w r1, #0
2319; CHECK-MVE-NEXT:    it vc
2320; CHECK-MVE-NEXT:    movvc r1, #1
2321; CHECK-MVE-NEXT:    cmp r1, #0
2322; CHECK-MVE-NEXT:    cset r1, ne
2323; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
2324; CHECK-MVE-NEXT:    lsls r1, r1, #31
2325; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
2326; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
2327; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2328; CHECK-MVE-NEXT:    it vc
2329; CHECK-MVE-NEXT:    movvc r0, #1
2330; CHECK-MVE-NEXT:    cmp r0, #0
2331; CHECK-MVE-NEXT:    cset r0, ne
2332; CHECK-MVE-NEXT:    vmov r1, s16
2333; CHECK-MVE-NEXT:    lsls r0, r0, #31
2334; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
2335; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
2336; CHECK-MVE-NEXT:    vmov r0, s0
2337; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
2338; CHECK-MVE-NEXT:    vmov q0, q3
2339; CHECK-MVE-NEXT:    vpop {d8, d9}
2340; CHECK-MVE-NEXT:    bx lr
2341;
2342; CHECK-MVEFP-LABEL: vcmp_ord_v8f16:
2343; CHECK-MVEFP:       @ %bb.0: @ %entry
2344; CHECK-MVEFP-NEXT:    vpt.f16 ge, q0, zr
2345; CHECK-MVEFP-NEXT:    vcmpt.f16 lt, q0, zr
2346; CHECK-MVEFP-NEXT:    vpsel q0, q2, q1
2347; CHECK-MVEFP-NEXT:    bx lr
2348entry:
2349  %c = fcmp ord <8 x half> %src, zeroinitializer
2350  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
2351  ret <8 x half> %s
2352}
2353
2354define arm_aapcs_vfpcc <8 x half> @vcmp_uno_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
2355; CHECK-MVE-LABEL: vcmp_uno_v8f16:
2356; CHECK-MVE:       @ %bb.0: @ %entry
2357; CHECK-MVE-NEXT:    .vsave {d8, d9}
2358; CHECK-MVE-NEXT:    vpush {d8, d9}
2359; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
2360; CHECK-MVE-NEXT:    movs r1, #0
2361; CHECK-MVE-NEXT:    vcmp.f16 s12, s12
2362; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
2363; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2364; CHECK-MVE-NEXT:    it vs
2365; CHECK-MVE-NEXT:    movvs r1, #1
2366; CHECK-MVE-NEXT:    cmp r1, #0
2367; CHECK-MVE-NEXT:    vcmp.f16 s0, s0
2368; CHECK-MVE-NEXT:    cset r1, ne
2369; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
2370; CHECK-MVE-NEXT:    lsls r1, r1, #31
2371; CHECK-MVE-NEXT:    mov.w r2, #0
2372; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
2373; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2374; CHECK-MVE-NEXT:    it vs
2375; CHECK-MVE-NEXT:    movvs r2, #1
2376; CHECK-MVE-NEXT:    cmp r2, #0
2377; CHECK-MVE-NEXT:    cset r2, ne
2378; CHECK-MVE-NEXT:    vmov r1, s12
2379; CHECK-MVE-NEXT:    lsls r2, r2, #31
2380; CHECK-MVE-NEXT:    vcmp.f16 s1, s1
2381; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
2382; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2383; CHECK-MVE-NEXT:    vmov r2, s12
2384; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
2385; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
2386; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
2387; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
2388; CHECK-MVE-NEXT:    mov.w r1, #0
2389; CHECK-MVE-NEXT:    it vs
2390; CHECK-MVE-NEXT:    movvs r1, #1
2391; CHECK-MVE-NEXT:    cmp r1, #0
2392; CHECK-MVE-NEXT:    cset r1, ne
2393; CHECK-MVE-NEXT:    movs r0, #0
2394; CHECK-MVE-NEXT:    lsls r1, r1, #31
2395; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
2396; CHECK-MVE-NEXT:    vmov r1, s16
2397; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
2398; CHECK-MVE-NEXT:    vcmp.f16 s16, s16
2399; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
2400; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2401; CHECK-MVE-NEXT:    mov.w r1, #0
2402; CHECK-MVE-NEXT:    it vs
2403; CHECK-MVE-NEXT:    movvs r1, #1
2404; CHECK-MVE-NEXT:    cmp r1, #0
2405; CHECK-MVE-NEXT:    cset r1, ne
2406; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
2407; CHECK-MVE-NEXT:    lsls r1, r1, #31
2408; CHECK-MVE-NEXT:    vcmp.f16 s2, s2
2409; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
2410; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2411; CHECK-MVE-NEXT:    vmov r1, s16
2412; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
2413; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
2414; CHECK-MVE-NEXT:    mov.w r1, #0
2415; CHECK-MVE-NEXT:    it vs
2416; CHECK-MVE-NEXT:    movvs r1, #1
2417; CHECK-MVE-NEXT:    cmp r1, #0
2418; CHECK-MVE-NEXT:    cset r1, ne
2419; CHECK-MVE-NEXT:    lsls r1, r1, #31
2420; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
2421; CHECK-MVE-NEXT:    vmov r1, s16
2422; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
2423; CHECK-MVE-NEXT:    vcmp.f16 s16, s16
2424; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
2425; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2426; CHECK-MVE-NEXT:    mov.w r1, #0
2427; CHECK-MVE-NEXT:    it vs
2428; CHECK-MVE-NEXT:    movvs r1, #1
2429; CHECK-MVE-NEXT:    cmp r1, #0
2430; CHECK-MVE-NEXT:    cset r1, ne
2431; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
2432; CHECK-MVE-NEXT:    lsls r1, r1, #31
2433; CHECK-MVE-NEXT:    vcmp.f16 s3, s3
2434; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
2435; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2436; CHECK-MVE-NEXT:    vmov r1, s16
2437; CHECK-MVE-NEXT:    vcmp.f16 s0, s0
2438; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
2439; CHECK-MVE-NEXT:    mov.w r1, #0
2440; CHECK-MVE-NEXT:    it vs
2441; CHECK-MVE-NEXT:    movvs r1, #1
2442; CHECK-MVE-NEXT:    cmp r1, #0
2443; CHECK-MVE-NEXT:    cset r1, ne
2444; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
2445; CHECK-MVE-NEXT:    lsls r1, r1, #31
2446; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
2447; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
2448; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2449; CHECK-MVE-NEXT:    it vs
2450; CHECK-MVE-NEXT:    movvs r0, #1
2451; CHECK-MVE-NEXT:    cmp r0, #0
2452; CHECK-MVE-NEXT:    cset r0, ne
2453; CHECK-MVE-NEXT:    vmov r1, s16
2454; CHECK-MVE-NEXT:    lsls r0, r0, #31
2455; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
2456; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
2457; CHECK-MVE-NEXT:    vmov r0, s0
2458; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
2459; CHECK-MVE-NEXT:    vmov q0, q3
2460; CHECK-MVE-NEXT:    vpop {d8, d9}
2461; CHECK-MVE-NEXT:    bx lr
2462;
2463; CHECK-MVEFP-LABEL: vcmp_uno_v8f16:
2464; CHECK-MVEFP:       @ %bb.0: @ %entry
2465; CHECK-MVEFP-NEXT:    vpt.f16 ge, q0, zr
2466; CHECK-MVEFP-NEXT:    vcmpt.f16 lt, q0, zr
2467; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
2468; CHECK-MVEFP-NEXT:    bx lr
2469entry:
2470  %c = fcmp uno <8 x half> %src, zeroinitializer
2471  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
2472  ret <8 x half> %s
2473}
2474
2475
2476; Reversed
2477
2478define arm_aapcs_vfpcc <4 x float> @vcmp_r_oeq_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
2479; CHECK-MVE-LABEL: vcmp_r_oeq_v4f32:
2480; CHECK-MVE:       @ %bb.0: @ %entry
2481; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
2482; CHECK-MVE-NEXT:    movs r1, #0
2483; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2484; CHECK-MVE-NEXT:    it eq
2485; CHECK-MVE-NEXT:    moveq r1, #1
2486; CHECK-MVE-NEXT:    cmp r1, #0
2487; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
2488; CHECK-MVE-NEXT:    cset r1, ne
2489; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2490; CHECK-MVE-NEXT:    mov.w r2, #0
2491; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
2492; CHECK-MVE-NEXT:    it eq
2493; CHECK-MVE-NEXT:    moveq r2, #1
2494; CHECK-MVE-NEXT:    cmp r2, #0
2495; CHECK-MVE-NEXT:    cset r2, ne
2496; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2497; CHECK-MVE-NEXT:    mov.w r3, #0
2498; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
2499; CHECK-MVE-NEXT:    it eq
2500; CHECK-MVE-NEXT:    moveq r3, #1
2501; CHECK-MVE-NEXT:    cmp r3, #0
2502; CHECK-MVE-NEXT:    cset r3, ne
2503; CHECK-MVE-NEXT:    movs r0, #0
2504; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2505; CHECK-MVE-NEXT:    it eq
2506; CHECK-MVE-NEXT:    moveq r0, #1
2507; CHECK-MVE-NEXT:    cmp r0, #0
2508; CHECK-MVE-NEXT:    cset r0, ne
2509; CHECK-MVE-NEXT:    lsls r0, r0, #31
2510; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
2511; CHECK-MVE-NEXT:    lsls r0, r3, #31
2512; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
2513; CHECK-MVE-NEXT:    lsls r0, r2, #31
2514; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
2515; CHECK-MVE-NEXT:    lsls r0, r1, #31
2516; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
2517; CHECK-MVE-NEXT:    bx lr
2518;
2519; CHECK-MVEFP-LABEL: vcmp_r_oeq_v4f32:
2520; CHECK-MVEFP:       @ %bb.0: @ %entry
2521; CHECK-MVEFP-NEXT:    vcmp.f32 eq, q0, zr
2522; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
2523; CHECK-MVEFP-NEXT:    bx lr
2524entry:
2525  %c = fcmp oeq <4 x float> zeroinitializer, %src
2526  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
2527  ret <4 x float> %s
2528}
2529
2530define arm_aapcs_vfpcc <4 x float> @vcmp_r_one_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
2531; CHECK-MVE-LABEL: vcmp_r_one_v4f32:
2532; CHECK-MVE:       @ %bb.0: @ %entry
2533; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
2534; CHECK-MVE-NEXT:    movs r1, #0
2535; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2536; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
2537; CHECK-MVE-NEXT:    it mi
2538; CHECK-MVE-NEXT:    movmi r1, #1
2539; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2540; CHECK-MVE-NEXT:    it gt
2541; CHECK-MVE-NEXT:    movgt r1, #1
2542; CHECK-MVE-NEXT:    cmp r1, #0
2543; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
2544; CHECK-MVE-NEXT:    mov.w r2, #0
2545; CHECK-MVE-NEXT:    cset r1, ne
2546; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2547; CHECK-MVE-NEXT:    it mi
2548; CHECK-MVE-NEXT:    movmi r2, #1
2549; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
2550; CHECK-MVE-NEXT:    it gt
2551; CHECK-MVE-NEXT:    movgt r2, #1
2552; CHECK-MVE-NEXT:    cmp r2, #0
2553; CHECK-MVE-NEXT:    mov.w r3, #0
2554; CHECK-MVE-NEXT:    cset r2, ne
2555; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2556; CHECK-MVE-NEXT:    it mi
2557; CHECK-MVE-NEXT:    movmi r3, #1
2558; CHECK-MVE-NEXT:    it gt
2559; CHECK-MVE-NEXT:    movgt r3, #1
2560; CHECK-MVE-NEXT:    cmp r3, #0
2561; CHECK-MVE-NEXT:    mov.w r0, #0
2562; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
2563; CHECK-MVE-NEXT:    cset r3, ne
2564; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2565; CHECK-MVE-NEXT:    it mi
2566; CHECK-MVE-NEXT:    movmi r0, #1
2567; CHECK-MVE-NEXT:    it gt
2568; CHECK-MVE-NEXT:    movgt r0, #1
2569; CHECK-MVE-NEXT:    cmp r0, #0
2570; CHECK-MVE-NEXT:    cset r0, ne
2571; CHECK-MVE-NEXT:    lsls r0, r0, #31
2572; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
2573; CHECK-MVE-NEXT:    lsls r0, r3, #31
2574; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
2575; CHECK-MVE-NEXT:    lsls r0, r2, #31
2576; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
2577; CHECK-MVE-NEXT:    lsls r0, r1, #31
2578; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
2579; CHECK-MVE-NEXT:    bx lr
2580;
2581; CHECK-MVEFP-LABEL: vcmp_r_one_v4f32:
2582; CHECK-MVEFP:       @ %bb.0: @ %entry
2583; CHECK-MVEFP-NEXT:    vpt.f32 le, q0, zr
2584; CHECK-MVEFP-NEXT:    vcmpt.f32 ge, q0, zr
2585; CHECK-MVEFP-NEXT:    vpsel q0, q2, q1
2586; CHECK-MVEFP-NEXT:    bx lr
2587entry:
2588  %c = fcmp one <4 x float> zeroinitializer, %src
2589  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
2590  ret <4 x float> %s
2591}
2592
2593define arm_aapcs_vfpcc <4 x float> @vcmp_r_ogt_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
2594; CHECK-MVE-LABEL: vcmp_r_ogt_v4f32:
2595; CHECK-MVE:       @ %bb.0: @ %entry
2596; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
2597; CHECK-MVE-NEXT:    movs r1, #0
2598; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2599; CHECK-MVE-NEXT:    it mi
2600; CHECK-MVE-NEXT:    movmi r1, #1
2601; CHECK-MVE-NEXT:    cmp r1, #0
2602; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
2603; CHECK-MVE-NEXT:    cset r1, ne
2604; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2605; CHECK-MVE-NEXT:    mov.w r2, #0
2606; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
2607; CHECK-MVE-NEXT:    it mi
2608; CHECK-MVE-NEXT:    movmi r2, #1
2609; CHECK-MVE-NEXT:    cmp r2, #0
2610; CHECK-MVE-NEXT:    cset r2, ne
2611; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2612; CHECK-MVE-NEXT:    mov.w r3, #0
2613; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
2614; CHECK-MVE-NEXT:    it mi
2615; CHECK-MVE-NEXT:    movmi r3, #1
2616; CHECK-MVE-NEXT:    cmp r3, #0
2617; CHECK-MVE-NEXT:    cset r3, ne
2618; CHECK-MVE-NEXT:    movs r0, #0
2619; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2620; CHECK-MVE-NEXT:    it mi
2621; CHECK-MVE-NEXT:    movmi r0, #1
2622; CHECK-MVE-NEXT:    cmp r0, #0
2623; CHECK-MVE-NEXT:    cset r0, ne
2624; CHECK-MVE-NEXT:    lsls r0, r0, #31
2625; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
2626; CHECK-MVE-NEXT:    lsls r0, r3, #31
2627; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
2628; CHECK-MVE-NEXT:    lsls r0, r2, #31
2629; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
2630; CHECK-MVE-NEXT:    lsls r0, r1, #31
2631; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
2632; CHECK-MVE-NEXT:    bx lr
2633;
2634; CHECK-MVEFP-LABEL: vcmp_r_ogt_v4f32:
2635; CHECK-MVEFP:       @ %bb.0: @ %entry
2636; CHECK-MVEFP-NEXT:    vcmp.f32 lt, q0, zr
2637; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
2638; CHECK-MVEFP-NEXT:    bx lr
2639entry:
2640  %c = fcmp ogt <4 x float> zeroinitializer, %src
2641  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
2642  ret <4 x float> %s
2643}
2644
2645define arm_aapcs_vfpcc <4 x float> @vcmp_r_oge_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
2646; CHECK-MVE-LABEL: vcmp_r_oge_v4f32:
2647; CHECK-MVE:       @ %bb.0: @ %entry
2648; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
2649; CHECK-MVE-NEXT:    movs r1, #0
2650; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2651; CHECK-MVE-NEXT:    it ls
2652; CHECK-MVE-NEXT:    movls r1, #1
2653; CHECK-MVE-NEXT:    cmp r1, #0
2654; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
2655; CHECK-MVE-NEXT:    cset r1, ne
2656; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2657; CHECK-MVE-NEXT:    mov.w r2, #0
2658; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
2659; CHECK-MVE-NEXT:    it ls
2660; CHECK-MVE-NEXT:    movls r2, #1
2661; CHECK-MVE-NEXT:    cmp r2, #0
2662; CHECK-MVE-NEXT:    cset r2, ne
2663; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2664; CHECK-MVE-NEXT:    mov.w r3, #0
2665; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
2666; CHECK-MVE-NEXT:    it ls
2667; CHECK-MVE-NEXT:    movls r3, #1
2668; CHECK-MVE-NEXT:    cmp r3, #0
2669; CHECK-MVE-NEXT:    cset r3, ne
2670; CHECK-MVE-NEXT:    movs r0, #0
2671; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2672; CHECK-MVE-NEXT:    it ls
2673; CHECK-MVE-NEXT:    movls r0, #1
2674; CHECK-MVE-NEXT:    cmp r0, #0
2675; CHECK-MVE-NEXT:    cset r0, ne
2676; CHECK-MVE-NEXT:    lsls r0, r0, #31
2677; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
2678; CHECK-MVE-NEXT:    lsls r0, r3, #31
2679; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
2680; CHECK-MVE-NEXT:    lsls r0, r2, #31
2681; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
2682; CHECK-MVE-NEXT:    lsls r0, r1, #31
2683; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
2684; CHECK-MVE-NEXT:    bx lr
2685;
2686; CHECK-MVEFP-LABEL: vcmp_r_oge_v4f32:
2687; CHECK-MVEFP:       @ %bb.0: @ %entry
2688; CHECK-MVEFP-NEXT:    vcmp.f32 le, q0, zr
2689; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
2690; CHECK-MVEFP-NEXT:    bx lr
2691entry:
2692  %c = fcmp oge <4 x float> zeroinitializer, %src
2693  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
2694  ret <4 x float> %s
2695}
2696
2697define arm_aapcs_vfpcc <4 x float> @vcmp_r_olt_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
2698; CHECK-MVE-LABEL: vcmp_r_olt_v4f32:
2699; CHECK-MVE:       @ %bb.0: @ %entry
2700; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
2701; CHECK-MVE-NEXT:    movs r1, #0
2702; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2703; CHECK-MVE-NEXT:    it gt
2704; CHECK-MVE-NEXT:    movgt r1, #1
2705; CHECK-MVE-NEXT:    cmp r1, #0
2706; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
2707; CHECK-MVE-NEXT:    cset r1, ne
2708; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2709; CHECK-MVE-NEXT:    mov.w r2, #0
2710; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
2711; CHECK-MVE-NEXT:    it gt
2712; CHECK-MVE-NEXT:    movgt r2, #1
2713; CHECK-MVE-NEXT:    cmp r2, #0
2714; CHECK-MVE-NEXT:    cset r2, ne
2715; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2716; CHECK-MVE-NEXT:    mov.w r3, #0
2717; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
2718; CHECK-MVE-NEXT:    it gt
2719; CHECK-MVE-NEXT:    movgt r3, #1
2720; CHECK-MVE-NEXT:    cmp r3, #0
2721; CHECK-MVE-NEXT:    cset r3, ne
2722; CHECK-MVE-NEXT:    movs r0, #0
2723; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2724; CHECK-MVE-NEXT:    it gt
2725; CHECK-MVE-NEXT:    movgt r0, #1
2726; CHECK-MVE-NEXT:    cmp r0, #0
2727; CHECK-MVE-NEXT:    cset r0, ne
2728; CHECK-MVE-NEXT:    lsls r0, r0, #31
2729; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
2730; CHECK-MVE-NEXT:    lsls r0, r3, #31
2731; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
2732; CHECK-MVE-NEXT:    lsls r0, r2, #31
2733; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
2734; CHECK-MVE-NEXT:    lsls r0, r1, #31
2735; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
2736; CHECK-MVE-NEXT:    bx lr
2737;
2738; CHECK-MVEFP-LABEL: vcmp_r_olt_v4f32:
2739; CHECK-MVEFP:       @ %bb.0: @ %entry
2740; CHECK-MVEFP-NEXT:    vcmp.f32 gt, q0, zr
2741; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
2742; CHECK-MVEFP-NEXT:    bx lr
2743entry:
2744  %c = fcmp olt <4 x float> zeroinitializer, %src
2745  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
2746  ret <4 x float> %s
2747}
2748
2749define arm_aapcs_vfpcc <4 x float> @vcmp_r_ole_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
2750; CHECK-MVE-LABEL: vcmp_r_ole_v4f32:
2751; CHECK-MVE:       @ %bb.0: @ %entry
2752; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
2753; CHECK-MVE-NEXT:    movs r1, #0
2754; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2755; CHECK-MVE-NEXT:    it ge
2756; CHECK-MVE-NEXT:    movge r1, #1
2757; CHECK-MVE-NEXT:    cmp r1, #0
2758; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
2759; CHECK-MVE-NEXT:    cset r1, ne
2760; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2761; CHECK-MVE-NEXT:    mov.w r2, #0
2762; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
2763; CHECK-MVE-NEXT:    it ge
2764; CHECK-MVE-NEXT:    movge r2, #1
2765; CHECK-MVE-NEXT:    cmp r2, #0
2766; CHECK-MVE-NEXT:    cset r2, ne
2767; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2768; CHECK-MVE-NEXT:    mov.w r3, #0
2769; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
2770; CHECK-MVE-NEXT:    it ge
2771; CHECK-MVE-NEXT:    movge r3, #1
2772; CHECK-MVE-NEXT:    cmp r3, #0
2773; CHECK-MVE-NEXT:    cset r3, ne
2774; CHECK-MVE-NEXT:    movs r0, #0
2775; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2776; CHECK-MVE-NEXT:    it ge
2777; CHECK-MVE-NEXT:    movge r0, #1
2778; CHECK-MVE-NEXT:    cmp r0, #0
2779; CHECK-MVE-NEXT:    cset r0, ne
2780; CHECK-MVE-NEXT:    lsls r0, r0, #31
2781; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
2782; CHECK-MVE-NEXT:    lsls r0, r3, #31
2783; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
2784; CHECK-MVE-NEXT:    lsls r0, r2, #31
2785; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
2786; CHECK-MVE-NEXT:    lsls r0, r1, #31
2787; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
2788; CHECK-MVE-NEXT:    bx lr
2789;
2790; CHECK-MVEFP-LABEL: vcmp_r_ole_v4f32:
2791; CHECK-MVEFP:       @ %bb.0: @ %entry
2792; CHECK-MVEFP-NEXT:    vcmp.f32 ge, q0, zr
2793; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
2794; CHECK-MVEFP-NEXT:    bx lr
2795entry:
2796  %c = fcmp ole <4 x float> zeroinitializer, %src
2797  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
2798  ret <4 x float> %s
2799}
2800
2801define arm_aapcs_vfpcc <4 x float> @vcmp_r_ueq_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
2802; CHECK-MVE-LABEL: vcmp_r_ueq_v4f32:
2803; CHECK-MVE:       @ %bb.0: @ %entry
2804; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
2805; CHECK-MVE-NEXT:    movs r1, #0
2806; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2807; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
2808; CHECK-MVE-NEXT:    it eq
2809; CHECK-MVE-NEXT:    moveq r1, #1
2810; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2811; CHECK-MVE-NEXT:    it vs
2812; CHECK-MVE-NEXT:    movvs r1, #1
2813; CHECK-MVE-NEXT:    cmp r1, #0
2814; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
2815; CHECK-MVE-NEXT:    mov.w r2, #0
2816; CHECK-MVE-NEXT:    cset r1, ne
2817; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2818; CHECK-MVE-NEXT:    it eq
2819; CHECK-MVE-NEXT:    moveq r2, #1
2820; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
2821; CHECK-MVE-NEXT:    it vs
2822; CHECK-MVE-NEXT:    movvs r2, #1
2823; CHECK-MVE-NEXT:    cmp r2, #0
2824; CHECK-MVE-NEXT:    mov.w r3, #0
2825; CHECK-MVE-NEXT:    cset r2, ne
2826; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2827; CHECK-MVE-NEXT:    it eq
2828; CHECK-MVE-NEXT:    moveq r3, #1
2829; CHECK-MVE-NEXT:    it vs
2830; CHECK-MVE-NEXT:    movvs r3, #1
2831; CHECK-MVE-NEXT:    cmp r3, #0
2832; CHECK-MVE-NEXT:    mov.w r0, #0
2833; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
2834; CHECK-MVE-NEXT:    cset r3, ne
2835; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2836; CHECK-MVE-NEXT:    it eq
2837; CHECK-MVE-NEXT:    moveq r0, #1
2838; CHECK-MVE-NEXT:    it vs
2839; CHECK-MVE-NEXT:    movvs r0, #1
2840; CHECK-MVE-NEXT:    cmp r0, #0
2841; CHECK-MVE-NEXT:    cset r0, ne
2842; CHECK-MVE-NEXT:    lsls r0, r0, #31
2843; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
2844; CHECK-MVE-NEXT:    lsls r0, r3, #31
2845; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
2846; CHECK-MVE-NEXT:    lsls r0, r2, #31
2847; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
2848; CHECK-MVE-NEXT:    lsls r0, r1, #31
2849; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
2850; CHECK-MVE-NEXT:    bx lr
2851;
2852; CHECK-MVEFP-LABEL: vcmp_r_ueq_v4f32:
2853; CHECK-MVEFP:       @ %bb.0: @ %entry
2854; CHECK-MVEFP-NEXT:    vpt.f32 le, q0, zr
2855; CHECK-MVEFP-NEXT:    vcmpt.f32 ge, q0, zr
2856; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
2857; CHECK-MVEFP-NEXT:    bx lr
2858entry:
2859  %c = fcmp ueq <4 x float> zeroinitializer, %src
2860  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
2861  ret <4 x float> %s
2862}
2863
2864define arm_aapcs_vfpcc <4 x float> @vcmp_r_une_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
2865; CHECK-MVE-LABEL: vcmp_r_une_v4f32:
2866; CHECK-MVE:       @ %bb.0: @ %entry
2867; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
2868; CHECK-MVE-NEXT:    movs r1, #0
2869; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2870; CHECK-MVE-NEXT:    it ne
2871; CHECK-MVE-NEXT:    movne r1, #1
2872; CHECK-MVE-NEXT:    cmp r1, #0
2873; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
2874; CHECK-MVE-NEXT:    cset r1, ne
2875; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2876; CHECK-MVE-NEXT:    mov.w r2, #0
2877; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
2878; CHECK-MVE-NEXT:    it ne
2879; CHECK-MVE-NEXT:    movne r2, #1
2880; CHECK-MVE-NEXT:    cmp r2, #0
2881; CHECK-MVE-NEXT:    cset r2, ne
2882; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2883; CHECK-MVE-NEXT:    mov.w r3, #0
2884; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
2885; CHECK-MVE-NEXT:    it ne
2886; CHECK-MVE-NEXT:    movne r3, #1
2887; CHECK-MVE-NEXT:    cmp r3, #0
2888; CHECK-MVE-NEXT:    cset r3, ne
2889; CHECK-MVE-NEXT:    movs r0, #0
2890; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2891; CHECK-MVE-NEXT:    it ne
2892; CHECK-MVE-NEXT:    movne r0, #1
2893; CHECK-MVE-NEXT:    cmp r0, #0
2894; CHECK-MVE-NEXT:    cset r0, ne
2895; CHECK-MVE-NEXT:    lsls r0, r0, #31
2896; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
2897; CHECK-MVE-NEXT:    lsls r0, r3, #31
2898; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
2899; CHECK-MVE-NEXT:    lsls r0, r2, #31
2900; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
2901; CHECK-MVE-NEXT:    lsls r0, r1, #31
2902; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
2903; CHECK-MVE-NEXT:    bx lr
2904;
2905; CHECK-MVEFP-LABEL: vcmp_r_une_v4f32:
2906; CHECK-MVEFP:       @ %bb.0: @ %entry
2907; CHECK-MVEFP-NEXT:    vcmp.f32 ne, q0, zr
2908; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
2909; CHECK-MVEFP-NEXT:    bx lr
2910entry:
2911  %c = fcmp une <4 x float> zeroinitializer, %src
2912  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
2913  ret <4 x float> %s
2914}
2915
2916define arm_aapcs_vfpcc <4 x float> @vcmp_r_ugt_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
2917; CHECK-MVE-LABEL: vcmp_r_ugt_v4f32:
2918; CHECK-MVE:       @ %bb.0: @ %entry
2919; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
2920; CHECK-MVE-NEXT:    movs r1, #0
2921; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2922; CHECK-MVE-NEXT:    it lt
2923; CHECK-MVE-NEXT:    movlt r1, #1
2924; CHECK-MVE-NEXT:    cmp r1, #0
2925; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
2926; CHECK-MVE-NEXT:    cset r1, ne
2927; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2928; CHECK-MVE-NEXT:    mov.w r2, #0
2929; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
2930; CHECK-MVE-NEXT:    it lt
2931; CHECK-MVE-NEXT:    movlt r2, #1
2932; CHECK-MVE-NEXT:    cmp r2, #0
2933; CHECK-MVE-NEXT:    cset r2, ne
2934; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2935; CHECK-MVE-NEXT:    mov.w r3, #0
2936; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
2937; CHECK-MVE-NEXT:    it lt
2938; CHECK-MVE-NEXT:    movlt r3, #1
2939; CHECK-MVE-NEXT:    cmp r3, #0
2940; CHECK-MVE-NEXT:    cset r3, ne
2941; CHECK-MVE-NEXT:    movs r0, #0
2942; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2943; CHECK-MVE-NEXT:    it lt
2944; CHECK-MVE-NEXT:    movlt r0, #1
2945; CHECK-MVE-NEXT:    cmp r0, #0
2946; CHECK-MVE-NEXT:    cset r0, ne
2947; CHECK-MVE-NEXT:    lsls r0, r0, #31
2948; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
2949; CHECK-MVE-NEXT:    lsls r0, r3, #31
2950; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
2951; CHECK-MVE-NEXT:    lsls r0, r2, #31
2952; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
2953; CHECK-MVE-NEXT:    lsls r0, r1, #31
2954; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
2955; CHECK-MVE-NEXT:    bx lr
2956;
2957; CHECK-MVEFP-LABEL: vcmp_r_ugt_v4f32:
2958; CHECK-MVEFP:       @ %bb.0: @ %entry
2959; CHECK-MVEFP-NEXT:    vcmp.f32 lt, q0, zr
2960; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
2961; CHECK-MVEFP-NEXT:    bx lr
2962entry:
2963  %c = fcmp ugt <4 x float> zeroinitializer, %src
2964  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
2965  ret <4 x float> %s
2966}
2967
2968define arm_aapcs_vfpcc <4 x float> @vcmp_r_uge_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
2969; CHECK-MVE-LABEL: vcmp_r_uge_v4f32:
2970; CHECK-MVE:       @ %bb.0: @ %entry
2971; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
2972; CHECK-MVE-NEXT:    movs r1, #0
2973; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2974; CHECK-MVE-NEXT:    it le
2975; CHECK-MVE-NEXT:    movle r1, #1
2976; CHECK-MVE-NEXT:    cmp r1, #0
2977; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
2978; CHECK-MVE-NEXT:    cset r1, ne
2979; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2980; CHECK-MVE-NEXT:    mov.w r2, #0
2981; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
2982; CHECK-MVE-NEXT:    it le
2983; CHECK-MVE-NEXT:    movle r2, #1
2984; CHECK-MVE-NEXT:    cmp r2, #0
2985; CHECK-MVE-NEXT:    cset r2, ne
2986; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2987; CHECK-MVE-NEXT:    mov.w r3, #0
2988; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
2989; CHECK-MVE-NEXT:    it le
2990; CHECK-MVE-NEXT:    movle r3, #1
2991; CHECK-MVE-NEXT:    cmp r3, #0
2992; CHECK-MVE-NEXT:    cset r3, ne
2993; CHECK-MVE-NEXT:    movs r0, #0
2994; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
2995; CHECK-MVE-NEXT:    it le
2996; CHECK-MVE-NEXT:    movle r0, #1
2997; CHECK-MVE-NEXT:    cmp r0, #0
2998; CHECK-MVE-NEXT:    cset r0, ne
2999; CHECK-MVE-NEXT:    lsls r0, r0, #31
3000; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
3001; CHECK-MVE-NEXT:    lsls r0, r3, #31
3002; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
3003; CHECK-MVE-NEXT:    lsls r0, r2, #31
3004; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
3005; CHECK-MVE-NEXT:    lsls r0, r1, #31
3006; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
3007; CHECK-MVE-NEXT:    bx lr
3008;
3009; CHECK-MVEFP-LABEL: vcmp_r_uge_v4f32:
3010; CHECK-MVEFP:       @ %bb.0: @ %entry
3011; CHECK-MVEFP-NEXT:    vcmp.f32 le, q0, zr
3012; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
3013; CHECK-MVEFP-NEXT:    bx lr
3014entry:
3015  %c = fcmp uge <4 x float> zeroinitializer, %src
3016  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
3017  ret <4 x float> %s
3018}
3019
3020define arm_aapcs_vfpcc <4 x float> @vcmp_r_ult_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
3021; CHECK-MVE-LABEL: vcmp_r_ult_v4f32:
3022; CHECK-MVE:       @ %bb.0: @ %entry
3023; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
3024; CHECK-MVE-NEXT:    movs r1, #0
3025; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3026; CHECK-MVE-NEXT:    it hi
3027; CHECK-MVE-NEXT:    movhi r1, #1
3028; CHECK-MVE-NEXT:    cmp r1, #0
3029; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
3030; CHECK-MVE-NEXT:    cset r1, ne
3031; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3032; CHECK-MVE-NEXT:    mov.w r2, #0
3033; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
3034; CHECK-MVE-NEXT:    it hi
3035; CHECK-MVE-NEXT:    movhi r2, #1
3036; CHECK-MVE-NEXT:    cmp r2, #0
3037; CHECK-MVE-NEXT:    cset r2, ne
3038; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3039; CHECK-MVE-NEXT:    mov.w r3, #0
3040; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
3041; CHECK-MVE-NEXT:    it hi
3042; CHECK-MVE-NEXT:    movhi r3, #1
3043; CHECK-MVE-NEXT:    cmp r3, #0
3044; CHECK-MVE-NEXT:    cset r3, ne
3045; CHECK-MVE-NEXT:    movs r0, #0
3046; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3047; CHECK-MVE-NEXT:    it hi
3048; CHECK-MVE-NEXT:    movhi r0, #1
3049; CHECK-MVE-NEXT:    cmp r0, #0
3050; CHECK-MVE-NEXT:    cset r0, ne
3051; CHECK-MVE-NEXT:    lsls r0, r0, #31
3052; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
3053; CHECK-MVE-NEXT:    lsls r0, r3, #31
3054; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
3055; CHECK-MVE-NEXT:    lsls r0, r2, #31
3056; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
3057; CHECK-MVE-NEXT:    lsls r0, r1, #31
3058; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
3059; CHECK-MVE-NEXT:    bx lr
3060;
3061; CHECK-MVEFP-LABEL: vcmp_r_ult_v4f32:
3062; CHECK-MVEFP:       @ %bb.0: @ %entry
3063; CHECK-MVEFP-NEXT:    vcmp.f32 gt, q0, zr
3064; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
3065; CHECK-MVEFP-NEXT:    bx lr
3066entry:
3067  %c = fcmp ult <4 x float> zeroinitializer, %src
3068  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
3069  ret <4 x float> %s
3070}
3071
3072define arm_aapcs_vfpcc <4 x float> @vcmp_r_ule_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
3073; CHECK-MVE-LABEL: vcmp_r_ule_v4f32:
3074; CHECK-MVE:       @ %bb.0: @ %entry
3075; CHECK-MVE-NEXT:    vcmp.f32 s0, #0
3076; CHECK-MVE-NEXT:    movs r1, #0
3077; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3078; CHECK-MVE-NEXT:    it pl
3079; CHECK-MVE-NEXT:    movpl r1, #1
3080; CHECK-MVE-NEXT:    cmp r1, #0
3081; CHECK-MVE-NEXT:    vcmp.f32 s1, #0
3082; CHECK-MVE-NEXT:    cset r1, ne
3083; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3084; CHECK-MVE-NEXT:    mov.w r2, #0
3085; CHECK-MVE-NEXT:    vcmp.f32 s2, #0
3086; CHECK-MVE-NEXT:    it pl
3087; CHECK-MVE-NEXT:    movpl r2, #1
3088; CHECK-MVE-NEXT:    cmp r2, #0
3089; CHECK-MVE-NEXT:    cset r2, ne
3090; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3091; CHECK-MVE-NEXT:    mov.w r3, #0
3092; CHECK-MVE-NEXT:    vcmp.f32 s3, #0
3093; CHECK-MVE-NEXT:    it pl
3094; CHECK-MVE-NEXT:    movpl r3, #1
3095; CHECK-MVE-NEXT:    cmp r3, #0
3096; CHECK-MVE-NEXT:    cset r3, ne
3097; CHECK-MVE-NEXT:    movs r0, #0
3098; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3099; CHECK-MVE-NEXT:    it pl
3100; CHECK-MVE-NEXT:    movpl r0, #1
3101; CHECK-MVE-NEXT:    cmp r0, #0
3102; CHECK-MVE-NEXT:    cset r0, ne
3103; CHECK-MVE-NEXT:    lsls r0, r0, #31
3104; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
3105; CHECK-MVE-NEXT:    lsls r0, r3, #31
3106; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
3107; CHECK-MVE-NEXT:    lsls r0, r2, #31
3108; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
3109; CHECK-MVE-NEXT:    lsls r0, r1, #31
3110; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
3111; CHECK-MVE-NEXT:    bx lr
3112;
3113; CHECK-MVEFP-LABEL: vcmp_r_ule_v4f32:
3114; CHECK-MVEFP:       @ %bb.0: @ %entry
3115; CHECK-MVEFP-NEXT:    vcmp.f32 ge, q0, zr
3116; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
3117; CHECK-MVEFP-NEXT:    bx lr
3118entry:
3119  %c = fcmp ule <4 x float> zeroinitializer, %src
3120  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
3121  ret <4 x float> %s
3122}
3123
3124define arm_aapcs_vfpcc <4 x float> @vcmp_r_ord_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
3125; CHECK-MVE-LABEL: vcmp_r_ord_v4f32:
3126; CHECK-MVE:       @ %bb.0: @ %entry
3127; CHECK-MVE-NEXT:    vcmp.f32 s0, s0
3128; CHECK-MVE-NEXT:    movs r1, #0
3129; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3130; CHECK-MVE-NEXT:    it vc
3131; CHECK-MVE-NEXT:    movvc r1, #1
3132; CHECK-MVE-NEXT:    cmp r1, #0
3133; CHECK-MVE-NEXT:    vcmp.f32 s1, s1
3134; CHECK-MVE-NEXT:    cset r1, ne
3135; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3136; CHECK-MVE-NEXT:    mov.w r2, #0
3137; CHECK-MVE-NEXT:    vcmp.f32 s2, s2
3138; CHECK-MVE-NEXT:    it vc
3139; CHECK-MVE-NEXT:    movvc r2, #1
3140; CHECK-MVE-NEXT:    cmp r2, #0
3141; CHECK-MVE-NEXT:    cset r2, ne
3142; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3143; CHECK-MVE-NEXT:    mov.w r3, #0
3144; CHECK-MVE-NEXT:    vcmp.f32 s3, s3
3145; CHECK-MVE-NEXT:    it vc
3146; CHECK-MVE-NEXT:    movvc r3, #1
3147; CHECK-MVE-NEXT:    cmp r3, #0
3148; CHECK-MVE-NEXT:    cset r3, ne
3149; CHECK-MVE-NEXT:    movs r0, #0
3150; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3151; CHECK-MVE-NEXT:    it vc
3152; CHECK-MVE-NEXT:    movvc r0, #1
3153; CHECK-MVE-NEXT:    cmp r0, #0
3154; CHECK-MVE-NEXT:    cset r0, ne
3155; CHECK-MVE-NEXT:    lsls r0, r0, #31
3156; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
3157; CHECK-MVE-NEXT:    lsls r0, r3, #31
3158; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
3159; CHECK-MVE-NEXT:    lsls r0, r2, #31
3160; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
3161; CHECK-MVE-NEXT:    lsls r0, r1, #31
3162; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
3163; CHECK-MVE-NEXT:    bx lr
3164;
3165; CHECK-MVEFP-LABEL: vcmp_r_ord_v4f32:
3166; CHECK-MVEFP:       @ %bb.0: @ %entry
3167; CHECK-MVEFP-NEXT:    vpt.f32 le, q0, zr
3168; CHECK-MVEFP-NEXT:    vcmpt.f32 gt, q0, zr
3169; CHECK-MVEFP-NEXT:    vpsel q0, q2, q1
3170; CHECK-MVEFP-NEXT:    bx lr
3171entry:
3172  %c = fcmp ord <4 x float> zeroinitializer, %src
3173  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
3174  ret <4 x float> %s
3175}
3176
3177define arm_aapcs_vfpcc <4 x float> @vcmp_r_uno_v4f32(<4 x float> %src, <4 x float> %a, <4 x float> %b) {
3178; CHECK-MVE-LABEL: vcmp_r_uno_v4f32:
3179; CHECK-MVE:       @ %bb.0: @ %entry
3180; CHECK-MVE-NEXT:    vcmp.f32 s0, s0
3181; CHECK-MVE-NEXT:    movs r1, #0
3182; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3183; CHECK-MVE-NEXT:    it vs
3184; CHECK-MVE-NEXT:    movvs r1, #1
3185; CHECK-MVE-NEXT:    cmp r1, #0
3186; CHECK-MVE-NEXT:    vcmp.f32 s1, s1
3187; CHECK-MVE-NEXT:    cset r1, ne
3188; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3189; CHECK-MVE-NEXT:    mov.w r2, #0
3190; CHECK-MVE-NEXT:    vcmp.f32 s2, s2
3191; CHECK-MVE-NEXT:    it vs
3192; CHECK-MVE-NEXT:    movvs r2, #1
3193; CHECK-MVE-NEXT:    cmp r2, #0
3194; CHECK-MVE-NEXT:    cset r2, ne
3195; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3196; CHECK-MVE-NEXT:    mov.w r3, #0
3197; CHECK-MVE-NEXT:    vcmp.f32 s3, s3
3198; CHECK-MVE-NEXT:    it vs
3199; CHECK-MVE-NEXT:    movvs r3, #1
3200; CHECK-MVE-NEXT:    cmp r3, #0
3201; CHECK-MVE-NEXT:    cset r3, ne
3202; CHECK-MVE-NEXT:    movs r0, #0
3203; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3204; CHECK-MVE-NEXT:    it vs
3205; CHECK-MVE-NEXT:    movvs r0, #1
3206; CHECK-MVE-NEXT:    cmp r0, #0
3207; CHECK-MVE-NEXT:    cset r0, ne
3208; CHECK-MVE-NEXT:    lsls r0, r0, #31
3209; CHECK-MVE-NEXT:    vseleq.f32 s3, s11, s7
3210; CHECK-MVE-NEXT:    lsls r0, r3, #31
3211; CHECK-MVE-NEXT:    vseleq.f32 s2, s10, s6
3212; CHECK-MVE-NEXT:    lsls r0, r2, #31
3213; CHECK-MVE-NEXT:    vseleq.f32 s1, s9, s5
3214; CHECK-MVE-NEXT:    lsls r0, r1, #31
3215; CHECK-MVE-NEXT:    vseleq.f32 s0, s8, s4
3216; CHECK-MVE-NEXT:    bx lr
3217;
3218; CHECK-MVEFP-LABEL: vcmp_r_uno_v4f32:
3219; CHECK-MVEFP:       @ %bb.0: @ %entry
3220; CHECK-MVEFP-NEXT:    vpt.f32 le, q0, zr
3221; CHECK-MVEFP-NEXT:    vcmpt.f32 gt, q0, zr
3222; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
3223; CHECK-MVEFP-NEXT:    bx lr
3224entry:
3225  %c = fcmp uno <4 x float> zeroinitializer, %src
3226  %s = select <4 x i1> %c, <4 x float> %a, <4 x float> %b
3227  ret <4 x float> %s
3228}
3229
3230
3231
3232define arm_aapcs_vfpcc <8 x half> @vcmp_r_oeq_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
3233; CHECK-MVE-LABEL: vcmp_r_oeq_v8f16:
3234; CHECK-MVE:       @ %bb.0: @ %entry
3235; CHECK-MVE-NEXT:    .vsave {d8, d9}
3236; CHECK-MVE-NEXT:    vpush {d8, d9}
3237; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
3238; CHECK-MVE-NEXT:    movs r1, #0
3239; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
3240; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
3241; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3242; CHECK-MVE-NEXT:    it eq
3243; CHECK-MVE-NEXT:    moveq r1, #1
3244; CHECK-MVE-NEXT:    cmp r1, #0
3245; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
3246; CHECK-MVE-NEXT:    cset r1, ne
3247; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
3248; CHECK-MVE-NEXT:    lsls r1, r1, #31
3249; CHECK-MVE-NEXT:    mov.w r2, #0
3250; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
3251; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3252; CHECK-MVE-NEXT:    it eq
3253; CHECK-MVE-NEXT:    moveq r2, #1
3254; CHECK-MVE-NEXT:    cmp r2, #0
3255; CHECK-MVE-NEXT:    cset r2, ne
3256; CHECK-MVE-NEXT:    vmov r1, s12
3257; CHECK-MVE-NEXT:    lsls r2, r2, #31
3258; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
3259; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
3260; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3261; CHECK-MVE-NEXT:    vmov r2, s12
3262; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
3263; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
3264; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
3265; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
3266; CHECK-MVE-NEXT:    mov.w r1, #0
3267; CHECK-MVE-NEXT:    it eq
3268; CHECK-MVE-NEXT:    moveq r1, #1
3269; CHECK-MVE-NEXT:    cmp r1, #0
3270; CHECK-MVE-NEXT:    cset r1, ne
3271; CHECK-MVE-NEXT:    movs r0, #0
3272; CHECK-MVE-NEXT:    lsls r1, r1, #31
3273; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
3274; CHECK-MVE-NEXT:    vmov r1, s16
3275; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
3276; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
3277; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
3278; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3279; CHECK-MVE-NEXT:    mov.w r1, #0
3280; CHECK-MVE-NEXT:    it eq
3281; CHECK-MVE-NEXT:    moveq r1, #1
3282; CHECK-MVE-NEXT:    cmp r1, #0
3283; CHECK-MVE-NEXT:    cset r1, ne
3284; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
3285; CHECK-MVE-NEXT:    lsls r1, r1, #31
3286; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
3287; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
3288; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3289; CHECK-MVE-NEXT:    vmov r1, s16
3290; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
3291; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
3292; CHECK-MVE-NEXT:    mov.w r1, #0
3293; CHECK-MVE-NEXT:    it eq
3294; CHECK-MVE-NEXT:    moveq r1, #1
3295; CHECK-MVE-NEXT:    cmp r1, #0
3296; CHECK-MVE-NEXT:    cset r1, ne
3297; CHECK-MVE-NEXT:    lsls r1, r1, #31
3298; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
3299; CHECK-MVE-NEXT:    vmov r1, s16
3300; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
3301; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
3302; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
3303; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3304; CHECK-MVE-NEXT:    mov.w r1, #0
3305; CHECK-MVE-NEXT:    it eq
3306; CHECK-MVE-NEXT:    moveq r1, #1
3307; CHECK-MVE-NEXT:    cmp r1, #0
3308; CHECK-MVE-NEXT:    cset r1, ne
3309; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
3310; CHECK-MVE-NEXT:    lsls r1, r1, #31
3311; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
3312; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
3313; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3314; CHECK-MVE-NEXT:    vmov r1, s16
3315; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
3316; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
3317; CHECK-MVE-NEXT:    mov.w r1, #0
3318; CHECK-MVE-NEXT:    it eq
3319; CHECK-MVE-NEXT:    moveq r1, #1
3320; CHECK-MVE-NEXT:    cmp r1, #0
3321; CHECK-MVE-NEXT:    cset r1, ne
3322; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
3323; CHECK-MVE-NEXT:    lsls r1, r1, #31
3324; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
3325; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
3326; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3327; CHECK-MVE-NEXT:    it eq
3328; CHECK-MVE-NEXT:    moveq r0, #1
3329; CHECK-MVE-NEXT:    cmp r0, #0
3330; CHECK-MVE-NEXT:    cset r0, ne
3331; CHECK-MVE-NEXT:    vmov r1, s16
3332; CHECK-MVE-NEXT:    lsls r0, r0, #31
3333; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
3334; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
3335; CHECK-MVE-NEXT:    vmov r0, s0
3336; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
3337; CHECK-MVE-NEXT:    vmov q0, q3
3338; CHECK-MVE-NEXT:    vpop {d8, d9}
3339; CHECK-MVE-NEXT:    bx lr
3340;
3341; CHECK-MVEFP-LABEL: vcmp_r_oeq_v8f16:
3342; CHECK-MVEFP:       @ %bb.0: @ %entry
3343; CHECK-MVEFP-NEXT:    vcmp.f16 eq, q0, zr
3344; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
3345; CHECK-MVEFP-NEXT:    bx lr
3346entry:
3347  %c = fcmp oeq <8 x half> zeroinitializer, %src
3348  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
3349  ret <8 x half> %s
3350}
3351
3352define arm_aapcs_vfpcc <8 x half> @vcmp_r_one_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
3353; CHECK-MVE-LABEL: vcmp_r_one_v8f16:
3354; CHECK-MVE:       @ %bb.0: @ %entry
3355; CHECK-MVE-NEXT:    .vsave {d8, d9}
3356; CHECK-MVE-NEXT:    vpush {d8, d9}
3357; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
3358; CHECK-MVE-NEXT:    movs r1, #0
3359; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
3360; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
3361; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3362; CHECK-MVE-NEXT:    it mi
3363; CHECK-MVE-NEXT:    movmi r1, #1
3364; CHECK-MVE-NEXT:    it gt
3365; CHECK-MVE-NEXT:    movgt r1, #1
3366; CHECK-MVE-NEXT:    cmp r1, #0
3367; CHECK-MVE-NEXT:    cset r1, ne
3368; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
3369; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
3370; CHECK-MVE-NEXT:    lsls r1, r1, #31
3371; CHECK-MVE-NEXT:    mov.w r2, #0
3372; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
3373; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3374; CHECK-MVE-NEXT:    it mi
3375; CHECK-MVE-NEXT:    movmi r2, #1
3376; CHECK-MVE-NEXT:    it gt
3377; CHECK-MVE-NEXT:    movgt r2, #1
3378; CHECK-MVE-NEXT:    cmp r2, #0
3379; CHECK-MVE-NEXT:    cset r2, ne
3380; CHECK-MVE-NEXT:    vmov r1, s12
3381; CHECK-MVE-NEXT:    lsls r2, r2, #31
3382; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
3383; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
3384; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3385; CHECK-MVE-NEXT:    vmov r2, s12
3386; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
3387; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
3388; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
3389; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
3390; CHECK-MVE-NEXT:    mov.w r1, #0
3391; CHECK-MVE-NEXT:    it mi
3392; CHECK-MVE-NEXT:    movmi r1, #1
3393; CHECK-MVE-NEXT:    mov.w r0, #0
3394; CHECK-MVE-NEXT:    it gt
3395; CHECK-MVE-NEXT:    movgt r1, #1
3396; CHECK-MVE-NEXT:    cmp r1, #0
3397; CHECK-MVE-NEXT:    cset r1, ne
3398; CHECK-MVE-NEXT:    lsls r1, r1, #31
3399; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
3400; CHECK-MVE-NEXT:    vmov r1, s16
3401; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
3402; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
3403; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
3404; CHECK-MVE-NEXT:    movs r1, #0
3405; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3406; CHECK-MVE-NEXT:    it mi
3407; CHECK-MVE-NEXT:    movmi r1, #1
3408; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
3409; CHECK-MVE-NEXT:    it gt
3410; CHECK-MVE-NEXT:    movgt r1, #1
3411; CHECK-MVE-NEXT:    cmp r1, #0
3412; CHECK-MVE-NEXT:    cset r1, ne
3413; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
3414; CHECK-MVE-NEXT:    lsls r1, r1, #31
3415; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
3416; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3417; CHECK-MVE-NEXT:    vmov r1, s16
3418; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
3419; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
3420; CHECK-MVE-NEXT:    mov.w r1, #0
3421; CHECK-MVE-NEXT:    it mi
3422; CHECK-MVE-NEXT:    movmi r1, #1
3423; CHECK-MVE-NEXT:    it gt
3424; CHECK-MVE-NEXT:    movgt r1, #1
3425; CHECK-MVE-NEXT:    cmp r1, #0
3426; CHECK-MVE-NEXT:    cset r1, ne
3427; CHECK-MVE-NEXT:    lsls r1, r1, #31
3428; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
3429; CHECK-MVE-NEXT:    vmov r1, s16
3430; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
3431; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
3432; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
3433; CHECK-MVE-NEXT:    movs r1, #0
3434; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3435; CHECK-MVE-NEXT:    it mi
3436; CHECK-MVE-NEXT:    movmi r1, #1
3437; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
3438; CHECK-MVE-NEXT:    it gt
3439; CHECK-MVE-NEXT:    movgt r1, #1
3440; CHECK-MVE-NEXT:    cmp r1, #0
3441; CHECK-MVE-NEXT:    cset r1, ne
3442; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
3443; CHECK-MVE-NEXT:    lsls r1, r1, #31
3444; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
3445; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
3446; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3447; CHECK-MVE-NEXT:    vmov r1, s16
3448; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
3449; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
3450; CHECK-MVE-NEXT:    mov.w r1, #0
3451; CHECK-MVE-NEXT:    it mi
3452; CHECK-MVE-NEXT:    movmi r1, #1
3453; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
3454; CHECK-MVE-NEXT:    it gt
3455; CHECK-MVE-NEXT:    movgt r1, #1
3456; CHECK-MVE-NEXT:    cmp r1, #0
3457; CHECK-MVE-NEXT:    cset r1, ne
3458; CHECK-MVE-NEXT:    lsls r1, r1, #31
3459; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
3460; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3461; CHECK-MVE-NEXT:    it mi
3462; CHECK-MVE-NEXT:    movmi r0, #1
3463; CHECK-MVE-NEXT:    vmov r1, s16
3464; CHECK-MVE-NEXT:    it gt
3465; CHECK-MVE-NEXT:    movgt r0, #1
3466; CHECK-MVE-NEXT:    cmp r0, #0
3467; CHECK-MVE-NEXT:    cset r0, ne
3468; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
3469; CHECK-MVE-NEXT:    lsls r0, r0, #31
3470; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
3471; CHECK-MVE-NEXT:    vmov r0, s0
3472; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
3473; CHECK-MVE-NEXT:    vmov q0, q3
3474; CHECK-MVE-NEXT:    vpop {d8, d9}
3475; CHECK-MVE-NEXT:    bx lr
3476;
3477; CHECK-MVEFP-LABEL: vcmp_r_one_v8f16:
3478; CHECK-MVEFP:       @ %bb.0: @ %entry
3479; CHECK-MVEFP-NEXT:    vpt.f16 le, q0, zr
3480; CHECK-MVEFP-NEXT:    vcmpt.f16 ge, q0, zr
3481; CHECK-MVEFP-NEXT:    vpsel q0, q2, q1
3482; CHECK-MVEFP-NEXT:    bx lr
3483entry:
3484  %c = fcmp one <8 x half> zeroinitializer, %src
3485  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
3486  ret <8 x half> %s
3487}
3488
3489define arm_aapcs_vfpcc <8 x half> @vcmp_r_ogt_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
3490; CHECK-MVE-LABEL: vcmp_r_ogt_v8f16:
3491; CHECK-MVE:       @ %bb.0: @ %entry
3492; CHECK-MVE-NEXT:    .vsave {d8, d9}
3493; CHECK-MVE-NEXT:    vpush {d8, d9}
3494; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
3495; CHECK-MVE-NEXT:    movs r1, #0
3496; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
3497; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
3498; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3499; CHECK-MVE-NEXT:    it mi
3500; CHECK-MVE-NEXT:    movmi r1, #1
3501; CHECK-MVE-NEXT:    cmp r1, #0
3502; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
3503; CHECK-MVE-NEXT:    cset r1, ne
3504; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
3505; CHECK-MVE-NEXT:    lsls r1, r1, #31
3506; CHECK-MVE-NEXT:    mov.w r2, #0
3507; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
3508; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3509; CHECK-MVE-NEXT:    it mi
3510; CHECK-MVE-NEXT:    movmi r2, #1
3511; CHECK-MVE-NEXT:    cmp r2, #0
3512; CHECK-MVE-NEXT:    cset r2, ne
3513; CHECK-MVE-NEXT:    vmov r1, s12
3514; CHECK-MVE-NEXT:    lsls r2, r2, #31
3515; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
3516; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
3517; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3518; CHECK-MVE-NEXT:    vmov r2, s12
3519; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
3520; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
3521; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
3522; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
3523; CHECK-MVE-NEXT:    mov.w r1, #0
3524; CHECK-MVE-NEXT:    it mi
3525; CHECK-MVE-NEXT:    movmi r1, #1
3526; CHECK-MVE-NEXT:    cmp r1, #0
3527; CHECK-MVE-NEXT:    cset r1, ne
3528; CHECK-MVE-NEXT:    movs r0, #0
3529; CHECK-MVE-NEXT:    lsls r1, r1, #31
3530; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
3531; CHECK-MVE-NEXT:    vmov r1, s16
3532; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
3533; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
3534; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
3535; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3536; CHECK-MVE-NEXT:    mov.w r1, #0
3537; CHECK-MVE-NEXT:    it mi
3538; CHECK-MVE-NEXT:    movmi r1, #1
3539; CHECK-MVE-NEXT:    cmp r1, #0
3540; CHECK-MVE-NEXT:    cset r1, ne
3541; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
3542; CHECK-MVE-NEXT:    lsls r1, r1, #31
3543; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
3544; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
3545; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3546; CHECK-MVE-NEXT:    vmov r1, s16
3547; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
3548; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
3549; CHECK-MVE-NEXT:    mov.w r1, #0
3550; CHECK-MVE-NEXT:    it mi
3551; CHECK-MVE-NEXT:    movmi r1, #1
3552; CHECK-MVE-NEXT:    cmp r1, #0
3553; CHECK-MVE-NEXT:    cset r1, ne
3554; CHECK-MVE-NEXT:    lsls r1, r1, #31
3555; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
3556; CHECK-MVE-NEXT:    vmov r1, s16
3557; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
3558; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
3559; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
3560; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3561; CHECK-MVE-NEXT:    mov.w r1, #0
3562; CHECK-MVE-NEXT:    it mi
3563; CHECK-MVE-NEXT:    movmi r1, #1
3564; CHECK-MVE-NEXT:    cmp r1, #0
3565; CHECK-MVE-NEXT:    cset r1, ne
3566; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
3567; CHECK-MVE-NEXT:    lsls r1, r1, #31
3568; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
3569; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
3570; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3571; CHECK-MVE-NEXT:    vmov r1, s16
3572; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
3573; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
3574; CHECK-MVE-NEXT:    mov.w r1, #0
3575; CHECK-MVE-NEXT:    it mi
3576; CHECK-MVE-NEXT:    movmi r1, #1
3577; CHECK-MVE-NEXT:    cmp r1, #0
3578; CHECK-MVE-NEXT:    cset r1, ne
3579; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
3580; CHECK-MVE-NEXT:    lsls r1, r1, #31
3581; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
3582; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
3583; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3584; CHECK-MVE-NEXT:    it mi
3585; CHECK-MVE-NEXT:    movmi r0, #1
3586; CHECK-MVE-NEXT:    cmp r0, #0
3587; CHECK-MVE-NEXT:    cset r0, ne
3588; CHECK-MVE-NEXT:    vmov r1, s16
3589; CHECK-MVE-NEXT:    lsls r0, r0, #31
3590; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
3591; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
3592; CHECK-MVE-NEXT:    vmov r0, s0
3593; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
3594; CHECK-MVE-NEXT:    vmov q0, q3
3595; CHECK-MVE-NEXT:    vpop {d8, d9}
3596; CHECK-MVE-NEXT:    bx lr
3597;
3598; CHECK-MVEFP-LABEL: vcmp_r_ogt_v8f16:
3599; CHECK-MVEFP:       @ %bb.0: @ %entry
3600; CHECK-MVEFP-NEXT:    vcmp.f16 lt, q0, zr
3601; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
3602; CHECK-MVEFP-NEXT:    bx lr
3603entry:
3604  %c = fcmp ogt <8 x half> zeroinitializer, %src
3605  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
3606  ret <8 x half> %s
3607}
3608
3609define arm_aapcs_vfpcc <8 x half> @vcmp_r_oge_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
3610; CHECK-MVE-LABEL: vcmp_r_oge_v8f16:
3611; CHECK-MVE:       @ %bb.0: @ %entry
3612; CHECK-MVE-NEXT:    .vsave {d8, d9}
3613; CHECK-MVE-NEXT:    vpush {d8, d9}
3614; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
3615; CHECK-MVE-NEXT:    movs r1, #0
3616; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
3617; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
3618; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3619; CHECK-MVE-NEXT:    it ls
3620; CHECK-MVE-NEXT:    movls r1, #1
3621; CHECK-MVE-NEXT:    cmp r1, #0
3622; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
3623; CHECK-MVE-NEXT:    cset r1, ne
3624; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
3625; CHECK-MVE-NEXT:    lsls r1, r1, #31
3626; CHECK-MVE-NEXT:    mov.w r2, #0
3627; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
3628; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3629; CHECK-MVE-NEXT:    it ls
3630; CHECK-MVE-NEXT:    movls r2, #1
3631; CHECK-MVE-NEXT:    cmp r2, #0
3632; CHECK-MVE-NEXT:    cset r2, ne
3633; CHECK-MVE-NEXT:    vmov r1, s12
3634; CHECK-MVE-NEXT:    lsls r2, r2, #31
3635; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
3636; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
3637; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3638; CHECK-MVE-NEXT:    vmov r2, s12
3639; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
3640; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
3641; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
3642; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
3643; CHECK-MVE-NEXT:    mov.w r1, #0
3644; CHECK-MVE-NEXT:    it ls
3645; CHECK-MVE-NEXT:    movls r1, #1
3646; CHECK-MVE-NEXT:    cmp r1, #0
3647; CHECK-MVE-NEXT:    cset r1, ne
3648; CHECK-MVE-NEXT:    movs r0, #0
3649; CHECK-MVE-NEXT:    lsls r1, r1, #31
3650; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
3651; CHECK-MVE-NEXT:    vmov r1, s16
3652; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
3653; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
3654; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
3655; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3656; CHECK-MVE-NEXT:    mov.w r1, #0
3657; CHECK-MVE-NEXT:    it ls
3658; CHECK-MVE-NEXT:    movls r1, #1
3659; CHECK-MVE-NEXT:    cmp r1, #0
3660; CHECK-MVE-NEXT:    cset r1, ne
3661; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
3662; CHECK-MVE-NEXT:    lsls r1, r1, #31
3663; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
3664; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
3665; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3666; CHECK-MVE-NEXT:    vmov r1, s16
3667; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
3668; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
3669; CHECK-MVE-NEXT:    mov.w r1, #0
3670; CHECK-MVE-NEXT:    it ls
3671; CHECK-MVE-NEXT:    movls r1, #1
3672; CHECK-MVE-NEXT:    cmp r1, #0
3673; CHECK-MVE-NEXT:    cset r1, ne
3674; CHECK-MVE-NEXT:    lsls r1, r1, #31
3675; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
3676; CHECK-MVE-NEXT:    vmov r1, s16
3677; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
3678; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
3679; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
3680; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3681; CHECK-MVE-NEXT:    mov.w r1, #0
3682; CHECK-MVE-NEXT:    it ls
3683; CHECK-MVE-NEXT:    movls r1, #1
3684; CHECK-MVE-NEXT:    cmp r1, #0
3685; CHECK-MVE-NEXT:    cset r1, ne
3686; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
3687; CHECK-MVE-NEXT:    lsls r1, r1, #31
3688; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
3689; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
3690; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3691; CHECK-MVE-NEXT:    vmov r1, s16
3692; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
3693; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
3694; CHECK-MVE-NEXT:    mov.w r1, #0
3695; CHECK-MVE-NEXT:    it ls
3696; CHECK-MVE-NEXT:    movls r1, #1
3697; CHECK-MVE-NEXT:    cmp r1, #0
3698; CHECK-MVE-NEXT:    cset r1, ne
3699; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
3700; CHECK-MVE-NEXT:    lsls r1, r1, #31
3701; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
3702; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
3703; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3704; CHECK-MVE-NEXT:    it ls
3705; CHECK-MVE-NEXT:    movls r0, #1
3706; CHECK-MVE-NEXT:    cmp r0, #0
3707; CHECK-MVE-NEXT:    cset r0, ne
3708; CHECK-MVE-NEXT:    vmov r1, s16
3709; CHECK-MVE-NEXT:    lsls r0, r0, #31
3710; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
3711; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
3712; CHECK-MVE-NEXT:    vmov r0, s0
3713; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
3714; CHECK-MVE-NEXT:    vmov q0, q3
3715; CHECK-MVE-NEXT:    vpop {d8, d9}
3716; CHECK-MVE-NEXT:    bx lr
3717;
3718; CHECK-MVEFP-LABEL: vcmp_r_oge_v8f16:
3719; CHECK-MVEFP:       @ %bb.0: @ %entry
3720; CHECK-MVEFP-NEXT:    vcmp.f16 le, q0, zr
3721; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
3722; CHECK-MVEFP-NEXT:    bx lr
3723entry:
3724  %c = fcmp oge <8 x half> zeroinitializer, %src
3725  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
3726  ret <8 x half> %s
3727}
3728
3729define arm_aapcs_vfpcc <8 x half> @vcmp_r_olt_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
3730; CHECK-MVE-LABEL: vcmp_r_olt_v8f16:
3731; CHECK-MVE:       @ %bb.0: @ %entry
3732; CHECK-MVE-NEXT:    .vsave {d8, d9}
3733; CHECK-MVE-NEXT:    vpush {d8, d9}
3734; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
3735; CHECK-MVE-NEXT:    movs r1, #0
3736; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
3737; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
3738; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3739; CHECK-MVE-NEXT:    it gt
3740; CHECK-MVE-NEXT:    movgt r1, #1
3741; CHECK-MVE-NEXT:    cmp r1, #0
3742; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
3743; CHECK-MVE-NEXT:    cset r1, ne
3744; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
3745; CHECK-MVE-NEXT:    lsls r1, r1, #31
3746; CHECK-MVE-NEXT:    mov.w r2, #0
3747; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
3748; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3749; CHECK-MVE-NEXT:    it gt
3750; CHECK-MVE-NEXT:    movgt r2, #1
3751; CHECK-MVE-NEXT:    cmp r2, #0
3752; CHECK-MVE-NEXT:    cset r2, ne
3753; CHECK-MVE-NEXT:    vmov r1, s12
3754; CHECK-MVE-NEXT:    lsls r2, r2, #31
3755; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
3756; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
3757; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3758; CHECK-MVE-NEXT:    vmov r2, s12
3759; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
3760; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
3761; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
3762; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
3763; CHECK-MVE-NEXT:    mov.w r1, #0
3764; CHECK-MVE-NEXT:    it gt
3765; CHECK-MVE-NEXT:    movgt r1, #1
3766; CHECK-MVE-NEXT:    cmp r1, #0
3767; CHECK-MVE-NEXT:    cset r1, ne
3768; CHECK-MVE-NEXT:    movs r0, #0
3769; CHECK-MVE-NEXT:    lsls r1, r1, #31
3770; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
3771; CHECK-MVE-NEXT:    vmov r1, s16
3772; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
3773; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
3774; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
3775; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3776; CHECK-MVE-NEXT:    mov.w r1, #0
3777; CHECK-MVE-NEXT:    it gt
3778; CHECK-MVE-NEXT:    movgt r1, #1
3779; CHECK-MVE-NEXT:    cmp r1, #0
3780; CHECK-MVE-NEXT:    cset r1, ne
3781; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
3782; CHECK-MVE-NEXT:    lsls r1, r1, #31
3783; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
3784; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
3785; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3786; CHECK-MVE-NEXT:    vmov r1, s16
3787; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
3788; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
3789; CHECK-MVE-NEXT:    mov.w r1, #0
3790; CHECK-MVE-NEXT:    it gt
3791; CHECK-MVE-NEXT:    movgt r1, #1
3792; CHECK-MVE-NEXT:    cmp r1, #0
3793; CHECK-MVE-NEXT:    cset r1, ne
3794; CHECK-MVE-NEXT:    lsls r1, r1, #31
3795; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
3796; CHECK-MVE-NEXT:    vmov r1, s16
3797; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
3798; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
3799; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
3800; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3801; CHECK-MVE-NEXT:    mov.w r1, #0
3802; CHECK-MVE-NEXT:    it gt
3803; CHECK-MVE-NEXT:    movgt r1, #1
3804; CHECK-MVE-NEXT:    cmp r1, #0
3805; CHECK-MVE-NEXT:    cset r1, ne
3806; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
3807; CHECK-MVE-NEXT:    lsls r1, r1, #31
3808; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
3809; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
3810; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3811; CHECK-MVE-NEXT:    vmov r1, s16
3812; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
3813; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
3814; CHECK-MVE-NEXT:    mov.w r1, #0
3815; CHECK-MVE-NEXT:    it gt
3816; CHECK-MVE-NEXT:    movgt r1, #1
3817; CHECK-MVE-NEXT:    cmp r1, #0
3818; CHECK-MVE-NEXT:    cset r1, ne
3819; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
3820; CHECK-MVE-NEXT:    lsls r1, r1, #31
3821; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
3822; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
3823; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3824; CHECK-MVE-NEXT:    it gt
3825; CHECK-MVE-NEXT:    movgt r0, #1
3826; CHECK-MVE-NEXT:    cmp r0, #0
3827; CHECK-MVE-NEXT:    cset r0, ne
3828; CHECK-MVE-NEXT:    vmov r1, s16
3829; CHECK-MVE-NEXT:    lsls r0, r0, #31
3830; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
3831; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
3832; CHECK-MVE-NEXT:    vmov r0, s0
3833; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
3834; CHECK-MVE-NEXT:    vmov q0, q3
3835; CHECK-MVE-NEXT:    vpop {d8, d9}
3836; CHECK-MVE-NEXT:    bx lr
3837;
3838; CHECK-MVEFP-LABEL: vcmp_r_olt_v8f16:
3839; CHECK-MVEFP:       @ %bb.0: @ %entry
3840; CHECK-MVEFP-NEXT:    vcmp.f16 gt, q0, zr
3841; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
3842; CHECK-MVEFP-NEXT:    bx lr
3843entry:
3844  %c = fcmp olt <8 x half> zeroinitializer, %src
3845  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
3846  ret <8 x half> %s
3847}
3848
3849define arm_aapcs_vfpcc <8 x half> @vcmp_r_ole_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
3850; CHECK-MVE-LABEL: vcmp_r_ole_v8f16:
3851; CHECK-MVE:       @ %bb.0: @ %entry
3852; CHECK-MVE-NEXT:    .vsave {d8, d9}
3853; CHECK-MVE-NEXT:    vpush {d8, d9}
3854; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
3855; CHECK-MVE-NEXT:    movs r1, #0
3856; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
3857; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
3858; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3859; CHECK-MVE-NEXT:    it ge
3860; CHECK-MVE-NEXT:    movge r1, #1
3861; CHECK-MVE-NEXT:    cmp r1, #0
3862; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
3863; CHECK-MVE-NEXT:    cset r1, ne
3864; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
3865; CHECK-MVE-NEXT:    lsls r1, r1, #31
3866; CHECK-MVE-NEXT:    mov.w r2, #0
3867; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
3868; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3869; CHECK-MVE-NEXT:    it ge
3870; CHECK-MVE-NEXT:    movge r2, #1
3871; CHECK-MVE-NEXT:    cmp r2, #0
3872; CHECK-MVE-NEXT:    cset r2, ne
3873; CHECK-MVE-NEXT:    vmov r1, s12
3874; CHECK-MVE-NEXT:    lsls r2, r2, #31
3875; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
3876; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
3877; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3878; CHECK-MVE-NEXT:    vmov r2, s12
3879; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
3880; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
3881; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
3882; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
3883; CHECK-MVE-NEXT:    mov.w r1, #0
3884; CHECK-MVE-NEXT:    it ge
3885; CHECK-MVE-NEXT:    movge r1, #1
3886; CHECK-MVE-NEXT:    cmp r1, #0
3887; CHECK-MVE-NEXT:    cset r1, ne
3888; CHECK-MVE-NEXT:    movs r0, #0
3889; CHECK-MVE-NEXT:    lsls r1, r1, #31
3890; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
3891; CHECK-MVE-NEXT:    vmov r1, s16
3892; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
3893; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
3894; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
3895; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3896; CHECK-MVE-NEXT:    mov.w r1, #0
3897; CHECK-MVE-NEXT:    it ge
3898; CHECK-MVE-NEXT:    movge r1, #1
3899; CHECK-MVE-NEXT:    cmp r1, #0
3900; CHECK-MVE-NEXT:    cset r1, ne
3901; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
3902; CHECK-MVE-NEXT:    lsls r1, r1, #31
3903; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
3904; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
3905; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3906; CHECK-MVE-NEXT:    vmov r1, s16
3907; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
3908; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
3909; CHECK-MVE-NEXT:    mov.w r1, #0
3910; CHECK-MVE-NEXT:    it ge
3911; CHECK-MVE-NEXT:    movge r1, #1
3912; CHECK-MVE-NEXT:    cmp r1, #0
3913; CHECK-MVE-NEXT:    cset r1, ne
3914; CHECK-MVE-NEXT:    lsls r1, r1, #31
3915; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
3916; CHECK-MVE-NEXT:    vmov r1, s16
3917; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
3918; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
3919; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
3920; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3921; CHECK-MVE-NEXT:    mov.w r1, #0
3922; CHECK-MVE-NEXT:    it ge
3923; CHECK-MVE-NEXT:    movge r1, #1
3924; CHECK-MVE-NEXT:    cmp r1, #0
3925; CHECK-MVE-NEXT:    cset r1, ne
3926; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
3927; CHECK-MVE-NEXT:    lsls r1, r1, #31
3928; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
3929; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
3930; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3931; CHECK-MVE-NEXT:    vmov r1, s16
3932; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
3933; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
3934; CHECK-MVE-NEXT:    mov.w r1, #0
3935; CHECK-MVE-NEXT:    it ge
3936; CHECK-MVE-NEXT:    movge r1, #1
3937; CHECK-MVE-NEXT:    cmp r1, #0
3938; CHECK-MVE-NEXT:    cset r1, ne
3939; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
3940; CHECK-MVE-NEXT:    lsls r1, r1, #31
3941; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
3942; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
3943; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3944; CHECK-MVE-NEXT:    it ge
3945; CHECK-MVE-NEXT:    movge r0, #1
3946; CHECK-MVE-NEXT:    cmp r0, #0
3947; CHECK-MVE-NEXT:    cset r0, ne
3948; CHECK-MVE-NEXT:    vmov r1, s16
3949; CHECK-MVE-NEXT:    lsls r0, r0, #31
3950; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
3951; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
3952; CHECK-MVE-NEXT:    vmov r0, s0
3953; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
3954; CHECK-MVE-NEXT:    vmov q0, q3
3955; CHECK-MVE-NEXT:    vpop {d8, d9}
3956; CHECK-MVE-NEXT:    bx lr
3957;
3958; CHECK-MVEFP-LABEL: vcmp_r_ole_v8f16:
3959; CHECK-MVEFP:       @ %bb.0: @ %entry
3960; CHECK-MVEFP-NEXT:    vcmp.f16 ge, q0, zr
3961; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
3962; CHECK-MVEFP-NEXT:    bx lr
3963entry:
3964  %c = fcmp ole <8 x half> zeroinitializer, %src
3965  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
3966  ret <8 x half> %s
3967}
3968
3969define arm_aapcs_vfpcc <8 x half> @vcmp_r_ueq_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
3970; CHECK-MVE-LABEL: vcmp_r_ueq_v8f16:
3971; CHECK-MVE:       @ %bb.0: @ %entry
3972; CHECK-MVE-NEXT:    .vsave {d8, d9}
3973; CHECK-MVE-NEXT:    vpush {d8, d9}
3974; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
3975; CHECK-MVE-NEXT:    movs r1, #0
3976; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
3977; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
3978; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3979; CHECK-MVE-NEXT:    it eq
3980; CHECK-MVE-NEXT:    moveq r1, #1
3981; CHECK-MVE-NEXT:    it vs
3982; CHECK-MVE-NEXT:    movvs r1, #1
3983; CHECK-MVE-NEXT:    cmp r1, #0
3984; CHECK-MVE-NEXT:    cset r1, ne
3985; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
3986; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
3987; CHECK-MVE-NEXT:    lsls r1, r1, #31
3988; CHECK-MVE-NEXT:    mov.w r2, #0
3989; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
3990; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
3991; CHECK-MVE-NEXT:    it eq
3992; CHECK-MVE-NEXT:    moveq r2, #1
3993; CHECK-MVE-NEXT:    it vs
3994; CHECK-MVE-NEXT:    movvs r2, #1
3995; CHECK-MVE-NEXT:    cmp r2, #0
3996; CHECK-MVE-NEXT:    cset r2, ne
3997; CHECK-MVE-NEXT:    vmov r1, s12
3998; CHECK-MVE-NEXT:    lsls r2, r2, #31
3999; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
4000; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
4001; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4002; CHECK-MVE-NEXT:    vmov r2, s12
4003; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
4004; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
4005; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
4006; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
4007; CHECK-MVE-NEXT:    mov.w r1, #0
4008; CHECK-MVE-NEXT:    it eq
4009; CHECK-MVE-NEXT:    moveq r1, #1
4010; CHECK-MVE-NEXT:    mov.w r0, #0
4011; CHECK-MVE-NEXT:    it vs
4012; CHECK-MVE-NEXT:    movvs r1, #1
4013; CHECK-MVE-NEXT:    cmp r1, #0
4014; CHECK-MVE-NEXT:    cset r1, ne
4015; CHECK-MVE-NEXT:    lsls r1, r1, #31
4016; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
4017; CHECK-MVE-NEXT:    vmov r1, s16
4018; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
4019; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
4020; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
4021; CHECK-MVE-NEXT:    movs r1, #0
4022; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4023; CHECK-MVE-NEXT:    it eq
4024; CHECK-MVE-NEXT:    moveq r1, #1
4025; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
4026; CHECK-MVE-NEXT:    it vs
4027; CHECK-MVE-NEXT:    movvs r1, #1
4028; CHECK-MVE-NEXT:    cmp r1, #0
4029; CHECK-MVE-NEXT:    cset r1, ne
4030; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
4031; CHECK-MVE-NEXT:    lsls r1, r1, #31
4032; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
4033; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4034; CHECK-MVE-NEXT:    vmov r1, s16
4035; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
4036; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
4037; CHECK-MVE-NEXT:    mov.w r1, #0
4038; CHECK-MVE-NEXT:    it eq
4039; CHECK-MVE-NEXT:    moveq r1, #1
4040; CHECK-MVE-NEXT:    it vs
4041; CHECK-MVE-NEXT:    movvs r1, #1
4042; CHECK-MVE-NEXT:    cmp r1, #0
4043; CHECK-MVE-NEXT:    cset r1, ne
4044; CHECK-MVE-NEXT:    lsls r1, r1, #31
4045; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
4046; CHECK-MVE-NEXT:    vmov r1, s16
4047; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
4048; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
4049; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
4050; CHECK-MVE-NEXT:    movs r1, #0
4051; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4052; CHECK-MVE-NEXT:    it eq
4053; CHECK-MVE-NEXT:    moveq r1, #1
4054; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
4055; CHECK-MVE-NEXT:    it vs
4056; CHECK-MVE-NEXT:    movvs r1, #1
4057; CHECK-MVE-NEXT:    cmp r1, #0
4058; CHECK-MVE-NEXT:    cset r1, ne
4059; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
4060; CHECK-MVE-NEXT:    lsls r1, r1, #31
4061; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
4062; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
4063; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4064; CHECK-MVE-NEXT:    vmov r1, s16
4065; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
4066; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
4067; CHECK-MVE-NEXT:    mov.w r1, #0
4068; CHECK-MVE-NEXT:    it eq
4069; CHECK-MVE-NEXT:    moveq r1, #1
4070; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
4071; CHECK-MVE-NEXT:    it vs
4072; CHECK-MVE-NEXT:    movvs r1, #1
4073; CHECK-MVE-NEXT:    cmp r1, #0
4074; CHECK-MVE-NEXT:    cset r1, ne
4075; CHECK-MVE-NEXT:    lsls r1, r1, #31
4076; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
4077; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4078; CHECK-MVE-NEXT:    it eq
4079; CHECK-MVE-NEXT:    moveq r0, #1
4080; CHECK-MVE-NEXT:    vmov r1, s16
4081; CHECK-MVE-NEXT:    it vs
4082; CHECK-MVE-NEXT:    movvs r0, #1
4083; CHECK-MVE-NEXT:    cmp r0, #0
4084; CHECK-MVE-NEXT:    cset r0, ne
4085; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
4086; CHECK-MVE-NEXT:    lsls r0, r0, #31
4087; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
4088; CHECK-MVE-NEXT:    vmov r0, s0
4089; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
4090; CHECK-MVE-NEXT:    vmov q0, q3
4091; CHECK-MVE-NEXT:    vpop {d8, d9}
4092; CHECK-MVE-NEXT:    bx lr
4093;
4094; CHECK-MVEFP-LABEL: vcmp_r_ueq_v8f16:
4095; CHECK-MVEFP:       @ %bb.0: @ %entry
4096; CHECK-MVEFP-NEXT:    vpt.f16 le, q0, zr
4097; CHECK-MVEFP-NEXT:    vcmpt.f16 ge, q0, zr
4098; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
4099; CHECK-MVEFP-NEXT:    bx lr
4100entry:
4101  %c = fcmp ueq <8 x half> zeroinitializer, %src
4102  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
4103  ret <8 x half> %s
4104}
4105
4106define arm_aapcs_vfpcc <8 x half> @vcmp_r_une_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
4107; CHECK-MVE-LABEL: vcmp_r_une_v8f16:
4108; CHECK-MVE:       @ %bb.0: @ %entry
4109; CHECK-MVE-NEXT:    .vsave {d8, d9}
4110; CHECK-MVE-NEXT:    vpush {d8, d9}
4111; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
4112; CHECK-MVE-NEXT:    movs r1, #0
4113; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
4114; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
4115; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4116; CHECK-MVE-NEXT:    it ne
4117; CHECK-MVE-NEXT:    movne r1, #1
4118; CHECK-MVE-NEXT:    cmp r1, #0
4119; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
4120; CHECK-MVE-NEXT:    cset r1, ne
4121; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
4122; CHECK-MVE-NEXT:    lsls r1, r1, #31
4123; CHECK-MVE-NEXT:    mov.w r2, #0
4124; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
4125; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4126; CHECK-MVE-NEXT:    it ne
4127; CHECK-MVE-NEXT:    movne r2, #1
4128; CHECK-MVE-NEXT:    cmp r2, #0
4129; CHECK-MVE-NEXT:    cset r2, ne
4130; CHECK-MVE-NEXT:    vmov r1, s12
4131; CHECK-MVE-NEXT:    lsls r2, r2, #31
4132; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
4133; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
4134; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4135; CHECK-MVE-NEXT:    vmov r2, s12
4136; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
4137; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
4138; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
4139; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
4140; CHECK-MVE-NEXT:    mov.w r1, #0
4141; CHECK-MVE-NEXT:    it ne
4142; CHECK-MVE-NEXT:    movne r1, #1
4143; CHECK-MVE-NEXT:    cmp r1, #0
4144; CHECK-MVE-NEXT:    cset r1, ne
4145; CHECK-MVE-NEXT:    movs r0, #0
4146; CHECK-MVE-NEXT:    lsls r1, r1, #31
4147; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
4148; CHECK-MVE-NEXT:    vmov r1, s16
4149; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
4150; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
4151; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
4152; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4153; CHECK-MVE-NEXT:    mov.w r1, #0
4154; CHECK-MVE-NEXT:    it ne
4155; CHECK-MVE-NEXT:    movne r1, #1
4156; CHECK-MVE-NEXT:    cmp r1, #0
4157; CHECK-MVE-NEXT:    cset r1, ne
4158; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
4159; CHECK-MVE-NEXT:    lsls r1, r1, #31
4160; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
4161; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
4162; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4163; CHECK-MVE-NEXT:    vmov r1, s16
4164; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
4165; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
4166; CHECK-MVE-NEXT:    mov.w r1, #0
4167; CHECK-MVE-NEXT:    it ne
4168; CHECK-MVE-NEXT:    movne r1, #1
4169; CHECK-MVE-NEXT:    cmp r1, #0
4170; CHECK-MVE-NEXT:    cset r1, ne
4171; CHECK-MVE-NEXT:    lsls r1, r1, #31
4172; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
4173; CHECK-MVE-NEXT:    vmov r1, s16
4174; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
4175; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
4176; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
4177; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4178; CHECK-MVE-NEXT:    mov.w r1, #0
4179; CHECK-MVE-NEXT:    it ne
4180; CHECK-MVE-NEXT:    movne r1, #1
4181; CHECK-MVE-NEXT:    cmp r1, #0
4182; CHECK-MVE-NEXT:    cset r1, ne
4183; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
4184; CHECK-MVE-NEXT:    lsls r1, r1, #31
4185; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
4186; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
4187; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4188; CHECK-MVE-NEXT:    vmov r1, s16
4189; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
4190; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
4191; CHECK-MVE-NEXT:    mov.w r1, #0
4192; CHECK-MVE-NEXT:    it ne
4193; CHECK-MVE-NEXT:    movne r1, #1
4194; CHECK-MVE-NEXT:    cmp r1, #0
4195; CHECK-MVE-NEXT:    cset r1, ne
4196; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
4197; CHECK-MVE-NEXT:    lsls r1, r1, #31
4198; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
4199; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
4200; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4201; CHECK-MVE-NEXT:    it ne
4202; CHECK-MVE-NEXT:    movne r0, #1
4203; CHECK-MVE-NEXT:    cmp r0, #0
4204; CHECK-MVE-NEXT:    cset r0, ne
4205; CHECK-MVE-NEXT:    vmov r1, s16
4206; CHECK-MVE-NEXT:    lsls r0, r0, #31
4207; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
4208; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
4209; CHECK-MVE-NEXT:    vmov r0, s0
4210; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
4211; CHECK-MVE-NEXT:    vmov q0, q3
4212; CHECK-MVE-NEXT:    vpop {d8, d9}
4213; CHECK-MVE-NEXT:    bx lr
4214;
4215; CHECK-MVEFP-LABEL: vcmp_r_une_v8f16:
4216; CHECK-MVEFP:       @ %bb.0: @ %entry
4217; CHECK-MVEFP-NEXT:    vcmp.f16 ne, q0, zr
4218; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
4219; CHECK-MVEFP-NEXT:    bx lr
4220entry:
4221  %c = fcmp une <8 x half> zeroinitializer, %src
4222  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
4223  ret <8 x half> %s
4224}
4225
4226define arm_aapcs_vfpcc <8 x half> @vcmp_r_ugt_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
4227; CHECK-MVE-LABEL: vcmp_r_ugt_v8f16:
4228; CHECK-MVE:       @ %bb.0: @ %entry
4229; CHECK-MVE-NEXT:    .vsave {d8, d9}
4230; CHECK-MVE-NEXT:    vpush {d8, d9}
4231; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
4232; CHECK-MVE-NEXT:    movs r1, #0
4233; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
4234; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
4235; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4236; CHECK-MVE-NEXT:    it lt
4237; CHECK-MVE-NEXT:    movlt r1, #1
4238; CHECK-MVE-NEXT:    cmp r1, #0
4239; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
4240; CHECK-MVE-NEXT:    cset r1, ne
4241; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
4242; CHECK-MVE-NEXT:    lsls r1, r1, #31
4243; CHECK-MVE-NEXT:    mov.w r2, #0
4244; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
4245; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4246; CHECK-MVE-NEXT:    it lt
4247; CHECK-MVE-NEXT:    movlt r2, #1
4248; CHECK-MVE-NEXT:    cmp r2, #0
4249; CHECK-MVE-NEXT:    cset r2, ne
4250; CHECK-MVE-NEXT:    vmov r1, s12
4251; CHECK-MVE-NEXT:    lsls r2, r2, #31
4252; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
4253; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
4254; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4255; CHECK-MVE-NEXT:    vmov r2, s12
4256; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
4257; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
4258; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
4259; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
4260; CHECK-MVE-NEXT:    mov.w r1, #0
4261; CHECK-MVE-NEXT:    it lt
4262; CHECK-MVE-NEXT:    movlt r1, #1
4263; CHECK-MVE-NEXT:    cmp r1, #0
4264; CHECK-MVE-NEXT:    cset r1, ne
4265; CHECK-MVE-NEXT:    movs r0, #0
4266; CHECK-MVE-NEXT:    lsls r1, r1, #31
4267; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
4268; CHECK-MVE-NEXT:    vmov r1, s16
4269; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
4270; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
4271; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
4272; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4273; CHECK-MVE-NEXT:    mov.w r1, #0
4274; CHECK-MVE-NEXT:    it lt
4275; CHECK-MVE-NEXT:    movlt r1, #1
4276; CHECK-MVE-NEXT:    cmp r1, #0
4277; CHECK-MVE-NEXT:    cset r1, ne
4278; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
4279; CHECK-MVE-NEXT:    lsls r1, r1, #31
4280; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
4281; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
4282; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4283; CHECK-MVE-NEXT:    vmov r1, s16
4284; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
4285; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
4286; CHECK-MVE-NEXT:    mov.w r1, #0
4287; CHECK-MVE-NEXT:    it lt
4288; CHECK-MVE-NEXT:    movlt r1, #1
4289; CHECK-MVE-NEXT:    cmp r1, #0
4290; CHECK-MVE-NEXT:    cset r1, ne
4291; CHECK-MVE-NEXT:    lsls r1, r1, #31
4292; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
4293; CHECK-MVE-NEXT:    vmov r1, s16
4294; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
4295; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
4296; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
4297; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4298; CHECK-MVE-NEXT:    mov.w r1, #0
4299; CHECK-MVE-NEXT:    it lt
4300; CHECK-MVE-NEXT:    movlt r1, #1
4301; CHECK-MVE-NEXT:    cmp r1, #0
4302; CHECK-MVE-NEXT:    cset r1, ne
4303; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
4304; CHECK-MVE-NEXT:    lsls r1, r1, #31
4305; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
4306; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
4307; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4308; CHECK-MVE-NEXT:    vmov r1, s16
4309; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
4310; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
4311; CHECK-MVE-NEXT:    mov.w r1, #0
4312; CHECK-MVE-NEXT:    it lt
4313; CHECK-MVE-NEXT:    movlt r1, #1
4314; CHECK-MVE-NEXT:    cmp r1, #0
4315; CHECK-MVE-NEXT:    cset r1, ne
4316; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
4317; CHECK-MVE-NEXT:    lsls r1, r1, #31
4318; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
4319; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
4320; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4321; CHECK-MVE-NEXT:    it lt
4322; CHECK-MVE-NEXT:    movlt r0, #1
4323; CHECK-MVE-NEXT:    cmp r0, #0
4324; CHECK-MVE-NEXT:    cset r0, ne
4325; CHECK-MVE-NEXT:    vmov r1, s16
4326; CHECK-MVE-NEXT:    lsls r0, r0, #31
4327; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
4328; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
4329; CHECK-MVE-NEXT:    vmov r0, s0
4330; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
4331; CHECK-MVE-NEXT:    vmov q0, q3
4332; CHECK-MVE-NEXT:    vpop {d8, d9}
4333; CHECK-MVE-NEXT:    bx lr
4334;
4335; CHECK-MVEFP-LABEL: vcmp_r_ugt_v8f16:
4336; CHECK-MVEFP:       @ %bb.0: @ %entry
4337; CHECK-MVEFP-NEXT:    vcmp.f16 lt, q0, zr
4338; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
4339; CHECK-MVEFP-NEXT:    bx lr
4340entry:
4341  %c = fcmp ugt <8 x half> zeroinitializer, %src
4342  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
4343  ret <8 x half> %s
4344}
4345
4346define arm_aapcs_vfpcc <8 x half> @vcmp_r_uge_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
4347; CHECK-MVE-LABEL: vcmp_r_uge_v8f16:
4348; CHECK-MVE:       @ %bb.0: @ %entry
4349; CHECK-MVE-NEXT:    .vsave {d8, d9}
4350; CHECK-MVE-NEXT:    vpush {d8, d9}
4351; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
4352; CHECK-MVE-NEXT:    movs r1, #0
4353; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
4354; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
4355; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4356; CHECK-MVE-NEXT:    it le
4357; CHECK-MVE-NEXT:    movle r1, #1
4358; CHECK-MVE-NEXT:    cmp r1, #0
4359; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
4360; CHECK-MVE-NEXT:    cset r1, ne
4361; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
4362; CHECK-MVE-NEXT:    lsls r1, r1, #31
4363; CHECK-MVE-NEXT:    mov.w r2, #0
4364; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
4365; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4366; CHECK-MVE-NEXT:    it le
4367; CHECK-MVE-NEXT:    movle r2, #1
4368; CHECK-MVE-NEXT:    cmp r2, #0
4369; CHECK-MVE-NEXT:    cset r2, ne
4370; CHECK-MVE-NEXT:    vmov r1, s12
4371; CHECK-MVE-NEXT:    lsls r2, r2, #31
4372; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
4373; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
4374; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4375; CHECK-MVE-NEXT:    vmov r2, s12
4376; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
4377; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
4378; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
4379; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
4380; CHECK-MVE-NEXT:    mov.w r1, #0
4381; CHECK-MVE-NEXT:    it le
4382; CHECK-MVE-NEXT:    movle r1, #1
4383; CHECK-MVE-NEXT:    cmp r1, #0
4384; CHECK-MVE-NEXT:    cset r1, ne
4385; CHECK-MVE-NEXT:    movs r0, #0
4386; CHECK-MVE-NEXT:    lsls r1, r1, #31
4387; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
4388; CHECK-MVE-NEXT:    vmov r1, s16
4389; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
4390; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
4391; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
4392; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4393; CHECK-MVE-NEXT:    mov.w r1, #0
4394; CHECK-MVE-NEXT:    it le
4395; CHECK-MVE-NEXT:    movle r1, #1
4396; CHECK-MVE-NEXT:    cmp r1, #0
4397; CHECK-MVE-NEXT:    cset r1, ne
4398; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
4399; CHECK-MVE-NEXT:    lsls r1, r1, #31
4400; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
4401; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
4402; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4403; CHECK-MVE-NEXT:    vmov r1, s16
4404; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
4405; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
4406; CHECK-MVE-NEXT:    mov.w r1, #0
4407; CHECK-MVE-NEXT:    it le
4408; CHECK-MVE-NEXT:    movle r1, #1
4409; CHECK-MVE-NEXT:    cmp r1, #0
4410; CHECK-MVE-NEXT:    cset r1, ne
4411; CHECK-MVE-NEXT:    lsls r1, r1, #31
4412; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
4413; CHECK-MVE-NEXT:    vmov r1, s16
4414; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
4415; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
4416; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
4417; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4418; CHECK-MVE-NEXT:    mov.w r1, #0
4419; CHECK-MVE-NEXT:    it le
4420; CHECK-MVE-NEXT:    movle r1, #1
4421; CHECK-MVE-NEXT:    cmp r1, #0
4422; CHECK-MVE-NEXT:    cset r1, ne
4423; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
4424; CHECK-MVE-NEXT:    lsls r1, r1, #31
4425; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
4426; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
4427; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4428; CHECK-MVE-NEXT:    vmov r1, s16
4429; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
4430; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
4431; CHECK-MVE-NEXT:    mov.w r1, #0
4432; CHECK-MVE-NEXT:    it le
4433; CHECK-MVE-NEXT:    movle r1, #1
4434; CHECK-MVE-NEXT:    cmp r1, #0
4435; CHECK-MVE-NEXT:    cset r1, ne
4436; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
4437; CHECK-MVE-NEXT:    lsls r1, r1, #31
4438; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
4439; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
4440; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4441; CHECK-MVE-NEXT:    it le
4442; CHECK-MVE-NEXT:    movle r0, #1
4443; CHECK-MVE-NEXT:    cmp r0, #0
4444; CHECK-MVE-NEXT:    cset r0, ne
4445; CHECK-MVE-NEXT:    vmov r1, s16
4446; CHECK-MVE-NEXT:    lsls r0, r0, #31
4447; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
4448; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
4449; CHECK-MVE-NEXT:    vmov r0, s0
4450; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
4451; CHECK-MVE-NEXT:    vmov q0, q3
4452; CHECK-MVE-NEXT:    vpop {d8, d9}
4453; CHECK-MVE-NEXT:    bx lr
4454;
4455; CHECK-MVEFP-LABEL: vcmp_r_uge_v8f16:
4456; CHECK-MVEFP:       @ %bb.0: @ %entry
4457; CHECK-MVEFP-NEXT:    vcmp.f16 le, q0, zr
4458; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
4459; CHECK-MVEFP-NEXT:    bx lr
4460entry:
4461  %c = fcmp uge <8 x half> zeroinitializer, %src
4462  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
4463  ret <8 x half> %s
4464}
4465
4466define arm_aapcs_vfpcc <8 x half> @vcmp_r_ult_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
4467; CHECK-MVE-LABEL: vcmp_r_ult_v8f16:
4468; CHECK-MVE:       @ %bb.0: @ %entry
4469; CHECK-MVE-NEXT:    .vsave {d8, d9}
4470; CHECK-MVE-NEXT:    vpush {d8, d9}
4471; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
4472; CHECK-MVE-NEXT:    movs r1, #0
4473; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
4474; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
4475; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4476; CHECK-MVE-NEXT:    it hi
4477; CHECK-MVE-NEXT:    movhi r1, #1
4478; CHECK-MVE-NEXT:    cmp r1, #0
4479; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
4480; CHECK-MVE-NEXT:    cset r1, ne
4481; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
4482; CHECK-MVE-NEXT:    lsls r1, r1, #31
4483; CHECK-MVE-NEXT:    mov.w r2, #0
4484; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
4485; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4486; CHECK-MVE-NEXT:    it hi
4487; CHECK-MVE-NEXT:    movhi r2, #1
4488; CHECK-MVE-NEXT:    cmp r2, #0
4489; CHECK-MVE-NEXT:    cset r2, ne
4490; CHECK-MVE-NEXT:    vmov r1, s12
4491; CHECK-MVE-NEXT:    lsls r2, r2, #31
4492; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
4493; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
4494; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4495; CHECK-MVE-NEXT:    vmov r2, s12
4496; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
4497; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
4498; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
4499; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
4500; CHECK-MVE-NEXT:    mov.w r1, #0
4501; CHECK-MVE-NEXT:    it hi
4502; CHECK-MVE-NEXT:    movhi r1, #1
4503; CHECK-MVE-NEXT:    cmp r1, #0
4504; CHECK-MVE-NEXT:    cset r1, ne
4505; CHECK-MVE-NEXT:    movs r0, #0
4506; CHECK-MVE-NEXT:    lsls r1, r1, #31
4507; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
4508; CHECK-MVE-NEXT:    vmov r1, s16
4509; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
4510; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
4511; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
4512; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4513; CHECK-MVE-NEXT:    mov.w r1, #0
4514; CHECK-MVE-NEXT:    it hi
4515; CHECK-MVE-NEXT:    movhi r1, #1
4516; CHECK-MVE-NEXT:    cmp r1, #0
4517; CHECK-MVE-NEXT:    cset r1, ne
4518; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
4519; CHECK-MVE-NEXT:    lsls r1, r1, #31
4520; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
4521; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
4522; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4523; CHECK-MVE-NEXT:    vmov r1, s16
4524; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
4525; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
4526; CHECK-MVE-NEXT:    mov.w r1, #0
4527; CHECK-MVE-NEXT:    it hi
4528; CHECK-MVE-NEXT:    movhi r1, #1
4529; CHECK-MVE-NEXT:    cmp r1, #0
4530; CHECK-MVE-NEXT:    cset r1, ne
4531; CHECK-MVE-NEXT:    lsls r1, r1, #31
4532; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
4533; CHECK-MVE-NEXT:    vmov r1, s16
4534; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
4535; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
4536; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
4537; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4538; CHECK-MVE-NEXT:    mov.w r1, #0
4539; CHECK-MVE-NEXT:    it hi
4540; CHECK-MVE-NEXT:    movhi r1, #1
4541; CHECK-MVE-NEXT:    cmp r1, #0
4542; CHECK-MVE-NEXT:    cset r1, ne
4543; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
4544; CHECK-MVE-NEXT:    lsls r1, r1, #31
4545; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
4546; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
4547; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4548; CHECK-MVE-NEXT:    vmov r1, s16
4549; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
4550; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
4551; CHECK-MVE-NEXT:    mov.w r1, #0
4552; CHECK-MVE-NEXT:    it hi
4553; CHECK-MVE-NEXT:    movhi r1, #1
4554; CHECK-MVE-NEXT:    cmp r1, #0
4555; CHECK-MVE-NEXT:    cset r1, ne
4556; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
4557; CHECK-MVE-NEXT:    lsls r1, r1, #31
4558; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
4559; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
4560; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4561; CHECK-MVE-NEXT:    it hi
4562; CHECK-MVE-NEXT:    movhi r0, #1
4563; CHECK-MVE-NEXT:    cmp r0, #0
4564; CHECK-MVE-NEXT:    cset r0, ne
4565; CHECK-MVE-NEXT:    vmov r1, s16
4566; CHECK-MVE-NEXT:    lsls r0, r0, #31
4567; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
4568; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
4569; CHECK-MVE-NEXT:    vmov r0, s0
4570; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
4571; CHECK-MVE-NEXT:    vmov q0, q3
4572; CHECK-MVE-NEXT:    vpop {d8, d9}
4573; CHECK-MVE-NEXT:    bx lr
4574;
4575; CHECK-MVEFP-LABEL: vcmp_r_ult_v8f16:
4576; CHECK-MVEFP:       @ %bb.0: @ %entry
4577; CHECK-MVEFP-NEXT:    vcmp.f16 gt, q0, zr
4578; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
4579; CHECK-MVEFP-NEXT:    bx lr
4580entry:
4581  %c = fcmp ult <8 x half> zeroinitializer, %src
4582  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
4583  ret <8 x half> %s
4584}
4585
4586define arm_aapcs_vfpcc <8 x half> @vcmp_r_ule_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
4587; CHECK-MVE-LABEL: vcmp_r_ule_v8f16:
4588; CHECK-MVE:       @ %bb.0: @ %entry
4589; CHECK-MVE-NEXT:    .vsave {d8, d9}
4590; CHECK-MVE-NEXT:    vpush {d8, d9}
4591; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
4592; CHECK-MVE-NEXT:    movs r1, #0
4593; CHECK-MVE-NEXT:    vcmp.f16 s12, #0
4594; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
4595; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4596; CHECK-MVE-NEXT:    it pl
4597; CHECK-MVE-NEXT:    movpl r1, #1
4598; CHECK-MVE-NEXT:    cmp r1, #0
4599; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
4600; CHECK-MVE-NEXT:    cset r1, ne
4601; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
4602; CHECK-MVE-NEXT:    lsls r1, r1, #31
4603; CHECK-MVE-NEXT:    mov.w r2, #0
4604; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
4605; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4606; CHECK-MVE-NEXT:    it pl
4607; CHECK-MVE-NEXT:    movpl r2, #1
4608; CHECK-MVE-NEXT:    cmp r2, #0
4609; CHECK-MVE-NEXT:    cset r2, ne
4610; CHECK-MVE-NEXT:    vmov r1, s12
4611; CHECK-MVE-NEXT:    lsls r2, r2, #31
4612; CHECK-MVE-NEXT:    vcmp.f16 s1, #0
4613; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
4614; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4615; CHECK-MVE-NEXT:    vmov r2, s12
4616; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
4617; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
4618; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
4619; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
4620; CHECK-MVE-NEXT:    mov.w r1, #0
4621; CHECK-MVE-NEXT:    it pl
4622; CHECK-MVE-NEXT:    movpl r1, #1
4623; CHECK-MVE-NEXT:    cmp r1, #0
4624; CHECK-MVE-NEXT:    cset r1, ne
4625; CHECK-MVE-NEXT:    movs r0, #0
4626; CHECK-MVE-NEXT:    lsls r1, r1, #31
4627; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
4628; CHECK-MVE-NEXT:    vmov r1, s16
4629; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
4630; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
4631; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
4632; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4633; CHECK-MVE-NEXT:    mov.w r1, #0
4634; CHECK-MVE-NEXT:    it pl
4635; CHECK-MVE-NEXT:    movpl r1, #1
4636; CHECK-MVE-NEXT:    cmp r1, #0
4637; CHECK-MVE-NEXT:    cset r1, ne
4638; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
4639; CHECK-MVE-NEXT:    lsls r1, r1, #31
4640; CHECK-MVE-NEXT:    vcmp.f16 s2, #0
4641; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
4642; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4643; CHECK-MVE-NEXT:    vmov r1, s16
4644; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
4645; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
4646; CHECK-MVE-NEXT:    mov.w r1, #0
4647; CHECK-MVE-NEXT:    it pl
4648; CHECK-MVE-NEXT:    movpl r1, #1
4649; CHECK-MVE-NEXT:    cmp r1, #0
4650; CHECK-MVE-NEXT:    cset r1, ne
4651; CHECK-MVE-NEXT:    lsls r1, r1, #31
4652; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
4653; CHECK-MVE-NEXT:    vmov r1, s16
4654; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
4655; CHECK-MVE-NEXT:    vcmp.f16 s16, #0
4656; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
4657; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4658; CHECK-MVE-NEXT:    mov.w r1, #0
4659; CHECK-MVE-NEXT:    it pl
4660; CHECK-MVE-NEXT:    movpl r1, #1
4661; CHECK-MVE-NEXT:    cmp r1, #0
4662; CHECK-MVE-NEXT:    cset r1, ne
4663; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
4664; CHECK-MVE-NEXT:    lsls r1, r1, #31
4665; CHECK-MVE-NEXT:    vcmp.f16 s3, #0
4666; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
4667; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4668; CHECK-MVE-NEXT:    vmov r1, s16
4669; CHECK-MVE-NEXT:    vcmp.f16 s0, #0
4670; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
4671; CHECK-MVE-NEXT:    mov.w r1, #0
4672; CHECK-MVE-NEXT:    it pl
4673; CHECK-MVE-NEXT:    movpl r1, #1
4674; CHECK-MVE-NEXT:    cmp r1, #0
4675; CHECK-MVE-NEXT:    cset r1, ne
4676; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
4677; CHECK-MVE-NEXT:    lsls r1, r1, #31
4678; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
4679; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
4680; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4681; CHECK-MVE-NEXT:    it pl
4682; CHECK-MVE-NEXT:    movpl r0, #1
4683; CHECK-MVE-NEXT:    cmp r0, #0
4684; CHECK-MVE-NEXT:    cset r0, ne
4685; CHECK-MVE-NEXT:    vmov r1, s16
4686; CHECK-MVE-NEXT:    lsls r0, r0, #31
4687; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
4688; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
4689; CHECK-MVE-NEXT:    vmov r0, s0
4690; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
4691; CHECK-MVE-NEXT:    vmov q0, q3
4692; CHECK-MVE-NEXT:    vpop {d8, d9}
4693; CHECK-MVE-NEXT:    bx lr
4694;
4695; CHECK-MVEFP-LABEL: vcmp_r_ule_v8f16:
4696; CHECK-MVEFP:       @ %bb.0: @ %entry
4697; CHECK-MVEFP-NEXT:    vcmp.f16 ge, q0, zr
4698; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
4699; CHECK-MVEFP-NEXT:    bx lr
4700entry:
4701  %c = fcmp ule <8 x half> zeroinitializer, %src
4702  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
4703  ret <8 x half> %s
4704}
4705
4706define arm_aapcs_vfpcc <8 x half> @vcmp_r_ord_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
4707; CHECK-MVE-LABEL: vcmp_r_ord_v8f16:
4708; CHECK-MVE:       @ %bb.0: @ %entry
4709; CHECK-MVE-NEXT:    .vsave {d8, d9}
4710; CHECK-MVE-NEXT:    vpush {d8, d9}
4711; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
4712; CHECK-MVE-NEXT:    movs r1, #0
4713; CHECK-MVE-NEXT:    vcmp.f16 s12, s12
4714; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
4715; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4716; CHECK-MVE-NEXT:    it vc
4717; CHECK-MVE-NEXT:    movvc r1, #1
4718; CHECK-MVE-NEXT:    cmp r1, #0
4719; CHECK-MVE-NEXT:    vcmp.f16 s0, s0
4720; CHECK-MVE-NEXT:    cset r1, ne
4721; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
4722; CHECK-MVE-NEXT:    lsls r1, r1, #31
4723; CHECK-MVE-NEXT:    mov.w r2, #0
4724; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
4725; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4726; CHECK-MVE-NEXT:    it vc
4727; CHECK-MVE-NEXT:    movvc r2, #1
4728; CHECK-MVE-NEXT:    cmp r2, #0
4729; CHECK-MVE-NEXT:    cset r2, ne
4730; CHECK-MVE-NEXT:    vmov r1, s12
4731; CHECK-MVE-NEXT:    lsls r2, r2, #31
4732; CHECK-MVE-NEXT:    vcmp.f16 s1, s1
4733; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
4734; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4735; CHECK-MVE-NEXT:    vmov r2, s12
4736; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
4737; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
4738; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
4739; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
4740; CHECK-MVE-NEXT:    mov.w r1, #0
4741; CHECK-MVE-NEXT:    it vc
4742; CHECK-MVE-NEXT:    movvc r1, #1
4743; CHECK-MVE-NEXT:    cmp r1, #0
4744; CHECK-MVE-NEXT:    cset r1, ne
4745; CHECK-MVE-NEXT:    movs r0, #0
4746; CHECK-MVE-NEXT:    lsls r1, r1, #31
4747; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
4748; CHECK-MVE-NEXT:    vmov r1, s16
4749; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
4750; CHECK-MVE-NEXT:    vcmp.f16 s16, s16
4751; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
4752; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4753; CHECK-MVE-NEXT:    mov.w r1, #0
4754; CHECK-MVE-NEXT:    it vc
4755; CHECK-MVE-NEXT:    movvc r1, #1
4756; CHECK-MVE-NEXT:    cmp r1, #0
4757; CHECK-MVE-NEXT:    cset r1, ne
4758; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
4759; CHECK-MVE-NEXT:    lsls r1, r1, #31
4760; CHECK-MVE-NEXT:    vcmp.f16 s2, s2
4761; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
4762; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4763; CHECK-MVE-NEXT:    vmov r1, s16
4764; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
4765; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
4766; CHECK-MVE-NEXT:    mov.w r1, #0
4767; CHECK-MVE-NEXT:    it vc
4768; CHECK-MVE-NEXT:    movvc r1, #1
4769; CHECK-MVE-NEXT:    cmp r1, #0
4770; CHECK-MVE-NEXT:    cset r1, ne
4771; CHECK-MVE-NEXT:    lsls r1, r1, #31
4772; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
4773; CHECK-MVE-NEXT:    vmov r1, s16
4774; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
4775; CHECK-MVE-NEXT:    vcmp.f16 s16, s16
4776; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
4777; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4778; CHECK-MVE-NEXT:    mov.w r1, #0
4779; CHECK-MVE-NEXT:    it vc
4780; CHECK-MVE-NEXT:    movvc r1, #1
4781; CHECK-MVE-NEXT:    cmp r1, #0
4782; CHECK-MVE-NEXT:    cset r1, ne
4783; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
4784; CHECK-MVE-NEXT:    lsls r1, r1, #31
4785; CHECK-MVE-NEXT:    vcmp.f16 s3, s3
4786; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
4787; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4788; CHECK-MVE-NEXT:    vmov r1, s16
4789; CHECK-MVE-NEXT:    vcmp.f16 s0, s0
4790; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
4791; CHECK-MVE-NEXT:    mov.w r1, #0
4792; CHECK-MVE-NEXT:    it vc
4793; CHECK-MVE-NEXT:    movvc r1, #1
4794; CHECK-MVE-NEXT:    cmp r1, #0
4795; CHECK-MVE-NEXT:    cset r1, ne
4796; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
4797; CHECK-MVE-NEXT:    lsls r1, r1, #31
4798; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
4799; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
4800; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4801; CHECK-MVE-NEXT:    it vc
4802; CHECK-MVE-NEXT:    movvc r0, #1
4803; CHECK-MVE-NEXT:    cmp r0, #0
4804; CHECK-MVE-NEXT:    cset r0, ne
4805; CHECK-MVE-NEXT:    vmov r1, s16
4806; CHECK-MVE-NEXT:    lsls r0, r0, #31
4807; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
4808; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
4809; CHECK-MVE-NEXT:    vmov r0, s0
4810; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
4811; CHECK-MVE-NEXT:    vmov q0, q3
4812; CHECK-MVE-NEXT:    vpop {d8, d9}
4813; CHECK-MVE-NEXT:    bx lr
4814;
4815; CHECK-MVEFP-LABEL: vcmp_r_ord_v8f16:
4816; CHECK-MVEFP:       @ %bb.0: @ %entry
4817; CHECK-MVEFP-NEXT:    vpt.f16 le, q0, zr
4818; CHECK-MVEFP-NEXT:    vcmpt.f16 gt, q0, zr
4819; CHECK-MVEFP-NEXT:    vpsel q0, q2, q1
4820; CHECK-MVEFP-NEXT:    bx lr
4821entry:
4822  %c = fcmp ord <8 x half> zeroinitializer, %src
4823  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
4824  ret <8 x half> %s
4825}
4826
4827define arm_aapcs_vfpcc <8 x half> @vcmp_r_uno_v8f16(<8 x half> %src, <8 x half> %a, <8 x half> %b) {
4828; CHECK-MVE-LABEL: vcmp_r_uno_v8f16:
4829; CHECK-MVE:       @ %bb.0: @ %entry
4830; CHECK-MVE-NEXT:    .vsave {d8, d9}
4831; CHECK-MVE-NEXT:    vpush {d8, d9}
4832; CHECK-MVE-NEXT:    vmovx.f16 s12, s0
4833; CHECK-MVE-NEXT:    movs r1, #0
4834; CHECK-MVE-NEXT:    vcmp.f16 s12, s12
4835; CHECK-MVE-NEXT:    vmovx.f16 s12, s4
4836; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4837; CHECK-MVE-NEXT:    it vs
4838; CHECK-MVE-NEXT:    movvs r1, #1
4839; CHECK-MVE-NEXT:    cmp r1, #0
4840; CHECK-MVE-NEXT:    vcmp.f16 s0, s0
4841; CHECK-MVE-NEXT:    cset r1, ne
4842; CHECK-MVE-NEXT:    vmovx.f16 s14, s8
4843; CHECK-MVE-NEXT:    lsls r1, r1, #31
4844; CHECK-MVE-NEXT:    mov.w r2, #0
4845; CHECK-MVE-NEXT:    vseleq.f16 s12, s14, s12
4846; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4847; CHECK-MVE-NEXT:    it vs
4848; CHECK-MVE-NEXT:    movvs r2, #1
4849; CHECK-MVE-NEXT:    cmp r2, #0
4850; CHECK-MVE-NEXT:    cset r2, ne
4851; CHECK-MVE-NEXT:    vmov r1, s12
4852; CHECK-MVE-NEXT:    lsls r2, r2, #31
4853; CHECK-MVE-NEXT:    vcmp.f16 s1, s1
4854; CHECK-MVE-NEXT:    vseleq.f16 s12, s8, s4
4855; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4856; CHECK-MVE-NEXT:    vmov r2, s12
4857; CHECK-MVE-NEXT:    vmovx.f16 s18, s9
4858; CHECK-MVE-NEXT:    vmov.16 q3[0], r2
4859; CHECK-MVE-NEXT:    vmovx.f16 s0, s3
4860; CHECK-MVE-NEXT:    vmov.16 q3[1], r1
4861; CHECK-MVE-NEXT:    mov.w r1, #0
4862; CHECK-MVE-NEXT:    it vs
4863; CHECK-MVE-NEXT:    movvs r1, #1
4864; CHECK-MVE-NEXT:    cmp r1, #0
4865; CHECK-MVE-NEXT:    cset r1, ne
4866; CHECK-MVE-NEXT:    movs r0, #0
4867; CHECK-MVE-NEXT:    lsls r1, r1, #31
4868; CHECK-MVE-NEXT:    vseleq.f16 s16, s9, s5
4869; CHECK-MVE-NEXT:    vmov r1, s16
4870; CHECK-MVE-NEXT:    vmovx.f16 s16, s1
4871; CHECK-MVE-NEXT:    vcmp.f16 s16, s16
4872; CHECK-MVE-NEXT:    vmov.16 q3[2], r1
4873; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4874; CHECK-MVE-NEXT:    mov.w r1, #0
4875; CHECK-MVE-NEXT:    it vs
4876; CHECK-MVE-NEXT:    movvs r1, #1
4877; CHECK-MVE-NEXT:    cmp r1, #0
4878; CHECK-MVE-NEXT:    cset r1, ne
4879; CHECK-MVE-NEXT:    vmovx.f16 s16, s5
4880; CHECK-MVE-NEXT:    lsls r1, r1, #31
4881; CHECK-MVE-NEXT:    vcmp.f16 s2, s2
4882; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
4883; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4884; CHECK-MVE-NEXT:    vmov r1, s16
4885; CHECK-MVE-NEXT:    vmovx.f16 s18, s10
4886; CHECK-MVE-NEXT:    vmov.16 q3[3], r1
4887; CHECK-MVE-NEXT:    mov.w r1, #0
4888; CHECK-MVE-NEXT:    it vs
4889; CHECK-MVE-NEXT:    movvs r1, #1
4890; CHECK-MVE-NEXT:    cmp r1, #0
4891; CHECK-MVE-NEXT:    cset r1, ne
4892; CHECK-MVE-NEXT:    lsls r1, r1, #31
4893; CHECK-MVE-NEXT:    vseleq.f16 s16, s10, s6
4894; CHECK-MVE-NEXT:    vmov r1, s16
4895; CHECK-MVE-NEXT:    vmovx.f16 s16, s2
4896; CHECK-MVE-NEXT:    vcmp.f16 s16, s16
4897; CHECK-MVE-NEXT:    vmov.16 q3[4], r1
4898; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4899; CHECK-MVE-NEXT:    mov.w r1, #0
4900; CHECK-MVE-NEXT:    it vs
4901; CHECK-MVE-NEXT:    movvs r1, #1
4902; CHECK-MVE-NEXT:    cmp r1, #0
4903; CHECK-MVE-NEXT:    cset r1, ne
4904; CHECK-MVE-NEXT:    vmovx.f16 s16, s6
4905; CHECK-MVE-NEXT:    lsls r1, r1, #31
4906; CHECK-MVE-NEXT:    vcmp.f16 s3, s3
4907; CHECK-MVE-NEXT:    vseleq.f16 s16, s18, s16
4908; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4909; CHECK-MVE-NEXT:    vmov r1, s16
4910; CHECK-MVE-NEXT:    vcmp.f16 s0, s0
4911; CHECK-MVE-NEXT:    vmov.16 q3[5], r1
4912; CHECK-MVE-NEXT:    mov.w r1, #0
4913; CHECK-MVE-NEXT:    it vs
4914; CHECK-MVE-NEXT:    movvs r1, #1
4915; CHECK-MVE-NEXT:    cmp r1, #0
4916; CHECK-MVE-NEXT:    cset r1, ne
4917; CHECK-MVE-NEXT:    vmovx.f16 s0, s7
4918; CHECK-MVE-NEXT:    lsls r1, r1, #31
4919; CHECK-MVE-NEXT:    vmovx.f16 s2, s11
4920; CHECK-MVE-NEXT:    vseleq.f16 s16, s11, s7
4921; CHECK-MVE-NEXT:    vmrs APSR_nzcv, fpscr
4922; CHECK-MVE-NEXT:    it vs
4923; CHECK-MVE-NEXT:    movvs r0, #1
4924; CHECK-MVE-NEXT:    cmp r0, #0
4925; CHECK-MVE-NEXT:    cset r0, ne
4926; CHECK-MVE-NEXT:    vmov r1, s16
4927; CHECK-MVE-NEXT:    lsls r0, r0, #31
4928; CHECK-MVE-NEXT:    vmov.16 q3[6], r1
4929; CHECK-MVE-NEXT:    vseleq.f16 s0, s2, s0
4930; CHECK-MVE-NEXT:    vmov r0, s0
4931; CHECK-MVE-NEXT:    vmov.16 q3[7], r0
4932; CHECK-MVE-NEXT:    vmov q0, q3
4933; CHECK-MVE-NEXT:    vpop {d8, d9}
4934; CHECK-MVE-NEXT:    bx lr
4935;
4936; CHECK-MVEFP-LABEL: vcmp_r_uno_v8f16:
4937; CHECK-MVEFP:       @ %bb.0: @ %entry
4938; CHECK-MVEFP-NEXT:    vpt.f16 le, q0, zr
4939; CHECK-MVEFP-NEXT:    vcmpt.f16 gt, q0, zr
4940; CHECK-MVEFP-NEXT:    vpsel q0, q1, q2
4941; CHECK-MVEFP-NEXT:    bx lr
4942entry:
4943  %c = fcmp uno <8 x half> zeroinitializer, %src
4944  %s = select <8 x i1> %c, <8 x half> %a, <8 x half> %b
4945  ret <8 x half> %s
4946}
4947