blob: ab7a3c4613a26b86a71031b4dc65e60c17aab5c3 [file] [log] [blame]
Daniel Sanders0d972702016-06-24 12:23:17 +00001; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s -check-prefixes=ALL,GP32
2; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s -check-prefixes=ALL,GP32
Zlatko Buljand2ed9c62016-06-15 07:46:24 +00003; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +00004; RUN: -check-prefixes=ALL,GP32
Zlatko Buljand2ed9c62016-06-15 07:46:24 +00005; RUN: llc < %s -march=mips -mcpu=mips32r3 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +00006; RUN: -check-prefixes=ALL,GP32
Zlatko Buljand2ed9c62016-06-15 07:46:24 +00007; RUN: llc < %s -march=mips -mcpu=mips32r5 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +00008; RUN: -check-prefixes=ALL,GP32
Zlatko Buljand2ed9c62016-06-15 07:46:24 +00009; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000010; RUN: -check-prefixes=ALL,GP32
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000011; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000012; RUN: -check-prefixes=ALL,GP64
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000013; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000014; RUN: -check-prefixes=ALL,GP64
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000015; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000016; RUN: -check-prefixes=ALL,GP64
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000017; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000018; RUN: -check-prefixes=ALL,GP64
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000019; RUN: llc < %s -march=mips64 -mcpu=mips64r3 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000020; RUN: -check-prefixes=ALL,GP64
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000021; RUN: llc < %s -march=mips64 -mcpu=mips64r5 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000022; RUN: -check-prefixes=ALL,GP64
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000023; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000024; RUN: -check-prefixes=ALL,GP64
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000025; RUN: llc < %s -march=mips -mcpu=mips32r3 -mattr=+micromips | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000026; RUN: -check-prefixes=ALL,MM,MM32
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000027; RUN: llc < %s -march=mips -mcpu=mips32r6 -mattr=+micromips | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000028; RUN: -check-prefixes=ALL,MM,MM32
Daniel Sandersde393322016-06-23 12:42:53 +000029; RUN: llc < %s -march=mips -mcpu=mips64r6 -target-abi n64 -mattr=+micromips | FileCheck %s \
Daniel Sanders0d972702016-06-24 12:23:17 +000030; RUN: -check-prefixes=ALL,MM,MM64
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000031
32define signext i1 @not_i1(i1 signext %a) {
33entry:
34; ALL-LABEL: not_i1:
35
36 ; GP32: not $2, $4
37
38 ; GP64: not $2, $4
39
40 ; MM: not16 $2, $4
41
42 %r = xor i1 %a, -1
43 ret i1 %r
44}
45
46define signext i8 @not_i8(i8 signext %a) {
47entry:
48; ALL-LABEL: not_i8:
49
50 ; GP32: not $2, $4
51
52 ; GP64: not $2, $4
53
54 ; MM: not16 $2, $4
55
56 %r = xor i8 %a, -1
57 ret i8 %r
58}
59
60define signext i16 @not_i16(i16 signext %a) {
61entry:
62; ALL-LABEL: not_i16:
63
64 ; GP32: not $2, $4
65
66 ; GP64: not $2, $4
67
68 ; MM: not16 $2, $4
69
70 %r = xor i16 %a, -1
71 ret i16 %r
72}
73
74define signext i32 @not_i32(i32 signext %a) {
75entry:
76; ALL-LABEL: not_i32:
77
78 ; GP32: not $2, $4
79
80 ; GP64: not $2, $4
81
82 ; MM: not16 $2, $4
83
84 %r = xor i32 %a, -1
85 ret i32 %r
86}
87
88define signext i64 @not_i64(i64 signext %a) {
89entry:
90; ALL-LABEL: not_i64:
91
92 ; GP32: not $2, $4
93 ; GP32: not $3, $5
94
95 ; GP64: daddiu $[[T0:[0-9]+]], $zero, -1
96 ; GP64: xor $2, $4, $[[T0]]
97
98 ; MM32: not16 $2, $4
99 ; MM32: not16 $3, $5
100
101 ; MM64: daddiu $[[T0:[0-9]+]], $zero, -1
102 ; MM64: xor $2, $4, $[[T0]]
103
104 %r = xor i64 %a, -1
105 ret i64 %r
106}
107
108define signext i128 @not_i128(i128 signext %a) {
109entry:
110; ALL-LABEL: not_i128:
111
112 ; GP32: not $2, $4
113 ; GP32: not $3, $5
114 ; GP32: not $4, $6
115 ; GP32: not $5, $7
116
117 ; GP64: daddiu $[[T0:[0-9]+]], $zero, -1
118 ; GP64: xor $2, $4, $[[T0]]
119 ; GP64: xor $3, $5, $[[T0]]
120
121 ; MM32: not16 $2, $4
122 ; MM32: not16 $3, $5
123 ; MM32: not16 $4, $6
124 ; MM32: not16 $5, $7
125
126 ; MM64: daddiu $[[T0:[0-9]+]], $zero, -1
127 ; MM64: xor $2, $4, $[[T0]]
128 ; MM64: xor $3, $5, $[[T0]]
129
130 %r = xor i128 %a, -1
131 ret i128 %r
132}
133
134define signext i1 @nor_i1(i1 signext %a, i1 signext %b) {
135entry:
136; ALL-LABEL: nor_i1:
137
Sanjay Patel2a61a822017-10-09 15:22:20 +0000138 ; GP32: nor $2, $5, $4
139 ; GP64: or $1, $5, $4
140 ; MM32: nor $2, $5, $4
141 ; MM64: or $1, $5, $4
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000142
143 %or = or i1 %b, %a
144 %r = xor i1 %or, -1
145 ret i1 %r
146}
147
148define signext i8 @nor_i8(i8 signext %a, i8 signext %b) {
149entry:
150; ALL-LABEL: nor_i8:
151
Sanjay Patel2a61a822017-10-09 15:22:20 +0000152 ; GP32: nor $2, $5, $4
153 ; GP64: or $1, $5, $4
154 ; MM32: nor $2, $5, $4
155 ; MM64: or $1, $5, $4
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000156
157 %or = or i8 %b, %a
158 %r = xor i8 %or, -1
159 ret i8 %r
160}
161
162define signext i16 @nor_i16(i16 signext %a, i16 signext %b) {
163entry:
164; ALL-LABEL: nor_i16:
165
Sanjay Patel2a61a822017-10-09 15:22:20 +0000166 ; GP32: nor $2, $5, $4
167 ; GP64: or $1, $5, $4
168 ; MM32: nor $2, $5, $4
169 ; MM64: or $1, $5, $4
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000170
171 %or = or i16 %b, %a
172 %r = xor i16 %or, -1
173 ret i16 %r
174}
175
176define signext i32 @nor_i32(i32 signext %a, i32 signext %b) {
177entry:
178; ALL-LABEL: nor_i32:
179
180 ; GP32: nor $2, $5, $4
181
182 ; GP64: or $[[T0:[0-9]+]], $5, $4
183 ; GP64: sll $[[T1:[0-9]+]], $[[T0]], 0
184 ; GP64: not $2, $[[T1]]
185
186 ; MM32: nor $2, $5, $4
187
188 ; MM64: or $[[T0:[0-9]+]], $5, $4
189 ; MM64: sll $[[T1:[0-9]+]], $[[T0]], 0
190 ; MM64: not16 $2, $[[T1]]
191
192 %or = or i32 %b, %a
193 %r = xor i32 %or, -1
194 ret i32 %r
195}
196
197
198define signext i64 @nor_i64(i64 signext %a, i64 signext %b) {
199entry:
200; ALL-LABEL: nor_i64:
201
202 ; GP32: nor $2, $6, $4
203 ; GP32: nor $3, $7, $5
204
205 ; GP64: nor $2, $5, $4
206
207 ; MM32: nor $2, $6, $4
208 ; MM32: nor $3, $7, $5
209
210 ; MM64: nor $2, $5, $4
211
212 %or = or i64 %b, %a
213 %r = xor i64 %or, -1
214 ret i64 %r
215}
216
217define signext i128 @nor_i128(i128 signext %a, i128 signext %b) {
218entry:
219; ALL-LABEL: nor_i128:
220
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000221 ; GP32: lw $[[T1:[0-9]+]], 20($sp)
222 ; GP32: lw $[[T2:[0-9]+]], 16($sp)
223 ; GP32: nor $2, $[[T2]], $4
224 ; GP32: nor $3, $[[T1]], $5
Simon Dardisbd271542016-09-01 14:53:53 +0000225 ; GP32: lw $[[T0:[0-9]+]], 24($sp)
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000226 ; GP32: nor $4, $[[T0]], $6
227 ; GP32: lw $[[T3:[0-9]+]], 28($sp)
228 ; GP32: nor $5, $[[T3]], $7
229
230 ; GP64: nor $2, $6, $4
231 ; GP64: nor $3, $7, $5
232
Simon Dardisf1148202016-08-24 13:00:47 +0000233 ; MM32: lw $[[T1:[0-9]+]], 20($sp)
234 ; MM32: lw $[[T2:[0-9]+]], 16($sp)
235 ; MM32: nor $2, $[[T2]], $4
236 ; MM32: nor $3, $[[T1]], $5
Simon Dardisbd271542016-09-01 14:53:53 +0000237 ; MM32: lw $[[T0:[0-9]+]], 24($sp)
Simon Dardisf1148202016-08-24 13:00:47 +0000238 ; MM32: nor $4, $[[T0]], $6
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000239 ; MM32: lw $[[T3:[0-9]+]], 28($sp)
240 ; MM32: nor $5, $[[T3]], $7
241
242 ; MM64: nor $2, $6, $4
243 ; MM64: nor $3, $7, $5
244
245 %or = or i128 %b, %a
246 %r = xor i128 %or, -1
247 ret i128 %r
248}