1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s
4 define i64 @and_bic(i64 %0, i64 %1) {
5 ; CHECK-LABEL: and_bic:
7 ; CHECK-NEXT: mvn w8, w0
8 ; CHECK-NEXT: orr x8, x8, #0xffffffffffff00ff
9 ; CHECK-NEXT: and x0, x8, x1
11 %3 = and i64 %0, 65280
17 define i64 @and_bic2(i32 %0, i64 %1) {
18 ; CHECK-LABEL: and_bic2:
20 ; CHECK-NEXT: mvn w8, w0
21 ; CHECK-NEXT: orr w8, w8, #0xffff00ff
22 ; CHECK-NEXT: and x0, x8, x1
24 %3 = and i32 %0, 65280
26 %5 = zext i32 %4 to i64
31 define i32 @and_bic3(i32 %0, i32 %1) {
32 ; CHECK-LABEL: and_bic3:
34 ; CHECK-NEXT: mvn w8, w0
35 ; CHECK-NEXT: orr w8, w8, #0xffff00ff
36 ; CHECK-NEXT: and w0, w8, w1
38 %3 = and i32 %0, 65280
44 define i64 @and_eon(i64 %0, i64 %1) {
45 ; CHECK-LABEL: and_eon:
47 ; CHECK-NEXT: and x8, x0, #0xff00
48 ; CHECK-NEXT: eon x0, x8, x1
50 %3 = and i64 %0, 65280
56 define i64 @and_eon2(i32 %0, i64 %1) {
57 ; CHECK-LABEL: and_eon2:
59 ; CHECK-NEXT: mvn w8, w0
60 ; CHECK-NEXT: orr w8, w8, #0xffff00ff
61 ; CHECK-NEXT: eor x0, x8, x1
63 %3 = and i32 %0, 65280
65 %5 = zext i32 %4 to i64
70 define i32 @and_eon3(i32 %0, i32 %1) {
71 ; CHECK-LABEL: and_eon3:
73 ; CHECK-NEXT: and w8, w0, #0xff00
74 ; CHECK-NEXT: eon w0, w8, w1
76 %3 = and i32 %0, 65280
82 define i64 @and_orn(i64 %0, i64 %1) {
83 ; CHECK-LABEL: and_orn:
85 ; CHECK-NEXT: orn w8, w1, w0
86 ; CHECK-NEXT: orr x0, x8, #0xffffffffffff00ff
88 %3 = and i64 %0, 65280
94 define i64 @and_orn2(i32 %0, i64 %1) {
95 ; CHECK-LABEL: and_orn2:
97 ; CHECK-NEXT: mvn w8, w0
98 ; CHECK-NEXT: orr w8, w8, #0xffff00ff
99 ; CHECK-NEXT: orr x0, x8, x1
101 %3 = and i32 %0, 65280
103 %5 = zext i32 %4 to i64
108 define i32 @and_orn3(i32 %0, i32 %1) {
109 ; CHECK-LABEL: and_orn3:
111 ; CHECK-NEXT: orn w8, w1, w0
112 ; CHECK-NEXT: orr w0, w8, #0xffff00ff
114 %3 = and i32 %0, 65280
120 define i64 @_Z6or_bic(i64 %0, i64 %1) {
121 ; CHECK-LABEL: _Z6or_bic:
123 ; CHECK-NEXT: bic x8, x1, x0
124 ; CHECK-NEXT: and x0, x8, #0xffffffffffff00ff
126 %3 = and i64 %0, -65281
127 %4 = xor i64 %3, -65281
132 define i64 @or_bic2(i32 %0, i64 %1) {
133 ; CHECK-LABEL: or_bic2:
135 ; CHECK-NEXT: mov w8, #-65281
136 ; CHECK-NEXT: bic w8, w8, w0
137 ; CHECK-NEXT: and x0, x8, x1
139 %3 = and i32 %0, -65281
140 %4 = xor i32 %3, -65281
141 %5 = zext i32 %4 to i64
146 define i32 @or_bic3(i32 %0, i32 %1) {
147 ; CHECK-LABEL: or_bic3:
149 ; CHECK-NEXT: bic w8, w1, w0
150 ; CHECK-NEXT: and w0, w8, #0xfffff000
152 %3 = and i32 %0, -4096
153 %4 = xor i32 %3, -4096
158 define i64 @_Z6or_orn(i64 %0, i64 %1) {
159 ; CHECK-LABEL: _Z6or_orn:
161 ; CHECK-NEXT: mov x8, #-4096
162 ; CHECK-NEXT: bic x8, x8, x0
163 ; CHECK-NEXT: orr x0, x8, x1
165 %3 = and i64 %0, -4096
166 %4 = xor i64 %3, -4096
171 define i64 @or_orn2(i32 %0, i64 %1) {
172 ; CHECK-LABEL: or_orn2:
174 ; CHECK-NEXT: mov w8, #-4096
175 ; CHECK-NEXT: bic w8, w8, w0
176 ; CHECK-NEXT: orr x0, x8, x1
178 %3 = and i32 %0, -4096
179 %4 = xor i32 %3, -4096
180 %5 = zext i32 %4 to i64
185 define i64 @or_orn3(i32 %0, i64 %1) {
186 ; CHECK-LABEL: or_orn3:
188 ; CHECK-NEXT: mov w8, #-4096
189 ; CHECK-NEXT: bic w8, w8, w0
190 ; CHECK-NEXT: orr x0, x8, x1
192 %3 = and i32 %0, -4096
193 %4 = xor i32 %3, -4096
194 %5 = zext i32 %4 to i64
199 define i64 @_Z6or_eon(i64 %0, i64 %1) {
200 ; CHECK-LABEL: _Z6or_eon:
202 ; CHECK-NEXT: and x8, x0, #0xfffffffffffff000
203 ; CHECK-NEXT: eor x8, x8, x1
204 ; CHECK-NEXT: eor x0, x8, #0xfffffffffffff000
206 %3 = and i64 %0, -4096
208 %5 = xor i64 %4, -4096
212 define i64 @or_eon2(i32 %0, i64 %1) {
213 ; CHECK-LABEL: or_eon2:
215 ; CHECK-NEXT: mov w8, #-4096
216 ; CHECK-NEXT: bic w8, w8, w0
217 ; CHECK-NEXT: eor x0, x8, x1
219 %3 = and i32 %0, -4096
220 %4 = xor i32 %3, -4096
221 %5 = zext i32 %4 to i64
226 define i64 @or_eon3(i32 %0, i64 %1) {
227 ; CHECK-LABEL: or_eon3:
229 ; CHECK-NEXT: mov w8, #-4096
230 ; CHECK-NEXT: bic w8, w8, w0
231 ; CHECK-NEXT: eor x0, x8, x1
233 %3 = and i32 %0, -4096
234 %4 = xor i32 %3, -4096
235 %5 = zext i32 %4 to i64