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
4 target triple = "aarch64-unknown-linux-gnu"
7 define <4 x i8> @vls_sve_and_4xi8(<4 x i8> %b) nounwind {
8 ; CHECK-LABEL: vls_sve_and_4xi8:
10 ; CHECK-NEXT: adrp x8, .LCPI0_0
11 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
12 ; CHECK-NEXT: ldr d1, [x8, :lo12:.LCPI0_0]
13 ; CHECK-NEXT: and z0.d, z0.d, z1.d
14 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
16 %c = and <4 x i8> %b, <i8 0, i8 255, i8 0, i8 255>
20 define <8 x i8> @vls_sve_and_8xi8(<8 x i8> %b) nounwind {
21 ; CHECK-LABEL: vls_sve_and_8xi8:
23 ; CHECK-NEXT: adrp x8, .LCPI1_0
24 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
25 ; CHECK-NEXT: ldr d1, [x8, :lo12:.LCPI1_0]
26 ; CHECK-NEXT: and z0.d, z0.d, z1.d
27 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
29 %c = and <8 x i8> %b, <i8 0, i8 255, i8 0, i8 255, i8 0, i8 255, i8 0, i8 255>
33 define <16 x i8> @vls_sve_and_16xi8(<16 x i8> %b) nounwind {
34 ; CHECK-LABEL: vls_sve_and_16xi8:
36 ; CHECK-NEXT: adrp x8, .LCPI2_0
37 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
38 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI2_0]
39 ; CHECK-NEXT: and z0.d, z0.d, z1.d
40 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
42 %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>
46 define <32 x i8> @vls_sve_and_32xi8(<32 x i8> %ap) nounwind {
47 ; CHECK-LABEL: vls_sve_and_32xi8:
49 ; CHECK-NEXT: adrp x8, .LCPI3_0
50 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
51 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
52 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI3_0]
53 ; CHECK-NEXT: and z0.d, z0.d, z2.d
54 ; CHECK-NEXT: and z1.d, z1.d, z2.d
55 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
56 ; CHECK-NEXT: // kill: def $q1 killed $q1 killed $z1
58 %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,
59 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>
64 define <2 x i16> @vls_sve_and_2xi16(<2 x i16> %b) nounwind {
65 ; CHECK-LABEL: vls_sve_and_2xi16:
67 ; CHECK-NEXT: sub sp, sp, #16
68 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
69 ; CHECK-NEXT: mov z0.s, z0.s[1]
70 ; CHECK-NEXT: fmov w8, s0
71 ; CHECK-NEXT: stp wzr, w8, [sp, #8]
72 ; CHECK-NEXT: ldr d0, [sp, #8]
73 ; CHECK-NEXT: add sp, sp, #16
75 %c = and <2 x i16> %b, <i16 0, i16 65535>
79 define <4 x i16> @vls_sve_and_4xi16(<4 x i16> %b) nounwind {
80 ; CHECK-LABEL: vls_sve_and_4xi16:
82 ; CHECK-NEXT: adrp x8, .LCPI5_0
83 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
84 ; CHECK-NEXT: ldr d1, [x8, :lo12:.LCPI5_0]
85 ; CHECK-NEXT: and z0.d, z0.d, z1.d
86 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
88 %c = and <4 x i16> %b, <i16 0, i16 65535, i16 0, i16 65535>
92 define <8 x i16> @vls_sve_and_8xi16(<8 x i16> %b) nounwind {
93 ; CHECK-LABEL: vls_sve_and_8xi16:
95 ; CHECK-NEXT: adrp x8, .LCPI6_0
96 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
97 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI6_0]
98 ; CHECK-NEXT: and z0.d, z0.d, z1.d
99 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
101 %c = and <8 x i16> %b, <i16 0, i16 65535, i16 0, i16 65535, i16 0, i16 65535, i16 0, i16 65535>
105 define <16 x i16> @vls_sve_and_16xi16(<16 x i16> %b) nounwind {
106 ; CHECK-LABEL: vls_sve_and_16xi16:
108 ; CHECK-NEXT: adrp x8, .LCPI7_0
109 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
110 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
111 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI7_0]
112 ; CHECK-NEXT: and z0.d, z0.d, z2.d
113 ; CHECK-NEXT: and z1.d, z1.d, z2.d
114 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
115 ; CHECK-NEXT: // kill: def $q1 killed $q1 killed $z1
117 %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>
122 define <2 x i32> @vls_sve_and_2xi32(<2 x i32> %b) nounwind {
123 ; CHECK-LABEL: vls_sve_and_2xi32:
125 ; CHECK-NEXT: index z1.s, #0, #-1
126 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
127 ; CHECK-NEXT: and z0.d, z0.d, z1.d
128 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
130 %c = and <2 x i32> %b, <i32 0, i32 4294967295>
134 define <4 x i32> @vls_sve_and_4xi32(<4 x i32> %b) nounwind {
135 ; CHECK-LABEL: vls_sve_and_4xi32:
137 ; CHECK-NEXT: adrp x8, .LCPI9_0
138 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
139 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI9_0]
140 ; CHECK-NEXT: and z0.d, z0.d, z1.d
141 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
143 %c = and <4 x i32> %b, <i32 0, i32 4294967295, i32 0, i32 4294967295>
147 define <8 x i32> @vls_sve_and_8xi32(<8 x i32> %b) nounwind {
148 ; CHECK-LABEL: vls_sve_and_8xi32:
150 ; CHECK-NEXT: adrp x8, .LCPI10_0
151 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
152 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
153 ; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI10_0]
154 ; CHECK-NEXT: and z0.d, z0.d, z2.d
155 ; CHECK-NEXT: and z1.d, z1.d, z2.d
156 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
157 ; CHECK-NEXT: // kill: def $q1 killed $q1 killed $z1
159 %c = and <8 x i32> %b, <i32 0, i32 4294967295, i32 0, i32 4294967295, i32 0, i32 4294967295, i32 0, i32 4294967295>
164 define <2 x i64> @vls_sve_and_2xi64(<2 x i64> %b) nounwind {
165 ; CHECK-LABEL: vls_sve_and_2xi64:
167 ; CHECK-NEXT: index z1.d, #0, #-1
168 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
169 ; CHECK-NEXT: and z0.d, z0.d, z1.d
170 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
172 %c = and <2 x i64> %b, <i64 0, i64 18446744073709551615>
176 define <4 x i64> @vls_sve_and_4xi64(<4 x i64> %b) nounwind {
177 ; CHECK-LABEL: vls_sve_and_4xi64:
179 ; CHECK-NEXT: index z2.d, #0, #-1
180 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
181 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
182 ; CHECK-NEXT: and z0.d, z0.d, z2.d
183 ; CHECK-NEXT: and z1.d, z1.d, z2.d
184 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
185 ; CHECK-NEXT: // kill: def $q1 killed $q1 killed $z1
187 %c = and <4 x i64> %b, <i64 0, i64 18446744073709551615, i64 0, i64 18446744073709551615>