1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve -force-streaming-compatible-sve < %s | FileCheck %s
3 ; RUN: llc -mattr=+sme -force-streaming-compatible-sve < %s | FileCheck %s
5 target triple = "aarch64-unknown-linux-gnu"
8 define <4 x i8> @vls_sve_and_4xi8(<4 x i8> %b) nounwind {
9 ; CHECK-LABEL: vls_sve_and_4xi8:
11 ; CHECK-NEXT: adrp x8, .LCPI0_0
12 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
13 ; CHECK-NEXT: ldr d1, [x8, :lo12:.LCPI0_0]
14 ; CHECK-NEXT: and z0.d, z0.d, z1.d
15 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
17 %c = and <4 x i8> %b, <i8 0, i8 255, i8 0, i8 255>
21 define <8 x i8> @vls_sve_and_8xi8(<8 x i8> %b) nounwind {
22 ; CHECK-LABEL: vls_sve_and_8xi8:
24 ; CHECK-NEXT: adrp x8, .LCPI1_0
25 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
26 ; CHECK-NEXT: ldr d1, [x8, :lo12:.LCPI1_0]
27 ; CHECK-NEXT: and z0.d, z0.d, z1.d
28 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
30 %c = and <8 x i8> %b, <i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255>
34 define <16 x i8> @vls_sve_and_16xi8(<16 x i8> %b) nounwind {
35 ; CHECK-LABEL: vls_sve_and_16xi8:
37 ; CHECK-NEXT: adrp x8, .LCPI2_0
38 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
39 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI2_0]
40 ; CHECK-NEXT: and z0.d, z0.d, z1.d
41 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
43 %c = and <16 x i8> %b, <i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255>
47 define <32 x i8> @vls_sve_and_32xi8(<32 x i8> %ap) nounwind {
48 ; CHECK-LABEL: vls_sve_and_32xi8:
50 ; CHECK-NEXT: adrp x8, .LCPI3_0
51 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
52 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
53 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI3_0]
54 ; CHECK-NEXT: and z0.d, z0.d, z2.d
55 ; CHECK-NEXT: and z1.d, z1.d, z2.d
56 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
57 ; CHECK-NEXT: // kill: def $q1 killed $q1 killed $z1
59 %b = and <32 x i8> %ap, <i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255,
60 i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255>
65 define <2 x i16> @vls_sve_and_2xi16(<2 x i16> %b) nounwind {
66 ; CHECK-LABEL: vls_sve_and_2xi16:
68 ; CHECK-NEXT: sub sp, sp, #16
69 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
70 ; CHECK-NEXT: mov z0.s, z0.s[1]
71 ; CHECK-NEXT: fmov w8, s0
72 ; CHECK-NEXT: stp wzr, w8, [sp, #8]
73 ; CHECK-NEXT: ldr d0, [sp, #8]
74 ; CHECK-NEXT: add sp, sp, #16
76 %c = and <2 x i16> %b, <i16 0, i16 65535>
80 define <4 x i16> @vls_sve_and_4xi16(<4 x i16> %b) nounwind {
81 ; CHECK-LABEL: vls_sve_and_4xi16:
83 ; CHECK-NEXT: adrp x8, .LCPI5_0
84 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
85 ; CHECK-NEXT: ldr d1, [x8, :lo12:.LCPI5_0]
86 ; CHECK-NEXT: and z0.d, z0.d, z1.d
87 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
89 %c = and <4 x i16> %b, <i16 0, i16 65535, i16 0, i16 65535>
93 define <8 x i16> @vls_sve_and_8xi16(<8 x i16> %b) nounwind {
94 ; CHECK-LABEL: vls_sve_and_8xi16:
96 ; CHECK-NEXT: adrp x8, .LCPI6_0
97 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
98 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI6_0]
99 ; CHECK-NEXT: and z0.d, z0.d, z1.d
100 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
102 %c = and <8 x i16> %b, <i16 0, i16 65535, i16 0, i16 65535, i16 0, i16 65535, i16 0, i16 65535>
106 define <16 x i16> @vls_sve_and_16xi16(<16 x i16> %b) nounwind {
107 ; CHECK-LABEL: vls_sve_and_16xi16:
109 ; CHECK-NEXT: adrp x8, .LCPI7_0
110 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
111 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
112 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI7_0]
113 ; CHECK-NEXT: and z0.d, z0.d, z2.d
114 ; CHECK-NEXT: and z1.d, z1.d, z2.d
115 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
116 ; CHECK-NEXT: // kill: def $q1 killed $q1 killed $z1
118 %c = and <16 x i16> %b, <i16 0, i16 65535, i16 0, i16 65535, i16 0, i16 65535, i16 0, i16 65535, i16 0, i16 65535, i16 0, i16 65535, i16 0, i16 65535, i16 0, i16 65535>
123 define <2 x i32> @vls_sve_and_2xi32(<2 x i32> %b) nounwind {
124 ; CHECK-LABEL: vls_sve_and_2xi32:
126 ; CHECK-NEXT: index z1.s, #0, #-1
127 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
128 ; CHECK-NEXT: and z0.d, z0.d, z1.d
129 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
131 %c = and <2 x i32> %b, <i32 0, i32 4294967295>
135 define <4 x i32> @vls_sve_and_4xi32(<4 x i32> %b) nounwind {
136 ; CHECK-LABEL: vls_sve_and_4xi32:
138 ; CHECK-NEXT: adrp x8, .LCPI9_0
139 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
140 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI9_0]
141 ; CHECK-NEXT: and z0.d, z0.d, z1.d
142 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
144 %c = and <4 x i32> %b, <i32 0, i32 4294967295, i32 0, i32 4294967295>
148 define <8 x i32> @vls_sve_and_8xi32(<8 x i32> %b) nounwind {
149 ; CHECK-LABEL: vls_sve_and_8xi32:
151 ; CHECK-NEXT: adrp x8, .LCPI10_0
152 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
153 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
154 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI10_0]
155 ; CHECK-NEXT: and z0.d, z0.d, z2.d
156 ; CHECK-NEXT: and z1.d, z1.d, z2.d
157 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
158 ; CHECK-NEXT: // kill: def $q1 killed $q1 killed $z1
160 %c = and <8 x i32> %b, <i32 0, i32 4294967295, i32 0, i32 4294967295, i32 0, i32 4294967295, i32 0, i32 4294967295>
165 define <2 x i64> @vls_sve_and_2xi64(<2 x i64> %b) nounwind {
166 ; CHECK-LABEL: vls_sve_and_2xi64:
168 ; CHECK-NEXT: index z1.d, #0, #-1
169 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
170 ; CHECK-NEXT: and z0.d, z0.d, z1.d
171 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
173 %c = and <2 x i64> %b, <i64 0, i64 18446744073709551615>
177 define <4 x i64> @vls_sve_and_4xi64(<4 x i64> %b) nounwind {
178 ; CHECK-LABEL: vls_sve_and_4xi64:
180 ; CHECK-NEXT: index z2.d, #0, #-1
181 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
182 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
183 ; CHECK-NEXT: and z0.d, z0.d, z2.d
184 ; CHECK-NEXT: and z1.d, z1.d, z2.d
185 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
186 ; CHECK-NEXT: // kill: def $q1 killed $q1 killed $z1
188 %c = and <4 x i64> %b, <i64 0, i64 18446744073709551615, i64 0, i64 18446744073709551615>