1
2
3 package ssa
4
5 import "internal/buildcfg"
6 import "math"
7 import "cmd/compile/internal/types"
8
9 func rewriteValuePPC64(v *Value) bool {
10 switch v.Op {
11 case OpAbs:
12 v.Op = OpPPC64FABS
13 return true
14 case OpAdd16:
15 v.Op = OpPPC64ADD
16 return true
17 case OpAdd32:
18 v.Op = OpPPC64ADD
19 return true
20 case OpAdd32F:
21 v.Op = OpPPC64FADDS
22 return true
23 case OpAdd64:
24 v.Op = OpPPC64ADD
25 return true
26 case OpAdd64F:
27 v.Op = OpPPC64FADD
28 return true
29 case OpAdd8:
30 v.Op = OpPPC64ADD
31 return true
32 case OpAddPtr:
33 v.Op = OpPPC64ADD
34 return true
35 case OpAddr:
36 return rewriteValuePPC64_OpAddr(v)
37 case OpAnd16:
38 v.Op = OpPPC64AND
39 return true
40 case OpAnd32:
41 v.Op = OpPPC64AND
42 return true
43 case OpAnd64:
44 v.Op = OpPPC64AND
45 return true
46 case OpAnd8:
47 v.Op = OpPPC64AND
48 return true
49 case OpAndB:
50 v.Op = OpPPC64AND
51 return true
52 case OpAtomicAdd32:
53 v.Op = OpPPC64LoweredAtomicAdd32
54 return true
55 case OpAtomicAdd64:
56 v.Op = OpPPC64LoweredAtomicAdd64
57 return true
58 case OpAtomicAnd32:
59 v.Op = OpPPC64LoweredAtomicAnd32
60 return true
61 case OpAtomicAnd8:
62 v.Op = OpPPC64LoweredAtomicAnd8
63 return true
64 case OpAtomicCompareAndSwap32:
65 return rewriteValuePPC64_OpAtomicCompareAndSwap32(v)
66 case OpAtomicCompareAndSwap64:
67 return rewriteValuePPC64_OpAtomicCompareAndSwap64(v)
68 case OpAtomicCompareAndSwapRel32:
69 return rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v)
70 case OpAtomicExchange32:
71 v.Op = OpPPC64LoweredAtomicExchange32
72 return true
73 case OpAtomicExchange64:
74 v.Op = OpPPC64LoweredAtomicExchange64
75 return true
76 case OpAtomicExchange8:
77 v.Op = OpPPC64LoweredAtomicExchange8
78 return true
79 case OpAtomicLoad32:
80 return rewriteValuePPC64_OpAtomicLoad32(v)
81 case OpAtomicLoad64:
82 return rewriteValuePPC64_OpAtomicLoad64(v)
83 case OpAtomicLoad8:
84 return rewriteValuePPC64_OpAtomicLoad8(v)
85 case OpAtomicLoadAcq32:
86 return rewriteValuePPC64_OpAtomicLoadAcq32(v)
87 case OpAtomicLoadAcq64:
88 return rewriteValuePPC64_OpAtomicLoadAcq64(v)
89 case OpAtomicLoadPtr:
90 return rewriteValuePPC64_OpAtomicLoadPtr(v)
91 case OpAtomicOr32:
92 v.Op = OpPPC64LoweredAtomicOr32
93 return true
94 case OpAtomicOr8:
95 v.Op = OpPPC64LoweredAtomicOr8
96 return true
97 case OpAtomicStore32:
98 return rewriteValuePPC64_OpAtomicStore32(v)
99 case OpAtomicStore64:
100 return rewriteValuePPC64_OpAtomicStore64(v)
101 case OpAtomicStore8:
102 return rewriteValuePPC64_OpAtomicStore8(v)
103 case OpAtomicStoreRel32:
104 return rewriteValuePPC64_OpAtomicStoreRel32(v)
105 case OpAtomicStoreRel64:
106 return rewriteValuePPC64_OpAtomicStoreRel64(v)
107 case OpAvg64u:
108 return rewriteValuePPC64_OpAvg64u(v)
109 case OpBitLen16:
110 return rewriteValuePPC64_OpBitLen16(v)
111 case OpBitLen32:
112 return rewriteValuePPC64_OpBitLen32(v)
113 case OpBitLen64:
114 return rewriteValuePPC64_OpBitLen64(v)
115 case OpBitLen8:
116 return rewriteValuePPC64_OpBitLen8(v)
117 case OpBswap16:
118 return rewriteValuePPC64_OpBswap16(v)
119 case OpBswap32:
120 return rewriteValuePPC64_OpBswap32(v)
121 case OpBswap64:
122 return rewriteValuePPC64_OpBswap64(v)
123 case OpCeil:
124 v.Op = OpPPC64FCEIL
125 return true
126 case OpClosureCall:
127 v.Op = OpPPC64CALLclosure
128 return true
129 case OpCom16:
130 return rewriteValuePPC64_OpCom16(v)
131 case OpCom32:
132 return rewriteValuePPC64_OpCom32(v)
133 case OpCom64:
134 return rewriteValuePPC64_OpCom64(v)
135 case OpCom8:
136 return rewriteValuePPC64_OpCom8(v)
137 case OpCondSelect:
138 return rewriteValuePPC64_OpCondSelect(v)
139 case OpConst16:
140 return rewriteValuePPC64_OpConst16(v)
141 case OpConst32:
142 return rewriteValuePPC64_OpConst32(v)
143 case OpConst32F:
144 v.Op = OpPPC64FMOVSconst
145 return true
146 case OpConst64:
147 return rewriteValuePPC64_OpConst64(v)
148 case OpConst64F:
149 v.Op = OpPPC64FMOVDconst
150 return true
151 case OpConst8:
152 return rewriteValuePPC64_OpConst8(v)
153 case OpConstBool:
154 return rewriteValuePPC64_OpConstBool(v)
155 case OpConstNil:
156 return rewriteValuePPC64_OpConstNil(v)
157 case OpCopysign:
158 return rewriteValuePPC64_OpCopysign(v)
159 case OpCtz16:
160 return rewriteValuePPC64_OpCtz16(v)
161 case OpCtz16NonZero:
162 v.Op = OpCtz64
163 return true
164 case OpCtz32:
165 return rewriteValuePPC64_OpCtz32(v)
166 case OpCtz32NonZero:
167 v.Op = OpCtz64
168 return true
169 case OpCtz64:
170 return rewriteValuePPC64_OpCtz64(v)
171 case OpCtz64NonZero:
172 v.Op = OpCtz64
173 return true
174 case OpCtz8:
175 return rewriteValuePPC64_OpCtz8(v)
176 case OpCtz8NonZero:
177 v.Op = OpCtz64
178 return true
179 case OpCvt32Fto32:
180 return rewriteValuePPC64_OpCvt32Fto32(v)
181 case OpCvt32Fto64:
182 return rewriteValuePPC64_OpCvt32Fto64(v)
183 case OpCvt32Fto64F:
184 v.Op = OpCopy
185 return true
186 case OpCvt32to32F:
187 return rewriteValuePPC64_OpCvt32to32F(v)
188 case OpCvt32to64F:
189 return rewriteValuePPC64_OpCvt32to64F(v)
190 case OpCvt64Fto32:
191 return rewriteValuePPC64_OpCvt64Fto32(v)
192 case OpCvt64Fto32F:
193 v.Op = OpPPC64FRSP
194 return true
195 case OpCvt64Fto64:
196 return rewriteValuePPC64_OpCvt64Fto64(v)
197 case OpCvt64to32F:
198 return rewriteValuePPC64_OpCvt64to32F(v)
199 case OpCvt64to64F:
200 return rewriteValuePPC64_OpCvt64to64F(v)
201 case OpCvtBoolToUint8:
202 v.Op = OpCopy
203 return true
204 case OpDiv16:
205 return rewriteValuePPC64_OpDiv16(v)
206 case OpDiv16u:
207 return rewriteValuePPC64_OpDiv16u(v)
208 case OpDiv32:
209 return rewriteValuePPC64_OpDiv32(v)
210 case OpDiv32F:
211 v.Op = OpPPC64FDIVS
212 return true
213 case OpDiv32u:
214 v.Op = OpPPC64DIVWU
215 return true
216 case OpDiv64:
217 return rewriteValuePPC64_OpDiv64(v)
218 case OpDiv64F:
219 v.Op = OpPPC64FDIV
220 return true
221 case OpDiv64u:
222 v.Op = OpPPC64DIVDU
223 return true
224 case OpDiv8:
225 return rewriteValuePPC64_OpDiv8(v)
226 case OpDiv8u:
227 return rewriteValuePPC64_OpDiv8u(v)
228 case OpEq16:
229 return rewriteValuePPC64_OpEq16(v)
230 case OpEq32:
231 return rewriteValuePPC64_OpEq32(v)
232 case OpEq32F:
233 return rewriteValuePPC64_OpEq32F(v)
234 case OpEq64:
235 return rewriteValuePPC64_OpEq64(v)
236 case OpEq64F:
237 return rewriteValuePPC64_OpEq64F(v)
238 case OpEq8:
239 return rewriteValuePPC64_OpEq8(v)
240 case OpEqB:
241 return rewriteValuePPC64_OpEqB(v)
242 case OpEqPtr:
243 return rewriteValuePPC64_OpEqPtr(v)
244 case OpFMA:
245 v.Op = OpPPC64FMADD
246 return true
247 case OpFloor:
248 v.Op = OpPPC64FFLOOR
249 return true
250 case OpGetCallerPC:
251 v.Op = OpPPC64LoweredGetCallerPC
252 return true
253 case OpGetCallerSP:
254 v.Op = OpPPC64LoweredGetCallerSP
255 return true
256 case OpGetClosurePtr:
257 v.Op = OpPPC64LoweredGetClosurePtr
258 return true
259 case OpHmul32:
260 v.Op = OpPPC64MULHW
261 return true
262 case OpHmul32u:
263 v.Op = OpPPC64MULHWU
264 return true
265 case OpHmul64:
266 v.Op = OpPPC64MULHD
267 return true
268 case OpHmul64u:
269 v.Op = OpPPC64MULHDU
270 return true
271 case OpInterCall:
272 v.Op = OpPPC64CALLinter
273 return true
274 case OpIsInBounds:
275 return rewriteValuePPC64_OpIsInBounds(v)
276 case OpIsNonNil:
277 return rewriteValuePPC64_OpIsNonNil(v)
278 case OpIsSliceInBounds:
279 return rewriteValuePPC64_OpIsSliceInBounds(v)
280 case OpLeq16:
281 return rewriteValuePPC64_OpLeq16(v)
282 case OpLeq16U:
283 return rewriteValuePPC64_OpLeq16U(v)
284 case OpLeq32:
285 return rewriteValuePPC64_OpLeq32(v)
286 case OpLeq32F:
287 return rewriteValuePPC64_OpLeq32F(v)
288 case OpLeq32U:
289 return rewriteValuePPC64_OpLeq32U(v)
290 case OpLeq64:
291 return rewriteValuePPC64_OpLeq64(v)
292 case OpLeq64F:
293 return rewriteValuePPC64_OpLeq64F(v)
294 case OpLeq64U:
295 return rewriteValuePPC64_OpLeq64U(v)
296 case OpLeq8:
297 return rewriteValuePPC64_OpLeq8(v)
298 case OpLeq8U:
299 return rewriteValuePPC64_OpLeq8U(v)
300 case OpLess16:
301 return rewriteValuePPC64_OpLess16(v)
302 case OpLess16U:
303 return rewriteValuePPC64_OpLess16U(v)
304 case OpLess32:
305 return rewriteValuePPC64_OpLess32(v)
306 case OpLess32F:
307 return rewriteValuePPC64_OpLess32F(v)
308 case OpLess32U:
309 return rewriteValuePPC64_OpLess32U(v)
310 case OpLess64:
311 return rewriteValuePPC64_OpLess64(v)
312 case OpLess64F:
313 return rewriteValuePPC64_OpLess64F(v)
314 case OpLess64U:
315 return rewriteValuePPC64_OpLess64U(v)
316 case OpLess8:
317 return rewriteValuePPC64_OpLess8(v)
318 case OpLess8U:
319 return rewriteValuePPC64_OpLess8U(v)
320 case OpLoad:
321 return rewriteValuePPC64_OpLoad(v)
322 case OpLocalAddr:
323 return rewriteValuePPC64_OpLocalAddr(v)
324 case OpLsh16x16:
325 return rewriteValuePPC64_OpLsh16x16(v)
326 case OpLsh16x32:
327 return rewriteValuePPC64_OpLsh16x32(v)
328 case OpLsh16x64:
329 return rewriteValuePPC64_OpLsh16x64(v)
330 case OpLsh16x8:
331 return rewriteValuePPC64_OpLsh16x8(v)
332 case OpLsh32x16:
333 return rewriteValuePPC64_OpLsh32x16(v)
334 case OpLsh32x32:
335 return rewriteValuePPC64_OpLsh32x32(v)
336 case OpLsh32x64:
337 return rewriteValuePPC64_OpLsh32x64(v)
338 case OpLsh32x8:
339 return rewriteValuePPC64_OpLsh32x8(v)
340 case OpLsh64x16:
341 return rewriteValuePPC64_OpLsh64x16(v)
342 case OpLsh64x32:
343 return rewriteValuePPC64_OpLsh64x32(v)
344 case OpLsh64x64:
345 return rewriteValuePPC64_OpLsh64x64(v)
346 case OpLsh64x8:
347 return rewriteValuePPC64_OpLsh64x8(v)
348 case OpLsh8x16:
349 return rewriteValuePPC64_OpLsh8x16(v)
350 case OpLsh8x32:
351 return rewriteValuePPC64_OpLsh8x32(v)
352 case OpLsh8x64:
353 return rewriteValuePPC64_OpLsh8x64(v)
354 case OpLsh8x8:
355 return rewriteValuePPC64_OpLsh8x8(v)
356 case OpMax32F:
357 return rewriteValuePPC64_OpMax32F(v)
358 case OpMax64F:
359 return rewriteValuePPC64_OpMax64F(v)
360 case OpMin32F:
361 return rewriteValuePPC64_OpMin32F(v)
362 case OpMin64F:
363 return rewriteValuePPC64_OpMin64F(v)
364 case OpMod16:
365 return rewriteValuePPC64_OpMod16(v)
366 case OpMod16u:
367 return rewriteValuePPC64_OpMod16u(v)
368 case OpMod32:
369 return rewriteValuePPC64_OpMod32(v)
370 case OpMod32u:
371 return rewriteValuePPC64_OpMod32u(v)
372 case OpMod64:
373 return rewriteValuePPC64_OpMod64(v)
374 case OpMod64u:
375 return rewriteValuePPC64_OpMod64u(v)
376 case OpMod8:
377 return rewriteValuePPC64_OpMod8(v)
378 case OpMod8u:
379 return rewriteValuePPC64_OpMod8u(v)
380 case OpMove:
381 return rewriteValuePPC64_OpMove(v)
382 case OpMul16:
383 v.Op = OpPPC64MULLW
384 return true
385 case OpMul32:
386 v.Op = OpPPC64MULLW
387 return true
388 case OpMul32F:
389 v.Op = OpPPC64FMULS
390 return true
391 case OpMul64:
392 v.Op = OpPPC64MULLD
393 return true
394 case OpMul64F:
395 v.Op = OpPPC64FMUL
396 return true
397 case OpMul8:
398 v.Op = OpPPC64MULLW
399 return true
400 case OpNeg16:
401 v.Op = OpPPC64NEG
402 return true
403 case OpNeg32:
404 v.Op = OpPPC64NEG
405 return true
406 case OpNeg32F:
407 v.Op = OpPPC64FNEG
408 return true
409 case OpNeg64:
410 v.Op = OpPPC64NEG
411 return true
412 case OpNeg64F:
413 v.Op = OpPPC64FNEG
414 return true
415 case OpNeg8:
416 v.Op = OpPPC64NEG
417 return true
418 case OpNeq16:
419 return rewriteValuePPC64_OpNeq16(v)
420 case OpNeq32:
421 return rewriteValuePPC64_OpNeq32(v)
422 case OpNeq32F:
423 return rewriteValuePPC64_OpNeq32F(v)
424 case OpNeq64:
425 return rewriteValuePPC64_OpNeq64(v)
426 case OpNeq64F:
427 return rewriteValuePPC64_OpNeq64F(v)
428 case OpNeq8:
429 return rewriteValuePPC64_OpNeq8(v)
430 case OpNeqB:
431 v.Op = OpPPC64XOR
432 return true
433 case OpNeqPtr:
434 return rewriteValuePPC64_OpNeqPtr(v)
435 case OpNilCheck:
436 v.Op = OpPPC64LoweredNilCheck
437 return true
438 case OpNot:
439 return rewriteValuePPC64_OpNot(v)
440 case OpOffPtr:
441 return rewriteValuePPC64_OpOffPtr(v)
442 case OpOr16:
443 v.Op = OpPPC64OR
444 return true
445 case OpOr32:
446 v.Op = OpPPC64OR
447 return true
448 case OpOr64:
449 v.Op = OpPPC64OR
450 return true
451 case OpOr8:
452 v.Op = OpPPC64OR
453 return true
454 case OpOrB:
455 v.Op = OpPPC64OR
456 return true
457 case OpPPC64ADD:
458 return rewriteValuePPC64_OpPPC64ADD(v)
459 case OpPPC64ADDC:
460 return rewriteValuePPC64_OpPPC64ADDC(v)
461 case OpPPC64ADDE:
462 return rewriteValuePPC64_OpPPC64ADDE(v)
463 case OpPPC64ADDconst:
464 return rewriteValuePPC64_OpPPC64ADDconst(v)
465 case OpPPC64AND:
466 return rewriteValuePPC64_OpPPC64AND(v)
467 case OpPPC64ANDN:
468 return rewriteValuePPC64_OpPPC64ANDN(v)
469 case OpPPC64ANDconst:
470 return rewriteValuePPC64_OpPPC64ANDconst(v)
471 case OpPPC64BRD:
472 return rewriteValuePPC64_OpPPC64BRD(v)
473 case OpPPC64BRH:
474 return rewriteValuePPC64_OpPPC64BRH(v)
475 case OpPPC64BRW:
476 return rewriteValuePPC64_OpPPC64BRW(v)
477 case OpPPC64CLRLSLDI:
478 return rewriteValuePPC64_OpPPC64CLRLSLDI(v)
479 case OpPPC64CMP:
480 return rewriteValuePPC64_OpPPC64CMP(v)
481 case OpPPC64CMPU:
482 return rewriteValuePPC64_OpPPC64CMPU(v)
483 case OpPPC64CMPUconst:
484 return rewriteValuePPC64_OpPPC64CMPUconst(v)
485 case OpPPC64CMPW:
486 return rewriteValuePPC64_OpPPC64CMPW(v)
487 case OpPPC64CMPWU:
488 return rewriteValuePPC64_OpPPC64CMPWU(v)
489 case OpPPC64CMPWUconst:
490 return rewriteValuePPC64_OpPPC64CMPWUconst(v)
491 case OpPPC64CMPWconst:
492 return rewriteValuePPC64_OpPPC64CMPWconst(v)
493 case OpPPC64CMPconst:
494 return rewriteValuePPC64_OpPPC64CMPconst(v)
495 case OpPPC64Equal:
496 return rewriteValuePPC64_OpPPC64Equal(v)
497 case OpPPC64FABS:
498 return rewriteValuePPC64_OpPPC64FABS(v)
499 case OpPPC64FADD:
500 return rewriteValuePPC64_OpPPC64FADD(v)
501 case OpPPC64FADDS:
502 return rewriteValuePPC64_OpPPC64FADDS(v)
503 case OpPPC64FCEIL:
504 return rewriteValuePPC64_OpPPC64FCEIL(v)
505 case OpPPC64FFLOOR:
506 return rewriteValuePPC64_OpPPC64FFLOOR(v)
507 case OpPPC64FGreaterEqual:
508 return rewriteValuePPC64_OpPPC64FGreaterEqual(v)
509 case OpPPC64FGreaterThan:
510 return rewriteValuePPC64_OpPPC64FGreaterThan(v)
511 case OpPPC64FLessEqual:
512 return rewriteValuePPC64_OpPPC64FLessEqual(v)
513 case OpPPC64FLessThan:
514 return rewriteValuePPC64_OpPPC64FLessThan(v)
515 case OpPPC64FMOVDload:
516 return rewriteValuePPC64_OpPPC64FMOVDload(v)
517 case OpPPC64FMOVDstore:
518 return rewriteValuePPC64_OpPPC64FMOVDstore(v)
519 case OpPPC64FMOVSload:
520 return rewriteValuePPC64_OpPPC64FMOVSload(v)
521 case OpPPC64FMOVSstore:
522 return rewriteValuePPC64_OpPPC64FMOVSstore(v)
523 case OpPPC64FNEG:
524 return rewriteValuePPC64_OpPPC64FNEG(v)
525 case OpPPC64FSQRT:
526 return rewriteValuePPC64_OpPPC64FSQRT(v)
527 case OpPPC64FSUB:
528 return rewriteValuePPC64_OpPPC64FSUB(v)
529 case OpPPC64FSUBS:
530 return rewriteValuePPC64_OpPPC64FSUBS(v)
531 case OpPPC64FTRUNC:
532 return rewriteValuePPC64_OpPPC64FTRUNC(v)
533 case OpPPC64GreaterEqual:
534 return rewriteValuePPC64_OpPPC64GreaterEqual(v)
535 case OpPPC64GreaterThan:
536 return rewriteValuePPC64_OpPPC64GreaterThan(v)
537 case OpPPC64ISEL:
538 return rewriteValuePPC64_OpPPC64ISEL(v)
539 case OpPPC64LessEqual:
540 return rewriteValuePPC64_OpPPC64LessEqual(v)
541 case OpPPC64LessThan:
542 return rewriteValuePPC64_OpPPC64LessThan(v)
543 case OpPPC64LoweredPanicBoundsCR:
544 return rewriteValuePPC64_OpPPC64LoweredPanicBoundsCR(v)
545 case OpPPC64LoweredPanicBoundsRC:
546 return rewriteValuePPC64_OpPPC64LoweredPanicBoundsRC(v)
547 case OpPPC64LoweredPanicBoundsRR:
548 return rewriteValuePPC64_OpPPC64LoweredPanicBoundsRR(v)
549 case OpPPC64MFVSRD:
550 return rewriteValuePPC64_OpPPC64MFVSRD(v)
551 case OpPPC64MOVBZload:
552 return rewriteValuePPC64_OpPPC64MOVBZload(v)
553 case OpPPC64MOVBZloadidx:
554 return rewriteValuePPC64_OpPPC64MOVBZloadidx(v)
555 case OpPPC64MOVBZreg:
556 return rewriteValuePPC64_OpPPC64MOVBZreg(v)
557 case OpPPC64MOVBreg:
558 return rewriteValuePPC64_OpPPC64MOVBreg(v)
559 case OpPPC64MOVBstore:
560 return rewriteValuePPC64_OpPPC64MOVBstore(v)
561 case OpPPC64MOVBstoreidx:
562 return rewriteValuePPC64_OpPPC64MOVBstoreidx(v)
563 case OpPPC64MOVBstorezero:
564 return rewriteValuePPC64_OpPPC64MOVBstorezero(v)
565 case OpPPC64MOVDaddr:
566 return rewriteValuePPC64_OpPPC64MOVDaddr(v)
567 case OpPPC64MOVDload:
568 return rewriteValuePPC64_OpPPC64MOVDload(v)
569 case OpPPC64MOVDloadidx:
570 return rewriteValuePPC64_OpPPC64MOVDloadidx(v)
571 case OpPPC64MOVDstore:
572 return rewriteValuePPC64_OpPPC64MOVDstore(v)
573 case OpPPC64MOVDstoreidx:
574 return rewriteValuePPC64_OpPPC64MOVDstoreidx(v)
575 case OpPPC64MOVDstorezero:
576 return rewriteValuePPC64_OpPPC64MOVDstorezero(v)
577 case OpPPC64MOVHBRstore:
578 return rewriteValuePPC64_OpPPC64MOVHBRstore(v)
579 case OpPPC64MOVHZload:
580 return rewriteValuePPC64_OpPPC64MOVHZload(v)
581 case OpPPC64MOVHZloadidx:
582 return rewriteValuePPC64_OpPPC64MOVHZloadidx(v)
583 case OpPPC64MOVHZreg:
584 return rewriteValuePPC64_OpPPC64MOVHZreg(v)
585 case OpPPC64MOVHload:
586 return rewriteValuePPC64_OpPPC64MOVHload(v)
587 case OpPPC64MOVHloadidx:
588 return rewriteValuePPC64_OpPPC64MOVHloadidx(v)
589 case OpPPC64MOVHreg:
590 return rewriteValuePPC64_OpPPC64MOVHreg(v)
591 case OpPPC64MOVHstore:
592 return rewriteValuePPC64_OpPPC64MOVHstore(v)
593 case OpPPC64MOVHstoreidx:
594 return rewriteValuePPC64_OpPPC64MOVHstoreidx(v)
595 case OpPPC64MOVHstorezero:
596 return rewriteValuePPC64_OpPPC64MOVHstorezero(v)
597 case OpPPC64MOVWBRstore:
598 return rewriteValuePPC64_OpPPC64MOVWBRstore(v)
599 case OpPPC64MOVWZload:
600 return rewriteValuePPC64_OpPPC64MOVWZload(v)
601 case OpPPC64MOVWZloadidx:
602 return rewriteValuePPC64_OpPPC64MOVWZloadidx(v)
603 case OpPPC64MOVWZreg:
604 return rewriteValuePPC64_OpPPC64MOVWZreg(v)
605 case OpPPC64MOVWload:
606 return rewriteValuePPC64_OpPPC64MOVWload(v)
607 case OpPPC64MOVWloadidx:
608 return rewriteValuePPC64_OpPPC64MOVWloadidx(v)
609 case OpPPC64MOVWreg:
610 return rewriteValuePPC64_OpPPC64MOVWreg(v)
611 case OpPPC64MOVWstore:
612 return rewriteValuePPC64_OpPPC64MOVWstore(v)
613 case OpPPC64MOVWstoreidx:
614 return rewriteValuePPC64_OpPPC64MOVWstoreidx(v)
615 case OpPPC64MOVWstorezero:
616 return rewriteValuePPC64_OpPPC64MOVWstorezero(v)
617 case OpPPC64MTVSRD:
618 return rewriteValuePPC64_OpPPC64MTVSRD(v)
619 case OpPPC64MULLD:
620 return rewriteValuePPC64_OpPPC64MULLD(v)
621 case OpPPC64MULLW:
622 return rewriteValuePPC64_OpPPC64MULLW(v)
623 case OpPPC64NEG:
624 return rewriteValuePPC64_OpPPC64NEG(v)
625 case OpPPC64NOR:
626 return rewriteValuePPC64_OpPPC64NOR(v)
627 case OpPPC64NotEqual:
628 return rewriteValuePPC64_OpPPC64NotEqual(v)
629 case OpPPC64OR:
630 return rewriteValuePPC64_OpPPC64OR(v)
631 case OpPPC64ORN:
632 return rewriteValuePPC64_OpPPC64ORN(v)
633 case OpPPC64ORconst:
634 return rewriteValuePPC64_OpPPC64ORconst(v)
635 case OpPPC64RLWINM:
636 return rewriteValuePPC64_OpPPC64RLWINM(v)
637 case OpPPC64ROTL:
638 return rewriteValuePPC64_OpPPC64ROTL(v)
639 case OpPPC64ROTLW:
640 return rewriteValuePPC64_OpPPC64ROTLW(v)
641 case OpPPC64ROTLWconst:
642 return rewriteValuePPC64_OpPPC64ROTLWconst(v)
643 case OpPPC64SETBC:
644 return rewriteValuePPC64_OpPPC64SETBC(v)
645 case OpPPC64SETBCR:
646 return rewriteValuePPC64_OpPPC64SETBCR(v)
647 case OpPPC64SLD:
648 return rewriteValuePPC64_OpPPC64SLD(v)
649 case OpPPC64SLDconst:
650 return rewriteValuePPC64_OpPPC64SLDconst(v)
651 case OpPPC64SLW:
652 return rewriteValuePPC64_OpPPC64SLW(v)
653 case OpPPC64SLWconst:
654 return rewriteValuePPC64_OpPPC64SLWconst(v)
655 case OpPPC64SRAD:
656 return rewriteValuePPC64_OpPPC64SRAD(v)
657 case OpPPC64SRAW:
658 return rewriteValuePPC64_OpPPC64SRAW(v)
659 case OpPPC64SRD:
660 return rewriteValuePPC64_OpPPC64SRD(v)
661 case OpPPC64SRW:
662 return rewriteValuePPC64_OpPPC64SRW(v)
663 case OpPPC64SRWconst:
664 return rewriteValuePPC64_OpPPC64SRWconst(v)
665 case OpPPC64SUB:
666 return rewriteValuePPC64_OpPPC64SUB(v)
667 case OpPPC64SUBE:
668 return rewriteValuePPC64_OpPPC64SUBE(v)
669 case OpPPC64SUBFCconst:
670 return rewriteValuePPC64_OpPPC64SUBFCconst(v)
671 case OpPPC64XOR:
672 return rewriteValuePPC64_OpPPC64XOR(v)
673 case OpPPC64XORconst:
674 return rewriteValuePPC64_OpPPC64XORconst(v)
675 case OpPanicBounds:
676 v.Op = OpPPC64LoweredPanicBoundsRR
677 return true
678 case OpPopCount16:
679 return rewriteValuePPC64_OpPopCount16(v)
680 case OpPopCount32:
681 return rewriteValuePPC64_OpPopCount32(v)
682 case OpPopCount64:
683 v.Op = OpPPC64POPCNTD
684 return true
685 case OpPopCount8:
686 return rewriteValuePPC64_OpPopCount8(v)
687 case OpPrefetchCache:
688 return rewriteValuePPC64_OpPrefetchCache(v)
689 case OpPrefetchCacheStreamed:
690 return rewriteValuePPC64_OpPrefetchCacheStreamed(v)
691 case OpPubBarrier:
692 v.Op = OpPPC64LoweredPubBarrier
693 return true
694 case OpRotateLeft16:
695 return rewriteValuePPC64_OpRotateLeft16(v)
696 case OpRotateLeft32:
697 v.Op = OpPPC64ROTLW
698 return true
699 case OpRotateLeft64:
700 v.Op = OpPPC64ROTL
701 return true
702 case OpRotateLeft8:
703 return rewriteValuePPC64_OpRotateLeft8(v)
704 case OpRound:
705 v.Op = OpPPC64FROUND
706 return true
707 case OpRound32F:
708 v.Op = OpPPC64LoweredRound32F
709 return true
710 case OpRound64F:
711 v.Op = OpPPC64LoweredRound64F
712 return true
713 case OpRsh16Ux16:
714 return rewriteValuePPC64_OpRsh16Ux16(v)
715 case OpRsh16Ux32:
716 return rewriteValuePPC64_OpRsh16Ux32(v)
717 case OpRsh16Ux64:
718 return rewriteValuePPC64_OpRsh16Ux64(v)
719 case OpRsh16Ux8:
720 return rewriteValuePPC64_OpRsh16Ux8(v)
721 case OpRsh16x16:
722 return rewriteValuePPC64_OpRsh16x16(v)
723 case OpRsh16x32:
724 return rewriteValuePPC64_OpRsh16x32(v)
725 case OpRsh16x64:
726 return rewriteValuePPC64_OpRsh16x64(v)
727 case OpRsh16x8:
728 return rewriteValuePPC64_OpRsh16x8(v)
729 case OpRsh32Ux16:
730 return rewriteValuePPC64_OpRsh32Ux16(v)
731 case OpRsh32Ux32:
732 return rewriteValuePPC64_OpRsh32Ux32(v)
733 case OpRsh32Ux64:
734 return rewriteValuePPC64_OpRsh32Ux64(v)
735 case OpRsh32Ux8:
736 return rewriteValuePPC64_OpRsh32Ux8(v)
737 case OpRsh32x16:
738 return rewriteValuePPC64_OpRsh32x16(v)
739 case OpRsh32x32:
740 return rewriteValuePPC64_OpRsh32x32(v)
741 case OpRsh32x64:
742 return rewriteValuePPC64_OpRsh32x64(v)
743 case OpRsh32x8:
744 return rewriteValuePPC64_OpRsh32x8(v)
745 case OpRsh64Ux16:
746 return rewriteValuePPC64_OpRsh64Ux16(v)
747 case OpRsh64Ux32:
748 return rewriteValuePPC64_OpRsh64Ux32(v)
749 case OpRsh64Ux64:
750 return rewriteValuePPC64_OpRsh64Ux64(v)
751 case OpRsh64Ux8:
752 return rewriteValuePPC64_OpRsh64Ux8(v)
753 case OpRsh64x16:
754 return rewriteValuePPC64_OpRsh64x16(v)
755 case OpRsh64x32:
756 return rewriteValuePPC64_OpRsh64x32(v)
757 case OpRsh64x64:
758 return rewriteValuePPC64_OpRsh64x64(v)
759 case OpRsh64x8:
760 return rewriteValuePPC64_OpRsh64x8(v)
761 case OpRsh8Ux16:
762 return rewriteValuePPC64_OpRsh8Ux16(v)
763 case OpRsh8Ux32:
764 return rewriteValuePPC64_OpRsh8Ux32(v)
765 case OpRsh8Ux64:
766 return rewriteValuePPC64_OpRsh8Ux64(v)
767 case OpRsh8Ux8:
768 return rewriteValuePPC64_OpRsh8Ux8(v)
769 case OpRsh8x16:
770 return rewriteValuePPC64_OpRsh8x16(v)
771 case OpRsh8x32:
772 return rewriteValuePPC64_OpRsh8x32(v)
773 case OpRsh8x64:
774 return rewriteValuePPC64_OpRsh8x64(v)
775 case OpRsh8x8:
776 return rewriteValuePPC64_OpRsh8x8(v)
777 case OpSelect0:
778 return rewriteValuePPC64_OpSelect0(v)
779 case OpSelect1:
780 return rewriteValuePPC64_OpSelect1(v)
781 case OpSelectN:
782 return rewriteValuePPC64_OpSelectN(v)
783 case OpSignExt16to32:
784 v.Op = OpPPC64MOVHreg
785 return true
786 case OpSignExt16to64:
787 v.Op = OpPPC64MOVHreg
788 return true
789 case OpSignExt32to64:
790 v.Op = OpPPC64MOVWreg
791 return true
792 case OpSignExt8to16:
793 v.Op = OpPPC64MOVBreg
794 return true
795 case OpSignExt8to32:
796 v.Op = OpPPC64MOVBreg
797 return true
798 case OpSignExt8to64:
799 v.Op = OpPPC64MOVBreg
800 return true
801 case OpSlicemask:
802 return rewriteValuePPC64_OpSlicemask(v)
803 case OpSqrt:
804 v.Op = OpPPC64FSQRT
805 return true
806 case OpSqrt32:
807 v.Op = OpPPC64FSQRTS
808 return true
809 case OpStaticCall:
810 v.Op = OpPPC64CALLstatic
811 return true
812 case OpStore:
813 return rewriteValuePPC64_OpStore(v)
814 case OpSub16:
815 v.Op = OpPPC64SUB
816 return true
817 case OpSub32:
818 v.Op = OpPPC64SUB
819 return true
820 case OpSub32F:
821 v.Op = OpPPC64FSUBS
822 return true
823 case OpSub64:
824 v.Op = OpPPC64SUB
825 return true
826 case OpSub64F:
827 v.Op = OpPPC64FSUB
828 return true
829 case OpSub8:
830 v.Op = OpPPC64SUB
831 return true
832 case OpSubPtr:
833 v.Op = OpPPC64SUB
834 return true
835 case OpTailCall:
836 v.Op = OpPPC64CALLtail
837 return true
838 case OpTrunc:
839 v.Op = OpPPC64FTRUNC
840 return true
841 case OpTrunc16to8:
842 return rewriteValuePPC64_OpTrunc16to8(v)
843 case OpTrunc32to16:
844 return rewriteValuePPC64_OpTrunc32to16(v)
845 case OpTrunc32to8:
846 return rewriteValuePPC64_OpTrunc32to8(v)
847 case OpTrunc64to16:
848 return rewriteValuePPC64_OpTrunc64to16(v)
849 case OpTrunc64to32:
850 return rewriteValuePPC64_OpTrunc64to32(v)
851 case OpTrunc64to8:
852 return rewriteValuePPC64_OpTrunc64to8(v)
853 case OpWB:
854 v.Op = OpPPC64LoweredWB
855 return true
856 case OpXor16:
857 v.Op = OpPPC64XOR
858 return true
859 case OpXor32:
860 v.Op = OpPPC64XOR
861 return true
862 case OpXor64:
863 v.Op = OpPPC64XOR
864 return true
865 case OpXor8:
866 v.Op = OpPPC64XOR
867 return true
868 case OpZero:
869 return rewriteValuePPC64_OpZero(v)
870 case OpZeroExt16to32:
871 v.Op = OpPPC64MOVHZreg
872 return true
873 case OpZeroExt16to64:
874 v.Op = OpPPC64MOVHZreg
875 return true
876 case OpZeroExt32to64:
877 v.Op = OpPPC64MOVWZreg
878 return true
879 case OpZeroExt8to16:
880 v.Op = OpPPC64MOVBZreg
881 return true
882 case OpZeroExt8to32:
883 v.Op = OpPPC64MOVBZreg
884 return true
885 case OpZeroExt8to64:
886 v.Op = OpPPC64MOVBZreg
887 return true
888 }
889 return false
890 }
891 func rewriteValuePPC64_OpAddr(v *Value) bool {
892 v_0 := v.Args[0]
893
894
895 for {
896 sym := auxToSym(v.Aux)
897 base := v_0
898 v.reset(OpPPC64MOVDaddr)
899 v.AuxInt = int32ToAuxInt(0)
900 v.Aux = symToAux(sym)
901 v.AddArg(base)
902 return true
903 }
904 }
905 func rewriteValuePPC64_OpAtomicCompareAndSwap32(v *Value) bool {
906 v_3 := v.Args[3]
907 v_2 := v.Args[2]
908 v_1 := v.Args[1]
909 v_0 := v.Args[0]
910
911
912 for {
913 ptr := v_0
914 old := v_1
915 new_ := v_2
916 mem := v_3
917 v.reset(OpPPC64LoweredAtomicCas32)
918 v.AuxInt = int64ToAuxInt(1)
919 v.AddArg4(ptr, old, new_, mem)
920 return true
921 }
922 }
923 func rewriteValuePPC64_OpAtomicCompareAndSwap64(v *Value) bool {
924 v_3 := v.Args[3]
925 v_2 := v.Args[2]
926 v_1 := v.Args[1]
927 v_0 := v.Args[0]
928
929
930 for {
931 ptr := v_0
932 old := v_1
933 new_ := v_2
934 mem := v_3
935 v.reset(OpPPC64LoweredAtomicCas64)
936 v.AuxInt = int64ToAuxInt(1)
937 v.AddArg4(ptr, old, new_, mem)
938 return true
939 }
940 }
941 func rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v *Value) bool {
942 v_3 := v.Args[3]
943 v_2 := v.Args[2]
944 v_1 := v.Args[1]
945 v_0 := v.Args[0]
946
947
948 for {
949 ptr := v_0
950 old := v_1
951 new_ := v_2
952 mem := v_3
953 v.reset(OpPPC64LoweredAtomicCas32)
954 v.AuxInt = int64ToAuxInt(0)
955 v.AddArg4(ptr, old, new_, mem)
956 return true
957 }
958 }
959 func rewriteValuePPC64_OpAtomicLoad32(v *Value) bool {
960 v_1 := v.Args[1]
961 v_0 := v.Args[0]
962
963
964 for {
965 ptr := v_0
966 mem := v_1
967 v.reset(OpPPC64LoweredAtomicLoad32)
968 v.AuxInt = int64ToAuxInt(1)
969 v.AddArg2(ptr, mem)
970 return true
971 }
972 }
973 func rewriteValuePPC64_OpAtomicLoad64(v *Value) bool {
974 v_1 := v.Args[1]
975 v_0 := v.Args[0]
976
977
978 for {
979 ptr := v_0
980 mem := v_1
981 v.reset(OpPPC64LoweredAtomicLoad64)
982 v.AuxInt = int64ToAuxInt(1)
983 v.AddArg2(ptr, mem)
984 return true
985 }
986 }
987 func rewriteValuePPC64_OpAtomicLoad8(v *Value) bool {
988 v_1 := v.Args[1]
989 v_0 := v.Args[0]
990
991
992 for {
993 ptr := v_0
994 mem := v_1
995 v.reset(OpPPC64LoweredAtomicLoad8)
996 v.AuxInt = int64ToAuxInt(1)
997 v.AddArg2(ptr, mem)
998 return true
999 }
1000 }
1001 func rewriteValuePPC64_OpAtomicLoadAcq32(v *Value) bool {
1002 v_1 := v.Args[1]
1003 v_0 := v.Args[0]
1004
1005
1006 for {
1007 ptr := v_0
1008 mem := v_1
1009 v.reset(OpPPC64LoweredAtomicLoad32)
1010 v.AuxInt = int64ToAuxInt(0)
1011 v.AddArg2(ptr, mem)
1012 return true
1013 }
1014 }
1015 func rewriteValuePPC64_OpAtomicLoadAcq64(v *Value) bool {
1016 v_1 := v.Args[1]
1017 v_0 := v.Args[0]
1018
1019
1020 for {
1021 ptr := v_0
1022 mem := v_1
1023 v.reset(OpPPC64LoweredAtomicLoad64)
1024 v.AuxInt = int64ToAuxInt(0)
1025 v.AddArg2(ptr, mem)
1026 return true
1027 }
1028 }
1029 func rewriteValuePPC64_OpAtomicLoadPtr(v *Value) bool {
1030 v_1 := v.Args[1]
1031 v_0 := v.Args[0]
1032
1033
1034 for {
1035 ptr := v_0
1036 mem := v_1
1037 v.reset(OpPPC64LoweredAtomicLoadPtr)
1038 v.AuxInt = int64ToAuxInt(1)
1039 v.AddArg2(ptr, mem)
1040 return true
1041 }
1042 }
1043 func rewriteValuePPC64_OpAtomicStore32(v *Value) bool {
1044 v_2 := v.Args[2]
1045 v_1 := v.Args[1]
1046 v_0 := v.Args[0]
1047
1048
1049 for {
1050 ptr := v_0
1051 val := v_1
1052 mem := v_2
1053 v.reset(OpPPC64LoweredAtomicStore32)
1054 v.AuxInt = int64ToAuxInt(1)
1055 v.AddArg3(ptr, val, mem)
1056 return true
1057 }
1058 }
1059 func rewriteValuePPC64_OpAtomicStore64(v *Value) bool {
1060 v_2 := v.Args[2]
1061 v_1 := v.Args[1]
1062 v_0 := v.Args[0]
1063
1064
1065 for {
1066 ptr := v_0
1067 val := v_1
1068 mem := v_2
1069 v.reset(OpPPC64LoweredAtomicStore64)
1070 v.AuxInt = int64ToAuxInt(1)
1071 v.AddArg3(ptr, val, mem)
1072 return true
1073 }
1074 }
1075 func rewriteValuePPC64_OpAtomicStore8(v *Value) bool {
1076 v_2 := v.Args[2]
1077 v_1 := v.Args[1]
1078 v_0 := v.Args[0]
1079
1080
1081 for {
1082 ptr := v_0
1083 val := v_1
1084 mem := v_2
1085 v.reset(OpPPC64LoweredAtomicStore8)
1086 v.AuxInt = int64ToAuxInt(1)
1087 v.AddArg3(ptr, val, mem)
1088 return true
1089 }
1090 }
1091 func rewriteValuePPC64_OpAtomicStoreRel32(v *Value) bool {
1092 v_2 := v.Args[2]
1093 v_1 := v.Args[1]
1094 v_0 := v.Args[0]
1095
1096
1097 for {
1098 ptr := v_0
1099 val := v_1
1100 mem := v_2
1101 v.reset(OpPPC64LoweredAtomicStore32)
1102 v.AuxInt = int64ToAuxInt(0)
1103 v.AddArg3(ptr, val, mem)
1104 return true
1105 }
1106 }
1107 func rewriteValuePPC64_OpAtomicStoreRel64(v *Value) bool {
1108 v_2 := v.Args[2]
1109 v_1 := v.Args[1]
1110 v_0 := v.Args[0]
1111
1112
1113 for {
1114 ptr := v_0
1115 val := v_1
1116 mem := v_2
1117 v.reset(OpPPC64LoweredAtomicStore64)
1118 v.AuxInt = int64ToAuxInt(0)
1119 v.AddArg3(ptr, val, mem)
1120 return true
1121 }
1122 }
1123 func rewriteValuePPC64_OpAvg64u(v *Value) bool {
1124 v_1 := v.Args[1]
1125 v_0 := v.Args[0]
1126 b := v.Block
1127
1128
1129 for {
1130 t := v.Type
1131 x := v_0
1132 y := v_1
1133 v.reset(OpPPC64ADD)
1134 v0 := b.NewValue0(v.Pos, OpPPC64SRDconst, t)
1135 v0.AuxInt = int64ToAuxInt(1)
1136 v1 := b.NewValue0(v.Pos, OpPPC64SUB, t)
1137 v1.AddArg2(x, y)
1138 v0.AddArg(v1)
1139 v.AddArg2(v0, y)
1140 return true
1141 }
1142 }
1143 func rewriteValuePPC64_OpBitLen16(v *Value) bool {
1144 v_0 := v.Args[0]
1145 b := v.Block
1146 typ := &b.Func.Config.Types
1147
1148
1149 for {
1150 x := v_0
1151 v.reset(OpBitLen64)
1152 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1153 v0.AddArg(x)
1154 v.AddArg(v0)
1155 return true
1156 }
1157 }
1158 func rewriteValuePPC64_OpBitLen32(v *Value) bool {
1159 v_0 := v.Args[0]
1160 b := v.Block
1161 typ := &b.Func.Config.Types
1162
1163
1164 for {
1165 x := v_0
1166 v.reset(OpPPC64SUBFCconst)
1167 v.AuxInt = int64ToAuxInt(32)
1168 v0 := b.NewValue0(v.Pos, OpPPC64CNTLZW, typ.Int)
1169 v0.AddArg(x)
1170 v.AddArg(v0)
1171 return true
1172 }
1173 }
1174 func rewriteValuePPC64_OpBitLen64(v *Value) bool {
1175 v_0 := v.Args[0]
1176 b := v.Block
1177 typ := &b.Func.Config.Types
1178
1179
1180 for {
1181 x := v_0
1182 v.reset(OpPPC64SUBFCconst)
1183 v.AuxInt = int64ToAuxInt(64)
1184 v0 := b.NewValue0(v.Pos, OpPPC64CNTLZD, typ.Int)
1185 v0.AddArg(x)
1186 v.AddArg(v0)
1187 return true
1188 }
1189 }
1190 func rewriteValuePPC64_OpBitLen8(v *Value) bool {
1191 v_0 := v.Args[0]
1192 b := v.Block
1193 typ := &b.Func.Config.Types
1194
1195
1196 for {
1197 x := v_0
1198 v.reset(OpBitLen64)
1199 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1200 v0.AddArg(x)
1201 v.AddArg(v0)
1202 return true
1203 }
1204 }
1205 func rewriteValuePPC64_OpBswap16(v *Value) bool {
1206 v_0 := v.Args[0]
1207 b := v.Block
1208 typ := &b.Func.Config.Types
1209
1210
1211
1212 for {
1213 x := v_0
1214 if !(buildcfg.GOPPC64 >= 10) {
1215 break
1216 }
1217 v.reset(OpPPC64BRH)
1218 v.AddArg(x)
1219 return true
1220 }
1221
1222
1223 for {
1224 x := v_0
1225 if x.Op != OpPPC64MOVHZload {
1226 break
1227 }
1228 off := auxIntToInt32(x.AuxInt)
1229 sym := auxToSym(x.Aux)
1230 mem := x.Args[1]
1231 ptr := x.Args[0]
1232 b = x.Block
1233 v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
1234 v.copyOf(v0)
1235 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
1236 v1.AuxInt = int32ToAuxInt(off)
1237 v1.Aux = symToAux(sym)
1238 v1.AddArg(ptr)
1239 v0.AddArg2(v1, mem)
1240 return true
1241 }
1242
1243
1244 for {
1245 x := v_0
1246 if x.Op != OpPPC64MOVHZloadidx {
1247 break
1248 }
1249 mem := x.Args[2]
1250 ptr := x.Args[0]
1251 idx := x.Args[1]
1252 b = x.Block
1253 v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
1254 v.copyOf(v0)
1255 v0.AddArg3(ptr, idx, mem)
1256 return true
1257 }
1258 return false
1259 }
1260 func rewriteValuePPC64_OpBswap32(v *Value) bool {
1261 v_0 := v.Args[0]
1262 b := v.Block
1263 typ := &b.Func.Config.Types
1264
1265
1266
1267 for {
1268 x := v_0
1269 if !(buildcfg.GOPPC64 >= 10) {
1270 break
1271 }
1272 v.reset(OpPPC64BRW)
1273 v.AddArg(x)
1274 return true
1275 }
1276
1277
1278 for {
1279 x := v_0
1280 if x.Op != OpPPC64MOVWZload {
1281 break
1282 }
1283 off := auxIntToInt32(x.AuxInt)
1284 sym := auxToSym(x.Aux)
1285 mem := x.Args[1]
1286 ptr := x.Args[0]
1287 b = x.Block
1288 v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
1289 v.copyOf(v0)
1290 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
1291 v1.AuxInt = int32ToAuxInt(off)
1292 v1.Aux = symToAux(sym)
1293 v1.AddArg(ptr)
1294 v0.AddArg2(v1, mem)
1295 return true
1296 }
1297
1298
1299 for {
1300 x := v_0
1301 if x.Op != OpPPC64MOVWZloadidx {
1302 break
1303 }
1304 mem := x.Args[2]
1305 ptr := x.Args[0]
1306 idx := x.Args[1]
1307 b = x.Block
1308 v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
1309 v.copyOf(v0)
1310 v0.AddArg3(ptr, idx, mem)
1311 return true
1312 }
1313 return false
1314 }
1315 func rewriteValuePPC64_OpBswap64(v *Value) bool {
1316 v_0 := v.Args[0]
1317 b := v.Block
1318 typ := &b.Func.Config.Types
1319
1320
1321
1322 for {
1323 x := v_0
1324 if !(buildcfg.GOPPC64 >= 10) {
1325 break
1326 }
1327 v.reset(OpPPC64BRD)
1328 v.AddArg(x)
1329 return true
1330 }
1331
1332
1333 for {
1334 x := v_0
1335 if x.Op != OpPPC64MOVDload {
1336 break
1337 }
1338 off := auxIntToInt32(x.AuxInt)
1339 sym := auxToSym(x.Aux)
1340 mem := x.Args[1]
1341 ptr := x.Args[0]
1342 b = x.Block
1343 v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
1344 v.copyOf(v0)
1345 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
1346 v1.AuxInt = int32ToAuxInt(off)
1347 v1.Aux = symToAux(sym)
1348 v1.AddArg(ptr)
1349 v0.AddArg2(v1, mem)
1350 return true
1351 }
1352
1353
1354 for {
1355 x := v_0
1356 if x.Op != OpPPC64MOVDloadidx {
1357 break
1358 }
1359 mem := x.Args[2]
1360 ptr := x.Args[0]
1361 idx := x.Args[1]
1362 b = x.Block
1363 v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
1364 v.copyOf(v0)
1365 v0.AddArg3(ptr, idx, mem)
1366 return true
1367 }
1368 return false
1369 }
1370 func rewriteValuePPC64_OpCom16(v *Value) bool {
1371 v_0 := v.Args[0]
1372
1373
1374 for {
1375 x := v_0
1376 v.reset(OpPPC64NOR)
1377 v.AddArg2(x, x)
1378 return true
1379 }
1380 }
1381 func rewriteValuePPC64_OpCom32(v *Value) bool {
1382 v_0 := v.Args[0]
1383
1384
1385 for {
1386 x := v_0
1387 v.reset(OpPPC64NOR)
1388 v.AddArg2(x, x)
1389 return true
1390 }
1391 }
1392 func rewriteValuePPC64_OpCom64(v *Value) bool {
1393 v_0 := v.Args[0]
1394
1395
1396 for {
1397 x := v_0
1398 v.reset(OpPPC64NOR)
1399 v.AddArg2(x, x)
1400 return true
1401 }
1402 }
1403 func rewriteValuePPC64_OpCom8(v *Value) bool {
1404 v_0 := v.Args[0]
1405
1406
1407 for {
1408 x := v_0
1409 v.reset(OpPPC64NOR)
1410 v.AddArg2(x, x)
1411 return true
1412 }
1413 }
1414 func rewriteValuePPC64_OpCondSelect(v *Value) bool {
1415 v_2 := v.Args[2]
1416 v_1 := v.Args[1]
1417 v_0 := v.Args[0]
1418 b := v.Block
1419 typ := &b.Func.Config.Types
1420
1421
1422 for {
1423 x := v_0
1424 y := v_1
1425 if v_2.Op != OpPPC64SETBC {
1426 break
1427 }
1428 a := auxIntToInt32(v_2.AuxInt)
1429 cmp := v_2.Args[0]
1430 v.reset(OpPPC64ISEL)
1431 v.AuxInt = int32ToAuxInt(a)
1432 v.AddArg3(x, y, cmp)
1433 return true
1434 }
1435
1436
1437 for {
1438 x := v_0
1439 y := v_1
1440 if v_2.Op != OpPPC64SETBCR {
1441 break
1442 }
1443 a := auxIntToInt32(v_2.AuxInt)
1444 cmp := v_2.Args[0]
1445 v.reset(OpPPC64ISEL)
1446 v.AuxInt = int32ToAuxInt(a + 4)
1447 v.AddArg3(x, y, cmp)
1448 return true
1449 }
1450
1451
1452
1453 for {
1454 x := v_0
1455 y := v_1
1456 bool := v_2
1457 if !(flagArg(bool) == nil) {
1458 break
1459 }
1460 v.reset(OpPPC64ISEL)
1461 v.AuxInt = int32ToAuxInt(6)
1462 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
1463 v0.AuxInt = int64ToAuxInt(0)
1464 v1 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
1465 v1.AuxInt = int64ToAuxInt(1)
1466 v1.AddArg(bool)
1467 v0.AddArg(v1)
1468 v.AddArg3(x, y, v0)
1469 return true
1470 }
1471 return false
1472 }
1473 func rewriteValuePPC64_OpConst16(v *Value) bool {
1474
1475
1476 for {
1477 val := auxIntToInt16(v.AuxInt)
1478 v.reset(OpPPC64MOVDconst)
1479 v.AuxInt = int64ToAuxInt(int64(val))
1480 return true
1481 }
1482 }
1483 func rewriteValuePPC64_OpConst32(v *Value) bool {
1484
1485
1486 for {
1487 val := auxIntToInt32(v.AuxInt)
1488 v.reset(OpPPC64MOVDconst)
1489 v.AuxInt = int64ToAuxInt(int64(val))
1490 return true
1491 }
1492 }
1493 func rewriteValuePPC64_OpConst64(v *Value) bool {
1494
1495
1496 for {
1497 val := auxIntToInt64(v.AuxInt)
1498 v.reset(OpPPC64MOVDconst)
1499 v.AuxInt = int64ToAuxInt(int64(val))
1500 return true
1501 }
1502 }
1503 func rewriteValuePPC64_OpConst8(v *Value) bool {
1504
1505
1506 for {
1507 val := auxIntToInt8(v.AuxInt)
1508 v.reset(OpPPC64MOVDconst)
1509 v.AuxInt = int64ToAuxInt(int64(val))
1510 return true
1511 }
1512 }
1513 func rewriteValuePPC64_OpConstBool(v *Value) bool {
1514
1515
1516 for {
1517 t := auxIntToBool(v.AuxInt)
1518 v.reset(OpPPC64MOVDconst)
1519 v.AuxInt = int64ToAuxInt(b2i(t))
1520 return true
1521 }
1522 }
1523 func rewriteValuePPC64_OpConstNil(v *Value) bool {
1524
1525
1526 for {
1527 v.reset(OpPPC64MOVDconst)
1528 v.AuxInt = int64ToAuxInt(0)
1529 return true
1530 }
1531 }
1532 func rewriteValuePPC64_OpCopysign(v *Value) bool {
1533 v_1 := v.Args[1]
1534 v_0 := v.Args[0]
1535
1536
1537 for {
1538 x := v_0
1539 y := v_1
1540 v.reset(OpPPC64FCPSGN)
1541 v.AddArg2(y, x)
1542 return true
1543 }
1544 }
1545 func rewriteValuePPC64_OpCtz16(v *Value) bool {
1546 v_0 := v.Args[0]
1547 b := v.Block
1548 typ := &b.Func.Config.Types
1549
1550
1551
1552 for {
1553 x := v_0
1554 if !(buildcfg.GOPPC64 <= 8) {
1555 break
1556 }
1557 v.reset(OpPPC64POPCNTW)
1558 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
1559 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int16)
1560 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int16)
1561 v2.AuxInt = int64ToAuxInt(-1)
1562 v2.AddArg(x)
1563 v1.AddArg2(v2, x)
1564 v0.AddArg(v1)
1565 v.AddArg(v0)
1566 return true
1567 }
1568
1569
1570
1571 for {
1572 x := v_0
1573 if !(buildcfg.GOPPC64 >= 9) {
1574 break
1575 }
1576 v.reset(OpPPC64CNTTZD)
1577 v0 := b.NewValue0(v.Pos, OpPPC64OR, typ.UInt64)
1578 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
1579 v1.AuxInt = int64ToAuxInt(1 << 16)
1580 v0.AddArg2(x, v1)
1581 v.AddArg(v0)
1582 return true
1583 }
1584 return false
1585 }
1586 func rewriteValuePPC64_OpCtz32(v *Value) bool {
1587 v_0 := v.Args[0]
1588 b := v.Block
1589 typ := &b.Func.Config.Types
1590
1591
1592
1593 for {
1594 x := v_0
1595 if !(buildcfg.GOPPC64 <= 8) {
1596 break
1597 }
1598 v.reset(OpPPC64POPCNTW)
1599 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
1600 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int)
1601 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int)
1602 v2.AuxInt = int64ToAuxInt(-1)
1603 v2.AddArg(x)
1604 v1.AddArg2(v2, x)
1605 v0.AddArg(v1)
1606 v.AddArg(v0)
1607 return true
1608 }
1609
1610
1611
1612 for {
1613 x := v_0
1614 if !(buildcfg.GOPPC64 >= 9) {
1615 break
1616 }
1617 v.reset(OpPPC64CNTTZW)
1618 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
1619 v0.AddArg(x)
1620 v.AddArg(v0)
1621 return true
1622 }
1623 return false
1624 }
1625 func rewriteValuePPC64_OpCtz64(v *Value) bool {
1626 v_0 := v.Args[0]
1627 b := v.Block
1628 typ := &b.Func.Config.Types
1629
1630
1631
1632 for {
1633 x := v_0
1634 if !(buildcfg.GOPPC64 <= 8) {
1635 break
1636 }
1637 v.reset(OpPPC64POPCNTD)
1638 v0 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int64)
1639 v1 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int64)
1640 v1.AuxInt = int64ToAuxInt(-1)
1641 v1.AddArg(x)
1642 v0.AddArg2(v1, x)
1643 v.AddArg(v0)
1644 return true
1645 }
1646
1647
1648
1649 for {
1650 x := v_0
1651 if !(buildcfg.GOPPC64 >= 9) {
1652 break
1653 }
1654 v.reset(OpPPC64CNTTZD)
1655 v.AddArg(x)
1656 return true
1657 }
1658 return false
1659 }
1660 func rewriteValuePPC64_OpCtz8(v *Value) bool {
1661 v_0 := v.Args[0]
1662 b := v.Block
1663 typ := &b.Func.Config.Types
1664
1665
1666
1667 for {
1668 x := v_0
1669 if !(buildcfg.GOPPC64 <= 8) {
1670 break
1671 }
1672 v.reset(OpPPC64POPCNTB)
1673 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
1674 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.UInt8)
1675 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.UInt8)
1676 v2.AuxInt = int64ToAuxInt(-1)
1677 v2.AddArg(x)
1678 v1.AddArg2(v2, x)
1679 v0.AddArg(v1)
1680 v.AddArg(v0)
1681 return true
1682 }
1683
1684
1685
1686 for {
1687 x := v_0
1688 if !(buildcfg.GOPPC64 >= 9) {
1689 break
1690 }
1691 v.reset(OpPPC64CNTTZD)
1692 v0 := b.NewValue0(v.Pos, OpPPC64OR, typ.UInt64)
1693 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
1694 v1.AuxInt = int64ToAuxInt(1 << 8)
1695 v0.AddArg2(x, v1)
1696 v.AddArg(v0)
1697 return true
1698 }
1699 return false
1700 }
1701 func rewriteValuePPC64_OpCvt32Fto32(v *Value) bool {
1702 v_0 := v.Args[0]
1703 b := v.Block
1704 typ := &b.Func.Config.Types
1705
1706
1707 for {
1708 x := v_0
1709 v.reset(OpPPC64MFVSRD)
1710 v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
1711 v0.AddArg(x)
1712 v.AddArg(v0)
1713 return true
1714 }
1715 }
1716 func rewriteValuePPC64_OpCvt32Fto64(v *Value) bool {
1717 v_0 := v.Args[0]
1718 b := v.Block
1719 typ := &b.Func.Config.Types
1720
1721
1722 for {
1723 x := v_0
1724 v.reset(OpPPC64MFVSRD)
1725 v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
1726 v0.AddArg(x)
1727 v.AddArg(v0)
1728 return true
1729 }
1730 }
1731 func rewriteValuePPC64_OpCvt32to32F(v *Value) bool {
1732 v_0 := v.Args[0]
1733 b := v.Block
1734 typ := &b.Func.Config.Types
1735
1736
1737 for {
1738 x := v_0
1739 v.reset(OpPPC64FCFIDS)
1740 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1741 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1742 v1.AddArg(x)
1743 v0.AddArg(v1)
1744 v.AddArg(v0)
1745 return true
1746 }
1747 }
1748 func rewriteValuePPC64_OpCvt32to64F(v *Value) bool {
1749 v_0 := v.Args[0]
1750 b := v.Block
1751 typ := &b.Func.Config.Types
1752
1753
1754 for {
1755 x := v_0
1756 v.reset(OpPPC64FCFID)
1757 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1758 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1759 v1.AddArg(x)
1760 v0.AddArg(v1)
1761 v.AddArg(v0)
1762 return true
1763 }
1764 }
1765 func rewriteValuePPC64_OpCvt64Fto32(v *Value) bool {
1766 v_0 := v.Args[0]
1767 b := v.Block
1768 typ := &b.Func.Config.Types
1769
1770
1771 for {
1772 x := v_0
1773 v.reset(OpPPC64MFVSRD)
1774 v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
1775 v0.AddArg(x)
1776 v.AddArg(v0)
1777 return true
1778 }
1779 }
1780 func rewriteValuePPC64_OpCvt64Fto64(v *Value) bool {
1781 v_0 := v.Args[0]
1782 b := v.Block
1783 typ := &b.Func.Config.Types
1784
1785
1786 for {
1787 x := v_0
1788 v.reset(OpPPC64MFVSRD)
1789 v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
1790 v0.AddArg(x)
1791 v.AddArg(v0)
1792 return true
1793 }
1794 }
1795 func rewriteValuePPC64_OpCvt64to32F(v *Value) bool {
1796 v_0 := v.Args[0]
1797 b := v.Block
1798 typ := &b.Func.Config.Types
1799
1800
1801 for {
1802 x := v_0
1803 v.reset(OpPPC64FCFIDS)
1804 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1805 v0.AddArg(x)
1806 v.AddArg(v0)
1807 return true
1808 }
1809 }
1810 func rewriteValuePPC64_OpCvt64to64F(v *Value) bool {
1811 v_0 := v.Args[0]
1812 b := v.Block
1813 typ := &b.Func.Config.Types
1814
1815
1816 for {
1817 x := v_0
1818 v.reset(OpPPC64FCFID)
1819 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1820 v0.AddArg(x)
1821 v.AddArg(v0)
1822 return true
1823 }
1824 }
1825 func rewriteValuePPC64_OpDiv16(v *Value) bool {
1826 v_1 := v.Args[1]
1827 v_0 := v.Args[0]
1828 b := v.Block
1829 typ := &b.Func.Config.Types
1830
1831
1832 for {
1833 if auxIntToBool(v.AuxInt) != false {
1834 break
1835 }
1836 x := v_0
1837 y := v_1
1838 v.reset(OpPPC64DIVW)
1839 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1840 v0.AddArg(x)
1841 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1842 v1.AddArg(y)
1843 v.AddArg2(v0, v1)
1844 return true
1845 }
1846 return false
1847 }
1848 func rewriteValuePPC64_OpDiv16u(v *Value) bool {
1849 v_1 := v.Args[1]
1850 v_0 := v.Args[0]
1851 b := v.Block
1852 typ := &b.Func.Config.Types
1853
1854
1855 for {
1856 x := v_0
1857 y := v_1
1858 v.reset(OpPPC64DIVWU)
1859 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1860 v0.AddArg(x)
1861 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1862 v1.AddArg(y)
1863 v.AddArg2(v0, v1)
1864 return true
1865 }
1866 }
1867 func rewriteValuePPC64_OpDiv32(v *Value) bool {
1868 v_1 := v.Args[1]
1869 v_0 := v.Args[0]
1870
1871
1872 for {
1873 if auxIntToBool(v.AuxInt) != false {
1874 break
1875 }
1876 x := v_0
1877 y := v_1
1878 v.reset(OpPPC64DIVW)
1879 v.AddArg2(x, y)
1880 return true
1881 }
1882 return false
1883 }
1884 func rewriteValuePPC64_OpDiv64(v *Value) bool {
1885 v_1 := v.Args[1]
1886 v_0 := v.Args[0]
1887
1888
1889 for {
1890 if auxIntToBool(v.AuxInt) != false {
1891 break
1892 }
1893 x := v_0
1894 y := v_1
1895 v.reset(OpPPC64DIVD)
1896 v.AddArg2(x, y)
1897 return true
1898 }
1899 return false
1900 }
1901 func rewriteValuePPC64_OpDiv8(v *Value) bool {
1902 v_1 := v.Args[1]
1903 v_0 := v.Args[0]
1904 b := v.Block
1905 typ := &b.Func.Config.Types
1906
1907
1908 for {
1909 x := v_0
1910 y := v_1
1911 v.reset(OpPPC64DIVW)
1912 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1913 v0.AddArg(x)
1914 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1915 v1.AddArg(y)
1916 v.AddArg2(v0, v1)
1917 return true
1918 }
1919 }
1920 func rewriteValuePPC64_OpDiv8u(v *Value) bool {
1921 v_1 := v.Args[1]
1922 v_0 := v.Args[0]
1923 b := v.Block
1924 typ := &b.Func.Config.Types
1925
1926
1927 for {
1928 x := v_0
1929 y := v_1
1930 v.reset(OpPPC64DIVWU)
1931 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
1932 v0.AddArg(x)
1933 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
1934 v1.AddArg(y)
1935 v.AddArg2(v0, v1)
1936 return true
1937 }
1938 }
1939 func rewriteValuePPC64_OpEq16(v *Value) bool {
1940 v_1 := v.Args[1]
1941 v_0 := v.Args[0]
1942 b := v.Block
1943 typ := &b.Func.Config.Types
1944
1945
1946
1947 for {
1948 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1949 x := v_0
1950 y := v_1
1951 if !(x.Type.IsSigned() && y.Type.IsSigned()) {
1952 continue
1953 }
1954 v.reset(OpPPC64Equal)
1955 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1956 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1957 v1.AddArg(x)
1958 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1959 v2.AddArg(y)
1960 v0.AddArg2(v1, v2)
1961 v.AddArg(v0)
1962 return true
1963 }
1964 break
1965 }
1966
1967
1968 for {
1969 x := v_0
1970 y := v_1
1971 v.reset(OpPPC64Equal)
1972 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1973 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1974 v1.AddArg(x)
1975 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1976 v2.AddArg(y)
1977 v0.AddArg2(v1, v2)
1978 v.AddArg(v0)
1979 return true
1980 }
1981 }
1982 func rewriteValuePPC64_OpEq32(v *Value) bool {
1983 v_1 := v.Args[1]
1984 v_0 := v.Args[0]
1985 b := v.Block
1986
1987
1988 for {
1989 x := v_0
1990 y := v_1
1991 v.reset(OpPPC64Equal)
1992 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1993 v0.AddArg2(x, y)
1994 v.AddArg(v0)
1995 return true
1996 }
1997 }
1998 func rewriteValuePPC64_OpEq32F(v *Value) bool {
1999 v_1 := v.Args[1]
2000 v_0 := v.Args[0]
2001 b := v.Block
2002
2003
2004 for {
2005 x := v_0
2006 y := v_1
2007 v.reset(OpPPC64Equal)
2008 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2009 v0.AddArg2(x, y)
2010 v.AddArg(v0)
2011 return true
2012 }
2013 }
2014 func rewriteValuePPC64_OpEq64(v *Value) bool {
2015 v_1 := v.Args[1]
2016 v_0 := v.Args[0]
2017 b := v.Block
2018
2019
2020 for {
2021 x := v_0
2022 y := v_1
2023 v.reset(OpPPC64Equal)
2024 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
2025 v0.AddArg2(x, y)
2026 v.AddArg(v0)
2027 return true
2028 }
2029 }
2030 func rewriteValuePPC64_OpEq64F(v *Value) bool {
2031 v_1 := v.Args[1]
2032 v_0 := v.Args[0]
2033 b := v.Block
2034
2035
2036 for {
2037 x := v_0
2038 y := v_1
2039 v.reset(OpPPC64Equal)
2040 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2041 v0.AddArg2(x, y)
2042 v.AddArg(v0)
2043 return true
2044 }
2045 }
2046 func rewriteValuePPC64_OpEq8(v *Value) bool {
2047 v_1 := v.Args[1]
2048 v_0 := v.Args[0]
2049 b := v.Block
2050 typ := &b.Func.Config.Types
2051
2052
2053
2054 for {
2055 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2056 x := v_0
2057 y := v_1
2058 if !(x.Type.IsSigned() && y.Type.IsSigned()) {
2059 continue
2060 }
2061 v.reset(OpPPC64Equal)
2062 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2063 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2064 v1.AddArg(x)
2065 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2066 v2.AddArg(y)
2067 v0.AddArg2(v1, v2)
2068 v.AddArg(v0)
2069 return true
2070 }
2071 break
2072 }
2073
2074
2075 for {
2076 x := v_0
2077 y := v_1
2078 v.reset(OpPPC64Equal)
2079 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2080 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2081 v1.AddArg(x)
2082 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2083 v2.AddArg(y)
2084 v0.AddArg2(v1, v2)
2085 v.AddArg(v0)
2086 return true
2087 }
2088 }
2089 func rewriteValuePPC64_OpEqB(v *Value) bool {
2090 v_1 := v.Args[1]
2091 v_0 := v.Args[0]
2092 b := v.Block
2093 typ := &b.Func.Config.Types
2094
2095
2096 for {
2097 x := v_0
2098 y := v_1
2099 v.reset(OpPPC64ANDconst)
2100 v.AuxInt = int64ToAuxInt(1)
2101 v0 := b.NewValue0(v.Pos, OpPPC64EQV, typ.Int64)
2102 v0.AddArg2(x, y)
2103 v.AddArg(v0)
2104 return true
2105 }
2106 }
2107 func rewriteValuePPC64_OpEqPtr(v *Value) bool {
2108 v_1 := v.Args[1]
2109 v_0 := v.Args[0]
2110 b := v.Block
2111
2112
2113 for {
2114 x := v_0
2115 y := v_1
2116 v.reset(OpPPC64Equal)
2117 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
2118 v0.AddArg2(x, y)
2119 v.AddArg(v0)
2120 return true
2121 }
2122 }
2123 func rewriteValuePPC64_OpIsInBounds(v *Value) bool {
2124 v_1 := v.Args[1]
2125 v_0 := v.Args[0]
2126 b := v.Block
2127
2128
2129 for {
2130 idx := v_0
2131 len := v_1
2132 v.reset(OpPPC64LessThan)
2133 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2134 v0.AddArg2(idx, len)
2135 v.AddArg(v0)
2136 return true
2137 }
2138 }
2139 func rewriteValuePPC64_OpIsNonNil(v *Value) bool {
2140 v_0 := v.Args[0]
2141 b := v.Block
2142
2143
2144 for {
2145 ptr := v_0
2146 v.reset(OpPPC64NotEqual)
2147 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
2148 v0.AuxInt = int64ToAuxInt(0)
2149 v0.AddArg(ptr)
2150 v.AddArg(v0)
2151 return true
2152 }
2153 }
2154 func rewriteValuePPC64_OpIsSliceInBounds(v *Value) bool {
2155 v_1 := v.Args[1]
2156 v_0 := v.Args[0]
2157 b := v.Block
2158
2159
2160 for {
2161 idx := v_0
2162 len := v_1
2163 v.reset(OpPPC64LessEqual)
2164 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2165 v0.AddArg2(idx, len)
2166 v.AddArg(v0)
2167 return true
2168 }
2169 }
2170 func rewriteValuePPC64_OpLeq16(v *Value) bool {
2171 v_1 := v.Args[1]
2172 v_0 := v.Args[0]
2173 b := v.Block
2174 typ := &b.Func.Config.Types
2175
2176
2177 for {
2178 x := v_0
2179 y := v_1
2180 v.reset(OpPPC64LessEqual)
2181 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2182 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2183 v1.AddArg(x)
2184 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2185 v2.AddArg(y)
2186 v0.AddArg2(v1, v2)
2187 v.AddArg(v0)
2188 return true
2189 }
2190 }
2191 func rewriteValuePPC64_OpLeq16U(v *Value) bool {
2192 v_1 := v.Args[1]
2193 v_0 := v.Args[0]
2194 b := v.Block
2195 typ := &b.Func.Config.Types
2196
2197
2198 for {
2199 x := v_0
2200 y := v_1
2201 v.reset(OpPPC64LessEqual)
2202 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2203 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2204 v1.AddArg(x)
2205 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2206 v2.AddArg(y)
2207 v0.AddArg2(v1, v2)
2208 v.AddArg(v0)
2209 return true
2210 }
2211 }
2212 func rewriteValuePPC64_OpLeq32(v *Value) bool {
2213 v_1 := v.Args[1]
2214 v_0 := v.Args[0]
2215 b := v.Block
2216
2217
2218 for {
2219 x := v_0
2220 y := v_1
2221 v.reset(OpPPC64LessEqual)
2222 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2223 v0.AddArg2(x, y)
2224 v.AddArg(v0)
2225 return true
2226 }
2227 }
2228 func rewriteValuePPC64_OpLeq32F(v *Value) bool {
2229 v_1 := v.Args[1]
2230 v_0 := v.Args[0]
2231 b := v.Block
2232
2233
2234 for {
2235 x := v_0
2236 y := v_1
2237 v.reset(OpPPC64FLessEqual)
2238 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2239 v0.AddArg2(x, y)
2240 v.AddArg(v0)
2241 return true
2242 }
2243 }
2244 func rewriteValuePPC64_OpLeq32U(v *Value) bool {
2245 v_1 := v.Args[1]
2246 v_0 := v.Args[0]
2247 b := v.Block
2248
2249
2250 for {
2251 x := v_0
2252 y := v_1
2253 v.reset(OpPPC64LessEqual)
2254 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2255 v0.AddArg2(x, y)
2256 v.AddArg(v0)
2257 return true
2258 }
2259 }
2260 func rewriteValuePPC64_OpLeq64(v *Value) bool {
2261 v_1 := v.Args[1]
2262 v_0 := v.Args[0]
2263 b := v.Block
2264
2265
2266 for {
2267 x := v_0
2268 y := v_1
2269 v.reset(OpPPC64LessEqual)
2270 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
2271 v0.AddArg2(x, y)
2272 v.AddArg(v0)
2273 return true
2274 }
2275 }
2276 func rewriteValuePPC64_OpLeq64F(v *Value) bool {
2277 v_1 := v.Args[1]
2278 v_0 := v.Args[0]
2279 b := v.Block
2280
2281
2282 for {
2283 x := v_0
2284 y := v_1
2285 v.reset(OpPPC64FLessEqual)
2286 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2287 v0.AddArg2(x, y)
2288 v.AddArg(v0)
2289 return true
2290 }
2291 }
2292 func rewriteValuePPC64_OpLeq64U(v *Value) bool {
2293 v_1 := v.Args[1]
2294 v_0 := v.Args[0]
2295 b := v.Block
2296
2297
2298 for {
2299 x := v_0
2300 y := v_1
2301 v.reset(OpPPC64LessEqual)
2302 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2303 v0.AddArg2(x, y)
2304 v.AddArg(v0)
2305 return true
2306 }
2307 }
2308 func rewriteValuePPC64_OpLeq8(v *Value) bool {
2309 v_1 := v.Args[1]
2310 v_0 := v.Args[0]
2311 b := v.Block
2312 typ := &b.Func.Config.Types
2313
2314
2315 for {
2316 x := v_0
2317 y := v_1
2318 v.reset(OpPPC64LessEqual)
2319 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2320 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2321 v1.AddArg(x)
2322 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2323 v2.AddArg(y)
2324 v0.AddArg2(v1, v2)
2325 v.AddArg(v0)
2326 return true
2327 }
2328 }
2329 func rewriteValuePPC64_OpLeq8U(v *Value) bool {
2330 v_1 := v.Args[1]
2331 v_0 := v.Args[0]
2332 b := v.Block
2333 typ := &b.Func.Config.Types
2334
2335
2336 for {
2337 x := v_0
2338 y := v_1
2339 v.reset(OpPPC64LessEqual)
2340 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2341 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2342 v1.AddArg(x)
2343 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2344 v2.AddArg(y)
2345 v0.AddArg2(v1, v2)
2346 v.AddArg(v0)
2347 return true
2348 }
2349 }
2350 func rewriteValuePPC64_OpLess16(v *Value) bool {
2351 v_1 := v.Args[1]
2352 v_0 := v.Args[0]
2353 b := v.Block
2354 typ := &b.Func.Config.Types
2355
2356
2357 for {
2358 x := v_0
2359 y := v_1
2360 v.reset(OpPPC64LessThan)
2361 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2362 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2363 v1.AddArg(x)
2364 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2365 v2.AddArg(y)
2366 v0.AddArg2(v1, v2)
2367 v.AddArg(v0)
2368 return true
2369 }
2370 }
2371 func rewriteValuePPC64_OpLess16U(v *Value) bool {
2372 v_1 := v.Args[1]
2373 v_0 := v.Args[0]
2374 b := v.Block
2375 typ := &b.Func.Config.Types
2376
2377
2378 for {
2379 x := v_0
2380 y := v_1
2381 v.reset(OpPPC64LessThan)
2382 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2383 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2384 v1.AddArg(x)
2385 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2386 v2.AddArg(y)
2387 v0.AddArg2(v1, v2)
2388 v.AddArg(v0)
2389 return true
2390 }
2391 }
2392 func rewriteValuePPC64_OpLess32(v *Value) bool {
2393 v_1 := v.Args[1]
2394 v_0 := v.Args[0]
2395 b := v.Block
2396
2397
2398 for {
2399 x := v_0
2400 y := v_1
2401 v.reset(OpPPC64LessThan)
2402 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2403 v0.AddArg2(x, y)
2404 v.AddArg(v0)
2405 return true
2406 }
2407 }
2408 func rewriteValuePPC64_OpLess32F(v *Value) bool {
2409 v_1 := v.Args[1]
2410 v_0 := v.Args[0]
2411 b := v.Block
2412
2413
2414 for {
2415 x := v_0
2416 y := v_1
2417 v.reset(OpPPC64FLessThan)
2418 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2419 v0.AddArg2(x, y)
2420 v.AddArg(v0)
2421 return true
2422 }
2423 }
2424 func rewriteValuePPC64_OpLess32U(v *Value) bool {
2425 v_1 := v.Args[1]
2426 v_0 := v.Args[0]
2427 b := v.Block
2428
2429
2430 for {
2431 x := v_0
2432 y := v_1
2433 v.reset(OpPPC64LessThan)
2434 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2435 v0.AddArg2(x, y)
2436 v.AddArg(v0)
2437 return true
2438 }
2439 }
2440 func rewriteValuePPC64_OpLess64(v *Value) bool {
2441 v_1 := v.Args[1]
2442 v_0 := v.Args[0]
2443 b := v.Block
2444
2445
2446 for {
2447 x := v_0
2448 y := v_1
2449 v.reset(OpPPC64LessThan)
2450 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
2451 v0.AddArg2(x, y)
2452 v.AddArg(v0)
2453 return true
2454 }
2455 }
2456 func rewriteValuePPC64_OpLess64F(v *Value) bool {
2457 v_1 := v.Args[1]
2458 v_0 := v.Args[0]
2459 b := v.Block
2460
2461
2462 for {
2463 x := v_0
2464 y := v_1
2465 v.reset(OpPPC64FLessThan)
2466 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2467 v0.AddArg2(x, y)
2468 v.AddArg(v0)
2469 return true
2470 }
2471 }
2472 func rewriteValuePPC64_OpLess64U(v *Value) bool {
2473 v_1 := v.Args[1]
2474 v_0 := v.Args[0]
2475 b := v.Block
2476
2477
2478 for {
2479 x := v_0
2480 y := v_1
2481 v.reset(OpPPC64LessThan)
2482 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2483 v0.AddArg2(x, y)
2484 v.AddArg(v0)
2485 return true
2486 }
2487 }
2488 func rewriteValuePPC64_OpLess8(v *Value) bool {
2489 v_1 := v.Args[1]
2490 v_0 := v.Args[0]
2491 b := v.Block
2492 typ := &b.Func.Config.Types
2493
2494
2495 for {
2496 x := v_0
2497 y := v_1
2498 v.reset(OpPPC64LessThan)
2499 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2500 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2501 v1.AddArg(x)
2502 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2503 v2.AddArg(y)
2504 v0.AddArg2(v1, v2)
2505 v.AddArg(v0)
2506 return true
2507 }
2508 }
2509 func rewriteValuePPC64_OpLess8U(v *Value) bool {
2510 v_1 := v.Args[1]
2511 v_0 := v.Args[0]
2512 b := v.Block
2513 typ := &b.Func.Config.Types
2514
2515
2516 for {
2517 x := v_0
2518 y := v_1
2519 v.reset(OpPPC64LessThan)
2520 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2521 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2522 v1.AddArg(x)
2523 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2524 v2.AddArg(y)
2525 v0.AddArg2(v1, v2)
2526 v.AddArg(v0)
2527 return true
2528 }
2529 }
2530 func rewriteValuePPC64_OpLoad(v *Value) bool {
2531 v_1 := v.Args[1]
2532 v_0 := v.Args[0]
2533 b := v.Block
2534 typ := &b.Func.Config.Types
2535
2536
2537
2538 for {
2539 t := v.Type
2540 ptr := v_0
2541 mem := v_1
2542 if !(is64BitInt(t) || isPtr(t)) {
2543 break
2544 }
2545 v.reset(OpPPC64MOVDload)
2546 v.AddArg2(ptr, mem)
2547 return true
2548 }
2549
2550
2551
2552 for {
2553 t := v.Type
2554 ptr := v_0
2555 mem := v_1
2556 if !(is32BitInt(t) && t.IsSigned()) {
2557 break
2558 }
2559 v.reset(OpPPC64MOVWload)
2560 v.AddArg2(ptr, mem)
2561 return true
2562 }
2563
2564
2565
2566 for {
2567 t := v.Type
2568 ptr := v_0
2569 mem := v_1
2570 if !(is32BitInt(t) && !t.IsSigned()) {
2571 break
2572 }
2573 v.reset(OpPPC64MOVWZload)
2574 v.AddArg2(ptr, mem)
2575 return true
2576 }
2577
2578
2579
2580 for {
2581 t := v.Type
2582 ptr := v_0
2583 mem := v_1
2584 if !(is16BitInt(t) && t.IsSigned()) {
2585 break
2586 }
2587 v.reset(OpPPC64MOVHload)
2588 v.AddArg2(ptr, mem)
2589 return true
2590 }
2591
2592
2593
2594 for {
2595 t := v.Type
2596 ptr := v_0
2597 mem := v_1
2598 if !(is16BitInt(t) && !t.IsSigned()) {
2599 break
2600 }
2601 v.reset(OpPPC64MOVHZload)
2602 v.AddArg2(ptr, mem)
2603 return true
2604 }
2605
2606
2607
2608 for {
2609 t := v.Type
2610 ptr := v_0
2611 mem := v_1
2612 if !(t.IsBoolean()) {
2613 break
2614 }
2615 v.reset(OpPPC64MOVBZload)
2616 v.AddArg2(ptr, mem)
2617 return true
2618 }
2619
2620
2621
2622 for {
2623 t := v.Type
2624 ptr := v_0
2625 mem := v_1
2626 if !(is8BitInt(t) && t.IsSigned()) {
2627 break
2628 }
2629 v.reset(OpPPC64MOVBreg)
2630 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
2631 v0.AddArg2(ptr, mem)
2632 v.AddArg(v0)
2633 return true
2634 }
2635
2636
2637
2638 for {
2639 t := v.Type
2640 ptr := v_0
2641 mem := v_1
2642 if !(is8BitInt(t) && !t.IsSigned()) {
2643 break
2644 }
2645 v.reset(OpPPC64MOVBZload)
2646 v.AddArg2(ptr, mem)
2647 return true
2648 }
2649
2650
2651
2652 for {
2653 t := v.Type
2654 ptr := v_0
2655 mem := v_1
2656 if !(is32BitFloat(t)) {
2657 break
2658 }
2659 v.reset(OpPPC64FMOVSload)
2660 v.AddArg2(ptr, mem)
2661 return true
2662 }
2663
2664
2665
2666 for {
2667 t := v.Type
2668 ptr := v_0
2669 mem := v_1
2670 if !(is64BitFloat(t)) {
2671 break
2672 }
2673 v.reset(OpPPC64FMOVDload)
2674 v.AddArg2(ptr, mem)
2675 return true
2676 }
2677 return false
2678 }
2679 func rewriteValuePPC64_OpLocalAddr(v *Value) bool {
2680 v_1 := v.Args[1]
2681 v_0 := v.Args[0]
2682 b := v.Block
2683 typ := &b.Func.Config.Types
2684
2685
2686
2687 for {
2688 t := v.Type
2689 sym := auxToSym(v.Aux)
2690 base := v_0
2691 mem := v_1
2692 if !(t.Elem().HasPointers()) {
2693 break
2694 }
2695 v.reset(OpPPC64MOVDaddr)
2696 v.Aux = symToAux(sym)
2697 v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
2698 v0.AddArg2(base, mem)
2699 v.AddArg(v0)
2700 return true
2701 }
2702
2703
2704
2705 for {
2706 t := v.Type
2707 sym := auxToSym(v.Aux)
2708 base := v_0
2709 if !(!t.Elem().HasPointers()) {
2710 break
2711 }
2712 v.reset(OpPPC64MOVDaddr)
2713 v.Aux = symToAux(sym)
2714 v.AddArg(base)
2715 return true
2716 }
2717 return false
2718 }
2719 func rewriteValuePPC64_OpLsh16x16(v *Value) bool {
2720 v_1 := v.Args[1]
2721 v_0 := v.Args[0]
2722 b := v.Block
2723 typ := &b.Func.Config.Types
2724
2725
2726
2727 for {
2728 x := v_0
2729 y := v_1
2730 if !(shiftIsBounded(v)) {
2731 break
2732 }
2733 v.reset(OpPPC64SLD)
2734 v.AddArg2(x, y)
2735 return true
2736 }
2737
2738
2739 for {
2740 t := v.Type
2741 x := v_0
2742 y := v_1
2743 v.reset(OpPPC64ISEL)
2744 v.AuxInt = int32ToAuxInt(2)
2745 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2746 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
2747 v1.AddArg(x)
2748 v0.AddArg2(v1, y)
2749 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2750 v2.AuxInt = int64ToAuxInt(0)
2751 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
2752 v3.AuxInt = int64ToAuxInt(0)
2753 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
2754 v4.AuxInt = int64ToAuxInt(0xFFF0)
2755 v4.AddArg(y)
2756 v3.AddArg(v4)
2757 v.AddArg3(v0, v2, v3)
2758 return true
2759 }
2760 }
2761 func rewriteValuePPC64_OpLsh16x32(v *Value) bool {
2762 v_1 := v.Args[1]
2763 v_0 := v.Args[0]
2764 b := v.Block
2765 typ := &b.Func.Config.Types
2766
2767
2768
2769 for {
2770 x := v_0
2771 y := v_1
2772 if !(shiftIsBounded(v)) {
2773 break
2774 }
2775 v.reset(OpPPC64SLD)
2776 v.AddArg2(x, y)
2777 return true
2778 }
2779
2780
2781 for {
2782 t := v.Type
2783 x := v_0
2784 y := v_1
2785 v.reset(OpPPC64ISEL)
2786 v.AuxInt = int32ToAuxInt(0)
2787 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2788 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
2789 v1.AddArg(x)
2790 v0.AddArg2(v1, y)
2791 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2792 v2.AuxInt = int64ToAuxInt(0)
2793 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
2794 v3.AuxInt = int32ToAuxInt(16)
2795 v3.AddArg(y)
2796 v.AddArg3(v0, v2, v3)
2797 return true
2798 }
2799 }
2800 func rewriteValuePPC64_OpLsh16x64(v *Value) bool {
2801 v_1 := v.Args[1]
2802 v_0 := v.Args[0]
2803 b := v.Block
2804 typ := &b.Func.Config.Types
2805
2806
2807
2808 for {
2809 x := v_0
2810 if v_1.Op != OpPPC64MOVDconst {
2811 break
2812 }
2813 c := auxIntToInt64(v_1.AuxInt)
2814 if !(uint64(c) < 16) {
2815 break
2816 }
2817 v.reset(OpPPC64SLWconst)
2818 v.AuxInt = int64ToAuxInt(c)
2819 v.AddArg(x)
2820 return true
2821 }
2822
2823
2824
2825 for {
2826 x := v_0
2827 y := v_1
2828 if !(shiftIsBounded(v)) {
2829 break
2830 }
2831 v.reset(OpPPC64SLD)
2832 v.AddArg2(x, y)
2833 return true
2834 }
2835
2836
2837 for {
2838 t := v.Type
2839 x := v_0
2840 y := v_1
2841 v.reset(OpPPC64ISEL)
2842 v.AuxInt = int32ToAuxInt(0)
2843 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2844 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
2845 v1.AddArg(x)
2846 v0.AddArg2(v1, y)
2847 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2848 v2.AuxInt = int64ToAuxInt(0)
2849 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
2850 v3.AuxInt = int64ToAuxInt(16)
2851 v3.AddArg(y)
2852 v.AddArg3(v0, v2, v3)
2853 return true
2854 }
2855 }
2856 func rewriteValuePPC64_OpLsh16x8(v *Value) bool {
2857 v_1 := v.Args[1]
2858 v_0 := v.Args[0]
2859 b := v.Block
2860 typ := &b.Func.Config.Types
2861
2862
2863
2864 for {
2865 x := v_0
2866 y := v_1
2867 if !(shiftIsBounded(v)) {
2868 break
2869 }
2870 v.reset(OpPPC64SLD)
2871 v.AddArg2(x, y)
2872 return true
2873 }
2874
2875
2876 for {
2877 t := v.Type
2878 x := v_0
2879 y := v_1
2880 v.reset(OpPPC64ISEL)
2881 v.AuxInt = int32ToAuxInt(2)
2882 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2883 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
2884 v1.AddArg(x)
2885 v0.AddArg2(v1, y)
2886 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2887 v2.AuxInt = int64ToAuxInt(0)
2888 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
2889 v3.AuxInt = int64ToAuxInt(0)
2890 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
2891 v4.AuxInt = int64ToAuxInt(0x00F0)
2892 v4.AddArg(y)
2893 v3.AddArg(v4)
2894 v.AddArg3(v0, v2, v3)
2895 return true
2896 }
2897 }
2898 func rewriteValuePPC64_OpLsh32x16(v *Value) bool {
2899 v_1 := v.Args[1]
2900 v_0 := v.Args[0]
2901 b := v.Block
2902 typ := &b.Func.Config.Types
2903
2904
2905
2906 for {
2907 x := v_0
2908 y := v_1
2909 if !(shiftIsBounded(v)) {
2910 break
2911 }
2912 v.reset(OpPPC64SLW)
2913 v.AddArg2(x, y)
2914 return true
2915 }
2916
2917
2918 for {
2919 t := v.Type
2920 x := v_0
2921 y := v_1
2922 v.reset(OpPPC64ISEL)
2923 v.AuxInt = int32ToAuxInt(2)
2924 v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
2925 v0.AddArg2(x, y)
2926 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2927 v1.AuxInt = int64ToAuxInt(0)
2928 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
2929 v2.AuxInt = int64ToAuxInt(0)
2930 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
2931 v3.AuxInt = int64ToAuxInt(0xFFE0)
2932 v3.AddArg(y)
2933 v2.AddArg(v3)
2934 v.AddArg3(v0, v1, v2)
2935 return true
2936 }
2937 }
2938 func rewriteValuePPC64_OpLsh32x32(v *Value) bool {
2939 v_1 := v.Args[1]
2940 v_0 := v.Args[0]
2941 b := v.Block
2942 typ := &b.Func.Config.Types
2943
2944
2945
2946 for {
2947 x := v_0
2948 y := v_1
2949 if !(shiftIsBounded(v)) {
2950 break
2951 }
2952 v.reset(OpPPC64SLW)
2953 v.AddArg2(x, y)
2954 return true
2955 }
2956
2957
2958 for {
2959 t := v.Type
2960 x := v_0
2961 y := v_1
2962 v.reset(OpPPC64ISEL)
2963 v.AuxInt = int32ToAuxInt(0)
2964 v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
2965 v0.AddArg2(x, y)
2966 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2967 v1.AuxInt = int64ToAuxInt(0)
2968 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
2969 v2.AuxInt = int32ToAuxInt(32)
2970 v2.AddArg(y)
2971 v.AddArg3(v0, v1, v2)
2972 return true
2973 }
2974 }
2975 func rewriteValuePPC64_OpLsh32x64(v *Value) bool {
2976 v_1 := v.Args[1]
2977 v_0 := v.Args[0]
2978 b := v.Block
2979 typ := &b.Func.Config.Types
2980
2981
2982
2983 for {
2984 x := v_0
2985 if v_1.Op != OpPPC64MOVDconst {
2986 break
2987 }
2988 c := auxIntToInt64(v_1.AuxInt)
2989 if !(uint64(c) < 32) {
2990 break
2991 }
2992 v.reset(OpPPC64SLWconst)
2993 v.AuxInt = int64ToAuxInt(c)
2994 v.AddArg(x)
2995 return true
2996 }
2997
2998
2999
3000 for {
3001 x := v_0
3002 y := v_1
3003 if !(shiftIsBounded(v)) {
3004 break
3005 }
3006 v.reset(OpPPC64SLW)
3007 v.AddArg2(x, y)
3008 return true
3009 }
3010
3011
3012 for {
3013 t := v.Type
3014 x := v_0
3015 y := v_1
3016 v.reset(OpPPC64ISEL)
3017 v.AuxInt = int32ToAuxInt(0)
3018 v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
3019 v0.AddArg2(x, y)
3020 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3021 v1.AuxInt = int64ToAuxInt(0)
3022 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
3023 v2.AuxInt = int64ToAuxInt(32)
3024 v2.AddArg(y)
3025 v.AddArg3(v0, v1, v2)
3026 return true
3027 }
3028 }
3029 func rewriteValuePPC64_OpLsh32x8(v *Value) bool {
3030 v_1 := v.Args[1]
3031 v_0 := v.Args[0]
3032 b := v.Block
3033 typ := &b.Func.Config.Types
3034
3035
3036
3037 for {
3038 x := v_0
3039 y := v_1
3040 if !(shiftIsBounded(v)) {
3041 break
3042 }
3043 v.reset(OpPPC64SLW)
3044 v.AddArg2(x, y)
3045 return true
3046 }
3047
3048
3049 for {
3050 t := v.Type
3051 x := v_0
3052 y := v_1
3053 v.reset(OpPPC64ISEL)
3054 v.AuxInt = int32ToAuxInt(2)
3055 v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
3056 v0.AddArg2(x, y)
3057 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3058 v1.AuxInt = int64ToAuxInt(0)
3059 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
3060 v2.AuxInt = int64ToAuxInt(0)
3061 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
3062 v3.AuxInt = int64ToAuxInt(0x00E0)
3063 v3.AddArg(y)
3064 v2.AddArg(v3)
3065 v.AddArg3(v0, v1, v2)
3066 return true
3067 }
3068 }
3069 func rewriteValuePPC64_OpLsh64x16(v *Value) bool {
3070 v_1 := v.Args[1]
3071 v_0 := v.Args[0]
3072 b := v.Block
3073 typ := &b.Func.Config.Types
3074
3075
3076
3077 for {
3078 x := v_0
3079 y := v_1
3080 if !(shiftIsBounded(v)) {
3081 break
3082 }
3083 v.reset(OpPPC64SLD)
3084 v.AddArg2(x, y)
3085 return true
3086 }
3087
3088
3089 for {
3090 t := v.Type
3091 x := v_0
3092 y := v_1
3093 v.reset(OpPPC64ISEL)
3094 v.AuxInt = int32ToAuxInt(2)
3095 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3096 v0.AddArg2(x, y)
3097 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3098 v1.AuxInt = int64ToAuxInt(0)
3099 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
3100 v2.AuxInt = int64ToAuxInt(0)
3101 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
3102 v3.AuxInt = int64ToAuxInt(0xFFC0)
3103 v3.AddArg(y)
3104 v2.AddArg(v3)
3105 v.AddArg3(v0, v1, v2)
3106 return true
3107 }
3108 }
3109 func rewriteValuePPC64_OpLsh64x32(v *Value) bool {
3110 v_1 := v.Args[1]
3111 v_0 := v.Args[0]
3112 b := v.Block
3113 typ := &b.Func.Config.Types
3114
3115
3116
3117 for {
3118 x := v_0
3119 y := v_1
3120 if !(shiftIsBounded(v)) {
3121 break
3122 }
3123 v.reset(OpPPC64SLD)
3124 v.AddArg2(x, y)
3125 return true
3126 }
3127
3128
3129 for {
3130 t := v.Type
3131 x := v_0
3132 y := v_1
3133 v.reset(OpPPC64ISEL)
3134 v.AuxInt = int32ToAuxInt(0)
3135 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3136 v0.AddArg2(x, y)
3137 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3138 v1.AuxInt = int64ToAuxInt(0)
3139 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
3140 v2.AuxInt = int32ToAuxInt(64)
3141 v2.AddArg(y)
3142 v.AddArg3(v0, v1, v2)
3143 return true
3144 }
3145 }
3146 func rewriteValuePPC64_OpLsh64x64(v *Value) bool {
3147 v_1 := v.Args[1]
3148 v_0 := v.Args[0]
3149 b := v.Block
3150 typ := &b.Func.Config.Types
3151
3152
3153
3154 for {
3155 x := v_0
3156 if v_1.Op != OpPPC64MOVDconst {
3157 break
3158 }
3159 c := auxIntToInt64(v_1.AuxInt)
3160 if !(uint64(c) < 64) {
3161 break
3162 }
3163 v.reset(OpPPC64SLDconst)
3164 v.AuxInt = int64ToAuxInt(c)
3165 v.AddArg(x)
3166 return true
3167 }
3168
3169
3170
3171 for {
3172 x := v_0
3173 y := v_1
3174 if !(shiftIsBounded(v)) {
3175 break
3176 }
3177 v.reset(OpPPC64SLD)
3178 v.AddArg2(x, y)
3179 return true
3180 }
3181
3182
3183 for {
3184 t := v.Type
3185 x := v_0
3186 y := v_1
3187 v.reset(OpPPC64ISEL)
3188 v.AuxInt = int32ToAuxInt(0)
3189 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3190 v0.AddArg2(x, y)
3191 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3192 v1.AuxInt = int64ToAuxInt(0)
3193 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
3194 v2.AuxInt = int64ToAuxInt(64)
3195 v2.AddArg(y)
3196 v.AddArg3(v0, v1, v2)
3197 return true
3198 }
3199 }
3200 func rewriteValuePPC64_OpLsh64x8(v *Value) bool {
3201 v_1 := v.Args[1]
3202 v_0 := v.Args[0]
3203 b := v.Block
3204 typ := &b.Func.Config.Types
3205
3206
3207
3208 for {
3209 x := v_0
3210 y := v_1
3211 if !(shiftIsBounded(v)) {
3212 break
3213 }
3214 v.reset(OpPPC64SLD)
3215 v.AddArg2(x, y)
3216 return true
3217 }
3218
3219
3220 for {
3221 t := v.Type
3222 x := v_0
3223 y := v_1
3224 v.reset(OpPPC64ISEL)
3225 v.AuxInt = int32ToAuxInt(2)
3226 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3227 v0.AddArg2(x, y)
3228 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3229 v1.AuxInt = int64ToAuxInt(0)
3230 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
3231 v2.AuxInt = int64ToAuxInt(0)
3232 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
3233 v3.AuxInt = int64ToAuxInt(0x00C0)
3234 v3.AddArg(y)
3235 v2.AddArg(v3)
3236 v.AddArg3(v0, v1, v2)
3237 return true
3238 }
3239 }
3240 func rewriteValuePPC64_OpLsh8x16(v *Value) bool {
3241 v_1 := v.Args[1]
3242 v_0 := v.Args[0]
3243 b := v.Block
3244 typ := &b.Func.Config.Types
3245
3246
3247
3248 for {
3249 x := v_0
3250 y := v_1
3251 if !(shiftIsBounded(v)) {
3252 break
3253 }
3254 v.reset(OpPPC64SLD)
3255 v.AddArg2(x, y)
3256 return true
3257 }
3258
3259
3260 for {
3261 t := v.Type
3262 x := v_0
3263 y := v_1
3264 v.reset(OpPPC64ISEL)
3265 v.AuxInt = int32ToAuxInt(2)
3266 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3267 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
3268 v1.AddArg(x)
3269 v0.AddArg2(v1, y)
3270 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3271 v2.AuxInt = int64ToAuxInt(0)
3272 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
3273 v3.AuxInt = int64ToAuxInt(0)
3274 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
3275 v4.AuxInt = int64ToAuxInt(0xFFF8)
3276 v4.AddArg(y)
3277 v3.AddArg(v4)
3278 v.AddArg3(v0, v2, v3)
3279 return true
3280 }
3281 }
3282 func rewriteValuePPC64_OpLsh8x32(v *Value) bool {
3283 v_1 := v.Args[1]
3284 v_0 := v.Args[0]
3285 b := v.Block
3286 typ := &b.Func.Config.Types
3287
3288
3289
3290 for {
3291 x := v_0
3292 y := v_1
3293 if !(shiftIsBounded(v)) {
3294 break
3295 }
3296 v.reset(OpPPC64SLD)
3297 v.AddArg2(x, y)
3298 return true
3299 }
3300
3301
3302 for {
3303 t := v.Type
3304 x := v_0
3305 y := v_1
3306 v.reset(OpPPC64ISEL)
3307 v.AuxInt = int32ToAuxInt(0)
3308 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3309 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
3310 v1.AddArg(x)
3311 v0.AddArg2(v1, y)
3312 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3313 v2.AuxInt = int64ToAuxInt(0)
3314 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
3315 v3.AuxInt = int32ToAuxInt(8)
3316 v3.AddArg(y)
3317 v.AddArg3(v0, v2, v3)
3318 return true
3319 }
3320 }
3321 func rewriteValuePPC64_OpLsh8x64(v *Value) bool {
3322 v_1 := v.Args[1]
3323 v_0 := v.Args[0]
3324 b := v.Block
3325 typ := &b.Func.Config.Types
3326
3327
3328
3329 for {
3330 x := v_0
3331 if v_1.Op != OpPPC64MOVDconst {
3332 break
3333 }
3334 c := auxIntToInt64(v_1.AuxInt)
3335 if !(uint64(c) < 8) {
3336 break
3337 }
3338 v.reset(OpPPC64SLWconst)
3339 v.AuxInt = int64ToAuxInt(c)
3340 v.AddArg(x)
3341 return true
3342 }
3343
3344
3345
3346 for {
3347 x := v_0
3348 y := v_1
3349 if !(shiftIsBounded(v)) {
3350 break
3351 }
3352 v.reset(OpPPC64SLD)
3353 v.AddArg2(x, y)
3354 return true
3355 }
3356
3357
3358 for {
3359 t := v.Type
3360 x := v_0
3361 y := v_1
3362 v.reset(OpPPC64ISEL)
3363 v.AuxInt = int32ToAuxInt(0)
3364 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3365 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
3366 v1.AddArg(x)
3367 v0.AddArg2(v1, y)
3368 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3369 v2.AuxInt = int64ToAuxInt(0)
3370 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
3371 v3.AuxInt = int64ToAuxInt(8)
3372 v3.AddArg(y)
3373 v.AddArg3(v0, v2, v3)
3374 return true
3375 }
3376 }
3377 func rewriteValuePPC64_OpLsh8x8(v *Value) bool {
3378 v_1 := v.Args[1]
3379 v_0 := v.Args[0]
3380 b := v.Block
3381 typ := &b.Func.Config.Types
3382
3383
3384
3385 for {
3386 x := v_0
3387 y := v_1
3388 if !(shiftIsBounded(v)) {
3389 break
3390 }
3391 v.reset(OpPPC64SLD)
3392 v.AddArg2(x, y)
3393 return true
3394 }
3395
3396
3397 for {
3398 t := v.Type
3399 x := v_0
3400 y := v_1
3401 v.reset(OpPPC64ISEL)
3402 v.AuxInt = int32ToAuxInt(2)
3403 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3404 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
3405 v1.AddArg(x)
3406 v0.AddArg2(v1, y)
3407 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3408 v2.AuxInt = int64ToAuxInt(0)
3409 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
3410 v3.AuxInt = int64ToAuxInt(0)
3411 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
3412 v4.AuxInt = int64ToAuxInt(0x00F8)
3413 v4.AddArg(y)
3414 v3.AddArg(v4)
3415 v.AddArg3(v0, v2, v3)
3416 return true
3417 }
3418 }
3419 func rewriteValuePPC64_OpMax32F(v *Value) bool {
3420 v_1 := v.Args[1]
3421 v_0 := v.Args[0]
3422
3423
3424
3425 for {
3426 x := v_0
3427 y := v_1
3428 if !(buildcfg.GOPPC64 >= 9) {
3429 break
3430 }
3431 v.reset(OpPPC64XSMAXJDP)
3432 v.AddArg2(x, y)
3433 return true
3434 }
3435 return false
3436 }
3437 func rewriteValuePPC64_OpMax64F(v *Value) bool {
3438 v_1 := v.Args[1]
3439 v_0 := v.Args[0]
3440
3441
3442
3443 for {
3444 x := v_0
3445 y := v_1
3446 if !(buildcfg.GOPPC64 >= 9) {
3447 break
3448 }
3449 v.reset(OpPPC64XSMAXJDP)
3450 v.AddArg2(x, y)
3451 return true
3452 }
3453 return false
3454 }
3455 func rewriteValuePPC64_OpMin32F(v *Value) bool {
3456 v_1 := v.Args[1]
3457 v_0 := v.Args[0]
3458
3459
3460
3461 for {
3462 x := v_0
3463 y := v_1
3464 if !(buildcfg.GOPPC64 >= 9) {
3465 break
3466 }
3467 v.reset(OpPPC64XSMINJDP)
3468 v.AddArg2(x, y)
3469 return true
3470 }
3471 return false
3472 }
3473 func rewriteValuePPC64_OpMin64F(v *Value) bool {
3474 v_1 := v.Args[1]
3475 v_0 := v.Args[0]
3476
3477
3478
3479 for {
3480 x := v_0
3481 y := v_1
3482 if !(buildcfg.GOPPC64 >= 9) {
3483 break
3484 }
3485 v.reset(OpPPC64XSMINJDP)
3486 v.AddArg2(x, y)
3487 return true
3488 }
3489 return false
3490 }
3491 func rewriteValuePPC64_OpMod16(v *Value) bool {
3492 v_1 := v.Args[1]
3493 v_0 := v.Args[0]
3494 b := v.Block
3495 typ := &b.Func.Config.Types
3496
3497
3498 for {
3499 x := v_0
3500 y := v_1
3501 v.reset(OpMod32)
3502 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3503 v0.AddArg(x)
3504 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3505 v1.AddArg(y)
3506 v.AddArg2(v0, v1)
3507 return true
3508 }
3509 }
3510 func rewriteValuePPC64_OpMod16u(v *Value) bool {
3511 v_1 := v.Args[1]
3512 v_0 := v.Args[0]
3513 b := v.Block
3514 typ := &b.Func.Config.Types
3515
3516
3517 for {
3518 x := v_0
3519 y := v_1
3520 v.reset(OpMod32u)
3521 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3522 v0.AddArg(x)
3523 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3524 v1.AddArg(y)
3525 v.AddArg2(v0, v1)
3526 return true
3527 }
3528 }
3529 func rewriteValuePPC64_OpMod32(v *Value) bool {
3530 v_1 := v.Args[1]
3531 v_0 := v.Args[0]
3532 b := v.Block
3533 typ := &b.Func.Config.Types
3534
3535
3536
3537 for {
3538 x := v_0
3539 y := v_1
3540 if !(buildcfg.GOPPC64 >= 9) {
3541 break
3542 }
3543 v.reset(OpPPC64MODSW)
3544 v.AddArg2(x, y)
3545 return true
3546 }
3547
3548
3549
3550 for {
3551 x := v_0
3552 y := v_1
3553 if !(buildcfg.GOPPC64 <= 8) {
3554 break
3555 }
3556 v.reset(OpPPC64SUB)
3557 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
3558 v1 := b.NewValue0(v.Pos, OpPPC64DIVW, typ.Int32)
3559 v1.AddArg2(x, y)
3560 v0.AddArg2(y, v1)
3561 v.AddArg2(x, v0)
3562 return true
3563 }
3564 return false
3565 }
3566 func rewriteValuePPC64_OpMod32u(v *Value) bool {
3567 v_1 := v.Args[1]
3568 v_0 := v.Args[0]
3569 b := v.Block
3570 typ := &b.Func.Config.Types
3571
3572
3573
3574 for {
3575 x := v_0
3576 y := v_1
3577 if !(buildcfg.GOPPC64 >= 9) {
3578 break
3579 }
3580 v.reset(OpPPC64MODUW)
3581 v.AddArg2(x, y)
3582 return true
3583 }
3584
3585
3586
3587 for {
3588 x := v_0
3589 y := v_1
3590 if !(buildcfg.GOPPC64 <= 8) {
3591 break
3592 }
3593 v.reset(OpPPC64SUB)
3594 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
3595 v1 := b.NewValue0(v.Pos, OpPPC64DIVWU, typ.Int32)
3596 v1.AddArg2(x, y)
3597 v0.AddArg2(y, v1)
3598 v.AddArg2(x, v0)
3599 return true
3600 }
3601 return false
3602 }
3603 func rewriteValuePPC64_OpMod64(v *Value) bool {
3604 v_1 := v.Args[1]
3605 v_0 := v.Args[0]
3606 b := v.Block
3607 typ := &b.Func.Config.Types
3608
3609
3610
3611 for {
3612 x := v_0
3613 y := v_1
3614 if !(buildcfg.GOPPC64 >= 9) {
3615 break
3616 }
3617 v.reset(OpPPC64MODSD)
3618 v.AddArg2(x, y)
3619 return true
3620 }
3621
3622
3623
3624 for {
3625 x := v_0
3626 y := v_1
3627 if !(buildcfg.GOPPC64 <= 8) {
3628 break
3629 }
3630 v.reset(OpPPC64SUB)
3631 v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
3632 v1 := b.NewValue0(v.Pos, OpPPC64DIVD, typ.Int64)
3633 v1.AddArg2(x, y)
3634 v0.AddArg2(y, v1)
3635 v.AddArg2(x, v0)
3636 return true
3637 }
3638 return false
3639 }
3640 func rewriteValuePPC64_OpMod64u(v *Value) bool {
3641 v_1 := v.Args[1]
3642 v_0 := v.Args[0]
3643 b := v.Block
3644 typ := &b.Func.Config.Types
3645
3646
3647
3648 for {
3649 x := v_0
3650 y := v_1
3651 if !(buildcfg.GOPPC64 >= 9) {
3652 break
3653 }
3654 v.reset(OpPPC64MODUD)
3655 v.AddArg2(x, y)
3656 return true
3657 }
3658
3659
3660
3661 for {
3662 x := v_0
3663 y := v_1
3664 if !(buildcfg.GOPPC64 <= 8) {
3665 break
3666 }
3667 v.reset(OpPPC64SUB)
3668 v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
3669 v1 := b.NewValue0(v.Pos, OpPPC64DIVDU, typ.Int64)
3670 v1.AddArg2(x, y)
3671 v0.AddArg2(y, v1)
3672 v.AddArg2(x, v0)
3673 return true
3674 }
3675 return false
3676 }
3677 func rewriteValuePPC64_OpMod8(v *Value) bool {
3678 v_1 := v.Args[1]
3679 v_0 := v.Args[0]
3680 b := v.Block
3681 typ := &b.Func.Config.Types
3682
3683
3684 for {
3685 x := v_0
3686 y := v_1
3687 v.reset(OpMod32)
3688 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
3689 v0.AddArg(x)
3690 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
3691 v1.AddArg(y)
3692 v.AddArg2(v0, v1)
3693 return true
3694 }
3695 }
3696 func rewriteValuePPC64_OpMod8u(v *Value) bool {
3697 v_1 := v.Args[1]
3698 v_0 := v.Args[0]
3699 b := v.Block
3700 typ := &b.Func.Config.Types
3701
3702
3703 for {
3704 x := v_0
3705 y := v_1
3706 v.reset(OpMod32u)
3707 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
3708 v0.AddArg(x)
3709 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
3710 v1.AddArg(y)
3711 v.AddArg2(v0, v1)
3712 return true
3713 }
3714 }
3715 func rewriteValuePPC64_OpMove(v *Value) bool {
3716 v_2 := v.Args[2]
3717 v_1 := v.Args[1]
3718 v_0 := v.Args[0]
3719 b := v.Block
3720 typ := &b.Func.Config.Types
3721
3722
3723 for {
3724 if auxIntToInt64(v.AuxInt) != 0 {
3725 break
3726 }
3727 mem := v_2
3728 v.copyOf(mem)
3729 return true
3730 }
3731
3732
3733 for {
3734 if auxIntToInt64(v.AuxInt) != 1 {
3735 break
3736 }
3737 dst := v_0
3738 src := v_1
3739 mem := v_2
3740 v.reset(OpPPC64MOVBstore)
3741 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3742 v0.AddArg2(src, mem)
3743 v.AddArg3(dst, v0, mem)
3744 return true
3745 }
3746
3747
3748 for {
3749 if auxIntToInt64(v.AuxInt) != 2 {
3750 break
3751 }
3752 dst := v_0
3753 src := v_1
3754 mem := v_2
3755 v.reset(OpPPC64MOVHstore)
3756 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
3757 v0.AddArg2(src, mem)
3758 v.AddArg3(dst, v0, mem)
3759 return true
3760 }
3761
3762
3763 for {
3764 if auxIntToInt64(v.AuxInt) != 4 {
3765 break
3766 }
3767 dst := v_0
3768 src := v_1
3769 mem := v_2
3770 v.reset(OpPPC64MOVWstore)
3771 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3772 v0.AddArg2(src, mem)
3773 v.AddArg3(dst, v0, mem)
3774 return true
3775 }
3776
3777
3778 for {
3779 if auxIntToInt64(v.AuxInt) != 8 {
3780 break
3781 }
3782 dst := v_0
3783 src := v_1
3784 mem := v_2
3785 v.reset(OpPPC64MOVDstore)
3786 v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, typ.Int64)
3787 v0.AddArg2(src, mem)
3788 v.AddArg3(dst, v0, mem)
3789 return true
3790 }
3791
3792
3793 for {
3794 if auxIntToInt64(v.AuxInt) != 3 {
3795 break
3796 }
3797 dst := v_0
3798 src := v_1
3799 mem := v_2
3800 v.reset(OpPPC64MOVBstore)
3801 v.AuxInt = int32ToAuxInt(2)
3802 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3803 v0.AuxInt = int32ToAuxInt(2)
3804 v0.AddArg2(src, mem)
3805 v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
3806 v2 := b.NewValue0(v.Pos, OpPPC64MOVHload, typ.Int16)
3807 v2.AddArg2(src, mem)
3808 v1.AddArg3(dst, v2, mem)
3809 v.AddArg3(dst, v0, v1)
3810 return true
3811 }
3812
3813
3814 for {
3815 if auxIntToInt64(v.AuxInt) != 5 {
3816 break
3817 }
3818 dst := v_0
3819 src := v_1
3820 mem := v_2
3821 v.reset(OpPPC64MOVBstore)
3822 v.AuxInt = int32ToAuxInt(4)
3823 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3824 v0.AuxInt = int32ToAuxInt(4)
3825 v0.AddArg2(src, mem)
3826 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
3827 v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3828 v2.AddArg2(src, mem)
3829 v1.AddArg3(dst, v2, mem)
3830 v.AddArg3(dst, v0, v1)
3831 return true
3832 }
3833
3834
3835 for {
3836 if auxIntToInt64(v.AuxInt) != 6 {
3837 break
3838 }
3839 dst := v_0
3840 src := v_1
3841 mem := v_2
3842 v.reset(OpPPC64MOVHstore)
3843 v.AuxInt = int32ToAuxInt(4)
3844 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
3845 v0.AuxInt = int32ToAuxInt(4)
3846 v0.AddArg2(src, mem)
3847 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
3848 v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3849 v2.AddArg2(src, mem)
3850 v1.AddArg3(dst, v2, mem)
3851 v.AddArg3(dst, v0, v1)
3852 return true
3853 }
3854
3855
3856 for {
3857 if auxIntToInt64(v.AuxInt) != 7 {
3858 break
3859 }
3860 dst := v_0
3861 src := v_1
3862 mem := v_2
3863 v.reset(OpPPC64MOVBstore)
3864 v.AuxInt = int32ToAuxInt(6)
3865 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3866 v0.AuxInt = int32ToAuxInt(6)
3867 v0.AddArg2(src, mem)
3868 v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
3869 v1.AuxInt = int32ToAuxInt(4)
3870 v2 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
3871 v2.AuxInt = int32ToAuxInt(4)
3872 v2.AddArg2(src, mem)
3873 v3 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
3874 v4 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3875 v4.AddArg2(src, mem)
3876 v3.AddArg3(dst, v4, mem)
3877 v1.AddArg3(dst, v2, v3)
3878 v.AddArg3(dst, v0, v1)
3879 return true
3880 }
3881
3882
3883
3884 for {
3885 s := auxIntToInt64(v.AuxInt)
3886 dst := v_0
3887 src := v_1
3888 mem := v_2
3889 if !(s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)) {
3890 break
3891 }
3892 v.reset(OpPPC64LoweredMove)
3893 v.AuxInt = int64ToAuxInt(s)
3894 v.AddArg3(dst, src, mem)
3895 return true
3896 }
3897
3898
3899
3900 for {
3901 s := auxIntToInt64(v.AuxInt)
3902 dst := v_0
3903 src := v_1
3904 mem := v_2
3905 if !(s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9) {
3906 break
3907 }
3908 v.reset(OpPPC64LoweredQuadMoveShort)
3909 v.AuxInt = int64ToAuxInt(s)
3910 v.AddArg3(dst, src, mem)
3911 return true
3912 }
3913
3914
3915
3916 for {
3917 s := auxIntToInt64(v.AuxInt)
3918 dst := v_0
3919 src := v_1
3920 mem := v_2
3921 if !(s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)) {
3922 break
3923 }
3924 v.reset(OpPPC64LoweredQuadMove)
3925 v.AuxInt = int64ToAuxInt(s)
3926 v.AddArg3(dst, src, mem)
3927 return true
3928 }
3929 return false
3930 }
3931 func rewriteValuePPC64_OpNeq16(v *Value) bool {
3932 v_1 := v.Args[1]
3933 v_0 := v.Args[0]
3934 b := v.Block
3935 typ := &b.Func.Config.Types
3936
3937
3938
3939 for {
3940 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3941 x := v_0
3942 y := v_1
3943 if !(x.Type.IsSigned() && y.Type.IsSigned()) {
3944 continue
3945 }
3946 v.reset(OpPPC64NotEqual)
3947 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3948 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3949 v1.AddArg(x)
3950 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3951 v2.AddArg(y)
3952 v0.AddArg2(v1, v2)
3953 v.AddArg(v0)
3954 return true
3955 }
3956 break
3957 }
3958
3959
3960 for {
3961 x := v_0
3962 y := v_1
3963 v.reset(OpPPC64NotEqual)
3964 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3965 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3966 v1.AddArg(x)
3967 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3968 v2.AddArg(y)
3969 v0.AddArg2(v1, v2)
3970 v.AddArg(v0)
3971 return true
3972 }
3973 }
3974 func rewriteValuePPC64_OpNeq32(v *Value) bool {
3975 v_1 := v.Args[1]
3976 v_0 := v.Args[0]
3977 b := v.Block
3978
3979
3980 for {
3981 x := v_0
3982 y := v_1
3983 v.reset(OpPPC64NotEqual)
3984 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3985 v0.AddArg2(x, y)
3986 v.AddArg(v0)
3987 return true
3988 }
3989 }
3990 func rewriteValuePPC64_OpNeq32F(v *Value) bool {
3991 v_1 := v.Args[1]
3992 v_0 := v.Args[0]
3993 b := v.Block
3994
3995
3996 for {
3997 x := v_0
3998 y := v_1
3999 v.reset(OpPPC64NotEqual)
4000 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
4001 v0.AddArg2(x, y)
4002 v.AddArg(v0)
4003 return true
4004 }
4005 }
4006 func rewriteValuePPC64_OpNeq64(v *Value) bool {
4007 v_1 := v.Args[1]
4008 v_0 := v.Args[0]
4009 b := v.Block
4010
4011
4012 for {
4013 x := v_0
4014 y := v_1
4015 v.reset(OpPPC64NotEqual)
4016 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
4017 v0.AddArg2(x, y)
4018 v.AddArg(v0)
4019 return true
4020 }
4021 }
4022 func rewriteValuePPC64_OpNeq64F(v *Value) bool {
4023 v_1 := v.Args[1]
4024 v_0 := v.Args[0]
4025 b := v.Block
4026
4027
4028 for {
4029 x := v_0
4030 y := v_1
4031 v.reset(OpPPC64NotEqual)
4032 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
4033 v0.AddArg2(x, y)
4034 v.AddArg(v0)
4035 return true
4036 }
4037 }
4038 func rewriteValuePPC64_OpNeq8(v *Value) bool {
4039 v_1 := v.Args[1]
4040 v_0 := v.Args[0]
4041 b := v.Block
4042 typ := &b.Func.Config.Types
4043
4044
4045
4046 for {
4047 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4048 x := v_0
4049 y := v_1
4050 if !(x.Type.IsSigned() && y.Type.IsSigned()) {
4051 continue
4052 }
4053 v.reset(OpPPC64NotEqual)
4054 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
4055 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
4056 v1.AddArg(x)
4057 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
4058 v2.AddArg(y)
4059 v0.AddArg2(v1, v2)
4060 v.AddArg(v0)
4061 return true
4062 }
4063 break
4064 }
4065
4066
4067 for {
4068 x := v_0
4069 y := v_1
4070 v.reset(OpPPC64NotEqual)
4071 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
4072 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
4073 v1.AddArg(x)
4074 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
4075 v2.AddArg(y)
4076 v0.AddArg2(v1, v2)
4077 v.AddArg(v0)
4078 return true
4079 }
4080 }
4081 func rewriteValuePPC64_OpNeqPtr(v *Value) bool {
4082 v_1 := v.Args[1]
4083 v_0 := v.Args[0]
4084 b := v.Block
4085
4086
4087 for {
4088 x := v_0
4089 y := v_1
4090 v.reset(OpPPC64NotEqual)
4091 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
4092 v0.AddArg2(x, y)
4093 v.AddArg(v0)
4094 return true
4095 }
4096 }
4097 func rewriteValuePPC64_OpNot(v *Value) bool {
4098 v_0 := v.Args[0]
4099
4100
4101 for {
4102 x := v_0
4103 v.reset(OpPPC64XORconst)
4104 v.AuxInt = int64ToAuxInt(1)
4105 v.AddArg(x)
4106 return true
4107 }
4108 }
4109 func rewriteValuePPC64_OpOffPtr(v *Value) bool {
4110 v_0 := v.Args[0]
4111 b := v.Block
4112 typ := &b.Func.Config.Types
4113
4114
4115 for {
4116 off := auxIntToInt64(v.AuxInt)
4117 ptr := v_0
4118 v.reset(OpPPC64ADD)
4119 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
4120 v0.AuxInt = int64ToAuxInt(off)
4121 v.AddArg2(v0, ptr)
4122 return true
4123 }
4124 }
4125 func rewriteValuePPC64_OpPPC64ADD(v *Value) bool {
4126 v_1 := v.Args[1]
4127 v_0 := v.Args[0]
4128 b := v.Block
4129
4130
4131
4132 for {
4133 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4134 z := v_0
4135 l := v_1
4136 if l.Op != OpPPC64MULLD {
4137 continue
4138 }
4139 y := l.Args[1]
4140 x := l.Args[0]
4141 if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
4142 continue
4143 }
4144 v.reset(OpPPC64MADDLD)
4145 v.AddArg3(x, y, z)
4146 return true
4147 }
4148 break
4149 }
4150
4151
4152
4153 for {
4154 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4155 z := v_0
4156 l := v_1
4157 if l.Op != OpPPC64MULLDconst {
4158 continue
4159 }
4160 mt := l.Type
4161 x := auxIntToInt32(l.AuxInt)
4162 y := l.Args[0]
4163 if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
4164 continue
4165 }
4166 v.reset(OpPPC64MADDLD)
4167 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, mt)
4168 v0.AuxInt = int64ToAuxInt(int64(x))
4169 v.AddArg3(v0, y, z)
4170 return true
4171 }
4172 break
4173 }
4174
4175
4176
4177 for {
4178 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4179 x := v_0
4180 if v_1.Op != OpPPC64MOVDconst {
4181 continue
4182 }
4183 t := v_1.Type
4184 c := auxIntToInt64(v_1.AuxInt)
4185 if !(is32Bit(c) && !t.IsPtr()) {
4186 continue
4187 }
4188 v.reset(OpPPC64ADDconst)
4189 v.AuxInt = int64ToAuxInt(c)
4190 v.AddArg(x)
4191 return true
4192 }
4193 break
4194 }
4195 return false
4196 }
4197 func rewriteValuePPC64_OpPPC64ADDC(v *Value) bool {
4198 v_1 := v.Args[1]
4199 v_0 := v.Args[0]
4200
4201
4202
4203 for {
4204 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4205 x := v_0
4206 if v_1.Op != OpPPC64MOVDconst {
4207 continue
4208 }
4209 y := auxIntToInt64(v_1.AuxInt)
4210 if !(is16Bit(y)) {
4211 continue
4212 }
4213 v.reset(OpPPC64ADDCconst)
4214 v.AuxInt = int64ToAuxInt(y)
4215 v.AddArg(x)
4216 return true
4217 }
4218 break
4219 }
4220 return false
4221 }
4222 func rewriteValuePPC64_OpPPC64ADDE(v *Value) bool {
4223 v_2 := v.Args[2]
4224 v_1 := v.Args[1]
4225 v_0 := v.Args[0]
4226 b := v.Block
4227 typ := &b.Func.Config.Types
4228
4229
4230 for {
4231 x := v_0
4232 y := v_1
4233 if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
4234 break
4235 }
4236 v_2_0 := v_2.Args[0]
4237 if v_2_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_2_0.AuxInt) != -1 {
4238 break
4239 }
4240 v_2_0_0 := v_2_0.Args[0]
4241 if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
4242 break
4243 }
4244 v.reset(OpPPC64ADDC)
4245 v.AddArg2(x, y)
4246 return true
4247 }
4248
4249
4250 for {
4251 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4252 if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 {
4253 continue
4254 }
4255 y := v_1
4256 c := v_2
4257 v.reset(OpPPC64ADDZE)
4258 v.AddArg2(y, c)
4259 return true
4260 }
4261 break
4262 }
4263 return false
4264 }
4265 func rewriteValuePPC64_OpPPC64ADDconst(v *Value) bool {
4266 v_0 := v.Args[0]
4267 b := v.Block
4268
4269
4270
4271 for {
4272 at := v.Type
4273 z := auxIntToInt64(v.AuxInt)
4274 l := v_0
4275 if l.Op != OpPPC64MULLD {
4276 break
4277 }
4278 y := l.Args[1]
4279 x := l.Args[0]
4280 if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
4281 break
4282 }
4283 v.reset(OpPPC64MADDLD)
4284 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, at)
4285 v0.AuxInt = int64ToAuxInt(int64(z))
4286 v.AddArg3(x, y, v0)
4287 return true
4288 }
4289
4290
4291
4292 for {
4293 at := v.Type
4294 z := auxIntToInt64(v.AuxInt)
4295 l := v_0
4296 if l.Op != OpPPC64MULLDconst {
4297 break
4298 }
4299 mt := l.Type
4300 x := auxIntToInt32(l.AuxInt)
4301 y := l.Args[0]
4302 if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
4303 break
4304 }
4305 v.reset(OpPPC64MADDLD)
4306 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, mt)
4307 v0.AuxInt = int64ToAuxInt(int64(x))
4308 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, at)
4309 v1.AuxInt = int64ToAuxInt(int64(z))
4310 v.AddArg3(v0, y, v1)
4311 return true
4312 }
4313
4314
4315
4316 for {
4317 c := auxIntToInt64(v.AuxInt)
4318 if v_0.Op != OpPPC64ADDconst {
4319 break
4320 }
4321 d := auxIntToInt64(v_0.AuxInt)
4322 x := v_0.Args[0]
4323 if !(is32Bit(c + d)) {
4324 break
4325 }
4326 v.reset(OpPPC64ADDconst)
4327 v.AuxInt = int64ToAuxInt(c + d)
4328 v.AddArg(x)
4329 return true
4330 }
4331
4332
4333 for {
4334 if auxIntToInt64(v.AuxInt) != 0 {
4335 break
4336 }
4337 x := v_0
4338 v.copyOf(x)
4339 return true
4340 }
4341
4342
4343
4344 for {
4345 c := auxIntToInt64(v.AuxInt)
4346 if v_0.Op != OpPPC64MOVDaddr {
4347 break
4348 }
4349 d := auxIntToInt32(v_0.AuxInt)
4350 sym := auxToSym(v_0.Aux)
4351 x := v_0.Args[0]
4352 if !(is32Bit(c + int64(d))) {
4353 break
4354 }
4355 v.reset(OpPPC64MOVDaddr)
4356 v.AuxInt = int32ToAuxInt(int32(c + int64(d)))
4357 v.Aux = symToAux(sym)
4358 v.AddArg(x)
4359 return true
4360 }
4361
4362
4363
4364 for {
4365 c := auxIntToInt64(v.AuxInt)
4366 x := v_0
4367 if x.Op != OpSP || !(is32Bit(c)) {
4368 break
4369 }
4370 v.reset(OpPPC64MOVDaddr)
4371 v.AuxInt = int32ToAuxInt(int32(c))
4372 v.AddArg(x)
4373 return true
4374 }
4375
4376
4377
4378 for {
4379 c := auxIntToInt64(v.AuxInt)
4380 if v_0.Op != OpPPC64SUBFCconst {
4381 break
4382 }
4383 d := auxIntToInt64(v_0.AuxInt)
4384 x := v_0.Args[0]
4385 if !(is32Bit(c + d)) {
4386 break
4387 }
4388 v.reset(OpPPC64SUBFCconst)
4389 v.AuxInt = int64ToAuxInt(c + d)
4390 v.AddArg(x)
4391 return true
4392 }
4393 return false
4394 }
4395 func rewriteValuePPC64_OpPPC64AND(v *Value) bool {
4396 v_1 := v.Args[1]
4397 v_0 := v.Args[0]
4398
4399
4400
4401 for {
4402 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4403 if v_0.Op != OpPPC64MOVDconst {
4404 continue
4405 }
4406 m := auxIntToInt64(v_0.AuxInt)
4407 if v_1.Op != OpPPC64ROTLWconst {
4408 continue
4409 }
4410 r := auxIntToInt64(v_1.AuxInt)
4411 x := v_1.Args[0]
4412 if !(isPPC64WordRotateMask(m)) {
4413 continue
4414 }
4415 v.reset(OpPPC64RLWINM)
4416 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
4417 v.AddArg(x)
4418 return true
4419 }
4420 break
4421 }
4422
4423
4424
4425 for {
4426 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4427 if v_0.Op != OpPPC64MOVDconst {
4428 continue
4429 }
4430 m := auxIntToInt64(v_0.AuxInt)
4431 if v_1.Op != OpPPC64ROTLW {
4432 continue
4433 }
4434 r := v_1.Args[1]
4435 x := v_1.Args[0]
4436 if !(isPPC64WordRotateMask(m)) {
4437 continue
4438 }
4439 v.reset(OpPPC64RLWNM)
4440 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
4441 v.AddArg2(x, r)
4442 return true
4443 }
4444 break
4445 }
4446
4447
4448
4449 for {
4450 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4451 if v_0.Op != OpPPC64MOVDconst {
4452 continue
4453 }
4454 m := auxIntToInt64(v_0.AuxInt)
4455 if v_1.Op != OpPPC64SRWconst {
4456 continue
4457 }
4458 s := auxIntToInt64(v_1.AuxInt)
4459 if !(mergePPC64RShiftMask(m, s, 32) == 0) {
4460 continue
4461 }
4462 v.reset(OpPPC64MOVDconst)
4463 v.AuxInt = int64ToAuxInt(0)
4464 return true
4465 }
4466 break
4467 }
4468
4469
4470
4471 for {
4472 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4473 if v_0.Op != OpPPC64MOVDconst {
4474 continue
4475 }
4476 m := auxIntToInt64(v_0.AuxInt)
4477 if v_1.Op != OpPPC64SRWconst {
4478 continue
4479 }
4480 s := auxIntToInt64(v_1.AuxInt)
4481 x := v_1.Args[0]
4482 if !(mergePPC64AndSrwi(m, s) != 0) {
4483 continue
4484 }
4485 v.reset(OpPPC64RLWINM)
4486 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
4487 v.AddArg(x)
4488 return true
4489 }
4490 break
4491 }
4492
4493
4494
4495 for {
4496 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4497 if v_0.Op != OpPPC64MOVDconst {
4498 continue
4499 }
4500 m := auxIntToInt64(v_0.AuxInt)
4501 if v_1.Op != OpPPC64SRDconst {
4502 continue
4503 }
4504 s := auxIntToInt64(v_1.AuxInt)
4505 x := v_1.Args[0]
4506 if !(mergePPC64AndSrdi(m, s) != 0) {
4507 continue
4508 }
4509 v.reset(OpPPC64RLWINM)
4510 v.AuxInt = int64ToAuxInt(mergePPC64AndSrdi(m, s))
4511 v.AddArg(x)
4512 return true
4513 }
4514 break
4515 }
4516
4517
4518
4519 for {
4520 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4521 if v_0.Op != OpPPC64MOVDconst {
4522 continue
4523 }
4524 m := auxIntToInt64(v_0.AuxInt)
4525 if v_1.Op != OpPPC64SLDconst {
4526 continue
4527 }
4528 s := auxIntToInt64(v_1.AuxInt)
4529 x := v_1.Args[0]
4530 if !(mergePPC64AndSldi(m, s) != 0) {
4531 continue
4532 }
4533 v.reset(OpPPC64RLWINM)
4534 v.AuxInt = int64ToAuxInt(mergePPC64AndSldi(m, s))
4535 v.AddArg(x)
4536 return true
4537 }
4538 break
4539 }
4540
4541
4542 for {
4543 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4544 x := v_0
4545 if v_1.Op != OpPPC64NOR {
4546 continue
4547 }
4548 y := v_1.Args[1]
4549 if y != v_1.Args[0] {
4550 continue
4551 }
4552 v.reset(OpPPC64ANDN)
4553 v.AddArg2(x, y)
4554 return true
4555 }
4556 break
4557 }
4558
4559
4560 for {
4561 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4562 if v_0.Op != OpPPC64MOVDconst {
4563 continue
4564 }
4565 c := auxIntToInt64(v_0.AuxInt)
4566 if v_1.Op != OpPPC64MOVDconst {
4567 continue
4568 }
4569 d := auxIntToInt64(v_1.AuxInt)
4570 v.reset(OpPPC64MOVDconst)
4571 v.AuxInt = int64ToAuxInt(c & d)
4572 return true
4573 }
4574 break
4575 }
4576
4577
4578 for {
4579 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4580 x := v_0
4581 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
4582 continue
4583 }
4584 v.copyOf(x)
4585 return true
4586 }
4587 break
4588 }
4589
4590
4591
4592 for {
4593 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4594 x := v_0
4595 if v_1.Op != OpPPC64MOVDconst {
4596 continue
4597 }
4598 c := auxIntToInt64(v_1.AuxInt)
4599 if !(isU16Bit(c)) {
4600 continue
4601 }
4602 v.reset(OpPPC64ANDconst)
4603 v.AuxInt = int64ToAuxInt(c)
4604 v.AddArg(x)
4605 return true
4606 }
4607 break
4608 }
4609
4610
4611
4612 for {
4613 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4614 if v_0.Op != OpPPC64MOVDconst {
4615 continue
4616 }
4617 c := auxIntToInt64(v_0.AuxInt)
4618 y := v_1
4619 if y.Op != OpPPC64MOVWZreg || !(c&0xFFFFFFFF == 0xFFFFFFFF) {
4620 continue
4621 }
4622 v.copyOf(y)
4623 return true
4624 }
4625 break
4626 }
4627
4628
4629 for {
4630 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4631 if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0xFFFFFFFF {
4632 continue
4633 }
4634 y := v_1
4635 if y.Op != OpPPC64MOVWreg {
4636 continue
4637 }
4638 x := y.Args[0]
4639 v.reset(OpPPC64MOVWZreg)
4640 v.AddArg(x)
4641 return true
4642 }
4643 break
4644 }
4645
4646
4647 for {
4648 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4649 if v_0.Op != OpPPC64MOVDconst {
4650 continue
4651 }
4652 c := auxIntToInt64(v_0.AuxInt)
4653 x := v_1
4654 if x.Op != OpPPC64MOVBZload {
4655 continue
4656 }
4657 v.reset(OpPPC64ANDconst)
4658 v.AuxInt = int64ToAuxInt(c & 0xFF)
4659 v.AddArg(x)
4660 return true
4661 }
4662 break
4663 }
4664 return false
4665 }
4666 func rewriteValuePPC64_OpPPC64ANDN(v *Value) bool {
4667 v_1 := v.Args[1]
4668 v_0 := v.Args[0]
4669
4670
4671 for {
4672 if v_0.Op != OpPPC64MOVDconst {
4673 break
4674 }
4675 c := auxIntToInt64(v_0.AuxInt)
4676 if v_1.Op != OpPPC64MOVDconst {
4677 break
4678 }
4679 d := auxIntToInt64(v_1.AuxInt)
4680 v.reset(OpPPC64MOVDconst)
4681 v.AuxInt = int64ToAuxInt(c &^ d)
4682 return true
4683 }
4684 return false
4685 }
4686 func rewriteValuePPC64_OpPPC64ANDconst(v *Value) bool {
4687 v_0 := v.Args[0]
4688
4689
4690
4691 for {
4692 m := auxIntToInt64(v.AuxInt)
4693 if v_0.Op != OpPPC64ROTLWconst {
4694 break
4695 }
4696 r := auxIntToInt64(v_0.AuxInt)
4697 x := v_0.Args[0]
4698 if !(isPPC64WordRotateMask(m)) {
4699 break
4700 }
4701 v.reset(OpPPC64RLWINM)
4702 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
4703 v.AddArg(x)
4704 return true
4705 }
4706
4707
4708
4709 for {
4710 m := auxIntToInt64(v.AuxInt)
4711 if v_0.Op != OpPPC64ROTLW {
4712 break
4713 }
4714 r := v_0.Args[1]
4715 x := v_0.Args[0]
4716 if !(isPPC64WordRotateMask(m)) {
4717 break
4718 }
4719 v.reset(OpPPC64RLWNM)
4720 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
4721 v.AddArg2(x, r)
4722 return true
4723 }
4724
4725
4726
4727 for {
4728 m := auxIntToInt64(v.AuxInt)
4729 if v_0.Op != OpPPC64SRWconst {
4730 break
4731 }
4732 s := auxIntToInt64(v_0.AuxInt)
4733 if !(mergePPC64RShiftMask(m, s, 32) == 0) {
4734 break
4735 }
4736 v.reset(OpPPC64MOVDconst)
4737 v.AuxInt = int64ToAuxInt(0)
4738 return true
4739 }
4740
4741
4742
4743 for {
4744 m := auxIntToInt64(v.AuxInt)
4745 if v_0.Op != OpPPC64SRWconst {
4746 break
4747 }
4748 s := auxIntToInt64(v_0.AuxInt)
4749 x := v_0.Args[0]
4750 if !(mergePPC64AndSrwi(m, s) != 0) {
4751 break
4752 }
4753 v.reset(OpPPC64RLWINM)
4754 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
4755 v.AddArg(x)
4756 return true
4757 }
4758
4759
4760
4761 for {
4762 m := auxIntToInt64(v.AuxInt)
4763 if v_0.Op != OpPPC64SRDconst {
4764 break
4765 }
4766 s := auxIntToInt64(v_0.AuxInt)
4767 x := v_0.Args[0]
4768 if !(mergePPC64AndSrdi(m, s) != 0) {
4769 break
4770 }
4771 v.reset(OpPPC64RLWINM)
4772 v.AuxInt = int64ToAuxInt(mergePPC64AndSrdi(m, s))
4773 v.AddArg(x)
4774 return true
4775 }
4776
4777
4778
4779 for {
4780 m := auxIntToInt64(v.AuxInt)
4781 if v_0.Op != OpPPC64SLDconst {
4782 break
4783 }
4784 s := auxIntToInt64(v_0.AuxInt)
4785 x := v_0.Args[0]
4786 if !(mergePPC64AndSldi(m, s) != 0) {
4787 break
4788 }
4789 v.reset(OpPPC64RLWINM)
4790 v.AuxInt = int64ToAuxInt(mergePPC64AndSldi(m, s))
4791 v.AddArg(x)
4792 return true
4793 }
4794
4795
4796 for {
4797 c := auxIntToInt64(v.AuxInt)
4798 if v_0.Op != OpPPC64ANDconst {
4799 break
4800 }
4801 d := auxIntToInt64(v_0.AuxInt)
4802 x := v_0.Args[0]
4803 v.reset(OpPPC64ANDconst)
4804 v.AuxInt = int64ToAuxInt(c & d)
4805 v.AddArg(x)
4806 return true
4807 }
4808
4809
4810 for {
4811 if auxIntToInt64(v.AuxInt) != -1 {
4812 break
4813 }
4814 x := v_0
4815 v.copyOf(x)
4816 return true
4817 }
4818
4819
4820 for {
4821 if auxIntToInt64(v.AuxInt) != 0 {
4822 break
4823 }
4824 v.reset(OpPPC64MOVDconst)
4825 v.AuxInt = int64ToAuxInt(0)
4826 return true
4827 }
4828
4829
4830
4831 for {
4832 c := auxIntToInt64(v.AuxInt)
4833 y := v_0
4834 if y.Op != OpPPC64MOVBZreg || !(c&0xFF == 0xFF) {
4835 break
4836 }
4837 v.copyOf(y)
4838 return true
4839 }
4840
4841
4842 for {
4843 if auxIntToInt64(v.AuxInt) != 0xFF || v_0.Op != OpPPC64MOVBreg {
4844 break
4845 }
4846 x := v_0.Args[0]
4847 v.reset(OpPPC64MOVBZreg)
4848 v.AddArg(x)
4849 return true
4850 }
4851
4852
4853
4854 for {
4855 c := auxIntToInt64(v.AuxInt)
4856 y := v_0
4857 if y.Op != OpPPC64MOVHZreg || !(c&0xFFFF == 0xFFFF) {
4858 break
4859 }
4860 v.copyOf(y)
4861 return true
4862 }
4863
4864
4865 for {
4866 if auxIntToInt64(v.AuxInt) != 0xFFFF || v_0.Op != OpPPC64MOVHreg {
4867 break
4868 }
4869 x := v_0.Args[0]
4870 v.reset(OpPPC64MOVHZreg)
4871 v.AddArg(x)
4872 return true
4873 }
4874
4875
4876 for {
4877 c := auxIntToInt64(v.AuxInt)
4878 if v_0.Op != OpPPC64MOVBZreg {
4879 break
4880 }
4881 x := v_0.Args[0]
4882 v.reset(OpPPC64ANDconst)
4883 v.AuxInt = int64ToAuxInt(c & 0xFF)
4884 v.AddArg(x)
4885 return true
4886 }
4887
4888
4889 for {
4890 c := auxIntToInt64(v.AuxInt)
4891 if v_0.Op != OpPPC64MOVHZreg {
4892 break
4893 }
4894 x := v_0.Args[0]
4895 v.reset(OpPPC64ANDconst)
4896 v.AuxInt = int64ToAuxInt(c & 0xFFFF)
4897 v.AddArg(x)
4898 return true
4899 }
4900
4901
4902 for {
4903 c := auxIntToInt64(v.AuxInt)
4904 if v_0.Op != OpPPC64MOVWZreg {
4905 break
4906 }
4907 x := v_0.Args[0]
4908 v.reset(OpPPC64ANDconst)
4909 v.AuxInt = int64ToAuxInt(c & 0xFFFFFFFF)
4910 v.AddArg(x)
4911 return true
4912 }
4913
4914
4915
4916 for {
4917 m := auxIntToInt64(v.AuxInt)
4918 if v_0.Op != OpPPC64RLWINM {
4919 break
4920 }
4921 r := auxIntToInt64(v_0.AuxInt)
4922 y := v_0.Args[0]
4923 if !(mergePPC64AndRlwinm(uint32(m), r) != 0) {
4924 break
4925 }
4926 v.reset(OpPPC64RLWINM)
4927 v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(uint32(m), r))
4928 v.AddArg(y)
4929 return true
4930 }
4931
4932
4933
4934 for {
4935 if auxIntToInt64(v.AuxInt) != 1 {
4936 break
4937 }
4938 z := v_0
4939 if z.Op != OpPPC64SRADconst || auxIntToInt64(z.AuxInt) != 63 {
4940 break
4941 }
4942 x := z.Args[0]
4943 if !(z.Uses == 1) {
4944 break
4945 }
4946 v.reset(OpPPC64SRDconst)
4947 v.AuxInt = int64ToAuxInt(63)
4948 v.AddArg(x)
4949 return true
4950 }
4951 return false
4952 }
4953 func rewriteValuePPC64_OpPPC64BRD(v *Value) bool {
4954 v_0 := v.Args[0]
4955 b := v.Block
4956 typ := &b.Func.Config.Types
4957
4958
4959
4960 for {
4961 x := v_0
4962 if x.Op != OpPPC64MOVDload {
4963 break
4964 }
4965 off := auxIntToInt32(x.AuxInt)
4966 sym := auxToSym(x.Aux)
4967 mem := x.Args[1]
4968 ptr := x.Args[0]
4969 if !(x.Uses == 1) {
4970 break
4971 }
4972 b = x.Block
4973 v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
4974 v.copyOf(v0)
4975 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
4976 v1.AuxInt = int32ToAuxInt(off)
4977 v1.Aux = symToAux(sym)
4978 v1.AddArg(ptr)
4979 v0.AddArg2(v1, mem)
4980 return true
4981 }
4982
4983
4984
4985 for {
4986 x := v_0
4987 if x.Op != OpPPC64MOVDloadidx {
4988 break
4989 }
4990 mem := x.Args[2]
4991 ptr := x.Args[0]
4992 idx := x.Args[1]
4993 if !(x.Uses == 1) {
4994 break
4995 }
4996 b = x.Block
4997 v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
4998 v.copyOf(v0)
4999 v0.AddArg3(ptr, idx, mem)
5000 return true
5001 }
5002 return false
5003 }
5004 func rewriteValuePPC64_OpPPC64BRH(v *Value) bool {
5005 v_0 := v.Args[0]
5006 b := v.Block
5007 typ := &b.Func.Config.Types
5008
5009
5010
5011 for {
5012 x := v_0
5013 if x.Op != OpPPC64MOVHZload {
5014 break
5015 }
5016 off := auxIntToInt32(x.AuxInt)
5017 sym := auxToSym(x.Aux)
5018 mem := x.Args[1]
5019 ptr := x.Args[0]
5020 if !(x.Uses == 1) {
5021 break
5022 }
5023 b = x.Block
5024 v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
5025 v.copyOf(v0)
5026 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
5027 v1.AuxInt = int32ToAuxInt(off)
5028 v1.Aux = symToAux(sym)
5029 v1.AddArg(ptr)
5030 v0.AddArg2(v1, mem)
5031 return true
5032 }
5033
5034
5035
5036 for {
5037 x := v_0
5038 if x.Op != OpPPC64MOVHZloadidx {
5039 break
5040 }
5041 mem := x.Args[2]
5042 ptr := x.Args[0]
5043 idx := x.Args[1]
5044 if !(x.Uses == 1) {
5045 break
5046 }
5047 b = x.Block
5048 v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
5049 v.copyOf(v0)
5050 v0.AddArg3(ptr, idx, mem)
5051 return true
5052 }
5053 return false
5054 }
5055 func rewriteValuePPC64_OpPPC64BRW(v *Value) bool {
5056 v_0 := v.Args[0]
5057 b := v.Block
5058 typ := &b.Func.Config.Types
5059
5060
5061
5062 for {
5063 x := v_0
5064 if x.Op != OpPPC64MOVWZload {
5065 break
5066 }
5067 off := auxIntToInt32(x.AuxInt)
5068 sym := auxToSym(x.Aux)
5069 mem := x.Args[1]
5070 ptr := x.Args[0]
5071 if !(x.Uses == 1) {
5072 break
5073 }
5074 b = x.Block
5075 v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
5076 v.copyOf(v0)
5077 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
5078 v1.AuxInt = int32ToAuxInt(off)
5079 v1.Aux = symToAux(sym)
5080 v1.AddArg(ptr)
5081 v0.AddArg2(v1, mem)
5082 return true
5083 }
5084
5085
5086
5087 for {
5088 x := v_0
5089 if x.Op != OpPPC64MOVWZloadidx {
5090 break
5091 }
5092 mem := x.Args[2]
5093 ptr := x.Args[0]
5094 idx := x.Args[1]
5095 if !(x.Uses == 1) {
5096 break
5097 }
5098 b = x.Block
5099 v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
5100 v.copyOf(v0)
5101 v0.AddArg3(ptr, idx, mem)
5102 return true
5103 }
5104 return false
5105 }
5106 func rewriteValuePPC64_OpPPC64CLRLSLDI(v *Value) bool {
5107 v_0 := v.Args[0]
5108
5109
5110
5111 for {
5112 c := auxIntToInt32(v.AuxInt)
5113 if v_0.Op != OpPPC64SRWconst {
5114 break
5115 }
5116 s := auxIntToInt64(v_0.AuxInt)
5117 x := v_0.Args[0]
5118 if !(mergePPC64ClrlsldiSrw(int64(c), s) != 0) {
5119 break
5120 }
5121 v.reset(OpPPC64RLWINM)
5122 v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrw(int64(c), s))
5123 v.AddArg(x)
5124 return true
5125 }
5126
5127
5128
5129 for {
5130 c := auxIntToInt32(v.AuxInt)
5131 if v_0.Op != OpPPC64SRDconst {
5132 break
5133 }
5134 s := auxIntToInt64(v_0.AuxInt)
5135 x := v_0.Args[0]
5136 if !(mergePPC64ClrlsldiSrd(int64(c), s) != 0) {
5137 break
5138 }
5139 v.reset(OpPPC64RLWINM)
5140 v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrd(int64(c), s))
5141 v.AddArg(x)
5142 return true
5143 }
5144
5145
5146
5147 for {
5148 c := auxIntToInt32(v.AuxInt)
5149 i := v_0
5150 if i.Op != OpPPC64RLWINM {
5151 break
5152 }
5153 s := auxIntToInt64(i.AuxInt)
5154 x := i.Args[0]
5155 if !(mergePPC64ClrlsldiRlwinm(c, s) != 0) {
5156 break
5157 }
5158 v.reset(OpPPC64RLWINM)
5159 v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiRlwinm(c, s))
5160 v.AddArg(x)
5161 return true
5162 }
5163 return false
5164 }
5165 func rewriteValuePPC64_OpPPC64CMP(v *Value) bool {
5166 v_1 := v.Args[1]
5167 v_0 := v.Args[0]
5168 b := v.Block
5169
5170
5171
5172 for {
5173 x := v_0
5174 if v_1.Op != OpPPC64MOVDconst {
5175 break
5176 }
5177 c := auxIntToInt64(v_1.AuxInt)
5178 if !(is16Bit(c)) {
5179 break
5180 }
5181 v.reset(OpPPC64CMPconst)
5182 v.AuxInt = int64ToAuxInt(c)
5183 v.AddArg(x)
5184 return true
5185 }
5186
5187
5188
5189 for {
5190 if v_0.Op != OpPPC64MOVDconst {
5191 break
5192 }
5193 c := auxIntToInt64(v_0.AuxInt)
5194 y := v_1
5195 if !(is16Bit(c)) {
5196 break
5197 }
5198 v.reset(OpPPC64InvertFlags)
5199 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
5200 v0.AuxInt = int64ToAuxInt(c)
5201 v0.AddArg(y)
5202 v.AddArg(v0)
5203 return true
5204 }
5205
5206
5207
5208 for {
5209 x := v_0
5210 y := v_1
5211 if !(canonLessThan(x, y)) {
5212 break
5213 }
5214 v.reset(OpPPC64InvertFlags)
5215 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
5216 v0.AddArg2(y, x)
5217 v.AddArg(v0)
5218 return true
5219 }
5220 return false
5221 }
5222 func rewriteValuePPC64_OpPPC64CMPU(v *Value) bool {
5223 v_1 := v.Args[1]
5224 v_0 := v.Args[0]
5225 b := v.Block
5226
5227
5228
5229 for {
5230 x := v_0
5231 if v_1.Op != OpPPC64MOVDconst {
5232 break
5233 }
5234 c := auxIntToInt64(v_1.AuxInt)
5235 if !(isU16Bit(c)) {
5236 break
5237 }
5238 v.reset(OpPPC64CMPUconst)
5239 v.AuxInt = int64ToAuxInt(c)
5240 v.AddArg(x)
5241 return true
5242 }
5243
5244
5245
5246 for {
5247 if v_0.Op != OpPPC64MOVDconst {
5248 break
5249 }
5250 c := auxIntToInt64(v_0.AuxInt)
5251 y := v_1
5252 if !(isU16Bit(c)) {
5253 break
5254 }
5255 v.reset(OpPPC64InvertFlags)
5256 v0 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
5257 v0.AuxInt = int64ToAuxInt(c)
5258 v0.AddArg(y)
5259 v.AddArg(v0)
5260 return true
5261 }
5262
5263
5264
5265 for {
5266 x := v_0
5267 y := v_1
5268 if !(canonLessThan(x, y)) {
5269 break
5270 }
5271 v.reset(OpPPC64InvertFlags)
5272 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
5273 v0.AddArg2(y, x)
5274 v.AddArg(v0)
5275 return true
5276 }
5277 return false
5278 }
5279 func rewriteValuePPC64_OpPPC64CMPUconst(v *Value) bool {
5280 v_0 := v.Args[0]
5281
5282
5283
5284 for {
5285 d := auxIntToInt64(v.AuxInt)
5286 if v_0.Op != OpPPC64ANDconst {
5287 break
5288 }
5289 c := auxIntToInt64(v_0.AuxInt)
5290 if !(uint64(d) > uint64(c)) {
5291 break
5292 }
5293 v.reset(OpPPC64FlagLT)
5294 return true
5295 }
5296
5297
5298
5299 for {
5300 y := auxIntToInt64(v.AuxInt)
5301 if v_0.Op != OpPPC64MOVDconst {
5302 break
5303 }
5304 x := auxIntToInt64(v_0.AuxInt)
5305 if !(x == y) {
5306 break
5307 }
5308 v.reset(OpPPC64FlagEQ)
5309 return true
5310 }
5311
5312
5313
5314 for {
5315 y := auxIntToInt64(v.AuxInt)
5316 if v_0.Op != OpPPC64MOVDconst {
5317 break
5318 }
5319 x := auxIntToInt64(v_0.AuxInt)
5320 if !(uint64(x) < uint64(y)) {
5321 break
5322 }
5323 v.reset(OpPPC64FlagLT)
5324 return true
5325 }
5326
5327
5328
5329 for {
5330 y := auxIntToInt64(v.AuxInt)
5331 if v_0.Op != OpPPC64MOVDconst {
5332 break
5333 }
5334 x := auxIntToInt64(v_0.AuxInt)
5335 if !(uint64(x) > uint64(y)) {
5336 break
5337 }
5338 v.reset(OpPPC64FlagGT)
5339 return true
5340 }
5341
5342
5343 for {
5344 if auxIntToInt64(v.AuxInt) != 0 {
5345 break
5346 }
5347 a := v_0
5348 if a.Op != OpPPC64ANDconst {
5349 break
5350 }
5351 v.reset(OpPPC64CMPconst)
5352 v.AuxInt = int64ToAuxInt(0)
5353 v.AddArg(a)
5354 return true
5355 }
5356 return false
5357 }
5358 func rewriteValuePPC64_OpPPC64CMPW(v *Value) bool {
5359 v_1 := v.Args[1]
5360 v_0 := v.Args[0]
5361 b := v.Block
5362
5363
5364 for {
5365 x := v_0
5366 if v_1.Op != OpPPC64MOVWreg {
5367 break
5368 }
5369 y := v_1.Args[0]
5370 v.reset(OpPPC64CMPW)
5371 v.AddArg2(x, y)
5372 return true
5373 }
5374
5375
5376 for {
5377 if v_0.Op != OpPPC64MOVWreg {
5378 break
5379 }
5380 x := v_0.Args[0]
5381 y := v_1
5382 v.reset(OpPPC64CMPW)
5383 v.AddArg2(x, y)
5384 return true
5385 }
5386
5387
5388
5389 for {
5390 x := v_0
5391 if v_1.Op != OpPPC64MOVDconst {
5392 break
5393 }
5394 c := auxIntToInt64(v_1.AuxInt)
5395 if !(is16Bit(c)) {
5396 break
5397 }
5398 v.reset(OpPPC64CMPWconst)
5399 v.AuxInt = int32ToAuxInt(int32(c))
5400 v.AddArg(x)
5401 return true
5402 }
5403
5404
5405
5406 for {
5407 if v_0.Op != OpPPC64MOVDconst {
5408 break
5409 }
5410 c := auxIntToInt64(v_0.AuxInt)
5411 y := v_1
5412 if !(is16Bit(c)) {
5413 break
5414 }
5415 v.reset(OpPPC64InvertFlags)
5416 v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, types.TypeFlags)
5417 v0.AuxInt = int32ToAuxInt(int32(c))
5418 v0.AddArg(y)
5419 v.AddArg(v0)
5420 return true
5421 }
5422
5423
5424
5425 for {
5426 x := v_0
5427 y := v_1
5428 if !(canonLessThan(x, y)) {
5429 break
5430 }
5431 v.reset(OpPPC64InvertFlags)
5432 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
5433 v0.AddArg2(y, x)
5434 v.AddArg(v0)
5435 return true
5436 }
5437 return false
5438 }
5439 func rewriteValuePPC64_OpPPC64CMPWU(v *Value) bool {
5440 v_1 := v.Args[1]
5441 v_0 := v.Args[0]
5442 b := v.Block
5443
5444
5445 for {
5446 x := v_0
5447 if v_1.Op != OpPPC64MOVWZreg {
5448 break
5449 }
5450 y := v_1.Args[0]
5451 v.reset(OpPPC64CMPWU)
5452 v.AddArg2(x, y)
5453 return true
5454 }
5455
5456
5457 for {
5458 if v_0.Op != OpPPC64MOVWZreg {
5459 break
5460 }
5461 x := v_0.Args[0]
5462 y := v_1
5463 v.reset(OpPPC64CMPWU)
5464 v.AddArg2(x, y)
5465 return true
5466 }
5467
5468
5469
5470 for {
5471 x := v_0
5472 if v_1.Op != OpPPC64MOVDconst {
5473 break
5474 }
5475 c := auxIntToInt64(v_1.AuxInt)
5476 if !(isU16Bit(c)) {
5477 break
5478 }
5479 v.reset(OpPPC64CMPWUconst)
5480 v.AuxInt = int32ToAuxInt(int32(c))
5481 v.AddArg(x)
5482 return true
5483 }
5484
5485
5486
5487 for {
5488 if v_0.Op != OpPPC64MOVDconst {
5489 break
5490 }
5491 c := auxIntToInt64(v_0.AuxInt)
5492 y := v_1
5493 if !(isU16Bit(c)) {
5494 break
5495 }
5496 v.reset(OpPPC64InvertFlags)
5497 v0 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
5498 v0.AuxInt = int32ToAuxInt(int32(c))
5499 v0.AddArg(y)
5500 v.AddArg(v0)
5501 return true
5502 }
5503
5504
5505
5506 for {
5507 x := v_0
5508 y := v_1
5509 if !(canonLessThan(x, y)) {
5510 break
5511 }
5512 v.reset(OpPPC64InvertFlags)
5513 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
5514 v0.AddArg2(y, x)
5515 v.AddArg(v0)
5516 return true
5517 }
5518 return false
5519 }
5520 func rewriteValuePPC64_OpPPC64CMPWUconst(v *Value) bool {
5521 v_0 := v.Args[0]
5522
5523
5524
5525 for {
5526 d := auxIntToInt32(v.AuxInt)
5527 if v_0.Op != OpPPC64ANDconst {
5528 break
5529 }
5530 c := auxIntToInt64(v_0.AuxInt)
5531 if !(uint64(d) > uint64(c)) {
5532 break
5533 }
5534 v.reset(OpPPC64FlagLT)
5535 return true
5536 }
5537
5538
5539
5540 for {
5541 y := auxIntToInt32(v.AuxInt)
5542 if v_0.Op != OpPPC64MOVDconst {
5543 break
5544 }
5545 x := auxIntToInt64(v_0.AuxInt)
5546 if !(int32(x) == int32(y)) {
5547 break
5548 }
5549 v.reset(OpPPC64FlagEQ)
5550 return true
5551 }
5552
5553
5554
5555 for {
5556 y := auxIntToInt32(v.AuxInt)
5557 if v_0.Op != OpPPC64MOVDconst {
5558 break
5559 }
5560 x := auxIntToInt64(v_0.AuxInt)
5561 if !(uint32(x) < uint32(y)) {
5562 break
5563 }
5564 v.reset(OpPPC64FlagLT)
5565 return true
5566 }
5567
5568
5569
5570 for {
5571 y := auxIntToInt32(v.AuxInt)
5572 if v_0.Op != OpPPC64MOVDconst {
5573 break
5574 }
5575 x := auxIntToInt64(v_0.AuxInt)
5576 if !(uint32(x) > uint32(y)) {
5577 break
5578 }
5579 v.reset(OpPPC64FlagGT)
5580 return true
5581 }
5582
5583
5584 for {
5585 if auxIntToInt32(v.AuxInt) != 0 {
5586 break
5587 }
5588 a := v_0
5589 if a.Op != OpPPC64ANDconst {
5590 break
5591 }
5592 v.reset(OpPPC64CMPconst)
5593 v.AuxInt = int64ToAuxInt(0)
5594 v.AddArg(a)
5595 return true
5596 }
5597 return false
5598 }
5599 func rewriteValuePPC64_OpPPC64CMPWconst(v *Value) bool {
5600 v_0 := v.Args[0]
5601
5602
5603
5604 for {
5605 y := auxIntToInt32(v.AuxInt)
5606 if v_0.Op != OpPPC64MOVDconst {
5607 break
5608 }
5609 x := auxIntToInt64(v_0.AuxInt)
5610 if !(int32(x) == int32(y)) {
5611 break
5612 }
5613 v.reset(OpPPC64FlagEQ)
5614 return true
5615 }
5616
5617
5618
5619 for {
5620 y := auxIntToInt32(v.AuxInt)
5621 if v_0.Op != OpPPC64MOVDconst {
5622 break
5623 }
5624 x := auxIntToInt64(v_0.AuxInt)
5625 if !(int32(x) < int32(y)) {
5626 break
5627 }
5628 v.reset(OpPPC64FlagLT)
5629 return true
5630 }
5631
5632
5633
5634 for {
5635 y := auxIntToInt32(v.AuxInt)
5636 if v_0.Op != OpPPC64MOVDconst {
5637 break
5638 }
5639 x := auxIntToInt64(v_0.AuxInt)
5640 if !(int32(x) > int32(y)) {
5641 break
5642 }
5643 v.reset(OpPPC64FlagGT)
5644 return true
5645 }
5646
5647
5648 for {
5649 if auxIntToInt32(v.AuxInt) != 0 {
5650 break
5651 }
5652 a := v_0
5653 if a.Op != OpPPC64ANDconst {
5654 break
5655 }
5656 v.reset(OpPPC64CMPconst)
5657 v.AuxInt = int64ToAuxInt(0)
5658 v.AddArg(a)
5659 return true
5660 }
5661 return false
5662 }
5663 func rewriteValuePPC64_OpPPC64CMPconst(v *Value) bool {
5664 v_0 := v.Args[0]
5665
5666
5667
5668 for {
5669 y := auxIntToInt64(v.AuxInt)
5670 if v_0.Op != OpPPC64MOVDconst {
5671 break
5672 }
5673 x := auxIntToInt64(v_0.AuxInt)
5674 if !(x == y) {
5675 break
5676 }
5677 v.reset(OpPPC64FlagEQ)
5678 return true
5679 }
5680
5681
5682
5683 for {
5684 y := auxIntToInt64(v.AuxInt)
5685 if v_0.Op != OpPPC64MOVDconst {
5686 break
5687 }
5688 x := auxIntToInt64(v_0.AuxInt)
5689 if !(x < y) {
5690 break
5691 }
5692 v.reset(OpPPC64FlagLT)
5693 return true
5694 }
5695
5696
5697
5698 for {
5699 y := auxIntToInt64(v.AuxInt)
5700 if v_0.Op != OpPPC64MOVDconst {
5701 break
5702 }
5703 x := auxIntToInt64(v_0.AuxInt)
5704 if !(x > y) {
5705 break
5706 }
5707 v.reset(OpPPC64FlagGT)
5708 return true
5709 }
5710 return false
5711 }
5712 func rewriteValuePPC64_OpPPC64Equal(v *Value) bool {
5713 v_0 := v.Args[0]
5714
5715
5716 for {
5717 if v_0.Op != OpPPC64FlagEQ {
5718 break
5719 }
5720 v.reset(OpPPC64MOVDconst)
5721 v.AuxInt = int64ToAuxInt(1)
5722 return true
5723 }
5724
5725
5726 for {
5727 if v_0.Op != OpPPC64FlagLT {
5728 break
5729 }
5730 v.reset(OpPPC64MOVDconst)
5731 v.AuxInt = int64ToAuxInt(0)
5732 return true
5733 }
5734
5735
5736 for {
5737 if v_0.Op != OpPPC64FlagGT {
5738 break
5739 }
5740 v.reset(OpPPC64MOVDconst)
5741 v.AuxInt = int64ToAuxInt(0)
5742 return true
5743 }
5744
5745
5746 for {
5747 if v_0.Op != OpPPC64InvertFlags {
5748 break
5749 }
5750 x := v_0.Args[0]
5751 v.reset(OpPPC64Equal)
5752 v.AddArg(x)
5753 return true
5754 }
5755
5756
5757 for {
5758 cmp := v_0
5759 v.reset(OpPPC64SETBC)
5760 v.AuxInt = int32ToAuxInt(2)
5761 v.AddArg(cmp)
5762 return true
5763 }
5764 }
5765 func rewriteValuePPC64_OpPPC64FABS(v *Value) bool {
5766 v_0 := v.Args[0]
5767
5768
5769 for {
5770 if v_0.Op != OpPPC64FMOVDconst {
5771 break
5772 }
5773 x := auxIntToFloat64(v_0.AuxInt)
5774 v.reset(OpPPC64FMOVDconst)
5775 v.AuxInt = float64ToAuxInt(math.Abs(x))
5776 return true
5777 }
5778 return false
5779 }
5780 func rewriteValuePPC64_OpPPC64FADD(v *Value) bool {
5781 v_1 := v.Args[1]
5782 v_0 := v.Args[0]
5783
5784
5785
5786 for {
5787 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5788 if v_0.Op != OpPPC64FMUL {
5789 continue
5790 }
5791 _ = v_0.Args[1]
5792 v_0_0 := v_0.Args[0]
5793 v_0_1 := v_0.Args[1]
5794 for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
5795 x := v_0_0
5796 y := v_0_1
5797 z := v_1
5798 if !(x.Block.Func.useFMA(v)) {
5799 continue
5800 }
5801 v.reset(OpPPC64FMADD)
5802 v.AddArg3(x, y, z)
5803 return true
5804 }
5805 }
5806 break
5807 }
5808 return false
5809 }
5810 func rewriteValuePPC64_OpPPC64FADDS(v *Value) bool {
5811 v_1 := v.Args[1]
5812 v_0 := v.Args[0]
5813
5814
5815
5816 for {
5817 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5818 if v_0.Op != OpPPC64FMULS {
5819 continue
5820 }
5821 _ = v_0.Args[1]
5822 v_0_0 := v_0.Args[0]
5823 v_0_1 := v_0.Args[1]
5824 for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
5825 x := v_0_0
5826 y := v_0_1
5827 z := v_1
5828 if !(x.Block.Func.useFMA(v)) {
5829 continue
5830 }
5831 v.reset(OpPPC64FMADDS)
5832 v.AddArg3(x, y, z)
5833 return true
5834 }
5835 }
5836 break
5837 }
5838 return false
5839 }
5840 func rewriteValuePPC64_OpPPC64FCEIL(v *Value) bool {
5841 v_0 := v.Args[0]
5842
5843
5844 for {
5845 if v_0.Op != OpPPC64FMOVDconst {
5846 break
5847 }
5848 x := auxIntToFloat64(v_0.AuxInt)
5849 v.reset(OpPPC64FMOVDconst)
5850 v.AuxInt = float64ToAuxInt(math.Ceil(x))
5851 return true
5852 }
5853 return false
5854 }
5855 func rewriteValuePPC64_OpPPC64FFLOOR(v *Value) bool {
5856 v_0 := v.Args[0]
5857
5858
5859 for {
5860 if v_0.Op != OpPPC64FMOVDconst {
5861 break
5862 }
5863 x := auxIntToFloat64(v_0.AuxInt)
5864 v.reset(OpPPC64FMOVDconst)
5865 v.AuxInt = float64ToAuxInt(math.Floor(x))
5866 return true
5867 }
5868 return false
5869 }
5870 func rewriteValuePPC64_OpPPC64FGreaterEqual(v *Value) bool {
5871 v_0 := v.Args[0]
5872 b := v.Block
5873 typ := &b.Func.Config.Types
5874
5875
5876 for {
5877 cmp := v_0
5878 v.reset(OpPPC64OR)
5879 v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
5880 v0.AuxInt = int32ToAuxInt(2)
5881 v0.AddArg(cmp)
5882 v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
5883 v1.AuxInt = int32ToAuxInt(1)
5884 v1.AddArg(cmp)
5885 v.AddArg2(v0, v1)
5886 return true
5887 }
5888 }
5889 func rewriteValuePPC64_OpPPC64FGreaterThan(v *Value) bool {
5890 v_0 := v.Args[0]
5891
5892
5893 for {
5894 cmp := v_0
5895 v.reset(OpPPC64SETBC)
5896 v.AuxInt = int32ToAuxInt(1)
5897 v.AddArg(cmp)
5898 return true
5899 }
5900 }
5901 func rewriteValuePPC64_OpPPC64FLessEqual(v *Value) bool {
5902 v_0 := v.Args[0]
5903 b := v.Block
5904 typ := &b.Func.Config.Types
5905
5906
5907 for {
5908 cmp := v_0
5909 v.reset(OpPPC64OR)
5910 v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
5911 v0.AuxInt = int32ToAuxInt(2)
5912 v0.AddArg(cmp)
5913 v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
5914 v1.AuxInt = int32ToAuxInt(0)
5915 v1.AddArg(cmp)
5916 v.AddArg2(v0, v1)
5917 return true
5918 }
5919 }
5920 func rewriteValuePPC64_OpPPC64FLessThan(v *Value) bool {
5921 v_0 := v.Args[0]
5922
5923
5924 for {
5925 cmp := v_0
5926 v.reset(OpPPC64SETBC)
5927 v.AuxInt = int32ToAuxInt(0)
5928 v.AddArg(cmp)
5929 return true
5930 }
5931 }
5932 func rewriteValuePPC64_OpPPC64FMOVDload(v *Value) bool {
5933 v_1 := v.Args[1]
5934 v_0 := v.Args[0]
5935
5936
5937 for {
5938 off := auxIntToInt32(v.AuxInt)
5939 sym := auxToSym(v.Aux)
5940 ptr := v_0
5941 if v_1.Op != OpPPC64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
5942 break
5943 }
5944 x := v_1.Args[1]
5945 if ptr != v_1.Args[0] {
5946 break
5947 }
5948 v.reset(OpPPC64MTVSRD)
5949 v.AddArg(x)
5950 return true
5951 }
5952
5953
5954
5955 for {
5956 off1 := auxIntToInt32(v.AuxInt)
5957 sym1 := auxToSym(v.Aux)
5958 p := v_0
5959 if p.Op != OpPPC64MOVDaddr {
5960 break
5961 }
5962 off2 := auxIntToInt32(p.AuxInt)
5963 sym2 := auxToSym(p.Aux)
5964 ptr := p.Args[0]
5965 mem := v_1
5966 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
5967 break
5968 }
5969 v.reset(OpPPC64FMOVDload)
5970 v.AuxInt = int32ToAuxInt(off1 + off2)
5971 v.Aux = symToAux(mergeSym(sym1, sym2))
5972 v.AddArg2(ptr, mem)
5973 return true
5974 }
5975
5976
5977
5978 for {
5979 off1 := auxIntToInt32(v.AuxInt)
5980 sym := auxToSym(v.Aux)
5981 if v_0.Op != OpPPC64ADDconst {
5982 break
5983 }
5984 off2 := auxIntToInt64(v_0.AuxInt)
5985 ptr := v_0.Args[0]
5986 mem := v_1
5987 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
5988 break
5989 }
5990 v.reset(OpPPC64FMOVDload)
5991 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
5992 v.Aux = symToAux(sym)
5993 v.AddArg2(ptr, mem)
5994 return true
5995 }
5996 return false
5997 }
5998 func rewriteValuePPC64_OpPPC64FMOVDstore(v *Value) bool {
5999 v_2 := v.Args[2]
6000 v_1 := v.Args[1]
6001 v_0 := v.Args[0]
6002
6003
6004 for {
6005 off := auxIntToInt32(v.AuxInt)
6006 sym := auxToSym(v.Aux)
6007 ptr := v_0
6008 if v_1.Op != OpPPC64MTVSRD {
6009 break
6010 }
6011 x := v_1.Args[0]
6012 mem := v_2
6013 v.reset(OpPPC64MOVDstore)
6014 v.AuxInt = int32ToAuxInt(off)
6015 v.Aux = symToAux(sym)
6016 v.AddArg3(ptr, x, mem)
6017 return true
6018 }
6019
6020
6021
6022 for {
6023 off1 := auxIntToInt32(v.AuxInt)
6024 sym := auxToSym(v.Aux)
6025 if v_0.Op != OpPPC64ADDconst {
6026 break
6027 }
6028 off2 := auxIntToInt64(v_0.AuxInt)
6029 ptr := v_0.Args[0]
6030 val := v_1
6031 mem := v_2
6032 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
6033 break
6034 }
6035 v.reset(OpPPC64FMOVDstore)
6036 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
6037 v.Aux = symToAux(sym)
6038 v.AddArg3(ptr, val, mem)
6039 return true
6040 }
6041
6042
6043
6044 for {
6045 off1 := auxIntToInt32(v.AuxInt)
6046 sym1 := auxToSym(v.Aux)
6047 p := v_0
6048 if p.Op != OpPPC64MOVDaddr {
6049 break
6050 }
6051 off2 := auxIntToInt32(p.AuxInt)
6052 sym2 := auxToSym(p.Aux)
6053 ptr := p.Args[0]
6054 val := v_1
6055 mem := v_2
6056 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
6057 break
6058 }
6059 v.reset(OpPPC64FMOVDstore)
6060 v.AuxInt = int32ToAuxInt(off1 + off2)
6061 v.Aux = symToAux(mergeSym(sym1, sym2))
6062 v.AddArg3(ptr, val, mem)
6063 return true
6064 }
6065 return false
6066 }
6067 func rewriteValuePPC64_OpPPC64FMOVSload(v *Value) bool {
6068 v_1 := v.Args[1]
6069 v_0 := v.Args[0]
6070
6071
6072
6073 for {
6074 off1 := auxIntToInt32(v.AuxInt)
6075 sym1 := auxToSym(v.Aux)
6076 p := v_0
6077 if p.Op != OpPPC64MOVDaddr {
6078 break
6079 }
6080 off2 := auxIntToInt32(p.AuxInt)
6081 sym2 := auxToSym(p.Aux)
6082 ptr := p.Args[0]
6083 mem := v_1
6084 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
6085 break
6086 }
6087 v.reset(OpPPC64FMOVSload)
6088 v.AuxInt = int32ToAuxInt(off1 + off2)
6089 v.Aux = symToAux(mergeSym(sym1, sym2))
6090 v.AddArg2(ptr, mem)
6091 return true
6092 }
6093
6094
6095
6096 for {
6097 off1 := auxIntToInt32(v.AuxInt)
6098 sym := auxToSym(v.Aux)
6099 if v_0.Op != OpPPC64ADDconst {
6100 break
6101 }
6102 off2 := auxIntToInt64(v_0.AuxInt)
6103 ptr := v_0.Args[0]
6104 mem := v_1
6105 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
6106 break
6107 }
6108 v.reset(OpPPC64FMOVSload)
6109 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
6110 v.Aux = symToAux(sym)
6111 v.AddArg2(ptr, mem)
6112 return true
6113 }
6114 return false
6115 }
6116 func rewriteValuePPC64_OpPPC64FMOVSstore(v *Value) bool {
6117 v_2 := v.Args[2]
6118 v_1 := v.Args[1]
6119 v_0 := v.Args[0]
6120
6121
6122
6123 for {
6124 off1 := auxIntToInt32(v.AuxInt)
6125 sym := auxToSym(v.Aux)
6126 if v_0.Op != OpPPC64ADDconst {
6127 break
6128 }
6129 off2 := auxIntToInt64(v_0.AuxInt)
6130 ptr := v_0.Args[0]
6131 val := v_1
6132 mem := v_2
6133 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
6134 break
6135 }
6136 v.reset(OpPPC64FMOVSstore)
6137 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
6138 v.Aux = symToAux(sym)
6139 v.AddArg3(ptr, val, mem)
6140 return true
6141 }
6142
6143
6144
6145 for {
6146 off1 := auxIntToInt32(v.AuxInt)
6147 sym1 := auxToSym(v.Aux)
6148 p := v_0
6149 if p.Op != OpPPC64MOVDaddr {
6150 break
6151 }
6152 off2 := auxIntToInt32(p.AuxInt)
6153 sym2 := auxToSym(p.Aux)
6154 ptr := p.Args[0]
6155 val := v_1
6156 mem := v_2
6157 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
6158 break
6159 }
6160 v.reset(OpPPC64FMOVSstore)
6161 v.AuxInt = int32ToAuxInt(off1 + off2)
6162 v.Aux = symToAux(mergeSym(sym1, sym2))
6163 v.AddArg3(ptr, val, mem)
6164 return true
6165 }
6166 return false
6167 }
6168 func rewriteValuePPC64_OpPPC64FNEG(v *Value) bool {
6169 v_0 := v.Args[0]
6170
6171
6172 for {
6173 if v_0.Op != OpPPC64FABS {
6174 break
6175 }
6176 x := v_0.Args[0]
6177 v.reset(OpPPC64FNABS)
6178 v.AddArg(x)
6179 return true
6180 }
6181
6182
6183 for {
6184 if v_0.Op != OpPPC64FNABS {
6185 break
6186 }
6187 x := v_0.Args[0]
6188 v.reset(OpPPC64FABS)
6189 v.AddArg(x)
6190 return true
6191 }
6192 return false
6193 }
6194 func rewriteValuePPC64_OpPPC64FSQRT(v *Value) bool {
6195 v_0 := v.Args[0]
6196
6197
6198
6199 for {
6200 if v_0.Op != OpPPC64FMOVDconst {
6201 break
6202 }
6203 x := auxIntToFloat64(v_0.AuxInt)
6204 if !(x >= 0) {
6205 break
6206 }
6207 v.reset(OpPPC64FMOVDconst)
6208 v.AuxInt = float64ToAuxInt(math.Sqrt(x))
6209 return true
6210 }
6211 return false
6212 }
6213 func rewriteValuePPC64_OpPPC64FSUB(v *Value) bool {
6214 v_1 := v.Args[1]
6215 v_0 := v.Args[0]
6216
6217
6218
6219 for {
6220 if v_0.Op != OpPPC64FMUL {
6221 break
6222 }
6223 _ = v_0.Args[1]
6224 v_0_0 := v_0.Args[0]
6225 v_0_1 := v_0.Args[1]
6226 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6227 x := v_0_0
6228 y := v_0_1
6229 z := v_1
6230 if !(x.Block.Func.useFMA(v)) {
6231 continue
6232 }
6233 v.reset(OpPPC64FMSUB)
6234 v.AddArg3(x, y, z)
6235 return true
6236 }
6237 break
6238 }
6239 return false
6240 }
6241 func rewriteValuePPC64_OpPPC64FSUBS(v *Value) bool {
6242 v_1 := v.Args[1]
6243 v_0 := v.Args[0]
6244
6245
6246
6247 for {
6248 if v_0.Op != OpPPC64FMULS {
6249 break
6250 }
6251 _ = v_0.Args[1]
6252 v_0_0 := v_0.Args[0]
6253 v_0_1 := v_0.Args[1]
6254 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6255 x := v_0_0
6256 y := v_0_1
6257 z := v_1
6258 if !(x.Block.Func.useFMA(v)) {
6259 continue
6260 }
6261 v.reset(OpPPC64FMSUBS)
6262 v.AddArg3(x, y, z)
6263 return true
6264 }
6265 break
6266 }
6267 return false
6268 }
6269 func rewriteValuePPC64_OpPPC64FTRUNC(v *Value) bool {
6270 v_0 := v.Args[0]
6271
6272
6273 for {
6274 if v_0.Op != OpPPC64FMOVDconst {
6275 break
6276 }
6277 x := auxIntToFloat64(v_0.AuxInt)
6278 v.reset(OpPPC64FMOVDconst)
6279 v.AuxInt = float64ToAuxInt(math.Trunc(x))
6280 return true
6281 }
6282 return false
6283 }
6284 func rewriteValuePPC64_OpPPC64GreaterEqual(v *Value) bool {
6285 v_0 := v.Args[0]
6286
6287
6288 for {
6289 if v_0.Op != OpPPC64FlagEQ {
6290 break
6291 }
6292 v.reset(OpPPC64MOVDconst)
6293 v.AuxInt = int64ToAuxInt(1)
6294 return true
6295 }
6296
6297
6298 for {
6299 if v_0.Op != OpPPC64FlagLT {
6300 break
6301 }
6302 v.reset(OpPPC64MOVDconst)
6303 v.AuxInt = int64ToAuxInt(0)
6304 return true
6305 }
6306
6307
6308 for {
6309 if v_0.Op != OpPPC64FlagGT {
6310 break
6311 }
6312 v.reset(OpPPC64MOVDconst)
6313 v.AuxInt = int64ToAuxInt(1)
6314 return true
6315 }
6316
6317
6318 for {
6319 if v_0.Op != OpPPC64InvertFlags {
6320 break
6321 }
6322 x := v_0.Args[0]
6323 v.reset(OpPPC64LessEqual)
6324 v.AddArg(x)
6325 return true
6326 }
6327
6328
6329 for {
6330 cmp := v_0
6331 v.reset(OpPPC64SETBCR)
6332 v.AuxInt = int32ToAuxInt(0)
6333 v.AddArg(cmp)
6334 return true
6335 }
6336 }
6337 func rewriteValuePPC64_OpPPC64GreaterThan(v *Value) bool {
6338 v_0 := v.Args[0]
6339
6340
6341 for {
6342 if v_0.Op != OpPPC64FlagEQ {
6343 break
6344 }
6345 v.reset(OpPPC64MOVDconst)
6346 v.AuxInt = int64ToAuxInt(0)
6347 return true
6348 }
6349
6350
6351 for {
6352 if v_0.Op != OpPPC64FlagLT {
6353 break
6354 }
6355 v.reset(OpPPC64MOVDconst)
6356 v.AuxInt = int64ToAuxInt(0)
6357 return true
6358 }
6359
6360
6361 for {
6362 if v_0.Op != OpPPC64FlagGT {
6363 break
6364 }
6365 v.reset(OpPPC64MOVDconst)
6366 v.AuxInt = int64ToAuxInt(1)
6367 return true
6368 }
6369
6370
6371 for {
6372 if v_0.Op != OpPPC64InvertFlags {
6373 break
6374 }
6375 x := v_0.Args[0]
6376 v.reset(OpPPC64LessThan)
6377 v.AddArg(x)
6378 return true
6379 }
6380
6381
6382 for {
6383 cmp := v_0
6384 v.reset(OpPPC64SETBC)
6385 v.AuxInt = int32ToAuxInt(1)
6386 v.AddArg(cmp)
6387 return true
6388 }
6389 }
6390 func rewriteValuePPC64_OpPPC64ISEL(v *Value) bool {
6391 v_2 := v.Args[2]
6392 v_1 := v.Args[1]
6393 v_0 := v.Args[0]
6394
6395
6396 for {
6397 if auxIntToInt32(v.AuxInt) != 6 {
6398 break
6399 }
6400 x := v_0
6401 y := v_1
6402 if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
6403 break
6404 }
6405 v_2_0 := v_2.Args[0]
6406 if v_2_0.Op != OpPPC64ANDconst || auxIntToInt64(v_2_0.AuxInt) != 1 {
6407 break
6408 }
6409 v_2_0_0 := v_2_0.Args[0]
6410 if v_2_0_0.Op != OpPPC64SETBC {
6411 break
6412 }
6413 c := auxIntToInt32(v_2_0_0.AuxInt)
6414 cmp := v_2_0_0.Args[0]
6415 v.reset(OpPPC64ISEL)
6416 v.AuxInt = int32ToAuxInt(c)
6417 v.AddArg3(x, y, cmp)
6418 return true
6419 }
6420
6421
6422 for {
6423 if auxIntToInt32(v.AuxInt) != 6 {
6424 break
6425 }
6426 x := v_0
6427 y := v_1
6428 if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
6429 break
6430 }
6431 v_2_0 := v_2.Args[0]
6432 if v_2_0.Op != OpPPC64SETBC {
6433 break
6434 }
6435 c := auxIntToInt32(v_2_0.AuxInt)
6436 cmp := v_2_0.Args[0]
6437 v.reset(OpPPC64ISEL)
6438 v.AuxInt = int32ToAuxInt(c)
6439 v.AddArg3(x, y, cmp)
6440 return true
6441 }
6442
6443
6444 for {
6445 if auxIntToInt32(v.AuxInt) != 6 {
6446 break
6447 }
6448 x := v_0
6449 y := v_1
6450 if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
6451 break
6452 }
6453 v_2_0 := v_2.Args[0]
6454 if v_2_0.Op != OpPPC64SETBC {
6455 break
6456 }
6457 c := auxIntToInt32(v_2_0.AuxInt)
6458 cmp := v_2_0.Args[0]
6459 v.reset(OpPPC64ISEL)
6460 v.AuxInt = int32ToAuxInt(c)
6461 v.AddArg3(x, y, cmp)
6462 return true
6463 }
6464
6465
6466 for {
6467 if auxIntToInt32(v.AuxInt) != 6 {
6468 break
6469 }
6470 x := v_0
6471 y := v_1
6472 if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
6473 break
6474 }
6475 v_2_0 := v_2.Args[0]
6476 if v_2_0.Op != OpPPC64SETBCR {
6477 break
6478 }
6479 c := auxIntToInt32(v_2_0.AuxInt)
6480 cmp := v_2_0.Args[0]
6481 v.reset(OpPPC64ISEL)
6482 v.AuxInt = int32ToAuxInt(c + 4)
6483 v.AddArg3(x, y, cmp)
6484 return true
6485 }
6486
6487
6488 for {
6489 if auxIntToInt32(v.AuxInt) != 6 {
6490 break
6491 }
6492 x := v_0
6493 y := v_1
6494 if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
6495 break
6496 }
6497 v_2_0 := v_2.Args[0]
6498 if v_2_0.Op != OpPPC64SETBCR {
6499 break
6500 }
6501 c := auxIntToInt32(v_2_0.AuxInt)
6502 cmp := v_2_0.Args[0]
6503 v.reset(OpPPC64ISEL)
6504 v.AuxInt = int32ToAuxInt(c + 4)
6505 v.AddArg3(x, y, cmp)
6506 return true
6507 }
6508
6509
6510 for {
6511 if auxIntToInt32(v.AuxInt) != 2 {
6512 break
6513 }
6514 x := v_0
6515 if v_2.Op != OpPPC64FlagEQ {
6516 break
6517 }
6518 v.copyOf(x)
6519 return true
6520 }
6521
6522
6523 for {
6524 if auxIntToInt32(v.AuxInt) != 2 {
6525 break
6526 }
6527 y := v_1
6528 if v_2.Op != OpPPC64FlagLT {
6529 break
6530 }
6531 v.copyOf(y)
6532 return true
6533 }
6534
6535
6536 for {
6537 if auxIntToInt32(v.AuxInt) != 2 {
6538 break
6539 }
6540 y := v_1
6541 if v_2.Op != OpPPC64FlagGT {
6542 break
6543 }
6544 v.copyOf(y)
6545 return true
6546 }
6547
6548
6549 for {
6550 if auxIntToInt32(v.AuxInt) != 6 {
6551 break
6552 }
6553 y := v_1
6554 if v_2.Op != OpPPC64FlagEQ {
6555 break
6556 }
6557 v.copyOf(y)
6558 return true
6559 }
6560
6561
6562 for {
6563 if auxIntToInt32(v.AuxInt) != 6 {
6564 break
6565 }
6566 x := v_0
6567 if v_2.Op != OpPPC64FlagLT {
6568 break
6569 }
6570 v.copyOf(x)
6571 return true
6572 }
6573
6574
6575 for {
6576 if auxIntToInt32(v.AuxInt) != 6 {
6577 break
6578 }
6579 x := v_0
6580 if v_2.Op != OpPPC64FlagGT {
6581 break
6582 }
6583 v.copyOf(x)
6584 return true
6585 }
6586
6587
6588 for {
6589 if auxIntToInt32(v.AuxInt) != 0 {
6590 break
6591 }
6592 y := v_1
6593 if v_2.Op != OpPPC64FlagEQ {
6594 break
6595 }
6596 v.copyOf(y)
6597 return true
6598 }
6599
6600
6601 for {
6602 if auxIntToInt32(v.AuxInt) != 0 {
6603 break
6604 }
6605 y := v_1
6606 if v_2.Op != OpPPC64FlagGT {
6607 break
6608 }
6609 v.copyOf(y)
6610 return true
6611 }
6612
6613
6614 for {
6615 if auxIntToInt32(v.AuxInt) != 0 {
6616 break
6617 }
6618 x := v_0
6619 if v_2.Op != OpPPC64FlagLT {
6620 break
6621 }
6622 v.copyOf(x)
6623 return true
6624 }
6625
6626
6627 for {
6628 if auxIntToInt32(v.AuxInt) != 5 {
6629 break
6630 }
6631 x := v_1
6632 if v_2.Op != OpPPC64FlagEQ {
6633 break
6634 }
6635 v.copyOf(x)
6636 return true
6637 }
6638
6639
6640 for {
6641 if auxIntToInt32(v.AuxInt) != 5 {
6642 break
6643 }
6644 x := v_1
6645 if v_2.Op != OpPPC64FlagLT {
6646 break
6647 }
6648 v.copyOf(x)
6649 return true
6650 }
6651
6652
6653 for {
6654 if auxIntToInt32(v.AuxInt) != 5 {
6655 break
6656 }
6657 y := v_0
6658 if v_2.Op != OpPPC64FlagGT {
6659 break
6660 }
6661 v.copyOf(y)
6662 return true
6663 }
6664
6665
6666 for {
6667 if auxIntToInt32(v.AuxInt) != 1 {
6668 break
6669 }
6670 y := v_1
6671 if v_2.Op != OpPPC64FlagEQ {
6672 break
6673 }
6674 v.copyOf(y)
6675 return true
6676 }
6677
6678
6679 for {
6680 if auxIntToInt32(v.AuxInt) != 1 {
6681 break
6682 }
6683 y := v_1
6684 if v_2.Op != OpPPC64FlagLT {
6685 break
6686 }
6687 v.copyOf(y)
6688 return true
6689 }
6690
6691
6692 for {
6693 if auxIntToInt32(v.AuxInt) != 1 {
6694 break
6695 }
6696 x := v_0
6697 if v_2.Op != OpPPC64FlagGT {
6698 break
6699 }
6700 v.copyOf(x)
6701 return true
6702 }
6703
6704
6705 for {
6706 if auxIntToInt32(v.AuxInt) != 4 {
6707 break
6708 }
6709 x := v_0
6710 if v_2.Op != OpPPC64FlagEQ {
6711 break
6712 }
6713 v.copyOf(x)
6714 return true
6715 }
6716
6717
6718 for {
6719 if auxIntToInt32(v.AuxInt) != 4 {
6720 break
6721 }
6722 x := v_0
6723 if v_2.Op != OpPPC64FlagGT {
6724 break
6725 }
6726 v.copyOf(x)
6727 return true
6728 }
6729
6730
6731 for {
6732 if auxIntToInt32(v.AuxInt) != 4 {
6733 break
6734 }
6735 y := v_1
6736 if v_2.Op != OpPPC64FlagLT {
6737 break
6738 }
6739 v.copyOf(y)
6740 return true
6741 }
6742
6743
6744
6745 for {
6746 n := auxIntToInt32(v.AuxInt)
6747 x := v_0
6748 y := v_1
6749 if v_2.Op != OpPPC64InvertFlags {
6750 break
6751 }
6752 bool := v_2.Args[0]
6753 if !(n%4 == 0) {
6754 break
6755 }
6756 v.reset(OpPPC64ISEL)
6757 v.AuxInt = int32ToAuxInt(n + 1)
6758 v.AddArg3(x, y, bool)
6759 return true
6760 }
6761
6762
6763
6764 for {
6765 n := auxIntToInt32(v.AuxInt)
6766 x := v_0
6767 y := v_1
6768 if v_2.Op != OpPPC64InvertFlags {
6769 break
6770 }
6771 bool := v_2.Args[0]
6772 if !(n%4 == 1) {
6773 break
6774 }
6775 v.reset(OpPPC64ISEL)
6776 v.AuxInt = int32ToAuxInt(n - 1)
6777 v.AddArg3(x, y, bool)
6778 return true
6779 }
6780
6781
6782
6783 for {
6784 n := auxIntToInt32(v.AuxInt)
6785 x := v_0
6786 y := v_1
6787 if v_2.Op != OpPPC64InvertFlags {
6788 break
6789 }
6790 bool := v_2.Args[0]
6791 if !(n%4 == 2) {
6792 break
6793 }
6794 v.reset(OpPPC64ISEL)
6795 v.AuxInt = int32ToAuxInt(n)
6796 v.AddArg3(x, y, bool)
6797 return true
6798 }
6799 return false
6800 }
6801 func rewriteValuePPC64_OpPPC64LessEqual(v *Value) bool {
6802 v_0 := v.Args[0]
6803
6804
6805 for {
6806 if v_0.Op != OpPPC64FlagEQ {
6807 break
6808 }
6809 v.reset(OpPPC64MOVDconst)
6810 v.AuxInt = int64ToAuxInt(1)
6811 return true
6812 }
6813
6814
6815 for {
6816 if v_0.Op != OpPPC64FlagLT {
6817 break
6818 }
6819 v.reset(OpPPC64MOVDconst)
6820 v.AuxInt = int64ToAuxInt(1)
6821 return true
6822 }
6823
6824
6825 for {
6826 if v_0.Op != OpPPC64FlagGT {
6827 break
6828 }
6829 v.reset(OpPPC64MOVDconst)
6830 v.AuxInt = int64ToAuxInt(0)
6831 return true
6832 }
6833
6834
6835 for {
6836 if v_0.Op != OpPPC64InvertFlags {
6837 break
6838 }
6839 x := v_0.Args[0]
6840 v.reset(OpPPC64GreaterEqual)
6841 v.AddArg(x)
6842 return true
6843 }
6844
6845
6846 for {
6847 cmp := v_0
6848 v.reset(OpPPC64SETBCR)
6849 v.AuxInt = int32ToAuxInt(1)
6850 v.AddArg(cmp)
6851 return true
6852 }
6853 }
6854 func rewriteValuePPC64_OpPPC64LessThan(v *Value) bool {
6855 v_0 := v.Args[0]
6856
6857
6858 for {
6859 if v_0.Op != OpPPC64FlagEQ {
6860 break
6861 }
6862 v.reset(OpPPC64MOVDconst)
6863 v.AuxInt = int64ToAuxInt(0)
6864 return true
6865 }
6866
6867
6868 for {
6869 if v_0.Op != OpPPC64FlagLT {
6870 break
6871 }
6872 v.reset(OpPPC64MOVDconst)
6873 v.AuxInt = int64ToAuxInt(1)
6874 return true
6875 }
6876
6877
6878 for {
6879 if v_0.Op != OpPPC64FlagGT {
6880 break
6881 }
6882 v.reset(OpPPC64MOVDconst)
6883 v.AuxInt = int64ToAuxInt(0)
6884 return true
6885 }
6886
6887
6888 for {
6889 if v_0.Op != OpPPC64InvertFlags {
6890 break
6891 }
6892 x := v_0.Args[0]
6893 v.reset(OpPPC64GreaterThan)
6894 v.AddArg(x)
6895 return true
6896 }
6897
6898
6899 for {
6900 cmp := v_0
6901 v.reset(OpPPC64SETBC)
6902 v.AuxInt = int32ToAuxInt(0)
6903 v.AddArg(cmp)
6904 return true
6905 }
6906 }
6907 func rewriteValuePPC64_OpPPC64LoweredPanicBoundsCR(v *Value) bool {
6908 v_1 := v.Args[1]
6909 v_0 := v.Args[0]
6910
6911
6912 for {
6913 kind := auxIntToInt64(v.AuxInt)
6914 p := auxToPanicBoundsC(v.Aux)
6915 if v_0.Op != OpPPC64MOVDconst {
6916 break
6917 }
6918 c := auxIntToInt64(v_0.AuxInt)
6919 mem := v_1
6920 v.reset(OpPPC64LoweredPanicBoundsCC)
6921 v.AuxInt = int64ToAuxInt(kind)
6922 v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: p.C, Cy: c})
6923 v.AddArg(mem)
6924 return true
6925 }
6926 return false
6927 }
6928 func rewriteValuePPC64_OpPPC64LoweredPanicBoundsRC(v *Value) bool {
6929 v_1 := v.Args[1]
6930 v_0 := v.Args[0]
6931
6932
6933 for {
6934 kind := auxIntToInt64(v.AuxInt)
6935 p := auxToPanicBoundsC(v.Aux)
6936 if v_0.Op != OpPPC64MOVDconst {
6937 break
6938 }
6939 c := auxIntToInt64(v_0.AuxInt)
6940 mem := v_1
6941 v.reset(OpPPC64LoweredPanicBoundsCC)
6942 v.AuxInt = int64ToAuxInt(kind)
6943 v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: c, Cy: p.C})
6944 v.AddArg(mem)
6945 return true
6946 }
6947 return false
6948 }
6949 func rewriteValuePPC64_OpPPC64LoweredPanicBoundsRR(v *Value) bool {
6950 v_2 := v.Args[2]
6951 v_1 := v.Args[1]
6952 v_0 := v.Args[0]
6953
6954
6955 for {
6956 kind := auxIntToInt64(v.AuxInt)
6957 x := v_0
6958 if v_1.Op != OpPPC64MOVDconst {
6959 break
6960 }
6961 c := auxIntToInt64(v_1.AuxInt)
6962 mem := v_2
6963 v.reset(OpPPC64LoweredPanicBoundsRC)
6964 v.AuxInt = int64ToAuxInt(kind)
6965 v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
6966 v.AddArg2(x, mem)
6967 return true
6968 }
6969
6970
6971 for {
6972 kind := auxIntToInt64(v.AuxInt)
6973 if v_0.Op != OpPPC64MOVDconst {
6974 break
6975 }
6976 c := auxIntToInt64(v_0.AuxInt)
6977 y := v_1
6978 mem := v_2
6979 v.reset(OpPPC64LoweredPanicBoundsCR)
6980 v.AuxInt = int64ToAuxInt(kind)
6981 v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
6982 v.AddArg2(y, mem)
6983 return true
6984 }
6985 return false
6986 }
6987 func rewriteValuePPC64_OpPPC64MFVSRD(v *Value) bool {
6988 v_0 := v.Args[0]
6989 b := v.Block
6990 typ := &b.Func.Config.Types
6991
6992
6993 for {
6994 if v_0.Op != OpPPC64FMOVDconst {
6995 break
6996 }
6997 c := auxIntToFloat64(v_0.AuxInt)
6998 v.reset(OpPPC64MOVDconst)
6999 v.AuxInt = int64ToAuxInt(int64(math.Float64bits(c)))
7000 return true
7001 }
7002
7003
7004
7005 for {
7006 x := v_0
7007 if x.Op != OpPPC64FMOVDload {
7008 break
7009 }
7010 off := auxIntToInt32(x.AuxInt)
7011 sym := auxToSym(x.Aux)
7012 mem := x.Args[1]
7013 ptr := x.Args[0]
7014 if !(x.Uses == 1 && clobber(x)) {
7015 break
7016 }
7017 b = x.Block
7018 v0 := b.NewValue0(x.Pos, OpPPC64MOVDload, typ.Int64)
7019 v.copyOf(v0)
7020 v0.AuxInt = int32ToAuxInt(off)
7021 v0.Aux = symToAux(sym)
7022 v0.AddArg2(ptr, mem)
7023 return true
7024 }
7025 return false
7026 }
7027 func rewriteValuePPC64_OpPPC64MOVBZload(v *Value) bool {
7028 v_1 := v.Args[1]
7029 v_0 := v.Args[0]
7030
7031
7032
7033 for {
7034 off1 := auxIntToInt32(v.AuxInt)
7035 sym1 := auxToSym(v.Aux)
7036 p := v_0
7037 if p.Op != OpPPC64MOVDaddr {
7038 break
7039 }
7040 off2 := auxIntToInt32(p.AuxInt)
7041 sym2 := auxToSym(p.Aux)
7042 ptr := p.Args[0]
7043 mem := v_1
7044 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
7045 break
7046 }
7047 v.reset(OpPPC64MOVBZload)
7048 v.AuxInt = int32ToAuxInt(off1 + off2)
7049 v.Aux = symToAux(mergeSym(sym1, sym2))
7050 v.AddArg2(ptr, mem)
7051 return true
7052 }
7053
7054
7055
7056 for {
7057 off1 := auxIntToInt32(v.AuxInt)
7058 sym := auxToSym(v.Aux)
7059 if v_0.Op != OpPPC64ADDconst {
7060 break
7061 }
7062 off2 := auxIntToInt64(v_0.AuxInt)
7063 x := v_0.Args[0]
7064 mem := v_1
7065 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
7066 break
7067 }
7068 v.reset(OpPPC64MOVBZload)
7069 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
7070 v.Aux = symToAux(sym)
7071 v.AddArg2(x, mem)
7072 return true
7073 }
7074
7075
7076
7077 for {
7078 if auxIntToInt32(v.AuxInt) != 0 {
7079 break
7080 }
7081 sym := auxToSym(v.Aux)
7082 p := v_0
7083 if p.Op != OpPPC64ADD {
7084 break
7085 }
7086 idx := p.Args[1]
7087 ptr := p.Args[0]
7088 mem := v_1
7089 if !(sym == nil && p.Uses == 1) {
7090 break
7091 }
7092 v.reset(OpPPC64MOVBZloadidx)
7093 v.AddArg3(ptr, idx, mem)
7094 return true
7095 }
7096 return false
7097 }
7098 func rewriteValuePPC64_OpPPC64MOVBZloadidx(v *Value) bool {
7099 v_2 := v.Args[2]
7100 v_1 := v.Args[1]
7101 v_0 := v.Args[0]
7102
7103
7104
7105 for {
7106 ptr := v_0
7107 if v_1.Op != OpPPC64MOVDconst {
7108 break
7109 }
7110 c := auxIntToInt64(v_1.AuxInt)
7111 mem := v_2
7112 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
7113 break
7114 }
7115 v.reset(OpPPC64MOVBZload)
7116 v.AuxInt = int32ToAuxInt(int32(c))
7117 v.AddArg2(ptr, mem)
7118 return true
7119 }
7120
7121
7122
7123 for {
7124 if v_0.Op != OpPPC64MOVDconst {
7125 break
7126 }
7127 c := auxIntToInt64(v_0.AuxInt)
7128 ptr := v_1
7129 mem := v_2
7130 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
7131 break
7132 }
7133 v.reset(OpPPC64MOVBZload)
7134 v.AuxInt = int32ToAuxInt(int32(c))
7135 v.AddArg2(ptr, mem)
7136 return true
7137 }
7138 return false
7139 }
7140 func rewriteValuePPC64_OpPPC64MOVBZreg(v *Value) bool {
7141 v_0 := v.Args[0]
7142 b := v.Block
7143 typ := &b.Func.Config.Types
7144
7145
7146
7147 for {
7148 y := v_0
7149 if y.Op != OpPPC64ANDconst {
7150 break
7151 }
7152 c := auxIntToInt64(y.AuxInt)
7153 if !(uint64(c) <= 0xFF) {
7154 break
7155 }
7156 v.copyOf(y)
7157 return true
7158 }
7159
7160
7161 for {
7162 if v_0.Op != OpPPC64SRWconst {
7163 break
7164 }
7165 c := auxIntToInt64(v_0.AuxInt)
7166 v_0_0 := v_0.Args[0]
7167 if v_0_0.Op != OpPPC64MOVBZreg {
7168 break
7169 }
7170 x := v_0_0.Args[0]
7171 v.reset(OpPPC64SRWconst)
7172 v.AuxInt = int64ToAuxInt(c)
7173 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
7174 v0.AddArg(x)
7175 v.AddArg(v0)
7176 return true
7177 }
7178
7179
7180
7181 for {
7182 if v_0.Op != OpPPC64SRWconst {
7183 break
7184 }
7185 c := auxIntToInt64(v_0.AuxInt)
7186 x := v_0.Args[0]
7187 if !(x.Type.Size() == 8) {
7188 break
7189 }
7190 v.reset(OpPPC64SRWconst)
7191 v.AuxInt = int64ToAuxInt(c)
7192 v.AddArg(x)
7193 return true
7194 }
7195
7196
7197
7198 for {
7199 if v_0.Op != OpPPC64SRDconst {
7200 break
7201 }
7202 c := auxIntToInt64(v_0.AuxInt)
7203 x := v_0.Args[0]
7204 if !(c >= 56) {
7205 break
7206 }
7207 v.reset(OpPPC64SRDconst)
7208 v.AuxInt = int64ToAuxInt(c)
7209 v.AddArg(x)
7210 return true
7211 }
7212
7213
7214
7215 for {
7216 if v_0.Op != OpPPC64SRWconst {
7217 break
7218 }
7219 c := auxIntToInt64(v_0.AuxInt)
7220 x := v_0.Args[0]
7221 if !(c >= 24) {
7222 break
7223 }
7224 v.reset(OpPPC64SRWconst)
7225 v.AuxInt = int64ToAuxInt(c)
7226 v.AddArg(x)
7227 return true
7228 }
7229
7230
7231 for {
7232 y := v_0
7233 if y.Op != OpPPC64MOVBZreg {
7234 break
7235 }
7236 v.copyOf(y)
7237 return true
7238 }
7239
7240
7241 for {
7242 if v_0.Op != OpPPC64MOVBreg {
7243 break
7244 }
7245 x := v_0.Args[0]
7246 v.reset(OpPPC64MOVBZreg)
7247 v.AddArg(x)
7248 return true
7249 }
7250
7251
7252
7253 for {
7254 if v_0.Op != OpPPC64SRWconst {
7255 break
7256 }
7257 s := auxIntToInt64(v_0.AuxInt)
7258 x := v_0.Args[0]
7259 if !(mergePPC64AndSrwi(0xFF, s) != 0) {
7260 break
7261 }
7262 v.reset(OpPPC64RLWINM)
7263 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(0xFF, s))
7264 v.AddArg(x)
7265 return true
7266 }
7267
7268
7269
7270 for {
7271 if v_0.Op != OpPPC64RLWINM {
7272 break
7273 }
7274 r := auxIntToInt64(v_0.AuxInt)
7275 y := v_0.Args[0]
7276 if !(mergePPC64AndRlwinm(0xFF, r) != 0) {
7277 break
7278 }
7279 v.reset(OpPPC64RLWINM)
7280 v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFF, r))
7281 v.AddArg(y)
7282 return true
7283 }
7284
7285
7286 for {
7287 if v_0.Op != OpPPC64OR {
7288 break
7289 }
7290 t := v_0.Type
7291 _ = v_0.Args[1]
7292 v_0_0 := v_0.Args[0]
7293 v_0_1 := v_0.Args[1]
7294 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7295 x := v_0_0
7296 if v_0_1.Op != OpPPC64MOVWZreg {
7297 continue
7298 }
7299 y := v_0_1.Args[0]
7300 v.reset(OpPPC64MOVBZreg)
7301 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
7302 v0.AddArg2(x, y)
7303 v.AddArg(v0)
7304 return true
7305 }
7306 break
7307 }
7308
7309
7310 for {
7311 if v_0.Op != OpPPC64XOR {
7312 break
7313 }
7314 t := v_0.Type
7315 _ = v_0.Args[1]
7316 v_0_0 := v_0.Args[0]
7317 v_0_1 := v_0.Args[1]
7318 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7319 x := v_0_0
7320 if v_0_1.Op != OpPPC64MOVWZreg {
7321 continue
7322 }
7323 y := v_0_1.Args[0]
7324 v.reset(OpPPC64MOVBZreg)
7325 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
7326 v0.AddArg2(x, y)
7327 v.AddArg(v0)
7328 return true
7329 }
7330 break
7331 }
7332
7333
7334 for {
7335 if v_0.Op != OpPPC64AND {
7336 break
7337 }
7338 t := v_0.Type
7339 _ = v_0.Args[1]
7340 v_0_0 := v_0.Args[0]
7341 v_0_1 := v_0.Args[1]
7342 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7343 x := v_0_0
7344 if v_0_1.Op != OpPPC64MOVWZreg {
7345 continue
7346 }
7347 y := v_0_1.Args[0]
7348 v.reset(OpPPC64MOVBZreg)
7349 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
7350 v0.AddArg2(x, y)
7351 v.AddArg(v0)
7352 return true
7353 }
7354 break
7355 }
7356
7357
7358 for {
7359 if v_0.Op != OpPPC64OR {
7360 break
7361 }
7362 t := v_0.Type
7363 _ = v_0.Args[1]
7364 v_0_0 := v_0.Args[0]
7365 v_0_1 := v_0.Args[1]
7366 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7367 x := v_0_0
7368 if v_0_1.Op != OpPPC64MOVHZreg {
7369 continue
7370 }
7371 y := v_0_1.Args[0]
7372 v.reset(OpPPC64MOVBZreg)
7373 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
7374 v0.AddArg2(x, y)
7375 v.AddArg(v0)
7376 return true
7377 }
7378 break
7379 }
7380
7381
7382 for {
7383 if v_0.Op != OpPPC64XOR {
7384 break
7385 }
7386 t := v_0.Type
7387 _ = v_0.Args[1]
7388 v_0_0 := v_0.Args[0]
7389 v_0_1 := v_0.Args[1]
7390 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7391 x := v_0_0
7392 if v_0_1.Op != OpPPC64MOVHZreg {
7393 continue
7394 }
7395 y := v_0_1.Args[0]
7396 v.reset(OpPPC64MOVBZreg)
7397 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
7398 v0.AddArg2(x, y)
7399 v.AddArg(v0)
7400 return true
7401 }
7402 break
7403 }
7404
7405
7406 for {
7407 if v_0.Op != OpPPC64AND {
7408 break
7409 }
7410 t := v_0.Type
7411 _ = v_0.Args[1]
7412 v_0_0 := v_0.Args[0]
7413 v_0_1 := v_0.Args[1]
7414 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7415 x := v_0_0
7416 if v_0_1.Op != OpPPC64MOVHZreg {
7417 continue
7418 }
7419 y := v_0_1.Args[0]
7420 v.reset(OpPPC64MOVBZreg)
7421 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
7422 v0.AddArg2(x, y)
7423 v.AddArg(v0)
7424 return true
7425 }
7426 break
7427 }
7428
7429
7430 for {
7431 if v_0.Op != OpPPC64OR {
7432 break
7433 }
7434 t := v_0.Type
7435 _ = v_0.Args[1]
7436 v_0_0 := v_0.Args[0]
7437 v_0_1 := v_0.Args[1]
7438 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7439 x := v_0_0
7440 if v_0_1.Op != OpPPC64MOVBZreg {
7441 continue
7442 }
7443 y := v_0_1.Args[0]
7444 v.reset(OpPPC64MOVBZreg)
7445 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
7446 v0.AddArg2(x, y)
7447 v.AddArg(v0)
7448 return true
7449 }
7450 break
7451 }
7452
7453
7454 for {
7455 if v_0.Op != OpPPC64XOR {
7456 break
7457 }
7458 t := v_0.Type
7459 _ = v_0.Args[1]
7460 v_0_0 := v_0.Args[0]
7461 v_0_1 := v_0.Args[1]
7462 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7463 x := v_0_0
7464 if v_0_1.Op != OpPPC64MOVBZreg {
7465 continue
7466 }
7467 y := v_0_1.Args[0]
7468 v.reset(OpPPC64MOVBZreg)
7469 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
7470 v0.AddArg2(x, y)
7471 v.AddArg(v0)
7472 return true
7473 }
7474 break
7475 }
7476
7477
7478 for {
7479 if v_0.Op != OpPPC64AND {
7480 break
7481 }
7482 t := v_0.Type
7483 _ = v_0.Args[1]
7484 v_0_0 := v_0.Args[0]
7485 v_0_1 := v_0.Args[1]
7486 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7487 x := v_0_0
7488 if v_0_1.Op != OpPPC64MOVBZreg {
7489 continue
7490 }
7491 y := v_0_1.Args[0]
7492 v.reset(OpPPC64MOVBZreg)
7493 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
7494 v0.AddArg2(x, y)
7495 v.AddArg(v0)
7496 return true
7497 }
7498 break
7499 }
7500
7501
7502 for {
7503 z := v_0
7504 if z.Op != OpPPC64ANDconst {
7505 break
7506 }
7507 z_0 := z.Args[0]
7508 if z_0.Op != OpPPC64MOVBZload {
7509 break
7510 }
7511 v.copyOf(z)
7512 return true
7513 }
7514
7515
7516 for {
7517 z := v_0
7518 if z.Op != OpPPC64AND {
7519 break
7520 }
7521 _ = z.Args[1]
7522 z_0 := z.Args[0]
7523 z_1 := z.Args[1]
7524 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
7525 if z_1.Op != OpPPC64MOVBZload {
7526 continue
7527 }
7528 v.copyOf(z)
7529 return true
7530 }
7531 break
7532 }
7533
7534
7535 for {
7536 x := v_0
7537 if x.Op != OpPPC64MOVBZload {
7538 break
7539 }
7540 v.copyOf(x)
7541 return true
7542 }
7543
7544
7545 for {
7546 x := v_0
7547 if x.Op != OpPPC64MOVBZloadidx {
7548 break
7549 }
7550 v.copyOf(x)
7551 return true
7552 }
7553
7554
7555 for {
7556 x := v_0
7557 if x.Op != OpSelect0 {
7558 break
7559 }
7560 x_0 := x.Args[0]
7561 if x_0.Op != OpPPC64LoweredAtomicLoad8 {
7562 break
7563 }
7564 v.copyOf(x)
7565 return true
7566 }
7567
7568
7569
7570 for {
7571 x := v_0
7572 if x.Op != OpArg {
7573 break
7574 }
7575 t := x.Type
7576 if !(is8BitInt(t) && !t.IsSigned()) {
7577 break
7578 }
7579 v.copyOf(x)
7580 return true
7581 }
7582
7583
7584 for {
7585 if v_0.Op != OpPPC64MOVDconst {
7586 break
7587 }
7588 c := auxIntToInt64(v_0.AuxInt)
7589 v.reset(OpPPC64MOVDconst)
7590 v.AuxInt = int64ToAuxInt(int64(uint8(c)))
7591 return true
7592 }
7593 return false
7594 }
7595 func rewriteValuePPC64_OpPPC64MOVBreg(v *Value) bool {
7596 v_0 := v.Args[0]
7597 b := v.Block
7598 typ := &b.Func.Config.Types
7599
7600
7601
7602 for {
7603 y := v_0
7604 if y.Op != OpPPC64ANDconst {
7605 break
7606 }
7607 c := auxIntToInt64(y.AuxInt)
7608 if !(uint64(c) <= 0x7F) {
7609 break
7610 }
7611 v.copyOf(y)
7612 return true
7613 }
7614
7615
7616 for {
7617 if v_0.Op != OpPPC64SRAWconst {
7618 break
7619 }
7620 c := auxIntToInt64(v_0.AuxInt)
7621 v_0_0 := v_0.Args[0]
7622 if v_0_0.Op != OpPPC64MOVBreg {
7623 break
7624 }
7625 x := v_0_0.Args[0]
7626 v.reset(OpPPC64SRAWconst)
7627 v.AuxInt = int64ToAuxInt(c)
7628 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
7629 v0.AddArg(x)
7630 v.AddArg(v0)
7631 return true
7632 }
7633
7634
7635
7636 for {
7637 if v_0.Op != OpPPC64SRAWconst {
7638 break
7639 }
7640 c := auxIntToInt64(v_0.AuxInt)
7641 x := v_0.Args[0]
7642 if !(x.Type.Size() == 8) {
7643 break
7644 }
7645 v.reset(OpPPC64SRAWconst)
7646 v.AuxInt = int64ToAuxInt(c)
7647 v.AddArg(x)
7648 return true
7649 }
7650
7651
7652
7653 for {
7654 if v_0.Op != OpPPC64SRDconst {
7655 break
7656 }
7657 c := auxIntToInt64(v_0.AuxInt)
7658 x := v_0.Args[0]
7659 if !(c > 56) {
7660 break
7661 }
7662 v.reset(OpPPC64SRDconst)
7663 v.AuxInt = int64ToAuxInt(c)
7664 v.AddArg(x)
7665 return true
7666 }
7667
7668
7669
7670 for {
7671 if v_0.Op != OpPPC64SRDconst {
7672 break
7673 }
7674 c := auxIntToInt64(v_0.AuxInt)
7675 x := v_0.Args[0]
7676 if !(c == 56) {
7677 break
7678 }
7679 v.reset(OpPPC64SRADconst)
7680 v.AuxInt = int64ToAuxInt(c)
7681 v.AddArg(x)
7682 return true
7683 }
7684
7685
7686
7687 for {
7688 if v_0.Op != OpPPC64SRADconst {
7689 break
7690 }
7691 c := auxIntToInt64(v_0.AuxInt)
7692 x := v_0.Args[0]
7693 if !(c >= 56) {
7694 break
7695 }
7696 v.reset(OpPPC64SRADconst)
7697 v.AuxInt = int64ToAuxInt(c)
7698 v.AddArg(x)
7699 return true
7700 }
7701
7702
7703
7704 for {
7705 if v_0.Op != OpPPC64SRWconst {
7706 break
7707 }
7708 c := auxIntToInt64(v_0.AuxInt)
7709 x := v_0.Args[0]
7710 if !(c > 24) {
7711 break
7712 }
7713 v.reset(OpPPC64SRWconst)
7714 v.AuxInt = int64ToAuxInt(c)
7715 v.AddArg(x)
7716 return true
7717 }
7718
7719
7720
7721 for {
7722 if v_0.Op != OpPPC64SRWconst {
7723 break
7724 }
7725 c := auxIntToInt64(v_0.AuxInt)
7726 x := v_0.Args[0]
7727 if !(c == 24) {
7728 break
7729 }
7730 v.reset(OpPPC64SRAWconst)
7731 v.AuxInt = int64ToAuxInt(c)
7732 v.AddArg(x)
7733 return true
7734 }
7735
7736
7737
7738 for {
7739 if v_0.Op != OpPPC64SRAWconst {
7740 break
7741 }
7742 c := auxIntToInt64(v_0.AuxInt)
7743 x := v_0.Args[0]
7744 if !(c >= 24) {
7745 break
7746 }
7747 v.reset(OpPPC64SRAWconst)
7748 v.AuxInt = int64ToAuxInt(c)
7749 v.AddArg(x)
7750 return true
7751 }
7752
7753
7754 for {
7755 y := v_0
7756 if y.Op != OpPPC64MOVBreg {
7757 break
7758 }
7759 v.copyOf(y)
7760 return true
7761 }
7762
7763
7764 for {
7765 if v_0.Op != OpPPC64MOVBZreg {
7766 break
7767 }
7768 x := v_0.Args[0]
7769 v.reset(OpPPC64MOVBreg)
7770 v.AddArg(x)
7771 return true
7772 }
7773
7774
7775
7776 for {
7777 x := v_0
7778 if x.Op != OpArg {
7779 break
7780 }
7781 t := x.Type
7782 if !(is8BitInt(t) && t.IsSigned()) {
7783 break
7784 }
7785 v.copyOf(x)
7786 return true
7787 }
7788
7789
7790 for {
7791 if v_0.Op != OpPPC64MOVDconst {
7792 break
7793 }
7794 c := auxIntToInt64(v_0.AuxInt)
7795 v.reset(OpPPC64MOVDconst)
7796 v.AuxInt = int64ToAuxInt(int64(int8(c)))
7797 return true
7798 }
7799 return false
7800 }
7801 func rewriteValuePPC64_OpPPC64MOVBstore(v *Value) bool {
7802 v_2 := v.Args[2]
7803 v_1 := v.Args[1]
7804 v_0 := v.Args[0]
7805 b := v.Block
7806 typ := &b.Func.Config.Types
7807
7808
7809
7810 for {
7811 off1 := auxIntToInt32(v.AuxInt)
7812 sym := auxToSym(v.Aux)
7813 if v_0.Op != OpPPC64ADDconst {
7814 break
7815 }
7816 off2 := auxIntToInt64(v_0.AuxInt)
7817 x := v_0.Args[0]
7818 val := v_1
7819 mem := v_2
7820 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
7821 break
7822 }
7823 v.reset(OpPPC64MOVBstore)
7824 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
7825 v.Aux = symToAux(sym)
7826 v.AddArg3(x, val, mem)
7827 return true
7828 }
7829
7830
7831
7832 for {
7833 off1 := auxIntToInt32(v.AuxInt)
7834 sym1 := auxToSym(v.Aux)
7835 p := v_0
7836 if p.Op != OpPPC64MOVDaddr {
7837 break
7838 }
7839 off2 := auxIntToInt32(p.AuxInt)
7840 sym2 := auxToSym(p.Aux)
7841 ptr := p.Args[0]
7842 val := v_1
7843 mem := v_2
7844 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
7845 break
7846 }
7847 v.reset(OpPPC64MOVBstore)
7848 v.AuxInt = int32ToAuxInt(off1 + off2)
7849 v.Aux = symToAux(mergeSym(sym1, sym2))
7850 v.AddArg3(ptr, val, mem)
7851 return true
7852 }
7853
7854
7855 for {
7856 off := auxIntToInt32(v.AuxInt)
7857 sym := auxToSym(v.Aux)
7858 ptr := v_0
7859 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
7860 break
7861 }
7862 mem := v_2
7863 v.reset(OpPPC64MOVBstorezero)
7864 v.AuxInt = int32ToAuxInt(off)
7865 v.Aux = symToAux(sym)
7866 v.AddArg2(ptr, mem)
7867 return true
7868 }
7869
7870
7871
7872 for {
7873 if auxIntToInt32(v.AuxInt) != 0 {
7874 break
7875 }
7876 sym := auxToSym(v.Aux)
7877 p := v_0
7878 if p.Op != OpPPC64ADD {
7879 break
7880 }
7881 idx := p.Args[1]
7882 ptr := p.Args[0]
7883 val := v_1
7884 mem := v_2
7885 if !(sym == nil && p.Uses == 1) {
7886 break
7887 }
7888 v.reset(OpPPC64MOVBstoreidx)
7889 v.AddArg4(ptr, idx, val, mem)
7890 return true
7891 }
7892
7893
7894 for {
7895 off := auxIntToInt32(v.AuxInt)
7896 sym := auxToSym(v.Aux)
7897 ptr := v_0
7898 if v_1.Op != OpPPC64MOVBreg {
7899 break
7900 }
7901 x := v_1.Args[0]
7902 mem := v_2
7903 v.reset(OpPPC64MOVBstore)
7904 v.AuxInt = int32ToAuxInt(off)
7905 v.Aux = symToAux(sym)
7906 v.AddArg3(ptr, x, mem)
7907 return true
7908 }
7909
7910
7911 for {
7912 off := auxIntToInt32(v.AuxInt)
7913 sym := auxToSym(v.Aux)
7914 ptr := v_0
7915 if v_1.Op != OpPPC64MOVBZreg {
7916 break
7917 }
7918 x := v_1.Args[0]
7919 mem := v_2
7920 v.reset(OpPPC64MOVBstore)
7921 v.AuxInt = int32ToAuxInt(off)
7922 v.Aux = symToAux(sym)
7923 v.AddArg3(ptr, x, mem)
7924 return true
7925 }
7926
7927
7928 for {
7929 off := auxIntToInt32(v.AuxInt)
7930 sym := auxToSym(v.Aux)
7931 ptr := v_0
7932 if v_1.Op != OpPPC64MOVHreg {
7933 break
7934 }
7935 x := v_1.Args[0]
7936 mem := v_2
7937 v.reset(OpPPC64MOVBstore)
7938 v.AuxInt = int32ToAuxInt(off)
7939 v.Aux = symToAux(sym)
7940 v.AddArg3(ptr, x, mem)
7941 return true
7942 }
7943
7944
7945 for {
7946 off := auxIntToInt32(v.AuxInt)
7947 sym := auxToSym(v.Aux)
7948 ptr := v_0
7949 if v_1.Op != OpPPC64MOVHZreg {
7950 break
7951 }
7952 x := v_1.Args[0]
7953 mem := v_2
7954 v.reset(OpPPC64MOVBstore)
7955 v.AuxInt = int32ToAuxInt(off)
7956 v.Aux = symToAux(sym)
7957 v.AddArg3(ptr, x, mem)
7958 return true
7959 }
7960
7961
7962 for {
7963 off := auxIntToInt32(v.AuxInt)
7964 sym := auxToSym(v.Aux)
7965 ptr := v_0
7966 if v_1.Op != OpPPC64MOVWreg {
7967 break
7968 }
7969 x := v_1.Args[0]
7970 mem := v_2
7971 v.reset(OpPPC64MOVBstore)
7972 v.AuxInt = int32ToAuxInt(off)
7973 v.Aux = symToAux(sym)
7974 v.AddArg3(ptr, x, mem)
7975 return true
7976 }
7977
7978
7979 for {
7980 off := auxIntToInt32(v.AuxInt)
7981 sym := auxToSym(v.Aux)
7982 ptr := v_0
7983 if v_1.Op != OpPPC64MOVWZreg {
7984 break
7985 }
7986 x := v_1.Args[0]
7987 mem := v_2
7988 v.reset(OpPPC64MOVBstore)
7989 v.AuxInt = int32ToAuxInt(off)
7990 v.Aux = symToAux(sym)
7991 v.AddArg3(ptr, x, mem)
7992 return true
7993 }
7994
7995
7996
7997 for {
7998 off := auxIntToInt32(v.AuxInt)
7999 sym := auxToSym(v.Aux)
8000 ptr := v_0
8001 if v_1.Op != OpPPC64SRWconst {
8002 break
8003 }
8004 c := auxIntToInt64(v_1.AuxInt)
8005 v_1_0 := v_1.Args[0]
8006 if v_1_0.Op != OpPPC64MOVHreg {
8007 break
8008 }
8009 x := v_1_0.Args[0]
8010 mem := v_2
8011 if !(c <= 8) {
8012 break
8013 }
8014 v.reset(OpPPC64MOVBstore)
8015 v.AuxInt = int32ToAuxInt(off)
8016 v.Aux = symToAux(sym)
8017 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8018 v0.AuxInt = int64ToAuxInt(c)
8019 v0.AddArg(x)
8020 v.AddArg3(ptr, v0, mem)
8021 return true
8022 }
8023
8024
8025
8026 for {
8027 off := auxIntToInt32(v.AuxInt)
8028 sym := auxToSym(v.Aux)
8029 ptr := v_0
8030 if v_1.Op != OpPPC64SRWconst {
8031 break
8032 }
8033 c := auxIntToInt64(v_1.AuxInt)
8034 v_1_0 := v_1.Args[0]
8035 if v_1_0.Op != OpPPC64MOVHZreg {
8036 break
8037 }
8038 x := v_1_0.Args[0]
8039 mem := v_2
8040 if !(c <= 8) {
8041 break
8042 }
8043 v.reset(OpPPC64MOVBstore)
8044 v.AuxInt = int32ToAuxInt(off)
8045 v.Aux = symToAux(sym)
8046 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8047 v0.AuxInt = int64ToAuxInt(c)
8048 v0.AddArg(x)
8049 v.AddArg3(ptr, v0, mem)
8050 return true
8051 }
8052
8053
8054
8055 for {
8056 off := auxIntToInt32(v.AuxInt)
8057 sym := auxToSym(v.Aux)
8058 ptr := v_0
8059 if v_1.Op != OpPPC64SRWconst {
8060 break
8061 }
8062 c := auxIntToInt64(v_1.AuxInt)
8063 v_1_0 := v_1.Args[0]
8064 if v_1_0.Op != OpPPC64MOVWreg {
8065 break
8066 }
8067 x := v_1_0.Args[0]
8068 mem := v_2
8069 if !(c <= 24) {
8070 break
8071 }
8072 v.reset(OpPPC64MOVBstore)
8073 v.AuxInt = int32ToAuxInt(off)
8074 v.Aux = symToAux(sym)
8075 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8076 v0.AuxInt = int64ToAuxInt(c)
8077 v0.AddArg(x)
8078 v.AddArg3(ptr, v0, mem)
8079 return true
8080 }
8081
8082
8083
8084 for {
8085 off := auxIntToInt32(v.AuxInt)
8086 sym := auxToSym(v.Aux)
8087 ptr := v_0
8088 if v_1.Op != OpPPC64SRWconst {
8089 break
8090 }
8091 c := auxIntToInt64(v_1.AuxInt)
8092 v_1_0 := v_1.Args[0]
8093 if v_1_0.Op != OpPPC64MOVWZreg {
8094 break
8095 }
8096 x := v_1_0.Args[0]
8097 mem := v_2
8098 if !(c <= 24) {
8099 break
8100 }
8101 v.reset(OpPPC64MOVBstore)
8102 v.AuxInt = int32ToAuxInt(off)
8103 v.Aux = symToAux(sym)
8104 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8105 v0.AuxInt = int64ToAuxInt(c)
8106 v0.AddArg(x)
8107 v.AddArg3(ptr, v0, mem)
8108 return true
8109 }
8110 return false
8111 }
8112 func rewriteValuePPC64_OpPPC64MOVBstoreidx(v *Value) bool {
8113 v_3 := v.Args[3]
8114 v_2 := v.Args[2]
8115 v_1 := v.Args[1]
8116 v_0 := v.Args[0]
8117 b := v.Block
8118 typ := &b.Func.Config.Types
8119
8120
8121
8122 for {
8123 ptr := v_0
8124 if v_1.Op != OpPPC64MOVDconst {
8125 break
8126 }
8127 c := auxIntToInt64(v_1.AuxInt)
8128 val := v_2
8129 mem := v_3
8130 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8131 break
8132 }
8133 v.reset(OpPPC64MOVBstore)
8134 v.AuxInt = int32ToAuxInt(int32(c))
8135 v.AddArg3(ptr, val, mem)
8136 return true
8137 }
8138
8139
8140
8141 for {
8142 if v_0.Op != OpPPC64MOVDconst {
8143 break
8144 }
8145 c := auxIntToInt64(v_0.AuxInt)
8146 ptr := v_1
8147 val := v_2
8148 mem := v_3
8149 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8150 break
8151 }
8152 v.reset(OpPPC64MOVBstore)
8153 v.AuxInt = int32ToAuxInt(int32(c))
8154 v.AddArg3(ptr, val, mem)
8155 return true
8156 }
8157
8158
8159 for {
8160 ptr := v_0
8161 idx := v_1
8162 if v_2.Op != OpPPC64MOVBreg {
8163 break
8164 }
8165 x := v_2.Args[0]
8166 mem := v_3
8167 v.reset(OpPPC64MOVBstoreidx)
8168 v.AddArg4(ptr, idx, x, mem)
8169 return true
8170 }
8171
8172
8173 for {
8174 ptr := v_0
8175 idx := v_1
8176 if v_2.Op != OpPPC64MOVBZreg {
8177 break
8178 }
8179 x := v_2.Args[0]
8180 mem := v_3
8181 v.reset(OpPPC64MOVBstoreidx)
8182 v.AddArg4(ptr, idx, x, mem)
8183 return true
8184 }
8185
8186
8187 for {
8188 ptr := v_0
8189 idx := v_1
8190 if v_2.Op != OpPPC64MOVHreg {
8191 break
8192 }
8193 x := v_2.Args[0]
8194 mem := v_3
8195 v.reset(OpPPC64MOVBstoreidx)
8196 v.AddArg4(ptr, idx, x, mem)
8197 return true
8198 }
8199
8200
8201 for {
8202 ptr := v_0
8203 idx := v_1
8204 if v_2.Op != OpPPC64MOVHZreg {
8205 break
8206 }
8207 x := v_2.Args[0]
8208 mem := v_3
8209 v.reset(OpPPC64MOVBstoreidx)
8210 v.AddArg4(ptr, idx, x, mem)
8211 return true
8212 }
8213
8214
8215 for {
8216 ptr := v_0
8217 idx := v_1
8218 if v_2.Op != OpPPC64MOVWreg {
8219 break
8220 }
8221 x := v_2.Args[0]
8222 mem := v_3
8223 v.reset(OpPPC64MOVBstoreidx)
8224 v.AddArg4(ptr, idx, x, mem)
8225 return true
8226 }
8227
8228
8229 for {
8230 ptr := v_0
8231 idx := v_1
8232 if v_2.Op != OpPPC64MOVWZreg {
8233 break
8234 }
8235 x := v_2.Args[0]
8236 mem := v_3
8237 v.reset(OpPPC64MOVBstoreidx)
8238 v.AddArg4(ptr, idx, x, mem)
8239 return true
8240 }
8241
8242
8243
8244 for {
8245 ptr := v_0
8246 idx := v_1
8247 if v_2.Op != OpPPC64SRWconst {
8248 break
8249 }
8250 c := auxIntToInt64(v_2.AuxInt)
8251 v_2_0 := v_2.Args[0]
8252 if v_2_0.Op != OpPPC64MOVHreg {
8253 break
8254 }
8255 x := v_2_0.Args[0]
8256 mem := v_3
8257 if !(c <= 8) {
8258 break
8259 }
8260 v.reset(OpPPC64MOVBstoreidx)
8261 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8262 v0.AuxInt = int64ToAuxInt(c)
8263 v0.AddArg(x)
8264 v.AddArg4(ptr, idx, v0, mem)
8265 return true
8266 }
8267
8268
8269
8270 for {
8271 ptr := v_0
8272 idx := v_1
8273 if v_2.Op != OpPPC64SRWconst {
8274 break
8275 }
8276 c := auxIntToInt64(v_2.AuxInt)
8277 v_2_0 := v_2.Args[0]
8278 if v_2_0.Op != OpPPC64MOVHZreg {
8279 break
8280 }
8281 x := v_2_0.Args[0]
8282 mem := v_3
8283 if !(c <= 8) {
8284 break
8285 }
8286 v.reset(OpPPC64MOVBstoreidx)
8287 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8288 v0.AuxInt = int64ToAuxInt(c)
8289 v0.AddArg(x)
8290 v.AddArg4(ptr, idx, v0, mem)
8291 return true
8292 }
8293
8294
8295
8296 for {
8297 ptr := v_0
8298 idx := v_1
8299 if v_2.Op != OpPPC64SRWconst {
8300 break
8301 }
8302 c := auxIntToInt64(v_2.AuxInt)
8303 v_2_0 := v_2.Args[0]
8304 if v_2_0.Op != OpPPC64MOVWreg {
8305 break
8306 }
8307 x := v_2_0.Args[0]
8308 mem := v_3
8309 if !(c <= 24) {
8310 break
8311 }
8312 v.reset(OpPPC64MOVBstoreidx)
8313 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8314 v0.AuxInt = int64ToAuxInt(c)
8315 v0.AddArg(x)
8316 v.AddArg4(ptr, idx, v0, mem)
8317 return true
8318 }
8319
8320
8321
8322 for {
8323 ptr := v_0
8324 idx := v_1
8325 if v_2.Op != OpPPC64SRWconst {
8326 break
8327 }
8328 c := auxIntToInt64(v_2.AuxInt)
8329 v_2_0 := v_2.Args[0]
8330 if v_2_0.Op != OpPPC64MOVWZreg {
8331 break
8332 }
8333 x := v_2_0.Args[0]
8334 mem := v_3
8335 if !(c <= 24) {
8336 break
8337 }
8338 v.reset(OpPPC64MOVBstoreidx)
8339 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8340 v0.AuxInt = int64ToAuxInt(c)
8341 v0.AddArg(x)
8342 v.AddArg4(ptr, idx, v0, mem)
8343 return true
8344 }
8345 return false
8346 }
8347 func rewriteValuePPC64_OpPPC64MOVBstorezero(v *Value) bool {
8348 v_1 := v.Args[1]
8349 v_0 := v.Args[0]
8350
8351
8352
8353 for {
8354 off1 := auxIntToInt32(v.AuxInt)
8355 sym := auxToSym(v.Aux)
8356 if v_0.Op != OpPPC64ADDconst {
8357 break
8358 }
8359 off2 := auxIntToInt64(v_0.AuxInt)
8360 x := v_0.Args[0]
8361 mem := v_1
8362 if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
8363 break
8364 }
8365 v.reset(OpPPC64MOVBstorezero)
8366 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8367 v.Aux = symToAux(sym)
8368 v.AddArg2(x, mem)
8369 return true
8370 }
8371
8372
8373
8374 for {
8375 off1 := auxIntToInt32(v.AuxInt)
8376 sym1 := auxToSym(v.Aux)
8377 p := v_0
8378 if p.Op != OpPPC64MOVDaddr {
8379 break
8380 }
8381 off2 := auxIntToInt32(p.AuxInt)
8382 sym2 := auxToSym(p.Aux)
8383 x := p.Args[0]
8384 mem := v_1
8385 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8386 break
8387 }
8388 v.reset(OpPPC64MOVBstorezero)
8389 v.AuxInt = int32ToAuxInt(off1 + off2)
8390 v.Aux = symToAux(mergeSym(sym1, sym2))
8391 v.AddArg2(x, mem)
8392 return true
8393 }
8394 return false
8395 }
8396 func rewriteValuePPC64_OpPPC64MOVDaddr(v *Value) bool {
8397 v_0 := v.Args[0]
8398
8399
8400
8401 for {
8402 n := auxIntToInt32(v.AuxInt)
8403 sym := auxToSym(v.Aux)
8404 p := v_0
8405 if p.Op != OpPPC64ADD {
8406 break
8407 }
8408 if !(sym == nil && n == 0) {
8409 break
8410 }
8411 v.copyOf(p)
8412 return true
8413 }
8414
8415
8416
8417 for {
8418 n := auxIntToInt32(v.AuxInt)
8419 sym := auxToSym(v.Aux)
8420 ptr := v_0
8421 if !(sym == nil && n == 0 && (ptr.Op == OpArgIntReg || ptr.Op == OpPhi)) {
8422 break
8423 }
8424 v.copyOf(ptr)
8425 return true
8426 }
8427 return false
8428 }
8429 func rewriteValuePPC64_OpPPC64MOVDload(v *Value) bool {
8430 v_1 := v.Args[1]
8431 v_0 := v.Args[0]
8432
8433
8434 for {
8435 off := auxIntToInt32(v.AuxInt)
8436 sym := auxToSym(v.Aux)
8437 ptr := v_0
8438 if v_1.Op != OpPPC64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
8439 break
8440 }
8441 x := v_1.Args[1]
8442 if ptr != v_1.Args[0] {
8443 break
8444 }
8445 v.reset(OpPPC64MFVSRD)
8446 v.AddArg(x)
8447 return true
8448 }
8449
8450
8451
8452 for {
8453 off1 := auxIntToInt32(v.AuxInt)
8454 sym1 := auxToSym(v.Aux)
8455 p := v_0
8456 if p.Op != OpPPC64MOVDaddr {
8457 break
8458 }
8459 off2 := auxIntToInt32(p.AuxInt)
8460 sym2 := auxToSym(p.Aux)
8461 ptr := p.Args[0]
8462 mem := v_1
8463 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8464 break
8465 }
8466 v.reset(OpPPC64MOVDload)
8467 v.AuxInt = int32ToAuxInt(off1 + off2)
8468 v.Aux = symToAux(mergeSym(sym1, sym2))
8469 v.AddArg2(ptr, mem)
8470 return true
8471 }
8472
8473
8474
8475 for {
8476 off1 := auxIntToInt32(v.AuxInt)
8477 sym := auxToSym(v.Aux)
8478 if v_0.Op != OpPPC64ADDconst {
8479 break
8480 }
8481 off2 := auxIntToInt64(v_0.AuxInt)
8482 x := v_0.Args[0]
8483 mem := v_1
8484 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
8485 break
8486 }
8487 v.reset(OpPPC64MOVDload)
8488 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8489 v.Aux = symToAux(sym)
8490 v.AddArg2(x, mem)
8491 return true
8492 }
8493
8494
8495
8496 for {
8497 if auxIntToInt32(v.AuxInt) != 0 {
8498 break
8499 }
8500 sym := auxToSym(v.Aux)
8501 p := v_0
8502 if p.Op != OpPPC64ADD {
8503 break
8504 }
8505 idx := p.Args[1]
8506 ptr := p.Args[0]
8507 mem := v_1
8508 if !(sym == nil && p.Uses == 1) {
8509 break
8510 }
8511 v.reset(OpPPC64MOVDloadidx)
8512 v.AddArg3(ptr, idx, mem)
8513 return true
8514 }
8515 return false
8516 }
8517 func rewriteValuePPC64_OpPPC64MOVDloadidx(v *Value) bool {
8518 v_2 := v.Args[2]
8519 v_1 := v.Args[1]
8520 v_0 := v.Args[0]
8521
8522
8523
8524 for {
8525 ptr := v_0
8526 if v_1.Op != OpPPC64MOVDconst {
8527 break
8528 }
8529 c := auxIntToInt64(v_1.AuxInt)
8530 mem := v_2
8531 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8532 break
8533 }
8534 v.reset(OpPPC64MOVDload)
8535 v.AuxInt = int32ToAuxInt(int32(c))
8536 v.AddArg2(ptr, mem)
8537 return true
8538 }
8539
8540
8541
8542 for {
8543 if v_0.Op != OpPPC64MOVDconst {
8544 break
8545 }
8546 c := auxIntToInt64(v_0.AuxInt)
8547 ptr := v_1
8548 mem := v_2
8549 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8550 break
8551 }
8552 v.reset(OpPPC64MOVDload)
8553 v.AuxInt = int32ToAuxInt(int32(c))
8554 v.AddArg2(ptr, mem)
8555 return true
8556 }
8557 return false
8558 }
8559 func rewriteValuePPC64_OpPPC64MOVDstore(v *Value) bool {
8560 v_2 := v.Args[2]
8561 v_1 := v.Args[1]
8562 v_0 := v.Args[0]
8563 b := v.Block
8564
8565
8566 for {
8567 off := auxIntToInt32(v.AuxInt)
8568 sym := auxToSym(v.Aux)
8569 ptr := v_0
8570 if v_1.Op != OpPPC64MFVSRD {
8571 break
8572 }
8573 x := v_1.Args[0]
8574 mem := v_2
8575 v.reset(OpPPC64FMOVDstore)
8576 v.AuxInt = int32ToAuxInt(off)
8577 v.Aux = symToAux(sym)
8578 v.AddArg3(ptr, x, mem)
8579 return true
8580 }
8581
8582
8583
8584 for {
8585 off1 := auxIntToInt32(v.AuxInt)
8586 sym := auxToSym(v.Aux)
8587 if v_0.Op != OpPPC64ADDconst {
8588 break
8589 }
8590 off2 := auxIntToInt64(v_0.AuxInt)
8591 x := v_0.Args[0]
8592 val := v_1
8593 mem := v_2
8594 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
8595 break
8596 }
8597 v.reset(OpPPC64MOVDstore)
8598 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8599 v.Aux = symToAux(sym)
8600 v.AddArg3(x, val, mem)
8601 return true
8602 }
8603
8604
8605
8606 for {
8607 off1 := auxIntToInt32(v.AuxInt)
8608 sym1 := auxToSym(v.Aux)
8609 p := v_0
8610 if p.Op != OpPPC64MOVDaddr {
8611 break
8612 }
8613 off2 := auxIntToInt32(p.AuxInt)
8614 sym2 := auxToSym(p.Aux)
8615 ptr := p.Args[0]
8616 val := v_1
8617 mem := v_2
8618 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8619 break
8620 }
8621 v.reset(OpPPC64MOVDstore)
8622 v.AuxInt = int32ToAuxInt(off1 + off2)
8623 v.Aux = symToAux(mergeSym(sym1, sym2))
8624 v.AddArg3(ptr, val, mem)
8625 return true
8626 }
8627
8628
8629 for {
8630 off := auxIntToInt32(v.AuxInt)
8631 sym := auxToSym(v.Aux)
8632 ptr := v_0
8633 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
8634 break
8635 }
8636 mem := v_2
8637 v.reset(OpPPC64MOVDstorezero)
8638 v.AuxInt = int32ToAuxInt(off)
8639 v.Aux = symToAux(sym)
8640 v.AddArg2(ptr, mem)
8641 return true
8642 }
8643
8644
8645
8646 for {
8647 if auxIntToInt32(v.AuxInt) != 0 {
8648 break
8649 }
8650 sym := auxToSym(v.Aux)
8651 p := v_0
8652 if p.Op != OpPPC64ADD {
8653 break
8654 }
8655 idx := p.Args[1]
8656 ptr := p.Args[0]
8657 val := v_1
8658 mem := v_2
8659 if !(sym == nil && p.Uses == 1) {
8660 break
8661 }
8662 v.reset(OpPPC64MOVDstoreidx)
8663 v.AddArg4(ptr, idx, val, mem)
8664 return true
8665 }
8666
8667
8668
8669 for {
8670 off := auxIntToInt32(v.AuxInt)
8671 sym := auxToSym(v.Aux)
8672 ptr := v_0
8673 r := v_1
8674 if r.Op != OpPPC64BRD {
8675 break
8676 }
8677 val := r.Args[0]
8678 mem := v_2
8679 if !(r.Uses == 1) {
8680 break
8681 }
8682 v.reset(OpPPC64MOVDBRstore)
8683 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
8684 v0.AuxInt = int32ToAuxInt(off)
8685 v0.Aux = symToAux(sym)
8686 v0.AddArg(ptr)
8687 v.AddArg3(v0, val, mem)
8688 return true
8689 }
8690
8691
8692 for {
8693 off := auxIntToInt32(v.AuxInt)
8694 sym := auxToSym(v.Aux)
8695 ptr := v_0
8696 if v_1.Op != OpBswap64 {
8697 break
8698 }
8699 val := v_1.Args[0]
8700 mem := v_2
8701 v.reset(OpPPC64MOVDBRstore)
8702 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
8703 v0.AuxInt = int32ToAuxInt(off)
8704 v0.Aux = symToAux(sym)
8705 v0.AddArg(ptr)
8706 v.AddArg3(v0, val, mem)
8707 return true
8708 }
8709 return false
8710 }
8711 func rewriteValuePPC64_OpPPC64MOVDstoreidx(v *Value) bool {
8712 v_3 := v.Args[3]
8713 v_2 := v.Args[2]
8714 v_1 := v.Args[1]
8715 v_0 := v.Args[0]
8716
8717
8718
8719 for {
8720 ptr := v_0
8721 if v_1.Op != OpPPC64MOVDconst {
8722 break
8723 }
8724 c := auxIntToInt64(v_1.AuxInt)
8725 val := v_2
8726 mem := v_3
8727 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8728 break
8729 }
8730 v.reset(OpPPC64MOVDstore)
8731 v.AuxInt = int32ToAuxInt(int32(c))
8732 v.AddArg3(ptr, val, mem)
8733 return true
8734 }
8735
8736
8737
8738 for {
8739 if v_0.Op != OpPPC64MOVDconst {
8740 break
8741 }
8742 c := auxIntToInt64(v_0.AuxInt)
8743 ptr := v_1
8744 val := v_2
8745 mem := v_3
8746 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8747 break
8748 }
8749 v.reset(OpPPC64MOVDstore)
8750 v.AuxInt = int32ToAuxInt(int32(c))
8751 v.AddArg3(ptr, val, mem)
8752 return true
8753 }
8754
8755
8756
8757 for {
8758 ptr := v_0
8759 idx := v_1
8760 r := v_2
8761 if r.Op != OpPPC64BRD {
8762 break
8763 }
8764 val := r.Args[0]
8765 mem := v_3
8766 if !(r.Uses == 1) {
8767 break
8768 }
8769 v.reset(OpPPC64MOVDBRstoreidx)
8770 v.AddArg4(ptr, idx, val, mem)
8771 return true
8772 }
8773
8774
8775 for {
8776 ptr := v_0
8777 idx := v_1
8778 if v_2.Op != OpBswap64 {
8779 break
8780 }
8781 val := v_2.Args[0]
8782 mem := v_3
8783 v.reset(OpPPC64MOVDBRstoreidx)
8784 v.AddArg4(ptr, idx, val, mem)
8785 return true
8786 }
8787 return false
8788 }
8789 func rewriteValuePPC64_OpPPC64MOVDstorezero(v *Value) bool {
8790 v_1 := v.Args[1]
8791 v_0 := v.Args[0]
8792
8793
8794
8795 for {
8796 off1 := auxIntToInt32(v.AuxInt)
8797 sym := auxToSym(v.Aux)
8798 if v_0.Op != OpPPC64ADDconst {
8799 break
8800 }
8801 off2 := auxIntToInt64(v_0.AuxInt)
8802 x := v_0.Args[0]
8803 mem := v_1
8804 if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
8805 break
8806 }
8807 v.reset(OpPPC64MOVDstorezero)
8808 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8809 v.Aux = symToAux(sym)
8810 v.AddArg2(x, mem)
8811 return true
8812 }
8813
8814
8815
8816 for {
8817 off1 := auxIntToInt32(v.AuxInt)
8818 sym1 := auxToSym(v.Aux)
8819 p := v_0
8820 if p.Op != OpPPC64MOVDaddr {
8821 break
8822 }
8823 off2 := auxIntToInt32(p.AuxInt)
8824 sym2 := auxToSym(p.Aux)
8825 x := p.Args[0]
8826 mem := v_1
8827 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8828 break
8829 }
8830 v.reset(OpPPC64MOVDstorezero)
8831 v.AuxInt = int32ToAuxInt(off1 + off2)
8832 v.Aux = symToAux(mergeSym(sym1, sym2))
8833 v.AddArg2(x, mem)
8834 return true
8835 }
8836 return false
8837 }
8838 func rewriteValuePPC64_OpPPC64MOVHBRstore(v *Value) bool {
8839 v_2 := v.Args[2]
8840 v_1 := v.Args[1]
8841 v_0 := v.Args[0]
8842
8843
8844 for {
8845 ptr := v_0
8846 if v_1.Op != OpPPC64MOVHreg {
8847 break
8848 }
8849 x := v_1.Args[0]
8850 mem := v_2
8851 v.reset(OpPPC64MOVHBRstore)
8852 v.AddArg3(ptr, x, mem)
8853 return true
8854 }
8855
8856
8857 for {
8858 ptr := v_0
8859 if v_1.Op != OpPPC64MOVHZreg {
8860 break
8861 }
8862 x := v_1.Args[0]
8863 mem := v_2
8864 v.reset(OpPPC64MOVHBRstore)
8865 v.AddArg3(ptr, x, mem)
8866 return true
8867 }
8868
8869
8870 for {
8871 ptr := v_0
8872 if v_1.Op != OpPPC64MOVWreg {
8873 break
8874 }
8875 x := v_1.Args[0]
8876 mem := v_2
8877 v.reset(OpPPC64MOVHBRstore)
8878 v.AddArg3(ptr, x, mem)
8879 return true
8880 }
8881
8882
8883 for {
8884 ptr := v_0
8885 if v_1.Op != OpPPC64MOVWZreg {
8886 break
8887 }
8888 x := v_1.Args[0]
8889 mem := v_2
8890 v.reset(OpPPC64MOVHBRstore)
8891 v.AddArg3(ptr, x, mem)
8892 return true
8893 }
8894 return false
8895 }
8896 func rewriteValuePPC64_OpPPC64MOVHZload(v *Value) bool {
8897 v_1 := v.Args[1]
8898 v_0 := v.Args[0]
8899
8900
8901
8902 for {
8903 off1 := auxIntToInt32(v.AuxInt)
8904 sym1 := auxToSym(v.Aux)
8905 p := v_0
8906 if p.Op != OpPPC64MOVDaddr {
8907 break
8908 }
8909 off2 := auxIntToInt32(p.AuxInt)
8910 sym2 := auxToSym(p.Aux)
8911 ptr := p.Args[0]
8912 mem := v_1
8913 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8914 break
8915 }
8916 v.reset(OpPPC64MOVHZload)
8917 v.AuxInt = int32ToAuxInt(off1 + off2)
8918 v.Aux = symToAux(mergeSym(sym1, sym2))
8919 v.AddArg2(ptr, mem)
8920 return true
8921 }
8922
8923
8924
8925 for {
8926 off1 := auxIntToInt32(v.AuxInt)
8927 sym := auxToSym(v.Aux)
8928 if v_0.Op != OpPPC64ADDconst {
8929 break
8930 }
8931 off2 := auxIntToInt64(v_0.AuxInt)
8932 x := v_0.Args[0]
8933 mem := v_1
8934 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
8935 break
8936 }
8937 v.reset(OpPPC64MOVHZload)
8938 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8939 v.Aux = symToAux(sym)
8940 v.AddArg2(x, mem)
8941 return true
8942 }
8943
8944
8945
8946 for {
8947 if auxIntToInt32(v.AuxInt) != 0 {
8948 break
8949 }
8950 sym := auxToSym(v.Aux)
8951 p := v_0
8952 if p.Op != OpPPC64ADD {
8953 break
8954 }
8955 idx := p.Args[1]
8956 ptr := p.Args[0]
8957 mem := v_1
8958 if !(sym == nil && p.Uses == 1) {
8959 break
8960 }
8961 v.reset(OpPPC64MOVHZloadidx)
8962 v.AddArg3(ptr, idx, mem)
8963 return true
8964 }
8965 return false
8966 }
8967 func rewriteValuePPC64_OpPPC64MOVHZloadidx(v *Value) bool {
8968 v_2 := v.Args[2]
8969 v_1 := v.Args[1]
8970 v_0 := v.Args[0]
8971
8972
8973
8974 for {
8975 ptr := v_0
8976 if v_1.Op != OpPPC64MOVDconst {
8977 break
8978 }
8979 c := auxIntToInt64(v_1.AuxInt)
8980 mem := v_2
8981 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8982 break
8983 }
8984 v.reset(OpPPC64MOVHZload)
8985 v.AuxInt = int32ToAuxInt(int32(c))
8986 v.AddArg2(ptr, mem)
8987 return true
8988 }
8989
8990
8991
8992 for {
8993 if v_0.Op != OpPPC64MOVDconst {
8994 break
8995 }
8996 c := auxIntToInt64(v_0.AuxInt)
8997 ptr := v_1
8998 mem := v_2
8999 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
9000 break
9001 }
9002 v.reset(OpPPC64MOVHZload)
9003 v.AuxInt = int32ToAuxInt(int32(c))
9004 v.AddArg2(ptr, mem)
9005 return true
9006 }
9007 return false
9008 }
9009 func rewriteValuePPC64_OpPPC64MOVHZreg(v *Value) bool {
9010 v_0 := v.Args[0]
9011 b := v.Block
9012 typ := &b.Func.Config.Types
9013
9014
9015
9016 for {
9017 y := v_0
9018 if y.Op != OpPPC64ANDconst {
9019 break
9020 }
9021 c := auxIntToInt64(y.AuxInt)
9022 if !(uint64(c) <= 0xFFFF) {
9023 break
9024 }
9025 v.copyOf(y)
9026 return true
9027 }
9028
9029
9030 for {
9031 if v_0.Op != OpPPC64SRWconst {
9032 break
9033 }
9034 c := auxIntToInt64(v_0.AuxInt)
9035 v_0_0 := v_0.Args[0]
9036 if v_0_0.Op != OpPPC64MOVBZreg {
9037 break
9038 }
9039 x := v_0_0.Args[0]
9040 v.reset(OpPPC64SRWconst)
9041 v.AuxInt = int64ToAuxInt(c)
9042 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
9043 v0.AddArg(x)
9044 v.AddArg(v0)
9045 return true
9046 }
9047
9048
9049 for {
9050 if v_0.Op != OpPPC64SRWconst {
9051 break
9052 }
9053 c := auxIntToInt64(v_0.AuxInt)
9054 v_0_0 := v_0.Args[0]
9055 if v_0_0.Op != OpPPC64MOVHZreg {
9056 break
9057 }
9058 x := v_0_0.Args[0]
9059 v.reset(OpPPC64SRWconst)
9060 v.AuxInt = int64ToAuxInt(c)
9061 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
9062 v0.AddArg(x)
9063 v.AddArg(v0)
9064 return true
9065 }
9066
9067
9068
9069 for {
9070 if v_0.Op != OpPPC64SRWconst {
9071 break
9072 }
9073 c := auxIntToInt64(v_0.AuxInt)
9074 x := v_0.Args[0]
9075 if !(x.Type.Size() <= 16) {
9076 break
9077 }
9078 v.reset(OpPPC64SRWconst)
9079 v.AuxInt = int64ToAuxInt(c)
9080 v.AddArg(x)
9081 return true
9082 }
9083
9084
9085
9086 for {
9087 if v_0.Op != OpPPC64SRDconst {
9088 break
9089 }
9090 c := auxIntToInt64(v_0.AuxInt)
9091 x := v_0.Args[0]
9092 if !(c >= 48) {
9093 break
9094 }
9095 v.reset(OpPPC64SRDconst)
9096 v.AuxInt = int64ToAuxInt(c)
9097 v.AddArg(x)
9098 return true
9099 }
9100
9101
9102
9103 for {
9104 if v_0.Op != OpPPC64SRWconst {
9105 break
9106 }
9107 c := auxIntToInt64(v_0.AuxInt)
9108 x := v_0.Args[0]
9109 if !(c >= 16) {
9110 break
9111 }
9112 v.reset(OpPPC64SRWconst)
9113 v.AuxInt = int64ToAuxInt(c)
9114 v.AddArg(x)
9115 return true
9116 }
9117
9118
9119
9120 for {
9121 if v_0.Op != OpPPC64RLWINM {
9122 break
9123 }
9124 r := auxIntToInt64(v_0.AuxInt)
9125 y := v_0.Args[0]
9126 if !(mergePPC64AndRlwinm(0xFFFF, r) != 0) {
9127 break
9128 }
9129 v.reset(OpPPC64RLWINM)
9130 v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFFFF, r))
9131 v.AddArg(y)
9132 return true
9133 }
9134
9135
9136 for {
9137 y := v_0
9138 if y.Op != OpPPC64MOVHZreg {
9139 break
9140 }
9141 v.copyOf(y)
9142 return true
9143 }
9144
9145
9146 for {
9147 y := v_0
9148 if y.Op != OpPPC64MOVBZreg {
9149 break
9150 }
9151 v.copyOf(y)
9152 return true
9153 }
9154
9155
9156 for {
9157 y := v_0
9158 if y.Op != OpPPC64MOVHBRload {
9159 break
9160 }
9161 v.copyOf(y)
9162 return true
9163 }
9164
9165
9166 for {
9167 y := v_0
9168 if y.Op != OpPPC64MOVHreg {
9169 break
9170 }
9171 x := y.Args[0]
9172 v.reset(OpPPC64MOVHZreg)
9173 v.AddArg(x)
9174 return true
9175 }
9176
9177
9178 for {
9179 if v_0.Op != OpPPC64OR {
9180 break
9181 }
9182 t := v_0.Type
9183 _ = v_0.Args[1]
9184 v_0_0 := v_0.Args[0]
9185 v_0_1 := v_0.Args[1]
9186 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9187 x := v_0_0
9188 if v_0_1.Op != OpPPC64MOVWZreg {
9189 continue
9190 }
9191 y := v_0_1.Args[0]
9192 v.reset(OpPPC64MOVHZreg)
9193 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
9194 v0.AddArg2(x, y)
9195 v.AddArg(v0)
9196 return true
9197 }
9198 break
9199 }
9200
9201
9202 for {
9203 if v_0.Op != OpPPC64XOR {
9204 break
9205 }
9206 t := v_0.Type
9207 _ = v_0.Args[1]
9208 v_0_0 := v_0.Args[0]
9209 v_0_1 := v_0.Args[1]
9210 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9211 x := v_0_0
9212 if v_0_1.Op != OpPPC64MOVWZreg {
9213 continue
9214 }
9215 y := v_0_1.Args[0]
9216 v.reset(OpPPC64MOVHZreg)
9217 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
9218 v0.AddArg2(x, y)
9219 v.AddArg(v0)
9220 return true
9221 }
9222 break
9223 }
9224
9225
9226 for {
9227 if v_0.Op != OpPPC64AND {
9228 break
9229 }
9230 t := v_0.Type
9231 _ = v_0.Args[1]
9232 v_0_0 := v_0.Args[0]
9233 v_0_1 := v_0.Args[1]
9234 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9235 x := v_0_0
9236 if v_0_1.Op != OpPPC64MOVWZreg {
9237 continue
9238 }
9239 y := v_0_1.Args[0]
9240 v.reset(OpPPC64MOVHZreg)
9241 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
9242 v0.AddArg2(x, y)
9243 v.AddArg(v0)
9244 return true
9245 }
9246 break
9247 }
9248
9249
9250 for {
9251 if v_0.Op != OpPPC64OR {
9252 break
9253 }
9254 t := v_0.Type
9255 _ = v_0.Args[1]
9256 v_0_0 := v_0.Args[0]
9257 v_0_1 := v_0.Args[1]
9258 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9259 x := v_0_0
9260 if v_0_1.Op != OpPPC64MOVHZreg {
9261 continue
9262 }
9263 y := v_0_1.Args[0]
9264 v.reset(OpPPC64MOVHZreg)
9265 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
9266 v0.AddArg2(x, y)
9267 v.AddArg(v0)
9268 return true
9269 }
9270 break
9271 }
9272
9273
9274 for {
9275 if v_0.Op != OpPPC64XOR {
9276 break
9277 }
9278 t := v_0.Type
9279 _ = v_0.Args[1]
9280 v_0_0 := v_0.Args[0]
9281 v_0_1 := v_0.Args[1]
9282 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9283 x := v_0_0
9284 if v_0_1.Op != OpPPC64MOVHZreg {
9285 continue
9286 }
9287 y := v_0_1.Args[0]
9288 v.reset(OpPPC64MOVHZreg)
9289 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
9290 v0.AddArg2(x, y)
9291 v.AddArg(v0)
9292 return true
9293 }
9294 break
9295 }
9296
9297
9298 for {
9299 if v_0.Op != OpPPC64AND {
9300 break
9301 }
9302 t := v_0.Type
9303 _ = v_0.Args[1]
9304 v_0_0 := v_0.Args[0]
9305 v_0_1 := v_0.Args[1]
9306 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9307 x := v_0_0
9308 if v_0_1.Op != OpPPC64MOVHZreg {
9309 continue
9310 }
9311 y := v_0_1.Args[0]
9312 v.reset(OpPPC64MOVHZreg)
9313 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
9314 v0.AddArg2(x, y)
9315 v.AddArg(v0)
9316 return true
9317 }
9318 break
9319 }
9320
9321
9322 for {
9323 z := v_0
9324 if z.Op != OpPPC64ANDconst {
9325 break
9326 }
9327 z_0 := z.Args[0]
9328 if z_0.Op != OpPPC64MOVBZload {
9329 break
9330 }
9331 v.copyOf(z)
9332 return true
9333 }
9334
9335
9336 for {
9337 z := v_0
9338 if z.Op != OpPPC64AND {
9339 break
9340 }
9341 _ = z.Args[1]
9342 z_0 := z.Args[0]
9343 z_1 := z.Args[1]
9344 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
9345 if z_1.Op != OpPPC64MOVHZload {
9346 continue
9347 }
9348 v.copyOf(z)
9349 return true
9350 }
9351 break
9352 }
9353
9354
9355 for {
9356 z := v_0
9357 if z.Op != OpPPC64ANDconst {
9358 break
9359 }
9360 z_0 := z.Args[0]
9361 if z_0.Op != OpPPC64MOVHZload {
9362 break
9363 }
9364 v.copyOf(z)
9365 return true
9366 }
9367
9368
9369 for {
9370 x := v_0
9371 if x.Op != OpPPC64MOVBZload {
9372 break
9373 }
9374 v.copyOf(x)
9375 return true
9376 }
9377
9378
9379 for {
9380 x := v_0
9381 if x.Op != OpPPC64MOVBZloadidx {
9382 break
9383 }
9384 v.copyOf(x)
9385 return true
9386 }
9387
9388
9389 for {
9390 x := v_0
9391 if x.Op != OpPPC64MOVHZload {
9392 break
9393 }
9394 v.copyOf(x)
9395 return true
9396 }
9397
9398
9399 for {
9400 x := v_0
9401 if x.Op != OpPPC64MOVHZloadidx {
9402 break
9403 }
9404 v.copyOf(x)
9405 return true
9406 }
9407
9408
9409
9410 for {
9411 x := v_0
9412 if x.Op != OpArg {
9413 break
9414 }
9415 t := x.Type
9416 if !((is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()) {
9417 break
9418 }
9419 v.copyOf(x)
9420 return true
9421 }
9422
9423
9424 for {
9425 if v_0.Op != OpPPC64MOVDconst {
9426 break
9427 }
9428 c := auxIntToInt64(v_0.AuxInt)
9429 v.reset(OpPPC64MOVDconst)
9430 v.AuxInt = int64ToAuxInt(int64(uint16(c)))
9431 return true
9432 }
9433 return false
9434 }
9435 func rewriteValuePPC64_OpPPC64MOVHload(v *Value) bool {
9436 v_1 := v.Args[1]
9437 v_0 := v.Args[0]
9438
9439
9440
9441 for {
9442 off1 := auxIntToInt32(v.AuxInt)
9443 sym1 := auxToSym(v.Aux)
9444 p := v_0
9445 if p.Op != OpPPC64MOVDaddr {
9446 break
9447 }
9448 off2 := auxIntToInt32(p.AuxInt)
9449 sym2 := auxToSym(p.Aux)
9450 ptr := p.Args[0]
9451 mem := v_1
9452 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
9453 break
9454 }
9455 v.reset(OpPPC64MOVHload)
9456 v.AuxInt = int32ToAuxInt(off1 + off2)
9457 v.Aux = symToAux(mergeSym(sym1, sym2))
9458 v.AddArg2(ptr, mem)
9459 return true
9460 }
9461
9462
9463
9464 for {
9465 off1 := auxIntToInt32(v.AuxInt)
9466 sym := auxToSym(v.Aux)
9467 if v_0.Op != OpPPC64ADDconst {
9468 break
9469 }
9470 off2 := auxIntToInt64(v_0.AuxInt)
9471 x := v_0.Args[0]
9472 mem := v_1
9473 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
9474 break
9475 }
9476 v.reset(OpPPC64MOVHload)
9477 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9478 v.Aux = symToAux(sym)
9479 v.AddArg2(x, mem)
9480 return true
9481 }
9482
9483
9484
9485 for {
9486 if auxIntToInt32(v.AuxInt) != 0 {
9487 break
9488 }
9489 sym := auxToSym(v.Aux)
9490 p := v_0
9491 if p.Op != OpPPC64ADD {
9492 break
9493 }
9494 idx := p.Args[1]
9495 ptr := p.Args[0]
9496 mem := v_1
9497 if !(sym == nil && p.Uses == 1) {
9498 break
9499 }
9500 v.reset(OpPPC64MOVHloadidx)
9501 v.AddArg3(ptr, idx, mem)
9502 return true
9503 }
9504 return false
9505 }
9506 func rewriteValuePPC64_OpPPC64MOVHloadidx(v *Value) bool {
9507 v_2 := v.Args[2]
9508 v_1 := v.Args[1]
9509 v_0 := v.Args[0]
9510
9511
9512
9513 for {
9514 ptr := v_0
9515 if v_1.Op != OpPPC64MOVDconst {
9516 break
9517 }
9518 c := auxIntToInt64(v_1.AuxInt)
9519 mem := v_2
9520 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
9521 break
9522 }
9523 v.reset(OpPPC64MOVHload)
9524 v.AuxInt = int32ToAuxInt(int32(c))
9525 v.AddArg2(ptr, mem)
9526 return true
9527 }
9528
9529
9530
9531 for {
9532 if v_0.Op != OpPPC64MOVDconst {
9533 break
9534 }
9535 c := auxIntToInt64(v_0.AuxInt)
9536 ptr := v_1
9537 mem := v_2
9538 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
9539 break
9540 }
9541 v.reset(OpPPC64MOVHload)
9542 v.AuxInt = int32ToAuxInt(int32(c))
9543 v.AddArg2(ptr, mem)
9544 return true
9545 }
9546 return false
9547 }
9548 func rewriteValuePPC64_OpPPC64MOVHreg(v *Value) bool {
9549 v_0 := v.Args[0]
9550 b := v.Block
9551 typ := &b.Func.Config.Types
9552
9553
9554
9555 for {
9556 y := v_0
9557 if y.Op != OpPPC64ANDconst {
9558 break
9559 }
9560 c := auxIntToInt64(y.AuxInt)
9561 if !(uint64(c) <= 0x7FFF) {
9562 break
9563 }
9564 v.copyOf(y)
9565 return true
9566 }
9567
9568
9569 for {
9570 if v_0.Op != OpPPC64SRAWconst {
9571 break
9572 }
9573 c := auxIntToInt64(v_0.AuxInt)
9574 v_0_0 := v_0.Args[0]
9575 if v_0_0.Op != OpPPC64MOVBreg {
9576 break
9577 }
9578 x := v_0_0.Args[0]
9579 v.reset(OpPPC64SRAWconst)
9580 v.AuxInt = int64ToAuxInt(c)
9581 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
9582 v0.AddArg(x)
9583 v.AddArg(v0)
9584 return true
9585 }
9586
9587
9588 for {
9589 if v_0.Op != OpPPC64SRAWconst {
9590 break
9591 }
9592 c := auxIntToInt64(v_0.AuxInt)
9593 v_0_0 := v_0.Args[0]
9594 if v_0_0.Op != OpPPC64MOVHreg {
9595 break
9596 }
9597 x := v_0_0.Args[0]
9598 v.reset(OpPPC64SRAWconst)
9599 v.AuxInt = int64ToAuxInt(c)
9600 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
9601 v0.AddArg(x)
9602 v.AddArg(v0)
9603 return true
9604 }
9605
9606
9607
9608 for {
9609 if v_0.Op != OpPPC64SRAWconst {
9610 break
9611 }
9612 c := auxIntToInt64(v_0.AuxInt)
9613 x := v_0.Args[0]
9614 if !(x.Type.Size() <= 16) {
9615 break
9616 }
9617 v.reset(OpPPC64SRAWconst)
9618 v.AuxInt = int64ToAuxInt(c)
9619 v.AddArg(x)
9620 return true
9621 }
9622
9623
9624
9625 for {
9626 if v_0.Op != OpPPC64SRDconst {
9627 break
9628 }
9629 c := auxIntToInt64(v_0.AuxInt)
9630 x := v_0.Args[0]
9631 if !(c > 48) {
9632 break
9633 }
9634 v.reset(OpPPC64SRDconst)
9635 v.AuxInt = int64ToAuxInt(c)
9636 v.AddArg(x)
9637 return true
9638 }
9639
9640
9641
9642 for {
9643 if v_0.Op != OpPPC64SRDconst {
9644 break
9645 }
9646 c := auxIntToInt64(v_0.AuxInt)
9647 x := v_0.Args[0]
9648 if !(c == 48) {
9649 break
9650 }
9651 v.reset(OpPPC64SRADconst)
9652 v.AuxInt = int64ToAuxInt(c)
9653 v.AddArg(x)
9654 return true
9655 }
9656
9657
9658
9659 for {
9660 if v_0.Op != OpPPC64SRADconst {
9661 break
9662 }
9663 c := auxIntToInt64(v_0.AuxInt)
9664 x := v_0.Args[0]
9665 if !(c >= 48) {
9666 break
9667 }
9668 v.reset(OpPPC64SRADconst)
9669 v.AuxInt = int64ToAuxInt(c)
9670 v.AddArg(x)
9671 return true
9672 }
9673
9674
9675
9676 for {
9677 if v_0.Op != OpPPC64SRWconst {
9678 break
9679 }
9680 c := auxIntToInt64(v_0.AuxInt)
9681 x := v_0.Args[0]
9682 if !(c > 16) {
9683 break
9684 }
9685 v.reset(OpPPC64SRWconst)
9686 v.AuxInt = int64ToAuxInt(c)
9687 v.AddArg(x)
9688 return true
9689 }
9690
9691
9692
9693 for {
9694 if v_0.Op != OpPPC64SRAWconst {
9695 break
9696 }
9697 c := auxIntToInt64(v_0.AuxInt)
9698 x := v_0.Args[0]
9699 if !(c >= 16) {
9700 break
9701 }
9702 v.reset(OpPPC64SRAWconst)
9703 v.AuxInt = int64ToAuxInt(c)
9704 v.AddArg(x)
9705 return true
9706 }
9707
9708
9709
9710 for {
9711 if v_0.Op != OpPPC64SRWconst {
9712 break
9713 }
9714 c := auxIntToInt64(v_0.AuxInt)
9715 x := v_0.Args[0]
9716 if !(c == 16) {
9717 break
9718 }
9719 v.reset(OpPPC64SRAWconst)
9720 v.AuxInt = int64ToAuxInt(c)
9721 v.AddArg(x)
9722 return true
9723 }
9724
9725
9726 for {
9727 y := v_0
9728 if y.Op != OpPPC64MOVHreg {
9729 break
9730 }
9731 v.copyOf(y)
9732 return true
9733 }
9734
9735
9736 for {
9737 y := v_0
9738 if y.Op != OpPPC64MOVBreg {
9739 break
9740 }
9741 v.copyOf(y)
9742 return true
9743 }
9744
9745
9746 for {
9747 y := v_0
9748 if y.Op != OpPPC64MOVHZreg {
9749 break
9750 }
9751 x := y.Args[0]
9752 v.reset(OpPPC64MOVHreg)
9753 v.AddArg(x)
9754 return true
9755 }
9756
9757
9758 for {
9759 x := v_0
9760 if x.Op != OpPPC64MOVHload {
9761 break
9762 }
9763 v.copyOf(x)
9764 return true
9765 }
9766
9767
9768 for {
9769 x := v_0
9770 if x.Op != OpPPC64MOVHloadidx {
9771 break
9772 }
9773 v.copyOf(x)
9774 return true
9775 }
9776
9777
9778
9779 for {
9780 x := v_0
9781 if x.Op != OpArg {
9782 break
9783 }
9784 t := x.Type
9785 if !((is8BitInt(t) || is16BitInt(t)) && t.IsSigned()) {
9786 break
9787 }
9788 v.copyOf(x)
9789 return true
9790 }
9791
9792
9793 for {
9794 if v_0.Op != OpPPC64MOVDconst {
9795 break
9796 }
9797 c := auxIntToInt64(v_0.AuxInt)
9798 v.reset(OpPPC64MOVDconst)
9799 v.AuxInt = int64ToAuxInt(int64(int16(c)))
9800 return true
9801 }
9802 return false
9803 }
9804 func rewriteValuePPC64_OpPPC64MOVHstore(v *Value) bool {
9805 v_2 := v.Args[2]
9806 v_1 := v.Args[1]
9807 v_0 := v.Args[0]
9808 b := v.Block
9809
9810
9811
9812 for {
9813 off1 := auxIntToInt32(v.AuxInt)
9814 sym := auxToSym(v.Aux)
9815 if v_0.Op != OpPPC64ADDconst {
9816 break
9817 }
9818 off2 := auxIntToInt64(v_0.AuxInt)
9819 x := v_0.Args[0]
9820 val := v_1
9821 mem := v_2
9822 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
9823 break
9824 }
9825 v.reset(OpPPC64MOVHstore)
9826 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9827 v.Aux = symToAux(sym)
9828 v.AddArg3(x, val, mem)
9829 return true
9830 }
9831
9832
9833
9834 for {
9835 off1 := auxIntToInt32(v.AuxInt)
9836 sym1 := auxToSym(v.Aux)
9837 p := v_0
9838 if p.Op != OpPPC64MOVDaddr {
9839 break
9840 }
9841 off2 := auxIntToInt32(p.AuxInt)
9842 sym2 := auxToSym(p.Aux)
9843 ptr := p.Args[0]
9844 val := v_1
9845 mem := v_2
9846 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
9847 break
9848 }
9849 v.reset(OpPPC64MOVHstore)
9850 v.AuxInt = int32ToAuxInt(off1 + off2)
9851 v.Aux = symToAux(mergeSym(sym1, sym2))
9852 v.AddArg3(ptr, val, mem)
9853 return true
9854 }
9855
9856
9857 for {
9858 off := auxIntToInt32(v.AuxInt)
9859 sym := auxToSym(v.Aux)
9860 ptr := v_0
9861 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
9862 break
9863 }
9864 mem := v_2
9865 v.reset(OpPPC64MOVHstorezero)
9866 v.AuxInt = int32ToAuxInt(off)
9867 v.Aux = symToAux(sym)
9868 v.AddArg2(ptr, mem)
9869 return true
9870 }
9871
9872
9873
9874 for {
9875 if auxIntToInt32(v.AuxInt) != 0 {
9876 break
9877 }
9878 sym := auxToSym(v.Aux)
9879 p := v_0
9880 if p.Op != OpPPC64ADD {
9881 break
9882 }
9883 idx := p.Args[1]
9884 ptr := p.Args[0]
9885 val := v_1
9886 mem := v_2
9887 if !(sym == nil && p.Uses == 1) {
9888 break
9889 }
9890 v.reset(OpPPC64MOVHstoreidx)
9891 v.AddArg4(ptr, idx, val, mem)
9892 return true
9893 }
9894
9895
9896 for {
9897 off := auxIntToInt32(v.AuxInt)
9898 sym := auxToSym(v.Aux)
9899 ptr := v_0
9900 if v_1.Op != OpPPC64MOVHreg {
9901 break
9902 }
9903 x := v_1.Args[0]
9904 mem := v_2
9905 v.reset(OpPPC64MOVHstore)
9906 v.AuxInt = int32ToAuxInt(off)
9907 v.Aux = symToAux(sym)
9908 v.AddArg3(ptr, x, mem)
9909 return true
9910 }
9911
9912
9913 for {
9914 off := auxIntToInt32(v.AuxInt)
9915 sym := auxToSym(v.Aux)
9916 ptr := v_0
9917 if v_1.Op != OpPPC64MOVHZreg {
9918 break
9919 }
9920 x := v_1.Args[0]
9921 mem := v_2
9922 v.reset(OpPPC64MOVHstore)
9923 v.AuxInt = int32ToAuxInt(off)
9924 v.Aux = symToAux(sym)
9925 v.AddArg3(ptr, x, mem)
9926 return true
9927 }
9928
9929
9930 for {
9931 off := auxIntToInt32(v.AuxInt)
9932 sym := auxToSym(v.Aux)
9933 ptr := v_0
9934 if v_1.Op != OpPPC64MOVWreg {
9935 break
9936 }
9937 x := v_1.Args[0]
9938 mem := v_2
9939 v.reset(OpPPC64MOVHstore)
9940 v.AuxInt = int32ToAuxInt(off)
9941 v.Aux = symToAux(sym)
9942 v.AddArg3(ptr, x, mem)
9943 return true
9944 }
9945
9946
9947 for {
9948 off := auxIntToInt32(v.AuxInt)
9949 sym := auxToSym(v.Aux)
9950 ptr := v_0
9951 if v_1.Op != OpPPC64MOVWZreg {
9952 break
9953 }
9954 x := v_1.Args[0]
9955 mem := v_2
9956 v.reset(OpPPC64MOVHstore)
9957 v.AuxInt = int32ToAuxInt(off)
9958 v.Aux = symToAux(sym)
9959 v.AddArg3(ptr, x, mem)
9960 return true
9961 }
9962
9963
9964
9965 for {
9966 off := auxIntToInt32(v.AuxInt)
9967 sym := auxToSym(v.Aux)
9968 ptr := v_0
9969 r := v_1
9970 if r.Op != OpPPC64BRH {
9971 break
9972 }
9973 val := r.Args[0]
9974 mem := v_2
9975 if !(r.Uses == 1) {
9976 break
9977 }
9978 v.reset(OpPPC64MOVHBRstore)
9979 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
9980 v0.AuxInt = int32ToAuxInt(off)
9981 v0.Aux = symToAux(sym)
9982 v0.AddArg(ptr)
9983 v.AddArg3(v0, val, mem)
9984 return true
9985 }
9986
9987
9988 for {
9989 off := auxIntToInt32(v.AuxInt)
9990 sym := auxToSym(v.Aux)
9991 ptr := v_0
9992 if v_1.Op != OpBswap16 {
9993 break
9994 }
9995 val := v_1.Args[0]
9996 mem := v_2
9997 v.reset(OpPPC64MOVHBRstore)
9998 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
9999 v0.AuxInt = int32ToAuxInt(off)
10000 v0.Aux = symToAux(sym)
10001 v0.AddArg(ptr)
10002 v.AddArg3(v0, val, mem)
10003 return true
10004 }
10005 return false
10006 }
10007 func rewriteValuePPC64_OpPPC64MOVHstoreidx(v *Value) bool {
10008 v_3 := v.Args[3]
10009 v_2 := v.Args[2]
10010 v_1 := v.Args[1]
10011 v_0 := v.Args[0]
10012
10013
10014
10015 for {
10016 ptr := v_0
10017 if v_1.Op != OpPPC64MOVDconst {
10018 break
10019 }
10020 c := auxIntToInt64(v_1.AuxInt)
10021 val := v_2
10022 mem := v_3
10023 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10024 break
10025 }
10026 v.reset(OpPPC64MOVHstore)
10027 v.AuxInt = int32ToAuxInt(int32(c))
10028 v.AddArg3(ptr, val, mem)
10029 return true
10030 }
10031
10032
10033
10034 for {
10035 if v_0.Op != OpPPC64MOVDconst {
10036 break
10037 }
10038 c := auxIntToInt64(v_0.AuxInt)
10039 ptr := v_1
10040 val := v_2
10041 mem := v_3
10042 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10043 break
10044 }
10045 v.reset(OpPPC64MOVHstore)
10046 v.AuxInt = int32ToAuxInt(int32(c))
10047 v.AddArg3(ptr, val, mem)
10048 return true
10049 }
10050
10051
10052 for {
10053 ptr := v_0
10054 idx := v_1
10055 if v_2.Op != OpPPC64MOVHreg {
10056 break
10057 }
10058 x := v_2.Args[0]
10059 mem := v_3
10060 v.reset(OpPPC64MOVHstoreidx)
10061 v.AddArg4(ptr, idx, x, mem)
10062 return true
10063 }
10064
10065
10066 for {
10067 ptr := v_0
10068 idx := v_1
10069 if v_2.Op != OpPPC64MOVHZreg {
10070 break
10071 }
10072 x := v_2.Args[0]
10073 mem := v_3
10074 v.reset(OpPPC64MOVHstoreidx)
10075 v.AddArg4(ptr, idx, x, mem)
10076 return true
10077 }
10078
10079
10080 for {
10081 ptr := v_0
10082 idx := v_1
10083 if v_2.Op != OpPPC64MOVWreg {
10084 break
10085 }
10086 x := v_2.Args[0]
10087 mem := v_3
10088 v.reset(OpPPC64MOVHstoreidx)
10089 v.AddArg4(ptr, idx, x, mem)
10090 return true
10091 }
10092
10093
10094 for {
10095 ptr := v_0
10096 idx := v_1
10097 if v_2.Op != OpPPC64MOVWZreg {
10098 break
10099 }
10100 x := v_2.Args[0]
10101 mem := v_3
10102 v.reset(OpPPC64MOVHstoreidx)
10103 v.AddArg4(ptr, idx, x, mem)
10104 return true
10105 }
10106
10107
10108
10109 for {
10110 ptr := v_0
10111 idx := v_1
10112 r := v_2
10113 if r.Op != OpPPC64BRH {
10114 break
10115 }
10116 val := r.Args[0]
10117 mem := v_3
10118 if !(r.Uses == 1) {
10119 break
10120 }
10121 v.reset(OpPPC64MOVHBRstoreidx)
10122 v.AddArg4(ptr, idx, val, mem)
10123 return true
10124 }
10125
10126
10127 for {
10128 ptr := v_0
10129 idx := v_1
10130 if v_2.Op != OpBswap16 {
10131 break
10132 }
10133 val := v_2.Args[0]
10134 mem := v_3
10135 v.reset(OpPPC64MOVHBRstoreidx)
10136 v.AddArg4(ptr, idx, val, mem)
10137 return true
10138 }
10139 return false
10140 }
10141 func rewriteValuePPC64_OpPPC64MOVHstorezero(v *Value) bool {
10142 v_1 := v.Args[1]
10143 v_0 := v.Args[0]
10144
10145
10146
10147 for {
10148 off1 := auxIntToInt32(v.AuxInt)
10149 sym := auxToSym(v.Aux)
10150 if v_0.Op != OpPPC64ADDconst {
10151 break
10152 }
10153 off2 := auxIntToInt64(v_0.AuxInt)
10154 x := v_0.Args[0]
10155 mem := v_1
10156 if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
10157 break
10158 }
10159 v.reset(OpPPC64MOVHstorezero)
10160 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10161 v.Aux = symToAux(sym)
10162 v.AddArg2(x, mem)
10163 return true
10164 }
10165
10166
10167
10168 for {
10169 off1 := auxIntToInt32(v.AuxInt)
10170 sym1 := auxToSym(v.Aux)
10171 p := v_0
10172 if p.Op != OpPPC64MOVDaddr {
10173 break
10174 }
10175 off2 := auxIntToInt32(p.AuxInt)
10176 sym2 := auxToSym(p.Aux)
10177 x := p.Args[0]
10178 mem := v_1
10179 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
10180 break
10181 }
10182 v.reset(OpPPC64MOVHstorezero)
10183 v.AuxInt = int32ToAuxInt(off1 + off2)
10184 v.Aux = symToAux(mergeSym(sym1, sym2))
10185 v.AddArg2(x, mem)
10186 return true
10187 }
10188 return false
10189 }
10190 func rewriteValuePPC64_OpPPC64MOVWBRstore(v *Value) bool {
10191 v_2 := v.Args[2]
10192 v_1 := v.Args[1]
10193 v_0 := v.Args[0]
10194
10195
10196 for {
10197 ptr := v_0
10198 if v_1.Op != OpPPC64MOVWreg {
10199 break
10200 }
10201 x := v_1.Args[0]
10202 mem := v_2
10203 v.reset(OpPPC64MOVWBRstore)
10204 v.AddArg3(ptr, x, mem)
10205 return true
10206 }
10207
10208
10209 for {
10210 ptr := v_0
10211 if v_1.Op != OpPPC64MOVWZreg {
10212 break
10213 }
10214 x := v_1.Args[0]
10215 mem := v_2
10216 v.reset(OpPPC64MOVWBRstore)
10217 v.AddArg3(ptr, x, mem)
10218 return true
10219 }
10220 return false
10221 }
10222 func rewriteValuePPC64_OpPPC64MOVWZload(v *Value) bool {
10223 v_1 := v.Args[1]
10224 v_0 := v.Args[0]
10225
10226
10227
10228 for {
10229 off1 := auxIntToInt32(v.AuxInt)
10230 sym1 := auxToSym(v.Aux)
10231 p := v_0
10232 if p.Op != OpPPC64MOVDaddr {
10233 break
10234 }
10235 off2 := auxIntToInt32(p.AuxInt)
10236 sym2 := auxToSym(p.Aux)
10237 ptr := p.Args[0]
10238 mem := v_1
10239 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
10240 break
10241 }
10242 v.reset(OpPPC64MOVWZload)
10243 v.AuxInt = int32ToAuxInt(off1 + off2)
10244 v.Aux = symToAux(mergeSym(sym1, sym2))
10245 v.AddArg2(ptr, mem)
10246 return true
10247 }
10248
10249
10250
10251 for {
10252 off1 := auxIntToInt32(v.AuxInt)
10253 sym := auxToSym(v.Aux)
10254 if v_0.Op != OpPPC64ADDconst {
10255 break
10256 }
10257 off2 := auxIntToInt64(v_0.AuxInt)
10258 x := v_0.Args[0]
10259 mem := v_1
10260 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
10261 break
10262 }
10263 v.reset(OpPPC64MOVWZload)
10264 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10265 v.Aux = symToAux(sym)
10266 v.AddArg2(x, mem)
10267 return true
10268 }
10269
10270
10271
10272 for {
10273 if auxIntToInt32(v.AuxInt) != 0 {
10274 break
10275 }
10276 sym := auxToSym(v.Aux)
10277 p := v_0
10278 if p.Op != OpPPC64ADD {
10279 break
10280 }
10281 idx := p.Args[1]
10282 ptr := p.Args[0]
10283 mem := v_1
10284 if !(sym == nil && p.Uses == 1) {
10285 break
10286 }
10287 v.reset(OpPPC64MOVWZloadidx)
10288 v.AddArg3(ptr, idx, mem)
10289 return true
10290 }
10291 return false
10292 }
10293 func rewriteValuePPC64_OpPPC64MOVWZloadidx(v *Value) bool {
10294 v_2 := v.Args[2]
10295 v_1 := v.Args[1]
10296 v_0 := v.Args[0]
10297
10298
10299
10300 for {
10301 ptr := v_0
10302 if v_1.Op != OpPPC64MOVDconst {
10303 break
10304 }
10305 c := auxIntToInt64(v_1.AuxInt)
10306 mem := v_2
10307 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10308 break
10309 }
10310 v.reset(OpPPC64MOVWZload)
10311 v.AuxInt = int32ToAuxInt(int32(c))
10312 v.AddArg2(ptr, mem)
10313 return true
10314 }
10315
10316
10317
10318 for {
10319 if v_0.Op != OpPPC64MOVDconst {
10320 break
10321 }
10322 c := auxIntToInt64(v_0.AuxInt)
10323 ptr := v_1
10324 mem := v_2
10325 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10326 break
10327 }
10328 v.reset(OpPPC64MOVWZload)
10329 v.AuxInt = int32ToAuxInt(int32(c))
10330 v.AddArg2(ptr, mem)
10331 return true
10332 }
10333 return false
10334 }
10335 func rewriteValuePPC64_OpPPC64MOVWZreg(v *Value) bool {
10336 v_0 := v.Args[0]
10337 b := v.Block
10338 typ := &b.Func.Config.Types
10339
10340
10341
10342 for {
10343 y := v_0
10344 if y.Op != OpPPC64ANDconst {
10345 break
10346 }
10347 c := auxIntToInt64(y.AuxInt)
10348 if !(uint64(c) <= 0xFFFFFFFF) {
10349 break
10350 }
10351 v.copyOf(y)
10352 return true
10353 }
10354
10355
10356
10357 for {
10358 y := v_0
10359 if y.Op != OpPPC64AND {
10360 break
10361 }
10362 y_0 := y.Args[0]
10363 y_1 := y.Args[1]
10364 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
10365 if y_0.Op != OpPPC64MOVDconst {
10366 continue
10367 }
10368 c := auxIntToInt64(y_0.AuxInt)
10369 if !(uint64(c) <= 0xFFFFFFFF) {
10370 continue
10371 }
10372 v.copyOf(y)
10373 return true
10374 }
10375 break
10376 }
10377
10378
10379 for {
10380 if v_0.Op != OpPPC64SRWconst {
10381 break
10382 }
10383 c := auxIntToInt64(v_0.AuxInt)
10384 v_0_0 := v_0.Args[0]
10385 if v_0_0.Op != OpPPC64MOVBZreg {
10386 break
10387 }
10388 x := v_0_0.Args[0]
10389 v.reset(OpPPC64SRWconst)
10390 v.AuxInt = int64ToAuxInt(c)
10391 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
10392 v0.AddArg(x)
10393 v.AddArg(v0)
10394 return true
10395 }
10396
10397
10398 for {
10399 if v_0.Op != OpPPC64SRWconst {
10400 break
10401 }
10402 c := auxIntToInt64(v_0.AuxInt)
10403 v_0_0 := v_0.Args[0]
10404 if v_0_0.Op != OpPPC64MOVHZreg {
10405 break
10406 }
10407 x := v_0_0.Args[0]
10408 v.reset(OpPPC64SRWconst)
10409 v.AuxInt = int64ToAuxInt(c)
10410 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
10411 v0.AddArg(x)
10412 v.AddArg(v0)
10413 return true
10414 }
10415
10416
10417 for {
10418 if v_0.Op != OpPPC64SRWconst {
10419 break
10420 }
10421 c := auxIntToInt64(v_0.AuxInt)
10422 v_0_0 := v_0.Args[0]
10423 if v_0_0.Op != OpPPC64MOVWZreg {
10424 break
10425 }
10426 x := v_0_0.Args[0]
10427 v.reset(OpPPC64SRWconst)
10428 v.AuxInt = int64ToAuxInt(c)
10429 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
10430 v0.AddArg(x)
10431 v.AddArg(v0)
10432 return true
10433 }
10434
10435
10436
10437 for {
10438 if v_0.Op != OpPPC64SRWconst {
10439 break
10440 }
10441 c := auxIntToInt64(v_0.AuxInt)
10442 x := v_0.Args[0]
10443 if !(x.Type.Size() <= 32) {
10444 break
10445 }
10446 v.reset(OpPPC64SRWconst)
10447 v.AuxInt = int64ToAuxInt(c)
10448 v.AddArg(x)
10449 return true
10450 }
10451
10452
10453
10454 for {
10455 if v_0.Op != OpPPC64SRDconst {
10456 break
10457 }
10458 c := auxIntToInt64(v_0.AuxInt)
10459 x := v_0.Args[0]
10460 if !(c >= 32) {
10461 break
10462 }
10463 v.reset(OpPPC64SRDconst)
10464 v.AuxInt = int64ToAuxInt(c)
10465 v.AddArg(x)
10466 return true
10467 }
10468
10469
10470
10471 for {
10472 if v_0.Op != OpPPC64RLWINM {
10473 break
10474 }
10475 r := auxIntToInt64(v_0.AuxInt)
10476 y := v_0.Args[0]
10477 if !(mergePPC64MovwzregRlwinm(r) != 0) {
10478 break
10479 }
10480 v.reset(OpPPC64RLWINM)
10481 v.AuxInt = int64ToAuxInt(mergePPC64MovwzregRlwinm(r))
10482 v.AddArg(y)
10483 return true
10484 }
10485
10486
10487 for {
10488 w := v_0
10489 if w.Op != OpPPC64SLWconst {
10490 break
10491 }
10492 v.copyOf(w)
10493 return true
10494 }
10495
10496
10497 for {
10498 y := v_0
10499 if y.Op != OpPPC64MOVWZreg {
10500 break
10501 }
10502 v.copyOf(y)
10503 return true
10504 }
10505
10506
10507 for {
10508 y := v_0
10509 if y.Op != OpPPC64MOVHZreg {
10510 break
10511 }
10512 v.copyOf(y)
10513 return true
10514 }
10515
10516
10517 for {
10518 y := v_0
10519 if y.Op != OpPPC64MOVBZreg {
10520 break
10521 }
10522 v.copyOf(y)
10523 return true
10524 }
10525
10526
10527 for {
10528 y := v_0
10529 if y.Op != OpPPC64MOVHBRload {
10530 break
10531 }
10532 v.copyOf(y)
10533 return true
10534 }
10535
10536
10537 for {
10538 y := v_0
10539 if y.Op != OpPPC64MOVWBRload {
10540 break
10541 }
10542 v.copyOf(y)
10543 return true
10544 }
10545
10546
10547 for {
10548 y := v_0
10549 if y.Op != OpPPC64MOVWreg {
10550 break
10551 }
10552 x := y.Args[0]
10553 v.reset(OpPPC64MOVWZreg)
10554 v.AddArg(x)
10555 return true
10556 }
10557
10558
10559 for {
10560 if v_0.Op != OpPPC64OR {
10561 break
10562 }
10563 t := v_0.Type
10564 _ = v_0.Args[1]
10565 v_0_0 := v_0.Args[0]
10566 v_0_1 := v_0.Args[1]
10567 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
10568 x := v_0_0
10569 if v_0_1.Op != OpPPC64MOVWZreg {
10570 continue
10571 }
10572 y := v_0_1.Args[0]
10573 v.reset(OpPPC64MOVWZreg)
10574 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
10575 v0.AddArg2(x, y)
10576 v.AddArg(v0)
10577 return true
10578 }
10579 break
10580 }
10581
10582
10583 for {
10584 if v_0.Op != OpPPC64XOR {
10585 break
10586 }
10587 t := v_0.Type
10588 _ = v_0.Args[1]
10589 v_0_0 := v_0.Args[0]
10590 v_0_1 := v_0.Args[1]
10591 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
10592 x := v_0_0
10593 if v_0_1.Op != OpPPC64MOVWZreg {
10594 continue
10595 }
10596 y := v_0_1.Args[0]
10597 v.reset(OpPPC64MOVWZreg)
10598 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
10599 v0.AddArg2(x, y)
10600 v.AddArg(v0)
10601 return true
10602 }
10603 break
10604 }
10605
10606
10607 for {
10608 if v_0.Op != OpPPC64AND {
10609 break
10610 }
10611 t := v_0.Type
10612 _ = v_0.Args[1]
10613 v_0_0 := v_0.Args[0]
10614 v_0_1 := v_0.Args[1]
10615 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
10616 x := v_0_0
10617 if v_0_1.Op != OpPPC64MOVWZreg {
10618 continue
10619 }
10620 y := v_0_1.Args[0]
10621 v.reset(OpPPC64MOVWZreg)
10622 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
10623 v0.AddArg2(x, y)
10624 v.AddArg(v0)
10625 return true
10626 }
10627 break
10628 }
10629
10630
10631 for {
10632 z := v_0
10633 if z.Op != OpPPC64ANDconst {
10634 break
10635 }
10636 z_0 := z.Args[0]
10637 if z_0.Op != OpPPC64MOVBZload {
10638 break
10639 }
10640 v.copyOf(z)
10641 return true
10642 }
10643
10644
10645 for {
10646 z := v_0
10647 if z.Op != OpPPC64AND {
10648 break
10649 }
10650 _ = z.Args[1]
10651 z_0 := z.Args[0]
10652 z_1 := z.Args[1]
10653 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
10654 if z_1.Op != OpPPC64MOVWZload {
10655 continue
10656 }
10657 v.copyOf(z)
10658 return true
10659 }
10660 break
10661 }
10662
10663
10664 for {
10665 z := v_0
10666 if z.Op != OpPPC64ANDconst {
10667 break
10668 }
10669 z_0 := z.Args[0]
10670 if z_0.Op != OpPPC64MOVHZload {
10671 break
10672 }
10673 v.copyOf(z)
10674 return true
10675 }
10676
10677
10678 for {
10679 z := v_0
10680 if z.Op != OpPPC64ANDconst {
10681 break
10682 }
10683 z_0 := z.Args[0]
10684 if z_0.Op != OpPPC64MOVWZload {
10685 break
10686 }
10687 v.copyOf(z)
10688 return true
10689 }
10690
10691
10692 for {
10693 x := v_0
10694 if x.Op != OpPPC64MOVBZload {
10695 break
10696 }
10697 v.copyOf(x)
10698 return true
10699 }
10700
10701
10702 for {
10703 x := v_0
10704 if x.Op != OpPPC64MOVBZloadidx {
10705 break
10706 }
10707 v.copyOf(x)
10708 return true
10709 }
10710
10711
10712 for {
10713 x := v_0
10714 if x.Op != OpPPC64MOVHZload {
10715 break
10716 }
10717 v.copyOf(x)
10718 return true
10719 }
10720
10721
10722 for {
10723 x := v_0
10724 if x.Op != OpPPC64MOVHZloadidx {
10725 break
10726 }
10727 v.copyOf(x)
10728 return true
10729 }
10730
10731
10732 for {
10733 x := v_0
10734 if x.Op != OpPPC64MOVWZload {
10735 break
10736 }
10737 v.copyOf(x)
10738 return true
10739 }
10740
10741
10742 for {
10743 x := v_0
10744 if x.Op != OpPPC64MOVWZloadidx {
10745 break
10746 }
10747 v.copyOf(x)
10748 return true
10749 }
10750
10751
10752 for {
10753 x := v_0
10754 if x.Op != OpSelect0 {
10755 break
10756 }
10757 x_0 := x.Args[0]
10758 if x_0.Op != OpPPC64LoweredAtomicLoad32 {
10759 break
10760 }
10761 v.copyOf(x)
10762 return true
10763 }
10764
10765
10766
10767 for {
10768 x := v_0
10769 if x.Op != OpArg {
10770 break
10771 }
10772 t := x.Type
10773 if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()) {
10774 break
10775 }
10776 v.copyOf(x)
10777 return true
10778 }
10779
10780
10781 for {
10782 if v_0.Op != OpPPC64MOVDconst {
10783 break
10784 }
10785 c := auxIntToInt64(v_0.AuxInt)
10786 v.reset(OpPPC64MOVDconst)
10787 v.AuxInt = int64ToAuxInt(int64(uint32(c)))
10788 return true
10789 }
10790 return false
10791 }
10792 func rewriteValuePPC64_OpPPC64MOVWload(v *Value) bool {
10793 v_1 := v.Args[1]
10794 v_0 := v.Args[0]
10795
10796
10797
10798 for {
10799 off1 := auxIntToInt32(v.AuxInt)
10800 sym1 := auxToSym(v.Aux)
10801 p := v_0
10802 if p.Op != OpPPC64MOVDaddr {
10803 break
10804 }
10805 off2 := auxIntToInt32(p.AuxInt)
10806 sym2 := auxToSym(p.Aux)
10807 ptr := p.Args[0]
10808 mem := v_1
10809 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
10810 break
10811 }
10812 v.reset(OpPPC64MOVWload)
10813 v.AuxInt = int32ToAuxInt(off1 + off2)
10814 v.Aux = symToAux(mergeSym(sym1, sym2))
10815 v.AddArg2(ptr, mem)
10816 return true
10817 }
10818
10819
10820
10821 for {
10822 off1 := auxIntToInt32(v.AuxInt)
10823 sym := auxToSym(v.Aux)
10824 if v_0.Op != OpPPC64ADDconst {
10825 break
10826 }
10827 off2 := auxIntToInt64(v_0.AuxInt)
10828 x := v_0.Args[0]
10829 mem := v_1
10830 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
10831 break
10832 }
10833 v.reset(OpPPC64MOVWload)
10834 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10835 v.Aux = symToAux(sym)
10836 v.AddArg2(x, mem)
10837 return true
10838 }
10839
10840
10841
10842 for {
10843 if auxIntToInt32(v.AuxInt) != 0 {
10844 break
10845 }
10846 sym := auxToSym(v.Aux)
10847 p := v_0
10848 if p.Op != OpPPC64ADD {
10849 break
10850 }
10851 idx := p.Args[1]
10852 ptr := p.Args[0]
10853 mem := v_1
10854 if !(sym == nil && p.Uses == 1) {
10855 break
10856 }
10857 v.reset(OpPPC64MOVWloadidx)
10858 v.AddArg3(ptr, idx, mem)
10859 return true
10860 }
10861 return false
10862 }
10863 func rewriteValuePPC64_OpPPC64MOVWloadidx(v *Value) bool {
10864 v_2 := v.Args[2]
10865 v_1 := v.Args[1]
10866 v_0 := v.Args[0]
10867
10868
10869
10870 for {
10871 ptr := v_0
10872 if v_1.Op != OpPPC64MOVDconst {
10873 break
10874 }
10875 c := auxIntToInt64(v_1.AuxInt)
10876 mem := v_2
10877 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10878 break
10879 }
10880 v.reset(OpPPC64MOVWload)
10881 v.AuxInt = int32ToAuxInt(int32(c))
10882 v.AddArg2(ptr, mem)
10883 return true
10884 }
10885
10886
10887
10888 for {
10889 if v_0.Op != OpPPC64MOVDconst {
10890 break
10891 }
10892 c := auxIntToInt64(v_0.AuxInt)
10893 ptr := v_1
10894 mem := v_2
10895 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10896 break
10897 }
10898 v.reset(OpPPC64MOVWload)
10899 v.AuxInt = int32ToAuxInt(int32(c))
10900 v.AddArg2(ptr, mem)
10901 return true
10902 }
10903 return false
10904 }
10905 func rewriteValuePPC64_OpPPC64MOVWreg(v *Value) bool {
10906 v_0 := v.Args[0]
10907 b := v.Block
10908 typ := &b.Func.Config.Types
10909
10910
10911
10912 for {
10913 y := v_0
10914 if y.Op != OpPPC64ANDconst {
10915 break
10916 }
10917 c := auxIntToInt64(y.AuxInt)
10918 if !(uint64(c) <= 0xFFFF) {
10919 break
10920 }
10921 v.copyOf(y)
10922 return true
10923 }
10924
10925
10926
10927 for {
10928 y := v_0
10929 if y.Op != OpPPC64AND {
10930 break
10931 }
10932 y_0 := y.Args[0]
10933 y_1 := y.Args[1]
10934 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
10935 if y_0.Op != OpPPC64MOVDconst {
10936 continue
10937 }
10938 c := auxIntToInt64(y_0.AuxInt)
10939 if !(uint64(c) <= 0x7FFFFFFF) {
10940 continue
10941 }
10942 v.copyOf(y)
10943 return true
10944 }
10945 break
10946 }
10947
10948
10949 for {
10950 if v_0.Op != OpPPC64SRAWconst {
10951 break
10952 }
10953 c := auxIntToInt64(v_0.AuxInt)
10954 v_0_0 := v_0.Args[0]
10955 if v_0_0.Op != OpPPC64MOVBreg {
10956 break
10957 }
10958 x := v_0_0.Args[0]
10959 v.reset(OpPPC64SRAWconst)
10960 v.AuxInt = int64ToAuxInt(c)
10961 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
10962 v0.AddArg(x)
10963 v.AddArg(v0)
10964 return true
10965 }
10966
10967
10968 for {
10969 if v_0.Op != OpPPC64SRAWconst {
10970 break
10971 }
10972 c := auxIntToInt64(v_0.AuxInt)
10973 v_0_0 := v_0.Args[0]
10974 if v_0_0.Op != OpPPC64MOVHreg {
10975 break
10976 }
10977 x := v_0_0.Args[0]
10978 v.reset(OpPPC64SRAWconst)
10979 v.AuxInt = int64ToAuxInt(c)
10980 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
10981 v0.AddArg(x)
10982 v.AddArg(v0)
10983 return true
10984 }
10985
10986
10987 for {
10988 if v_0.Op != OpPPC64SRAWconst {
10989 break
10990 }
10991 c := auxIntToInt64(v_0.AuxInt)
10992 v_0_0 := v_0.Args[0]
10993 if v_0_0.Op != OpPPC64MOVWreg {
10994 break
10995 }
10996 x := v_0_0.Args[0]
10997 v.reset(OpPPC64SRAWconst)
10998 v.AuxInt = int64ToAuxInt(c)
10999 v0 := b.NewValue0(v.Pos, OpPPC64MOVWreg, typ.Int64)
11000 v0.AddArg(x)
11001 v.AddArg(v0)
11002 return true
11003 }
11004
11005
11006
11007 for {
11008 if v_0.Op != OpPPC64SRAWconst {
11009 break
11010 }
11011 c := auxIntToInt64(v_0.AuxInt)
11012 x := v_0.Args[0]
11013 if !(x.Type.Size() <= 32) {
11014 break
11015 }
11016 v.reset(OpPPC64SRAWconst)
11017 v.AuxInt = int64ToAuxInt(c)
11018 v.AddArg(x)
11019 return true
11020 }
11021
11022
11023
11024 for {
11025 if v_0.Op != OpPPC64SRDconst {
11026 break
11027 }
11028 c := auxIntToInt64(v_0.AuxInt)
11029 x := v_0.Args[0]
11030 if !(c > 32) {
11031 break
11032 }
11033 v.reset(OpPPC64SRDconst)
11034 v.AuxInt = int64ToAuxInt(c)
11035 v.AddArg(x)
11036 return true
11037 }
11038
11039
11040
11041 for {
11042 if v_0.Op != OpPPC64SRADconst {
11043 break
11044 }
11045 c := auxIntToInt64(v_0.AuxInt)
11046 x := v_0.Args[0]
11047 if !(c >= 32) {
11048 break
11049 }
11050 v.reset(OpPPC64SRADconst)
11051 v.AuxInt = int64ToAuxInt(c)
11052 v.AddArg(x)
11053 return true
11054 }
11055
11056
11057
11058 for {
11059 if v_0.Op != OpPPC64SRDconst {
11060 break
11061 }
11062 c := auxIntToInt64(v_0.AuxInt)
11063 x := v_0.Args[0]
11064 if !(c == 32) {
11065 break
11066 }
11067 v.reset(OpPPC64SRADconst)
11068 v.AuxInt = int64ToAuxInt(c)
11069 v.AddArg(x)
11070 return true
11071 }
11072
11073
11074 for {
11075 y := v_0
11076 if y.Op != OpPPC64MOVWreg {
11077 break
11078 }
11079 v.copyOf(y)
11080 return true
11081 }
11082
11083
11084 for {
11085 y := v_0
11086 if y.Op != OpPPC64MOVHreg {
11087 break
11088 }
11089 v.copyOf(y)
11090 return true
11091 }
11092
11093
11094 for {
11095 y := v_0
11096 if y.Op != OpPPC64MOVBreg {
11097 break
11098 }
11099 v.copyOf(y)
11100 return true
11101 }
11102
11103
11104 for {
11105 y := v_0
11106 if y.Op != OpPPC64MOVWZreg {
11107 break
11108 }
11109 x := y.Args[0]
11110 v.reset(OpPPC64MOVWreg)
11111 v.AddArg(x)
11112 return true
11113 }
11114
11115
11116 for {
11117 x := v_0
11118 if x.Op != OpPPC64MOVHload {
11119 break
11120 }
11121 v.copyOf(x)
11122 return true
11123 }
11124
11125
11126 for {
11127 x := v_0
11128 if x.Op != OpPPC64MOVHloadidx {
11129 break
11130 }
11131 v.copyOf(x)
11132 return true
11133 }
11134
11135
11136 for {
11137 x := v_0
11138 if x.Op != OpPPC64MOVWload {
11139 break
11140 }
11141 v.copyOf(x)
11142 return true
11143 }
11144
11145
11146 for {
11147 x := v_0
11148 if x.Op != OpPPC64MOVWloadidx {
11149 break
11150 }
11151 v.copyOf(x)
11152 return true
11153 }
11154
11155
11156
11157 for {
11158 x := v_0
11159 if x.Op != OpArg {
11160 break
11161 }
11162 t := x.Type
11163 if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()) {
11164 break
11165 }
11166 v.copyOf(x)
11167 return true
11168 }
11169
11170
11171 for {
11172 if v_0.Op != OpPPC64MOVDconst {
11173 break
11174 }
11175 c := auxIntToInt64(v_0.AuxInt)
11176 v.reset(OpPPC64MOVDconst)
11177 v.AuxInt = int64ToAuxInt(int64(int32(c)))
11178 return true
11179 }
11180 return false
11181 }
11182 func rewriteValuePPC64_OpPPC64MOVWstore(v *Value) bool {
11183 v_2 := v.Args[2]
11184 v_1 := v.Args[1]
11185 v_0 := v.Args[0]
11186 b := v.Block
11187
11188
11189
11190 for {
11191 off1 := auxIntToInt32(v.AuxInt)
11192 sym := auxToSym(v.Aux)
11193 if v_0.Op != OpPPC64ADDconst {
11194 break
11195 }
11196 off2 := auxIntToInt64(v_0.AuxInt)
11197 x := v_0.Args[0]
11198 val := v_1
11199 mem := v_2
11200 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
11201 break
11202 }
11203 v.reset(OpPPC64MOVWstore)
11204 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
11205 v.Aux = symToAux(sym)
11206 v.AddArg3(x, val, mem)
11207 return true
11208 }
11209
11210
11211
11212 for {
11213 off1 := auxIntToInt32(v.AuxInt)
11214 sym1 := auxToSym(v.Aux)
11215 p := v_0
11216 if p.Op != OpPPC64MOVDaddr {
11217 break
11218 }
11219 off2 := auxIntToInt32(p.AuxInt)
11220 sym2 := auxToSym(p.Aux)
11221 ptr := p.Args[0]
11222 val := v_1
11223 mem := v_2
11224 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
11225 break
11226 }
11227 v.reset(OpPPC64MOVWstore)
11228 v.AuxInt = int32ToAuxInt(off1 + off2)
11229 v.Aux = symToAux(mergeSym(sym1, sym2))
11230 v.AddArg3(ptr, val, mem)
11231 return true
11232 }
11233
11234
11235 for {
11236 off := auxIntToInt32(v.AuxInt)
11237 sym := auxToSym(v.Aux)
11238 ptr := v_0
11239 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
11240 break
11241 }
11242 mem := v_2
11243 v.reset(OpPPC64MOVWstorezero)
11244 v.AuxInt = int32ToAuxInt(off)
11245 v.Aux = symToAux(sym)
11246 v.AddArg2(ptr, mem)
11247 return true
11248 }
11249
11250
11251
11252 for {
11253 if auxIntToInt32(v.AuxInt) != 0 {
11254 break
11255 }
11256 sym := auxToSym(v.Aux)
11257 p := v_0
11258 if p.Op != OpPPC64ADD {
11259 break
11260 }
11261 idx := p.Args[1]
11262 ptr := p.Args[0]
11263 val := v_1
11264 mem := v_2
11265 if !(sym == nil && p.Uses == 1) {
11266 break
11267 }
11268 v.reset(OpPPC64MOVWstoreidx)
11269 v.AddArg4(ptr, idx, val, mem)
11270 return true
11271 }
11272
11273
11274 for {
11275 off := auxIntToInt32(v.AuxInt)
11276 sym := auxToSym(v.Aux)
11277 ptr := v_0
11278 if v_1.Op != OpPPC64MOVWreg {
11279 break
11280 }
11281 x := v_1.Args[0]
11282 mem := v_2
11283 v.reset(OpPPC64MOVWstore)
11284 v.AuxInt = int32ToAuxInt(off)
11285 v.Aux = symToAux(sym)
11286 v.AddArg3(ptr, x, mem)
11287 return true
11288 }
11289
11290
11291 for {
11292 off := auxIntToInt32(v.AuxInt)
11293 sym := auxToSym(v.Aux)
11294 ptr := v_0
11295 if v_1.Op != OpPPC64MOVWZreg {
11296 break
11297 }
11298 x := v_1.Args[0]
11299 mem := v_2
11300 v.reset(OpPPC64MOVWstore)
11301 v.AuxInt = int32ToAuxInt(off)
11302 v.Aux = symToAux(sym)
11303 v.AddArg3(ptr, x, mem)
11304 return true
11305 }
11306
11307
11308
11309 for {
11310 off := auxIntToInt32(v.AuxInt)
11311 sym := auxToSym(v.Aux)
11312 ptr := v_0
11313 r := v_1
11314 if r.Op != OpPPC64BRW {
11315 break
11316 }
11317 val := r.Args[0]
11318 mem := v_2
11319 if !(r.Uses == 1) {
11320 break
11321 }
11322 v.reset(OpPPC64MOVWBRstore)
11323 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
11324 v0.AuxInt = int32ToAuxInt(off)
11325 v0.Aux = symToAux(sym)
11326 v0.AddArg(ptr)
11327 v.AddArg3(v0, val, mem)
11328 return true
11329 }
11330
11331
11332 for {
11333 off := auxIntToInt32(v.AuxInt)
11334 sym := auxToSym(v.Aux)
11335 ptr := v_0
11336 if v_1.Op != OpBswap32 {
11337 break
11338 }
11339 val := v_1.Args[0]
11340 mem := v_2
11341 v.reset(OpPPC64MOVWBRstore)
11342 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
11343 v0.AuxInt = int32ToAuxInt(off)
11344 v0.Aux = symToAux(sym)
11345 v0.AddArg(ptr)
11346 v.AddArg3(v0, val, mem)
11347 return true
11348 }
11349 return false
11350 }
11351 func rewriteValuePPC64_OpPPC64MOVWstoreidx(v *Value) bool {
11352 v_3 := v.Args[3]
11353 v_2 := v.Args[2]
11354 v_1 := v.Args[1]
11355 v_0 := v.Args[0]
11356
11357
11358
11359 for {
11360 ptr := v_0
11361 if v_1.Op != OpPPC64MOVDconst {
11362 break
11363 }
11364 c := auxIntToInt64(v_1.AuxInt)
11365 val := v_2
11366 mem := v_3
11367 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
11368 break
11369 }
11370 v.reset(OpPPC64MOVWstore)
11371 v.AuxInt = int32ToAuxInt(int32(c))
11372 v.AddArg3(ptr, val, mem)
11373 return true
11374 }
11375
11376
11377
11378 for {
11379 if v_0.Op != OpPPC64MOVDconst {
11380 break
11381 }
11382 c := auxIntToInt64(v_0.AuxInt)
11383 ptr := v_1
11384 val := v_2
11385 mem := v_3
11386 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
11387 break
11388 }
11389 v.reset(OpPPC64MOVWstore)
11390 v.AuxInt = int32ToAuxInt(int32(c))
11391 v.AddArg3(ptr, val, mem)
11392 return true
11393 }
11394
11395
11396 for {
11397 ptr := v_0
11398 idx := v_1
11399 if v_2.Op != OpPPC64MOVWreg {
11400 break
11401 }
11402 x := v_2.Args[0]
11403 mem := v_3
11404 v.reset(OpPPC64MOVWstoreidx)
11405 v.AddArg4(ptr, idx, x, mem)
11406 return true
11407 }
11408
11409
11410 for {
11411 ptr := v_0
11412 idx := v_1
11413 if v_2.Op != OpPPC64MOVWZreg {
11414 break
11415 }
11416 x := v_2.Args[0]
11417 mem := v_3
11418 v.reset(OpPPC64MOVWstoreidx)
11419 v.AddArg4(ptr, idx, x, mem)
11420 return true
11421 }
11422
11423
11424
11425 for {
11426 ptr := v_0
11427 idx := v_1
11428 r := v_2
11429 if r.Op != OpPPC64BRW {
11430 break
11431 }
11432 val := r.Args[0]
11433 mem := v_3
11434 if !(r.Uses == 1) {
11435 break
11436 }
11437 v.reset(OpPPC64MOVWBRstoreidx)
11438 v.AddArg4(ptr, idx, val, mem)
11439 return true
11440 }
11441
11442
11443 for {
11444 ptr := v_0
11445 idx := v_1
11446 if v_2.Op != OpBswap32 {
11447 break
11448 }
11449 val := v_2.Args[0]
11450 mem := v_3
11451 v.reset(OpPPC64MOVWBRstoreidx)
11452 v.AddArg4(ptr, idx, val, mem)
11453 return true
11454 }
11455 return false
11456 }
11457 func rewriteValuePPC64_OpPPC64MOVWstorezero(v *Value) bool {
11458 v_1 := v.Args[1]
11459 v_0 := v.Args[0]
11460
11461
11462
11463 for {
11464 off1 := auxIntToInt32(v.AuxInt)
11465 sym := auxToSym(v.Aux)
11466 if v_0.Op != OpPPC64ADDconst {
11467 break
11468 }
11469 off2 := auxIntToInt64(v_0.AuxInt)
11470 x := v_0.Args[0]
11471 mem := v_1
11472 if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
11473 break
11474 }
11475 v.reset(OpPPC64MOVWstorezero)
11476 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
11477 v.Aux = symToAux(sym)
11478 v.AddArg2(x, mem)
11479 return true
11480 }
11481
11482
11483
11484 for {
11485 off1 := auxIntToInt32(v.AuxInt)
11486 sym1 := auxToSym(v.Aux)
11487 p := v_0
11488 if p.Op != OpPPC64MOVDaddr {
11489 break
11490 }
11491 off2 := auxIntToInt32(p.AuxInt)
11492 sym2 := auxToSym(p.Aux)
11493 x := p.Args[0]
11494 mem := v_1
11495 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
11496 break
11497 }
11498 v.reset(OpPPC64MOVWstorezero)
11499 v.AuxInt = int32ToAuxInt(off1 + off2)
11500 v.Aux = symToAux(mergeSym(sym1, sym2))
11501 v.AddArg2(x, mem)
11502 return true
11503 }
11504 return false
11505 }
11506 func rewriteValuePPC64_OpPPC64MTVSRD(v *Value) bool {
11507 v_0 := v.Args[0]
11508 b := v.Block
11509 typ := &b.Func.Config.Types
11510
11511
11512
11513 for {
11514 if v_0.Op != OpPPC64MOVDconst {
11515 break
11516 }
11517 c := auxIntToInt64(v_0.AuxInt)
11518 if !(!math.IsNaN(math.Float64frombits(uint64(c)))) {
11519 break
11520 }
11521 v.reset(OpPPC64FMOVDconst)
11522 v.AuxInt = float64ToAuxInt(math.Float64frombits(uint64(c)))
11523 return true
11524 }
11525
11526
11527
11528 for {
11529 x := v_0
11530 if x.Op != OpPPC64MOVDload {
11531 break
11532 }
11533 off := auxIntToInt32(x.AuxInt)
11534 sym := auxToSym(x.Aux)
11535 mem := x.Args[1]
11536 ptr := x.Args[0]
11537 if !(x.Uses == 1 && clobber(x)) {
11538 break
11539 }
11540 b = x.Block
11541 v0 := b.NewValue0(x.Pos, OpPPC64FMOVDload, typ.Float64)
11542 v.copyOf(v0)
11543 v0.AuxInt = int32ToAuxInt(off)
11544 v0.Aux = symToAux(sym)
11545 v0.AddArg2(ptr, mem)
11546 return true
11547 }
11548 return false
11549 }
11550 func rewriteValuePPC64_OpPPC64MULLD(v *Value) bool {
11551 v_1 := v.Args[1]
11552 v_0 := v.Args[0]
11553
11554
11555
11556 for {
11557 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11558 x := v_0
11559 if v_1.Op != OpPPC64MOVDconst {
11560 continue
11561 }
11562 c := auxIntToInt64(v_1.AuxInt)
11563 if !(is16Bit(c)) {
11564 continue
11565 }
11566 v.reset(OpPPC64MULLDconst)
11567 v.AuxInt = int32ToAuxInt(int32(c))
11568 v.AddArg(x)
11569 return true
11570 }
11571 break
11572 }
11573 return false
11574 }
11575 func rewriteValuePPC64_OpPPC64MULLW(v *Value) bool {
11576 v_1 := v.Args[1]
11577 v_0 := v.Args[0]
11578
11579
11580
11581 for {
11582 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11583 x := v_0
11584 if v_1.Op != OpPPC64MOVDconst {
11585 continue
11586 }
11587 c := auxIntToInt64(v_1.AuxInt)
11588 if !(is16Bit(c)) {
11589 continue
11590 }
11591 v.reset(OpPPC64MULLWconst)
11592 v.AuxInt = int32ToAuxInt(int32(c))
11593 v.AddArg(x)
11594 return true
11595 }
11596 break
11597 }
11598 return false
11599 }
11600 func rewriteValuePPC64_OpPPC64NEG(v *Value) bool {
11601 v_0 := v.Args[0]
11602
11603
11604
11605 for {
11606 if v_0.Op != OpPPC64ADDconst {
11607 break
11608 }
11609 c := auxIntToInt64(v_0.AuxInt)
11610 x := v_0.Args[0]
11611 if !(is32Bit(-c)) {
11612 break
11613 }
11614 v.reset(OpPPC64SUBFCconst)
11615 v.AuxInt = int64ToAuxInt(-c)
11616 v.AddArg(x)
11617 return true
11618 }
11619
11620
11621
11622 for {
11623 if v_0.Op != OpPPC64SUBFCconst {
11624 break
11625 }
11626 c := auxIntToInt64(v_0.AuxInt)
11627 x := v_0.Args[0]
11628 if !(is32Bit(-c)) {
11629 break
11630 }
11631 v.reset(OpPPC64ADDconst)
11632 v.AuxInt = int64ToAuxInt(-c)
11633 v.AddArg(x)
11634 return true
11635 }
11636
11637
11638 for {
11639 if v_0.Op != OpPPC64SUB {
11640 break
11641 }
11642 y := v_0.Args[1]
11643 x := v_0.Args[0]
11644 v.reset(OpPPC64SUB)
11645 v.AddArg2(y, x)
11646 return true
11647 }
11648
11649
11650 for {
11651 if v_0.Op != OpPPC64NEG {
11652 break
11653 }
11654 x := v_0.Args[0]
11655 v.copyOf(x)
11656 return true
11657 }
11658 return false
11659 }
11660 func rewriteValuePPC64_OpPPC64NOR(v *Value) bool {
11661 v_1 := v.Args[1]
11662 v_0 := v.Args[0]
11663
11664
11665 for {
11666 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11667 if v_0.Op != OpPPC64MOVDconst {
11668 continue
11669 }
11670 c := auxIntToInt64(v_0.AuxInt)
11671 if v_1.Op != OpPPC64MOVDconst {
11672 continue
11673 }
11674 d := auxIntToInt64(v_1.AuxInt)
11675 v.reset(OpPPC64MOVDconst)
11676 v.AuxInt = int64ToAuxInt(^(c | d))
11677 return true
11678 }
11679 break
11680 }
11681 return false
11682 }
11683 func rewriteValuePPC64_OpPPC64NotEqual(v *Value) bool {
11684 v_0 := v.Args[0]
11685
11686
11687 for {
11688 if v_0.Op != OpPPC64FlagEQ {
11689 break
11690 }
11691 v.reset(OpPPC64MOVDconst)
11692 v.AuxInt = int64ToAuxInt(0)
11693 return true
11694 }
11695
11696
11697 for {
11698 if v_0.Op != OpPPC64FlagLT {
11699 break
11700 }
11701 v.reset(OpPPC64MOVDconst)
11702 v.AuxInt = int64ToAuxInt(1)
11703 return true
11704 }
11705
11706
11707 for {
11708 if v_0.Op != OpPPC64FlagGT {
11709 break
11710 }
11711 v.reset(OpPPC64MOVDconst)
11712 v.AuxInt = int64ToAuxInt(1)
11713 return true
11714 }
11715
11716
11717 for {
11718 if v_0.Op != OpPPC64InvertFlags {
11719 break
11720 }
11721 x := v_0.Args[0]
11722 v.reset(OpPPC64NotEqual)
11723 v.AddArg(x)
11724 return true
11725 }
11726
11727
11728 for {
11729 cmp := v_0
11730 v.reset(OpPPC64SETBCR)
11731 v.AuxInt = int32ToAuxInt(2)
11732 v.AddArg(cmp)
11733 return true
11734 }
11735 }
11736 func rewriteValuePPC64_OpPPC64OR(v *Value) bool {
11737 v_1 := v.Args[1]
11738 v_0 := v.Args[0]
11739
11740
11741 for {
11742 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11743 x := v_0
11744 if v_1.Op != OpPPC64NOR {
11745 continue
11746 }
11747 y := v_1.Args[1]
11748 if y != v_1.Args[0] {
11749 continue
11750 }
11751 v.reset(OpPPC64ORN)
11752 v.AddArg2(x, y)
11753 return true
11754 }
11755 break
11756 }
11757
11758
11759 for {
11760 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11761 if v_0.Op != OpPPC64MOVDconst {
11762 continue
11763 }
11764 c := auxIntToInt64(v_0.AuxInt)
11765 if v_1.Op != OpPPC64MOVDconst {
11766 continue
11767 }
11768 d := auxIntToInt64(v_1.AuxInt)
11769 v.reset(OpPPC64MOVDconst)
11770 v.AuxInt = int64ToAuxInt(c | d)
11771 return true
11772 }
11773 break
11774 }
11775
11776
11777
11778 for {
11779 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11780 x := v_0
11781 if v_1.Op != OpPPC64MOVDconst {
11782 continue
11783 }
11784 c := auxIntToInt64(v_1.AuxInt)
11785 if !(isU32Bit(c)) {
11786 continue
11787 }
11788 v.reset(OpPPC64ORconst)
11789 v.AuxInt = int64ToAuxInt(c)
11790 v.AddArg(x)
11791 return true
11792 }
11793 break
11794 }
11795 return false
11796 }
11797 func rewriteValuePPC64_OpPPC64ORN(v *Value) bool {
11798 v_1 := v.Args[1]
11799 v_0 := v.Args[0]
11800
11801
11802 for {
11803 x := v_0
11804 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
11805 break
11806 }
11807 v.copyOf(x)
11808 return true
11809 }
11810
11811
11812 for {
11813 if v_0.Op != OpPPC64MOVDconst {
11814 break
11815 }
11816 c := auxIntToInt64(v_0.AuxInt)
11817 if v_1.Op != OpPPC64MOVDconst {
11818 break
11819 }
11820 d := auxIntToInt64(v_1.AuxInt)
11821 v.reset(OpPPC64MOVDconst)
11822 v.AuxInt = int64ToAuxInt(c | ^d)
11823 return true
11824 }
11825 return false
11826 }
11827 func rewriteValuePPC64_OpPPC64ORconst(v *Value) bool {
11828 v_0 := v.Args[0]
11829
11830
11831 for {
11832 c := auxIntToInt64(v.AuxInt)
11833 if v_0.Op != OpPPC64ORconst {
11834 break
11835 }
11836 d := auxIntToInt64(v_0.AuxInt)
11837 x := v_0.Args[0]
11838 v.reset(OpPPC64ORconst)
11839 v.AuxInt = int64ToAuxInt(c | d)
11840 v.AddArg(x)
11841 return true
11842 }
11843
11844
11845 for {
11846 if auxIntToInt64(v.AuxInt) != -1 {
11847 break
11848 }
11849 v.reset(OpPPC64MOVDconst)
11850 v.AuxInt = int64ToAuxInt(-1)
11851 return true
11852 }
11853
11854
11855 for {
11856 if auxIntToInt64(v.AuxInt) != 0 {
11857 break
11858 }
11859 x := v_0
11860 v.copyOf(x)
11861 return true
11862 }
11863 return false
11864 }
11865 func rewriteValuePPC64_OpPPC64RLWINM(v *Value) bool {
11866 v_0 := v.Args[0]
11867
11868
11869
11870 for {
11871 r := auxIntToInt64(v.AuxInt)
11872 if v_0.Op != OpPPC64MOVHZreg {
11873 break
11874 }
11875 u := v_0.Args[0]
11876 if !(mergePPC64RlwinmAnd(r, 0xFFFF) != 0) {
11877 break
11878 }
11879 v.reset(OpPPC64RLWINM)
11880 v.AuxInt = int64ToAuxInt(mergePPC64RlwinmAnd(r, 0xFFFF))
11881 v.AddArg(u)
11882 return true
11883 }
11884
11885
11886
11887 for {
11888 r := auxIntToInt64(v.AuxInt)
11889 if v_0.Op != OpPPC64ANDconst {
11890 break
11891 }
11892 a := auxIntToInt64(v_0.AuxInt)
11893 u := v_0.Args[0]
11894 if !(mergePPC64RlwinmAnd(r, uint32(a)) != 0) {
11895 break
11896 }
11897 v.reset(OpPPC64RLWINM)
11898 v.AuxInt = int64ToAuxInt(mergePPC64RlwinmAnd(r, uint32(a)))
11899 v.AddArg(u)
11900 return true
11901 }
11902 return false
11903 }
11904 func rewriteValuePPC64_OpPPC64ROTL(v *Value) bool {
11905 v_1 := v.Args[1]
11906 v_0 := v.Args[0]
11907
11908
11909 for {
11910 x := v_0
11911 if v_1.Op != OpPPC64MOVDconst {
11912 break
11913 }
11914 c := auxIntToInt64(v_1.AuxInt)
11915 v.reset(OpPPC64ROTLconst)
11916 v.AuxInt = int64ToAuxInt(c & 63)
11917 v.AddArg(x)
11918 return true
11919 }
11920 return false
11921 }
11922 func rewriteValuePPC64_OpPPC64ROTLW(v *Value) bool {
11923 v_1 := v.Args[1]
11924 v_0 := v.Args[0]
11925
11926
11927 for {
11928 x := v_0
11929 if v_1.Op != OpPPC64MOVDconst {
11930 break
11931 }
11932 c := auxIntToInt64(v_1.AuxInt)
11933 v.reset(OpPPC64ROTLWconst)
11934 v.AuxInt = int64ToAuxInt(c & 31)
11935 v.AddArg(x)
11936 return true
11937 }
11938 return false
11939 }
11940 func rewriteValuePPC64_OpPPC64ROTLWconst(v *Value) bool {
11941 v_0 := v.Args[0]
11942
11943
11944
11945 for {
11946 r := auxIntToInt64(v.AuxInt)
11947 if v_0.Op != OpPPC64AND {
11948 break
11949 }
11950 _ = v_0.Args[1]
11951 v_0_0 := v_0.Args[0]
11952 v_0_1 := v_0.Args[1]
11953 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
11954 if v_0_0.Op != OpPPC64MOVDconst {
11955 continue
11956 }
11957 m := auxIntToInt64(v_0_0.AuxInt)
11958 x := v_0_1
11959 if !(isPPC64WordRotateMask(m)) {
11960 continue
11961 }
11962 v.reset(OpPPC64RLWINM)
11963 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
11964 v.AddArg(x)
11965 return true
11966 }
11967 break
11968 }
11969
11970
11971
11972 for {
11973 r := auxIntToInt64(v.AuxInt)
11974 if v_0.Op != OpPPC64ANDconst {
11975 break
11976 }
11977 m := auxIntToInt64(v_0.AuxInt)
11978 x := v_0.Args[0]
11979 if !(isPPC64WordRotateMask(m)) {
11980 break
11981 }
11982 v.reset(OpPPC64RLWINM)
11983 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
11984 v.AddArg(x)
11985 return true
11986 }
11987 return false
11988 }
11989 func rewriteValuePPC64_OpPPC64SETBC(v *Value) bool {
11990 v_0 := v.Args[0]
11991 b := v.Block
11992 typ := &b.Func.Config.Types
11993
11994
11995 for {
11996 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
11997 break
11998 }
11999 v.reset(OpPPC64MOVDconst)
12000 v.AuxInt = int64ToAuxInt(1)
12001 return true
12002 }
12003
12004
12005 for {
12006 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
12007 break
12008 }
12009 v.reset(OpPPC64MOVDconst)
12010 v.AuxInt = int64ToAuxInt(0)
12011 return true
12012 }
12013
12014
12015 for {
12016 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
12017 break
12018 }
12019 v.reset(OpPPC64MOVDconst)
12020 v.AuxInt = int64ToAuxInt(0)
12021 return true
12022 }
12023
12024
12025 for {
12026 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
12027 break
12028 }
12029 v.reset(OpPPC64MOVDconst)
12030 v.AuxInt = int64ToAuxInt(1)
12031 return true
12032 }
12033
12034
12035 for {
12036 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
12037 break
12038 }
12039 v.reset(OpPPC64MOVDconst)
12040 v.AuxInt = int64ToAuxInt(0)
12041 return true
12042 }
12043
12044
12045 for {
12046 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
12047 break
12048 }
12049 v.reset(OpPPC64MOVDconst)
12050 v.AuxInt = int64ToAuxInt(0)
12051 return true
12052 }
12053
12054
12055 for {
12056 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
12057 break
12058 }
12059 v.reset(OpPPC64MOVDconst)
12060 v.AuxInt = int64ToAuxInt(1)
12061 return true
12062 }
12063
12064
12065 for {
12066 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
12067 break
12068 }
12069 v.reset(OpPPC64MOVDconst)
12070 v.AuxInt = int64ToAuxInt(0)
12071 return true
12072 }
12073
12074
12075 for {
12076 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
12077 break
12078 }
12079 v.reset(OpPPC64MOVDconst)
12080 v.AuxInt = int64ToAuxInt(0)
12081 return true
12082 }
12083
12084
12085 for {
12086 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
12087 break
12088 }
12089 bool := v_0.Args[0]
12090 v.reset(OpPPC64SETBC)
12091 v.AuxInt = int32ToAuxInt(1)
12092 v.AddArg(bool)
12093 return true
12094 }
12095
12096
12097 for {
12098 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
12099 break
12100 }
12101 bool := v_0.Args[0]
12102 v.reset(OpPPC64SETBC)
12103 v.AuxInt = int32ToAuxInt(0)
12104 v.AddArg(bool)
12105 return true
12106 }
12107
12108
12109 for {
12110 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
12111 break
12112 }
12113 bool := v_0.Args[0]
12114 v.reset(OpPPC64SETBC)
12115 v.AuxInt = int32ToAuxInt(2)
12116 v.AddArg(bool)
12117 return true
12118 }
12119
12120
12121 for {
12122 n := auxIntToInt32(v.AuxInt)
12123 if v_0.Op != OpPPC64InvertFlags {
12124 break
12125 }
12126 bool := v_0.Args[0]
12127 v.reset(OpPPC64SETBCR)
12128 v.AuxInt = int32ToAuxInt(n)
12129 v.AddArg(bool)
12130 return true
12131 }
12132
12133
12134 for {
12135 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
12136 break
12137 }
12138 a := v_0.Args[0]
12139 if a.Op != OpPPC64ANDconst || auxIntToInt64(a.AuxInt) != 1 {
12140 break
12141 }
12142 v.reset(OpPPC64XORconst)
12143 v.AuxInt = int64ToAuxInt(1)
12144 v.AddArg(a)
12145 return true
12146 }
12147
12148
12149
12150 for {
12151 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
12152 break
12153 }
12154 a := v_0.Args[0]
12155 if a.Op != OpPPC64AND {
12156 break
12157 }
12158 z := a.Args[1]
12159 y := a.Args[0]
12160 if !(a.Uses == 1) {
12161 break
12162 }
12163 v.reset(OpPPC64SETBC)
12164 v.AuxInt = int32ToAuxInt(2)
12165 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12166 v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
12167 v1.AddArg2(y, z)
12168 v0.AddArg(v1)
12169 v.AddArg(v0)
12170 return true
12171 }
12172
12173
12174
12175 for {
12176 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
12177 break
12178 }
12179 o := v_0.Args[0]
12180 if o.Op != OpPPC64OR {
12181 break
12182 }
12183 z := o.Args[1]
12184 y := o.Args[0]
12185 if !(o.Uses == 1) {
12186 break
12187 }
12188 v.reset(OpPPC64SETBC)
12189 v.AuxInt = int32ToAuxInt(2)
12190 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12191 v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
12192 v1.AddArg2(y, z)
12193 v0.AddArg(v1)
12194 v.AddArg(v0)
12195 return true
12196 }
12197
12198
12199
12200 for {
12201 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
12202 break
12203 }
12204 a := v_0.Args[0]
12205 if a.Op != OpPPC64XOR {
12206 break
12207 }
12208 z := a.Args[1]
12209 y := a.Args[0]
12210 if !(a.Uses == 1) {
12211 break
12212 }
12213 v.reset(OpPPC64SETBC)
12214 v.AuxInt = int32ToAuxInt(2)
12215 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12216 v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
12217 v1.AddArg2(y, z)
12218 v0.AddArg(v1)
12219 v.AddArg(v0)
12220 return true
12221 }
12222 return false
12223 }
12224 func rewriteValuePPC64_OpPPC64SETBCR(v *Value) bool {
12225 v_0 := v.Args[0]
12226 b := v.Block
12227 typ := &b.Func.Config.Types
12228
12229
12230 for {
12231 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
12232 break
12233 }
12234 v.reset(OpPPC64MOVDconst)
12235 v.AuxInt = int64ToAuxInt(0)
12236 return true
12237 }
12238
12239
12240 for {
12241 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
12242 break
12243 }
12244 v.reset(OpPPC64MOVDconst)
12245 v.AuxInt = int64ToAuxInt(1)
12246 return true
12247 }
12248
12249
12250 for {
12251 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
12252 break
12253 }
12254 v.reset(OpPPC64MOVDconst)
12255 v.AuxInt = int64ToAuxInt(1)
12256 return true
12257 }
12258
12259
12260 for {
12261 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
12262 break
12263 }
12264 v.reset(OpPPC64MOVDconst)
12265 v.AuxInt = int64ToAuxInt(0)
12266 return true
12267 }
12268
12269
12270 for {
12271 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
12272 break
12273 }
12274 v.reset(OpPPC64MOVDconst)
12275 v.AuxInt = int64ToAuxInt(1)
12276 return true
12277 }
12278
12279
12280 for {
12281 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
12282 break
12283 }
12284 v.reset(OpPPC64MOVDconst)
12285 v.AuxInt = int64ToAuxInt(1)
12286 return true
12287 }
12288
12289
12290 for {
12291 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
12292 break
12293 }
12294 v.reset(OpPPC64MOVDconst)
12295 v.AuxInt = int64ToAuxInt(0)
12296 return true
12297 }
12298
12299
12300 for {
12301 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
12302 break
12303 }
12304 v.reset(OpPPC64MOVDconst)
12305 v.AuxInt = int64ToAuxInt(1)
12306 return true
12307 }
12308
12309
12310 for {
12311 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
12312 break
12313 }
12314 v.reset(OpPPC64MOVDconst)
12315 v.AuxInt = int64ToAuxInt(1)
12316 return true
12317 }
12318
12319
12320 for {
12321 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
12322 break
12323 }
12324 bool := v_0.Args[0]
12325 v.reset(OpPPC64SETBCR)
12326 v.AuxInt = int32ToAuxInt(1)
12327 v.AddArg(bool)
12328 return true
12329 }
12330
12331
12332 for {
12333 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
12334 break
12335 }
12336 bool := v_0.Args[0]
12337 v.reset(OpPPC64SETBCR)
12338 v.AuxInt = int32ToAuxInt(0)
12339 v.AddArg(bool)
12340 return true
12341 }
12342
12343
12344 for {
12345 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
12346 break
12347 }
12348 bool := v_0.Args[0]
12349 v.reset(OpPPC64SETBCR)
12350 v.AuxInt = int32ToAuxInt(2)
12351 v.AddArg(bool)
12352 return true
12353 }
12354
12355
12356 for {
12357 n := auxIntToInt32(v.AuxInt)
12358 if v_0.Op != OpPPC64InvertFlags {
12359 break
12360 }
12361 bool := v_0.Args[0]
12362 v.reset(OpPPC64SETBC)
12363 v.AuxInt = int32ToAuxInt(n)
12364 v.AddArg(bool)
12365 return true
12366 }
12367
12368
12369 for {
12370 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
12371 break
12372 }
12373 a := v_0.Args[0]
12374 if a.Op != OpPPC64ANDconst || auxIntToInt64(a.AuxInt) != 1 {
12375 break
12376 }
12377 v.copyOf(a)
12378 return true
12379 }
12380
12381
12382
12383 for {
12384 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
12385 break
12386 }
12387 a := v_0.Args[0]
12388 if a.Op != OpPPC64AND {
12389 break
12390 }
12391 z := a.Args[1]
12392 y := a.Args[0]
12393 if !(a.Uses == 1) {
12394 break
12395 }
12396 v.reset(OpPPC64SETBCR)
12397 v.AuxInt = int32ToAuxInt(2)
12398 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12399 v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
12400 v1.AddArg2(y, z)
12401 v0.AddArg(v1)
12402 v.AddArg(v0)
12403 return true
12404 }
12405
12406
12407
12408 for {
12409 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
12410 break
12411 }
12412 o := v_0.Args[0]
12413 if o.Op != OpPPC64OR {
12414 break
12415 }
12416 z := o.Args[1]
12417 y := o.Args[0]
12418 if !(o.Uses == 1) {
12419 break
12420 }
12421 v.reset(OpPPC64SETBCR)
12422 v.AuxInt = int32ToAuxInt(2)
12423 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12424 v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
12425 v1.AddArg2(y, z)
12426 v0.AddArg(v1)
12427 v.AddArg(v0)
12428 return true
12429 }
12430
12431
12432
12433 for {
12434 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
12435 break
12436 }
12437 a := v_0.Args[0]
12438 if a.Op != OpPPC64XOR {
12439 break
12440 }
12441 z := a.Args[1]
12442 y := a.Args[0]
12443 if !(a.Uses == 1) {
12444 break
12445 }
12446 v.reset(OpPPC64SETBCR)
12447 v.AuxInt = int32ToAuxInt(2)
12448 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12449 v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
12450 v1.AddArg2(y, z)
12451 v0.AddArg(v1)
12452 v.AddArg(v0)
12453 return true
12454 }
12455 return false
12456 }
12457 func rewriteValuePPC64_OpPPC64SLD(v *Value) bool {
12458 v_1 := v.Args[1]
12459 v_0 := v.Args[0]
12460
12461
12462 for {
12463 x := v_0
12464 if v_1.Op != OpPPC64MOVDconst {
12465 break
12466 }
12467 c := auxIntToInt64(v_1.AuxInt)
12468 v.reset(OpPPC64SLDconst)
12469 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
12470 v.AddArg(x)
12471 return true
12472 }
12473 return false
12474 }
12475 func rewriteValuePPC64_OpPPC64SLDconst(v *Value) bool {
12476 v_0 := v.Args[0]
12477
12478
12479
12480 for {
12481 l := auxIntToInt64(v.AuxInt)
12482 if v_0.Op != OpPPC64SRWconst {
12483 break
12484 }
12485 r := auxIntToInt64(v_0.AuxInt)
12486 x := v_0.Args[0]
12487 if !(mergePPC64SldiSrw(l, r) != 0) {
12488 break
12489 }
12490 v.reset(OpPPC64RLWINM)
12491 v.AuxInt = int64ToAuxInt(mergePPC64SldiSrw(l, r))
12492 v.AddArg(x)
12493 return true
12494 }
12495
12496
12497
12498 for {
12499 s := auxIntToInt64(v.AuxInt)
12500 if v_0.Op != OpPPC64RLWINM {
12501 break
12502 }
12503 r := auxIntToInt64(v_0.AuxInt)
12504 y := v_0.Args[0]
12505 if !(mergePPC64SldiRlwinm(s, r) != 0) {
12506 break
12507 }
12508 v.reset(OpPPC64RLWINM)
12509 v.AuxInt = int64ToAuxInt(mergePPC64SldiRlwinm(s, r))
12510 v.AddArg(y)
12511 return true
12512 }
12513
12514
12515
12516 for {
12517 c := auxIntToInt64(v.AuxInt)
12518 z := v_0
12519 if z.Op != OpPPC64MOVBZreg {
12520 break
12521 }
12522 x := z.Args[0]
12523 if !(c < 8 && z.Uses == 1) {
12524 break
12525 }
12526 v.reset(OpPPC64CLRLSLDI)
12527 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 56, 63, 64))
12528 v.AddArg(x)
12529 return true
12530 }
12531
12532
12533
12534 for {
12535 c := auxIntToInt64(v.AuxInt)
12536 z := v_0
12537 if z.Op != OpPPC64MOVHZreg {
12538 break
12539 }
12540 x := z.Args[0]
12541 if !(c < 16 && z.Uses == 1) {
12542 break
12543 }
12544 v.reset(OpPPC64CLRLSLDI)
12545 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 48, 63, 64))
12546 v.AddArg(x)
12547 return true
12548 }
12549
12550
12551
12552 for {
12553 c := auxIntToInt64(v.AuxInt)
12554 z := v_0
12555 if z.Op != OpPPC64MOVWZreg {
12556 break
12557 }
12558 x := z.Args[0]
12559 if !(c < 32 && z.Uses == 1) {
12560 break
12561 }
12562 v.reset(OpPPC64CLRLSLDI)
12563 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32, 63, 64))
12564 v.AddArg(x)
12565 return true
12566 }
12567
12568
12569
12570 for {
12571 c := auxIntToInt64(v.AuxInt)
12572 z := v_0
12573 if z.Op != OpPPC64ANDconst {
12574 break
12575 }
12576 d := auxIntToInt64(z.AuxInt)
12577 x := z.Args[0]
12578 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
12579 break
12580 }
12581 v.reset(OpPPC64CLRLSLDI)
12582 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
12583 v.AddArg(x)
12584 return true
12585 }
12586
12587
12588
12589 for {
12590 c := auxIntToInt64(v.AuxInt)
12591 z := v_0
12592 if z.Op != OpPPC64AND {
12593 break
12594 }
12595 _ = z.Args[1]
12596 z_0 := z.Args[0]
12597 z_1 := z.Args[1]
12598 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
12599 if z_0.Op != OpPPC64MOVDconst {
12600 continue
12601 }
12602 d := auxIntToInt64(z_0.AuxInt)
12603 x := z_1
12604 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
12605 continue
12606 }
12607 v.reset(OpPPC64CLRLSLDI)
12608 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
12609 v.AddArg(x)
12610 return true
12611 }
12612 break
12613 }
12614
12615
12616
12617 for {
12618 c := auxIntToInt64(v.AuxInt)
12619 z := v_0
12620 if z.Op != OpPPC64MOVWreg {
12621 break
12622 }
12623 x := z.Args[0]
12624 if !(c < 32 && buildcfg.GOPPC64 >= 9) {
12625 break
12626 }
12627 v.reset(OpPPC64EXTSWSLconst)
12628 v.AuxInt = int64ToAuxInt(c)
12629 v.AddArg(x)
12630 return true
12631 }
12632 return false
12633 }
12634 func rewriteValuePPC64_OpPPC64SLW(v *Value) bool {
12635 v_1 := v.Args[1]
12636 v_0 := v.Args[0]
12637
12638
12639 for {
12640 x := v_0
12641 if v_1.Op != OpPPC64MOVDconst {
12642 break
12643 }
12644 c := auxIntToInt64(v_1.AuxInt)
12645 v.reset(OpPPC64SLWconst)
12646 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
12647 v.AddArg(x)
12648 return true
12649 }
12650 return false
12651 }
12652 func rewriteValuePPC64_OpPPC64SLWconst(v *Value) bool {
12653 v_0 := v.Args[0]
12654
12655
12656 for {
12657 s := auxIntToInt64(v.AuxInt)
12658 if v_0.Op != OpPPC64MOVWZreg {
12659 break
12660 }
12661 w := v_0.Args[0]
12662 v.reset(OpPPC64SLWconst)
12663 v.AuxInt = int64ToAuxInt(s)
12664 v.AddArg(w)
12665 return true
12666 }
12667
12668
12669
12670 for {
12671 c := auxIntToInt64(v.AuxInt)
12672 z := v_0
12673 if z.Op != OpPPC64MOVBZreg {
12674 break
12675 }
12676 x := z.Args[0]
12677 if !(z.Uses == 1 && c < 8) {
12678 break
12679 }
12680 v.reset(OpPPC64CLRLSLWI)
12681 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 24, 31, 32))
12682 v.AddArg(x)
12683 return true
12684 }
12685
12686
12687
12688 for {
12689 c := auxIntToInt64(v.AuxInt)
12690 z := v_0
12691 if z.Op != OpPPC64MOVHZreg {
12692 break
12693 }
12694 x := z.Args[0]
12695 if !(z.Uses == 1 && c < 16) {
12696 break
12697 }
12698 v.reset(OpPPC64CLRLSLWI)
12699 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 16, 31, 32))
12700 v.AddArg(x)
12701 return true
12702 }
12703
12704
12705
12706 for {
12707 c := auxIntToInt64(v.AuxInt)
12708 z := v_0
12709 if z.Op != OpPPC64ANDconst {
12710 break
12711 }
12712 d := auxIntToInt64(z.AuxInt)
12713 x := z.Args[0]
12714 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
12715 break
12716 }
12717 v.reset(OpPPC64CLRLSLWI)
12718 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
12719 v.AddArg(x)
12720 return true
12721 }
12722
12723
12724
12725 for {
12726 c := auxIntToInt64(v.AuxInt)
12727 z := v_0
12728 if z.Op != OpPPC64AND {
12729 break
12730 }
12731 _ = z.Args[1]
12732 z_0 := z.Args[0]
12733 z_1 := z.Args[1]
12734 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
12735 if z_0.Op != OpPPC64MOVDconst {
12736 continue
12737 }
12738 d := auxIntToInt64(z_0.AuxInt)
12739 x := z_1
12740 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
12741 continue
12742 }
12743 v.reset(OpPPC64CLRLSLWI)
12744 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
12745 v.AddArg(x)
12746 return true
12747 }
12748 break
12749 }
12750
12751
12752
12753 for {
12754 c := auxIntToInt64(v.AuxInt)
12755 z := v_0
12756 if z.Op != OpPPC64MOVWreg {
12757 break
12758 }
12759 x := z.Args[0]
12760 if !(c < 32 && buildcfg.GOPPC64 >= 9) {
12761 break
12762 }
12763 v.reset(OpPPC64EXTSWSLconst)
12764 v.AuxInt = int64ToAuxInt(c)
12765 v.AddArg(x)
12766 return true
12767 }
12768 return false
12769 }
12770 func rewriteValuePPC64_OpPPC64SRAD(v *Value) bool {
12771 v_1 := v.Args[1]
12772 v_0 := v.Args[0]
12773
12774
12775 for {
12776 x := v_0
12777 if v_1.Op != OpPPC64MOVDconst {
12778 break
12779 }
12780 c := auxIntToInt64(v_1.AuxInt)
12781 v.reset(OpPPC64SRADconst)
12782 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
12783 v.AddArg(x)
12784 return true
12785 }
12786 return false
12787 }
12788 func rewriteValuePPC64_OpPPC64SRAW(v *Value) bool {
12789 v_1 := v.Args[1]
12790 v_0 := v.Args[0]
12791
12792
12793 for {
12794 x := v_0
12795 if v_1.Op != OpPPC64MOVDconst {
12796 break
12797 }
12798 c := auxIntToInt64(v_1.AuxInt)
12799 v.reset(OpPPC64SRAWconst)
12800 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
12801 v.AddArg(x)
12802 return true
12803 }
12804 return false
12805 }
12806 func rewriteValuePPC64_OpPPC64SRD(v *Value) bool {
12807 v_1 := v.Args[1]
12808 v_0 := v.Args[0]
12809
12810
12811 for {
12812 x := v_0
12813 if v_1.Op != OpPPC64MOVDconst {
12814 break
12815 }
12816 c := auxIntToInt64(v_1.AuxInt)
12817 v.reset(OpPPC64SRDconst)
12818 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
12819 v.AddArg(x)
12820 return true
12821 }
12822 return false
12823 }
12824 func rewriteValuePPC64_OpPPC64SRW(v *Value) bool {
12825 v_1 := v.Args[1]
12826 v_0 := v.Args[0]
12827
12828
12829 for {
12830 x := v_0
12831 if v_1.Op != OpPPC64MOVDconst {
12832 break
12833 }
12834 c := auxIntToInt64(v_1.AuxInt)
12835 v.reset(OpPPC64SRWconst)
12836 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
12837 v.AddArg(x)
12838 return true
12839 }
12840 return false
12841 }
12842 func rewriteValuePPC64_OpPPC64SRWconst(v *Value) bool {
12843 v_0 := v.Args[0]
12844
12845
12846
12847 for {
12848 s := auxIntToInt64(v.AuxInt)
12849 if v_0.Op != OpPPC64ANDconst {
12850 break
12851 }
12852 m := auxIntToInt64(v_0.AuxInt)
12853 if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
12854 break
12855 }
12856 v.reset(OpPPC64MOVDconst)
12857 v.AuxInt = int64ToAuxInt(0)
12858 return true
12859 }
12860
12861
12862
12863 for {
12864 s := auxIntToInt64(v.AuxInt)
12865 if v_0.Op != OpPPC64ANDconst {
12866 break
12867 }
12868 m := auxIntToInt64(v_0.AuxInt)
12869 x := v_0.Args[0]
12870 if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
12871 break
12872 }
12873 v.reset(OpPPC64RLWINM)
12874 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
12875 v.AddArg(x)
12876 return true
12877 }
12878
12879
12880
12881 for {
12882 s := auxIntToInt64(v.AuxInt)
12883 if v_0.Op != OpPPC64AND {
12884 break
12885 }
12886 _ = v_0.Args[1]
12887 v_0_0 := v_0.Args[0]
12888 v_0_1 := v_0.Args[1]
12889 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
12890 if v_0_0.Op != OpPPC64MOVDconst {
12891 continue
12892 }
12893 m := auxIntToInt64(v_0_0.AuxInt)
12894 if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
12895 continue
12896 }
12897 v.reset(OpPPC64MOVDconst)
12898 v.AuxInt = int64ToAuxInt(0)
12899 return true
12900 }
12901 break
12902 }
12903
12904
12905
12906 for {
12907 s := auxIntToInt64(v.AuxInt)
12908 if v_0.Op != OpPPC64AND {
12909 break
12910 }
12911 _ = v_0.Args[1]
12912 v_0_0 := v_0.Args[0]
12913 v_0_1 := v_0.Args[1]
12914 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
12915 if v_0_0.Op != OpPPC64MOVDconst {
12916 continue
12917 }
12918 m := auxIntToInt64(v_0_0.AuxInt)
12919 x := v_0_1
12920 if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
12921 continue
12922 }
12923 v.reset(OpPPC64RLWINM)
12924 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
12925 v.AddArg(x)
12926 return true
12927 }
12928 break
12929 }
12930 return false
12931 }
12932 func rewriteValuePPC64_OpPPC64SUB(v *Value) bool {
12933 v_1 := v.Args[1]
12934 v_0 := v.Args[0]
12935
12936
12937
12938 for {
12939 x := v_0
12940 if v_1.Op != OpPPC64MOVDconst {
12941 break
12942 }
12943 c := auxIntToInt64(v_1.AuxInt)
12944 if !(is32Bit(-c)) {
12945 break
12946 }
12947 v.reset(OpPPC64ADDconst)
12948 v.AuxInt = int64ToAuxInt(-c)
12949 v.AddArg(x)
12950 return true
12951 }
12952
12953
12954
12955 for {
12956 if v_0.Op != OpPPC64MOVDconst {
12957 break
12958 }
12959 c := auxIntToInt64(v_0.AuxInt)
12960 x := v_1
12961 if !(is32Bit(c)) {
12962 break
12963 }
12964 v.reset(OpPPC64SUBFCconst)
12965 v.AuxInt = int64ToAuxInt(c)
12966 v.AddArg(x)
12967 return true
12968 }
12969 return false
12970 }
12971 func rewriteValuePPC64_OpPPC64SUBE(v *Value) bool {
12972 v_2 := v.Args[2]
12973 v_1 := v.Args[1]
12974 v_0 := v.Args[0]
12975 b := v.Block
12976 typ := &b.Func.Config.Types
12977
12978
12979 for {
12980 x := v_0
12981 y := v_1
12982 if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
12983 break
12984 }
12985 v_2_0 := v_2.Args[0]
12986 if v_2_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_2_0.AuxInt) != 0 {
12987 break
12988 }
12989 v_2_0_0 := v_2_0.Args[0]
12990 if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
12991 break
12992 }
12993 v.reset(OpPPC64SUBC)
12994 v.AddArg2(x, y)
12995 return true
12996 }
12997 return false
12998 }
12999 func rewriteValuePPC64_OpPPC64SUBFCconst(v *Value) bool {
13000 v_0 := v.Args[0]
13001
13002
13003 for {
13004 c := auxIntToInt64(v.AuxInt)
13005 if v_0.Op != OpPPC64NEG {
13006 break
13007 }
13008 x := v_0.Args[0]
13009 v.reset(OpPPC64ADDconst)
13010 v.AuxInt = int64ToAuxInt(c)
13011 v.AddArg(x)
13012 return true
13013 }
13014
13015
13016
13017 for {
13018 c := auxIntToInt64(v.AuxInt)
13019 if v_0.Op != OpPPC64SUBFCconst {
13020 break
13021 }
13022 d := auxIntToInt64(v_0.AuxInt)
13023 x := v_0.Args[0]
13024 if !(is32Bit(c - d)) {
13025 break
13026 }
13027 v.reset(OpPPC64ADDconst)
13028 v.AuxInt = int64ToAuxInt(c - d)
13029 v.AddArg(x)
13030 return true
13031 }
13032
13033
13034 for {
13035 if auxIntToInt64(v.AuxInt) != 0 {
13036 break
13037 }
13038 x := v_0
13039 v.reset(OpPPC64NEG)
13040 v.AddArg(x)
13041 return true
13042 }
13043 return false
13044 }
13045 func rewriteValuePPC64_OpPPC64XOR(v *Value) bool {
13046 v_1 := v.Args[1]
13047 v_0 := v.Args[0]
13048
13049
13050 for {
13051 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13052 if v_0.Op != OpPPC64MOVDconst {
13053 continue
13054 }
13055 c := auxIntToInt64(v_0.AuxInt)
13056 if v_1.Op != OpPPC64MOVDconst {
13057 continue
13058 }
13059 d := auxIntToInt64(v_1.AuxInt)
13060 v.reset(OpPPC64MOVDconst)
13061 v.AuxInt = int64ToAuxInt(c ^ d)
13062 return true
13063 }
13064 break
13065 }
13066
13067
13068
13069 for {
13070 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13071 x := v_0
13072 if v_1.Op != OpPPC64MOVDconst {
13073 continue
13074 }
13075 c := auxIntToInt64(v_1.AuxInt)
13076 if !(isU32Bit(c)) {
13077 continue
13078 }
13079 v.reset(OpPPC64XORconst)
13080 v.AuxInt = int64ToAuxInt(c)
13081 v.AddArg(x)
13082 return true
13083 }
13084 break
13085 }
13086 return false
13087 }
13088 func rewriteValuePPC64_OpPPC64XORconst(v *Value) bool {
13089 v_0 := v.Args[0]
13090
13091
13092 for {
13093 c := auxIntToInt64(v.AuxInt)
13094 if v_0.Op != OpPPC64XORconst {
13095 break
13096 }
13097 d := auxIntToInt64(v_0.AuxInt)
13098 x := v_0.Args[0]
13099 v.reset(OpPPC64XORconst)
13100 v.AuxInt = int64ToAuxInt(c ^ d)
13101 v.AddArg(x)
13102 return true
13103 }
13104
13105
13106 for {
13107 if auxIntToInt64(v.AuxInt) != 0 {
13108 break
13109 }
13110 x := v_0
13111 v.copyOf(x)
13112 return true
13113 }
13114
13115
13116 for {
13117 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBCR {
13118 break
13119 }
13120 n := auxIntToInt32(v_0.AuxInt)
13121 cmp := v_0.Args[0]
13122 v.reset(OpPPC64SETBC)
13123 v.AuxInt = int32ToAuxInt(n)
13124 v.AddArg(cmp)
13125 return true
13126 }
13127
13128
13129 for {
13130 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBC {
13131 break
13132 }
13133 n := auxIntToInt32(v_0.AuxInt)
13134 cmp := v_0.Args[0]
13135 v.reset(OpPPC64SETBCR)
13136 v.AuxInt = int32ToAuxInt(n)
13137 v.AddArg(cmp)
13138 return true
13139 }
13140 return false
13141 }
13142 func rewriteValuePPC64_OpPopCount16(v *Value) bool {
13143 v_0 := v.Args[0]
13144 b := v.Block
13145 typ := &b.Func.Config.Types
13146
13147
13148 for {
13149 x := v_0
13150 v.reset(OpPPC64POPCNTW)
13151 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13152 v0.AddArg(x)
13153 v.AddArg(v0)
13154 return true
13155 }
13156 }
13157 func rewriteValuePPC64_OpPopCount32(v *Value) bool {
13158 v_0 := v.Args[0]
13159 b := v.Block
13160 typ := &b.Func.Config.Types
13161
13162
13163 for {
13164 x := v_0
13165 v.reset(OpPPC64POPCNTW)
13166 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
13167 v0.AddArg(x)
13168 v.AddArg(v0)
13169 return true
13170 }
13171 }
13172 func rewriteValuePPC64_OpPopCount8(v *Value) bool {
13173 v_0 := v.Args[0]
13174 b := v.Block
13175 typ := &b.Func.Config.Types
13176
13177
13178 for {
13179 x := v_0
13180 v.reset(OpPPC64POPCNTB)
13181 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
13182 v0.AddArg(x)
13183 v.AddArg(v0)
13184 return true
13185 }
13186 }
13187 func rewriteValuePPC64_OpPrefetchCache(v *Value) bool {
13188 v_1 := v.Args[1]
13189 v_0 := v.Args[0]
13190
13191
13192 for {
13193 ptr := v_0
13194 mem := v_1
13195 v.reset(OpPPC64DCBT)
13196 v.AuxInt = int64ToAuxInt(0)
13197 v.AddArg2(ptr, mem)
13198 return true
13199 }
13200 }
13201 func rewriteValuePPC64_OpPrefetchCacheStreamed(v *Value) bool {
13202 v_1 := v.Args[1]
13203 v_0 := v.Args[0]
13204
13205
13206 for {
13207 ptr := v_0
13208 mem := v_1
13209 v.reset(OpPPC64DCBT)
13210 v.AuxInt = int64ToAuxInt(16)
13211 v.AddArg2(ptr, mem)
13212 return true
13213 }
13214 }
13215 func rewriteValuePPC64_OpRotateLeft16(v *Value) bool {
13216 v_1 := v.Args[1]
13217 v_0 := v.Args[0]
13218 b := v.Block
13219 typ := &b.Func.Config.Types
13220
13221
13222 for {
13223 t := v.Type
13224 x := v_0
13225 if v_1.Op != OpPPC64MOVDconst {
13226 break
13227 }
13228 c := auxIntToInt64(v_1.AuxInt)
13229 v.reset(OpOr16)
13230 v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
13231 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13232 v1.AuxInt = int64ToAuxInt(c & 15)
13233 v0.AddArg2(x, v1)
13234 v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
13235 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13236 v3.AuxInt = int64ToAuxInt(-c & 15)
13237 v2.AddArg2(x, v3)
13238 v.AddArg2(v0, v2)
13239 return true
13240 }
13241 return false
13242 }
13243 func rewriteValuePPC64_OpRotateLeft8(v *Value) bool {
13244 v_1 := v.Args[1]
13245 v_0 := v.Args[0]
13246 b := v.Block
13247 typ := &b.Func.Config.Types
13248
13249
13250 for {
13251 t := v.Type
13252 x := v_0
13253 if v_1.Op != OpPPC64MOVDconst {
13254 break
13255 }
13256 c := auxIntToInt64(v_1.AuxInt)
13257 v.reset(OpOr8)
13258 v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
13259 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13260 v1.AuxInt = int64ToAuxInt(c & 7)
13261 v0.AddArg2(x, v1)
13262 v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
13263 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13264 v3.AuxInt = int64ToAuxInt(-c & 7)
13265 v2.AddArg2(x, v3)
13266 v.AddArg2(v0, v2)
13267 return true
13268 }
13269 return false
13270 }
13271 func rewriteValuePPC64_OpRsh16Ux16(v *Value) bool {
13272 v_1 := v.Args[1]
13273 v_0 := v.Args[0]
13274 b := v.Block
13275 typ := &b.Func.Config.Types
13276
13277
13278
13279 for {
13280 x := v_0
13281 y := v_1
13282 if !(shiftIsBounded(v)) {
13283 break
13284 }
13285 v.reset(OpPPC64SRD)
13286 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13287 v0.AddArg(x)
13288 v.AddArg2(v0, y)
13289 return true
13290 }
13291
13292
13293 for {
13294 t := v.Type
13295 x := v_0
13296 y := v_1
13297 v.reset(OpPPC64ISEL)
13298 v.AuxInt = int32ToAuxInt(2)
13299 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13300 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13301 v1.AddArg(x)
13302 v0.AddArg2(v1, y)
13303 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13304 v2.AuxInt = int64ToAuxInt(0)
13305 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13306 v3.AuxInt = int64ToAuxInt(0)
13307 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13308 v4.AuxInt = int64ToAuxInt(0xFFF0)
13309 v4.AddArg(y)
13310 v3.AddArg(v4)
13311 v.AddArg3(v0, v2, v3)
13312 return true
13313 }
13314 }
13315 func rewriteValuePPC64_OpRsh16Ux32(v *Value) bool {
13316 v_1 := v.Args[1]
13317 v_0 := v.Args[0]
13318 b := v.Block
13319 typ := &b.Func.Config.Types
13320
13321
13322
13323 for {
13324 x := v_0
13325 y := v_1
13326 if !(shiftIsBounded(v)) {
13327 break
13328 }
13329 v.reset(OpPPC64SRD)
13330 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13331 v0.AddArg(x)
13332 v.AddArg2(v0, y)
13333 return true
13334 }
13335
13336
13337 for {
13338 t := v.Type
13339 x := v_0
13340 y := v_1
13341 v.reset(OpPPC64ISEL)
13342 v.AuxInt = int32ToAuxInt(0)
13343 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13344 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13345 v1.AddArg(x)
13346 v0.AddArg2(v1, y)
13347 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13348 v2.AuxInt = int64ToAuxInt(0)
13349 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13350 v3.AuxInt = int32ToAuxInt(16)
13351 v3.AddArg(y)
13352 v.AddArg3(v0, v2, v3)
13353 return true
13354 }
13355 }
13356 func rewriteValuePPC64_OpRsh16Ux64(v *Value) bool {
13357 v_1 := v.Args[1]
13358 v_0 := v.Args[0]
13359 b := v.Block
13360 typ := &b.Func.Config.Types
13361
13362
13363
13364 for {
13365 x := v_0
13366 if v_1.Op != OpPPC64MOVDconst {
13367 break
13368 }
13369 c := auxIntToInt64(v_1.AuxInt)
13370 if !(uint64(c) < 16) {
13371 break
13372 }
13373 v.reset(OpPPC64SRWconst)
13374 v.AuxInt = int64ToAuxInt(c)
13375 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
13376 v0.AddArg(x)
13377 v.AddArg(v0)
13378 return true
13379 }
13380
13381
13382
13383 for {
13384 x := v_0
13385 y := v_1
13386 if !(shiftIsBounded(v)) {
13387 break
13388 }
13389 v.reset(OpPPC64SRD)
13390 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13391 v0.AddArg(x)
13392 v.AddArg2(v0, y)
13393 return true
13394 }
13395
13396
13397 for {
13398 t := v.Type
13399 x := v_0
13400 y := v_1
13401 v.reset(OpPPC64ISEL)
13402 v.AuxInt = int32ToAuxInt(0)
13403 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13404 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13405 v1.AddArg(x)
13406 v0.AddArg2(v1, y)
13407 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13408 v2.AuxInt = int64ToAuxInt(0)
13409 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13410 v3.AuxInt = int64ToAuxInt(16)
13411 v3.AddArg(y)
13412 v.AddArg3(v0, v2, v3)
13413 return true
13414 }
13415 }
13416 func rewriteValuePPC64_OpRsh16Ux8(v *Value) bool {
13417 v_1 := v.Args[1]
13418 v_0 := v.Args[0]
13419 b := v.Block
13420 typ := &b.Func.Config.Types
13421
13422
13423
13424 for {
13425 x := v_0
13426 y := v_1
13427 if !(shiftIsBounded(v)) {
13428 break
13429 }
13430 v.reset(OpPPC64SRD)
13431 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13432 v0.AddArg(x)
13433 v.AddArg2(v0, y)
13434 return true
13435 }
13436
13437
13438 for {
13439 t := v.Type
13440 x := v_0
13441 y := v_1
13442 v.reset(OpPPC64ISEL)
13443 v.AuxInt = int32ToAuxInt(2)
13444 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13445 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13446 v1.AddArg(x)
13447 v0.AddArg2(v1, y)
13448 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13449 v2.AuxInt = int64ToAuxInt(0)
13450 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13451 v3.AuxInt = int64ToAuxInt(0)
13452 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13453 v4.AuxInt = int64ToAuxInt(0x00F0)
13454 v4.AddArg(y)
13455 v3.AddArg(v4)
13456 v.AddArg3(v0, v2, v3)
13457 return true
13458 }
13459 }
13460 func rewriteValuePPC64_OpRsh16x16(v *Value) bool {
13461 v_1 := v.Args[1]
13462 v_0 := v.Args[0]
13463 b := v.Block
13464 typ := &b.Func.Config.Types
13465
13466
13467
13468 for {
13469 x := v_0
13470 y := v_1
13471 if !(shiftIsBounded(v)) {
13472 break
13473 }
13474 v.reset(OpPPC64SRAD)
13475 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13476 v0.AddArg(x)
13477 v.AddArg2(v0, y)
13478 return true
13479 }
13480
13481
13482 for {
13483 t := v.Type
13484 x := v_0
13485 y := v_1
13486 v.reset(OpPPC64ISEL)
13487 v.AuxInt = int32ToAuxInt(2)
13488 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13489 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13490 v1.AddArg(x)
13491 v0.AddArg2(v1, y)
13492 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13493 v2.AuxInt = int64ToAuxInt(15)
13494 v2.AddArg(v1)
13495 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13496 v3.AuxInt = int64ToAuxInt(0)
13497 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13498 v4.AuxInt = int64ToAuxInt(0xFFF0)
13499 v4.AddArg(y)
13500 v3.AddArg(v4)
13501 v.AddArg3(v0, v2, v3)
13502 return true
13503 }
13504 }
13505 func rewriteValuePPC64_OpRsh16x32(v *Value) bool {
13506 v_1 := v.Args[1]
13507 v_0 := v.Args[0]
13508 b := v.Block
13509 typ := &b.Func.Config.Types
13510
13511
13512
13513 for {
13514 x := v_0
13515 y := v_1
13516 if !(shiftIsBounded(v)) {
13517 break
13518 }
13519 v.reset(OpPPC64SRAD)
13520 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13521 v0.AddArg(x)
13522 v.AddArg2(v0, y)
13523 return true
13524 }
13525
13526
13527 for {
13528 t := v.Type
13529 x := v_0
13530 y := v_1
13531 v.reset(OpPPC64ISEL)
13532 v.AuxInt = int32ToAuxInt(0)
13533 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13534 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13535 v1.AddArg(x)
13536 v0.AddArg2(v1, y)
13537 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13538 v2.AuxInt = int64ToAuxInt(15)
13539 v2.AddArg(v1)
13540 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13541 v3.AuxInt = int32ToAuxInt(16)
13542 v3.AddArg(y)
13543 v.AddArg3(v0, v2, v3)
13544 return true
13545 }
13546 }
13547 func rewriteValuePPC64_OpRsh16x64(v *Value) bool {
13548 v_1 := v.Args[1]
13549 v_0 := v.Args[0]
13550 b := v.Block
13551 typ := &b.Func.Config.Types
13552
13553
13554
13555 for {
13556 x := v_0
13557 if v_1.Op != OpPPC64MOVDconst {
13558 break
13559 }
13560 c := auxIntToInt64(v_1.AuxInt)
13561 if !(uint64(c) >= 16) {
13562 break
13563 }
13564 v.reset(OpPPC64SRAWconst)
13565 v.AuxInt = int64ToAuxInt(63)
13566 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
13567 v0.AddArg(x)
13568 v.AddArg(v0)
13569 return true
13570 }
13571
13572
13573
13574 for {
13575 x := v_0
13576 if v_1.Op != OpPPC64MOVDconst {
13577 break
13578 }
13579 c := auxIntToInt64(v_1.AuxInt)
13580 if !(uint64(c) < 16) {
13581 break
13582 }
13583 v.reset(OpPPC64SRAWconst)
13584 v.AuxInt = int64ToAuxInt(c)
13585 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
13586 v0.AddArg(x)
13587 v.AddArg(v0)
13588 return true
13589 }
13590
13591
13592
13593 for {
13594 x := v_0
13595 y := v_1
13596 if !(shiftIsBounded(v)) {
13597 break
13598 }
13599 v.reset(OpPPC64SRAD)
13600 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13601 v0.AddArg(x)
13602 v.AddArg2(v0, y)
13603 return true
13604 }
13605
13606
13607 for {
13608 t := v.Type
13609 x := v_0
13610 y := v_1
13611 v.reset(OpPPC64ISEL)
13612 v.AuxInt = int32ToAuxInt(0)
13613 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13614 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13615 v1.AddArg(x)
13616 v0.AddArg2(v1, y)
13617 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13618 v2.AuxInt = int64ToAuxInt(15)
13619 v2.AddArg(v1)
13620 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13621 v3.AuxInt = int64ToAuxInt(16)
13622 v3.AddArg(y)
13623 v.AddArg3(v0, v2, v3)
13624 return true
13625 }
13626 }
13627 func rewriteValuePPC64_OpRsh16x8(v *Value) bool {
13628 v_1 := v.Args[1]
13629 v_0 := v.Args[0]
13630 b := v.Block
13631 typ := &b.Func.Config.Types
13632
13633
13634
13635 for {
13636 x := v_0
13637 y := v_1
13638 if !(shiftIsBounded(v)) {
13639 break
13640 }
13641 v.reset(OpPPC64SRAD)
13642 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13643 v0.AddArg(x)
13644 v.AddArg2(v0, y)
13645 return true
13646 }
13647
13648
13649 for {
13650 t := v.Type
13651 x := v_0
13652 y := v_1
13653 v.reset(OpPPC64ISEL)
13654 v.AuxInt = int32ToAuxInt(2)
13655 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13656 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13657 v1.AddArg(x)
13658 v0.AddArg2(v1, y)
13659 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13660 v2.AuxInt = int64ToAuxInt(15)
13661 v2.AddArg(v1)
13662 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13663 v3.AuxInt = int64ToAuxInt(0)
13664 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13665 v4.AuxInt = int64ToAuxInt(0x00F0)
13666 v4.AddArg(y)
13667 v3.AddArg(v4)
13668 v.AddArg3(v0, v2, v3)
13669 return true
13670 }
13671 }
13672 func rewriteValuePPC64_OpRsh32Ux16(v *Value) bool {
13673 v_1 := v.Args[1]
13674 v_0 := v.Args[0]
13675 b := v.Block
13676 typ := &b.Func.Config.Types
13677
13678
13679
13680 for {
13681 x := v_0
13682 y := v_1
13683 if !(shiftIsBounded(v)) {
13684 break
13685 }
13686 v.reset(OpPPC64SRW)
13687 v.AddArg2(x, y)
13688 return true
13689 }
13690
13691
13692 for {
13693 t := v.Type
13694 x := v_0
13695 y := v_1
13696 v.reset(OpPPC64ISEL)
13697 v.AuxInt = int32ToAuxInt(2)
13698 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13699 v0.AddArg2(x, y)
13700 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13701 v1.AuxInt = int64ToAuxInt(0)
13702 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13703 v2.AuxInt = int64ToAuxInt(0)
13704 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13705 v3.AuxInt = int64ToAuxInt(0xFFE0)
13706 v3.AddArg(y)
13707 v2.AddArg(v3)
13708 v.AddArg3(v0, v1, v2)
13709 return true
13710 }
13711 }
13712 func rewriteValuePPC64_OpRsh32Ux32(v *Value) bool {
13713 v_1 := v.Args[1]
13714 v_0 := v.Args[0]
13715 b := v.Block
13716 typ := &b.Func.Config.Types
13717
13718
13719
13720 for {
13721 x := v_0
13722 y := v_1
13723 if !(shiftIsBounded(v)) {
13724 break
13725 }
13726 v.reset(OpPPC64SRW)
13727 v.AddArg2(x, y)
13728 return true
13729 }
13730
13731
13732 for {
13733 t := v.Type
13734 x := v_0
13735 y := v_1
13736 v.reset(OpPPC64ISEL)
13737 v.AuxInt = int32ToAuxInt(0)
13738 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13739 v0.AddArg2(x, y)
13740 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13741 v1.AuxInt = int64ToAuxInt(0)
13742 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13743 v2.AuxInt = int32ToAuxInt(32)
13744 v2.AddArg(y)
13745 v.AddArg3(v0, v1, v2)
13746 return true
13747 }
13748 }
13749 func rewriteValuePPC64_OpRsh32Ux64(v *Value) bool {
13750 v_1 := v.Args[1]
13751 v_0 := v.Args[0]
13752 b := v.Block
13753 typ := &b.Func.Config.Types
13754
13755
13756
13757 for {
13758 x := v_0
13759 if v_1.Op != OpPPC64MOVDconst {
13760 break
13761 }
13762 c := auxIntToInt64(v_1.AuxInt)
13763 if !(uint64(c) < 32) {
13764 break
13765 }
13766 v.reset(OpPPC64SRWconst)
13767 v.AuxInt = int64ToAuxInt(c)
13768 v.AddArg(x)
13769 return true
13770 }
13771
13772
13773
13774 for {
13775 x := v_0
13776 y := v_1
13777 if !(shiftIsBounded(v)) {
13778 break
13779 }
13780 v.reset(OpPPC64SRW)
13781 v.AddArg2(x, y)
13782 return true
13783 }
13784
13785
13786 for {
13787 t := v.Type
13788 x := v_0
13789 y := v_1
13790 v.reset(OpPPC64ISEL)
13791 v.AuxInt = int32ToAuxInt(0)
13792 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13793 v0.AddArg2(x, y)
13794 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13795 v1.AuxInt = int64ToAuxInt(0)
13796 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13797 v2.AuxInt = int64ToAuxInt(32)
13798 v2.AddArg(y)
13799 v.AddArg3(v0, v1, v2)
13800 return true
13801 }
13802 }
13803 func rewriteValuePPC64_OpRsh32Ux8(v *Value) bool {
13804 v_1 := v.Args[1]
13805 v_0 := v.Args[0]
13806 b := v.Block
13807 typ := &b.Func.Config.Types
13808
13809
13810
13811 for {
13812 x := v_0
13813 y := v_1
13814 if !(shiftIsBounded(v)) {
13815 break
13816 }
13817 v.reset(OpPPC64SRW)
13818 v.AddArg2(x, y)
13819 return true
13820 }
13821
13822
13823 for {
13824 t := v.Type
13825 x := v_0
13826 y := v_1
13827 v.reset(OpPPC64ISEL)
13828 v.AuxInt = int32ToAuxInt(2)
13829 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13830 v0.AddArg2(x, y)
13831 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13832 v1.AuxInt = int64ToAuxInt(0)
13833 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13834 v2.AuxInt = int64ToAuxInt(0)
13835 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13836 v3.AuxInt = int64ToAuxInt(0x00E0)
13837 v3.AddArg(y)
13838 v2.AddArg(v3)
13839 v.AddArg3(v0, v1, v2)
13840 return true
13841 }
13842 }
13843 func rewriteValuePPC64_OpRsh32x16(v *Value) bool {
13844 v_1 := v.Args[1]
13845 v_0 := v.Args[0]
13846 b := v.Block
13847 typ := &b.Func.Config.Types
13848
13849
13850
13851 for {
13852 x := v_0
13853 y := v_1
13854 if !(shiftIsBounded(v)) {
13855 break
13856 }
13857 v.reset(OpPPC64SRAW)
13858 v.AddArg2(x, y)
13859 return true
13860 }
13861
13862
13863 for {
13864 t := v.Type
13865 x := v_0
13866 y := v_1
13867 v.reset(OpPPC64ISEL)
13868 v.AuxInt = int32ToAuxInt(2)
13869 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
13870 v0.AddArg2(x, y)
13871 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
13872 v1.AuxInt = int64ToAuxInt(31)
13873 v1.AddArg(x)
13874 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13875 v2.AuxInt = int64ToAuxInt(0)
13876 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13877 v3.AuxInt = int64ToAuxInt(0xFFE0)
13878 v3.AddArg(y)
13879 v2.AddArg(v3)
13880 v.AddArg3(v0, v1, v2)
13881 return true
13882 }
13883 }
13884 func rewriteValuePPC64_OpRsh32x32(v *Value) bool {
13885 v_1 := v.Args[1]
13886 v_0 := v.Args[0]
13887 b := v.Block
13888
13889
13890
13891 for {
13892 x := v_0
13893 y := v_1
13894 if !(shiftIsBounded(v)) {
13895 break
13896 }
13897 v.reset(OpPPC64SRAW)
13898 v.AddArg2(x, y)
13899 return true
13900 }
13901
13902
13903 for {
13904 t := v.Type
13905 x := v_0
13906 y := v_1
13907 v.reset(OpPPC64ISEL)
13908 v.AuxInt = int32ToAuxInt(0)
13909 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
13910 v0.AddArg2(x, y)
13911 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
13912 v1.AuxInt = int64ToAuxInt(31)
13913 v1.AddArg(x)
13914 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13915 v2.AuxInt = int32ToAuxInt(32)
13916 v2.AddArg(y)
13917 v.AddArg3(v0, v1, v2)
13918 return true
13919 }
13920 }
13921 func rewriteValuePPC64_OpRsh32x64(v *Value) bool {
13922 v_1 := v.Args[1]
13923 v_0 := v.Args[0]
13924 b := v.Block
13925
13926
13927
13928 for {
13929 x := v_0
13930 if v_1.Op != OpPPC64MOVDconst {
13931 break
13932 }
13933 c := auxIntToInt64(v_1.AuxInt)
13934 if !(uint64(c) >= 32) {
13935 break
13936 }
13937 v.reset(OpPPC64SRAWconst)
13938 v.AuxInt = int64ToAuxInt(63)
13939 v.AddArg(x)
13940 return true
13941 }
13942
13943
13944
13945 for {
13946 x := v_0
13947 if v_1.Op != OpPPC64MOVDconst {
13948 break
13949 }
13950 c := auxIntToInt64(v_1.AuxInt)
13951 if !(uint64(c) < 32) {
13952 break
13953 }
13954 v.reset(OpPPC64SRAWconst)
13955 v.AuxInt = int64ToAuxInt(c)
13956 v.AddArg(x)
13957 return true
13958 }
13959
13960
13961
13962 for {
13963 x := v_0
13964 y := v_1
13965 if !(shiftIsBounded(v)) {
13966 break
13967 }
13968 v.reset(OpPPC64SRAW)
13969 v.AddArg2(x, y)
13970 return true
13971 }
13972
13973
13974 for {
13975 t := v.Type
13976 x := v_0
13977 y := v_1
13978 v.reset(OpPPC64ISEL)
13979 v.AuxInt = int32ToAuxInt(0)
13980 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
13981 v0.AddArg2(x, y)
13982 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
13983 v1.AuxInt = int64ToAuxInt(31)
13984 v1.AddArg(x)
13985 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13986 v2.AuxInt = int64ToAuxInt(32)
13987 v2.AddArg(y)
13988 v.AddArg3(v0, v1, v2)
13989 return true
13990 }
13991 }
13992 func rewriteValuePPC64_OpRsh32x8(v *Value) bool {
13993 v_1 := v.Args[1]
13994 v_0 := v.Args[0]
13995 b := v.Block
13996 typ := &b.Func.Config.Types
13997
13998
13999
14000 for {
14001 x := v_0
14002 y := v_1
14003 if !(shiftIsBounded(v)) {
14004 break
14005 }
14006 v.reset(OpPPC64SRAW)
14007 v.AddArg2(x, y)
14008 return true
14009 }
14010
14011
14012 for {
14013 t := v.Type
14014 x := v_0
14015 y := v_1
14016 v.reset(OpPPC64ISEL)
14017 v.AuxInt = int32ToAuxInt(2)
14018 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
14019 v0.AddArg2(x, y)
14020 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
14021 v1.AuxInt = int64ToAuxInt(31)
14022 v1.AddArg(x)
14023 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14024 v2.AuxInt = int64ToAuxInt(0)
14025 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14026 v3.AuxInt = int64ToAuxInt(0x00E0)
14027 v3.AddArg(y)
14028 v2.AddArg(v3)
14029 v.AddArg3(v0, v1, v2)
14030 return true
14031 }
14032 }
14033 func rewriteValuePPC64_OpRsh64Ux16(v *Value) bool {
14034 v_1 := v.Args[1]
14035 v_0 := v.Args[0]
14036 b := v.Block
14037 typ := &b.Func.Config.Types
14038
14039
14040
14041 for {
14042 x := v_0
14043 y := v_1
14044 if !(shiftIsBounded(v)) {
14045 break
14046 }
14047 v.reset(OpPPC64SRD)
14048 v.AddArg2(x, y)
14049 return true
14050 }
14051
14052
14053 for {
14054 t := v.Type
14055 x := v_0
14056 y := v_1
14057 v.reset(OpPPC64ISEL)
14058 v.AuxInt = int32ToAuxInt(2)
14059 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14060 v0.AddArg2(x, y)
14061 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14062 v1.AuxInt = int64ToAuxInt(0)
14063 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14064 v2.AuxInt = int64ToAuxInt(0)
14065 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14066 v3.AuxInt = int64ToAuxInt(0xFFC0)
14067 v3.AddArg(y)
14068 v2.AddArg(v3)
14069 v.AddArg3(v0, v1, v2)
14070 return true
14071 }
14072 }
14073 func rewriteValuePPC64_OpRsh64Ux32(v *Value) bool {
14074 v_1 := v.Args[1]
14075 v_0 := v.Args[0]
14076 b := v.Block
14077 typ := &b.Func.Config.Types
14078
14079
14080
14081 for {
14082 x := v_0
14083 y := v_1
14084 if !(shiftIsBounded(v)) {
14085 break
14086 }
14087 v.reset(OpPPC64SRD)
14088 v.AddArg2(x, y)
14089 return true
14090 }
14091
14092
14093 for {
14094 t := v.Type
14095 x := v_0
14096 y := v_1
14097 v.reset(OpPPC64ISEL)
14098 v.AuxInt = int32ToAuxInt(0)
14099 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14100 v0.AddArg2(x, y)
14101 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14102 v1.AuxInt = int64ToAuxInt(0)
14103 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
14104 v2.AuxInt = int32ToAuxInt(64)
14105 v2.AddArg(y)
14106 v.AddArg3(v0, v1, v2)
14107 return true
14108 }
14109 }
14110 func rewriteValuePPC64_OpRsh64Ux64(v *Value) bool {
14111 v_1 := v.Args[1]
14112 v_0 := v.Args[0]
14113 b := v.Block
14114 typ := &b.Func.Config.Types
14115
14116
14117
14118 for {
14119 x := v_0
14120 if v_1.Op != OpPPC64MOVDconst {
14121 break
14122 }
14123 c := auxIntToInt64(v_1.AuxInt)
14124 if !(uint64(c) < 64) {
14125 break
14126 }
14127 v.reset(OpPPC64SRDconst)
14128 v.AuxInt = int64ToAuxInt(c)
14129 v.AddArg(x)
14130 return true
14131 }
14132
14133
14134
14135 for {
14136 x := v_0
14137 y := v_1
14138 if !(shiftIsBounded(v)) {
14139 break
14140 }
14141 v.reset(OpPPC64SRD)
14142 v.AddArg2(x, y)
14143 return true
14144 }
14145
14146
14147 for {
14148 t := v.Type
14149 x := v_0
14150 y := v_1
14151 v.reset(OpPPC64ISEL)
14152 v.AuxInt = int32ToAuxInt(0)
14153 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14154 v0.AddArg2(x, y)
14155 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14156 v1.AuxInt = int64ToAuxInt(0)
14157 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
14158 v2.AuxInt = int64ToAuxInt(64)
14159 v2.AddArg(y)
14160 v.AddArg3(v0, v1, v2)
14161 return true
14162 }
14163 }
14164 func rewriteValuePPC64_OpRsh64Ux8(v *Value) bool {
14165 v_1 := v.Args[1]
14166 v_0 := v.Args[0]
14167 b := v.Block
14168 typ := &b.Func.Config.Types
14169
14170
14171
14172 for {
14173 x := v_0
14174 y := v_1
14175 if !(shiftIsBounded(v)) {
14176 break
14177 }
14178 v.reset(OpPPC64SRD)
14179 v.AddArg2(x, y)
14180 return true
14181 }
14182
14183
14184 for {
14185 t := v.Type
14186 x := v_0
14187 y := v_1
14188 v.reset(OpPPC64ISEL)
14189 v.AuxInt = int32ToAuxInt(2)
14190 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14191 v0.AddArg2(x, y)
14192 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14193 v1.AuxInt = int64ToAuxInt(0)
14194 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14195 v2.AuxInt = int64ToAuxInt(0)
14196 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14197 v3.AuxInt = int64ToAuxInt(0x00C0)
14198 v3.AddArg(y)
14199 v2.AddArg(v3)
14200 v.AddArg3(v0, v1, v2)
14201 return true
14202 }
14203 }
14204 func rewriteValuePPC64_OpRsh64x16(v *Value) bool {
14205 v_1 := v.Args[1]
14206 v_0 := v.Args[0]
14207 b := v.Block
14208 typ := &b.Func.Config.Types
14209
14210
14211
14212 for {
14213 x := v_0
14214 y := v_1
14215 if !(shiftIsBounded(v)) {
14216 break
14217 }
14218 v.reset(OpPPC64SRAD)
14219 v.AddArg2(x, y)
14220 return true
14221 }
14222
14223
14224 for {
14225 t := v.Type
14226 x := v_0
14227 y := v_1
14228 v.reset(OpPPC64ISEL)
14229 v.AuxInt = int32ToAuxInt(2)
14230 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14231 v0.AddArg2(x, y)
14232 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14233 v1.AuxInt = int64ToAuxInt(63)
14234 v1.AddArg(x)
14235 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14236 v2.AuxInt = int64ToAuxInt(0)
14237 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14238 v3.AuxInt = int64ToAuxInt(0xFFC0)
14239 v3.AddArg(y)
14240 v2.AddArg(v3)
14241 v.AddArg3(v0, v1, v2)
14242 return true
14243 }
14244 }
14245 func rewriteValuePPC64_OpRsh64x32(v *Value) bool {
14246 v_1 := v.Args[1]
14247 v_0 := v.Args[0]
14248 b := v.Block
14249
14250
14251
14252 for {
14253 x := v_0
14254 y := v_1
14255 if !(shiftIsBounded(v)) {
14256 break
14257 }
14258 v.reset(OpPPC64SRAD)
14259 v.AddArg2(x, y)
14260 return true
14261 }
14262
14263
14264 for {
14265 t := v.Type
14266 x := v_0
14267 y := v_1
14268 v.reset(OpPPC64ISEL)
14269 v.AuxInt = int32ToAuxInt(0)
14270 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14271 v0.AddArg2(x, y)
14272 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14273 v1.AuxInt = int64ToAuxInt(63)
14274 v1.AddArg(x)
14275 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
14276 v2.AuxInt = int32ToAuxInt(64)
14277 v2.AddArg(y)
14278 v.AddArg3(v0, v1, v2)
14279 return true
14280 }
14281 }
14282 func rewriteValuePPC64_OpRsh64x64(v *Value) bool {
14283 v_1 := v.Args[1]
14284 v_0 := v.Args[0]
14285 b := v.Block
14286
14287
14288
14289 for {
14290 x := v_0
14291 if v_1.Op != OpPPC64MOVDconst {
14292 break
14293 }
14294 c := auxIntToInt64(v_1.AuxInt)
14295 if !(uint64(c) >= 64) {
14296 break
14297 }
14298 v.reset(OpPPC64SRADconst)
14299 v.AuxInt = int64ToAuxInt(63)
14300 v.AddArg(x)
14301 return true
14302 }
14303
14304
14305
14306 for {
14307 x := v_0
14308 if v_1.Op != OpPPC64MOVDconst {
14309 break
14310 }
14311 c := auxIntToInt64(v_1.AuxInt)
14312 if !(uint64(c) < 64) {
14313 break
14314 }
14315 v.reset(OpPPC64SRADconst)
14316 v.AuxInt = int64ToAuxInt(c)
14317 v.AddArg(x)
14318 return true
14319 }
14320
14321
14322
14323 for {
14324 x := v_0
14325 y := v_1
14326 if !(shiftIsBounded(v)) {
14327 break
14328 }
14329 v.reset(OpPPC64SRAD)
14330 v.AddArg2(x, y)
14331 return true
14332 }
14333
14334
14335 for {
14336 t := v.Type
14337 x := v_0
14338 y := v_1
14339 v.reset(OpPPC64ISEL)
14340 v.AuxInt = int32ToAuxInt(0)
14341 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14342 v0.AddArg2(x, y)
14343 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14344 v1.AuxInt = int64ToAuxInt(63)
14345 v1.AddArg(x)
14346 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
14347 v2.AuxInt = int64ToAuxInt(64)
14348 v2.AddArg(y)
14349 v.AddArg3(v0, v1, v2)
14350 return true
14351 }
14352 }
14353 func rewriteValuePPC64_OpRsh64x8(v *Value) bool {
14354 v_1 := v.Args[1]
14355 v_0 := v.Args[0]
14356 b := v.Block
14357 typ := &b.Func.Config.Types
14358
14359
14360
14361 for {
14362 x := v_0
14363 y := v_1
14364 if !(shiftIsBounded(v)) {
14365 break
14366 }
14367 v.reset(OpPPC64SRAD)
14368 v.AddArg2(x, y)
14369 return true
14370 }
14371
14372
14373 for {
14374 t := v.Type
14375 x := v_0
14376 y := v_1
14377 v.reset(OpPPC64ISEL)
14378 v.AuxInt = int32ToAuxInt(2)
14379 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14380 v0.AddArg2(x, y)
14381 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14382 v1.AuxInt = int64ToAuxInt(63)
14383 v1.AddArg(x)
14384 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14385 v2.AuxInt = int64ToAuxInt(0)
14386 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14387 v3.AuxInt = int64ToAuxInt(0x00C0)
14388 v3.AddArg(y)
14389 v2.AddArg(v3)
14390 v.AddArg3(v0, v1, v2)
14391 return true
14392 }
14393 }
14394 func rewriteValuePPC64_OpRsh8Ux16(v *Value) bool {
14395 v_1 := v.Args[1]
14396 v_0 := v.Args[0]
14397 b := v.Block
14398 typ := &b.Func.Config.Types
14399
14400
14401
14402 for {
14403 x := v_0
14404 y := v_1
14405 if !(shiftIsBounded(v)) {
14406 break
14407 }
14408 v.reset(OpPPC64SRD)
14409 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14410 v0.AddArg(x)
14411 v.AddArg2(v0, y)
14412 return true
14413 }
14414
14415
14416 for {
14417 t := v.Type
14418 x := v_0
14419 y := v_1
14420 v.reset(OpPPC64ISEL)
14421 v.AuxInt = int32ToAuxInt(2)
14422 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14423 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14424 v1.AddArg(x)
14425 v0.AddArg2(v1, y)
14426 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14427 v2.AuxInt = int64ToAuxInt(0)
14428 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14429 v3.AuxInt = int64ToAuxInt(0)
14430 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14431 v4.AuxInt = int64ToAuxInt(0xFFF8)
14432 v4.AddArg(y)
14433 v3.AddArg(v4)
14434 v.AddArg3(v0, v2, v3)
14435 return true
14436 }
14437 }
14438 func rewriteValuePPC64_OpRsh8Ux32(v *Value) bool {
14439 v_1 := v.Args[1]
14440 v_0 := v.Args[0]
14441 b := v.Block
14442 typ := &b.Func.Config.Types
14443
14444
14445
14446 for {
14447 x := v_0
14448 y := v_1
14449 if !(shiftIsBounded(v)) {
14450 break
14451 }
14452 v.reset(OpPPC64SRD)
14453 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14454 v0.AddArg(x)
14455 v.AddArg2(v0, y)
14456 return true
14457 }
14458
14459
14460 for {
14461 t := v.Type
14462 x := v_0
14463 y := v_1
14464 v.reset(OpPPC64ISEL)
14465 v.AuxInt = int32ToAuxInt(0)
14466 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14467 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14468 v1.AddArg(x)
14469 v0.AddArg2(v1, y)
14470 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14471 v2.AuxInt = int64ToAuxInt(0)
14472 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
14473 v3.AuxInt = int32ToAuxInt(8)
14474 v3.AddArg(y)
14475 v.AddArg3(v0, v2, v3)
14476 return true
14477 }
14478 }
14479 func rewriteValuePPC64_OpRsh8Ux64(v *Value) bool {
14480 v_1 := v.Args[1]
14481 v_0 := v.Args[0]
14482 b := v.Block
14483 typ := &b.Func.Config.Types
14484
14485
14486
14487 for {
14488 x := v_0
14489 if v_1.Op != OpPPC64MOVDconst {
14490 break
14491 }
14492 c := auxIntToInt64(v_1.AuxInt)
14493 if !(uint64(c) < 8) {
14494 break
14495 }
14496 v.reset(OpPPC64SRWconst)
14497 v.AuxInt = int64ToAuxInt(c)
14498 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
14499 v0.AddArg(x)
14500 v.AddArg(v0)
14501 return true
14502 }
14503
14504
14505
14506 for {
14507 x := v_0
14508 y := v_1
14509 if !(shiftIsBounded(v)) {
14510 break
14511 }
14512 v.reset(OpPPC64SRD)
14513 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14514 v0.AddArg(x)
14515 v.AddArg2(v0, y)
14516 return true
14517 }
14518
14519
14520 for {
14521 t := v.Type
14522 x := v_0
14523 y := v_1
14524 v.reset(OpPPC64ISEL)
14525 v.AuxInt = int32ToAuxInt(0)
14526 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14527 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14528 v1.AddArg(x)
14529 v0.AddArg2(v1, y)
14530 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14531 v2.AuxInt = int64ToAuxInt(0)
14532 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
14533 v3.AuxInt = int64ToAuxInt(8)
14534 v3.AddArg(y)
14535 v.AddArg3(v0, v2, v3)
14536 return true
14537 }
14538 }
14539 func rewriteValuePPC64_OpRsh8Ux8(v *Value) bool {
14540 v_1 := v.Args[1]
14541 v_0 := v.Args[0]
14542 b := v.Block
14543 typ := &b.Func.Config.Types
14544
14545
14546
14547 for {
14548 x := v_0
14549 y := v_1
14550 if !(shiftIsBounded(v)) {
14551 break
14552 }
14553 v.reset(OpPPC64SRD)
14554 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14555 v0.AddArg(x)
14556 v.AddArg2(v0, y)
14557 return true
14558 }
14559
14560
14561 for {
14562 t := v.Type
14563 x := v_0
14564 y := v_1
14565 v.reset(OpPPC64ISEL)
14566 v.AuxInt = int32ToAuxInt(2)
14567 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14568 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14569 v1.AddArg(x)
14570 v0.AddArg2(v1, y)
14571 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14572 v2.AuxInt = int64ToAuxInt(0)
14573 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14574 v3.AuxInt = int64ToAuxInt(0)
14575 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14576 v4.AuxInt = int64ToAuxInt(0x00F8)
14577 v4.AddArg(y)
14578 v3.AddArg(v4)
14579 v.AddArg3(v0, v2, v3)
14580 return true
14581 }
14582 }
14583 func rewriteValuePPC64_OpRsh8x16(v *Value) bool {
14584 v_1 := v.Args[1]
14585 v_0 := v.Args[0]
14586 b := v.Block
14587 typ := &b.Func.Config.Types
14588
14589
14590
14591 for {
14592 x := v_0
14593 y := v_1
14594 if !(shiftIsBounded(v)) {
14595 break
14596 }
14597 v.reset(OpPPC64SRAD)
14598 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14599 v0.AddArg(x)
14600 v.AddArg2(v0, y)
14601 return true
14602 }
14603
14604
14605 for {
14606 t := v.Type
14607 x := v_0
14608 y := v_1
14609 v.reset(OpPPC64ISEL)
14610 v.AuxInt = int32ToAuxInt(2)
14611 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14612 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14613 v1.AddArg(x)
14614 v0.AddArg2(v1, y)
14615 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14616 v2.AuxInt = int64ToAuxInt(7)
14617 v2.AddArg(v1)
14618 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14619 v3.AuxInt = int64ToAuxInt(0)
14620 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14621 v4.AuxInt = int64ToAuxInt(0xFFF8)
14622 v4.AddArg(y)
14623 v3.AddArg(v4)
14624 v.AddArg3(v0, v2, v3)
14625 return true
14626 }
14627 }
14628 func rewriteValuePPC64_OpRsh8x32(v *Value) bool {
14629 v_1 := v.Args[1]
14630 v_0 := v.Args[0]
14631 b := v.Block
14632 typ := &b.Func.Config.Types
14633
14634
14635
14636 for {
14637 x := v_0
14638 y := v_1
14639 if !(shiftIsBounded(v)) {
14640 break
14641 }
14642 v.reset(OpPPC64SRAD)
14643 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14644 v0.AddArg(x)
14645 v.AddArg2(v0, y)
14646 return true
14647 }
14648
14649
14650 for {
14651 t := v.Type
14652 x := v_0
14653 y := v_1
14654 v.reset(OpPPC64ISEL)
14655 v.AuxInt = int32ToAuxInt(0)
14656 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14657 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14658 v1.AddArg(x)
14659 v0.AddArg2(v1, y)
14660 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14661 v2.AuxInt = int64ToAuxInt(7)
14662 v2.AddArg(v1)
14663 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
14664 v3.AuxInt = int32ToAuxInt(8)
14665 v3.AddArg(y)
14666 v.AddArg3(v0, v2, v3)
14667 return true
14668 }
14669 }
14670 func rewriteValuePPC64_OpRsh8x64(v *Value) bool {
14671 v_1 := v.Args[1]
14672 v_0 := v.Args[0]
14673 b := v.Block
14674 typ := &b.Func.Config.Types
14675
14676
14677
14678 for {
14679 x := v_0
14680 if v_1.Op != OpPPC64MOVDconst {
14681 break
14682 }
14683 c := auxIntToInt64(v_1.AuxInt)
14684 if !(uint64(c) >= 8) {
14685 break
14686 }
14687 v.reset(OpPPC64SRAWconst)
14688 v.AuxInt = int64ToAuxInt(63)
14689 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
14690 v0.AddArg(x)
14691 v.AddArg(v0)
14692 return true
14693 }
14694
14695
14696
14697 for {
14698 x := v_0
14699 if v_1.Op != OpPPC64MOVDconst {
14700 break
14701 }
14702 c := auxIntToInt64(v_1.AuxInt)
14703 if !(uint64(c) < 8) {
14704 break
14705 }
14706 v.reset(OpPPC64SRAWconst)
14707 v.AuxInt = int64ToAuxInt(c)
14708 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
14709 v0.AddArg(x)
14710 v.AddArg(v0)
14711 return true
14712 }
14713
14714
14715
14716 for {
14717 x := v_0
14718 y := v_1
14719 if !(shiftIsBounded(v)) {
14720 break
14721 }
14722 v.reset(OpPPC64SRAD)
14723 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14724 v0.AddArg(x)
14725 v.AddArg2(v0, y)
14726 return true
14727 }
14728
14729
14730 for {
14731 t := v.Type
14732 x := v_0
14733 y := v_1
14734 v.reset(OpPPC64ISEL)
14735 v.AuxInt = int32ToAuxInt(0)
14736 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14737 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14738 v1.AddArg(x)
14739 v0.AddArg2(v1, y)
14740 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14741 v2.AuxInt = int64ToAuxInt(7)
14742 v2.AddArg(v1)
14743 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
14744 v3.AuxInt = int64ToAuxInt(8)
14745 v3.AddArg(y)
14746 v.AddArg3(v0, v2, v3)
14747 return true
14748 }
14749 }
14750 func rewriteValuePPC64_OpRsh8x8(v *Value) bool {
14751 v_1 := v.Args[1]
14752 v_0 := v.Args[0]
14753 b := v.Block
14754 typ := &b.Func.Config.Types
14755
14756
14757
14758 for {
14759 x := v_0
14760 y := v_1
14761 if !(shiftIsBounded(v)) {
14762 break
14763 }
14764 v.reset(OpPPC64SRAD)
14765 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14766 v0.AddArg(x)
14767 v.AddArg2(v0, y)
14768 return true
14769 }
14770
14771
14772 for {
14773 t := v.Type
14774 x := v_0
14775 y := v_1
14776 v.reset(OpPPC64ISEL)
14777 v.AuxInt = int32ToAuxInt(2)
14778 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14779 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14780 v1.AddArg(x)
14781 v0.AddArg2(v1, y)
14782 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14783 v2.AuxInt = int64ToAuxInt(7)
14784 v2.AddArg(v1)
14785 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14786 v3.AuxInt = int64ToAuxInt(0)
14787 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14788 v4.AuxInt = int64ToAuxInt(0x00F8)
14789 v4.AddArg(y)
14790 v3.AddArg(v4)
14791 v.AddArg3(v0, v2, v3)
14792 return true
14793 }
14794 }
14795 func rewriteValuePPC64_OpSelect0(v *Value) bool {
14796 v_0 := v.Args[0]
14797 b := v.Block
14798 typ := &b.Func.Config.Types
14799
14800
14801 for {
14802 if v_0.Op != OpMul64uhilo {
14803 break
14804 }
14805 y := v_0.Args[1]
14806 x := v_0.Args[0]
14807 v.reset(OpPPC64MULHDU)
14808 v.AddArg2(x, y)
14809 return true
14810 }
14811
14812
14813 for {
14814 if v_0.Op != OpMul64uover {
14815 break
14816 }
14817 y := v_0.Args[1]
14818 x := v_0.Args[0]
14819 v.reset(OpPPC64MULLD)
14820 v.AddArg2(x, y)
14821 return true
14822 }
14823
14824
14825 for {
14826 if v_0.Op != OpAdd64carry {
14827 break
14828 }
14829 c := v_0.Args[2]
14830 x := v_0.Args[0]
14831 y := v_0.Args[1]
14832 v.reset(OpSelect0)
14833 v.Type = typ.UInt64
14834 v0 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
14835 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14836 v2 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14837 v2.AuxInt = int64ToAuxInt(-1)
14838 v2.AddArg(c)
14839 v1.AddArg(v2)
14840 v0.AddArg3(x, y, v1)
14841 v.AddArg(v0)
14842 return true
14843 }
14844
14845
14846 for {
14847 if v_0.Op != OpSub64borrow {
14848 break
14849 }
14850 c := v_0.Args[2]
14851 x := v_0.Args[0]
14852 y := v_0.Args[1]
14853 v.reset(OpSelect0)
14854 v.Type = typ.UInt64
14855 v0 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
14856 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14857 v2 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14858 v2.AuxInt = int64ToAuxInt(0)
14859 v2.AddArg(c)
14860 v1.AddArg(v2)
14861 v0.AddArg3(x, y, v1)
14862 v.AddArg(v0)
14863 return true
14864 }
14865 return false
14866 }
14867 func rewriteValuePPC64_OpSelect1(v *Value) bool {
14868 v_0 := v.Args[0]
14869 b := v.Block
14870 typ := &b.Func.Config.Types
14871
14872
14873 for {
14874 if v_0.Op != OpMul64uhilo {
14875 break
14876 }
14877 y := v_0.Args[1]
14878 x := v_0.Args[0]
14879 v.reset(OpPPC64MULLD)
14880 v.AddArg2(x, y)
14881 return true
14882 }
14883
14884
14885 for {
14886 if v_0.Op != OpMul64uover {
14887 break
14888 }
14889 y := v_0.Args[1]
14890 x := v_0.Args[0]
14891 v.reset(OpPPC64SETBCR)
14892 v.AuxInt = int32ToAuxInt(2)
14893 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14894 v0.AuxInt = int64ToAuxInt(0)
14895 v1 := b.NewValue0(v.Pos, OpPPC64MULHDU, x.Type)
14896 v1.AddArg2(x, y)
14897 v0.AddArg(v1)
14898 v.AddArg(v0)
14899 return true
14900 }
14901
14902
14903 for {
14904 if v_0.Op != OpAdd64carry {
14905 break
14906 }
14907 c := v_0.Args[2]
14908 x := v_0.Args[0]
14909 y := v_0.Args[1]
14910 v.reset(OpPPC64ADDZEzero)
14911 v0 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14912 v1 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
14913 v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14914 v3 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14915 v3.AuxInt = int64ToAuxInt(-1)
14916 v3.AddArg(c)
14917 v2.AddArg(v3)
14918 v1.AddArg3(x, y, v2)
14919 v0.AddArg(v1)
14920 v.AddArg(v0)
14921 return true
14922 }
14923
14924
14925
14926 for {
14927 if v_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_0.AuxInt) != -1 {
14928 break
14929 }
14930 n := v_0.Args[0]
14931 if n.Op != OpPPC64ADDZEzero {
14932 break
14933 }
14934 x := n.Args[0]
14935 if !(n.Uses <= 2) {
14936 break
14937 }
14938 v.copyOf(x)
14939 return true
14940 }
14941
14942
14943 for {
14944 if v_0.Op != OpSub64borrow {
14945 break
14946 }
14947 c := v_0.Args[2]
14948 x := v_0.Args[0]
14949 y := v_0.Args[1]
14950 v.reset(OpPPC64NEG)
14951 v0 := b.NewValue0(v.Pos, OpPPC64SUBZEzero, typ.UInt64)
14952 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14953 v2 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
14954 v3 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14955 v4 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14956 v4.AuxInt = int64ToAuxInt(0)
14957 v4.AddArg(c)
14958 v3.AddArg(v4)
14959 v2.AddArg3(x, y, v3)
14960 v1.AddArg(v2)
14961 v0.AddArg(v1)
14962 v.AddArg(v0)
14963 return true
14964 }
14965
14966
14967
14968 for {
14969 if v_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_0.AuxInt) != 0 {
14970 break
14971 }
14972 n := v_0.Args[0]
14973 if n.Op != OpPPC64NEG {
14974 break
14975 }
14976 n_0 := n.Args[0]
14977 if n_0.Op != OpPPC64SUBZEzero {
14978 break
14979 }
14980 x := n_0.Args[0]
14981 if !(n.Uses <= 2) {
14982 break
14983 }
14984 v.copyOf(x)
14985 return true
14986 }
14987 return false
14988 }
14989 func rewriteValuePPC64_OpSelectN(v *Value) bool {
14990 v_0 := v.Args[0]
14991 b := v.Block
14992 config := b.Func.Config
14993
14994
14995
14996 for {
14997 if auxIntToInt64(v.AuxInt) != 0 {
14998 break
14999 }
15000 call := v_0
15001 if call.Op != OpPPC64CALLstatic || len(call.Args) != 1 {
15002 break
15003 }
15004 sym := auxToCall(call.Aux)
15005 s1 := call.Args[0]
15006 if s1.Op != OpPPC64MOVDstore {
15007 break
15008 }
15009 _ = s1.Args[2]
15010 s1_1 := s1.Args[1]
15011 if s1_1.Op != OpPPC64MOVDconst {
15012 break
15013 }
15014 sz := auxIntToInt64(s1_1.AuxInt)
15015 s2 := s1.Args[2]
15016 if s2.Op != OpPPC64MOVDstore {
15017 break
15018 }
15019 _ = s2.Args[2]
15020 src := s2.Args[1]
15021 s3 := s2.Args[2]
15022 if s3.Op != OpPPC64MOVDstore {
15023 break
15024 }
15025 mem := s3.Args[2]
15026 dst := s3.Args[1]
15027 if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(s1, s2, s3, call)) {
15028 break
15029 }
15030 v.reset(OpMove)
15031 v.AuxInt = int64ToAuxInt(sz)
15032 v.AddArg3(dst, src, mem)
15033 return true
15034 }
15035
15036
15037
15038 for {
15039 if auxIntToInt64(v.AuxInt) != 0 {
15040 break
15041 }
15042 call := v_0
15043 if call.Op != OpPPC64CALLstatic || len(call.Args) != 4 {
15044 break
15045 }
15046 sym := auxToCall(call.Aux)
15047 mem := call.Args[3]
15048 dst := call.Args[0]
15049 src := call.Args[1]
15050 call_2 := call.Args[2]
15051 if call_2.Op != OpPPC64MOVDconst {
15052 break
15053 }
15054 sz := auxIntToInt64(call_2.AuxInt)
15055 if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
15056 break
15057 }
15058 v.reset(OpMove)
15059 v.AuxInt = int64ToAuxInt(sz)
15060 v.AddArg3(dst, src, mem)
15061 return true
15062 }
15063 return false
15064 }
15065 func rewriteValuePPC64_OpSlicemask(v *Value) bool {
15066 v_0 := v.Args[0]
15067 b := v.Block
15068
15069
15070 for {
15071 t := v.Type
15072 x := v_0
15073 v.reset(OpPPC64SRADconst)
15074 v.AuxInt = int64ToAuxInt(63)
15075 v0 := b.NewValue0(v.Pos, OpPPC64NEG, t)
15076 v0.AddArg(x)
15077 v.AddArg(v0)
15078 return true
15079 }
15080 }
15081 func rewriteValuePPC64_OpStore(v *Value) bool {
15082 v_2 := v.Args[2]
15083 v_1 := v.Args[1]
15084 v_0 := v.Args[0]
15085
15086
15087
15088 for {
15089 t := auxToType(v.Aux)
15090 ptr := v_0
15091 val := v_1
15092 mem := v_2
15093 if !(t.Size() == 8 && t.IsFloat()) {
15094 break
15095 }
15096 v.reset(OpPPC64FMOVDstore)
15097 v.AddArg3(ptr, val, mem)
15098 return true
15099 }
15100
15101
15102
15103 for {
15104 t := auxToType(v.Aux)
15105 ptr := v_0
15106 val := v_1
15107 mem := v_2
15108 if !(t.Size() == 4 && t.IsFloat()) {
15109 break
15110 }
15111 v.reset(OpPPC64FMOVSstore)
15112 v.AddArg3(ptr, val, mem)
15113 return true
15114 }
15115
15116
15117
15118 for {
15119 t := auxToType(v.Aux)
15120 ptr := v_0
15121 val := v_1
15122 mem := v_2
15123 if !(t.Size() == 8 && !t.IsFloat()) {
15124 break
15125 }
15126 v.reset(OpPPC64MOVDstore)
15127 v.AddArg3(ptr, val, mem)
15128 return true
15129 }
15130
15131
15132
15133 for {
15134 t := auxToType(v.Aux)
15135 ptr := v_0
15136 val := v_1
15137 mem := v_2
15138 if !(t.Size() == 4 && !t.IsFloat()) {
15139 break
15140 }
15141 v.reset(OpPPC64MOVWstore)
15142 v.AddArg3(ptr, val, mem)
15143 return true
15144 }
15145
15146
15147
15148 for {
15149 t := auxToType(v.Aux)
15150 ptr := v_0
15151 val := v_1
15152 mem := v_2
15153 if !(t.Size() == 2) {
15154 break
15155 }
15156 v.reset(OpPPC64MOVHstore)
15157 v.AddArg3(ptr, val, mem)
15158 return true
15159 }
15160
15161
15162
15163 for {
15164 t := auxToType(v.Aux)
15165 ptr := v_0
15166 val := v_1
15167 mem := v_2
15168 if !(t.Size() == 1) {
15169 break
15170 }
15171 v.reset(OpPPC64MOVBstore)
15172 v.AddArg3(ptr, val, mem)
15173 return true
15174 }
15175 return false
15176 }
15177 func rewriteValuePPC64_OpTrunc16to8(v *Value) bool {
15178 v_0 := v.Args[0]
15179
15180
15181
15182 for {
15183 t := v.Type
15184 x := v_0
15185 if !(t.IsSigned()) {
15186 break
15187 }
15188 v.reset(OpPPC64MOVBreg)
15189 v.AddArg(x)
15190 return true
15191 }
15192
15193
15194 for {
15195 x := v_0
15196 v.reset(OpPPC64MOVBZreg)
15197 v.AddArg(x)
15198 return true
15199 }
15200 }
15201 func rewriteValuePPC64_OpTrunc32to16(v *Value) bool {
15202 v_0 := v.Args[0]
15203
15204
15205
15206 for {
15207 t := v.Type
15208 x := v_0
15209 if !(t.IsSigned()) {
15210 break
15211 }
15212 v.reset(OpPPC64MOVHreg)
15213 v.AddArg(x)
15214 return true
15215 }
15216
15217
15218 for {
15219 x := v_0
15220 v.reset(OpPPC64MOVHZreg)
15221 v.AddArg(x)
15222 return true
15223 }
15224 }
15225 func rewriteValuePPC64_OpTrunc32to8(v *Value) bool {
15226 v_0 := v.Args[0]
15227
15228
15229
15230 for {
15231 t := v.Type
15232 x := v_0
15233 if !(t.IsSigned()) {
15234 break
15235 }
15236 v.reset(OpPPC64MOVBreg)
15237 v.AddArg(x)
15238 return true
15239 }
15240
15241
15242 for {
15243 x := v_0
15244 v.reset(OpPPC64MOVBZreg)
15245 v.AddArg(x)
15246 return true
15247 }
15248 }
15249 func rewriteValuePPC64_OpTrunc64to16(v *Value) bool {
15250 v_0 := v.Args[0]
15251
15252
15253
15254 for {
15255 t := v.Type
15256 x := v_0
15257 if !(t.IsSigned()) {
15258 break
15259 }
15260 v.reset(OpPPC64MOVHreg)
15261 v.AddArg(x)
15262 return true
15263 }
15264
15265
15266 for {
15267 x := v_0
15268 v.reset(OpPPC64MOVHZreg)
15269 v.AddArg(x)
15270 return true
15271 }
15272 }
15273 func rewriteValuePPC64_OpTrunc64to32(v *Value) bool {
15274 v_0 := v.Args[0]
15275
15276
15277
15278 for {
15279 t := v.Type
15280 x := v_0
15281 if !(t.IsSigned()) {
15282 break
15283 }
15284 v.reset(OpPPC64MOVWreg)
15285 v.AddArg(x)
15286 return true
15287 }
15288
15289
15290 for {
15291 x := v_0
15292 v.reset(OpPPC64MOVWZreg)
15293 v.AddArg(x)
15294 return true
15295 }
15296 }
15297 func rewriteValuePPC64_OpTrunc64to8(v *Value) bool {
15298 v_0 := v.Args[0]
15299
15300
15301
15302 for {
15303 t := v.Type
15304 x := v_0
15305 if !(t.IsSigned()) {
15306 break
15307 }
15308 v.reset(OpPPC64MOVBreg)
15309 v.AddArg(x)
15310 return true
15311 }
15312
15313
15314 for {
15315 x := v_0
15316 v.reset(OpPPC64MOVBZreg)
15317 v.AddArg(x)
15318 return true
15319 }
15320 }
15321 func rewriteValuePPC64_OpZero(v *Value) bool {
15322 v_1 := v.Args[1]
15323 v_0 := v.Args[0]
15324 b := v.Block
15325
15326
15327 for {
15328 if auxIntToInt64(v.AuxInt) != 0 {
15329 break
15330 }
15331 mem := v_1
15332 v.copyOf(mem)
15333 return true
15334 }
15335
15336
15337 for {
15338 if auxIntToInt64(v.AuxInt) != 1 {
15339 break
15340 }
15341 destptr := v_0
15342 mem := v_1
15343 v.reset(OpPPC64MOVBstorezero)
15344 v.AddArg2(destptr, mem)
15345 return true
15346 }
15347
15348
15349 for {
15350 if auxIntToInt64(v.AuxInt) != 2 {
15351 break
15352 }
15353 destptr := v_0
15354 mem := v_1
15355 v.reset(OpPPC64MOVHstorezero)
15356 v.AddArg2(destptr, mem)
15357 return true
15358 }
15359
15360
15361 for {
15362 if auxIntToInt64(v.AuxInt) != 3 {
15363 break
15364 }
15365 destptr := v_0
15366 mem := v_1
15367 v.reset(OpPPC64MOVBstorezero)
15368 v.AuxInt = int32ToAuxInt(2)
15369 v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
15370 v0.AddArg2(destptr, mem)
15371 v.AddArg2(destptr, v0)
15372 return true
15373 }
15374
15375
15376 for {
15377 if auxIntToInt64(v.AuxInt) != 4 {
15378 break
15379 }
15380 destptr := v_0
15381 mem := v_1
15382 v.reset(OpPPC64MOVWstorezero)
15383 v.AddArg2(destptr, mem)
15384 return true
15385 }
15386
15387
15388 for {
15389 if auxIntToInt64(v.AuxInt) != 5 {
15390 break
15391 }
15392 destptr := v_0
15393 mem := v_1
15394 v.reset(OpPPC64MOVBstorezero)
15395 v.AuxInt = int32ToAuxInt(4)
15396 v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
15397 v0.AddArg2(destptr, mem)
15398 v.AddArg2(destptr, v0)
15399 return true
15400 }
15401
15402
15403 for {
15404 if auxIntToInt64(v.AuxInt) != 6 {
15405 break
15406 }
15407 destptr := v_0
15408 mem := v_1
15409 v.reset(OpPPC64MOVHstorezero)
15410 v.AuxInt = int32ToAuxInt(4)
15411 v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
15412 v0.AddArg2(destptr, mem)
15413 v.AddArg2(destptr, v0)
15414 return true
15415 }
15416
15417
15418 for {
15419 if auxIntToInt64(v.AuxInt) != 7 {
15420 break
15421 }
15422 destptr := v_0
15423 mem := v_1
15424 v.reset(OpPPC64MOVBstorezero)
15425 v.AuxInt = int32ToAuxInt(6)
15426 v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
15427 v0.AuxInt = int32ToAuxInt(4)
15428 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
15429 v1.AddArg2(destptr, mem)
15430 v0.AddArg2(destptr, v1)
15431 v.AddArg2(destptr, v0)
15432 return true
15433 }
15434
15435
15436 for {
15437 if auxIntToInt64(v.AuxInt) != 8 {
15438 break
15439 }
15440 destptr := v_0
15441 mem := v_1
15442 v.reset(OpPPC64MOVDstorezero)
15443 v.AddArg2(destptr, mem)
15444 return true
15445 }
15446
15447
15448 for {
15449 if auxIntToInt64(v.AuxInt) != 12 {
15450 break
15451 }
15452 destptr := v_0
15453 mem := v_1
15454 v.reset(OpPPC64MOVWstorezero)
15455 v.AuxInt = int32ToAuxInt(8)
15456 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15457 v0.AuxInt = int32ToAuxInt(0)
15458 v0.AddArg2(destptr, mem)
15459 v.AddArg2(destptr, v0)
15460 return true
15461 }
15462
15463
15464 for {
15465 if auxIntToInt64(v.AuxInt) != 16 {
15466 break
15467 }
15468 destptr := v_0
15469 mem := v_1
15470 v.reset(OpPPC64MOVDstorezero)
15471 v.AuxInt = int32ToAuxInt(8)
15472 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15473 v0.AuxInt = int32ToAuxInt(0)
15474 v0.AddArg2(destptr, mem)
15475 v.AddArg2(destptr, v0)
15476 return true
15477 }
15478
15479
15480 for {
15481 if auxIntToInt64(v.AuxInt) != 24 {
15482 break
15483 }
15484 destptr := v_0
15485 mem := v_1
15486 v.reset(OpPPC64MOVDstorezero)
15487 v.AuxInt = int32ToAuxInt(16)
15488 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15489 v0.AuxInt = int32ToAuxInt(8)
15490 v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15491 v1.AuxInt = int32ToAuxInt(0)
15492 v1.AddArg2(destptr, mem)
15493 v0.AddArg2(destptr, v1)
15494 v.AddArg2(destptr, v0)
15495 return true
15496 }
15497
15498
15499 for {
15500 if auxIntToInt64(v.AuxInt) != 32 {
15501 break
15502 }
15503 destptr := v_0
15504 mem := v_1
15505 v.reset(OpPPC64MOVDstorezero)
15506 v.AuxInt = int32ToAuxInt(24)
15507 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15508 v0.AuxInt = int32ToAuxInt(16)
15509 v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15510 v1.AuxInt = int32ToAuxInt(8)
15511 v2 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15512 v2.AuxInt = int32ToAuxInt(0)
15513 v2.AddArg2(destptr, mem)
15514 v1.AddArg2(destptr, v2)
15515 v0.AddArg2(destptr, v1)
15516 v.AddArg2(destptr, v0)
15517 return true
15518 }
15519
15520
15521
15522 for {
15523 s := auxIntToInt64(v.AuxInt)
15524 ptr := v_0
15525 mem := v_1
15526 if !(buildcfg.GOPPC64 <= 8 && s < 64) {
15527 break
15528 }
15529 v.reset(OpPPC64LoweredZeroShort)
15530 v.AuxInt = int64ToAuxInt(s)
15531 v.AddArg2(ptr, mem)
15532 return true
15533 }
15534
15535
15536
15537 for {
15538 s := auxIntToInt64(v.AuxInt)
15539 ptr := v_0
15540 mem := v_1
15541 if !(buildcfg.GOPPC64 <= 8) {
15542 break
15543 }
15544 v.reset(OpPPC64LoweredZero)
15545 v.AuxInt = int64ToAuxInt(s)
15546 v.AddArg2(ptr, mem)
15547 return true
15548 }
15549
15550
15551
15552 for {
15553 s := auxIntToInt64(v.AuxInt)
15554 ptr := v_0
15555 mem := v_1
15556 if !(s < 128 && buildcfg.GOPPC64 >= 9) {
15557 break
15558 }
15559 v.reset(OpPPC64LoweredQuadZeroShort)
15560 v.AuxInt = int64ToAuxInt(s)
15561 v.AddArg2(ptr, mem)
15562 return true
15563 }
15564
15565
15566
15567 for {
15568 s := auxIntToInt64(v.AuxInt)
15569 ptr := v_0
15570 mem := v_1
15571 if !(buildcfg.GOPPC64 >= 9) {
15572 break
15573 }
15574 v.reset(OpPPC64LoweredQuadZero)
15575 v.AuxInt = int64ToAuxInt(s)
15576 v.AddArg2(ptr, mem)
15577 return true
15578 }
15579 return false
15580 }
15581 func rewriteBlockPPC64(b *Block) bool {
15582 typ := &b.Func.Config.Types
15583 switch b.Kind {
15584 case BlockPPC64EQ:
15585
15586
15587 for b.Controls[0].Op == OpPPC64FlagEQ {
15588 b.Reset(BlockFirst)
15589 return true
15590 }
15591
15592
15593 for b.Controls[0].Op == OpPPC64FlagLT {
15594 b.Reset(BlockFirst)
15595 b.swapSuccessors()
15596 return true
15597 }
15598
15599
15600 for b.Controls[0].Op == OpPPC64FlagGT {
15601 b.Reset(BlockFirst)
15602 b.swapSuccessors()
15603 return true
15604 }
15605
15606
15607 for b.Controls[0].Op == OpPPC64InvertFlags {
15608 v_0 := b.Controls[0]
15609 cmp := v_0.Args[0]
15610 b.resetWithControl(BlockPPC64EQ, cmp)
15611 return true
15612 }
15613
15614
15615
15616 for b.Controls[0].Op == OpPPC64CMPconst {
15617 v_0 := b.Controls[0]
15618 if auxIntToInt64(v_0.AuxInt) != 0 {
15619 break
15620 }
15621 z := v_0.Args[0]
15622 if z.Op != OpPPC64AND {
15623 break
15624 }
15625 _ = z.Args[1]
15626 z_0 := z.Args[0]
15627 z_1 := z.Args[1]
15628 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15629 x := z_0
15630 y := z_1
15631 if !(z.Uses == 1) {
15632 continue
15633 }
15634 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15635 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15636 v1.AddArg2(x, y)
15637 v0.AddArg(v1)
15638 b.resetWithControl(BlockPPC64EQ, v0)
15639 return true
15640 }
15641 break
15642 }
15643
15644
15645
15646 for b.Controls[0].Op == OpPPC64CMPconst {
15647 v_0 := b.Controls[0]
15648 if auxIntToInt64(v_0.AuxInt) != 0 {
15649 break
15650 }
15651 z := v_0.Args[0]
15652 if z.Op != OpPPC64OR {
15653 break
15654 }
15655 _ = z.Args[1]
15656 z_0 := z.Args[0]
15657 z_1 := z.Args[1]
15658 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15659 x := z_0
15660 y := z_1
15661 if !(z.Uses == 1) {
15662 continue
15663 }
15664 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15665 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
15666 v1.AddArg2(x, y)
15667 v0.AddArg(v1)
15668 b.resetWithControl(BlockPPC64EQ, v0)
15669 return true
15670 }
15671 break
15672 }
15673
15674
15675
15676 for b.Controls[0].Op == OpPPC64CMPconst {
15677 v_0 := b.Controls[0]
15678 if auxIntToInt64(v_0.AuxInt) != 0 {
15679 break
15680 }
15681 z := v_0.Args[0]
15682 if z.Op != OpPPC64XOR {
15683 break
15684 }
15685 _ = z.Args[1]
15686 z_0 := z.Args[0]
15687 z_1 := z.Args[1]
15688 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15689 x := z_0
15690 y := z_1
15691 if !(z.Uses == 1) {
15692 continue
15693 }
15694 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15695 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
15696 v1.AddArg2(x, y)
15697 v0.AddArg(v1)
15698 b.resetWithControl(BlockPPC64EQ, v0)
15699 return true
15700 }
15701 break
15702 }
15703 case BlockPPC64GE:
15704
15705
15706 for b.Controls[0].Op == OpPPC64FlagEQ {
15707 b.Reset(BlockFirst)
15708 return true
15709 }
15710
15711
15712 for b.Controls[0].Op == OpPPC64FlagLT {
15713 b.Reset(BlockFirst)
15714 b.swapSuccessors()
15715 return true
15716 }
15717
15718
15719 for b.Controls[0].Op == OpPPC64FlagGT {
15720 b.Reset(BlockFirst)
15721 return true
15722 }
15723
15724
15725 for b.Controls[0].Op == OpPPC64InvertFlags {
15726 v_0 := b.Controls[0]
15727 cmp := v_0.Args[0]
15728 b.resetWithControl(BlockPPC64LE, cmp)
15729 return true
15730 }
15731
15732
15733
15734 for b.Controls[0].Op == OpPPC64CMPconst {
15735 v_0 := b.Controls[0]
15736 if auxIntToInt64(v_0.AuxInt) != 0 {
15737 break
15738 }
15739 z := v_0.Args[0]
15740 if z.Op != OpPPC64AND {
15741 break
15742 }
15743 _ = z.Args[1]
15744 z_0 := z.Args[0]
15745 z_1 := z.Args[1]
15746 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15747 x := z_0
15748 y := z_1
15749 if !(z.Uses == 1) {
15750 continue
15751 }
15752 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15753 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15754 v1.AddArg2(x, y)
15755 v0.AddArg(v1)
15756 b.resetWithControl(BlockPPC64GE, v0)
15757 return true
15758 }
15759 break
15760 }
15761
15762
15763
15764 for b.Controls[0].Op == OpPPC64CMPconst {
15765 v_0 := b.Controls[0]
15766 if auxIntToInt64(v_0.AuxInt) != 0 {
15767 break
15768 }
15769 z := v_0.Args[0]
15770 if z.Op != OpPPC64OR {
15771 break
15772 }
15773 _ = z.Args[1]
15774 z_0 := z.Args[0]
15775 z_1 := z.Args[1]
15776 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15777 x := z_0
15778 y := z_1
15779 if !(z.Uses == 1) {
15780 continue
15781 }
15782 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15783 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
15784 v1.AddArg2(x, y)
15785 v0.AddArg(v1)
15786 b.resetWithControl(BlockPPC64GE, v0)
15787 return true
15788 }
15789 break
15790 }
15791
15792
15793
15794 for b.Controls[0].Op == OpPPC64CMPconst {
15795 v_0 := b.Controls[0]
15796 if auxIntToInt64(v_0.AuxInt) != 0 {
15797 break
15798 }
15799 z := v_0.Args[0]
15800 if z.Op != OpPPC64XOR {
15801 break
15802 }
15803 _ = z.Args[1]
15804 z_0 := z.Args[0]
15805 z_1 := z.Args[1]
15806 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15807 x := z_0
15808 y := z_1
15809 if !(z.Uses == 1) {
15810 continue
15811 }
15812 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15813 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
15814 v1.AddArg2(x, y)
15815 v0.AddArg(v1)
15816 b.resetWithControl(BlockPPC64GE, v0)
15817 return true
15818 }
15819 break
15820 }
15821 case BlockPPC64GT:
15822
15823
15824 for b.Controls[0].Op == OpPPC64FlagEQ {
15825 b.Reset(BlockFirst)
15826 b.swapSuccessors()
15827 return true
15828 }
15829
15830
15831 for b.Controls[0].Op == OpPPC64FlagLT {
15832 b.Reset(BlockFirst)
15833 b.swapSuccessors()
15834 return true
15835 }
15836
15837
15838 for b.Controls[0].Op == OpPPC64FlagGT {
15839 b.Reset(BlockFirst)
15840 return true
15841 }
15842
15843
15844 for b.Controls[0].Op == OpPPC64InvertFlags {
15845 v_0 := b.Controls[0]
15846 cmp := v_0.Args[0]
15847 b.resetWithControl(BlockPPC64LT, cmp)
15848 return true
15849 }
15850
15851
15852
15853 for b.Controls[0].Op == OpPPC64CMPconst {
15854 v_0 := b.Controls[0]
15855 if auxIntToInt64(v_0.AuxInt) != 0 {
15856 break
15857 }
15858 z := v_0.Args[0]
15859 if z.Op != OpPPC64AND {
15860 break
15861 }
15862 _ = z.Args[1]
15863 z_0 := z.Args[0]
15864 z_1 := z.Args[1]
15865 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15866 x := z_0
15867 y := z_1
15868 if !(z.Uses == 1) {
15869 continue
15870 }
15871 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15872 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15873 v1.AddArg2(x, y)
15874 v0.AddArg(v1)
15875 b.resetWithControl(BlockPPC64GT, v0)
15876 return true
15877 }
15878 break
15879 }
15880
15881
15882
15883 for b.Controls[0].Op == OpPPC64CMPconst {
15884 v_0 := b.Controls[0]
15885 if auxIntToInt64(v_0.AuxInt) != 0 {
15886 break
15887 }
15888 z := v_0.Args[0]
15889 if z.Op != OpPPC64OR {
15890 break
15891 }
15892 _ = z.Args[1]
15893 z_0 := z.Args[0]
15894 z_1 := z.Args[1]
15895 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15896 x := z_0
15897 y := z_1
15898 if !(z.Uses == 1) {
15899 continue
15900 }
15901 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15902 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
15903 v1.AddArg2(x, y)
15904 v0.AddArg(v1)
15905 b.resetWithControl(BlockPPC64GT, v0)
15906 return true
15907 }
15908 break
15909 }
15910
15911
15912
15913 for b.Controls[0].Op == OpPPC64CMPconst {
15914 v_0 := b.Controls[0]
15915 if auxIntToInt64(v_0.AuxInt) != 0 {
15916 break
15917 }
15918 z := v_0.Args[0]
15919 if z.Op != OpPPC64XOR {
15920 break
15921 }
15922 _ = z.Args[1]
15923 z_0 := z.Args[0]
15924 z_1 := z.Args[1]
15925 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15926 x := z_0
15927 y := z_1
15928 if !(z.Uses == 1) {
15929 continue
15930 }
15931 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15932 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
15933 v1.AddArg2(x, y)
15934 v0.AddArg(v1)
15935 b.resetWithControl(BlockPPC64GT, v0)
15936 return true
15937 }
15938 break
15939 }
15940 case BlockIf:
15941
15942
15943 for b.Controls[0].Op == OpPPC64Equal {
15944 v_0 := b.Controls[0]
15945 cc := v_0.Args[0]
15946 b.resetWithControl(BlockPPC64EQ, cc)
15947 return true
15948 }
15949
15950
15951 for b.Controls[0].Op == OpPPC64NotEqual {
15952 v_0 := b.Controls[0]
15953 cc := v_0.Args[0]
15954 b.resetWithControl(BlockPPC64NE, cc)
15955 return true
15956 }
15957
15958
15959 for b.Controls[0].Op == OpPPC64LessThan {
15960 v_0 := b.Controls[0]
15961 cc := v_0.Args[0]
15962 b.resetWithControl(BlockPPC64LT, cc)
15963 return true
15964 }
15965
15966
15967 for b.Controls[0].Op == OpPPC64LessEqual {
15968 v_0 := b.Controls[0]
15969 cc := v_0.Args[0]
15970 b.resetWithControl(BlockPPC64LE, cc)
15971 return true
15972 }
15973
15974
15975 for b.Controls[0].Op == OpPPC64GreaterThan {
15976 v_0 := b.Controls[0]
15977 cc := v_0.Args[0]
15978 b.resetWithControl(BlockPPC64GT, cc)
15979 return true
15980 }
15981
15982
15983 for b.Controls[0].Op == OpPPC64GreaterEqual {
15984 v_0 := b.Controls[0]
15985 cc := v_0.Args[0]
15986 b.resetWithControl(BlockPPC64GE, cc)
15987 return true
15988 }
15989
15990
15991 for b.Controls[0].Op == OpPPC64FLessThan {
15992 v_0 := b.Controls[0]
15993 cc := v_0.Args[0]
15994 b.resetWithControl(BlockPPC64FLT, cc)
15995 return true
15996 }
15997
15998
15999 for b.Controls[0].Op == OpPPC64FLessEqual {
16000 v_0 := b.Controls[0]
16001 cc := v_0.Args[0]
16002 b.resetWithControl(BlockPPC64FLE, cc)
16003 return true
16004 }
16005
16006
16007 for b.Controls[0].Op == OpPPC64FGreaterThan {
16008 v_0 := b.Controls[0]
16009 cc := v_0.Args[0]
16010 b.resetWithControl(BlockPPC64FGT, cc)
16011 return true
16012 }
16013
16014
16015 for b.Controls[0].Op == OpPPC64FGreaterEqual {
16016 v_0 := b.Controls[0]
16017 cc := v_0.Args[0]
16018 b.resetWithControl(BlockPPC64FGE, cc)
16019 return true
16020 }
16021
16022
16023 for {
16024 cond := b.Controls[0]
16025 v0 := b.NewValue0(cond.Pos, OpPPC64CMPconst, types.TypeFlags)
16026 v0.AuxInt = int64ToAuxInt(0)
16027 v1 := b.NewValue0(cond.Pos, OpPPC64ANDconst, typ.Int)
16028 v1.AuxInt = int64ToAuxInt(1)
16029 v1.AddArg(cond)
16030 v0.AddArg(v1)
16031 b.resetWithControl(BlockPPC64NE, v0)
16032 return true
16033 }
16034 case BlockPPC64LE:
16035
16036
16037 for b.Controls[0].Op == OpPPC64FlagEQ {
16038 b.Reset(BlockFirst)
16039 return true
16040 }
16041
16042
16043 for b.Controls[0].Op == OpPPC64FlagLT {
16044 b.Reset(BlockFirst)
16045 return true
16046 }
16047
16048
16049 for b.Controls[0].Op == OpPPC64FlagGT {
16050 b.Reset(BlockFirst)
16051 b.swapSuccessors()
16052 return true
16053 }
16054
16055
16056 for b.Controls[0].Op == OpPPC64InvertFlags {
16057 v_0 := b.Controls[0]
16058 cmp := v_0.Args[0]
16059 b.resetWithControl(BlockPPC64GE, cmp)
16060 return true
16061 }
16062
16063
16064
16065 for b.Controls[0].Op == OpPPC64CMPconst {
16066 v_0 := b.Controls[0]
16067 if auxIntToInt64(v_0.AuxInt) != 0 {
16068 break
16069 }
16070 z := v_0.Args[0]
16071 if z.Op != OpPPC64AND {
16072 break
16073 }
16074 _ = z.Args[1]
16075 z_0 := z.Args[0]
16076 z_1 := z.Args[1]
16077 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16078 x := z_0
16079 y := z_1
16080 if !(z.Uses == 1) {
16081 continue
16082 }
16083 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16084 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
16085 v1.AddArg2(x, y)
16086 v0.AddArg(v1)
16087 b.resetWithControl(BlockPPC64LE, v0)
16088 return true
16089 }
16090 break
16091 }
16092
16093
16094
16095 for b.Controls[0].Op == OpPPC64CMPconst {
16096 v_0 := b.Controls[0]
16097 if auxIntToInt64(v_0.AuxInt) != 0 {
16098 break
16099 }
16100 z := v_0.Args[0]
16101 if z.Op != OpPPC64OR {
16102 break
16103 }
16104 _ = z.Args[1]
16105 z_0 := z.Args[0]
16106 z_1 := z.Args[1]
16107 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16108 x := z_0
16109 y := z_1
16110 if !(z.Uses == 1) {
16111 continue
16112 }
16113 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16114 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
16115 v1.AddArg2(x, y)
16116 v0.AddArg(v1)
16117 b.resetWithControl(BlockPPC64LE, v0)
16118 return true
16119 }
16120 break
16121 }
16122
16123
16124
16125 for b.Controls[0].Op == OpPPC64CMPconst {
16126 v_0 := b.Controls[0]
16127 if auxIntToInt64(v_0.AuxInt) != 0 {
16128 break
16129 }
16130 z := v_0.Args[0]
16131 if z.Op != OpPPC64XOR {
16132 break
16133 }
16134 _ = z.Args[1]
16135 z_0 := z.Args[0]
16136 z_1 := z.Args[1]
16137 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16138 x := z_0
16139 y := z_1
16140 if !(z.Uses == 1) {
16141 continue
16142 }
16143 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16144 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
16145 v1.AddArg2(x, y)
16146 v0.AddArg(v1)
16147 b.resetWithControl(BlockPPC64LE, v0)
16148 return true
16149 }
16150 break
16151 }
16152 case BlockPPC64LT:
16153
16154
16155 for b.Controls[0].Op == OpPPC64FlagEQ {
16156 b.Reset(BlockFirst)
16157 b.swapSuccessors()
16158 return true
16159 }
16160
16161
16162 for b.Controls[0].Op == OpPPC64FlagLT {
16163 b.Reset(BlockFirst)
16164 return true
16165 }
16166
16167
16168 for b.Controls[0].Op == OpPPC64FlagGT {
16169 b.Reset(BlockFirst)
16170 b.swapSuccessors()
16171 return true
16172 }
16173
16174
16175 for b.Controls[0].Op == OpPPC64InvertFlags {
16176 v_0 := b.Controls[0]
16177 cmp := v_0.Args[0]
16178 b.resetWithControl(BlockPPC64GT, cmp)
16179 return true
16180 }
16181
16182
16183
16184 for b.Controls[0].Op == OpPPC64CMPconst {
16185 v_0 := b.Controls[0]
16186 if auxIntToInt64(v_0.AuxInt) != 0 {
16187 break
16188 }
16189 z := v_0.Args[0]
16190 if z.Op != OpPPC64AND {
16191 break
16192 }
16193 _ = z.Args[1]
16194 z_0 := z.Args[0]
16195 z_1 := z.Args[1]
16196 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16197 x := z_0
16198 y := z_1
16199 if !(z.Uses == 1) {
16200 continue
16201 }
16202 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16203 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
16204 v1.AddArg2(x, y)
16205 v0.AddArg(v1)
16206 b.resetWithControl(BlockPPC64LT, v0)
16207 return true
16208 }
16209 break
16210 }
16211
16212
16213
16214 for b.Controls[0].Op == OpPPC64CMPconst {
16215 v_0 := b.Controls[0]
16216 if auxIntToInt64(v_0.AuxInt) != 0 {
16217 break
16218 }
16219 z := v_0.Args[0]
16220 if z.Op != OpPPC64OR {
16221 break
16222 }
16223 _ = z.Args[1]
16224 z_0 := z.Args[0]
16225 z_1 := z.Args[1]
16226 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16227 x := z_0
16228 y := z_1
16229 if !(z.Uses == 1) {
16230 continue
16231 }
16232 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16233 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
16234 v1.AddArg2(x, y)
16235 v0.AddArg(v1)
16236 b.resetWithControl(BlockPPC64LT, v0)
16237 return true
16238 }
16239 break
16240 }
16241
16242
16243
16244 for b.Controls[0].Op == OpPPC64CMPconst {
16245 v_0 := b.Controls[0]
16246 if auxIntToInt64(v_0.AuxInt) != 0 {
16247 break
16248 }
16249 z := v_0.Args[0]
16250 if z.Op != OpPPC64XOR {
16251 break
16252 }
16253 _ = z.Args[1]
16254 z_0 := z.Args[0]
16255 z_1 := z.Args[1]
16256 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16257 x := z_0
16258 y := z_1
16259 if !(z.Uses == 1) {
16260 continue
16261 }
16262 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16263 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
16264 v1.AddArg2(x, y)
16265 v0.AddArg(v1)
16266 b.resetWithControl(BlockPPC64LT, v0)
16267 return true
16268 }
16269 break
16270 }
16271 case BlockPPC64NE:
16272
16273
16274 for b.Controls[0].Op == OpPPC64CMPconst {
16275 v_0 := b.Controls[0]
16276 if auxIntToInt64(v_0.AuxInt) != 0 {
16277 break
16278 }
16279 v_0_0 := v_0.Args[0]
16280 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16281 break
16282 }
16283 v_0_0_0 := v_0_0.Args[0]
16284 if v_0_0_0.Op != OpPPC64Equal {
16285 break
16286 }
16287 cc := v_0_0_0.Args[0]
16288 b.resetWithControl(BlockPPC64EQ, cc)
16289 return true
16290 }
16291
16292
16293 for b.Controls[0].Op == OpPPC64CMPconst {
16294 v_0 := b.Controls[0]
16295 if auxIntToInt64(v_0.AuxInt) != 0 {
16296 break
16297 }
16298 v_0_0 := v_0.Args[0]
16299 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16300 break
16301 }
16302 v_0_0_0 := v_0_0.Args[0]
16303 if v_0_0_0.Op != OpPPC64NotEqual {
16304 break
16305 }
16306 cc := v_0_0_0.Args[0]
16307 b.resetWithControl(BlockPPC64NE, cc)
16308 return true
16309 }
16310
16311
16312 for b.Controls[0].Op == OpPPC64CMPconst {
16313 v_0 := b.Controls[0]
16314 if auxIntToInt64(v_0.AuxInt) != 0 {
16315 break
16316 }
16317 v_0_0 := v_0.Args[0]
16318 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16319 break
16320 }
16321 v_0_0_0 := v_0_0.Args[0]
16322 if v_0_0_0.Op != OpPPC64LessThan {
16323 break
16324 }
16325 cc := v_0_0_0.Args[0]
16326 b.resetWithControl(BlockPPC64LT, cc)
16327 return true
16328 }
16329
16330
16331 for b.Controls[0].Op == OpPPC64CMPconst {
16332 v_0 := b.Controls[0]
16333 if auxIntToInt64(v_0.AuxInt) != 0 {
16334 break
16335 }
16336 v_0_0 := v_0.Args[0]
16337 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16338 break
16339 }
16340 v_0_0_0 := v_0_0.Args[0]
16341 if v_0_0_0.Op != OpPPC64LessEqual {
16342 break
16343 }
16344 cc := v_0_0_0.Args[0]
16345 b.resetWithControl(BlockPPC64LE, cc)
16346 return true
16347 }
16348
16349
16350 for b.Controls[0].Op == OpPPC64CMPconst {
16351 v_0 := b.Controls[0]
16352 if auxIntToInt64(v_0.AuxInt) != 0 {
16353 break
16354 }
16355 v_0_0 := v_0.Args[0]
16356 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16357 break
16358 }
16359 v_0_0_0 := v_0_0.Args[0]
16360 if v_0_0_0.Op != OpPPC64GreaterThan {
16361 break
16362 }
16363 cc := v_0_0_0.Args[0]
16364 b.resetWithControl(BlockPPC64GT, cc)
16365 return true
16366 }
16367
16368
16369 for b.Controls[0].Op == OpPPC64CMPconst {
16370 v_0 := b.Controls[0]
16371 if auxIntToInt64(v_0.AuxInt) != 0 {
16372 break
16373 }
16374 v_0_0 := v_0.Args[0]
16375 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16376 break
16377 }
16378 v_0_0_0 := v_0_0.Args[0]
16379 if v_0_0_0.Op != OpPPC64GreaterEqual {
16380 break
16381 }
16382 cc := v_0_0_0.Args[0]
16383 b.resetWithControl(BlockPPC64GE, cc)
16384 return true
16385 }
16386
16387
16388 for b.Controls[0].Op == OpPPC64CMPconst {
16389 v_0 := b.Controls[0]
16390 if auxIntToInt64(v_0.AuxInt) != 0 {
16391 break
16392 }
16393 v_0_0 := v_0.Args[0]
16394 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16395 break
16396 }
16397 v_0_0_0 := v_0_0.Args[0]
16398 if v_0_0_0.Op != OpPPC64FLessThan {
16399 break
16400 }
16401 cc := v_0_0_0.Args[0]
16402 b.resetWithControl(BlockPPC64FLT, cc)
16403 return true
16404 }
16405
16406
16407 for b.Controls[0].Op == OpPPC64CMPconst {
16408 v_0 := b.Controls[0]
16409 if auxIntToInt64(v_0.AuxInt) != 0 {
16410 break
16411 }
16412 v_0_0 := v_0.Args[0]
16413 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16414 break
16415 }
16416 v_0_0_0 := v_0_0.Args[0]
16417 if v_0_0_0.Op != OpPPC64FLessEqual {
16418 break
16419 }
16420 cc := v_0_0_0.Args[0]
16421 b.resetWithControl(BlockPPC64FLE, cc)
16422 return true
16423 }
16424
16425
16426 for b.Controls[0].Op == OpPPC64CMPconst {
16427 v_0 := b.Controls[0]
16428 if auxIntToInt64(v_0.AuxInt) != 0 {
16429 break
16430 }
16431 v_0_0 := v_0.Args[0]
16432 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16433 break
16434 }
16435 v_0_0_0 := v_0_0.Args[0]
16436 if v_0_0_0.Op != OpPPC64FGreaterThan {
16437 break
16438 }
16439 cc := v_0_0_0.Args[0]
16440 b.resetWithControl(BlockPPC64FGT, cc)
16441 return true
16442 }
16443
16444
16445 for b.Controls[0].Op == OpPPC64CMPconst {
16446 v_0 := b.Controls[0]
16447 if auxIntToInt64(v_0.AuxInt) != 0 {
16448 break
16449 }
16450 v_0_0 := v_0.Args[0]
16451 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16452 break
16453 }
16454 v_0_0_0 := v_0_0.Args[0]
16455 if v_0_0_0.Op != OpPPC64FGreaterEqual {
16456 break
16457 }
16458 cc := v_0_0_0.Args[0]
16459 b.resetWithControl(BlockPPC64FGE, cc)
16460 return true
16461 }
16462
16463
16464 for b.Controls[0].Op == OpPPC64FlagEQ {
16465 b.Reset(BlockFirst)
16466 b.swapSuccessors()
16467 return true
16468 }
16469
16470
16471 for b.Controls[0].Op == OpPPC64FlagLT {
16472 b.Reset(BlockFirst)
16473 return true
16474 }
16475
16476
16477 for b.Controls[0].Op == OpPPC64FlagGT {
16478 b.Reset(BlockFirst)
16479 return true
16480 }
16481
16482
16483 for b.Controls[0].Op == OpPPC64InvertFlags {
16484 v_0 := b.Controls[0]
16485 cmp := v_0.Args[0]
16486 b.resetWithControl(BlockPPC64NE, cmp)
16487 return true
16488 }
16489
16490
16491
16492 for b.Controls[0].Op == OpPPC64CMPconst {
16493 v_0 := b.Controls[0]
16494 if auxIntToInt64(v_0.AuxInt) != 0 {
16495 break
16496 }
16497 z := v_0.Args[0]
16498 if z.Op != OpPPC64AND {
16499 break
16500 }
16501 _ = z.Args[1]
16502 z_0 := z.Args[0]
16503 z_1 := z.Args[1]
16504 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16505 x := z_0
16506 y := z_1
16507 if !(z.Uses == 1) {
16508 continue
16509 }
16510 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16511 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
16512 v1.AddArg2(x, y)
16513 v0.AddArg(v1)
16514 b.resetWithControl(BlockPPC64NE, v0)
16515 return true
16516 }
16517 break
16518 }
16519
16520
16521
16522 for b.Controls[0].Op == OpPPC64CMPconst {
16523 v_0 := b.Controls[0]
16524 if auxIntToInt64(v_0.AuxInt) != 0 {
16525 break
16526 }
16527 z := v_0.Args[0]
16528 if z.Op != OpPPC64OR {
16529 break
16530 }
16531 _ = z.Args[1]
16532 z_0 := z.Args[0]
16533 z_1 := z.Args[1]
16534 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16535 x := z_0
16536 y := z_1
16537 if !(z.Uses == 1) {
16538 continue
16539 }
16540 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16541 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
16542 v1.AddArg2(x, y)
16543 v0.AddArg(v1)
16544 b.resetWithControl(BlockPPC64NE, v0)
16545 return true
16546 }
16547 break
16548 }
16549
16550
16551
16552 for b.Controls[0].Op == OpPPC64CMPconst {
16553 v_0 := b.Controls[0]
16554 if auxIntToInt64(v_0.AuxInt) != 0 {
16555 break
16556 }
16557 z := v_0.Args[0]
16558 if z.Op != OpPPC64XOR {
16559 break
16560 }
16561 _ = z.Args[1]
16562 z_0 := z.Args[0]
16563 z_1 := z.Args[1]
16564 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16565 x := z_0
16566 y := z_1
16567 if !(z.Uses == 1) {
16568 continue
16569 }
16570 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16571 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
16572 v1.AddArg2(x, y)
16573 v0.AddArg(v1)
16574 b.resetWithControl(BlockPPC64NE, v0)
16575 return true
16576 }
16577 break
16578 }
16579 }
16580 return false
16581 }
16582
View as plain text