not.ll
5.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s -check-prefixes=ALL,GP32
; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s -check-prefixes=ALL,GP32
; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
; RUN: -check-prefixes=ALL,GP32
; RUN: llc < %s -march=mips -mcpu=mips32r3 | FileCheck %s \
; RUN: -check-prefixes=ALL,GP32
; RUN: llc < %s -march=mips -mcpu=mips32r5 | FileCheck %s \
; RUN: -check-prefixes=ALL,GP32
; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
; RUN: -check-prefixes=ALL,GP32
; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
; RUN: -check-prefixes=ALL,GP64
; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
; RUN: -check-prefixes=ALL,GP64
; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
; RUN: -check-prefixes=ALL,GP64
; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
; RUN: -check-prefixes=ALL,GP64
; RUN: llc < %s -march=mips64 -mcpu=mips64r3 | FileCheck %s \
; RUN: -check-prefixes=ALL,GP64
; RUN: llc < %s -march=mips64 -mcpu=mips64r5 | FileCheck %s \
; RUN: -check-prefixes=ALL,GP64
; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
; RUN: -check-prefixes=ALL,GP64
; RUN: llc < %s -march=mips -mcpu=mips32r3 -mattr=+micromips | FileCheck %s \
; RUN: -check-prefixes=ALL,MM,MM32
; RUN: llc < %s -march=mips -mcpu=mips32r6 -mattr=+micromips | FileCheck %s \
; RUN: -check-prefixes=ALL,MM,MM32
define signext i1 @not_i1(i1 signext %a) {
entry:
; ALL-LABEL: not_i1:
; GP32: not $2, $4
; GP64: not $2, $4
; MM: not16 $2, $4
%r = xor i1 %a, -1
ret i1 %r
}
define signext i8 @not_i8(i8 signext %a) {
entry:
; ALL-LABEL: not_i8:
; GP32: not $2, $4
; GP64: not $2, $4
; MM: not16 $2, $4
%r = xor i8 %a, -1
ret i8 %r
}
define signext i16 @not_i16(i16 signext %a) {
entry:
; ALL-LABEL: not_i16:
; GP32: not $2, $4
; GP64: not $2, $4
; MM: not16 $2, $4
%r = xor i16 %a, -1
ret i16 %r
}
define signext i32 @not_i32(i32 signext %a) {
entry:
; ALL-LABEL: not_i32:
; GP32: not $2, $4
; GP64: not $1, $4
; GP64: sll $2, $1, 0
; MM: not16 $2, $4
%r = xor i32 %a, -1
ret i32 %r
}
define signext i64 @not_i64(i64 signext %a) {
entry:
; ALL-LABEL: not_i64:
; GP32: not $2, $4
; GP32: not $3, $5
; GP64: daddiu $[[T0:[0-9]+]], $zero, -1
; GP64: xor $2, $4, $[[T0]]
; MM32: not16 $2, $4
; MM32: not16 $3, $5
%r = xor i64 %a, -1
ret i64 %r
}
define signext i128 @not_i128(i128 signext %a) {
entry:
; ALL-LABEL: not_i128:
; GP32: not $2, $4
; GP32: not $3, $5
; GP32: not $4, $6
; GP32: not $5, $7
; GP64: daddiu $[[T0:[0-9]+]], $zero, -1
; GP64: xor $2, $4, $[[T0]]
; GP64: xor $3, $5, $[[T0]]
; MM32: not16 $2, $4
; MM32: not16 $3, $5
; MM32: not16 $4, $6
; MM32: not16 $5, $7
%r = xor i128 %a, -1
ret i128 %r
}
define signext i1 @nor_i1(i1 signext %a, i1 signext %b) {
entry:
; ALL-LABEL: nor_i1:
; GP32: nor $2, $5, $4
; GP64: or $1, $5, $4
; MM32: nor $2, $5, $4
%or = or i1 %b, %a
%r = xor i1 %or, -1
ret i1 %r
}
define signext i8 @nor_i8(i8 signext %a, i8 signext %b) {
entry:
; ALL-LABEL: nor_i8:
; GP32: nor $2, $5, $4
; GP64: or $1, $5, $4
; MM32: nor $2, $5, $4
%or = or i8 %b, %a
%r = xor i8 %or, -1
ret i8 %r
}
define signext i16 @nor_i16(i16 signext %a, i16 signext %b) {
entry:
; ALL-LABEL: nor_i16:
; GP32: nor $2, $5, $4
; GP64: or $1, $5, $4
; MM32: nor $2, $5, $4
%or = or i16 %b, %a
%r = xor i16 %or, -1
ret i16 %r
}
define signext i32 @nor_i32(i32 signext %a, i32 signext %b) {
entry:
; ALL-LABEL: nor_i32:
; GP32: nor $2, $5, $4
; GP64: or $[[T0:[0-9]+]], $5, $4
; GP64: sll $[[T1:[0-9]+]], $[[T0]], 0
; GP64: not $[[T2:[0-9]+]], $[[T1]]
; GP64: sll $2, $[[T2]], 0
; MM32: nor $2, $5, $4
%or = or i32 %b, %a
%r = xor i32 %or, -1
ret i32 %r
}
define signext i64 @nor_i64(i64 signext %a, i64 signext %b) {
entry:
; ALL-LABEL: nor_i64:
; GP32: nor $2, $6, $4
; GP32: nor $3, $7, $5
; GP64: nor $2, $5, $4
; MM32: nor $2, $6, $4
; MM32: nor $3, $7, $5
%or = or i64 %b, %a
%r = xor i64 %or, -1
ret i64 %r
}
define signext i128 @nor_i128(i128 signext %a, i128 signext %b) {
entry:
; ALL-LABEL: nor_i128:
; GP32: lw $[[T1:[0-9]+]], 20($sp)
; GP32: lw $[[T2:[0-9]+]], 16($sp)
; GP32: nor $2, $[[T2]], $4
; GP32: nor $3, $[[T1]], $5
; GP32: lw $[[T0:[0-9]+]], 24($sp)
; GP32: nor $4, $[[T0]], $6
; GP32: lw $[[T3:[0-9]+]], 28($sp)
; GP32: nor $5, $[[T3]], $7
; GP64: nor $2, $6, $4
; GP64: nor $3, $7, $5
; MM32: lw $[[T1:[0-9]+]], 20($sp)
; MM32: lw $[[T2:[0-9]+]], 16($sp)
; MM32: nor $2, $[[T2]], $4
; MM32: nor $3, $[[T1]], $5
; MM32: lw $[[T0:[0-9]+]], 24($sp)
; MM32: nor $4, $[[T0]], $6
; MM32: lw $[[T3:[0-9]+]], 28($sp)
; MM32: nor $5, $[[T3]], $7
%or = or i128 %b, %a
%r = xor i128 %or, -1
ret i128 %r
}