1 // Code generated from gen/PPC64.rules; DO NOT EDIT.
2 // generated with: cd gen; go run *.go
7 import "cmd/internal/objabi"
8 import "cmd/compile/internal/types"
10 func rewriteValuePPC64(v *Value) bool {
31 v.Op = OpPPC64LoweredAdd64Carry
40 return rewriteValuePPC64_OpAddr(v)
57 v.Op = OpPPC64LoweredAtomicAdd32
60 v.Op = OpPPC64LoweredAtomicAdd64
63 v.Op = OpPPC64LoweredAtomicAnd32
66 v.Op = OpPPC64LoweredAtomicAnd8
68 case OpAtomicCompareAndSwap32:
69 return rewriteValuePPC64_OpAtomicCompareAndSwap32(v)
70 case OpAtomicCompareAndSwap64:
71 return rewriteValuePPC64_OpAtomicCompareAndSwap64(v)
72 case OpAtomicCompareAndSwapRel32:
73 return rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v)
74 case OpAtomicExchange32:
75 v.Op = OpPPC64LoweredAtomicExchange32
77 case OpAtomicExchange64:
78 v.Op = OpPPC64LoweredAtomicExchange64
81 return rewriteValuePPC64_OpAtomicLoad32(v)
83 return rewriteValuePPC64_OpAtomicLoad64(v)
85 return rewriteValuePPC64_OpAtomicLoad8(v)
86 case OpAtomicLoadAcq32:
87 return rewriteValuePPC64_OpAtomicLoadAcq32(v)
88 case OpAtomicLoadAcq64:
89 return rewriteValuePPC64_OpAtomicLoadAcq64(v)
91 return rewriteValuePPC64_OpAtomicLoadPtr(v)
93 v.Op = OpPPC64LoweredAtomicOr32
96 v.Op = OpPPC64LoweredAtomicOr8
99 return rewriteValuePPC64_OpAtomicStore32(v)
100 case OpAtomicStore64:
101 return rewriteValuePPC64_OpAtomicStore64(v)
103 return rewriteValuePPC64_OpAtomicStore8(v)
104 case OpAtomicStoreRel32:
105 return rewriteValuePPC64_OpAtomicStoreRel32(v)
106 case OpAtomicStoreRel64:
107 return rewriteValuePPC64_OpAtomicStoreRel64(v)
109 return rewriteValuePPC64_OpAvg64u(v)
111 return rewriteValuePPC64_OpBitLen32(v)
113 return rewriteValuePPC64_OpBitLen64(v)
118 v.Op = OpPPC64CALLclosure
121 return rewriteValuePPC64_OpCom16(v)
123 return rewriteValuePPC64_OpCom32(v)
125 return rewriteValuePPC64_OpCom64(v)
127 return rewriteValuePPC64_OpCom8(v)
129 return rewriteValuePPC64_OpCondSelect(v)
131 return rewriteValuePPC64_OpConst16(v)
133 return rewriteValuePPC64_OpConst32(v)
135 v.Op = OpPPC64FMOVSconst
138 return rewriteValuePPC64_OpConst64(v)
140 v.Op = OpPPC64FMOVDconst
143 return rewriteValuePPC64_OpConst8(v)
145 return rewriteValuePPC64_OpConstBool(v)
147 return rewriteValuePPC64_OpConstNil(v)
149 return rewriteValuePPC64_OpCopysign(v)
151 return rewriteValuePPC64_OpCtz16(v)
153 return rewriteValuePPC64_OpCtz32(v)
158 return rewriteValuePPC64_OpCtz64(v)
163 return rewriteValuePPC64_OpCtz8(v)
165 return rewriteValuePPC64_OpCvt32Fto32(v)
167 return rewriteValuePPC64_OpCvt32Fto64(v)
172 return rewriteValuePPC64_OpCvt32to32F(v)
174 return rewriteValuePPC64_OpCvt32to64F(v)
176 return rewriteValuePPC64_OpCvt64Fto32(v)
181 return rewriteValuePPC64_OpCvt64Fto64(v)
183 return rewriteValuePPC64_OpCvt64to32F(v)
185 return rewriteValuePPC64_OpCvt64to64F(v)
186 case OpCvtBoolToUint8:
190 return rewriteValuePPC64_OpDiv16(v)
192 return rewriteValuePPC64_OpDiv16u(v)
194 return rewriteValuePPC64_OpDiv32(v)
202 return rewriteValuePPC64_OpDiv64(v)
210 return rewriteValuePPC64_OpDiv8(v)
212 return rewriteValuePPC64_OpDiv8u(v)
214 return rewriteValuePPC64_OpEq16(v)
216 return rewriteValuePPC64_OpEq32(v)
218 return rewriteValuePPC64_OpEq32F(v)
220 return rewriteValuePPC64_OpEq64(v)
222 return rewriteValuePPC64_OpEq64F(v)
224 return rewriteValuePPC64_OpEq8(v)
226 return rewriteValuePPC64_OpEqB(v)
228 return rewriteValuePPC64_OpEqPtr(v)
236 v.Op = OpPPC64LoweredGetCallerPC
239 v.Op = OpPPC64LoweredGetCallerSP
241 case OpGetClosurePtr:
242 v.Op = OpPPC64LoweredGetClosurePtr
257 v.Op = OpPPC64CALLinter
260 return rewriteValuePPC64_OpIsInBounds(v)
262 return rewriteValuePPC64_OpIsNonNil(v)
263 case OpIsSliceInBounds:
264 return rewriteValuePPC64_OpIsSliceInBounds(v)
266 return rewriteValuePPC64_OpLeq16(v)
268 return rewriteValuePPC64_OpLeq16U(v)
270 return rewriteValuePPC64_OpLeq32(v)
272 return rewriteValuePPC64_OpLeq32F(v)
274 return rewriteValuePPC64_OpLeq32U(v)
276 return rewriteValuePPC64_OpLeq64(v)
278 return rewriteValuePPC64_OpLeq64F(v)
280 return rewriteValuePPC64_OpLeq64U(v)
282 return rewriteValuePPC64_OpLeq8(v)
284 return rewriteValuePPC64_OpLeq8U(v)
286 return rewriteValuePPC64_OpLess16(v)
288 return rewriteValuePPC64_OpLess16U(v)
290 return rewriteValuePPC64_OpLess32(v)
292 return rewriteValuePPC64_OpLess32F(v)
294 return rewriteValuePPC64_OpLess32U(v)
296 return rewriteValuePPC64_OpLess64(v)
298 return rewriteValuePPC64_OpLess64F(v)
300 return rewriteValuePPC64_OpLess64U(v)
302 return rewriteValuePPC64_OpLess8(v)
304 return rewriteValuePPC64_OpLess8U(v)
306 return rewriteValuePPC64_OpLoad(v)
308 return rewriteValuePPC64_OpLocalAddr(v)
310 return rewriteValuePPC64_OpLsh16x16(v)
312 return rewriteValuePPC64_OpLsh16x32(v)
314 return rewriteValuePPC64_OpLsh16x64(v)
316 return rewriteValuePPC64_OpLsh16x8(v)
318 return rewriteValuePPC64_OpLsh32x16(v)
320 return rewriteValuePPC64_OpLsh32x32(v)
322 return rewriteValuePPC64_OpLsh32x64(v)
324 return rewriteValuePPC64_OpLsh32x8(v)
326 return rewriteValuePPC64_OpLsh64x16(v)
328 return rewriteValuePPC64_OpLsh64x32(v)
330 return rewriteValuePPC64_OpLsh64x64(v)
332 return rewriteValuePPC64_OpLsh64x8(v)
334 return rewriteValuePPC64_OpLsh8x16(v)
336 return rewriteValuePPC64_OpLsh8x32(v)
338 return rewriteValuePPC64_OpLsh8x64(v)
340 return rewriteValuePPC64_OpLsh8x8(v)
342 return rewriteValuePPC64_OpMod16(v)
344 return rewriteValuePPC64_OpMod16u(v)
346 return rewriteValuePPC64_OpMod32(v)
348 return rewriteValuePPC64_OpMod32u(v)
350 return rewriteValuePPC64_OpMod64(v)
352 return rewriteValuePPC64_OpMod64u(v)
354 return rewriteValuePPC64_OpMod8(v)
356 return rewriteValuePPC64_OpMod8u(v)
358 return rewriteValuePPC64_OpMove(v)
375 v.Op = OpPPC64LoweredMuluhilo
399 return rewriteValuePPC64_OpNeq16(v)
401 return rewriteValuePPC64_OpNeq32(v)
403 return rewriteValuePPC64_OpNeq32F(v)
405 return rewriteValuePPC64_OpNeq64(v)
407 return rewriteValuePPC64_OpNeq64F(v)
409 return rewriteValuePPC64_OpNeq8(v)
414 return rewriteValuePPC64_OpNeqPtr(v)
416 v.Op = OpPPC64LoweredNilCheck
419 return rewriteValuePPC64_OpNot(v)
421 return rewriteValuePPC64_OpOffPtr(v)
438 return rewriteValuePPC64_OpPPC64ADD(v)
439 case OpPPC64ADDconst:
440 return rewriteValuePPC64_OpPPC64ADDconst(v)
442 return rewriteValuePPC64_OpPPC64AND(v)
444 return rewriteValuePPC64_OpPPC64ANDN(v)
445 case OpPPC64ANDconst:
446 return rewriteValuePPC64_OpPPC64ANDconst(v)
447 case OpPPC64CLRLSLDI:
448 return rewriteValuePPC64_OpPPC64CLRLSLDI(v)
450 return rewriteValuePPC64_OpPPC64CMP(v)
452 return rewriteValuePPC64_OpPPC64CMPU(v)
453 case OpPPC64CMPUconst:
454 return rewriteValuePPC64_OpPPC64CMPUconst(v)
456 return rewriteValuePPC64_OpPPC64CMPW(v)
458 return rewriteValuePPC64_OpPPC64CMPWU(v)
459 case OpPPC64CMPWUconst:
460 return rewriteValuePPC64_OpPPC64CMPWUconst(v)
461 case OpPPC64CMPWconst:
462 return rewriteValuePPC64_OpPPC64CMPWconst(v)
463 case OpPPC64CMPconst:
464 return rewriteValuePPC64_OpPPC64CMPconst(v)
466 return rewriteValuePPC64_OpPPC64Equal(v)
468 return rewriteValuePPC64_OpPPC64FABS(v)
470 return rewriteValuePPC64_OpPPC64FADD(v)
472 return rewriteValuePPC64_OpPPC64FADDS(v)
474 return rewriteValuePPC64_OpPPC64FCEIL(v)
476 return rewriteValuePPC64_OpPPC64FFLOOR(v)
477 case OpPPC64FGreaterEqual:
478 return rewriteValuePPC64_OpPPC64FGreaterEqual(v)
479 case OpPPC64FGreaterThan:
480 return rewriteValuePPC64_OpPPC64FGreaterThan(v)
481 case OpPPC64FLessEqual:
482 return rewriteValuePPC64_OpPPC64FLessEqual(v)
483 case OpPPC64FLessThan:
484 return rewriteValuePPC64_OpPPC64FLessThan(v)
485 case OpPPC64FMOVDload:
486 return rewriteValuePPC64_OpPPC64FMOVDload(v)
487 case OpPPC64FMOVDstore:
488 return rewriteValuePPC64_OpPPC64FMOVDstore(v)
489 case OpPPC64FMOVSload:
490 return rewriteValuePPC64_OpPPC64FMOVSload(v)
491 case OpPPC64FMOVSstore:
492 return rewriteValuePPC64_OpPPC64FMOVSstore(v)
494 return rewriteValuePPC64_OpPPC64FNEG(v)
496 return rewriteValuePPC64_OpPPC64FSQRT(v)
498 return rewriteValuePPC64_OpPPC64FSUB(v)
500 return rewriteValuePPC64_OpPPC64FSUBS(v)
502 return rewriteValuePPC64_OpPPC64FTRUNC(v)
503 case OpPPC64GreaterEqual:
504 return rewriteValuePPC64_OpPPC64GreaterEqual(v)
505 case OpPPC64GreaterThan:
506 return rewriteValuePPC64_OpPPC64GreaterThan(v)
508 return rewriteValuePPC64_OpPPC64ISEL(v)
510 return rewriteValuePPC64_OpPPC64ISELB(v)
511 case OpPPC64LessEqual:
512 return rewriteValuePPC64_OpPPC64LessEqual(v)
513 case OpPPC64LessThan:
514 return rewriteValuePPC64_OpPPC64LessThan(v)
516 return rewriteValuePPC64_OpPPC64MFVSRD(v)
517 case OpPPC64MOVBZload:
518 return rewriteValuePPC64_OpPPC64MOVBZload(v)
519 case OpPPC64MOVBZloadidx:
520 return rewriteValuePPC64_OpPPC64MOVBZloadidx(v)
521 case OpPPC64MOVBZreg:
522 return rewriteValuePPC64_OpPPC64MOVBZreg(v)
524 return rewriteValuePPC64_OpPPC64MOVBreg(v)
525 case OpPPC64MOVBstore:
526 return rewriteValuePPC64_OpPPC64MOVBstore(v)
527 case OpPPC64MOVBstoreidx:
528 return rewriteValuePPC64_OpPPC64MOVBstoreidx(v)
529 case OpPPC64MOVBstorezero:
530 return rewriteValuePPC64_OpPPC64MOVBstorezero(v)
531 case OpPPC64MOVDload:
532 return rewriteValuePPC64_OpPPC64MOVDload(v)
533 case OpPPC64MOVDloadidx:
534 return rewriteValuePPC64_OpPPC64MOVDloadidx(v)
535 case OpPPC64MOVDstore:
536 return rewriteValuePPC64_OpPPC64MOVDstore(v)
537 case OpPPC64MOVDstoreidx:
538 return rewriteValuePPC64_OpPPC64MOVDstoreidx(v)
539 case OpPPC64MOVDstorezero:
540 return rewriteValuePPC64_OpPPC64MOVDstorezero(v)
541 case OpPPC64MOVHBRstore:
542 return rewriteValuePPC64_OpPPC64MOVHBRstore(v)
543 case OpPPC64MOVHZload:
544 return rewriteValuePPC64_OpPPC64MOVHZload(v)
545 case OpPPC64MOVHZloadidx:
546 return rewriteValuePPC64_OpPPC64MOVHZloadidx(v)
547 case OpPPC64MOVHZreg:
548 return rewriteValuePPC64_OpPPC64MOVHZreg(v)
549 case OpPPC64MOVHload:
550 return rewriteValuePPC64_OpPPC64MOVHload(v)
551 case OpPPC64MOVHloadidx:
552 return rewriteValuePPC64_OpPPC64MOVHloadidx(v)
554 return rewriteValuePPC64_OpPPC64MOVHreg(v)
555 case OpPPC64MOVHstore:
556 return rewriteValuePPC64_OpPPC64MOVHstore(v)
557 case OpPPC64MOVHstoreidx:
558 return rewriteValuePPC64_OpPPC64MOVHstoreidx(v)
559 case OpPPC64MOVHstorezero:
560 return rewriteValuePPC64_OpPPC64MOVHstorezero(v)
561 case OpPPC64MOVWBRstore:
562 return rewriteValuePPC64_OpPPC64MOVWBRstore(v)
563 case OpPPC64MOVWZload:
564 return rewriteValuePPC64_OpPPC64MOVWZload(v)
565 case OpPPC64MOVWZloadidx:
566 return rewriteValuePPC64_OpPPC64MOVWZloadidx(v)
567 case OpPPC64MOVWZreg:
568 return rewriteValuePPC64_OpPPC64MOVWZreg(v)
569 case OpPPC64MOVWload:
570 return rewriteValuePPC64_OpPPC64MOVWload(v)
571 case OpPPC64MOVWloadidx:
572 return rewriteValuePPC64_OpPPC64MOVWloadidx(v)
574 return rewriteValuePPC64_OpPPC64MOVWreg(v)
575 case OpPPC64MOVWstore:
576 return rewriteValuePPC64_OpPPC64MOVWstore(v)
577 case OpPPC64MOVWstoreidx:
578 return rewriteValuePPC64_OpPPC64MOVWstoreidx(v)
579 case OpPPC64MOVWstorezero:
580 return rewriteValuePPC64_OpPPC64MOVWstorezero(v)
582 return rewriteValuePPC64_OpPPC64MTVSRD(v)
584 return rewriteValuePPC64_OpPPC64MULLD(v)
586 return rewriteValuePPC64_OpPPC64MULLW(v)
588 return rewriteValuePPC64_OpPPC64NEG(v)
590 return rewriteValuePPC64_OpPPC64NOR(v)
591 case OpPPC64NotEqual:
592 return rewriteValuePPC64_OpPPC64NotEqual(v)
594 return rewriteValuePPC64_OpPPC64OR(v)
596 return rewriteValuePPC64_OpPPC64ORN(v)
598 return rewriteValuePPC64_OpPPC64ORconst(v)
600 return rewriteValuePPC64_OpPPC64ROTL(v)
602 return rewriteValuePPC64_OpPPC64ROTLW(v)
603 case OpPPC64ROTLWconst:
604 return rewriteValuePPC64_OpPPC64ROTLWconst(v)
606 return rewriteValuePPC64_OpPPC64SLD(v)
607 case OpPPC64SLDconst:
608 return rewriteValuePPC64_OpPPC64SLDconst(v)
610 return rewriteValuePPC64_OpPPC64SLW(v)
611 case OpPPC64SLWconst:
612 return rewriteValuePPC64_OpPPC64SLWconst(v)
614 return rewriteValuePPC64_OpPPC64SRAD(v)
616 return rewriteValuePPC64_OpPPC64SRAW(v)
618 return rewriteValuePPC64_OpPPC64SRD(v)
620 return rewriteValuePPC64_OpPPC64SRW(v)
621 case OpPPC64SRWconst:
622 return rewriteValuePPC64_OpPPC64SRWconst(v)
624 return rewriteValuePPC64_OpPPC64SUB(v)
625 case OpPPC64SUBFCconst:
626 return rewriteValuePPC64_OpPPC64SUBFCconst(v)
628 return rewriteValuePPC64_OpPPC64XOR(v)
629 case OpPPC64XORconst:
630 return rewriteValuePPC64_OpPPC64XORconst(v)
632 return rewriteValuePPC64_OpPanicBounds(v)
634 return rewriteValuePPC64_OpPopCount16(v)
636 return rewriteValuePPC64_OpPopCount32(v)
638 v.Op = OpPPC64POPCNTD
641 return rewriteValuePPC64_OpPopCount8(v)
643 return rewriteValuePPC64_OpRotateLeft16(v)
645 return rewriteValuePPC64_OpRotateLeft32(v)
647 return rewriteValuePPC64_OpRotateLeft64(v)
649 return rewriteValuePPC64_OpRotateLeft8(v)
654 v.Op = OpPPC64LoweredRound32F
657 v.Op = OpPPC64LoweredRound64F
660 return rewriteValuePPC64_OpRsh16Ux16(v)
662 return rewriteValuePPC64_OpRsh16Ux32(v)
664 return rewriteValuePPC64_OpRsh16Ux64(v)
666 return rewriteValuePPC64_OpRsh16Ux8(v)
668 return rewriteValuePPC64_OpRsh16x16(v)
670 return rewriteValuePPC64_OpRsh16x32(v)
672 return rewriteValuePPC64_OpRsh16x64(v)
674 return rewriteValuePPC64_OpRsh16x8(v)
676 return rewriteValuePPC64_OpRsh32Ux16(v)
678 return rewriteValuePPC64_OpRsh32Ux32(v)
680 return rewriteValuePPC64_OpRsh32Ux64(v)
682 return rewriteValuePPC64_OpRsh32Ux8(v)
684 return rewriteValuePPC64_OpRsh32x16(v)
686 return rewriteValuePPC64_OpRsh32x32(v)
688 return rewriteValuePPC64_OpRsh32x64(v)
690 return rewriteValuePPC64_OpRsh32x8(v)
692 return rewriteValuePPC64_OpRsh64Ux16(v)
694 return rewriteValuePPC64_OpRsh64Ux32(v)
696 return rewriteValuePPC64_OpRsh64Ux64(v)
698 return rewriteValuePPC64_OpRsh64Ux8(v)
700 return rewriteValuePPC64_OpRsh64x16(v)
702 return rewriteValuePPC64_OpRsh64x32(v)
704 return rewriteValuePPC64_OpRsh64x64(v)
706 return rewriteValuePPC64_OpRsh64x8(v)
708 return rewriteValuePPC64_OpRsh8Ux16(v)
710 return rewriteValuePPC64_OpRsh8Ux32(v)
712 return rewriteValuePPC64_OpRsh8Ux64(v)
714 return rewriteValuePPC64_OpRsh8Ux8(v)
716 return rewriteValuePPC64_OpRsh8x16(v)
718 return rewriteValuePPC64_OpRsh8x32(v)
720 return rewriteValuePPC64_OpRsh8x64(v)
722 return rewriteValuePPC64_OpRsh8x8(v)
723 case OpSignExt16to32:
724 v.Op = OpPPC64MOVHreg
726 case OpSignExt16to64:
727 v.Op = OpPPC64MOVHreg
729 case OpSignExt32to64:
730 v.Op = OpPPC64MOVWreg
733 v.Op = OpPPC64MOVBreg
736 v.Op = OpPPC64MOVBreg
739 v.Op = OpPPC64MOVBreg
742 return rewriteValuePPC64_OpSlicemask(v)
750 v.Op = OpPPC64CALLstatic
753 return rewriteValuePPC64_OpStore(v)
779 return rewriteValuePPC64_OpTrunc16to8(v)
781 return rewriteValuePPC64_OpTrunc32to16(v)
783 return rewriteValuePPC64_OpTrunc32to8(v)
785 return rewriteValuePPC64_OpTrunc64to16(v)
787 return rewriteValuePPC64_OpTrunc64to32(v)
789 return rewriteValuePPC64_OpTrunc64to8(v)
791 v.Op = OpPPC64LoweredWB
806 return rewriteValuePPC64_OpZero(v)
807 case OpZeroExt16to32:
808 v.Op = OpPPC64MOVHZreg
810 case OpZeroExt16to64:
811 v.Op = OpPPC64MOVHZreg
813 case OpZeroExt32to64:
814 v.Op = OpPPC64MOVWZreg
817 v.Op = OpPPC64MOVBZreg
820 v.Op = OpPPC64MOVBZreg
823 v.Op = OpPPC64MOVBZreg
828 func rewriteValuePPC64_OpAddr(v *Value) bool {
830 // match: (Addr {sym} base)
831 // result: (MOVDaddr {sym} [0] base)
833 sym := auxToSym(v.Aux)
835 v.reset(OpPPC64MOVDaddr)
836 v.AuxInt = int32ToAuxInt(0)
837 v.Aux = symToAux(sym)
842 func rewriteValuePPC64_OpAtomicCompareAndSwap32(v *Value) bool {
847 // match: (AtomicCompareAndSwap32 ptr old new_ mem)
848 // result: (LoweredAtomicCas32 [1] ptr old new_ mem)
854 v.reset(OpPPC64LoweredAtomicCas32)
855 v.AuxInt = int64ToAuxInt(1)
856 v.AddArg4(ptr, old, new_, mem)
860 func rewriteValuePPC64_OpAtomicCompareAndSwap64(v *Value) bool {
865 // match: (AtomicCompareAndSwap64 ptr old new_ mem)
866 // result: (LoweredAtomicCas64 [1] ptr old new_ mem)
872 v.reset(OpPPC64LoweredAtomicCas64)
873 v.AuxInt = int64ToAuxInt(1)
874 v.AddArg4(ptr, old, new_, mem)
878 func rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v *Value) bool {
883 // match: (AtomicCompareAndSwapRel32 ptr old new_ mem)
884 // result: (LoweredAtomicCas32 [0] ptr old new_ mem)
890 v.reset(OpPPC64LoweredAtomicCas32)
891 v.AuxInt = int64ToAuxInt(0)
892 v.AddArg4(ptr, old, new_, mem)
896 func rewriteValuePPC64_OpAtomicLoad32(v *Value) bool {
899 // match: (AtomicLoad32 ptr mem)
900 // result: (LoweredAtomicLoad32 [1] ptr mem)
904 v.reset(OpPPC64LoweredAtomicLoad32)
905 v.AuxInt = int64ToAuxInt(1)
910 func rewriteValuePPC64_OpAtomicLoad64(v *Value) bool {
913 // match: (AtomicLoad64 ptr mem)
914 // result: (LoweredAtomicLoad64 [1] ptr mem)
918 v.reset(OpPPC64LoweredAtomicLoad64)
919 v.AuxInt = int64ToAuxInt(1)
924 func rewriteValuePPC64_OpAtomicLoad8(v *Value) bool {
927 // match: (AtomicLoad8 ptr mem)
928 // result: (LoweredAtomicLoad8 [1] ptr mem)
932 v.reset(OpPPC64LoweredAtomicLoad8)
933 v.AuxInt = int64ToAuxInt(1)
938 func rewriteValuePPC64_OpAtomicLoadAcq32(v *Value) bool {
941 // match: (AtomicLoadAcq32 ptr mem)
942 // result: (LoweredAtomicLoad32 [0] ptr mem)
946 v.reset(OpPPC64LoweredAtomicLoad32)
947 v.AuxInt = int64ToAuxInt(0)
952 func rewriteValuePPC64_OpAtomicLoadAcq64(v *Value) bool {
955 // match: (AtomicLoadAcq64 ptr mem)
956 // result: (LoweredAtomicLoad64 [0] ptr mem)
960 v.reset(OpPPC64LoweredAtomicLoad64)
961 v.AuxInt = int64ToAuxInt(0)
966 func rewriteValuePPC64_OpAtomicLoadPtr(v *Value) bool {
969 // match: (AtomicLoadPtr ptr mem)
970 // result: (LoweredAtomicLoadPtr [1] ptr mem)
974 v.reset(OpPPC64LoweredAtomicLoadPtr)
975 v.AuxInt = int64ToAuxInt(1)
980 func rewriteValuePPC64_OpAtomicStore32(v *Value) bool {
984 // match: (AtomicStore32 ptr val mem)
985 // result: (LoweredAtomicStore32 [1] ptr val mem)
990 v.reset(OpPPC64LoweredAtomicStore32)
991 v.AuxInt = int64ToAuxInt(1)
992 v.AddArg3(ptr, val, mem)
996 func rewriteValuePPC64_OpAtomicStore64(v *Value) bool {
1000 // match: (AtomicStore64 ptr val mem)
1001 // result: (LoweredAtomicStore64 [1] ptr val mem)
1006 v.reset(OpPPC64LoweredAtomicStore64)
1007 v.AuxInt = int64ToAuxInt(1)
1008 v.AddArg3(ptr, val, mem)
1012 func rewriteValuePPC64_OpAtomicStore8(v *Value) bool {
1016 // match: (AtomicStore8 ptr val mem)
1017 // result: (LoweredAtomicStore8 [1] ptr val mem)
1022 v.reset(OpPPC64LoweredAtomicStore8)
1023 v.AuxInt = int64ToAuxInt(1)
1024 v.AddArg3(ptr, val, mem)
1028 func rewriteValuePPC64_OpAtomicStoreRel32(v *Value) bool {
1032 // match: (AtomicStoreRel32 ptr val mem)
1033 // result: (LoweredAtomicStore32 [0] ptr val mem)
1038 v.reset(OpPPC64LoweredAtomicStore32)
1039 v.AuxInt = int64ToAuxInt(0)
1040 v.AddArg3(ptr, val, mem)
1044 func rewriteValuePPC64_OpAtomicStoreRel64(v *Value) bool {
1048 // match: (AtomicStoreRel64 ptr val mem)
1049 // result: (LoweredAtomicStore64 [0] ptr val mem)
1054 v.reset(OpPPC64LoweredAtomicStore64)
1055 v.AuxInt = int64ToAuxInt(0)
1056 v.AddArg3(ptr, val, mem)
1060 func rewriteValuePPC64_OpAvg64u(v *Value) bool {
1064 // match: (Avg64u <t> x y)
1065 // result: (ADD (SRDconst <t> (SUB <t> x y) [1]) y)
1071 v0 := b.NewValue0(v.Pos, OpPPC64SRDconst, t)
1072 v0.AuxInt = int64ToAuxInt(1)
1073 v1 := b.NewValue0(v.Pos, OpPPC64SUB, t)
1080 func rewriteValuePPC64_OpBitLen32(v *Value) bool {
1083 typ := &b.Func.Config.Types
1084 // match: (BitLen32 x)
1085 // result: (SUBFCconst [32] (CNTLZW <typ.Int> x))
1088 v.reset(OpPPC64SUBFCconst)
1089 v.AuxInt = int64ToAuxInt(32)
1090 v0 := b.NewValue0(v.Pos, OpPPC64CNTLZW, typ.Int)
1096 func rewriteValuePPC64_OpBitLen64(v *Value) bool {
1099 typ := &b.Func.Config.Types
1100 // match: (BitLen64 x)
1101 // result: (SUBFCconst [64] (CNTLZD <typ.Int> x))
1104 v.reset(OpPPC64SUBFCconst)
1105 v.AuxInt = int64ToAuxInt(64)
1106 v0 := b.NewValue0(v.Pos, OpPPC64CNTLZD, typ.Int)
1112 func rewriteValuePPC64_OpCom16(v *Value) bool {
1115 // result: (NOR x x)
1123 func rewriteValuePPC64_OpCom32(v *Value) bool {
1126 // result: (NOR x x)
1134 func rewriteValuePPC64_OpCom64(v *Value) bool {
1137 // result: (NOR x x)
1145 func rewriteValuePPC64_OpCom8(v *Value) bool {
1148 // result: (NOR x x)
1156 func rewriteValuePPC64_OpCondSelect(v *Value) bool {
1161 // match: (CondSelect x y bool)
1162 // cond: flagArg(bool) != nil
1163 // result: (ISEL [2] x y bool)
1168 if !(flagArg(bool) != nil) {
1171 v.reset(OpPPC64ISEL)
1172 v.AuxInt = int32ToAuxInt(2)
1173 v.AddArg3(x, y, bool)
1176 // match: (CondSelect x y bool)
1177 // cond: flagArg(bool) == nil
1178 // result: (ISEL [2] x y (CMPWconst [0] bool))
1183 if !(flagArg(bool) == nil) {
1186 v.reset(OpPPC64ISEL)
1187 v.AuxInt = int32ToAuxInt(2)
1188 v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, types.TypeFlags)
1189 v0.AuxInt = int32ToAuxInt(0)
1196 func rewriteValuePPC64_OpConst16(v *Value) bool {
1197 // match: (Const16 [val])
1198 // result: (MOVDconst [int64(val)])
1200 val := auxIntToInt16(v.AuxInt)
1201 v.reset(OpPPC64MOVDconst)
1202 v.AuxInt = int64ToAuxInt(int64(val))
1206 func rewriteValuePPC64_OpConst32(v *Value) bool {
1207 // match: (Const32 [val])
1208 // result: (MOVDconst [int64(val)])
1210 val := auxIntToInt32(v.AuxInt)
1211 v.reset(OpPPC64MOVDconst)
1212 v.AuxInt = int64ToAuxInt(int64(val))
1216 func rewriteValuePPC64_OpConst64(v *Value) bool {
1217 // match: (Const64 [val])
1218 // result: (MOVDconst [int64(val)])
1220 val := auxIntToInt64(v.AuxInt)
1221 v.reset(OpPPC64MOVDconst)
1222 v.AuxInt = int64ToAuxInt(int64(val))
1226 func rewriteValuePPC64_OpConst8(v *Value) bool {
1227 // match: (Const8 [val])
1228 // result: (MOVDconst [int64(val)])
1230 val := auxIntToInt8(v.AuxInt)
1231 v.reset(OpPPC64MOVDconst)
1232 v.AuxInt = int64ToAuxInt(int64(val))
1236 func rewriteValuePPC64_OpConstBool(v *Value) bool {
1237 // match: (ConstBool [t])
1238 // result: (MOVDconst [b2i(t)])
1240 t := auxIntToBool(v.AuxInt)
1241 v.reset(OpPPC64MOVDconst)
1242 v.AuxInt = int64ToAuxInt(b2i(t))
1246 func rewriteValuePPC64_OpConstNil(v *Value) bool {
1247 // match: (ConstNil)
1248 // result: (MOVDconst [0])
1250 v.reset(OpPPC64MOVDconst)
1251 v.AuxInt = int64ToAuxInt(0)
1255 func rewriteValuePPC64_OpCopysign(v *Value) bool {
1258 // match: (Copysign x y)
1259 // result: (FCPSGN y x)
1263 v.reset(OpPPC64FCPSGN)
1268 func rewriteValuePPC64_OpCtz16(v *Value) bool {
1271 typ := &b.Func.Config.Types
1273 // result: (POPCNTW (MOVHZreg (ANDN <typ.Int16> (ADDconst <typ.Int16> [-1] x) x)))
1276 v.reset(OpPPC64POPCNTW)
1277 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
1278 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int16)
1279 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int16)
1280 v2.AuxInt = int64ToAuxInt(-1)
1288 func rewriteValuePPC64_OpCtz32(v *Value) bool {
1291 typ := &b.Func.Config.Types
1293 // cond: objabi.GOPPC64<=8
1294 // result: (POPCNTW (MOVWZreg (ANDN <typ.Int> (ADDconst <typ.Int> [-1] x) x)))
1297 if !(objabi.GOPPC64 <= 8) {
1300 v.reset(OpPPC64POPCNTW)
1301 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
1302 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int)
1303 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int)
1304 v2.AuxInt = int64ToAuxInt(-1)
1312 // result: (CNTTZW (MOVWZreg x))
1315 v.reset(OpPPC64CNTTZW)
1316 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
1322 func rewriteValuePPC64_OpCtz64(v *Value) bool {
1325 typ := &b.Func.Config.Types
1327 // cond: objabi.GOPPC64<=8
1328 // result: (POPCNTD (ANDN <typ.Int64> (ADDconst <typ.Int64> [-1] x) x))
1331 if !(objabi.GOPPC64 <= 8) {
1334 v.reset(OpPPC64POPCNTD)
1335 v0 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int64)
1336 v1 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int64)
1337 v1.AuxInt = int64ToAuxInt(-1)
1344 // result: (CNTTZD x)
1347 v.reset(OpPPC64CNTTZD)
1352 func rewriteValuePPC64_OpCtz8(v *Value) bool {
1355 typ := &b.Func.Config.Types
1357 // result: (POPCNTB (MOVBZreg (ANDN <typ.UInt8> (ADDconst <typ.UInt8> [-1] x) x)))
1360 v.reset(OpPPC64POPCNTB)
1361 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
1362 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.UInt8)
1363 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.UInt8)
1364 v2.AuxInt = int64ToAuxInt(-1)
1372 func rewriteValuePPC64_OpCvt32Fto32(v *Value) bool {
1375 typ := &b.Func.Config.Types
1376 // match: (Cvt32Fto32 x)
1377 // result: (MFVSRD (FCTIWZ x))
1380 v.reset(OpPPC64MFVSRD)
1381 v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
1387 func rewriteValuePPC64_OpCvt32Fto64(v *Value) bool {
1390 typ := &b.Func.Config.Types
1391 // match: (Cvt32Fto64 x)
1392 // result: (MFVSRD (FCTIDZ x))
1395 v.reset(OpPPC64MFVSRD)
1396 v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
1402 func rewriteValuePPC64_OpCvt32to32F(v *Value) bool {
1405 typ := &b.Func.Config.Types
1406 // match: (Cvt32to32F x)
1407 // result: (FCFIDS (MTVSRD (SignExt32to64 x)))
1410 v.reset(OpPPC64FCFIDS)
1411 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1412 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1419 func rewriteValuePPC64_OpCvt32to64F(v *Value) bool {
1422 typ := &b.Func.Config.Types
1423 // match: (Cvt32to64F x)
1424 // result: (FCFID (MTVSRD (SignExt32to64 x)))
1427 v.reset(OpPPC64FCFID)
1428 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1429 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1436 func rewriteValuePPC64_OpCvt64Fto32(v *Value) bool {
1439 typ := &b.Func.Config.Types
1440 // match: (Cvt64Fto32 x)
1441 // result: (MFVSRD (FCTIWZ x))
1444 v.reset(OpPPC64MFVSRD)
1445 v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
1451 func rewriteValuePPC64_OpCvt64Fto64(v *Value) bool {
1454 typ := &b.Func.Config.Types
1455 // match: (Cvt64Fto64 x)
1456 // result: (MFVSRD (FCTIDZ x))
1459 v.reset(OpPPC64MFVSRD)
1460 v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
1466 func rewriteValuePPC64_OpCvt64to32F(v *Value) bool {
1469 typ := &b.Func.Config.Types
1470 // match: (Cvt64to32F x)
1471 // result: (FCFIDS (MTVSRD x))
1474 v.reset(OpPPC64FCFIDS)
1475 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1481 func rewriteValuePPC64_OpCvt64to64F(v *Value) bool {
1484 typ := &b.Func.Config.Types
1485 // match: (Cvt64to64F x)
1486 // result: (FCFID (MTVSRD x))
1489 v.reset(OpPPC64FCFID)
1490 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1496 func rewriteValuePPC64_OpDiv16(v *Value) bool {
1500 typ := &b.Func.Config.Types
1501 // match: (Div16 [false] x y)
1502 // result: (DIVW (SignExt16to32 x) (SignExt16to32 y))
1504 if auxIntToBool(v.AuxInt) != false {
1509 v.reset(OpPPC64DIVW)
1510 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1512 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1519 func rewriteValuePPC64_OpDiv16u(v *Value) bool {
1523 typ := &b.Func.Config.Types
1524 // match: (Div16u x y)
1525 // result: (DIVWU (ZeroExt16to32 x) (ZeroExt16to32 y))
1529 v.reset(OpPPC64DIVWU)
1530 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1532 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1538 func rewriteValuePPC64_OpDiv32(v *Value) bool {
1541 // match: (Div32 [false] x y)
1542 // result: (DIVW x y)
1544 if auxIntToBool(v.AuxInt) != false {
1549 v.reset(OpPPC64DIVW)
1555 func rewriteValuePPC64_OpDiv64(v *Value) bool {
1558 // match: (Div64 [false] x y)
1559 // result: (DIVD x y)
1561 if auxIntToBool(v.AuxInt) != false {
1566 v.reset(OpPPC64DIVD)
1572 func rewriteValuePPC64_OpDiv8(v *Value) bool {
1576 typ := &b.Func.Config.Types
1577 // match: (Div8 x y)
1578 // result: (DIVW (SignExt8to32 x) (SignExt8to32 y))
1582 v.reset(OpPPC64DIVW)
1583 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1585 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1591 func rewriteValuePPC64_OpDiv8u(v *Value) bool {
1595 typ := &b.Func.Config.Types
1596 // match: (Div8u x y)
1597 // result: (DIVWU (ZeroExt8to32 x) (ZeroExt8to32 y))
1601 v.reset(OpPPC64DIVWU)
1602 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
1604 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
1610 func rewriteValuePPC64_OpEq16(v *Value) bool {
1614 typ := &b.Func.Config.Types
1615 // match: (Eq16 x y)
1616 // cond: isSigned(x.Type) && isSigned(y.Type)
1617 // result: (Equal (CMPW (SignExt16to32 x) (SignExt16to32 y)))
1619 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1622 if !(isSigned(x.Type) && isSigned(y.Type)) {
1625 v.reset(OpPPC64Equal)
1626 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1627 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1629 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1637 // match: (Eq16 x y)
1638 // result: (Equal (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
1642 v.reset(OpPPC64Equal)
1643 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1644 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1646 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1653 func rewriteValuePPC64_OpEq32(v *Value) bool {
1657 // match: (Eq32 x y)
1658 // result: (Equal (CMPW x y))
1662 v.reset(OpPPC64Equal)
1663 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1669 func rewriteValuePPC64_OpEq32F(v *Value) bool {
1673 // match: (Eq32F x y)
1674 // result: (Equal (FCMPU x y))
1678 v.reset(OpPPC64Equal)
1679 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
1685 func rewriteValuePPC64_OpEq64(v *Value) bool {
1689 // match: (Eq64 x y)
1690 // result: (Equal (CMP x y))
1694 v.reset(OpPPC64Equal)
1695 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
1701 func rewriteValuePPC64_OpEq64F(v *Value) bool {
1705 // match: (Eq64F x y)
1706 // result: (Equal (FCMPU x y))
1710 v.reset(OpPPC64Equal)
1711 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
1717 func rewriteValuePPC64_OpEq8(v *Value) bool {
1721 typ := &b.Func.Config.Types
1723 // cond: isSigned(x.Type) && isSigned(y.Type)
1724 // result: (Equal (CMPW (SignExt8to32 x) (SignExt8to32 y)))
1726 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1729 if !(isSigned(x.Type) && isSigned(y.Type)) {
1732 v.reset(OpPPC64Equal)
1733 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1734 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1736 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1745 // result: (Equal (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
1749 v.reset(OpPPC64Equal)
1750 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1751 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
1753 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
1760 func rewriteValuePPC64_OpEqB(v *Value) bool {
1764 typ := &b.Func.Config.Types
1766 // result: (ANDconst [1] (EQV x y))
1770 v.reset(OpPPC64ANDconst)
1771 v.AuxInt = int64ToAuxInt(1)
1772 v0 := b.NewValue0(v.Pos, OpPPC64EQV, typ.Int64)
1778 func rewriteValuePPC64_OpEqPtr(v *Value) bool {
1782 // match: (EqPtr x y)
1783 // result: (Equal (CMP x y))
1787 v.reset(OpPPC64Equal)
1788 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
1794 func rewriteValuePPC64_OpIsInBounds(v *Value) bool {
1798 // match: (IsInBounds idx len)
1799 // result: (LessThan (CMPU idx len))
1803 v.reset(OpPPC64LessThan)
1804 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
1805 v0.AddArg2(idx, len)
1810 func rewriteValuePPC64_OpIsNonNil(v *Value) bool {
1813 // match: (IsNonNil ptr)
1814 // result: (NotEqual (CMPconst [0] ptr))
1817 v.reset(OpPPC64NotEqual)
1818 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
1819 v0.AuxInt = int64ToAuxInt(0)
1825 func rewriteValuePPC64_OpIsSliceInBounds(v *Value) bool {
1829 // match: (IsSliceInBounds idx len)
1830 // result: (LessEqual (CMPU idx len))
1834 v.reset(OpPPC64LessEqual)
1835 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
1836 v0.AddArg2(idx, len)
1841 func rewriteValuePPC64_OpLeq16(v *Value) bool {
1845 typ := &b.Func.Config.Types
1846 // match: (Leq16 x y)
1847 // result: (LessEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
1851 v.reset(OpPPC64LessEqual)
1852 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1853 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1855 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1862 func rewriteValuePPC64_OpLeq16U(v *Value) bool {
1866 typ := &b.Func.Config.Types
1867 // match: (Leq16U x y)
1868 // result: (LessEqual (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
1872 v.reset(OpPPC64LessEqual)
1873 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
1874 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1876 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1883 func rewriteValuePPC64_OpLeq32(v *Value) bool {
1887 // match: (Leq32 x y)
1888 // result: (LessEqual (CMPW x y))
1892 v.reset(OpPPC64LessEqual)
1893 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1899 func rewriteValuePPC64_OpLeq32F(v *Value) bool {
1903 // match: (Leq32F x y)
1904 // result: (FLessEqual (FCMPU x y))
1908 v.reset(OpPPC64FLessEqual)
1909 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
1915 func rewriteValuePPC64_OpLeq32U(v *Value) bool {
1919 // match: (Leq32U x y)
1920 // result: (LessEqual (CMPWU x y))
1924 v.reset(OpPPC64LessEqual)
1925 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
1931 func rewriteValuePPC64_OpLeq64(v *Value) bool {
1935 // match: (Leq64 x y)
1936 // result: (LessEqual (CMP x y))
1940 v.reset(OpPPC64LessEqual)
1941 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
1947 func rewriteValuePPC64_OpLeq64F(v *Value) bool {
1951 // match: (Leq64F x y)
1952 // result: (FLessEqual (FCMPU x y))
1956 v.reset(OpPPC64FLessEqual)
1957 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
1963 func rewriteValuePPC64_OpLeq64U(v *Value) bool {
1967 // match: (Leq64U x y)
1968 // result: (LessEqual (CMPU x y))
1972 v.reset(OpPPC64LessEqual)
1973 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
1979 func rewriteValuePPC64_OpLeq8(v *Value) bool {
1983 typ := &b.Func.Config.Types
1984 // match: (Leq8 x y)
1985 // result: (LessEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
1989 v.reset(OpPPC64LessEqual)
1990 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1991 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1993 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2000 func rewriteValuePPC64_OpLeq8U(v *Value) bool {
2004 typ := &b.Func.Config.Types
2005 // match: (Leq8U x y)
2006 // result: (LessEqual (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
2010 v.reset(OpPPC64LessEqual)
2011 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2012 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2014 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2021 func rewriteValuePPC64_OpLess16(v *Value) bool {
2025 typ := &b.Func.Config.Types
2026 // match: (Less16 x y)
2027 // result: (LessThan (CMPW (SignExt16to32 x) (SignExt16to32 y)))
2031 v.reset(OpPPC64LessThan)
2032 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2033 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2035 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2042 func rewriteValuePPC64_OpLess16U(v *Value) bool {
2046 typ := &b.Func.Config.Types
2047 // match: (Less16U x y)
2048 // result: (LessThan (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
2052 v.reset(OpPPC64LessThan)
2053 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2054 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2056 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2063 func rewriteValuePPC64_OpLess32(v *Value) bool {
2067 // match: (Less32 x y)
2068 // result: (LessThan (CMPW x y))
2072 v.reset(OpPPC64LessThan)
2073 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2079 func rewriteValuePPC64_OpLess32F(v *Value) bool {
2083 // match: (Less32F x y)
2084 // result: (FLessThan (FCMPU x y))
2088 v.reset(OpPPC64FLessThan)
2089 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2095 func rewriteValuePPC64_OpLess32U(v *Value) bool {
2099 // match: (Less32U x y)
2100 // result: (LessThan (CMPWU x y))
2104 v.reset(OpPPC64LessThan)
2105 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2111 func rewriteValuePPC64_OpLess64(v *Value) bool {
2115 // match: (Less64 x y)
2116 // result: (LessThan (CMP x y))
2120 v.reset(OpPPC64LessThan)
2121 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
2127 func rewriteValuePPC64_OpLess64F(v *Value) bool {
2131 // match: (Less64F x y)
2132 // result: (FLessThan (FCMPU x y))
2136 v.reset(OpPPC64FLessThan)
2137 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2143 func rewriteValuePPC64_OpLess64U(v *Value) bool {
2147 // match: (Less64U x y)
2148 // result: (LessThan (CMPU x y))
2152 v.reset(OpPPC64LessThan)
2153 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2159 func rewriteValuePPC64_OpLess8(v *Value) bool {
2163 typ := &b.Func.Config.Types
2164 // match: (Less8 x y)
2165 // result: (LessThan (CMPW (SignExt8to32 x) (SignExt8to32 y)))
2169 v.reset(OpPPC64LessThan)
2170 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2171 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2173 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2180 func rewriteValuePPC64_OpLess8U(v *Value) bool {
2184 typ := &b.Func.Config.Types
2185 // match: (Less8U x y)
2186 // result: (LessThan (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
2190 v.reset(OpPPC64LessThan)
2191 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2192 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2194 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2201 func rewriteValuePPC64_OpLoad(v *Value) bool {
2205 typ := &b.Func.Config.Types
2206 // match: (Load <t> ptr mem)
2207 // cond: (is64BitInt(t) || isPtr(t))
2208 // result: (MOVDload ptr mem)
2213 if !(is64BitInt(t) || isPtr(t)) {
2216 v.reset(OpPPC64MOVDload)
2220 // match: (Load <t> ptr mem)
2221 // cond: is32BitInt(t) && isSigned(t)
2222 // result: (MOVWload ptr mem)
2227 if !(is32BitInt(t) && isSigned(t)) {
2230 v.reset(OpPPC64MOVWload)
2234 // match: (Load <t> ptr mem)
2235 // cond: is32BitInt(t) && !isSigned(t)
2236 // result: (MOVWZload ptr mem)
2241 if !(is32BitInt(t) && !isSigned(t)) {
2244 v.reset(OpPPC64MOVWZload)
2248 // match: (Load <t> ptr mem)
2249 // cond: is16BitInt(t) && isSigned(t)
2250 // result: (MOVHload ptr mem)
2255 if !(is16BitInt(t) && isSigned(t)) {
2258 v.reset(OpPPC64MOVHload)
2262 // match: (Load <t> ptr mem)
2263 // cond: is16BitInt(t) && !isSigned(t)
2264 // result: (MOVHZload ptr mem)
2269 if !(is16BitInt(t) && !isSigned(t)) {
2272 v.reset(OpPPC64MOVHZload)
2276 // match: (Load <t> ptr mem)
2277 // cond: t.IsBoolean()
2278 // result: (MOVBZload ptr mem)
2283 if !(t.IsBoolean()) {
2286 v.reset(OpPPC64MOVBZload)
2290 // match: (Load <t> ptr mem)
2291 // cond: is8BitInt(t) && isSigned(t)
2292 // result: (MOVBreg (MOVBZload ptr mem))
2297 if !(is8BitInt(t) && isSigned(t)) {
2300 v.reset(OpPPC64MOVBreg)
2301 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
2302 v0.AddArg2(ptr, mem)
2306 // match: (Load <t> ptr mem)
2307 // cond: is8BitInt(t) && !isSigned(t)
2308 // result: (MOVBZload ptr mem)
2313 if !(is8BitInt(t) && !isSigned(t)) {
2316 v.reset(OpPPC64MOVBZload)
2320 // match: (Load <t> ptr mem)
2321 // cond: is32BitFloat(t)
2322 // result: (FMOVSload ptr mem)
2327 if !(is32BitFloat(t)) {
2330 v.reset(OpPPC64FMOVSload)
2334 // match: (Load <t> ptr mem)
2335 // cond: is64BitFloat(t)
2336 // result: (FMOVDload ptr mem)
2341 if !(is64BitFloat(t)) {
2344 v.reset(OpPPC64FMOVDload)
2350 func rewriteValuePPC64_OpLocalAddr(v *Value) bool {
2352 // match: (LocalAddr {sym} base _)
2353 // result: (MOVDaddr {sym} base)
2355 sym := auxToSym(v.Aux)
2357 v.reset(OpPPC64MOVDaddr)
2358 v.Aux = symToAux(sym)
2363 func rewriteValuePPC64_OpLsh16x16(v *Value) bool {
2367 typ := &b.Func.Config.Types
2368 // match: (Lsh16x16 x y)
2369 // cond: shiftIsBounded(v)
2370 // result: (SLW x y)
2374 if !(shiftIsBounded(v)) {
2381 // match: (Lsh16x16 x y)
2382 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [16]))))
2387 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
2388 v0.AuxInt = int32ToAuxInt(0)
2389 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2390 v1.AuxInt = int64ToAuxInt(-1)
2391 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2392 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2394 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2395 v4.AuxInt = int64ToAuxInt(16)
2397 v0.AddArg3(y, v1, v2)
2402 func rewriteValuePPC64_OpLsh16x32(v *Value) bool {
2406 typ := &b.Func.Config.Types
2407 // match: (Lsh16x32 x (MOVDconst [c]))
2408 // cond: uint32(c) < 16
2409 // result: (SLWconst x [c&31])
2412 if v_1.Op != OpPPC64MOVDconst {
2415 c := auxIntToInt64(v_1.AuxInt)
2416 if !(uint32(c) < 16) {
2419 v.reset(OpPPC64SLWconst)
2420 v.AuxInt = int64ToAuxInt(c & 31)
2424 // match: (Lsh16x32 x y)
2425 // cond: shiftIsBounded(v)
2426 // result: (SLW x y)
2430 if !(shiftIsBounded(v)) {
2437 // match: (Lsh16x32 x y)
2438 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [16]))))
2443 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
2444 v0.AuxInt = int32ToAuxInt(0)
2445 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2446 v1.AuxInt = int64ToAuxInt(-1)
2447 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2448 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2449 v3.AuxInt = int64ToAuxInt(16)
2451 v0.AddArg3(y, v1, v2)
2456 func rewriteValuePPC64_OpLsh16x64(v *Value) bool {
2460 typ := &b.Func.Config.Types
2461 // match: (Lsh16x64 _ (MOVDconst [c]))
2462 // cond: uint64(c) >= 16
2463 // result: (MOVDconst [0])
2465 if v_1.Op != OpPPC64MOVDconst {
2468 c := auxIntToInt64(v_1.AuxInt)
2469 if !(uint64(c) >= 16) {
2472 v.reset(OpPPC64MOVDconst)
2473 v.AuxInt = int64ToAuxInt(0)
2476 // match: (Lsh16x64 x (MOVDconst [c]))
2477 // cond: uint64(c) < 16
2478 // result: (SLWconst x [c])
2481 if v_1.Op != OpPPC64MOVDconst {
2484 c := auxIntToInt64(v_1.AuxInt)
2485 if !(uint64(c) < 16) {
2488 v.reset(OpPPC64SLWconst)
2489 v.AuxInt = int64ToAuxInt(c)
2493 // match: (Lsh16x64 x y)
2494 // cond: shiftIsBounded(v)
2495 // result: (SLW x y)
2499 if !(shiftIsBounded(v)) {
2506 // match: (Lsh16x64 x y)
2507 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [16]))))
2512 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
2513 v0.AuxInt = int32ToAuxInt(0)
2514 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2515 v1.AuxInt = int64ToAuxInt(-1)
2516 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2517 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2518 v3.AuxInt = int64ToAuxInt(16)
2520 v0.AddArg3(y, v1, v2)
2525 func rewriteValuePPC64_OpLsh16x8(v *Value) bool {
2529 typ := &b.Func.Config.Types
2530 // match: (Lsh16x8 x y)
2531 // cond: shiftIsBounded(v)
2532 // result: (SLW x y)
2536 if !(shiftIsBounded(v)) {
2543 // match: (Lsh16x8 x y)
2544 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [16]))))
2549 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
2550 v0.AuxInt = int32ToAuxInt(0)
2551 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2552 v1.AuxInt = int64ToAuxInt(-1)
2553 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2554 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
2556 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2557 v4.AuxInt = int64ToAuxInt(16)
2559 v0.AddArg3(y, v1, v2)
2564 func rewriteValuePPC64_OpLsh32x16(v *Value) bool {
2568 typ := &b.Func.Config.Types
2569 // match: (Lsh32x16 x y)
2570 // cond: shiftIsBounded(v)
2571 // result: (SLW x y)
2575 if !(shiftIsBounded(v)) {
2582 // match: (Lsh32x16 x y)
2583 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [32]))))
2588 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
2589 v0.AuxInt = int32ToAuxInt(0)
2590 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2591 v1.AuxInt = int64ToAuxInt(-1)
2592 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2593 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2595 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2596 v4.AuxInt = int64ToAuxInt(32)
2598 v0.AddArg3(y, v1, v2)
2603 func rewriteValuePPC64_OpLsh32x32(v *Value) bool {
2607 typ := &b.Func.Config.Types
2608 // match: (Lsh32x32 x (MOVDconst [c]))
2609 // cond: uint32(c) < 32
2610 // result: (SLWconst x [c&31])
2613 if v_1.Op != OpPPC64MOVDconst {
2616 c := auxIntToInt64(v_1.AuxInt)
2617 if !(uint32(c) < 32) {
2620 v.reset(OpPPC64SLWconst)
2621 v.AuxInt = int64ToAuxInt(c & 31)
2625 // match: (Lsh32x32 x y)
2626 // cond: shiftIsBounded(v)
2627 // result: (SLW x y)
2631 if !(shiftIsBounded(v)) {
2638 // match: (Lsh32x32 x y)
2639 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [32]))))
2644 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
2645 v0.AuxInt = int32ToAuxInt(0)
2646 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2647 v1.AuxInt = int64ToAuxInt(-1)
2648 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2649 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2650 v3.AuxInt = int64ToAuxInt(32)
2652 v0.AddArg3(y, v1, v2)
2657 func rewriteValuePPC64_OpLsh32x64(v *Value) bool {
2661 typ := &b.Func.Config.Types
2662 // match: (Lsh32x64 _ (MOVDconst [c]))
2663 // cond: uint64(c) >= 32
2664 // result: (MOVDconst [0])
2666 if v_1.Op != OpPPC64MOVDconst {
2669 c := auxIntToInt64(v_1.AuxInt)
2670 if !(uint64(c) >= 32) {
2673 v.reset(OpPPC64MOVDconst)
2674 v.AuxInt = int64ToAuxInt(0)
2677 // match: (Lsh32x64 x (MOVDconst [c]))
2678 // cond: uint64(c) < 32
2679 // result: (SLWconst x [c])
2682 if v_1.Op != OpPPC64MOVDconst {
2685 c := auxIntToInt64(v_1.AuxInt)
2686 if !(uint64(c) < 32) {
2689 v.reset(OpPPC64SLWconst)
2690 v.AuxInt = int64ToAuxInt(c)
2694 // match: (Lsh32x64 x y)
2695 // cond: shiftIsBounded(v)
2696 // result: (SLW x y)
2700 if !(shiftIsBounded(v)) {
2707 // match: (Lsh32x64 x (AND y (MOVDconst [31])))
2708 // result: (SLW x (ANDconst <typ.Int32> [31] y))
2711 if v_1.Op != OpPPC64AND {
2715 v_1_0 := v_1.Args[0]
2716 v_1_1 := v_1.Args[1]
2717 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
2719 if v_1_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1.AuxInt) != 31 {
2723 v0 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int32)
2724 v0.AuxInt = int64ToAuxInt(31)
2731 // match: (Lsh32x64 x (ANDconst <typ.Int32> [31] y))
2732 // result: (SLW x (ANDconst <typ.Int32> [31] y))
2735 if v_1.Op != OpPPC64ANDconst || v_1.Type != typ.Int32 || auxIntToInt64(v_1.AuxInt) != 31 {
2740 v0 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int32)
2741 v0.AuxInt = int64ToAuxInt(31)
2746 // match: (Lsh32x64 x y)
2747 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [32]))))
2752 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
2753 v0.AuxInt = int32ToAuxInt(0)
2754 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2755 v1.AuxInt = int64ToAuxInt(-1)
2756 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2757 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2758 v3.AuxInt = int64ToAuxInt(32)
2760 v0.AddArg3(y, v1, v2)
2765 func rewriteValuePPC64_OpLsh32x8(v *Value) bool {
2769 typ := &b.Func.Config.Types
2770 // match: (Lsh32x8 x y)
2771 // cond: shiftIsBounded(v)
2772 // result: (SLW x y)
2776 if !(shiftIsBounded(v)) {
2783 // match: (Lsh32x8 x y)
2784 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [32]))))
2789 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
2790 v0.AuxInt = int32ToAuxInt(0)
2791 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2792 v1.AuxInt = int64ToAuxInt(-1)
2793 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2794 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
2796 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2797 v4.AuxInt = int64ToAuxInt(32)
2799 v0.AddArg3(y, v1, v2)
2804 func rewriteValuePPC64_OpLsh64x16(v *Value) bool {
2808 typ := &b.Func.Config.Types
2809 // match: (Lsh64x16 x y)
2810 // cond: shiftIsBounded(v)
2811 // result: (SLD x y)
2815 if !(shiftIsBounded(v)) {
2822 // match: (Lsh64x16 x y)
2823 // result: (SLD x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [64]))))
2828 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
2829 v0.AuxInt = int32ToAuxInt(0)
2830 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2831 v1.AuxInt = int64ToAuxInt(-1)
2832 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2833 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
2835 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2836 v4.AuxInt = int64ToAuxInt(64)
2838 v0.AddArg3(y, v1, v2)
2843 func rewriteValuePPC64_OpLsh64x32(v *Value) bool {
2847 typ := &b.Func.Config.Types
2848 // match: (Lsh64x32 x (MOVDconst [c]))
2849 // cond: uint32(c) < 64
2850 // result: (SLDconst x [c&63])
2853 if v_1.Op != OpPPC64MOVDconst {
2856 c := auxIntToInt64(v_1.AuxInt)
2857 if !(uint32(c) < 64) {
2860 v.reset(OpPPC64SLDconst)
2861 v.AuxInt = int64ToAuxInt(c & 63)
2865 // match: (Lsh64x32 x y)
2866 // cond: shiftIsBounded(v)
2867 // result: (SLD x y)
2871 if !(shiftIsBounded(v)) {
2878 // match: (Lsh64x32 x y)
2879 // result: (SLD x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [64]))))
2884 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
2885 v0.AuxInt = int32ToAuxInt(0)
2886 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2887 v1.AuxInt = int64ToAuxInt(-1)
2888 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2889 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2890 v3.AuxInt = int64ToAuxInt(64)
2892 v0.AddArg3(y, v1, v2)
2897 func rewriteValuePPC64_OpLsh64x64(v *Value) bool {
2901 typ := &b.Func.Config.Types
2902 // match: (Lsh64x64 _ (MOVDconst [c]))
2903 // cond: uint64(c) >= 64
2904 // result: (MOVDconst [0])
2906 if v_1.Op != OpPPC64MOVDconst {
2909 c := auxIntToInt64(v_1.AuxInt)
2910 if !(uint64(c) >= 64) {
2913 v.reset(OpPPC64MOVDconst)
2914 v.AuxInt = int64ToAuxInt(0)
2917 // match: (Lsh64x64 x (MOVDconst [c]))
2918 // cond: uint64(c) < 64
2919 // result: (SLDconst x [c])
2922 if v_1.Op != OpPPC64MOVDconst {
2925 c := auxIntToInt64(v_1.AuxInt)
2926 if !(uint64(c) < 64) {
2929 v.reset(OpPPC64SLDconst)
2930 v.AuxInt = int64ToAuxInt(c)
2934 // match: (Lsh64x64 x y)
2935 // cond: shiftIsBounded(v)
2936 // result: (SLD x y)
2940 if !(shiftIsBounded(v)) {
2947 // match: (Lsh64x64 x (AND y (MOVDconst [63])))
2948 // result: (SLD x (ANDconst <typ.Int64> [63] y))
2951 if v_1.Op != OpPPC64AND {
2955 v_1_0 := v_1.Args[0]
2956 v_1_1 := v_1.Args[1]
2957 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
2959 if v_1_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1.AuxInt) != 63 {
2963 v0 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int64)
2964 v0.AuxInt = int64ToAuxInt(63)
2971 // match: (Lsh64x64 x (ANDconst <typ.Int64> [63] y))
2972 // result: (SLD x (ANDconst <typ.Int64> [63] y))
2975 if v_1.Op != OpPPC64ANDconst || v_1.Type != typ.Int64 || auxIntToInt64(v_1.AuxInt) != 63 {
2980 v0 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int64)
2981 v0.AuxInt = int64ToAuxInt(63)
2986 // match: (Lsh64x64 x y)
2987 // result: (SLD x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [64]))))
2992 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
2993 v0.AuxInt = int32ToAuxInt(0)
2994 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2995 v1.AuxInt = int64ToAuxInt(-1)
2996 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2997 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2998 v3.AuxInt = int64ToAuxInt(64)
3000 v0.AddArg3(y, v1, v2)
3005 func rewriteValuePPC64_OpLsh64x8(v *Value) bool {
3009 typ := &b.Func.Config.Types
3010 // match: (Lsh64x8 x y)
3011 // cond: shiftIsBounded(v)
3012 // result: (SLD x y)
3016 if !(shiftIsBounded(v)) {
3023 // match: (Lsh64x8 x y)
3024 // result: (SLD x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [64]))))
3029 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
3030 v0.AuxInt = int32ToAuxInt(0)
3031 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3032 v1.AuxInt = int64ToAuxInt(-1)
3033 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
3034 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
3036 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3037 v4.AuxInt = int64ToAuxInt(64)
3039 v0.AddArg3(y, v1, v2)
3044 func rewriteValuePPC64_OpLsh8x16(v *Value) bool {
3048 typ := &b.Func.Config.Types
3049 // match: (Lsh8x16 x y)
3050 // cond: shiftIsBounded(v)
3051 // result: (SLW x y)
3055 if !(shiftIsBounded(v)) {
3062 // match: (Lsh8x16 x y)
3063 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [8]))))
3068 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
3069 v0.AuxInt = int32ToAuxInt(0)
3070 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3071 v1.AuxInt = int64ToAuxInt(-1)
3072 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
3073 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
3075 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3076 v4.AuxInt = int64ToAuxInt(8)
3078 v0.AddArg3(y, v1, v2)
3083 func rewriteValuePPC64_OpLsh8x32(v *Value) bool {
3087 typ := &b.Func.Config.Types
3088 // match: (Lsh8x32 x (MOVDconst [c]))
3089 // cond: uint32(c) < 8
3090 // result: (SLWconst x [c&7])
3093 if v_1.Op != OpPPC64MOVDconst {
3096 c := auxIntToInt64(v_1.AuxInt)
3097 if !(uint32(c) < 8) {
3100 v.reset(OpPPC64SLWconst)
3101 v.AuxInt = int64ToAuxInt(c & 7)
3105 // match: (Lsh8x32 x y)
3106 // cond: shiftIsBounded(v)
3107 // result: (SLW x y)
3111 if !(shiftIsBounded(v)) {
3118 // match: (Lsh8x32 x y)
3119 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [8]))))
3124 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
3125 v0.AuxInt = int32ToAuxInt(0)
3126 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3127 v1.AuxInt = int64ToAuxInt(-1)
3128 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
3129 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3130 v3.AuxInt = int64ToAuxInt(8)
3132 v0.AddArg3(y, v1, v2)
3137 func rewriteValuePPC64_OpLsh8x64(v *Value) bool {
3141 typ := &b.Func.Config.Types
3142 // match: (Lsh8x64 _ (MOVDconst [c]))
3143 // cond: uint64(c) >= 8
3144 // result: (MOVDconst [0])
3146 if v_1.Op != OpPPC64MOVDconst {
3149 c := auxIntToInt64(v_1.AuxInt)
3150 if !(uint64(c) >= 8) {
3153 v.reset(OpPPC64MOVDconst)
3154 v.AuxInt = int64ToAuxInt(0)
3157 // match: (Lsh8x64 x (MOVDconst [c]))
3158 // cond: uint64(c) < 8
3159 // result: (SLWconst x [c])
3162 if v_1.Op != OpPPC64MOVDconst {
3165 c := auxIntToInt64(v_1.AuxInt)
3166 if !(uint64(c) < 8) {
3169 v.reset(OpPPC64SLWconst)
3170 v.AuxInt = int64ToAuxInt(c)
3174 // match: (Lsh8x64 x y)
3175 // cond: shiftIsBounded(v)
3176 // result: (SLW x y)
3180 if !(shiftIsBounded(v)) {
3187 // match: (Lsh8x64 x y)
3188 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [8]))))
3193 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
3194 v0.AuxInt = int32ToAuxInt(0)
3195 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3196 v1.AuxInt = int64ToAuxInt(-1)
3197 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
3198 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3199 v3.AuxInt = int64ToAuxInt(8)
3201 v0.AddArg3(y, v1, v2)
3206 func rewriteValuePPC64_OpLsh8x8(v *Value) bool {
3210 typ := &b.Func.Config.Types
3211 // match: (Lsh8x8 x y)
3212 // cond: shiftIsBounded(v)
3213 // result: (SLW x y)
3217 if !(shiftIsBounded(v)) {
3224 // match: (Lsh8x8 x y)
3225 // result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [8]))))
3230 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
3231 v0.AuxInt = int32ToAuxInt(0)
3232 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3233 v1.AuxInt = int64ToAuxInt(-1)
3234 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
3235 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
3237 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3238 v4.AuxInt = int64ToAuxInt(8)
3240 v0.AddArg3(y, v1, v2)
3245 func rewriteValuePPC64_OpMod16(v *Value) bool {
3249 typ := &b.Func.Config.Types
3250 // match: (Mod16 x y)
3251 // result: (Mod32 (SignExt16to32 x) (SignExt16to32 y))
3256 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3258 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3264 func rewriteValuePPC64_OpMod16u(v *Value) bool {
3268 typ := &b.Func.Config.Types
3269 // match: (Mod16u x y)
3270 // result: (Mod32u (ZeroExt16to32 x) (ZeroExt16to32 y))
3275 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3277 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3283 func rewriteValuePPC64_OpMod32(v *Value) bool {
3287 typ := &b.Func.Config.Types
3288 // match: (Mod32 x y)
3289 // cond: objabi.GOPPC64 >= 9
3290 // result: (MODSW x y)
3294 if !(objabi.GOPPC64 >= 9) {
3297 v.reset(OpPPC64MODSW)
3301 // match: (Mod32 x y)
3302 // cond: objabi.GOPPC64 <= 8
3303 // result: (SUB x (MULLW y (DIVW x y)))
3307 if !(objabi.GOPPC64 <= 8) {
3311 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
3312 v1 := b.NewValue0(v.Pos, OpPPC64DIVW, typ.Int32)
3320 func rewriteValuePPC64_OpMod32u(v *Value) bool {
3324 typ := &b.Func.Config.Types
3325 // match: (Mod32u x y)
3326 // cond: objabi.GOPPC64 >= 9
3327 // result: (MODUW x y)
3331 if !(objabi.GOPPC64 >= 9) {
3334 v.reset(OpPPC64MODUW)
3338 // match: (Mod32u x y)
3339 // cond: objabi.GOPPC64 <= 8
3340 // result: (SUB x (MULLW y (DIVWU x y)))
3344 if !(objabi.GOPPC64 <= 8) {
3348 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
3349 v1 := b.NewValue0(v.Pos, OpPPC64DIVWU, typ.Int32)
3357 func rewriteValuePPC64_OpMod64(v *Value) bool {
3361 typ := &b.Func.Config.Types
3362 // match: (Mod64 x y)
3363 // cond: objabi.GOPPC64 >=9
3364 // result: (MODSD x y)
3368 if !(objabi.GOPPC64 >= 9) {
3371 v.reset(OpPPC64MODSD)
3375 // match: (Mod64 x y)
3376 // cond: objabi.GOPPC64 <=8
3377 // result: (SUB x (MULLD y (DIVD x y)))
3381 if !(objabi.GOPPC64 <= 8) {
3385 v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
3386 v1 := b.NewValue0(v.Pos, OpPPC64DIVD, typ.Int64)
3394 func rewriteValuePPC64_OpMod64u(v *Value) bool {
3398 typ := &b.Func.Config.Types
3399 // match: (Mod64u x y)
3400 // cond: objabi.GOPPC64 >= 9
3401 // result: (MODUD x y)
3405 if !(objabi.GOPPC64 >= 9) {
3408 v.reset(OpPPC64MODUD)
3412 // match: (Mod64u x y)
3413 // cond: objabi.GOPPC64 <= 8
3414 // result: (SUB x (MULLD y (DIVDU x y)))
3418 if !(objabi.GOPPC64 <= 8) {
3422 v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
3423 v1 := b.NewValue0(v.Pos, OpPPC64DIVDU, typ.Int64)
3431 func rewriteValuePPC64_OpMod8(v *Value) bool {
3435 typ := &b.Func.Config.Types
3436 // match: (Mod8 x y)
3437 // result: (Mod32 (SignExt8to32 x) (SignExt8to32 y))
3442 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
3444 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
3450 func rewriteValuePPC64_OpMod8u(v *Value) bool {
3454 typ := &b.Func.Config.Types
3455 // match: (Mod8u x y)
3456 // result: (Mod32u (ZeroExt8to32 x) (ZeroExt8to32 y))
3461 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
3463 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
3469 func rewriteValuePPC64_OpMove(v *Value) bool {
3474 typ := &b.Func.Config.Types
3475 // match: (Move [0] _ _ mem)
3478 if auxIntToInt64(v.AuxInt) != 0 {
3485 // match: (Move [1] dst src mem)
3486 // result: (MOVBstore dst (MOVBZload src mem) mem)
3488 if auxIntToInt64(v.AuxInt) != 1 {
3494 v.reset(OpPPC64MOVBstore)
3495 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3496 v0.AddArg2(src, mem)
3497 v.AddArg3(dst, v0, mem)
3500 // match: (Move [2] dst src mem)
3501 // result: (MOVHstore dst (MOVHZload src mem) mem)
3503 if auxIntToInt64(v.AuxInt) != 2 {
3509 v.reset(OpPPC64MOVHstore)
3510 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
3511 v0.AddArg2(src, mem)
3512 v.AddArg3(dst, v0, mem)
3515 // match: (Move [4] dst src mem)
3516 // result: (MOVWstore dst (MOVWZload src mem) mem)
3518 if auxIntToInt64(v.AuxInt) != 4 {
3524 v.reset(OpPPC64MOVWstore)
3525 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3526 v0.AddArg2(src, mem)
3527 v.AddArg3(dst, v0, mem)
3530 // match: (Move [8] {t} dst src mem)
3531 // result: (MOVDstore dst (MOVDload src mem) mem)
3533 if auxIntToInt64(v.AuxInt) != 8 {
3539 v.reset(OpPPC64MOVDstore)
3540 v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, typ.Int64)
3541 v0.AddArg2(src, mem)
3542 v.AddArg3(dst, v0, mem)
3545 // match: (Move [3] dst src mem)
3546 // result: (MOVBstore [2] dst (MOVBZload [2] src mem) (MOVHstore dst (MOVHload src mem) mem))
3548 if auxIntToInt64(v.AuxInt) != 3 {
3554 v.reset(OpPPC64MOVBstore)
3555 v.AuxInt = int32ToAuxInt(2)
3556 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3557 v0.AuxInt = int32ToAuxInt(2)
3558 v0.AddArg2(src, mem)
3559 v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
3560 v2 := b.NewValue0(v.Pos, OpPPC64MOVHload, typ.Int16)
3561 v2.AddArg2(src, mem)
3562 v1.AddArg3(dst, v2, mem)
3563 v.AddArg3(dst, v0, v1)
3566 // match: (Move [5] dst src mem)
3567 // result: (MOVBstore [4] dst (MOVBZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
3569 if auxIntToInt64(v.AuxInt) != 5 {
3575 v.reset(OpPPC64MOVBstore)
3576 v.AuxInt = int32ToAuxInt(4)
3577 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3578 v0.AuxInt = int32ToAuxInt(4)
3579 v0.AddArg2(src, mem)
3580 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
3581 v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3582 v2.AddArg2(src, mem)
3583 v1.AddArg3(dst, v2, mem)
3584 v.AddArg3(dst, v0, v1)
3587 // match: (Move [6] dst src mem)
3588 // result: (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
3590 if auxIntToInt64(v.AuxInt) != 6 {
3596 v.reset(OpPPC64MOVHstore)
3597 v.AuxInt = int32ToAuxInt(4)
3598 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
3599 v0.AuxInt = int32ToAuxInt(4)
3600 v0.AddArg2(src, mem)
3601 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
3602 v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3603 v2.AddArg2(src, mem)
3604 v1.AddArg3(dst, v2, mem)
3605 v.AddArg3(dst, v0, v1)
3608 // match: (Move [7] dst src mem)
3609 // result: (MOVBstore [6] dst (MOVBZload [6] src mem) (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem)))
3611 if auxIntToInt64(v.AuxInt) != 7 {
3617 v.reset(OpPPC64MOVBstore)
3618 v.AuxInt = int32ToAuxInt(6)
3619 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3620 v0.AuxInt = int32ToAuxInt(6)
3621 v0.AddArg2(src, mem)
3622 v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
3623 v1.AuxInt = int32ToAuxInt(4)
3624 v2 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
3625 v2.AuxInt = int32ToAuxInt(4)
3626 v2.AddArg2(src, mem)
3627 v3 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
3628 v4 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3629 v4.AddArg2(src, mem)
3630 v3.AddArg3(dst, v4, mem)
3631 v1.AddArg3(dst, v2, v3)
3632 v.AddArg3(dst, v0, v1)
3635 // match: (Move [s] dst src mem)
3636 // cond: s > 8 && objabi.GOPPC64 <= 8 && logLargeCopy(v, s)
3637 // result: (LoweredMove [s] dst src mem)
3639 s := auxIntToInt64(v.AuxInt)
3643 if !(s > 8 && objabi.GOPPC64 <= 8 && logLargeCopy(v, s)) {
3646 v.reset(OpPPC64LoweredMove)
3647 v.AuxInt = int64ToAuxInt(s)
3648 v.AddArg3(dst, src, mem)
3651 // match: (Move [s] dst src mem)
3652 // cond: s > 8 && s <= 64 && objabi.GOPPC64 >= 9
3653 // result: (LoweredQuadMoveShort [s] dst src mem)
3655 s := auxIntToInt64(v.AuxInt)
3659 if !(s > 8 && s <= 64 && objabi.GOPPC64 >= 9) {
3662 v.reset(OpPPC64LoweredQuadMoveShort)
3663 v.AuxInt = int64ToAuxInt(s)
3664 v.AddArg3(dst, src, mem)
3667 // match: (Move [s] dst src mem)
3668 // cond: s > 8 && objabi.GOPPC64 >= 9 && logLargeCopy(v, s)
3669 // result: (LoweredQuadMove [s] dst src mem)
3671 s := auxIntToInt64(v.AuxInt)
3675 if !(s > 8 && objabi.GOPPC64 >= 9 && logLargeCopy(v, s)) {
3678 v.reset(OpPPC64LoweredQuadMove)
3679 v.AuxInt = int64ToAuxInt(s)
3680 v.AddArg3(dst, src, mem)
3685 func rewriteValuePPC64_OpNeq16(v *Value) bool {
3689 typ := &b.Func.Config.Types
3690 // match: (Neq16 x y)
3691 // cond: isSigned(x.Type) && isSigned(y.Type)
3692 // result: (NotEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
3694 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3697 if !(isSigned(x.Type) && isSigned(y.Type)) {
3700 v.reset(OpPPC64NotEqual)
3701 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3702 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3704 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3712 // match: (Neq16 x y)
3713 // result: (NotEqual (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
3717 v.reset(OpPPC64NotEqual)
3718 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3719 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3721 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3728 func rewriteValuePPC64_OpNeq32(v *Value) bool {
3732 // match: (Neq32 x y)
3733 // result: (NotEqual (CMPW x y))
3737 v.reset(OpPPC64NotEqual)
3738 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3744 func rewriteValuePPC64_OpNeq32F(v *Value) bool {
3748 // match: (Neq32F x y)
3749 // result: (NotEqual (FCMPU x y))
3753 v.reset(OpPPC64NotEqual)
3754 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
3760 func rewriteValuePPC64_OpNeq64(v *Value) bool {
3764 // match: (Neq64 x y)
3765 // result: (NotEqual (CMP x y))
3769 v.reset(OpPPC64NotEqual)
3770 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
3776 func rewriteValuePPC64_OpNeq64F(v *Value) bool {
3780 // match: (Neq64F x y)
3781 // result: (NotEqual (FCMPU x y))
3785 v.reset(OpPPC64NotEqual)
3786 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
3792 func rewriteValuePPC64_OpNeq8(v *Value) bool {
3796 typ := &b.Func.Config.Types
3797 // match: (Neq8 x y)
3798 // cond: isSigned(x.Type) && isSigned(y.Type)
3799 // result: (NotEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
3801 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3804 if !(isSigned(x.Type) && isSigned(y.Type)) {
3807 v.reset(OpPPC64NotEqual)
3808 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3809 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
3811 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
3819 // match: (Neq8 x y)
3820 // result: (NotEqual (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
3824 v.reset(OpPPC64NotEqual)
3825 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3826 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
3828 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
3835 func rewriteValuePPC64_OpNeqPtr(v *Value) bool {
3839 // match: (NeqPtr x y)
3840 // result: (NotEqual (CMP x y))
3844 v.reset(OpPPC64NotEqual)
3845 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
3851 func rewriteValuePPC64_OpNot(v *Value) bool {
3854 // result: (XORconst [1] x)
3857 v.reset(OpPPC64XORconst)
3858 v.AuxInt = int64ToAuxInt(1)
3863 func rewriteValuePPC64_OpOffPtr(v *Value) bool {
3866 typ := &b.Func.Config.Types
3867 // match: (OffPtr [off] ptr)
3868 // result: (ADD (MOVDconst <typ.Int64> [off]) ptr)
3870 off := auxIntToInt64(v.AuxInt)
3873 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3874 v0.AuxInt = int64ToAuxInt(off)
3879 func rewriteValuePPC64_OpPPC64ADD(v *Value) bool {
3883 typ := &b.Func.Config.Types
3884 // match: (ADD l:(MULLD x y) z)
3885 // cond: objabi.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)
3886 // result: (MADDLD x y z)
3888 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3890 if l.Op != OpPPC64MULLD {
3896 if !(objabi.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
3899 v.reset(OpPPC64MADDLD)
3905 // match: (ADD (SLDconst x [c]) (SRDconst x [d]))
3907 // result: (ROTLconst [c] x)
3909 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3910 if v_0.Op != OpPPC64SLDconst {
3913 c := auxIntToInt64(v_0.AuxInt)
3915 if v_1.Op != OpPPC64SRDconst {
3918 d := auxIntToInt64(v_1.AuxInt)
3919 if x != v_1.Args[0] || !(d == 64-c) {
3922 v.reset(OpPPC64ROTLconst)
3923 v.AuxInt = int64ToAuxInt(c)
3929 // match: (ADD (SLWconst x [c]) (SRWconst x [d]))
3931 // result: (ROTLWconst [c] x)
3933 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3934 if v_0.Op != OpPPC64SLWconst {
3937 c := auxIntToInt64(v_0.AuxInt)
3939 if v_1.Op != OpPPC64SRWconst {
3942 d := auxIntToInt64(v_1.AuxInt)
3943 if x != v_1.Args[0] || !(d == 32-c) {
3946 v.reset(OpPPC64ROTLWconst)
3947 v.AuxInt = int64ToAuxInt(c)
3953 // match: (ADD (SLD x (ANDconst <typ.Int64> [63] y)) (SRD x (SUB <typ.UInt> (MOVDconst [64]) (ANDconst <typ.UInt> [63] y))))
3954 // result: (ROTL x y)
3956 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3957 if v_0.Op != OpPPC64SLD {
3962 v_0_1 := v_0.Args[1]
3963 if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int64 || auxIntToInt64(v_0_1.AuxInt) != 63 {
3967 if v_1.Op != OpPPC64SRD {
3971 if x != v_1.Args[0] {
3974 v_1_1 := v_1.Args[1]
3975 if v_1_1.Op != OpPPC64SUB || v_1_1.Type != typ.UInt {
3979 v_1_1_0 := v_1_1.Args[0]
3980 if v_1_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1_0.AuxInt) != 64 {
3983 v_1_1_1 := v_1_1.Args[1]
3984 if v_1_1_1.Op != OpPPC64ANDconst || v_1_1_1.Type != typ.UInt || auxIntToInt64(v_1_1_1.AuxInt) != 63 || y != v_1_1_1.Args[0] {
3987 v.reset(OpPPC64ROTL)
3993 // match: (ADD (SLD x (ANDconst <typ.Int64> [63] y)) (SRD x (SUBFCconst <typ.UInt> [64] (ANDconst <typ.UInt> [63] y))))
3994 // result: (ROTL x y)
3996 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3997 if v_0.Op != OpPPC64SLD {
4002 v_0_1 := v_0.Args[1]
4003 if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int64 || auxIntToInt64(v_0_1.AuxInt) != 63 {
4007 if v_1.Op != OpPPC64SRD {
4011 if x != v_1.Args[0] {
4014 v_1_1 := v_1.Args[1]
4015 if v_1_1.Op != OpPPC64SUBFCconst || v_1_1.Type != typ.UInt || auxIntToInt64(v_1_1.AuxInt) != 64 {
4018 v_1_1_0 := v_1_1.Args[0]
4019 if v_1_1_0.Op != OpPPC64ANDconst || v_1_1_0.Type != typ.UInt || auxIntToInt64(v_1_1_0.AuxInt) != 63 || y != v_1_1_0.Args[0] {
4022 v.reset(OpPPC64ROTL)
4028 // match: (ADD (SLW x (ANDconst <typ.Int32> [31] y)) (SRW x (SUBFCconst <typ.UInt> [32] (ANDconst <typ.UInt> [31] y))))
4029 // result: (ROTLW x y)
4031 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4032 if v_0.Op != OpPPC64SLW {
4037 v_0_1 := v_0.Args[1]
4038 if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int32 || auxIntToInt64(v_0_1.AuxInt) != 31 {
4042 if v_1.Op != OpPPC64SRW {
4046 if x != v_1.Args[0] {
4049 v_1_1 := v_1.Args[1]
4050 if v_1_1.Op != OpPPC64SUBFCconst || v_1_1.Type != typ.UInt || auxIntToInt64(v_1_1.AuxInt) != 32 {
4053 v_1_1_0 := v_1_1.Args[0]
4054 if v_1_1_0.Op != OpPPC64ANDconst || v_1_1_0.Type != typ.UInt || auxIntToInt64(v_1_1_0.AuxInt) != 31 || y != v_1_1_0.Args[0] {
4057 v.reset(OpPPC64ROTLW)
4063 // match: (ADD (SLW x (ANDconst <typ.Int32> [31] y)) (SRW x (SUB <typ.UInt> (MOVDconst [32]) (ANDconst <typ.UInt> [31] y))))
4064 // result: (ROTLW x y)
4066 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4067 if v_0.Op != OpPPC64SLW {
4072 v_0_1 := v_0.Args[1]
4073 if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int32 || auxIntToInt64(v_0_1.AuxInt) != 31 {
4077 if v_1.Op != OpPPC64SRW {
4081 if x != v_1.Args[0] {
4084 v_1_1 := v_1.Args[1]
4085 if v_1_1.Op != OpPPC64SUB || v_1_1.Type != typ.UInt {
4089 v_1_1_0 := v_1_1.Args[0]
4090 if v_1_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1_0.AuxInt) != 32 {
4093 v_1_1_1 := v_1_1.Args[1]
4094 if v_1_1_1.Op != OpPPC64ANDconst || v_1_1_1.Type != typ.UInt || auxIntToInt64(v_1_1_1.AuxInt) != 31 || y != v_1_1_1.Args[0] {
4097 v.reset(OpPPC64ROTLW)
4103 // match: (ADD x (MOVDconst [c]))
4105 // result: (ADDconst [c] x)
4107 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4109 if v_1.Op != OpPPC64MOVDconst {
4112 c := auxIntToInt64(v_1.AuxInt)
4116 v.reset(OpPPC64ADDconst)
4117 v.AuxInt = int64ToAuxInt(c)
4125 func rewriteValuePPC64_OpPPC64ADDconst(v *Value) bool {
4127 // match: (ADDconst [c] (ADDconst [d] x))
4128 // cond: is32Bit(c+d)
4129 // result: (ADDconst [c+d] x)
4131 c := auxIntToInt64(v.AuxInt)
4132 if v_0.Op != OpPPC64ADDconst {
4135 d := auxIntToInt64(v_0.AuxInt)
4137 if !(is32Bit(c + d)) {
4140 v.reset(OpPPC64ADDconst)
4141 v.AuxInt = int64ToAuxInt(c + d)
4145 // match: (ADDconst [0] x)
4148 if auxIntToInt64(v.AuxInt) != 0 {
4155 // match: (ADDconst [c] (MOVDaddr [d] {sym} x))
4156 // cond: is32Bit(c+int64(d))
4157 // result: (MOVDaddr [int32(c+int64(d))] {sym} x)
4159 c := auxIntToInt64(v.AuxInt)
4160 if v_0.Op != OpPPC64MOVDaddr {
4163 d := auxIntToInt32(v_0.AuxInt)
4164 sym := auxToSym(v_0.Aux)
4166 if !(is32Bit(c + int64(d))) {
4169 v.reset(OpPPC64MOVDaddr)
4170 v.AuxInt = int32ToAuxInt(int32(c + int64(d)))
4171 v.Aux = symToAux(sym)
4175 // match: (ADDconst [c] x:(SP))
4177 // result: (MOVDaddr [int32(c)] x)
4179 c := auxIntToInt64(v.AuxInt)
4181 if x.Op != OpSP || !(is32Bit(c)) {
4184 v.reset(OpPPC64MOVDaddr)
4185 v.AuxInt = int32ToAuxInt(int32(c))
4189 // match: (ADDconst [c] (SUBFCconst [d] x))
4190 // cond: is32Bit(c+d)
4191 // result: (SUBFCconst [c+d] x)
4193 c := auxIntToInt64(v.AuxInt)
4194 if v_0.Op != OpPPC64SUBFCconst {
4197 d := auxIntToInt64(v_0.AuxInt)
4199 if !(is32Bit(c + d)) {
4202 v.reset(OpPPC64SUBFCconst)
4203 v.AuxInt = int64ToAuxInt(c + d)
4209 func rewriteValuePPC64_OpPPC64AND(v *Value) bool {
4212 // match: (AND (MOVDconst [m]) (ROTLWconst [r] x))
4213 // cond: isPPC64WordRotateMask(m)
4214 // result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
4216 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4217 if v_0.Op != OpPPC64MOVDconst {
4220 m := auxIntToInt64(v_0.AuxInt)
4221 if v_1.Op != OpPPC64ROTLWconst {
4224 r := auxIntToInt64(v_1.AuxInt)
4226 if !(isPPC64WordRotateMask(m)) {
4229 v.reset(OpPPC64RLWINM)
4230 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
4236 // match: (AND (MOVDconst [m]) (ROTLW x r))
4237 // cond: isPPC64WordRotateMask(m)
4238 // result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
4240 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4241 if v_0.Op != OpPPC64MOVDconst {
4244 m := auxIntToInt64(v_0.AuxInt)
4245 if v_1.Op != OpPPC64ROTLW {
4250 if !(isPPC64WordRotateMask(m)) {
4253 v.reset(OpPPC64RLWNM)
4254 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
4260 // match: (AND (MOVDconst [m]) (SRWconst x [s]))
4261 // cond: mergePPC64RShiftMask(m,s,32) == 0
4262 // result: (MOVDconst [0])
4264 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4265 if v_0.Op != OpPPC64MOVDconst {
4268 m := auxIntToInt64(v_0.AuxInt)
4269 if v_1.Op != OpPPC64SRWconst {
4272 s := auxIntToInt64(v_1.AuxInt)
4273 if !(mergePPC64RShiftMask(m, s, 32) == 0) {
4276 v.reset(OpPPC64MOVDconst)
4277 v.AuxInt = int64ToAuxInt(0)
4282 // match: (AND (MOVDconst [m]) (SRWconst x [s]))
4283 // cond: mergePPC64AndSrwi(m,s) != 0
4284 // result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
4286 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4287 if v_0.Op != OpPPC64MOVDconst {
4290 m := auxIntToInt64(v_0.AuxInt)
4291 if v_1.Op != OpPPC64SRWconst {
4294 s := auxIntToInt64(v_1.AuxInt)
4296 if !(mergePPC64AndSrwi(m, s) != 0) {
4299 v.reset(OpPPC64RLWINM)
4300 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
4306 // match: (AND x (NOR y y))
4307 // result: (ANDN x y)
4309 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4311 if v_1.Op != OpPPC64NOR {
4315 if y != v_1.Args[0] {
4318 v.reset(OpPPC64ANDN)
4324 // match: (AND (MOVDconst [c]) (MOVDconst [d]))
4325 // result: (MOVDconst [c&d])
4327 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4328 if v_0.Op != OpPPC64MOVDconst {
4331 c := auxIntToInt64(v_0.AuxInt)
4332 if v_1.Op != OpPPC64MOVDconst {
4335 d := auxIntToInt64(v_1.AuxInt)
4336 v.reset(OpPPC64MOVDconst)
4337 v.AuxInt = int64ToAuxInt(c & d)
4342 // match: (AND x (MOVDconst [c]))
4343 // cond: isU16Bit(c)
4344 // result: (ANDconst [c] x)
4346 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4348 if v_1.Op != OpPPC64MOVDconst {
4351 c := auxIntToInt64(v_1.AuxInt)
4355 v.reset(OpPPC64ANDconst)
4356 v.AuxInt = int64ToAuxInt(c)
4362 // match: (AND (MOVDconst [c]) y:(MOVWZreg _))
4363 // cond: c&0xFFFFFFFF == 0xFFFFFFFF
4366 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4367 if v_0.Op != OpPPC64MOVDconst {
4370 c := auxIntToInt64(v_0.AuxInt)
4372 if y.Op != OpPPC64MOVWZreg || !(c&0xFFFFFFFF == 0xFFFFFFFF) {
4380 // match: (AND (MOVDconst [0xFFFFFFFF]) y:(MOVWreg x))
4381 // result: (MOVWZreg x)
4383 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4384 if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0xFFFFFFFF {
4388 if y.Op != OpPPC64MOVWreg {
4392 v.reset(OpPPC64MOVWZreg)
4398 // match: (AND (MOVDconst [c]) x:(MOVBZload _ _))
4399 // result: (ANDconst [c&0xFF] x)
4401 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4402 if v_0.Op != OpPPC64MOVDconst {
4405 c := auxIntToInt64(v_0.AuxInt)
4407 if x.Op != OpPPC64MOVBZload {
4410 v.reset(OpPPC64ANDconst)
4411 v.AuxInt = int64ToAuxInt(c & 0xFF)
4419 func rewriteValuePPC64_OpPPC64ANDN(v *Value) bool {
4422 // match: (ANDN (MOVDconst [c]) (MOVDconst [d]))
4423 // result: (MOVDconst [c&^d])
4425 if v_0.Op != OpPPC64MOVDconst {
4428 c := auxIntToInt64(v_0.AuxInt)
4429 if v_1.Op != OpPPC64MOVDconst {
4432 d := auxIntToInt64(v_1.AuxInt)
4433 v.reset(OpPPC64MOVDconst)
4434 v.AuxInt = int64ToAuxInt(c &^ d)
4439 func rewriteValuePPC64_OpPPC64ANDconst(v *Value) bool {
4441 // match: (ANDconst [m] (ROTLWconst [r] x))
4442 // cond: isPPC64WordRotateMask(m)
4443 // result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
4445 m := auxIntToInt64(v.AuxInt)
4446 if v_0.Op != OpPPC64ROTLWconst {
4449 r := auxIntToInt64(v_0.AuxInt)
4451 if !(isPPC64WordRotateMask(m)) {
4454 v.reset(OpPPC64RLWINM)
4455 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
4459 // match: (ANDconst [m] (ROTLW x r))
4460 // cond: isPPC64WordRotateMask(m)
4461 // result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
4463 m := auxIntToInt64(v.AuxInt)
4464 if v_0.Op != OpPPC64ROTLW {
4469 if !(isPPC64WordRotateMask(m)) {
4472 v.reset(OpPPC64RLWNM)
4473 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
4477 // match: (ANDconst [m] (SRWconst x [s]))
4478 // cond: mergePPC64RShiftMask(m,s,32) == 0
4479 // result: (MOVDconst [0])
4481 m := auxIntToInt64(v.AuxInt)
4482 if v_0.Op != OpPPC64SRWconst {
4485 s := auxIntToInt64(v_0.AuxInt)
4486 if !(mergePPC64RShiftMask(m, s, 32) == 0) {
4489 v.reset(OpPPC64MOVDconst)
4490 v.AuxInt = int64ToAuxInt(0)
4493 // match: (ANDconst [m] (SRWconst x [s]))
4494 // cond: mergePPC64AndSrwi(m,s) != 0
4495 // result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
4497 m := auxIntToInt64(v.AuxInt)
4498 if v_0.Op != OpPPC64SRWconst {
4501 s := auxIntToInt64(v_0.AuxInt)
4503 if !(mergePPC64AndSrwi(m, s) != 0) {
4506 v.reset(OpPPC64RLWINM)
4507 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
4511 // match: (ANDconst [c] (ANDconst [d] x))
4512 // result: (ANDconst [c&d] x)
4514 c := auxIntToInt64(v.AuxInt)
4515 if v_0.Op != OpPPC64ANDconst {
4518 d := auxIntToInt64(v_0.AuxInt)
4520 v.reset(OpPPC64ANDconst)
4521 v.AuxInt = int64ToAuxInt(c & d)
4525 // match: (ANDconst [-1] x)
4528 if auxIntToInt64(v.AuxInt) != -1 {
4535 // match: (ANDconst [0] _)
4536 // result: (MOVDconst [0])
4538 if auxIntToInt64(v.AuxInt) != 0 {
4541 v.reset(OpPPC64MOVDconst)
4542 v.AuxInt = int64ToAuxInt(0)
4545 // match: (ANDconst [c] y:(MOVBZreg _))
4546 // cond: c&0xFF == 0xFF
4549 c := auxIntToInt64(v.AuxInt)
4551 if y.Op != OpPPC64MOVBZreg || !(c&0xFF == 0xFF) {
4557 // match: (ANDconst [0xFF] y:(MOVBreg _))
4560 if auxIntToInt64(v.AuxInt) != 0xFF {
4564 if y.Op != OpPPC64MOVBreg {
4570 // match: (ANDconst [c] y:(MOVHZreg _))
4571 // cond: c&0xFFFF == 0xFFFF
4574 c := auxIntToInt64(v.AuxInt)
4576 if y.Op != OpPPC64MOVHZreg || !(c&0xFFFF == 0xFFFF) {
4582 // match: (ANDconst [0xFFFF] y:(MOVHreg _))
4585 if auxIntToInt64(v.AuxInt) != 0xFFFF {
4589 if y.Op != OpPPC64MOVHreg {
4595 // match: (ANDconst [c] (MOVBreg x))
4596 // result: (ANDconst [c&0xFF] x)
4598 c := auxIntToInt64(v.AuxInt)
4599 if v_0.Op != OpPPC64MOVBreg {
4603 v.reset(OpPPC64ANDconst)
4604 v.AuxInt = int64ToAuxInt(c & 0xFF)
4608 // match: (ANDconst [c] (MOVBZreg x))
4609 // result: (ANDconst [c&0xFF] x)
4611 c := auxIntToInt64(v.AuxInt)
4612 if v_0.Op != OpPPC64MOVBZreg {
4616 v.reset(OpPPC64ANDconst)
4617 v.AuxInt = int64ToAuxInt(c & 0xFF)
4621 // match: (ANDconst [c] (MOVHreg x))
4622 // result: (ANDconst [c&0xFFFF] x)
4624 c := auxIntToInt64(v.AuxInt)
4625 if v_0.Op != OpPPC64MOVHreg {
4629 v.reset(OpPPC64ANDconst)
4630 v.AuxInt = int64ToAuxInt(c & 0xFFFF)
4634 // match: (ANDconst [c] (MOVHZreg x))
4635 // result: (ANDconst [c&0xFFFF] x)
4637 c := auxIntToInt64(v.AuxInt)
4638 if v_0.Op != OpPPC64MOVHZreg {
4642 v.reset(OpPPC64ANDconst)
4643 v.AuxInt = int64ToAuxInt(c & 0xFFFF)
4647 // match: (ANDconst [c] (MOVWreg x))
4648 // result: (ANDconst [c&0xFFFFFFFF] x)
4650 c := auxIntToInt64(v.AuxInt)
4651 if v_0.Op != OpPPC64MOVWreg {
4655 v.reset(OpPPC64ANDconst)
4656 v.AuxInt = int64ToAuxInt(c & 0xFFFFFFFF)
4660 // match: (ANDconst [c] (MOVWZreg x))
4661 // result: (ANDconst [c&0xFFFFFFFF] x)
4663 c := auxIntToInt64(v.AuxInt)
4664 if v_0.Op != OpPPC64MOVWZreg {
4668 v.reset(OpPPC64ANDconst)
4669 v.AuxInt = int64ToAuxInt(c & 0xFFFFFFFF)
4675 func rewriteValuePPC64_OpPPC64CLRLSLDI(v *Value) bool {
4677 // match: (CLRLSLDI [c] (SRWconst [s] x))
4678 // cond: mergePPC64ClrlsldiSrw(int64(c),s) != 0
4679 // result: (RLWINM [mergePPC64ClrlsldiSrw(int64(c),s)] x)
4681 c := auxIntToInt32(v.AuxInt)
4682 if v_0.Op != OpPPC64SRWconst {
4685 s := auxIntToInt64(v_0.AuxInt)
4687 if !(mergePPC64ClrlsldiSrw(int64(c), s) != 0) {
4690 v.reset(OpPPC64RLWINM)
4691 v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrw(int64(c), s))
4695 // match: (CLRLSLDI [c] i:(RLWINM [s] x))
4696 // cond: mergePPC64ClrlsldiRlwinm(c,s) != 0
4697 // result: (RLWINM [mergePPC64ClrlsldiRlwinm(c,s)] x)
4699 c := auxIntToInt32(v.AuxInt)
4701 if i.Op != OpPPC64RLWINM {
4704 s := auxIntToInt64(i.AuxInt)
4706 if !(mergePPC64ClrlsldiRlwinm(c, s) != 0) {
4709 v.reset(OpPPC64RLWINM)
4710 v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiRlwinm(c, s))
4716 func rewriteValuePPC64_OpPPC64CMP(v *Value) bool {
4720 // match: (CMP x (MOVDconst [c]))
4722 // result: (CMPconst x [c])
4725 if v_1.Op != OpPPC64MOVDconst {
4728 c := auxIntToInt64(v_1.AuxInt)
4732 v.reset(OpPPC64CMPconst)
4733 v.AuxInt = int64ToAuxInt(c)
4737 // match: (CMP (MOVDconst [c]) y)
4739 // result: (InvertFlags (CMPconst y [c]))
4741 if v_0.Op != OpPPC64MOVDconst {
4744 c := auxIntToInt64(v_0.AuxInt)
4749 v.reset(OpPPC64InvertFlags)
4750 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
4751 v0.AuxInt = int64ToAuxInt(c)
4757 // cond: canonLessThan(x,y)
4758 // result: (InvertFlags (CMP y x))
4762 if !(canonLessThan(x, y)) {
4765 v.reset(OpPPC64InvertFlags)
4766 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
4773 func rewriteValuePPC64_OpPPC64CMPU(v *Value) bool {
4777 // match: (CMPU x (MOVDconst [c]))
4778 // cond: isU16Bit(c)
4779 // result: (CMPUconst x [c])
4782 if v_1.Op != OpPPC64MOVDconst {
4785 c := auxIntToInt64(v_1.AuxInt)
4789 v.reset(OpPPC64CMPUconst)
4790 v.AuxInt = int64ToAuxInt(c)
4794 // match: (CMPU (MOVDconst [c]) y)
4795 // cond: isU16Bit(c)
4796 // result: (InvertFlags (CMPUconst y [c]))
4798 if v_0.Op != OpPPC64MOVDconst {
4801 c := auxIntToInt64(v_0.AuxInt)
4806 v.reset(OpPPC64InvertFlags)
4807 v0 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
4808 v0.AuxInt = int64ToAuxInt(c)
4813 // match: (CMPU x y)
4814 // cond: canonLessThan(x,y)
4815 // result: (InvertFlags (CMPU y x))
4819 if !(canonLessThan(x, y)) {
4822 v.reset(OpPPC64InvertFlags)
4823 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
4830 func rewriteValuePPC64_OpPPC64CMPUconst(v *Value) bool {
4832 // match: (CMPUconst (MOVDconst [x]) [y])
4836 y := auxIntToInt64(v.AuxInt)
4837 if v_0.Op != OpPPC64MOVDconst {
4840 x := auxIntToInt64(v_0.AuxInt)
4844 v.reset(OpPPC64FlagEQ)
4847 // match: (CMPUconst (MOVDconst [x]) [y])
4848 // cond: uint64(x)<uint64(y)
4851 y := auxIntToInt64(v.AuxInt)
4852 if v_0.Op != OpPPC64MOVDconst {
4855 x := auxIntToInt64(v_0.AuxInt)
4856 if !(uint64(x) < uint64(y)) {
4859 v.reset(OpPPC64FlagLT)
4862 // match: (CMPUconst (MOVDconst [x]) [y])
4863 // cond: uint64(x)>uint64(y)
4866 y := auxIntToInt64(v.AuxInt)
4867 if v_0.Op != OpPPC64MOVDconst {
4870 x := auxIntToInt64(v_0.AuxInt)
4871 if !(uint64(x) > uint64(y)) {
4874 v.reset(OpPPC64FlagGT)
4879 func rewriteValuePPC64_OpPPC64CMPW(v *Value) bool {
4883 // match: (CMPW x (MOVWreg y))
4884 // result: (CMPW x y)
4887 if v_1.Op != OpPPC64MOVWreg {
4891 v.reset(OpPPC64CMPW)
4895 // match: (CMPW (MOVWreg x) y)
4896 // result: (CMPW x y)
4898 if v_0.Op != OpPPC64MOVWreg {
4903 v.reset(OpPPC64CMPW)
4907 // match: (CMPW x (MOVDconst [c]))
4909 // result: (CMPWconst x [int32(c)])
4912 if v_1.Op != OpPPC64MOVDconst {
4915 c := auxIntToInt64(v_1.AuxInt)
4919 v.reset(OpPPC64CMPWconst)
4920 v.AuxInt = int32ToAuxInt(int32(c))
4924 // match: (CMPW (MOVDconst [c]) y)
4926 // result: (InvertFlags (CMPWconst y [int32(c)]))
4928 if v_0.Op != OpPPC64MOVDconst {
4931 c := auxIntToInt64(v_0.AuxInt)
4936 v.reset(OpPPC64InvertFlags)
4937 v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, types.TypeFlags)
4938 v0.AuxInt = int32ToAuxInt(int32(c))
4943 // match: (CMPW x y)
4944 // cond: canonLessThan(x,y)
4945 // result: (InvertFlags (CMPW y x))
4949 if !(canonLessThan(x, y)) {
4952 v.reset(OpPPC64InvertFlags)
4953 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
4960 func rewriteValuePPC64_OpPPC64CMPWU(v *Value) bool {
4964 // match: (CMPWU x (MOVWZreg y))
4965 // result: (CMPWU x y)
4968 if v_1.Op != OpPPC64MOVWZreg {
4972 v.reset(OpPPC64CMPWU)
4976 // match: (CMPWU (MOVWZreg x) y)
4977 // result: (CMPWU x y)
4979 if v_0.Op != OpPPC64MOVWZreg {
4984 v.reset(OpPPC64CMPWU)
4988 // match: (CMPWU x (MOVDconst [c]))
4989 // cond: isU16Bit(c)
4990 // result: (CMPWUconst x [int32(c)])
4993 if v_1.Op != OpPPC64MOVDconst {
4996 c := auxIntToInt64(v_1.AuxInt)
5000 v.reset(OpPPC64CMPWUconst)
5001 v.AuxInt = int32ToAuxInt(int32(c))
5005 // match: (CMPWU (MOVDconst [c]) y)
5006 // cond: isU16Bit(c)
5007 // result: (InvertFlags (CMPWUconst y [int32(c)]))
5009 if v_0.Op != OpPPC64MOVDconst {
5012 c := auxIntToInt64(v_0.AuxInt)
5017 v.reset(OpPPC64InvertFlags)
5018 v0 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
5019 v0.AuxInt = int32ToAuxInt(int32(c))
5024 // match: (CMPWU x y)
5025 // cond: canonLessThan(x,y)
5026 // result: (InvertFlags (CMPWU y x))
5030 if !(canonLessThan(x, y)) {
5033 v.reset(OpPPC64InvertFlags)
5034 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
5041 func rewriteValuePPC64_OpPPC64CMPWUconst(v *Value) bool {
5043 // match: (CMPWUconst (MOVDconst [x]) [y])
5044 // cond: int32(x)==int32(y)
5047 y := auxIntToInt32(v.AuxInt)
5048 if v_0.Op != OpPPC64MOVDconst {
5051 x := auxIntToInt64(v_0.AuxInt)
5052 if !(int32(x) == int32(y)) {
5055 v.reset(OpPPC64FlagEQ)
5058 // match: (CMPWUconst (MOVDconst [x]) [y])
5059 // cond: uint32(x)<uint32(y)
5062 y := auxIntToInt32(v.AuxInt)
5063 if v_0.Op != OpPPC64MOVDconst {
5066 x := auxIntToInt64(v_0.AuxInt)
5067 if !(uint32(x) < uint32(y)) {
5070 v.reset(OpPPC64FlagLT)
5073 // match: (CMPWUconst (MOVDconst [x]) [y])
5074 // cond: uint32(x)>uint32(y)
5077 y := auxIntToInt32(v.AuxInt)
5078 if v_0.Op != OpPPC64MOVDconst {
5081 x := auxIntToInt64(v_0.AuxInt)
5082 if !(uint32(x) > uint32(y)) {
5085 v.reset(OpPPC64FlagGT)
5090 func rewriteValuePPC64_OpPPC64CMPWconst(v *Value) bool {
5092 // match: (CMPWconst (MOVDconst [x]) [y])
5093 // cond: int32(x)==int32(y)
5096 y := auxIntToInt32(v.AuxInt)
5097 if v_0.Op != OpPPC64MOVDconst {
5100 x := auxIntToInt64(v_0.AuxInt)
5101 if !(int32(x) == int32(y)) {
5104 v.reset(OpPPC64FlagEQ)
5107 // match: (CMPWconst (MOVDconst [x]) [y])
5108 // cond: int32(x)<int32(y)
5111 y := auxIntToInt32(v.AuxInt)
5112 if v_0.Op != OpPPC64MOVDconst {
5115 x := auxIntToInt64(v_0.AuxInt)
5116 if !(int32(x) < int32(y)) {
5119 v.reset(OpPPC64FlagLT)
5122 // match: (CMPWconst (MOVDconst [x]) [y])
5123 // cond: int32(x)>int32(y)
5126 y := auxIntToInt32(v.AuxInt)
5127 if v_0.Op != OpPPC64MOVDconst {
5130 x := auxIntToInt64(v_0.AuxInt)
5131 if !(int32(x) > int32(y)) {
5134 v.reset(OpPPC64FlagGT)
5139 func rewriteValuePPC64_OpPPC64CMPconst(v *Value) bool {
5141 // match: (CMPconst (MOVDconst [x]) [y])
5145 y := auxIntToInt64(v.AuxInt)
5146 if v_0.Op != OpPPC64MOVDconst {
5149 x := auxIntToInt64(v_0.AuxInt)
5153 v.reset(OpPPC64FlagEQ)
5156 // match: (CMPconst (MOVDconst [x]) [y])
5160 y := auxIntToInt64(v.AuxInt)
5161 if v_0.Op != OpPPC64MOVDconst {
5164 x := auxIntToInt64(v_0.AuxInt)
5168 v.reset(OpPPC64FlagLT)
5171 // match: (CMPconst (MOVDconst [x]) [y])
5175 y := auxIntToInt64(v.AuxInt)
5176 if v_0.Op != OpPPC64MOVDconst {
5179 x := auxIntToInt64(v_0.AuxInt)
5183 v.reset(OpPPC64FlagGT)
5188 func rewriteValuePPC64_OpPPC64Equal(v *Value) bool {
5191 typ := &b.Func.Config.Types
5192 // match: (Equal (FlagEQ))
5193 // result: (MOVDconst [1])
5195 if v_0.Op != OpPPC64FlagEQ {
5198 v.reset(OpPPC64MOVDconst)
5199 v.AuxInt = int64ToAuxInt(1)
5202 // match: (Equal (FlagLT))
5203 // result: (MOVDconst [0])
5205 if v_0.Op != OpPPC64FlagLT {
5208 v.reset(OpPPC64MOVDconst)
5209 v.AuxInt = int64ToAuxInt(0)
5212 // match: (Equal (FlagGT))
5213 // result: (MOVDconst [0])
5215 if v_0.Op != OpPPC64FlagGT {
5218 v.reset(OpPPC64MOVDconst)
5219 v.AuxInt = int64ToAuxInt(0)
5222 // match: (Equal (InvertFlags x))
5223 // result: (Equal x)
5225 if v_0.Op != OpPPC64InvertFlags {
5229 v.reset(OpPPC64Equal)
5233 // match: (Equal cmp)
5234 // result: (ISELB [2] (MOVDconst [1]) cmp)
5237 v.reset(OpPPC64ISELB)
5238 v.AuxInt = int32ToAuxInt(2)
5239 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
5240 v0.AuxInt = int64ToAuxInt(1)
5245 func rewriteValuePPC64_OpPPC64FABS(v *Value) bool {
5247 // match: (FABS (FMOVDconst [x]))
5248 // result: (FMOVDconst [math.Abs(x)])
5250 if v_0.Op != OpPPC64FMOVDconst {
5253 x := auxIntToFloat64(v_0.AuxInt)
5254 v.reset(OpPPC64FMOVDconst)
5255 v.AuxInt = float64ToAuxInt(math.Abs(x))
5260 func rewriteValuePPC64_OpPPC64FADD(v *Value) bool {
5263 // match: (FADD (FMUL x y) z)
5264 // result: (FMADD x y z)
5266 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5267 if v_0.Op != OpPPC64FMUL {
5273 v.reset(OpPPC64FMADD)
5281 func rewriteValuePPC64_OpPPC64FADDS(v *Value) bool {
5284 // match: (FADDS (FMULS x y) z)
5285 // result: (FMADDS x y z)
5287 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5288 if v_0.Op != OpPPC64FMULS {
5294 v.reset(OpPPC64FMADDS)
5302 func rewriteValuePPC64_OpPPC64FCEIL(v *Value) bool {
5304 // match: (FCEIL (FMOVDconst [x]))
5305 // result: (FMOVDconst [math.Ceil(x)])
5307 if v_0.Op != OpPPC64FMOVDconst {
5310 x := auxIntToFloat64(v_0.AuxInt)
5311 v.reset(OpPPC64FMOVDconst)
5312 v.AuxInt = float64ToAuxInt(math.Ceil(x))
5317 func rewriteValuePPC64_OpPPC64FFLOOR(v *Value) bool {
5319 // match: (FFLOOR (FMOVDconst [x]))
5320 // result: (FMOVDconst [math.Floor(x)])
5322 if v_0.Op != OpPPC64FMOVDconst {
5325 x := auxIntToFloat64(v_0.AuxInt)
5326 v.reset(OpPPC64FMOVDconst)
5327 v.AuxInt = float64ToAuxInt(math.Floor(x))
5332 func rewriteValuePPC64_OpPPC64FGreaterEqual(v *Value) bool {
5335 typ := &b.Func.Config.Types
5336 // match: (FGreaterEqual cmp)
5337 // result: (ISEL [2] (MOVDconst [1]) (ISELB [1] (MOVDconst [1]) cmp) cmp)
5340 v.reset(OpPPC64ISEL)
5341 v.AuxInt = int32ToAuxInt(2)
5342 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
5343 v0.AuxInt = int64ToAuxInt(1)
5344 v1 := b.NewValue0(v.Pos, OpPPC64ISELB, typ.Int32)
5345 v1.AuxInt = int32ToAuxInt(1)
5347 v.AddArg3(v0, v1, cmp)
5351 func rewriteValuePPC64_OpPPC64FGreaterThan(v *Value) bool {
5354 typ := &b.Func.Config.Types
5355 // match: (FGreaterThan cmp)
5356 // result: (ISELB [1] (MOVDconst [1]) cmp)
5359 v.reset(OpPPC64ISELB)
5360 v.AuxInt = int32ToAuxInt(1)
5361 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
5362 v0.AuxInt = int64ToAuxInt(1)
5367 func rewriteValuePPC64_OpPPC64FLessEqual(v *Value) bool {
5370 typ := &b.Func.Config.Types
5371 // match: (FLessEqual cmp)
5372 // result: (ISEL [2] (MOVDconst [1]) (ISELB [0] (MOVDconst [1]) cmp) cmp)
5375 v.reset(OpPPC64ISEL)
5376 v.AuxInt = int32ToAuxInt(2)
5377 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
5378 v0.AuxInt = int64ToAuxInt(1)
5379 v1 := b.NewValue0(v.Pos, OpPPC64ISELB, typ.Int32)
5380 v1.AuxInt = int32ToAuxInt(0)
5382 v.AddArg3(v0, v1, cmp)
5386 func rewriteValuePPC64_OpPPC64FLessThan(v *Value) bool {
5389 typ := &b.Func.Config.Types
5390 // match: (FLessThan cmp)
5391 // result: (ISELB [0] (MOVDconst [1]) cmp)
5394 v.reset(OpPPC64ISELB)
5395 v.AuxInt = int32ToAuxInt(0)
5396 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
5397 v0.AuxInt = int64ToAuxInt(1)
5402 func rewriteValuePPC64_OpPPC64FMOVDload(v *Value) bool {
5405 // match: (FMOVDload [off] {sym} ptr (MOVDstore [off] {sym} ptr x _))
5406 // result: (MTVSRD x)
5408 off := auxIntToInt32(v.AuxInt)
5409 sym := auxToSym(v.Aux)
5411 if v_1.Op != OpPPC64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
5415 if ptr != v_1.Args[0] {
5418 v.reset(OpPPC64MTVSRD)
5422 // match: (FMOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
5423 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
5424 // result: (FMOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
5426 off1 := auxIntToInt32(v.AuxInt)
5427 sym1 := auxToSym(v.Aux)
5429 if p.Op != OpPPC64MOVDaddr {
5432 off2 := auxIntToInt32(p.AuxInt)
5433 sym2 := auxToSym(p.Aux)
5436 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
5439 v.reset(OpPPC64FMOVDload)
5440 v.AuxInt = int32ToAuxInt(off1 + off2)
5441 v.Aux = symToAux(mergeSym(sym1, sym2))
5445 // match: (FMOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
5446 // cond: is16Bit(int64(off1)+off2)
5447 // result: (FMOVDload [off1+int32(off2)] {sym} ptr mem)
5449 off1 := auxIntToInt32(v.AuxInt)
5450 sym := auxToSym(v.Aux)
5451 if v_0.Op != OpPPC64ADDconst {
5454 off2 := auxIntToInt64(v_0.AuxInt)
5457 if !(is16Bit(int64(off1) + off2)) {
5460 v.reset(OpPPC64FMOVDload)
5461 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
5462 v.Aux = symToAux(sym)
5468 func rewriteValuePPC64_OpPPC64FMOVDstore(v *Value) bool {
5472 // match: (FMOVDstore [off] {sym} ptr (MTVSRD x) mem)
5473 // result: (MOVDstore [off] {sym} ptr x mem)
5475 off := auxIntToInt32(v.AuxInt)
5476 sym := auxToSym(v.Aux)
5478 if v_1.Op != OpPPC64MTVSRD {
5483 v.reset(OpPPC64MOVDstore)
5484 v.AuxInt = int32ToAuxInt(off)
5485 v.Aux = symToAux(sym)
5486 v.AddArg3(ptr, x, mem)
5489 // match: (FMOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
5490 // cond: is16Bit(int64(off1)+off2)
5491 // result: (FMOVDstore [off1+int32(off2)] {sym} ptr val mem)
5493 off1 := auxIntToInt32(v.AuxInt)
5494 sym := auxToSym(v.Aux)
5495 if v_0.Op != OpPPC64ADDconst {
5498 off2 := auxIntToInt64(v_0.AuxInt)
5502 if !(is16Bit(int64(off1) + off2)) {
5505 v.reset(OpPPC64FMOVDstore)
5506 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
5507 v.Aux = symToAux(sym)
5508 v.AddArg3(ptr, val, mem)
5511 // match: (FMOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
5512 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
5513 // result: (FMOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
5515 off1 := auxIntToInt32(v.AuxInt)
5516 sym1 := auxToSym(v.Aux)
5518 if p.Op != OpPPC64MOVDaddr {
5521 off2 := auxIntToInt32(p.AuxInt)
5522 sym2 := auxToSym(p.Aux)
5526 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
5529 v.reset(OpPPC64FMOVDstore)
5530 v.AuxInt = int32ToAuxInt(off1 + off2)
5531 v.Aux = symToAux(mergeSym(sym1, sym2))
5532 v.AddArg3(ptr, val, mem)
5537 func rewriteValuePPC64_OpPPC64FMOVSload(v *Value) bool {
5540 // match: (FMOVSload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
5541 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
5542 // result: (FMOVSload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
5544 off1 := auxIntToInt32(v.AuxInt)
5545 sym1 := auxToSym(v.Aux)
5547 if p.Op != OpPPC64MOVDaddr {
5550 off2 := auxIntToInt32(p.AuxInt)
5551 sym2 := auxToSym(p.Aux)
5554 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
5557 v.reset(OpPPC64FMOVSload)
5558 v.AuxInt = int32ToAuxInt(off1 + off2)
5559 v.Aux = symToAux(mergeSym(sym1, sym2))
5563 // match: (FMOVSload [off1] {sym} (ADDconst [off2] ptr) mem)
5564 // cond: is16Bit(int64(off1)+off2)
5565 // result: (FMOVSload [off1+int32(off2)] {sym} ptr mem)
5567 off1 := auxIntToInt32(v.AuxInt)
5568 sym := auxToSym(v.Aux)
5569 if v_0.Op != OpPPC64ADDconst {
5572 off2 := auxIntToInt64(v_0.AuxInt)
5575 if !(is16Bit(int64(off1) + off2)) {
5578 v.reset(OpPPC64FMOVSload)
5579 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
5580 v.Aux = symToAux(sym)
5586 func rewriteValuePPC64_OpPPC64FMOVSstore(v *Value) bool {
5590 // match: (FMOVSstore [off1] {sym} (ADDconst [off2] ptr) val mem)
5591 // cond: is16Bit(int64(off1)+off2)
5592 // result: (FMOVSstore [off1+int32(off2)] {sym} ptr val mem)
5594 off1 := auxIntToInt32(v.AuxInt)
5595 sym := auxToSym(v.Aux)
5596 if v_0.Op != OpPPC64ADDconst {
5599 off2 := auxIntToInt64(v_0.AuxInt)
5603 if !(is16Bit(int64(off1) + off2)) {
5606 v.reset(OpPPC64FMOVSstore)
5607 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
5608 v.Aux = symToAux(sym)
5609 v.AddArg3(ptr, val, mem)
5612 // match: (FMOVSstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
5613 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
5614 // result: (FMOVSstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
5616 off1 := auxIntToInt32(v.AuxInt)
5617 sym1 := auxToSym(v.Aux)
5619 if p.Op != OpPPC64MOVDaddr {
5622 off2 := auxIntToInt32(p.AuxInt)
5623 sym2 := auxToSym(p.Aux)
5627 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
5630 v.reset(OpPPC64FMOVSstore)
5631 v.AuxInt = int32ToAuxInt(off1 + off2)
5632 v.Aux = symToAux(mergeSym(sym1, sym2))
5633 v.AddArg3(ptr, val, mem)
5638 func rewriteValuePPC64_OpPPC64FNEG(v *Value) bool {
5640 // match: (FNEG (FABS x))
5641 // result: (FNABS x)
5643 if v_0.Op != OpPPC64FABS {
5647 v.reset(OpPPC64FNABS)
5651 // match: (FNEG (FNABS x))
5654 if v_0.Op != OpPPC64FNABS {
5658 v.reset(OpPPC64FABS)
5664 func rewriteValuePPC64_OpPPC64FSQRT(v *Value) bool {
5666 // match: (FSQRT (FMOVDconst [x]))
5668 // result: (FMOVDconst [math.Sqrt(x)])
5670 if v_0.Op != OpPPC64FMOVDconst {
5673 x := auxIntToFloat64(v_0.AuxInt)
5677 v.reset(OpPPC64FMOVDconst)
5678 v.AuxInt = float64ToAuxInt(math.Sqrt(x))
5683 func rewriteValuePPC64_OpPPC64FSUB(v *Value) bool {
5686 // match: (FSUB (FMUL x y) z)
5687 // result: (FMSUB x y z)
5689 if v_0.Op != OpPPC64FMUL {
5695 v.reset(OpPPC64FMSUB)
5701 func rewriteValuePPC64_OpPPC64FSUBS(v *Value) bool {
5704 // match: (FSUBS (FMULS x y) z)
5705 // result: (FMSUBS x y z)
5707 if v_0.Op != OpPPC64FMULS {
5713 v.reset(OpPPC64FMSUBS)
5719 func rewriteValuePPC64_OpPPC64FTRUNC(v *Value) bool {
5721 // match: (FTRUNC (FMOVDconst [x]))
5722 // result: (FMOVDconst [math.Trunc(x)])
5724 if v_0.Op != OpPPC64FMOVDconst {
5727 x := auxIntToFloat64(v_0.AuxInt)
5728 v.reset(OpPPC64FMOVDconst)
5729 v.AuxInt = float64ToAuxInt(math.Trunc(x))
5734 func rewriteValuePPC64_OpPPC64GreaterEqual(v *Value) bool {
5737 typ := &b.Func.Config.Types
5738 // match: (GreaterEqual (FlagEQ))
5739 // result: (MOVDconst [1])
5741 if v_0.Op != OpPPC64FlagEQ {
5744 v.reset(OpPPC64MOVDconst)
5745 v.AuxInt = int64ToAuxInt(1)
5748 // match: (GreaterEqual (FlagLT))
5749 // result: (MOVDconst [0])
5751 if v_0.Op != OpPPC64FlagLT {
5754 v.reset(OpPPC64MOVDconst)
5755 v.AuxInt = int64ToAuxInt(0)
5758 // match: (GreaterEqual (FlagGT))
5759 // result: (MOVDconst [1])
5761 if v_0.Op != OpPPC64FlagGT {
5764 v.reset(OpPPC64MOVDconst)
5765 v.AuxInt = int64ToAuxInt(1)
5768 // match: (GreaterEqual (InvertFlags x))
5769 // result: (LessEqual x)
5771 if v_0.Op != OpPPC64InvertFlags {
5775 v.reset(OpPPC64LessEqual)
5779 // match: (GreaterEqual cmp)
5780 // result: (ISELB [4] (MOVDconst [1]) cmp)
5783 v.reset(OpPPC64ISELB)
5784 v.AuxInt = int32ToAuxInt(4)
5785 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
5786 v0.AuxInt = int64ToAuxInt(1)
5791 func rewriteValuePPC64_OpPPC64GreaterThan(v *Value) bool {
5794 typ := &b.Func.Config.Types
5795 // match: (GreaterThan (FlagEQ))
5796 // result: (MOVDconst [0])
5798 if v_0.Op != OpPPC64FlagEQ {
5801 v.reset(OpPPC64MOVDconst)
5802 v.AuxInt = int64ToAuxInt(0)
5805 // match: (GreaterThan (FlagLT))
5806 // result: (MOVDconst [0])
5808 if v_0.Op != OpPPC64FlagLT {
5811 v.reset(OpPPC64MOVDconst)
5812 v.AuxInt = int64ToAuxInt(0)
5815 // match: (GreaterThan (FlagGT))
5816 // result: (MOVDconst [1])
5818 if v_0.Op != OpPPC64FlagGT {
5821 v.reset(OpPPC64MOVDconst)
5822 v.AuxInt = int64ToAuxInt(1)
5825 // match: (GreaterThan (InvertFlags x))
5826 // result: (LessThan x)
5828 if v_0.Op != OpPPC64InvertFlags {
5832 v.reset(OpPPC64LessThan)
5836 // match: (GreaterThan cmp)
5837 // result: (ISELB [1] (MOVDconst [1]) cmp)
5840 v.reset(OpPPC64ISELB)
5841 v.AuxInt = int32ToAuxInt(1)
5842 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
5843 v0.AuxInt = int64ToAuxInt(1)
5848 func rewriteValuePPC64_OpPPC64ISEL(v *Value) bool {
5852 // match: (ISEL [0] (ANDconst [d] y) (MOVDconst [-1]) (CMPU (ANDconst [d] y) (MOVDconst [c])))
5854 // result: (ANDconst [d] y)
5856 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64ANDconst {
5859 d := auxIntToInt64(v_0.AuxInt)
5861 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 || v_2.Op != OpPPC64CMPU {
5865 v_2_0 := v_2.Args[0]
5866 if v_2_0.Op != OpPPC64ANDconst || auxIntToInt64(v_2_0.AuxInt) != d || y != v_2_0.Args[0] {
5869 v_2_1 := v_2.Args[1]
5870 if v_2_1.Op != OpPPC64MOVDconst {
5873 c := auxIntToInt64(v_2_1.AuxInt)
5877 v.reset(OpPPC64ANDconst)
5878 v.AuxInt = int64ToAuxInt(d)
5882 // match: (ISEL [0] (ANDconst [d] y) (MOVDconst [-1]) (CMPUconst [c] (ANDconst [d] y)))
5884 // result: (ANDconst [d] y)
5886 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64ANDconst {
5889 d := auxIntToInt64(v_0.AuxInt)
5891 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 || v_2.Op != OpPPC64CMPUconst {
5894 c := auxIntToInt64(v_2.AuxInt)
5895 v_2_0 := v_2.Args[0]
5896 if v_2_0.Op != OpPPC64ANDconst || auxIntToInt64(v_2_0.AuxInt) != d || y != v_2_0.Args[0] || !(c >= d) {
5899 v.reset(OpPPC64ANDconst)
5900 v.AuxInt = int64ToAuxInt(d)
5904 // match: (ISEL [2] x _ (FlagEQ))
5907 if auxIntToInt32(v.AuxInt) != 2 {
5911 if v_2.Op != OpPPC64FlagEQ {
5917 // match: (ISEL [2] _ y (FlagLT))
5920 if auxIntToInt32(v.AuxInt) != 2 {
5924 if v_2.Op != OpPPC64FlagLT {
5930 // match: (ISEL [2] _ y (FlagGT))
5933 if auxIntToInt32(v.AuxInt) != 2 {
5937 if v_2.Op != OpPPC64FlagGT {
5943 // match: (ISEL [6] _ y (FlagEQ))
5946 if auxIntToInt32(v.AuxInt) != 6 {
5950 if v_2.Op != OpPPC64FlagEQ {
5956 // match: (ISEL [6] x _ (FlagLT))
5959 if auxIntToInt32(v.AuxInt) != 6 {
5963 if v_2.Op != OpPPC64FlagLT {
5969 // match: (ISEL [6] x _ (FlagGT))
5972 if auxIntToInt32(v.AuxInt) != 6 {
5976 if v_2.Op != OpPPC64FlagGT {
5982 // match: (ISEL [0] _ y (FlagEQ))
5985 if auxIntToInt32(v.AuxInt) != 0 {
5989 if v_2.Op != OpPPC64FlagEQ {
5995 // match: (ISEL [0] _ y (FlagGT))
5998 if auxIntToInt32(v.AuxInt) != 0 {
6002 if v_2.Op != OpPPC64FlagGT {
6008 // match: (ISEL [0] x _ (FlagLT))
6011 if auxIntToInt32(v.AuxInt) != 0 {
6015 if v_2.Op != OpPPC64FlagLT {
6021 // match: (ISEL [5] _ x (FlagEQ))
6024 if auxIntToInt32(v.AuxInt) != 5 {
6028 if v_2.Op != OpPPC64FlagEQ {
6034 // match: (ISEL [5] _ x (FlagLT))
6037 if auxIntToInt32(v.AuxInt) != 5 {
6041 if v_2.Op != OpPPC64FlagLT {
6047 // match: (ISEL [5] y _ (FlagGT))
6050 if auxIntToInt32(v.AuxInt) != 5 {
6054 if v_2.Op != OpPPC64FlagGT {
6060 // match: (ISEL [1] _ y (FlagEQ))
6063 if auxIntToInt32(v.AuxInt) != 1 {
6067 if v_2.Op != OpPPC64FlagEQ {
6073 // match: (ISEL [1] _ y (FlagLT))
6076 if auxIntToInt32(v.AuxInt) != 1 {
6080 if v_2.Op != OpPPC64FlagLT {
6086 // match: (ISEL [1] x _ (FlagGT))
6089 if auxIntToInt32(v.AuxInt) != 1 {
6093 if v_2.Op != OpPPC64FlagGT {
6099 // match: (ISEL [4] x _ (FlagEQ))
6102 if auxIntToInt32(v.AuxInt) != 4 {
6106 if v_2.Op != OpPPC64FlagEQ {
6112 // match: (ISEL [4] x _ (FlagGT))
6115 if auxIntToInt32(v.AuxInt) != 4 {
6119 if v_2.Op != OpPPC64FlagGT {
6125 // match: (ISEL [4] _ y (FlagLT))
6128 if auxIntToInt32(v.AuxInt) != 4 {
6132 if v_2.Op != OpPPC64FlagLT {
6138 // match: (ISEL [n] x y (InvertFlags bool))
6140 // result: (ISEL [n+1] x y bool)
6142 n := auxIntToInt32(v.AuxInt)
6145 if v_2.Op != OpPPC64InvertFlags {
6152 v.reset(OpPPC64ISEL)
6153 v.AuxInt = int32ToAuxInt(n + 1)
6154 v.AddArg3(x, y, bool)
6157 // match: (ISEL [n] x y (InvertFlags bool))
6159 // result: (ISEL [n-1] x y bool)
6161 n := auxIntToInt32(v.AuxInt)
6164 if v_2.Op != OpPPC64InvertFlags {
6171 v.reset(OpPPC64ISEL)
6172 v.AuxInt = int32ToAuxInt(n - 1)
6173 v.AddArg3(x, y, bool)
6176 // match: (ISEL [n] x y (InvertFlags bool))
6178 // result: (ISEL [n] x y bool)
6180 n := auxIntToInt32(v.AuxInt)
6183 if v_2.Op != OpPPC64InvertFlags {
6190 v.reset(OpPPC64ISEL)
6191 v.AuxInt = int32ToAuxInt(n)
6192 v.AddArg3(x, y, bool)
6197 func rewriteValuePPC64_OpPPC64ISELB(v *Value) bool {
6201 typ := &b.Func.Config.Types
6202 // match: (ISELB [0] _ (FlagLT))
6203 // result: (MOVDconst [1])
6205 if auxIntToInt32(v.AuxInt) != 0 || v_1.Op != OpPPC64FlagLT {
6208 v.reset(OpPPC64MOVDconst)
6209 v.AuxInt = int64ToAuxInt(1)
6212 // match: (ISELB [0] _ (FlagGT))
6213 // result: (MOVDconst [0])
6215 if auxIntToInt32(v.AuxInt) != 0 || v_1.Op != OpPPC64FlagGT {
6218 v.reset(OpPPC64MOVDconst)
6219 v.AuxInt = int64ToAuxInt(0)
6222 // match: (ISELB [0] _ (FlagEQ))
6223 // result: (MOVDconst [0])
6225 if auxIntToInt32(v.AuxInt) != 0 || v_1.Op != OpPPC64FlagEQ {
6228 v.reset(OpPPC64MOVDconst)
6229 v.AuxInt = int64ToAuxInt(0)
6232 // match: (ISELB [1] _ (FlagGT))
6233 // result: (MOVDconst [1])
6235 if auxIntToInt32(v.AuxInt) != 1 || v_1.Op != OpPPC64FlagGT {
6238 v.reset(OpPPC64MOVDconst)
6239 v.AuxInt = int64ToAuxInt(1)
6242 // match: (ISELB [1] _ (FlagLT))
6243 // result: (MOVDconst [0])
6245 if auxIntToInt32(v.AuxInt) != 1 || v_1.Op != OpPPC64FlagLT {
6248 v.reset(OpPPC64MOVDconst)
6249 v.AuxInt = int64ToAuxInt(0)
6252 // match: (ISELB [1] _ (FlagEQ))
6253 // result: (MOVDconst [0])
6255 if auxIntToInt32(v.AuxInt) != 1 || v_1.Op != OpPPC64FlagEQ {
6258 v.reset(OpPPC64MOVDconst)
6259 v.AuxInt = int64ToAuxInt(0)
6262 // match: (ISELB [2] _ (FlagEQ))
6263 // result: (MOVDconst [1])
6265 if auxIntToInt32(v.AuxInt) != 2 || v_1.Op != OpPPC64FlagEQ {
6268 v.reset(OpPPC64MOVDconst)
6269 v.AuxInt = int64ToAuxInt(1)
6272 // match: (ISELB [2] _ (FlagLT))
6273 // result: (MOVDconst [0])
6275 if auxIntToInt32(v.AuxInt) != 2 || v_1.Op != OpPPC64FlagLT {
6278 v.reset(OpPPC64MOVDconst)
6279 v.AuxInt = int64ToAuxInt(0)
6282 // match: (ISELB [2] _ (FlagGT))
6283 // result: (MOVDconst [0])
6285 if auxIntToInt32(v.AuxInt) != 2 || v_1.Op != OpPPC64FlagGT {
6288 v.reset(OpPPC64MOVDconst)
6289 v.AuxInt = int64ToAuxInt(0)
6292 // match: (ISELB [4] _ (FlagLT))
6293 // result: (MOVDconst [0])
6295 if auxIntToInt32(v.AuxInt) != 4 || v_1.Op != OpPPC64FlagLT {
6298 v.reset(OpPPC64MOVDconst)
6299 v.AuxInt = int64ToAuxInt(0)
6302 // match: (ISELB [4] _ (FlagGT))
6303 // result: (MOVDconst [1])
6305 if auxIntToInt32(v.AuxInt) != 4 || v_1.Op != OpPPC64FlagGT {
6308 v.reset(OpPPC64MOVDconst)
6309 v.AuxInt = int64ToAuxInt(1)
6312 // match: (ISELB [4] _ (FlagEQ))
6313 // result: (MOVDconst [1])
6315 if auxIntToInt32(v.AuxInt) != 4 || v_1.Op != OpPPC64FlagEQ {
6318 v.reset(OpPPC64MOVDconst)
6319 v.AuxInt = int64ToAuxInt(1)
6322 // match: (ISELB [5] _ (FlagGT))
6323 // result: (MOVDconst [0])
6325 if auxIntToInt32(v.AuxInt) != 5 || v_1.Op != OpPPC64FlagGT {
6328 v.reset(OpPPC64MOVDconst)
6329 v.AuxInt = int64ToAuxInt(0)
6332 // match: (ISELB [5] _ (FlagLT))
6333 // result: (MOVDconst [1])
6335 if auxIntToInt32(v.AuxInt) != 5 || v_1.Op != OpPPC64FlagLT {
6338 v.reset(OpPPC64MOVDconst)
6339 v.AuxInt = int64ToAuxInt(1)
6342 // match: (ISELB [5] _ (FlagEQ))
6343 // result: (MOVDconst [1])
6345 if auxIntToInt32(v.AuxInt) != 5 || v_1.Op != OpPPC64FlagEQ {
6348 v.reset(OpPPC64MOVDconst)
6349 v.AuxInt = int64ToAuxInt(1)
6352 // match: (ISELB [6] _ (FlagEQ))
6353 // result: (MOVDconst [0])
6355 if auxIntToInt32(v.AuxInt) != 6 || v_1.Op != OpPPC64FlagEQ {
6358 v.reset(OpPPC64MOVDconst)
6359 v.AuxInt = int64ToAuxInt(0)
6362 // match: (ISELB [6] _ (FlagLT))
6363 // result: (MOVDconst [1])
6365 if auxIntToInt32(v.AuxInt) != 6 || v_1.Op != OpPPC64FlagLT {
6368 v.reset(OpPPC64MOVDconst)
6369 v.AuxInt = int64ToAuxInt(1)
6372 // match: (ISELB [6] _ (FlagGT))
6373 // result: (MOVDconst [1])
6375 if auxIntToInt32(v.AuxInt) != 6 || v_1.Op != OpPPC64FlagGT {
6378 v.reset(OpPPC64MOVDconst)
6379 v.AuxInt = int64ToAuxInt(1)
6382 // match: (ISELB [n] (MOVDconst [1]) (InvertFlags bool))
6384 // result: (ISELB [n+1] (MOVDconst [1]) bool)
6386 n := auxIntToInt32(v.AuxInt)
6387 if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 || v_1.Op != OpPPC64InvertFlags {
6394 v.reset(OpPPC64ISELB)
6395 v.AuxInt = int32ToAuxInt(n + 1)
6396 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
6397 v0.AuxInt = int64ToAuxInt(1)
6401 // match: (ISELB [n] (MOVDconst [1]) (InvertFlags bool))
6403 // result: (ISELB [n-1] (MOVDconst [1]) bool)
6405 n := auxIntToInt32(v.AuxInt)
6406 if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 || v_1.Op != OpPPC64InvertFlags {
6413 v.reset(OpPPC64ISELB)
6414 v.AuxInt = int32ToAuxInt(n - 1)
6415 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
6416 v0.AuxInt = int64ToAuxInt(1)
6420 // match: (ISELB [n] (MOVDconst [1]) (InvertFlags bool))
6422 // result: (ISELB [n] (MOVDconst [1]) bool)
6424 n := auxIntToInt32(v.AuxInt)
6425 if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 || v_1.Op != OpPPC64InvertFlags {
6432 v.reset(OpPPC64ISELB)
6433 v.AuxInt = int32ToAuxInt(n)
6434 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
6435 v0.AuxInt = int64ToAuxInt(1)
6441 func rewriteValuePPC64_OpPPC64LessEqual(v *Value) bool {
6444 typ := &b.Func.Config.Types
6445 // match: (LessEqual (FlagEQ))
6446 // result: (MOVDconst [1])
6448 if v_0.Op != OpPPC64FlagEQ {
6451 v.reset(OpPPC64MOVDconst)
6452 v.AuxInt = int64ToAuxInt(1)
6455 // match: (LessEqual (FlagLT))
6456 // result: (MOVDconst [1])
6458 if v_0.Op != OpPPC64FlagLT {
6461 v.reset(OpPPC64MOVDconst)
6462 v.AuxInt = int64ToAuxInt(1)
6465 // match: (LessEqual (FlagGT))
6466 // result: (MOVDconst [0])
6468 if v_0.Op != OpPPC64FlagGT {
6471 v.reset(OpPPC64MOVDconst)
6472 v.AuxInt = int64ToAuxInt(0)
6475 // match: (LessEqual (InvertFlags x))
6476 // result: (GreaterEqual x)
6478 if v_0.Op != OpPPC64InvertFlags {
6482 v.reset(OpPPC64GreaterEqual)
6486 // match: (LessEqual cmp)
6487 // result: (ISELB [5] (MOVDconst [1]) cmp)
6490 v.reset(OpPPC64ISELB)
6491 v.AuxInt = int32ToAuxInt(5)
6492 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
6493 v0.AuxInt = int64ToAuxInt(1)
6498 func rewriteValuePPC64_OpPPC64LessThan(v *Value) bool {
6501 typ := &b.Func.Config.Types
6502 // match: (LessThan (FlagEQ))
6503 // result: (MOVDconst [0])
6505 if v_0.Op != OpPPC64FlagEQ {
6508 v.reset(OpPPC64MOVDconst)
6509 v.AuxInt = int64ToAuxInt(0)
6512 // match: (LessThan (FlagLT))
6513 // result: (MOVDconst [1])
6515 if v_0.Op != OpPPC64FlagLT {
6518 v.reset(OpPPC64MOVDconst)
6519 v.AuxInt = int64ToAuxInt(1)
6522 // match: (LessThan (FlagGT))
6523 // result: (MOVDconst [0])
6525 if v_0.Op != OpPPC64FlagGT {
6528 v.reset(OpPPC64MOVDconst)
6529 v.AuxInt = int64ToAuxInt(0)
6532 // match: (LessThan (InvertFlags x))
6533 // result: (GreaterThan x)
6535 if v_0.Op != OpPPC64InvertFlags {
6539 v.reset(OpPPC64GreaterThan)
6543 // match: (LessThan cmp)
6544 // result: (ISELB [0] (MOVDconst [1]) cmp)
6547 v.reset(OpPPC64ISELB)
6548 v.AuxInt = int32ToAuxInt(0)
6549 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
6550 v0.AuxInt = int64ToAuxInt(1)
6555 func rewriteValuePPC64_OpPPC64MFVSRD(v *Value) bool {
6558 typ := &b.Func.Config.Types
6559 // match: (MFVSRD (FMOVDconst [c]))
6560 // result: (MOVDconst [int64(math.Float64bits(c))])
6562 if v_0.Op != OpPPC64FMOVDconst {
6565 c := auxIntToFloat64(v_0.AuxInt)
6566 v.reset(OpPPC64MOVDconst)
6567 v.AuxInt = int64ToAuxInt(int64(math.Float64bits(c)))
6570 // match: (MFVSRD x:(FMOVDload [off] {sym} ptr mem))
6571 // cond: x.Uses == 1 && clobber(x)
6572 // result: @x.Block (MOVDload [off] {sym} ptr mem)
6575 if x.Op != OpPPC64FMOVDload {
6578 off := auxIntToInt32(x.AuxInt)
6579 sym := auxToSym(x.Aux)
6582 if !(x.Uses == 1 && clobber(x)) {
6586 v0 := b.NewValue0(x.Pos, OpPPC64MOVDload, typ.Int64)
6588 v0.AuxInt = int32ToAuxInt(off)
6589 v0.Aux = symToAux(sym)
6590 v0.AddArg2(ptr, mem)
6595 func rewriteValuePPC64_OpPPC64MOVBZload(v *Value) bool {
6598 // match: (MOVBZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
6599 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
6600 // result: (MOVBZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
6602 off1 := auxIntToInt32(v.AuxInt)
6603 sym1 := auxToSym(v.Aux)
6605 if p.Op != OpPPC64MOVDaddr {
6608 off2 := auxIntToInt32(p.AuxInt)
6609 sym2 := auxToSym(p.Aux)
6612 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
6615 v.reset(OpPPC64MOVBZload)
6616 v.AuxInt = int32ToAuxInt(off1 + off2)
6617 v.Aux = symToAux(mergeSym(sym1, sym2))
6621 // match: (MOVBZload [off1] {sym} (ADDconst [off2] x) mem)
6622 // cond: is16Bit(int64(off1)+off2)
6623 // result: (MOVBZload [off1+int32(off2)] {sym} x mem)
6625 off1 := auxIntToInt32(v.AuxInt)
6626 sym := auxToSym(v.Aux)
6627 if v_0.Op != OpPPC64ADDconst {
6630 off2 := auxIntToInt64(v_0.AuxInt)
6633 if !(is16Bit(int64(off1) + off2)) {
6636 v.reset(OpPPC64MOVBZload)
6637 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
6638 v.Aux = symToAux(sym)
6642 // match: (MOVBZload [0] {sym} p:(ADD ptr idx) mem)
6643 // cond: sym == nil && p.Uses == 1
6644 // result: (MOVBZloadidx ptr idx mem)
6646 if auxIntToInt32(v.AuxInt) != 0 {
6649 sym := auxToSym(v.Aux)
6651 if p.Op != OpPPC64ADD {
6657 if !(sym == nil && p.Uses == 1) {
6660 v.reset(OpPPC64MOVBZloadidx)
6661 v.AddArg3(ptr, idx, mem)
6666 func rewriteValuePPC64_OpPPC64MOVBZloadidx(v *Value) bool {
6670 // match: (MOVBZloadidx ptr (MOVDconst [c]) mem)
6672 // result: (MOVBZload [int32(c)] ptr mem)
6675 if v_1.Op != OpPPC64MOVDconst {
6678 c := auxIntToInt64(v_1.AuxInt)
6683 v.reset(OpPPC64MOVBZload)
6684 v.AuxInt = int32ToAuxInt(int32(c))
6688 // match: (MOVBZloadidx (MOVDconst [c]) ptr mem)
6690 // result: (MOVBZload [int32(c)] ptr mem)
6692 if v_0.Op != OpPPC64MOVDconst {
6695 c := auxIntToInt64(v_0.AuxInt)
6701 v.reset(OpPPC64MOVBZload)
6702 v.AuxInt = int32ToAuxInt(int32(c))
6708 func rewriteValuePPC64_OpPPC64MOVBZreg(v *Value) bool {
6711 typ := &b.Func.Config.Types
6712 // match: (MOVBZreg y:(ANDconst [c] _))
6713 // cond: uint64(c) <= 0xFF
6717 if y.Op != OpPPC64ANDconst {
6720 c := auxIntToInt64(y.AuxInt)
6721 if !(uint64(c) <= 0xFF) {
6727 // match: (MOVBZreg (SRWconst [c] (MOVBZreg x)))
6728 // result: (SRWconst [c] (MOVBZreg x))
6730 if v_0.Op != OpPPC64SRWconst {
6733 c := auxIntToInt64(v_0.AuxInt)
6734 v_0_0 := v_0.Args[0]
6735 if v_0_0.Op != OpPPC64MOVBZreg {
6739 v.reset(OpPPC64SRWconst)
6740 v.AuxInt = int64ToAuxInt(c)
6741 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
6746 // match: (MOVBZreg (SRWconst [c] x))
6747 // cond: sizeof(x.Type) == 8
6748 // result: (SRWconst [c] x)
6750 if v_0.Op != OpPPC64SRWconst {
6753 c := auxIntToInt64(v_0.AuxInt)
6755 if !(sizeof(x.Type) == 8) {
6758 v.reset(OpPPC64SRWconst)
6759 v.AuxInt = int64ToAuxInt(c)
6763 // match: (MOVBZreg (SRDconst [c] x))
6765 // result: (SRDconst [c] x)
6767 if v_0.Op != OpPPC64SRDconst {
6770 c := auxIntToInt64(v_0.AuxInt)
6775 v.reset(OpPPC64SRDconst)
6776 v.AuxInt = int64ToAuxInt(c)
6780 // match: (MOVBZreg (SRWconst [c] x))
6782 // result: (SRWconst [c] x)
6784 if v_0.Op != OpPPC64SRWconst {
6787 c := auxIntToInt64(v_0.AuxInt)
6792 v.reset(OpPPC64SRWconst)
6793 v.AuxInt = int64ToAuxInt(c)
6797 // match: (MOVBZreg y:(MOVBZreg _))
6801 if y.Op != OpPPC64MOVBZreg {
6807 // match: (MOVBZreg (MOVBreg x))
6808 // result: (MOVBZreg x)
6810 if v_0.Op != OpPPC64MOVBreg {
6814 v.reset(OpPPC64MOVBZreg)
6818 // match: (MOVBZreg (OR <t> x (MOVWZreg y)))
6819 // result: (MOVBZreg (OR <t> x y))
6821 if v_0.Op != OpPPC64OR {
6826 v_0_0 := v_0.Args[0]
6827 v_0_1 := v_0.Args[1]
6828 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6830 if v_0_1.Op != OpPPC64MOVWZreg {
6834 v.reset(OpPPC64MOVBZreg)
6835 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
6842 // match: (MOVBZreg (XOR <t> x (MOVWZreg y)))
6843 // result: (MOVBZreg (XOR <t> x y))
6845 if v_0.Op != OpPPC64XOR {
6850 v_0_0 := v_0.Args[0]
6851 v_0_1 := v_0.Args[1]
6852 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6854 if v_0_1.Op != OpPPC64MOVWZreg {
6858 v.reset(OpPPC64MOVBZreg)
6859 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
6866 // match: (MOVBZreg (AND <t> x (MOVWZreg y)))
6867 // result: (MOVBZreg (AND <t> x y))
6869 if v_0.Op != OpPPC64AND {
6874 v_0_0 := v_0.Args[0]
6875 v_0_1 := v_0.Args[1]
6876 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6878 if v_0_1.Op != OpPPC64MOVWZreg {
6882 v.reset(OpPPC64MOVBZreg)
6883 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
6890 // match: (MOVBZreg (OR <t> x (MOVHZreg y)))
6891 // result: (MOVBZreg (OR <t> x y))
6893 if v_0.Op != OpPPC64OR {
6898 v_0_0 := v_0.Args[0]
6899 v_0_1 := v_0.Args[1]
6900 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6902 if v_0_1.Op != OpPPC64MOVHZreg {
6906 v.reset(OpPPC64MOVBZreg)
6907 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
6914 // match: (MOVBZreg (XOR <t> x (MOVHZreg y)))
6915 // result: (MOVBZreg (XOR <t> x y))
6917 if v_0.Op != OpPPC64XOR {
6922 v_0_0 := v_0.Args[0]
6923 v_0_1 := v_0.Args[1]
6924 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6926 if v_0_1.Op != OpPPC64MOVHZreg {
6930 v.reset(OpPPC64MOVBZreg)
6931 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
6938 // match: (MOVBZreg (AND <t> x (MOVHZreg y)))
6939 // result: (MOVBZreg (AND <t> x y))
6941 if v_0.Op != OpPPC64AND {
6946 v_0_0 := v_0.Args[0]
6947 v_0_1 := v_0.Args[1]
6948 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6950 if v_0_1.Op != OpPPC64MOVHZreg {
6954 v.reset(OpPPC64MOVBZreg)
6955 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
6962 // match: (MOVBZreg (OR <t> x (MOVBZreg y)))
6963 // result: (MOVBZreg (OR <t> x y))
6965 if v_0.Op != OpPPC64OR {
6970 v_0_0 := v_0.Args[0]
6971 v_0_1 := v_0.Args[1]
6972 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6974 if v_0_1.Op != OpPPC64MOVBZreg {
6978 v.reset(OpPPC64MOVBZreg)
6979 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
6986 // match: (MOVBZreg (XOR <t> x (MOVBZreg y)))
6987 // result: (MOVBZreg (XOR <t> x y))
6989 if v_0.Op != OpPPC64XOR {
6994 v_0_0 := v_0.Args[0]
6995 v_0_1 := v_0.Args[1]
6996 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6998 if v_0_1.Op != OpPPC64MOVBZreg {
7002 v.reset(OpPPC64MOVBZreg)
7003 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
7010 // match: (MOVBZreg (AND <t> x (MOVBZreg y)))
7011 // result: (MOVBZreg (AND <t> x y))
7013 if v_0.Op != OpPPC64AND {
7018 v_0_0 := v_0.Args[0]
7019 v_0_1 := v_0.Args[1]
7020 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7022 if v_0_1.Op != OpPPC64MOVBZreg {
7026 v.reset(OpPPC64MOVBZreg)
7027 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
7034 // match: (MOVBZreg z:(ANDconst [c] (MOVBZload ptr x)))
7038 if z.Op != OpPPC64ANDconst {
7042 if z_0.Op != OpPPC64MOVBZload {
7048 // match: (MOVBZreg z:(AND y (MOVBZload ptr x)))
7052 if z.Op != OpPPC64AND {
7058 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
7059 if z_1.Op != OpPPC64MOVBZload {
7067 // match: (MOVBZreg x:(MOVBZload _ _))
7071 if x.Op != OpPPC64MOVBZload {
7077 // match: (MOVBZreg x:(MOVBZloadidx _ _ _))
7081 if x.Op != OpPPC64MOVBZloadidx {
7087 // match: (MOVBZreg x:(Arg <t>))
7088 // cond: is8BitInt(t) && !isSigned(t)
7096 if !(is8BitInt(t) && !isSigned(t)) {
7102 // match: (MOVBZreg (MOVDconst [c]))
7103 // result: (MOVDconst [int64(uint8(c))])
7105 if v_0.Op != OpPPC64MOVDconst {
7108 c := auxIntToInt64(v_0.AuxInt)
7109 v.reset(OpPPC64MOVDconst)
7110 v.AuxInt = int64ToAuxInt(int64(uint8(c)))
7115 func rewriteValuePPC64_OpPPC64MOVBreg(v *Value) bool {
7118 typ := &b.Func.Config.Types
7119 // match: (MOVBreg y:(ANDconst [c] _))
7120 // cond: uint64(c) <= 0x7F
7124 if y.Op != OpPPC64ANDconst {
7127 c := auxIntToInt64(y.AuxInt)
7128 if !(uint64(c) <= 0x7F) {
7134 // match: (MOVBreg (SRAWconst [c] (MOVBreg x)))
7135 // result: (SRAWconst [c] (MOVBreg x))
7137 if v_0.Op != OpPPC64SRAWconst {
7140 c := auxIntToInt64(v_0.AuxInt)
7141 v_0_0 := v_0.Args[0]
7142 if v_0_0.Op != OpPPC64MOVBreg {
7146 v.reset(OpPPC64SRAWconst)
7147 v.AuxInt = int64ToAuxInt(c)
7148 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
7153 // match: (MOVBreg (SRAWconst [c] x))
7154 // cond: sizeof(x.Type) == 8
7155 // result: (SRAWconst [c] x)
7157 if v_0.Op != OpPPC64SRAWconst {
7160 c := auxIntToInt64(v_0.AuxInt)
7162 if !(sizeof(x.Type) == 8) {
7165 v.reset(OpPPC64SRAWconst)
7166 v.AuxInt = int64ToAuxInt(c)
7170 // match: (MOVBreg (SRDconst [c] x))
7172 // result: (SRDconst [c] x)
7174 if v_0.Op != OpPPC64SRDconst {
7177 c := auxIntToInt64(v_0.AuxInt)
7182 v.reset(OpPPC64SRDconst)
7183 v.AuxInt = int64ToAuxInt(c)
7187 // match: (MOVBreg (SRDconst [c] x))
7189 // result: (SRADconst [c] x)
7191 if v_0.Op != OpPPC64SRDconst {
7194 c := auxIntToInt64(v_0.AuxInt)
7199 v.reset(OpPPC64SRADconst)
7200 v.AuxInt = int64ToAuxInt(c)
7204 // match: (MOVBreg (SRADconst [c] x))
7206 // result: (SRADconst [c] x)
7208 if v_0.Op != OpPPC64SRADconst {
7211 c := auxIntToInt64(v_0.AuxInt)
7216 v.reset(OpPPC64SRADconst)
7217 v.AuxInt = int64ToAuxInt(c)
7221 // match: (MOVBreg (SRWconst [c] x))
7223 // result: (SRWconst [c] x)
7225 if v_0.Op != OpPPC64SRWconst {
7228 c := auxIntToInt64(v_0.AuxInt)
7233 v.reset(OpPPC64SRWconst)
7234 v.AuxInt = int64ToAuxInt(c)
7238 // match: (MOVBreg (SRWconst [c] x))
7240 // result: (SRAWconst [c] x)
7242 if v_0.Op != OpPPC64SRWconst {
7245 c := auxIntToInt64(v_0.AuxInt)
7250 v.reset(OpPPC64SRAWconst)
7251 v.AuxInt = int64ToAuxInt(c)
7255 // match: (MOVBreg (SRAWconst [c] x))
7257 // result: (SRAWconst [c] x)
7259 if v_0.Op != OpPPC64SRAWconst {
7262 c := auxIntToInt64(v_0.AuxInt)
7267 v.reset(OpPPC64SRAWconst)
7268 v.AuxInt = int64ToAuxInt(c)
7272 // match: (MOVBreg y:(MOVBreg _))
7276 if y.Op != OpPPC64MOVBreg {
7282 // match: (MOVBreg (MOVBZreg x))
7283 // result: (MOVBreg x)
7285 if v_0.Op != OpPPC64MOVBZreg {
7289 v.reset(OpPPC64MOVBreg)
7293 // match: (MOVBreg x:(Arg <t>))
7294 // cond: is8BitInt(t) && isSigned(t)
7302 if !(is8BitInt(t) && isSigned(t)) {
7308 // match: (MOVBreg (MOVDconst [c]))
7309 // result: (MOVDconst [int64(int8(c))])
7311 if v_0.Op != OpPPC64MOVDconst {
7314 c := auxIntToInt64(v_0.AuxInt)
7315 v.reset(OpPPC64MOVDconst)
7316 v.AuxInt = int64ToAuxInt(int64(int8(c)))
7321 func rewriteValuePPC64_OpPPC64MOVBstore(v *Value) bool {
7326 config := b.Func.Config
7327 typ := &b.Func.Config.Types
7328 // match: (MOVBstore [off1] {sym} (ADDconst [off2] x) val mem)
7329 // cond: is16Bit(int64(off1)+off2)
7330 // result: (MOVBstore [off1+int32(off2)] {sym} x val mem)
7332 off1 := auxIntToInt32(v.AuxInt)
7333 sym := auxToSym(v.Aux)
7334 if v_0.Op != OpPPC64ADDconst {
7337 off2 := auxIntToInt64(v_0.AuxInt)
7341 if !(is16Bit(int64(off1) + off2)) {
7344 v.reset(OpPPC64MOVBstore)
7345 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
7346 v.Aux = symToAux(sym)
7347 v.AddArg3(x, val, mem)
7350 // match: (MOVBstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
7351 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
7352 // result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
7354 off1 := auxIntToInt32(v.AuxInt)
7355 sym1 := auxToSym(v.Aux)
7357 if p.Op != OpPPC64MOVDaddr {
7360 off2 := auxIntToInt32(p.AuxInt)
7361 sym2 := auxToSym(p.Aux)
7365 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
7368 v.reset(OpPPC64MOVBstore)
7369 v.AuxInt = int32ToAuxInt(off1 + off2)
7370 v.Aux = symToAux(mergeSym(sym1, sym2))
7371 v.AddArg3(ptr, val, mem)
7374 // match: (MOVBstore [off] {sym} ptr (MOVDconst [0]) mem)
7375 // result: (MOVBstorezero [off] {sym} ptr mem)
7377 off := auxIntToInt32(v.AuxInt)
7378 sym := auxToSym(v.Aux)
7380 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
7384 v.reset(OpPPC64MOVBstorezero)
7385 v.AuxInt = int32ToAuxInt(off)
7386 v.Aux = symToAux(sym)
7390 // match: (MOVBstore [0] {sym} p:(ADD ptr idx) val mem)
7391 // cond: sym == nil && p.Uses == 1
7392 // result: (MOVBstoreidx ptr idx val mem)
7394 if auxIntToInt32(v.AuxInt) != 0 {
7397 sym := auxToSym(v.Aux)
7399 if p.Op != OpPPC64ADD {
7406 if !(sym == nil && p.Uses == 1) {
7409 v.reset(OpPPC64MOVBstoreidx)
7410 v.AddArg4(ptr, idx, val, mem)
7413 // match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
7414 // result: (MOVBstore [off] {sym} ptr x mem)
7416 off := auxIntToInt32(v.AuxInt)
7417 sym := auxToSym(v.Aux)
7419 if v_1.Op != OpPPC64MOVBreg {
7424 v.reset(OpPPC64MOVBstore)
7425 v.AuxInt = int32ToAuxInt(off)
7426 v.Aux = symToAux(sym)
7427 v.AddArg3(ptr, x, mem)
7430 // match: (MOVBstore [off] {sym} ptr (MOVBZreg x) mem)
7431 // result: (MOVBstore [off] {sym} ptr x mem)
7433 off := auxIntToInt32(v.AuxInt)
7434 sym := auxToSym(v.Aux)
7436 if v_1.Op != OpPPC64MOVBZreg {
7441 v.reset(OpPPC64MOVBstore)
7442 v.AuxInt = int32ToAuxInt(off)
7443 v.Aux = symToAux(sym)
7444 v.AddArg3(ptr, x, mem)
7447 // match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
7448 // result: (MOVBstore [off] {sym} ptr x mem)
7450 off := auxIntToInt32(v.AuxInt)
7451 sym := auxToSym(v.Aux)
7453 if v_1.Op != OpPPC64MOVHreg {
7458 v.reset(OpPPC64MOVBstore)
7459 v.AuxInt = int32ToAuxInt(off)
7460 v.Aux = symToAux(sym)
7461 v.AddArg3(ptr, x, mem)
7464 // match: (MOVBstore [off] {sym} ptr (MOVHZreg x) mem)
7465 // result: (MOVBstore [off] {sym} ptr x mem)
7467 off := auxIntToInt32(v.AuxInt)
7468 sym := auxToSym(v.Aux)
7470 if v_1.Op != OpPPC64MOVHZreg {
7475 v.reset(OpPPC64MOVBstore)
7476 v.AuxInt = int32ToAuxInt(off)
7477 v.Aux = symToAux(sym)
7478 v.AddArg3(ptr, x, mem)
7481 // match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
7482 // result: (MOVBstore [off] {sym} ptr x mem)
7484 off := auxIntToInt32(v.AuxInt)
7485 sym := auxToSym(v.Aux)
7487 if v_1.Op != OpPPC64MOVWreg {
7492 v.reset(OpPPC64MOVBstore)
7493 v.AuxInt = int32ToAuxInt(off)
7494 v.Aux = symToAux(sym)
7495 v.AddArg3(ptr, x, mem)
7498 // match: (MOVBstore [off] {sym} ptr (MOVWZreg x) mem)
7499 // result: (MOVBstore [off] {sym} ptr x mem)
7501 off := auxIntToInt32(v.AuxInt)
7502 sym := auxToSym(v.Aux)
7504 if v_1.Op != OpPPC64MOVWZreg {
7509 v.reset(OpPPC64MOVBstore)
7510 v.AuxInt = int32ToAuxInt(off)
7511 v.Aux = symToAux(sym)
7512 v.AddArg3(ptr, x, mem)
7515 // match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHreg x) [c]) mem)
7517 // result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
7519 off := auxIntToInt32(v.AuxInt)
7520 sym := auxToSym(v.Aux)
7522 if v_1.Op != OpPPC64SRWconst {
7525 c := auxIntToInt64(v_1.AuxInt)
7526 v_1_0 := v_1.Args[0]
7527 if v_1_0.Op != OpPPC64MOVHreg {
7535 v.reset(OpPPC64MOVBstore)
7536 v.AuxInt = int32ToAuxInt(off)
7537 v.Aux = symToAux(sym)
7538 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7539 v0.AuxInt = int64ToAuxInt(c)
7541 v.AddArg3(ptr, v0, mem)
7544 // match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHZreg x) [c]) mem)
7546 // result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
7548 off := auxIntToInt32(v.AuxInt)
7549 sym := auxToSym(v.Aux)
7551 if v_1.Op != OpPPC64SRWconst {
7554 c := auxIntToInt64(v_1.AuxInt)
7555 v_1_0 := v_1.Args[0]
7556 if v_1_0.Op != OpPPC64MOVHZreg {
7564 v.reset(OpPPC64MOVBstore)
7565 v.AuxInt = int32ToAuxInt(off)
7566 v.Aux = symToAux(sym)
7567 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7568 v0.AuxInt = int64ToAuxInt(c)
7570 v.AddArg3(ptr, v0, mem)
7573 // match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWreg x) [c]) mem)
7575 // result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
7577 off := auxIntToInt32(v.AuxInt)
7578 sym := auxToSym(v.Aux)
7580 if v_1.Op != OpPPC64SRWconst {
7583 c := auxIntToInt64(v_1.AuxInt)
7584 v_1_0 := v_1.Args[0]
7585 if v_1_0.Op != OpPPC64MOVWreg {
7593 v.reset(OpPPC64MOVBstore)
7594 v.AuxInt = int32ToAuxInt(off)
7595 v.Aux = symToAux(sym)
7596 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7597 v0.AuxInt = int64ToAuxInt(c)
7599 v.AddArg3(ptr, v0, mem)
7602 // match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWZreg x) [c]) mem)
7604 // result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
7606 off := auxIntToInt32(v.AuxInt)
7607 sym := auxToSym(v.Aux)
7609 if v_1.Op != OpPPC64SRWconst {
7612 c := auxIntToInt64(v_1.AuxInt)
7613 v_1_0 := v_1.Args[0]
7614 if v_1_0.Op != OpPPC64MOVWZreg {
7622 v.reset(OpPPC64MOVBstore)
7623 v.AuxInt = int32ToAuxInt(off)
7624 v.Aux = symToAux(sym)
7625 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7626 v0.AuxInt = int64ToAuxInt(c)
7628 v.AddArg3(ptr, v0, mem)
7631 // match: (MOVBstore [i1] {s} p (SRWconst w [24]) x0:(MOVBstore [i0] {s} p (SRWconst w [16]) mem))
7632 // cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)
7633 // result: (MOVHstore [i0] {s} p (SRWconst <typ.UInt16> w [16]) mem)
7635 i1 := auxIntToInt32(v.AuxInt)
7636 s := auxToSym(v.Aux)
7638 if v_1.Op != OpPPC64SRWconst || auxIntToInt64(v_1.AuxInt) != 24 {
7643 if x0.Op != OpPPC64MOVBstore {
7646 i0 := auxIntToInt32(x0.AuxInt)
7647 if auxToSym(x0.Aux) != s {
7651 if p != x0.Args[0] {
7655 if x0_1.Op != OpPPC64SRWconst || auxIntToInt64(x0_1.AuxInt) != 16 || w != x0_1.Args[0] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)) {
7658 v.reset(OpPPC64MOVHstore)
7659 v.AuxInt = int32ToAuxInt(i0)
7661 v0 := b.NewValue0(x0.Pos, OpPPC64SRWconst, typ.UInt16)
7662 v0.AuxInt = int64ToAuxInt(16)
7664 v.AddArg3(p, v0, mem)
7667 // match: (MOVBstore [i1] {s} p (SRDconst w [24]) x0:(MOVBstore [i0] {s} p (SRDconst w [16]) mem))
7668 // cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)
7669 // result: (MOVHstore [i0] {s} p (SRWconst <typ.UInt16> w [16]) mem)
7671 i1 := auxIntToInt32(v.AuxInt)
7672 s := auxToSym(v.Aux)
7674 if v_1.Op != OpPPC64SRDconst || auxIntToInt64(v_1.AuxInt) != 24 {
7679 if x0.Op != OpPPC64MOVBstore {
7682 i0 := auxIntToInt32(x0.AuxInt)
7683 if auxToSym(x0.Aux) != s {
7687 if p != x0.Args[0] {
7691 if x0_1.Op != OpPPC64SRDconst || auxIntToInt64(x0_1.AuxInt) != 16 || w != x0_1.Args[0] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)) {
7694 v.reset(OpPPC64MOVHstore)
7695 v.AuxInt = int32ToAuxInt(i0)
7697 v0 := b.NewValue0(x0.Pos, OpPPC64SRWconst, typ.UInt16)
7698 v0.AuxInt = int64ToAuxInt(16)
7700 v.AddArg3(p, v0, mem)
7703 // match: (MOVBstore [i1] {s} p (SRWconst w [8]) x0:(MOVBstore [i0] {s} p w mem))
7704 // cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)
7705 // result: (MOVHstore [i0] {s} p w mem)
7707 i1 := auxIntToInt32(v.AuxInt)
7708 s := auxToSym(v.Aux)
7710 if v_1.Op != OpPPC64SRWconst || auxIntToInt64(v_1.AuxInt) != 8 {
7715 if x0.Op != OpPPC64MOVBstore {
7718 i0 := auxIntToInt32(x0.AuxInt)
7719 if auxToSym(x0.Aux) != s {
7723 if p != x0.Args[0] || w != x0.Args[1] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)) {
7726 v.reset(OpPPC64MOVHstore)
7727 v.AuxInt = int32ToAuxInt(i0)
7729 v.AddArg3(p, w, mem)
7732 // match: (MOVBstore [i1] {s} p (SRDconst w [8]) x0:(MOVBstore [i0] {s} p w mem))
7733 // cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)
7734 // result: (MOVHstore [i0] {s} p w mem)
7736 i1 := auxIntToInt32(v.AuxInt)
7737 s := auxToSym(v.Aux)
7739 if v_1.Op != OpPPC64SRDconst || auxIntToInt64(v_1.AuxInt) != 8 {
7744 if x0.Op != OpPPC64MOVBstore {
7747 i0 := auxIntToInt32(x0.AuxInt)
7748 if auxToSym(x0.Aux) != s {
7752 if p != x0.Args[0] || w != x0.Args[1] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)) {
7755 v.reset(OpPPC64MOVHstore)
7756 v.AuxInt = int32ToAuxInt(i0)
7758 v.AddArg3(p, w, mem)
7761 // match: (MOVBstore [i3] {s} p w x0:(MOVBstore [i2] {s} p (SRWconst w [8]) x1:(MOVBstore [i1] {s} p (SRWconst w [16]) x2:(MOVBstore [i0] {s} p (SRWconst w [24]) mem))))
7762 // cond: !config.BigEndian && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && clobber(x0, x1, x2)
7763 // result: (MOVWBRstore (MOVDaddr <typ.Uintptr> [i0] {s} p) w mem)
7765 i3 := auxIntToInt32(v.AuxInt)
7766 s := auxToSym(v.Aux)
7770 if x0.Op != OpPPC64MOVBstore {
7773 i2 := auxIntToInt32(x0.AuxInt)
7774 if auxToSym(x0.Aux) != s {
7778 if p != x0.Args[0] {
7782 if x0_1.Op != OpPPC64SRWconst || auxIntToInt64(x0_1.AuxInt) != 8 || w != x0_1.Args[0] {
7786 if x1.Op != OpPPC64MOVBstore {
7789 i1 := auxIntToInt32(x1.AuxInt)
7790 if auxToSym(x1.Aux) != s {
7794 if p != x1.Args[0] {
7798 if x1_1.Op != OpPPC64SRWconst || auxIntToInt64(x1_1.AuxInt) != 16 || w != x1_1.Args[0] {
7802 if x2.Op != OpPPC64MOVBstore {
7805 i0 := auxIntToInt32(x2.AuxInt)
7806 if auxToSym(x2.Aux) != s {
7810 if p != x2.Args[0] {
7814 if x2_1.Op != OpPPC64SRWconst || auxIntToInt64(x2_1.AuxInt) != 24 || w != x2_1.Args[0] || !(!config.BigEndian && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && clobber(x0, x1, x2)) {
7817 v.reset(OpPPC64MOVWBRstore)
7818 v0 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr)
7819 v0.AuxInt = int32ToAuxInt(i0)
7820 v0.Aux = symToAux(s)
7822 v.AddArg3(v0, w, mem)
7825 // match: (MOVBstore [i1] {s} p w x0:(MOVBstore [i0] {s} p (SRWconst w [8]) mem))
7826 // cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)
7827 // result: (MOVHBRstore (MOVDaddr <typ.Uintptr> [i0] {s} p) w mem)
7829 i1 := auxIntToInt32(v.AuxInt)
7830 s := auxToSym(v.Aux)
7834 if x0.Op != OpPPC64MOVBstore {
7837 i0 := auxIntToInt32(x0.AuxInt)
7838 if auxToSym(x0.Aux) != s {
7842 if p != x0.Args[0] {
7846 if x0_1.Op != OpPPC64SRWconst || auxIntToInt64(x0_1.AuxInt) != 8 || w != x0_1.Args[0] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)) {
7849 v.reset(OpPPC64MOVHBRstore)
7850 v0 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr)
7851 v0.AuxInt = int32ToAuxInt(i0)
7852 v0.Aux = symToAux(s)
7854 v.AddArg3(v0, w, mem)
7857 // match: (MOVBstore [i7] {s} p (SRDconst w [56]) x0:(MOVBstore [i6] {s} p (SRDconst w [48]) x1:(MOVBstore [i5] {s} p (SRDconst w [40]) x2:(MOVBstore [i4] {s} p (SRDconst w [32]) x3:(MOVWstore [i0] {s} p w mem)))))
7858 // cond: !config.BigEndian && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && clobber(x0, x1, x2, x3)
7859 // result: (MOVDstore [i0] {s} p w mem)
7861 i7 := auxIntToInt32(v.AuxInt)
7862 s := auxToSym(v.Aux)
7864 if v_1.Op != OpPPC64SRDconst || auxIntToInt64(v_1.AuxInt) != 56 {
7869 if x0.Op != OpPPC64MOVBstore {
7872 i6 := auxIntToInt32(x0.AuxInt)
7873 if auxToSym(x0.Aux) != s {
7877 if p != x0.Args[0] {
7881 if x0_1.Op != OpPPC64SRDconst || auxIntToInt64(x0_1.AuxInt) != 48 || w != x0_1.Args[0] {
7885 if x1.Op != OpPPC64MOVBstore {
7888 i5 := auxIntToInt32(x1.AuxInt)
7889 if auxToSym(x1.Aux) != s {
7893 if p != x1.Args[0] {
7897 if x1_1.Op != OpPPC64SRDconst || auxIntToInt64(x1_1.AuxInt) != 40 || w != x1_1.Args[0] {
7901 if x2.Op != OpPPC64MOVBstore {
7904 i4 := auxIntToInt32(x2.AuxInt)
7905 if auxToSym(x2.Aux) != s {
7909 if p != x2.Args[0] {
7913 if x2_1.Op != OpPPC64SRDconst || auxIntToInt64(x2_1.AuxInt) != 32 || w != x2_1.Args[0] {
7917 if x3.Op != OpPPC64MOVWstore {
7920 i0 := auxIntToInt32(x3.AuxInt)
7921 if auxToSym(x3.Aux) != s {
7925 if p != x3.Args[0] || w != x3.Args[1] || !(!config.BigEndian && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && clobber(x0, x1, x2, x3)) {
7928 v.reset(OpPPC64MOVDstore)
7929 v.AuxInt = int32ToAuxInt(i0)
7931 v.AddArg3(p, w, mem)
7934 // match: (MOVBstore [i7] {s} p w x0:(MOVBstore [i6] {s} p (SRDconst w [8]) x1:(MOVBstore [i5] {s} p (SRDconst w [16]) x2:(MOVBstore [i4] {s} p (SRDconst w [24]) x3:(MOVBstore [i3] {s} p (SRDconst w [32]) x4:(MOVBstore [i2] {s} p (SRDconst w [40]) x5:(MOVBstore [i1] {s} p (SRDconst w [48]) x6:(MOVBstore [i0] {s} p (SRDconst w [56]) mem))))))))
7935 // cond: !config.BigEndian && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && clobber(x0, x1, x2, x3, x4, x5, x6)
7936 // result: (MOVDBRstore (MOVDaddr <typ.Uintptr> [i0] {s} p) w mem)
7938 i7 := auxIntToInt32(v.AuxInt)
7939 s := auxToSym(v.Aux)
7943 if x0.Op != OpPPC64MOVBstore {
7946 i6 := auxIntToInt32(x0.AuxInt)
7947 if auxToSym(x0.Aux) != s {
7951 if p != x0.Args[0] {
7955 if x0_1.Op != OpPPC64SRDconst || auxIntToInt64(x0_1.AuxInt) != 8 || w != x0_1.Args[0] {
7959 if x1.Op != OpPPC64MOVBstore {
7962 i5 := auxIntToInt32(x1.AuxInt)
7963 if auxToSym(x1.Aux) != s {
7967 if p != x1.Args[0] {
7971 if x1_1.Op != OpPPC64SRDconst || auxIntToInt64(x1_1.AuxInt) != 16 || w != x1_1.Args[0] {
7975 if x2.Op != OpPPC64MOVBstore {
7978 i4 := auxIntToInt32(x2.AuxInt)
7979 if auxToSym(x2.Aux) != s {
7983 if p != x2.Args[0] {
7987 if x2_1.Op != OpPPC64SRDconst || auxIntToInt64(x2_1.AuxInt) != 24 || w != x2_1.Args[0] {
7991 if x3.Op != OpPPC64MOVBstore {
7994 i3 := auxIntToInt32(x3.AuxInt)
7995 if auxToSym(x3.Aux) != s {
7999 if p != x3.Args[0] {
8003 if x3_1.Op != OpPPC64SRDconst || auxIntToInt64(x3_1.AuxInt) != 32 || w != x3_1.Args[0] {
8007 if x4.Op != OpPPC64MOVBstore {
8010 i2 := auxIntToInt32(x4.AuxInt)
8011 if auxToSym(x4.Aux) != s {
8015 if p != x4.Args[0] {
8019 if x4_1.Op != OpPPC64SRDconst || auxIntToInt64(x4_1.AuxInt) != 40 || w != x4_1.Args[0] {
8023 if x5.Op != OpPPC64MOVBstore {
8026 i1 := auxIntToInt32(x5.AuxInt)
8027 if auxToSym(x5.Aux) != s {
8031 if p != x5.Args[0] {
8035 if x5_1.Op != OpPPC64SRDconst || auxIntToInt64(x5_1.AuxInt) != 48 || w != x5_1.Args[0] {
8039 if x6.Op != OpPPC64MOVBstore {
8042 i0 := auxIntToInt32(x6.AuxInt)
8043 if auxToSym(x6.Aux) != s {
8047 if p != x6.Args[0] {
8051 if x6_1.Op != OpPPC64SRDconst || auxIntToInt64(x6_1.AuxInt) != 56 || w != x6_1.Args[0] || !(!config.BigEndian && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && clobber(x0, x1, x2, x3, x4, x5, x6)) {
8054 v.reset(OpPPC64MOVDBRstore)
8055 v0 := b.NewValue0(x6.Pos, OpPPC64MOVDaddr, typ.Uintptr)
8056 v0.AuxInt = int32ToAuxInt(i0)
8057 v0.Aux = symToAux(s)
8059 v.AddArg3(v0, w, mem)
8064 func rewriteValuePPC64_OpPPC64MOVBstoreidx(v *Value) bool {
8070 typ := &b.Func.Config.Types
8071 // match: (MOVBstoreidx ptr (MOVDconst [c]) val mem)
8073 // result: (MOVBstore [int32(c)] ptr val mem)
8076 if v_1.Op != OpPPC64MOVDconst {
8079 c := auxIntToInt64(v_1.AuxInt)
8085 v.reset(OpPPC64MOVBstore)
8086 v.AuxInt = int32ToAuxInt(int32(c))
8087 v.AddArg3(ptr, val, mem)
8090 // match: (MOVBstoreidx (MOVDconst [c]) ptr val mem)
8092 // result: (MOVBstore [int32(c)] ptr val mem)
8094 if v_0.Op != OpPPC64MOVDconst {
8097 c := auxIntToInt64(v_0.AuxInt)
8104 v.reset(OpPPC64MOVBstore)
8105 v.AuxInt = int32ToAuxInt(int32(c))
8106 v.AddArg3(ptr, val, mem)
8109 // match: (MOVBstoreidx ptr idx (MOVBreg x) mem)
8110 // result: (MOVBstoreidx ptr idx x mem)
8114 if v_2.Op != OpPPC64MOVBreg {
8119 v.reset(OpPPC64MOVBstoreidx)
8120 v.AddArg4(ptr, idx, x, mem)
8123 // match: (MOVBstoreidx ptr idx (MOVBZreg x) mem)
8124 // result: (MOVBstoreidx ptr idx x mem)
8128 if v_2.Op != OpPPC64MOVBZreg {
8133 v.reset(OpPPC64MOVBstoreidx)
8134 v.AddArg4(ptr, idx, x, mem)
8137 // match: (MOVBstoreidx ptr idx (MOVHreg x) mem)
8138 // result: (MOVBstoreidx ptr idx x mem)
8142 if v_2.Op != OpPPC64MOVHreg {
8147 v.reset(OpPPC64MOVBstoreidx)
8148 v.AddArg4(ptr, idx, x, mem)
8151 // match: (MOVBstoreidx ptr idx (MOVHZreg x) mem)
8152 // result: (MOVBstoreidx ptr idx x mem)
8156 if v_2.Op != OpPPC64MOVHZreg {
8161 v.reset(OpPPC64MOVBstoreidx)
8162 v.AddArg4(ptr, idx, x, mem)
8165 // match: (MOVBstoreidx ptr idx (MOVWreg x) mem)
8166 // result: (MOVBstoreidx ptr idx x mem)
8170 if v_2.Op != OpPPC64MOVWreg {
8175 v.reset(OpPPC64MOVBstoreidx)
8176 v.AddArg4(ptr, idx, x, mem)
8179 // match: (MOVBstoreidx ptr idx (MOVWZreg x) mem)
8180 // result: (MOVBstoreidx ptr idx x mem)
8184 if v_2.Op != OpPPC64MOVWZreg {
8189 v.reset(OpPPC64MOVBstoreidx)
8190 v.AddArg4(ptr, idx, x, mem)
8193 // match: (MOVBstoreidx ptr idx (SRWconst (MOVHreg x) [c]) mem)
8195 // result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
8199 if v_2.Op != OpPPC64SRWconst {
8202 c := auxIntToInt64(v_2.AuxInt)
8203 v_2_0 := v_2.Args[0]
8204 if v_2_0.Op != OpPPC64MOVHreg {
8212 v.reset(OpPPC64MOVBstoreidx)
8213 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8214 v0.AuxInt = int64ToAuxInt(c)
8216 v.AddArg4(ptr, idx, v0, mem)
8219 // match: (MOVBstoreidx ptr idx (SRWconst (MOVHZreg x) [c]) mem)
8221 // result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
8225 if v_2.Op != OpPPC64SRWconst {
8228 c := auxIntToInt64(v_2.AuxInt)
8229 v_2_0 := v_2.Args[0]
8230 if v_2_0.Op != OpPPC64MOVHZreg {
8238 v.reset(OpPPC64MOVBstoreidx)
8239 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8240 v0.AuxInt = int64ToAuxInt(c)
8242 v.AddArg4(ptr, idx, v0, mem)
8245 // match: (MOVBstoreidx ptr idx (SRWconst (MOVWreg x) [c]) mem)
8247 // result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
8251 if v_2.Op != OpPPC64SRWconst {
8254 c := auxIntToInt64(v_2.AuxInt)
8255 v_2_0 := v_2.Args[0]
8256 if v_2_0.Op != OpPPC64MOVWreg {
8264 v.reset(OpPPC64MOVBstoreidx)
8265 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8266 v0.AuxInt = int64ToAuxInt(c)
8268 v.AddArg4(ptr, idx, v0, mem)
8271 // match: (MOVBstoreidx ptr idx (SRWconst (MOVWZreg x) [c]) mem)
8273 // result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
8277 if v_2.Op != OpPPC64SRWconst {
8280 c := auxIntToInt64(v_2.AuxInt)
8281 v_2_0 := v_2.Args[0]
8282 if v_2_0.Op != OpPPC64MOVWZreg {
8290 v.reset(OpPPC64MOVBstoreidx)
8291 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8292 v0.AuxInt = int64ToAuxInt(c)
8294 v.AddArg4(ptr, idx, v0, mem)
8299 func rewriteValuePPC64_OpPPC64MOVBstorezero(v *Value) bool {
8302 // match: (MOVBstorezero [off1] {sym} (ADDconst [off2] x) mem)
8303 // cond: is16Bit(int64(off1)+off2)
8304 // result: (MOVBstorezero [off1+int32(off2)] {sym} x mem)
8306 off1 := auxIntToInt32(v.AuxInt)
8307 sym := auxToSym(v.Aux)
8308 if v_0.Op != OpPPC64ADDconst {
8311 off2 := auxIntToInt64(v_0.AuxInt)
8314 if !(is16Bit(int64(off1) + off2)) {
8317 v.reset(OpPPC64MOVBstorezero)
8318 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8319 v.Aux = symToAux(sym)
8323 // match: (MOVBstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
8324 // cond: canMergeSym(sym1,sym2) && (x.Op != OpSB || p.Uses == 1)
8325 // result: (MOVBstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
8327 off1 := auxIntToInt32(v.AuxInt)
8328 sym1 := auxToSym(v.Aux)
8330 if p.Op != OpPPC64MOVDaddr {
8333 off2 := auxIntToInt32(p.AuxInt)
8334 sym2 := auxToSym(p.Aux)
8337 if !(canMergeSym(sym1, sym2) && (x.Op != OpSB || p.Uses == 1)) {
8340 v.reset(OpPPC64MOVBstorezero)
8341 v.AuxInt = int32ToAuxInt(off1 + off2)
8342 v.Aux = symToAux(mergeSym(sym1, sym2))
8348 func rewriteValuePPC64_OpPPC64MOVDload(v *Value) bool {
8351 // match: (MOVDload [off] {sym} ptr (FMOVDstore [off] {sym} ptr x _))
8352 // result: (MFVSRD x)
8354 off := auxIntToInt32(v.AuxInt)
8355 sym := auxToSym(v.Aux)
8357 if v_1.Op != OpPPC64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
8361 if ptr != v_1.Args[0] {
8364 v.reset(OpPPC64MFVSRD)
8368 // match: (MOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
8369 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
8370 // result: (MOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
8372 off1 := auxIntToInt32(v.AuxInt)
8373 sym1 := auxToSym(v.Aux)
8375 if p.Op != OpPPC64MOVDaddr {
8378 off2 := auxIntToInt32(p.AuxInt)
8379 sym2 := auxToSym(p.Aux)
8382 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
8385 v.reset(OpPPC64MOVDload)
8386 v.AuxInt = int32ToAuxInt(off1 + off2)
8387 v.Aux = symToAux(mergeSym(sym1, sym2))
8391 // match: (MOVDload [off1] {sym} (ADDconst [off2] x) mem)
8392 // cond: is16Bit(int64(off1)+off2)
8393 // result: (MOVDload [off1+int32(off2)] {sym} x mem)
8395 off1 := auxIntToInt32(v.AuxInt)
8396 sym := auxToSym(v.Aux)
8397 if v_0.Op != OpPPC64ADDconst {
8400 off2 := auxIntToInt64(v_0.AuxInt)
8403 if !(is16Bit(int64(off1) + off2)) {
8406 v.reset(OpPPC64MOVDload)
8407 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8408 v.Aux = symToAux(sym)
8412 // match: (MOVDload [0] {sym} p:(ADD ptr idx) mem)
8413 // cond: sym == nil && p.Uses == 1
8414 // result: (MOVDloadidx ptr idx mem)
8416 if auxIntToInt32(v.AuxInt) != 0 {
8419 sym := auxToSym(v.Aux)
8421 if p.Op != OpPPC64ADD {
8427 if !(sym == nil && p.Uses == 1) {
8430 v.reset(OpPPC64MOVDloadidx)
8431 v.AddArg3(ptr, idx, mem)
8436 func rewriteValuePPC64_OpPPC64MOVDloadidx(v *Value) bool {
8440 // match: (MOVDloadidx ptr (MOVDconst [c]) mem)
8441 // cond: is16Bit(c) && c%4 == 0
8442 // result: (MOVDload [int32(c)] ptr mem)
8445 if v_1.Op != OpPPC64MOVDconst {
8448 c := auxIntToInt64(v_1.AuxInt)
8450 if !(is16Bit(c) && c%4 == 0) {
8453 v.reset(OpPPC64MOVDload)
8454 v.AuxInt = int32ToAuxInt(int32(c))
8458 // match: (MOVDloadidx (MOVDconst [c]) ptr mem)
8459 // cond: is16Bit(c) && c%4 == 0
8460 // result: (MOVDload [int32(c)] ptr mem)
8462 if v_0.Op != OpPPC64MOVDconst {
8465 c := auxIntToInt64(v_0.AuxInt)
8468 if !(is16Bit(c) && c%4 == 0) {
8471 v.reset(OpPPC64MOVDload)
8472 v.AuxInt = int32ToAuxInt(int32(c))
8478 func rewriteValuePPC64_OpPPC64MOVDstore(v *Value) bool {
8482 // match: (MOVDstore [off] {sym} ptr (MFVSRD x) mem)
8483 // result: (FMOVDstore [off] {sym} ptr x mem)
8485 off := auxIntToInt32(v.AuxInt)
8486 sym := auxToSym(v.Aux)
8488 if v_1.Op != OpPPC64MFVSRD {
8493 v.reset(OpPPC64FMOVDstore)
8494 v.AuxInt = int32ToAuxInt(off)
8495 v.Aux = symToAux(sym)
8496 v.AddArg3(ptr, x, mem)
8499 // match: (MOVDstore [off1] {sym} (ADDconst [off2] x) val mem)
8500 // cond: is16Bit(int64(off1)+off2)
8501 // result: (MOVDstore [off1+int32(off2)] {sym} x val mem)
8503 off1 := auxIntToInt32(v.AuxInt)
8504 sym := auxToSym(v.Aux)
8505 if v_0.Op != OpPPC64ADDconst {
8508 off2 := auxIntToInt64(v_0.AuxInt)
8512 if !(is16Bit(int64(off1) + off2)) {
8515 v.reset(OpPPC64MOVDstore)
8516 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8517 v.Aux = symToAux(sym)
8518 v.AddArg3(x, val, mem)
8521 // match: (MOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
8522 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
8523 // result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
8525 off1 := auxIntToInt32(v.AuxInt)
8526 sym1 := auxToSym(v.Aux)
8528 if p.Op != OpPPC64MOVDaddr {
8531 off2 := auxIntToInt32(p.AuxInt)
8532 sym2 := auxToSym(p.Aux)
8536 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
8539 v.reset(OpPPC64MOVDstore)
8540 v.AuxInt = int32ToAuxInt(off1 + off2)
8541 v.Aux = symToAux(mergeSym(sym1, sym2))
8542 v.AddArg3(ptr, val, mem)
8545 // match: (MOVDstore [off] {sym} ptr (MOVDconst [0]) mem)
8546 // result: (MOVDstorezero [off] {sym} ptr mem)
8548 off := auxIntToInt32(v.AuxInt)
8549 sym := auxToSym(v.Aux)
8551 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
8555 v.reset(OpPPC64MOVDstorezero)
8556 v.AuxInt = int32ToAuxInt(off)
8557 v.Aux = symToAux(sym)
8561 // match: (MOVDstore [0] {sym} p:(ADD ptr idx) val mem)
8562 // cond: sym == nil && p.Uses == 1
8563 // result: (MOVDstoreidx ptr idx val mem)
8565 if auxIntToInt32(v.AuxInt) != 0 {
8568 sym := auxToSym(v.Aux)
8570 if p.Op != OpPPC64ADD {
8577 if !(sym == nil && p.Uses == 1) {
8580 v.reset(OpPPC64MOVDstoreidx)
8581 v.AddArg4(ptr, idx, val, mem)
8586 func rewriteValuePPC64_OpPPC64MOVDstoreidx(v *Value) bool {
8591 // match: (MOVDstoreidx ptr (MOVDconst [c]) val mem)
8592 // cond: is16Bit(c) && c%4 == 0
8593 // result: (MOVDstore [int32(c)] ptr val mem)
8596 if v_1.Op != OpPPC64MOVDconst {
8599 c := auxIntToInt64(v_1.AuxInt)
8602 if !(is16Bit(c) && c%4 == 0) {
8605 v.reset(OpPPC64MOVDstore)
8606 v.AuxInt = int32ToAuxInt(int32(c))
8607 v.AddArg3(ptr, val, mem)
8610 // match: (MOVDstoreidx (MOVDconst [c]) ptr val mem)
8611 // cond: is16Bit(c) && c%4 == 0
8612 // result: (MOVDstore [int32(c)] ptr val mem)
8614 if v_0.Op != OpPPC64MOVDconst {
8617 c := auxIntToInt64(v_0.AuxInt)
8621 if !(is16Bit(c) && c%4 == 0) {
8624 v.reset(OpPPC64MOVDstore)
8625 v.AuxInt = int32ToAuxInt(int32(c))
8626 v.AddArg3(ptr, val, mem)
8631 func rewriteValuePPC64_OpPPC64MOVDstorezero(v *Value) bool {
8634 // match: (MOVDstorezero [off1] {sym} (ADDconst [off2] x) mem)
8635 // cond: is16Bit(int64(off1)+off2)
8636 // result: (MOVDstorezero [off1+int32(off2)] {sym} x mem)
8638 off1 := auxIntToInt32(v.AuxInt)
8639 sym := auxToSym(v.Aux)
8640 if v_0.Op != OpPPC64ADDconst {
8643 off2 := auxIntToInt64(v_0.AuxInt)
8646 if !(is16Bit(int64(off1) + off2)) {
8649 v.reset(OpPPC64MOVDstorezero)
8650 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8651 v.Aux = symToAux(sym)
8655 // match: (MOVDstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
8656 // cond: canMergeSym(sym1,sym2) && (x.Op != OpSB || p.Uses == 1)
8657 // result: (MOVDstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
8659 off1 := auxIntToInt32(v.AuxInt)
8660 sym1 := auxToSym(v.Aux)
8662 if p.Op != OpPPC64MOVDaddr {
8665 off2 := auxIntToInt32(p.AuxInt)
8666 sym2 := auxToSym(p.Aux)
8669 if !(canMergeSym(sym1, sym2) && (x.Op != OpSB || p.Uses == 1)) {
8672 v.reset(OpPPC64MOVDstorezero)
8673 v.AuxInt = int32ToAuxInt(off1 + off2)
8674 v.Aux = symToAux(mergeSym(sym1, sym2))
8680 func rewriteValuePPC64_OpPPC64MOVHBRstore(v *Value) bool {
8684 // match: (MOVHBRstore {sym} ptr (MOVHreg x) mem)
8685 // result: (MOVHBRstore {sym} ptr x mem)
8687 sym := auxToSym(v.Aux)
8689 if v_1.Op != OpPPC64MOVHreg {
8694 v.reset(OpPPC64MOVHBRstore)
8695 v.Aux = symToAux(sym)
8696 v.AddArg3(ptr, x, mem)
8699 // match: (MOVHBRstore {sym} ptr (MOVHZreg x) mem)
8700 // result: (MOVHBRstore {sym} ptr x mem)
8702 sym := auxToSym(v.Aux)
8704 if v_1.Op != OpPPC64MOVHZreg {
8709 v.reset(OpPPC64MOVHBRstore)
8710 v.Aux = symToAux(sym)
8711 v.AddArg3(ptr, x, mem)
8714 // match: (MOVHBRstore {sym} ptr (MOVWreg x) mem)
8715 // result: (MOVHBRstore {sym} ptr x mem)
8717 sym := auxToSym(v.Aux)
8719 if v_1.Op != OpPPC64MOVWreg {
8724 v.reset(OpPPC64MOVHBRstore)
8725 v.Aux = symToAux(sym)
8726 v.AddArg3(ptr, x, mem)
8729 // match: (MOVHBRstore {sym} ptr (MOVWZreg x) mem)
8730 // result: (MOVHBRstore {sym} ptr x mem)
8732 sym := auxToSym(v.Aux)
8734 if v_1.Op != OpPPC64MOVWZreg {
8739 v.reset(OpPPC64MOVHBRstore)
8740 v.Aux = symToAux(sym)
8741 v.AddArg3(ptr, x, mem)
8746 func rewriteValuePPC64_OpPPC64MOVHZload(v *Value) bool {
8749 // match: (MOVHZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
8750 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
8751 // result: (MOVHZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
8753 off1 := auxIntToInt32(v.AuxInt)
8754 sym1 := auxToSym(v.Aux)
8756 if p.Op != OpPPC64MOVDaddr {
8759 off2 := auxIntToInt32(p.AuxInt)
8760 sym2 := auxToSym(p.Aux)
8763 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
8766 v.reset(OpPPC64MOVHZload)
8767 v.AuxInt = int32ToAuxInt(off1 + off2)
8768 v.Aux = symToAux(mergeSym(sym1, sym2))
8772 // match: (MOVHZload [off1] {sym} (ADDconst [off2] x) mem)
8773 // cond: is16Bit(int64(off1)+off2)
8774 // result: (MOVHZload [off1+int32(off2)] {sym} x mem)
8776 off1 := auxIntToInt32(v.AuxInt)
8777 sym := auxToSym(v.Aux)
8778 if v_0.Op != OpPPC64ADDconst {
8781 off2 := auxIntToInt64(v_0.AuxInt)
8784 if !(is16Bit(int64(off1) + off2)) {
8787 v.reset(OpPPC64MOVHZload)
8788 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8789 v.Aux = symToAux(sym)
8793 // match: (MOVHZload [0] {sym} p:(ADD ptr idx) mem)
8794 // cond: sym == nil && p.Uses == 1
8795 // result: (MOVHZloadidx ptr idx mem)
8797 if auxIntToInt32(v.AuxInt) != 0 {
8800 sym := auxToSym(v.Aux)
8802 if p.Op != OpPPC64ADD {
8808 if !(sym == nil && p.Uses == 1) {
8811 v.reset(OpPPC64MOVHZloadidx)
8812 v.AddArg3(ptr, idx, mem)
8817 func rewriteValuePPC64_OpPPC64MOVHZloadidx(v *Value) bool {
8821 // match: (MOVHZloadidx ptr (MOVDconst [c]) mem)
8823 // result: (MOVHZload [int32(c)] ptr mem)
8826 if v_1.Op != OpPPC64MOVDconst {
8829 c := auxIntToInt64(v_1.AuxInt)
8834 v.reset(OpPPC64MOVHZload)
8835 v.AuxInt = int32ToAuxInt(int32(c))
8839 // match: (MOVHZloadidx (MOVDconst [c]) ptr mem)
8841 // result: (MOVHZload [int32(c)] ptr mem)
8843 if v_0.Op != OpPPC64MOVDconst {
8846 c := auxIntToInt64(v_0.AuxInt)
8852 v.reset(OpPPC64MOVHZload)
8853 v.AuxInt = int32ToAuxInt(int32(c))
8859 func rewriteValuePPC64_OpPPC64MOVHZreg(v *Value) bool {
8862 typ := &b.Func.Config.Types
8863 // match: (MOVHZreg y:(ANDconst [c] _))
8864 // cond: uint64(c) <= 0xFFFF
8868 if y.Op != OpPPC64ANDconst {
8871 c := auxIntToInt64(y.AuxInt)
8872 if !(uint64(c) <= 0xFFFF) {
8878 // match: (MOVHZreg (SRWconst [c] (MOVBZreg x)))
8879 // result: (SRWconst [c] (MOVBZreg x))
8881 if v_0.Op != OpPPC64SRWconst {
8884 c := auxIntToInt64(v_0.AuxInt)
8885 v_0_0 := v_0.Args[0]
8886 if v_0_0.Op != OpPPC64MOVBZreg {
8890 v.reset(OpPPC64SRWconst)
8891 v.AuxInt = int64ToAuxInt(c)
8892 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
8897 // match: (MOVHZreg (SRWconst [c] (MOVHZreg x)))
8898 // result: (SRWconst [c] (MOVHZreg x))
8900 if v_0.Op != OpPPC64SRWconst {
8903 c := auxIntToInt64(v_0.AuxInt)
8904 v_0_0 := v_0.Args[0]
8905 if v_0_0.Op != OpPPC64MOVHZreg {
8909 v.reset(OpPPC64SRWconst)
8910 v.AuxInt = int64ToAuxInt(c)
8911 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
8916 // match: (MOVHZreg (SRWconst [c] x))
8917 // cond: sizeof(x.Type) <= 16
8918 // result: (SRWconst [c] x)
8920 if v_0.Op != OpPPC64SRWconst {
8923 c := auxIntToInt64(v_0.AuxInt)
8925 if !(sizeof(x.Type) <= 16) {
8928 v.reset(OpPPC64SRWconst)
8929 v.AuxInt = int64ToAuxInt(c)
8933 // match: (MOVHZreg (SRDconst [c] x))
8935 // result: (SRDconst [c] x)
8937 if v_0.Op != OpPPC64SRDconst {
8940 c := auxIntToInt64(v_0.AuxInt)
8945 v.reset(OpPPC64SRDconst)
8946 v.AuxInt = int64ToAuxInt(c)
8950 // match: (MOVHZreg (SRWconst [c] x))
8952 // result: (SRWconst [c] x)
8954 if v_0.Op != OpPPC64SRWconst {
8957 c := auxIntToInt64(v_0.AuxInt)
8962 v.reset(OpPPC64SRWconst)
8963 v.AuxInt = int64ToAuxInt(c)
8967 // match: (MOVHZreg y:(MOVHZreg _))
8971 if y.Op != OpPPC64MOVHZreg {
8977 // match: (MOVHZreg y:(MOVBZreg _))
8981 if y.Op != OpPPC64MOVBZreg {
8987 // match: (MOVHZreg y:(MOVHBRload _ _))
8991 if y.Op != OpPPC64MOVHBRload {
8997 // match: (MOVHZreg y:(MOVHreg x))
8998 // result: (MOVHZreg x)
9001 if y.Op != OpPPC64MOVHreg {
9005 v.reset(OpPPC64MOVHZreg)
9009 // match: (MOVHZreg (OR <t> x (MOVWZreg y)))
9010 // result: (MOVHZreg (OR <t> x y))
9012 if v_0.Op != OpPPC64OR {
9017 v_0_0 := v_0.Args[0]
9018 v_0_1 := v_0.Args[1]
9019 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9021 if v_0_1.Op != OpPPC64MOVWZreg {
9025 v.reset(OpPPC64MOVHZreg)
9026 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
9033 // match: (MOVHZreg (XOR <t> x (MOVWZreg y)))
9034 // result: (MOVHZreg (XOR <t> x y))
9036 if v_0.Op != OpPPC64XOR {
9041 v_0_0 := v_0.Args[0]
9042 v_0_1 := v_0.Args[1]
9043 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9045 if v_0_1.Op != OpPPC64MOVWZreg {
9049 v.reset(OpPPC64MOVHZreg)
9050 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
9057 // match: (MOVHZreg (AND <t> x (MOVWZreg y)))
9058 // result: (MOVHZreg (AND <t> x y))
9060 if v_0.Op != OpPPC64AND {
9065 v_0_0 := v_0.Args[0]
9066 v_0_1 := v_0.Args[1]
9067 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9069 if v_0_1.Op != OpPPC64MOVWZreg {
9073 v.reset(OpPPC64MOVHZreg)
9074 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
9081 // match: (MOVHZreg (OR <t> x (MOVHZreg y)))
9082 // result: (MOVHZreg (OR <t> x y))
9084 if v_0.Op != OpPPC64OR {
9089 v_0_0 := v_0.Args[0]
9090 v_0_1 := v_0.Args[1]
9091 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9093 if v_0_1.Op != OpPPC64MOVHZreg {
9097 v.reset(OpPPC64MOVHZreg)
9098 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
9105 // match: (MOVHZreg (XOR <t> x (MOVHZreg y)))
9106 // result: (MOVHZreg (XOR <t> x y))
9108 if v_0.Op != OpPPC64XOR {
9113 v_0_0 := v_0.Args[0]
9114 v_0_1 := v_0.Args[1]
9115 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9117 if v_0_1.Op != OpPPC64MOVHZreg {
9121 v.reset(OpPPC64MOVHZreg)
9122 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
9129 // match: (MOVHZreg (AND <t> x (MOVHZreg y)))
9130 // result: (MOVHZreg (AND <t> x y))
9132 if v_0.Op != OpPPC64AND {
9137 v_0_0 := v_0.Args[0]
9138 v_0_1 := v_0.Args[1]
9139 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9141 if v_0_1.Op != OpPPC64MOVHZreg {
9145 v.reset(OpPPC64MOVHZreg)
9146 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
9153 // match: (MOVHZreg z:(ANDconst [c] (MOVBZload ptr x)))
9157 if z.Op != OpPPC64ANDconst {
9161 if z_0.Op != OpPPC64MOVBZload {
9167 // match: (MOVHZreg z:(ANDconst [c] (MOVHZload ptr x)))
9171 if z.Op != OpPPC64ANDconst {
9175 if z_0.Op != OpPPC64MOVHZload {
9181 // match: (MOVHZreg z:(AND y (MOVHZload ptr x)))
9185 if z.Op != OpPPC64AND {
9191 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
9192 if z_1.Op != OpPPC64MOVHZload {
9200 // match: (MOVHZreg x:(MOVBZload _ _))
9204 if x.Op != OpPPC64MOVBZload {
9210 // match: (MOVHZreg x:(MOVBZloadidx _ _ _))
9214 if x.Op != OpPPC64MOVBZloadidx {
9220 // match: (MOVHZreg x:(MOVHZload _ _))
9224 if x.Op != OpPPC64MOVHZload {
9230 // match: (MOVHZreg x:(MOVHZloadidx _ _ _))
9234 if x.Op != OpPPC64MOVHZloadidx {
9240 // match: (MOVHZreg x:(Arg <t>))
9241 // cond: (is8BitInt(t) || is16BitInt(t)) && !isSigned(t)
9249 if !((is8BitInt(t) || is16BitInt(t)) && !isSigned(t)) {
9255 // match: (MOVHZreg (MOVDconst [c]))
9256 // result: (MOVDconst [int64(uint16(c))])
9258 if v_0.Op != OpPPC64MOVDconst {
9261 c := auxIntToInt64(v_0.AuxInt)
9262 v.reset(OpPPC64MOVDconst)
9263 v.AuxInt = int64ToAuxInt(int64(uint16(c)))
9268 func rewriteValuePPC64_OpPPC64MOVHload(v *Value) bool {
9271 // match: (MOVHload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
9272 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
9273 // result: (MOVHload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
9275 off1 := auxIntToInt32(v.AuxInt)
9276 sym1 := auxToSym(v.Aux)
9278 if p.Op != OpPPC64MOVDaddr {
9281 off2 := auxIntToInt32(p.AuxInt)
9282 sym2 := auxToSym(p.Aux)
9285 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
9288 v.reset(OpPPC64MOVHload)
9289 v.AuxInt = int32ToAuxInt(off1 + off2)
9290 v.Aux = symToAux(mergeSym(sym1, sym2))
9294 // match: (MOVHload [off1] {sym} (ADDconst [off2] x) mem)
9295 // cond: is16Bit(int64(off1)+off2)
9296 // result: (MOVHload [off1+int32(off2)] {sym} x mem)
9298 off1 := auxIntToInt32(v.AuxInt)
9299 sym := auxToSym(v.Aux)
9300 if v_0.Op != OpPPC64ADDconst {
9303 off2 := auxIntToInt64(v_0.AuxInt)
9306 if !(is16Bit(int64(off1) + off2)) {
9309 v.reset(OpPPC64MOVHload)
9310 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9311 v.Aux = symToAux(sym)
9315 // match: (MOVHload [0] {sym} p:(ADD ptr idx) mem)
9316 // cond: sym == nil && p.Uses == 1
9317 // result: (MOVHloadidx ptr idx mem)
9319 if auxIntToInt32(v.AuxInt) != 0 {
9322 sym := auxToSym(v.Aux)
9324 if p.Op != OpPPC64ADD {
9330 if !(sym == nil && p.Uses == 1) {
9333 v.reset(OpPPC64MOVHloadidx)
9334 v.AddArg3(ptr, idx, mem)
9339 func rewriteValuePPC64_OpPPC64MOVHloadidx(v *Value) bool {
9343 // match: (MOVHloadidx ptr (MOVDconst [c]) mem)
9345 // result: (MOVHload [int32(c)] ptr mem)
9348 if v_1.Op != OpPPC64MOVDconst {
9351 c := auxIntToInt64(v_1.AuxInt)
9356 v.reset(OpPPC64MOVHload)
9357 v.AuxInt = int32ToAuxInt(int32(c))
9361 // match: (MOVHloadidx (MOVDconst [c]) ptr mem)
9363 // result: (MOVHload [int32(c)] ptr mem)
9365 if v_0.Op != OpPPC64MOVDconst {
9368 c := auxIntToInt64(v_0.AuxInt)
9374 v.reset(OpPPC64MOVHload)
9375 v.AuxInt = int32ToAuxInt(int32(c))
9381 func rewriteValuePPC64_OpPPC64MOVHreg(v *Value) bool {
9384 typ := &b.Func.Config.Types
9385 // match: (MOVHreg y:(ANDconst [c] _))
9386 // cond: uint64(c) <= 0x7FFF
9390 if y.Op != OpPPC64ANDconst {
9393 c := auxIntToInt64(y.AuxInt)
9394 if !(uint64(c) <= 0x7FFF) {
9400 // match: (MOVHreg (SRAWconst [c] (MOVBreg x)))
9401 // result: (SRAWconst [c] (MOVBreg x))
9403 if v_0.Op != OpPPC64SRAWconst {
9406 c := auxIntToInt64(v_0.AuxInt)
9407 v_0_0 := v_0.Args[0]
9408 if v_0_0.Op != OpPPC64MOVBreg {
9412 v.reset(OpPPC64SRAWconst)
9413 v.AuxInt = int64ToAuxInt(c)
9414 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
9419 // match: (MOVHreg (SRAWconst [c] (MOVHreg x)))
9420 // result: (SRAWconst [c] (MOVHreg x))
9422 if v_0.Op != OpPPC64SRAWconst {
9425 c := auxIntToInt64(v_0.AuxInt)
9426 v_0_0 := v_0.Args[0]
9427 if v_0_0.Op != OpPPC64MOVHreg {
9431 v.reset(OpPPC64SRAWconst)
9432 v.AuxInt = int64ToAuxInt(c)
9433 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
9438 // match: (MOVHreg (SRAWconst [c] x))
9439 // cond: sizeof(x.Type) <= 16
9440 // result: (SRAWconst [c] x)
9442 if v_0.Op != OpPPC64SRAWconst {
9445 c := auxIntToInt64(v_0.AuxInt)
9447 if !(sizeof(x.Type) <= 16) {
9450 v.reset(OpPPC64SRAWconst)
9451 v.AuxInt = int64ToAuxInt(c)
9455 // match: (MOVHreg (SRDconst [c] x))
9457 // result: (SRDconst [c] x)
9459 if v_0.Op != OpPPC64SRDconst {
9462 c := auxIntToInt64(v_0.AuxInt)
9467 v.reset(OpPPC64SRDconst)
9468 v.AuxInt = int64ToAuxInt(c)
9472 // match: (MOVHreg (SRDconst [c] x))
9474 // result: (SRADconst [c] x)
9476 if v_0.Op != OpPPC64SRDconst {
9479 c := auxIntToInt64(v_0.AuxInt)
9484 v.reset(OpPPC64SRADconst)
9485 v.AuxInt = int64ToAuxInt(c)
9489 // match: (MOVHreg (SRADconst [c] x))
9491 // result: (SRADconst [c] x)
9493 if v_0.Op != OpPPC64SRADconst {
9496 c := auxIntToInt64(v_0.AuxInt)
9501 v.reset(OpPPC64SRADconst)
9502 v.AuxInt = int64ToAuxInt(c)
9506 // match: (MOVHreg (SRWconst [c] x))
9508 // result: (SRWconst [c] x)
9510 if v_0.Op != OpPPC64SRWconst {
9513 c := auxIntToInt64(v_0.AuxInt)
9518 v.reset(OpPPC64SRWconst)
9519 v.AuxInt = int64ToAuxInt(c)
9523 // match: (MOVHreg (SRAWconst [c] x))
9525 // result: (SRAWconst [c] x)
9527 if v_0.Op != OpPPC64SRAWconst {
9530 c := auxIntToInt64(v_0.AuxInt)
9535 v.reset(OpPPC64SRAWconst)
9536 v.AuxInt = int64ToAuxInt(c)
9540 // match: (MOVHreg (SRWconst [c] x))
9542 // result: (SRAWconst [c] x)
9544 if v_0.Op != OpPPC64SRWconst {
9547 c := auxIntToInt64(v_0.AuxInt)
9552 v.reset(OpPPC64SRAWconst)
9553 v.AuxInt = int64ToAuxInt(c)
9557 // match: (MOVHreg y:(MOVHreg _))
9561 if y.Op != OpPPC64MOVHreg {
9567 // match: (MOVHreg y:(MOVBreg _))
9571 if y.Op != OpPPC64MOVBreg {
9577 // match: (MOVHreg y:(MOVHZreg x))
9578 // result: (MOVHreg x)
9581 if y.Op != OpPPC64MOVHZreg {
9585 v.reset(OpPPC64MOVHreg)
9589 // match: (MOVHreg x:(MOVHload _ _))
9593 if x.Op != OpPPC64MOVHload {
9599 // match: (MOVHreg x:(MOVHloadidx _ _ _))
9603 if x.Op != OpPPC64MOVHloadidx {
9609 // match: (MOVHreg x:(Arg <t>))
9610 // cond: (is8BitInt(t) || is16BitInt(t)) && isSigned(t)
9618 if !((is8BitInt(t) || is16BitInt(t)) && isSigned(t)) {
9624 // match: (MOVHreg (MOVDconst [c]))
9625 // result: (MOVDconst [int64(int16(c))])
9627 if v_0.Op != OpPPC64MOVDconst {
9630 c := auxIntToInt64(v_0.AuxInt)
9631 v.reset(OpPPC64MOVDconst)
9632 v.AuxInt = int64ToAuxInt(int64(int16(c)))
9637 func rewriteValuePPC64_OpPPC64MOVHstore(v *Value) bool {
9642 config := b.Func.Config
9643 // match: (MOVHstore [off1] {sym} (ADDconst [off2] x) val mem)
9644 // cond: is16Bit(int64(off1)+off2)
9645 // result: (MOVHstore [off1+int32(off2)] {sym} x val mem)
9647 off1 := auxIntToInt32(v.AuxInt)
9648 sym := auxToSym(v.Aux)
9649 if v_0.Op != OpPPC64ADDconst {
9652 off2 := auxIntToInt64(v_0.AuxInt)
9656 if !(is16Bit(int64(off1) + off2)) {
9659 v.reset(OpPPC64MOVHstore)
9660 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9661 v.Aux = symToAux(sym)
9662 v.AddArg3(x, val, mem)
9665 // match: (MOVHstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
9666 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
9667 // result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
9669 off1 := auxIntToInt32(v.AuxInt)
9670 sym1 := auxToSym(v.Aux)
9672 if p.Op != OpPPC64MOVDaddr {
9675 off2 := auxIntToInt32(p.AuxInt)
9676 sym2 := auxToSym(p.Aux)
9680 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
9683 v.reset(OpPPC64MOVHstore)
9684 v.AuxInt = int32ToAuxInt(off1 + off2)
9685 v.Aux = symToAux(mergeSym(sym1, sym2))
9686 v.AddArg3(ptr, val, mem)
9689 // match: (MOVHstore [off] {sym} ptr (MOVDconst [0]) mem)
9690 // result: (MOVHstorezero [off] {sym} ptr mem)
9692 off := auxIntToInt32(v.AuxInt)
9693 sym := auxToSym(v.Aux)
9695 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
9699 v.reset(OpPPC64MOVHstorezero)
9700 v.AuxInt = int32ToAuxInt(off)
9701 v.Aux = symToAux(sym)
9705 // match: (MOVHstore [0] {sym} p:(ADD ptr idx) val mem)
9706 // cond: sym == nil && p.Uses == 1
9707 // result: (MOVHstoreidx ptr idx val mem)
9709 if auxIntToInt32(v.AuxInt) != 0 {
9712 sym := auxToSym(v.Aux)
9714 if p.Op != OpPPC64ADD {
9721 if !(sym == nil && p.Uses == 1) {
9724 v.reset(OpPPC64MOVHstoreidx)
9725 v.AddArg4(ptr, idx, val, mem)
9728 // match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
9729 // result: (MOVHstore [off] {sym} ptr x mem)
9731 off := auxIntToInt32(v.AuxInt)
9732 sym := auxToSym(v.Aux)
9734 if v_1.Op != OpPPC64MOVHreg {
9739 v.reset(OpPPC64MOVHstore)
9740 v.AuxInt = int32ToAuxInt(off)
9741 v.Aux = symToAux(sym)
9742 v.AddArg3(ptr, x, mem)
9745 // match: (MOVHstore [off] {sym} ptr (MOVHZreg x) mem)
9746 // result: (MOVHstore [off] {sym} ptr x mem)
9748 off := auxIntToInt32(v.AuxInt)
9749 sym := auxToSym(v.Aux)
9751 if v_1.Op != OpPPC64MOVHZreg {
9756 v.reset(OpPPC64MOVHstore)
9757 v.AuxInt = int32ToAuxInt(off)
9758 v.Aux = symToAux(sym)
9759 v.AddArg3(ptr, x, mem)
9762 // match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
9763 // result: (MOVHstore [off] {sym} ptr x mem)
9765 off := auxIntToInt32(v.AuxInt)
9766 sym := auxToSym(v.Aux)
9768 if v_1.Op != OpPPC64MOVWreg {
9773 v.reset(OpPPC64MOVHstore)
9774 v.AuxInt = int32ToAuxInt(off)
9775 v.Aux = symToAux(sym)
9776 v.AddArg3(ptr, x, mem)
9779 // match: (MOVHstore [off] {sym} ptr (MOVWZreg x) mem)
9780 // result: (MOVHstore [off] {sym} ptr x mem)
9782 off := auxIntToInt32(v.AuxInt)
9783 sym := auxToSym(v.Aux)
9785 if v_1.Op != OpPPC64MOVWZreg {
9790 v.reset(OpPPC64MOVHstore)
9791 v.AuxInt = int32ToAuxInt(off)
9792 v.Aux = symToAux(sym)
9793 v.AddArg3(ptr, x, mem)
9796 // match: (MOVHstore [i1] {s} p (SRWconst w [16]) x0:(MOVHstore [i0] {s} p w mem))
9797 // cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+2 && clobber(x0)
9798 // result: (MOVWstore [i0] {s} p w mem)
9800 i1 := auxIntToInt32(v.AuxInt)
9801 s := auxToSym(v.Aux)
9803 if v_1.Op != OpPPC64SRWconst || auxIntToInt64(v_1.AuxInt) != 16 {
9808 if x0.Op != OpPPC64MOVHstore {
9811 i0 := auxIntToInt32(x0.AuxInt)
9812 if auxToSym(x0.Aux) != s {
9816 if p != x0.Args[0] || w != x0.Args[1] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+2 && clobber(x0)) {
9819 v.reset(OpPPC64MOVWstore)
9820 v.AuxInt = int32ToAuxInt(i0)
9822 v.AddArg3(p, w, mem)
9825 // match: (MOVHstore [i1] {s} p (SRDconst w [16]) x0:(MOVHstore [i0] {s} p w mem))
9826 // cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+2 && clobber(x0)
9827 // result: (MOVWstore [i0] {s} p w mem)
9829 i1 := auxIntToInt32(v.AuxInt)
9830 s := auxToSym(v.Aux)
9832 if v_1.Op != OpPPC64SRDconst || auxIntToInt64(v_1.AuxInt) != 16 {
9837 if x0.Op != OpPPC64MOVHstore {
9840 i0 := auxIntToInt32(x0.AuxInt)
9841 if auxToSym(x0.Aux) != s {
9845 if p != x0.Args[0] || w != x0.Args[1] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+2 && clobber(x0)) {
9848 v.reset(OpPPC64MOVWstore)
9849 v.AuxInt = int32ToAuxInt(i0)
9851 v.AddArg3(p, w, mem)
9856 func rewriteValuePPC64_OpPPC64MOVHstoreidx(v *Value) bool {
9861 // match: (MOVHstoreidx ptr (MOVDconst [c]) val mem)
9863 // result: (MOVHstore [int32(c)] ptr val mem)
9866 if v_1.Op != OpPPC64MOVDconst {
9869 c := auxIntToInt64(v_1.AuxInt)
9875 v.reset(OpPPC64MOVHstore)
9876 v.AuxInt = int32ToAuxInt(int32(c))
9877 v.AddArg3(ptr, val, mem)
9880 // match: (MOVHstoreidx (MOVDconst [c]) ptr val mem)
9882 // result: (MOVHstore [int32(c)] ptr val mem)
9884 if v_0.Op != OpPPC64MOVDconst {
9887 c := auxIntToInt64(v_0.AuxInt)
9894 v.reset(OpPPC64MOVHstore)
9895 v.AuxInt = int32ToAuxInt(int32(c))
9896 v.AddArg3(ptr, val, mem)
9899 // match: (MOVHstoreidx ptr idx (MOVHreg x) mem)
9900 // result: (MOVHstoreidx ptr idx x mem)
9904 if v_2.Op != OpPPC64MOVHreg {
9909 v.reset(OpPPC64MOVHstoreidx)
9910 v.AddArg4(ptr, idx, x, mem)
9913 // match: (MOVHstoreidx ptr idx (MOVHZreg x) mem)
9914 // result: (MOVHstoreidx ptr idx x mem)
9918 if v_2.Op != OpPPC64MOVHZreg {
9923 v.reset(OpPPC64MOVHstoreidx)
9924 v.AddArg4(ptr, idx, x, mem)
9927 // match: (MOVHstoreidx ptr idx (MOVWreg x) mem)
9928 // result: (MOVHstoreidx ptr idx x mem)
9932 if v_2.Op != OpPPC64MOVWreg {
9937 v.reset(OpPPC64MOVHstoreidx)
9938 v.AddArg4(ptr, idx, x, mem)
9941 // match: (MOVHstoreidx ptr idx (MOVWZreg x) mem)
9942 // result: (MOVHstoreidx ptr idx x mem)
9946 if v_2.Op != OpPPC64MOVWZreg {
9951 v.reset(OpPPC64MOVHstoreidx)
9952 v.AddArg4(ptr, idx, x, mem)
9957 func rewriteValuePPC64_OpPPC64MOVHstorezero(v *Value) bool {
9960 // match: (MOVHstorezero [off1] {sym} (ADDconst [off2] x) mem)
9961 // cond: is16Bit(int64(off1)+off2)
9962 // result: (MOVHstorezero [off1+int32(off2)] {sym} x mem)
9964 off1 := auxIntToInt32(v.AuxInt)
9965 sym := auxToSym(v.Aux)
9966 if v_0.Op != OpPPC64ADDconst {
9969 off2 := auxIntToInt64(v_0.AuxInt)
9972 if !(is16Bit(int64(off1) + off2)) {
9975 v.reset(OpPPC64MOVHstorezero)
9976 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9977 v.Aux = symToAux(sym)
9981 // match: (MOVHstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
9982 // cond: canMergeSym(sym1,sym2) && (x.Op != OpSB || p.Uses == 1)
9983 // result: (MOVHstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
9985 off1 := auxIntToInt32(v.AuxInt)
9986 sym1 := auxToSym(v.Aux)
9988 if p.Op != OpPPC64MOVDaddr {
9991 off2 := auxIntToInt32(p.AuxInt)
9992 sym2 := auxToSym(p.Aux)
9995 if !(canMergeSym(sym1, sym2) && (x.Op != OpSB || p.Uses == 1)) {
9998 v.reset(OpPPC64MOVHstorezero)
9999 v.AuxInt = int32ToAuxInt(off1 + off2)
10000 v.Aux = symToAux(mergeSym(sym1, sym2))
10006 func rewriteValuePPC64_OpPPC64MOVWBRstore(v *Value) bool {
10010 // match: (MOVWBRstore {sym} ptr (MOVWreg x) mem)
10011 // result: (MOVWBRstore {sym} ptr x mem)
10013 sym := auxToSym(v.Aux)
10015 if v_1.Op != OpPPC64MOVWreg {
10020 v.reset(OpPPC64MOVWBRstore)
10021 v.Aux = symToAux(sym)
10022 v.AddArg3(ptr, x, mem)
10025 // match: (MOVWBRstore {sym} ptr (MOVWZreg x) mem)
10026 // result: (MOVWBRstore {sym} ptr x mem)
10028 sym := auxToSym(v.Aux)
10030 if v_1.Op != OpPPC64MOVWZreg {
10035 v.reset(OpPPC64MOVWBRstore)
10036 v.Aux = symToAux(sym)
10037 v.AddArg3(ptr, x, mem)
10042 func rewriteValuePPC64_OpPPC64MOVWZload(v *Value) bool {
10045 // match: (MOVWZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
10046 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
10047 // result: (MOVWZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
10049 off1 := auxIntToInt32(v.AuxInt)
10050 sym1 := auxToSym(v.Aux)
10052 if p.Op != OpPPC64MOVDaddr {
10055 off2 := auxIntToInt32(p.AuxInt)
10056 sym2 := auxToSym(p.Aux)
10059 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
10062 v.reset(OpPPC64MOVWZload)
10063 v.AuxInt = int32ToAuxInt(off1 + off2)
10064 v.Aux = symToAux(mergeSym(sym1, sym2))
10065 v.AddArg2(ptr, mem)
10068 // match: (MOVWZload [off1] {sym} (ADDconst [off2] x) mem)
10069 // cond: is16Bit(int64(off1)+off2)
10070 // result: (MOVWZload [off1+int32(off2)] {sym} x mem)
10072 off1 := auxIntToInt32(v.AuxInt)
10073 sym := auxToSym(v.Aux)
10074 if v_0.Op != OpPPC64ADDconst {
10077 off2 := auxIntToInt64(v_0.AuxInt)
10080 if !(is16Bit(int64(off1) + off2)) {
10083 v.reset(OpPPC64MOVWZload)
10084 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10085 v.Aux = symToAux(sym)
10089 // match: (MOVWZload [0] {sym} p:(ADD ptr idx) mem)
10090 // cond: sym == nil && p.Uses == 1
10091 // result: (MOVWZloadidx ptr idx mem)
10093 if auxIntToInt32(v.AuxInt) != 0 {
10096 sym := auxToSym(v.Aux)
10098 if p.Op != OpPPC64ADD {
10104 if !(sym == nil && p.Uses == 1) {
10107 v.reset(OpPPC64MOVWZloadidx)
10108 v.AddArg3(ptr, idx, mem)
10113 func rewriteValuePPC64_OpPPC64MOVWZloadidx(v *Value) bool {
10117 // match: (MOVWZloadidx ptr (MOVDconst [c]) mem)
10118 // cond: is16Bit(c)
10119 // result: (MOVWZload [int32(c)] ptr mem)
10122 if v_1.Op != OpPPC64MOVDconst {
10125 c := auxIntToInt64(v_1.AuxInt)
10130 v.reset(OpPPC64MOVWZload)
10131 v.AuxInt = int32ToAuxInt(int32(c))
10132 v.AddArg2(ptr, mem)
10135 // match: (MOVWZloadidx (MOVDconst [c]) ptr mem)
10136 // cond: is16Bit(c)
10137 // result: (MOVWZload [int32(c)] ptr mem)
10139 if v_0.Op != OpPPC64MOVDconst {
10142 c := auxIntToInt64(v_0.AuxInt)
10148 v.reset(OpPPC64MOVWZload)
10149 v.AuxInt = int32ToAuxInt(int32(c))
10150 v.AddArg2(ptr, mem)
10155 func rewriteValuePPC64_OpPPC64MOVWZreg(v *Value) bool {
10158 typ := &b.Func.Config.Types
10159 // match: (MOVWZreg y:(ANDconst [c] _))
10160 // cond: uint64(c) <= 0xFFFFFFFF
10164 if y.Op != OpPPC64ANDconst {
10167 c := auxIntToInt64(y.AuxInt)
10168 if !(uint64(c) <= 0xFFFFFFFF) {
10174 // match: (MOVWZreg y:(AND (MOVDconst [c]) _))
10175 // cond: uint64(c) <= 0xFFFFFFFF
10179 if y.Op != OpPPC64AND {
10184 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
10185 if y_0.Op != OpPPC64MOVDconst {
10188 c := auxIntToInt64(y_0.AuxInt)
10189 if !(uint64(c) <= 0xFFFFFFFF) {
10197 // match: (MOVWZreg (SRWconst [c] (MOVBZreg x)))
10198 // result: (SRWconst [c] (MOVBZreg x))
10200 if v_0.Op != OpPPC64SRWconst {
10203 c := auxIntToInt64(v_0.AuxInt)
10204 v_0_0 := v_0.Args[0]
10205 if v_0_0.Op != OpPPC64MOVBZreg {
10209 v.reset(OpPPC64SRWconst)
10210 v.AuxInt = int64ToAuxInt(c)
10211 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
10216 // match: (MOVWZreg (SRWconst [c] (MOVHZreg x)))
10217 // result: (SRWconst [c] (MOVHZreg x))
10219 if v_0.Op != OpPPC64SRWconst {
10222 c := auxIntToInt64(v_0.AuxInt)
10223 v_0_0 := v_0.Args[0]
10224 if v_0_0.Op != OpPPC64MOVHZreg {
10228 v.reset(OpPPC64SRWconst)
10229 v.AuxInt = int64ToAuxInt(c)
10230 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
10235 // match: (MOVWZreg (SRWconst [c] (MOVWZreg x)))
10236 // result: (SRWconst [c] (MOVWZreg x))
10238 if v_0.Op != OpPPC64SRWconst {
10241 c := auxIntToInt64(v_0.AuxInt)
10242 v_0_0 := v_0.Args[0]
10243 if v_0_0.Op != OpPPC64MOVWZreg {
10247 v.reset(OpPPC64SRWconst)
10248 v.AuxInt = int64ToAuxInt(c)
10249 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
10254 // match: (MOVWZreg (SRWconst [c] x))
10255 // cond: sizeof(x.Type) <= 32
10256 // result: (SRWconst [c] x)
10258 if v_0.Op != OpPPC64SRWconst {
10261 c := auxIntToInt64(v_0.AuxInt)
10263 if !(sizeof(x.Type) <= 32) {
10266 v.reset(OpPPC64SRWconst)
10267 v.AuxInt = int64ToAuxInt(c)
10271 // match: (MOVWZreg (SRDconst [c] x))
10273 // result: (SRDconst [c] x)
10275 if v_0.Op != OpPPC64SRDconst {
10278 c := auxIntToInt64(v_0.AuxInt)
10283 v.reset(OpPPC64SRDconst)
10284 v.AuxInt = int64ToAuxInt(c)
10288 // match: (MOVWZreg y:(MOVWZreg _))
10292 if y.Op != OpPPC64MOVWZreg {
10298 // match: (MOVWZreg y:(MOVHZreg _))
10302 if y.Op != OpPPC64MOVHZreg {
10308 // match: (MOVWZreg y:(MOVBZreg _))
10312 if y.Op != OpPPC64MOVBZreg {
10318 // match: (MOVWZreg y:(MOVHBRload _ _))
10322 if y.Op != OpPPC64MOVHBRload {
10328 // match: (MOVWZreg y:(MOVWBRload _ _))
10332 if y.Op != OpPPC64MOVWBRload {
10338 // match: (MOVWZreg y:(MOVWreg x))
10339 // result: (MOVWZreg x)
10342 if y.Op != OpPPC64MOVWreg {
10346 v.reset(OpPPC64MOVWZreg)
10350 // match: (MOVWZreg (OR <t> x (MOVWZreg y)))
10351 // result: (MOVWZreg (OR <t> x y))
10353 if v_0.Op != OpPPC64OR {
10358 v_0_0 := v_0.Args[0]
10359 v_0_1 := v_0.Args[1]
10360 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
10362 if v_0_1.Op != OpPPC64MOVWZreg {
10366 v.reset(OpPPC64MOVWZreg)
10367 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
10374 // match: (MOVWZreg (XOR <t> x (MOVWZreg y)))
10375 // result: (MOVWZreg (XOR <t> x y))
10377 if v_0.Op != OpPPC64XOR {
10382 v_0_0 := v_0.Args[0]
10383 v_0_1 := v_0.Args[1]
10384 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
10386 if v_0_1.Op != OpPPC64MOVWZreg {
10390 v.reset(OpPPC64MOVWZreg)
10391 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
10398 // match: (MOVWZreg (AND <t> x (MOVWZreg y)))
10399 // result: (MOVWZreg (AND <t> x y))
10401 if v_0.Op != OpPPC64AND {
10406 v_0_0 := v_0.Args[0]
10407 v_0_1 := v_0.Args[1]
10408 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
10410 if v_0_1.Op != OpPPC64MOVWZreg {
10414 v.reset(OpPPC64MOVWZreg)
10415 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
10422 // match: (MOVWZreg z:(ANDconst [c] (MOVBZload ptr x)))
10426 if z.Op != OpPPC64ANDconst {
10430 if z_0.Op != OpPPC64MOVBZload {
10436 // match: (MOVWZreg z:(ANDconst [c] (MOVHZload ptr x)))
10440 if z.Op != OpPPC64ANDconst {
10444 if z_0.Op != OpPPC64MOVHZload {
10450 // match: (MOVWZreg z:(ANDconst [c] (MOVWZload ptr x)))
10454 if z.Op != OpPPC64ANDconst {
10458 if z_0.Op != OpPPC64MOVWZload {
10464 // match: (MOVWZreg z:(AND y (MOVWZload ptr x)))
10468 if z.Op != OpPPC64AND {
10474 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
10475 if z_1.Op != OpPPC64MOVWZload {
10483 // match: (MOVWZreg x:(MOVBZload _ _))
10487 if x.Op != OpPPC64MOVBZload {
10493 // match: (MOVWZreg x:(MOVBZloadidx _ _ _))
10497 if x.Op != OpPPC64MOVBZloadidx {
10503 // match: (MOVWZreg x:(MOVHZload _ _))
10507 if x.Op != OpPPC64MOVHZload {
10513 // match: (MOVWZreg x:(MOVHZloadidx _ _ _))
10517 if x.Op != OpPPC64MOVHZloadidx {
10523 // match: (MOVWZreg x:(MOVWZload _ _))
10527 if x.Op != OpPPC64MOVWZload {
10533 // match: (MOVWZreg x:(MOVWZloadidx _ _ _))
10537 if x.Op != OpPPC64MOVWZloadidx {
10543 // match: (MOVWZreg x:(Arg <t>))
10544 // cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !isSigned(t)
10552 if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !isSigned(t)) {
10558 // match: (MOVWZreg (MOVDconst [c]))
10559 // result: (MOVDconst [int64(uint32(c))])
10561 if v_0.Op != OpPPC64MOVDconst {
10564 c := auxIntToInt64(v_0.AuxInt)
10565 v.reset(OpPPC64MOVDconst)
10566 v.AuxInt = int64ToAuxInt(int64(uint32(c)))
10571 func rewriteValuePPC64_OpPPC64MOVWload(v *Value) bool {
10574 // match: (MOVWload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
10575 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
10576 // result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
10578 off1 := auxIntToInt32(v.AuxInt)
10579 sym1 := auxToSym(v.Aux)
10581 if p.Op != OpPPC64MOVDaddr {
10584 off2 := auxIntToInt32(p.AuxInt)
10585 sym2 := auxToSym(p.Aux)
10588 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
10591 v.reset(OpPPC64MOVWload)
10592 v.AuxInt = int32ToAuxInt(off1 + off2)
10593 v.Aux = symToAux(mergeSym(sym1, sym2))
10594 v.AddArg2(ptr, mem)
10597 // match: (MOVWload [off1] {sym} (ADDconst [off2] x) mem)
10598 // cond: is16Bit(int64(off1)+off2)
10599 // result: (MOVWload [off1+int32(off2)] {sym} x mem)
10601 off1 := auxIntToInt32(v.AuxInt)
10602 sym := auxToSym(v.Aux)
10603 if v_0.Op != OpPPC64ADDconst {
10606 off2 := auxIntToInt64(v_0.AuxInt)
10609 if !(is16Bit(int64(off1) + off2)) {
10612 v.reset(OpPPC64MOVWload)
10613 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10614 v.Aux = symToAux(sym)
10618 // match: (MOVWload [0] {sym} p:(ADD ptr idx) mem)
10619 // cond: sym == nil && p.Uses == 1
10620 // result: (MOVWloadidx ptr idx mem)
10622 if auxIntToInt32(v.AuxInt) != 0 {
10625 sym := auxToSym(v.Aux)
10627 if p.Op != OpPPC64ADD {
10633 if !(sym == nil && p.Uses == 1) {
10636 v.reset(OpPPC64MOVWloadidx)
10637 v.AddArg3(ptr, idx, mem)
10642 func rewriteValuePPC64_OpPPC64MOVWloadidx(v *Value) bool {
10646 // match: (MOVWloadidx ptr (MOVDconst [c]) mem)
10647 // cond: is16Bit(c) && c%4 == 0
10648 // result: (MOVWload [int32(c)] ptr mem)
10651 if v_1.Op != OpPPC64MOVDconst {
10654 c := auxIntToInt64(v_1.AuxInt)
10656 if !(is16Bit(c) && c%4 == 0) {
10659 v.reset(OpPPC64MOVWload)
10660 v.AuxInt = int32ToAuxInt(int32(c))
10661 v.AddArg2(ptr, mem)
10664 // match: (MOVWloadidx (MOVDconst [c]) ptr mem)
10665 // cond: is16Bit(c) && c%4 == 0
10666 // result: (MOVWload [int32(c)] ptr mem)
10668 if v_0.Op != OpPPC64MOVDconst {
10671 c := auxIntToInt64(v_0.AuxInt)
10674 if !(is16Bit(c) && c%4 == 0) {
10677 v.reset(OpPPC64MOVWload)
10678 v.AuxInt = int32ToAuxInt(int32(c))
10679 v.AddArg2(ptr, mem)
10684 func rewriteValuePPC64_OpPPC64MOVWreg(v *Value) bool {
10687 typ := &b.Func.Config.Types
10688 // match: (MOVWreg y:(ANDconst [c] _))
10689 // cond: uint64(c) <= 0xFFFF
10693 if y.Op != OpPPC64ANDconst {
10696 c := auxIntToInt64(y.AuxInt)
10697 if !(uint64(c) <= 0xFFFF) {
10703 // match: (MOVWreg y:(AND (MOVDconst [c]) _))
10704 // cond: uint64(c) <= 0x7FFFFFFF
10708 if y.Op != OpPPC64AND {
10713 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
10714 if y_0.Op != OpPPC64MOVDconst {
10717 c := auxIntToInt64(y_0.AuxInt)
10718 if !(uint64(c) <= 0x7FFFFFFF) {
10726 // match: (MOVWreg (SRAWconst [c] (MOVBreg x)))
10727 // result: (SRAWconst [c] (MOVBreg x))
10729 if v_0.Op != OpPPC64SRAWconst {
10732 c := auxIntToInt64(v_0.AuxInt)
10733 v_0_0 := v_0.Args[0]
10734 if v_0_0.Op != OpPPC64MOVBreg {
10738 v.reset(OpPPC64SRAWconst)
10739 v.AuxInt = int64ToAuxInt(c)
10740 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
10745 // match: (MOVWreg (SRAWconst [c] (MOVHreg x)))
10746 // result: (SRAWconst [c] (MOVHreg x))
10748 if v_0.Op != OpPPC64SRAWconst {
10751 c := auxIntToInt64(v_0.AuxInt)
10752 v_0_0 := v_0.Args[0]
10753 if v_0_0.Op != OpPPC64MOVHreg {
10757 v.reset(OpPPC64SRAWconst)
10758 v.AuxInt = int64ToAuxInt(c)
10759 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
10764 // match: (MOVWreg (SRAWconst [c] (MOVWreg x)))
10765 // result: (SRAWconst [c] (MOVWreg x))
10767 if v_0.Op != OpPPC64SRAWconst {
10770 c := auxIntToInt64(v_0.AuxInt)
10771 v_0_0 := v_0.Args[0]
10772 if v_0_0.Op != OpPPC64MOVWreg {
10776 v.reset(OpPPC64SRAWconst)
10777 v.AuxInt = int64ToAuxInt(c)
10778 v0 := b.NewValue0(v.Pos, OpPPC64MOVWreg, typ.Int64)
10783 // match: (MOVWreg (SRAWconst [c] x))
10784 // cond: sizeof(x.Type) <= 32
10785 // result: (SRAWconst [c] x)
10787 if v_0.Op != OpPPC64SRAWconst {
10790 c := auxIntToInt64(v_0.AuxInt)
10792 if !(sizeof(x.Type) <= 32) {
10795 v.reset(OpPPC64SRAWconst)
10796 v.AuxInt = int64ToAuxInt(c)
10800 // match: (MOVWreg (SRDconst [c] x))
10802 // result: (SRDconst [c] x)
10804 if v_0.Op != OpPPC64SRDconst {
10807 c := auxIntToInt64(v_0.AuxInt)
10812 v.reset(OpPPC64SRDconst)
10813 v.AuxInt = int64ToAuxInt(c)
10817 // match: (MOVWreg (SRADconst [c] x))
10819 // result: (SRADconst [c] x)
10821 if v_0.Op != OpPPC64SRADconst {
10824 c := auxIntToInt64(v_0.AuxInt)
10829 v.reset(OpPPC64SRADconst)
10830 v.AuxInt = int64ToAuxInt(c)
10834 // match: (MOVWreg (SRDconst [c] x))
10836 // result: (SRADconst [c] x)
10838 if v_0.Op != OpPPC64SRDconst {
10841 c := auxIntToInt64(v_0.AuxInt)
10846 v.reset(OpPPC64SRADconst)
10847 v.AuxInt = int64ToAuxInt(c)
10851 // match: (MOVWreg y:(MOVWreg _))
10855 if y.Op != OpPPC64MOVWreg {
10861 // match: (MOVWreg y:(MOVHreg _))
10865 if y.Op != OpPPC64MOVHreg {
10871 // match: (MOVWreg y:(MOVBreg _))
10875 if y.Op != OpPPC64MOVBreg {
10881 // match: (MOVWreg y:(MOVWZreg x))
10882 // result: (MOVWreg x)
10885 if y.Op != OpPPC64MOVWZreg {
10889 v.reset(OpPPC64MOVWreg)
10893 // match: (MOVWreg x:(MOVHload _ _))
10897 if x.Op != OpPPC64MOVHload {
10903 // match: (MOVWreg x:(MOVHloadidx _ _ _))
10907 if x.Op != OpPPC64MOVHloadidx {
10913 // match: (MOVWreg x:(MOVWload _ _))
10917 if x.Op != OpPPC64MOVWload {
10923 // match: (MOVWreg x:(MOVWloadidx _ _ _))
10927 if x.Op != OpPPC64MOVWloadidx {
10933 // match: (MOVWreg x:(Arg <t>))
10934 // cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && isSigned(t)
10942 if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && isSigned(t)) {
10948 // match: (MOVWreg (MOVDconst [c]))
10949 // result: (MOVDconst [int64(int32(c))])
10951 if v_0.Op != OpPPC64MOVDconst {
10954 c := auxIntToInt64(v_0.AuxInt)
10955 v.reset(OpPPC64MOVDconst)
10956 v.AuxInt = int64ToAuxInt(int64(int32(c)))
10961 func rewriteValuePPC64_OpPPC64MOVWstore(v *Value) bool {
10965 // match: (MOVWstore [off1] {sym} (ADDconst [off2] x) val mem)
10966 // cond: is16Bit(int64(off1)+off2)
10967 // result: (MOVWstore [off1+int32(off2)] {sym} x val mem)
10969 off1 := auxIntToInt32(v.AuxInt)
10970 sym := auxToSym(v.Aux)
10971 if v_0.Op != OpPPC64ADDconst {
10974 off2 := auxIntToInt64(v_0.AuxInt)
10978 if !(is16Bit(int64(off1) + off2)) {
10981 v.reset(OpPPC64MOVWstore)
10982 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10983 v.Aux = symToAux(sym)
10984 v.AddArg3(x, val, mem)
10987 // match: (MOVWstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
10988 // cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
10989 // result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
10991 off1 := auxIntToInt32(v.AuxInt)
10992 sym1 := auxToSym(v.Aux)
10994 if p.Op != OpPPC64MOVDaddr {
10997 off2 := auxIntToInt32(p.AuxInt)
10998 sym2 := auxToSym(p.Aux)
11002 if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
11005 v.reset(OpPPC64MOVWstore)
11006 v.AuxInt = int32ToAuxInt(off1 + off2)
11007 v.Aux = symToAux(mergeSym(sym1, sym2))
11008 v.AddArg3(ptr, val, mem)
11011 // match: (MOVWstore [off] {sym} ptr (MOVDconst [0]) mem)
11012 // result: (MOVWstorezero [off] {sym} ptr mem)
11014 off := auxIntToInt32(v.AuxInt)
11015 sym := auxToSym(v.Aux)
11017 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
11021 v.reset(OpPPC64MOVWstorezero)
11022 v.AuxInt = int32ToAuxInt(off)
11023 v.Aux = symToAux(sym)
11024 v.AddArg2(ptr, mem)
11027 // match: (MOVWstore [0] {sym} p:(ADD ptr idx) val mem)
11028 // cond: sym == nil && p.Uses == 1
11029 // result: (MOVWstoreidx ptr idx val mem)
11031 if auxIntToInt32(v.AuxInt) != 0 {
11034 sym := auxToSym(v.Aux)
11036 if p.Op != OpPPC64ADD {
11043 if !(sym == nil && p.Uses == 1) {
11046 v.reset(OpPPC64MOVWstoreidx)
11047 v.AddArg4(ptr, idx, val, mem)
11050 // match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
11051 // result: (MOVWstore [off] {sym} ptr x mem)
11053 off := auxIntToInt32(v.AuxInt)
11054 sym := auxToSym(v.Aux)
11056 if v_1.Op != OpPPC64MOVWreg {
11061 v.reset(OpPPC64MOVWstore)
11062 v.AuxInt = int32ToAuxInt(off)
11063 v.Aux = symToAux(sym)
11064 v.AddArg3(ptr, x, mem)
11067 // match: (MOVWstore [off] {sym} ptr (MOVWZreg x) mem)
11068 // result: (MOVWstore [off] {sym} ptr x mem)
11070 off := auxIntToInt32(v.AuxInt)
11071 sym := auxToSym(v.Aux)
11073 if v_1.Op != OpPPC64MOVWZreg {
11078 v.reset(OpPPC64MOVWstore)
11079 v.AuxInt = int32ToAuxInt(off)
11080 v.Aux = symToAux(sym)
11081 v.AddArg3(ptr, x, mem)
11086 func rewriteValuePPC64_OpPPC64MOVWstoreidx(v *Value) bool {
11091 // match: (MOVWstoreidx ptr (MOVDconst [c]) val mem)
11092 // cond: is16Bit(c)
11093 // result: (MOVWstore [int32(c)] ptr val mem)
11096 if v_1.Op != OpPPC64MOVDconst {
11099 c := auxIntToInt64(v_1.AuxInt)
11105 v.reset(OpPPC64MOVWstore)
11106 v.AuxInt = int32ToAuxInt(int32(c))
11107 v.AddArg3(ptr, val, mem)
11110 // match: (MOVWstoreidx (MOVDconst [c]) ptr val mem)
11111 // cond: is16Bit(c)
11112 // result: (MOVWstore [int32(c)] ptr val mem)
11114 if v_0.Op != OpPPC64MOVDconst {
11117 c := auxIntToInt64(v_0.AuxInt)
11124 v.reset(OpPPC64MOVWstore)
11125 v.AuxInt = int32ToAuxInt(int32(c))
11126 v.AddArg3(ptr, val, mem)
11129 // match: (MOVWstoreidx ptr idx (MOVWreg x) mem)
11130 // result: (MOVWstoreidx ptr idx x mem)
11134 if v_2.Op != OpPPC64MOVWreg {
11139 v.reset(OpPPC64MOVWstoreidx)
11140 v.AddArg4(ptr, idx, x, mem)
11143 // match: (MOVWstoreidx ptr idx (MOVWZreg x) mem)
11144 // result: (MOVWstoreidx ptr idx x mem)
11148 if v_2.Op != OpPPC64MOVWZreg {
11153 v.reset(OpPPC64MOVWstoreidx)
11154 v.AddArg4(ptr, idx, x, mem)
11159 func rewriteValuePPC64_OpPPC64MOVWstorezero(v *Value) bool {
11162 // match: (MOVWstorezero [off1] {sym} (ADDconst [off2] x) mem)
11163 // cond: is16Bit(int64(off1)+off2)
11164 // result: (MOVWstorezero [off1+int32(off2)] {sym} x mem)
11166 off1 := auxIntToInt32(v.AuxInt)
11167 sym := auxToSym(v.Aux)
11168 if v_0.Op != OpPPC64ADDconst {
11171 off2 := auxIntToInt64(v_0.AuxInt)
11174 if !(is16Bit(int64(off1) + off2)) {
11177 v.reset(OpPPC64MOVWstorezero)
11178 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
11179 v.Aux = symToAux(sym)
11183 // match: (MOVWstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
11184 // cond: canMergeSym(sym1,sym2) && (x.Op != OpSB || p.Uses == 1)
11185 // result: (MOVWstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
11187 off1 := auxIntToInt32(v.AuxInt)
11188 sym1 := auxToSym(v.Aux)
11190 if p.Op != OpPPC64MOVDaddr {
11193 off2 := auxIntToInt32(p.AuxInt)
11194 sym2 := auxToSym(p.Aux)
11197 if !(canMergeSym(sym1, sym2) && (x.Op != OpSB || p.Uses == 1)) {
11200 v.reset(OpPPC64MOVWstorezero)
11201 v.AuxInt = int32ToAuxInt(off1 + off2)
11202 v.Aux = symToAux(mergeSym(sym1, sym2))
11208 func rewriteValuePPC64_OpPPC64MTVSRD(v *Value) bool {
11211 typ := &b.Func.Config.Types
11212 // match: (MTVSRD (MOVDconst [c]))
11213 // cond: !math.IsNaN(math.Float64frombits(uint64(c)))
11214 // result: (FMOVDconst [math.Float64frombits(uint64(c))])
11216 if v_0.Op != OpPPC64MOVDconst {
11219 c := auxIntToInt64(v_0.AuxInt)
11220 if !(!math.IsNaN(math.Float64frombits(uint64(c)))) {
11223 v.reset(OpPPC64FMOVDconst)
11224 v.AuxInt = float64ToAuxInt(math.Float64frombits(uint64(c)))
11227 // match: (MTVSRD x:(MOVDload [off] {sym} ptr mem))
11228 // cond: x.Uses == 1 && clobber(x)
11229 // result: @x.Block (FMOVDload [off] {sym} ptr mem)
11232 if x.Op != OpPPC64MOVDload {
11235 off := auxIntToInt32(x.AuxInt)
11236 sym := auxToSym(x.Aux)
11239 if !(x.Uses == 1 && clobber(x)) {
11243 v0 := b.NewValue0(x.Pos, OpPPC64FMOVDload, typ.Float64)
11245 v0.AuxInt = int32ToAuxInt(off)
11246 v0.Aux = symToAux(sym)
11247 v0.AddArg2(ptr, mem)
11252 func rewriteValuePPC64_OpPPC64MULLD(v *Value) bool {
11255 // match: (MULLD x (MOVDconst [c]))
11256 // cond: is16Bit(c)
11257 // result: (MULLDconst [int32(c)] x)
11259 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11261 if v_1.Op != OpPPC64MOVDconst {
11264 c := auxIntToInt64(v_1.AuxInt)
11268 v.reset(OpPPC64MULLDconst)
11269 v.AuxInt = int32ToAuxInt(int32(c))
11277 func rewriteValuePPC64_OpPPC64MULLW(v *Value) bool {
11280 // match: (MULLW x (MOVDconst [c]))
11281 // cond: is16Bit(c)
11282 // result: (MULLWconst [int32(c)] x)
11284 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11286 if v_1.Op != OpPPC64MOVDconst {
11289 c := auxIntToInt64(v_1.AuxInt)
11293 v.reset(OpPPC64MULLWconst)
11294 v.AuxInt = int32ToAuxInt(int32(c))
11302 func rewriteValuePPC64_OpPPC64NEG(v *Value) bool {
11304 // match: (NEG (ADDconst [c] x))
11305 // cond: is32Bit(-c)
11306 // result: (SUBFCconst [-c] x)
11308 if v_0.Op != OpPPC64ADDconst {
11311 c := auxIntToInt64(v_0.AuxInt)
11313 if !(is32Bit(-c)) {
11316 v.reset(OpPPC64SUBFCconst)
11317 v.AuxInt = int64ToAuxInt(-c)
11321 // match: (NEG (SUBFCconst [c] x))
11322 // cond: is32Bit(-c)
11323 // result: (ADDconst [-c] x)
11325 if v_0.Op != OpPPC64SUBFCconst {
11328 c := auxIntToInt64(v_0.AuxInt)
11330 if !(is32Bit(-c)) {
11333 v.reset(OpPPC64ADDconst)
11334 v.AuxInt = int64ToAuxInt(-c)
11340 func rewriteValuePPC64_OpPPC64NOR(v *Value) bool {
11343 // match: (NOR (MOVDconst [c]) (MOVDconst [d]))
11344 // result: (MOVDconst [^(c|d)])
11346 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11347 if v_0.Op != OpPPC64MOVDconst {
11350 c := auxIntToInt64(v_0.AuxInt)
11351 if v_1.Op != OpPPC64MOVDconst {
11354 d := auxIntToInt64(v_1.AuxInt)
11355 v.reset(OpPPC64MOVDconst)
11356 v.AuxInt = int64ToAuxInt(^(c | d))
11363 func rewriteValuePPC64_OpPPC64NotEqual(v *Value) bool {
11366 typ := &b.Func.Config.Types
11367 // match: (NotEqual (FlagEQ))
11368 // result: (MOVDconst [0])
11370 if v_0.Op != OpPPC64FlagEQ {
11373 v.reset(OpPPC64MOVDconst)
11374 v.AuxInt = int64ToAuxInt(0)
11377 // match: (NotEqual (FlagLT))
11378 // result: (MOVDconst [1])
11380 if v_0.Op != OpPPC64FlagLT {
11383 v.reset(OpPPC64MOVDconst)
11384 v.AuxInt = int64ToAuxInt(1)
11387 // match: (NotEqual (FlagGT))
11388 // result: (MOVDconst [1])
11390 if v_0.Op != OpPPC64FlagGT {
11393 v.reset(OpPPC64MOVDconst)
11394 v.AuxInt = int64ToAuxInt(1)
11397 // match: (NotEqual (InvertFlags x))
11398 // result: (NotEqual x)
11400 if v_0.Op != OpPPC64InvertFlags {
11404 v.reset(OpPPC64NotEqual)
11408 // match: (NotEqual cmp)
11409 // result: (ISELB [6] (MOVDconst [1]) cmp)
11412 v.reset(OpPPC64ISELB)
11413 v.AuxInt = int32ToAuxInt(6)
11414 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
11415 v0.AuxInt = int64ToAuxInt(1)
11420 func rewriteValuePPC64_OpPPC64OR(v *Value) bool {
11424 config := b.Func.Config
11425 typ := &b.Func.Config.Types
11426 // match: ( OR (SLDconst x [c]) (SRDconst x [d]))
11428 // result: (ROTLconst [c] x)
11430 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11431 if v_0.Op != OpPPC64SLDconst {
11434 c := auxIntToInt64(v_0.AuxInt)
11436 if v_1.Op != OpPPC64SRDconst {
11439 d := auxIntToInt64(v_1.AuxInt)
11440 if x != v_1.Args[0] || !(d == 64-c) {
11443 v.reset(OpPPC64ROTLconst)
11444 v.AuxInt = int64ToAuxInt(c)
11450 // match: ( OR (SLWconst x [c]) (SRWconst x [d]))
11452 // result: (ROTLWconst [c] x)
11454 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11455 if v_0.Op != OpPPC64SLWconst {
11458 c := auxIntToInt64(v_0.AuxInt)
11460 if v_1.Op != OpPPC64SRWconst {
11463 d := auxIntToInt64(v_1.AuxInt)
11464 if x != v_1.Args[0] || !(d == 32-c) {
11467 v.reset(OpPPC64ROTLWconst)
11468 v.AuxInt = int64ToAuxInt(c)
11474 // match: ( OR (SLD x (ANDconst <typ.Int64> [63] y)) (SRD x (SUB <typ.UInt> (MOVDconst [64]) (ANDconst <typ.UInt> [63] y))))
11475 // result: (ROTL x y)
11477 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11478 if v_0.Op != OpPPC64SLD {
11483 v_0_1 := v_0.Args[1]
11484 if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int64 || auxIntToInt64(v_0_1.AuxInt) != 63 {
11488 if v_1.Op != OpPPC64SRD {
11492 if x != v_1.Args[0] {
11495 v_1_1 := v_1.Args[1]
11496 if v_1_1.Op != OpPPC64SUB || v_1_1.Type != typ.UInt {
11500 v_1_1_0 := v_1_1.Args[0]
11501 if v_1_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1_0.AuxInt) != 64 {
11504 v_1_1_1 := v_1_1.Args[1]
11505 if v_1_1_1.Op != OpPPC64ANDconst || v_1_1_1.Type != typ.UInt || auxIntToInt64(v_1_1_1.AuxInt) != 63 || y != v_1_1_1.Args[0] {
11508 v.reset(OpPPC64ROTL)
11514 // match: ( OR (SLD x (ANDconst <typ.Int64> [63] y)) (SRD x (SUBFCconst <typ.UInt> [64] (ANDconst <typ.UInt> [63] y))))
11515 // result: (ROTL x y)
11517 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11518 if v_0.Op != OpPPC64SLD {
11523 v_0_1 := v_0.Args[1]
11524 if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int64 || auxIntToInt64(v_0_1.AuxInt) != 63 {
11528 if v_1.Op != OpPPC64SRD {
11532 if x != v_1.Args[0] {
11535 v_1_1 := v_1.Args[1]
11536 if v_1_1.Op != OpPPC64SUBFCconst || v_1_1.Type != typ.UInt || auxIntToInt64(v_1_1.AuxInt) != 64 {
11539 v_1_1_0 := v_1_1.Args[0]
11540 if v_1_1_0.Op != OpPPC64ANDconst || v_1_1_0.Type != typ.UInt || auxIntToInt64(v_1_1_0.AuxInt) != 63 || y != v_1_1_0.Args[0] {
11543 v.reset(OpPPC64ROTL)
11549 // match: ( OR (SLW x (ANDconst <typ.Int32> [31] y)) (SRW x (SUBFCconst <typ.UInt> [32] (ANDconst <typ.UInt> [31] y))))
11550 // result: (ROTLW x y)
11552 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11553 if v_0.Op != OpPPC64SLW {
11558 v_0_1 := v_0.Args[1]
11559 if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int32 || auxIntToInt64(v_0_1.AuxInt) != 31 {
11563 if v_1.Op != OpPPC64SRW {
11567 if x != v_1.Args[0] {
11570 v_1_1 := v_1.Args[1]
11571 if v_1_1.Op != OpPPC64SUBFCconst || v_1_1.Type != typ.UInt || auxIntToInt64(v_1_1.AuxInt) != 32 {
11574 v_1_1_0 := v_1_1.Args[0]
11575 if v_1_1_0.Op != OpPPC64ANDconst || v_1_1_0.Type != typ.UInt || auxIntToInt64(v_1_1_0.AuxInt) != 31 || y != v_1_1_0.Args[0] {
11578 v.reset(OpPPC64ROTLW)
11584 // match: ( OR (SLW x (ANDconst <typ.Int32> [31] y)) (SRW x (SUB <typ.UInt> (MOVDconst [32]) (ANDconst <typ.UInt> [31] y))))
11585 // result: (ROTLW x y)
11587 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11588 if v_0.Op != OpPPC64SLW {
11593 v_0_1 := v_0.Args[1]
11594 if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int32 || auxIntToInt64(v_0_1.AuxInt) != 31 {
11598 if v_1.Op != OpPPC64SRW {
11602 if x != v_1.Args[0] {
11605 v_1_1 := v_1.Args[1]
11606 if v_1_1.Op != OpPPC64SUB || v_1_1.Type != typ.UInt {
11610 v_1_1_0 := v_1_1.Args[0]
11611 if v_1_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1_0.AuxInt) != 32 {
11614 v_1_1_1 := v_1_1.Args[1]
11615 if v_1_1_1.Op != OpPPC64ANDconst || v_1_1_1.Type != typ.UInt || auxIntToInt64(v_1_1_1.AuxInt) != 31 || y != v_1_1_1.Args[0] {
11618 v.reset(OpPPC64ROTLW)
11624 // match: (OR (MOVDconst [c]) (MOVDconst [d]))
11625 // result: (MOVDconst [c|d])
11627 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11628 if v_0.Op != OpPPC64MOVDconst {
11631 c := auxIntToInt64(v_0.AuxInt)
11632 if v_1.Op != OpPPC64MOVDconst {
11635 d := auxIntToInt64(v_1.AuxInt)
11636 v.reset(OpPPC64MOVDconst)
11637 v.AuxInt = int64ToAuxInt(c | d)
11642 // match: (OR x (MOVDconst [c]))
11643 // cond: isU32Bit(c)
11644 // result: (ORconst [c] x)
11646 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11648 if v_1.Op != OpPPC64MOVDconst {
11651 c := auxIntToInt64(v_1.AuxInt)
11652 if !(isU32Bit(c)) {
11655 v.reset(OpPPC64ORconst)
11656 v.AuxInt = int64ToAuxInt(c)
11662 // match: (OR <t> x0:(MOVBZload [i0] {s} p mem) o1:(SLWconst x1:(MOVBZload [i1] {s} p mem) [8]))
11663 // cond: !config.BigEndian && i1 == i0+1 && x0.Uses ==1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)
11664 // result: @mergePoint(b,x0,x1) (MOVHZload <t> {s} [i0] p mem)
11667 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11669 if x0.Op != OpPPC64MOVBZload {
11672 i0 := auxIntToInt32(x0.AuxInt)
11673 s := auxToSym(x0.Aux)
11677 if o1.Op != OpPPC64SLWconst || auxIntToInt64(o1.AuxInt) != 8 {
11681 if x1.Op != OpPPC64MOVBZload {
11684 i1 := auxIntToInt32(x1.AuxInt)
11685 if auxToSym(x1.Aux) != s {
11689 if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && x0.Uses == 1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)) {
11692 b = mergePoint(b, x0, x1)
11693 v0 := b.NewValue0(x1.Pos, OpPPC64MOVHZload, t)
11695 v0.AuxInt = int32ToAuxInt(i0)
11696 v0.Aux = symToAux(s)
11702 // match: (OR <t> x0:(MOVBZload [i0] {s} p mem) o1:(SLDconst x1:(MOVBZload [i1] {s} p mem) [8]))
11703 // cond: !config.BigEndian && i1 == i0+1 && x0.Uses ==1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)
11704 // result: @mergePoint(b,x0,x1) (MOVHZload <t> {s} [i0] p mem)
11707 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11709 if x0.Op != OpPPC64MOVBZload {
11712 i0 := auxIntToInt32(x0.AuxInt)
11713 s := auxToSym(x0.Aux)
11717 if o1.Op != OpPPC64SLDconst || auxIntToInt64(o1.AuxInt) != 8 {
11721 if x1.Op != OpPPC64MOVBZload {
11724 i1 := auxIntToInt32(x1.AuxInt)
11725 if auxToSym(x1.Aux) != s {
11729 if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && x0.Uses == 1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)) {
11732 b = mergePoint(b, x0, x1)
11733 v0 := b.NewValue0(x1.Pos, OpPPC64MOVHZload, t)
11735 v0.AuxInt = int32ToAuxInt(i0)
11736 v0.Aux = symToAux(s)
11742 // match: (OR <t> x0:(MOVBZload [i1] {s} p mem) o1:(SLWconst x1:(MOVBZload [i0] {s} p mem) [8]))
11743 // cond: !config.BigEndian && i1 == i0+1 && x0.Uses ==1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)
11744 // result: @mergePoint(b,x0,x1) (MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
11747 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11749 if x0.Op != OpPPC64MOVBZload {
11752 i1 := auxIntToInt32(x0.AuxInt)
11753 s := auxToSym(x0.Aux)
11757 if o1.Op != OpPPC64SLWconst || auxIntToInt64(o1.AuxInt) != 8 {
11761 if x1.Op != OpPPC64MOVBZload {
11764 i0 := auxIntToInt32(x1.AuxInt)
11765 if auxToSym(x1.Aux) != s {
11769 if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && x0.Uses == 1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)) {
11772 b = mergePoint(b, x0, x1)
11773 v0 := b.NewValue0(x1.Pos, OpPPC64MOVHBRload, t)
11775 v1 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr)
11776 v1.AuxInt = int32ToAuxInt(i0)
11777 v1.Aux = symToAux(s)
11779 v0.AddArg2(v1, mem)
11784 // match: (OR <t> x0:(MOVBZload [i1] {s} p mem) o1:(SLDconst x1:(MOVBZload [i0] {s} p mem) [8]))
11785 // cond: !config.BigEndian && i1 == i0+1 && x0.Uses ==1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)
11786 // result: @mergePoint(b,x0,x1) (MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
11789 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11791 if x0.Op != OpPPC64MOVBZload {
11794 i1 := auxIntToInt32(x0.AuxInt)
11795 s := auxToSym(x0.Aux)
11799 if o1.Op != OpPPC64SLDconst || auxIntToInt64(o1.AuxInt) != 8 {
11803 if x1.Op != OpPPC64MOVBZload {
11806 i0 := auxIntToInt32(x1.AuxInt)
11807 if auxToSym(x1.Aux) != s {
11811 if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && x0.Uses == 1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)) {
11814 b = mergePoint(b, x0, x1)
11815 v0 := b.NewValue0(x1.Pos, OpPPC64MOVHBRload, t)
11817 v1 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr)
11818 v1.AuxInt = int32ToAuxInt(i0)
11819 v1.Aux = symToAux(s)
11821 v0.AddArg2(v1, mem)
11826 // match: (OR <t> s0:(SLWconst x0:(MOVBZload [i1] {s} p mem) [n1]) s1:(SLWconst x1:(MOVBZload [i0] {s} p mem) [n2]))
11827 // cond: !config.BigEndian && i1 == i0+1 && n1%8 == 0 && n2 == n1+8 && x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, s0, s1)
11828 // result: @mergePoint(b,x0,x1) (SLDconst <t> (MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [n1])
11831 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11833 if s0.Op != OpPPC64SLWconst {
11836 n1 := auxIntToInt64(s0.AuxInt)
11838 if x0.Op != OpPPC64MOVBZload {
11841 i1 := auxIntToInt32(x0.AuxInt)
11842 s := auxToSym(x0.Aux)
11846 if s1.Op != OpPPC64SLWconst {
11849 n2 := auxIntToInt64(s1.AuxInt)
11851 if x1.Op != OpPPC64MOVBZload {
11854 i0 := auxIntToInt32(x1.AuxInt)
11855 if auxToSym(x1.Aux) != s {
11859 if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && n1%8 == 0 && n2 == n1+8 && x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, s0, s1)) {
11862 b = mergePoint(b, x0, x1)
11863 v0 := b.NewValue0(x1.Pos, OpPPC64SLDconst, t)
11865 v0.AuxInt = int64ToAuxInt(n1)
11866 v1 := b.NewValue0(x1.Pos, OpPPC64MOVHBRload, t)
11867 v2 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr)
11868 v2.AuxInt = int32ToAuxInt(i0)
11869 v2.Aux = symToAux(s)
11871 v1.AddArg2(v2, mem)
11877 // match: (OR <t> s0:(SLDconst x0:(MOVBZload [i1] {s} p mem) [n1]) s1:(SLDconst x1:(MOVBZload [i0] {s} p mem) [n2]))
11878 // cond: !config.BigEndian && i1 == i0+1 && n1%8 == 0 && n2 == n1+8 && x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, s0, s1)
11879 // result: @mergePoint(b,x0,x1) (SLDconst <t> (MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [n1])
11882 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11884 if s0.Op != OpPPC64SLDconst {
11887 n1 := auxIntToInt64(s0.AuxInt)
11889 if x0.Op != OpPPC64MOVBZload {
11892 i1 := auxIntToInt32(x0.AuxInt)
11893 s := auxToSym(x0.Aux)
11897 if s1.Op != OpPPC64SLDconst {
11900 n2 := auxIntToInt64(s1.AuxInt)
11902 if x1.Op != OpPPC64MOVBZload {
11905 i0 := auxIntToInt32(x1.AuxInt)
11906 if auxToSym(x1.Aux) != s {
11910 if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && n1%8 == 0 && n2 == n1+8 && x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, s0, s1)) {
11913 b = mergePoint(b, x0, x1)
11914 v0 := b.NewValue0(x1.Pos, OpPPC64SLDconst, t)
11916 v0.AuxInt = int64ToAuxInt(n1)
11917 v1 := b.NewValue0(x1.Pos, OpPPC64MOVHBRload, t)
11918 v2 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr)
11919 v2.AuxInt = int32ToAuxInt(i0)
11920 v2.Aux = symToAux(s)
11922 v1.AddArg2(v2, mem)
11928 // match: (OR <t> s1:(SLWconst x2:(MOVBZload [i3] {s} p mem) [24]) o0:(OR <t> s0:(SLWconst x1:(MOVBZload [i2] {s} p mem) [16]) x0:(MOVHZload [i0] {s} p mem)))
11929 // cond: !config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses ==1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)
11930 // result: @mergePoint(b,x0,x1,x2) (MOVWZload <t> {s} [i0] p mem)
11933 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11935 if s1.Op != OpPPC64SLWconst || auxIntToInt64(s1.AuxInt) != 24 {
11939 if x2.Op != OpPPC64MOVBZload {
11942 i3 := auxIntToInt32(x2.AuxInt)
11943 s := auxToSym(x2.Aux)
11947 if o0.Op != OpPPC64OR || o0.Type != t {
11953 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
11955 if s0.Op != OpPPC64SLWconst || auxIntToInt64(s0.AuxInt) != 16 {
11959 if x1.Op != OpPPC64MOVBZload {
11962 i2 := auxIntToInt32(x1.AuxInt)
11963 if auxToSym(x1.Aux) != s {
11967 if p != x1.Args[0] || mem != x1.Args[1] {
11971 if x0.Op != OpPPC64MOVHZload {
11974 i0 := auxIntToInt32(x0.AuxInt)
11975 if auxToSym(x0.Aux) != s {
11979 if p != x0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) {
11982 b = mergePoint(b, x0, x1, x2)
11983 v0 := b.NewValue0(x0.Pos, OpPPC64MOVWZload, t)
11985 v0.AuxInt = int32ToAuxInt(i0)
11986 v0.Aux = symToAux(s)
11993 // match: (OR <t> s1:(SLDconst x2:(MOVBZload [i3] {s} p mem) [24]) o0:(OR <t> s0:(SLDconst x1:(MOVBZload [i2] {s} p mem) [16]) x0:(MOVHZload [i0] {s} p mem)))
11994 // cond: !config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses ==1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)
11995 // result: @mergePoint(b,x0,x1,x2) (MOVWZload <t> {s} [i0] p mem)
11998 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
12000 if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 24 {
12004 if x2.Op != OpPPC64MOVBZload {
12007 i3 := auxIntToInt32(x2.AuxInt)
12008 s := auxToSym(x2.Aux)
12012 if o0.Op != OpPPC64OR || o0.Type != t {
12018 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
12020 if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 16 {
12024 if x1.Op != OpPPC64MOVBZload {
12027 i2 := auxIntToInt32(x1.AuxInt)
12028 if auxToSym(x1.Aux) != s {
12032 if p != x1.Args[0] || mem != x1.Args[1] {
12036 if x0.Op != OpPPC64MOVHZload {
12039 i0 := auxIntToInt32(x0.AuxInt)
12040 if auxToSym(x0.Aux) != s {
12044 if p != x0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) {
12047 b = mergePoint(b, x0, x1, x2)
12048 v0 := b.NewValue0(x0.Pos, OpPPC64MOVWZload, t)
12050 v0.AuxInt = int32ToAuxInt(i0)
12051 v0.Aux = symToAux(s)
12058 // match: (OR <t> s1:(SLWconst x2:(MOVBZload [i0] {s} p mem) [24]) o0:(OR <t> s0:(SLWconst x1:(MOVBZload [i1] {s} p mem) [16]) x0:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i2] {s} p) mem)))
12059 // cond: !config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)
12060 // result: @mergePoint(b,x0,x1,x2) (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
12063 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
12065 if s1.Op != OpPPC64SLWconst || auxIntToInt64(s1.AuxInt) != 24 {
12069 if x2.Op != OpPPC64MOVBZload {
12072 i0 := auxIntToInt32(x2.AuxInt)
12073 s := auxToSym(x2.Aux)
12077 if o0.Op != OpPPC64OR || o0.Type != t {
12083 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
12085 if s0.Op != OpPPC64SLWconst || auxIntToInt64(s0.AuxInt) != 16 {
12089 if x1.Op != OpPPC64MOVBZload {
12092 i1 := auxIntToInt32(x1.AuxInt)
12093 if auxToSym(x1.Aux) != s {
12097 if p != x1.Args[0] || mem != x1.Args[1] {
12101 if x0.Op != OpPPC64MOVHBRload || x0.Type != t {
12106 if x0_0.Op != OpPPC64MOVDaddr || x0_0.Type != typ.Uintptr {
12109 i2 := auxIntToInt32(x0_0.AuxInt)
12110 if auxToSym(x0_0.Aux) != s || p != x0_0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) {
12113 b = mergePoint(b, x0, x1, x2)
12114 v0 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t)
12116 v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr)
12117 v1.AuxInt = int32ToAuxInt(i0)
12118 v1.Aux = symToAux(s)
12120 v0.AddArg2(v1, mem)
12126 // match: (OR <t> s1:(SLDconst x2:(MOVBZload [i0] {s} p mem) [24]) o0:(OR <t> s0:(SLDconst x1:(MOVBZload [i1] {s} p mem) [16]) x0:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i2] {s} p) mem)))
12127 // cond: !config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)
12128 // result: @mergePoint(b,x0,x1,x2) (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
12131 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
12133 if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 24 {
12137 if x2.Op != OpPPC64MOVBZload {
12140 i0 := auxIntToInt32(x2.AuxInt)
12141 s := auxToSym(x2.Aux)
12145 if o0.Op != OpPPC64OR || o0.Type != t {
12151 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
12153 if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 16 {
12157 if x1.Op != OpPPC64MOVBZload {
12160 i1 := auxIntToInt32(x1.AuxInt)
12161 if auxToSym(x1.Aux) != s {
12165 if p != x1.Args[0] || mem != x1.Args[1] {
12169 if x0.Op != OpPPC64MOVHBRload || x0.Type != t {
12174 if x0_0.Op != OpPPC64MOVDaddr || x0_0.Type != typ.Uintptr {
12177 i2 := auxIntToInt32(x0_0.AuxInt)
12178 if auxToSym(x0_0.Aux) != s || p != x0_0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) {
12181 b = mergePoint(b, x0, x1, x2)
12182 v0 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t)
12184 v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr)
12185 v1.AuxInt = int32ToAuxInt(i0)
12186 v1.Aux = symToAux(s)
12188 v0.AddArg2(v1, mem)
12194 // match: (OR <t> x0:(MOVBZload [i3] {s} p mem) o0:(OR <t> s0:(SLWconst x1:(MOVBZload [i2] {s} p mem) [8]) s1:(SLWconst x2:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [16])))
12195 // cond: !config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)
12196 // result: @mergePoint(b,x0,x1,x2) (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
12199 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
12201 if x0.Op != OpPPC64MOVBZload {
12204 i3 := auxIntToInt32(x0.AuxInt)
12205 s := auxToSym(x0.Aux)
12209 if o0.Op != OpPPC64OR || o0.Type != t {
12215 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
12217 if s0.Op != OpPPC64SLWconst || auxIntToInt64(s0.AuxInt) != 8 {
12221 if x1.Op != OpPPC64MOVBZload {
12224 i2 := auxIntToInt32(x1.AuxInt)
12225 if auxToSym(x1.Aux) != s {
12229 if p != x1.Args[0] || mem != x1.Args[1] {
12233 if s1.Op != OpPPC64SLWconst || auxIntToInt64(s1.AuxInt) != 16 {
12237 if x2.Op != OpPPC64MOVHBRload || x2.Type != t {
12242 if x2_0.Op != OpPPC64MOVDaddr || x2_0.Type != typ.Uintptr {
12245 i0 := auxIntToInt32(x2_0.AuxInt)
12246 if auxToSym(x2_0.Aux) != s || p != x2_0.Args[0] || mem != x2.Args[1] || !(!config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) {
12249 b = mergePoint(b, x0, x1, x2)
12250 v0 := b.NewValue0(x2.Pos, OpPPC64MOVWBRload, t)
12252 v1 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr)
12253 v1.AuxInt = int32ToAuxInt(i0)
12254 v1.Aux = symToAux(s)
12256 v0.AddArg2(v1, mem)
12262 // match: (OR <t> x0:(MOVBZload [i3] {s} p mem) o0:(OR <t> s0:(SLDconst x1:(MOVBZload [i2] {s} p mem) [8]) s1:(SLDconst x2:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [16])))
12263 // cond: !config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)
12264 // result: @mergePoint(b,x0,x1,x2) (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
12267 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
12269 if x0.Op != OpPPC64MOVBZload {
12272 i3 := auxIntToInt32(x0.AuxInt)
12273 s := auxToSym(x0.Aux)
12277 if o0.Op != OpPPC64OR || o0.Type != t {
12283 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
12285 if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 8 {
12289 if x1.Op != OpPPC64MOVBZload {
12292 i2 := auxIntToInt32(x1.AuxInt)
12293 if auxToSym(x1.Aux) != s {
12297 if p != x1.Args[0] || mem != x1.Args[1] {
12301 if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 16 {
12305 if x2.Op != OpPPC64MOVHBRload || x2.Type != t {
12310 if x2_0.Op != OpPPC64MOVDaddr || x2_0.Type != typ.Uintptr {
12313 i0 := auxIntToInt32(x2_0.AuxInt)
12314 if auxToSym(x2_0.Aux) != s || p != x2_0.Args[0] || mem != x2.Args[1] || !(!config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) {
12317 b = mergePoint(b, x0, x1, x2)
12318 v0 := b.NewValue0(x2.Pos, OpPPC64MOVWBRload, t)
12320 v1 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr)
12321 v1.AuxInt = int32ToAuxInt(i0)
12322 v1.Aux = symToAux(s)
12324 v0.AddArg2(v1, mem)
12330 // match: (OR <t> s2:(SLDconst x2:(MOVBZload [i3] {s} p mem) [32]) o0:(OR <t> s1:(SLDconst x1:(MOVBZload [i2] {s} p mem) [40]) s0:(SLDconst x0:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [48])))
12331 // cond: !config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, s2, o0)
12332 // result: @mergePoint(b,x0,x1,x2) (SLDconst <t> (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [32])
12335 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
12337 if s2.Op != OpPPC64SLDconst || auxIntToInt64(s2.AuxInt) != 32 {
12341 if x2.Op != OpPPC64MOVBZload {
12344 i3 := auxIntToInt32(x2.AuxInt)
12345 s := auxToSym(x2.Aux)
12349 if o0.Op != OpPPC64OR || o0.Type != t {
12355 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
12357 if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 40 {
12361 if x1.Op != OpPPC64MOVBZload {
12364 i2 := auxIntToInt32(x1.AuxInt)
12365 if auxToSym(x1.Aux) != s {
12369 if p != x1.Args[0] || mem != x1.Args[1] {
12373 if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 48 {
12377 if x0.Op != OpPPC64MOVHBRload || x0.Type != t {
12382 if x0_0.Op != OpPPC64MOVDaddr || x0_0.Type != typ.Uintptr {
12385 i0 := auxIntToInt32(x0_0.AuxInt)
12386 if auxToSym(x0_0.Aux) != s || p != x0_0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, s2, o0)) {
12389 b = mergePoint(b, x0, x1, x2)
12390 v0 := b.NewValue0(x0.Pos, OpPPC64SLDconst, t)
12392 v0.AuxInt = int64ToAuxInt(32)
12393 v1 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t)
12394 v2 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr)
12395 v2.AuxInt = int32ToAuxInt(i0)
12396 v2.Aux = symToAux(s)
12398 v1.AddArg2(v2, mem)
12405 // match: (OR <t> s2:(SLDconst x2:(MOVBZload [i0] {s} p mem) [56]) o0:(OR <t> s1:(SLDconst x1:(MOVBZload [i1] {s} p mem) [48]) s0:(SLDconst x0:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i2] {s} p) mem) [32])))
12406 // cond: !config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, s2, o0)
12407 // result: @mergePoint(b,x0,x1,x2) (SLDconst <t> (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [32])
12410 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
12412 if s2.Op != OpPPC64SLDconst || auxIntToInt64(s2.AuxInt) != 56 {
12416 if x2.Op != OpPPC64MOVBZload {
12419 i0 := auxIntToInt32(x2.AuxInt)
12420 s := auxToSym(x2.Aux)
12424 if o0.Op != OpPPC64OR || o0.Type != t {
12430 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
12432 if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 48 {
12436 if x1.Op != OpPPC64MOVBZload {
12439 i1 := auxIntToInt32(x1.AuxInt)
12440 if auxToSym(x1.Aux) != s {
12444 if p != x1.Args[0] || mem != x1.Args[1] {
12448 if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 32 {
12452 if x0.Op != OpPPC64MOVHBRload || x0.Type != t {
12457 if x0_0.Op != OpPPC64MOVDaddr || x0_0.Type != typ.Uintptr {
12460 i2 := auxIntToInt32(x0_0.AuxInt)
12461 if auxToSym(x0_0.Aux) != s || p != x0_0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, s2, o0)) {
12464 b = mergePoint(b, x0, x1, x2)
12465 v0 := b.NewValue0(x0.Pos, OpPPC64SLDconst, t)
12467 v0.AuxInt = int64ToAuxInt(32)
12468 v1 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t)
12469 v2 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr)
12470 v2.AuxInt = int32ToAuxInt(i0)
12471 v2.Aux = symToAux(s)
12473 v1.AddArg2(v2, mem)
12480 // match: (OR <t> s6:(SLDconst x7:(MOVBZload [i7] {s} p mem) [56]) o5:(OR <t> s5:(SLDconst x6:(MOVBZload [i6] {s} p mem) [48]) o4:(OR <t> s4:(SLDconst x5:(MOVBZload [i5] {s} p mem) [40]) o3:(OR <t> s3:(SLDconst x4:(MOVBZload [i4] {s} p mem) [32]) x0:(MOVWZload {s} [i0] p mem)))))
12481 // cond: !config.BigEndian && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x0.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses ==1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s3.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x0, x4, x5, x6, x7) != nil && clobber(x0, x4, x5, x6, x7, s3, s4, s5, s6, o3, o4, o5)
12482 // result: @mergePoint(b,x0,x4,x5,x6,x7) (MOVDload <t> {s} [i0] p mem)
12485 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
12487 if s6.Op != OpPPC64SLDconst || auxIntToInt64(s6.AuxInt) != 56 {
12491 if x7.Op != OpPPC64MOVBZload {
12494 i7 := auxIntToInt32(x7.AuxInt)
12495 s := auxToSym(x7.Aux)
12499 if o5.Op != OpPPC64OR || o5.Type != t {
12505 for _i1 := 0; _i1 <= 1; _i1, o5_0, o5_1 = _i1+1, o5_1, o5_0 {
12507 if s5.Op != OpPPC64SLDconst || auxIntToInt64(s5.AuxInt) != 48 {
12511 if x6.Op != OpPPC64MOVBZload {
12514 i6 := auxIntToInt32(x6.AuxInt)
12515 if auxToSym(x6.Aux) != s {
12519 if p != x6.Args[0] || mem != x6.Args[1] {
12523 if o4.Op != OpPPC64OR || o4.Type != t {
12529 for _i2 := 0; _i2 <= 1; _i2, o4_0, o4_1 = _i2+1, o4_1, o4_0 {
12531 if s4.Op != OpPPC64SLDconst || auxIntToInt64(s4.AuxInt) != 40 {
12535 if x5.Op != OpPPC64MOVBZload {
12538 i5 := auxIntToInt32(x5.AuxInt)
12539 if auxToSym(x5.Aux) != s {
12543 if p != x5.Args[0] || mem != x5.Args[1] {
12547 if o3.Op != OpPPC64OR || o3.Type != t {
12553 for _i3 := 0; _i3 <= 1; _i3, o3_0, o3_1 = _i3+1, o3_1, o3_0 {
12555 if s3.Op != OpPPC64SLDconst || auxIntToInt64(s3.AuxInt) != 32 {
12559 if x4.Op != OpPPC64MOVBZload {
12562 i4 := auxIntToInt32(x4.AuxInt)
12563 if auxToSym(x4.Aux) != s {
12567 if p != x4.Args[0] || mem != x4.Args[1] {
12571 if x0.Op != OpPPC64MOVWZload {
12574 i0 := auxIntToInt32(x0.AuxInt)
12575 if auxToSym(x0.Aux) != s {
12579 if p != x0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x0.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s3.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x0, x4, x5, x6, x7) != nil && clobber(x0, x4, x5, x6, x7, s3, s4, s5, s6, o3, o4, o5)) {
12582 b = mergePoint(b, x0, x4, x5, x6, x7)
12583 v0 := b.NewValue0(x0.Pos, OpPPC64MOVDload, t)
12585 v0.AuxInt = int32ToAuxInt(i0)
12586 v0.Aux = symToAux(s)
12595 // match: (OR <t> s0:(SLDconst x0:(MOVBZload [i0] {s} p mem) [56]) o0:(OR <t> s1:(SLDconst x1:(MOVBZload [i1] {s} p mem) [48]) o1:(OR <t> s2:(SLDconst x2:(MOVBZload [i2] {s} p mem) [40]) o2:(OR <t> s3:(SLDconst x3:(MOVBZload [i3] {s} p mem) [32]) x4:(MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i4] p) mem)))))
12596 // cond: !config.BigEndian && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && i4 == i0+4 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && x4.Uses == 1 && o0.Uses == 1 && o1.Uses == 1 && o2.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && mergePoint(b, x0, x1, x2, x3, x4) != nil && clobber(x0, x1, x2, x3, x4, o0, o1, o2, s0, s1, s2, s3)
12597 // result: @mergePoint(b,x0,x1,x2,x3,x4) (MOVDBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
12600 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
12602 if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 56 {
12606 if x0.Op != OpPPC64MOVBZload {
12609 i0 := auxIntToInt32(x0.AuxInt)
12610 s := auxToSym(x0.Aux)
12614 if o0.Op != OpPPC64OR || o0.Type != t {
12620 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
12622 if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 48 {
12626 if x1.Op != OpPPC64MOVBZload {
12629 i1 := auxIntToInt32(x1.AuxInt)
12630 if auxToSym(x1.Aux) != s {
12634 if p != x1.Args[0] || mem != x1.Args[1] {
12638 if o1.Op != OpPPC64OR || o1.Type != t {
12644 for _i2 := 0; _i2 <= 1; _i2, o1_0, o1_1 = _i2+1, o1_1, o1_0 {
12646 if s2.Op != OpPPC64SLDconst || auxIntToInt64(s2.AuxInt) != 40 {
12650 if x2.Op != OpPPC64MOVBZload {
12653 i2 := auxIntToInt32(x2.AuxInt)
12654 if auxToSym(x2.Aux) != s {
12658 if p != x2.Args[0] || mem != x2.Args[1] {
12662 if o2.Op != OpPPC64OR || o2.Type != t {
12668 for _i3 := 0; _i3 <= 1; _i3, o2_0, o2_1 = _i3+1, o2_1, o2_0 {
12670 if s3.Op != OpPPC64SLDconst || auxIntToInt64(s3.AuxInt) != 32 {
12674 if x3.Op != OpPPC64MOVBZload {
12677 i3 := auxIntToInt32(x3.AuxInt)
12678 if auxToSym(x3.Aux) != s {
12682 if p != x3.Args[0] || mem != x3.Args[1] {
12686 if x4.Op != OpPPC64MOVWBRload || x4.Type != t {
12691 if x4_0.Op != OpPPC64MOVDaddr || x4_0.Type != typ.Uintptr {
12694 i4 := auxIntToInt32(x4_0.AuxInt)
12695 if p != x4_0.Args[0] || mem != x4.Args[1] || !(!config.BigEndian && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && i4 == i0+4 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && x4.Uses == 1 && o0.Uses == 1 && o1.Uses == 1 && o2.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && mergePoint(b, x0, x1, x2, x3, x4) != nil && clobber(x0, x1, x2, x3, x4, o0, o1, o2, s0, s1, s2, s3)) {
12698 b = mergePoint(b, x0, x1, x2, x3, x4)
12699 v0 := b.NewValue0(x4.Pos, OpPPC64MOVDBRload, t)
12701 v1 := b.NewValue0(x4.Pos, OpPPC64MOVDaddr, typ.Uintptr)
12702 v1.AuxInt = int32ToAuxInt(i0)
12703 v1.Aux = symToAux(s)
12705 v0.AddArg2(v1, mem)
12713 // match: (OR <t> x7:(MOVBZload [i7] {s} p mem) o5:(OR <t> s6:(SLDconst x6:(MOVBZload [i6] {s} p mem) [8]) o4:(OR <t> s5:(SLDconst x5:(MOVBZload [i5] {s} p mem) [16]) o3:(OR <t> s4:(SLDconst x4:(MOVBZload [i4] {s} p mem) [24]) s0:(SLWconst x3:(MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [32])))))
12714 // cond: !config.BigEndian && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s0.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x3, x4, x5, x6, x7) != nil && clobber(x3, x4, x5, x6, x7, o3, o4, o5, s0, s4, s5, s6)
12715 // result: @mergePoint(b,x3,x4,x5,x6,x7) (MOVDBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
12718 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
12720 if x7.Op != OpPPC64MOVBZload {
12723 i7 := auxIntToInt32(x7.AuxInt)
12724 s := auxToSym(x7.Aux)
12728 if o5.Op != OpPPC64OR || o5.Type != t {
12734 for _i1 := 0; _i1 <= 1; _i1, o5_0, o5_1 = _i1+1, o5_1, o5_0 {
12736 if s6.Op != OpPPC64SLDconst || auxIntToInt64(s6.AuxInt) != 8 {
12740 if x6.Op != OpPPC64MOVBZload {
12743 i6 := auxIntToInt32(x6.AuxInt)
12744 if auxToSym(x6.Aux) != s {
12748 if p != x6.Args[0] || mem != x6.Args[1] {
12752 if o4.Op != OpPPC64OR || o4.Type != t {
12758 for _i2 := 0; _i2 <= 1; _i2, o4_0, o4_1 = _i2+1, o4_1, o4_0 {
12760 if s5.Op != OpPPC64SLDconst || auxIntToInt64(s5.AuxInt) != 16 {
12764 if x5.Op != OpPPC64MOVBZload {
12767 i5 := auxIntToInt32(x5.AuxInt)
12768 if auxToSym(x5.Aux) != s {
12772 if p != x5.Args[0] || mem != x5.Args[1] {
12776 if o3.Op != OpPPC64OR || o3.Type != t {
12782 for _i3 := 0; _i3 <= 1; _i3, o3_0, o3_1 = _i3+1, o3_1, o3_0 {
12784 if s4.Op != OpPPC64SLDconst || auxIntToInt64(s4.AuxInt) != 24 {
12788 if x4.Op != OpPPC64MOVBZload {
12791 i4 := auxIntToInt32(x4.AuxInt)
12792 if auxToSym(x4.Aux) != s {
12796 if p != x4.Args[0] || mem != x4.Args[1] {
12800 if s0.Op != OpPPC64SLWconst || auxIntToInt64(s0.AuxInt) != 32 {
12804 if x3.Op != OpPPC64MOVWBRload || x3.Type != t {
12809 if x3_0.Op != OpPPC64MOVDaddr || x3_0.Type != typ.Uintptr {
12812 i0 := auxIntToInt32(x3_0.AuxInt)
12813 if auxToSym(x3_0.Aux) != s || p != x3_0.Args[0] || mem != x3.Args[1] || !(!config.BigEndian && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s0.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x3, x4, x5, x6, x7) != nil && clobber(x3, x4, x5, x6, x7, o3, o4, o5, s0, s4, s5, s6)) {
12816 b = mergePoint(b, x3, x4, x5, x6, x7)
12817 v0 := b.NewValue0(x3.Pos, OpPPC64MOVDBRload, t)
12819 v1 := b.NewValue0(x3.Pos, OpPPC64MOVDaddr, typ.Uintptr)
12820 v1.AuxInt = int32ToAuxInt(i0)
12821 v1.Aux = symToAux(s)
12823 v0.AddArg2(v1, mem)
12831 // match: (OR <t> x7:(MOVBZload [i7] {s} p mem) o5:(OR <t> s6:(SLDconst x6:(MOVBZload [i6] {s} p mem) [8]) o4:(OR <t> s5:(SLDconst x5:(MOVBZload [i5] {s} p mem) [16]) o3:(OR <t> s4:(SLDconst x4:(MOVBZload [i4] {s} p mem) [24]) s0:(SLDconst x3:(MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [32])))))
12832 // cond: !config.BigEndian && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s0.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x3, x4, x5, x6, x7) != nil && clobber(x3, x4, x5, x6, x7, o3, o4, o5, s0, s4, s5, s6)
12833 // result: @mergePoint(b,x3,x4,x5,x6,x7) (MOVDBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
12836 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
12838 if x7.Op != OpPPC64MOVBZload {
12841 i7 := auxIntToInt32(x7.AuxInt)
12842 s := auxToSym(x7.Aux)
12846 if o5.Op != OpPPC64OR || o5.Type != t {
12852 for _i1 := 0; _i1 <= 1; _i1, o5_0, o5_1 = _i1+1, o5_1, o5_0 {
12854 if s6.Op != OpPPC64SLDconst || auxIntToInt64(s6.AuxInt) != 8 {
12858 if x6.Op != OpPPC64MOVBZload {
12861 i6 := auxIntToInt32(x6.AuxInt)
12862 if auxToSym(x6.Aux) != s {
12866 if p != x6.Args[0] || mem != x6.Args[1] {
12870 if o4.Op != OpPPC64OR || o4.Type != t {
12876 for _i2 := 0; _i2 <= 1; _i2, o4_0, o4_1 = _i2+1, o4_1, o4_0 {
12878 if s5.Op != OpPPC64SLDconst || auxIntToInt64(s5.AuxInt) != 16 {
12882 if x5.Op != OpPPC64MOVBZload {
12885 i5 := auxIntToInt32(x5.AuxInt)
12886 if auxToSym(x5.Aux) != s {
12890 if p != x5.Args[0] || mem != x5.Args[1] {
12894 if o3.Op != OpPPC64OR || o3.Type != t {
12900 for _i3 := 0; _i3 <= 1; _i3, o3_0, o3_1 = _i3+1, o3_1, o3_0 {
12902 if s4.Op != OpPPC64SLDconst || auxIntToInt64(s4.AuxInt) != 24 {
12906 if x4.Op != OpPPC64MOVBZload {
12909 i4 := auxIntToInt32(x4.AuxInt)
12910 if auxToSym(x4.Aux) != s {
12914 if p != x4.Args[0] || mem != x4.Args[1] {
12918 if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 32 {
12922 if x3.Op != OpPPC64MOVWBRload || x3.Type != t {
12927 if x3_0.Op != OpPPC64MOVDaddr || x3_0.Type != typ.Uintptr {
12930 i0 := auxIntToInt32(x3_0.AuxInt)
12931 if auxToSym(x3_0.Aux) != s || p != x3_0.Args[0] || mem != x3.Args[1] || !(!config.BigEndian && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s0.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x3, x4, x5, x6, x7) != nil && clobber(x3, x4, x5, x6, x7, o3, o4, o5, s0, s4, s5, s6)) {
12934 b = mergePoint(b, x3, x4, x5, x6, x7)
12935 v0 := b.NewValue0(x3.Pos, OpPPC64MOVDBRload, t)
12937 v1 := b.NewValue0(x3.Pos, OpPPC64MOVDaddr, typ.Uintptr)
12938 v1.AuxInt = int32ToAuxInt(i0)
12939 v1.Aux = symToAux(s)
12941 v0.AddArg2(v1, mem)
12951 func rewriteValuePPC64_OpPPC64ORN(v *Value) bool {
12954 // match: (ORN x (MOVDconst [-1]))
12958 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
12964 // match: (ORN (MOVDconst [c]) (MOVDconst [d]))
12965 // result: (MOVDconst [c|^d])
12967 if v_0.Op != OpPPC64MOVDconst {
12970 c := auxIntToInt64(v_0.AuxInt)
12971 if v_1.Op != OpPPC64MOVDconst {
12974 d := auxIntToInt64(v_1.AuxInt)
12975 v.reset(OpPPC64MOVDconst)
12976 v.AuxInt = int64ToAuxInt(c | ^d)
12981 func rewriteValuePPC64_OpPPC64ORconst(v *Value) bool {
12983 // match: (ORconst [c] (ORconst [d] x))
12984 // result: (ORconst [c|d] x)
12986 c := auxIntToInt64(v.AuxInt)
12987 if v_0.Op != OpPPC64ORconst {
12990 d := auxIntToInt64(v_0.AuxInt)
12992 v.reset(OpPPC64ORconst)
12993 v.AuxInt = int64ToAuxInt(c | d)
12997 // match: (ORconst [-1] _)
12998 // result: (MOVDconst [-1])
13000 if auxIntToInt64(v.AuxInt) != -1 {
13003 v.reset(OpPPC64MOVDconst)
13004 v.AuxInt = int64ToAuxInt(-1)
13007 // match: (ORconst [0] x)
13010 if auxIntToInt64(v.AuxInt) != 0 {
13019 func rewriteValuePPC64_OpPPC64ROTL(v *Value) bool {
13022 // match: (ROTL x (MOVDconst [c]))
13023 // result: (ROTLconst x [c&63])
13026 if v_1.Op != OpPPC64MOVDconst {
13029 c := auxIntToInt64(v_1.AuxInt)
13030 v.reset(OpPPC64ROTLconst)
13031 v.AuxInt = int64ToAuxInt(c & 63)
13037 func rewriteValuePPC64_OpPPC64ROTLW(v *Value) bool {
13040 // match: (ROTLW x (MOVDconst [c]))
13041 // result: (ROTLWconst x [c&31])
13044 if v_1.Op != OpPPC64MOVDconst {
13047 c := auxIntToInt64(v_1.AuxInt)
13048 v.reset(OpPPC64ROTLWconst)
13049 v.AuxInt = int64ToAuxInt(c & 31)
13055 func rewriteValuePPC64_OpPPC64ROTLWconst(v *Value) bool {
13057 // match: (ROTLWconst [r] (AND (MOVDconst [m]) x))
13058 // cond: isPPC64WordRotateMask(m)
13059 // result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
13061 r := auxIntToInt64(v.AuxInt)
13062 if v_0.Op != OpPPC64AND {
13066 v_0_0 := v_0.Args[0]
13067 v_0_1 := v_0.Args[1]
13068 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
13069 if v_0_0.Op != OpPPC64MOVDconst {
13072 m := auxIntToInt64(v_0_0.AuxInt)
13074 if !(isPPC64WordRotateMask(m)) {
13077 v.reset(OpPPC64RLWINM)
13078 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
13084 // match: (ROTLWconst [r] (ANDconst [m] x))
13085 // cond: isPPC64WordRotateMask(m)
13086 // result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
13088 r := auxIntToInt64(v.AuxInt)
13089 if v_0.Op != OpPPC64ANDconst {
13092 m := auxIntToInt64(v_0.AuxInt)
13094 if !(isPPC64WordRotateMask(m)) {
13097 v.reset(OpPPC64RLWINM)
13098 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
13104 func rewriteValuePPC64_OpPPC64SLD(v *Value) bool {
13107 // match: (SLD x (MOVDconst [c]))
13108 // result: (SLDconst [c&63 | (c>>6&1*63)] x)
13111 if v_1.Op != OpPPC64MOVDconst {
13114 c := auxIntToInt64(v_1.AuxInt)
13115 v.reset(OpPPC64SLDconst)
13116 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
13122 func rewriteValuePPC64_OpPPC64SLDconst(v *Value) bool {
13124 // match: (SLDconst [l] (SRWconst [r] x))
13125 // cond: mergePPC64SldiSrw(l,r) != 0
13126 // result: (RLWINM [mergePPC64SldiSrw(l,r)] x)
13128 l := auxIntToInt64(v.AuxInt)
13129 if v_0.Op != OpPPC64SRWconst {
13132 r := auxIntToInt64(v_0.AuxInt)
13134 if !(mergePPC64SldiSrw(l, r) != 0) {
13137 v.reset(OpPPC64RLWINM)
13138 v.AuxInt = int64ToAuxInt(mergePPC64SldiSrw(l, r))
13142 // match: (SLDconst [c] z:(MOVBZreg x))
13143 // cond: c < 8 && z.Uses == 1
13144 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,56,63,64)] x)
13146 c := auxIntToInt64(v.AuxInt)
13148 if z.Op != OpPPC64MOVBZreg {
13152 if !(c < 8 && z.Uses == 1) {
13155 v.reset(OpPPC64CLRLSLDI)
13156 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 56, 63, 64))
13160 // match: (SLDconst [c] z:(MOVHZreg x))
13161 // cond: c < 16 && z.Uses == 1
13162 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,48,63,64)] x)
13164 c := auxIntToInt64(v.AuxInt)
13166 if z.Op != OpPPC64MOVHZreg {
13170 if !(c < 16 && z.Uses == 1) {
13173 v.reset(OpPPC64CLRLSLDI)
13174 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 48, 63, 64))
13178 // match: (SLDconst [c] z:(MOVWZreg x))
13179 // cond: c < 32 && z.Uses == 1
13180 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,32,63,64)] x)
13182 c := auxIntToInt64(v.AuxInt)
13184 if z.Op != OpPPC64MOVWZreg {
13188 if !(c < 32 && z.Uses == 1) {
13191 v.reset(OpPPC64CLRLSLDI)
13192 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32, 63, 64))
13196 // match: (SLDconst [c] z:(ANDconst [d] x))
13197 // cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))
13198 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
13200 c := auxIntToInt64(v.AuxInt)
13202 if z.Op != OpPPC64ANDconst {
13205 d := auxIntToInt64(z.AuxInt)
13207 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
13210 v.reset(OpPPC64CLRLSLDI)
13211 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
13215 // match: (SLDconst [c] z:(AND (MOVDconst [d]) x))
13216 // cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(64-getPPC64ShiftMaskLength(d))
13217 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
13219 c := auxIntToInt64(v.AuxInt)
13221 if z.Op != OpPPC64AND {
13227 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
13228 if z_0.Op != OpPPC64MOVDconst {
13231 d := auxIntToInt64(z_0.AuxInt)
13233 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
13236 v.reset(OpPPC64CLRLSLDI)
13237 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
13243 // match: (SLDconst [c] z:(MOVWreg x))
13244 // cond: c < 32 && objabi.GOPPC64 >= 9
13245 // result: (EXTSWSLconst [c] x)
13247 c := auxIntToInt64(v.AuxInt)
13249 if z.Op != OpPPC64MOVWreg {
13253 if !(c < 32 && objabi.GOPPC64 >= 9) {
13256 v.reset(OpPPC64EXTSWSLconst)
13257 v.AuxInt = int64ToAuxInt(c)
13263 func rewriteValuePPC64_OpPPC64SLW(v *Value) bool {
13266 // match: (SLW x (MOVDconst [c]))
13267 // result: (SLWconst [c&31 | (c>>5&1*31)] x)
13270 if v_1.Op != OpPPC64MOVDconst {
13273 c := auxIntToInt64(v_1.AuxInt)
13274 v.reset(OpPPC64SLWconst)
13275 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
13281 func rewriteValuePPC64_OpPPC64SLWconst(v *Value) bool {
13283 // match: (SLWconst [c] z:(MOVBZreg x))
13284 // cond: z.Uses == 1 && c < 8
13285 // result: (CLRLSLWI [newPPC64ShiftAuxInt(c,24,31,32)] x)
13287 c := auxIntToInt64(v.AuxInt)
13289 if z.Op != OpPPC64MOVBZreg {
13293 if !(z.Uses == 1 && c < 8) {
13296 v.reset(OpPPC64CLRLSLWI)
13297 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 24, 31, 32))
13301 // match: (SLWconst [c] z:(MOVHZreg x))
13302 // cond: z.Uses == 1 && c < 16
13303 // result: (CLRLSLWI [newPPC64ShiftAuxInt(c,16,31,32)] x)
13305 c := auxIntToInt64(v.AuxInt)
13307 if z.Op != OpPPC64MOVHZreg {
13311 if !(z.Uses == 1 && c < 16) {
13314 v.reset(OpPPC64CLRLSLWI)
13315 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 16, 31, 32))
13319 // match: (SLWconst [c] z:(ANDconst [d] x))
13320 // cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
13321 // result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
13323 c := auxIntToInt64(v.AuxInt)
13325 if z.Op != OpPPC64ANDconst {
13328 d := auxIntToInt64(z.AuxInt)
13330 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
13333 v.reset(OpPPC64CLRLSLWI)
13334 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
13338 // match: (SLWconst [c] z:(AND (MOVDconst [d]) x))
13339 // cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
13340 // result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
13342 c := auxIntToInt64(v.AuxInt)
13344 if z.Op != OpPPC64AND {
13350 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
13351 if z_0.Op != OpPPC64MOVDconst {
13354 d := auxIntToInt64(z_0.AuxInt)
13356 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
13359 v.reset(OpPPC64CLRLSLWI)
13360 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
13366 // match: (SLWconst [c] z:(MOVWreg x))
13367 // cond: c < 32 && objabi.GOPPC64 >= 9
13368 // result: (EXTSWSLconst [c] x)
13370 c := auxIntToInt64(v.AuxInt)
13372 if z.Op != OpPPC64MOVWreg {
13376 if !(c < 32 && objabi.GOPPC64 >= 9) {
13379 v.reset(OpPPC64EXTSWSLconst)
13380 v.AuxInt = int64ToAuxInt(c)
13386 func rewriteValuePPC64_OpPPC64SRAD(v *Value) bool {
13389 // match: (SRAD x (MOVDconst [c]))
13390 // result: (SRADconst [c&63 | (c>>6&1*63)] x)
13393 if v_1.Op != OpPPC64MOVDconst {
13396 c := auxIntToInt64(v_1.AuxInt)
13397 v.reset(OpPPC64SRADconst)
13398 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
13404 func rewriteValuePPC64_OpPPC64SRAW(v *Value) bool {
13407 // match: (SRAW x (MOVDconst [c]))
13408 // result: (SRAWconst [c&31 | (c>>5&1*31)] x)
13411 if v_1.Op != OpPPC64MOVDconst {
13414 c := auxIntToInt64(v_1.AuxInt)
13415 v.reset(OpPPC64SRAWconst)
13416 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
13422 func rewriteValuePPC64_OpPPC64SRD(v *Value) bool {
13425 // match: (SRD x (MOVDconst [c]))
13426 // result: (SRDconst [c&63 | (c>>6&1*63)] x)
13429 if v_1.Op != OpPPC64MOVDconst {
13432 c := auxIntToInt64(v_1.AuxInt)
13433 v.reset(OpPPC64SRDconst)
13434 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
13440 func rewriteValuePPC64_OpPPC64SRW(v *Value) bool {
13443 // match: (SRW x (MOVDconst [c]))
13444 // result: (SRWconst [c&31 | (c>>5&1*31)] x)
13447 if v_1.Op != OpPPC64MOVDconst {
13450 c := auxIntToInt64(v_1.AuxInt)
13451 v.reset(OpPPC64SRWconst)
13452 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
13458 func rewriteValuePPC64_OpPPC64SRWconst(v *Value) bool {
13460 // match: (SRWconst (ANDconst [m] x) [s])
13461 // cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
13462 // result: (MOVDconst [0])
13464 s := auxIntToInt64(v.AuxInt)
13465 if v_0.Op != OpPPC64ANDconst {
13468 m := auxIntToInt64(v_0.AuxInt)
13469 if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
13472 v.reset(OpPPC64MOVDconst)
13473 v.AuxInt = int64ToAuxInt(0)
13476 // match: (SRWconst (ANDconst [m] x) [s])
13477 // cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
13478 // result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
13480 s := auxIntToInt64(v.AuxInt)
13481 if v_0.Op != OpPPC64ANDconst {
13484 m := auxIntToInt64(v_0.AuxInt)
13486 if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
13489 v.reset(OpPPC64RLWINM)
13490 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
13494 // match: (SRWconst (AND (MOVDconst [m]) x) [s])
13495 // cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
13496 // result: (MOVDconst [0])
13498 s := auxIntToInt64(v.AuxInt)
13499 if v_0.Op != OpPPC64AND {
13503 v_0_0 := v_0.Args[0]
13504 v_0_1 := v_0.Args[1]
13505 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
13506 if v_0_0.Op != OpPPC64MOVDconst {
13509 m := auxIntToInt64(v_0_0.AuxInt)
13510 if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
13513 v.reset(OpPPC64MOVDconst)
13514 v.AuxInt = int64ToAuxInt(0)
13519 // match: (SRWconst (AND (MOVDconst [m]) x) [s])
13520 // cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
13521 // result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
13523 s := auxIntToInt64(v.AuxInt)
13524 if v_0.Op != OpPPC64AND {
13528 v_0_0 := v_0.Args[0]
13529 v_0_1 := v_0.Args[1]
13530 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
13531 if v_0_0.Op != OpPPC64MOVDconst {
13534 m := auxIntToInt64(v_0_0.AuxInt)
13536 if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
13539 v.reset(OpPPC64RLWINM)
13540 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
13548 func rewriteValuePPC64_OpPPC64SUB(v *Value) bool {
13551 // match: (SUB x (MOVDconst [c]))
13552 // cond: is32Bit(-c)
13553 // result: (ADDconst [-c] x)
13556 if v_1.Op != OpPPC64MOVDconst {
13559 c := auxIntToInt64(v_1.AuxInt)
13560 if !(is32Bit(-c)) {
13563 v.reset(OpPPC64ADDconst)
13564 v.AuxInt = int64ToAuxInt(-c)
13568 // match: (SUB (MOVDconst [c]) x)
13569 // cond: is32Bit(c)
13570 // result: (SUBFCconst [c] x)
13572 if v_0.Op != OpPPC64MOVDconst {
13575 c := auxIntToInt64(v_0.AuxInt)
13580 v.reset(OpPPC64SUBFCconst)
13581 v.AuxInt = int64ToAuxInt(c)
13587 func rewriteValuePPC64_OpPPC64SUBFCconst(v *Value) bool {
13589 // match: (SUBFCconst [c] (NEG x))
13590 // result: (ADDconst [c] x)
13592 c := auxIntToInt64(v.AuxInt)
13593 if v_0.Op != OpPPC64NEG {
13597 v.reset(OpPPC64ADDconst)
13598 v.AuxInt = int64ToAuxInt(c)
13602 // match: (SUBFCconst [c] (SUBFCconst [d] x))
13603 // cond: is32Bit(c-d)
13604 // result: (ADDconst [c-d] x)
13606 c := auxIntToInt64(v.AuxInt)
13607 if v_0.Op != OpPPC64SUBFCconst {
13610 d := auxIntToInt64(v_0.AuxInt)
13612 if !(is32Bit(c - d)) {
13615 v.reset(OpPPC64ADDconst)
13616 v.AuxInt = int64ToAuxInt(c - d)
13620 // match: (SUBFCconst [0] x)
13623 if auxIntToInt64(v.AuxInt) != 0 {
13627 v.reset(OpPPC64NEG)
13633 func rewriteValuePPC64_OpPPC64XOR(v *Value) bool {
13637 typ := &b.Func.Config.Types
13638 // match: (XOR (SLDconst x [c]) (SRDconst x [d]))
13640 // result: (ROTLconst [c] x)
13642 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13643 if v_0.Op != OpPPC64SLDconst {
13646 c := auxIntToInt64(v_0.AuxInt)
13648 if v_1.Op != OpPPC64SRDconst {
13651 d := auxIntToInt64(v_1.AuxInt)
13652 if x != v_1.Args[0] || !(d == 64-c) {
13655 v.reset(OpPPC64ROTLconst)
13656 v.AuxInt = int64ToAuxInt(c)
13662 // match: (XOR (SLWconst x [c]) (SRWconst x [d]))
13664 // result: (ROTLWconst [c] x)
13666 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13667 if v_0.Op != OpPPC64SLWconst {
13670 c := auxIntToInt64(v_0.AuxInt)
13672 if v_1.Op != OpPPC64SRWconst {
13675 d := auxIntToInt64(v_1.AuxInt)
13676 if x != v_1.Args[0] || !(d == 32-c) {
13679 v.reset(OpPPC64ROTLWconst)
13680 v.AuxInt = int64ToAuxInt(c)
13686 // match: (XOR (SLD x (ANDconst <typ.Int64> [63] y)) (SRD x (SUB <typ.UInt> (MOVDconst [64]) (ANDconst <typ.UInt> [63] y))))
13687 // result: (ROTL x y)
13689 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13690 if v_0.Op != OpPPC64SLD {
13695 v_0_1 := v_0.Args[1]
13696 if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int64 || auxIntToInt64(v_0_1.AuxInt) != 63 {
13700 if v_1.Op != OpPPC64SRD {
13704 if x != v_1.Args[0] {
13707 v_1_1 := v_1.Args[1]
13708 if v_1_1.Op != OpPPC64SUB || v_1_1.Type != typ.UInt {
13712 v_1_1_0 := v_1_1.Args[0]
13713 if v_1_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1_0.AuxInt) != 64 {
13716 v_1_1_1 := v_1_1.Args[1]
13717 if v_1_1_1.Op != OpPPC64ANDconst || v_1_1_1.Type != typ.UInt || auxIntToInt64(v_1_1_1.AuxInt) != 63 || y != v_1_1_1.Args[0] {
13720 v.reset(OpPPC64ROTL)
13726 // match: (XOR (SLD x (ANDconst <typ.Int64> [63] y)) (SRD x (SUBFCconst <typ.UInt> [64] (ANDconst <typ.UInt> [63] y))))
13727 // result: (ROTL x y)
13729 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13730 if v_0.Op != OpPPC64SLD {
13735 v_0_1 := v_0.Args[1]
13736 if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int64 || auxIntToInt64(v_0_1.AuxInt) != 63 {
13740 if v_1.Op != OpPPC64SRD {
13744 if x != v_1.Args[0] {
13747 v_1_1 := v_1.Args[1]
13748 if v_1_1.Op != OpPPC64SUBFCconst || v_1_1.Type != typ.UInt || auxIntToInt64(v_1_1.AuxInt) != 64 {
13751 v_1_1_0 := v_1_1.Args[0]
13752 if v_1_1_0.Op != OpPPC64ANDconst || v_1_1_0.Type != typ.UInt || auxIntToInt64(v_1_1_0.AuxInt) != 63 || y != v_1_1_0.Args[0] {
13755 v.reset(OpPPC64ROTL)
13761 // match: (XOR (SLW x (ANDconst <typ.Int32> [31] y)) (SRW x (SUBFCconst <typ.UInt> [32] (ANDconst <typ.UInt> [31] y))))
13762 // result: (ROTLW x y)
13764 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13765 if v_0.Op != OpPPC64SLW {
13770 v_0_1 := v_0.Args[1]
13771 if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int32 || auxIntToInt64(v_0_1.AuxInt) != 31 {
13775 if v_1.Op != OpPPC64SRW {
13779 if x != v_1.Args[0] {
13782 v_1_1 := v_1.Args[1]
13783 if v_1_1.Op != OpPPC64SUBFCconst || v_1_1.Type != typ.UInt || auxIntToInt64(v_1_1.AuxInt) != 32 {
13786 v_1_1_0 := v_1_1.Args[0]
13787 if v_1_1_0.Op != OpPPC64ANDconst || v_1_1_0.Type != typ.UInt || auxIntToInt64(v_1_1_0.AuxInt) != 31 || y != v_1_1_0.Args[0] {
13790 v.reset(OpPPC64ROTLW)
13796 // match: (XOR (SLW x (ANDconst <typ.Int32> [31] y)) (SRW x (SUB <typ.UInt> (MOVDconst [32]) (ANDconst <typ.UInt> [31] y))))
13797 // result: (ROTLW x y)
13799 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13800 if v_0.Op != OpPPC64SLW {
13805 v_0_1 := v_0.Args[1]
13806 if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int32 || auxIntToInt64(v_0_1.AuxInt) != 31 {
13810 if v_1.Op != OpPPC64SRW {
13814 if x != v_1.Args[0] {
13817 v_1_1 := v_1.Args[1]
13818 if v_1_1.Op != OpPPC64SUB || v_1_1.Type != typ.UInt {
13822 v_1_1_0 := v_1_1.Args[0]
13823 if v_1_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1_0.AuxInt) != 32 {
13826 v_1_1_1 := v_1_1.Args[1]
13827 if v_1_1_1.Op != OpPPC64ANDconst || v_1_1_1.Type != typ.UInt || auxIntToInt64(v_1_1_1.AuxInt) != 31 || y != v_1_1_1.Args[0] {
13830 v.reset(OpPPC64ROTLW)
13836 // match: (XOR (MOVDconst [c]) (MOVDconst [d]))
13837 // result: (MOVDconst [c^d])
13839 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13840 if v_0.Op != OpPPC64MOVDconst {
13843 c := auxIntToInt64(v_0.AuxInt)
13844 if v_1.Op != OpPPC64MOVDconst {
13847 d := auxIntToInt64(v_1.AuxInt)
13848 v.reset(OpPPC64MOVDconst)
13849 v.AuxInt = int64ToAuxInt(c ^ d)
13854 // match: (XOR x (MOVDconst [c]))
13855 // cond: isU32Bit(c)
13856 // result: (XORconst [c] x)
13858 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13860 if v_1.Op != OpPPC64MOVDconst {
13863 c := auxIntToInt64(v_1.AuxInt)
13864 if !(isU32Bit(c)) {
13867 v.reset(OpPPC64XORconst)
13868 v.AuxInt = int64ToAuxInt(c)
13876 func rewriteValuePPC64_OpPPC64XORconst(v *Value) bool {
13878 // match: (XORconst [c] (XORconst [d] x))
13879 // result: (XORconst [c^d] x)
13881 c := auxIntToInt64(v.AuxInt)
13882 if v_0.Op != OpPPC64XORconst {
13885 d := auxIntToInt64(v_0.AuxInt)
13887 v.reset(OpPPC64XORconst)
13888 v.AuxInt = int64ToAuxInt(c ^ d)
13892 // match: (XORconst [0] x)
13895 if auxIntToInt64(v.AuxInt) != 0 {
13904 func rewriteValuePPC64_OpPanicBounds(v *Value) bool {
13908 // match: (PanicBounds [kind] x y mem)
13909 // cond: boundsABI(kind) == 0
13910 // result: (LoweredPanicBoundsA [kind] x y mem)
13912 kind := auxIntToInt64(v.AuxInt)
13916 if !(boundsABI(kind) == 0) {
13919 v.reset(OpPPC64LoweredPanicBoundsA)
13920 v.AuxInt = int64ToAuxInt(kind)
13921 v.AddArg3(x, y, mem)
13924 // match: (PanicBounds [kind] x y mem)
13925 // cond: boundsABI(kind) == 1
13926 // result: (LoweredPanicBoundsB [kind] x y mem)
13928 kind := auxIntToInt64(v.AuxInt)
13932 if !(boundsABI(kind) == 1) {
13935 v.reset(OpPPC64LoweredPanicBoundsB)
13936 v.AuxInt = int64ToAuxInt(kind)
13937 v.AddArg3(x, y, mem)
13940 // match: (PanicBounds [kind] x y mem)
13941 // cond: boundsABI(kind) == 2
13942 // result: (LoweredPanicBoundsC [kind] x y mem)
13944 kind := auxIntToInt64(v.AuxInt)
13948 if !(boundsABI(kind) == 2) {
13951 v.reset(OpPPC64LoweredPanicBoundsC)
13952 v.AuxInt = int64ToAuxInt(kind)
13953 v.AddArg3(x, y, mem)
13958 func rewriteValuePPC64_OpPopCount16(v *Value) bool {
13961 typ := &b.Func.Config.Types
13962 // match: (PopCount16 x)
13963 // result: (POPCNTW (MOVHZreg x))
13966 v.reset(OpPPC64POPCNTW)
13967 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13973 func rewriteValuePPC64_OpPopCount32(v *Value) bool {
13976 typ := &b.Func.Config.Types
13977 // match: (PopCount32 x)
13978 // result: (POPCNTW (MOVWZreg x))
13981 v.reset(OpPPC64POPCNTW)
13982 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
13988 func rewriteValuePPC64_OpPopCount8(v *Value) bool {
13991 typ := &b.Func.Config.Types
13992 // match: (PopCount8 x)
13993 // result: (POPCNTB (MOVBZreg x))
13996 v.reset(OpPPC64POPCNTB)
13997 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14003 func rewriteValuePPC64_OpRotateLeft16(v *Value) bool {
14007 typ := &b.Func.Config.Types
14008 // match: (RotateLeft16 <t> x (MOVDconst [c]))
14009 // result: (Or16 (Lsh16x64 <t> x (MOVDconst [c&15])) (Rsh16Ux64 <t> x (MOVDconst [-c&15])))
14013 if v_1.Op != OpPPC64MOVDconst {
14016 c := auxIntToInt64(v_1.AuxInt)
14018 v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
14019 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14020 v1.AuxInt = int64ToAuxInt(c & 15)
14022 v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
14023 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14024 v3.AuxInt = int64ToAuxInt(-c & 15)
14031 func rewriteValuePPC64_OpRotateLeft32(v *Value) bool {
14034 // match: (RotateLeft32 x (MOVDconst [c]))
14035 // result: (ROTLWconst [c&31] x)
14038 if v_1.Op != OpPPC64MOVDconst {
14041 c := auxIntToInt64(v_1.AuxInt)
14042 v.reset(OpPPC64ROTLWconst)
14043 v.AuxInt = int64ToAuxInt(c & 31)
14047 // match: (RotateLeft32 x y)
14048 // result: (ROTLW x y)
14052 v.reset(OpPPC64ROTLW)
14057 func rewriteValuePPC64_OpRotateLeft64(v *Value) bool {
14060 // match: (RotateLeft64 x (MOVDconst [c]))
14061 // result: (ROTLconst [c&63] x)
14064 if v_1.Op != OpPPC64MOVDconst {
14067 c := auxIntToInt64(v_1.AuxInt)
14068 v.reset(OpPPC64ROTLconst)
14069 v.AuxInt = int64ToAuxInt(c & 63)
14073 // match: (RotateLeft64 x y)
14074 // result: (ROTL x y)
14078 v.reset(OpPPC64ROTL)
14083 func rewriteValuePPC64_OpRotateLeft8(v *Value) bool {
14087 typ := &b.Func.Config.Types
14088 // match: (RotateLeft8 <t> x (MOVDconst [c]))
14089 // result: (Or8 (Lsh8x64 <t> x (MOVDconst [c&7])) (Rsh8Ux64 <t> x (MOVDconst [-c&7])))
14093 if v_1.Op != OpPPC64MOVDconst {
14096 c := auxIntToInt64(v_1.AuxInt)
14098 v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
14099 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14100 v1.AuxInt = int64ToAuxInt(c & 7)
14102 v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
14103 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14104 v3.AuxInt = int64ToAuxInt(-c & 7)
14111 func rewriteValuePPC64_OpRsh16Ux16(v *Value) bool {
14115 typ := &b.Func.Config.Types
14116 // match: (Rsh16Ux16 x y)
14117 // cond: shiftIsBounded(v)
14118 // result: (SRW (MOVHZreg x) y)
14122 if !(shiftIsBounded(v)) {
14125 v.reset(OpPPC64SRW)
14126 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
14131 // match: (Rsh16Ux16 x y)
14132 // result: (SRW (ZeroExt16to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [16]))))
14136 v.reset(OpPPC64SRW)
14137 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
14139 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
14140 v1.AuxInt = int32ToAuxInt(0)
14141 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14142 v2.AuxInt = int64ToAuxInt(-1)
14143 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
14144 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
14146 v5 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14147 v5.AuxInt = int64ToAuxInt(16)
14149 v1.AddArg3(y, v2, v3)
14154 func rewriteValuePPC64_OpRsh16Ux32(v *Value) bool {
14158 typ := &b.Func.Config.Types
14159 // match: (Rsh16Ux32 x (MOVDconst [c]))
14160 // cond: uint32(c) < 16
14161 // result: (SRWconst (ZeroExt16to32 x) [c&15])
14164 if v_1.Op != OpPPC64MOVDconst {
14167 c := auxIntToInt64(v_1.AuxInt)
14168 if !(uint32(c) < 16) {
14171 v.reset(OpPPC64SRWconst)
14172 v.AuxInt = int64ToAuxInt(c & 15)
14173 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
14178 // match: (Rsh16Ux32 x y)
14179 // cond: shiftIsBounded(v)
14180 // result: (SRW (MOVHZreg x) y)
14184 if !(shiftIsBounded(v)) {
14187 v.reset(OpPPC64SRW)
14188 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
14193 // match: (Rsh16Ux32 x y)
14194 // result: (SRW (ZeroExt16to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [16]))))
14198 v.reset(OpPPC64SRW)
14199 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
14201 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
14202 v1.AuxInt = int32ToAuxInt(0)
14203 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14204 v2.AuxInt = int64ToAuxInt(-1)
14205 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
14206 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14207 v4.AuxInt = int64ToAuxInt(16)
14209 v1.AddArg3(y, v2, v3)
14214 func rewriteValuePPC64_OpRsh16Ux64(v *Value) bool {
14218 typ := &b.Func.Config.Types
14219 // match: (Rsh16Ux64 _ (MOVDconst [c]))
14220 // cond: uint64(c) >= 16
14221 // result: (MOVDconst [0])
14223 if v_1.Op != OpPPC64MOVDconst {
14226 c := auxIntToInt64(v_1.AuxInt)
14227 if !(uint64(c) >= 16) {
14230 v.reset(OpPPC64MOVDconst)
14231 v.AuxInt = int64ToAuxInt(0)
14234 // match: (Rsh16Ux64 x (MOVDconst [c]))
14235 // cond: uint64(c) < 16
14236 // result: (SRWconst (ZeroExt16to32 x) [c])
14239 if v_1.Op != OpPPC64MOVDconst {
14242 c := auxIntToInt64(v_1.AuxInt)
14243 if !(uint64(c) < 16) {
14246 v.reset(OpPPC64SRWconst)
14247 v.AuxInt = int64ToAuxInt(c)
14248 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
14253 // match: (Rsh16Ux64 x y)
14254 // cond: shiftIsBounded(v)
14255 // result: (SRW (MOVHZreg x) y)
14259 if !(shiftIsBounded(v)) {
14262 v.reset(OpPPC64SRW)
14263 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
14268 // match: (Rsh16Ux64 x y)
14269 // result: (SRW (ZeroExt16to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [16]))))
14273 v.reset(OpPPC64SRW)
14274 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
14276 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
14277 v1.AuxInt = int32ToAuxInt(0)
14278 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14279 v2.AuxInt = int64ToAuxInt(-1)
14280 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
14281 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14282 v4.AuxInt = int64ToAuxInt(16)
14284 v1.AddArg3(y, v2, v3)
14289 func rewriteValuePPC64_OpRsh16Ux8(v *Value) bool {
14293 typ := &b.Func.Config.Types
14294 // match: (Rsh16Ux8 x y)
14295 // cond: shiftIsBounded(v)
14296 // result: (SRW (MOVHZreg x) y)
14300 if !(shiftIsBounded(v)) {
14303 v.reset(OpPPC64SRW)
14304 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
14309 // match: (Rsh16Ux8 x y)
14310 // result: (SRW (ZeroExt16to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [16]))))
14314 v.reset(OpPPC64SRW)
14315 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
14317 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
14318 v1.AuxInt = int32ToAuxInt(0)
14319 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14320 v2.AuxInt = int64ToAuxInt(-1)
14321 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
14322 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
14324 v5 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14325 v5.AuxInt = int64ToAuxInt(16)
14327 v1.AddArg3(y, v2, v3)
14332 func rewriteValuePPC64_OpRsh16x16(v *Value) bool {
14336 typ := &b.Func.Config.Types
14337 // match: (Rsh16x16 x y)
14338 // cond: shiftIsBounded(v)
14339 // result: (SRAW (MOVHreg x) y)
14343 if !(shiftIsBounded(v)) {
14346 v.reset(OpPPC64SRAW)
14347 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
14352 // match: (Rsh16x16 x y)
14353 // result: (SRAW (SignExt16to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [16]))))
14357 v.reset(OpPPC64SRAW)
14358 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
14360 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
14361 v1.AuxInt = int32ToAuxInt(0)
14362 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14363 v2.AuxInt = int64ToAuxInt(-1)
14364 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
14365 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
14367 v5 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14368 v5.AuxInt = int64ToAuxInt(16)
14370 v1.AddArg3(y, v2, v3)
14375 func rewriteValuePPC64_OpRsh16x32(v *Value) bool {
14379 typ := &b.Func.Config.Types
14380 // match: (Rsh16x32 x (MOVDconst [c]))
14381 // cond: uint32(c) < 16
14382 // result: (SRAWconst (SignExt16to32 x) [c&15])
14385 if v_1.Op != OpPPC64MOVDconst {
14388 c := auxIntToInt64(v_1.AuxInt)
14389 if !(uint32(c) < 16) {
14392 v.reset(OpPPC64SRAWconst)
14393 v.AuxInt = int64ToAuxInt(c & 15)
14394 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
14399 // match: (Rsh16x32 x y)
14400 // cond: shiftIsBounded(v)
14401 // result: (SRAW (MOVHreg x) y)
14405 if !(shiftIsBounded(v)) {
14408 v.reset(OpPPC64SRAW)
14409 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
14414 // match: (Rsh16x32 x y)
14415 // result: (SRAW (SignExt16to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [16]))))
14419 v.reset(OpPPC64SRAW)
14420 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
14422 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
14423 v1.AuxInt = int32ToAuxInt(0)
14424 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14425 v2.AuxInt = int64ToAuxInt(-1)
14426 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
14427 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14428 v4.AuxInt = int64ToAuxInt(16)
14430 v1.AddArg3(y, v2, v3)
14435 func rewriteValuePPC64_OpRsh16x64(v *Value) bool {
14439 typ := &b.Func.Config.Types
14440 // match: (Rsh16x64 x (MOVDconst [c]))
14441 // cond: uint64(c) >= 16
14442 // result: (SRAWconst (SignExt16to32 x) [63])
14445 if v_1.Op != OpPPC64MOVDconst {
14448 c := auxIntToInt64(v_1.AuxInt)
14449 if !(uint64(c) >= 16) {
14452 v.reset(OpPPC64SRAWconst)
14453 v.AuxInt = int64ToAuxInt(63)
14454 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
14459 // match: (Rsh16x64 x (MOVDconst [c]))
14460 // cond: uint64(c) < 16
14461 // result: (SRAWconst (SignExt16to32 x) [c])
14464 if v_1.Op != OpPPC64MOVDconst {
14467 c := auxIntToInt64(v_1.AuxInt)
14468 if !(uint64(c) < 16) {
14471 v.reset(OpPPC64SRAWconst)
14472 v.AuxInt = int64ToAuxInt(c)
14473 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
14478 // match: (Rsh16x64 x y)
14479 // cond: shiftIsBounded(v)
14480 // result: (SRAW (MOVHreg x) y)
14484 if !(shiftIsBounded(v)) {
14487 v.reset(OpPPC64SRAW)
14488 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
14493 // match: (Rsh16x64 x y)
14494 // result: (SRAW (SignExt16to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [16]))))
14498 v.reset(OpPPC64SRAW)
14499 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
14501 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
14502 v1.AuxInt = int32ToAuxInt(0)
14503 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14504 v2.AuxInt = int64ToAuxInt(-1)
14505 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
14506 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14507 v4.AuxInt = int64ToAuxInt(16)
14509 v1.AddArg3(y, v2, v3)
14514 func rewriteValuePPC64_OpRsh16x8(v *Value) bool {
14518 typ := &b.Func.Config.Types
14519 // match: (Rsh16x8 x y)
14520 // cond: shiftIsBounded(v)
14521 // result: (SRAW (MOVHreg x) y)
14525 if !(shiftIsBounded(v)) {
14528 v.reset(OpPPC64SRAW)
14529 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
14534 // match: (Rsh16x8 x y)
14535 // result: (SRAW (SignExt16to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [16]))))
14539 v.reset(OpPPC64SRAW)
14540 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
14542 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
14543 v1.AuxInt = int32ToAuxInt(0)
14544 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14545 v2.AuxInt = int64ToAuxInt(-1)
14546 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
14547 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
14549 v5 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14550 v5.AuxInt = int64ToAuxInt(16)
14552 v1.AddArg3(y, v2, v3)
14557 func rewriteValuePPC64_OpRsh32Ux16(v *Value) bool {
14561 typ := &b.Func.Config.Types
14562 // match: (Rsh32Ux16 x y)
14563 // cond: shiftIsBounded(v)
14564 // result: (SRW x y)
14568 if !(shiftIsBounded(v)) {
14571 v.reset(OpPPC64SRW)
14575 // match: (Rsh32Ux16 x y)
14576 // result: (SRW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [32]))))
14580 v.reset(OpPPC64SRW)
14581 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
14582 v0.AuxInt = int32ToAuxInt(0)
14583 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14584 v1.AuxInt = int64ToAuxInt(-1)
14585 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
14586 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
14588 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14589 v4.AuxInt = int64ToAuxInt(32)
14591 v0.AddArg3(y, v1, v2)
14596 func rewriteValuePPC64_OpRsh32Ux32(v *Value) bool {
14600 typ := &b.Func.Config.Types
14601 // match: (Rsh32Ux32 x (MOVDconst [c]))
14602 // cond: uint32(c) < 32
14603 // result: (SRWconst x [c&31])
14606 if v_1.Op != OpPPC64MOVDconst {
14609 c := auxIntToInt64(v_1.AuxInt)
14610 if !(uint32(c) < 32) {
14613 v.reset(OpPPC64SRWconst)
14614 v.AuxInt = int64ToAuxInt(c & 31)
14618 // match: (Rsh32Ux32 x y)
14619 // cond: shiftIsBounded(v)
14620 // result: (SRW x y)
14624 if !(shiftIsBounded(v)) {
14627 v.reset(OpPPC64SRW)
14631 // match: (Rsh32Ux32 x y)
14632 // result: (SRW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [32]))))
14636 v.reset(OpPPC64SRW)
14637 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
14638 v0.AuxInt = int32ToAuxInt(0)
14639 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14640 v1.AuxInt = int64ToAuxInt(-1)
14641 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
14642 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14643 v3.AuxInt = int64ToAuxInt(32)
14645 v0.AddArg3(y, v1, v2)
14650 func rewriteValuePPC64_OpRsh32Ux64(v *Value) bool {
14654 typ := &b.Func.Config.Types
14655 // match: (Rsh32Ux64 _ (MOVDconst [c]))
14656 // cond: uint64(c) >= 32
14657 // result: (MOVDconst [0])
14659 if v_1.Op != OpPPC64MOVDconst {
14662 c := auxIntToInt64(v_1.AuxInt)
14663 if !(uint64(c) >= 32) {
14666 v.reset(OpPPC64MOVDconst)
14667 v.AuxInt = int64ToAuxInt(0)
14670 // match: (Rsh32Ux64 x (MOVDconst [c]))
14671 // cond: uint64(c) < 32
14672 // result: (SRWconst x [c])
14675 if v_1.Op != OpPPC64MOVDconst {
14678 c := auxIntToInt64(v_1.AuxInt)
14679 if !(uint64(c) < 32) {
14682 v.reset(OpPPC64SRWconst)
14683 v.AuxInt = int64ToAuxInt(c)
14687 // match: (Rsh32Ux64 x y)
14688 // cond: shiftIsBounded(v)
14689 // result: (SRW x y)
14693 if !(shiftIsBounded(v)) {
14696 v.reset(OpPPC64SRW)
14700 // match: (Rsh32Ux64 x (AND y (MOVDconst [31])))
14701 // result: (SRW x (ANDconst <typ.Int32> [31] y))
14704 if v_1.Op != OpPPC64AND {
14708 v_1_0 := v_1.Args[0]
14709 v_1_1 := v_1.Args[1]
14710 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
14712 if v_1_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1.AuxInt) != 31 {
14715 v.reset(OpPPC64SRW)
14716 v0 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int32)
14717 v0.AuxInt = int64ToAuxInt(31)
14724 // match: (Rsh32Ux64 x (ANDconst <typ.UInt> [31] y))
14725 // result: (SRW x (ANDconst <typ.UInt> [31] y))
14728 if v_1.Op != OpPPC64ANDconst || v_1.Type != typ.UInt || auxIntToInt64(v_1.AuxInt) != 31 {
14732 v.reset(OpPPC64SRW)
14733 v0 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
14734 v0.AuxInt = int64ToAuxInt(31)
14739 // match: (Rsh32Ux64 x (SUB <typ.UInt> (MOVDconst [32]) (ANDconst <typ.UInt> [31] y)))
14740 // result: (SRW x (SUB <typ.UInt> (MOVDconst [32]) (ANDconst <typ.UInt> [31] y)))
14743 if v_1.Op != OpPPC64SUB || v_1.Type != typ.UInt {
14747 v_1_0 := v_1.Args[0]
14748 if v_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_0.AuxInt) != 32 {
14751 v_1_1 := v_1.Args[1]
14752 if v_1_1.Op != OpPPC64ANDconst || v_1_1.Type != typ.UInt || auxIntToInt64(v_1_1.AuxInt) != 31 {
14756 v.reset(OpPPC64SRW)
14757 v0 := b.NewValue0(v.Pos, OpPPC64SUB, typ.UInt)
14758 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14759 v1.AuxInt = int64ToAuxInt(32)
14760 v2 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
14761 v2.AuxInt = int64ToAuxInt(31)
14767 // match: (Rsh32Ux64 x (SUBFCconst <typ.UInt> [32] (ANDconst <typ.UInt> [31] y)))
14768 // result: (SRW x (SUBFCconst <typ.UInt> [32] (ANDconst <typ.UInt> [31] y)))
14771 if v_1.Op != OpPPC64SUBFCconst || v_1.Type != typ.UInt || auxIntToInt64(v_1.AuxInt) != 32 {
14774 v_1_0 := v_1.Args[0]
14775 if v_1_0.Op != OpPPC64ANDconst || v_1_0.Type != typ.UInt || auxIntToInt64(v_1_0.AuxInt) != 31 {
14779 v.reset(OpPPC64SRW)
14780 v0 := b.NewValue0(v.Pos, OpPPC64SUBFCconst, typ.UInt)
14781 v0.AuxInt = int64ToAuxInt(32)
14782 v1 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
14783 v1.AuxInt = int64ToAuxInt(31)
14789 // match: (Rsh32Ux64 x (SUB <typ.UInt> (MOVDconst [32]) (AND <typ.UInt> y (MOVDconst [31]))))
14790 // result: (SRW x (SUB <typ.UInt> (MOVDconst [32]) (ANDconst <typ.UInt> [31] y)))
14793 if v_1.Op != OpPPC64SUB || v_1.Type != typ.UInt {
14797 v_1_0 := v_1.Args[0]
14798 if v_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_0.AuxInt) != 32 {
14801 v_1_1 := v_1.Args[1]
14802 if v_1_1.Op != OpPPC64AND || v_1_1.Type != typ.UInt {
14806 v_1_1_0 := v_1_1.Args[0]
14807 v_1_1_1 := v_1_1.Args[1]
14808 for _i0 := 0; _i0 <= 1; _i0, v_1_1_0, v_1_1_1 = _i0+1, v_1_1_1, v_1_1_0 {
14810 if v_1_1_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1_1.AuxInt) != 31 {
14813 v.reset(OpPPC64SRW)
14814 v0 := b.NewValue0(v.Pos, OpPPC64SUB, typ.UInt)
14815 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14816 v1.AuxInt = int64ToAuxInt(32)
14817 v2 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
14818 v2.AuxInt = int64ToAuxInt(31)
14826 // match: (Rsh32Ux64 x (SUBFCconst <typ.UInt> [32] (AND <typ.UInt> y (MOVDconst [31]))))
14827 // result: (SRW x (SUBFCconst <typ.UInt> [32] (ANDconst <typ.UInt> [31] y)))
14830 if v_1.Op != OpPPC64SUBFCconst || v_1.Type != typ.UInt || auxIntToInt64(v_1.AuxInt) != 32 {
14833 v_1_0 := v_1.Args[0]
14834 if v_1_0.Op != OpPPC64AND || v_1_0.Type != typ.UInt {
14838 v_1_0_0 := v_1_0.Args[0]
14839 v_1_0_1 := v_1_0.Args[1]
14840 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
14842 if v_1_0_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_0_1.AuxInt) != 31 {
14845 v.reset(OpPPC64SRW)
14846 v0 := b.NewValue0(v.Pos, OpPPC64SUBFCconst, typ.UInt)
14847 v0.AuxInt = int64ToAuxInt(32)
14848 v1 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
14849 v1.AuxInt = int64ToAuxInt(31)
14857 // match: (Rsh32Ux64 x y)
14858 // result: (SRW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [32]))))
14862 v.reset(OpPPC64SRW)
14863 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
14864 v0.AuxInt = int32ToAuxInt(0)
14865 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14866 v1.AuxInt = int64ToAuxInt(-1)
14867 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
14868 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14869 v3.AuxInt = int64ToAuxInt(32)
14871 v0.AddArg3(y, v1, v2)
14876 func rewriteValuePPC64_OpRsh32Ux8(v *Value) bool {
14880 typ := &b.Func.Config.Types
14881 // match: (Rsh32Ux8 x y)
14882 // cond: shiftIsBounded(v)
14883 // result: (SRW x y)
14887 if !(shiftIsBounded(v)) {
14890 v.reset(OpPPC64SRW)
14894 // match: (Rsh32Ux8 x y)
14895 // result: (SRW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [32]))))
14899 v.reset(OpPPC64SRW)
14900 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
14901 v0.AuxInt = int32ToAuxInt(0)
14902 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14903 v1.AuxInt = int64ToAuxInt(-1)
14904 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
14905 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
14907 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14908 v4.AuxInt = int64ToAuxInt(32)
14910 v0.AddArg3(y, v1, v2)
14915 func rewriteValuePPC64_OpRsh32x16(v *Value) bool {
14919 typ := &b.Func.Config.Types
14920 // match: (Rsh32x16 x y)
14921 // cond: shiftIsBounded(v)
14922 // result: (SRAW x y)
14926 if !(shiftIsBounded(v)) {
14929 v.reset(OpPPC64SRAW)
14933 // match: (Rsh32x16 x y)
14934 // result: (SRAW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [32]))))
14938 v.reset(OpPPC64SRAW)
14939 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
14940 v0.AuxInt = int32ToAuxInt(0)
14941 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14942 v1.AuxInt = int64ToAuxInt(-1)
14943 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
14944 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
14946 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14947 v4.AuxInt = int64ToAuxInt(32)
14949 v0.AddArg3(y, v1, v2)
14954 func rewriteValuePPC64_OpRsh32x32(v *Value) bool {
14958 typ := &b.Func.Config.Types
14959 // match: (Rsh32x32 x (MOVDconst [c]))
14960 // cond: uint32(c) < 32
14961 // result: (SRAWconst x [c&31])
14964 if v_1.Op != OpPPC64MOVDconst {
14967 c := auxIntToInt64(v_1.AuxInt)
14968 if !(uint32(c) < 32) {
14971 v.reset(OpPPC64SRAWconst)
14972 v.AuxInt = int64ToAuxInt(c & 31)
14976 // match: (Rsh32x32 x y)
14977 // cond: shiftIsBounded(v)
14978 // result: (SRAW x y)
14982 if !(shiftIsBounded(v)) {
14985 v.reset(OpPPC64SRAW)
14989 // match: (Rsh32x32 x y)
14990 // result: (SRAW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [32]))))
14994 v.reset(OpPPC64SRAW)
14995 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
14996 v0.AuxInt = int32ToAuxInt(0)
14997 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14998 v1.AuxInt = int64ToAuxInt(-1)
14999 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
15000 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15001 v3.AuxInt = int64ToAuxInt(32)
15003 v0.AddArg3(y, v1, v2)
15008 func rewriteValuePPC64_OpRsh32x64(v *Value) bool {
15012 typ := &b.Func.Config.Types
15013 // match: (Rsh32x64 x (MOVDconst [c]))
15014 // cond: uint64(c) >= 32
15015 // result: (SRAWconst x [63])
15018 if v_1.Op != OpPPC64MOVDconst {
15021 c := auxIntToInt64(v_1.AuxInt)
15022 if !(uint64(c) >= 32) {
15025 v.reset(OpPPC64SRAWconst)
15026 v.AuxInt = int64ToAuxInt(63)
15030 // match: (Rsh32x64 x (MOVDconst [c]))
15031 // cond: uint64(c) < 32
15032 // result: (SRAWconst x [c])
15035 if v_1.Op != OpPPC64MOVDconst {
15038 c := auxIntToInt64(v_1.AuxInt)
15039 if !(uint64(c) < 32) {
15042 v.reset(OpPPC64SRAWconst)
15043 v.AuxInt = int64ToAuxInt(c)
15047 // match: (Rsh32x64 x y)
15048 // cond: shiftIsBounded(v)
15049 // result: (SRAW x y)
15053 if !(shiftIsBounded(v)) {
15056 v.reset(OpPPC64SRAW)
15060 // match: (Rsh32x64 x (AND y (MOVDconst [31])))
15061 // result: (SRAW x (ANDconst <typ.Int32> [31] y))
15064 if v_1.Op != OpPPC64AND {
15068 v_1_0 := v_1.Args[0]
15069 v_1_1 := v_1.Args[1]
15070 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
15072 if v_1_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1.AuxInt) != 31 {
15075 v.reset(OpPPC64SRAW)
15076 v0 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int32)
15077 v0.AuxInt = int64ToAuxInt(31)
15084 // match: (Rsh32x64 x (ANDconst <typ.UInt> [31] y))
15085 // result: (SRAW x (ANDconst <typ.UInt> [31] y))
15088 if v_1.Op != OpPPC64ANDconst || v_1.Type != typ.UInt || auxIntToInt64(v_1.AuxInt) != 31 {
15092 v.reset(OpPPC64SRAW)
15093 v0 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
15094 v0.AuxInt = int64ToAuxInt(31)
15099 // match: (Rsh32x64 x (SUB <typ.UInt> (MOVDconst [32]) (ANDconst <typ.UInt> [31] y)))
15100 // result: (SRAW x (SUB <typ.UInt> (MOVDconst [32]) (ANDconst <typ.UInt> [31] y)))
15103 if v_1.Op != OpPPC64SUB || v_1.Type != typ.UInt {
15107 v_1_0 := v_1.Args[0]
15108 if v_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_0.AuxInt) != 32 {
15111 v_1_1 := v_1.Args[1]
15112 if v_1_1.Op != OpPPC64ANDconst || v_1_1.Type != typ.UInt || auxIntToInt64(v_1_1.AuxInt) != 31 {
15116 v.reset(OpPPC64SRAW)
15117 v0 := b.NewValue0(v.Pos, OpPPC64SUB, typ.UInt)
15118 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15119 v1.AuxInt = int64ToAuxInt(32)
15120 v2 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
15121 v2.AuxInt = int64ToAuxInt(31)
15127 // match: (Rsh32x64 x (SUBFCconst <typ.UInt> [32] (ANDconst <typ.UInt> [31] y)))
15128 // result: (SRAW x (SUBFCconst <typ.UInt> [32] (ANDconst <typ.UInt> [31] y)))
15131 if v_1.Op != OpPPC64SUBFCconst || v_1.Type != typ.UInt || auxIntToInt64(v_1.AuxInt) != 32 {
15134 v_1_0 := v_1.Args[0]
15135 if v_1_0.Op != OpPPC64ANDconst || v_1_0.Type != typ.UInt || auxIntToInt64(v_1_0.AuxInt) != 31 {
15139 v.reset(OpPPC64SRAW)
15140 v0 := b.NewValue0(v.Pos, OpPPC64SUBFCconst, typ.UInt)
15141 v0.AuxInt = int64ToAuxInt(32)
15142 v1 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
15143 v1.AuxInt = int64ToAuxInt(31)
15149 // match: (Rsh32x64 x (SUB <typ.UInt> (MOVDconst [32]) (AND <typ.UInt> y (MOVDconst [31]))))
15150 // result: (SRAW x (SUB <typ.UInt> (MOVDconst [32]) (ANDconst <typ.UInt> [31] y)))
15153 if v_1.Op != OpPPC64SUB || v_1.Type != typ.UInt {
15157 v_1_0 := v_1.Args[0]
15158 if v_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_0.AuxInt) != 32 {
15161 v_1_1 := v_1.Args[1]
15162 if v_1_1.Op != OpPPC64AND || v_1_1.Type != typ.UInt {
15166 v_1_1_0 := v_1_1.Args[0]
15167 v_1_1_1 := v_1_1.Args[1]
15168 for _i0 := 0; _i0 <= 1; _i0, v_1_1_0, v_1_1_1 = _i0+1, v_1_1_1, v_1_1_0 {
15170 if v_1_1_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1_1.AuxInt) != 31 {
15173 v.reset(OpPPC64SRAW)
15174 v0 := b.NewValue0(v.Pos, OpPPC64SUB, typ.UInt)
15175 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15176 v1.AuxInt = int64ToAuxInt(32)
15177 v2 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
15178 v2.AuxInt = int64ToAuxInt(31)
15186 // match: (Rsh32x64 x (SUBFCconst <typ.UInt> [32] (AND <typ.UInt> y (MOVDconst [31]))))
15187 // result: (SRAW x (SUBFCconst <typ.UInt> [32] (ANDconst <typ.UInt> [31] y)))
15190 if v_1.Op != OpPPC64SUBFCconst || v_1.Type != typ.UInt || auxIntToInt64(v_1.AuxInt) != 32 {
15193 v_1_0 := v_1.Args[0]
15194 if v_1_0.Op != OpPPC64AND || v_1_0.Type != typ.UInt {
15198 v_1_0_0 := v_1_0.Args[0]
15199 v_1_0_1 := v_1_0.Args[1]
15200 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
15202 if v_1_0_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_0_1.AuxInt) != 31 {
15205 v.reset(OpPPC64SRAW)
15206 v0 := b.NewValue0(v.Pos, OpPPC64SUBFCconst, typ.UInt)
15207 v0.AuxInt = int64ToAuxInt(32)
15208 v1 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
15209 v1.AuxInt = int64ToAuxInt(31)
15217 // match: (Rsh32x64 x y)
15218 // result: (SRAW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [32]))))
15222 v.reset(OpPPC64SRAW)
15223 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
15224 v0.AuxInt = int32ToAuxInt(0)
15225 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15226 v1.AuxInt = int64ToAuxInt(-1)
15227 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
15228 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15229 v3.AuxInt = int64ToAuxInt(32)
15231 v0.AddArg3(y, v1, v2)
15236 func rewriteValuePPC64_OpRsh32x8(v *Value) bool {
15240 typ := &b.Func.Config.Types
15241 // match: (Rsh32x8 x y)
15242 // cond: shiftIsBounded(v)
15243 // result: (SRAW x y)
15247 if !(shiftIsBounded(v)) {
15250 v.reset(OpPPC64SRAW)
15254 // match: (Rsh32x8 x y)
15255 // result: (SRAW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [32]))))
15259 v.reset(OpPPC64SRAW)
15260 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
15261 v0.AuxInt = int32ToAuxInt(0)
15262 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15263 v1.AuxInt = int64ToAuxInt(-1)
15264 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
15265 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
15267 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15268 v4.AuxInt = int64ToAuxInt(32)
15270 v0.AddArg3(y, v1, v2)
15275 func rewriteValuePPC64_OpRsh64Ux16(v *Value) bool {
15279 typ := &b.Func.Config.Types
15280 // match: (Rsh64Ux16 x y)
15281 // cond: shiftIsBounded(v)
15282 // result: (SRD x y)
15286 if !(shiftIsBounded(v)) {
15289 v.reset(OpPPC64SRD)
15293 // match: (Rsh64Ux16 x y)
15294 // result: (SRD x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [64]))))
15298 v.reset(OpPPC64SRD)
15299 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
15300 v0.AuxInt = int32ToAuxInt(0)
15301 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15302 v1.AuxInt = int64ToAuxInt(-1)
15303 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
15304 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
15306 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15307 v4.AuxInt = int64ToAuxInt(64)
15309 v0.AddArg3(y, v1, v2)
15314 func rewriteValuePPC64_OpRsh64Ux32(v *Value) bool {
15318 typ := &b.Func.Config.Types
15319 // match: (Rsh64Ux32 x (MOVDconst [c]))
15320 // cond: uint32(c) < 64
15321 // result: (SRDconst x [c&63])
15324 if v_1.Op != OpPPC64MOVDconst {
15327 c := auxIntToInt64(v_1.AuxInt)
15328 if !(uint32(c) < 64) {
15331 v.reset(OpPPC64SRDconst)
15332 v.AuxInt = int64ToAuxInt(c & 63)
15336 // match: (Rsh64Ux32 x y)
15337 // cond: shiftIsBounded(v)
15338 // result: (SRD x y)
15342 if !(shiftIsBounded(v)) {
15345 v.reset(OpPPC64SRD)
15349 // match: (Rsh64Ux32 x y)
15350 // result: (SRD x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [64]))))
15354 v.reset(OpPPC64SRD)
15355 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
15356 v0.AuxInt = int32ToAuxInt(0)
15357 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15358 v1.AuxInt = int64ToAuxInt(-1)
15359 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
15360 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15361 v3.AuxInt = int64ToAuxInt(64)
15363 v0.AddArg3(y, v1, v2)
15368 func rewriteValuePPC64_OpRsh64Ux64(v *Value) bool {
15372 typ := &b.Func.Config.Types
15373 // match: (Rsh64Ux64 _ (MOVDconst [c]))
15374 // cond: uint64(c) >= 64
15375 // result: (MOVDconst [0])
15377 if v_1.Op != OpPPC64MOVDconst {
15380 c := auxIntToInt64(v_1.AuxInt)
15381 if !(uint64(c) >= 64) {
15384 v.reset(OpPPC64MOVDconst)
15385 v.AuxInt = int64ToAuxInt(0)
15388 // match: (Rsh64Ux64 x (MOVDconst [c]))
15389 // cond: uint64(c) < 64
15390 // result: (SRDconst x [c])
15393 if v_1.Op != OpPPC64MOVDconst {
15396 c := auxIntToInt64(v_1.AuxInt)
15397 if !(uint64(c) < 64) {
15400 v.reset(OpPPC64SRDconst)
15401 v.AuxInt = int64ToAuxInt(c)
15405 // match: (Rsh64Ux64 x y)
15406 // cond: shiftIsBounded(v)
15407 // result: (SRD x y)
15411 if !(shiftIsBounded(v)) {
15414 v.reset(OpPPC64SRD)
15418 // match: (Rsh64Ux64 x (AND y (MOVDconst [63])))
15419 // result: (SRD x (ANDconst <typ.Int64> [63] y))
15422 if v_1.Op != OpPPC64AND {
15426 v_1_0 := v_1.Args[0]
15427 v_1_1 := v_1.Args[1]
15428 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
15430 if v_1_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1.AuxInt) != 63 {
15433 v.reset(OpPPC64SRD)
15434 v0 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int64)
15435 v0.AuxInt = int64ToAuxInt(63)
15442 // match: (Rsh64Ux64 x (ANDconst <typ.UInt> [63] y))
15443 // result: (SRD x (ANDconst <typ.UInt> [63] y))
15446 if v_1.Op != OpPPC64ANDconst || v_1.Type != typ.UInt || auxIntToInt64(v_1.AuxInt) != 63 {
15450 v.reset(OpPPC64SRD)
15451 v0 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
15452 v0.AuxInt = int64ToAuxInt(63)
15457 // match: (Rsh64Ux64 x (SUB <typ.UInt> (MOVDconst [64]) (ANDconst <typ.UInt> [63] y)))
15458 // result: (SRD x (SUB <typ.UInt> (MOVDconst [64]) (ANDconst <typ.UInt> [63] y)))
15461 if v_1.Op != OpPPC64SUB || v_1.Type != typ.UInt {
15465 v_1_0 := v_1.Args[0]
15466 if v_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_0.AuxInt) != 64 {
15469 v_1_1 := v_1.Args[1]
15470 if v_1_1.Op != OpPPC64ANDconst || v_1_1.Type != typ.UInt || auxIntToInt64(v_1_1.AuxInt) != 63 {
15474 v.reset(OpPPC64SRD)
15475 v0 := b.NewValue0(v.Pos, OpPPC64SUB, typ.UInt)
15476 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15477 v1.AuxInt = int64ToAuxInt(64)
15478 v2 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
15479 v2.AuxInt = int64ToAuxInt(63)
15485 // match: (Rsh64Ux64 x (SUBFCconst <typ.UInt> [64] (ANDconst <typ.UInt> [63] y)))
15486 // result: (SRD x (SUBFCconst <typ.UInt> [64] (ANDconst <typ.UInt> [63] y)))
15489 if v_1.Op != OpPPC64SUBFCconst || v_1.Type != typ.UInt || auxIntToInt64(v_1.AuxInt) != 64 {
15492 v_1_0 := v_1.Args[0]
15493 if v_1_0.Op != OpPPC64ANDconst || v_1_0.Type != typ.UInt || auxIntToInt64(v_1_0.AuxInt) != 63 {
15497 v.reset(OpPPC64SRD)
15498 v0 := b.NewValue0(v.Pos, OpPPC64SUBFCconst, typ.UInt)
15499 v0.AuxInt = int64ToAuxInt(64)
15500 v1 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
15501 v1.AuxInt = int64ToAuxInt(63)
15507 // match: (Rsh64Ux64 x (SUB <typ.UInt> (MOVDconst [64]) (AND <typ.UInt> y (MOVDconst [63]))))
15508 // result: (SRD x (SUB <typ.UInt> (MOVDconst [64]) (ANDconst <typ.UInt> [63] y)))
15511 if v_1.Op != OpPPC64SUB || v_1.Type != typ.UInt {
15515 v_1_0 := v_1.Args[0]
15516 if v_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_0.AuxInt) != 64 {
15519 v_1_1 := v_1.Args[1]
15520 if v_1_1.Op != OpPPC64AND || v_1_1.Type != typ.UInt {
15524 v_1_1_0 := v_1_1.Args[0]
15525 v_1_1_1 := v_1_1.Args[1]
15526 for _i0 := 0; _i0 <= 1; _i0, v_1_1_0, v_1_1_1 = _i0+1, v_1_1_1, v_1_1_0 {
15528 if v_1_1_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1_1.AuxInt) != 63 {
15531 v.reset(OpPPC64SRD)
15532 v0 := b.NewValue0(v.Pos, OpPPC64SUB, typ.UInt)
15533 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15534 v1.AuxInt = int64ToAuxInt(64)
15535 v2 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
15536 v2.AuxInt = int64ToAuxInt(63)
15544 // match: (Rsh64Ux64 x (SUBFCconst <typ.UInt> [64] (AND <typ.UInt> y (MOVDconst [63]))))
15545 // result: (SRD x (SUBFCconst <typ.UInt> [64] (ANDconst <typ.UInt> [63] y)))
15548 if v_1.Op != OpPPC64SUBFCconst || v_1.Type != typ.UInt || auxIntToInt64(v_1.AuxInt) != 64 {
15551 v_1_0 := v_1.Args[0]
15552 if v_1_0.Op != OpPPC64AND || v_1_0.Type != typ.UInt {
15556 v_1_0_0 := v_1_0.Args[0]
15557 v_1_0_1 := v_1_0.Args[1]
15558 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
15560 if v_1_0_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_0_1.AuxInt) != 63 {
15563 v.reset(OpPPC64SRD)
15564 v0 := b.NewValue0(v.Pos, OpPPC64SUBFCconst, typ.UInt)
15565 v0.AuxInt = int64ToAuxInt(64)
15566 v1 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
15567 v1.AuxInt = int64ToAuxInt(63)
15575 // match: (Rsh64Ux64 x y)
15576 // result: (SRD x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [64]))))
15580 v.reset(OpPPC64SRD)
15581 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
15582 v0.AuxInt = int32ToAuxInt(0)
15583 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15584 v1.AuxInt = int64ToAuxInt(-1)
15585 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
15586 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15587 v3.AuxInt = int64ToAuxInt(64)
15589 v0.AddArg3(y, v1, v2)
15594 func rewriteValuePPC64_OpRsh64Ux8(v *Value) bool {
15598 typ := &b.Func.Config.Types
15599 // match: (Rsh64Ux8 x y)
15600 // cond: shiftIsBounded(v)
15601 // result: (SRD x y)
15605 if !(shiftIsBounded(v)) {
15608 v.reset(OpPPC64SRD)
15612 // match: (Rsh64Ux8 x y)
15613 // result: (SRD x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [64]))))
15617 v.reset(OpPPC64SRD)
15618 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
15619 v0.AuxInt = int32ToAuxInt(0)
15620 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15621 v1.AuxInt = int64ToAuxInt(-1)
15622 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
15623 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
15625 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15626 v4.AuxInt = int64ToAuxInt(64)
15628 v0.AddArg3(y, v1, v2)
15633 func rewriteValuePPC64_OpRsh64x16(v *Value) bool {
15637 typ := &b.Func.Config.Types
15638 // match: (Rsh64x16 x y)
15639 // cond: shiftIsBounded(v)
15640 // result: (SRAD x y)
15644 if !(shiftIsBounded(v)) {
15647 v.reset(OpPPC64SRAD)
15651 // match: (Rsh64x16 x y)
15652 // result: (SRAD x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [64]))))
15656 v.reset(OpPPC64SRAD)
15657 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
15658 v0.AuxInt = int32ToAuxInt(0)
15659 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15660 v1.AuxInt = int64ToAuxInt(-1)
15661 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
15662 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
15664 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15665 v4.AuxInt = int64ToAuxInt(64)
15667 v0.AddArg3(y, v1, v2)
15672 func rewriteValuePPC64_OpRsh64x32(v *Value) bool {
15676 typ := &b.Func.Config.Types
15677 // match: (Rsh64x32 x (MOVDconst [c]))
15678 // cond: uint32(c) < 64
15679 // result: (SRADconst x [c&63])
15682 if v_1.Op != OpPPC64MOVDconst {
15685 c := auxIntToInt64(v_1.AuxInt)
15686 if !(uint32(c) < 64) {
15689 v.reset(OpPPC64SRADconst)
15690 v.AuxInt = int64ToAuxInt(c & 63)
15694 // match: (Rsh64x32 x y)
15695 // cond: shiftIsBounded(v)
15696 // result: (SRAD x y)
15700 if !(shiftIsBounded(v)) {
15703 v.reset(OpPPC64SRAD)
15707 // match: (Rsh64x32 x y)
15708 // result: (SRAD x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [64]))))
15712 v.reset(OpPPC64SRAD)
15713 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
15714 v0.AuxInt = int32ToAuxInt(0)
15715 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15716 v1.AuxInt = int64ToAuxInt(-1)
15717 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
15718 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15719 v3.AuxInt = int64ToAuxInt(64)
15721 v0.AddArg3(y, v1, v2)
15726 func rewriteValuePPC64_OpRsh64x64(v *Value) bool {
15730 typ := &b.Func.Config.Types
15731 // match: (Rsh64x64 x (MOVDconst [c]))
15732 // cond: uint64(c) >= 64
15733 // result: (SRADconst x [63])
15736 if v_1.Op != OpPPC64MOVDconst {
15739 c := auxIntToInt64(v_1.AuxInt)
15740 if !(uint64(c) >= 64) {
15743 v.reset(OpPPC64SRADconst)
15744 v.AuxInt = int64ToAuxInt(63)
15748 // match: (Rsh64x64 x (MOVDconst [c]))
15749 // cond: uint64(c) < 64
15750 // result: (SRADconst x [c])
15753 if v_1.Op != OpPPC64MOVDconst {
15756 c := auxIntToInt64(v_1.AuxInt)
15757 if !(uint64(c) < 64) {
15760 v.reset(OpPPC64SRADconst)
15761 v.AuxInt = int64ToAuxInt(c)
15765 // match: (Rsh64x64 x y)
15766 // cond: shiftIsBounded(v)
15767 // result: (SRAD x y)
15771 if !(shiftIsBounded(v)) {
15774 v.reset(OpPPC64SRAD)
15778 // match: (Rsh64x64 x (AND y (MOVDconst [63])))
15779 // result: (SRAD x (ANDconst <typ.Int64> [63] y))
15782 if v_1.Op != OpPPC64AND {
15786 v_1_0 := v_1.Args[0]
15787 v_1_1 := v_1.Args[1]
15788 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
15790 if v_1_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1.AuxInt) != 63 {
15793 v.reset(OpPPC64SRAD)
15794 v0 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int64)
15795 v0.AuxInt = int64ToAuxInt(63)
15802 // match: (Rsh64x64 x (ANDconst <typ.UInt> [63] y))
15803 // result: (SRAD x (ANDconst <typ.UInt> [63] y))
15806 if v_1.Op != OpPPC64ANDconst || v_1.Type != typ.UInt || auxIntToInt64(v_1.AuxInt) != 63 {
15810 v.reset(OpPPC64SRAD)
15811 v0 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
15812 v0.AuxInt = int64ToAuxInt(63)
15817 // match: (Rsh64x64 x (SUB <typ.UInt> (MOVDconst [64]) (ANDconst <typ.UInt> [63] y)))
15818 // result: (SRAD x (SUB <typ.UInt> (MOVDconst [64]) (ANDconst <typ.UInt> [63] y)))
15821 if v_1.Op != OpPPC64SUB || v_1.Type != typ.UInt {
15825 v_1_0 := v_1.Args[0]
15826 if v_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_0.AuxInt) != 64 {
15829 v_1_1 := v_1.Args[1]
15830 if v_1_1.Op != OpPPC64ANDconst || v_1_1.Type != typ.UInt || auxIntToInt64(v_1_1.AuxInt) != 63 {
15834 v.reset(OpPPC64SRAD)
15835 v0 := b.NewValue0(v.Pos, OpPPC64SUB, typ.UInt)
15836 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15837 v1.AuxInt = int64ToAuxInt(64)
15838 v2 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
15839 v2.AuxInt = int64ToAuxInt(63)
15845 // match: (Rsh64x64 x (SUBFCconst <typ.UInt> [64] (ANDconst <typ.UInt> [63] y)))
15846 // result: (SRAD x (SUBFCconst <typ.UInt> [64] (ANDconst <typ.UInt> [63] y)))
15849 if v_1.Op != OpPPC64SUBFCconst || v_1.Type != typ.UInt || auxIntToInt64(v_1.AuxInt) != 64 {
15852 v_1_0 := v_1.Args[0]
15853 if v_1_0.Op != OpPPC64ANDconst || v_1_0.Type != typ.UInt || auxIntToInt64(v_1_0.AuxInt) != 63 {
15857 v.reset(OpPPC64SRAD)
15858 v0 := b.NewValue0(v.Pos, OpPPC64SUBFCconst, typ.UInt)
15859 v0.AuxInt = int64ToAuxInt(64)
15860 v1 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
15861 v1.AuxInt = int64ToAuxInt(63)
15867 // match: (Rsh64x64 x (SUB <typ.UInt> (MOVDconst [64]) (AND <typ.UInt> y (MOVDconst [63]))))
15868 // result: (SRAD x (SUB <typ.UInt> (MOVDconst [64]) (ANDconst <typ.UInt> [63] y)))
15871 if v_1.Op != OpPPC64SUB || v_1.Type != typ.UInt {
15875 v_1_0 := v_1.Args[0]
15876 if v_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_0.AuxInt) != 64 {
15879 v_1_1 := v_1.Args[1]
15880 if v_1_1.Op != OpPPC64AND || v_1_1.Type != typ.UInt {
15884 v_1_1_0 := v_1_1.Args[0]
15885 v_1_1_1 := v_1_1.Args[1]
15886 for _i0 := 0; _i0 <= 1; _i0, v_1_1_0, v_1_1_1 = _i0+1, v_1_1_1, v_1_1_0 {
15888 if v_1_1_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1_1.AuxInt) != 63 {
15891 v.reset(OpPPC64SRAD)
15892 v0 := b.NewValue0(v.Pos, OpPPC64SUB, typ.UInt)
15893 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15894 v1.AuxInt = int64ToAuxInt(64)
15895 v2 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
15896 v2.AuxInt = int64ToAuxInt(63)
15904 // match: (Rsh64x64 x (SUBFCconst <typ.UInt> [64] (AND <typ.UInt> y (MOVDconst [63]))))
15905 // result: (SRAD x (SUBFCconst <typ.UInt> [64] (ANDconst <typ.UInt> [63] y)))
15908 if v_1.Op != OpPPC64SUBFCconst || v_1.Type != typ.UInt || auxIntToInt64(v_1.AuxInt) != 64 {
15911 v_1_0 := v_1.Args[0]
15912 if v_1_0.Op != OpPPC64AND || v_1_0.Type != typ.UInt {
15916 v_1_0_0 := v_1_0.Args[0]
15917 v_1_0_1 := v_1_0.Args[1]
15918 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
15920 if v_1_0_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_0_1.AuxInt) != 63 {
15923 v.reset(OpPPC64SRAD)
15924 v0 := b.NewValue0(v.Pos, OpPPC64SUBFCconst, typ.UInt)
15925 v0.AuxInt = int64ToAuxInt(64)
15926 v1 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.UInt)
15927 v1.AuxInt = int64ToAuxInt(63)
15935 // match: (Rsh64x64 x y)
15936 // result: (SRAD x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [64]))))
15940 v.reset(OpPPC64SRAD)
15941 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
15942 v0.AuxInt = int32ToAuxInt(0)
15943 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15944 v1.AuxInt = int64ToAuxInt(-1)
15945 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
15946 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15947 v3.AuxInt = int64ToAuxInt(64)
15949 v0.AddArg3(y, v1, v2)
15954 func rewriteValuePPC64_OpRsh64x8(v *Value) bool {
15958 typ := &b.Func.Config.Types
15959 // match: (Rsh64x8 x y)
15960 // cond: shiftIsBounded(v)
15961 // result: (SRAD x y)
15965 if !(shiftIsBounded(v)) {
15968 v.reset(OpPPC64SRAD)
15972 // match: (Rsh64x8 x y)
15973 // result: (SRAD x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [64]))))
15977 v.reset(OpPPC64SRAD)
15978 v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
15979 v0.AuxInt = int32ToAuxInt(0)
15980 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15981 v1.AuxInt = int64ToAuxInt(-1)
15982 v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
15983 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
15985 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
15986 v4.AuxInt = int64ToAuxInt(64)
15988 v0.AddArg3(y, v1, v2)
15993 func rewriteValuePPC64_OpRsh8Ux16(v *Value) bool {
15997 typ := &b.Func.Config.Types
15998 // match: (Rsh8Ux16 x y)
15999 // cond: shiftIsBounded(v)
16000 // result: (SRW (MOVBZreg x) y)
16004 if !(shiftIsBounded(v)) {
16007 v.reset(OpPPC64SRW)
16008 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
16013 // match: (Rsh8Ux16 x y)
16014 // result: (SRW (ZeroExt8to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [8]))))
16018 v.reset(OpPPC64SRW)
16019 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
16021 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
16022 v1.AuxInt = int32ToAuxInt(0)
16023 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
16024 v2.AuxInt = int64ToAuxInt(-1)
16025 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
16026 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
16028 v5 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
16029 v5.AuxInt = int64ToAuxInt(8)
16031 v1.AddArg3(y, v2, v3)
16036 func rewriteValuePPC64_OpRsh8Ux32(v *Value) bool {
16040 typ := &b.Func.Config.Types
16041 // match: (Rsh8Ux32 x (MOVDconst [c]))
16042 // cond: uint32(c) < 8
16043 // result: (SRWconst (ZeroExt8to32 x) [c&7])
16046 if v_1.Op != OpPPC64MOVDconst {
16049 c := auxIntToInt64(v_1.AuxInt)
16050 if !(uint32(c) < 8) {
16053 v.reset(OpPPC64SRWconst)
16054 v.AuxInt = int64ToAuxInt(c & 7)
16055 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
16060 // match: (Rsh8Ux32 x y)
16061 // cond: shiftIsBounded(v)
16062 // result: (SRW (MOVBZreg x) y)
16066 if !(shiftIsBounded(v)) {
16069 v.reset(OpPPC64SRW)
16070 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
16075 // match: (Rsh8Ux32 x y)
16076 // result: (SRW (ZeroExt8to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [8]))))
16080 v.reset(OpPPC64SRW)
16081 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
16083 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
16084 v1.AuxInt = int32ToAuxInt(0)
16085 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
16086 v2.AuxInt = int64ToAuxInt(-1)
16087 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
16088 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
16089 v4.AuxInt = int64ToAuxInt(8)
16091 v1.AddArg3(y, v2, v3)
16096 func rewriteValuePPC64_OpRsh8Ux64(v *Value) bool {
16100 typ := &b.Func.Config.Types
16101 // match: (Rsh8Ux64 _ (MOVDconst [c]))
16102 // cond: uint64(c) >= 8
16103 // result: (MOVDconst [0])
16105 if v_1.Op != OpPPC64MOVDconst {
16108 c := auxIntToInt64(v_1.AuxInt)
16109 if !(uint64(c) >= 8) {
16112 v.reset(OpPPC64MOVDconst)
16113 v.AuxInt = int64ToAuxInt(0)
16116 // match: (Rsh8Ux64 x (MOVDconst [c]))
16117 // cond: uint64(c) < 8
16118 // result: (SRWconst (ZeroExt8to32 x) [c])
16121 if v_1.Op != OpPPC64MOVDconst {
16124 c := auxIntToInt64(v_1.AuxInt)
16125 if !(uint64(c) < 8) {
16128 v.reset(OpPPC64SRWconst)
16129 v.AuxInt = int64ToAuxInt(c)
16130 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
16135 // match: (Rsh8Ux64 x y)
16136 // cond: shiftIsBounded(v)
16137 // result: (SRW (MOVBZreg x) y)
16141 if !(shiftIsBounded(v)) {
16144 v.reset(OpPPC64SRW)
16145 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
16150 // match: (Rsh8Ux64 x y)
16151 // result: (SRW (ZeroExt8to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [8]))))
16155 v.reset(OpPPC64SRW)
16156 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
16158 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
16159 v1.AuxInt = int32ToAuxInt(0)
16160 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
16161 v2.AuxInt = int64ToAuxInt(-1)
16162 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
16163 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
16164 v4.AuxInt = int64ToAuxInt(8)
16166 v1.AddArg3(y, v2, v3)
16171 func rewriteValuePPC64_OpRsh8Ux8(v *Value) bool {
16175 typ := &b.Func.Config.Types
16176 // match: (Rsh8Ux8 x y)
16177 // cond: shiftIsBounded(v)
16178 // result: (SRW (MOVBZreg x) y)
16182 if !(shiftIsBounded(v)) {
16185 v.reset(OpPPC64SRW)
16186 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
16191 // match: (Rsh8Ux8 x y)
16192 // result: (SRW (ZeroExt8to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [8]))))
16196 v.reset(OpPPC64SRW)
16197 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
16199 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
16200 v1.AuxInt = int32ToAuxInt(0)
16201 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
16202 v2.AuxInt = int64ToAuxInt(-1)
16203 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
16204 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
16206 v5 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
16207 v5.AuxInt = int64ToAuxInt(8)
16209 v1.AddArg3(y, v2, v3)
16214 func rewriteValuePPC64_OpRsh8x16(v *Value) bool {
16218 typ := &b.Func.Config.Types
16219 // match: (Rsh8x16 x y)
16220 // cond: shiftIsBounded(v)
16221 // result: (SRAW (MOVBreg x) y)
16225 if !(shiftIsBounded(v)) {
16228 v.reset(OpPPC64SRAW)
16229 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
16234 // match: (Rsh8x16 x y)
16235 // result: (SRAW (SignExt8to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [8]))))
16239 v.reset(OpPPC64SRAW)
16240 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
16242 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
16243 v1.AuxInt = int32ToAuxInt(0)
16244 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
16245 v2.AuxInt = int64ToAuxInt(-1)
16246 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
16247 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
16249 v5 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
16250 v5.AuxInt = int64ToAuxInt(8)
16252 v1.AddArg3(y, v2, v3)
16257 func rewriteValuePPC64_OpRsh8x32(v *Value) bool {
16261 typ := &b.Func.Config.Types
16262 // match: (Rsh8x32 x (MOVDconst [c]))
16263 // cond: uint32(c) < 8
16264 // result: (SRAWconst (SignExt8to32 x) [c&7])
16267 if v_1.Op != OpPPC64MOVDconst {
16270 c := auxIntToInt64(v_1.AuxInt)
16271 if !(uint32(c) < 8) {
16274 v.reset(OpPPC64SRAWconst)
16275 v.AuxInt = int64ToAuxInt(c & 7)
16276 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
16281 // match: (Rsh8x32 x y)
16282 // cond: shiftIsBounded(v)
16283 // result: (SRAW (MOVBreg x) y)
16287 if !(shiftIsBounded(v)) {
16290 v.reset(OpPPC64SRAW)
16291 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
16296 // match: (Rsh8x32 x y)
16297 // result: (SRAW (SignExt8to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [8]))))
16301 v.reset(OpPPC64SRAW)
16302 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
16304 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
16305 v1.AuxInt = int32ToAuxInt(0)
16306 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
16307 v2.AuxInt = int64ToAuxInt(-1)
16308 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
16309 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
16310 v4.AuxInt = int64ToAuxInt(8)
16312 v1.AddArg3(y, v2, v3)
16317 func rewriteValuePPC64_OpRsh8x64(v *Value) bool {
16321 typ := &b.Func.Config.Types
16322 // match: (Rsh8x64 x (MOVDconst [c]))
16323 // cond: uint64(c) >= 8
16324 // result: (SRAWconst (SignExt8to32 x) [63])
16327 if v_1.Op != OpPPC64MOVDconst {
16330 c := auxIntToInt64(v_1.AuxInt)
16331 if !(uint64(c) >= 8) {
16334 v.reset(OpPPC64SRAWconst)
16335 v.AuxInt = int64ToAuxInt(63)
16336 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
16341 // match: (Rsh8x64 x (MOVDconst [c]))
16342 // cond: uint64(c) < 8
16343 // result: (SRAWconst (SignExt8to32 x) [c])
16346 if v_1.Op != OpPPC64MOVDconst {
16349 c := auxIntToInt64(v_1.AuxInt)
16350 if !(uint64(c) < 8) {
16353 v.reset(OpPPC64SRAWconst)
16354 v.AuxInt = int64ToAuxInt(c)
16355 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
16360 // match: (Rsh8x64 x y)
16361 // cond: shiftIsBounded(v)
16362 // result: (SRAW (MOVBreg x) y)
16366 if !(shiftIsBounded(v)) {
16369 v.reset(OpPPC64SRAW)
16370 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
16375 // match: (Rsh8x64 x y)
16376 // result: (SRAW (SignExt8to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [8]))))
16380 v.reset(OpPPC64SRAW)
16381 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
16383 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
16384 v1.AuxInt = int32ToAuxInt(0)
16385 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
16386 v2.AuxInt = int64ToAuxInt(-1)
16387 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
16388 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
16389 v4.AuxInt = int64ToAuxInt(8)
16391 v1.AddArg3(y, v2, v3)
16396 func rewriteValuePPC64_OpRsh8x8(v *Value) bool {
16400 typ := &b.Func.Config.Types
16401 // match: (Rsh8x8 x y)
16402 // cond: shiftIsBounded(v)
16403 // result: (SRAW (MOVBreg x) y)
16407 if !(shiftIsBounded(v)) {
16410 v.reset(OpPPC64SRAW)
16411 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
16416 // match: (Rsh8x8 x y)
16417 // result: (SRAW (SignExt8to32 x) (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [8]))))
16421 v.reset(OpPPC64SRAW)
16422 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
16424 v1 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
16425 v1.AuxInt = int32ToAuxInt(0)
16426 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
16427 v2.AuxInt = int64ToAuxInt(-1)
16428 v3 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
16429 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
16431 v5 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
16432 v5.AuxInt = int64ToAuxInt(8)
16434 v1.AddArg3(y, v2, v3)
16439 func rewriteValuePPC64_OpSlicemask(v *Value) bool {
16442 // match: (Slicemask <t> x)
16443 // result: (SRADconst (NEG <t> x) [63])
16447 v.reset(OpPPC64SRADconst)
16448 v.AuxInt = int64ToAuxInt(63)
16449 v0 := b.NewValue0(v.Pos, OpPPC64NEG, t)
16455 func rewriteValuePPC64_OpStore(v *Value) bool {
16459 // match: (Store {t} ptr val mem)
16460 // cond: t.Size() == 8 && is64BitFloat(val.Type)
16461 // result: (FMOVDstore ptr val mem)
16463 t := auxToType(v.Aux)
16467 if !(t.Size() == 8 && is64BitFloat(val.Type)) {
16470 v.reset(OpPPC64FMOVDstore)
16471 v.AddArg3(ptr, val, mem)
16474 // match: (Store {t} ptr val mem)
16475 // cond: t.Size() == 8 && is32BitFloat(val.Type)
16476 // result: (FMOVDstore ptr val mem)
16478 t := auxToType(v.Aux)
16482 if !(t.Size() == 8 && is32BitFloat(val.Type)) {
16485 v.reset(OpPPC64FMOVDstore)
16486 v.AddArg3(ptr, val, mem)
16489 // match: (Store {t} ptr val mem)
16490 // cond: t.Size() == 4 && is32BitFloat(val.Type)
16491 // result: (FMOVSstore ptr val mem)
16493 t := auxToType(v.Aux)
16497 if !(t.Size() == 4 && is32BitFloat(val.Type)) {
16500 v.reset(OpPPC64FMOVSstore)
16501 v.AddArg3(ptr, val, mem)
16504 // match: (Store {t} ptr val mem)
16505 // cond: t.Size() == 8 && (is64BitInt(val.Type) || isPtr(val.Type))
16506 // result: (MOVDstore ptr val mem)
16508 t := auxToType(v.Aux)
16512 if !(t.Size() == 8 && (is64BitInt(val.Type) || isPtr(val.Type))) {
16515 v.reset(OpPPC64MOVDstore)
16516 v.AddArg3(ptr, val, mem)
16519 // match: (Store {t} ptr val mem)
16520 // cond: t.Size() == 4 && is32BitInt(val.Type)
16521 // result: (MOVWstore ptr val mem)
16523 t := auxToType(v.Aux)
16527 if !(t.Size() == 4 && is32BitInt(val.Type)) {
16530 v.reset(OpPPC64MOVWstore)
16531 v.AddArg3(ptr, val, mem)
16534 // match: (Store {t} ptr val mem)
16535 // cond: t.Size() == 2
16536 // result: (MOVHstore ptr val mem)
16538 t := auxToType(v.Aux)
16542 if !(t.Size() == 2) {
16545 v.reset(OpPPC64MOVHstore)
16546 v.AddArg3(ptr, val, mem)
16549 // match: (Store {t} ptr val mem)
16550 // cond: t.Size() == 1
16551 // result: (MOVBstore ptr val mem)
16553 t := auxToType(v.Aux)
16557 if !(t.Size() == 1) {
16560 v.reset(OpPPC64MOVBstore)
16561 v.AddArg3(ptr, val, mem)
16566 func rewriteValuePPC64_OpTrunc16to8(v *Value) bool {
16568 // match: (Trunc16to8 <t> x)
16569 // cond: isSigned(t)
16570 // result: (MOVBreg x)
16574 if !(isSigned(t)) {
16577 v.reset(OpPPC64MOVBreg)
16581 // match: (Trunc16to8 x)
16582 // result: (MOVBZreg x)
16585 v.reset(OpPPC64MOVBZreg)
16590 func rewriteValuePPC64_OpTrunc32to16(v *Value) bool {
16592 // match: (Trunc32to16 <t> x)
16593 // cond: isSigned(t)
16594 // result: (MOVHreg x)
16598 if !(isSigned(t)) {
16601 v.reset(OpPPC64MOVHreg)
16605 // match: (Trunc32to16 x)
16606 // result: (MOVHZreg x)
16609 v.reset(OpPPC64MOVHZreg)
16614 func rewriteValuePPC64_OpTrunc32to8(v *Value) bool {
16616 // match: (Trunc32to8 <t> x)
16617 // cond: isSigned(t)
16618 // result: (MOVBreg x)
16622 if !(isSigned(t)) {
16625 v.reset(OpPPC64MOVBreg)
16629 // match: (Trunc32to8 x)
16630 // result: (MOVBZreg x)
16633 v.reset(OpPPC64MOVBZreg)
16638 func rewriteValuePPC64_OpTrunc64to16(v *Value) bool {
16640 // match: (Trunc64to16 <t> x)
16641 // cond: isSigned(t)
16642 // result: (MOVHreg x)
16646 if !(isSigned(t)) {
16649 v.reset(OpPPC64MOVHreg)
16653 // match: (Trunc64to16 x)
16654 // result: (MOVHZreg x)
16657 v.reset(OpPPC64MOVHZreg)
16662 func rewriteValuePPC64_OpTrunc64to32(v *Value) bool {
16664 // match: (Trunc64to32 <t> x)
16665 // cond: isSigned(t)
16666 // result: (MOVWreg x)
16670 if !(isSigned(t)) {
16673 v.reset(OpPPC64MOVWreg)
16677 // match: (Trunc64to32 x)
16678 // result: (MOVWZreg x)
16681 v.reset(OpPPC64MOVWZreg)
16686 func rewriteValuePPC64_OpTrunc64to8(v *Value) bool {
16688 // match: (Trunc64to8 <t> x)
16689 // cond: isSigned(t)
16690 // result: (MOVBreg x)
16694 if !(isSigned(t)) {
16697 v.reset(OpPPC64MOVBreg)
16701 // match: (Trunc64to8 x)
16702 // result: (MOVBZreg x)
16705 v.reset(OpPPC64MOVBZreg)
16710 func rewriteValuePPC64_OpZero(v *Value) bool {
16714 // match: (Zero [0] _ mem)
16717 if auxIntToInt64(v.AuxInt) != 0 {
16724 // match: (Zero [1] destptr mem)
16725 // result: (MOVBstorezero destptr mem)
16727 if auxIntToInt64(v.AuxInt) != 1 {
16732 v.reset(OpPPC64MOVBstorezero)
16733 v.AddArg2(destptr, mem)
16736 // match: (Zero [2] destptr mem)
16737 // result: (MOVHstorezero destptr mem)
16739 if auxIntToInt64(v.AuxInt) != 2 {
16744 v.reset(OpPPC64MOVHstorezero)
16745 v.AddArg2(destptr, mem)
16748 // match: (Zero [3] destptr mem)
16749 // result: (MOVBstorezero [2] destptr (MOVHstorezero destptr mem))
16751 if auxIntToInt64(v.AuxInt) != 3 {
16756 v.reset(OpPPC64MOVBstorezero)
16757 v.AuxInt = int32ToAuxInt(2)
16758 v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
16759 v0.AddArg2(destptr, mem)
16760 v.AddArg2(destptr, v0)
16763 // match: (Zero [4] destptr mem)
16764 // result: (MOVWstorezero destptr mem)
16766 if auxIntToInt64(v.AuxInt) != 4 {
16771 v.reset(OpPPC64MOVWstorezero)
16772 v.AddArg2(destptr, mem)
16775 // match: (Zero [5] destptr mem)
16776 // result: (MOVBstorezero [4] destptr (MOVWstorezero destptr mem))
16778 if auxIntToInt64(v.AuxInt) != 5 {
16783 v.reset(OpPPC64MOVBstorezero)
16784 v.AuxInt = int32ToAuxInt(4)
16785 v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
16786 v0.AddArg2(destptr, mem)
16787 v.AddArg2(destptr, v0)
16790 // match: (Zero [6] destptr mem)
16791 // result: (MOVHstorezero [4] destptr (MOVWstorezero destptr mem))
16793 if auxIntToInt64(v.AuxInt) != 6 {
16798 v.reset(OpPPC64MOVHstorezero)
16799 v.AuxInt = int32ToAuxInt(4)
16800 v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
16801 v0.AddArg2(destptr, mem)
16802 v.AddArg2(destptr, v0)
16805 // match: (Zero [7] destptr mem)
16806 // result: (MOVBstorezero [6] destptr (MOVHstorezero [4] destptr (MOVWstorezero destptr mem)))
16808 if auxIntToInt64(v.AuxInt) != 7 {
16813 v.reset(OpPPC64MOVBstorezero)
16814 v.AuxInt = int32ToAuxInt(6)
16815 v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
16816 v0.AuxInt = int32ToAuxInt(4)
16817 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
16818 v1.AddArg2(destptr, mem)
16819 v0.AddArg2(destptr, v1)
16820 v.AddArg2(destptr, v0)
16823 // match: (Zero [8] {t} destptr mem)
16824 // result: (MOVDstorezero destptr mem)
16826 if auxIntToInt64(v.AuxInt) != 8 {
16831 v.reset(OpPPC64MOVDstorezero)
16832 v.AddArg2(destptr, mem)
16835 // match: (Zero [12] {t} destptr mem)
16836 // result: (MOVWstorezero [8] destptr (MOVDstorezero [0] destptr mem))
16838 if auxIntToInt64(v.AuxInt) != 12 {
16843 v.reset(OpPPC64MOVWstorezero)
16844 v.AuxInt = int32ToAuxInt(8)
16845 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
16846 v0.AuxInt = int32ToAuxInt(0)
16847 v0.AddArg2(destptr, mem)
16848 v.AddArg2(destptr, v0)
16851 // match: (Zero [16] {t} destptr mem)
16852 // result: (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))
16854 if auxIntToInt64(v.AuxInt) != 16 {
16859 v.reset(OpPPC64MOVDstorezero)
16860 v.AuxInt = int32ToAuxInt(8)
16861 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
16862 v0.AuxInt = int32ToAuxInt(0)
16863 v0.AddArg2(destptr, mem)
16864 v.AddArg2(destptr, v0)
16867 // match: (Zero [24] {t} destptr mem)
16868 // result: (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem)))
16870 if auxIntToInt64(v.AuxInt) != 24 {
16875 v.reset(OpPPC64MOVDstorezero)
16876 v.AuxInt = int32ToAuxInt(16)
16877 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
16878 v0.AuxInt = int32ToAuxInt(8)
16879 v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
16880 v1.AuxInt = int32ToAuxInt(0)
16881 v1.AddArg2(destptr, mem)
16882 v0.AddArg2(destptr, v1)
16883 v.AddArg2(destptr, v0)
16886 // match: (Zero [32] {t} destptr mem)
16887 // result: (MOVDstorezero [24] destptr (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))))
16889 if auxIntToInt64(v.AuxInt) != 32 {
16894 v.reset(OpPPC64MOVDstorezero)
16895 v.AuxInt = int32ToAuxInt(24)
16896 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
16897 v0.AuxInt = int32ToAuxInt(16)
16898 v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
16899 v1.AuxInt = int32ToAuxInt(8)
16900 v2 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
16901 v2.AuxInt = int32ToAuxInt(0)
16902 v2.AddArg2(destptr, mem)
16903 v1.AddArg2(destptr, v2)
16904 v0.AddArg2(destptr, v1)
16905 v.AddArg2(destptr, v0)
16908 // match: (Zero [s] ptr mem)
16909 // cond: objabi.GOPPC64 <= 8 && s < 64
16910 // result: (LoweredZeroShort [s] ptr mem)
16912 s := auxIntToInt64(v.AuxInt)
16915 if !(objabi.GOPPC64 <= 8 && s < 64) {
16918 v.reset(OpPPC64LoweredZeroShort)
16919 v.AuxInt = int64ToAuxInt(s)
16920 v.AddArg2(ptr, mem)
16923 // match: (Zero [s] ptr mem)
16924 // cond: objabi.GOPPC64 <= 8
16925 // result: (LoweredZero [s] ptr mem)
16927 s := auxIntToInt64(v.AuxInt)
16930 if !(objabi.GOPPC64 <= 8) {
16933 v.reset(OpPPC64LoweredZero)
16934 v.AuxInt = int64ToAuxInt(s)
16935 v.AddArg2(ptr, mem)
16938 // match: (Zero [s] ptr mem)
16939 // cond: s < 128 && objabi.GOPPC64 >= 9
16940 // result: (LoweredQuadZeroShort [s] ptr mem)
16942 s := auxIntToInt64(v.AuxInt)
16945 if !(s < 128 && objabi.GOPPC64 >= 9) {
16948 v.reset(OpPPC64LoweredQuadZeroShort)
16949 v.AuxInt = int64ToAuxInt(s)
16950 v.AddArg2(ptr, mem)
16953 // match: (Zero [s] ptr mem)
16954 // cond: objabi.GOPPC64 >= 9
16955 // result: (LoweredQuadZero [s] ptr mem)
16957 s := auxIntToInt64(v.AuxInt)
16960 if !(objabi.GOPPC64 >= 9) {
16963 v.reset(OpPPC64LoweredQuadZero)
16964 v.AuxInt = int64ToAuxInt(s)
16965 v.AddArg2(ptr, mem)
16970 func rewriteBlockPPC64(b *Block) bool {
16973 // match: (EQ (CMPconst [0] (ANDconst [c] x)) yes no)
16974 // result: (EQ (ANDCCconst [c] x) yes no)
16975 for b.Controls[0].Op == OpPPC64CMPconst {
16976 v_0 := b.Controls[0]
16977 if auxIntToInt64(v_0.AuxInt) != 0 {
16980 v_0_0 := v_0.Args[0]
16981 if v_0_0.Op != OpPPC64ANDconst {
16984 c := auxIntToInt64(v_0_0.AuxInt)
16986 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
16987 v0.AuxInt = int64ToAuxInt(c)
16989 b.resetWithControl(BlockPPC64EQ, v0)
16992 // match: (EQ (CMPWconst [0] (ANDconst [c] x)) yes no)
16993 // result: (EQ (ANDCCconst [c] x) yes no)
16994 for b.Controls[0].Op == OpPPC64CMPWconst {
16995 v_0 := b.Controls[0]
16996 if auxIntToInt32(v_0.AuxInt) != 0 {
16999 v_0_0 := v_0.Args[0]
17000 if v_0_0.Op != OpPPC64ANDconst {
17003 c := auxIntToInt64(v_0_0.AuxInt)
17005 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
17006 v0.AuxInt = int64ToAuxInt(c)
17008 b.resetWithControl(BlockPPC64EQ, v0)
17011 // match: (EQ (FlagEQ) yes no)
17012 // result: (First yes no)
17013 for b.Controls[0].Op == OpPPC64FlagEQ {
17014 b.Reset(BlockFirst)
17017 // match: (EQ (FlagLT) yes no)
17018 // result: (First no yes)
17019 for b.Controls[0].Op == OpPPC64FlagLT {
17020 b.Reset(BlockFirst)
17024 // match: (EQ (FlagGT) yes no)
17025 // result: (First no yes)
17026 for b.Controls[0].Op == OpPPC64FlagGT {
17027 b.Reset(BlockFirst)
17031 // match: (EQ (InvertFlags cmp) yes no)
17032 // result: (EQ cmp yes no)
17033 for b.Controls[0].Op == OpPPC64InvertFlags {
17034 v_0 := b.Controls[0]
17036 b.resetWithControl(BlockPPC64EQ, cmp)
17039 // match: (EQ (CMPconst [0] (ANDconst [c] x)) yes no)
17040 // result: (EQ (ANDCCconst [c] x) yes no)
17041 for b.Controls[0].Op == OpPPC64CMPconst {
17042 v_0 := b.Controls[0]
17043 if auxIntToInt64(v_0.AuxInt) != 0 {
17046 v_0_0 := v_0.Args[0]
17047 if v_0_0.Op != OpPPC64ANDconst {
17050 c := auxIntToInt64(v_0_0.AuxInt)
17052 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
17053 v0.AuxInt = int64ToAuxInt(c)
17055 b.resetWithControl(BlockPPC64EQ, v0)
17058 // match: (EQ (CMPWconst [0] (ANDconst [c] x)) yes no)
17059 // result: (EQ (ANDCCconst [c] x) yes no)
17060 for b.Controls[0].Op == OpPPC64CMPWconst {
17061 v_0 := b.Controls[0]
17062 if auxIntToInt32(v_0.AuxInt) != 0 {
17065 v_0_0 := v_0.Args[0]
17066 if v_0_0.Op != OpPPC64ANDconst {
17069 c := auxIntToInt64(v_0_0.AuxInt)
17071 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
17072 v0.AuxInt = int64ToAuxInt(c)
17074 b.resetWithControl(BlockPPC64EQ, v0)
17077 // match: (EQ (CMPconst [0] z:(AND x y)) yes no)
17078 // cond: z.Uses == 1
17079 // result: (EQ (ANDCC x y) yes no)
17080 for b.Controls[0].Op == OpPPC64CMPconst {
17081 v_0 := b.Controls[0]
17082 if auxIntToInt64(v_0.AuxInt) != 0 {
17086 if z.Op != OpPPC64AND {
17092 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
17095 if !(z.Uses == 1) {
17098 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.TypeFlags)
17100 b.resetWithControl(BlockPPC64EQ, v0)
17105 // match: (EQ (CMPconst [0] z:(OR x y)) yes no)
17106 // cond: z.Uses == 1
17107 // result: (EQ (ORCC x y) yes no)
17108 for b.Controls[0].Op == OpPPC64CMPconst {
17109 v_0 := b.Controls[0]
17110 if auxIntToInt64(v_0.AuxInt) != 0 {
17114 if z.Op != OpPPC64OR {
17120 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
17123 if !(z.Uses == 1) {
17126 v0 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.TypeFlags)
17128 b.resetWithControl(BlockPPC64EQ, v0)
17133 // match: (EQ (CMPconst [0] z:(XOR x y)) yes no)
17134 // cond: z.Uses == 1
17135 // result: (EQ (XORCC x y) yes no)
17136 for b.Controls[0].Op == OpPPC64CMPconst {
17137 v_0 := b.Controls[0]
17138 if auxIntToInt64(v_0.AuxInt) != 0 {
17142 if z.Op != OpPPC64XOR {
17148 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
17151 if !(z.Uses == 1) {
17154 v0 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.TypeFlags)
17156 b.resetWithControl(BlockPPC64EQ, v0)
17162 // match: (GE (FlagEQ) yes no)
17163 // result: (First yes no)
17164 for b.Controls[0].Op == OpPPC64FlagEQ {
17165 b.Reset(BlockFirst)
17168 // match: (GE (FlagLT) yes no)
17169 // result: (First no yes)
17170 for b.Controls[0].Op == OpPPC64FlagLT {
17171 b.Reset(BlockFirst)
17175 // match: (GE (FlagGT) yes no)
17176 // result: (First yes no)
17177 for b.Controls[0].Op == OpPPC64FlagGT {
17178 b.Reset(BlockFirst)
17181 // match: (GE (InvertFlags cmp) yes no)
17182 // result: (LE cmp yes no)
17183 for b.Controls[0].Op == OpPPC64InvertFlags {
17184 v_0 := b.Controls[0]
17186 b.resetWithControl(BlockPPC64LE, cmp)
17189 // match: (GE (CMPconst [0] (ANDconst [c] x)) yes no)
17190 // result: (GE (ANDCCconst [c] x) yes no)
17191 for b.Controls[0].Op == OpPPC64CMPconst {
17192 v_0 := b.Controls[0]
17193 if auxIntToInt64(v_0.AuxInt) != 0 {
17196 v_0_0 := v_0.Args[0]
17197 if v_0_0.Op != OpPPC64ANDconst {
17200 c := auxIntToInt64(v_0_0.AuxInt)
17202 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
17203 v0.AuxInt = int64ToAuxInt(c)
17205 b.resetWithControl(BlockPPC64GE, v0)
17208 // match: (GE (CMPWconst [0] (ANDconst [c] x)) yes no)
17209 // result: (GE (ANDCCconst [c] x) yes no)
17210 for b.Controls[0].Op == OpPPC64CMPWconst {
17211 v_0 := b.Controls[0]
17212 if auxIntToInt32(v_0.AuxInt) != 0 {
17215 v_0_0 := v_0.Args[0]
17216 if v_0_0.Op != OpPPC64ANDconst {
17219 c := auxIntToInt64(v_0_0.AuxInt)
17221 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
17222 v0.AuxInt = int64ToAuxInt(c)
17224 b.resetWithControl(BlockPPC64GE, v0)
17227 // match: (GE (CMPconst [0] z:(AND x y)) yes no)
17228 // cond: z.Uses == 1
17229 // result: (GE (ANDCC x y) yes no)
17230 for b.Controls[0].Op == OpPPC64CMPconst {
17231 v_0 := b.Controls[0]
17232 if auxIntToInt64(v_0.AuxInt) != 0 {
17236 if z.Op != OpPPC64AND {
17242 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
17245 if !(z.Uses == 1) {
17248 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.TypeFlags)
17250 b.resetWithControl(BlockPPC64GE, v0)
17255 // match: (GE (CMPconst [0] z:(OR x y)) yes no)
17256 // cond: z.Uses == 1
17257 // result: (GE (ORCC x y) yes no)
17258 for b.Controls[0].Op == OpPPC64CMPconst {
17259 v_0 := b.Controls[0]
17260 if auxIntToInt64(v_0.AuxInt) != 0 {
17264 if z.Op != OpPPC64OR {
17270 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
17273 if !(z.Uses == 1) {
17276 v0 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.TypeFlags)
17278 b.resetWithControl(BlockPPC64GE, v0)
17283 // match: (GE (CMPconst [0] z:(XOR x y)) yes no)
17284 // cond: z.Uses == 1
17285 // result: (GE (XORCC x y) yes no)
17286 for b.Controls[0].Op == OpPPC64CMPconst {
17287 v_0 := b.Controls[0]
17288 if auxIntToInt64(v_0.AuxInt) != 0 {
17292 if z.Op != OpPPC64XOR {
17298 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
17301 if !(z.Uses == 1) {
17304 v0 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.TypeFlags)
17306 b.resetWithControl(BlockPPC64GE, v0)
17312 // match: (GT (FlagEQ) yes no)
17313 // result: (First no yes)
17314 for b.Controls[0].Op == OpPPC64FlagEQ {
17315 b.Reset(BlockFirst)
17319 // match: (GT (FlagLT) yes no)
17320 // result: (First no yes)
17321 for b.Controls[0].Op == OpPPC64FlagLT {
17322 b.Reset(BlockFirst)
17326 // match: (GT (FlagGT) yes no)
17327 // result: (First yes no)
17328 for b.Controls[0].Op == OpPPC64FlagGT {
17329 b.Reset(BlockFirst)
17332 // match: (GT (InvertFlags cmp) yes no)
17333 // result: (LT cmp yes no)
17334 for b.Controls[0].Op == OpPPC64InvertFlags {
17335 v_0 := b.Controls[0]
17337 b.resetWithControl(BlockPPC64LT, cmp)
17340 // match: (GT (CMPconst [0] (ANDconst [c] x)) yes no)
17341 // result: (GT (ANDCCconst [c] x) yes no)
17342 for b.Controls[0].Op == OpPPC64CMPconst {
17343 v_0 := b.Controls[0]
17344 if auxIntToInt64(v_0.AuxInt) != 0 {
17347 v_0_0 := v_0.Args[0]
17348 if v_0_0.Op != OpPPC64ANDconst {
17351 c := auxIntToInt64(v_0_0.AuxInt)
17353 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
17354 v0.AuxInt = int64ToAuxInt(c)
17356 b.resetWithControl(BlockPPC64GT, v0)
17359 // match: (GT (CMPWconst [0] (ANDconst [c] x)) yes no)
17360 // result: (GT (ANDCCconst [c] x) yes no)
17361 for b.Controls[0].Op == OpPPC64CMPWconst {
17362 v_0 := b.Controls[0]
17363 if auxIntToInt32(v_0.AuxInt) != 0 {
17366 v_0_0 := v_0.Args[0]
17367 if v_0_0.Op != OpPPC64ANDconst {
17370 c := auxIntToInt64(v_0_0.AuxInt)
17372 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
17373 v0.AuxInt = int64ToAuxInt(c)
17375 b.resetWithControl(BlockPPC64GT, v0)
17378 // match: (GT (CMPconst [0] z:(AND x y)) yes no)
17379 // cond: z.Uses == 1
17380 // result: (GT (ANDCC x y) yes no)
17381 for b.Controls[0].Op == OpPPC64CMPconst {
17382 v_0 := b.Controls[0]
17383 if auxIntToInt64(v_0.AuxInt) != 0 {
17387 if z.Op != OpPPC64AND {
17393 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
17396 if !(z.Uses == 1) {
17399 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.TypeFlags)
17401 b.resetWithControl(BlockPPC64GT, v0)
17406 // match: (GT (CMPconst [0] z:(OR x y)) yes no)
17407 // cond: z.Uses == 1
17408 // result: (GT (ORCC x y) yes no)
17409 for b.Controls[0].Op == OpPPC64CMPconst {
17410 v_0 := b.Controls[0]
17411 if auxIntToInt64(v_0.AuxInt) != 0 {
17415 if z.Op != OpPPC64OR {
17421 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
17424 if !(z.Uses == 1) {
17427 v0 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.TypeFlags)
17429 b.resetWithControl(BlockPPC64GT, v0)
17434 // match: (GT (CMPconst [0] z:(XOR x y)) yes no)
17435 // cond: z.Uses == 1
17436 // result: (GT (XORCC x y) yes no)
17437 for b.Controls[0].Op == OpPPC64CMPconst {
17438 v_0 := b.Controls[0]
17439 if auxIntToInt64(v_0.AuxInt) != 0 {
17443 if z.Op != OpPPC64XOR {
17449 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
17452 if !(z.Uses == 1) {
17455 v0 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.TypeFlags)
17457 b.resetWithControl(BlockPPC64GT, v0)
17463 // match: (If (Equal cc) yes no)
17464 // result: (EQ cc yes no)
17465 for b.Controls[0].Op == OpPPC64Equal {
17466 v_0 := b.Controls[0]
17468 b.resetWithControl(BlockPPC64EQ, cc)
17471 // match: (If (NotEqual cc) yes no)
17472 // result: (NE cc yes no)
17473 for b.Controls[0].Op == OpPPC64NotEqual {
17474 v_0 := b.Controls[0]
17476 b.resetWithControl(BlockPPC64NE, cc)
17479 // match: (If (LessThan cc) yes no)
17480 // result: (LT cc yes no)
17481 for b.Controls[0].Op == OpPPC64LessThan {
17482 v_0 := b.Controls[0]
17484 b.resetWithControl(BlockPPC64LT, cc)
17487 // match: (If (LessEqual cc) yes no)
17488 // result: (LE cc yes no)
17489 for b.Controls[0].Op == OpPPC64LessEqual {
17490 v_0 := b.Controls[0]
17492 b.resetWithControl(BlockPPC64LE, cc)
17495 // match: (If (GreaterThan cc) yes no)
17496 // result: (GT cc yes no)
17497 for b.Controls[0].Op == OpPPC64GreaterThan {
17498 v_0 := b.Controls[0]
17500 b.resetWithControl(BlockPPC64GT, cc)
17503 // match: (If (GreaterEqual cc) yes no)
17504 // result: (GE cc yes no)
17505 for b.Controls[0].Op == OpPPC64GreaterEqual {
17506 v_0 := b.Controls[0]
17508 b.resetWithControl(BlockPPC64GE, cc)
17511 // match: (If (FLessThan cc) yes no)
17512 // result: (FLT cc yes no)
17513 for b.Controls[0].Op == OpPPC64FLessThan {
17514 v_0 := b.Controls[0]
17516 b.resetWithControl(BlockPPC64FLT, cc)
17519 // match: (If (FLessEqual cc) yes no)
17520 // result: (FLE cc yes no)
17521 for b.Controls[0].Op == OpPPC64FLessEqual {
17522 v_0 := b.Controls[0]
17524 b.resetWithControl(BlockPPC64FLE, cc)
17527 // match: (If (FGreaterThan cc) yes no)
17528 // result: (FGT cc yes no)
17529 for b.Controls[0].Op == OpPPC64FGreaterThan {
17530 v_0 := b.Controls[0]
17532 b.resetWithControl(BlockPPC64FGT, cc)
17535 // match: (If (FGreaterEqual cc) yes no)
17536 // result: (FGE cc yes no)
17537 for b.Controls[0].Op == OpPPC64FGreaterEqual {
17538 v_0 := b.Controls[0]
17540 b.resetWithControl(BlockPPC64FGE, cc)
17543 // match: (If cond yes no)
17544 // result: (NE (CMPWconst [0] cond) yes no)
17546 cond := b.Controls[0]
17547 v0 := b.NewValue0(cond.Pos, OpPPC64CMPWconst, types.TypeFlags)
17548 v0.AuxInt = int32ToAuxInt(0)
17550 b.resetWithControl(BlockPPC64NE, v0)
17554 // match: (LE (FlagEQ) yes no)
17555 // result: (First yes no)
17556 for b.Controls[0].Op == OpPPC64FlagEQ {
17557 b.Reset(BlockFirst)
17560 // match: (LE (FlagLT) yes no)
17561 // result: (First yes no)
17562 for b.Controls[0].Op == OpPPC64FlagLT {
17563 b.Reset(BlockFirst)
17566 // match: (LE (FlagGT) yes no)
17567 // result: (First no yes)
17568 for b.Controls[0].Op == OpPPC64FlagGT {
17569 b.Reset(BlockFirst)
17573 // match: (LE (InvertFlags cmp) yes no)
17574 // result: (GE cmp yes no)
17575 for b.Controls[0].Op == OpPPC64InvertFlags {
17576 v_0 := b.Controls[0]
17578 b.resetWithControl(BlockPPC64GE, cmp)
17581 // match: (LE (CMPconst [0] (ANDconst [c] x)) yes no)
17582 // result: (LE (ANDCCconst [c] x) yes no)
17583 for b.Controls[0].Op == OpPPC64CMPconst {
17584 v_0 := b.Controls[0]
17585 if auxIntToInt64(v_0.AuxInt) != 0 {
17588 v_0_0 := v_0.Args[0]
17589 if v_0_0.Op != OpPPC64ANDconst {
17592 c := auxIntToInt64(v_0_0.AuxInt)
17594 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
17595 v0.AuxInt = int64ToAuxInt(c)
17597 b.resetWithControl(BlockPPC64LE, v0)
17600 // match: (LE (CMPWconst [0] (ANDconst [c] x)) yes no)
17601 // result: (LE (ANDCCconst [c] x) yes no)
17602 for b.Controls[0].Op == OpPPC64CMPWconst {
17603 v_0 := b.Controls[0]
17604 if auxIntToInt32(v_0.AuxInt) != 0 {
17607 v_0_0 := v_0.Args[0]
17608 if v_0_0.Op != OpPPC64ANDconst {
17611 c := auxIntToInt64(v_0_0.AuxInt)
17613 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
17614 v0.AuxInt = int64ToAuxInt(c)
17616 b.resetWithControl(BlockPPC64LE, v0)
17619 // match: (LE (CMPconst [0] z:(AND x y)) yes no)
17620 // cond: z.Uses == 1
17621 // result: (LE (ANDCC x y) yes no)
17622 for b.Controls[0].Op == OpPPC64CMPconst {
17623 v_0 := b.Controls[0]
17624 if auxIntToInt64(v_0.AuxInt) != 0 {
17628 if z.Op != OpPPC64AND {
17634 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
17637 if !(z.Uses == 1) {
17640 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.TypeFlags)
17642 b.resetWithControl(BlockPPC64LE, v0)
17647 // match: (LE (CMPconst [0] z:(OR x y)) yes no)
17648 // cond: z.Uses == 1
17649 // result: (LE (ORCC x y) yes no)
17650 for b.Controls[0].Op == OpPPC64CMPconst {
17651 v_0 := b.Controls[0]
17652 if auxIntToInt64(v_0.AuxInt) != 0 {
17656 if z.Op != OpPPC64OR {
17662 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
17665 if !(z.Uses == 1) {
17668 v0 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.TypeFlags)
17670 b.resetWithControl(BlockPPC64LE, v0)
17675 // match: (LE (CMPconst [0] z:(XOR x y)) yes no)
17676 // cond: z.Uses == 1
17677 // result: (LE (XORCC x y) yes no)
17678 for b.Controls[0].Op == OpPPC64CMPconst {
17679 v_0 := b.Controls[0]
17680 if auxIntToInt64(v_0.AuxInt) != 0 {
17684 if z.Op != OpPPC64XOR {
17690 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
17693 if !(z.Uses == 1) {
17696 v0 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.TypeFlags)
17698 b.resetWithControl(BlockPPC64LE, v0)
17704 // match: (LT (FlagEQ) yes no)
17705 // result: (First no yes)
17706 for b.Controls[0].Op == OpPPC64FlagEQ {
17707 b.Reset(BlockFirst)
17711 // match: (LT (FlagLT) yes no)
17712 // result: (First yes no)
17713 for b.Controls[0].Op == OpPPC64FlagLT {
17714 b.Reset(BlockFirst)
17717 // match: (LT (FlagGT) yes no)
17718 // result: (First no yes)
17719 for b.Controls[0].Op == OpPPC64FlagGT {
17720 b.Reset(BlockFirst)
17724 // match: (LT (InvertFlags cmp) yes no)
17725 // result: (GT cmp yes no)
17726 for b.Controls[0].Op == OpPPC64InvertFlags {
17727 v_0 := b.Controls[0]
17729 b.resetWithControl(BlockPPC64GT, cmp)
17732 // match: (LT (CMPconst [0] (ANDconst [c] x)) yes no)
17733 // result: (LT (ANDCCconst [c] x) yes no)
17734 for b.Controls[0].Op == OpPPC64CMPconst {
17735 v_0 := b.Controls[0]
17736 if auxIntToInt64(v_0.AuxInt) != 0 {
17739 v_0_0 := v_0.Args[0]
17740 if v_0_0.Op != OpPPC64ANDconst {
17743 c := auxIntToInt64(v_0_0.AuxInt)
17745 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
17746 v0.AuxInt = int64ToAuxInt(c)
17748 b.resetWithControl(BlockPPC64LT, v0)
17751 // match: (LT (CMPWconst [0] (ANDconst [c] x)) yes no)
17752 // result: (LT (ANDCCconst [c] x) yes no)
17753 for b.Controls[0].Op == OpPPC64CMPWconst {
17754 v_0 := b.Controls[0]
17755 if auxIntToInt32(v_0.AuxInt) != 0 {
17758 v_0_0 := v_0.Args[0]
17759 if v_0_0.Op != OpPPC64ANDconst {
17762 c := auxIntToInt64(v_0_0.AuxInt)
17764 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
17765 v0.AuxInt = int64ToAuxInt(c)
17767 b.resetWithControl(BlockPPC64LT, v0)
17770 // match: (LT (CMPconst [0] z:(AND x y)) yes no)
17771 // cond: z.Uses == 1
17772 // result: (LT (ANDCC x y) yes no)
17773 for b.Controls[0].Op == OpPPC64CMPconst {
17774 v_0 := b.Controls[0]
17775 if auxIntToInt64(v_0.AuxInt) != 0 {
17779 if z.Op != OpPPC64AND {
17785 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
17788 if !(z.Uses == 1) {
17791 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.TypeFlags)
17793 b.resetWithControl(BlockPPC64LT, v0)
17798 // match: (LT (CMPconst [0] z:(OR x y)) yes no)
17799 // cond: z.Uses == 1
17800 // result: (LT (ORCC x y) yes no)
17801 for b.Controls[0].Op == OpPPC64CMPconst {
17802 v_0 := b.Controls[0]
17803 if auxIntToInt64(v_0.AuxInt) != 0 {
17807 if z.Op != OpPPC64OR {
17813 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
17816 if !(z.Uses == 1) {
17819 v0 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.TypeFlags)
17821 b.resetWithControl(BlockPPC64LT, v0)
17826 // match: (LT (CMPconst [0] z:(XOR x y)) yes no)
17827 // cond: z.Uses == 1
17828 // result: (LT (XORCC x y) yes no)
17829 for b.Controls[0].Op == OpPPC64CMPconst {
17830 v_0 := b.Controls[0]
17831 if auxIntToInt64(v_0.AuxInt) != 0 {
17835 if z.Op != OpPPC64XOR {
17841 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
17844 if !(z.Uses == 1) {
17847 v0 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.TypeFlags)
17849 b.resetWithControl(BlockPPC64LT, v0)
17855 // match: (NE (CMPWconst [0] (Equal cc)) yes no)
17856 // result: (EQ cc yes no)
17857 for b.Controls[0].Op == OpPPC64CMPWconst {
17858 v_0 := b.Controls[0]
17859 if auxIntToInt32(v_0.AuxInt) != 0 {
17862 v_0_0 := v_0.Args[0]
17863 if v_0_0.Op != OpPPC64Equal {
17866 cc := v_0_0.Args[0]
17867 b.resetWithControl(BlockPPC64EQ, cc)
17870 // match: (NE (CMPWconst [0] (NotEqual cc)) yes no)
17871 // result: (NE cc yes no)
17872 for b.Controls[0].Op == OpPPC64CMPWconst {
17873 v_0 := b.Controls[0]
17874 if auxIntToInt32(v_0.AuxInt) != 0 {
17877 v_0_0 := v_0.Args[0]
17878 if v_0_0.Op != OpPPC64NotEqual {
17881 cc := v_0_0.Args[0]
17882 b.resetWithControl(BlockPPC64NE, cc)
17885 // match: (NE (CMPWconst [0] (LessThan cc)) yes no)
17886 // result: (LT cc yes no)
17887 for b.Controls[0].Op == OpPPC64CMPWconst {
17888 v_0 := b.Controls[0]
17889 if auxIntToInt32(v_0.AuxInt) != 0 {
17892 v_0_0 := v_0.Args[0]
17893 if v_0_0.Op != OpPPC64LessThan {
17896 cc := v_0_0.Args[0]
17897 b.resetWithControl(BlockPPC64LT, cc)
17900 // match: (NE (CMPWconst [0] (LessEqual cc)) yes no)
17901 // result: (LE cc yes no)
17902 for b.Controls[0].Op == OpPPC64CMPWconst {
17903 v_0 := b.Controls[0]
17904 if auxIntToInt32(v_0.AuxInt) != 0 {
17907 v_0_0 := v_0.Args[0]
17908 if v_0_0.Op != OpPPC64LessEqual {
17911 cc := v_0_0.Args[0]
17912 b.resetWithControl(BlockPPC64LE, cc)
17915 // match: (NE (CMPWconst [0] (GreaterThan cc)) yes no)
17916 // result: (GT cc yes no)
17917 for b.Controls[0].Op == OpPPC64CMPWconst {
17918 v_0 := b.Controls[0]
17919 if auxIntToInt32(v_0.AuxInt) != 0 {
17922 v_0_0 := v_0.Args[0]
17923 if v_0_0.Op != OpPPC64GreaterThan {
17926 cc := v_0_0.Args[0]
17927 b.resetWithControl(BlockPPC64GT, cc)
17930 // match: (NE (CMPWconst [0] (GreaterEqual cc)) yes no)
17931 // result: (GE cc yes no)
17932 for b.Controls[0].Op == OpPPC64CMPWconst {
17933 v_0 := b.Controls[0]
17934 if auxIntToInt32(v_0.AuxInt) != 0 {
17937 v_0_0 := v_0.Args[0]
17938 if v_0_0.Op != OpPPC64GreaterEqual {
17941 cc := v_0_0.Args[0]
17942 b.resetWithControl(BlockPPC64GE, cc)
17945 // match: (NE (CMPWconst [0] (FLessThan cc)) yes no)
17946 // result: (FLT cc yes no)
17947 for b.Controls[0].Op == OpPPC64CMPWconst {
17948 v_0 := b.Controls[0]
17949 if auxIntToInt32(v_0.AuxInt) != 0 {
17952 v_0_0 := v_0.Args[0]
17953 if v_0_0.Op != OpPPC64FLessThan {
17956 cc := v_0_0.Args[0]
17957 b.resetWithControl(BlockPPC64FLT, cc)
17960 // match: (NE (CMPWconst [0] (FLessEqual cc)) yes no)
17961 // result: (FLE cc yes no)
17962 for b.Controls[0].Op == OpPPC64CMPWconst {
17963 v_0 := b.Controls[0]
17964 if auxIntToInt32(v_0.AuxInt) != 0 {
17967 v_0_0 := v_0.Args[0]
17968 if v_0_0.Op != OpPPC64FLessEqual {
17971 cc := v_0_0.Args[0]
17972 b.resetWithControl(BlockPPC64FLE, cc)
17975 // match: (NE (CMPWconst [0] (FGreaterThan cc)) yes no)
17976 // result: (FGT cc yes no)
17977 for b.Controls[0].Op == OpPPC64CMPWconst {
17978 v_0 := b.Controls[0]
17979 if auxIntToInt32(v_0.AuxInt) != 0 {
17982 v_0_0 := v_0.Args[0]
17983 if v_0_0.Op != OpPPC64FGreaterThan {
17986 cc := v_0_0.Args[0]
17987 b.resetWithControl(BlockPPC64FGT, cc)
17990 // match: (NE (CMPWconst [0] (FGreaterEqual cc)) yes no)
17991 // result: (FGE cc yes no)
17992 for b.Controls[0].Op == OpPPC64CMPWconst {
17993 v_0 := b.Controls[0]
17994 if auxIntToInt32(v_0.AuxInt) != 0 {
17997 v_0_0 := v_0.Args[0]
17998 if v_0_0.Op != OpPPC64FGreaterEqual {
18001 cc := v_0_0.Args[0]
18002 b.resetWithControl(BlockPPC64FGE, cc)
18005 // match: (NE (CMPconst [0] (ANDconst [c] x)) yes no)
18006 // result: (NE (ANDCCconst [c] x) yes no)
18007 for b.Controls[0].Op == OpPPC64CMPconst {
18008 v_0 := b.Controls[0]
18009 if auxIntToInt64(v_0.AuxInt) != 0 {
18012 v_0_0 := v_0.Args[0]
18013 if v_0_0.Op != OpPPC64ANDconst {
18016 c := auxIntToInt64(v_0_0.AuxInt)
18018 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
18019 v0.AuxInt = int64ToAuxInt(c)
18021 b.resetWithControl(BlockPPC64NE, v0)
18024 // match: (NE (CMPWconst [0] (ANDconst [c] x)) yes no)
18025 // result: (NE (ANDCCconst [c] x) yes no)
18026 for b.Controls[0].Op == OpPPC64CMPWconst {
18027 v_0 := b.Controls[0]
18028 if auxIntToInt32(v_0.AuxInt) != 0 {
18031 v_0_0 := v_0.Args[0]
18032 if v_0_0.Op != OpPPC64ANDconst {
18035 c := auxIntToInt64(v_0_0.AuxInt)
18037 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
18038 v0.AuxInt = int64ToAuxInt(c)
18040 b.resetWithControl(BlockPPC64NE, v0)
18043 // match: (NE (FlagEQ) yes no)
18044 // result: (First no yes)
18045 for b.Controls[0].Op == OpPPC64FlagEQ {
18046 b.Reset(BlockFirst)
18050 // match: (NE (FlagLT) yes no)
18051 // result: (First yes no)
18052 for b.Controls[0].Op == OpPPC64FlagLT {
18053 b.Reset(BlockFirst)
18056 // match: (NE (FlagGT) yes no)
18057 // result: (First yes no)
18058 for b.Controls[0].Op == OpPPC64FlagGT {
18059 b.Reset(BlockFirst)
18062 // match: (NE (InvertFlags cmp) yes no)
18063 // result: (NE cmp yes no)
18064 for b.Controls[0].Op == OpPPC64InvertFlags {
18065 v_0 := b.Controls[0]
18067 b.resetWithControl(BlockPPC64NE, cmp)
18070 // match: (NE (CMPconst [0] (ANDconst [c] x)) yes no)
18071 // result: (NE (ANDCCconst [c] x) yes no)
18072 for b.Controls[0].Op == OpPPC64CMPconst {
18073 v_0 := b.Controls[0]
18074 if auxIntToInt64(v_0.AuxInt) != 0 {
18077 v_0_0 := v_0.Args[0]
18078 if v_0_0.Op != OpPPC64ANDconst {
18081 c := auxIntToInt64(v_0_0.AuxInt)
18083 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
18084 v0.AuxInt = int64ToAuxInt(c)
18086 b.resetWithControl(BlockPPC64NE, v0)
18089 // match: (NE (CMPWconst [0] (ANDconst [c] x)) yes no)
18090 // result: (NE (ANDCCconst [c] x) yes no)
18091 for b.Controls[0].Op == OpPPC64CMPWconst {
18092 v_0 := b.Controls[0]
18093 if auxIntToInt32(v_0.AuxInt) != 0 {
18096 v_0_0 := v_0.Args[0]
18097 if v_0_0.Op != OpPPC64ANDconst {
18100 c := auxIntToInt64(v_0_0.AuxInt)
18102 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
18103 v0.AuxInt = int64ToAuxInt(c)
18105 b.resetWithControl(BlockPPC64NE, v0)
18108 // match: (NE (CMPconst [0] z:(AND x y)) yes no)
18109 // cond: z.Uses == 1
18110 // result: (NE (ANDCC x y) yes no)
18111 for b.Controls[0].Op == OpPPC64CMPconst {
18112 v_0 := b.Controls[0]
18113 if auxIntToInt64(v_0.AuxInt) != 0 {
18117 if z.Op != OpPPC64AND {
18123 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
18126 if !(z.Uses == 1) {
18129 v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.TypeFlags)
18131 b.resetWithControl(BlockPPC64NE, v0)
18136 // match: (NE (CMPconst [0] z:(OR x y)) yes no)
18137 // cond: z.Uses == 1
18138 // result: (NE (ORCC x y) yes no)
18139 for b.Controls[0].Op == OpPPC64CMPconst {
18140 v_0 := b.Controls[0]
18141 if auxIntToInt64(v_0.AuxInt) != 0 {
18145 if z.Op != OpPPC64OR {
18151 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
18154 if !(z.Uses == 1) {
18157 v0 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.TypeFlags)
18159 b.resetWithControl(BlockPPC64NE, v0)
18164 // match: (NE (CMPconst [0] z:(XOR x y)) yes no)
18165 // cond: z.Uses == 1
18166 // result: (NE (XORCC x y) yes no)
18167 for b.Controls[0].Op == OpPPC64CMPconst {
18168 v_0 := b.Controls[0]
18169 if auxIntToInt64(v_0.AuxInt) != 0 {
18173 if z.Op != OpPPC64XOR {
18179 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
18182 if !(z.Uses == 1) {
18185 v0 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.TypeFlags)
18187 b.resetWithControl(BlockPPC64NE, v0)