Debian Codegraph @

src/cmd/compile/internal/ssa/rewriteMIPS64.go

raw
1 // Code generated from _gen/MIPS64.rules using 'go generate'; DO NOT EDIT.
2
3 package ssa
4
5 import "cmd/compile/internal/types"
6
7 func rewriteValueMIPS64(v *Value) bool {
8 switch v.Op {
9 case OpAbs:
10 v.Op = OpMIPS64ABSD
11 return true
12 case OpAdd16:
13 v.Op = OpMIPS64ADDV
14 return true
15 case OpAdd32:
16 v.Op = OpMIPS64ADDV
17 return true
18 case OpAdd32F:
19 v.Op = OpMIPS64ADDF
20 return true
21 case OpAdd64:
22 v.Op = OpMIPS64ADDV
23 return true
24 case OpAdd64F:
25 v.Op = OpMIPS64ADDD
26 return true
27 case OpAdd8:
28 v.Op = OpMIPS64ADDV
29 return true
30 case OpAddPtr:
31 v.Op = OpMIPS64ADDV
32 return true
33 case OpAddr:
34 return rewriteValueMIPS64_OpAddr(v)
35 case OpAnd16:
36 v.Op = OpMIPS64AND
37 return true
38 case OpAnd32:
39 v.Op = OpMIPS64AND
40 return true
41 case OpAnd64:
42 v.Op = OpMIPS64AND
43 return true
44 case OpAnd8:
45 v.Op = OpMIPS64AND
46 return true
47 case OpAndB:
48 v.Op = OpMIPS64AND
49 return true
50 case OpAtomicAdd32:
51 v.Op = OpMIPS64LoweredAtomicAdd32
52 return true
53 case OpAtomicAdd64:
54 v.Op = OpMIPS64LoweredAtomicAdd64
55 return true
56 case OpAtomicAnd32:
57 v.Op = OpMIPS64LoweredAtomicAnd32
58 return true
59 case OpAtomicAnd8:
60 return rewriteValueMIPS64_OpAtomicAnd8(v)
61 case OpAtomicCompareAndSwap32:
62 return rewriteValueMIPS64_OpAtomicCompareAndSwap32(v)
63 case OpAtomicCompareAndSwap64:
64 v.Op = OpMIPS64LoweredAtomicCas64
65 return true
66 case OpAtomicExchange32:
67 v.Op = OpMIPS64LoweredAtomicExchange32
68 return true
69 case OpAtomicExchange64:
70 v.Op = OpMIPS64LoweredAtomicExchange64
71 return true
72 case OpAtomicLoad32:
73 v.Op = OpMIPS64LoweredAtomicLoad32
74 return true
75 case OpAtomicLoad64:
76 v.Op = OpMIPS64LoweredAtomicLoad64
77 return true
78 case OpAtomicLoad8:
79 v.Op = OpMIPS64LoweredAtomicLoad8
80 return true
81 case OpAtomicLoadPtr:
82 v.Op = OpMIPS64LoweredAtomicLoad64
83 return true
84 case OpAtomicOr32:
85 v.Op = OpMIPS64LoweredAtomicOr32
86 return true
87 case OpAtomicOr8:
88 return rewriteValueMIPS64_OpAtomicOr8(v)
89 case OpAtomicStore32:
90 v.Op = OpMIPS64LoweredAtomicStore32
91 return true
92 case OpAtomicStore64:
93 v.Op = OpMIPS64LoweredAtomicStore64
94 return true
95 case OpAtomicStore8:
96 v.Op = OpMIPS64LoweredAtomicStore8
97 return true
98 case OpAtomicStorePtrNoWB:
99 v.Op = OpMIPS64LoweredAtomicStore64
100 return true
101 case OpAvg64u:
102 return rewriteValueMIPS64_OpAvg64u(v)
103 case OpClosureCall:
104 v.Op = OpMIPS64CALLclosure
105 return true
106 case OpCom16:
107 return rewriteValueMIPS64_OpCom16(v)
108 case OpCom32:
109 return rewriteValueMIPS64_OpCom32(v)
110 case OpCom64:
111 return rewriteValueMIPS64_OpCom64(v)
112 case OpCom8:
113 return rewriteValueMIPS64_OpCom8(v)
114 case OpConst16:
115 return rewriteValueMIPS64_OpConst16(v)
116 case OpConst32:
117 return rewriteValueMIPS64_OpConst32(v)
118 case OpConst32F:
119 return rewriteValueMIPS64_OpConst32F(v)
120 case OpConst64:
121 return rewriteValueMIPS64_OpConst64(v)
122 case OpConst64F:
123 return rewriteValueMIPS64_OpConst64F(v)
124 case OpConst8:
125 return rewriteValueMIPS64_OpConst8(v)
126 case OpConstBool:
127 return rewriteValueMIPS64_OpConstBool(v)
128 case OpConstNil:
129 return rewriteValueMIPS64_OpConstNil(v)
130 case OpCvt32Fto32:
131 v.Op = OpMIPS64TRUNCFW
132 return true
133 case OpCvt32Fto64:
134 v.Op = OpMIPS64TRUNCFV
135 return true
136 case OpCvt32Fto64F:
137 v.Op = OpMIPS64MOVFD
138 return true
139 case OpCvt32to32F:
140 v.Op = OpMIPS64MOVWF
141 return true
142 case OpCvt32to64F:
143 v.Op = OpMIPS64MOVWD
144 return true
145 case OpCvt64Fto32:
146 v.Op = OpMIPS64TRUNCDW
147 return true
148 case OpCvt64Fto32F:
149 v.Op = OpMIPS64MOVDF
150 return true
151 case OpCvt64Fto64:
152 v.Op = OpMIPS64TRUNCDV
153 return true
154 case OpCvt64to32F:
155 v.Op = OpMIPS64MOVVF
156 return true
157 case OpCvt64to64F:
158 v.Op = OpMIPS64MOVVD
159 return true
160 case OpCvtBoolToUint8:
161 v.Op = OpCopy
162 return true
163 case OpDiv16:
164 return rewriteValueMIPS64_OpDiv16(v)
165 case OpDiv16u:
166 return rewriteValueMIPS64_OpDiv16u(v)
167 case OpDiv32:
168 return rewriteValueMIPS64_OpDiv32(v)
169 case OpDiv32F:
170 v.Op = OpMIPS64DIVF
171 return true
172 case OpDiv32u:
173 return rewriteValueMIPS64_OpDiv32u(v)
174 case OpDiv64:
175 return rewriteValueMIPS64_OpDiv64(v)
176 case OpDiv64F:
177 v.Op = OpMIPS64DIVD
178 return true
179 case OpDiv64u:
180 return rewriteValueMIPS64_OpDiv64u(v)
181 case OpDiv8:
182 return rewriteValueMIPS64_OpDiv8(v)
183 case OpDiv8u:
184 return rewriteValueMIPS64_OpDiv8u(v)
185 case OpEq16:
186 return rewriteValueMIPS64_OpEq16(v)
187 case OpEq32:
188 return rewriteValueMIPS64_OpEq32(v)
189 case OpEq32F:
190 return rewriteValueMIPS64_OpEq32F(v)
191 case OpEq64:
192 return rewriteValueMIPS64_OpEq64(v)
193 case OpEq64F:
194 return rewriteValueMIPS64_OpEq64F(v)
195 case OpEq8:
196 return rewriteValueMIPS64_OpEq8(v)
197 case OpEqB:
198 return rewriteValueMIPS64_OpEqB(v)
199 case OpEqPtr:
200 return rewriteValueMIPS64_OpEqPtr(v)
201 case OpGetCallerPC:
202 v.Op = OpMIPS64LoweredGetCallerPC
203 return true
204 case OpGetCallerSP:
205 v.Op = OpMIPS64LoweredGetCallerSP
206 return true
207 case OpGetClosurePtr:
208 v.Op = OpMIPS64LoweredGetClosurePtr
209 return true
210 case OpHmul32:
211 return rewriteValueMIPS64_OpHmul32(v)
212 case OpHmul32u:
213 return rewriteValueMIPS64_OpHmul32u(v)
214 case OpHmul64:
215 return rewriteValueMIPS64_OpHmul64(v)
216 case OpHmul64u:
217 return rewriteValueMIPS64_OpHmul64u(v)
218 case OpInterCall:
219 v.Op = OpMIPS64CALLinter
220 return true
221 case OpIsInBounds:
222 return rewriteValueMIPS64_OpIsInBounds(v)
223 case OpIsNonNil:
224 return rewriteValueMIPS64_OpIsNonNil(v)
225 case OpIsSliceInBounds:
226 return rewriteValueMIPS64_OpIsSliceInBounds(v)
227 case OpLeq16:
228 return rewriteValueMIPS64_OpLeq16(v)
229 case OpLeq16U:
230 return rewriteValueMIPS64_OpLeq16U(v)
231 case OpLeq32:
232 return rewriteValueMIPS64_OpLeq32(v)
233 case OpLeq32F:
234 return rewriteValueMIPS64_OpLeq32F(v)
235 case OpLeq32U:
236 return rewriteValueMIPS64_OpLeq32U(v)
237 case OpLeq64:
238 return rewriteValueMIPS64_OpLeq64(v)
239 case OpLeq64F:
240 return rewriteValueMIPS64_OpLeq64F(v)
241 case OpLeq64U:
242 return rewriteValueMIPS64_OpLeq64U(v)
243 case OpLeq8:
244 return rewriteValueMIPS64_OpLeq8(v)
245 case OpLeq8U:
246 return rewriteValueMIPS64_OpLeq8U(v)
247 case OpLess16:
248 return rewriteValueMIPS64_OpLess16(v)
249 case OpLess16U:
250 return rewriteValueMIPS64_OpLess16U(v)
251 case OpLess32:
252 return rewriteValueMIPS64_OpLess32(v)
253 case OpLess32F:
254 return rewriteValueMIPS64_OpLess32F(v)
255 case OpLess32U:
256 return rewriteValueMIPS64_OpLess32U(v)
257 case OpLess64:
258 return rewriteValueMIPS64_OpLess64(v)
259 case OpLess64F:
260 return rewriteValueMIPS64_OpLess64F(v)
261 case OpLess64U:
262 return rewriteValueMIPS64_OpLess64U(v)
263 case OpLess8:
264 return rewriteValueMIPS64_OpLess8(v)
265 case OpLess8U:
266 return rewriteValueMIPS64_OpLess8U(v)
267 case OpLoad:
268 return rewriteValueMIPS64_OpLoad(v)
269 case OpLocalAddr:
270 return rewriteValueMIPS64_OpLocalAddr(v)
271 case OpLsh16x16:
272 return rewriteValueMIPS64_OpLsh16x16(v)
273 case OpLsh16x32:
274 return rewriteValueMIPS64_OpLsh16x32(v)
275 case OpLsh16x64:
276 return rewriteValueMIPS64_OpLsh16x64(v)
277 case OpLsh16x8:
278 return rewriteValueMIPS64_OpLsh16x8(v)
279 case OpLsh32x16:
280 return rewriteValueMIPS64_OpLsh32x16(v)
281 case OpLsh32x32:
282 return rewriteValueMIPS64_OpLsh32x32(v)
283 case OpLsh32x64:
284 return rewriteValueMIPS64_OpLsh32x64(v)
285 case OpLsh32x8:
286 return rewriteValueMIPS64_OpLsh32x8(v)
287 case OpLsh64x16:
288 return rewriteValueMIPS64_OpLsh64x16(v)
289 case OpLsh64x32:
290 return rewriteValueMIPS64_OpLsh64x32(v)
291 case OpLsh64x64:
292 return rewriteValueMIPS64_OpLsh64x64(v)
293 case OpLsh64x8:
294 return rewriteValueMIPS64_OpLsh64x8(v)
295 case OpLsh8x16:
296 return rewriteValueMIPS64_OpLsh8x16(v)
297 case OpLsh8x32:
298 return rewriteValueMIPS64_OpLsh8x32(v)
299 case OpLsh8x64:
300 return rewriteValueMIPS64_OpLsh8x64(v)
301 case OpLsh8x8:
302 return rewriteValueMIPS64_OpLsh8x8(v)
303 case OpMIPS64ADDV:
304 return rewriteValueMIPS64_OpMIPS64ADDV(v)
305 case OpMIPS64ADDVconst:
306 return rewriteValueMIPS64_OpMIPS64ADDVconst(v)
307 case OpMIPS64AND:
308 return rewriteValueMIPS64_OpMIPS64AND(v)
309 case OpMIPS64ANDconst:
310 return rewriteValueMIPS64_OpMIPS64ANDconst(v)
311 case OpMIPS64LoweredAtomicAdd32:
312 return rewriteValueMIPS64_OpMIPS64LoweredAtomicAdd32(v)
313 case OpMIPS64LoweredAtomicAdd64:
314 return rewriteValueMIPS64_OpMIPS64LoweredAtomicAdd64(v)
315 case OpMIPS64LoweredAtomicStore32:
316 return rewriteValueMIPS64_OpMIPS64LoweredAtomicStore32(v)
317 case OpMIPS64LoweredAtomicStore64:
318 return rewriteValueMIPS64_OpMIPS64LoweredAtomicStore64(v)
319 case OpMIPS64MOVBUload:
320 return rewriteValueMIPS64_OpMIPS64MOVBUload(v)
321 case OpMIPS64MOVBUreg:
322 return rewriteValueMIPS64_OpMIPS64MOVBUreg(v)
323 case OpMIPS64MOVBload:
324 return rewriteValueMIPS64_OpMIPS64MOVBload(v)
325 case OpMIPS64MOVBreg:
326 return rewriteValueMIPS64_OpMIPS64MOVBreg(v)
327 case OpMIPS64MOVBstore:
328 return rewriteValueMIPS64_OpMIPS64MOVBstore(v)
329 case OpMIPS64MOVBstorezero:
330 return rewriteValueMIPS64_OpMIPS64MOVBstorezero(v)
331 case OpMIPS64MOVDload:
332 return rewriteValueMIPS64_OpMIPS64MOVDload(v)
333 case OpMIPS64MOVDstore:
334 return rewriteValueMIPS64_OpMIPS64MOVDstore(v)
335 case OpMIPS64MOVFload:
336 return rewriteValueMIPS64_OpMIPS64MOVFload(v)
337 case OpMIPS64MOVFstore:
338 return rewriteValueMIPS64_OpMIPS64MOVFstore(v)
339 case OpMIPS64MOVHUload:
340 return rewriteValueMIPS64_OpMIPS64MOVHUload(v)
341 case OpMIPS64MOVHUreg:
342 return rewriteValueMIPS64_OpMIPS64MOVHUreg(v)
343 case OpMIPS64MOVHload:
344 return rewriteValueMIPS64_OpMIPS64MOVHload(v)
345 case OpMIPS64MOVHreg:
346 return rewriteValueMIPS64_OpMIPS64MOVHreg(v)
347 case OpMIPS64MOVHstore:
348 return rewriteValueMIPS64_OpMIPS64MOVHstore(v)
349 case OpMIPS64MOVHstorezero:
350 return rewriteValueMIPS64_OpMIPS64MOVHstorezero(v)
351 case OpMIPS64MOVVload:
352 return rewriteValueMIPS64_OpMIPS64MOVVload(v)
353 case OpMIPS64MOVVnop:
354 return rewriteValueMIPS64_OpMIPS64MOVVnop(v)
355 case OpMIPS64MOVVreg:
356 return rewriteValueMIPS64_OpMIPS64MOVVreg(v)
357 case OpMIPS64MOVVstore:
358 return rewriteValueMIPS64_OpMIPS64MOVVstore(v)
359 case OpMIPS64MOVVstorezero:
360 return rewriteValueMIPS64_OpMIPS64MOVVstorezero(v)
361 case OpMIPS64MOVWUload:
362 return rewriteValueMIPS64_OpMIPS64MOVWUload(v)
363 case OpMIPS64MOVWUreg:
364 return rewriteValueMIPS64_OpMIPS64MOVWUreg(v)
365 case OpMIPS64MOVWload:
366 return rewriteValueMIPS64_OpMIPS64MOVWload(v)
367 case OpMIPS64MOVWreg:
368 return rewriteValueMIPS64_OpMIPS64MOVWreg(v)
369 case OpMIPS64MOVWstore:
370 return rewriteValueMIPS64_OpMIPS64MOVWstore(v)
371 case OpMIPS64MOVWstorezero:
372 return rewriteValueMIPS64_OpMIPS64MOVWstorezero(v)
373 case OpMIPS64NEGV:
374 return rewriteValueMIPS64_OpMIPS64NEGV(v)
375 case OpMIPS64NOR:
376 return rewriteValueMIPS64_OpMIPS64NOR(v)
377 case OpMIPS64NORconst:
378 return rewriteValueMIPS64_OpMIPS64NORconst(v)
379 case OpMIPS64OR:
380 return rewriteValueMIPS64_OpMIPS64OR(v)
381 case OpMIPS64ORconst:
382 return rewriteValueMIPS64_OpMIPS64ORconst(v)
383 case OpMIPS64SGT:
384 return rewriteValueMIPS64_OpMIPS64SGT(v)
385 case OpMIPS64SGTU:
386 return rewriteValueMIPS64_OpMIPS64SGTU(v)
387 case OpMIPS64SGTUconst:
388 return rewriteValueMIPS64_OpMIPS64SGTUconst(v)
389 case OpMIPS64SGTconst:
390 return rewriteValueMIPS64_OpMIPS64SGTconst(v)
391 case OpMIPS64SLLV:
392 return rewriteValueMIPS64_OpMIPS64SLLV(v)
393 case OpMIPS64SLLVconst:
394 return rewriteValueMIPS64_OpMIPS64SLLVconst(v)
395 case OpMIPS64SRAV:
396 return rewriteValueMIPS64_OpMIPS64SRAV(v)
397 case OpMIPS64SRAVconst:
398 return rewriteValueMIPS64_OpMIPS64SRAVconst(v)
399 case OpMIPS64SRLV:
400 return rewriteValueMIPS64_OpMIPS64SRLV(v)
401 case OpMIPS64SRLVconst:
402 return rewriteValueMIPS64_OpMIPS64SRLVconst(v)
403 case OpMIPS64SUBV:
404 return rewriteValueMIPS64_OpMIPS64SUBV(v)
405 case OpMIPS64SUBVconst:
406 return rewriteValueMIPS64_OpMIPS64SUBVconst(v)
407 case OpMIPS64XOR:
408 return rewriteValueMIPS64_OpMIPS64XOR(v)
409 case OpMIPS64XORconst:
410 return rewriteValueMIPS64_OpMIPS64XORconst(v)
411 case OpMod16:
412 return rewriteValueMIPS64_OpMod16(v)
413 case OpMod16u:
414 return rewriteValueMIPS64_OpMod16u(v)
415 case OpMod32:
416 return rewriteValueMIPS64_OpMod32(v)
417 case OpMod32u:
418 return rewriteValueMIPS64_OpMod32u(v)
419 case OpMod64:
420 return rewriteValueMIPS64_OpMod64(v)
421 case OpMod64u:
422 return rewriteValueMIPS64_OpMod64u(v)
423 case OpMod8:
424 return rewriteValueMIPS64_OpMod8(v)
425 case OpMod8u:
426 return rewriteValueMIPS64_OpMod8u(v)
427 case OpMove:
428 return rewriteValueMIPS64_OpMove(v)
429 case OpMul16:
430 return rewriteValueMIPS64_OpMul16(v)
431 case OpMul32:
432 return rewriteValueMIPS64_OpMul32(v)
433 case OpMul32F:
434 v.Op = OpMIPS64MULF
435 return true
436 case OpMul64:
437 return rewriteValueMIPS64_OpMul64(v)
438 case OpMul64F:
439 v.Op = OpMIPS64MULD
440 return true
441 case OpMul64uhilo:
442 v.Op = OpMIPS64MULVU
443 return true
444 case OpMul8:
445 return rewriteValueMIPS64_OpMul8(v)
446 case OpNeg16:
447 v.Op = OpMIPS64NEGV
448 return true
449 case OpNeg32:
450 v.Op = OpMIPS64NEGV
451 return true
452 case OpNeg32F:
453 v.Op = OpMIPS64NEGF
454 return true
455 case OpNeg64:
456 v.Op = OpMIPS64NEGV
457 return true
458 case OpNeg64F:
459 v.Op = OpMIPS64NEGD
460 return true
461 case OpNeg8:
462 v.Op = OpMIPS64NEGV
463 return true
464 case OpNeq16:
465 return rewriteValueMIPS64_OpNeq16(v)
466 case OpNeq32:
467 return rewriteValueMIPS64_OpNeq32(v)
468 case OpNeq32F:
469 return rewriteValueMIPS64_OpNeq32F(v)
470 case OpNeq64:
471 return rewriteValueMIPS64_OpNeq64(v)
472 case OpNeq64F:
473 return rewriteValueMIPS64_OpNeq64F(v)
474 case OpNeq8:
475 return rewriteValueMIPS64_OpNeq8(v)
476 case OpNeqB:
477 v.Op = OpMIPS64XOR
478 return true
479 case OpNeqPtr:
480 return rewriteValueMIPS64_OpNeqPtr(v)
481 case OpNilCheck:
482 v.Op = OpMIPS64LoweredNilCheck
483 return true
484 case OpNot:
485 return rewriteValueMIPS64_OpNot(v)
486 case OpOffPtr:
487 return rewriteValueMIPS64_OpOffPtr(v)
488 case OpOr16:
489 v.Op = OpMIPS64OR
490 return true
491 case OpOr32:
492 v.Op = OpMIPS64OR
493 return true
494 case OpOr64:
495 v.Op = OpMIPS64OR
496 return true
497 case OpOr8:
498 v.Op = OpMIPS64OR
499 return true
500 case OpOrB:
501 v.Op = OpMIPS64OR
502 return true
503 case OpPanicBounds:
504 return rewriteValueMIPS64_OpPanicBounds(v)
505 case OpPubBarrier:
506 v.Op = OpMIPS64LoweredPubBarrier
507 return true
508 case OpRotateLeft16:
509 return rewriteValueMIPS64_OpRotateLeft16(v)
510 case OpRotateLeft32:
511 return rewriteValueMIPS64_OpRotateLeft32(v)
512 case OpRotateLeft64:
513 return rewriteValueMIPS64_OpRotateLeft64(v)
514 case OpRotateLeft8:
515 return rewriteValueMIPS64_OpRotateLeft8(v)
516 case OpRound32F:
517 v.Op = OpCopy
518 return true
519 case OpRound64F:
520 v.Op = OpCopy
521 return true
522 case OpRsh16Ux16:
523 return rewriteValueMIPS64_OpRsh16Ux16(v)
524 case OpRsh16Ux32:
525 return rewriteValueMIPS64_OpRsh16Ux32(v)
526 case OpRsh16Ux64:
527 return rewriteValueMIPS64_OpRsh16Ux64(v)
528 case OpRsh16Ux8:
529 return rewriteValueMIPS64_OpRsh16Ux8(v)
530 case OpRsh16x16:
531 return rewriteValueMIPS64_OpRsh16x16(v)
532 case OpRsh16x32:
533 return rewriteValueMIPS64_OpRsh16x32(v)
534 case OpRsh16x64:
535 return rewriteValueMIPS64_OpRsh16x64(v)
536 case OpRsh16x8:
537 return rewriteValueMIPS64_OpRsh16x8(v)
538 case OpRsh32Ux16:
539 return rewriteValueMIPS64_OpRsh32Ux16(v)
540 case OpRsh32Ux32:
541 return rewriteValueMIPS64_OpRsh32Ux32(v)
542 case OpRsh32Ux64:
543 return rewriteValueMIPS64_OpRsh32Ux64(v)
544 case OpRsh32Ux8:
545 return rewriteValueMIPS64_OpRsh32Ux8(v)
546 case OpRsh32x16:
547 return rewriteValueMIPS64_OpRsh32x16(v)
548 case OpRsh32x32:
549 return rewriteValueMIPS64_OpRsh32x32(v)
550 case OpRsh32x64:
551 return rewriteValueMIPS64_OpRsh32x64(v)
552 case OpRsh32x8:
553 return rewriteValueMIPS64_OpRsh32x8(v)
554 case OpRsh64Ux16:
555 return rewriteValueMIPS64_OpRsh64Ux16(v)
556 case OpRsh64Ux32:
557 return rewriteValueMIPS64_OpRsh64Ux32(v)
558 case OpRsh64Ux64:
559 return rewriteValueMIPS64_OpRsh64Ux64(v)
560 case OpRsh64Ux8:
561 return rewriteValueMIPS64_OpRsh64Ux8(v)
562 case OpRsh64x16:
563 return rewriteValueMIPS64_OpRsh64x16(v)
564 case OpRsh64x32:
565 return rewriteValueMIPS64_OpRsh64x32(v)
566 case OpRsh64x64:
567 return rewriteValueMIPS64_OpRsh64x64(v)
568 case OpRsh64x8:
569 return rewriteValueMIPS64_OpRsh64x8(v)
570 case OpRsh8Ux16:
571 return rewriteValueMIPS64_OpRsh8Ux16(v)
572 case OpRsh8Ux32:
573 return rewriteValueMIPS64_OpRsh8Ux32(v)
574 case OpRsh8Ux64:
575 return rewriteValueMIPS64_OpRsh8Ux64(v)
576 case OpRsh8Ux8:
577 return rewriteValueMIPS64_OpRsh8Ux8(v)
578 case OpRsh8x16:
579 return rewriteValueMIPS64_OpRsh8x16(v)
580 case OpRsh8x32:
581 return rewriteValueMIPS64_OpRsh8x32(v)
582 case OpRsh8x64:
583 return rewriteValueMIPS64_OpRsh8x64(v)
584 case OpRsh8x8:
585 return rewriteValueMIPS64_OpRsh8x8(v)
586 case OpSelect0:
587 return rewriteValueMIPS64_OpSelect0(v)
588 case OpSelect1:
589 return rewriteValueMIPS64_OpSelect1(v)
590 case OpSignExt16to32:
591 v.Op = OpMIPS64MOVHreg
592 return true
593 case OpSignExt16to64:
594 v.Op = OpMIPS64MOVHreg
595 return true
596 case OpSignExt32to64:
597 v.Op = OpMIPS64MOVWreg
598 return true
599 case OpSignExt8to16:
600 v.Op = OpMIPS64MOVBreg
601 return true
602 case OpSignExt8to32:
603 v.Op = OpMIPS64MOVBreg
604 return true
605 case OpSignExt8to64:
606 v.Op = OpMIPS64MOVBreg
607 return true
608 case OpSlicemask:
609 return rewriteValueMIPS64_OpSlicemask(v)
610 case OpSqrt:
611 v.Op = OpMIPS64SQRTD
612 return true
613 case OpSqrt32:
614 v.Op = OpMIPS64SQRTF
615 return true
616 case OpStaticCall:
617 v.Op = OpMIPS64CALLstatic
618 return true
619 case OpStore:
620 return rewriteValueMIPS64_OpStore(v)
621 case OpSub16:
622 v.Op = OpMIPS64SUBV
623 return true
624 case OpSub32:
625 v.Op = OpMIPS64SUBV
626 return true
627 case OpSub32F:
628 v.Op = OpMIPS64SUBF
629 return true
630 case OpSub64:
631 v.Op = OpMIPS64SUBV
632 return true
633 case OpSub64F:
634 v.Op = OpMIPS64SUBD
635 return true
636 case OpSub8:
637 v.Op = OpMIPS64SUBV
638 return true
639 case OpSubPtr:
640 v.Op = OpMIPS64SUBV
641 return true
642 case OpTailCall:
643 v.Op = OpMIPS64CALLtail
644 return true
645 case OpTrunc16to8:
646 v.Op = OpCopy
647 return true
648 case OpTrunc32to16:
649 v.Op = OpCopy
650 return true
651 case OpTrunc32to8:
652 v.Op = OpCopy
653 return true
654 case OpTrunc64to16:
655 v.Op = OpCopy
656 return true
657 case OpTrunc64to32:
658 v.Op = OpCopy
659 return true
660 case OpTrunc64to8:
661 v.Op = OpCopy
662 return true
663 case OpWB:
664 v.Op = OpMIPS64LoweredWB
665 return true
666 case OpXor16:
667 v.Op = OpMIPS64XOR
668 return true
669 case OpXor32:
670 v.Op = OpMIPS64XOR
671 return true
672 case OpXor64:
673 v.Op = OpMIPS64XOR
674 return true
675 case OpXor8:
676 v.Op = OpMIPS64XOR
677 return true
678 case OpZero:
679 return rewriteValueMIPS64_OpZero(v)
680 case OpZeroExt16to32:
681 v.Op = OpMIPS64MOVHUreg
682 return true
683 case OpZeroExt16to64:
684 v.Op = OpMIPS64MOVHUreg
685 return true
686 case OpZeroExt32to64:
687 v.Op = OpMIPS64MOVWUreg
688 return true
689 case OpZeroExt8to16:
690 v.Op = OpMIPS64MOVBUreg
691 return true
692 case OpZeroExt8to32:
693 v.Op = OpMIPS64MOVBUreg
694 return true
695 case OpZeroExt8to64:
696 v.Op = OpMIPS64MOVBUreg
697 return true
698 }
699 return false
700 }
701 func rewriteValueMIPS64_OpAddr(v *Value) bool {
702 v_0 := v.Args[0]
703 // match: (Addr {sym} base)
704 // result: (MOVVaddr {sym} base)
705 for {
706 sym := auxToSym(v.Aux)
707 base := v_0
708 v.reset(OpMIPS64MOVVaddr)
709 v.Aux = symToAux(sym)
710 v.AddArg(base)
711 return true
712 }
713 }
714 func rewriteValueMIPS64_OpAtomicAnd8(v *Value) bool {
715 v_2 := v.Args[2]
716 v_1 := v.Args[1]
717 v_0 := v.Args[0]
718 b := v.Block
719 config := b.Func.Config
720 typ := &b.Func.Config.Types
721 // match: (AtomicAnd8 ptr val mem)
722 // cond: !config.BigEndian
723 // result: (LoweredAtomicAnd32 (AND <typ.UInt32Ptr> (MOVVconst [^3]) ptr) (OR <typ.UInt64> (SLLV <typ.UInt32> (ZeroExt8to32 val) (SLLVconst <typ.UInt64> [3] (ANDconst <typ.UInt64> [3] ptr))) (NORconst [0] <typ.UInt64> (SLLV <typ.UInt64> (MOVVconst [0xff]) (SLLVconst <typ.UInt64> [3] (ANDconst <typ.UInt64> [3] ptr))))) mem)
724 for {
725 ptr := v_0
726 val := v_1
727 mem := v_2
728 if !(!config.BigEndian) {
729 break
730 }
731 v.reset(OpMIPS64LoweredAtomicAnd32)
732 v0 := b.NewValue0(v.Pos, OpMIPS64AND, typ.UInt32Ptr)
733 v1 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
734 v1.AuxInt = int64ToAuxInt(^3)
735 v0.AddArg2(v1, ptr)
736 v2 := b.NewValue0(v.Pos, OpMIPS64OR, typ.UInt64)
737 v3 := b.NewValue0(v.Pos, OpMIPS64SLLV, typ.UInt32)
738 v4 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
739 v4.AddArg(val)
740 v5 := b.NewValue0(v.Pos, OpMIPS64SLLVconst, typ.UInt64)
741 v5.AuxInt = int64ToAuxInt(3)
742 v6 := b.NewValue0(v.Pos, OpMIPS64ANDconst, typ.UInt64)
743 v6.AuxInt = int64ToAuxInt(3)
744 v6.AddArg(ptr)
745 v5.AddArg(v6)
746 v3.AddArg2(v4, v5)
747 v7 := b.NewValue0(v.Pos, OpMIPS64NORconst, typ.UInt64)
748 v7.AuxInt = int64ToAuxInt(0)
749 v8 := b.NewValue0(v.Pos, OpMIPS64SLLV, typ.UInt64)
750 v9 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
751 v9.AuxInt = int64ToAuxInt(0xff)
752 v8.AddArg2(v9, v5)
753 v7.AddArg(v8)
754 v2.AddArg2(v3, v7)
755 v.AddArg3(v0, v2, mem)
756 return true
757 }
758 // match: (AtomicAnd8 ptr val mem)
759 // cond: config.BigEndian
760 // result: (LoweredAtomicAnd32 (AND <typ.UInt32Ptr> (MOVVconst [^3]) ptr) (OR <typ.UInt64> (SLLV <typ.UInt32> (ZeroExt8to32 val) (SLLVconst <typ.UInt64> [3] (ANDconst <typ.UInt64> [3] (XORconst <typ.UInt64> [3] ptr)))) (NORconst [0] <typ.UInt64> (SLLV <typ.UInt64> (MOVVconst [0xff]) (SLLVconst <typ.UInt64> [3] (ANDconst <typ.UInt64> [3] (XORconst <typ.UInt64> [3] ptr)))))) mem)
761 for {
762 ptr := v_0
763 val := v_1
764 mem := v_2
765 if !(config.BigEndian) {
766 break
767 }
768 v.reset(OpMIPS64LoweredAtomicAnd32)
769 v0 := b.NewValue0(v.Pos, OpMIPS64AND, typ.UInt32Ptr)
770 v1 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
771 v1.AuxInt = int64ToAuxInt(^3)
772 v0.AddArg2(v1, ptr)
773 v2 := b.NewValue0(v.Pos, OpMIPS64OR, typ.UInt64)
774 v3 := b.NewValue0(v.Pos, OpMIPS64SLLV, typ.UInt32)
775 v4 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
776 v4.AddArg(val)
777 v5 := b.NewValue0(v.Pos, OpMIPS64SLLVconst, typ.UInt64)
778 v5.AuxInt = int64ToAuxInt(3)
779 v6 := b.NewValue0(v.Pos, OpMIPS64ANDconst, typ.UInt64)
780 v6.AuxInt = int64ToAuxInt(3)
781 v7 := b.NewValue0(v.Pos, OpMIPS64XORconst, typ.UInt64)
782 v7.AuxInt = int64ToAuxInt(3)
783 v7.AddArg(ptr)
784 v6.AddArg(v7)
785 v5.AddArg(v6)
786 v3.AddArg2(v4, v5)
787 v8 := b.NewValue0(v.Pos, OpMIPS64NORconst, typ.UInt64)
788 v8.AuxInt = int64ToAuxInt(0)
789 v9 := b.NewValue0(v.Pos, OpMIPS64SLLV, typ.UInt64)
790 v10 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
791 v10.AuxInt = int64ToAuxInt(0xff)
792 v9.AddArg2(v10, v5)
793 v8.AddArg(v9)
794 v2.AddArg2(v3, v8)
795 v.AddArg3(v0, v2, mem)
796 return true
797 }
798 return false
799 }
800 func rewriteValueMIPS64_OpAtomicCompareAndSwap32(v *Value) bool {
801 v_3 := v.Args[3]
802 v_2 := v.Args[2]
803 v_1 := v.Args[1]
804 v_0 := v.Args[0]
805 b := v.Block
806 typ := &b.Func.Config.Types
807 // match: (AtomicCompareAndSwap32 ptr old new mem)
808 // result: (LoweredAtomicCas32 ptr (SignExt32to64 old) new mem)
809 for {
810 ptr := v_0
811 old := v_1
812 new := v_2
813 mem := v_3
814 v.reset(OpMIPS64LoweredAtomicCas32)
815 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
816 v0.AddArg(old)
817 v.AddArg4(ptr, v0, new, mem)
818 return true
819 }
820 }
821 func rewriteValueMIPS64_OpAtomicOr8(v *Value) bool {
822 v_2 := v.Args[2]
823 v_1 := v.Args[1]
824 v_0 := v.Args[0]
825 b := v.Block
826 config := b.Func.Config
827 typ := &b.Func.Config.Types
828 // match: (AtomicOr8 ptr val mem)
829 // cond: !config.BigEndian
830 // result: (LoweredAtomicOr32 (AND <typ.UInt32Ptr> (MOVVconst [^3]) ptr) (SLLV <typ.UInt32> (ZeroExt8to32 val) (SLLVconst <typ.UInt64> [3] (ANDconst <typ.UInt64> [3] ptr))) mem)
831 for {
832 ptr := v_0
833 val := v_1
834 mem := v_2
835 if !(!config.BigEndian) {
836 break
837 }
838 v.reset(OpMIPS64LoweredAtomicOr32)
839 v0 := b.NewValue0(v.Pos, OpMIPS64AND, typ.UInt32Ptr)
840 v1 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
841 v1.AuxInt = int64ToAuxInt(^3)
842 v0.AddArg2(v1, ptr)
843 v2 := b.NewValue0(v.Pos, OpMIPS64SLLV, typ.UInt32)
844 v3 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
845 v3.AddArg(val)
846 v4 := b.NewValue0(v.Pos, OpMIPS64SLLVconst, typ.UInt64)
847 v4.AuxInt = int64ToAuxInt(3)
848 v5 := b.NewValue0(v.Pos, OpMIPS64ANDconst, typ.UInt64)
849 v5.AuxInt = int64ToAuxInt(3)
850 v5.AddArg(ptr)
851 v4.AddArg(v5)
852 v2.AddArg2(v3, v4)
853 v.AddArg3(v0, v2, mem)
854 return true
855 }
856 // match: (AtomicOr8 ptr val mem)
857 // cond: config.BigEndian
858 // result: (LoweredAtomicOr32 (AND <typ.UInt32Ptr> (MOVVconst [^3]) ptr) (SLLV <typ.UInt32> (ZeroExt8to32 val) (SLLVconst <typ.UInt64> [3] (ANDconst <typ.UInt64> [3] (XORconst <typ.UInt64> [3] ptr)))) mem)
859 for {
860 ptr := v_0
861 val := v_1
862 mem := v_2
863 if !(config.BigEndian) {
864 break
865 }
866 v.reset(OpMIPS64LoweredAtomicOr32)
867 v0 := b.NewValue0(v.Pos, OpMIPS64AND, typ.UInt32Ptr)
868 v1 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
869 v1.AuxInt = int64ToAuxInt(^3)
870 v0.AddArg2(v1, ptr)
871 v2 := b.NewValue0(v.Pos, OpMIPS64SLLV, typ.UInt32)
872 v3 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
873 v3.AddArg(val)
874 v4 := b.NewValue0(v.Pos, OpMIPS64SLLVconst, typ.UInt64)
875 v4.AuxInt = int64ToAuxInt(3)
876 v5 := b.NewValue0(v.Pos, OpMIPS64ANDconst, typ.UInt64)
877 v5.AuxInt = int64ToAuxInt(3)
878 v6 := b.NewValue0(v.Pos, OpMIPS64XORconst, typ.UInt64)
879 v6.AuxInt = int64ToAuxInt(3)
880 v6.AddArg(ptr)
881 v5.AddArg(v6)
882 v4.AddArg(v5)
883 v2.AddArg2(v3, v4)
884 v.AddArg3(v0, v2, mem)
885 return true
886 }
887 return false
888 }
889 func rewriteValueMIPS64_OpAvg64u(v *Value) bool {
890 v_1 := v.Args[1]
891 v_0 := v.Args[0]
892 b := v.Block
893 // match: (Avg64u <t> x y)
894 // result: (ADDV (SRLVconst <t> (SUBV <t> x y) [1]) y)
895 for {
896 t := v.Type
897 x := v_0
898 y := v_1
899 v.reset(OpMIPS64ADDV)
900 v0 := b.NewValue0(v.Pos, OpMIPS64SRLVconst, t)
901 v0.AuxInt = int64ToAuxInt(1)
902 v1 := b.NewValue0(v.Pos, OpMIPS64SUBV, t)
903 v1.AddArg2(x, y)
904 v0.AddArg(v1)
905 v.AddArg2(v0, y)
906 return true
907 }
908 }
909 func rewriteValueMIPS64_OpCom16(v *Value) bool {
910 v_0 := v.Args[0]
911 b := v.Block
912 typ := &b.Func.Config.Types
913 // match: (Com16 x)
914 // result: (NOR (MOVVconst [0]) x)
915 for {
916 x := v_0
917 v.reset(OpMIPS64NOR)
918 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
919 v0.AuxInt = int64ToAuxInt(0)
920 v.AddArg2(v0, x)
921 return true
922 }
923 }
924 func rewriteValueMIPS64_OpCom32(v *Value) bool {
925 v_0 := v.Args[0]
926 b := v.Block
927 typ := &b.Func.Config.Types
928 // match: (Com32 x)
929 // result: (NOR (MOVVconst [0]) x)
930 for {
931 x := v_0
932 v.reset(OpMIPS64NOR)
933 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
934 v0.AuxInt = int64ToAuxInt(0)
935 v.AddArg2(v0, x)
936 return true
937 }
938 }
939 func rewriteValueMIPS64_OpCom64(v *Value) bool {
940 v_0 := v.Args[0]
941 b := v.Block
942 typ := &b.Func.Config.Types
943 // match: (Com64 x)
944 // result: (NOR (MOVVconst [0]) x)
945 for {
946 x := v_0
947 v.reset(OpMIPS64NOR)
948 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
949 v0.AuxInt = int64ToAuxInt(0)
950 v.AddArg2(v0, x)
951 return true
952 }
953 }
954 func rewriteValueMIPS64_OpCom8(v *Value) bool {
955 v_0 := v.Args[0]
956 b := v.Block
957 typ := &b.Func.Config.Types
958 // match: (Com8 x)
959 // result: (NOR (MOVVconst [0]) x)
960 for {
961 x := v_0
962 v.reset(OpMIPS64NOR)
963 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
964 v0.AuxInt = int64ToAuxInt(0)
965 v.AddArg2(v0, x)
966 return true
967 }
968 }
969 func rewriteValueMIPS64_OpConst16(v *Value) bool {
970 // match: (Const16 [val])
971 // result: (MOVVconst [int64(val)])
972 for {
973 val := auxIntToInt16(v.AuxInt)
974 v.reset(OpMIPS64MOVVconst)
975 v.AuxInt = int64ToAuxInt(int64(val))
976 return true
977 }
978 }
979 func rewriteValueMIPS64_OpConst32(v *Value) bool {
980 // match: (Const32 [val])
981 // result: (MOVVconst [int64(val)])
982 for {
983 val := auxIntToInt32(v.AuxInt)
984 v.reset(OpMIPS64MOVVconst)
985 v.AuxInt = int64ToAuxInt(int64(val))
986 return true
987 }
988 }
989 func rewriteValueMIPS64_OpConst32F(v *Value) bool {
990 // match: (Const32F [val])
991 // result: (MOVFconst [float64(val)])
992 for {
993 val := auxIntToFloat32(v.AuxInt)
994 v.reset(OpMIPS64MOVFconst)
995 v.AuxInt = float64ToAuxInt(float64(val))
996 return true
997 }
998 }
999 func rewriteValueMIPS64_OpConst64(v *Value) bool {
1000 // match: (Const64 [val])
1001 // result: (MOVVconst [int64(val)])
1002 for {
1003 val := auxIntToInt64(v.AuxInt)
1004 v.reset(OpMIPS64MOVVconst)
1005 v.AuxInt = int64ToAuxInt(int64(val))
1006 return true
1007 }
1008 }
1009 func rewriteValueMIPS64_OpConst64F(v *Value) bool {
1010 // match: (Const64F [val])
1011 // result: (MOVDconst [float64(val)])
1012 for {
1013 val := auxIntToFloat64(v.AuxInt)
1014 v.reset(OpMIPS64MOVDconst)
1015 v.AuxInt = float64ToAuxInt(float64(val))
1016 return true
1017 }
1018 }
1019 func rewriteValueMIPS64_OpConst8(v *Value) bool {
1020 // match: (Const8 [val])
1021 // result: (MOVVconst [int64(val)])
1022 for {
1023 val := auxIntToInt8(v.AuxInt)
1024 v.reset(OpMIPS64MOVVconst)
1025 v.AuxInt = int64ToAuxInt(int64(val))
1026 return true
1027 }
1028 }
1029 func rewriteValueMIPS64_OpConstBool(v *Value) bool {
1030 // match: (ConstBool [t])
1031 // result: (MOVVconst [int64(b2i(t))])
1032 for {
1033 t := auxIntToBool(v.AuxInt)
1034 v.reset(OpMIPS64MOVVconst)
1035 v.AuxInt = int64ToAuxInt(int64(b2i(t)))
1036 return true
1037 }
1038 }
1039 func rewriteValueMIPS64_OpConstNil(v *Value) bool {
1040 // match: (ConstNil)
1041 // result: (MOVVconst [0])
1042 for {
1043 v.reset(OpMIPS64MOVVconst)
1044 v.AuxInt = int64ToAuxInt(0)
1045 return true
1046 }
1047 }
1048 func rewriteValueMIPS64_OpDiv16(v *Value) bool {
1049 v_1 := v.Args[1]
1050 v_0 := v.Args[0]
1051 b := v.Block
1052 typ := &b.Func.Config.Types
1053 // match: (Div16 x y)
1054 // result: (Select1 (DIVV (SignExt16to64 x) (SignExt16to64 y)))
1055 for {
1056 x := v_0
1057 y := v_1
1058 v.reset(OpSelect1)
1059 v0 := b.NewValue0(v.Pos, OpMIPS64DIVV, types.NewTuple(typ.Int64, typ.Int64))
1060 v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
1061 v1.AddArg(x)
1062 v2 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
1063 v2.AddArg(y)
1064 v0.AddArg2(v1, v2)
1065 v.AddArg(v0)
1066 return true
1067 }
1068 }
1069 func rewriteValueMIPS64_OpDiv16u(v *Value) bool {
1070 v_1 := v.Args[1]
1071 v_0 := v.Args[0]
1072 b := v.Block
1073 typ := &b.Func.Config.Types
1074 // match: (Div16u x y)
1075 // result: (Select1 (DIVVU (ZeroExt16to64 x) (ZeroExt16to64 y)))
1076 for {
1077 x := v_0
1078 y := v_1
1079 v.reset(OpSelect1)
1080 v0 := b.NewValue0(v.Pos, OpMIPS64DIVVU, types.NewTuple(typ.UInt64, typ.UInt64))
1081 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1082 v1.AddArg(x)
1083 v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1084 v2.AddArg(y)
1085 v0.AddArg2(v1, v2)
1086 v.AddArg(v0)
1087 return true
1088 }
1089 }
1090 func rewriteValueMIPS64_OpDiv32(v *Value) bool {
1091 v_1 := v.Args[1]
1092 v_0 := v.Args[0]
1093 b := v.Block
1094 typ := &b.Func.Config.Types
1095 // match: (Div32 x y)
1096 // result: (Select1 (DIVV (SignExt32to64 x) (SignExt32to64 y)))
1097 for {
1098 x := v_0
1099 y := v_1
1100 v.reset(OpSelect1)
1101 v0 := b.NewValue0(v.Pos, OpMIPS64DIVV, types.NewTuple(typ.Int64, typ.Int64))
1102 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1103 v1.AddArg(x)
1104 v2 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1105 v2.AddArg(y)
1106 v0.AddArg2(v1, v2)
1107 v.AddArg(v0)
1108 return true
1109 }
1110 }
1111 func rewriteValueMIPS64_OpDiv32u(v *Value) bool {
1112 v_1 := v.Args[1]
1113 v_0 := v.Args[0]
1114 b := v.Block
1115 typ := &b.Func.Config.Types
1116 // match: (Div32u x y)
1117 // result: (Select1 (DIVVU (ZeroExt32to64 x) (ZeroExt32to64 y)))
1118 for {
1119 x := v_0
1120 y := v_1
1121 v.reset(OpSelect1)
1122 v0 := b.NewValue0(v.Pos, OpMIPS64DIVVU, types.NewTuple(typ.UInt64, typ.UInt64))
1123 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1124 v1.AddArg(x)
1125 v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1126 v2.AddArg(y)
1127 v0.AddArg2(v1, v2)
1128 v.AddArg(v0)
1129 return true
1130 }
1131 }
1132 func rewriteValueMIPS64_OpDiv64(v *Value) bool {
1133 v_1 := v.Args[1]
1134 v_0 := v.Args[0]
1135 b := v.Block
1136 typ := &b.Func.Config.Types
1137 // match: (Div64 x y)
1138 // result: (Select1 (DIVV x y))
1139 for {
1140 x := v_0
1141 y := v_1
1142 v.reset(OpSelect1)
1143 v0 := b.NewValue0(v.Pos, OpMIPS64DIVV, types.NewTuple(typ.Int64, typ.Int64))
1144 v0.AddArg2(x, y)
1145 v.AddArg(v0)
1146 return true
1147 }
1148 }
1149 func rewriteValueMIPS64_OpDiv64u(v *Value) bool {
1150 v_1 := v.Args[1]
1151 v_0 := v.Args[0]
1152 b := v.Block
1153 typ := &b.Func.Config.Types
1154 // match: (Div64u x y)
1155 // result: (Select1 (DIVVU x y))
1156 for {
1157 x := v_0
1158 y := v_1
1159 v.reset(OpSelect1)
1160 v0 := b.NewValue0(v.Pos, OpMIPS64DIVVU, types.NewTuple(typ.UInt64, typ.UInt64))
1161 v0.AddArg2(x, y)
1162 v.AddArg(v0)
1163 return true
1164 }
1165 }
1166 func rewriteValueMIPS64_OpDiv8(v *Value) bool {
1167 v_1 := v.Args[1]
1168 v_0 := v.Args[0]
1169 b := v.Block
1170 typ := &b.Func.Config.Types
1171 // match: (Div8 x y)
1172 // result: (Select1 (DIVV (SignExt8to64 x) (SignExt8to64 y)))
1173 for {
1174 x := v_0
1175 y := v_1
1176 v.reset(OpSelect1)
1177 v0 := b.NewValue0(v.Pos, OpMIPS64DIVV, types.NewTuple(typ.Int64, typ.Int64))
1178 v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
1179 v1.AddArg(x)
1180 v2 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
1181 v2.AddArg(y)
1182 v0.AddArg2(v1, v2)
1183 v.AddArg(v0)
1184 return true
1185 }
1186 }
1187 func rewriteValueMIPS64_OpDiv8u(v *Value) bool {
1188 v_1 := v.Args[1]
1189 v_0 := v.Args[0]
1190 b := v.Block
1191 typ := &b.Func.Config.Types
1192 // match: (Div8u x y)
1193 // result: (Select1 (DIVVU (ZeroExt8to64 x) (ZeroExt8to64 y)))
1194 for {
1195 x := v_0
1196 y := v_1
1197 v.reset(OpSelect1)
1198 v0 := b.NewValue0(v.Pos, OpMIPS64DIVVU, types.NewTuple(typ.UInt64, typ.UInt64))
1199 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1200 v1.AddArg(x)
1201 v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1202 v2.AddArg(y)
1203 v0.AddArg2(v1, v2)
1204 v.AddArg(v0)
1205 return true
1206 }
1207 }
1208 func rewriteValueMIPS64_OpEq16(v *Value) bool {
1209 v_1 := v.Args[1]
1210 v_0 := v.Args[0]
1211 b := v.Block
1212 typ := &b.Func.Config.Types
1213 // match: (Eq16 x y)
1214 // result: (SGTU (MOVVconst [1]) (XOR (ZeroExt16to64 x) (ZeroExt16to64 y)))
1215 for {
1216 x := v_0
1217 y := v_1
1218 v.reset(OpMIPS64SGTU)
1219 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
1220 v0.AuxInt = int64ToAuxInt(1)
1221 v1 := b.NewValue0(v.Pos, OpMIPS64XOR, typ.UInt64)
1222 v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1223 v2.AddArg(x)
1224 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1225 v3.AddArg(y)
1226 v1.AddArg2(v2, v3)
1227 v.AddArg2(v0, v1)
1228 return true
1229 }
1230 }
1231 func rewriteValueMIPS64_OpEq32(v *Value) bool {
1232 v_1 := v.Args[1]
1233 v_0 := v.Args[0]
1234 b := v.Block
1235 typ := &b.Func.Config.Types
1236 // match: (Eq32 x y)
1237 // result: (SGTU (MOVVconst [1]) (XOR (ZeroExt32to64 x) (ZeroExt32to64 y)))
1238 for {
1239 x := v_0
1240 y := v_1
1241 v.reset(OpMIPS64SGTU)
1242 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
1243 v0.AuxInt = int64ToAuxInt(1)
1244 v1 := b.NewValue0(v.Pos, OpMIPS64XOR, typ.UInt64)
1245 v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1246 v2.AddArg(x)
1247 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1248 v3.AddArg(y)
1249 v1.AddArg2(v2, v3)
1250 v.AddArg2(v0, v1)
1251 return true
1252 }
1253 }
1254 func rewriteValueMIPS64_OpEq32F(v *Value) bool {
1255 v_1 := v.Args[1]
1256 v_0 := v.Args[0]
1257 b := v.Block
1258 // match: (Eq32F x y)
1259 // result: (FPFlagTrue (CMPEQF x y))
1260 for {
1261 x := v_0
1262 y := v_1
1263 v.reset(OpMIPS64FPFlagTrue)
1264 v0 := b.NewValue0(v.Pos, OpMIPS64CMPEQF, types.TypeFlags)
1265 v0.AddArg2(x, y)
1266 v.AddArg(v0)
1267 return true
1268 }
1269 }
1270 func rewriteValueMIPS64_OpEq64(v *Value) bool {
1271 v_1 := v.Args[1]
1272 v_0 := v.Args[0]
1273 b := v.Block
1274 typ := &b.Func.Config.Types
1275 // match: (Eq64 x y)
1276 // result: (SGTU (MOVVconst [1]) (XOR x y))
1277 for {
1278 x := v_0
1279 y := v_1
1280 v.reset(OpMIPS64SGTU)
1281 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
1282 v0.AuxInt = int64ToAuxInt(1)
1283 v1 := b.NewValue0(v.Pos, OpMIPS64XOR, typ.UInt64)
1284 v1.AddArg2(x, y)
1285 v.AddArg2(v0, v1)
1286 return true
1287 }
1288 }
1289 func rewriteValueMIPS64_OpEq64F(v *Value) bool {
1290 v_1 := v.Args[1]
1291 v_0 := v.Args[0]
1292 b := v.Block
1293 // match: (Eq64F x y)
1294 // result: (FPFlagTrue (CMPEQD x y))
1295 for {
1296 x := v_0
1297 y := v_1
1298 v.reset(OpMIPS64FPFlagTrue)
1299 v0 := b.NewValue0(v.Pos, OpMIPS64CMPEQD, types.TypeFlags)
1300 v0.AddArg2(x, y)
1301 v.AddArg(v0)
1302 return true
1303 }
1304 }
1305 func rewriteValueMIPS64_OpEq8(v *Value) bool {
1306 v_1 := v.Args[1]
1307 v_0 := v.Args[0]
1308 b := v.Block
1309 typ := &b.Func.Config.Types
1310 // match: (Eq8 x y)
1311 // result: (SGTU (MOVVconst [1]) (XOR (ZeroExt8to64 x) (ZeroExt8to64 y)))
1312 for {
1313 x := v_0
1314 y := v_1
1315 v.reset(OpMIPS64SGTU)
1316 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
1317 v0.AuxInt = int64ToAuxInt(1)
1318 v1 := b.NewValue0(v.Pos, OpMIPS64XOR, typ.UInt64)
1319 v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1320 v2.AddArg(x)
1321 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1322 v3.AddArg(y)
1323 v1.AddArg2(v2, v3)
1324 v.AddArg2(v0, v1)
1325 return true
1326 }
1327 }
1328 func rewriteValueMIPS64_OpEqB(v *Value) bool {
1329 v_1 := v.Args[1]
1330 v_0 := v.Args[0]
1331 b := v.Block
1332 typ := &b.Func.Config.Types
1333 // match: (EqB x y)
1334 // result: (XOR (MOVVconst [1]) (XOR <typ.Bool> x y))
1335 for {
1336 x := v_0
1337 y := v_1
1338 v.reset(OpMIPS64XOR)
1339 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
1340 v0.AuxInt = int64ToAuxInt(1)
1341 v1 := b.NewValue0(v.Pos, OpMIPS64XOR, typ.Bool)
1342 v1.AddArg2(x, y)
1343 v.AddArg2(v0, v1)
1344 return true
1345 }
1346 }
1347 func rewriteValueMIPS64_OpEqPtr(v *Value) bool {
1348 v_1 := v.Args[1]
1349 v_0 := v.Args[0]
1350 b := v.Block
1351 typ := &b.Func.Config.Types
1352 // match: (EqPtr x y)
1353 // result: (SGTU (MOVVconst [1]) (XOR x y))
1354 for {
1355 x := v_0
1356 y := v_1
1357 v.reset(OpMIPS64SGTU)
1358 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
1359 v0.AuxInt = int64ToAuxInt(1)
1360 v1 := b.NewValue0(v.Pos, OpMIPS64XOR, typ.UInt64)
1361 v1.AddArg2(x, y)
1362 v.AddArg2(v0, v1)
1363 return true
1364 }
1365 }
1366 func rewriteValueMIPS64_OpHmul32(v *Value) bool {
1367 v_1 := v.Args[1]
1368 v_0 := v.Args[0]
1369 b := v.Block
1370 typ := &b.Func.Config.Types
1371 // match: (Hmul32 x y)
1372 // result: (SRAVconst (Select1 <typ.Int64> (MULV (SignExt32to64 x) (SignExt32to64 y))) [32])
1373 for {
1374 x := v_0
1375 y := v_1
1376 v.reset(OpMIPS64SRAVconst)
1377 v.AuxInt = int64ToAuxInt(32)
1378 v0 := b.NewValue0(v.Pos, OpSelect1, typ.Int64)
1379 v1 := b.NewValue0(v.Pos, OpMIPS64MULV, types.NewTuple(typ.Int64, typ.Int64))
1380 v2 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1381 v2.AddArg(x)
1382 v3 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1383 v3.AddArg(y)
1384 v1.AddArg2(v2, v3)
1385 v0.AddArg(v1)
1386 v.AddArg(v0)
1387 return true
1388 }
1389 }
1390 func rewriteValueMIPS64_OpHmul32u(v *Value) bool {
1391 v_1 := v.Args[1]
1392 v_0 := v.Args[0]
1393 b := v.Block
1394 typ := &b.Func.Config.Types
1395 // match: (Hmul32u x y)
1396 // result: (SRLVconst (Select1 <typ.UInt64> (MULVU (ZeroExt32to64 x) (ZeroExt32to64 y))) [32])
1397 for {
1398 x := v_0
1399 y := v_1
1400 v.reset(OpMIPS64SRLVconst)
1401 v.AuxInt = int64ToAuxInt(32)
1402 v0 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
1403 v1 := b.NewValue0(v.Pos, OpMIPS64MULVU, types.NewTuple(typ.UInt64, typ.UInt64))
1404 v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1405 v2.AddArg(x)
1406 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1407 v3.AddArg(y)
1408 v1.AddArg2(v2, v3)
1409 v0.AddArg(v1)
1410 v.AddArg(v0)
1411 return true
1412 }
1413 }
1414 func rewriteValueMIPS64_OpHmul64(v *Value) bool {
1415 v_1 := v.Args[1]
1416 v_0 := v.Args[0]
1417 b := v.Block
1418 typ := &b.Func.Config.Types
1419 // match: (Hmul64 x y)
1420 // result: (Select0 (MULV x y))
1421 for {
1422 x := v_0
1423 y := v_1
1424 v.reset(OpSelect0)
1425 v0 := b.NewValue0(v.Pos, OpMIPS64MULV, types.NewTuple(typ.Int64, typ.Int64))
1426 v0.AddArg2(x, y)
1427 v.AddArg(v0)
1428 return true
1429 }
1430 }
1431 func rewriteValueMIPS64_OpHmul64u(v *Value) bool {
1432 v_1 := v.Args[1]
1433 v_0 := v.Args[0]
1434 b := v.Block
1435 typ := &b.Func.Config.Types
1436 // match: (Hmul64u x y)
1437 // result: (Select0 (MULVU x y))
1438 for {
1439 x := v_0
1440 y := v_1
1441 v.reset(OpSelect0)
1442 v0 := b.NewValue0(v.Pos, OpMIPS64MULVU, types.NewTuple(typ.UInt64, typ.UInt64))
1443 v0.AddArg2(x, y)
1444 v.AddArg(v0)
1445 return true
1446 }
1447 }
1448 func rewriteValueMIPS64_OpIsInBounds(v *Value) bool {
1449 v_1 := v.Args[1]
1450 v_0 := v.Args[0]
1451 // match: (IsInBounds idx len)
1452 // result: (SGTU len idx)
1453 for {
1454 idx := v_0
1455 len := v_1
1456 v.reset(OpMIPS64SGTU)
1457 v.AddArg2(len, idx)
1458 return true
1459 }
1460 }
1461 func rewriteValueMIPS64_OpIsNonNil(v *Value) bool {
1462 v_0 := v.Args[0]
1463 b := v.Block
1464 typ := &b.Func.Config.Types
1465 // match: (IsNonNil ptr)
1466 // result: (SGTU ptr (MOVVconst [0]))
1467 for {
1468 ptr := v_0
1469 v.reset(OpMIPS64SGTU)
1470 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
1471 v0.AuxInt = int64ToAuxInt(0)
1472 v.AddArg2(ptr, v0)
1473 return true
1474 }
1475 }
1476 func rewriteValueMIPS64_OpIsSliceInBounds(v *Value) bool {
1477 v_1 := v.Args[1]
1478 v_0 := v.Args[0]
1479 b := v.Block
1480 typ := &b.Func.Config.Types
1481 // match: (IsSliceInBounds idx len)
1482 // result: (XOR (MOVVconst [1]) (SGTU idx len))
1483 for {
1484 idx := v_0
1485 len := v_1
1486 v.reset(OpMIPS64XOR)
1487 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
1488 v0.AuxInt = int64ToAuxInt(1)
1489 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
1490 v1.AddArg2(idx, len)
1491 v.AddArg2(v0, v1)
1492 return true
1493 }
1494 }
1495 func rewriteValueMIPS64_OpLeq16(v *Value) bool {
1496 v_1 := v.Args[1]
1497 v_0 := v.Args[0]
1498 b := v.Block
1499 typ := &b.Func.Config.Types
1500 // match: (Leq16 x y)
1501 // result: (XOR (MOVVconst [1]) (SGT (SignExt16to64 x) (SignExt16to64 y)))
1502 for {
1503 x := v_0
1504 y := v_1
1505 v.reset(OpMIPS64XOR)
1506 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
1507 v0.AuxInt = int64ToAuxInt(1)
1508 v1 := b.NewValue0(v.Pos, OpMIPS64SGT, typ.Bool)
1509 v2 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
1510 v2.AddArg(x)
1511 v3 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
1512 v3.AddArg(y)
1513 v1.AddArg2(v2, v3)
1514 v.AddArg2(v0, v1)
1515 return true
1516 }
1517 }
1518 func rewriteValueMIPS64_OpLeq16U(v *Value) bool {
1519 v_1 := v.Args[1]
1520 v_0 := v.Args[0]
1521 b := v.Block
1522 typ := &b.Func.Config.Types
1523 // match: (Leq16U x y)
1524 // result: (XOR (MOVVconst [1]) (SGTU (ZeroExt16to64 x) (ZeroExt16to64 y)))
1525 for {
1526 x := v_0
1527 y := v_1
1528 v.reset(OpMIPS64XOR)
1529 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
1530 v0.AuxInt = int64ToAuxInt(1)
1531 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
1532 v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1533 v2.AddArg(x)
1534 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1535 v3.AddArg(y)
1536 v1.AddArg2(v2, v3)
1537 v.AddArg2(v0, v1)
1538 return true
1539 }
1540 }
1541 func rewriteValueMIPS64_OpLeq32(v *Value) bool {
1542 v_1 := v.Args[1]
1543 v_0 := v.Args[0]
1544 b := v.Block
1545 typ := &b.Func.Config.Types
1546 // match: (Leq32 x y)
1547 // result: (XOR (MOVVconst [1]) (SGT (SignExt32to64 x) (SignExt32to64 y)))
1548 for {
1549 x := v_0
1550 y := v_1
1551 v.reset(OpMIPS64XOR)
1552 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
1553 v0.AuxInt = int64ToAuxInt(1)
1554 v1 := b.NewValue0(v.Pos, OpMIPS64SGT, typ.Bool)
1555 v2 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1556 v2.AddArg(x)
1557 v3 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1558 v3.AddArg(y)
1559 v1.AddArg2(v2, v3)
1560 v.AddArg2(v0, v1)
1561 return true
1562 }
1563 }
1564 func rewriteValueMIPS64_OpLeq32F(v *Value) bool {
1565 v_1 := v.Args[1]
1566 v_0 := v.Args[0]
1567 b := v.Block
1568 // match: (Leq32F x y)
1569 // result: (FPFlagTrue (CMPGEF y x))
1570 for {
1571 x := v_0
1572 y := v_1
1573 v.reset(OpMIPS64FPFlagTrue)
1574 v0 := b.NewValue0(v.Pos, OpMIPS64CMPGEF, types.TypeFlags)
1575 v0.AddArg2(y, x)
1576 v.AddArg(v0)
1577 return true
1578 }
1579 }
1580 func rewriteValueMIPS64_OpLeq32U(v *Value) bool {
1581 v_1 := v.Args[1]
1582 v_0 := v.Args[0]
1583 b := v.Block
1584 typ := &b.Func.Config.Types
1585 // match: (Leq32U x y)
1586 // result: (XOR (MOVVconst [1]) (SGTU (ZeroExt32to64 x) (ZeroExt32to64 y)))
1587 for {
1588 x := v_0
1589 y := v_1
1590 v.reset(OpMIPS64XOR)
1591 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
1592 v0.AuxInt = int64ToAuxInt(1)
1593 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
1594 v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1595 v2.AddArg(x)
1596 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1597 v3.AddArg(y)
1598 v1.AddArg2(v2, v3)
1599 v.AddArg2(v0, v1)
1600 return true
1601 }
1602 }
1603 func rewriteValueMIPS64_OpLeq64(v *Value) bool {
1604 v_1 := v.Args[1]
1605 v_0 := v.Args[0]
1606 b := v.Block
1607 typ := &b.Func.Config.Types
1608 // match: (Leq64 x y)
1609 // result: (XOR (MOVVconst [1]) (SGT x y))
1610 for {
1611 x := v_0
1612 y := v_1
1613 v.reset(OpMIPS64XOR)
1614 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
1615 v0.AuxInt = int64ToAuxInt(1)
1616 v1 := b.NewValue0(v.Pos, OpMIPS64SGT, typ.Bool)
1617 v1.AddArg2(x, y)
1618 v.AddArg2(v0, v1)
1619 return true
1620 }
1621 }
1622 func rewriteValueMIPS64_OpLeq64F(v *Value) bool {
1623 v_1 := v.Args[1]
1624 v_0 := v.Args[0]
1625 b := v.Block
1626 // match: (Leq64F x y)
1627 // result: (FPFlagTrue (CMPGED y x))
1628 for {
1629 x := v_0
1630 y := v_1
1631 v.reset(OpMIPS64FPFlagTrue)
1632 v0 := b.NewValue0(v.Pos, OpMIPS64CMPGED, types.TypeFlags)
1633 v0.AddArg2(y, x)
1634 v.AddArg(v0)
1635 return true
1636 }
1637 }
1638 func rewriteValueMIPS64_OpLeq64U(v *Value) bool {
1639 v_1 := v.Args[1]
1640 v_0 := v.Args[0]
1641 b := v.Block
1642 typ := &b.Func.Config.Types
1643 // match: (Leq64U x y)
1644 // result: (XOR (MOVVconst [1]) (SGTU x y))
1645 for {
1646 x := v_0
1647 y := v_1
1648 v.reset(OpMIPS64XOR)
1649 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
1650 v0.AuxInt = int64ToAuxInt(1)
1651 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
1652 v1.AddArg2(x, y)
1653 v.AddArg2(v0, v1)
1654 return true
1655 }
1656 }
1657 func rewriteValueMIPS64_OpLeq8(v *Value) bool {
1658 v_1 := v.Args[1]
1659 v_0 := v.Args[0]
1660 b := v.Block
1661 typ := &b.Func.Config.Types
1662 // match: (Leq8 x y)
1663 // result: (XOR (MOVVconst [1]) (SGT (SignExt8to64 x) (SignExt8to64 y)))
1664 for {
1665 x := v_0
1666 y := v_1
1667 v.reset(OpMIPS64XOR)
1668 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
1669 v0.AuxInt = int64ToAuxInt(1)
1670 v1 := b.NewValue0(v.Pos, OpMIPS64SGT, typ.Bool)
1671 v2 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
1672 v2.AddArg(x)
1673 v3 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
1674 v3.AddArg(y)
1675 v1.AddArg2(v2, v3)
1676 v.AddArg2(v0, v1)
1677 return true
1678 }
1679 }
1680 func rewriteValueMIPS64_OpLeq8U(v *Value) bool {
1681 v_1 := v.Args[1]
1682 v_0 := v.Args[0]
1683 b := v.Block
1684 typ := &b.Func.Config.Types
1685 // match: (Leq8U x y)
1686 // result: (XOR (MOVVconst [1]) (SGTU (ZeroExt8to64 x) (ZeroExt8to64 y)))
1687 for {
1688 x := v_0
1689 y := v_1
1690 v.reset(OpMIPS64XOR)
1691 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
1692 v0.AuxInt = int64ToAuxInt(1)
1693 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
1694 v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1695 v2.AddArg(x)
1696 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1697 v3.AddArg(y)
1698 v1.AddArg2(v2, v3)
1699 v.AddArg2(v0, v1)
1700 return true
1701 }
1702 }
1703 func rewriteValueMIPS64_OpLess16(v *Value) bool {
1704 v_1 := v.Args[1]
1705 v_0 := v.Args[0]
1706 b := v.Block
1707 typ := &b.Func.Config.Types
1708 // match: (Less16 x y)
1709 // result: (SGT (SignExt16to64 y) (SignExt16to64 x))
1710 for {
1711 x := v_0
1712 y := v_1
1713 v.reset(OpMIPS64SGT)
1714 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
1715 v0.AddArg(y)
1716 v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
1717 v1.AddArg(x)
1718 v.AddArg2(v0, v1)
1719 return true
1720 }
1721 }
1722 func rewriteValueMIPS64_OpLess16U(v *Value) bool {
1723 v_1 := v.Args[1]
1724 v_0 := v.Args[0]
1725 b := v.Block
1726 typ := &b.Func.Config.Types
1727 // match: (Less16U x y)
1728 // result: (SGTU (ZeroExt16to64 y) (ZeroExt16to64 x))
1729 for {
1730 x := v_0
1731 y := v_1
1732 v.reset(OpMIPS64SGTU)
1733 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1734 v0.AddArg(y)
1735 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1736 v1.AddArg(x)
1737 v.AddArg2(v0, v1)
1738 return true
1739 }
1740 }
1741 func rewriteValueMIPS64_OpLess32(v *Value) bool {
1742 v_1 := v.Args[1]
1743 v_0 := v.Args[0]
1744 b := v.Block
1745 typ := &b.Func.Config.Types
1746 // match: (Less32 x y)
1747 // result: (SGT (SignExt32to64 y) (SignExt32to64 x))
1748 for {
1749 x := v_0
1750 y := v_1
1751 v.reset(OpMIPS64SGT)
1752 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1753 v0.AddArg(y)
1754 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1755 v1.AddArg(x)
1756 v.AddArg2(v0, v1)
1757 return true
1758 }
1759 }
1760 func rewriteValueMIPS64_OpLess32F(v *Value) bool {
1761 v_1 := v.Args[1]
1762 v_0 := v.Args[0]
1763 b := v.Block
1764 // match: (Less32F x y)
1765 // result: (FPFlagTrue (CMPGTF y x))
1766 for {
1767 x := v_0
1768 y := v_1
1769 v.reset(OpMIPS64FPFlagTrue)
1770 v0 := b.NewValue0(v.Pos, OpMIPS64CMPGTF, types.TypeFlags)
1771 v0.AddArg2(y, x)
1772 v.AddArg(v0)
1773 return true
1774 }
1775 }
1776 func rewriteValueMIPS64_OpLess32U(v *Value) bool {
1777 v_1 := v.Args[1]
1778 v_0 := v.Args[0]
1779 b := v.Block
1780 typ := &b.Func.Config.Types
1781 // match: (Less32U x y)
1782 // result: (SGTU (ZeroExt32to64 y) (ZeroExt32to64 x))
1783 for {
1784 x := v_0
1785 y := v_1
1786 v.reset(OpMIPS64SGTU)
1787 v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1788 v0.AddArg(y)
1789 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
1790 v1.AddArg(x)
1791 v.AddArg2(v0, v1)
1792 return true
1793 }
1794 }
1795 func rewriteValueMIPS64_OpLess64(v *Value) bool {
1796 v_1 := v.Args[1]
1797 v_0 := v.Args[0]
1798 // match: (Less64 x y)
1799 // result: (SGT y x)
1800 for {
1801 x := v_0
1802 y := v_1
1803 v.reset(OpMIPS64SGT)
1804 v.AddArg2(y, x)
1805 return true
1806 }
1807 }
1808 func rewriteValueMIPS64_OpLess64F(v *Value) bool {
1809 v_1 := v.Args[1]
1810 v_0 := v.Args[0]
1811 b := v.Block
1812 // match: (Less64F x y)
1813 // result: (FPFlagTrue (CMPGTD y x))
1814 for {
1815 x := v_0
1816 y := v_1
1817 v.reset(OpMIPS64FPFlagTrue)
1818 v0 := b.NewValue0(v.Pos, OpMIPS64CMPGTD, types.TypeFlags)
1819 v0.AddArg2(y, x)
1820 v.AddArg(v0)
1821 return true
1822 }
1823 }
1824 func rewriteValueMIPS64_OpLess64U(v *Value) bool {
1825 v_1 := v.Args[1]
1826 v_0 := v.Args[0]
1827 // match: (Less64U x y)
1828 // result: (SGTU y x)
1829 for {
1830 x := v_0
1831 y := v_1
1832 v.reset(OpMIPS64SGTU)
1833 v.AddArg2(y, x)
1834 return true
1835 }
1836 }
1837 func rewriteValueMIPS64_OpLess8(v *Value) bool {
1838 v_1 := v.Args[1]
1839 v_0 := v.Args[0]
1840 b := v.Block
1841 typ := &b.Func.Config.Types
1842 // match: (Less8 x y)
1843 // result: (SGT (SignExt8to64 y) (SignExt8to64 x))
1844 for {
1845 x := v_0
1846 y := v_1
1847 v.reset(OpMIPS64SGT)
1848 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
1849 v0.AddArg(y)
1850 v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
1851 v1.AddArg(x)
1852 v.AddArg2(v0, v1)
1853 return true
1854 }
1855 }
1856 func rewriteValueMIPS64_OpLess8U(v *Value) bool {
1857 v_1 := v.Args[1]
1858 v_0 := v.Args[0]
1859 b := v.Block
1860 typ := &b.Func.Config.Types
1861 // match: (Less8U x y)
1862 // result: (SGTU (ZeroExt8to64 y) (ZeroExt8to64 x))
1863 for {
1864 x := v_0
1865 y := v_1
1866 v.reset(OpMIPS64SGTU)
1867 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1868 v0.AddArg(y)
1869 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1870 v1.AddArg(x)
1871 v.AddArg2(v0, v1)
1872 return true
1873 }
1874 }
1875 func rewriteValueMIPS64_OpLoad(v *Value) bool {
1876 v_1 := v.Args[1]
1877 v_0 := v.Args[0]
1878 // match: (Load <t> ptr mem)
1879 // cond: t.IsBoolean()
1880 // result: (MOVBUload ptr mem)
1881 for {
1882 t := v.Type
1883 ptr := v_0
1884 mem := v_1
1885 if !(t.IsBoolean()) {
1886 break
1887 }
1888 v.reset(OpMIPS64MOVBUload)
1889 v.AddArg2(ptr, mem)
1890 return true
1891 }
1892 // match: (Load <t> ptr mem)
1893 // cond: (is8BitInt(t) && t.IsSigned())
1894 // result: (MOVBload ptr mem)
1895 for {
1896 t := v.Type
1897 ptr := v_0
1898 mem := v_1
1899 if !(is8BitInt(t) && t.IsSigned()) {
1900 break
1901 }
1902 v.reset(OpMIPS64MOVBload)
1903 v.AddArg2(ptr, mem)
1904 return true
1905 }
1906 // match: (Load <t> ptr mem)
1907 // cond: (is8BitInt(t) && !t.IsSigned())
1908 // result: (MOVBUload ptr mem)
1909 for {
1910 t := v.Type
1911 ptr := v_0
1912 mem := v_1
1913 if !(is8BitInt(t) && !t.IsSigned()) {
1914 break
1915 }
1916 v.reset(OpMIPS64MOVBUload)
1917 v.AddArg2(ptr, mem)
1918 return true
1919 }
1920 // match: (Load <t> ptr mem)
1921 // cond: (is16BitInt(t) && t.IsSigned())
1922 // result: (MOVHload ptr mem)
1923 for {
1924 t := v.Type
1925 ptr := v_0
1926 mem := v_1
1927 if !(is16BitInt(t) && t.IsSigned()) {
1928 break
1929 }
1930 v.reset(OpMIPS64MOVHload)
1931 v.AddArg2(ptr, mem)
1932 return true
1933 }
1934 // match: (Load <t> ptr mem)
1935 // cond: (is16BitInt(t) && !t.IsSigned())
1936 // result: (MOVHUload ptr mem)
1937 for {
1938 t := v.Type
1939 ptr := v_0
1940 mem := v_1
1941 if !(is16BitInt(t) && !t.IsSigned()) {
1942 break
1943 }
1944 v.reset(OpMIPS64MOVHUload)
1945 v.AddArg2(ptr, mem)
1946 return true
1947 }
1948 // match: (Load <t> ptr mem)
1949 // cond: (is32BitInt(t) && t.IsSigned())
1950 // result: (MOVWload ptr mem)
1951 for {
1952 t := v.Type
1953 ptr := v_0
1954 mem := v_1
1955 if !(is32BitInt(t) && t.IsSigned()) {
1956 break
1957 }
1958 v.reset(OpMIPS64MOVWload)
1959 v.AddArg2(ptr, mem)
1960 return true
1961 }
1962 // match: (Load <t> ptr mem)
1963 // cond: (is32BitInt(t) && !t.IsSigned())
1964 // result: (MOVWUload ptr mem)
1965 for {
1966 t := v.Type
1967 ptr := v_0
1968 mem := v_1
1969 if !(is32BitInt(t) && !t.IsSigned()) {
1970 break
1971 }
1972 v.reset(OpMIPS64MOVWUload)
1973 v.AddArg2(ptr, mem)
1974 return true
1975 }
1976 // match: (Load <t> ptr mem)
1977 // cond: (is64BitInt(t) || isPtr(t))
1978 // result: (MOVVload ptr mem)
1979 for {
1980 t := v.Type
1981 ptr := v_0
1982 mem := v_1
1983 if !(is64BitInt(t) || isPtr(t)) {
1984 break
1985 }
1986 v.reset(OpMIPS64MOVVload)
1987 v.AddArg2(ptr, mem)
1988 return true
1989 }
1990 // match: (Load <t> ptr mem)
1991 // cond: is32BitFloat(t)
1992 // result: (MOVFload ptr mem)
1993 for {
1994 t := v.Type
1995 ptr := v_0
1996 mem := v_1
1997 if !(is32BitFloat(t)) {
1998 break
1999 }
2000 v.reset(OpMIPS64MOVFload)
2001 v.AddArg2(ptr, mem)
2002 return true
2003 }
2004 // match: (Load <t> ptr mem)
2005 // cond: is64BitFloat(t)
2006 // result: (MOVDload ptr mem)
2007 for {
2008 t := v.Type
2009 ptr := v_0
2010 mem := v_1
2011 if !(is64BitFloat(t)) {
2012 break
2013 }
2014 v.reset(OpMIPS64MOVDload)
2015 v.AddArg2(ptr, mem)
2016 return true
2017 }
2018 return false
2019 }
2020 func rewriteValueMIPS64_OpLocalAddr(v *Value) bool {
2021 v_1 := v.Args[1]
2022 v_0 := v.Args[0]
2023 b := v.Block
2024 typ := &b.Func.Config.Types
2025 // match: (LocalAddr <t> {sym} base mem)
2026 // cond: t.Elem().HasPointers()
2027 // result: (MOVVaddr {sym} (SPanchored base mem))
2028 for {
2029 t := v.Type
2030 sym := auxToSym(v.Aux)
2031 base := v_0
2032 mem := v_1
2033 if !(t.Elem().HasPointers()) {
2034 break
2035 }
2036 v.reset(OpMIPS64MOVVaddr)
2037 v.Aux = symToAux(sym)
2038 v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
2039 v0.AddArg2(base, mem)
2040 v.AddArg(v0)
2041 return true
2042 }
2043 // match: (LocalAddr <t> {sym} base _)
2044 // cond: !t.Elem().HasPointers()
2045 // result: (MOVVaddr {sym} base)
2046 for {
2047 t := v.Type
2048 sym := auxToSym(v.Aux)
2049 base := v_0
2050 if !(!t.Elem().HasPointers()) {
2051 break
2052 }
2053 v.reset(OpMIPS64MOVVaddr)
2054 v.Aux = symToAux(sym)
2055 v.AddArg(base)
2056 return true
2057 }
2058 return false
2059 }
2060 func rewriteValueMIPS64_OpLsh16x16(v *Value) bool {
2061 v_1 := v.Args[1]
2062 v_0 := v.Args[0]
2063 b := v.Block
2064 typ := &b.Func.Config.Types
2065 // match: (Lsh16x16 <t> x y)
2066 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y))) (SLLV <t> x (ZeroExt16to64 y)))
2067 for {
2068 t := v.Type
2069 x := v_0
2070 y := v_1
2071 v.reset(OpMIPS64AND)
2072 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
2073 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
2074 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
2075 v2.AuxInt = int64ToAuxInt(64)
2076 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2077 v3.AddArg(y)
2078 v1.AddArg2(v2, v3)
2079 v0.AddArg(v1)
2080 v4 := b.NewValue0(v.Pos, OpMIPS64SLLV, t)
2081 v4.AddArg2(x, v3)
2082 v.AddArg2(v0, v4)
2083 return true
2084 }
2085 }
2086 func rewriteValueMIPS64_OpLsh16x32(v *Value) bool {
2087 v_1 := v.Args[1]
2088 v_0 := v.Args[0]
2089 b := v.Block
2090 typ := &b.Func.Config.Types
2091 // match: (Lsh16x32 <t> x y)
2092 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y))) (SLLV <t> x (ZeroExt32to64 y)))
2093 for {
2094 t := v.Type
2095 x := v_0
2096 y := v_1
2097 v.reset(OpMIPS64AND)
2098 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
2099 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
2100 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
2101 v2.AuxInt = int64ToAuxInt(64)
2102 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2103 v3.AddArg(y)
2104 v1.AddArg2(v2, v3)
2105 v0.AddArg(v1)
2106 v4 := b.NewValue0(v.Pos, OpMIPS64SLLV, t)
2107 v4.AddArg2(x, v3)
2108 v.AddArg2(v0, v4)
2109 return true
2110 }
2111 }
2112 func rewriteValueMIPS64_OpLsh16x64(v *Value) bool {
2113 v_1 := v.Args[1]
2114 v_0 := v.Args[0]
2115 b := v.Block
2116 typ := &b.Func.Config.Types
2117 // match: (Lsh16x64 <t> x y)
2118 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) y)) (SLLV <t> x y))
2119 for {
2120 t := v.Type
2121 x := v_0
2122 y := v_1
2123 v.reset(OpMIPS64AND)
2124 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
2125 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
2126 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
2127 v2.AuxInt = int64ToAuxInt(64)
2128 v1.AddArg2(v2, y)
2129 v0.AddArg(v1)
2130 v3 := b.NewValue0(v.Pos, OpMIPS64SLLV, t)
2131 v3.AddArg2(x, y)
2132 v.AddArg2(v0, v3)
2133 return true
2134 }
2135 }
2136 func rewriteValueMIPS64_OpLsh16x8(v *Value) bool {
2137 v_1 := v.Args[1]
2138 v_0 := v.Args[0]
2139 b := v.Block
2140 typ := &b.Func.Config.Types
2141 // match: (Lsh16x8 <t> x y)
2142 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y))) (SLLV <t> x (ZeroExt8to64 y)))
2143 for {
2144 t := v.Type
2145 x := v_0
2146 y := v_1
2147 v.reset(OpMIPS64AND)
2148 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
2149 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
2150 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
2151 v2.AuxInt = int64ToAuxInt(64)
2152 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
2153 v3.AddArg(y)
2154 v1.AddArg2(v2, v3)
2155 v0.AddArg(v1)
2156 v4 := b.NewValue0(v.Pos, OpMIPS64SLLV, t)
2157 v4.AddArg2(x, v3)
2158 v.AddArg2(v0, v4)
2159 return true
2160 }
2161 }
2162 func rewriteValueMIPS64_OpLsh32x16(v *Value) bool {
2163 v_1 := v.Args[1]
2164 v_0 := v.Args[0]
2165 b := v.Block
2166 typ := &b.Func.Config.Types
2167 // match: (Lsh32x16 <t> x y)
2168 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y))) (SLLV <t> x (ZeroExt16to64 y)))
2169 for {
2170 t := v.Type
2171 x := v_0
2172 y := v_1
2173 v.reset(OpMIPS64AND)
2174 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
2175 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
2176 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
2177 v2.AuxInt = int64ToAuxInt(64)
2178 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2179 v3.AddArg(y)
2180 v1.AddArg2(v2, v3)
2181 v0.AddArg(v1)
2182 v4 := b.NewValue0(v.Pos, OpMIPS64SLLV, t)
2183 v4.AddArg2(x, v3)
2184 v.AddArg2(v0, v4)
2185 return true
2186 }
2187 }
2188 func rewriteValueMIPS64_OpLsh32x32(v *Value) bool {
2189 v_1 := v.Args[1]
2190 v_0 := v.Args[0]
2191 b := v.Block
2192 typ := &b.Func.Config.Types
2193 // match: (Lsh32x32 <t> x y)
2194 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y))) (SLLV <t> x (ZeroExt32to64 y)))
2195 for {
2196 t := v.Type
2197 x := v_0
2198 y := v_1
2199 v.reset(OpMIPS64AND)
2200 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
2201 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
2202 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
2203 v2.AuxInt = int64ToAuxInt(64)
2204 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2205 v3.AddArg(y)
2206 v1.AddArg2(v2, v3)
2207 v0.AddArg(v1)
2208 v4 := b.NewValue0(v.Pos, OpMIPS64SLLV, t)
2209 v4.AddArg2(x, v3)
2210 v.AddArg2(v0, v4)
2211 return true
2212 }
2213 }
2214 func rewriteValueMIPS64_OpLsh32x64(v *Value) bool {
2215 v_1 := v.Args[1]
2216 v_0 := v.Args[0]
2217 b := v.Block
2218 typ := &b.Func.Config.Types
2219 // match: (Lsh32x64 <t> x y)
2220 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) y)) (SLLV <t> x y))
2221 for {
2222 t := v.Type
2223 x := v_0
2224 y := v_1
2225 v.reset(OpMIPS64AND)
2226 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
2227 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
2228 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
2229 v2.AuxInt = int64ToAuxInt(64)
2230 v1.AddArg2(v2, y)
2231 v0.AddArg(v1)
2232 v3 := b.NewValue0(v.Pos, OpMIPS64SLLV, t)
2233 v3.AddArg2(x, y)
2234 v.AddArg2(v0, v3)
2235 return true
2236 }
2237 }
2238 func rewriteValueMIPS64_OpLsh32x8(v *Value) bool {
2239 v_1 := v.Args[1]
2240 v_0 := v.Args[0]
2241 b := v.Block
2242 typ := &b.Func.Config.Types
2243 // match: (Lsh32x8 <t> x y)
2244 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y))) (SLLV <t> x (ZeroExt8to64 y)))
2245 for {
2246 t := v.Type
2247 x := v_0
2248 y := v_1
2249 v.reset(OpMIPS64AND)
2250 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
2251 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
2252 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
2253 v2.AuxInt = int64ToAuxInt(64)
2254 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
2255 v3.AddArg(y)
2256 v1.AddArg2(v2, v3)
2257 v0.AddArg(v1)
2258 v4 := b.NewValue0(v.Pos, OpMIPS64SLLV, t)
2259 v4.AddArg2(x, v3)
2260 v.AddArg2(v0, v4)
2261 return true
2262 }
2263 }
2264 func rewriteValueMIPS64_OpLsh64x16(v *Value) bool {
2265 v_1 := v.Args[1]
2266 v_0 := v.Args[0]
2267 b := v.Block
2268 typ := &b.Func.Config.Types
2269 // match: (Lsh64x16 <t> x y)
2270 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y))) (SLLV <t> x (ZeroExt16to64 y)))
2271 for {
2272 t := v.Type
2273 x := v_0
2274 y := v_1
2275 v.reset(OpMIPS64AND)
2276 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
2277 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
2278 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
2279 v2.AuxInt = int64ToAuxInt(64)
2280 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2281 v3.AddArg(y)
2282 v1.AddArg2(v2, v3)
2283 v0.AddArg(v1)
2284 v4 := b.NewValue0(v.Pos, OpMIPS64SLLV, t)
2285 v4.AddArg2(x, v3)
2286 v.AddArg2(v0, v4)
2287 return true
2288 }
2289 }
2290 func rewriteValueMIPS64_OpLsh64x32(v *Value) bool {
2291 v_1 := v.Args[1]
2292 v_0 := v.Args[0]
2293 b := v.Block
2294 typ := &b.Func.Config.Types
2295 // match: (Lsh64x32 <t> x y)
2296 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y))) (SLLV <t> x (ZeroExt32to64 y)))
2297 for {
2298 t := v.Type
2299 x := v_0
2300 y := v_1
2301 v.reset(OpMIPS64AND)
2302 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
2303 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
2304 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
2305 v2.AuxInt = int64ToAuxInt(64)
2306 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2307 v3.AddArg(y)
2308 v1.AddArg2(v2, v3)
2309 v0.AddArg(v1)
2310 v4 := b.NewValue0(v.Pos, OpMIPS64SLLV, t)
2311 v4.AddArg2(x, v3)
2312 v.AddArg2(v0, v4)
2313 return true
2314 }
2315 }
2316 func rewriteValueMIPS64_OpLsh64x64(v *Value) bool {
2317 v_1 := v.Args[1]
2318 v_0 := v.Args[0]
2319 b := v.Block
2320 typ := &b.Func.Config.Types
2321 // match: (Lsh64x64 <t> x y)
2322 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) y)) (SLLV <t> x y))
2323 for {
2324 t := v.Type
2325 x := v_0
2326 y := v_1
2327 v.reset(OpMIPS64AND)
2328 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
2329 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
2330 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
2331 v2.AuxInt = int64ToAuxInt(64)
2332 v1.AddArg2(v2, y)
2333 v0.AddArg(v1)
2334 v3 := b.NewValue0(v.Pos, OpMIPS64SLLV, t)
2335 v3.AddArg2(x, y)
2336 v.AddArg2(v0, v3)
2337 return true
2338 }
2339 }
2340 func rewriteValueMIPS64_OpLsh64x8(v *Value) bool {
2341 v_1 := v.Args[1]
2342 v_0 := v.Args[0]
2343 b := v.Block
2344 typ := &b.Func.Config.Types
2345 // match: (Lsh64x8 <t> x y)
2346 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y))) (SLLV <t> x (ZeroExt8to64 y)))
2347 for {
2348 t := v.Type
2349 x := v_0
2350 y := v_1
2351 v.reset(OpMIPS64AND)
2352 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
2353 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
2354 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
2355 v2.AuxInt = int64ToAuxInt(64)
2356 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
2357 v3.AddArg(y)
2358 v1.AddArg2(v2, v3)
2359 v0.AddArg(v1)
2360 v4 := b.NewValue0(v.Pos, OpMIPS64SLLV, t)
2361 v4.AddArg2(x, v3)
2362 v.AddArg2(v0, v4)
2363 return true
2364 }
2365 }
2366 func rewriteValueMIPS64_OpLsh8x16(v *Value) bool {
2367 v_1 := v.Args[1]
2368 v_0 := v.Args[0]
2369 b := v.Block
2370 typ := &b.Func.Config.Types
2371 // match: (Lsh8x16 <t> x y)
2372 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y))) (SLLV <t> x (ZeroExt16to64 y)))
2373 for {
2374 t := v.Type
2375 x := v_0
2376 y := v_1
2377 v.reset(OpMIPS64AND)
2378 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
2379 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
2380 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
2381 v2.AuxInt = int64ToAuxInt(64)
2382 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2383 v3.AddArg(y)
2384 v1.AddArg2(v2, v3)
2385 v0.AddArg(v1)
2386 v4 := b.NewValue0(v.Pos, OpMIPS64SLLV, t)
2387 v4.AddArg2(x, v3)
2388 v.AddArg2(v0, v4)
2389 return true
2390 }
2391 }
2392 func rewriteValueMIPS64_OpLsh8x32(v *Value) bool {
2393 v_1 := v.Args[1]
2394 v_0 := v.Args[0]
2395 b := v.Block
2396 typ := &b.Func.Config.Types
2397 // match: (Lsh8x32 <t> x y)
2398 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y))) (SLLV <t> x (ZeroExt32to64 y)))
2399 for {
2400 t := v.Type
2401 x := v_0
2402 y := v_1
2403 v.reset(OpMIPS64AND)
2404 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
2405 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
2406 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
2407 v2.AuxInt = int64ToAuxInt(64)
2408 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
2409 v3.AddArg(y)
2410 v1.AddArg2(v2, v3)
2411 v0.AddArg(v1)
2412 v4 := b.NewValue0(v.Pos, OpMIPS64SLLV, t)
2413 v4.AddArg2(x, v3)
2414 v.AddArg2(v0, v4)
2415 return true
2416 }
2417 }
2418 func rewriteValueMIPS64_OpLsh8x64(v *Value) bool {
2419 v_1 := v.Args[1]
2420 v_0 := v.Args[0]
2421 b := v.Block
2422 typ := &b.Func.Config.Types
2423 // match: (Lsh8x64 <t> x y)
2424 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) y)) (SLLV <t> x y))
2425 for {
2426 t := v.Type
2427 x := v_0
2428 y := v_1
2429 v.reset(OpMIPS64AND)
2430 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
2431 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
2432 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
2433 v2.AuxInt = int64ToAuxInt(64)
2434 v1.AddArg2(v2, y)
2435 v0.AddArg(v1)
2436 v3 := b.NewValue0(v.Pos, OpMIPS64SLLV, t)
2437 v3.AddArg2(x, y)
2438 v.AddArg2(v0, v3)
2439 return true
2440 }
2441 }
2442 func rewriteValueMIPS64_OpLsh8x8(v *Value) bool {
2443 v_1 := v.Args[1]
2444 v_0 := v.Args[0]
2445 b := v.Block
2446 typ := &b.Func.Config.Types
2447 // match: (Lsh8x8 <t> x y)
2448 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y))) (SLLV <t> x (ZeroExt8to64 y)))
2449 for {
2450 t := v.Type
2451 x := v_0
2452 y := v_1
2453 v.reset(OpMIPS64AND)
2454 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
2455 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
2456 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
2457 v2.AuxInt = int64ToAuxInt(64)
2458 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
2459 v3.AddArg(y)
2460 v1.AddArg2(v2, v3)
2461 v0.AddArg(v1)
2462 v4 := b.NewValue0(v.Pos, OpMIPS64SLLV, t)
2463 v4.AddArg2(x, v3)
2464 v.AddArg2(v0, v4)
2465 return true
2466 }
2467 }
2468 func rewriteValueMIPS64_OpMIPS64ADDV(v *Value) bool {
2469 v_1 := v.Args[1]
2470 v_0 := v.Args[0]
2471 // match: (ADDV x (MOVVconst <t> [c]))
2472 // cond: is32Bit(c) && !t.IsPtr()
2473 // result: (ADDVconst [c] x)
2474 for {
2475 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2476 x := v_0
2477 if v_1.Op != OpMIPS64MOVVconst {
2478 continue
2479 }
2480 t := v_1.Type
2481 c := auxIntToInt64(v_1.AuxInt)
2482 if !(is32Bit(c) && !t.IsPtr()) {
2483 continue
2484 }
2485 v.reset(OpMIPS64ADDVconst)
2486 v.AuxInt = int64ToAuxInt(c)
2487 v.AddArg(x)
2488 return true
2489 }
2490 break
2491 }
2492 // match: (ADDV x (NEGV y))
2493 // result: (SUBV x y)
2494 for {
2495 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2496 x := v_0
2497 if v_1.Op != OpMIPS64NEGV {
2498 continue
2499 }
2500 y := v_1.Args[0]
2501 v.reset(OpMIPS64SUBV)
2502 v.AddArg2(x, y)
2503 return true
2504 }
2505 break
2506 }
2507 return false
2508 }
2509 func rewriteValueMIPS64_OpMIPS64ADDVconst(v *Value) bool {
2510 v_0 := v.Args[0]
2511 // match: (ADDVconst [off1] (MOVVaddr [off2] {sym} ptr))
2512 // cond: is32Bit(off1+int64(off2))
2513 // result: (MOVVaddr [int32(off1)+int32(off2)] {sym} ptr)
2514 for {
2515 off1 := auxIntToInt64(v.AuxInt)
2516 if v_0.Op != OpMIPS64MOVVaddr {
2517 break
2518 }
2519 off2 := auxIntToInt32(v_0.AuxInt)
2520 sym := auxToSym(v_0.Aux)
2521 ptr := v_0.Args[0]
2522 if !(is32Bit(off1 + int64(off2))) {
2523 break
2524 }
2525 v.reset(OpMIPS64MOVVaddr)
2526 v.AuxInt = int32ToAuxInt(int32(off1) + int32(off2))
2527 v.Aux = symToAux(sym)
2528 v.AddArg(ptr)
2529 return true
2530 }
2531 // match: (ADDVconst [0] x)
2532 // result: x
2533 for {
2534 if auxIntToInt64(v.AuxInt) != 0 {
2535 break
2536 }
2537 x := v_0
2538 v.copyOf(x)
2539 return true
2540 }
2541 // match: (ADDVconst [c] (MOVVconst [d]))
2542 // result: (MOVVconst [c+d])
2543 for {
2544 c := auxIntToInt64(v.AuxInt)
2545 if v_0.Op != OpMIPS64MOVVconst {
2546 break
2547 }
2548 d := auxIntToInt64(v_0.AuxInt)
2549 v.reset(OpMIPS64MOVVconst)
2550 v.AuxInt = int64ToAuxInt(c + d)
2551 return true
2552 }
2553 // match: (ADDVconst [c] (ADDVconst [d] x))
2554 // cond: is32Bit(c+d)
2555 // result: (ADDVconst [c+d] x)
2556 for {
2557 c := auxIntToInt64(v.AuxInt)
2558 if v_0.Op != OpMIPS64ADDVconst {
2559 break
2560 }
2561 d := auxIntToInt64(v_0.AuxInt)
2562 x := v_0.Args[0]
2563 if !(is32Bit(c + d)) {
2564 break
2565 }
2566 v.reset(OpMIPS64ADDVconst)
2567 v.AuxInt = int64ToAuxInt(c + d)
2568 v.AddArg(x)
2569 return true
2570 }
2571 // match: (ADDVconst [c] (SUBVconst [d] x))
2572 // cond: is32Bit(c-d)
2573 // result: (ADDVconst [c-d] x)
2574 for {
2575 c := auxIntToInt64(v.AuxInt)
2576 if v_0.Op != OpMIPS64SUBVconst {
2577 break
2578 }
2579 d := auxIntToInt64(v_0.AuxInt)
2580 x := v_0.Args[0]
2581 if !(is32Bit(c - d)) {
2582 break
2583 }
2584 v.reset(OpMIPS64ADDVconst)
2585 v.AuxInt = int64ToAuxInt(c - d)
2586 v.AddArg(x)
2587 return true
2588 }
2589 return false
2590 }
2591 func rewriteValueMIPS64_OpMIPS64AND(v *Value) bool {
2592 v_1 := v.Args[1]
2593 v_0 := v.Args[0]
2594 // match: (AND x (MOVVconst [c]))
2595 // cond: is32Bit(c)
2596 // result: (ANDconst [c] x)
2597 for {
2598 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2599 x := v_0
2600 if v_1.Op != OpMIPS64MOVVconst {
2601 continue
2602 }
2603 c := auxIntToInt64(v_1.AuxInt)
2604 if !(is32Bit(c)) {
2605 continue
2606 }
2607 v.reset(OpMIPS64ANDconst)
2608 v.AuxInt = int64ToAuxInt(c)
2609 v.AddArg(x)
2610 return true
2611 }
2612 break
2613 }
2614 // match: (AND x x)
2615 // result: x
2616 for {
2617 x := v_0
2618 if x != v_1 {
2619 break
2620 }
2621 v.copyOf(x)
2622 return true
2623 }
2624 return false
2625 }
2626 func rewriteValueMIPS64_OpMIPS64ANDconst(v *Value) bool {
2627 v_0 := v.Args[0]
2628 // match: (ANDconst [0] _)
2629 // result: (MOVVconst [0])
2630 for {
2631 if auxIntToInt64(v.AuxInt) != 0 {
2632 break
2633 }
2634 v.reset(OpMIPS64MOVVconst)
2635 v.AuxInt = int64ToAuxInt(0)
2636 return true
2637 }
2638 // match: (ANDconst [-1] x)
2639 // result: x
2640 for {
2641 if auxIntToInt64(v.AuxInt) != -1 {
2642 break
2643 }
2644 x := v_0
2645 v.copyOf(x)
2646 return true
2647 }
2648 // match: (ANDconst [c] (MOVVconst [d]))
2649 // result: (MOVVconst [c&d])
2650 for {
2651 c := auxIntToInt64(v.AuxInt)
2652 if v_0.Op != OpMIPS64MOVVconst {
2653 break
2654 }
2655 d := auxIntToInt64(v_0.AuxInt)
2656 v.reset(OpMIPS64MOVVconst)
2657 v.AuxInt = int64ToAuxInt(c & d)
2658 return true
2659 }
2660 // match: (ANDconst [c] (ANDconst [d] x))
2661 // result: (ANDconst [c&d] x)
2662 for {
2663 c := auxIntToInt64(v.AuxInt)
2664 if v_0.Op != OpMIPS64ANDconst {
2665 break
2666 }
2667 d := auxIntToInt64(v_0.AuxInt)
2668 x := v_0.Args[0]
2669 v.reset(OpMIPS64ANDconst)
2670 v.AuxInt = int64ToAuxInt(c & d)
2671 v.AddArg(x)
2672 return true
2673 }
2674 return false
2675 }
2676 func rewriteValueMIPS64_OpMIPS64LoweredAtomicAdd32(v *Value) bool {
2677 v_2 := v.Args[2]
2678 v_1 := v.Args[1]
2679 v_0 := v.Args[0]
2680 // match: (LoweredAtomicAdd32 ptr (MOVVconst [c]) mem)
2681 // cond: is32Bit(c)
2682 // result: (LoweredAtomicAddconst32 [int32(c)] ptr mem)
2683 for {
2684 ptr := v_0
2685 if v_1.Op != OpMIPS64MOVVconst {
2686 break
2687 }
2688 c := auxIntToInt64(v_1.AuxInt)
2689 mem := v_2
2690 if !(is32Bit(c)) {
2691 break
2692 }
2693 v.reset(OpMIPS64LoweredAtomicAddconst32)
2694 v.AuxInt = int32ToAuxInt(int32(c))
2695 v.AddArg2(ptr, mem)
2696 return true
2697 }
2698 return false
2699 }
2700 func rewriteValueMIPS64_OpMIPS64LoweredAtomicAdd64(v *Value) bool {
2701 v_2 := v.Args[2]
2702 v_1 := v.Args[1]
2703 v_0 := v.Args[0]
2704 // match: (LoweredAtomicAdd64 ptr (MOVVconst [c]) mem)
2705 // cond: is32Bit(c)
2706 // result: (LoweredAtomicAddconst64 [c] ptr mem)
2707 for {
2708 ptr := v_0
2709 if v_1.Op != OpMIPS64MOVVconst {
2710 break
2711 }
2712 c := auxIntToInt64(v_1.AuxInt)
2713 mem := v_2
2714 if !(is32Bit(c)) {
2715 break
2716 }
2717 v.reset(OpMIPS64LoweredAtomicAddconst64)
2718 v.AuxInt = int64ToAuxInt(c)
2719 v.AddArg2(ptr, mem)
2720 return true
2721 }
2722 return false
2723 }
2724 func rewriteValueMIPS64_OpMIPS64LoweredAtomicStore32(v *Value) bool {
2725 v_2 := v.Args[2]
2726 v_1 := v.Args[1]
2727 v_0 := v.Args[0]
2728 // match: (LoweredAtomicStore32 ptr (MOVVconst [0]) mem)
2729 // result: (LoweredAtomicStorezero32 ptr mem)
2730 for {
2731 ptr := v_0
2732 if v_1.Op != OpMIPS64MOVVconst || auxIntToInt64(v_1.AuxInt) != 0 {
2733 break
2734 }
2735 mem := v_2
2736 v.reset(OpMIPS64LoweredAtomicStorezero32)
2737 v.AddArg2(ptr, mem)
2738 return true
2739 }
2740 return false
2741 }
2742 func rewriteValueMIPS64_OpMIPS64LoweredAtomicStore64(v *Value) bool {
2743 v_2 := v.Args[2]
2744 v_1 := v.Args[1]
2745 v_0 := v.Args[0]
2746 // match: (LoweredAtomicStore64 ptr (MOVVconst [0]) mem)
2747 // result: (LoweredAtomicStorezero64 ptr mem)
2748 for {
2749 ptr := v_0
2750 if v_1.Op != OpMIPS64MOVVconst || auxIntToInt64(v_1.AuxInt) != 0 {
2751 break
2752 }
2753 mem := v_2
2754 v.reset(OpMIPS64LoweredAtomicStorezero64)
2755 v.AddArg2(ptr, mem)
2756 return true
2757 }
2758 return false
2759 }
2760 func rewriteValueMIPS64_OpMIPS64MOVBUload(v *Value) bool {
2761 v_1 := v.Args[1]
2762 v_0 := v.Args[0]
2763 b := v.Block
2764 config := b.Func.Config
2765 // match: (MOVBUload [off1] {sym} (ADDVconst [off2] ptr) mem)
2766 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
2767 // result: (MOVBUload [off1+int32(off2)] {sym} ptr mem)
2768 for {
2769 off1 := auxIntToInt32(v.AuxInt)
2770 sym := auxToSym(v.Aux)
2771 if v_0.Op != OpMIPS64ADDVconst {
2772 break
2773 }
2774 off2 := auxIntToInt64(v_0.AuxInt)
2775 ptr := v_0.Args[0]
2776 mem := v_1
2777 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
2778 break
2779 }
2780 v.reset(OpMIPS64MOVBUload)
2781 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
2782 v.Aux = symToAux(sym)
2783 v.AddArg2(ptr, mem)
2784 return true
2785 }
2786 // match: (MOVBUload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
2787 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
2788 // result: (MOVBUload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
2789 for {
2790 off1 := auxIntToInt32(v.AuxInt)
2791 sym1 := auxToSym(v.Aux)
2792 if v_0.Op != OpMIPS64MOVVaddr {
2793 break
2794 }
2795 off2 := auxIntToInt32(v_0.AuxInt)
2796 sym2 := auxToSym(v_0.Aux)
2797 ptr := v_0.Args[0]
2798 mem := v_1
2799 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
2800 break
2801 }
2802 v.reset(OpMIPS64MOVBUload)
2803 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
2804 v.Aux = symToAux(mergeSym(sym1, sym2))
2805 v.AddArg2(ptr, mem)
2806 return true
2807 }
2808 // match: (MOVBUload [off] {sym} (SB) _)
2809 // cond: symIsRO(sym)
2810 // result: (MOVVconst [int64(read8(sym, int64(off)))])
2811 for {
2812 off := auxIntToInt32(v.AuxInt)
2813 sym := auxToSym(v.Aux)
2814 if v_0.Op != OpSB || !(symIsRO(sym)) {
2815 break
2816 }
2817 v.reset(OpMIPS64MOVVconst)
2818 v.AuxInt = int64ToAuxInt(int64(read8(sym, int64(off))))
2819 return true
2820 }
2821 return false
2822 }
2823 func rewriteValueMIPS64_OpMIPS64MOVBUreg(v *Value) bool {
2824 v_0 := v.Args[0]
2825 // match: (MOVBUreg x:(MOVBUload _ _))
2826 // result: (MOVVreg x)
2827 for {
2828 x := v_0
2829 if x.Op != OpMIPS64MOVBUload {
2830 break
2831 }
2832 v.reset(OpMIPS64MOVVreg)
2833 v.AddArg(x)
2834 return true
2835 }
2836 // match: (MOVBUreg x:(MOVBUreg _))
2837 // result: (MOVVreg x)
2838 for {
2839 x := v_0
2840 if x.Op != OpMIPS64MOVBUreg {
2841 break
2842 }
2843 v.reset(OpMIPS64MOVVreg)
2844 v.AddArg(x)
2845 return true
2846 }
2847 // match: (MOVBUreg (MOVVconst [c]))
2848 // result: (MOVVconst [int64(uint8(c))])
2849 for {
2850 if v_0.Op != OpMIPS64MOVVconst {
2851 break
2852 }
2853 c := auxIntToInt64(v_0.AuxInt)
2854 v.reset(OpMIPS64MOVVconst)
2855 v.AuxInt = int64ToAuxInt(int64(uint8(c)))
2856 return true
2857 }
2858 return false
2859 }
2860 func rewriteValueMIPS64_OpMIPS64MOVBload(v *Value) bool {
2861 v_1 := v.Args[1]
2862 v_0 := v.Args[0]
2863 b := v.Block
2864 config := b.Func.Config
2865 // match: (MOVBload [off1] {sym} (ADDVconst [off2] ptr) mem)
2866 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
2867 // result: (MOVBload [off1+int32(off2)] {sym} ptr mem)
2868 for {
2869 off1 := auxIntToInt32(v.AuxInt)
2870 sym := auxToSym(v.Aux)
2871 if v_0.Op != OpMIPS64ADDVconst {
2872 break
2873 }
2874 off2 := auxIntToInt64(v_0.AuxInt)
2875 ptr := v_0.Args[0]
2876 mem := v_1
2877 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
2878 break
2879 }
2880 v.reset(OpMIPS64MOVBload)
2881 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
2882 v.Aux = symToAux(sym)
2883 v.AddArg2(ptr, mem)
2884 return true
2885 }
2886 // match: (MOVBload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
2887 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
2888 // result: (MOVBload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
2889 for {
2890 off1 := auxIntToInt32(v.AuxInt)
2891 sym1 := auxToSym(v.Aux)
2892 if v_0.Op != OpMIPS64MOVVaddr {
2893 break
2894 }
2895 off2 := auxIntToInt32(v_0.AuxInt)
2896 sym2 := auxToSym(v_0.Aux)
2897 ptr := v_0.Args[0]
2898 mem := v_1
2899 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
2900 break
2901 }
2902 v.reset(OpMIPS64MOVBload)
2903 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
2904 v.Aux = symToAux(mergeSym(sym1, sym2))
2905 v.AddArg2(ptr, mem)
2906 return true
2907 }
2908 // match: (MOVBload [off] {sym} (SB) _)
2909 // cond: symIsRO(sym)
2910 // result: (MOVVconst [int64(int8(read8(sym, int64(off))))])
2911 for {
2912 off := auxIntToInt32(v.AuxInt)
2913 sym := auxToSym(v.Aux)
2914 if v_0.Op != OpSB || !(symIsRO(sym)) {
2915 break
2916 }
2917 v.reset(OpMIPS64MOVVconst)
2918 v.AuxInt = int64ToAuxInt(int64(int8(read8(sym, int64(off)))))
2919 return true
2920 }
2921 return false
2922 }
2923 func rewriteValueMIPS64_OpMIPS64MOVBreg(v *Value) bool {
2924 v_0 := v.Args[0]
2925 // match: (MOVBreg x:(MOVBload _ _))
2926 // result: (MOVVreg x)
2927 for {
2928 x := v_0
2929 if x.Op != OpMIPS64MOVBload {
2930 break
2931 }
2932 v.reset(OpMIPS64MOVVreg)
2933 v.AddArg(x)
2934 return true
2935 }
2936 // match: (MOVBreg x:(MOVBreg _))
2937 // result: (MOVVreg x)
2938 for {
2939 x := v_0
2940 if x.Op != OpMIPS64MOVBreg {
2941 break
2942 }
2943 v.reset(OpMIPS64MOVVreg)
2944 v.AddArg(x)
2945 return true
2946 }
2947 // match: (MOVBreg (MOVVconst [c]))
2948 // result: (MOVVconst [int64(int8(c))])
2949 for {
2950 if v_0.Op != OpMIPS64MOVVconst {
2951 break
2952 }
2953 c := auxIntToInt64(v_0.AuxInt)
2954 v.reset(OpMIPS64MOVVconst)
2955 v.AuxInt = int64ToAuxInt(int64(int8(c)))
2956 return true
2957 }
2958 return false
2959 }
2960 func rewriteValueMIPS64_OpMIPS64MOVBstore(v *Value) bool {
2961 v_2 := v.Args[2]
2962 v_1 := v.Args[1]
2963 v_0 := v.Args[0]
2964 b := v.Block
2965 config := b.Func.Config
2966 // match: (MOVBstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
2967 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
2968 // result: (MOVBstore [off1+int32(off2)] {sym} ptr val mem)
2969 for {
2970 off1 := auxIntToInt32(v.AuxInt)
2971 sym := auxToSym(v.Aux)
2972 if v_0.Op != OpMIPS64ADDVconst {
2973 break
2974 }
2975 off2 := auxIntToInt64(v_0.AuxInt)
2976 ptr := v_0.Args[0]
2977 val := v_1
2978 mem := v_2
2979 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
2980 break
2981 }
2982 v.reset(OpMIPS64MOVBstore)
2983 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
2984 v.Aux = symToAux(sym)
2985 v.AddArg3(ptr, val, mem)
2986 return true
2987 }
2988 // match: (MOVBstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
2989 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
2990 // result: (MOVBstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
2991 for {
2992 off1 := auxIntToInt32(v.AuxInt)
2993 sym1 := auxToSym(v.Aux)
2994 if v_0.Op != OpMIPS64MOVVaddr {
2995 break
2996 }
2997 off2 := auxIntToInt32(v_0.AuxInt)
2998 sym2 := auxToSym(v_0.Aux)
2999 ptr := v_0.Args[0]
3000 val := v_1
3001 mem := v_2
3002 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3003 break
3004 }
3005 v.reset(OpMIPS64MOVBstore)
3006 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3007 v.Aux = symToAux(mergeSym(sym1, sym2))
3008 v.AddArg3(ptr, val, mem)
3009 return true
3010 }
3011 // match: (MOVBstore [off] {sym} ptr (MOVVconst [0]) mem)
3012 // result: (MOVBstorezero [off] {sym} ptr mem)
3013 for {
3014 off := auxIntToInt32(v.AuxInt)
3015 sym := auxToSym(v.Aux)
3016 ptr := v_0
3017 if v_1.Op != OpMIPS64MOVVconst || auxIntToInt64(v_1.AuxInt) != 0 {
3018 break
3019 }
3020 mem := v_2
3021 v.reset(OpMIPS64MOVBstorezero)
3022 v.AuxInt = int32ToAuxInt(off)
3023 v.Aux = symToAux(sym)
3024 v.AddArg2(ptr, mem)
3025 return true
3026 }
3027 // match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
3028 // result: (MOVBstore [off] {sym} ptr x mem)
3029 for {
3030 off := auxIntToInt32(v.AuxInt)
3031 sym := auxToSym(v.Aux)
3032 ptr := v_0
3033 if v_1.Op != OpMIPS64MOVBreg {
3034 break
3035 }
3036 x := v_1.Args[0]
3037 mem := v_2
3038 v.reset(OpMIPS64MOVBstore)
3039 v.AuxInt = int32ToAuxInt(off)
3040 v.Aux = symToAux(sym)
3041 v.AddArg3(ptr, x, mem)
3042 return true
3043 }
3044 // match: (MOVBstore [off] {sym} ptr (MOVBUreg x) mem)
3045 // result: (MOVBstore [off] {sym} ptr x mem)
3046 for {
3047 off := auxIntToInt32(v.AuxInt)
3048 sym := auxToSym(v.Aux)
3049 ptr := v_0
3050 if v_1.Op != OpMIPS64MOVBUreg {
3051 break
3052 }
3053 x := v_1.Args[0]
3054 mem := v_2
3055 v.reset(OpMIPS64MOVBstore)
3056 v.AuxInt = int32ToAuxInt(off)
3057 v.Aux = symToAux(sym)
3058 v.AddArg3(ptr, x, mem)
3059 return true
3060 }
3061 // match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
3062 // result: (MOVBstore [off] {sym} ptr x mem)
3063 for {
3064 off := auxIntToInt32(v.AuxInt)
3065 sym := auxToSym(v.Aux)
3066 ptr := v_0
3067 if v_1.Op != OpMIPS64MOVHreg {
3068 break
3069 }
3070 x := v_1.Args[0]
3071 mem := v_2
3072 v.reset(OpMIPS64MOVBstore)
3073 v.AuxInt = int32ToAuxInt(off)
3074 v.Aux = symToAux(sym)
3075 v.AddArg3(ptr, x, mem)
3076 return true
3077 }
3078 // match: (MOVBstore [off] {sym} ptr (MOVHUreg x) mem)
3079 // result: (MOVBstore [off] {sym} ptr x mem)
3080 for {
3081 off := auxIntToInt32(v.AuxInt)
3082 sym := auxToSym(v.Aux)
3083 ptr := v_0
3084 if v_1.Op != OpMIPS64MOVHUreg {
3085 break
3086 }
3087 x := v_1.Args[0]
3088 mem := v_2
3089 v.reset(OpMIPS64MOVBstore)
3090 v.AuxInt = int32ToAuxInt(off)
3091 v.Aux = symToAux(sym)
3092 v.AddArg3(ptr, x, mem)
3093 return true
3094 }
3095 // match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
3096 // result: (MOVBstore [off] {sym} ptr x mem)
3097 for {
3098 off := auxIntToInt32(v.AuxInt)
3099 sym := auxToSym(v.Aux)
3100 ptr := v_0
3101 if v_1.Op != OpMIPS64MOVWreg {
3102 break
3103 }
3104 x := v_1.Args[0]
3105 mem := v_2
3106 v.reset(OpMIPS64MOVBstore)
3107 v.AuxInt = int32ToAuxInt(off)
3108 v.Aux = symToAux(sym)
3109 v.AddArg3(ptr, x, mem)
3110 return true
3111 }
3112 // match: (MOVBstore [off] {sym} ptr (MOVWUreg x) mem)
3113 // result: (MOVBstore [off] {sym} ptr x mem)
3114 for {
3115 off := auxIntToInt32(v.AuxInt)
3116 sym := auxToSym(v.Aux)
3117 ptr := v_0
3118 if v_1.Op != OpMIPS64MOVWUreg {
3119 break
3120 }
3121 x := v_1.Args[0]
3122 mem := v_2
3123 v.reset(OpMIPS64MOVBstore)
3124 v.AuxInt = int32ToAuxInt(off)
3125 v.Aux = symToAux(sym)
3126 v.AddArg3(ptr, x, mem)
3127 return true
3128 }
3129 return false
3130 }
3131 func rewriteValueMIPS64_OpMIPS64MOVBstorezero(v *Value) bool {
3132 v_1 := v.Args[1]
3133 v_0 := v.Args[0]
3134 b := v.Block
3135 config := b.Func.Config
3136 // match: (MOVBstorezero [off1] {sym} (ADDVconst [off2] ptr) mem)
3137 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3138 // result: (MOVBstorezero [off1+int32(off2)] {sym} ptr mem)
3139 for {
3140 off1 := auxIntToInt32(v.AuxInt)
3141 sym := auxToSym(v.Aux)
3142 if v_0.Op != OpMIPS64ADDVconst {
3143 break
3144 }
3145 off2 := auxIntToInt64(v_0.AuxInt)
3146 ptr := v_0.Args[0]
3147 mem := v_1
3148 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3149 break
3150 }
3151 v.reset(OpMIPS64MOVBstorezero)
3152 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3153 v.Aux = symToAux(sym)
3154 v.AddArg2(ptr, mem)
3155 return true
3156 }
3157 // match: (MOVBstorezero [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
3158 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3159 // result: (MOVBstorezero [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
3160 for {
3161 off1 := auxIntToInt32(v.AuxInt)
3162 sym1 := auxToSym(v.Aux)
3163 if v_0.Op != OpMIPS64MOVVaddr {
3164 break
3165 }
3166 off2 := auxIntToInt32(v_0.AuxInt)
3167 sym2 := auxToSym(v_0.Aux)
3168 ptr := v_0.Args[0]
3169 mem := v_1
3170 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3171 break
3172 }
3173 v.reset(OpMIPS64MOVBstorezero)
3174 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3175 v.Aux = symToAux(mergeSym(sym1, sym2))
3176 v.AddArg2(ptr, mem)
3177 return true
3178 }
3179 return false
3180 }
3181 func rewriteValueMIPS64_OpMIPS64MOVDload(v *Value) bool {
3182 v_1 := v.Args[1]
3183 v_0 := v.Args[0]
3184 b := v.Block
3185 config := b.Func.Config
3186 // match: (MOVDload [off] {sym} ptr (MOVVstore [off] {sym} ptr val _))
3187 // result: (MOVVgpfp val)
3188 for {
3189 off := auxIntToInt32(v.AuxInt)
3190 sym := auxToSym(v.Aux)
3191 ptr := v_0
3192 if v_1.Op != OpMIPS64MOVVstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
3193 break
3194 }
3195 val := v_1.Args[1]
3196 if ptr != v_1.Args[0] {
3197 break
3198 }
3199 v.reset(OpMIPS64MOVVgpfp)
3200 v.AddArg(val)
3201 return true
3202 }
3203 // match: (MOVDload [off1] {sym} (ADDVconst [off2] ptr) mem)
3204 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3205 // result: (MOVDload [off1+int32(off2)] {sym} ptr mem)
3206 for {
3207 off1 := auxIntToInt32(v.AuxInt)
3208 sym := auxToSym(v.Aux)
3209 if v_0.Op != OpMIPS64ADDVconst {
3210 break
3211 }
3212 off2 := auxIntToInt64(v_0.AuxInt)
3213 ptr := v_0.Args[0]
3214 mem := v_1
3215 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3216 break
3217 }
3218 v.reset(OpMIPS64MOVDload)
3219 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3220 v.Aux = symToAux(sym)
3221 v.AddArg2(ptr, mem)
3222 return true
3223 }
3224 // match: (MOVDload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
3225 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3226 // result: (MOVDload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
3227 for {
3228 off1 := auxIntToInt32(v.AuxInt)
3229 sym1 := auxToSym(v.Aux)
3230 if v_0.Op != OpMIPS64MOVVaddr {
3231 break
3232 }
3233 off2 := auxIntToInt32(v_0.AuxInt)
3234 sym2 := auxToSym(v_0.Aux)
3235 ptr := v_0.Args[0]
3236 mem := v_1
3237 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3238 break
3239 }
3240 v.reset(OpMIPS64MOVDload)
3241 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3242 v.Aux = symToAux(mergeSym(sym1, sym2))
3243 v.AddArg2(ptr, mem)
3244 return true
3245 }
3246 return false
3247 }
3248 func rewriteValueMIPS64_OpMIPS64MOVDstore(v *Value) bool {
3249 v_2 := v.Args[2]
3250 v_1 := v.Args[1]
3251 v_0 := v.Args[0]
3252 b := v.Block
3253 config := b.Func.Config
3254 // match: (MOVDstore [off] {sym} ptr (MOVVgpfp val) mem)
3255 // result: (MOVVstore [off] {sym} ptr val mem)
3256 for {
3257 off := auxIntToInt32(v.AuxInt)
3258 sym := auxToSym(v.Aux)
3259 ptr := v_0
3260 if v_1.Op != OpMIPS64MOVVgpfp {
3261 break
3262 }
3263 val := v_1.Args[0]
3264 mem := v_2
3265 v.reset(OpMIPS64MOVVstore)
3266 v.AuxInt = int32ToAuxInt(off)
3267 v.Aux = symToAux(sym)
3268 v.AddArg3(ptr, val, mem)
3269 return true
3270 }
3271 // match: (MOVDstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
3272 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3273 // result: (MOVDstore [off1+int32(off2)] {sym} ptr val mem)
3274 for {
3275 off1 := auxIntToInt32(v.AuxInt)
3276 sym := auxToSym(v.Aux)
3277 if v_0.Op != OpMIPS64ADDVconst {
3278 break
3279 }
3280 off2 := auxIntToInt64(v_0.AuxInt)
3281 ptr := v_0.Args[0]
3282 val := v_1
3283 mem := v_2
3284 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3285 break
3286 }
3287 v.reset(OpMIPS64MOVDstore)
3288 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3289 v.Aux = symToAux(sym)
3290 v.AddArg3(ptr, val, mem)
3291 return true
3292 }
3293 // match: (MOVDstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
3294 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3295 // result: (MOVDstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
3296 for {
3297 off1 := auxIntToInt32(v.AuxInt)
3298 sym1 := auxToSym(v.Aux)
3299 if v_0.Op != OpMIPS64MOVVaddr {
3300 break
3301 }
3302 off2 := auxIntToInt32(v_0.AuxInt)
3303 sym2 := auxToSym(v_0.Aux)
3304 ptr := v_0.Args[0]
3305 val := v_1
3306 mem := v_2
3307 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3308 break
3309 }
3310 v.reset(OpMIPS64MOVDstore)
3311 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3312 v.Aux = symToAux(mergeSym(sym1, sym2))
3313 v.AddArg3(ptr, val, mem)
3314 return true
3315 }
3316 return false
3317 }
3318 func rewriteValueMIPS64_OpMIPS64MOVFload(v *Value) bool {
3319 v_1 := v.Args[1]
3320 v_0 := v.Args[0]
3321 b := v.Block
3322 config := b.Func.Config
3323 // match: (MOVFload [off] {sym} ptr (MOVWstore [off] {sym} ptr val _))
3324 // result: (MOVWgpfp val)
3325 for {
3326 off := auxIntToInt32(v.AuxInt)
3327 sym := auxToSym(v.Aux)
3328 ptr := v_0
3329 if v_1.Op != OpMIPS64MOVWstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
3330 break
3331 }
3332 val := v_1.Args[1]
3333 if ptr != v_1.Args[0] {
3334 break
3335 }
3336 v.reset(OpMIPS64MOVWgpfp)
3337 v.AddArg(val)
3338 return true
3339 }
3340 // match: (MOVFload [off1] {sym} (ADDVconst [off2] ptr) mem)
3341 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3342 // result: (MOVFload [off1+int32(off2)] {sym} ptr mem)
3343 for {
3344 off1 := auxIntToInt32(v.AuxInt)
3345 sym := auxToSym(v.Aux)
3346 if v_0.Op != OpMIPS64ADDVconst {
3347 break
3348 }
3349 off2 := auxIntToInt64(v_0.AuxInt)
3350 ptr := v_0.Args[0]
3351 mem := v_1
3352 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3353 break
3354 }
3355 v.reset(OpMIPS64MOVFload)
3356 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3357 v.Aux = symToAux(sym)
3358 v.AddArg2(ptr, mem)
3359 return true
3360 }
3361 // match: (MOVFload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
3362 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3363 // result: (MOVFload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
3364 for {
3365 off1 := auxIntToInt32(v.AuxInt)
3366 sym1 := auxToSym(v.Aux)
3367 if v_0.Op != OpMIPS64MOVVaddr {
3368 break
3369 }
3370 off2 := auxIntToInt32(v_0.AuxInt)
3371 sym2 := auxToSym(v_0.Aux)
3372 ptr := v_0.Args[0]
3373 mem := v_1
3374 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3375 break
3376 }
3377 v.reset(OpMIPS64MOVFload)
3378 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3379 v.Aux = symToAux(mergeSym(sym1, sym2))
3380 v.AddArg2(ptr, mem)
3381 return true
3382 }
3383 return false
3384 }
3385 func rewriteValueMIPS64_OpMIPS64MOVFstore(v *Value) bool {
3386 v_2 := v.Args[2]
3387 v_1 := v.Args[1]
3388 v_0 := v.Args[0]
3389 b := v.Block
3390 config := b.Func.Config
3391 // match: (MOVFstore [off] {sym} ptr (MOVWgpfp val) mem)
3392 // result: (MOVWstore [off] {sym} ptr val mem)
3393 for {
3394 off := auxIntToInt32(v.AuxInt)
3395 sym := auxToSym(v.Aux)
3396 ptr := v_0
3397 if v_1.Op != OpMIPS64MOVWgpfp {
3398 break
3399 }
3400 val := v_1.Args[0]
3401 mem := v_2
3402 v.reset(OpMIPS64MOVWstore)
3403 v.AuxInt = int32ToAuxInt(off)
3404 v.Aux = symToAux(sym)
3405 v.AddArg3(ptr, val, mem)
3406 return true
3407 }
3408 // match: (MOVFstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
3409 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3410 // result: (MOVFstore [off1+int32(off2)] {sym} ptr val mem)
3411 for {
3412 off1 := auxIntToInt32(v.AuxInt)
3413 sym := auxToSym(v.Aux)
3414 if v_0.Op != OpMIPS64ADDVconst {
3415 break
3416 }
3417 off2 := auxIntToInt64(v_0.AuxInt)
3418 ptr := v_0.Args[0]
3419 val := v_1
3420 mem := v_2
3421 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3422 break
3423 }
3424 v.reset(OpMIPS64MOVFstore)
3425 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3426 v.Aux = symToAux(sym)
3427 v.AddArg3(ptr, val, mem)
3428 return true
3429 }
3430 // match: (MOVFstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
3431 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3432 // result: (MOVFstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
3433 for {
3434 off1 := auxIntToInt32(v.AuxInt)
3435 sym1 := auxToSym(v.Aux)
3436 if v_0.Op != OpMIPS64MOVVaddr {
3437 break
3438 }
3439 off2 := auxIntToInt32(v_0.AuxInt)
3440 sym2 := auxToSym(v_0.Aux)
3441 ptr := v_0.Args[0]
3442 val := v_1
3443 mem := v_2
3444 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3445 break
3446 }
3447 v.reset(OpMIPS64MOVFstore)
3448 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3449 v.Aux = symToAux(mergeSym(sym1, sym2))
3450 v.AddArg3(ptr, val, mem)
3451 return true
3452 }
3453 return false
3454 }
3455 func rewriteValueMIPS64_OpMIPS64MOVHUload(v *Value) bool {
3456 v_1 := v.Args[1]
3457 v_0 := v.Args[0]
3458 b := v.Block
3459 config := b.Func.Config
3460 // match: (MOVHUload [off1] {sym} (ADDVconst [off2] ptr) mem)
3461 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3462 // result: (MOVHUload [off1+int32(off2)] {sym} ptr mem)
3463 for {
3464 off1 := auxIntToInt32(v.AuxInt)
3465 sym := auxToSym(v.Aux)
3466 if v_0.Op != OpMIPS64ADDVconst {
3467 break
3468 }
3469 off2 := auxIntToInt64(v_0.AuxInt)
3470 ptr := v_0.Args[0]
3471 mem := v_1
3472 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3473 break
3474 }
3475 v.reset(OpMIPS64MOVHUload)
3476 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3477 v.Aux = symToAux(sym)
3478 v.AddArg2(ptr, mem)
3479 return true
3480 }
3481 // match: (MOVHUload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
3482 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3483 // result: (MOVHUload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
3484 for {
3485 off1 := auxIntToInt32(v.AuxInt)
3486 sym1 := auxToSym(v.Aux)
3487 if v_0.Op != OpMIPS64MOVVaddr {
3488 break
3489 }
3490 off2 := auxIntToInt32(v_0.AuxInt)
3491 sym2 := auxToSym(v_0.Aux)
3492 ptr := v_0.Args[0]
3493 mem := v_1
3494 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3495 break
3496 }
3497 v.reset(OpMIPS64MOVHUload)
3498 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3499 v.Aux = symToAux(mergeSym(sym1, sym2))
3500 v.AddArg2(ptr, mem)
3501 return true
3502 }
3503 // match: (MOVHUload [off] {sym} (SB) _)
3504 // cond: symIsRO(sym)
3505 // result: (MOVVconst [int64(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))])
3506 for {
3507 off := auxIntToInt32(v.AuxInt)
3508 sym := auxToSym(v.Aux)
3509 if v_0.Op != OpSB || !(symIsRO(sym)) {
3510 break
3511 }
3512 v.reset(OpMIPS64MOVVconst)
3513 v.AuxInt = int64ToAuxInt(int64(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))
3514 return true
3515 }
3516 return false
3517 }
3518 func rewriteValueMIPS64_OpMIPS64MOVHUreg(v *Value) bool {
3519 v_0 := v.Args[0]
3520 // match: (MOVHUreg x:(MOVBUload _ _))
3521 // result: (MOVVreg x)
3522 for {
3523 x := v_0
3524 if x.Op != OpMIPS64MOVBUload {
3525 break
3526 }
3527 v.reset(OpMIPS64MOVVreg)
3528 v.AddArg(x)
3529 return true
3530 }
3531 // match: (MOVHUreg x:(MOVHUload _ _))
3532 // result: (MOVVreg x)
3533 for {
3534 x := v_0
3535 if x.Op != OpMIPS64MOVHUload {
3536 break
3537 }
3538 v.reset(OpMIPS64MOVVreg)
3539 v.AddArg(x)
3540 return true
3541 }
3542 // match: (MOVHUreg x:(MOVBUreg _))
3543 // result: (MOVVreg x)
3544 for {
3545 x := v_0
3546 if x.Op != OpMIPS64MOVBUreg {
3547 break
3548 }
3549 v.reset(OpMIPS64MOVVreg)
3550 v.AddArg(x)
3551 return true
3552 }
3553 // match: (MOVHUreg x:(MOVHUreg _))
3554 // result: (MOVVreg x)
3555 for {
3556 x := v_0
3557 if x.Op != OpMIPS64MOVHUreg {
3558 break
3559 }
3560 v.reset(OpMIPS64MOVVreg)
3561 v.AddArg(x)
3562 return true
3563 }
3564 // match: (MOVHUreg (MOVVconst [c]))
3565 // result: (MOVVconst [int64(uint16(c))])
3566 for {
3567 if v_0.Op != OpMIPS64MOVVconst {
3568 break
3569 }
3570 c := auxIntToInt64(v_0.AuxInt)
3571 v.reset(OpMIPS64MOVVconst)
3572 v.AuxInt = int64ToAuxInt(int64(uint16(c)))
3573 return true
3574 }
3575 return false
3576 }
3577 func rewriteValueMIPS64_OpMIPS64MOVHload(v *Value) bool {
3578 v_1 := v.Args[1]
3579 v_0 := v.Args[0]
3580 b := v.Block
3581 config := b.Func.Config
3582 // match: (MOVHload [off1] {sym} (ADDVconst [off2] ptr) mem)
3583 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3584 // result: (MOVHload [off1+int32(off2)] {sym} ptr mem)
3585 for {
3586 off1 := auxIntToInt32(v.AuxInt)
3587 sym := auxToSym(v.Aux)
3588 if v_0.Op != OpMIPS64ADDVconst {
3589 break
3590 }
3591 off2 := auxIntToInt64(v_0.AuxInt)
3592 ptr := v_0.Args[0]
3593 mem := v_1
3594 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3595 break
3596 }
3597 v.reset(OpMIPS64MOVHload)
3598 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3599 v.Aux = symToAux(sym)
3600 v.AddArg2(ptr, mem)
3601 return true
3602 }
3603 // match: (MOVHload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
3604 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3605 // result: (MOVHload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
3606 for {
3607 off1 := auxIntToInt32(v.AuxInt)
3608 sym1 := auxToSym(v.Aux)
3609 if v_0.Op != OpMIPS64MOVVaddr {
3610 break
3611 }
3612 off2 := auxIntToInt32(v_0.AuxInt)
3613 sym2 := auxToSym(v_0.Aux)
3614 ptr := v_0.Args[0]
3615 mem := v_1
3616 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3617 break
3618 }
3619 v.reset(OpMIPS64MOVHload)
3620 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3621 v.Aux = symToAux(mergeSym(sym1, sym2))
3622 v.AddArg2(ptr, mem)
3623 return true
3624 }
3625 // match: (MOVHload [off] {sym} (SB) _)
3626 // cond: symIsRO(sym)
3627 // result: (MOVVconst [int64(int16(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))])
3628 for {
3629 off := auxIntToInt32(v.AuxInt)
3630 sym := auxToSym(v.Aux)
3631 if v_0.Op != OpSB || !(symIsRO(sym)) {
3632 break
3633 }
3634 v.reset(OpMIPS64MOVVconst)
3635 v.AuxInt = int64ToAuxInt(int64(int16(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))))
3636 return true
3637 }
3638 return false
3639 }
3640 func rewriteValueMIPS64_OpMIPS64MOVHreg(v *Value) bool {
3641 v_0 := v.Args[0]
3642 // match: (MOVHreg x:(MOVBload _ _))
3643 // result: (MOVVreg x)
3644 for {
3645 x := v_0
3646 if x.Op != OpMIPS64MOVBload {
3647 break
3648 }
3649 v.reset(OpMIPS64MOVVreg)
3650 v.AddArg(x)
3651 return true
3652 }
3653 // match: (MOVHreg x:(MOVBUload _ _))
3654 // result: (MOVVreg x)
3655 for {
3656 x := v_0
3657 if x.Op != OpMIPS64MOVBUload {
3658 break
3659 }
3660 v.reset(OpMIPS64MOVVreg)
3661 v.AddArg(x)
3662 return true
3663 }
3664 // match: (MOVHreg x:(MOVHload _ _))
3665 // result: (MOVVreg x)
3666 for {
3667 x := v_0
3668 if x.Op != OpMIPS64MOVHload {
3669 break
3670 }
3671 v.reset(OpMIPS64MOVVreg)
3672 v.AddArg(x)
3673 return true
3674 }
3675 // match: (MOVHreg x:(MOVBreg _))
3676 // result: (MOVVreg x)
3677 for {
3678 x := v_0
3679 if x.Op != OpMIPS64MOVBreg {
3680 break
3681 }
3682 v.reset(OpMIPS64MOVVreg)
3683 v.AddArg(x)
3684 return true
3685 }
3686 // match: (MOVHreg x:(MOVBUreg _))
3687 // result: (MOVVreg x)
3688 for {
3689 x := v_0
3690 if x.Op != OpMIPS64MOVBUreg {
3691 break
3692 }
3693 v.reset(OpMIPS64MOVVreg)
3694 v.AddArg(x)
3695 return true
3696 }
3697 // match: (MOVHreg x:(MOVHreg _))
3698 // result: (MOVVreg x)
3699 for {
3700 x := v_0
3701 if x.Op != OpMIPS64MOVHreg {
3702 break
3703 }
3704 v.reset(OpMIPS64MOVVreg)
3705 v.AddArg(x)
3706 return true
3707 }
3708 // match: (MOVHreg (MOVVconst [c]))
3709 // result: (MOVVconst [int64(int16(c))])
3710 for {
3711 if v_0.Op != OpMIPS64MOVVconst {
3712 break
3713 }
3714 c := auxIntToInt64(v_0.AuxInt)
3715 v.reset(OpMIPS64MOVVconst)
3716 v.AuxInt = int64ToAuxInt(int64(int16(c)))
3717 return true
3718 }
3719 return false
3720 }
3721 func rewriteValueMIPS64_OpMIPS64MOVHstore(v *Value) bool {
3722 v_2 := v.Args[2]
3723 v_1 := v.Args[1]
3724 v_0 := v.Args[0]
3725 b := v.Block
3726 config := b.Func.Config
3727 // match: (MOVHstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
3728 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3729 // result: (MOVHstore [off1+int32(off2)] {sym} ptr val mem)
3730 for {
3731 off1 := auxIntToInt32(v.AuxInt)
3732 sym := auxToSym(v.Aux)
3733 if v_0.Op != OpMIPS64ADDVconst {
3734 break
3735 }
3736 off2 := auxIntToInt64(v_0.AuxInt)
3737 ptr := v_0.Args[0]
3738 val := v_1
3739 mem := v_2
3740 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3741 break
3742 }
3743 v.reset(OpMIPS64MOVHstore)
3744 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3745 v.Aux = symToAux(sym)
3746 v.AddArg3(ptr, val, mem)
3747 return true
3748 }
3749 // match: (MOVHstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
3750 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3751 // result: (MOVHstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
3752 for {
3753 off1 := auxIntToInt32(v.AuxInt)
3754 sym1 := auxToSym(v.Aux)
3755 if v_0.Op != OpMIPS64MOVVaddr {
3756 break
3757 }
3758 off2 := auxIntToInt32(v_0.AuxInt)
3759 sym2 := auxToSym(v_0.Aux)
3760 ptr := v_0.Args[0]
3761 val := v_1
3762 mem := v_2
3763 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3764 break
3765 }
3766 v.reset(OpMIPS64MOVHstore)
3767 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3768 v.Aux = symToAux(mergeSym(sym1, sym2))
3769 v.AddArg3(ptr, val, mem)
3770 return true
3771 }
3772 // match: (MOVHstore [off] {sym} ptr (MOVVconst [0]) mem)
3773 // result: (MOVHstorezero [off] {sym} ptr mem)
3774 for {
3775 off := auxIntToInt32(v.AuxInt)
3776 sym := auxToSym(v.Aux)
3777 ptr := v_0
3778 if v_1.Op != OpMIPS64MOVVconst || auxIntToInt64(v_1.AuxInt) != 0 {
3779 break
3780 }
3781 mem := v_2
3782 v.reset(OpMIPS64MOVHstorezero)
3783 v.AuxInt = int32ToAuxInt(off)
3784 v.Aux = symToAux(sym)
3785 v.AddArg2(ptr, mem)
3786 return true
3787 }
3788 // match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
3789 // result: (MOVHstore [off] {sym} ptr x mem)
3790 for {
3791 off := auxIntToInt32(v.AuxInt)
3792 sym := auxToSym(v.Aux)
3793 ptr := v_0
3794 if v_1.Op != OpMIPS64MOVHreg {
3795 break
3796 }
3797 x := v_1.Args[0]
3798 mem := v_2
3799 v.reset(OpMIPS64MOVHstore)
3800 v.AuxInt = int32ToAuxInt(off)
3801 v.Aux = symToAux(sym)
3802 v.AddArg3(ptr, x, mem)
3803 return true
3804 }
3805 // match: (MOVHstore [off] {sym} ptr (MOVHUreg x) mem)
3806 // result: (MOVHstore [off] {sym} ptr x mem)
3807 for {
3808 off := auxIntToInt32(v.AuxInt)
3809 sym := auxToSym(v.Aux)
3810 ptr := v_0
3811 if v_1.Op != OpMIPS64MOVHUreg {
3812 break
3813 }
3814 x := v_1.Args[0]
3815 mem := v_2
3816 v.reset(OpMIPS64MOVHstore)
3817 v.AuxInt = int32ToAuxInt(off)
3818 v.Aux = symToAux(sym)
3819 v.AddArg3(ptr, x, mem)
3820 return true
3821 }
3822 // match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
3823 // result: (MOVHstore [off] {sym} ptr x mem)
3824 for {
3825 off := auxIntToInt32(v.AuxInt)
3826 sym := auxToSym(v.Aux)
3827 ptr := v_0
3828 if v_1.Op != OpMIPS64MOVWreg {
3829 break
3830 }
3831 x := v_1.Args[0]
3832 mem := v_2
3833 v.reset(OpMIPS64MOVHstore)
3834 v.AuxInt = int32ToAuxInt(off)
3835 v.Aux = symToAux(sym)
3836 v.AddArg3(ptr, x, mem)
3837 return true
3838 }
3839 // match: (MOVHstore [off] {sym} ptr (MOVWUreg x) mem)
3840 // result: (MOVHstore [off] {sym} ptr x mem)
3841 for {
3842 off := auxIntToInt32(v.AuxInt)
3843 sym := auxToSym(v.Aux)
3844 ptr := v_0
3845 if v_1.Op != OpMIPS64MOVWUreg {
3846 break
3847 }
3848 x := v_1.Args[0]
3849 mem := v_2
3850 v.reset(OpMIPS64MOVHstore)
3851 v.AuxInt = int32ToAuxInt(off)
3852 v.Aux = symToAux(sym)
3853 v.AddArg3(ptr, x, mem)
3854 return true
3855 }
3856 return false
3857 }
3858 func rewriteValueMIPS64_OpMIPS64MOVHstorezero(v *Value) bool {
3859 v_1 := v.Args[1]
3860 v_0 := v.Args[0]
3861 b := v.Block
3862 config := b.Func.Config
3863 // match: (MOVHstorezero [off1] {sym} (ADDVconst [off2] ptr) mem)
3864 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3865 // result: (MOVHstorezero [off1+int32(off2)] {sym} ptr mem)
3866 for {
3867 off1 := auxIntToInt32(v.AuxInt)
3868 sym := auxToSym(v.Aux)
3869 if v_0.Op != OpMIPS64ADDVconst {
3870 break
3871 }
3872 off2 := auxIntToInt64(v_0.AuxInt)
3873 ptr := v_0.Args[0]
3874 mem := v_1
3875 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3876 break
3877 }
3878 v.reset(OpMIPS64MOVHstorezero)
3879 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3880 v.Aux = symToAux(sym)
3881 v.AddArg2(ptr, mem)
3882 return true
3883 }
3884 // match: (MOVHstorezero [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
3885 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3886 // result: (MOVHstorezero [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
3887 for {
3888 off1 := auxIntToInt32(v.AuxInt)
3889 sym1 := auxToSym(v.Aux)
3890 if v_0.Op != OpMIPS64MOVVaddr {
3891 break
3892 }
3893 off2 := auxIntToInt32(v_0.AuxInt)
3894 sym2 := auxToSym(v_0.Aux)
3895 ptr := v_0.Args[0]
3896 mem := v_1
3897 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3898 break
3899 }
3900 v.reset(OpMIPS64MOVHstorezero)
3901 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3902 v.Aux = symToAux(mergeSym(sym1, sym2))
3903 v.AddArg2(ptr, mem)
3904 return true
3905 }
3906 return false
3907 }
3908 func rewriteValueMIPS64_OpMIPS64MOVVload(v *Value) bool {
3909 v_1 := v.Args[1]
3910 v_0 := v.Args[0]
3911 b := v.Block
3912 config := b.Func.Config
3913 // match: (MOVVload [off] {sym} ptr (MOVDstore [off] {sym} ptr val _))
3914 // result: (MOVVfpgp val)
3915 for {
3916 off := auxIntToInt32(v.AuxInt)
3917 sym := auxToSym(v.Aux)
3918 ptr := v_0
3919 if v_1.Op != OpMIPS64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
3920 break
3921 }
3922 val := v_1.Args[1]
3923 if ptr != v_1.Args[0] {
3924 break
3925 }
3926 v.reset(OpMIPS64MOVVfpgp)
3927 v.AddArg(val)
3928 return true
3929 }
3930 // match: (MOVVload [off1] {sym} (ADDVconst [off2] ptr) mem)
3931 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3932 // result: (MOVVload [off1+int32(off2)] {sym} ptr mem)
3933 for {
3934 off1 := auxIntToInt32(v.AuxInt)
3935 sym := auxToSym(v.Aux)
3936 if v_0.Op != OpMIPS64ADDVconst {
3937 break
3938 }
3939 off2 := auxIntToInt64(v_0.AuxInt)
3940 ptr := v_0.Args[0]
3941 mem := v_1
3942 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3943 break
3944 }
3945 v.reset(OpMIPS64MOVVload)
3946 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3947 v.Aux = symToAux(sym)
3948 v.AddArg2(ptr, mem)
3949 return true
3950 }
3951 // match: (MOVVload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
3952 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
3953 // result: (MOVVload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
3954 for {
3955 off1 := auxIntToInt32(v.AuxInt)
3956 sym1 := auxToSym(v.Aux)
3957 if v_0.Op != OpMIPS64MOVVaddr {
3958 break
3959 }
3960 off2 := auxIntToInt32(v_0.AuxInt)
3961 sym2 := auxToSym(v_0.Aux)
3962 ptr := v_0.Args[0]
3963 mem := v_1
3964 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
3965 break
3966 }
3967 v.reset(OpMIPS64MOVVload)
3968 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
3969 v.Aux = symToAux(mergeSym(sym1, sym2))
3970 v.AddArg2(ptr, mem)
3971 return true
3972 }
3973 // match: (MOVVload [off] {sym} (SB) _)
3974 // cond: symIsRO(sym)
3975 // result: (MOVVconst [int64(read64(sym, int64(off), config.ctxt.Arch.ByteOrder))])
3976 for {
3977 off := auxIntToInt32(v.AuxInt)
3978 sym := auxToSym(v.Aux)
3979 if v_0.Op != OpSB || !(symIsRO(sym)) {
3980 break
3981 }
3982 v.reset(OpMIPS64MOVVconst)
3983 v.AuxInt = int64ToAuxInt(int64(read64(sym, int64(off), config.ctxt.Arch.ByteOrder)))
3984 return true
3985 }
3986 return false
3987 }
3988 func rewriteValueMIPS64_OpMIPS64MOVVnop(v *Value) bool {
3989 v_0 := v.Args[0]
3990 // match: (MOVVnop (MOVVconst [c]))
3991 // result: (MOVVconst [c])
3992 for {
3993 if v_0.Op != OpMIPS64MOVVconst {
3994 break
3995 }
3996 c := auxIntToInt64(v_0.AuxInt)
3997 v.reset(OpMIPS64MOVVconst)
3998 v.AuxInt = int64ToAuxInt(c)
3999 return true
4000 }
4001 return false
4002 }
4003 func rewriteValueMIPS64_OpMIPS64MOVVreg(v *Value) bool {
4004 v_0 := v.Args[0]
4005 // match: (MOVVreg x)
4006 // cond: x.Uses == 1
4007 // result: (MOVVnop x)
4008 for {
4009 x := v_0
4010 if !(x.Uses == 1) {
4011 break
4012 }
4013 v.reset(OpMIPS64MOVVnop)
4014 v.AddArg(x)
4015 return true
4016 }
4017 // match: (MOVVreg (MOVVconst [c]))
4018 // result: (MOVVconst [c])
4019 for {
4020 if v_0.Op != OpMIPS64MOVVconst {
4021 break
4022 }
4023 c := auxIntToInt64(v_0.AuxInt)
4024 v.reset(OpMIPS64MOVVconst)
4025 v.AuxInt = int64ToAuxInt(c)
4026 return true
4027 }
4028 return false
4029 }
4030 func rewriteValueMIPS64_OpMIPS64MOVVstore(v *Value) bool {
4031 v_2 := v.Args[2]
4032 v_1 := v.Args[1]
4033 v_0 := v.Args[0]
4034 b := v.Block
4035 config := b.Func.Config
4036 // match: (MOVVstore [off] {sym} ptr (MOVVfpgp val) mem)
4037 // result: (MOVDstore [off] {sym} ptr val mem)
4038 for {
4039 off := auxIntToInt32(v.AuxInt)
4040 sym := auxToSym(v.Aux)
4041 ptr := v_0
4042 if v_1.Op != OpMIPS64MOVVfpgp {
4043 break
4044 }
4045 val := v_1.Args[0]
4046 mem := v_2
4047 v.reset(OpMIPS64MOVDstore)
4048 v.AuxInt = int32ToAuxInt(off)
4049 v.Aux = symToAux(sym)
4050 v.AddArg3(ptr, val, mem)
4051 return true
4052 }
4053 // match: (MOVVstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
4054 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
4055 // result: (MOVVstore [off1+int32(off2)] {sym} ptr val mem)
4056 for {
4057 off1 := auxIntToInt32(v.AuxInt)
4058 sym := auxToSym(v.Aux)
4059 if v_0.Op != OpMIPS64ADDVconst {
4060 break
4061 }
4062 off2 := auxIntToInt64(v_0.AuxInt)
4063 ptr := v_0.Args[0]
4064 val := v_1
4065 mem := v_2
4066 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4067 break
4068 }
4069 v.reset(OpMIPS64MOVVstore)
4070 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
4071 v.Aux = symToAux(sym)
4072 v.AddArg3(ptr, val, mem)
4073 return true
4074 }
4075 // match: (MOVVstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
4076 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
4077 // result: (MOVVstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
4078 for {
4079 off1 := auxIntToInt32(v.AuxInt)
4080 sym1 := auxToSym(v.Aux)
4081 if v_0.Op != OpMIPS64MOVVaddr {
4082 break
4083 }
4084 off2 := auxIntToInt32(v_0.AuxInt)
4085 sym2 := auxToSym(v_0.Aux)
4086 ptr := v_0.Args[0]
4087 val := v_1
4088 mem := v_2
4089 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4090 break
4091 }
4092 v.reset(OpMIPS64MOVVstore)
4093 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
4094 v.Aux = symToAux(mergeSym(sym1, sym2))
4095 v.AddArg3(ptr, val, mem)
4096 return true
4097 }
4098 // match: (MOVVstore [off] {sym} ptr (MOVVconst [0]) mem)
4099 // result: (MOVVstorezero [off] {sym} ptr mem)
4100 for {
4101 off := auxIntToInt32(v.AuxInt)
4102 sym := auxToSym(v.Aux)
4103 ptr := v_0
4104 if v_1.Op != OpMIPS64MOVVconst || auxIntToInt64(v_1.AuxInt) != 0 {
4105 break
4106 }
4107 mem := v_2
4108 v.reset(OpMIPS64MOVVstorezero)
4109 v.AuxInt = int32ToAuxInt(off)
4110 v.Aux = symToAux(sym)
4111 v.AddArg2(ptr, mem)
4112 return true
4113 }
4114 return false
4115 }
4116 func rewriteValueMIPS64_OpMIPS64MOVVstorezero(v *Value) bool {
4117 v_1 := v.Args[1]
4118 v_0 := v.Args[0]
4119 b := v.Block
4120 config := b.Func.Config
4121 // match: (MOVVstorezero [off1] {sym} (ADDVconst [off2] ptr) mem)
4122 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
4123 // result: (MOVVstorezero [off1+int32(off2)] {sym} ptr mem)
4124 for {
4125 off1 := auxIntToInt32(v.AuxInt)
4126 sym := auxToSym(v.Aux)
4127 if v_0.Op != OpMIPS64ADDVconst {
4128 break
4129 }
4130 off2 := auxIntToInt64(v_0.AuxInt)
4131 ptr := v_0.Args[0]
4132 mem := v_1
4133 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4134 break
4135 }
4136 v.reset(OpMIPS64MOVVstorezero)
4137 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
4138 v.Aux = symToAux(sym)
4139 v.AddArg2(ptr, mem)
4140 return true
4141 }
4142 // match: (MOVVstorezero [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
4143 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
4144 // result: (MOVVstorezero [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
4145 for {
4146 off1 := auxIntToInt32(v.AuxInt)
4147 sym1 := auxToSym(v.Aux)
4148 if v_0.Op != OpMIPS64MOVVaddr {
4149 break
4150 }
4151 off2 := auxIntToInt32(v_0.AuxInt)
4152 sym2 := auxToSym(v_0.Aux)
4153 ptr := v_0.Args[0]
4154 mem := v_1
4155 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4156 break
4157 }
4158 v.reset(OpMIPS64MOVVstorezero)
4159 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
4160 v.Aux = symToAux(mergeSym(sym1, sym2))
4161 v.AddArg2(ptr, mem)
4162 return true
4163 }
4164 return false
4165 }
4166 func rewriteValueMIPS64_OpMIPS64MOVWUload(v *Value) bool {
4167 v_1 := v.Args[1]
4168 v_0 := v.Args[0]
4169 b := v.Block
4170 config := b.Func.Config
4171 typ := &b.Func.Config.Types
4172 // match: (MOVWUload [off] {sym} ptr (MOVFstore [off] {sym} ptr val _))
4173 // result: (ZeroExt32to64 (MOVWfpgp <typ.Float32> val))
4174 for {
4175 off := auxIntToInt32(v.AuxInt)
4176 sym := auxToSym(v.Aux)
4177 ptr := v_0
4178 if v_1.Op != OpMIPS64MOVFstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
4179 break
4180 }
4181 val := v_1.Args[1]
4182 if ptr != v_1.Args[0] {
4183 break
4184 }
4185 v.reset(OpZeroExt32to64)
4186 v0 := b.NewValue0(v_1.Pos, OpMIPS64MOVWfpgp, typ.Float32)
4187 v0.AddArg(val)
4188 v.AddArg(v0)
4189 return true
4190 }
4191 // match: (MOVWUload [off1] {sym} (ADDVconst [off2] ptr) mem)
4192 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
4193 // result: (MOVWUload [off1+int32(off2)] {sym} ptr mem)
4194 for {
4195 off1 := auxIntToInt32(v.AuxInt)
4196 sym := auxToSym(v.Aux)
4197 if v_0.Op != OpMIPS64ADDVconst {
4198 break
4199 }
4200 off2 := auxIntToInt64(v_0.AuxInt)
4201 ptr := v_0.Args[0]
4202 mem := v_1
4203 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4204 break
4205 }
4206 v.reset(OpMIPS64MOVWUload)
4207 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
4208 v.Aux = symToAux(sym)
4209 v.AddArg2(ptr, mem)
4210 return true
4211 }
4212 // match: (MOVWUload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
4213 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
4214 // result: (MOVWUload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
4215 for {
4216 off1 := auxIntToInt32(v.AuxInt)
4217 sym1 := auxToSym(v.Aux)
4218 if v_0.Op != OpMIPS64MOVVaddr {
4219 break
4220 }
4221 off2 := auxIntToInt32(v_0.AuxInt)
4222 sym2 := auxToSym(v_0.Aux)
4223 ptr := v_0.Args[0]
4224 mem := v_1
4225 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4226 break
4227 }
4228 v.reset(OpMIPS64MOVWUload)
4229 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
4230 v.Aux = symToAux(mergeSym(sym1, sym2))
4231 v.AddArg2(ptr, mem)
4232 return true
4233 }
4234 // match: (MOVWUload [off] {sym} (SB) _)
4235 // cond: symIsRO(sym)
4236 // result: (MOVVconst [int64(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))])
4237 for {
4238 off := auxIntToInt32(v.AuxInt)
4239 sym := auxToSym(v.Aux)
4240 if v_0.Op != OpSB || !(symIsRO(sym)) {
4241 break
4242 }
4243 v.reset(OpMIPS64MOVVconst)
4244 v.AuxInt = int64ToAuxInt(int64(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))
4245 return true
4246 }
4247 return false
4248 }
4249 func rewriteValueMIPS64_OpMIPS64MOVWUreg(v *Value) bool {
4250 v_0 := v.Args[0]
4251 // match: (MOVWUreg x:(MOVBUload _ _))
4252 // result: (MOVVreg x)
4253 for {
4254 x := v_0
4255 if x.Op != OpMIPS64MOVBUload {
4256 break
4257 }
4258 v.reset(OpMIPS64MOVVreg)
4259 v.AddArg(x)
4260 return true
4261 }
4262 // match: (MOVWUreg x:(MOVHUload _ _))
4263 // result: (MOVVreg x)
4264 for {
4265 x := v_0
4266 if x.Op != OpMIPS64MOVHUload {
4267 break
4268 }
4269 v.reset(OpMIPS64MOVVreg)
4270 v.AddArg(x)
4271 return true
4272 }
4273 // match: (MOVWUreg x:(MOVWUload _ _))
4274 // result: (MOVVreg x)
4275 for {
4276 x := v_0
4277 if x.Op != OpMIPS64MOVWUload {
4278 break
4279 }
4280 v.reset(OpMIPS64MOVVreg)
4281 v.AddArg(x)
4282 return true
4283 }
4284 // match: (MOVWUreg x:(MOVBUreg _))
4285 // result: (MOVVreg x)
4286 for {
4287 x := v_0
4288 if x.Op != OpMIPS64MOVBUreg {
4289 break
4290 }
4291 v.reset(OpMIPS64MOVVreg)
4292 v.AddArg(x)
4293 return true
4294 }
4295 // match: (MOVWUreg x:(MOVHUreg _))
4296 // result: (MOVVreg x)
4297 for {
4298 x := v_0
4299 if x.Op != OpMIPS64MOVHUreg {
4300 break
4301 }
4302 v.reset(OpMIPS64MOVVreg)
4303 v.AddArg(x)
4304 return true
4305 }
4306 // match: (MOVWUreg x:(MOVWUreg _))
4307 // result: (MOVVreg x)
4308 for {
4309 x := v_0
4310 if x.Op != OpMIPS64MOVWUreg {
4311 break
4312 }
4313 v.reset(OpMIPS64MOVVreg)
4314 v.AddArg(x)
4315 return true
4316 }
4317 // match: (MOVWUreg (MOVVconst [c]))
4318 // result: (MOVVconst [int64(uint32(c))])
4319 for {
4320 if v_0.Op != OpMIPS64MOVVconst {
4321 break
4322 }
4323 c := auxIntToInt64(v_0.AuxInt)
4324 v.reset(OpMIPS64MOVVconst)
4325 v.AuxInt = int64ToAuxInt(int64(uint32(c)))
4326 return true
4327 }
4328 return false
4329 }
4330 func rewriteValueMIPS64_OpMIPS64MOVWload(v *Value) bool {
4331 v_1 := v.Args[1]
4332 v_0 := v.Args[0]
4333 b := v.Block
4334 config := b.Func.Config
4335 // match: (MOVWload [off1] {sym} (ADDVconst [off2] ptr) mem)
4336 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
4337 // result: (MOVWload [off1+int32(off2)] {sym} ptr mem)
4338 for {
4339 off1 := auxIntToInt32(v.AuxInt)
4340 sym := auxToSym(v.Aux)
4341 if v_0.Op != OpMIPS64ADDVconst {
4342 break
4343 }
4344 off2 := auxIntToInt64(v_0.AuxInt)
4345 ptr := v_0.Args[0]
4346 mem := v_1
4347 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4348 break
4349 }
4350 v.reset(OpMIPS64MOVWload)
4351 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
4352 v.Aux = symToAux(sym)
4353 v.AddArg2(ptr, mem)
4354 return true
4355 }
4356 // match: (MOVWload [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
4357 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
4358 // result: (MOVWload [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
4359 for {
4360 off1 := auxIntToInt32(v.AuxInt)
4361 sym1 := auxToSym(v.Aux)
4362 if v_0.Op != OpMIPS64MOVVaddr {
4363 break
4364 }
4365 off2 := auxIntToInt32(v_0.AuxInt)
4366 sym2 := auxToSym(v_0.Aux)
4367 ptr := v_0.Args[0]
4368 mem := v_1
4369 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4370 break
4371 }
4372 v.reset(OpMIPS64MOVWload)
4373 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
4374 v.Aux = symToAux(mergeSym(sym1, sym2))
4375 v.AddArg2(ptr, mem)
4376 return true
4377 }
4378 // match: (MOVWload [off] {sym} (SB) _)
4379 // cond: symIsRO(sym)
4380 // result: (MOVVconst [int64(int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))])
4381 for {
4382 off := auxIntToInt32(v.AuxInt)
4383 sym := auxToSym(v.Aux)
4384 if v_0.Op != OpSB || !(symIsRO(sym)) {
4385 break
4386 }
4387 v.reset(OpMIPS64MOVVconst)
4388 v.AuxInt = int64ToAuxInt(int64(int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))))
4389 return true
4390 }
4391 return false
4392 }
4393 func rewriteValueMIPS64_OpMIPS64MOVWreg(v *Value) bool {
4394 v_0 := v.Args[0]
4395 // match: (MOVWreg x:(MOVBload _ _))
4396 // result: (MOVVreg x)
4397 for {
4398 x := v_0
4399 if x.Op != OpMIPS64MOVBload {
4400 break
4401 }
4402 v.reset(OpMIPS64MOVVreg)
4403 v.AddArg(x)
4404 return true
4405 }
4406 // match: (MOVWreg x:(MOVBUload _ _))
4407 // result: (MOVVreg x)
4408 for {
4409 x := v_0
4410 if x.Op != OpMIPS64MOVBUload {
4411 break
4412 }
4413 v.reset(OpMIPS64MOVVreg)
4414 v.AddArg(x)
4415 return true
4416 }
4417 // match: (MOVWreg x:(MOVHload _ _))
4418 // result: (MOVVreg x)
4419 for {
4420 x := v_0
4421 if x.Op != OpMIPS64MOVHload {
4422 break
4423 }
4424 v.reset(OpMIPS64MOVVreg)
4425 v.AddArg(x)
4426 return true
4427 }
4428 // match: (MOVWreg x:(MOVHUload _ _))
4429 // result: (MOVVreg x)
4430 for {
4431 x := v_0
4432 if x.Op != OpMIPS64MOVHUload {
4433 break
4434 }
4435 v.reset(OpMIPS64MOVVreg)
4436 v.AddArg(x)
4437 return true
4438 }
4439 // match: (MOVWreg x:(MOVWload _ _))
4440 // result: (MOVVreg x)
4441 for {
4442 x := v_0
4443 if x.Op != OpMIPS64MOVWload {
4444 break
4445 }
4446 v.reset(OpMIPS64MOVVreg)
4447 v.AddArg(x)
4448 return true
4449 }
4450 // match: (MOVWreg x:(MOVBreg _))
4451 // result: (MOVVreg x)
4452 for {
4453 x := v_0
4454 if x.Op != OpMIPS64MOVBreg {
4455 break
4456 }
4457 v.reset(OpMIPS64MOVVreg)
4458 v.AddArg(x)
4459 return true
4460 }
4461 // match: (MOVWreg x:(MOVBUreg _))
4462 // result: (MOVVreg x)
4463 for {
4464 x := v_0
4465 if x.Op != OpMIPS64MOVBUreg {
4466 break
4467 }
4468 v.reset(OpMIPS64MOVVreg)
4469 v.AddArg(x)
4470 return true
4471 }
4472 // match: (MOVWreg x:(MOVHreg _))
4473 // result: (MOVVreg x)
4474 for {
4475 x := v_0
4476 if x.Op != OpMIPS64MOVHreg {
4477 break
4478 }
4479 v.reset(OpMIPS64MOVVreg)
4480 v.AddArg(x)
4481 return true
4482 }
4483 // match: (MOVWreg x:(MOVWreg _))
4484 // result: (MOVVreg x)
4485 for {
4486 x := v_0
4487 if x.Op != OpMIPS64MOVWreg {
4488 break
4489 }
4490 v.reset(OpMIPS64MOVVreg)
4491 v.AddArg(x)
4492 return true
4493 }
4494 // match: (MOVWreg (MOVVconst [c]))
4495 // result: (MOVVconst [int64(int32(c))])
4496 for {
4497 if v_0.Op != OpMIPS64MOVVconst {
4498 break
4499 }
4500 c := auxIntToInt64(v_0.AuxInt)
4501 v.reset(OpMIPS64MOVVconst)
4502 v.AuxInt = int64ToAuxInt(int64(int32(c)))
4503 return true
4504 }
4505 return false
4506 }
4507 func rewriteValueMIPS64_OpMIPS64MOVWstore(v *Value) bool {
4508 v_2 := v.Args[2]
4509 v_1 := v.Args[1]
4510 v_0 := v.Args[0]
4511 b := v.Block
4512 config := b.Func.Config
4513 // match: (MOVWstore [off] {sym} ptr (MOVWfpgp val) mem)
4514 // result: (MOVFstore [off] {sym} ptr val mem)
4515 for {
4516 off := auxIntToInt32(v.AuxInt)
4517 sym := auxToSym(v.Aux)
4518 ptr := v_0
4519 if v_1.Op != OpMIPS64MOVWfpgp {
4520 break
4521 }
4522 val := v_1.Args[0]
4523 mem := v_2
4524 v.reset(OpMIPS64MOVFstore)
4525 v.AuxInt = int32ToAuxInt(off)
4526 v.Aux = symToAux(sym)
4527 v.AddArg3(ptr, val, mem)
4528 return true
4529 }
4530 // match: (MOVWstore [off1] {sym} (ADDVconst [off2] ptr) val mem)
4531 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
4532 // result: (MOVWstore [off1+int32(off2)] {sym} ptr val mem)
4533 for {
4534 off1 := auxIntToInt32(v.AuxInt)
4535 sym := auxToSym(v.Aux)
4536 if v_0.Op != OpMIPS64ADDVconst {
4537 break
4538 }
4539 off2 := auxIntToInt64(v_0.AuxInt)
4540 ptr := v_0.Args[0]
4541 val := v_1
4542 mem := v_2
4543 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4544 break
4545 }
4546 v.reset(OpMIPS64MOVWstore)
4547 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
4548 v.Aux = symToAux(sym)
4549 v.AddArg3(ptr, val, mem)
4550 return true
4551 }
4552 // match: (MOVWstore [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) val mem)
4553 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
4554 // result: (MOVWstore [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr val mem)
4555 for {
4556 off1 := auxIntToInt32(v.AuxInt)
4557 sym1 := auxToSym(v.Aux)
4558 if v_0.Op != OpMIPS64MOVVaddr {
4559 break
4560 }
4561 off2 := auxIntToInt32(v_0.AuxInt)
4562 sym2 := auxToSym(v_0.Aux)
4563 ptr := v_0.Args[0]
4564 val := v_1
4565 mem := v_2
4566 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4567 break
4568 }
4569 v.reset(OpMIPS64MOVWstore)
4570 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
4571 v.Aux = symToAux(mergeSym(sym1, sym2))
4572 v.AddArg3(ptr, val, mem)
4573 return true
4574 }
4575 // match: (MOVWstore [off] {sym} ptr (MOVVconst [0]) mem)
4576 // result: (MOVWstorezero [off] {sym} ptr mem)
4577 for {
4578 off := auxIntToInt32(v.AuxInt)
4579 sym := auxToSym(v.Aux)
4580 ptr := v_0
4581 if v_1.Op != OpMIPS64MOVVconst || auxIntToInt64(v_1.AuxInt) != 0 {
4582 break
4583 }
4584 mem := v_2
4585 v.reset(OpMIPS64MOVWstorezero)
4586 v.AuxInt = int32ToAuxInt(off)
4587 v.Aux = symToAux(sym)
4588 v.AddArg2(ptr, mem)
4589 return true
4590 }
4591 // match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
4592 // result: (MOVWstore [off] {sym} ptr x mem)
4593 for {
4594 off := auxIntToInt32(v.AuxInt)
4595 sym := auxToSym(v.Aux)
4596 ptr := v_0
4597 if v_1.Op != OpMIPS64MOVWreg {
4598 break
4599 }
4600 x := v_1.Args[0]
4601 mem := v_2
4602 v.reset(OpMIPS64MOVWstore)
4603 v.AuxInt = int32ToAuxInt(off)
4604 v.Aux = symToAux(sym)
4605 v.AddArg3(ptr, x, mem)
4606 return true
4607 }
4608 // match: (MOVWstore [off] {sym} ptr (MOVWUreg x) mem)
4609 // result: (MOVWstore [off] {sym} ptr x mem)
4610 for {
4611 off := auxIntToInt32(v.AuxInt)
4612 sym := auxToSym(v.Aux)
4613 ptr := v_0
4614 if v_1.Op != OpMIPS64MOVWUreg {
4615 break
4616 }
4617 x := v_1.Args[0]
4618 mem := v_2
4619 v.reset(OpMIPS64MOVWstore)
4620 v.AuxInt = int32ToAuxInt(off)
4621 v.Aux = symToAux(sym)
4622 v.AddArg3(ptr, x, mem)
4623 return true
4624 }
4625 return false
4626 }
4627 func rewriteValueMIPS64_OpMIPS64MOVWstorezero(v *Value) bool {
4628 v_1 := v.Args[1]
4629 v_0 := v.Args[0]
4630 b := v.Block
4631 config := b.Func.Config
4632 // match: (MOVWstorezero [off1] {sym} (ADDVconst [off2] ptr) mem)
4633 // cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
4634 // result: (MOVWstorezero [off1+int32(off2)] {sym} ptr mem)
4635 for {
4636 off1 := auxIntToInt32(v.AuxInt)
4637 sym := auxToSym(v.Aux)
4638 if v_0.Op != OpMIPS64ADDVconst {
4639 break
4640 }
4641 off2 := auxIntToInt64(v_0.AuxInt)
4642 ptr := v_0.Args[0]
4643 mem := v_1
4644 if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4645 break
4646 }
4647 v.reset(OpMIPS64MOVWstorezero)
4648 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
4649 v.Aux = symToAux(sym)
4650 v.AddArg2(ptr, mem)
4651 return true
4652 }
4653 // match: (MOVWstorezero [off1] {sym1} (MOVVaddr [off2] {sym2} ptr) mem)
4654 // cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
4655 // result: (MOVWstorezero [off1+int32(off2)] {mergeSym(sym1,sym2)} ptr mem)
4656 for {
4657 off1 := auxIntToInt32(v.AuxInt)
4658 sym1 := auxToSym(v.Aux)
4659 if v_0.Op != OpMIPS64MOVVaddr {
4660 break
4661 }
4662 off2 := auxIntToInt32(v_0.AuxInt)
4663 sym2 := auxToSym(v_0.Aux)
4664 ptr := v_0.Args[0]
4665 mem := v_1
4666 if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4667 break
4668 }
4669 v.reset(OpMIPS64MOVWstorezero)
4670 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
4671 v.Aux = symToAux(mergeSym(sym1, sym2))
4672 v.AddArg2(ptr, mem)
4673 return true
4674 }
4675 return false
4676 }
4677 func rewriteValueMIPS64_OpMIPS64NEGV(v *Value) bool {
4678 v_0 := v.Args[0]
4679 // match: (NEGV (SUBV x y))
4680 // result: (SUBV y x)
4681 for {
4682 if v_0.Op != OpMIPS64SUBV {
4683 break
4684 }
4685 y := v_0.Args[1]
4686 x := v_0.Args[0]
4687 v.reset(OpMIPS64SUBV)
4688 v.AddArg2(y, x)
4689 return true
4690 }
4691 // match: (NEGV (NEGV x))
4692 // result: x
4693 for {
4694 if v_0.Op != OpMIPS64NEGV {
4695 break
4696 }
4697 x := v_0.Args[0]
4698 v.copyOf(x)
4699 return true
4700 }
4701 // match: (NEGV (MOVVconst [c]))
4702 // result: (MOVVconst [-c])
4703 for {
4704 if v_0.Op != OpMIPS64MOVVconst {
4705 break
4706 }
4707 c := auxIntToInt64(v_0.AuxInt)
4708 v.reset(OpMIPS64MOVVconst)
4709 v.AuxInt = int64ToAuxInt(-c)
4710 return true
4711 }
4712 return false
4713 }
4714 func rewriteValueMIPS64_OpMIPS64NOR(v *Value) bool {
4715 v_1 := v.Args[1]
4716 v_0 := v.Args[0]
4717 // match: (NOR x (MOVVconst [c]))
4718 // cond: is32Bit(c)
4719 // result: (NORconst [c] x)
4720 for {
4721 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4722 x := v_0
4723 if v_1.Op != OpMIPS64MOVVconst {
4724 continue
4725 }
4726 c := auxIntToInt64(v_1.AuxInt)
4727 if !(is32Bit(c)) {
4728 continue
4729 }
4730 v.reset(OpMIPS64NORconst)
4731 v.AuxInt = int64ToAuxInt(c)
4732 v.AddArg(x)
4733 return true
4734 }
4735 break
4736 }
4737 return false
4738 }
4739 func rewriteValueMIPS64_OpMIPS64NORconst(v *Value) bool {
4740 v_0 := v.Args[0]
4741 // match: (NORconst [c] (MOVVconst [d]))
4742 // result: (MOVVconst [^(c|d)])
4743 for {
4744 c := auxIntToInt64(v.AuxInt)
4745 if v_0.Op != OpMIPS64MOVVconst {
4746 break
4747 }
4748 d := auxIntToInt64(v_0.AuxInt)
4749 v.reset(OpMIPS64MOVVconst)
4750 v.AuxInt = int64ToAuxInt(^(c | d))
4751 return true
4752 }
4753 return false
4754 }
4755 func rewriteValueMIPS64_OpMIPS64OR(v *Value) bool {
4756 v_1 := v.Args[1]
4757 v_0 := v.Args[0]
4758 // match: (OR x (MOVVconst [c]))
4759 // cond: is32Bit(c)
4760 // result: (ORconst [c] x)
4761 for {
4762 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4763 x := v_0
4764 if v_1.Op != OpMIPS64MOVVconst {
4765 continue
4766 }
4767 c := auxIntToInt64(v_1.AuxInt)
4768 if !(is32Bit(c)) {
4769 continue
4770 }
4771 v.reset(OpMIPS64ORconst)
4772 v.AuxInt = int64ToAuxInt(c)
4773 v.AddArg(x)
4774 return true
4775 }
4776 break
4777 }
4778 // match: (OR x x)
4779 // result: x
4780 for {
4781 x := v_0
4782 if x != v_1 {
4783 break
4784 }
4785 v.copyOf(x)
4786 return true
4787 }
4788 return false
4789 }
4790 func rewriteValueMIPS64_OpMIPS64ORconst(v *Value) bool {
4791 v_0 := v.Args[0]
4792 // match: (ORconst [0] x)
4793 // result: x
4794 for {
4795 if auxIntToInt64(v.AuxInt) != 0 {
4796 break
4797 }
4798 x := v_0
4799 v.copyOf(x)
4800 return true
4801 }
4802 // match: (ORconst [-1] _)
4803 // result: (MOVVconst [-1])
4804 for {
4805 if auxIntToInt64(v.AuxInt) != -1 {
4806 break
4807 }
4808 v.reset(OpMIPS64MOVVconst)
4809 v.AuxInt = int64ToAuxInt(-1)
4810 return true
4811 }
4812 // match: (ORconst [c] (MOVVconst [d]))
4813 // result: (MOVVconst [c|d])
4814 for {
4815 c := auxIntToInt64(v.AuxInt)
4816 if v_0.Op != OpMIPS64MOVVconst {
4817 break
4818 }
4819 d := auxIntToInt64(v_0.AuxInt)
4820 v.reset(OpMIPS64MOVVconst)
4821 v.AuxInt = int64ToAuxInt(c | d)
4822 return true
4823 }
4824 // match: (ORconst [c] (ORconst [d] x))
4825 // cond: is32Bit(c|d)
4826 // result: (ORconst [c|d] x)
4827 for {
4828 c := auxIntToInt64(v.AuxInt)
4829 if v_0.Op != OpMIPS64ORconst {
4830 break
4831 }
4832 d := auxIntToInt64(v_0.AuxInt)
4833 x := v_0.Args[0]
4834 if !(is32Bit(c | d)) {
4835 break
4836 }
4837 v.reset(OpMIPS64ORconst)
4838 v.AuxInt = int64ToAuxInt(c | d)
4839 v.AddArg(x)
4840 return true
4841 }
4842 return false
4843 }
4844 func rewriteValueMIPS64_OpMIPS64SGT(v *Value) bool {
4845 v_1 := v.Args[1]
4846 v_0 := v.Args[0]
4847 // match: (SGT (MOVVconst [c]) x)
4848 // cond: is32Bit(c)
4849 // result: (SGTconst [c] x)
4850 for {
4851 if v_0.Op != OpMIPS64MOVVconst {
4852 break
4853 }
4854 c := auxIntToInt64(v_0.AuxInt)
4855 x := v_1
4856 if !(is32Bit(c)) {
4857 break
4858 }
4859 v.reset(OpMIPS64SGTconst)
4860 v.AuxInt = int64ToAuxInt(c)
4861 v.AddArg(x)
4862 return true
4863 }
4864 // match: (SGT x x)
4865 // result: (MOVVconst [0])
4866 for {
4867 x := v_0
4868 if x != v_1 {
4869 break
4870 }
4871 v.reset(OpMIPS64MOVVconst)
4872 v.AuxInt = int64ToAuxInt(0)
4873 return true
4874 }
4875 return false
4876 }
4877 func rewriteValueMIPS64_OpMIPS64SGTU(v *Value) bool {
4878 v_1 := v.Args[1]
4879 v_0 := v.Args[0]
4880 // match: (SGTU (MOVVconst [c]) x)
4881 // cond: is32Bit(c)
4882 // result: (SGTUconst [c] x)
4883 for {
4884 if v_0.Op != OpMIPS64MOVVconst {
4885 break
4886 }
4887 c := auxIntToInt64(v_0.AuxInt)
4888 x := v_1
4889 if !(is32Bit(c)) {
4890 break
4891 }
4892 v.reset(OpMIPS64SGTUconst)
4893 v.AuxInt = int64ToAuxInt(c)
4894 v.AddArg(x)
4895 return true
4896 }
4897 // match: (SGTU x x)
4898 // result: (MOVVconst [0])
4899 for {
4900 x := v_0
4901 if x != v_1 {
4902 break
4903 }
4904 v.reset(OpMIPS64MOVVconst)
4905 v.AuxInt = int64ToAuxInt(0)
4906 return true
4907 }
4908 return false
4909 }
4910 func rewriteValueMIPS64_OpMIPS64SGTUconst(v *Value) bool {
4911 v_0 := v.Args[0]
4912 // match: (SGTUconst [c] (MOVVconst [d]))
4913 // cond: uint64(c)>uint64(d)
4914 // result: (MOVVconst [1])
4915 for {
4916 c := auxIntToInt64(v.AuxInt)
4917 if v_0.Op != OpMIPS64MOVVconst {
4918 break
4919 }
4920 d := auxIntToInt64(v_0.AuxInt)
4921 if !(uint64(c) > uint64(d)) {
4922 break
4923 }
4924 v.reset(OpMIPS64MOVVconst)
4925 v.AuxInt = int64ToAuxInt(1)
4926 return true
4927 }
4928 // match: (SGTUconst [c] (MOVVconst [d]))
4929 // cond: uint64(c)<=uint64(d)
4930 // result: (MOVVconst [0])
4931 for {
4932 c := auxIntToInt64(v.AuxInt)
4933 if v_0.Op != OpMIPS64MOVVconst {
4934 break
4935 }
4936 d := auxIntToInt64(v_0.AuxInt)
4937 if !(uint64(c) <= uint64(d)) {
4938 break
4939 }
4940 v.reset(OpMIPS64MOVVconst)
4941 v.AuxInt = int64ToAuxInt(0)
4942 return true
4943 }
4944 // match: (SGTUconst [c] (MOVBUreg _))
4945 // cond: 0xff < uint64(c)
4946 // result: (MOVVconst [1])
4947 for {
4948 c := auxIntToInt64(v.AuxInt)
4949 if v_0.Op != OpMIPS64MOVBUreg || !(0xff < uint64(c)) {
4950 break
4951 }
4952 v.reset(OpMIPS64MOVVconst)
4953 v.AuxInt = int64ToAuxInt(1)
4954 return true
4955 }
4956 // match: (SGTUconst [c] (MOVHUreg _))
4957 // cond: 0xffff < uint64(c)
4958 // result: (MOVVconst [1])
4959 for {
4960 c := auxIntToInt64(v.AuxInt)
4961 if v_0.Op != OpMIPS64MOVHUreg || !(0xffff < uint64(c)) {
4962 break
4963 }
4964 v.reset(OpMIPS64MOVVconst)
4965 v.AuxInt = int64ToAuxInt(1)
4966 return true
4967 }
4968 // match: (SGTUconst [c] (ANDconst [m] _))
4969 // cond: uint64(m) < uint64(c)
4970 // result: (MOVVconst [1])
4971 for {
4972 c := auxIntToInt64(v.AuxInt)
4973 if v_0.Op != OpMIPS64ANDconst {
4974 break
4975 }
4976 m := auxIntToInt64(v_0.AuxInt)
4977 if !(uint64(m) < uint64(c)) {
4978 break
4979 }
4980 v.reset(OpMIPS64MOVVconst)
4981 v.AuxInt = int64ToAuxInt(1)
4982 return true
4983 }
4984 // match: (SGTUconst [c] (SRLVconst _ [d]))
4985 // cond: 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)
4986 // result: (MOVVconst [1])
4987 for {
4988 c := auxIntToInt64(v.AuxInt)
4989 if v_0.Op != OpMIPS64SRLVconst {
4990 break
4991 }
4992 d := auxIntToInt64(v_0.AuxInt)
4993 if !(0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)) {
4994 break
4995 }
4996 v.reset(OpMIPS64MOVVconst)
4997 v.AuxInt = int64ToAuxInt(1)
4998 return true
4999 }
5000 return false
5001 }
5002 func rewriteValueMIPS64_OpMIPS64SGTconst(v *Value) bool {
5003 v_0 := v.Args[0]
5004 // match: (SGTconst [c] (MOVVconst [d]))
5005 // cond: c>d
5006 // result: (MOVVconst [1])
5007 for {
5008 c := auxIntToInt64(v.AuxInt)
5009 if v_0.Op != OpMIPS64MOVVconst {
5010 break
5011 }
5012 d := auxIntToInt64(v_0.AuxInt)
5013 if !(c > d) {
5014 break
5015 }
5016 v.reset(OpMIPS64MOVVconst)
5017 v.AuxInt = int64ToAuxInt(1)
5018 return true
5019 }
5020 // match: (SGTconst [c] (MOVVconst [d]))
5021 // cond: c<=d
5022 // result: (MOVVconst [0])
5023 for {
5024 c := auxIntToInt64(v.AuxInt)
5025 if v_0.Op != OpMIPS64MOVVconst {
5026 break
5027 }
5028 d := auxIntToInt64(v_0.AuxInt)
5029 if !(c <= d) {
5030 break
5031 }
5032 v.reset(OpMIPS64MOVVconst)
5033 v.AuxInt = int64ToAuxInt(0)
5034 return true
5035 }
5036 // match: (SGTconst [c] (MOVBreg _))
5037 // cond: 0x7f < c
5038 // result: (MOVVconst [1])
5039 for {
5040 c := auxIntToInt64(v.AuxInt)
5041 if v_0.Op != OpMIPS64MOVBreg || !(0x7f < c) {
5042 break
5043 }
5044 v.reset(OpMIPS64MOVVconst)
5045 v.AuxInt = int64ToAuxInt(1)
5046 return true
5047 }
5048 // match: (SGTconst [c] (MOVBreg _))
5049 // cond: c <= -0x80
5050 // result: (MOVVconst [0])
5051 for {
5052 c := auxIntToInt64(v.AuxInt)
5053 if v_0.Op != OpMIPS64MOVBreg || !(c <= -0x80) {
5054 break
5055 }
5056 v.reset(OpMIPS64MOVVconst)
5057 v.AuxInt = int64ToAuxInt(0)
5058 return true
5059 }
5060 // match: (SGTconst [c] (MOVBUreg _))
5061 // cond: 0xff < c
5062 // result: (MOVVconst [1])
5063 for {
5064 c := auxIntToInt64(v.AuxInt)
5065 if v_0.Op != OpMIPS64MOVBUreg || !(0xff < c) {
5066 break
5067 }
5068 v.reset(OpMIPS64MOVVconst)
5069 v.AuxInt = int64ToAuxInt(1)
5070 return true
5071 }
5072 // match: (SGTconst [c] (MOVBUreg _))
5073 // cond: c < 0
5074 // result: (MOVVconst [0])
5075 for {
5076 c := auxIntToInt64(v.AuxInt)
5077 if v_0.Op != OpMIPS64MOVBUreg || !(c < 0) {
5078 break
5079 }
5080 v.reset(OpMIPS64MOVVconst)
5081 v.AuxInt = int64ToAuxInt(0)
5082 return true
5083 }
5084 // match: (SGTconst [c] (MOVHreg _))
5085 // cond: 0x7fff < c
5086 // result: (MOVVconst [1])
5087 for {
5088 c := auxIntToInt64(v.AuxInt)
5089 if v_0.Op != OpMIPS64MOVHreg || !(0x7fff < c) {
5090 break
5091 }
5092 v.reset(OpMIPS64MOVVconst)
5093 v.AuxInt = int64ToAuxInt(1)
5094 return true
5095 }
5096 // match: (SGTconst [c] (MOVHreg _))
5097 // cond: c <= -0x8000
5098 // result: (MOVVconst [0])
5099 for {
5100 c := auxIntToInt64(v.AuxInt)
5101 if v_0.Op != OpMIPS64MOVHreg || !(c <= -0x8000) {
5102 break
5103 }
5104 v.reset(OpMIPS64MOVVconst)
5105 v.AuxInt = int64ToAuxInt(0)
5106 return true
5107 }
5108 // match: (SGTconst [c] (MOVHUreg _))
5109 // cond: 0xffff < c
5110 // result: (MOVVconst [1])
5111 for {
5112 c := auxIntToInt64(v.AuxInt)
5113 if v_0.Op != OpMIPS64MOVHUreg || !(0xffff < c) {
5114 break
5115 }
5116 v.reset(OpMIPS64MOVVconst)
5117 v.AuxInt = int64ToAuxInt(1)
5118 return true
5119 }
5120 // match: (SGTconst [c] (MOVHUreg _))
5121 // cond: c < 0
5122 // result: (MOVVconst [0])
5123 for {
5124 c := auxIntToInt64(v.AuxInt)
5125 if v_0.Op != OpMIPS64MOVHUreg || !(c < 0) {
5126 break
5127 }
5128 v.reset(OpMIPS64MOVVconst)
5129 v.AuxInt = int64ToAuxInt(0)
5130 return true
5131 }
5132 // match: (SGTconst [c] (MOVWUreg _))
5133 // cond: c < 0
5134 // result: (MOVVconst [0])
5135 for {
5136 c := auxIntToInt64(v.AuxInt)
5137 if v_0.Op != OpMIPS64MOVWUreg || !(c < 0) {
5138 break
5139 }
5140 v.reset(OpMIPS64MOVVconst)
5141 v.AuxInt = int64ToAuxInt(0)
5142 return true
5143 }
5144 // match: (SGTconst [c] (ANDconst [m] _))
5145 // cond: 0 <= m && m < c
5146 // result: (MOVVconst [1])
5147 for {
5148 c := auxIntToInt64(v.AuxInt)
5149 if v_0.Op != OpMIPS64ANDconst {
5150 break
5151 }
5152 m := auxIntToInt64(v_0.AuxInt)
5153 if !(0 <= m && m < c) {
5154 break
5155 }
5156 v.reset(OpMIPS64MOVVconst)
5157 v.AuxInt = int64ToAuxInt(1)
5158 return true
5159 }
5160 // match: (SGTconst [c] (SRLVconst _ [d]))
5161 // cond: 0 <= c && 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)
5162 // result: (MOVVconst [1])
5163 for {
5164 c := auxIntToInt64(v.AuxInt)
5165 if v_0.Op != OpMIPS64SRLVconst {
5166 break
5167 }
5168 d := auxIntToInt64(v_0.AuxInt)
5169 if !(0 <= c && 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)) {
5170 break
5171 }
5172 v.reset(OpMIPS64MOVVconst)
5173 v.AuxInt = int64ToAuxInt(1)
5174 return true
5175 }
5176 return false
5177 }
5178 func rewriteValueMIPS64_OpMIPS64SLLV(v *Value) bool {
5179 v_1 := v.Args[1]
5180 v_0 := v.Args[0]
5181 // match: (SLLV _ (MOVVconst [c]))
5182 // cond: uint64(c)>=64
5183 // result: (MOVVconst [0])
5184 for {
5185 if v_1.Op != OpMIPS64MOVVconst {
5186 break
5187 }
5188 c := auxIntToInt64(v_1.AuxInt)
5189 if !(uint64(c) >= 64) {
5190 break
5191 }
5192 v.reset(OpMIPS64MOVVconst)
5193 v.AuxInt = int64ToAuxInt(0)
5194 return true
5195 }
5196 // match: (SLLV x (MOVVconst [c]))
5197 // result: (SLLVconst x [c])
5198 for {
5199 x := v_0
5200 if v_1.Op != OpMIPS64MOVVconst {
5201 break
5202 }
5203 c := auxIntToInt64(v_1.AuxInt)
5204 v.reset(OpMIPS64SLLVconst)
5205 v.AuxInt = int64ToAuxInt(c)
5206 v.AddArg(x)
5207 return true
5208 }
5209 return false
5210 }
5211 func rewriteValueMIPS64_OpMIPS64SLLVconst(v *Value) bool {
5212 v_0 := v.Args[0]
5213 // match: (SLLVconst [c] (MOVVconst [d]))
5214 // result: (MOVVconst [d<<uint64(c)])
5215 for {
5216 c := auxIntToInt64(v.AuxInt)
5217 if v_0.Op != OpMIPS64MOVVconst {
5218 break
5219 }
5220 d := auxIntToInt64(v_0.AuxInt)
5221 v.reset(OpMIPS64MOVVconst)
5222 v.AuxInt = int64ToAuxInt(d << uint64(c))
5223 return true
5224 }
5225 return false
5226 }
5227 func rewriteValueMIPS64_OpMIPS64SRAV(v *Value) bool {
5228 v_1 := v.Args[1]
5229 v_0 := v.Args[0]
5230 // match: (SRAV x (MOVVconst [c]))
5231 // cond: uint64(c)>=64
5232 // result: (SRAVconst x [63])
5233 for {
5234 x := v_0
5235 if v_1.Op != OpMIPS64MOVVconst {
5236 break
5237 }
5238 c := auxIntToInt64(v_1.AuxInt)
5239 if !(uint64(c) >= 64) {
5240 break
5241 }
5242 v.reset(OpMIPS64SRAVconst)
5243 v.AuxInt = int64ToAuxInt(63)
5244 v.AddArg(x)
5245 return true
5246 }
5247 // match: (SRAV x (MOVVconst [c]))
5248 // result: (SRAVconst x [c])
5249 for {
5250 x := v_0
5251 if v_1.Op != OpMIPS64MOVVconst {
5252 break
5253 }
5254 c := auxIntToInt64(v_1.AuxInt)
5255 v.reset(OpMIPS64SRAVconst)
5256 v.AuxInt = int64ToAuxInt(c)
5257 v.AddArg(x)
5258 return true
5259 }
5260 return false
5261 }
5262 func rewriteValueMIPS64_OpMIPS64SRAVconst(v *Value) bool {
5263 v_0 := v.Args[0]
5264 // match: (SRAVconst [c] (MOVVconst [d]))
5265 // result: (MOVVconst [d>>uint64(c)])
5266 for {
5267 c := auxIntToInt64(v.AuxInt)
5268 if v_0.Op != OpMIPS64MOVVconst {
5269 break
5270 }
5271 d := auxIntToInt64(v_0.AuxInt)
5272 v.reset(OpMIPS64MOVVconst)
5273 v.AuxInt = int64ToAuxInt(d >> uint64(c))
5274 return true
5275 }
5276 return false
5277 }
5278 func rewriteValueMIPS64_OpMIPS64SRLV(v *Value) bool {
5279 v_1 := v.Args[1]
5280 v_0 := v.Args[0]
5281 // match: (SRLV _ (MOVVconst [c]))
5282 // cond: uint64(c)>=64
5283 // result: (MOVVconst [0])
5284 for {
5285 if v_1.Op != OpMIPS64MOVVconst {
5286 break
5287 }
5288 c := auxIntToInt64(v_1.AuxInt)
5289 if !(uint64(c) >= 64) {
5290 break
5291 }
5292 v.reset(OpMIPS64MOVVconst)
5293 v.AuxInt = int64ToAuxInt(0)
5294 return true
5295 }
5296 // match: (SRLV x (MOVVconst [c]))
5297 // result: (SRLVconst x [c])
5298 for {
5299 x := v_0
5300 if v_1.Op != OpMIPS64MOVVconst {
5301 break
5302 }
5303 c := auxIntToInt64(v_1.AuxInt)
5304 v.reset(OpMIPS64SRLVconst)
5305 v.AuxInt = int64ToAuxInt(c)
5306 v.AddArg(x)
5307 return true
5308 }
5309 return false
5310 }
5311 func rewriteValueMIPS64_OpMIPS64SRLVconst(v *Value) bool {
5312 v_0 := v.Args[0]
5313 // match: (SRLVconst [c] (MOVVconst [d]))
5314 // result: (MOVVconst [int64(uint64(d)>>uint64(c))])
5315 for {
5316 c := auxIntToInt64(v.AuxInt)
5317 if v_0.Op != OpMIPS64MOVVconst {
5318 break
5319 }
5320 d := auxIntToInt64(v_0.AuxInt)
5321 v.reset(OpMIPS64MOVVconst)
5322 v.AuxInt = int64ToAuxInt(int64(uint64(d) >> uint64(c)))
5323 return true
5324 }
5325 return false
5326 }
5327 func rewriteValueMIPS64_OpMIPS64SUBV(v *Value) bool {
5328 v_1 := v.Args[1]
5329 v_0 := v.Args[0]
5330 // match: (SUBV x (MOVVconst [c]))
5331 // cond: is32Bit(c)
5332 // result: (SUBVconst [c] x)
5333 for {
5334 x := v_0
5335 if v_1.Op != OpMIPS64MOVVconst {
5336 break
5337 }
5338 c := auxIntToInt64(v_1.AuxInt)
5339 if !(is32Bit(c)) {
5340 break
5341 }
5342 v.reset(OpMIPS64SUBVconst)
5343 v.AuxInt = int64ToAuxInt(c)
5344 v.AddArg(x)
5345 return true
5346 }
5347 // match: (SUBV x (NEGV y))
5348 // result: (ADDV x y)
5349 for {
5350 x := v_0
5351 if v_1.Op != OpMIPS64NEGV {
5352 break
5353 }
5354 y := v_1.Args[0]
5355 v.reset(OpMIPS64ADDV)
5356 v.AddArg2(x, y)
5357 return true
5358 }
5359 // match: (SUBV x x)
5360 // result: (MOVVconst [0])
5361 for {
5362 x := v_0
5363 if x != v_1 {
5364 break
5365 }
5366 v.reset(OpMIPS64MOVVconst)
5367 v.AuxInt = int64ToAuxInt(0)
5368 return true
5369 }
5370 // match: (SUBV (MOVVconst [0]) x)
5371 // result: (NEGV x)
5372 for {
5373 if v_0.Op != OpMIPS64MOVVconst || auxIntToInt64(v_0.AuxInt) != 0 {
5374 break
5375 }
5376 x := v_1
5377 v.reset(OpMIPS64NEGV)
5378 v.AddArg(x)
5379 return true
5380 }
5381 return false
5382 }
5383 func rewriteValueMIPS64_OpMIPS64SUBVconst(v *Value) bool {
5384 v_0 := v.Args[0]
5385 // match: (SUBVconst [0] x)
5386 // result: x
5387 for {
5388 if auxIntToInt64(v.AuxInt) != 0 {
5389 break
5390 }
5391 x := v_0
5392 v.copyOf(x)
5393 return true
5394 }
5395 // match: (SUBVconst [c] (MOVVconst [d]))
5396 // result: (MOVVconst [d-c])
5397 for {
5398 c := auxIntToInt64(v.AuxInt)
5399 if v_0.Op != OpMIPS64MOVVconst {
5400 break
5401 }
5402 d := auxIntToInt64(v_0.AuxInt)
5403 v.reset(OpMIPS64MOVVconst)
5404 v.AuxInt = int64ToAuxInt(d - c)
5405 return true
5406 }
5407 // match: (SUBVconst [c] (SUBVconst [d] x))
5408 // cond: is32Bit(-c-d)
5409 // result: (ADDVconst [-c-d] x)
5410 for {
5411 c := auxIntToInt64(v.AuxInt)
5412 if v_0.Op != OpMIPS64SUBVconst {
5413 break
5414 }
5415 d := auxIntToInt64(v_0.AuxInt)
5416 x := v_0.Args[0]
5417 if !(is32Bit(-c - d)) {
5418 break
5419 }
5420 v.reset(OpMIPS64ADDVconst)
5421 v.AuxInt = int64ToAuxInt(-c - d)
5422 v.AddArg(x)
5423 return true
5424 }
5425 // match: (SUBVconst [c] (ADDVconst [d] x))
5426 // cond: is32Bit(-c+d)
5427 // result: (ADDVconst [-c+d] x)
5428 for {
5429 c := auxIntToInt64(v.AuxInt)
5430 if v_0.Op != OpMIPS64ADDVconst {
5431 break
5432 }
5433 d := auxIntToInt64(v_0.AuxInt)
5434 x := v_0.Args[0]
5435 if !(is32Bit(-c + d)) {
5436 break
5437 }
5438 v.reset(OpMIPS64ADDVconst)
5439 v.AuxInt = int64ToAuxInt(-c + d)
5440 v.AddArg(x)
5441 return true
5442 }
5443 return false
5444 }
5445 func rewriteValueMIPS64_OpMIPS64XOR(v *Value) bool {
5446 v_1 := v.Args[1]
5447 v_0 := v.Args[0]
5448 // match: (XOR x (MOVVconst [c]))
5449 // cond: is32Bit(c)
5450 // result: (XORconst [c] x)
5451 for {
5452 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5453 x := v_0
5454 if v_1.Op != OpMIPS64MOVVconst {
5455 continue
5456 }
5457 c := auxIntToInt64(v_1.AuxInt)
5458 if !(is32Bit(c)) {
5459 continue
5460 }
5461 v.reset(OpMIPS64XORconst)
5462 v.AuxInt = int64ToAuxInt(c)
5463 v.AddArg(x)
5464 return true
5465 }
5466 break
5467 }
5468 // match: (XOR x x)
5469 // result: (MOVVconst [0])
5470 for {
5471 x := v_0
5472 if x != v_1 {
5473 break
5474 }
5475 v.reset(OpMIPS64MOVVconst)
5476 v.AuxInt = int64ToAuxInt(0)
5477 return true
5478 }
5479 return false
5480 }
5481 func rewriteValueMIPS64_OpMIPS64XORconst(v *Value) bool {
5482 v_0 := v.Args[0]
5483 // match: (XORconst [0] x)
5484 // result: x
5485 for {
5486 if auxIntToInt64(v.AuxInt) != 0 {
5487 break
5488 }
5489 x := v_0
5490 v.copyOf(x)
5491 return true
5492 }
5493 // match: (XORconst [-1] x)
5494 // result: (NORconst [0] x)
5495 for {
5496 if auxIntToInt64(v.AuxInt) != -1 {
5497 break
5498 }
5499 x := v_0
5500 v.reset(OpMIPS64NORconst)
5501 v.AuxInt = int64ToAuxInt(0)
5502 v.AddArg(x)
5503 return true
5504 }
5505 // match: (XORconst [c] (MOVVconst [d]))
5506 // result: (MOVVconst [c^d])
5507 for {
5508 c := auxIntToInt64(v.AuxInt)
5509 if v_0.Op != OpMIPS64MOVVconst {
5510 break
5511 }
5512 d := auxIntToInt64(v_0.AuxInt)
5513 v.reset(OpMIPS64MOVVconst)
5514 v.AuxInt = int64ToAuxInt(c ^ d)
5515 return true
5516 }
5517 // match: (XORconst [c] (XORconst [d] x))
5518 // cond: is32Bit(c^d)
5519 // result: (XORconst [c^d] x)
5520 for {
5521 c := auxIntToInt64(v.AuxInt)
5522 if v_0.Op != OpMIPS64XORconst {
5523 break
5524 }
5525 d := auxIntToInt64(v_0.AuxInt)
5526 x := v_0.Args[0]
5527 if !(is32Bit(c ^ d)) {
5528 break
5529 }
5530 v.reset(OpMIPS64XORconst)
5531 v.AuxInt = int64ToAuxInt(c ^ d)
5532 v.AddArg(x)
5533 return true
5534 }
5535 return false
5536 }
5537 func rewriteValueMIPS64_OpMod16(v *Value) bool {
5538 v_1 := v.Args[1]
5539 v_0 := v.Args[0]
5540 b := v.Block
5541 typ := &b.Func.Config.Types
5542 // match: (Mod16 x y)
5543 // result: (Select0 (DIVV (SignExt16to64 x) (SignExt16to64 y)))
5544 for {
5545 x := v_0
5546 y := v_1
5547 v.reset(OpSelect0)
5548 v0 := b.NewValue0(v.Pos, OpMIPS64DIVV, types.NewTuple(typ.Int64, typ.Int64))
5549 v1 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
5550 v1.AddArg(x)
5551 v2 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
5552 v2.AddArg(y)
5553 v0.AddArg2(v1, v2)
5554 v.AddArg(v0)
5555 return true
5556 }
5557 }
5558 func rewriteValueMIPS64_OpMod16u(v *Value) bool {
5559 v_1 := v.Args[1]
5560 v_0 := v.Args[0]
5561 b := v.Block
5562 typ := &b.Func.Config.Types
5563 // match: (Mod16u x y)
5564 // result: (Select0 (DIVVU (ZeroExt16to64 x) (ZeroExt16to64 y)))
5565 for {
5566 x := v_0
5567 y := v_1
5568 v.reset(OpSelect0)
5569 v0 := b.NewValue0(v.Pos, OpMIPS64DIVVU, types.NewTuple(typ.UInt64, typ.UInt64))
5570 v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
5571 v1.AddArg(x)
5572 v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
5573 v2.AddArg(y)
5574 v0.AddArg2(v1, v2)
5575 v.AddArg(v0)
5576 return true
5577 }
5578 }
5579 func rewriteValueMIPS64_OpMod32(v *Value) bool {
5580 v_1 := v.Args[1]
5581 v_0 := v.Args[0]
5582 b := v.Block
5583 typ := &b.Func.Config.Types
5584 // match: (Mod32 x y)
5585 // result: (Select0 (DIVV (SignExt32to64 x) (SignExt32to64 y)))
5586 for {
5587 x := v_0
5588 y := v_1
5589 v.reset(OpSelect0)
5590 v0 := b.NewValue0(v.Pos, OpMIPS64DIVV, types.NewTuple(typ.Int64, typ.Int64))
5591 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
5592 v1.AddArg(x)
5593 v2 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
5594 v2.AddArg(y)
5595 v0.AddArg2(v1, v2)
5596 v.AddArg(v0)
5597 return true
5598 }
5599 }
5600 func rewriteValueMIPS64_OpMod32u(v *Value) bool {
5601 v_1 := v.Args[1]
5602 v_0 := v.Args[0]
5603 b := v.Block
5604 typ := &b.Func.Config.Types
5605 // match: (Mod32u x y)
5606 // result: (Select0 (DIVVU (ZeroExt32to64 x) (ZeroExt32to64 y)))
5607 for {
5608 x := v_0
5609 y := v_1
5610 v.reset(OpSelect0)
5611 v0 := b.NewValue0(v.Pos, OpMIPS64DIVVU, types.NewTuple(typ.UInt64, typ.UInt64))
5612 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
5613 v1.AddArg(x)
5614 v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
5615 v2.AddArg(y)
5616 v0.AddArg2(v1, v2)
5617 v.AddArg(v0)
5618 return true
5619 }
5620 }
5621 func rewriteValueMIPS64_OpMod64(v *Value) bool {
5622 v_1 := v.Args[1]
5623 v_0 := v.Args[0]
5624 b := v.Block
5625 typ := &b.Func.Config.Types
5626 // match: (Mod64 x y)
5627 // result: (Select0 (DIVV x y))
5628 for {
5629 x := v_0
5630 y := v_1
5631 v.reset(OpSelect0)
5632 v0 := b.NewValue0(v.Pos, OpMIPS64DIVV, types.NewTuple(typ.Int64, typ.Int64))
5633 v0.AddArg2(x, y)
5634 v.AddArg(v0)
5635 return true
5636 }
5637 }
5638 func rewriteValueMIPS64_OpMod64u(v *Value) bool {
5639 v_1 := v.Args[1]
5640 v_0 := v.Args[0]
5641 b := v.Block
5642 typ := &b.Func.Config.Types
5643 // match: (Mod64u x y)
5644 // result: (Select0 (DIVVU x y))
5645 for {
5646 x := v_0
5647 y := v_1
5648 v.reset(OpSelect0)
5649 v0 := b.NewValue0(v.Pos, OpMIPS64DIVVU, types.NewTuple(typ.UInt64, typ.UInt64))
5650 v0.AddArg2(x, y)
5651 v.AddArg(v0)
5652 return true
5653 }
5654 }
5655 func rewriteValueMIPS64_OpMod8(v *Value) bool {
5656 v_1 := v.Args[1]
5657 v_0 := v.Args[0]
5658 b := v.Block
5659 typ := &b.Func.Config.Types
5660 // match: (Mod8 x y)
5661 // result: (Select0 (DIVV (SignExt8to64 x) (SignExt8to64 y)))
5662 for {
5663 x := v_0
5664 y := v_1
5665 v.reset(OpSelect0)
5666 v0 := b.NewValue0(v.Pos, OpMIPS64DIVV, types.NewTuple(typ.Int64, typ.Int64))
5667 v1 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
5668 v1.AddArg(x)
5669 v2 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
5670 v2.AddArg(y)
5671 v0.AddArg2(v1, v2)
5672 v.AddArg(v0)
5673 return true
5674 }
5675 }
5676 func rewriteValueMIPS64_OpMod8u(v *Value) bool {
5677 v_1 := v.Args[1]
5678 v_0 := v.Args[0]
5679 b := v.Block
5680 typ := &b.Func.Config.Types
5681 // match: (Mod8u x y)
5682 // result: (Select0 (DIVVU (ZeroExt8to64 x) (ZeroExt8to64 y)))
5683 for {
5684 x := v_0
5685 y := v_1
5686 v.reset(OpSelect0)
5687 v0 := b.NewValue0(v.Pos, OpMIPS64DIVVU, types.NewTuple(typ.UInt64, typ.UInt64))
5688 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
5689 v1.AddArg(x)
5690 v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
5691 v2.AddArg(y)
5692 v0.AddArg2(v1, v2)
5693 v.AddArg(v0)
5694 return true
5695 }
5696 }
5697 func rewriteValueMIPS64_OpMove(v *Value) bool {
5698 v_2 := v.Args[2]
5699 v_1 := v.Args[1]
5700 v_0 := v.Args[0]
5701 b := v.Block
5702 config := b.Func.Config
5703 typ := &b.Func.Config.Types
5704 // match: (Move [0] _ _ mem)
5705 // result: mem
5706 for {
5707 if auxIntToInt64(v.AuxInt) != 0 {
5708 break
5709 }
5710 mem := v_2
5711 v.copyOf(mem)
5712 return true
5713 }
5714 // match: (Move [1] dst src mem)
5715 // result: (MOVBstore dst (MOVBload src mem) mem)
5716 for {
5717 if auxIntToInt64(v.AuxInt) != 1 {
5718 break
5719 }
5720 dst := v_0
5721 src := v_1
5722 mem := v_2
5723 v.reset(OpMIPS64MOVBstore)
5724 v0 := b.NewValue0(v.Pos, OpMIPS64MOVBload, typ.Int8)
5725 v0.AddArg2(src, mem)
5726 v.AddArg3(dst, v0, mem)
5727 return true
5728 }
5729 // match: (Move [2] {t} dst src mem)
5730 // cond: t.Alignment()%2 == 0
5731 // result: (MOVHstore dst (MOVHload src mem) mem)
5732 for {
5733 if auxIntToInt64(v.AuxInt) != 2 {
5734 break
5735 }
5736 t := auxToType(v.Aux)
5737 dst := v_0
5738 src := v_1
5739 mem := v_2
5740 if !(t.Alignment()%2 == 0) {
5741 break
5742 }
5743 v.reset(OpMIPS64MOVHstore)
5744 v0 := b.NewValue0(v.Pos, OpMIPS64MOVHload, typ.Int16)
5745 v0.AddArg2(src, mem)
5746 v.AddArg3(dst, v0, mem)
5747 return true
5748 }
5749 // match: (Move [2] dst src mem)
5750 // result: (MOVBstore [1] dst (MOVBload [1] src mem) (MOVBstore dst (MOVBload src mem) mem))
5751 for {
5752 if auxIntToInt64(v.AuxInt) != 2 {
5753 break
5754 }
5755 dst := v_0
5756 src := v_1
5757 mem := v_2
5758 v.reset(OpMIPS64MOVBstore)
5759 v.AuxInt = int32ToAuxInt(1)
5760 v0 := b.NewValue0(v.Pos, OpMIPS64MOVBload, typ.Int8)
5761 v0.AuxInt = int32ToAuxInt(1)
5762 v0.AddArg2(src, mem)
5763 v1 := b.NewValue0(v.Pos, OpMIPS64MOVBstore, types.TypeMem)
5764 v2 := b.NewValue0(v.Pos, OpMIPS64MOVBload, typ.Int8)
5765 v2.AddArg2(src, mem)
5766 v1.AddArg3(dst, v2, mem)
5767 v.AddArg3(dst, v0, v1)
5768 return true
5769 }
5770 // match: (Move [4] {t} dst src mem)
5771 // cond: t.Alignment()%4 == 0
5772 // result: (MOVWstore dst (MOVWload src mem) mem)
5773 for {
5774 if auxIntToInt64(v.AuxInt) != 4 {
5775 break
5776 }
5777 t := auxToType(v.Aux)
5778 dst := v_0
5779 src := v_1
5780 mem := v_2
5781 if !(t.Alignment()%4 == 0) {
5782 break
5783 }
5784 v.reset(OpMIPS64MOVWstore)
5785 v0 := b.NewValue0(v.Pos, OpMIPS64MOVWload, typ.Int32)
5786 v0.AddArg2(src, mem)
5787 v.AddArg3(dst, v0, mem)
5788 return true
5789 }
5790 // match: (Move [4] {t} dst src mem)
5791 // cond: t.Alignment()%2 == 0
5792 // result: (MOVHstore [2] dst (MOVHload [2] src mem) (MOVHstore dst (MOVHload src mem) mem))
5793 for {
5794 if auxIntToInt64(v.AuxInt) != 4 {
5795 break
5796 }
5797 t := auxToType(v.Aux)
5798 dst := v_0
5799 src := v_1
5800 mem := v_2
5801 if !(t.Alignment()%2 == 0) {
5802 break
5803 }
5804 v.reset(OpMIPS64MOVHstore)
5805 v.AuxInt = int32ToAuxInt(2)
5806 v0 := b.NewValue0(v.Pos, OpMIPS64MOVHload, typ.Int16)
5807 v0.AuxInt = int32ToAuxInt(2)
5808 v0.AddArg2(src, mem)
5809 v1 := b.NewValue0(v.Pos, OpMIPS64MOVHstore, types.TypeMem)
5810 v2 := b.NewValue0(v.Pos, OpMIPS64MOVHload, typ.Int16)
5811 v2.AddArg2(src, mem)
5812 v1.AddArg3(dst, v2, mem)
5813 v.AddArg3(dst, v0, v1)
5814 return true
5815 }
5816 // match: (Move [4] dst src mem)
5817 // result: (MOVBstore [3] dst (MOVBload [3] src mem) (MOVBstore [2] dst (MOVBload [2] src mem) (MOVBstore [1] dst (MOVBload [1] src mem) (MOVBstore dst (MOVBload src mem) mem))))
5818 for {
5819 if auxIntToInt64(v.AuxInt) != 4 {
5820 break
5821 }
5822 dst := v_0
5823 src := v_1
5824 mem := v_2
5825 v.reset(OpMIPS64MOVBstore)
5826 v.AuxInt = int32ToAuxInt(3)
5827 v0 := b.NewValue0(v.Pos, OpMIPS64MOVBload, typ.Int8)
5828 v0.AuxInt = int32ToAuxInt(3)
5829 v0.AddArg2(src, mem)
5830 v1 := b.NewValue0(v.Pos, OpMIPS64MOVBstore, types.TypeMem)
5831 v1.AuxInt = int32ToAuxInt(2)
5832 v2 := b.NewValue0(v.Pos, OpMIPS64MOVBload, typ.Int8)
5833 v2.AuxInt = int32ToAuxInt(2)
5834 v2.AddArg2(src, mem)
5835 v3 := b.NewValue0(v.Pos, OpMIPS64MOVBstore, types.TypeMem)
5836 v3.AuxInt = int32ToAuxInt(1)
5837 v4 := b.NewValue0(v.Pos, OpMIPS64MOVBload, typ.Int8)
5838 v4.AuxInt = int32ToAuxInt(1)
5839 v4.AddArg2(src, mem)
5840 v5 := b.NewValue0(v.Pos, OpMIPS64MOVBstore, types.TypeMem)
5841 v6 := b.NewValue0(v.Pos, OpMIPS64MOVBload, typ.Int8)
5842 v6.AddArg2(src, mem)
5843 v5.AddArg3(dst, v6, mem)
5844 v3.AddArg3(dst, v4, v5)
5845 v1.AddArg3(dst, v2, v3)
5846 v.AddArg3(dst, v0, v1)
5847 return true
5848 }
5849 // match: (Move [8] {t} dst src mem)
5850 // cond: t.Alignment()%8 == 0
5851 // result: (MOVVstore dst (MOVVload src mem) mem)
5852 for {
5853 if auxIntToInt64(v.AuxInt) != 8 {
5854 break
5855 }
5856 t := auxToType(v.Aux)
5857 dst := v_0
5858 src := v_1
5859 mem := v_2
5860 if !(t.Alignment()%8 == 0) {
5861 break
5862 }
5863 v.reset(OpMIPS64MOVVstore)
5864 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVload, typ.UInt64)
5865 v0.AddArg2(src, mem)
5866 v.AddArg3(dst, v0, mem)
5867 return true
5868 }
5869 // match: (Move [8] {t} dst src mem)
5870 // cond: t.Alignment()%4 == 0
5871 // result: (MOVWstore [4] dst (MOVWload [4] src mem) (MOVWstore dst (MOVWload src mem) mem))
5872 for {
5873 if auxIntToInt64(v.AuxInt) != 8 {
5874 break
5875 }
5876 t := auxToType(v.Aux)
5877 dst := v_0
5878 src := v_1
5879 mem := v_2
5880 if !(t.Alignment()%4 == 0) {
5881 break
5882 }
5883 v.reset(OpMIPS64MOVWstore)
5884 v.AuxInt = int32ToAuxInt(4)
5885 v0 := b.NewValue0(v.Pos, OpMIPS64MOVWload, typ.Int32)
5886 v0.AuxInt = int32ToAuxInt(4)
5887 v0.AddArg2(src, mem)
5888 v1 := b.NewValue0(v.Pos, OpMIPS64MOVWstore, types.TypeMem)
5889 v2 := b.NewValue0(v.Pos, OpMIPS64MOVWload, typ.Int32)
5890 v2.AddArg2(src, mem)
5891 v1.AddArg3(dst, v2, mem)
5892 v.AddArg3(dst, v0, v1)
5893 return true
5894 }
5895 // match: (Move [8] {t} dst src mem)
5896 // cond: t.Alignment()%2 == 0
5897 // result: (MOVHstore [6] dst (MOVHload [6] src mem) (MOVHstore [4] dst (MOVHload [4] src mem) (MOVHstore [2] dst (MOVHload [2] src mem) (MOVHstore dst (MOVHload src mem) mem))))
5898 for {
5899 if auxIntToInt64(v.AuxInt) != 8 {
5900 break
5901 }
5902 t := auxToType(v.Aux)
5903 dst := v_0
5904 src := v_1
5905 mem := v_2
5906 if !(t.Alignment()%2 == 0) {
5907 break
5908 }
5909 v.reset(OpMIPS64MOVHstore)
5910 v.AuxInt = int32ToAuxInt(6)
5911 v0 := b.NewValue0(v.Pos, OpMIPS64MOVHload, typ.Int16)
5912 v0.AuxInt = int32ToAuxInt(6)
5913 v0.AddArg2(src, mem)
5914 v1 := b.NewValue0(v.Pos, OpMIPS64MOVHstore, types.TypeMem)
5915 v1.AuxInt = int32ToAuxInt(4)
5916 v2 := b.NewValue0(v.Pos, OpMIPS64MOVHload, typ.Int16)
5917 v2.AuxInt = int32ToAuxInt(4)
5918 v2.AddArg2(src, mem)
5919 v3 := b.NewValue0(v.Pos, OpMIPS64MOVHstore, types.TypeMem)
5920 v3.AuxInt = int32ToAuxInt(2)
5921 v4 := b.NewValue0(v.Pos, OpMIPS64MOVHload, typ.Int16)
5922 v4.AuxInt = int32ToAuxInt(2)
5923 v4.AddArg2(src, mem)
5924 v5 := b.NewValue0(v.Pos, OpMIPS64MOVHstore, types.TypeMem)
5925 v6 := b.NewValue0(v.Pos, OpMIPS64MOVHload, typ.Int16)
5926 v6.AddArg2(src, mem)
5927 v5.AddArg3(dst, v6, mem)
5928 v3.AddArg3(dst, v4, v5)
5929 v1.AddArg3(dst, v2, v3)
5930 v.AddArg3(dst, v0, v1)
5931 return true
5932 }
5933 // match: (Move [3] dst src mem)
5934 // result: (MOVBstore [2] dst (MOVBload [2] src mem) (MOVBstore [1] dst (MOVBload [1] src mem) (MOVBstore dst (MOVBload src mem) mem)))
5935 for {
5936 if auxIntToInt64(v.AuxInt) != 3 {
5937 break
5938 }
5939 dst := v_0
5940 src := v_1
5941 mem := v_2
5942 v.reset(OpMIPS64MOVBstore)
5943 v.AuxInt = int32ToAuxInt(2)
5944 v0 := b.NewValue0(v.Pos, OpMIPS64MOVBload, typ.Int8)
5945 v0.AuxInt = int32ToAuxInt(2)
5946 v0.AddArg2(src, mem)
5947 v1 := b.NewValue0(v.Pos, OpMIPS64MOVBstore, types.TypeMem)
5948 v1.AuxInt = int32ToAuxInt(1)
5949 v2 := b.NewValue0(v.Pos, OpMIPS64MOVBload, typ.Int8)
5950 v2.AuxInt = int32ToAuxInt(1)
5951 v2.AddArg2(src, mem)
5952 v3 := b.NewValue0(v.Pos, OpMIPS64MOVBstore, types.TypeMem)
5953 v4 := b.NewValue0(v.Pos, OpMIPS64MOVBload, typ.Int8)
5954 v4.AddArg2(src, mem)
5955 v3.AddArg3(dst, v4, mem)
5956 v1.AddArg3(dst, v2, v3)
5957 v.AddArg3(dst, v0, v1)
5958 return true
5959 }
5960 // match: (Move [6] {t} dst src mem)
5961 // cond: t.Alignment()%2 == 0
5962 // result: (MOVHstore [4] dst (MOVHload [4] src mem) (MOVHstore [2] dst (MOVHload [2] src mem) (MOVHstore dst (MOVHload src mem) mem)))
5963 for {
5964 if auxIntToInt64(v.AuxInt) != 6 {
5965 break
5966 }
5967 t := auxToType(v.Aux)
5968 dst := v_0
5969 src := v_1
5970 mem := v_2
5971 if !(t.Alignment()%2 == 0) {
5972 break
5973 }
5974 v.reset(OpMIPS64MOVHstore)
5975 v.AuxInt = int32ToAuxInt(4)
5976 v0 := b.NewValue0(v.Pos, OpMIPS64MOVHload, typ.Int16)
5977 v0.AuxInt = int32ToAuxInt(4)
5978 v0.AddArg2(src, mem)
5979 v1 := b.NewValue0(v.Pos, OpMIPS64MOVHstore, types.TypeMem)
5980 v1.AuxInt = int32ToAuxInt(2)
5981 v2 := b.NewValue0(v.Pos, OpMIPS64MOVHload, typ.Int16)
5982 v2.AuxInt = int32ToAuxInt(2)
5983 v2.AddArg2(src, mem)
5984 v3 := b.NewValue0(v.Pos, OpMIPS64MOVHstore, types.TypeMem)
5985 v4 := b.NewValue0(v.Pos, OpMIPS64MOVHload, typ.Int16)
5986 v4.AddArg2(src, mem)
5987 v3.AddArg3(dst, v4, mem)
5988 v1.AddArg3(dst, v2, v3)
5989 v.AddArg3(dst, v0, v1)
5990 return true
5991 }
5992 // match: (Move [12] {t} dst src mem)
5993 // cond: t.Alignment()%4 == 0
5994 // result: (MOVWstore [8] dst (MOVWload [8] src mem) (MOVWstore [4] dst (MOVWload [4] src mem) (MOVWstore dst (MOVWload src mem) mem)))
5995 for {
5996 if auxIntToInt64(v.AuxInt) != 12 {
5997 break
5998 }
5999 t := auxToType(v.Aux)
6000 dst := v_0
6001 src := v_1
6002 mem := v_2
6003 if !(t.Alignment()%4 == 0) {
6004 break
6005 }
6006 v.reset(OpMIPS64MOVWstore)
6007 v.AuxInt = int32ToAuxInt(8)
6008 v0 := b.NewValue0(v.Pos, OpMIPS64MOVWload, typ.Int32)
6009 v0.AuxInt = int32ToAuxInt(8)
6010 v0.AddArg2(src, mem)
6011 v1 := b.NewValue0(v.Pos, OpMIPS64MOVWstore, types.TypeMem)
6012 v1.AuxInt = int32ToAuxInt(4)
6013 v2 := b.NewValue0(v.Pos, OpMIPS64MOVWload, typ.Int32)
6014 v2.AuxInt = int32ToAuxInt(4)
6015 v2.AddArg2(src, mem)
6016 v3 := b.NewValue0(v.Pos, OpMIPS64MOVWstore, types.TypeMem)
6017 v4 := b.NewValue0(v.Pos, OpMIPS64MOVWload, typ.Int32)
6018 v4.AddArg2(src, mem)
6019 v3.AddArg3(dst, v4, mem)
6020 v1.AddArg3(dst, v2, v3)
6021 v.AddArg3(dst, v0, v1)
6022 return true
6023 }
6024 // match: (Move [16] {t} dst src mem)
6025 // cond: t.Alignment()%8 == 0
6026 // result: (MOVVstore [8] dst (MOVVload [8] src mem) (MOVVstore dst (MOVVload src mem) mem))
6027 for {
6028 if auxIntToInt64(v.AuxInt) != 16 {
6029 break
6030 }
6031 t := auxToType(v.Aux)
6032 dst := v_0
6033 src := v_1
6034 mem := v_2
6035 if !(t.Alignment()%8 == 0) {
6036 break
6037 }
6038 v.reset(OpMIPS64MOVVstore)
6039 v.AuxInt = int32ToAuxInt(8)
6040 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVload, typ.UInt64)
6041 v0.AuxInt = int32ToAuxInt(8)
6042 v0.AddArg2(src, mem)
6043 v1 := b.NewValue0(v.Pos, OpMIPS64MOVVstore, types.TypeMem)
6044 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVload, typ.UInt64)
6045 v2.AddArg2(src, mem)
6046 v1.AddArg3(dst, v2, mem)
6047 v.AddArg3(dst, v0, v1)
6048 return true
6049 }
6050 // match: (Move [24] {t} dst src mem)
6051 // cond: t.Alignment()%8 == 0
6052 // result: (MOVVstore [16] dst (MOVVload [16] src mem) (MOVVstore [8] dst (MOVVload [8] src mem) (MOVVstore dst (MOVVload src mem) mem)))
6053 for {
6054 if auxIntToInt64(v.AuxInt) != 24 {
6055 break
6056 }
6057 t := auxToType(v.Aux)
6058 dst := v_0
6059 src := v_1
6060 mem := v_2
6061 if !(t.Alignment()%8 == 0) {
6062 break
6063 }
6064 v.reset(OpMIPS64MOVVstore)
6065 v.AuxInt = int32ToAuxInt(16)
6066 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVload, typ.UInt64)
6067 v0.AuxInt = int32ToAuxInt(16)
6068 v0.AddArg2(src, mem)
6069 v1 := b.NewValue0(v.Pos, OpMIPS64MOVVstore, types.TypeMem)
6070 v1.AuxInt = int32ToAuxInt(8)
6071 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVload, typ.UInt64)
6072 v2.AuxInt = int32ToAuxInt(8)
6073 v2.AddArg2(src, mem)
6074 v3 := b.NewValue0(v.Pos, OpMIPS64MOVVstore, types.TypeMem)
6075 v4 := b.NewValue0(v.Pos, OpMIPS64MOVVload, typ.UInt64)
6076 v4.AddArg2(src, mem)
6077 v3.AddArg3(dst, v4, mem)
6078 v1.AddArg3(dst, v2, v3)
6079 v.AddArg3(dst, v0, v1)
6080 return true
6081 }
6082 // match: (Move [s] {t} dst src mem)
6083 // cond: s%8 == 0 && s >= 24 && s <= 8*128 && t.Alignment()%8 == 0 && logLargeCopy(v, s)
6084 // result: (DUFFCOPY [16 * (128 - s/8)] dst src mem)
6085 for {
6086 s := auxIntToInt64(v.AuxInt)
6087 t := auxToType(v.Aux)
6088 dst := v_0
6089 src := v_1
6090 mem := v_2
6091 if !(s%8 == 0 && s >= 24 && s <= 8*128 && t.Alignment()%8 == 0 && logLargeCopy(v, s)) {
6092 break
6093 }
6094 v.reset(OpMIPS64DUFFCOPY)
6095 v.AuxInt = int64ToAuxInt(16 * (128 - s/8))
6096 v.AddArg3(dst, src, mem)
6097 return true
6098 }
6099 // match: (Move [s] {t} dst src mem)
6100 // cond: s > 24 && logLargeCopy(v, s) || t.Alignment()%8 != 0
6101 // result: (LoweredMove [t.Alignment()] dst src (ADDVconst <src.Type> src [s-moveSize(t.Alignment(), config)]) mem)
6102 for {
6103 s := auxIntToInt64(v.AuxInt)
6104 t := auxToType(v.Aux)
6105 dst := v_0
6106 src := v_1
6107 mem := v_2
6108 if !(s > 24 && logLargeCopy(v, s) || t.Alignment()%8 != 0) {
6109 break
6110 }
6111 v.reset(OpMIPS64LoweredMove)
6112 v.AuxInt = int64ToAuxInt(t.Alignment())
6113 v0 := b.NewValue0(v.Pos, OpMIPS64ADDVconst, src.Type)
6114 v0.AuxInt = int64ToAuxInt(s - moveSize(t.Alignment(), config))
6115 v0.AddArg(src)
6116 v.AddArg4(dst, src, v0, mem)
6117 return true
6118 }
6119 return false
6120 }
6121 func rewriteValueMIPS64_OpMul16(v *Value) bool {
6122 v_1 := v.Args[1]
6123 v_0 := v.Args[0]
6124 b := v.Block
6125 typ := &b.Func.Config.Types
6126 // match: (Mul16 x y)
6127 // result: (Select1 (MULVU x y))
6128 for {
6129 x := v_0
6130 y := v_1
6131 v.reset(OpSelect1)
6132 v0 := b.NewValue0(v.Pos, OpMIPS64MULVU, types.NewTuple(typ.UInt64, typ.UInt64))
6133 v0.AddArg2(x, y)
6134 v.AddArg(v0)
6135 return true
6136 }
6137 }
6138 func rewriteValueMIPS64_OpMul32(v *Value) bool {
6139 v_1 := v.Args[1]
6140 v_0 := v.Args[0]
6141 b := v.Block
6142 typ := &b.Func.Config.Types
6143 // match: (Mul32 x y)
6144 // result: (Select1 (MULVU x y))
6145 for {
6146 x := v_0
6147 y := v_1
6148 v.reset(OpSelect1)
6149 v0 := b.NewValue0(v.Pos, OpMIPS64MULVU, types.NewTuple(typ.UInt64, typ.UInt64))
6150 v0.AddArg2(x, y)
6151 v.AddArg(v0)
6152 return true
6153 }
6154 }
6155 func rewriteValueMIPS64_OpMul64(v *Value) bool {
6156 v_1 := v.Args[1]
6157 v_0 := v.Args[0]
6158 b := v.Block
6159 typ := &b.Func.Config.Types
6160 // match: (Mul64 x y)
6161 // result: (Select1 (MULVU x y))
6162 for {
6163 x := v_0
6164 y := v_1
6165 v.reset(OpSelect1)
6166 v0 := b.NewValue0(v.Pos, OpMIPS64MULVU, types.NewTuple(typ.UInt64, typ.UInt64))
6167 v0.AddArg2(x, y)
6168 v.AddArg(v0)
6169 return true
6170 }
6171 }
6172 func rewriteValueMIPS64_OpMul8(v *Value) bool {
6173 v_1 := v.Args[1]
6174 v_0 := v.Args[0]
6175 b := v.Block
6176 typ := &b.Func.Config.Types
6177 // match: (Mul8 x y)
6178 // result: (Select1 (MULVU x y))
6179 for {
6180 x := v_0
6181 y := v_1
6182 v.reset(OpSelect1)
6183 v0 := b.NewValue0(v.Pos, OpMIPS64MULVU, types.NewTuple(typ.UInt64, typ.UInt64))
6184 v0.AddArg2(x, y)
6185 v.AddArg(v0)
6186 return true
6187 }
6188 }
6189 func rewriteValueMIPS64_OpNeq16(v *Value) bool {
6190 v_1 := v.Args[1]
6191 v_0 := v.Args[0]
6192 b := v.Block
6193 typ := &b.Func.Config.Types
6194 // match: (Neq16 x y)
6195 // result: (SGTU (XOR (ZeroExt16to32 x) (ZeroExt16to64 y)) (MOVVconst [0]))
6196 for {
6197 x := v_0
6198 y := v_1
6199 v.reset(OpMIPS64SGTU)
6200 v0 := b.NewValue0(v.Pos, OpMIPS64XOR, typ.UInt64)
6201 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
6202 v1.AddArg(x)
6203 v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
6204 v2.AddArg(y)
6205 v0.AddArg2(v1, v2)
6206 v3 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6207 v3.AuxInt = int64ToAuxInt(0)
6208 v.AddArg2(v0, v3)
6209 return true
6210 }
6211 }
6212 func rewriteValueMIPS64_OpNeq32(v *Value) bool {
6213 v_1 := v.Args[1]
6214 v_0 := v.Args[0]
6215 b := v.Block
6216 typ := &b.Func.Config.Types
6217 // match: (Neq32 x y)
6218 // result: (SGTU (XOR (ZeroExt32to64 x) (ZeroExt32to64 y)) (MOVVconst [0]))
6219 for {
6220 x := v_0
6221 y := v_1
6222 v.reset(OpMIPS64SGTU)
6223 v0 := b.NewValue0(v.Pos, OpMIPS64XOR, typ.UInt64)
6224 v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
6225 v1.AddArg(x)
6226 v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
6227 v2.AddArg(y)
6228 v0.AddArg2(v1, v2)
6229 v3 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6230 v3.AuxInt = int64ToAuxInt(0)
6231 v.AddArg2(v0, v3)
6232 return true
6233 }
6234 }
6235 func rewriteValueMIPS64_OpNeq32F(v *Value) bool {
6236 v_1 := v.Args[1]
6237 v_0 := v.Args[0]
6238 b := v.Block
6239 // match: (Neq32F x y)
6240 // result: (FPFlagFalse (CMPEQF x y))
6241 for {
6242 x := v_0
6243 y := v_1
6244 v.reset(OpMIPS64FPFlagFalse)
6245 v0 := b.NewValue0(v.Pos, OpMIPS64CMPEQF, types.TypeFlags)
6246 v0.AddArg2(x, y)
6247 v.AddArg(v0)
6248 return true
6249 }
6250 }
6251 func rewriteValueMIPS64_OpNeq64(v *Value) bool {
6252 v_1 := v.Args[1]
6253 v_0 := v.Args[0]
6254 b := v.Block
6255 typ := &b.Func.Config.Types
6256 // match: (Neq64 x y)
6257 // result: (SGTU (XOR x y) (MOVVconst [0]))
6258 for {
6259 x := v_0
6260 y := v_1
6261 v.reset(OpMIPS64SGTU)
6262 v0 := b.NewValue0(v.Pos, OpMIPS64XOR, typ.UInt64)
6263 v0.AddArg2(x, y)
6264 v1 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6265 v1.AuxInt = int64ToAuxInt(0)
6266 v.AddArg2(v0, v1)
6267 return true
6268 }
6269 }
6270 func rewriteValueMIPS64_OpNeq64F(v *Value) bool {
6271 v_1 := v.Args[1]
6272 v_0 := v.Args[0]
6273 b := v.Block
6274 // match: (Neq64F x y)
6275 // result: (FPFlagFalse (CMPEQD x y))
6276 for {
6277 x := v_0
6278 y := v_1
6279 v.reset(OpMIPS64FPFlagFalse)
6280 v0 := b.NewValue0(v.Pos, OpMIPS64CMPEQD, types.TypeFlags)
6281 v0.AddArg2(x, y)
6282 v.AddArg(v0)
6283 return true
6284 }
6285 }
6286 func rewriteValueMIPS64_OpNeq8(v *Value) bool {
6287 v_1 := v.Args[1]
6288 v_0 := v.Args[0]
6289 b := v.Block
6290 typ := &b.Func.Config.Types
6291 // match: (Neq8 x y)
6292 // result: (SGTU (XOR (ZeroExt8to64 x) (ZeroExt8to64 y)) (MOVVconst [0]))
6293 for {
6294 x := v_0
6295 y := v_1
6296 v.reset(OpMIPS64SGTU)
6297 v0 := b.NewValue0(v.Pos, OpMIPS64XOR, typ.UInt64)
6298 v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
6299 v1.AddArg(x)
6300 v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
6301 v2.AddArg(y)
6302 v0.AddArg2(v1, v2)
6303 v3 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6304 v3.AuxInt = int64ToAuxInt(0)
6305 v.AddArg2(v0, v3)
6306 return true
6307 }
6308 }
6309 func rewriteValueMIPS64_OpNeqPtr(v *Value) bool {
6310 v_1 := v.Args[1]
6311 v_0 := v.Args[0]
6312 b := v.Block
6313 typ := &b.Func.Config.Types
6314 // match: (NeqPtr x y)
6315 // result: (SGTU (XOR x y) (MOVVconst [0]))
6316 for {
6317 x := v_0
6318 y := v_1
6319 v.reset(OpMIPS64SGTU)
6320 v0 := b.NewValue0(v.Pos, OpMIPS64XOR, typ.UInt64)
6321 v0.AddArg2(x, y)
6322 v1 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6323 v1.AuxInt = int64ToAuxInt(0)
6324 v.AddArg2(v0, v1)
6325 return true
6326 }
6327 }
6328 func rewriteValueMIPS64_OpNot(v *Value) bool {
6329 v_0 := v.Args[0]
6330 // match: (Not x)
6331 // result: (XORconst [1] x)
6332 for {
6333 x := v_0
6334 v.reset(OpMIPS64XORconst)
6335 v.AuxInt = int64ToAuxInt(1)
6336 v.AddArg(x)
6337 return true
6338 }
6339 }
6340 func rewriteValueMIPS64_OpOffPtr(v *Value) bool {
6341 v_0 := v.Args[0]
6342 b := v.Block
6343 typ := &b.Func.Config.Types
6344 // match: (OffPtr [off] ptr:(SP))
6345 // cond: is32Bit(off)
6346 // result: (MOVVaddr [int32(off)] ptr)
6347 for {
6348 off := auxIntToInt64(v.AuxInt)
6349 ptr := v_0
6350 if ptr.Op != OpSP || !(is32Bit(off)) {
6351 break
6352 }
6353 v.reset(OpMIPS64MOVVaddr)
6354 v.AuxInt = int32ToAuxInt(int32(off))
6355 v.AddArg(ptr)
6356 return true
6357 }
6358 // match: (OffPtr [off] ptr)
6359 // cond: is32Bit(off)
6360 // result: (ADDVconst [off] ptr)
6361 for {
6362 off := auxIntToInt64(v.AuxInt)
6363 ptr := v_0
6364 if !(is32Bit(off)) {
6365 break
6366 }
6367 v.reset(OpMIPS64ADDVconst)
6368 v.AuxInt = int64ToAuxInt(off)
6369 v.AddArg(ptr)
6370 return true
6371 }
6372 // match: (OffPtr [off] ptr)
6373 // cond: !is32Bit(off)
6374 // result: (ADDV ptr (MOVVconst <typ.UInt64> [off]))
6375 for {
6376 off := auxIntToInt64(v.AuxInt)
6377 ptr := v_0
6378 if !(!is32Bit(off)) {
6379 break
6380 }
6381 v.reset(OpMIPS64ADDV)
6382 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6383 v0.AuxInt = int64ToAuxInt(off)
6384 v.AddArg2(ptr, v0)
6385 return true
6386 }
6387 return false
6388 }
6389 func rewriteValueMIPS64_OpPanicBounds(v *Value) bool {
6390 v_2 := v.Args[2]
6391 v_1 := v.Args[1]
6392 v_0 := v.Args[0]
6393 // match: (PanicBounds [kind] x y mem)
6394 // cond: boundsABI(kind) == 0
6395 // result: (LoweredPanicBoundsA [kind] x y mem)
6396 for {
6397 kind := auxIntToInt64(v.AuxInt)
6398 x := v_0
6399 y := v_1
6400 mem := v_2
6401 if !(boundsABI(kind) == 0) {
6402 break
6403 }
6404 v.reset(OpMIPS64LoweredPanicBoundsA)
6405 v.AuxInt = int64ToAuxInt(kind)
6406 v.AddArg3(x, y, mem)
6407 return true
6408 }
6409 // match: (PanicBounds [kind] x y mem)
6410 // cond: boundsABI(kind) == 1
6411 // result: (LoweredPanicBoundsB [kind] x y mem)
6412 for {
6413 kind := auxIntToInt64(v.AuxInt)
6414 x := v_0
6415 y := v_1
6416 mem := v_2
6417 if !(boundsABI(kind) == 1) {
6418 break
6419 }
6420 v.reset(OpMIPS64LoweredPanicBoundsB)
6421 v.AuxInt = int64ToAuxInt(kind)
6422 v.AddArg3(x, y, mem)
6423 return true
6424 }
6425 // match: (PanicBounds [kind] x y mem)
6426 // cond: boundsABI(kind) == 2
6427 // result: (LoweredPanicBoundsC [kind] x y mem)
6428 for {
6429 kind := auxIntToInt64(v.AuxInt)
6430 x := v_0
6431 y := v_1
6432 mem := v_2
6433 if !(boundsABI(kind) == 2) {
6434 break
6435 }
6436 v.reset(OpMIPS64LoweredPanicBoundsC)
6437 v.AuxInt = int64ToAuxInt(kind)
6438 v.AddArg3(x, y, mem)
6439 return true
6440 }
6441 return false
6442 }
6443 func rewriteValueMIPS64_OpRotateLeft16(v *Value) bool {
6444 v_1 := v.Args[1]
6445 v_0 := v.Args[0]
6446 b := v.Block
6447 typ := &b.Func.Config.Types
6448 // match: (RotateLeft16 <t> x (MOVVconst [c]))
6449 // result: (Or16 (Lsh16x64 <t> x (MOVVconst [c&15])) (Rsh16Ux64 <t> x (MOVVconst [-c&15])))
6450 for {
6451 t := v.Type
6452 x := v_0
6453 if v_1.Op != OpMIPS64MOVVconst {
6454 break
6455 }
6456 c := auxIntToInt64(v_1.AuxInt)
6457 v.reset(OpOr16)
6458 v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
6459 v1 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6460 v1.AuxInt = int64ToAuxInt(c & 15)
6461 v0.AddArg2(x, v1)
6462 v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
6463 v3 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6464 v3.AuxInt = int64ToAuxInt(-c & 15)
6465 v2.AddArg2(x, v3)
6466 v.AddArg2(v0, v2)
6467 return true
6468 }
6469 return false
6470 }
6471 func rewriteValueMIPS64_OpRotateLeft32(v *Value) bool {
6472 v_1 := v.Args[1]
6473 v_0 := v.Args[0]
6474 b := v.Block
6475 typ := &b.Func.Config.Types
6476 // match: (RotateLeft32 <t> x (MOVVconst [c]))
6477 // result: (Or32 (Lsh32x64 <t> x (MOVVconst [c&31])) (Rsh32Ux64 <t> x (MOVVconst [-c&31])))
6478 for {
6479 t := v.Type
6480 x := v_0
6481 if v_1.Op != OpMIPS64MOVVconst {
6482 break
6483 }
6484 c := auxIntToInt64(v_1.AuxInt)
6485 v.reset(OpOr32)
6486 v0 := b.NewValue0(v.Pos, OpLsh32x64, t)
6487 v1 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6488 v1.AuxInt = int64ToAuxInt(c & 31)
6489 v0.AddArg2(x, v1)
6490 v2 := b.NewValue0(v.Pos, OpRsh32Ux64, t)
6491 v3 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6492 v3.AuxInt = int64ToAuxInt(-c & 31)
6493 v2.AddArg2(x, v3)
6494 v.AddArg2(v0, v2)
6495 return true
6496 }
6497 return false
6498 }
6499 func rewriteValueMIPS64_OpRotateLeft64(v *Value) bool {
6500 v_1 := v.Args[1]
6501 v_0 := v.Args[0]
6502 b := v.Block
6503 typ := &b.Func.Config.Types
6504 // match: (RotateLeft64 <t> x (MOVVconst [c]))
6505 // result: (Or64 (Lsh64x64 <t> x (MOVVconst [c&63])) (Rsh64Ux64 <t> x (MOVVconst [-c&63])))
6506 for {
6507 t := v.Type
6508 x := v_0
6509 if v_1.Op != OpMIPS64MOVVconst {
6510 break
6511 }
6512 c := auxIntToInt64(v_1.AuxInt)
6513 v.reset(OpOr64)
6514 v0 := b.NewValue0(v.Pos, OpLsh64x64, t)
6515 v1 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6516 v1.AuxInt = int64ToAuxInt(c & 63)
6517 v0.AddArg2(x, v1)
6518 v2 := b.NewValue0(v.Pos, OpRsh64Ux64, t)
6519 v3 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6520 v3.AuxInt = int64ToAuxInt(-c & 63)
6521 v2.AddArg2(x, v3)
6522 v.AddArg2(v0, v2)
6523 return true
6524 }
6525 return false
6526 }
6527 func rewriteValueMIPS64_OpRotateLeft8(v *Value) bool {
6528 v_1 := v.Args[1]
6529 v_0 := v.Args[0]
6530 b := v.Block
6531 typ := &b.Func.Config.Types
6532 // match: (RotateLeft8 <t> x (MOVVconst [c]))
6533 // result: (Or8 (Lsh8x64 <t> x (MOVVconst [c&7])) (Rsh8Ux64 <t> x (MOVVconst [-c&7])))
6534 for {
6535 t := v.Type
6536 x := v_0
6537 if v_1.Op != OpMIPS64MOVVconst {
6538 break
6539 }
6540 c := auxIntToInt64(v_1.AuxInt)
6541 v.reset(OpOr8)
6542 v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
6543 v1 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6544 v1.AuxInt = int64ToAuxInt(c & 7)
6545 v0.AddArg2(x, v1)
6546 v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
6547 v3 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6548 v3.AuxInt = int64ToAuxInt(-c & 7)
6549 v2.AddArg2(x, v3)
6550 v.AddArg2(v0, v2)
6551 return true
6552 }
6553 return false
6554 }
6555 func rewriteValueMIPS64_OpRsh16Ux16(v *Value) bool {
6556 v_1 := v.Args[1]
6557 v_0 := v.Args[0]
6558 b := v.Block
6559 typ := &b.Func.Config.Types
6560 // match: (Rsh16Ux16 <t> x y)
6561 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y))) (SRLV <t> (ZeroExt16to64 x) (ZeroExt16to64 y)))
6562 for {
6563 t := v.Type
6564 x := v_0
6565 y := v_1
6566 v.reset(OpMIPS64AND)
6567 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
6568 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
6569 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6570 v2.AuxInt = int64ToAuxInt(64)
6571 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
6572 v3.AddArg(y)
6573 v1.AddArg2(v2, v3)
6574 v0.AddArg(v1)
6575 v4 := b.NewValue0(v.Pos, OpMIPS64SRLV, t)
6576 v5 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
6577 v5.AddArg(x)
6578 v4.AddArg2(v5, v3)
6579 v.AddArg2(v0, v4)
6580 return true
6581 }
6582 }
6583 func rewriteValueMIPS64_OpRsh16Ux32(v *Value) bool {
6584 v_1 := v.Args[1]
6585 v_0 := v.Args[0]
6586 b := v.Block
6587 typ := &b.Func.Config.Types
6588 // match: (Rsh16Ux32 <t> x y)
6589 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y))) (SRLV <t> (ZeroExt16to64 x) (ZeroExt32to64 y)))
6590 for {
6591 t := v.Type
6592 x := v_0
6593 y := v_1
6594 v.reset(OpMIPS64AND)
6595 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
6596 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
6597 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6598 v2.AuxInt = int64ToAuxInt(64)
6599 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
6600 v3.AddArg(y)
6601 v1.AddArg2(v2, v3)
6602 v0.AddArg(v1)
6603 v4 := b.NewValue0(v.Pos, OpMIPS64SRLV, t)
6604 v5 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
6605 v5.AddArg(x)
6606 v4.AddArg2(v5, v3)
6607 v.AddArg2(v0, v4)
6608 return true
6609 }
6610 }
6611 func rewriteValueMIPS64_OpRsh16Ux64(v *Value) bool {
6612 v_1 := v.Args[1]
6613 v_0 := v.Args[0]
6614 b := v.Block
6615 typ := &b.Func.Config.Types
6616 // match: (Rsh16Ux64 <t> x y)
6617 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) y)) (SRLV <t> (ZeroExt16to64 x) y))
6618 for {
6619 t := v.Type
6620 x := v_0
6621 y := v_1
6622 v.reset(OpMIPS64AND)
6623 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
6624 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
6625 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6626 v2.AuxInt = int64ToAuxInt(64)
6627 v1.AddArg2(v2, y)
6628 v0.AddArg(v1)
6629 v3 := b.NewValue0(v.Pos, OpMIPS64SRLV, t)
6630 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
6631 v4.AddArg(x)
6632 v3.AddArg2(v4, y)
6633 v.AddArg2(v0, v3)
6634 return true
6635 }
6636 }
6637 func rewriteValueMIPS64_OpRsh16Ux8(v *Value) bool {
6638 v_1 := v.Args[1]
6639 v_0 := v.Args[0]
6640 b := v.Block
6641 typ := &b.Func.Config.Types
6642 // match: (Rsh16Ux8 <t> x y)
6643 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y))) (SRLV <t> (ZeroExt16to64 x) (ZeroExt8to64 y)))
6644 for {
6645 t := v.Type
6646 x := v_0
6647 y := v_1
6648 v.reset(OpMIPS64AND)
6649 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
6650 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
6651 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6652 v2.AuxInt = int64ToAuxInt(64)
6653 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
6654 v3.AddArg(y)
6655 v1.AddArg2(v2, v3)
6656 v0.AddArg(v1)
6657 v4 := b.NewValue0(v.Pos, OpMIPS64SRLV, t)
6658 v5 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
6659 v5.AddArg(x)
6660 v4.AddArg2(v5, v3)
6661 v.AddArg2(v0, v4)
6662 return true
6663 }
6664 }
6665 func rewriteValueMIPS64_OpRsh16x16(v *Value) bool {
6666 v_1 := v.Args[1]
6667 v_0 := v.Args[0]
6668 b := v.Block
6669 typ := &b.Func.Config.Types
6670 // match: (Rsh16x16 <t> x y)
6671 // result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
6672 for {
6673 t := v.Type
6674 x := v_0
6675 y := v_1
6676 v.reset(OpMIPS64SRAV)
6677 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
6678 v0.AddArg(x)
6679 v1 := b.NewValue0(v.Pos, OpMIPS64OR, t)
6680 v2 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
6681 v3 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
6682 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
6683 v4.AddArg(y)
6684 v5 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6685 v5.AuxInt = int64ToAuxInt(63)
6686 v3.AddArg2(v4, v5)
6687 v2.AddArg(v3)
6688 v1.AddArg2(v2, v4)
6689 v.AddArg2(v0, v1)
6690 return true
6691 }
6692 }
6693 func rewriteValueMIPS64_OpRsh16x32(v *Value) bool {
6694 v_1 := v.Args[1]
6695 v_0 := v.Args[0]
6696 b := v.Block
6697 typ := &b.Func.Config.Types
6698 // match: (Rsh16x32 <t> x y)
6699 // result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
6700 for {
6701 t := v.Type
6702 x := v_0
6703 y := v_1
6704 v.reset(OpMIPS64SRAV)
6705 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
6706 v0.AddArg(x)
6707 v1 := b.NewValue0(v.Pos, OpMIPS64OR, t)
6708 v2 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
6709 v3 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
6710 v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
6711 v4.AddArg(y)
6712 v5 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6713 v5.AuxInt = int64ToAuxInt(63)
6714 v3.AddArg2(v4, v5)
6715 v2.AddArg(v3)
6716 v1.AddArg2(v2, v4)
6717 v.AddArg2(v0, v1)
6718 return true
6719 }
6720 }
6721 func rewriteValueMIPS64_OpRsh16x64(v *Value) bool {
6722 v_1 := v.Args[1]
6723 v_0 := v.Args[0]
6724 b := v.Block
6725 typ := &b.Func.Config.Types
6726 // match: (Rsh16x64 <t> x y)
6727 // result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
6728 for {
6729 t := v.Type
6730 x := v_0
6731 y := v_1
6732 v.reset(OpMIPS64SRAV)
6733 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
6734 v0.AddArg(x)
6735 v1 := b.NewValue0(v.Pos, OpMIPS64OR, t)
6736 v2 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
6737 v3 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
6738 v4 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6739 v4.AuxInt = int64ToAuxInt(63)
6740 v3.AddArg2(y, v4)
6741 v2.AddArg(v3)
6742 v1.AddArg2(v2, y)
6743 v.AddArg2(v0, v1)
6744 return true
6745 }
6746 }
6747 func rewriteValueMIPS64_OpRsh16x8(v *Value) bool {
6748 v_1 := v.Args[1]
6749 v_0 := v.Args[0]
6750 b := v.Block
6751 typ := &b.Func.Config.Types
6752 // match: (Rsh16x8 <t> x y)
6753 // result: (SRAV (SignExt16to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
6754 for {
6755 t := v.Type
6756 x := v_0
6757 y := v_1
6758 v.reset(OpMIPS64SRAV)
6759 v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
6760 v0.AddArg(x)
6761 v1 := b.NewValue0(v.Pos, OpMIPS64OR, t)
6762 v2 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
6763 v3 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
6764 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
6765 v4.AddArg(y)
6766 v5 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6767 v5.AuxInt = int64ToAuxInt(63)
6768 v3.AddArg2(v4, v5)
6769 v2.AddArg(v3)
6770 v1.AddArg2(v2, v4)
6771 v.AddArg2(v0, v1)
6772 return true
6773 }
6774 }
6775 func rewriteValueMIPS64_OpRsh32Ux16(v *Value) bool {
6776 v_1 := v.Args[1]
6777 v_0 := v.Args[0]
6778 b := v.Block
6779 typ := &b.Func.Config.Types
6780 // match: (Rsh32Ux16 <t> x y)
6781 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y))) (SRLV <t> (ZeroExt32to64 x) (ZeroExt16to64 y)))
6782 for {
6783 t := v.Type
6784 x := v_0
6785 y := v_1
6786 v.reset(OpMIPS64AND)
6787 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
6788 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
6789 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6790 v2.AuxInt = int64ToAuxInt(64)
6791 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
6792 v3.AddArg(y)
6793 v1.AddArg2(v2, v3)
6794 v0.AddArg(v1)
6795 v4 := b.NewValue0(v.Pos, OpMIPS64SRLV, t)
6796 v5 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
6797 v5.AddArg(x)
6798 v4.AddArg2(v5, v3)
6799 v.AddArg2(v0, v4)
6800 return true
6801 }
6802 }
6803 func rewriteValueMIPS64_OpRsh32Ux32(v *Value) bool {
6804 v_1 := v.Args[1]
6805 v_0 := v.Args[0]
6806 b := v.Block
6807 typ := &b.Func.Config.Types
6808 // match: (Rsh32Ux32 <t> x y)
6809 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y))) (SRLV <t> (ZeroExt32to64 x) (ZeroExt32to64 y)))
6810 for {
6811 t := v.Type
6812 x := v_0
6813 y := v_1
6814 v.reset(OpMIPS64AND)
6815 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
6816 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
6817 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6818 v2.AuxInt = int64ToAuxInt(64)
6819 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
6820 v3.AddArg(y)
6821 v1.AddArg2(v2, v3)
6822 v0.AddArg(v1)
6823 v4 := b.NewValue0(v.Pos, OpMIPS64SRLV, t)
6824 v5 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
6825 v5.AddArg(x)
6826 v4.AddArg2(v5, v3)
6827 v.AddArg2(v0, v4)
6828 return true
6829 }
6830 }
6831 func rewriteValueMIPS64_OpRsh32Ux64(v *Value) bool {
6832 v_1 := v.Args[1]
6833 v_0 := v.Args[0]
6834 b := v.Block
6835 typ := &b.Func.Config.Types
6836 // match: (Rsh32Ux64 <t> x y)
6837 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) y)) (SRLV <t> (ZeroExt32to64 x) y))
6838 for {
6839 t := v.Type
6840 x := v_0
6841 y := v_1
6842 v.reset(OpMIPS64AND)
6843 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
6844 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
6845 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6846 v2.AuxInt = int64ToAuxInt(64)
6847 v1.AddArg2(v2, y)
6848 v0.AddArg(v1)
6849 v3 := b.NewValue0(v.Pos, OpMIPS64SRLV, t)
6850 v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
6851 v4.AddArg(x)
6852 v3.AddArg2(v4, y)
6853 v.AddArg2(v0, v3)
6854 return true
6855 }
6856 }
6857 func rewriteValueMIPS64_OpRsh32Ux8(v *Value) bool {
6858 v_1 := v.Args[1]
6859 v_0 := v.Args[0]
6860 b := v.Block
6861 typ := &b.Func.Config.Types
6862 // match: (Rsh32Ux8 <t> x y)
6863 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y))) (SRLV <t> (ZeroExt32to64 x) (ZeroExt8to64 y)))
6864 for {
6865 t := v.Type
6866 x := v_0
6867 y := v_1
6868 v.reset(OpMIPS64AND)
6869 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
6870 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
6871 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6872 v2.AuxInt = int64ToAuxInt(64)
6873 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
6874 v3.AddArg(y)
6875 v1.AddArg2(v2, v3)
6876 v0.AddArg(v1)
6877 v4 := b.NewValue0(v.Pos, OpMIPS64SRLV, t)
6878 v5 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
6879 v5.AddArg(x)
6880 v4.AddArg2(v5, v3)
6881 v.AddArg2(v0, v4)
6882 return true
6883 }
6884 }
6885 func rewriteValueMIPS64_OpRsh32x16(v *Value) bool {
6886 v_1 := v.Args[1]
6887 v_0 := v.Args[0]
6888 b := v.Block
6889 typ := &b.Func.Config.Types
6890 // match: (Rsh32x16 <t> x y)
6891 // result: (SRAV (SignExt32to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
6892 for {
6893 t := v.Type
6894 x := v_0
6895 y := v_1
6896 v.reset(OpMIPS64SRAV)
6897 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
6898 v0.AddArg(x)
6899 v1 := b.NewValue0(v.Pos, OpMIPS64OR, t)
6900 v2 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
6901 v3 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
6902 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
6903 v4.AddArg(y)
6904 v5 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6905 v5.AuxInt = int64ToAuxInt(63)
6906 v3.AddArg2(v4, v5)
6907 v2.AddArg(v3)
6908 v1.AddArg2(v2, v4)
6909 v.AddArg2(v0, v1)
6910 return true
6911 }
6912 }
6913 func rewriteValueMIPS64_OpRsh32x32(v *Value) bool {
6914 v_1 := v.Args[1]
6915 v_0 := v.Args[0]
6916 b := v.Block
6917 typ := &b.Func.Config.Types
6918 // match: (Rsh32x32 <t> x y)
6919 // result: (SRAV (SignExt32to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
6920 for {
6921 t := v.Type
6922 x := v_0
6923 y := v_1
6924 v.reset(OpMIPS64SRAV)
6925 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
6926 v0.AddArg(x)
6927 v1 := b.NewValue0(v.Pos, OpMIPS64OR, t)
6928 v2 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
6929 v3 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
6930 v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
6931 v4.AddArg(y)
6932 v5 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6933 v5.AuxInt = int64ToAuxInt(63)
6934 v3.AddArg2(v4, v5)
6935 v2.AddArg(v3)
6936 v1.AddArg2(v2, v4)
6937 v.AddArg2(v0, v1)
6938 return true
6939 }
6940 }
6941 func rewriteValueMIPS64_OpRsh32x64(v *Value) bool {
6942 v_1 := v.Args[1]
6943 v_0 := v.Args[0]
6944 b := v.Block
6945 typ := &b.Func.Config.Types
6946 // match: (Rsh32x64 <t> x y)
6947 // result: (SRAV (SignExt32to64 x) (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
6948 for {
6949 t := v.Type
6950 x := v_0
6951 y := v_1
6952 v.reset(OpMIPS64SRAV)
6953 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
6954 v0.AddArg(x)
6955 v1 := b.NewValue0(v.Pos, OpMIPS64OR, t)
6956 v2 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
6957 v3 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
6958 v4 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6959 v4.AuxInt = int64ToAuxInt(63)
6960 v3.AddArg2(y, v4)
6961 v2.AddArg(v3)
6962 v1.AddArg2(v2, y)
6963 v.AddArg2(v0, v1)
6964 return true
6965 }
6966 }
6967 func rewriteValueMIPS64_OpRsh32x8(v *Value) bool {
6968 v_1 := v.Args[1]
6969 v_0 := v.Args[0]
6970 b := v.Block
6971 typ := &b.Func.Config.Types
6972 // match: (Rsh32x8 <t> x y)
6973 // result: (SRAV (SignExt32to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
6974 for {
6975 t := v.Type
6976 x := v_0
6977 y := v_1
6978 v.reset(OpMIPS64SRAV)
6979 v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
6980 v0.AddArg(x)
6981 v1 := b.NewValue0(v.Pos, OpMIPS64OR, t)
6982 v2 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
6983 v3 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
6984 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
6985 v4.AddArg(y)
6986 v5 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
6987 v5.AuxInt = int64ToAuxInt(63)
6988 v3.AddArg2(v4, v5)
6989 v2.AddArg(v3)
6990 v1.AddArg2(v2, v4)
6991 v.AddArg2(v0, v1)
6992 return true
6993 }
6994 }
6995 func rewriteValueMIPS64_OpRsh64Ux16(v *Value) bool {
6996 v_1 := v.Args[1]
6997 v_0 := v.Args[0]
6998 b := v.Block
6999 typ := &b.Func.Config.Types
7000 // match: (Rsh64Ux16 <t> x y)
7001 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y))) (SRLV <t> x (ZeroExt16to64 y)))
7002 for {
7003 t := v.Type
7004 x := v_0
7005 y := v_1
7006 v.reset(OpMIPS64AND)
7007 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7008 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
7009 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7010 v2.AuxInt = int64ToAuxInt(64)
7011 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
7012 v3.AddArg(y)
7013 v1.AddArg2(v2, v3)
7014 v0.AddArg(v1)
7015 v4 := b.NewValue0(v.Pos, OpMIPS64SRLV, t)
7016 v4.AddArg2(x, v3)
7017 v.AddArg2(v0, v4)
7018 return true
7019 }
7020 }
7021 func rewriteValueMIPS64_OpRsh64Ux32(v *Value) bool {
7022 v_1 := v.Args[1]
7023 v_0 := v.Args[0]
7024 b := v.Block
7025 typ := &b.Func.Config.Types
7026 // match: (Rsh64Ux32 <t> x y)
7027 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y))) (SRLV <t> x (ZeroExt32to64 y)))
7028 for {
7029 t := v.Type
7030 x := v_0
7031 y := v_1
7032 v.reset(OpMIPS64AND)
7033 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7034 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
7035 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7036 v2.AuxInt = int64ToAuxInt(64)
7037 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
7038 v3.AddArg(y)
7039 v1.AddArg2(v2, v3)
7040 v0.AddArg(v1)
7041 v4 := b.NewValue0(v.Pos, OpMIPS64SRLV, t)
7042 v4.AddArg2(x, v3)
7043 v.AddArg2(v0, v4)
7044 return true
7045 }
7046 }
7047 func rewriteValueMIPS64_OpRsh64Ux64(v *Value) bool {
7048 v_1 := v.Args[1]
7049 v_0 := v.Args[0]
7050 b := v.Block
7051 typ := &b.Func.Config.Types
7052 // match: (Rsh64Ux64 <t> x y)
7053 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) y)) (SRLV <t> x y))
7054 for {
7055 t := v.Type
7056 x := v_0
7057 y := v_1
7058 v.reset(OpMIPS64AND)
7059 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7060 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
7061 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7062 v2.AuxInt = int64ToAuxInt(64)
7063 v1.AddArg2(v2, y)
7064 v0.AddArg(v1)
7065 v3 := b.NewValue0(v.Pos, OpMIPS64SRLV, t)
7066 v3.AddArg2(x, y)
7067 v.AddArg2(v0, v3)
7068 return true
7069 }
7070 }
7071 func rewriteValueMIPS64_OpRsh64Ux8(v *Value) bool {
7072 v_1 := v.Args[1]
7073 v_0 := v.Args[0]
7074 b := v.Block
7075 typ := &b.Func.Config.Types
7076 // match: (Rsh64Ux8 <t> x y)
7077 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y))) (SRLV <t> x (ZeroExt8to64 y)))
7078 for {
7079 t := v.Type
7080 x := v_0
7081 y := v_1
7082 v.reset(OpMIPS64AND)
7083 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7084 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
7085 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7086 v2.AuxInt = int64ToAuxInt(64)
7087 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
7088 v3.AddArg(y)
7089 v1.AddArg2(v2, v3)
7090 v0.AddArg(v1)
7091 v4 := b.NewValue0(v.Pos, OpMIPS64SRLV, t)
7092 v4.AddArg2(x, v3)
7093 v.AddArg2(v0, v4)
7094 return true
7095 }
7096 }
7097 func rewriteValueMIPS64_OpRsh64x16(v *Value) bool {
7098 v_1 := v.Args[1]
7099 v_0 := v.Args[0]
7100 b := v.Block
7101 typ := &b.Func.Config.Types
7102 // match: (Rsh64x16 <t> x y)
7103 // result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
7104 for {
7105 t := v.Type
7106 x := v_0
7107 y := v_1
7108 v.reset(OpMIPS64SRAV)
7109 v0 := b.NewValue0(v.Pos, OpMIPS64OR, t)
7110 v1 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7111 v2 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
7112 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
7113 v3.AddArg(y)
7114 v4 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7115 v4.AuxInt = int64ToAuxInt(63)
7116 v2.AddArg2(v3, v4)
7117 v1.AddArg(v2)
7118 v0.AddArg2(v1, v3)
7119 v.AddArg2(x, v0)
7120 return true
7121 }
7122 }
7123 func rewriteValueMIPS64_OpRsh64x32(v *Value) bool {
7124 v_1 := v.Args[1]
7125 v_0 := v.Args[0]
7126 b := v.Block
7127 typ := &b.Func.Config.Types
7128 // match: (Rsh64x32 <t> x y)
7129 // result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
7130 for {
7131 t := v.Type
7132 x := v_0
7133 y := v_1
7134 v.reset(OpMIPS64SRAV)
7135 v0 := b.NewValue0(v.Pos, OpMIPS64OR, t)
7136 v1 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7137 v2 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
7138 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
7139 v3.AddArg(y)
7140 v4 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7141 v4.AuxInt = int64ToAuxInt(63)
7142 v2.AddArg2(v3, v4)
7143 v1.AddArg(v2)
7144 v0.AddArg2(v1, v3)
7145 v.AddArg2(x, v0)
7146 return true
7147 }
7148 }
7149 func rewriteValueMIPS64_OpRsh64x64(v *Value) bool {
7150 v_1 := v.Args[1]
7151 v_0 := v.Args[0]
7152 b := v.Block
7153 typ := &b.Func.Config.Types
7154 // match: (Rsh64x64 <t> x y)
7155 // result: (SRAV x (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
7156 for {
7157 t := v.Type
7158 x := v_0
7159 y := v_1
7160 v.reset(OpMIPS64SRAV)
7161 v0 := b.NewValue0(v.Pos, OpMIPS64OR, t)
7162 v1 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7163 v2 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
7164 v3 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7165 v3.AuxInt = int64ToAuxInt(63)
7166 v2.AddArg2(y, v3)
7167 v1.AddArg(v2)
7168 v0.AddArg2(v1, y)
7169 v.AddArg2(x, v0)
7170 return true
7171 }
7172 }
7173 func rewriteValueMIPS64_OpRsh64x8(v *Value) bool {
7174 v_1 := v.Args[1]
7175 v_0 := v.Args[0]
7176 b := v.Block
7177 typ := &b.Func.Config.Types
7178 // match: (Rsh64x8 <t> x y)
7179 // result: (SRAV x (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
7180 for {
7181 t := v.Type
7182 x := v_0
7183 y := v_1
7184 v.reset(OpMIPS64SRAV)
7185 v0 := b.NewValue0(v.Pos, OpMIPS64OR, t)
7186 v1 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7187 v2 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
7188 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
7189 v3.AddArg(y)
7190 v4 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7191 v4.AuxInt = int64ToAuxInt(63)
7192 v2.AddArg2(v3, v4)
7193 v1.AddArg(v2)
7194 v0.AddArg2(v1, v3)
7195 v.AddArg2(x, v0)
7196 return true
7197 }
7198 }
7199 func rewriteValueMIPS64_OpRsh8Ux16(v *Value) bool {
7200 v_1 := v.Args[1]
7201 v_0 := v.Args[0]
7202 b := v.Block
7203 typ := &b.Func.Config.Types
7204 // match: (Rsh8Ux16 <t> x y)
7205 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt16to64 y))) (SRLV <t> (ZeroExt8to64 x) (ZeroExt16to64 y)))
7206 for {
7207 t := v.Type
7208 x := v_0
7209 y := v_1
7210 v.reset(OpMIPS64AND)
7211 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7212 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
7213 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7214 v2.AuxInt = int64ToAuxInt(64)
7215 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
7216 v3.AddArg(y)
7217 v1.AddArg2(v2, v3)
7218 v0.AddArg(v1)
7219 v4 := b.NewValue0(v.Pos, OpMIPS64SRLV, t)
7220 v5 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
7221 v5.AddArg(x)
7222 v4.AddArg2(v5, v3)
7223 v.AddArg2(v0, v4)
7224 return true
7225 }
7226 }
7227 func rewriteValueMIPS64_OpRsh8Ux32(v *Value) bool {
7228 v_1 := v.Args[1]
7229 v_0 := v.Args[0]
7230 b := v.Block
7231 typ := &b.Func.Config.Types
7232 // match: (Rsh8Ux32 <t> x y)
7233 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt32to64 y))) (SRLV <t> (ZeroExt8to64 x) (ZeroExt32to64 y)))
7234 for {
7235 t := v.Type
7236 x := v_0
7237 y := v_1
7238 v.reset(OpMIPS64AND)
7239 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7240 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
7241 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7242 v2.AuxInt = int64ToAuxInt(64)
7243 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
7244 v3.AddArg(y)
7245 v1.AddArg2(v2, v3)
7246 v0.AddArg(v1)
7247 v4 := b.NewValue0(v.Pos, OpMIPS64SRLV, t)
7248 v5 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
7249 v5.AddArg(x)
7250 v4.AddArg2(v5, v3)
7251 v.AddArg2(v0, v4)
7252 return true
7253 }
7254 }
7255 func rewriteValueMIPS64_OpRsh8Ux64(v *Value) bool {
7256 v_1 := v.Args[1]
7257 v_0 := v.Args[0]
7258 b := v.Block
7259 typ := &b.Func.Config.Types
7260 // match: (Rsh8Ux64 <t> x y)
7261 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) y)) (SRLV <t> (ZeroExt8to64 x) y))
7262 for {
7263 t := v.Type
7264 x := v_0
7265 y := v_1
7266 v.reset(OpMIPS64AND)
7267 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7268 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
7269 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7270 v2.AuxInt = int64ToAuxInt(64)
7271 v1.AddArg2(v2, y)
7272 v0.AddArg(v1)
7273 v3 := b.NewValue0(v.Pos, OpMIPS64SRLV, t)
7274 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
7275 v4.AddArg(x)
7276 v3.AddArg2(v4, y)
7277 v.AddArg2(v0, v3)
7278 return true
7279 }
7280 }
7281 func rewriteValueMIPS64_OpRsh8Ux8(v *Value) bool {
7282 v_1 := v.Args[1]
7283 v_0 := v.Args[0]
7284 b := v.Block
7285 typ := &b.Func.Config.Types
7286 // match: (Rsh8Ux8 <t> x y)
7287 // result: (AND (NEGV <t> (SGTU (MOVVconst <typ.UInt64> [64]) (ZeroExt8to64 y))) (SRLV <t> (ZeroExt8to64 x) (ZeroExt8to64 y)))
7288 for {
7289 t := v.Type
7290 x := v_0
7291 y := v_1
7292 v.reset(OpMIPS64AND)
7293 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7294 v1 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
7295 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7296 v2.AuxInt = int64ToAuxInt(64)
7297 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
7298 v3.AddArg(y)
7299 v1.AddArg2(v2, v3)
7300 v0.AddArg(v1)
7301 v4 := b.NewValue0(v.Pos, OpMIPS64SRLV, t)
7302 v5 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
7303 v5.AddArg(x)
7304 v4.AddArg2(v5, v3)
7305 v.AddArg2(v0, v4)
7306 return true
7307 }
7308 }
7309 func rewriteValueMIPS64_OpRsh8x16(v *Value) bool {
7310 v_1 := v.Args[1]
7311 v_0 := v.Args[0]
7312 b := v.Block
7313 typ := &b.Func.Config.Types
7314 // match: (Rsh8x16 <t> x y)
7315 // result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt16to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt16to64 y)))
7316 for {
7317 t := v.Type
7318 x := v_0
7319 y := v_1
7320 v.reset(OpMIPS64SRAV)
7321 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
7322 v0.AddArg(x)
7323 v1 := b.NewValue0(v.Pos, OpMIPS64OR, t)
7324 v2 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7325 v3 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
7326 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
7327 v4.AddArg(y)
7328 v5 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7329 v5.AuxInt = int64ToAuxInt(63)
7330 v3.AddArg2(v4, v5)
7331 v2.AddArg(v3)
7332 v1.AddArg2(v2, v4)
7333 v.AddArg2(v0, v1)
7334 return true
7335 }
7336 }
7337 func rewriteValueMIPS64_OpRsh8x32(v *Value) bool {
7338 v_1 := v.Args[1]
7339 v_0 := v.Args[0]
7340 b := v.Block
7341 typ := &b.Func.Config.Types
7342 // match: (Rsh8x32 <t> x y)
7343 // result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt32to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt32to64 y)))
7344 for {
7345 t := v.Type
7346 x := v_0
7347 y := v_1
7348 v.reset(OpMIPS64SRAV)
7349 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
7350 v0.AddArg(x)
7351 v1 := b.NewValue0(v.Pos, OpMIPS64OR, t)
7352 v2 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7353 v3 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
7354 v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
7355 v4.AddArg(y)
7356 v5 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7357 v5.AuxInt = int64ToAuxInt(63)
7358 v3.AddArg2(v4, v5)
7359 v2.AddArg(v3)
7360 v1.AddArg2(v2, v4)
7361 v.AddArg2(v0, v1)
7362 return true
7363 }
7364 }
7365 func rewriteValueMIPS64_OpRsh8x64(v *Value) bool {
7366 v_1 := v.Args[1]
7367 v_0 := v.Args[0]
7368 b := v.Block
7369 typ := &b.Func.Config.Types
7370 // match: (Rsh8x64 <t> x y)
7371 // result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU y (MOVVconst <typ.UInt64> [63]))) y))
7372 for {
7373 t := v.Type
7374 x := v_0
7375 y := v_1
7376 v.reset(OpMIPS64SRAV)
7377 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
7378 v0.AddArg(x)
7379 v1 := b.NewValue0(v.Pos, OpMIPS64OR, t)
7380 v2 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7381 v3 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
7382 v4 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7383 v4.AuxInt = int64ToAuxInt(63)
7384 v3.AddArg2(y, v4)
7385 v2.AddArg(v3)
7386 v1.AddArg2(v2, y)
7387 v.AddArg2(v0, v1)
7388 return true
7389 }
7390 }
7391 func rewriteValueMIPS64_OpRsh8x8(v *Value) bool {
7392 v_1 := v.Args[1]
7393 v_0 := v.Args[0]
7394 b := v.Block
7395 typ := &b.Func.Config.Types
7396 // match: (Rsh8x8 <t> x y)
7397 // result: (SRAV (SignExt8to64 x) (OR <t> (NEGV <t> (SGTU (ZeroExt8to64 y) (MOVVconst <typ.UInt64> [63]))) (ZeroExt8to64 y)))
7398 for {
7399 t := v.Type
7400 x := v_0
7401 y := v_1
7402 v.reset(OpMIPS64SRAV)
7403 v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
7404 v0.AddArg(x)
7405 v1 := b.NewValue0(v.Pos, OpMIPS64OR, t)
7406 v2 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7407 v3 := b.NewValue0(v.Pos, OpMIPS64SGTU, typ.Bool)
7408 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
7409 v4.AddArg(y)
7410 v5 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7411 v5.AuxInt = int64ToAuxInt(63)
7412 v3.AddArg2(v4, v5)
7413 v2.AddArg(v3)
7414 v1.AddArg2(v2, v4)
7415 v.AddArg2(v0, v1)
7416 return true
7417 }
7418 }
7419 func rewriteValueMIPS64_OpSelect0(v *Value) bool {
7420 v_0 := v.Args[0]
7421 b := v.Block
7422 typ := &b.Func.Config.Types
7423 // match: (Select0 (Mul64uover x y))
7424 // result: (Select1 <typ.UInt64> (MULVU x y))
7425 for {
7426 if v_0.Op != OpMul64uover {
7427 break
7428 }
7429 y := v_0.Args[1]
7430 x := v_0.Args[0]
7431 v.reset(OpSelect1)
7432 v.Type = typ.UInt64
7433 v0 := b.NewValue0(v.Pos, OpMIPS64MULVU, types.NewTuple(typ.UInt64, typ.UInt64))
7434 v0.AddArg2(x, y)
7435 v.AddArg(v0)
7436 return true
7437 }
7438 // match: (Select0 <t> (Add64carry x y c))
7439 // result: (ADDV (ADDV <t> x y) c)
7440 for {
7441 t := v.Type
7442 if v_0.Op != OpAdd64carry {
7443 break
7444 }
7445 c := v_0.Args[2]
7446 x := v_0.Args[0]
7447 y := v_0.Args[1]
7448 v.reset(OpMIPS64ADDV)
7449 v0 := b.NewValue0(v.Pos, OpMIPS64ADDV, t)
7450 v0.AddArg2(x, y)
7451 v.AddArg2(v0, c)
7452 return true
7453 }
7454 // match: (Select0 <t> (Sub64borrow x y c))
7455 // result: (SUBV (SUBV <t> x y) c)
7456 for {
7457 t := v.Type
7458 if v_0.Op != OpSub64borrow {
7459 break
7460 }
7461 c := v_0.Args[2]
7462 x := v_0.Args[0]
7463 y := v_0.Args[1]
7464 v.reset(OpMIPS64SUBV)
7465 v0 := b.NewValue0(v.Pos, OpMIPS64SUBV, t)
7466 v0.AddArg2(x, y)
7467 v.AddArg2(v0, c)
7468 return true
7469 }
7470 // match: (Select0 (DIVVU _ (MOVVconst [1])))
7471 // result: (MOVVconst [0])
7472 for {
7473 if v_0.Op != OpMIPS64DIVVU {
7474 break
7475 }
7476 _ = v_0.Args[1]
7477 v_0_1 := v_0.Args[1]
7478 if v_0_1.Op != OpMIPS64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 1 {
7479 break
7480 }
7481 v.reset(OpMIPS64MOVVconst)
7482 v.AuxInt = int64ToAuxInt(0)
7483 return true
7484 }
7485 // match: (Select0 (DIVVU x (MOVVconst [c])))
7486 // cond: isPowerOfTwo(c)
7487 // result: (ANDconst [c-1] x)
7488 for {
7489 if v_0.Op != OpMIPS64DIVVU {
7490 break
7491 }
7492 _ = v_0.Args[1]
7493 x := v_0.Args[0]
7494 v_0_1 := v_0.Args[1]
7495 if v_0_1.Op != OpMIPS64MOVVconst {
7496 break
7497 }
7498 c := auxIntToInt64(v_0_1.AuxInt)
7499 if !(isPowerOfTwo(c)) {
7500 break
7501 }
7502 v.reset(OpMIPS64ANDconst)
7503 v.AuxInt = int64ToAuxInt(c - 1)
7504 v.AddArg(x)
7505 return true
7506 }
7507 // match: (Select0 (DIVV (MOVVconst [c]) (MOVVconst [d])))
7508 // cond: d != 0
7509 // result: (MOVVconst [c%d])
7510 for {
7511 if v_0.Op != OpMIPS64DIVV {
7512 break
7513 }
7514 _ = v_0.Args[1]
7515 v_0_0 := v_0.Args[0]
7516 if v_0_0.Op != OpMIPS64MOVVconst {
7517 break
7518 }
7519 c := auxIntToInt64(v_0_0.AuxInt)
7520 v_0_1 := v_0.Args[1]
7521 if v_0_1.Op != OpMIPS64MOVVconst {
7522 break
7523 }
7524 d := auxIntToInt64(v_0_1.AuxInt)
7525 if !(d != 0) {
7526 break
7527 }
7528 v.reset(OpMIPS64MOVVconst)
7529 v.AuxInt = int64ToAuxInt(c % d)
7530 return true
7531 }
7532 // match: (Select0 (DIVVU (MOVVconst [c]) (MOVVconst [d])))
7533 // cond: d != 0
7534 // result: (MOVVconst [int64(uint64(c)%uint64(d))])
7535 for {
7536 if v_0.Op != OpMIPS64DIVVU {
7537 break
7538 }
7539 _ = v_0.Args[1]
7540 v_0_0 := v_0.Args[0]
7541 if v_0_0.Op != OpMIPS64MOVVconst {
7542 break
7543 }
7544 c := auxIntToInt64(v_0_0.AuxInt)
7545 v_0_1 := v_0.Args[1]
7546 if v_0_1.Op != OpMIPS64MOVVconst {
7547 break
7548 }
7549 d := auxIntToInt64(v_0_1.AuxInt)
7550 if !(d != 0) {
7551 break
7552 }
7553 v.reset(OpMIPS64MOVVconst)
7554 v.AuxInt = int64ToAuxInt(int64(uint64(c) % uint64(d)))
7555 return true
7556 }
7557 return false
7558 }
7559 func rewriteValueMIPS64_OpSelect1(v *Value) bool {
7560 v_0 := v.Args[0]
7561 b := v.Block
7562 typ := &b.Func.Config.Types
7563 // match: (Select1 (Mul64uover x y))
7564 // result: (SGTU <typ.Bool> (Select0 <typ.UInt64> (MULVU x y)) (MOVVconst <typ.UInt64> [0]))
7565 for {
7566 if v_0.Op != OpMul64uover {
7567 break
7568 }
7569 y := v_0.Args[1]
7570 x := v_0.Args[0]
7571 v.reset(OpMIPS64SGTU)
7572 v.Type = typ.Bool
7573 v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
7574 v1 := b.NewValue0(v.Pos, OpMIPS64MULVU, types.NewTuple(typ.UInt64, typ.UInt64))
7575 v1.AddArg2(x, y)
7576 v0.AddArg(v1)
7577 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7578 v2.AuxInt = int64ToAuxInt(0)
7579 v.AddArg2(v0, v2)
7580 return true
7581 }
7582 // match: (Select1 <t> (Add64carry x y c))
7583 // result: (OR (SGTU <t> x s:(ADDV <t> x y)) (SGTU <t> s (ADDV <t> s c)))
7584 for {
7585 t := v.Type
7586 if v_0.Op != OpAdd64carry {
7587 break
7588 }
7589 c := v_0.Args[2]
7590 x := v_0.Args[0]
7591 y := v_0.Args[1]
7592 v.reset(OpMIPS64OR)
7593 v0 := b.NewValue0(v.Pos, OpMIPS64SGTU, t)
7594 s := b.NewValue0(v.Pos, OpMIPS64ADDV, t)
7595 s.AddArg2(x, y)
7596 v0.AddArg2(x, s)
7597 v2 := b.NewValue0(v.Pos, OpMIPS64SGTU, t)
7598 v3 := b.NewValue0(v.Pos, OpMIPS64ADDV, t)
7599 v3.AddArg2(s, c)
7600 v2.AddArg2(s, v3)
7601 v.AddArg2(v0, v2)
7602 return true
7603 }
7604 // match: (Select1 <t> (Sub64borrow x y c))
7605 // result: (OR (SGTU <t> s:(SUBV <t> x y) x) (SGTU <t> (SUBV <t> s c) s))
7606 for {
7607 t := v.Type
7608 if v_0.Op != OpSub64borrow {
7609 break
7610 }
7611 c := v_0.Args[2]
7612 x := v_0.Args[0]
7613 y := v_0.Args[1]
7614 v.reset(OpMIPS64OR)
7615 v0 := b.NewValue0(v.Pos, OpMIPS64SGTU, t)
7616 s := b.NewValue0(v.Pos, OpMIPS64SUBV, t)
7617 s.AddArg2(x, y)
7618 v0.AddArg2(s, x)
7619 v2 := b.NewValue0(v.Pos, OpMIPS64SGTU, t)
7620 v3 := b.NewValue0(v.Pos, OpMIPS64SUBV, t)
7621 v3.AddArg2(s, c)
7622 v2.AddArg2(v3, s)
7623 v.AddArg2(v0, v2)
7624 return true
7625 }
7626 // match: (Select1 (MULVU x (MOVVconst [-1])))
7627 // result: (NEGV x)
7628 for {
7629 if v_0.Op != OpMIPS64MULVU {
7630 break
7631 }
7632 _ = v_0.Args[1]
7633 v_0_0 := v_0.Args[0]
7634 v_0_1 := v_0.Args[1]
7635 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7636 x := v_0_0
7637 if v_0_1.Op != OpMIPS64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != -1 {
7638 continue
7639 }
7640 v.reset(OpMIPS64NEGV)
7641 v.AddArg(x)
7642 return true
7643 }
7644 break
7645 }
7646 // match: (Select1 (MULVU _ (MOVVconst [0])))
7647 // result: (MOVVconst [0])
7648 for {
7649 if v_0.Op != OpMIPS64MULVU {
7650 break
7651 }
7652 _ = v_0.Args[1]
7653 v_0_0 := v_0.Args[0]
7654 v_0_1 := v_0.Args[1]
7655 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7656 if v_0_1.Op != OpMIPS64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
7657 continue
7658 }
7659 v.reset(OpMIPS64MOVVconst)
7660 v.AuxInt = int64ToAuxInt(0)
7661 return true
7662 }
7663 break
7664 }
7665 // match: (Select1 (MULVU x (MOVVconst [1])))
7666 // result: x
7667 for {
7668 if v_0.Op != OpMIPS64MULVU {
7669 break
7670 }
7671 _ = v_0.Args[1]
7672 v_0_0 := v_0.Args[0]
7673 v_0_1 := v_0.Args[1]
7674 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7675 x := v_0_0
7676 if v_0_1.Op != OpMIPS64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 1 {
7677 continue
7678 }
7679 v.copyOf(x)
7680 return true
7681 }
7682 break
7683 }
7684 // match: (Select1 (MULVU x (MOVVconst [c])))
7685 // cond: isPowerOfTwo(c)
7686 // result: (SLLVconst [log64(c)] x)
7687 for {
7688 if v_0.Op != OpMIPS64MULVU {
7689 break
7690 }
7691 _ = v_0.Args[1]
7692 v_0_0 := v_0.Args[0]
7693 v_0_1 := v_0.Args[1]
7694 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7695 x := v_0_0
7696 if v_0_1.Op != OpMIPS64MOVVconst {
7697 continue
7698 }
7699 c := auxIntToInt64(v_0_1.AuxInt)
7700 if !(isPowerOfTwo(c)) {
7701 continue
7702 }
7703 v.reset(OpMIPS64SLLVconst)
7704 v.AuxInt = int64ToAuxInt(log64(c))
7705 v.AddArg(x)
7706 return true
7707 }
7708 break
7709 }
7710 // match: (Select1 (DIVVU x (MOVVconst [1])))
7711 // result: x
7712 for {
7713 if v_0.Op != OpMIPS64DIVVU {
7714 break
7715 }
7716 _ = v_0.Args[1]
7717 x := v_0.Args[0]
7718 v_0_1 := v_0.Args[1]
7719 if v_0_1.Op != OpMIPS64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 1 {
7720 break
7721 }
7722 v.copyOf(x)
7723 return true
7724 }
7725 // match: (Select1 (DIVVU x (MOVVconst [c])))
7726 // cond: isPowerOfTwo(c)
7727 // result: (SRLVconst [log64(c)] x)
7728 for {
7729 if v_0.Op != OpMIPS64DIVVU {
7730 break
7731 }
7732 _ = v_0.Args[1]
7733 x := v_0.Args[0]
7734 v_0_1 := v_0.Args[1]
7735 if v_0_1.Op != OpMIPS64MOVVconst {
7736 break
7737 }
7738 c := auxIntToInt64(v_0_1.AuxInt)
7739 if !(isPowerOfTwo(c)) {
7740 break
7741 }
7742 v.reset(OpMIPS64SRLVconst)
7743 v.AuxInt = int64ToAuxInt(log64(c))
7744 v.AddArg(x)
7745 return true
7746 }
7747 // match: (Select1 (MULVU (MOVVconst [c]) (MOVVconst [d])))
7748 // result: (MOVVconst [c*d])
7749 for {
7750 if v_0.Op != OpMIPS64MULVU {
7751 break
7752 }
7753 _ = v_0.Args[1]
7754 v_0_0 := v_0.Args[0]
7755 v_0_1 := v_0.Args[1]
7756 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7757 if v_0_0.Op != OpMIPS64MOVVconst {
7758 continue
7759 }
7760 c := auxIntToInt64(v_0_0.AuxInt)
7761 if v_0_1.Op != OpMIPS64MOVVconst {
7762 continue
7763 }
7764 d := auxIntToInt64(v_0_1.AuxInt)
7765 v.reset(OpMIPS64MOVVconst)
7766 v.AuxInt = int64ToAuxInt(c * d)
7767 return true
7768 }
7769 break
7770 }
7771 // match: (Select1 (DIVV (MOVVconst [c]) (MOVVconst [d])))
7772 // cond: d != 0
7773 // result: (MOVVconst [c/d])
7774 for {
7775 if v_0.Op != OpMIPS64DIVV {
7776 break
7777 }
7778 _ = v_0.Args[1]
7779 v_0_0 := v_0.Args[0]
7780 if v_0_0.Op != OpMIPS64MOVVconst {
7781 break
7782 }
7783 c := auxIntToInt64(v_0_0.AuxInt)
7784 v_0_1 := v_0.Args[1]
7785 if v_0_1.Op != OpMIPS64MOVVconst {
7786 break
7787 }
7788 d := auxIntToInt64(v_0_1.AuxInt)
7789 if !(d != 0) {
7790 break
7791 }
7792 v.reset(OpMIPS64MOVVconst)
7793 v.AuxInt = int64ToAuxInt(c / d)
7794 return true
7795 }
7796 // match: (Select1 (DIVVU (MOVVconst [c]) (MOVVconst [d])))
7797 // cond: d != 0
7798 // result: (MOVVconst [int64(uint64(c)/uint64(d))])
7799 for {
7800 if v_0.Op != OpMIPS64DIVVU {
7801 break
7802 }
7803 _ = v_0.Args[1]
7804 v_0_0 := v_0.Args[0]
7805 if v_0_0.Op != OpMIPS64MOVVconst {
7806 break
7807 }
7808 c := auxIntToInt64(v_0_0.AuxInt)
7809 v_0_1 := v_0.Args[1]
7810 if v_0_1.Op != OpMIPS64MOVVconst {
7811 break
7812 }
7813 d := auxIntToInt64(v_0_1.AuxInt)
7814 if !(d != 0) {
7815 break
7816 }
7817 v.reset(OpMIPS64MOVVconst)
7818 v.AuxInt = int64ToAuxInt(int64(uint64(c) / uint64(d)))
7819 return true
7820 }
7821 return false
7822 }
7823 func rewriteValueMIPS64_OpSlicemask(v *Value) bool {
7824 v_0 := v.Args[0]
7825 b := v.Block
7826 // match: (Slicemask <t> x)
7827 // result: (SRAVconst (NEGV <t> x) [63])
7828 for {
7829 t := v.Type
7830 x := v_0
7831 v.reset(OpMIPS64SRAVconst)
7832 v.AuxInt = int64ToAuxInt(63)
7833 v0 := b.NewValue0(v.Pos, OpMIPS64NEGV, t)
7834 v0.AddArg(x)
7835 v.AddArg(v0)
7836 return true
7837 }
7838 }
7839 func rewriteValueMIPS64_OpStore(v *Value) bool {
7840 v_2 := v.Args[2]
7841 v_1 := v.Args[1]
7842 v_0 := v.Args[0]
7843 // match: (Store {t} ptr val mem)
7844 // cond: t.Size() == 1
7845 // result: (MOVBstore ptr val mem)
7846 for {
7847 t := auxToType(v.Aux)
7848 ptr := v_0
7849 val := v_1
7850 mem := v_2
7851 if !(t.Size() == 1) {
7852 break
7853 }
7854 v.reset(OpMIPS64MOVBstore)
7855 v.AddArg3(ptr, val, mem)
7856 return true
7857 }
7858 // match: (Store {t} ptr val mem)
7859 // cond: t.Size() == 2
7860 // result: (MOVHstore ptr val mem)
7861 for {
7862 t := auxToType(v.Aux)
7863 ptr := v_0
7864 val := v_1
7865 mem := v_2
7866 if !(t.Size() == 2) {
7867 break
7868 }
7869 v.reset(OpMIPS64MOVHstore)
7870 v.AddArg3(ptr, val, mem)
7871 return true
7872 }
7873 // match: (Store {t} ptr val mem)
7874 // cond: t.Size() == 4 && !t.IsFloat()
7875 // result: (MOVWstore ptr val mem)
7876 for {
7877 t := auxToType(v.Aux)
7878 ptr := v_0
7879 val := v_1
7880 mem := v_2
7881 if !(t.Size() == 4 && !t.IsFloat()) {
7882 break
7883 }
7884 v.reset(OpMIPS64MOVWstore)
7885 v.AddArg3(ptr, val, mem)
7886 return true
7887 }
7888 // match: (Store {t} ptr val mem)
7889 // cond: t.Size() == 8 && !t.IsFloat()
7890 // result: (MOVVstore ptr val mem)
7891 for {
7892 t := auxToType(v.Aux)
7893 ptr := v_0
7894 val := v_1
7895 mem := v_2
7896 if !(t.Size() == 8 && !t.IsFloat()) {
7897 break
7898 }
7899 v.reset(OpMIPS64MOVVstore)
7900 v.AddArg3(ptr, val, mem)
7901 return true
7902 }
7903 // match: (Store {t} ptr val mem)
7904 // cond: t.Size() == 4 && t.IsFloat()
7905 // result: (MOVFstore ptr val mem)
7906 for {
7907 t := auxToType(v.Aux)
7908 ptr := v_0
7909 val := v_1
7910 mem := v_2
7911 if !(t.Size() == 4 && t.IsFloat()) {
7912 break
7913 }
7914 v.reset(OpMIPS64MOVFstore)
7915 v.AddArg3(ptr, val, mem)
7916 return true
7917 }
7918 // match: (Store {t} ptr val mem)
7919 // cond: t.Size() == 8 && t.IsFloat()
7920 // result: (MOVDstore ptr val mem)
7921 for {
7922 t := auxToType(v.Aux)
7923 ptr := v_0
7924 val := v_1
7925 mem := v_2
7926 if !(t.Size() == 8 && t.IsFloat()) {
7927 break
7928 }
7929 v.reset(OpMIPS64MOVDstore)
7930 v.AddArg3(ptr, val, mem)
7931 return true
7932 }
7933 return false
7934 }
7935 func rewriteValueMIPS64_OpZero(v *Value) bool {
7936 v_1 := v.Args[1]
7937 v_0 := v.Args[0]
7938 b := v.Block
7939 config := b.Func.Config
7940 typ := &b.Func.Config.Types
7941 // match: (Zero [0] _ mem)
7942 // result: mem
7943 for {
7944 if auxIntToInt64(v.AuxInt) != 0 {
7945 break
7946 }
7947 mem := v_1
7948 v.copyOf(mem)
7949 return true
7950 }
7951 // match: (Zero [1] ptr mem)
7952 // result: (MOVBstore ptr (MOVVconst [0]) mem)
7953 for {
7954 if auxIntToInt64(v.AuxInt) != 1 {
7955 break
7956 }
7957 ptr := v_0
7958 mem := v_1
7959 v.reset(OpMIPS64MOVBstore)
7960 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7961 v0.AuxInt = int64ToAuxInt(0)
7962 v.AddArg3(ptr, v0, mem)
7963 return true
7964 }
7965 // match: (Zero [2] {t} ptr mem)
7966 // cond: t.Alignment()%2 == 0
7967 // result: (MOVHstore ptr (MOVVconst [0]) mem)
7968 for {
7969 if auxIntToInt64(v.AuxInt) != 2 {
7970 break
7971 }
7972 t := auxToType(v.Aux)
7973 ptr := v_0
7974 mem := v_1
7975 if !(t.Alignment()%2 == 0) {
7976 break
7977 }
7978 v.reset(OpMIPS64MOVHstore)
7979 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7980 v0.AuxInt = int64ToAuxInt(0)
7981 v.AddArg3(ptr, v0, mem)
7982 return true
7983 }
7984 // match: (Zero [2] ptr mem)
7985 // result: (MOVBstore [1] ptr (MOVVconst [0]) (MOVBstore [0] ptr (MOVVconst [0]) mem))
7986 for {
7987 if auxIntToInt64(v.AuxInt) != 2 {
7988 break
7989 }
7990 ptr := v_0
7991 mem := v_1
7992 v.reset(OpMIPS64MOVBstore)
7993 v.AuxInt = int32ToAuxInt(1)
7994 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
7995 v0.AuxInt = int64ToAuxInt(0)
7996 v1 := b.NewValue0(v.Pos, OpMIPS64MOVBstore, types.TypeMem)
7997 v1.AuxInt = int32ToAuxInt(0)
7998 v1.AddArg3(ptr, v0, mem)
7999 v.AddArg3(ptr, v0, v1)
8000 return true
8001 }
8002 // match: (Zero [4] {t} ptr mem)
8003 // cond: t.Alignment()%4 == 0
8004 // result: (MOVWstore ptr (MOVVconst [0]) mem)
8005 for {
8006 if auxIntToInt64(v.AuxInt) != 4 {
8007 break
8008 }
8009 t := auxToType(v.Aux)
8010 ptr := v_0
8011 mem := v_1
8012 if !(t.Alignment()%4 == 0) {
8013 break
8014 }
8015 v.reset(OpMIPS64MOVWstore)
8016 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
8017 v0.AuxInt = int64ToAuxInt(0)
8018 v.AddArg3(ptr, v0, mem)
8019 return true
8020 }
8021 // match: (Zero [4] {t} ptr mem)
8022 // cond: t.Alignment()%2 == 0
8023 // result: (MOVHstore [2] ptr (MOVVconst [0]) (MOVHstore [0] ptr (MOVVconst [0]) mem))
8024 for {
8025 if auxIntToInt64(v.AuxInt) != 4 {
8026 break
8027 }
8028 t := auxToType(v.Aux)
8029 ptr := v_0
8030 mem := v_1
8031 if !(t.Alignment()%2 == 0) {
8032 break
8033 }
8034 v.reset(OpMIPS64MOVHstore)
8035 v.AuxInt = int32ToAuxInt(2)
8036 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
8037 v0.AuxInt = int64ToAuxInt(0)
8038 v1 := b.NewValue0(v.Pos, OpMIPS64MOVHstore, types.TypeMem)
8039 v1.AuxInt = int32ToAuxInt(0)
8040 v1.AddArg3(ptr, v0, mem)
8041 v.AddArg3(ptr, v0, v1)
8042 return true
8043 }
8044 // match: (Zero [4] ptr mem)
8045 // result: (MOVBstore [3] ptr (MOVVconst [0]) (MOVBstore [2] ptr (MOVVconst [0]) (MOVBstore [1] ptr (MOVVconst [0]) (MOVBstore [0] ptr (MOVVconst [0]) mem))))
8046 for {
8047 if auxIntToInt64(v.AuxInt) != 4 {
8048 break
8049 }
8050 ptr := v_0
8051 mem := v_1
8052 v.reset(OpMIPS64MOVBstore)
8053 v.AuxInt = int32ToAuxInt(3)
8054 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
8055 v0.AuxInt = int64ToAuxInt(0)
8056 v1 := b.NewValue0(v.Pos, OpMIPS64MOVBstore, types.TypeMem)
8057 v1.AuxInt = int32ToAuxInt(2)
8058 v2 := b.NewValue0(v.Pos, OpMIPS64MOVBstore, types.TypeMem)
8059 v2.AuxInt = int32ToAuxInt(1)
8060 v3 := b.NewValue0(v.Pos, OpMIPS64MOVBstore, types.TypeMem)
8061 v3.AuxInt = int32ToAuxInt(0)
8062 v3.AddArg3(ptr, v0, mem)
8063 v2.AddArg3(ptr, v0, v3)
8064 v1.AddArg3(ptr, v0, v2)
8065 v.AddArg3(ptr, v0, v1)
8066 return true
8067 }
8068 // match: (Zero [8] {t} ptr mem)
8069 // cond: t.Alignment()%8 == 0
8070 // result: (MOVVstore ptr (MOVVconst [0]) mem)
8071 for {
8072 if auxIntToInt64(v.AuxInt) != 8 {
8073 break
8074 }
8075 t := auxToType(v.Aux)
8076 ptr := v_0
8077 mem := v_1
8078 if !(t.Alignment()%8 == 0) {
8079 break
8080 }
8081 v.reset(OpMIPS64MOVVstore)
8082 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
8083 v0.AuxInt = int64ToAuxInt(0)
8084 v.AddArg3(ptr, v0, mem)
8085 return true
8086 }
8087 // match: (Zero [8] {t} ptr mem)
8088 // cond: t.Alignment()%4 == 0
8089 // result: (MOVWstore [4] ptr (MOVVconst [0]) (MOVWstore [0] ptr (MOVVconst [0]) mem))
8090 for {
8091 if auxIntToInt64(v.AuxInt) != 8 {
8092 break
8093 }
8094 t := auxToType(v.Aux)
8095 ptr := v_0
8096 mem := v_1
8097 if !(t.Alignment()%4 == 0) {
8098 break
8099 }
8100 v.reset(OpMIPS64MOVWstore)
8101 v.AuxInt = int32ToAuxInt(4)
8102 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
8103 v0.AuxInt = int64ToAuxInt(0)
8104 v1 := b.NewValue0(v.Pos, OpMIPS64MOVWstore, types.TypeMem)
8105 v1.AuxInt = int32ToAuxInt(0)
8106 v1.AddArg3(ptr, v0, mem)
8107 v.AddArg3(ptr, v0, v1)
8108 return true
8109 }
8110 // match: (Zero [8] {t} ptr mem)
8111 // cond: t.Alignment()%2 == 0
8112 // result: (MOVHstore [6] ptr (MOVVconst [0]) (MOVHstore [4] ptr (MOVVconst [0]) (MOVHstore [2] ptr (MOVVconst [0]) (MOVHstore [0] ptr (MOVVconst [0]) mem))))
8113 for {
8114 if auxIntToInt64(v.AuxInt) != 8 {
8115 break
8116 }
8117 t := auxToType(v.Aux)
8118 ptr := v_0
8119 mem := v_1
8120 if !(t.Alignment()%2 == 0) {
8121 break
8122 }
8123 v.reset(OpMIPS64MOVHstore)
8124 v.AuxInt = int32ToAuxInt(6)
8125 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
8126 v0.AuxInt = int64ToAuxInt(0)
8127 v1 := b.NewValue0(v.Pos, OpMIPS64MOVHstore, types.TypeMem)
8128 v1.AuxInt = int32ToAuxInt(4)
8129 v2 := b.NewValue0(v.Pos, OpMIPS64MOVHstore, types.TypeMem)
8130 v2.AuxInt = int32ToAuxInt(2)
8131 v3 := b.NewValue0(v.Pos, OpMIPS64MOVHstore, types.TypeMem)
8132 v3.AuxInt = int32ToAuxInt(0)
8133 v3.AddArg3(ptr, v0, mem)
8134 v2.AddArg3(ptr, v0, v3)
8135 v1.AddArg3(ptr, v0, v2)
8136 v.AddArg3(ptr, v0, v1)
8137 return true
8138 }
8139 // match: (Zero [3] ptr mem)
8140 // result: (MOVBstore [2] ptr (MOVVconst [0]) (MOVBstore [1] ptr (MOVVconst [0]) (MOVBstore [0] ptr (MOVVconst [0]) mem)))
8141 for {
8142 if auxIntToInt64(v.AuxInt) != 3 {
8143 break
8144 }
8145 ptr := v_0
8146 mem := v_1
8147 v.reset(OpMIPS64MOVBstore)
8148 v.AuxInt = int32ToAuxInt(2)
8149 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
8150 v0.AuxInt = int64ToAuxInt(0)
8151 v1 := b.NewValue0(v.Pos, OpMIPS64MOVBstore, types.TypeMem)
8152 v1.AuxInt = int32ToAuxInt(1)
8153 v2 := b.NewValue0(v.Pos, OpMIPS64MOVBstore, types.TypeMem)
8154 v2.AuxInt = int32ToAuxInt(0)
8155 v2.AddArg3(ptr, v0, mem)
8156 v1.AddArg3(ptr, v0, v2)
8157 v.AddArg3(ptr, v0, v1)
8158 return true
8159 }
8160 // match: (Zero [6] {t} ptr mem)
8161 // cond: t.Alignment()%2 == 0
8162 // result: (MOVHstore [4] ptr (MOVVconst [0]) (MOVHstore [2] ptr (MOVVconst [0]) (MOVHstore [0] ptr (MOVVconst [0]) mem)))
8163 for {
8164 if auxIntToInt64(v.AuxInt) != 6 {
8165 break
8166 }
8167 t := auxToType(v.Aux)
8168 ptr := v_0
8169 mem := v_1
8170 if !(t.Alignment()%2 == 0) {
8171 break
8172 }
8173 v.reset(OpMIPS64MOVHstore)
8174 v.AuxInt = int32ToAuxInt(4)
8175 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
8176 v0.AuxInt = int64ToAuxInt(0)
8177 v1 := b.NewValue0(v.Pos, OpMIPS64MOVHstore, types.TypeMem)
8178 v1.AuxInt = int32ToAuxInt(2)
8179 v2 := b.NewValue0(v.Pos, OpMIPS64MOVHstore, types.TypeMem)
8180 v2.AuxInt = int32ToAuxInt(0)
8181 v2.AddArg3(ptr, v0, mem)
8182 v1.AddArg3(ptr, v0, v2)
8183 v.AddArg3(ptr, v0, v1)
8184 return true
8185 }
8186 // match: (Zero [12] {t} ptr mem)
8187 // cond: t.Alignment()%4 == 0
8188 // result: (MOVWstore [8] ptr (MOVVconst [0]) (MOVWstore [4] ptr (MOVVconst [0]) (MOVWstore [0] ptr (MOVVconst [0]) mem)))
8189 for {
8190 if auxIntToInt64(v.AuxInt) != 12 {
8191 break
8192 }
8193 t := auxToType(v.Aux)
8194 ptr := v_0
8195 mem := v_1
8196 if !(t.Alignment()%4 == 0) {
8197 break
8198 }
8199 v.reset(OpMIPS64MOVWstore)
8200 v.AuxInt = int32ToAuxInt(8)
8201 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
8202 v0.AuxInt = int64ToAuxInt(0)
8203 v1 := b.NewValue0(v.Pos, OpMIPS64MOVWstore, types.TypeMem)
8204 v1.AuxInt = int32ToAuxInt(4)
8205 v2 := b.NewValue0(v.Pos, OpMIPS64MOVWstore, types.TypeMem)
8206 v2.AuxInt = int32ToAuxInt(0)
8207 v2.AddArg3(ptr, v0, mem)
8208 v1.AddArg3(ptr, v0, v2)
8209 v.AddArg3(ptr, v0, v1)
8210 return true
8211 }
8212 // match: (Zero [16] {t} ptr mem)
8213 // cond: t.Alignment()%8 == 0
8214 // result: (MOVVstore [8] ptr (MOVVconst [0]) (MOVVstore [0] ptr (MOVVconst [0]) mem))
8215 for {
8216 if auxIntToInt64(v.AuxInt) != 16 {
8217 break
8218 }
8219 t := auxToType(v.Aux)
8220 ptr := v_0
8221 mem := v_1
8222 if !(t.Alignment()%8 == 0) {
8223 break
8224 }
8225 v.reset(OpMIPS64MOVVstore)
8226 v.AuxInt = int32ToAuxInt(8)
8227 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
8228 v0.AuxInt = int64ToAuxInt(0)
8229 v1 := b.NewValue0(v.Pos, OpMIPS64MOVVstore, types.TypeMem)
8230 v1.AuxInt = int32ToAuxInt(0)
8231 v1.AddArg3(ptr, v0, mem)
8232 v.AddArg3(ptr, v0, v1)
8233 return true
8234 }
8235 // match: (Zero [24] {t} ptr mem)
8236 // cond: t.Alignment()%8 == 0
8237 // result: (MOVVstore [16] ptr (MOVVconst [0]) (MOVVstore [8] ptr (MOVVconst [0]) (MOVVstore [0] ptr (MOVVconst [0]) mem)))
8238 for {
8239 if auxIntToInt64(v.AuxInt) != 24 {
8240 break
8241 }
8242 t := auxToType(v.Aux)
8243 ptr := v_0
8244 mem := v_1
8245 if !(t.Alignment()%8 == 0) {
8246 break
8247 }
8248 v.reset(OpMIPS64MOVVstore)
8249 v.AuxInt = int32ToAuxInt(16)
8250 v0 := b.NewValue0(v.Pos, OpMIPS64MOVVconst, typ.UInt64)
8251 v0.AuxInt = int64ToAuxInt(0)
8252 v1 := b.NewValue0(v.Pos, OpMIPS64MOVVstore, types.TypeMem)
8253 v1.AuxInt = int32ToAuxInt(8)
8254 v2 := b.NewValue0(v.Pos, OpMIPS64MOVVstore, types.TypeMem)
8255 v2.AuxInt = int32ToAuxInt(0)
8256 v2.AddArg3(ptr, v0, mem)
8257 v1.AddArg3(ptr, v0, v2)
8258 v.AddArg3(ptr, v0, v1)
8259 return true
8260 }
8261 // match: (Zero [s] {t} ptr mem)
8262 // cond: s%8 == 0 && s > 24 && s <= 8*128 && t.Alignment()%8 == 0
8263 // result: (DUFFZERO [8 * (128 - s/8)] ptr mem)
8264 for {
8265 s := auxIntToInt64(v.AuxInt)
8266 t := auxToType(v.Aux)
8267 ptr := v_0
8268 mem := v_1
8269 if !(s%8 == 0 && s > 24 && s <= 8*128 && t.Alignment()%8 == 0) {
8270 break
8271 }
8272 v.reset(OpMIPS64DUFFZERO)
8273 v.AuxInt = int64ToAuxInt(8 * (128 - s/8))
8274 v.AddArg2(ptr, mem)
8275 return true
8276 }
8277 // match: (Zero [s] {t} ptr mem)
8278 // cond: s > 8*128 || t.Alignment()%8 != 0
8279 // result: (LoweredZero [t.Alignment()] ptr (ADDVconst <ptr.Type> ptr [s-moveSize(t.Alignment(), config)]) mem)
8280 for {
8281 s := auxIntToInt64(v.AuxInt)
8282 t := auxToType(v.Aux)
8283 ptr := v_0
8284 mem := v_1
8285 if !(s > 8*128 || t.Alignment()%8 != 0) {
8286 break
8287 }
8288 v.reset(OpMIPS64LoweredZero)
8289 v.AuxInt = int64ToAuxInt(t.Alignment())
8290 v0 := b.NewValue0(v.Pos, OpMIPS64ADDVconst, ptr.Type)
8291 v0.AuxInt = int64ToAuxInt(s - moveSize(t.Alignment(), config))
8292 v0.AddArg(ptr)
8293 v.AddArg3(ptr, v0, mem)
8294 return true
8295 }
8296 return false
8297 }
8298 func rewriteBlockMIPS64(b *Block) bool {
8299 switch b.Kind {
8300 case BlockMIPS64EQ:
8301 // match: (EQ (FPFlagTrue cmp) yes no)
8302 // result: (FPF cmp yes no)
8303 for b.Controls[0].Op == OpMIPS64FPFlagTrue {
8304 v_0 := b.Controls[0]
8305 cmp := v_0.Args[0]
8306 b.resetWithControl(BlockMIPS64FPF, cmp)
8307 return true
8308 }
8309 // match: (EQ (FPFlagFalse cmp) yes no)
8310 // result: (FPT cmp yes no)
8311 for b.Controls[0].Op == OpMIPS64FPFlagFalse {
8312 v_0 := b.Controls[0]
8313 cmp := v_0.Args[0]
8314 b.resetWithControl(BlockMIPS64FPT, cmp)
8315 return true
8316 }
8317 // match: (EQ (XORconst [1] cmp:(SGT _ _)) yes no)
8318 // result: (NE cmp yes no)
8319 for b.Controls[0].Op == OpMIPS64XORconst {
8320 v_0 := b.Controls[0]
8321 if auxIntToInt64(v_0.AuxInt) != 1 {
8322 break
8323 }
8324 cmp := v_0.Args[0]
8325 if cmp.Op != OpMIPS64SGT {
8326 break
8327 }
8328 b.resetWithControl(BlockMIPS64NE, cmp)
8329 return true
8330 }
8331 // match: (EQ (XORconst [1] cmp:(SGTU _ _)) yes no)
8332 // result: (NE cmp yes no)
8333 for b.Controls[0].Op == OpMIPS64XORconst {
8334 v_0 := b.Controls[0]
8335 if auxIntToInt64(v_0.AuxInt) != 1 {
8336 break
8337 }
8338 cmp := v_0.Args[0]
8339 if cmp.Op != OpMIPS64SGTU {
8340 break
8341 }
8342 b.resetWithControl(BlockMIPS64NE, cmp)
8343 return true
8344 }
8345 // match: (EQ (XORconst [1] cmp:(SGTconst _)) yes no)
8346 // result: (NE cmp yes no)
8347 for b.Controls[0].Op == OpMIPS64XORconst {
8348 v_0 := b.Controls[0]
8349 if auxIntToInt64(v_0.AuxInt) != 1 {
8350 break
8351 }
8352 cmp := v_0.Args[0]
8353 if cmp.Op != OpMIPS64SGTconst {
8354 break
8355 }
8356 b.resetWithControl(BlockMIPS64NE, cmp)
8357 return true
8358 }
8359 // match: (EQ (XORconst [1] cmp:(SGTUconst _)) yes no)
8360 // result: (NE cmp yes no)
8361 for b.Controls[0].Op == OpMIPS64XORconst {
8362 v_0 := b.Controls[0]
8363 if auxIntToInt64(v_0.AuxInt) != 1 {
8364 break
8365 }
8366 cmp := v_0.Args[0]
8367 if cmp.Op != OpMIPS64SGTUconst {
8368 break
8369 }
8370 b.resetWithControl(BlockMIPS64NE, cmp)
8371 return true
8372 }
8373 // match: (EQ (SGTUconst [1] x) yes no)
8374 // result: (NE x yes no)
8375 for b.Controls[0].Op == OpMIPS64SGTUconst {
8376 v_0 := b.Controls[0]
8377 if auxIntToInt64(v_0.AuxInt) != 1 {
8378 break
8379 }
8380 x := v_0.Args[0]
8381 b.resetWithControl(BlockMIPS64NE, x)
8382 return true
8383 }
8384 // match: (EQ (SGTU x (MOVVconst [0])) yes no)
8385 // result: (EQ x yes no)
8386 for b.Controls[0].Op == OpMIPS64SGTU {
8387 v_0 := b.Controls[0]
8388 _ = v_0.Args[1]
8389 x := v_0.Args[0]
8390 v_0_1 := v_0.Args[1]
8391 if v_0_1.Op != OpMIPS64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
8392 break
8393 }
8394 b.resetWithControl(BlockMIPS64EQ, x)
8395 return true
8396 }
8397 // match: (EQ (SGTconst [0] x) yes no)
8398 // result: (GEZ x yes no)
8399 for b.Controls[0].Op == OpMIPS64SGTconst {
8400 v_0 := b.Controls[0]
8401 if auxIntToInt64(v_0.AuxInt) != 0 {
8402 break
8403 }
8404 x := v_0.Args[0]
8405 b.resetWithControl(BlockMIPS64GEZ, x)
8406 return true
8407 }
8408 // match: (EQ (SGT x (MOVVconst [0])) yes no)
8409 // result: (LEZ x yes no)
8410 for b.Controls[0].Op == OpMIPS64SGT {
8411 v_0 := b.Controls[0]
8412 _ = v_0.Args[1]
8413 x := v_0.Args[0]
8414 v_0_1 := v_0.Args[1]
8415 if v_0_1.Op != OpMIPS64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
8416 break
8417 }
8418 b.resetWithControl(BlockMIPS64LEZ, x)
8419 return true
8420 }
8421 // match: (EQ (MOVVconst [0]) yes no)
8422 // result: (First yes no)
8423 for b.Controls[0].Op == OpMIPS64MOVVconst {
8424 v_0 := b.Controls[0]
8425 if auxIntToInt64(v_0.AuxInt) != 0 {
8426 break
8427 }
8428 b.Reset(BlockFirst)
8429 return true
8430 }
8431 // match: (EQ (MOVVconst [c]) yes no)
8432 // cond: c != 0
8433 // result: (First no yes)
8434 for b.Controls[0].Op == OpMIPS64MOVVconst {
8435 v_0 := b.Controls[0]
8436 c := auxIntToInt64(v_0.AuxInt)
8437 if !(c != 0) {
8438 break
8439 }
8440 b.Reset(BlockFirst)
8441 b.swapSuccessors()
8442 return true
8443 }
8444 case BlockMIPS64GEZ:
8445 // match: (GEZ (MOVVconst [c]) yes no)
8446 // cond: c >= 0
8447 // result: (First yes no)
8448 for b.Controls[0].Op == OpMIPS64MOVVconst {
8449 v_0 := b.Controls[0]
8450 c := auxIntToInt64(v_0.AuxInt)
8451 if !(c >= 0) {
8452 break
8453 }
8454 b.Reset(BlockFirst)
8455 return true
8456 }
8457 // match: (GEZ (MOVVconst [c]) yes no)
8458 // cond: c < 0
8459 // result: (First no yes)
8460 for b.Controls[0].Op == OpMIPS64MOVVconst {
8461 v_0 := b.Controls[0]
8462 c := auxIntToInt64(v_0.AuxInt)
8463 if !(c < 0) {
8464 break
8465 }
8466 b.Reset(BlockFirst)
8467 b.swapSuccessors()
8468 return true
8469 }
8470 case BlockMIPS64GTZ:
8471 // match: (GTZ (MOVVconst [c]) yes no)
8472 // cond: c > 0
8473 // result: (First yes no)
8474 for b.Controls[0].Op == OpMIPS64MOVVconst {
8475 v_0 := b.Controls[0]
8476 c := auxIntToInt64(v_0.AuxInt)
8477 if !(c > 0) {
8478 break
8479 }
8480 b.Reset(BlockFirst)
8481 return true
8482 }
8483 // match: (GTZ (MOVVconst [c]) yes no)
8484 // cond: c <= 0
8485 // result: (First no yes)
8486 for b.Controls[0].Op == OpMIPS64MOVVconst {
8487 v_0 := b.Controls[0]
8488 c := auxIntToInt64(v_0.AuxInt)
8489 if !(c <= 0) {
8490 break
8491 }
8492 b.Reset(BlockFirst)
8493 b.swapSuccessors()
8494 return true
8495 }
8496 case BlockIf:
8497 // match: (If cond yes no)
8498 // result: (NE cond yes no)
8499 for {
8500 cond := b.Controls[0]
8501 b.resetWithControl(BlockMIPS64NE, cond)
8502 return true
8503 }
8504 case BlockMIPS64LEZ:
8505 // match: (LEZ (MOVVconst [c]) yes no)
8506 // cond: c <= 0
8507 // result: (First yes no)
8508 for b.Controls[0].Op == OpMIPS64MOVVconst {
8509 v_0 := b.Controls[0]
8510 c := auxIntToInt64(v_0.AuxInt)
8511 if !(c <= 0) {
8512 break
8513 }
8514 b.Reset(BlockFirst)
8515 return true
8516 }
8517 // match: (LEZ (MOVVconst [c]) yes no)
8518 // cond: c > 0
8519 // result: (First no yes)
8520 for b.Controls[0].Op == OpMIPS64MOVVconst {
8521 v_0 := b.Controls[0]
8522 c := auxIntToInt64(v_0.AuxInt)
8523 if !(c > 0) {
8524 break
8525 }
8526 b.Reset(BlockFirst)
8527 b.swapSuccessors()
8528 return true
8529 }
8530 case BlockMIPS64LTZ:
8531 // match: (LTZ (MOVVconst [c]) yes no)
8532 // cond: c < 0
8533 // result: (First yes no)
8534 for b.Controls[0].Op == OpMIPS64MOVVconst {
8535 v_0 := b.Controls[0]
8536 c := auxIntToInt64(v_0.AuxInt)
8537 if !(c < 0) {
8538 break
8539 }
8540 b.Reset(BlockFirst)
8541 return true
8542 }
8543 // match: (LTZ (MOVVconst [c]) yes no)
8544 // cond: c >= 0
8545 // result: (First no yes)
8546 for b.Controls[0].Op == OpMIPS64MOVVconst {
8547 v_0 := b.Controls[0]
8548 c := auxIntToInt64(v_0.AuxInt)
8549 if !(c >= 0) {
8550 break
8551 }
8552 b.Reset(BlockFirst)
8553 b.swapSuccessors()
8554 return true
8555 }
8556 case BlockMIPS64NE:
8557 // match: (NE (FPFlagTrue cmp) yes no)
8558 // result: (FPT cmp yes no)
8559 for b.Controls[0].Op == OpMIPS64FPFlagTrue {
8560 v_0 := b.Controls[0]
8561 cmp := v_0.Args[0]
8562 b.resetWithControl(BlockMIPS64FPT, cmp)
8563 return true
8564 }
8565 // match: (NE (FPFlagFalse cmp) yes no)
8566 // result: (FPF cmp yes no)
8567 for b.Controls[0].Op == OpMIPS64FPFlagFalse {
8568 v_0 := b.Controls[0]
8569 cmp := v_0.Args[0]
8570 b.resetWithControl(BlockMIPS64FPF, cmp)
8571 return true
8572 }
8573 // match: (NE (XORconst [1] cmp:(SGT _ _)) yes no)
8574 // result: (EQ cmp yes no)
8575 for b.Controls[0].Op == OpMIPS64XORconst {
8576 v_0 := b.Controls[0]
8577 if auxIntToInt64(v_0.AuxInt) != 1 {
8578 break
8579 }
8580 cmp := v_0.Args[0]
8581 if cmp.Op != OpMIPS64SGT {
8582 break
8583 }
8584 b.resetWithControl(BlockMIPS64EQ, cmp)
8585 return true
8586 }
8587 // match: (NE (XORconst [1] cmp:(SGTU _ _)) yes no)
8588 // result: (EQ cmp yes no)
8589 for b.Controls[0].Op == OpMIPS64XORconst {
8590 v_0 := b.Controls[0]
8591 if auxIntToInt64(v_0.AuxInt) != 1 {
8592 break
8593 }
8594 cmp := v_0.Args[0]
8595 if cmp.Op != OpMIPS64SGTU {
8596 break
8597 }
8598 b.resetWithControl(BlockMIPS64EQ, cmp)
8599 return true
8600 }
8601 // match: (NE (XORconst [1] cmp:(SGTconst _)) yes no)
8602 // result: (EQ cmp yes no)
8603 for b.Controls[0].Op == OpMIPS64XORconst {
8604 v_0 := b.Controls[0]
8605 if auxIntToInt64(v_0.AuxInt) != 1 {
8606 break
8607 }
8608 cmp := v_0.Args[0]
8609 if cmp.Op != OpMIPS64SGTconst {
8610 break
8611 }
8612 b.resetWithControl(BlockMIPS64EQ, cmp)
8613 return true
8614 }
8615 // match: (NE (XORconst [1] cmp:(SGTUconst _)) yes no)
8616 // result: (EQ cmp yes no)
8617 for b.Controls[0].Op == OpMIPS64XORconst {
8618 v_0 := b.Controls[0]
8619 if auxIntToInt64(v_0.AuxInt) != 1 {
8620 break
8621 }
8622 cmp := v_0.Args[0]
8623 if cmp.Op != OpMIPS64SGTUconst {
8624 break
8625 }
8626 b.resetWithControl(BlockMIPS64EQ, cmp)
8627 return true
8628 }
8629 // match: (NE (SGTUconst [1] x) yes no)
8630 // result: (EQ x yes no)
8631 for b.Controls[0].Op == OpMIPS64SGTUconst {
8632 v_0 := b.Controls[0]
8633 if auxIntToInt64(v_0.AuxInt) != 1 {
8634 break
8635 }
8636 x := v_0.Args[0]
8637 b.resetWithControl(BlockMIPS64EQ, x)
8638 return true
8639 }
8640 // match: (NE (SGTU x (MOVVconst [0])) yes no)
8641 // result: (NE x yes no)
8642 for b.Controls[0].Op == OpMIPS64SGTU {
8643 v_0 := b.Controls[0]
8644 _ = v_0.Args[1]
8645 x := v_0.Args[0]
8646 v_0_1 := v_0.Args[1]
8647 if v_0_1.Op != OpMIPS64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
8648 break
8649 }
8650 b.resetWithControl(BlockMIPS64NE, x)
8651 return true
8652 }
8653 // match: (NE (SGTconst [0] x) yes no)
8654 // result: (LTZ x yes no)
8655 for b.Controls[0].Op == OpMIPS64SGTconst {
8656 v_0 := b.Controls[0]
8657 if auxIntToInt64(v_0.AuxInt) != 0 {
8658 break
8659 }
8660 x := v_0.Args[0]
8661 b.resetWithControl(BlockMIPS64LTZ, x)
8662 return true
8663 }
8664 // match: (NE (SGT x (MOVVconst [0])) yes no)
8665 // result: (GTZ x yes no)
8666 for b.Controls[0].Op == OpMIPS64SGT {
8667 v_0 := b.Controls[0]
8668 _ = v_0.Args[1]
8669 x := v_0.Args[0]
8670 v_0_1 := v_0.Args[1]
8671 if v_0_1.Op != OpMIPS64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
8672 break
8673 }
8674 b.resetWithControl(BlockMIPS64GTZ, x)
8675 return true
8676 }
8677 // match: (NE (MOVVconst [0]) yes no)
8678 // result: (First no yes)
8679 for b.Controls[0].Op == OpMIPS64MOVVconst {
8680 v_0 := b.Controls[0]
8681 if auxIntToInt64(v_0.AuxInt) != 0 {
8682 break
8683 }
8684 b.Reset(BlockFirst)
8685 b.swapSuccessors()
8686 return true
8687 }
8688 // match: (NE (MOVVconst [c]) yes no)
8689 // cond: c != 0
8690 // result: (First yes no)
8691 for b.Controls[0].Op == OpMIPS64MOVVconst {
8692 v_0 := b.Controls[0]
8693 c := auxIntToInt64(v_0.AuxInt)
8694 if !(c != 0) {
8695 break
8696 }
8697 b.Reset(BlockFirst)
8698 return true
8699 }
8700 }
8701 return false
8702 }