blob: 6a27612c0e2b6f1e2922d26d30d4c6f2fe41f383 [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
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000029
30define signext i1 @not_i1(i1 signext %a) {
31entry:
32; ALL-LABEL: not_i1:
33
34 ; GP32: not $2, $4
35
36 ; GP64: not $2, $4
37
38 ; MM: not16 $2, $4
39
40 %r = xor i1 %a, -1
41 ret i1 %r
42}
43
44define signext i8 @not_i8(i8 signext %a) {
45entry:
46; ALL-LABEL: not_i8:
47
48 ; GP32: not $2, $4
49
50 ; GP64: not $2, $4
51
52 ; MM: not16 $2, $4
53
54 %r = xor i8 %a, -1
55 ret i8 %r
56}
57
58define signext i16 @not_i16(i16 signext %a) {
59entry:
60; ALL-LABEL: not_i16:
61
62 ; GP32: not $2, $4
63
64 ; GP64: not $2, $4
65
66 ; MM: not16 $2, $4
67
68 %r = xor i16 %a, -1
69 ret i16 %r
70}
71
72define signext i32 @not_i32(i32 signext %a) {
73entry:
74; ALL-LABEL: not_i32:
75
76 ; GP32: not $2, $4
77
78 ; GP64: not $2, $4
79
80 ; MM: not16 $2, $4
81
82 %r = xor i32 %a, -1
83 ret i32 %r
84}
85
86define signext i64 @not_i64(i64 signext %a) {
87entry:
88; ALL-LABEL: not_i64:
89
90 ; GP32: not $2, $4
91 ; GP32: not $3, $5
92
93 ; GP64: daddiu $[[T0:[0-9]+]], $zero, -1
94 ; GP64: xor $2, $4, $[[T0]]
95
96 ; MM32: not16 $2, $4
97 ; MM32: not16 $3, $5
98
Zlatko Buljand2ed9c62016-06-15 07:46:24 +000099 %r = xor i64 %a, -1
100 ret i64 %r
101}
102
103define signext i128 @not_i128(i128 signext %a) {
104entry:
105; ALL-LABEL: not_i128:
106
107 ; GP32: not $2, $4
108 ; GP32: not $3, $5
109 ; GP32: not $4, $6
110 ; GP32: not $5, $7
111
112 ; GP64: daddiu $[[T0:[0-9]+]], $zero, -1
113 ; GP64: xor $2, $4, $[[T0]]
114 ; GP64: xor $3, $5, $[[T0]]
115
116 ; MM32: not16 $2, $4
117 ; MM32: not16 $3, $5
118 ; MM32: not16 $4, $6
119 ; MM32: not16 $5, $7
120
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000121 %r = xor i128 %a, -1
122 ret i128 %r
123}
124
125define signext i1 @nor_i1(i1 signext %a, i1 signext %b) {
126entry:
127; ALL-LABEL: nor_i1:
128
Sanjay Patel2a61a822017-10-09 15:22:20 +0000129 ; GP32: nor $2, $5, $4
130 ; GP64: or $1, $5, $4
131 ; MM32: nor $2, $5, $4
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000132
133 %or = or i1 %b, %a
134 %r = xor i1 %or, -1
135 ret i1 %r
136}
137
138define signext i8 @nor_i8(i8 signext %a, i8 signext %b) {
139entry:
140; ALL-LABEL: nor_i8:
141
Sanjay Patel2a61a822017-10-09 15:22:20 +0000142 ; GP32: nor $2, $5, $4
143 ; GP64: or $1, $5, $4
144 ; MM32: nor $2, $5, $4
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000145
146 %or = or i8 %b, %a
147 %r = xor i8 %or, -1
148 ret i8 %r
149}
150
151define signext i16 @nor_i16(i16 signext %a, i16 signext %b) {
152entry:
153; ALL-LABEL: nor_i16:
154
Sanjay Patel2a61a822017-10-09 15:22:20 +0000155 ; GP32: nor $2, $5, $4
156 ; GP64: or $1, $5, $4
157 ; MM32: nor $2, $5, $4
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000158
159 %or = or i16 %b, %a
160 %r = xor i16 %or, -1
161 ret i16 %r
162}
163
164define signext i32 @nor_i32(i32 signext %a, i32 signext %b) {
165entry:
166; ALL-LABEL: nor_i32:
167
168 ; GP32: nor $2, $5, $4
169
170 ; GP64: or $[[T0:[0-9]+]], $5, $4
171 ; GP64: sll $[[T1:[0-9]+]], $[[T0]], 0
172 ; GP64: not $2, $[[T1]]
173
174 ; MM32: nor $2, $5, $4
175
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000176 %or = or i32 %b, %a
177 %r = xor i32 %or, -1
178 ret i32 %r
179}
180
181
182define signext i64 @nor_i64(i64 signext %a, i64 signext %b) {
183entry:
184; ALL-LABEL: nor_i64:
185
186 ; GP32: nor $2, $6, $4
187 ; GP32: nor $3, $7, $5
188
189 ; GP64: nor $2, $5, $4
190
191 ; MM32: nor $2, $6, $4
192 ; MM32: nor $3, $7, $5
193
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000194 %or = or i64 %b, %a
195 %r = xor i64 %or, -1
196 ret i64 %r
197}
198
199define signext i128 @nor_i128(i128 signext %a, i128 signext %b) {
200entry:
201; ALL-LABEL: nor_i128:
202
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000203 ; GP32: lw $[[T1:[0-9]+]], 20($sp)
204 ; GP32: lw $[[T2:[0-9]+]], 16($sp)
205 ; GP32: nor $2, $[[T2]], $4
206 ; GP32: nor $3, $[[T1]], $5
Simon Dardisbd271542016-09-01 14:53:53 +0000207 ; GP32: lw $[[T0:[0-9]+]], 24($sp)
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000208 ; GP32: nor $4, $[[T0]], $6
209 ; GP32: lw $[[T3:[0-9]+]], 28($sp)
210 ; GP32: nor $5, $[[T3]], $7
211
212 ; GP64: nor $2, $6, $4
213 ; GP64: nor $3, $7, $5
214
Simon Dardisf1148202016-08-24 13:00:47 +0000215 ; MM32: lw $[[T1:[0-9]+]], 20($sp)
216 ; MM32: lw $[[T2:[0-9]+]], 16($sp)
217 ; MM32: nor $2, $[[T2]], $4
218 ; MM32: nor $3, $[[T1]], $5
Simon Dardisbd271542016-09-01 14:53:53 +0000219 ; MM32: lw $[[T0:[0-9]+]], 24($sp)
Simon Dardisf1148202016-08-24 13:00:47 +0000220 ; MM32: nor $4, $[[T0]], $6
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000221 ; MM32: lw $[[T3:[0-9]+]], 28($sp)
222 ; MM32: nor $5, $[[T3]], $7
223
Zlatko Buljand2ed9c62016-06-15 07:46:24 +0000224 %or = or i128 %b, %a
225 %r = xor i128 %or, -1
226 ret i128 %r
227}