1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2p1 < %s | FileCheck %s
4 define <vscale x 16 x i1> @test_pmov_to_pred_i8(<vscale x 16 x i8> %zn) {
5 ; CHECK-LABEL: test_pmov_to_pred_i8:
6 ; CHECK: // %bb.0: // %entry
7 ; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill
8 ; CHECK-NEXT: .cfi_def_cfa_offset 16
9 ; CHECK-NEXT: .cfi_offset w30, -16
10 ; CHECK-NEXT: mov w0, wzr
11 ; CHECK-NEXT: bl llvm.aarch64.sve.pmov.to.pred.lane.nxv16i8
12 ; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload
15 %res = call <vscale x 16 x i1> @llvm.aarch64.sve.pmov.to.pred.lane.nxv16i8(<vscale x 16 x i8> %zn, i32 0)
16 ret <vscale x 16 x i1> %res
19 define <vscale x 8 x i1> @test_pmov_to_pred_i16(<vscale x 8 x i16> %zn) {
20 ; CHECK-LABEL: test_pmov_to_pred_i16:
21 ; CHECK: // %bb.0: // %entry
22 ; CHECK-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
23 ; CHECK-NEXT: addvl sp, sp, #-2
24 ; CHECK-NEXT: str p4, [sp, #7, mul vl] // 2-byte Folded Spill
25 ; CHECK-NEXT: str z8, [sp, #1, mul vl] // 16-byte Folded Spill
26 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0c, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x10, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 16 * VG
27 ; CHECK-NEXT: .cfi_offset w30, -8
28 ; CHECK-NEXT: .cfi_offset w29, -16
29 ; CHECK-NEXT: .cfi_escape 0x10, 0x48, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x78, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d8 @ cfa - 16 - 8 * VG
30 ; CHECK-NEXT: mov w0, wzr
31 ; CHECK-NEXT: mov z8.d, z0.d
32 ; CHECK-NEXT: bl llvm.aarch64.sve.pmov.to.pred.lane.nxv8i16
33 ; CHECK-NEXT: mov z0.d, z8.d
34 ; CHECK-NEXT: mov w0, #1 // =0x1
35 ; CHECK-NEXT: mov p4.b, p0.b
36 ; CHECK-NEXT: bl llvm.aarch64.sve.pmov.to.pred.lane.nxv8i16
37 ; CHECK-NEXT: ptrue p1.h
38 ; CHECK-NEXT: ldr z8, [sp, #1, mul vl] // 16-byte Folded Reload
39 ; CHECK-NEXT: eor p0.b, p1/z, p4.b, p0.b
40 ; CHECK-NEXT: ldr p4, [sp, #7, mul vl] // 2-byte Folded Reload
41 ; CHECK-NEXT: addvl sp, sp, #2
42 ; CHECK-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
45 %res1 = call <vscale x 8 x i1> @llvm.aarch64.sve.pmov.to.pred.lane.nxv8i16(<vscale x 8 x i16> %zn, i32 0)
46 %res2 = call <vscale x 8 x i1> @llvm.aarch64.sve.pmov.to.pred.lane.nxv8i16(<vscale x 8 x i16> %zn, i32 1)
48 %res = add <vscale x 8 x i1> %res1, %res2
49 ret <vscale x 8 x i1> %res
52 define <vscale x 4 x i1> @test_pmov_to_pred_i32(<vscale x 4 x i32> %zn) {
53 ; CHECK-LABEL: test_pmov_to_pred_i32:
54 ; CHECK: // %bb.0: // %entry
55 ; CHECK-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
56 ; CHECK-NEXT: addvl sp, sp, #-2
57 ; CHECK-NEXT: str p4, [sp, #7, mul vl] // 2-byte Folded Spill
58 ; CHECK-NEXT: str z8, [sp, #1, mul vl] // 16-byte Folded Spill
59 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0c, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x10, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 16 * VG
60 ; CHECK-NEXT: .cfi_offset w30, -8
61 ; CHECK-NEXT: .cfi_offset w29, -16
62 ; CHECK-NEXT: .cfi_escape 0x10, 0x48, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x78, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d8 @ cfa - 16 - 8 * VG
63 ; CHECK-NEXT: mov w0, wzr
64 ; CHECK-NEXT: mov z8.d, z0.d
65 ; CHECK-NEXT: bl llvm.aarch64.sve.pmov.to.pred.lane.nxv4i32
66 ; CHECK-NEXT: mov z0.d, z8.d
67 ; CHECK-NEXT: mov w0, #3 // =0x3
68 ; CHECK-NEXT: mov p4.b, p0.b
69 ; CHECK-NEXT: bl llvm.aarch64.sve.pmov.to.pred.lane.nxv4i32
70 ; CHECK-NEXT: ptrue p1.s
71 ; CHECK-NEXT: ldr z8, [sp, #1, mul vl] // 16-byte Folded Reload
72 ; CHECK-NEXT: eor p0.b, p1/z, p4.b, p0.b
73 ; CHECK-NEXT: ldr p4, [sp, #7, mul vl] // 2-byte Folded Reload
74 ; CHECK-NEXT: addvl sp, sp, #2
75 ; CHECK-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
78 %res1 = call <vscale x 4 x i1> @llvm.aarch64.sve.pmov.to.pred.lane.nxv4i32(<vscale x 4 x i32> %zn, i32 0)
79 %res2 = call <vscale x 4 x i1> @llvm.aarch64.sve.pmov.to.pred.lane.nxv4i32(<vscale x 4 x i32> %zn, i32 3)
81 %res = add <vscale x 4 x i1> %res1, %res2
82 ret <vscale x 4 x i1> %res
85 define <vscale x 2 x i1> @test_pmov_to_pred_i64(<vscale x 2 x i64> %zn) {
86 ; CHECK-LABEL: test_pmov_to_pred_i64:
87 ; CHECK: // %bb.0: // %entry
88 ; CHECK-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
89 ; CHECK-NEXT: addvl sp, sp, #-2
90 ; CHECK-NEXT: str p4, [sp, #7, mul vl] // 2-byte Folded Spill
91 ; CHECK-NEXT: str z8, [sp, #1, mul vl] // 16-byte Folded Spill
92 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0c, 0x8f, 0x00, 0x11, 0x10, 0x22, 0x11, 0x10, 0x92, 0x2e, 0x00, 0x1e, 0x22 // sp + 16 + 16 * VG
93 ; CHECK-NEXT: .cfi_offset w30, -8
94 ; CHECK-NEXT: .cfi_offset w29, -16
95 ; CHECK-NEXT: .cfi_escape 0x10, 0x48, 0x0a, 0x11, 0x70, 0x22, 0x11, 0x78, 0x92, 0x2e, 0x00, 0x1e, 0x22 // $d8 @ cfa - 16 - 8 * VG
96 ; CHECK-NEXT: mov w0, wzr
97 ; CHECK-NEXT: mov z8.d, z0.d
98 ; CHECK-NEXT: bl llvm.aarch64.sve.pmov.to.pred.lane.nxv2i64
99 ; CHECK-NEXT: mov z0.d, z8.d
100 ; CHECK-NEXT: mov w0, #7 // =0x7
101 ; CHECK-NEXT: mov p4.b, p0.b
102 ; CHECK-NEXT: bl llvm.aarch64.sve.pmov.to.pred.lane.nxv2i64
103 ; CHECK-NEXT: ptrue p1.d
104 ; CHECK-NEXT: ldr z8, [sp, #1, mul vl] // 16-byte Folded Reload
105 ; CHECK-NEXT: eor p0.b, p1/z, p4.b, p0.b
106 ; CHECK-NEXT: ldr p4, [sp, #7, mul vl] // 2-byte Folded Reload
107 ; CHECK-NEXT: addvl sp, sp, #2
108 ; CHECK-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
111 %res1 = call <vscale x 2 x i1> @llvm.aarch64.sve.pmov.to.pred.lane.nxv2i64(<vscale x 2 x i64> %zn, i32 0)
112 %res2 = call <vscale x 2 x i1> @llvm.aarch64.sve.pmov.to.pred.lane.nxv2i64(<vscale x 2 x i64> %zn, i32 7)
114 %res = add <vscale x 2 x i1> %res1, %res2
115 ret <vscale x 2 x i1> %res
118 declare <vscale x 16 x i1> @llvm.aarch64.sve.pmov.to.pred.lane.nxv16i8(<vscale x 16 x i8>, i32)
119 declare <vscale x 8 x i1> @llvm.aarch64.sve.pmov.to.pred.lane.nxv8i16(<vscale x 8 x i16>, i32)
120 declare <vscale x 4 x i1> @llvm.aarch64.sve.pmov.to.pred.lane.nxv4i32(<vscale x 4 x i32>, i32)
121 declare <vscale x 2 x i1> @llvm.aarch64.sve.pmov.to.pred.lane.nxv2i64(<vscale x 2 x i64>, i32)