1 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve -mattr=+use-experimental-zeroing-pseudos < %s | FileCheck %s
7 define <vscale x 16 x i8> @add_i8_zero(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale x 16 x i8> %b) {
8 ; CHECK-LABEL: add_i8_zero:
9 ; CHECK: movprfx z0.b, p0/z, z0.b
10 ; CHECK-NEXT: add z0.b, p0/m, z0.b, z1.b
12 %a_z = select <vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale x 16 x i8> zeroinitializer
13 %out = call <vscale x 16 x i8> @llvm.aarch64.sve.add.nxv16i8(<vscale x 16 x i1> %pg,
14 <vscale x 16 x i8> %a_z,
15 <vscale x 16 x i8> %b)
16 ret <vscale x 16 x i8> %out
19 define <vscale x 8 x i16> @add_i16_zero(<vscale x 8 x i1> %pg, <vscale x 8 x i16> %a, <vscale x 8 x i16> %b) {
20 ; CHECK-LABEL: add_i16_zero:
21 ; CHECK: movprfx z0.h, p0/z, z0.h
22 ; CHECK-NEXT: add z0.h, p0/m, z0.h, z1.h
24 %a_z = select <vscale x 8 x i1> %pg, <vscale x 8 x i16> %a, <vscale x 8 x i16> zeroinitializer
25 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.add.nxv8i16(<vscale x 8 x i1> %pg,
26 <vscale x 8 x i16> %a_z,
27 <vscale x 8 x i16> %b)
28 ret <vscale x 8 x i16> %out
31 define <vscale x 4 x i32> @add_i32_zero(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
32 ; CHECK-LABEL: add_i32_zero:
33 ; CHECK: movprfx z0.s, p0/z, z0.s
34 ; CHECK-NEXT: add z0.s, p0/m, z0.s, z1.s
36 %a_z = select <vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> zeroinitializer
37 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.add.nxv4i32(<vscale x 4 x i1> %pg,
38 <vscale x 4 x i32> %a_z,
39 <vscale x 4 x i32> %b)
40 ret <vscale x 4 x i32> %out
43 define <vscale x 2 x i64> @add_i64_zero(<vscale x 2 x i1> %pg, <vscale x 2 x i64> %a, <vscale x 2 x i64> %b) {
44 ; CHECK-LABEL: add_i64_zero:
45 ; CHECK: movprfx z0.d, p0/z, z0.d
46 ; CHECK-NEXT: add z0.d, p0/m, z0.d, z1.d
48 %a_z = select <vscale x 2 x i1> %pg, <vscale x 2 x i64> %a, <vscale x 2 x i64> zeroinitializer
49 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.add.nxv2i64(<vscale x 2 x i1> %pg,
50 <vscale x 2 x i64> %a_z,
51 <vscale x 2 x i64> %b)
52 ret <vscale x 2 x i64> %out
59 define <vscale x 16 x i8> @sub_i8_zero(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale x 16 x i8> %b) {
60 ; CHECK-LABEL: sub_i8_zero:
61 ; CHECK: movprfx z0.b, p0/z, z0.b
62 ; CHECK-NEXT: sub z0.b, p0/m, z0.b, z1.b
64 %a_z = select <vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale x 16 x i8> zeroinitializer
65 %out = call <vscale x 16 x i8> @llvm.aarch64.sve.sub.nxv16i8(<vscale x 16 x i1> %pg,
66 <vscale x 16 x i8> %a_z,
67 <vscale x 16 x i8> %b)
68 ret <vscale x 16 x i8> %out
71 define <vscale x 8 x i16> @sub_i16_zero(<vscale x 8 x i1> %pg, <vscale x 8 x i16> %a, <vscale x 8 x i16> %b) {
72 ; CHECK-LABEL: sub_i16_zero:
73 ; CHECK: movprfx z0.h, p0/z, z0.h
74 ; CHECK-NEXT: sub z0.h, p0/m, z0.h, z1.h
76 %a_z = select <vscale x 8 x i1> %pg, <vscale x 8 x i16> %a, <vscale x 8 x i16> zeroinitializer
77 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.sub.nxv8i16(<vscale x 8 x i1> %pg,
78 <vscale x 8 x i16> %a_z,
79 <vscale x 8 x i16> %b)
80 ret <vscale x 8 x i16> %out
83 define <vscale x 4 x i32> @sub_i32_zero(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
84 ; CHECK-LABEL: sub_i32_zero:
85 ; CHECK: movprfx z0.s, p0/z, z0.s
86 ; CHECK-NEXT: sub z0.s, p0/m, z0.s, z1.s
88 %a_z = select <vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> zeroinitializer
89 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.sub.nxv4i32(<vscale x 4 x i1> %pg,
90 <vscale x 4 x i32> %a_z,
91 <vscale x 4 x i32> %b)
92 ret <vscale x 4 x i32> %out
95 define <vscale x 2 x i64> @sub_i64_zero(<vscale x 2 x i1> %pg, <vscale x 2 x i64> %a, <vscale x 2 x i64> %b) {
96 ; CHECK-LABEL: sub_i64_zero:
97 ; CHECK: movprfx z0.d, p0/z, z0.d
98 ; CHECK-NEXT: sub z0.d, p0/m, z0.d, z1.d
100 %a_z = select <vscale x 2 x i1> %pg, <vscale x 2 x i64> %a, <vscale x 2 x i64> zeroinitializer
101 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.sub.nxv2i64(<vscale x 2 x i1> %pg,
102 <vscale x 2 x i64> %a_z,
103 <vscale x 2 x i64> %b)
104 ret <vscale x 2 x i64> %out
111 define <vscale x 16 x i8> @subr_i8_zero(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale x 16 x i8> %b) {
112 ; CHECK-LABEL: subr_i8_zero:
113 ; CHECK: movprfx z0.b, p0/z, z0.b
114 ; CHECK-NEXT: subr z0.b, p0/m, z0.b, z1.b
116 %a_z = select <vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale x 16 x i8> zeroinitializer
117 %out = call <vscale x 16 x i8> @llvm.aarch64.sve.subr.nxv16i8(<vscale x 16 x i1> %pg,
118 <vscale x 16 x i8> %a_z,
119 <vscale x 16 x i8> %b)
120 ret <vscale x 16 x i8> %out
123 define <vscale x 8 x i16> @subr_i16_zero(<vscale x 8 x i1> %pg, <vscale x 8 x i16> %a, <vscale x 8 x i16> %b) {
124 ; CHECK-LABEL: subr_i16_zero:
125 ; CHECK: movprfx z0.h, p0/z, z0.h
126 ; CHECK-NEXT: subr z0.h, p0/m, z0.h, z1.h
128 %a_z = select <vscale x 8 x i1> %pg, <vscale x 8 x i16> %a, <vscale x 8 x i16> zeroinitializer
129 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.subr.nxv8i16(<vscale x 8 x i1> %pg,
130 <vscale x 8 x i16> %a_z,
131 <vscale x 8 x i16> %b)
132 ret <vscale x 8 x i16> %out
135 define <vscale x 4 x i32> @subr_i32_zero(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
136 ; CHECK-LABEL: subr_i32_zero:
137 ; CHECK: movprfx z0.s, p0/z, z0.s
138 ; CHECK-NEXT: subr z0.s, p0/m, z0.s, z1.s
140 %a_z = select <vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> zeroinitializer
141 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.subr.nxv4i32(<vscale x 4 x i1> %pg,
142 <vscale x 4 x i32> %a_z,
143 <vscale x 4 x i32> %b)
144 ret <vscale x 4 x i32> %out
147 define <vscale x 2 x i64> @subr_i64_zero(<vscale x 2 x i1> %pg, <vscale x 2 x i64> %a, <vscale x 2 x i64> %b) {
148 ; CHECK-LABEL: subr_i64_zero:
149 ; CHECK: movprfx z0.d, p0/z, z0.d
150 ; CHECK-NEXT: subr z0.d, p0/m, z0.d, z1.d
152 %a_z = select <vscale x 2 x i1> %pg, <vscale x 2 x i64> %a, <vscale x 2 x i64> zeroinitializer
153 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.subr.nxv2i64(<vscale x 2 x i1> %pg,
154 <vscale x 2 x i64> %a_z,
155 <vscale x 2 x i64> %b)
156 ret <vscale x 2 x i64> %out
159 declare <vscale x 16 x i8> @llvm.aarch64.sve.add.nxv16i8(<vscale x 16 x i1>, <vscale x 16 x i8>, <vscale x 16 x i8>)
160 declare <vscale x 8 x i16> @llvm.aarch64.sve.add.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>, <vscale x 8 x i16>)
161 declare <vscale x 4 x i32> @llvm.aarch64.sve.add.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>, <vscale x 4 x i32>)
162 declare <vscale x 2 x i64> @llvm.aarch64.sve.add.nxv2i64(<vscale x 2 x i1>, <vscale x 2 x i64>, <vscale x 2 x i64>)
164 declare <vscale x 16 x i8> @llvm.aarch64.sve.sub.nxv16i8(<vscale x 16 x i1>, <vscale x 16 x i8>, <vscale x 16 x i8>)
165 declare <vscale x 8 x i16> @llvm.aarch64.sve.sub.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>, <vscale x 8 x i16>)
166 declare <vscale x 4 x i32> @llvm.aarch64.sve.sub.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>, <vscale x 4 x i32>)
167 declare <vscale x 2 x i64> @llvm.aarch64.sve.sub.nxv2i64(<vscale x 2 x i1>, <vscale x 2 x i64>, <vscale x 2 x i64>)
169 declare <vscale x 16 x i8> @llvm.aarch64.sve.subr.nxv16i8(<vscale x 16 x i1>, <vscale x 16 x i8>, <vscale x 16 x i8>)
170 declare <vscale x 8 x i16> @llvm.aarch64.sve.subr.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>, <vscale x 8 x i16>)
171 declare <vscale x 4 x i32> @llvm.aarch64.sve.subr.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>, <vscale x 4 x i32>)
172 declare <vscale x 2 x i64> @llvm.aarch64.sve.subr.nxv2i64(<vscale x 2 x i1>, <vscale x 2 x i64>, <vscale x 2 x i64>)