1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=m68k-linux -verify-machineinstrs | FileCheck %s
6 define zeroext i8 @andb(i8 zeroext %a, i8 zeroext %b) nounwind {
9 ; CHECK-NEXT: move.b (11,%sp), %d0
10 ; CHECK-NEXT: move.b (7,%sp), %d1
11 ; CHECK-NEXT: and.b %d0, %d1
12 ; CHECK-NEXT: move.l %d1, %d0
13 ; CHECK-NEXT: and.l #255, %d0
19 define zeroext i16 @andw(i16 zeroext %a, i16 zeroext %b) nounwind {
22 ; CHECK-NEXT: move.w (10,%sp), %d0
23 ; CHECK-NEXT: move.w (6,%sp), %d1
24 ; CHECK-NEXT: and.w %d0, %d1
25 ; CHECK-NEXT: move.l %d1, %d0
26 ; CHECK-NEXT: and.l #65535, %d0
32 define i32 @andl(i32 %a, i32 %b) nounwind {
35 ; CHECK-NEXT: move.l (8,%sp), %d1
36 ; CHECK-NEXT: move.l (4,%sp), %d0
37 ; CHECK-NEXT: and.l %d1, %d0
43 define zeroext i8 @orb(i8 zeroext %a, i8 zeroext %b) nounwind {
46 ; CHECK-NEXT: move.b (11,%sp), %d0
47 ; CHECK-NEXT: move.b (7,%sp), %d1
48 ; CHECK-NEXT: or.b %d0, %d1
49 ; CHECK-NEXT: move.l %d1, %d0
50 ; CHECK-NEXT: and.l #255, %d0
56 define zeroext i16 @orw(i16 zeroext %a, i16 zeroext %b) nounwind {
59 ; CHECK-NEXT: move.w (10,%sp), %d0
60 ; CHECK-NEXT: move.w (6,%sp), %d1
61 ; CHECK-NEXT: or.w %d0, %d1
62 ; CHECK-NEXT: move.l %d1, %d0
63 ; CHECK-NEXT: and.l #65535, %d0
69 define i32 @orl(i32 %a, i32 %b) nounwind {
72 ; CHECK-NEXT: move.l (8,%sp), %d1
73 ; CHECK-NEXT: move.l (4,%sp), %d0
74 ; CHECK-NEXT: or.l %d1, %d0
80 define zeroext i8 @eorb(i8 zeroext %a, i8 zeroext %b) nounwind {
83 ; CHECK-NEXT: move.b (11,%sp), %d0
84 ; CHECK-NEXT: move.b (7,%sp), %d1
85 ; CHECK-NEXT: eor.b %d0, %d1
86 ; CHECK-NEXT: move.l %d1, %d0
87 ; CHECK-NEXT: and.l #255, %d0
93 define zeroext i16 @eorw(i16 zeroext %a, i16 zeroext %b) nounwind {
96 ; CHECK-NEXT: move.w (10,%sp), %d0
97 ; CHECK-NEXT: move.w (6,%sp), %d1
98 ; CHECK-NEXT: eor.w %d0, %d1
99 ; CHECK-NEXT: move.l %d1, %d0
100 ; CHECK-NEXT: and.l #65535, %d0
106 define i32 @eorl(i32 %a, i32 %b) nounwind {
109 ; CHECK-NEXT: move.l (8,%sp), %d1
110 ; CHECK-NEXT: move.l (4,%sp), %d0
111 ; CHECK-NEXT: eor.l %d1, %d0
118 ; For type i8 and i16, value is loaded from memory to avoid optimizing it to *.l
120 define void @andib(i8* %a) nounwind {
121 ; CHECK-LABEL: andib:
123 ; CHECK-NEXT: move.l (4,%sp), %a0
124 ; CHECK-NEXT: move.b (%a0), %d0
125 ; CHECK-NEXT: and.b #18, %d0
126 ; CHECK-NEXT: move.b %d0, (%a0)
134 define void @andiw(i16* %a) nounwind {
135 ; CHECK-LABEL: andiw:
137 ; CHECK-NEXT: move.l (4,%sp), %a0
138 ; CHECK-NEXT: move.w (%a0), %d0
139 ; CHECK-NEXT: and.w #4660, %d0
140 ; CHECK-NEXT: move.w %d0, (%a0)
142 %1 = load i16, i16* %a
143 %2 = and i16 %1, 4660
144 store i16 %2, i16* %a
148 define i32 @andil(i32 %a) nounwind {
149 ; CHECK-LABEL: andil:
151 ; CHECK-NEXT: move.l (4,%sp), %d0
152 ; CHECK-NEXT: and.l #305419896, %d0
154 %1 = and i32 %a, 305419896
158 define void @orib(i8* %a) nounwind {
161 ; CHECK-NEXT: move.l (4,%sp), %a0
162 ; CHECK-NEXT: move.b (%a0), %d0
163 ; CHECK-NEXT: or.b #18, %d0
164 ; CHECK-NEXT: move.b %d0, (%a0)
172 define void @oriw(i16* %a) nounwind {
175 ; CHECK-NEXT: move.l (4,%sp), %a0
176 ; CHECK-NEXT: move.w (%a0), %d0
177 ; CHECK-NEXT: or.w #4660, %d0
178 ; CHECK-NEXT: move.w %d0, (%a0)
180 %1 = load i16, i16* %a
182 store i16 %2, i16* %a
186 define i32 @oril(i32 %a) nounwind {
189 ; CHECK-NEXT: move.l (4,%sp), %d0
190 ; CHECK-NEXT: or.l #305419896, %d0
192 %1 = or i32 %a, 305419896
196 define void @eorib(i8* %a) nounwind {
197 ; CHECK-LABEL: eorib:
199 ; CHECK-NEXT: move.l (4,%sp), %a0
200 ; CHECK-NEXT: move.b (%a0), %d0
201 ; CHECK-NEXT: eori.b #18, %d0
202 ; CHECK-NEXT: move.b %d0, (%a0)
210 define void @eoriw(i16* %a) nounwind {
211 ; CHECK-LABEL: eoriw:
213 ; CHECK-NEXT: move.l (4,%sp), %a0
214 ; CHECK-NEXT: move.w (%a0), %d0
215 ; CHECK-NEXT: eori.w #4660, %d0
216 ; CHECK-NEXT: move.w %d0, (%a0)
218 %1 = load i16, i16* %a
219 %2 = xor i16 %1, 4660
220 store i16 %2, i16* %a
224 define i32 @eoril(i32 %a) nounwind {
225 ; CHECK-LABEL: eoril:
227 ; CHECK-NEXT: move.l (4,%sp), %d0
228 ; CHECK-NEXT: eori.l #305419896, %d0
230 %1 = xor i32 %a, 305419896