1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc --mtriple=loongarch32 < %s | FileCheck %s --check-prefix=LA32
3 ; RUN: llc --mtriple=loongarch64 < %s | FileCheck %s --check-prefix=LA64
5 define i8 @nor_i8(i8 %a, i8 %b) nounwind {
8 ; LA32-NEXT: nor $a0, $a0, $a1
13 ; LA64-NEXT: nor $a0, $a0, $a1
20 define i16 @nor_i16(i16 %a, i16 %b) nounwind {
21 ; LA32-LABEL: nor_i16:
23 ; LA32-NEXT: nor $a0, $a0, $a1
26 ; LA64-LABEL: nor_i16:
28 ; LA64-NEXT: nor $a0, $a0, $a1
31 %neg = xor i16 %or, -1
35 define i32 @nor_i32(i32 %a, i32 %b) nounwind {
36 ; LA32-LABEL: nor_i32:
38 ; LA32-NEXT: nor $a0, $a0, $a1
41 ; LA64-LABEL: nor_i32:
43 ; LA64-NEXT: nor $a0, $a0, $a1
46 %neg = xor i32 %or, -1
50 define i64 @nor_i64(i64 %a, i64 %b) nounwind {
51 ; LA32-LABEL: nor_i64:
53 ; LA32-NEXT: nor $a0, $a0, $a2
54 ; LA32-NEXT: nor $a1, $a1, $a3
57 ; LA64-LABEL: nor_i64:
59 ; LA64-NEXT: nor $a0, $a0, $a1
62 %neg = xor i64 %or, -1
66 define i8 @nor_zero_i8(i8 %a) nounwind {
67 ; LA32-LABEL: nor_zero_i8:
69 ; LA32-NEXT: nor $a0, $a0, $zero
72 ; LA64-LABEL: nor_zero_i8:
74 ; LA64-NEXT: nor $a0, $a0, $zero
80 define i16 @nor_zero_i16(i16 %a) nounwind {
81 ; LA32-LABEL: nor_zero_i16:
83 ; LA32-NEXT: nor $a0, $a0, $zero
86 ; LA64-LABEL: nor_zero_i16:
88 ; LA64-NEXT: nor $a0, $a0, $zero
94 define i32 @nor_zero_i32(i32 %a) nounwind {
95 ; LA32-LABEL: nor_zero_i32:
97 ; LA32-NEXT: nor $a0, $a0, $zero
100 ; LA64-LABEL: nor_zero_i32:
102 ; LA64-NEXT: nor $a0, $a0, $zero
104 %neg = xor i32 %a, -1
108 define i64 @nor_zero_i64(i64 %a) nounwind {
109 ; LA32-LABEL: nor_zero_i64:
111 ; LA32-NEXT: nor $a0, $a0, $zero
112 ; LA32-NEXT: nor $a1, $a1, $zero
115 ; LA64-LABEL: nor_zero_i64:
117 ; LA64-NEXT: nor $a0, $a0, $zero
119 %neg = xor i64 %a, -1
123 define i8 @orn_i8(i8 %a, i8 %b) nounwind {
124 ; LA32-LABEL: orn_i8:
126 ; LA32-NEXT: orn $a0, $a0, $a1
129 ; LA64-LABEL: orn_i8:
131 ; LA64-NEXT: orn $a0, $a0, $a1
138 define i16 @orn_i16(i16 %a, i16 %b) nounwind {
139 ; LA32-LABEL: orn_i16:
141 ; LA32-NEXT: orn $a0, $a0, $a1
144 ; LA64-LABEL: orn_i16:
146 ; LA64-NEXT: orn $a0, $a0, $a1
148 %neg = xor i16 %b, -1
149 %or = or i16 %neg, %a
153 define i32 @orn_i32(i32 %a, i32 %b) nounwind {
154 ; LA32-LABEL: orn_i32:
156 ; LA32-NEXT: orn $a0, $a0, $a1
159 ; LA64-LABEL: orn_i32:
161 ; LA64-NEXT: orn $a0, $a0, $a1
163 %neg = xor i32 %b, -1
164 %or = or i32 %neg, %a
168 define i64 @orn_i64(i64 %a, i64 %b) nounwind {
169 ; LA32-LABEL: orn_i64:
171 ; LA32-NEXT: orn $a0, $a0, $a2
172 ; LA32-NEXT: orn $a1, $a1, $a3
175 ; LA64-LABEL: orn_i64:
177 ; LA64-NEXT: orn $a0, $a0, $a1
179 %neg = xor i64 %b, -1
180 %or = or i64 %neg, %a
184 define i8 @andn_i8(i8 %a, i8 %b) nounwind {
185 ; LA32-LABEL: andn_i8:
187 ; LA32-NEXT: andn $a0, $a0, $a1
190 ; LA64-LABEL: andn_i8:
192 ; LA64-NEXT: andn $a0, $a0, $a1
195 %and = and i8 %neg, %a
199 define i16 @andn_i16(i16 %a, i16 %b) nounwind {
200 ; LA32-LABEL: andn_i16:
202 ; LA32-NEXT: andn $a0, $a0, $a1
205 ; LA64-LABEL: andn_i16:
207 ; LA64-NEXT: andn $a0, $a0, $a1
209 %neg = xor i16 %b, -1
210 %and = and i16 %neg, %a
214 define i32 @andn_i32(i32 %a, i32 %b) nounwind {
215 ; LA32-LABEL: andn_i32:
217 ; LA32-NEXT: andn $a0, $a0, $a1
220 ; LA64-LABEL: andn_i32:
222 ; LA64-NEXT: andn $a0, $a0, $a1
224 %neg = xor i32 %b, -1
225 %and = and i32 %neg, %a
229 define i64 @andn_i64(i64 %a, i64 %b) nounwind {
230 ; LA32-LABEL: andn_i64:
232 ; LA32-NEXT: andn $a0, $a0, $a2
233 ; LA32-NEXT: andn $a1, $a1, $a3
236 ; LA64-LABEL: andn_i64:
238 ; LA64-NEXT: andn $a0, $a0, $a1
240 %neg = xor i64 %b, -1
241 %and = and i64 %neg, %a