1 // Code generated from _gen/PPC64.rules using 'go generate'; DO NOT EDIT.
5 import "internal/buildcfg"
7 import "cmd/compile/internal/types"
9 func rewriteValuePPC64(v *Value) bool {
36 return rewriteValuePPC64_OpAddr(v)
53 v.Op = OpPPC64LoweredAtomicAdd32
56 v.Op = OpPPC64LoweredAtomicAdd64
59 v.Op = OpPPC64LoweredAtomicAnd32
62 v.Op = OpPPC64LoweredAtomicAnd8
64 case OpAtomicCompareAndSwap32:
65 return rewriteValuePPC64_OpAtomicCompareAndSwap32(v)
66 case OpAtomicCompareAndSwap64:
67 return rewriteValuePPC64_OpAtomicCompareAndSwap64(v)
68 case OpAtomicCompareAndSwapRel32:
69 return rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v)
70 case OpAtomicExchange32:
71 v.Op = OpPPC64LoweredAtomicExchange32
73 case OpAtomicExchange64:
74 v.Op = OpPPC64LoweredAtomicExchange64
77 return rewriteValuePPC64_OpAtomicLoad32(v)
79 return rewriteValuePPC64_OpAtomicLoad64(v)
81 return rewriteValuePPC64_OpAtomicLoad8(v)
82 case OpAtomicLoadAcq32:
83 return rewriteValuePPC64_OpAtomicLoadAcq32(v)
84 case OpAtomicLoadAcq64:
85 return rewriteValuePPC64_OpAtomicLoadAcq64(v)
87 return rewriteValuePPC64_OpAtomicLoadPtr(v)
89 v.Op = OpPPC64LoweredAtomicOr32
92 v.Op = OpPPC64LoweredAtomicOr8
95 return rewriteValuePPC64_OpAtomicStore32(v)
97 return rewriteValuePPC64_OpAtomicStore64(v)
99 return rewriteValuePPC64_OpAtomicStore8(v)
100 case OpAtomicStoreRel32:
101 return rewriteValuePPC64_OpAtomicStoreRel32(v)
102 case OpAtomicStoreRel64:
103 return rewriteValuePPC64_OpAtomicStoreRel64(v)
105 return rewriteValuePPC64_OpAvg64u(v)
107 return rewriteValuePPC64_OpBitLen32(v)
109 return rewriteValuePPC64_OpBitLen64(v)
111 return rewriteValuePPC64_OpBswap16(v)
113 return rewriteValuePPC64_OpBswap32(v)
115 return rewriteValuePPC64_OpBswap64(v)
120 v.Op = OpPPC64CALLclosure
123 return rewriteValuePPC64_OpCom16(v)
125 return rewriteValuePPC64_OpCom32(v)
127 return rewriteValuePPC64_OpCom64(v)
129 return rewriteValuePPC64_OpCom8(v)
131 return rewriteValuePPC64_OpCondSelect(v)
133 return rewriteValuePPC64_OpConst16(v)
135 return rewriteValuePPC64_OpConst32(v)
137 v.Op = OpPPC64FMOVSconst
140 return rewriteValuePPC64_OpConst64(v)
142 v.Op = OpPPC64FMOVDconst
145 return rewriteValuePPC64_OpConst8(v)
147 return rewriteValuePPC64_OpConstBool(v)
149 return rewriteValuePPC64_OpConstNil(v)
151 return rewriteValuePPC64_OpCopysign(v)
153 return rewriteValuePPC64_OpCtz16(v)
155 return rewriteValuePPC64_OpCtz32(v)
160 return rewriteValuePPC64_OpCtz64(v)
165 return rewriteValuePPC64_OpCtz8(v)
167 return rewriteValuePPC64_OpCvt32Fto32(v)
169 return rewriteValuePPC64_OpCvt32Fto64(v)
174 return rewriteValuePPC64_OpCvt32to32F(v)
176 return rewriteValuePPC64_OpCvt32to64F(v)
178 return rewriteValuePPC64_OpCvt64Fto32(v)
183 return rewriteValuePPC64_OpCvt64Fto64(v)
185 return rewriteValuePPC64_OpCvt64to32F(v)
187 return rewriteValuePPC64_OpCvt64to64F(v)
188 case OpCvtBoolToUint8:
192 return rewriteValuePPC64_OpDiv16(v)
194 return rewriteValuePPC64_OpDiv16u(v)
196 return rewriteValuePPC64_OpDiv32(v)
204 return rewriteValuePPC64_OpDiv64(v)
212 return rewriteValuePPC64_OpDiv8(v)
214 return rewriteValuePPC64_OpDiv8u(v)
216 return rewriteValuePPC64_OpEq16(v)
218 return rewriteValuePPC64_OpEq32(v)
220 return rewriteValuePPC64_OpEq32F(v)
222 return rewriteValuePPC64_OpEq64(v)
224 return rewriteValuePPC64_OpEq64F(v)
226 return rewriteValuePPC64_OpEq8(v)
228 return rewriteValuePPC64_OpEqB(v)
230 return rewriteValuePPC64_OpEqPtr(v)
238 v.Op = OpPPC64LoweredGetCallerPC
241 v.Op = OpPPC64LoweredGetCallerSP
243 case OpGetClosurePtr:
244 v.Op = OpPPC64LoweredGetClosurePtr
259 v.Op = OpPPC64CALLinter
262 return rewriteValuePPC64_OpIsInBounds(v)
264 return rewriteValuePPC64_OpIsNonNil(v)
265 case OpIsSliceInBounds:
266 return rewriteValuePPC64_OpIsSliceInBounds(v)
268 return rewriteValuePPC64_OpLeq16(v)
270 return rewriteValuePPC64_OpLeq16U(v)
272 return rewriteValuePPC64_OpLeq32(v)
274 return rewriteValuePPC64_OpLeq32F(v)
276 return rewriteValuePPC64_OpLeq32U(v)
278 return rewriteValuePPC64_OpLeq64(v)
280 return rewriteValuePPC64_OpLeq64F(v)
282 return rewriteValuePPC64_OpLeq64U(v)
284 return rewriteValuePPC64_OpLeq8(v)
286 return rewriteValuePPC64_OpLeq8U(v)
288 return rewriteValuePPC64_OpLess16(v)
290 return rewriteValuePPC64_OpLess16U(v)
292 return rewriteValuePPC64_OpLess32(v)
294 return rewriteValuePPC64_OpLess32F(v)
296 return rewriteValuePPC64_OpLess32U(v)
298 return rewriteValuePPC64_OpLess64(v)
300 return rewriteValuePPC64_OpLess64F(v)
302 return rewriteValuePPC64_OpLess64U(v)
304 return rewriteValuePPC64_OpLess8(v)
306 return rewriteValuePPC64_OpLess8U(v)
308 return rewriteValuePPC64_OpLoad(v)
310 return rewriteValuePPC64_OpLocalAddr(v)
312 return rewriteValuePPC64_OpLsh16x16(v)
314 return rewriteValuePPC64_OpLsh16x32(v)
316 return rewriteValuePPC64_OpLsh16x64(v)
318 return rewriteValuePPC64_OpLsh16x8(v)
320 return rewriteValuePPC64_OpLsh32x16(v)
322 return rewriteValuePPC64_OpLsh32x32(v)
324 return rewriteValuePPC64_OpLsh32x64(v)
326 return rewriteValuePPC64_OpLsh32x8(v)
328 return rewriteValuePPC64_OpLsh64x16(v)
330 return rewriteValuePPC64_OpLsh64x32(v)
332 return rewriteValuePPC64_OpLsh64x64(v)
334 return rewriteValuePPC64_OpLsh64x8(v)
336 return rewriteValuePPC64_OpLsh8x16(v)
338 return rewriteValuePPC64_OpLsh8x32(v)
340 return rewriteValuePPC64_OpLsh8x64(v)
342 return rewriteValuePPC64_OpLsh8x8(v)
344 return rewriteValuePPC64_OpMod16(v)
346 return rewriteValuePPC64_OpMod16u(v)
348 return rewriteValuePPC64_OpMod32(v)
350 return rewriteValuePPC64_OpMod32u(v)
352 return rewriteValuePPC64_OpMod64(v)
354 return rewriteValuePPC64_OpMod64u(v)
356 return rewriteValuePPC64_OpMod8(v)
358 return rewriteValuePPC64_OpMod8u(v)
360 return rewriteValuePPC64_OpMove(v)
398 return rewriteValuePPC64_OpNeq16(v)
400 return rewriteValuePPC64_OpNeq32(v)
402 return rewriteValuePPC64_OpNeq32F(v)
404 return rewriteValuePPC64_OpNeq64(v)
406 return rewriteValuePPC64_OpNeq64F(v)
408 return rewriteValuePPC64_OpNeq8(v)
413 return rewriteValuePPC64_OpNeqPtr(v)
415 v.Op = OpPPC64LoweredNilCheck
418 return rewriteValuePPC64_OpNot(v)
420 return rewriteValuePPC64_OpOffPtr(v)
437 return rewriteValuePPC64_OpPPC64ADD(v)
439 return rewriteValuePPC64_OpPPC64ADDE(v)
440 case OpPPC64ADDconst:
441 return rewriteValuePPC64_OpPPC64ADDconst(v)
443 return rewriteValuePPC64_OpPPC64AND(v)
444 case OpPPC64ANDCCconst:
445 return rewriteValuePPC64_OpPPC64ANDCCconst(v)
447 return rewriteValuePPC64_OpPPC64ANDN(v)
449 return rewriteValuePPC64_OpPPC64BRD(v)
451 return rewriteValuePPC64_OpPPC64BRH(v)
453 return rewriteValuePPC64_OpPPC64BRW(v)
454 case OpPPC64CLRLSLDI:
455 return rewriteValuePPC64_OpPPC64CLRLSLDI(v)
457 return rewriteValuePPC64_OpPPC64CMP(v)
459 return rewriteValuePPC64_OpPPC64CMPU(v)
460 case OpPPC64CMPUconst:
461 return rewriteValuePPC64_OpPPC64CMPUconst(v)
463 return rewriteValuePPC64_OpPPC64CMPW(v)
465 return rewriteValuePPC64_OpPPC64CMPWU(v)
466 case OpPPC64CMPWUconst:
467 return rewriteValuePPC64_OpPPC64CMPWUconst(v)
468 case OpPPC64CMPWconst:
469 return rewriteValuePPC64_OpPPC64CMPWconst(v)
470 case OpPPC64CMPconst:
471 return rewriteValuePPC64_OpPPC64CMPconst(v)
473 return rewriteValuePPC64_OpPPC64Equal(v)
475 return rewriteValuePPC64_OpPPC64FABS(v)
477 return rewriteValuePPC64_OpPPC64FADD(v)
479 return rewriteValuePPC64_OpPPC64FADDS(v)
481 return rewriteValuePPC64_OpPPC64FCEIL(v)
483 return rewriteValuePPC64_OpPPC64FFLOOR(v)
484 case OpPPC64FGreaterEqual:
485 return rewriteValuePPC64_OpPPC64FGreaterEqual(v)
486 case OpPPC64FGreaterThan:
487 return rewriteValuePPC64_OpPPC64FGreaterThan(v)
488 case OpPPC64FLessEqual:
489 return rewriteValuePPC64_OpPPC64FLessEqual(v)
490 case OpPPC64FLessThan:
491 return rewriteValuePPC64_OpPPC64FLessThan(v)
492 case OpPPC64FMOVDload:
493 return rewriteValuePPC64_OpPPC64FMOVDload(v)
494 case OpPPC64FMOVDstore:
495 return rewriteValuePPC64_OpPPC64FMOVDstore(v)
496 case OpPPC64FMOVSload:
497 return rewriteValuePPC64_OpPPC64FMOVSload(v)
498 case OpPPC64FMOVSstore:
499 return rewriteValuePPC64_OpPPC64FMOVSstore(v)
501 return rewriteValuePPC64_OpPPC64FNEG(v)
503 return rewriteValuePPC64_OpPPC64FSQRT(v)
505 return rewriteValuePPC64_OpPPC64FSUB(v)
507 return rewriteValuePPC64_OpPPC64FSUBS(v)
509 return rewriteValuePPC64_OpPPC64FTRUNC(v)
510 case OpPPC64GreaterEqual:
511 return rewriteValuePPC64_OpPPC64GreaterEqual(v)
512 case OpPPC64GreaterThan:
513 return rewriteValuePPC64_OpPPC64GreaterThan(v)
515 return rewriteValuePPC64_OpPPC64ISEL(v)
516 case OpPPC64LessEqual:
517 return rewriteValuePPC64_OpPPC64LessEqual(v)
518 case OpPPC64LessThan:
519 return rewriteValuePPC64_OpPPC64LessThan(v)
521 return rewriteValuePPC64_OpPPC64MFVSRD(v)
522 case OpPPC64MOVBZload:
523 return rewriteValuePPC64_OpPPC64MOVBZload(v)
524 case OpPPC64MOVBZloadidx:
525 return rewriteValuePPC64_OpPPC64MOVBZloadidx(v)
526 case OpPPC64MOVBZreg:
527 return rewriteValuePPC64_OpPPC64MOVBZreg(v)
529 return rewriteValuePPC64_OpPPC64MOVBreg(v)
530 case OpPPC64MOVBstore:
531 return rewriteValuePPC64_OpPPC64MOVBstore(v)
532 case OpPPC64MOVBstoreidx:
533 return rewriteValuePPC64_OpPPC64MOVBstoreidx(v)
534 case OpPPC64MOVBstorezero:
535 return rewriteValuePPC64_OpPPC64MOVBstorezero(v)
536 case OpPPC64MOVDload:
537 return rewriteValuePPC64_OpPPC64MOVDload(v)
538 case OpPPC64MOVDloadidx:
539 return rewriteValuePPC64_OpPPC64MOVDloadidx(v)
540 case OpPPC64MOVDstore:
541 return rewriteValuePPC64_OpPPC64MOVDstore(v)
542 case OpPPC64MOVDstoreidx:
543 return rewriteValuePPC64_OpPPC64MOVDstoreidx(v)
544 case OpPPC64MOVDstorezero:
545 return rewriteValuePPC64_OpPPC64MOVDstorezero(v)
546 case OpPPC64MOVHBRstore:
547 return rewriteValuePPC64_OpPPC64MOVHBRstore(v)
548 case OpPPC64MOVHZload:
549 return rewriteValuePPC64_OpPPC64MOVHZload(v)
550 case OpPPC64MOVHZloadidx:
551 return rewriteValuePPC64_OpPPC64MOVHZloadidx(v)
552 case OpPPC64MOVHZreg:
553 return rewriteValuePPC64_OpPPC64MOVHZreg(v)
554 case OpPPC64MOVHload:
555 return rewriteValuePPC64_OpPPC64MOVHload(v)
556 case OpPPC64MOVHloadidx:
557 return rewriteValuePPC64_OpPPC64MOVHloadidx(v)
559 return rewriteValuePPC64_OpPPC64MOVHreg(v)
560 case OpPPC64MOVHstore:
561 return rewriteValuePPC64_OpPPC64MOVHstore(v)
562 case OpPPC64MOVHstoreidx:
563 return rewriteValuePPC64_OpPPC64MOVHstoreidx(v)
564 case OpPPC64MOVHstorezero:
565 return rewriteValuePPC64_OpPPC64MOVHstorezero(v)
566 case OpPPC64MOVWBRstore:
567 return rewriteValuePPC64_OpPPC64MOVWBRstore(v)
568 case OpPPC64MOVWZload:
569 return rewriteValuePPC64_OpPPC64MOVWZload(v)
570 case OpPPC64MOVWZloadidx:
571 return rewriteValuePPC64_OpPPC64MOVWZloadidx(v)
572 case OpPPC64MOVWZreg:
573 return rewriteValuePPC64_OpPPC64MOVWZreg(v)
574 case OpPPC64MOVWload:
575 return rewriteValuePPC64_OpPPC64MOVWload(v)
576 case OpPPC64MOVWloadidx:
577 return rewriteValuePPC64_OpPPC64MOVWloadidx(v)
579 return rewriteValuePPC64_OpPPC64MOVWreg(v)
580 case OpPPC64MOVWstore:
581 return rewriteValuePPC64_OpPPC64MOVWstore(v)
582 case OpPPC64MOVWstoreidx:
583 return rewriteValuePPC64_OpPPC64MOVWstoreidx(v)
584 case OpPPC64MOVWstorezero:
585 return rewriteValuePPC64_OpPPC64MOVWstorezero(v)
587 return rewriteValuePPC64_OpPPC64MTVSRD(v)
589 return rewriteValuePPC64_OpPPC64MULLD(v)
591 return rewriteValuePPC64_OpPPC64MULLW(v)
593 return rewriteValuePPC64_OpPPC64NEG(v)
595 return rewriteValuePPC64_OpPPC64NOR(v)
596 case OpPPC64NotEqual:
597 return rewriteValuePPC64_OpPPC64NotEqual(v)
599 return rewriteValuePPC64_OpPPC64OR(v)
601 return rewriteValuePPC64_OpPPC64ORN(v)
603 return rewriteValuePPC64_OpPPC64ORconst(v)
605 return rewriteValuePPC64_OpPPC64ROTL(v)
607 return rewriteValuePPC64_OpPPC64ROTLW(v)
608 case OpPPC64ROTLWconst:
609 return rewriteValuePPC64_OpPPC64ROTLWconst(v)
611 return rewriteValuePPC64_OpPPC64SETBC(v)
613 return rewriteValuePPC64_OpPPC64SETBCR(v)
615 return rewriteValuePPC64_OpPPC64SLD(v)
616 case OpPPC64SLDconst:
617 return rewriteValuePPC64_OpPPC64SLDconst(v)
619 return rewriteValuePPC64_OpPPC64SLW(v)
620 case OpPPC64SLWconst:
621 return rewriteValuePPC64_OpPPC64SLWconst(v)
623 return rewriteValuePPC64_OpPPC64SRAD(v)
625 return rewriteValuePPC64_OpPPC64SRAW(v)
627 return rewriteValuePPC64_OpPPC64SRD(v)
629 return rewriteValuePPC64_OpPPC64SRW(v)
630 case OpPPC64SRWconst:
631 return rewriteValuePPC64_OpPPC64SRWconst(v)
633 return rewriteValuePPC64_OpPPC64SUB(v)
635 return rewriteValuePPC64_OpPPC64SUBE(v)
636 case OpPPC64SUBFCconst:
637 return rewriteValuePPC64_OpPPC64SUBFCconst(v)
639 return rewriteValuePPC64_OpPPC64XOR(v)
640 case OpPPC64XORconst:
641 return rewriteValuePPC64_OpPPC64XORconst(v)
643 return rewriteValuePPC64_OpPanicBounds(v)
645 return rewriteValuePPC64_OpPopCount16(v)
647 return rewriteValuePPC64_OpPopCount32(v)
649 v.Op = OpPPC64POPCNTD
652 return rewriteValuePPC64_OpPopCount8(v)
653 case OpPrefetchCache:
654 return rewriteValuePPC64_OpPrefetchCache(v)
655 case OpPrefetchCacheStreamed:
656 return rewriteValuePPC64_OpPrefetchCacheStreamed(v)
658 v.Op = OpPPC64LoweredPubBarrier
661 return rewriteValuePPC64_OpRotateLeft16(v)
669 return rewriteValuePPC64_OpRotateLeft8(v)
674 v.Op = OpPPC64LoweredRound32F
677 v.Op = OpPPC64LoweredRound64F
680 return rewriteValuePPC64_OpRsh16Ux16(v)
682 return rewriteValuePPC64_OpRsh16Ux32(v)
684 return rewriteValuePPC64_OpRsh16Ux64(v)
686 return rewriteValuePPC64_OpRsh16Ux8(v)
688 return rewriteValuePPC64_OpRsh16x16(v)
690 return rewriteValuePPC64_OpRsh16x32(v)
692 return rewriteValuePPC64_OpRsh16x64(v)
694 return rewriteValuePPC64_OpRsh16x8(v)
696 return rewriteValuePPC64_OpRsh32Ux16(v)
698 return rewriteValuePPC64_OpRsh32Ux32(v)
700 return rewriteValuePPC64_OpRsh32Ux64(v)
702 return rewriteValuePPC64_OpRsh32Ux8(v)
704 return rewriteValuePPC64_OpRsh32x16(v)
706 return rewriteValuePPC64_OpRsh32x32(v)
708 return rewriteValuePPC64_OpRsh32x64(v)
710 return rewriteValuePPC64_OpRsh32x8(v)
712 return rewriteValuePPC64_OpRsh64Ux16(v)
714 return rewriteValuePPC64_OpRsh64Ux32(v)
716 return rewriteValuePPC64_OpRsh64Ux64(v)
718 return rewriteValuePPC64_OpRsh64Ux8(v)
720 return rewriteValuePPC64_OpRsh64x16(v)
722 return rewriteValuePPC64_OpRsh64x32(v)
724 return rewriteValuePPC64_OpRsh64x64(v)
726 return rewriteValuePPC64_OpRsh64x8(v)
728 return rewriteValuePPC64_OpRsh8Ux16(v)
730 return rewriteValuePPC64_OpRsh8Ux32(v)
732 return rewriteValuePPC64_OpRsh8Ux64(v)
734 return rewriteValuePPC64_OpRsh8Ux8(v)
736 return rewriteValuePPC64_OpRsh8x16(v)
738 return rewriteValuePPC64_OpRsh8x32(v)
740 return rewriteValuePPC64_OpRsh8x64(v)
742 return rewriteValuePPC64_OpRsh8x8(v)
744 return rewriteValuePPC64_OpSelect0(v)
746 return rewriteValuePPC64_OpSelect1(v)
748 return rewriteValuePPC64_OpSelectN(v)
749 case OpSignExt16to32:
750 v.Op = OpPPC64MOVHreg
752 case OpSignExt16to64:
753 v.Op = OpPPC64MOVHreg
755 case OpSignExt32to64:
756 v.Op = OpPPC64MOVWreg
759 v.Op = OpPPC64MOVBreg
762 v.Op = OpPPC64MOVBreg
765 v.Op = OpPPC64MOVBreg
768 return rewriteValuePPC64_OpSlicemask(v)
776 v.Op = OpPPC64CALLstatic
779 return rewriteValuePPC64_OpStore(v)
802 v.Op = OpPPC64CALLtail
808 return rewriteValuePPC64_OpTrunc16to8(v)
810 return rewriteValuePPC64_OpTrunc32to16(v)
812 return rewriteValuePPC64_OpTrunc32to8(v)
814 return rewriteValuePPC64_OpTrunc64to16(v)
816 return rewriteValuePPC64_OpTrunc64to32(v)
818 return rewriteValuePPC64_OpTrunc64to8(v)
820 v.Op = OpPPC64LoweredWB
835 return rewriteValuePPC64_OpZero(v)
836 case OpZeroExt16to32:
837 v.Op = OpPPC64MOVHZreg
839 case OpZeroExt16to64:
840 v.Op = OpPPC64MOVHZreg
842 case OpZeroExt32to64:
843 v.Op = OpPPC64MOVWZreg
846 v.Op = OpPPC64MOVBZreg
849 v.Op = OpPPC64MOVBZreg
852 v.Op = OpPPC64MOVBZreg
857 func rewriteValuePPC64_OpAddr(v *Value) bool {
859 // match: (Addr {sym} base)
860 // result: (MOVDaddr {sym} [0] base)
862 sym := auxToSym(v.Aux)
864 v.reset(OpPPC64MOVDaddr)
865 v.AuxInt = int32ToAuxInt(0)
866 v.Aux = symToAux(sym)
871 func rewriteValuePPC64_OpAtomicCompareAndSwap32(v *Value) bool {
876 // match: (AtomicCompareAndSwap32 ptr old new_ mem)
877 // result: (LoweredAtomicCas32 [1] ptr old new_ mem)
883 v.reset(OpPPC64LoweredAtomicCas32)
884 v.AuxInt = int64ToAuxInt(1)
885 v.AddArg4(ptr, old, new_, mem)
889 func rewriteValuePPC64_OpAtomicCompareAndSwap64(v *Value) bool {
894 // match: (AtomicCompareAndSwap64 ptr old new_ mem)
895 // result: (LoweredAtomicCas64 [1] ptr old new_ mem)
901 v.reset(OpPPC64LoweredAtomicCas64)
902 v.AuxInt = int64ToAuxInt(1)
903 v.AddArg4(ptr, old, new_, mem)
907 func rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v *Value) bool {
912 // match: (AtomicCompareAndSwapRel32 ptr old new_ mem)
913 // result: (LoweredAtomicCas32 [0] ptr old new_ mem)
919 v.reset(OpPPC64LoweredAtomicCas32)
920 v.AuxInt = int64ToAuxInt(0)
921 v.AddArg4(ptr, old, new_, mem)
925 func rewriteValuePPC64_OpAtomicLoad32(v *Value) bool {
928 // match: (AtomicLoad32 ptr mem)
929 // result: (LoweredAtomicLoad32 [1] ptr mem)
933 v.reset(OpPPC64LoweredAtomicLoad32)
934 v.AuxInt = int64ToAuxInt(1)
939 func rewriteValuePPC64_OpAtomicLoad64(v *Value) bool {
942 // match: (AtomicLoad64 ptr mem)
943 // result: (LoweredAtomicLoad64 [1] ptr mem)
947 v.reset(OpPPC64LoweredAtomicLoad64)
948 v.AuxInt = int64ToAuxInt(1)
953 func rewriteValuePPC64_OpAtomicLoad8(v *Value) bool {
956 // match: (AtomicLoad8 ptr mem)
957 // result: (LoweredAtomicLoad8 [1] ptr mem)
961 v.reset(OpPPC64LoweredAtomicLoad8)
962 v.AuxInt = int64ToAuxInt(1)
967 func rewriteValuePPC64_OpAtomicLoadAcq32(v *Value) bool {
970 // match: (AtomicLoadAcq32 ptr mem)
971 // result: (LoweredAtomicLoad32 [0] ptr mem)
975 v.reset(OpPPC64LoweredAtomicLoad32)
976 v.AuxInt = int64ToAuxInt(0)
981 func rewriteValuePPC64_OpAtomicLoadAcq64(v *Value) bool {
984 // match: (AtomicLoadAcq64 ptr mem)
985 // result: (LoweredAtomicLoad64 [0] ptr mem)
989 v.reset(OpPPC64LoweredAtomicLoad64)
990 v.AuxInt = int64ToAuxInt(0)
995 func rewriteValuePPC64_OpAtomicLoadPtr(v *Value) bool {
998 // match: (AtomicLoadPtr ptr mem)
999 // result: (LoweredAtomicLoadPtr [1] ptr mem)
1003 v.reset(OpPPC64LoweredAtomicLoadPtr)
1004 v.AuxInt = int64ToAuxInt(1)
1009 func rewriteValuePPC64_OpAtomicStore32(v *Value) bool {
1013 // match: (AtomicStore32 ptr val mem)
1014 // result: (LoweredAtomicStore32 [1] ptr val mem)
1019 v.reset(OpPPC64LoweredAtomicStore32)
1020 v.AuxInt = int64ToAuxInt(1)
1021 v.AddArg3(ptr, val, mem)
1025 func rewriteValuePPC64_OpAtomicStore64(v *Value) bool {
1029 // match: (AtomicStore64 ptr val mem)
1030 // result: (LoweredAtomicStore64 [1] ptr val mem)
1035 v.reset(OpPPC64LoweredAtomicStore64)
1036 v.AuxInt = int64ToAuxInt(1)
1037 v.AddArg3(ptr, val, mem)
1041 func rewriteValuePPC64_OpAtomicStore8(v *Value) bool {
1045 // match: (AtomicStore8 ptr val mem)
1046 // result: (LoweredAtomicStore8 [1] ptr val mem)
1051 v.reset(OpPPC64LoweredAtomicStore8)
1052 v.AuxInt = int64ToAuxInt(1)
1053 v.AddArg3(ptr, val, mem)
1057 func rewriteValuePPC64_OpAtomicStoreRel32(v *Value) bool {
1061 // match: (AtomicStoreRel32 ptr val mem)
1062 // result: (LoweredAtomicStore32 [0] ptr val mem)
1067 v.reset(OpPPC64LoweredAtomicStore32)
1068 v.AuxInt = int64ToAuxInt(0)
1069 v.AddArg3(ptr, val, mem)
1073 func rewriteValuePPC64_OpAtomicStoreRel64(v *Value) bool {
1077 // match: (AtomicStoreRel64 ptr val mem)
1078 // result: (LoweredAtomicStore64 [0] ptr val mem)
1083 v.reset(OpPPC64LoweredAtomicStore64)
1084 v.AuxInt = int64ToAuxInt(0)
1085 v.AddArg3(ptr, val, mem)
1089 func rewriteValuePPC64_OpAvg64u(v *Value) bool {
1093 // match: (Avg64u <t> x y)
1094 // result: (ADD (SRDconst <t> (SUB <t> x y) [1]) y)
1100 v0 := b.NewValue0(v.Pos, OpPPC64SRDconst, t)
1101 v0.AuxInt = int64ToAuxInt(1)
1102 v1 := b.NewValue0(v.Pos, OpPPC64SUB, t)
1109 func rewriteValuePPC64_OpBitLen32(v *Value) bool {
1112 typ := &b.Func.Config.Types
1113 // match: (BitLen32 x)
1114 // result: (SUBFCconst [32] (CNTLZW <typ.Int> x))
1117 v.reset(OpPPC64SUBFCconst)
1118 v.AuxInt = int64ToAuxInt(32)
1119 v0 := b.NewValue0(v.Pos, OpPPC64CNTLZW, typ.Int)
1125 func rewriteValuePPC64_OpBitLen64(v *Value) bool {
1128 typ := &b.Func.Config.Types
1129 // match: (BitLen64 x)
1130 // result: (SUBFCconst [64] (CNTLZD <typ.Int> x))
1133 v.reset(OpPPC64SUBFCconst)
1134 v.AuxInt = int64ToAuxInt(64)
1135 v0 := b.NewValue0(v.Pos, OpPPC64CNTLZD, typ.Int)
1141 func rewriteValuePPC64_OpBswap16(v *Value) bool {
1144 typ := &b.Func.Config.Types
1145 // match: (Bswap16 x)
1146 // cond: buildcfg.GOPPC64>=10
1150 if !(buildcfg.GOPPC64 >= 10) {
1157 // match: (Bswap16 x:(MOVHZload [off] {sym} ptr mem))
1158 // result: @x.Block (MOVHBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
1161 if x.Op != OpPPC64MOVHZload {
1164 off := auxIntToInt32(x.AuxInt)
1165 sym := auxToSym(x.Aux)
1169 v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
1171 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
1172 v1.AuxInt = int32ToAuxInt(off)
1173 v1.Aux = symToAux(sym)
1178 // match: (Bswap16 x:(MOVHZloadidx ptr idx mem))
1179 // result: @x.Block (MOVHZreg (MOVHBRloadidx ptr idx mem))
1182 if x.Op != OpPPC64MOVHZloadidx {
1189 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
1191 v1 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
1192 v1.AddArg3(ptr, idx, mem)
1198 func rewriteValuePPC64_OpBswap32(v *Value) bool {
1201 typ := &b.Func.Config.Types
1202 // match: (Bswap32 x)
1203 // cond: buildcfg.GOPPC64>=10
1207 if !(buildcfg.GOPPC64 >= 10) {
1214 // match: (Bswap32 x:(MOVWZload [off] {sym} ptr mem))
1215 // result: @x.Block (MOVWBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
1218 if x.Op != OpPPC64MOVWZload {
1221 off := auxIntToInt32(x.AuxInt)
1222 sym := auxToSym(x.Aux)
1226 v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
1228 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
1229 v1.AuxInt = int32ToAuxInt(off)
1230 v1.Aux = symToAux(sym)
1235 // match: (Bswap32 x:(MOVWZloadidx ptr idx mem))
1236 // result: @x.Block (MOVWZreg (MOVWBRloadidx ptr idx mem))
1239 if x.Op != OpPPC64MOVWZloadidx {
1246 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
1248 v1 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
1249 v1.AddArg3(ptr, idx, mem)
1255 func rewriteValuePPC64_OpBswap64(v *Value) bool {
1258 typ := &b.Func.Config.Types
1259 // match: (Bswap64 x)
1260 // cond: buildcfg.GOPPC64>=10
1264 if !(buildcfg.GOPPC64 >= 10) {
1271 // match: (Bswap64 x:(MOVDload [off] {sym} ptr mem))
1272 // result: @x.Block (MOVDBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
1275 if x.Op != OpPPC64MOVDload {
1278 off := auxIntToInt32(x.AuxInt)
1279 sym := auxToSym(x.Aux)
1283 v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
1285 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
1286 v1.AuxInt = int32ToAuxInt(off)
1287 v1.Aux = symToAux(sym)
1292 // match: (Bswap64 x:(MOVDloadidx ptr idx mem))
1293 // result: @x.Block (MOVDBRloadidx ptr idx mem)
1296 if x.Op != OpPPC64MOVDloadidx {
1303 v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
1305 v0.AddArg3(ptr, idx, mem)
1310 func rewriteValuePPC64_OpCom16(v *Value) bool {
1313 // result: (NOR x x)
1321 func rewriteValuePPC64_OpCom32(v *Value) bool {
1324 // result: (NOR x x)
1332 func rewriteValuePPC64_OpCom64(v *Value) bool {
1335 // result: (NOR x x)
1343 func rewriteValuePPC64_OpCom8(v *Value) bool {
1346 // result: (NOR x x)
1354 func rewriteValuePPC64_OpCondSelect(v *Value) bool {
1359 typ := &b.Func.Config.Types
1360 // match: (CondSelect x y (SETBC [a] cmp))
1361 // result: (ISEL [a] x y cmp)
1365 if v_2.Op != OpPPC64SETBC {
1368 a := auxIntToInt32(v_2.AuxInt)
1370 v.reset(OpPPC64ISEL)
1371 v.AuxInt = int32ToAuxInt(a)
1372 v.AddArg3(x, y, cmp)
1375 // match: (CondSelect x y (SETBCR [a] cmp))
1376 // result: (ISEL [a+4] x y cmp)
1380 if v_2.Op != OpPPC64SETBCR {
1383 a := auxIntToInt32(v_2.AuxInt)
1385 v.reset(OpPPC64ISEL)
1386 v.AuxInt = int32ToAuxInt(a + 4)
1387 v.AddArg3(x, y, cmp)
1390 // match: (CondSelect x y bool)
1391 // cond: flagArg(bool) == nil
1392 // result: (ISEL [6] x y (Select1 <types.TypeFlags> (ANDCCconst [1] bool)))
1397 if !(flagArg(bool) == nil) {
1400 v.reset(OpPPC64ISEL)
1401 v.AuxInt = int32ToAuxInt(6)
1402 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
1403 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
1404 v1.AuxInt = int64ToAuxInt(1)
1412 func rewriteValuePPC64_OpConst16(v *Value) bool {
1413 // match: (Const16 [val])
1414 // result: (MOVDconst [int64(val)])
1416 val := auxIntToInt16(v.AuxInt)
1417 v.reset(OpPPC64MOVDconst)
1418 v.AuxInt = int64ToAuxInt(int64(val))
1422 func rewriteValuePPC64_OpConst32(v *Value) bool {
1423 // match: (Const32 [val])
1424 // result: (MOVDconst [int64(val)])
1426 val := auxIntToInt32(v.AuxInt)
1427 v.reset(OpPPC64MOVDconst)
1428 v.AuxInt = int64ToAuxInt(int64(val))
1432 func rewriteValuePPC64_OpConst64(v *Value) bool {
1433 // match: (Const64 [val])
1434 // result: (MOVDconst [int64(val)])
1436 val := auxIntToInt64(v.AuxInt)
1437 v.reset(OpPPC64MOVDconst)
1438 v.AuxInt = int64ToAuxInt(int64(val))
1442 func rewriteValuePPC64_OpConst8(v *Value) bool {
1443 // match: (Const8 [val])
1444 // result: (MOVDconst [int64(val)])
1446 val := auxIntToInt8(v.AuxInt)
1447 v.reset(OpPPC64MOVDconst)
1448 v.AuxInt = int64ToAuxInt(int64(val))
1452 func rewriteValuePPC64_OpConstBool(v *Value) bool {
1453 // match: (ConstBool [t])
1454 // result: (MOVDconst [b2i(t)])
1456 t := auxIntToBool(v.AuxInt)
1457 v.reset(OpPPC64MOVDconst)
1458 v.AuxInt = int64ToAuxInt(b2i(t))
1462 func rewriteValuePPC64_OpConstNil(v *Value) bool {
1463 // match: (ConstNil)
1464 // result: (MOVDconst [0])
1466 v.reset(OpPPC64MOVDconst)
1467 v.AuxInt = int64ToAuxInt(0)
1471 func rewriteValuePPC64_OpCopysign(v *Value) bool {
1474 // match: (Copysign x y)
1475 // result: (FCPSGN y x)
1479 v.reset(OpPPC64FCPSGN)
1484 func rewriteValuePPC64_OpCtz16(v *Value) bool {
1487 typ := &b.Func.Config.Types
1489 // result: (POPCNTW (MOVHZreg (ANDN <typ.Int16> (ADDconst <typ.Int16> [-1] x) x)))
1492 v.reset(OpPPC64POPCNTW)
1493 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
1494 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int16)
1495 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int16)
1496 v2.AuxInt = int64ToAuxInt(-1)
1504 func rewriteValuePPC64_OpCtz32(v *Value) bool {
1507 typ := &b.Func.Config.Types
1509 // cond: buildcfg.GOPPC64<=8
1510 // result: (POPCNTW (MOVWZreg (ANDN <typ.Int> (ADDconst <typ.Int> [-1] x) x)))
1513 if !(buildcfg.GOPPC64 <= 8) {
1516 v.reset(OpPPC64POPCNTW)
1517 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
1518 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int)
1519 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int)
1520 v2.AuxInt = int64ToAuxInt(-1)
1528 // result: (CNTTZW (MOVWZreg x))
1531 v.reset(OpPPC64CNTTZW)
1532 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
1538 func rewriteValuePPC64_OpCtz64(v *Value) bool {
1541 typ := &b.Func.Config.Types
1543 // cond: buildcfg.GOPPC64<=8
1544 // result: (POPCNTD (ANDN <typ.Int64> (ADDconst <typ.Int64> [-1] x) x))
1547 if !(buildcfg.GOPPC64 <= 8) {
1550 v.reset(OpPPC64POPCNTD)
1551 v0 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int64)
1552 v1 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int64)
1553 v1.AuxInt = int64ToAuxInt(-1)
1560 // result: (CNTTZD x)
1563 v.reset(OpPPC64CNTTZD)
1568 func rewriteValuePPC64_OpCtz8(v *Value) bool {
1571 typ := &b.Func.Config.Types
1573 // result: (POPCNTB (MOVBZreg (ANDN <typ.UInt8> (ADDconst <typ.UInt8> [-1] x) x)))
1576 v.reset(OpPPC64POPCNTB)
1577 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
1578 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.UInt8)
1579 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.UInt8)
1580 v2.AuxInt = int64ToAuxInt(-1)
1588 func rewriteValuePPC64_OpCvt32Fto32(v *Value) bool {
1591 typ := &b.Func.Config.Types
1592 // match: (Cvt32Fto32 x)
1593 // result: (MFVSRD (FCTIWZ x))
1596 v.reset(OpPPC64MFVSRD)
1597 v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
1603 func rewriteValuePPC64_OpCvt32Fto64(v *Value) bool {
1606 typ := &b.Func.Config.Types
1607 // match: (Cvt32Fto64 x)
1608 // result: (MFVSRD (FCTIDZ x))
1611 v.reset(OpPPC64MFVSRD)
1612 v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
1618 func rewriteValuePPC64_OpCvt32to32F(v *Value) bool {
1621 typ := &b.Func.Config.Types
1622 // match: (Cvt32to32F x)
1623 // result: (FCFIDS (MTVSRD (SignExt32to64 x)))
1626 v.reset(OpPPC64FCFIDS)
1627 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1628 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1635 func rewriteValuePPC64_OpCvt32to64F(v *Value) bool {
1638 typ := &b.Func.Config.Types
1639 // match: (Cvt32to64F x)
1640 // result: (FCFID (MTVSRD (SignExt32to64 x)))
1643 v.reset(OpPPC64FCFID)
1644 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1645 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1652 func rewriteValuePPC64_OpCvt64Fto32(v *Value) bool {
1655 typ := &b.Func.Config.Types
1656 // match: (Cvt64Fto32 x)
1657 // result: (MFVSRD (FCTIWZ x))
1660 v.reset(OpPPC64MFVSRD)
1661 v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
1667 func rewriteValuePPC64_OpCvt64Fto64(v *Value) bool {
1670 typ := &b.Func.Config.Types
1671 // match: (Cvt64Fto64 x)
1672 // result: (MFVSRD (FCTIDZ x))
1675 v.reset(OpPPC64MFVSRD)
1676 v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
1682 func rewriteValuePPC64_OpCvt64to32F(v *Value) bool {
1685 typ := &b.Func.Config.Types
1686 // match: (Cvt64to32F x)
1687 // result: (FCFIDS (MTVSRD x))
1690 v.reset(OpPPC64FCFIDS)
1691 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1697 func rewriteValuePPC64_OpCvt64to64F(v *Value) bool {
1700 typ := &b.Func.Config.Types
1701 // match: (Cvt64to64F x)
1702 // result: (FCFID (MTVSRD x))
1705 v.reset(OpPPC64FCFID)
1706 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1712 func rewriteValuePPC64_OpDiv16(v *Value) bool {
1716 typ := &b.Func.Config.Types
1717 // match: (Div16 [false] x y)
1718 // result: (DIVW (SignExt16to32 x) (SignExt16to32 y))
1720 if auxIntToBool(v.AuxInt) != false {
1725 v.reset(OpPPC64DIVW)
1726 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1728 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1735 func rewriteValuePPC64_OpDiv16u(v *Value) bool {
1739 typ := &b.Func.Config.Types
1740 // match: (Div16u x y)
1741 // result: (DIVWU (ZeroExt16to32 x) (ZeroExt16to32 y))
1745 v.reset(OpPPC64DIVWU)
1746 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1748 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1754 func rewriteValuePPC64_OpDiv32(v *Value) bool {
1757 // match: (Div32 [false] x y)
1758 // result: (DIVW x y)
1760 if auxIntToBool(v.AuxInt) != false {
1765 v.reset(OpPPC64DIVW)
1771 func rewriteValuePPC64_OpDiv64(v *Value) bool {
1774 // match: (Div64 [false] x y)
1775 // result: (DIVD x y)
1777 if auxIntToBool(v.AuxInt) != false {
1782 v.reset(OpPPC64DIVD)
1788 func rewriteValuePPC64_OpDiv8(v *Value) bool {
1792 typ := &b.Func.Config.Types
1793 // match: (Div8 x y)
1794 // result: (DIVW (SignExt8to32 x) (SignExt8to32 y))
1798 v.reset(OpPPC64DIVW)
1799 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1801 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1807 func rewriteValuePPC64_OpDiv8u(v *Value) bool {
1811 typ := &b.Func.Config.Types
1812 // match: (Div8u x y)
1813 // result: (DIVWU (ZeroExt8to32 x) (ZeroExt8to32 y))
1817 v.reset(OpPPC64DIVWU)
1818 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
1820 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
1826 func rewriteValuePPC64_OpEq16(v *Value) bool {
1830 typ := &b.Func.Config.Types
1831 // match: (Eq16 x y)
1832 // cond: x.Type.IsSigned() && y.Type.IsSigned()
1833 // result: (Equal (CMPW (SignExt16to32 x) (SignExt16to32 y)))
1835 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1838 if !(x.Type.IsSigned() && y.Type.IsSigned()) {
1841 v.reset(OpPPC64Equal)
1842 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1843 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1845 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1853 // match: (Eq16 x y)
1854 // result: (Equal (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
1858 v.reset(OpPPC64Equal)
1859 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1860 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1862 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1869 func rewriteValuePPC64_OpEq32(v *Value) bool {
1873 // match: (Eq32 x y)
1874 // result: (Equal (CMPW x y))
1878 v.reset(OpPPC64Equal)
1879 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1885 func rewriteValuePPC64_OpEq32F(v *Value) bool {
1889 // match: (Eq32F x y)
1890 // result: (Equal (FCMPU x y))
1894 v.reset(OpPPC64Equal)
1895 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
1901 func rewriteValuePPC64_OpEq64(v *Value) bool {
1905 // match: (Eq64 x y)
1906 // result: (Equal (CMP x y))
1910 v.reset(OpPPC64Equal)
1911 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
1917 func rewriteValuePPC64_OpEq64F(v *Value) bool {
1921 // match: (Eq64F x y)
1922 // result: (Equal (FCMPU x y))
1926 v.reset(OpPPC64Equal)
1927 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
1933 func rewriteValuePPC64_OpEq8(v *Value) bool {
1937 typ := &b.Func.Config.Types
1939 // cond: x.Type.IsSigned() && y.Type.IsSigned()
1940 // result: (Equal (CMPW (SignExt8to32 x) (SignExt8to32 y)))
1942 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1945 if !(x.Type.IsSigned() && y.Type.IsSigned()) {
1948 v.reset(OpPPC64Equal)
1949 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1950 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1952 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1961 // result: (Equal (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
1965 v.reset(OpPPC64Equal)
1966 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1967 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
1969 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
1976 func rewriteValuePPC64_OpEqB(v *Value) bool {
1980 typ := &b.Func.Config.Types
1982 // result: (Select0 <typ.Int> (ANDCCconst [1] (EQV x y)))
1988 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
1989 v0.AuxInt = int64ToAuxInt(1)
1990 v1 := b.NewValue0(v.Pos, OpPPC64EQV, typ.Int64)
1997 func rewriteValuePPC64_OpEqPtr(v *Value) bool {
2001 // match: (EqPtr x y)
2002 // result: (Equal (CMP x y))
2006 v.reset(OpPPC64Equal)
2007 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
2013 func rewriteValuePPC64_OpIsInBounds(v *Value) bool {
2017 // match: (IsInBounds idx len)
2018 // result: (LessThan (CMPU idx len))
2022 v.reset(OpPPC64LessThan)
2023 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2024 v0.AddArg2(idx, len)
2029 func rewriteValuePPC64_OpIsNonNil(v *Value) bool {
2032 // match: (IsNonNil ptr)
2033 // result: (NotEqual (CMPconst [0] ptr))
2036 v.reset(OpPPC64NotEqual)
2037 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
2038 v0.AuxInt = int64ToAuxInt(0)
2044 func rewriteValuePPC64_OpIsSliceInBounds(v *Value) bool {
2048 // match: (IsSliceInBounds idx len)
2049 // result: (LessEqual (CMPU idx len))
2053 v.reset(OpPPC64LessEqual)
2054 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2055 v0.AddArg2(idx, len)
2060 func rewriteValuePPC64_OpLeq16(v *Value) bool {
2064 typ := &b.Func.Config.Types
2065 // match: (Leq16 x y)
2066 // result: (LessEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
2070 v.reset(OpPPC64LessEqual)
2071 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2072 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2074 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2081 func rewriteValuePPC64_OpLeq16U(v *Value) bool {
2085 typ := &b.Func.Config.Types
2086 // match: (Leq16U x y)
2087 // result: (LessEqual (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
2091 v.reset(OpPPC64LessEqual)
2092 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2093 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2095 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2102 func rewriteValuePPC64_OpLeq32(v *Value) bool {
2106 // match: (Leq32 x y)
2107 // result: (LessEqual (CMPW x y))
2111 v.reset(OpPPC64LessEqual)
2112 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2118 func rewriteValuePPC64_OpLeq32F(v *Value) bool {
2122 // match: (Leq32F x y)
2123 // result: (FLessEqual (FCMPU x y))
2127 v.reset(OpPPC64FLessEqual)
2128 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2134 func rewriteValuePPC64_OpLeq32U(v *Value) bool {
2138 // match: (Leq32U x y)
2139 // result: (LessEqual (CMPWU x y))
2143 v.reset(OpPPC64LessEqual)
2144 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2150 func rewriteValuePPC64_OpLeq64(v *Value) bool {
2154 // match: (Leq64 x y)
2155 // result: (LessEqual (CMP x y))
2159 v.reset(OpPPC64LessEqual)
2160 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
2166 func rewriteValuePPC64_OpLeq64F(v *Value) bool {
2170 // match: (Leq64F x y)
2171 // result: (FLessEqual (FCMPU x y))
2175 v.reset(OpPPC64FLessEqual)
2176 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2182 func rewriteValuePPC64_OpLeq64U(v *Value) bool {
2186 // match: (Leq64U x y)
2187 // result: (LessEqual (CMPU x y))
2191 v.reset(OpPPC64LessEqual)
2192 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2198 func rewriteValuePPC64_OpLeq8(v *Value) bool {
2202 typ := &b.Func.Config.Types
2203 // match: (Leq8 x y)
2204 // result: (LessEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
2208 v.reset(OpPPC64LessEqual)
2209 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2210 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2212 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2219 func rewriteValuePPC64_OpLeq8U(v *Value) bool {
2223 typ := &b.Func.Config.Types
2224 // match: (Leq8U x y)
2225 // result: (LessEqual (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
2229 v.reset(OpPPC64LessEqual)
2230 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2231 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2233 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2240 func rewriteValuePPC64_OpLess16(v *Value) bool {
2244 typ := &b.Func.Config.Types
2245 // match: (Less16 x y)
2246 // result: (LessThan (CMPW (SignExt16to32 x) (SignExt16to32 y)))
2250 v.reset(OpPPC64LessThan)
2251 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2252 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2254 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2261 func rewriteValuePPC64_OpLess16U(v *Value) bool {
2265 typ := &b.Func.Config.Types
2266 // match: (Less16U x y)
2267 // result: (LessThan (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
2271 v.reset(OpPPC64LessThan)
2272 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2273 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2275 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2282 func rewriteValuePPC64_OpLess32(v *Value) bool {
2286 // match: (Less32 x y)
2287 // result: (LessThan (CMPW x y))
2291 v.reset(OpPPC64LessThan)
2292 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2298 func rewriteValuePPC64_OpLess32F(v *Value) bool {
2302 // match: (Less32F x y)
2303 // result: (FLessThan (FCMPU x y))
2307 v.reset(OpPPC64FLessThan)
2308 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2314 func rewriteValuePPC64_OpLess32U(v *Value) bool {
2318 // match: (Less32U x y)
2319 // result: (LessThan (CMPWU x y))
2323 v.reset(OpPPC64LessThan)
2324 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2330 func rewriteValuePPC64_OpLess64(v *Value) bool {
2334 // match: (Less64 x y)
2335 // result: (LessThan (CMP x y))
2339 v.reset(OpPPC64LessThan)
2340 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
2346 func rewriteValuePPC64_OpLess64F(v *Value) bool {
2350 // match: (Less64F x y)
2351 // result: (FLessThan (FCMPU x y))
2355 v.reset(OpPPC64FLessThan)
2356 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2362 func rewriteValuePPC64_OpLess64U(v *Value) bool {
2366 // match: (Less64U x y)
2367 // result: (LessThan (CMPU x y))
2371 v.reset(OpPPC64LessThan)
2372 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2378 func rewriteValuePPC64_OpLess8(v *Value) bool {
2382 typ := &b.Func.Config.Types
2383 // match: (Less8 x y)
2384 // result: (LessThan (CMPW (SignExt8to32 x) (SignExt8to32 y)))
2388 v.reset(OpPPC64LessThan)
2389 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2390 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2392 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2399 func rewriteValuePPC64_OpLess8U(v *Value) bool {
2403 typ := &b.Func.Config.Types
2404 // match: (Less8U x y)
2405 // result: (LessThan (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
2409 v.reset(OpPPC64LessThan)
2410 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2411 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2413 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2420 func rewriteValuePPC64_OpLoad(v *Value) bool {
2424 typ := &b.Func.Config.Types
2425 // match: (Load <t> ptr mem)
2426 // cond: (is64BitInt(t) || isPtr(t))
2427 // result: (MOVDload ptr mem)
2432 if !(is64BitInt(t) || isPtr(t)) {
2435 v.reset(OpPPC64MOVDload)
2439 // match: (Load <t> ptr mem)
2440 // cond: is32BitInt(t) && t.IsSigned()
2441 // result: (MOVWload ptr mem)
2446 if !(is32BitInt(t) && t.IsSigned()) {
2449 v.reset(OpPPC64MOVWload)
2453 // match: (Load <t> ptr mem)
2454 // cond: is32BitInt(t) && !t.IsSigned()
2455 // result: (MOVWZload ptr mem)
2460 if !(is32BitInt(t) && !t.IsSigned()) {
2463 v.reset(OpPPC64MOVWZload)
2467 // match: (Load <t> ptr mem)
2468 // cond: is16BitInt(t) && t.IsSigned()
2469 // result: (MOVHload ptr mem)
2474 if !(is16BitInt(t) && t.IsSigned()) {
2477 v.reset(OpPPC64MOVHload)
2481 // match: (Load <t> ptr mem)
2482 // cond: is16BitInt(t) && !t.IsSigned()
2483 // result: (MOVHZload ptr mem)
2488 if !(is16BitInt(t) && !t.IsSigned()) {
2491 v.reset(OpPPC64MOVHZload)
2495 // match: (Load <t> ptr mem)
2496 // cond: t.IsBoolean()
2497 // result: (MOVBZload ptr mem)
2502 if !(t.IsBoolean()) {
2505 v.reset(OpPPC64MOVBZload)
2509 // match: (Load <t> ptr mem)
2510 // cond: is8BitInt(t) && t.IsSigned()
2511 // result: (MOVBreg (MOVBZload ptr mem))
2516 if !(is8BitInt(t) && t.IsSigned()) {
2519 v.reset(OpPPC64MOVBreg)
2520 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
2521 v0.AddArg2(ptr, mem)
2525 // match: (Load <t> ptr mem)
2526 // cond: is8BitInt(t) && !t.IsSigned()
2527 // result: (MOVBZload ptr mem)
2532 if !(is8BitInt(t) && !t.IsSigned()) {
2535 v.reset(OpPPC64MOVBZload)
2539 // match: (Load <t> ptr mem)
2540 // cond: is32BitFloat(t)
2541 // result: (FMOVSload ptr mem)
2546 if !(is32BitFloat(t)) {
2549 v.reset(OpPPC64FMOVSload)
2553 // match: (Load <t> ptr mem)
2554 // cond: is64BitFloat(t)
2555 // result: (FMOVDload ptr mem)
2560 if !(is64BitFloat(t)) {
2563 v.reset(OpPPC64FMOVDload)
2569 func rewriteValuePPC64_OpLocalAddr(v *Value) bool {
2573 typ := &b.Func.Config.Types
2574 // match: (LocalAddr <t> {sym} base mem)
2575 // cond: t.Elem().HasPointers()
2576 // result: (MOVDaddr {sym} (SPanchored base mem))
2579 sym := auxToSym(v.Aux)
2582 if !(t.Elem().HasPointers()) {
2585 v.reset(OpPPC64MOVDaddr)
2586 v.Aux = symToAux(sym)
2587 v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
2588 v0.AddArg2(base, mem)
2592 // match: (LocalAddr <t> {sym} base _)
2593 // cond: !t.Elem().HasPointers()
2594 // result: (MOVDaddr {sym} base)
2597 sym := auxToSym(v.Aux)
2599 if !(!t.Elem().HasPointers()) {
2602 v.reset(OpPPC64MOVDaddr)
2603 v.Aux = symToAux(sym)
2609 func rewriteValuePPC64_OpLsh16x16(v *Value) bool {
2613 typ := &b.Func.Config.Types
2614 // match: (Lsh16x16 x y)
2615 // cond: shiftIsBounded(v)
2616 // result: (SLD x y)
2620 if !(shiftIsBounded(v)) {
2627 // match: (Lsh16x16 <t> x y)
2628 // result: (ISEL [2] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF0] y)))
2633 v.reset(OpPPC64ISEL)
2634 v.AuxInt = int32ToAuxInt(2)
2635 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2636 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
2639 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2640 v2.AuxInt = int64ToAuxInt(0)
2641 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
2642 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
2643 v4.AuxInt = int64ToAuxInt(0xFFF0)
2646 v.AddArg3(v0, v2, v3)
2650 func rewriteValuePPC64_OpLsh16x32(v *Value) bool {
2654 typ := &b.Func.Config.Types
2655 // match: (Lsh16x32 x y)
2656 // cond: shiftIsBounded(v)
2657 // result: (SLD x y)
2661 if !(shiftIsBounded(v)) {
2668 // match: (Lsh16x32 <t> x y)
2669 // result: (ISEL [0] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [16]))
2674 v.reset(OpPPC64ISEL)
2675 v.AuxInt = int32ToAuxInt(0)
2676 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2677 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
2680 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2681 v2.AuxInt = int64ToAuxInt(0)
2682 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
2683 v3.AuxInt = int32ToAuxInt(16)
2685 v.AddArg3(v0, v2, v3)
2689 func rewriteValuePPC64_OpLsh16x64(v *Value) bool {
2693 typ := &b.Func.Config.Types
2694 // match: (Lsh16x64 x (MOVDconst [c]))
2695 // cond: uint64(c) < 16
2696 // result: (SLWconst x [c])
2699 if v_1.Op != OpPPC64MOVDconst {
2702 c := auxIntToInt64(v_1.AuxInt)
2703 if !(uint64(c) < 16) {
2706 v.reset(OpPPC64SLWconst)
2707 v.AuxInt = int64ToAuxInt(c)
2711 // match: (Lsh16x64 x y)
2712 // cond: shiftIsBounded(v)
2713 // result: (SLD x y)
2717 if !(shiftIsBounded(v)) {
2724 // match: (Lsh16x64 <t> x y)
2725 // result: (ISEL [0] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [16]))
2730 v.reset(OpPPC64ISEL)
2731 v.AuxInt = int32ToAuxInt(0)
2732 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2733 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
2736 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2737 v2.AuxInt = int64ToAuxInt(0)
2738 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
2739 v3.AuxInt = int64ToAuxInt(16)
2741 v.AddArg3(v0, v2, v3)
2745 func rewriteValuePPC64_OpLsh16x8(v *Value) bool {
2749 typ := &b.Func.Config.Types
2750 // match: (Lsh16x8 x y)
2751 // cond: shiftIsBounded(v)
2752 // result: (SLD x y)
2756 if !(shiftIsBounded(v)) {
2763 // match: (Lsh16x8 <t> x y)
2764 // result: (ISEL [2] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F0] y)))
2769 v.reset(OpPPC64ISEL)
2770 v.AuxInt = int32ToAuxInt(2)
2771 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2772 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
2775 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2776 v2.AuxInt = int64ToAuxInt(0)
2777 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
2778 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
2779 v4.AuxInt = int64ToAuxInt(0x00F0)
2782 v.AddArg3(v0, v2, v3)
2786 func rewriteValuePPC64_OpLsh32x16(v *Value) bool {
2790 typ := &b.Func.Config.Types
2791 // match: (Lsh32x16 x y)
2792 // cond: shiftIsBounded(v)
2793 // result: (SLW x y)
2797 if !(shiftIsBounded(v)) {
2804 // match: (Lsh32x16 <t> x y)
2805 // result: (ISEL [2] (SLW <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFE0] y)))
2810 v.reset(OpPPC64ISEL)
2811 v.AuxInt = int32ToAuxInt(2)
2812 v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
2814 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2815 v1.AuxInt = int64ToAuxInt(0)
2816 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
2817 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
2818 v3.AuxInt = int64ToAuxInt(0xFFE0)
2821 v.AddArg3(v0, v1, v2)
2825 func rewriteValuePPC64_OpLsh32x32(v *Value) bool {
2829 typ := &b.Func.Config.Types
2830 // match: (Lsh32x32 x y)
2831 // cond: shiftIsBounded(v)
2832 // result: (SLW x y)
2836 if !(shiftIsBounded(v)) {
2843 // match: (Lsh32x32 <t> x y)
2844 // result: (ISEL [0] (SLW <t> x y) (MOVDconst [0]) (CMPWUconst y [32]))
2849 v.reset(OpPPC64ISEL)
2850 v.AuxInt = int32ToAuxInt(0)
2851 v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
2853 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2854 v1.AuxInt = int64ToAuxInt(0)
2855 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
2856 v2.AuxInt = int32ToAuxInt(32)
2858 v.AddArg3(v0, v1, v2)
2862 func rewriteValuePPC64_OpLsh32x64(v *Value) bool {
2866 typ := &b.Func.Config.Types
2867 // match: (Lsh32x64 x (MOVDconst [c]))
2868 // cond: uint64(c) < 32
2869 // result: (SLWconst x [c])
2872 if v_1.Op != OpPPC64MOVDconst {
2875 c := auxIntToInt64(v_1.AuxInt)
2876 if !(uint64(c) < 32) {
2879 v.reset(OpPPC64SLWconst)
2880 v.AuxInt = int64ToAuxInt(c)
2884 // match: (Lsh32x64 x y)
2885 // cond: shiftIsBounded(v)
2886 // result: (SLW x y)
2890 if !(shiftIsBounded(v)) {
2897 // match: (Lsh32x64 <t> x y)
2898 // result: (ISEL [0] (SLW <t> x y) (MOVDconst [0]) (CMPUconst y [32]))
2903 v.reset(OpPPC64ISEL)
2904 v.AuxInt = int32ToAuxInt(0)
2905 v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
2907 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2908 v1.AuxInt = int64ToAuxInt(0)
2909 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
2910 v2.AuxInt = int64ToAuxInt(32)
2912 v.AddArg3(v0, v1, v2)
2916 func rewriteValuePPC64_OpLsh32x8(v *Value) bool {
2920 typ := &b.Func.Config.Types
2921 // match: (Lsh32x8 x y)
2922 // cond: shiftIsBounded(v)
2923 // result: (SLW x y)
2927 if !(shiftIsBounded(v)) {
2934 // match: (Lsh32x8 <t> x y)
2935 // result: (ISEL [2] (SLW <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00E0] y)))
2940 v.reset(OpPPC64ISEL)
2941 v.AuxInt = int32ToAuxInt(2)
2942 v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
2944 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2945 v1.AuxInt = int64ToAuxInt(0)
2946 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
2947 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
2948 v3.AuxInt = int64ToAuxInt(0x00E0)
2951 v.AddArg3(v0, v1, v2)
2955 func rewriteValuePPC64_OpLsh64x16(v *Value) bool {
2959 typ := &b.Func.Config.Types
2960 // match: (Lsh64x16 x y)
2961 // cond: shiftIsBounded(v)
2962 // result: (SLD x y)
2966 if !(shiftIsBounded(v)) {
2973 // match: (Lsh64x16 <t> x y)
2974 // result: (ISEL [2] (SLD <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFC0] y)))
2979 v.reset(OpPPC64ISEL)
2980 v.AuxInt = int32ToAuxInt(2)
2981 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2983 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2984 v1.AuxInt = int64ToAuxInt(0)
2985 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
2986 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
2987 v3.AuxInt = int64ToAuxInt(0xFFC0)
2990 v.AddArg3(v0, v1, v2)
2994 func rewriteValuePPC64_OpLsh64x32(v *Value) bool {
2998 typ := &b.Func.Config.Types
2999 // match: (Lsh64x32 x y)
3000 // cond: shiftIsBounded(v)
3001 // result: (SLD x y)
3005 if !(shiftIsBounded(v)) {
3012 // match: (Lsh64x32 <t> x y)
3013 // result: (ISEL [0] (SLD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
3018 v.reset(OpPPC64ISEL)
3019 v.AuxInt = int32ToAuxInt(0)
3020 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3022 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3023 v1.AuxInt = int64ToAuxInt(0)
3024 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
3025 v2.AuxInt = int32ToAuxInt(64)
3027 v.AddArg3(v0, v1, v2)
3031 func rewriteValuePPC64_OpLsh64x64(v *Value) bool {
3035 typ := &b.Func.Config.Types
3036 // match: (Lsh64x64 x (MOVDconst [c]))
3037 // cond: uint64(c) < 64
3038 // result: (SLDconst x [c])
3041 if v_1.Op != OpPPC64MOVDconst {
3044 c := auxIntToInt64(v_1.AuxInt)
3045 if !(uint64(c) < 64) {
3048 v.reset(OpPPC64SLDconst)
3049 v.AuxInt = int64ToAuxInt(c)
3053 // match: (Lsh64x64 x y)
3054 // cond: shiftIsBounded(v)
3055 // result: (SLD x y)
3059 if !(shiftIsBounded(v)) {
3066 // match: (Lsh64x64 <t> x y)
3067 // result: (ISEL [0] (SLD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
3072 v.reset(OpPPC64ISEL)
3073 v.AuxInt = int32ToAuxInt(0)
3074 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3076 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3077 v1.AuxInt = int64ToAuxInt(0)
3078 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
3079 v2.AuxInt = int64ToAuxInt(64)
3081 v.AddArg3(v0, v1, v2)
3085 func rewriteValuePPC64_OpLsh64x8(v *Value) bool {
3089 typ := &b.Func.Config.Types
3090 // match: (Lsh64x8 x y)
3091 // cond: shiftIsBounded(v)
3092 // result: (SLD x y)
3096 if !(shiftIsBounded(v)) {
3103 // match: (Lsh64x8 <t> x y)
3104 // result: (ISEL [2] (SLD <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00C0] y)))
3109 v.reset(OpPPC64ISEL)
3110 v.AuxInt = int32ToAuxInt(2)
3111 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3113 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3114 v1.AuxInt = int64ToAuxInt(0)
3115 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
3116 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
3117 v3.AuxInt = int64ToAuxInt(0x00C0)
3120 v.AddArg3(v0, v1, v2)
3124 func rewriteValuePPC64_OpLsh8x16(v *Value) bool {
3128 typ := &b.Func.Config.Types
3129 // match: (Lsh8x16 x y)
3130 // cond: shiftIsBounded(v)
3131 // result: (SLD x y)
3135 if !(shiftIsBounded(v)) {
3142 // match: (Lsh8x16 <t> x y)
3143 // result: (ISEL [2] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF8] y)))
3148 v.reset(OpPPC64ISEL)
3149 v.AuxInt = int32ToAuxInt(2)
3150 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3151 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
3154 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3155 v2.AuxInt = int64ToAuxInt(0)
3156 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
3157 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
3158 v4.AuxInt = int64ToAuxInt(0xFFF8)
3161 v.AddArg3(v0, v2, v3)
3165 func rewriteValuePPC64_OpLsh8x32(v *Value) bool {
3169 typ := &b.Func.Config.Types
3170 // match: (Lsh8x32 x y)
3171 // cond: shiftIsBounded(v)
3172 // result: (SLD x y)
3176 if !(shiftIsBounded(v)) {
3183 // match: (Lsh8x32 <t> x y)
3184 // result: (ISEL [0] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [8]))
3189 v.reset(OpPPC64ISEL)
3190 v.AuxInt = int32ToAuxInt(0)
3191 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3192 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
3195 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3196 v2.AuxInt = int64ToAuxInt(0)
3197 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
3198 v3.AuxInt = int32ToAuxInt(8)
3200 v.AddArg3(v0, v2, v3)
3204 func rewriteValuePPC64_OpLsh8x64(v *Value) bool {
3208 typ := &b.Func.Config.Types
3209 // match: (Lsh8x64 x (MOVDconst [c]))
3210 // cond: uint64(c) < 8
3211 // result: (SLWconst x [c])
3214 if v_1.Op != OpPPC64MOVDconst {
3217 c := auxIntToInt64(v_1.AuxInt)
3218 if !(uint64(c) < 8) {
3221 v.reset(OpPPC64SLWconst)
3222 v.AuxInt = int64ToAuxInt(c)
3226 // match: (Lsh8x64 x y)
3227 // cond: shiftIsBounded(v)
3228 // result: (SLD x y)
3232 if !(shiftIsBounded(v)) {
3239 // match: (Lsh8x64 <t> x y)
3240 // result: (ISEL [0] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [8]))
3245 v.reset(OpPPC64ISEL)
3246 v.AuxInt = int32ToAuxInt(0)
3247 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3248 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
3251 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3252 v2.AuxInt = int64ToAuxInt(0)
3253 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
3254 v3.AuxInt = int64ToAuxInt(8)
3256 v.AddArg3(v0, v2, v3)
3260 func rewriteValuePPC64_OpLsh8x8(v *Value) bool {
3264 typ := &b.Func.Config.Types
3265 // match: (Lsh8x8 x y)
3266 // cond: shiftIsBounded(v)
3267 // result: (SLD x y)
3271 if !(shiftIsBounded(v)) {
3278 // match: (Lsh8x8 <t> x y)
3279 // result: (ISEL [2] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F8] y)))
3284 v.reset(OpPPC64ISEL)
3285 v.AuxInt = int32ToAuxInt(2)
3286 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3287 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
3290 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3291 v2.AuxInt = int64ToAuxInt(0)
3292 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
3293 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
3294 v4.AuxInt = int64ToAuxInt(0x00F8)
3297 v.AddArg3(v0, v2, v3)
3301 func rewriteValuePPC64_OpMod16(v *Value) bool {
3305 typ := &b.Func.Config.Types
3306 // match: (Mod16 x y)
3307 // result: (Mod32 (SignExt16to32 x) (SignExt16to32 y))
3312 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3314 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3320 func rewriteValuePPC64_OpMod16u(v *Value) bool {
3324 typ := &b.Func.Config.Types
3325 // match: (Mod16u x y)
3326 // result: (Mod32u (ZeroExt16to32 x) (ZeroExt16to32 y))
3331 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3333 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3339 func rewriteValuePPC64_OpMod32(v *Value) bool {
3343 typ := &b.Func.Config.Types
3344 // match: (Mod32 x y)
3345 // cond: buildcfg.GOPPC64 >= 9
3346 // result: (MODSW x y)
3350 if !(buildcfg.GOPPC64 >= 9) {
3353 v.reset(OpPPC64MODSW)
3357 // match: (Mod32 x y)
3358 // cond: buildcfg.GOPPC64 <= 8
3359 // result: (SUB x (MULLW y (DIVW x y)))
3363 if !(buildcfg.GOPPC64 <= 8) {
3367 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
3368 v1 := b.NewValue0(v.Pos, OpPPC64DIVW, typ.Int32)
3376 func rewriteValuePPC64_OpMod32u(v *Value) bool {
3380 typ := &b.Func.Config.Types
3381 // match: (Mod32u x y)
3382 // cond: buildcfg.GOPPC64 >= 9
3383 // result: (MODUW x y)
3387 if !(buildcfg.GOPPC64 >= 9) {
3390 v.reset(OpPPC64MODUW)
3394 // match: (Mod32u x y)
3395 // cond: buildcfg.GOPPC64 <= 8
3396 // result: (SUB x (MULLW y (DIVWU x y)))
3400 if !(buildcfg.GOPPC64 <= 8) {
3404 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
3405 v1 := b.NewValue0(v.Pos, OpPPC64DIVWU, typ.Int32)
3413 func rewriteValuePPC64_OpMod64(v *Value) bool {
3417 typ := &b.Func.Config.Types
3418 // match: (Mod64 x y)
3419 // cond: buildcfg.GOPPC64 >=9
3420 // result: (MODSD x y)
3424 if !(buildcfg.GOPPC64 >= 9) {
3427 v.reset(OpPPC64MODSD)
3431 // match: (Mod64 x y)
3432 // cond: buildcfg.GOPPC64 <=8
3433 // result: (SUB x (MULLD y (DIVD x y)))
3437 if !(buildcfg.GOPPC64 <= 8) {
3441 v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
3442 v1 := b.NewValue0(v.Pos, OpPPC64DIVD, typ.Int64)
3450 func rewriteValuePPC64_OpMod64u(v *Value) bool {
3454 typ := &b.Func.Config.Types
3455 // match: (Mod64u x y)
3456 // cond: buildcfg.GOPPC64 >= 9
3457 // result: (MODUD x y)
3461 if !(buildcfg.GOPPC64 >= 9) {
3464 v.reset(OpPPC64MODUD)
3468 // match: (Mod64u x y)
3469 // cond: buildcfg.GOPPC64 <= 8
3470 // result: (SUB x (MULLD y (DIVDU x y)))
3474 if !(buildcfg.GOPPC64 <= 8) {
3478 v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
3479 v1 := b.NewValue0(v.Pos, OpPPC64DIVDU, typ.Int64)
3487 func rewriteValuePPC64_OpMod8(v *Value) bool {
3491 typ := &b.Func.Config.Types
3492 // match: (Mod8 x y)
3493 // result: (Mod32 (SignExt8to32 x) (SignExt8to32 y))
3498 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
3500 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
3506 func rewriteValuePPC64_OpMod8u(v *Value) bool {
3510 typ := &b.Func.Config.Types
3511 // match: (Mod8u x y)
3512 // result: (Mod32u (ZeroExt8to32 x) (ZeroExt8to32 y))
3517 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
3519 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
3525 func rewriteValuePPC64_OpMove(v *Value) bool {
3530 typ := &b.Func.Config.Types
3531 // match: (Move [0] _ _ mem)
3534 if auxIntToInt64(v.AuxInt) != 0 {
3541 // match: (Move [1] dst src mem)
3542 // result: (MOVBstore dst (MOVBZload src mem) mem)
3544 if auxIntToInt64(v.AuxInt) != 1 {
3550 v.reset(OpPPC64MOVBstore)
3551 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3552 v0.AddArg2(src, mem)
3553 v.AddArg3(dst, v0, mem)
3556 // match: (Move [2] dst src mem)
3557 // result: (MOVHstore dst (MOVHZload src mem) mem)
3559 if auxIntToInt64(v.AuxInt) != 2 {
3565 v.reset(OpPPC64MOVHstore)
3566 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
3567 v0.AddArg2(src, mem)
3568 v.AddArg3(dst, v0, mem)
3571 // match: (Move [4] dst src mem)
3572 // result: (MOVWstore dst (MOVWZload src mem) mem)
3574 if auxIntToInt64(v.AuxInt) != 4 {
3580 v.reset(OpPPC64MOVWstore)
3581 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3582 v0.AddArg2(src, mem)
3583 v.AddArg3(dst, v0, mem)
3586 // match: (Move [8] {t} dst src mem)
3587 // result: (MOVDstore dst (MOVDload src mem) mem)
3589 if auxIntToInt64(v.AuxInt) != 8 {
3595 v.reset(OpPPC64MOVDstore)
3596 v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, typ.Int64)
3597 v0.AddArg2(src, mem)
3598 v.AddArg3(dst, v0, mem)
3601 // match: (Move [3] dst src mem)
3602 // result: (MOVBstore [2] dst (MOVBZload [2] src mem) (MOVHstore dst (MOVHload src mem) mem))
3604 if auxIntToInt64(v.AuxInt) != 3 {
3610 v.reset(OpPPC64MOVBstore)
3611 v.AuxInt = int32ToAuxInt(2)
3612 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3613 v0.AuxInt = int32ToAuxInt(2)
3614 v0.AddArg2(src, mem)
3615 v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
3616 v2 := b.NewValue0(v.Pos, OpPPC64MOVHload, typ.Int16)
3617 v2.AddArg2(src, mem)
3618 v1.AddArg3(dst, v2, mem)
3619 v.AddArg3(dst, v0, v1)
3622 // match: (Move [5] dst src mem)
3623 // result: (MOVBstore [4] dst (MOVBZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
3625 if auxIntToInt64(v.AuxInt) != 5 {
3631 v.reset(OpPPC64MOVBstore)
3632 v.AuxInt = int32ToAuxInt(4)
3633 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3634 v0.AuxInt = int32ToAuxInt(4)
3635 v0.AddArg2(src, mem)
3636 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
3637 v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3638 v2.AddArg2(src, mem)
3639 v1.AddArg3(dst, v2, mem)
3640 v.AddArg3(dst, v0, v1)
3643 // match: (Move [6] dst src mem)
3644 // result: (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
3646 if auxIntToInt64(v.AuxInt) != 6 {
3652 v.reset(OpPPC64MOVHstore)
3653 v.AuxInt = int32ToAuxInt(4)
3654 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
3655 v0.AuxInt = int32ToAuxInt(4)
3656 v0.AddArg2(src, mem)
3657 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
3658 v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3659 v2.AddArg2(src, mem)
3660 v1.AddArg3(dst, v2, mem)
3661 v.AddArg3(dst, v0, v1)
3664 // match: (Move [7] dst src mem)
3665 // result: (MOVBstore [6] dst (MOVBZload [6] src mem) (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem)))
3667 if auxIntToInt64(v.AuxInt) != 7 {
3673 v.reset(OpPPC64MOVBstore)
3674 v.AuxInt = int32ToAuxInt(6)
3675 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3676 v0.AuxInt = int32ToAuxInt(6)
3677 v0.AddArg2(src, mem)
3678 v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
3679 v1.AuxInt = int32ToAuxInt(4)
3680 v2 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
3681 v2.AuxInt = int32ToAuxInt(4)
3682 v2.AddArg2(src, mem)
3683 v3 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
3684 v4 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3685 v4.AddArg2(src, mem)
3686 v3.AddArg3(dst, v4, mem)
3687 v1.AddArg3(dst, v2, v3)
3688 v.AddArg3(dst, v0, v1)
3691 // match: (Move [s] dst src mem)
3692 // cond: s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)
3693 // result: (LoweredMove [s] dst src mem)
3695 s := auxIntToInt64(v.AuxInt)
3699 if !(s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)) {
3702 v.reset(OpPPC64LoweredMove)
3703 v.AuxInt = int64ToAuxInt(s)
3704 v.AddArg3(dst, src, mem)
3707 // match: (Move [s] dst src mem)
3708 // cond: s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9
3709 // result: (LoweredQuadMoveShort [s] dst src mem)
3711 s := auxIntToInt64(v.AuxInt)
3715 if !(s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9) {
3718 v.reset(OpPPC64LoweredQuadMoveShort)
3719 v.AuxInt = int64ToAuxInt(s)
3720 v.AddArg3(dst, src, mem)
3723 // match: (Move [s] dst src mem)
3724 // cond: s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)
3725 // result: (LoweredQuadMove [s] dst src mem)
3727 s := auxIntToInt64(v.AuxInt)
3731 if !(s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)) {
3734 v.reset(OpPPC64LoweredQuadMove)
3735 v.AuxInt = int64ToAuxInt(s)
3736 v.AddArg3(dst, src, mem)
3741 func rewriteValuePPC64_OpNeq16(v *Value) bool {
3745 typ := &b.Func.Config.Types
3746 // match: (Neq16 x y)
3747 // cond: x.Type.IsSigned() && y.Type.IsSigned()
3748 // result: (NotEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
3750 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3753 if !(x.Type.IsSigned() && y.Type.IsSigned()) {
3756 v.reset(OpPPC64NotEqual)
3757 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3758 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3760 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3768 // match: (Neq16 x y)
3769 // result: (NotEqual (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
3773 v.reset(OpPPC64NotEqual)
3774 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3775 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3777 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3784 func rewriteValuePPC64_OpNeq32(v *Value) bool {
3788 // match: (Neq32 x y)
3789 // result: (NotEqual (CMPW x y))
3793 v.reset(OpPPC64NotEqual)
3794 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3800 func rewriteValuePPC64_OpNeq32F(v *Value) bool {
3804 // match: (Neq32F x y)
3805 // result: (NotEqual (FCMPU x y))
3809 v.reset(OpPPC64NotEqual)
3810 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
3816 func rewriteValuePPC64_OpNeq64(v *Value) bool {
3820 // match: (Neq64 x y)
3821 // result: (NotEqual (CMP x y))
3825 v.reset(OpPPC64NotEqual)
3826 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
3832 func rewriteValuePPC64_OpNeq64F(v *Value) bool {
3836 // match: (Neq64F x y)
3837 // result: (NotEqual (FCMPU x y))
3841 v.reset(OpPPC64NotEqual)
3842 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
3848 func rewriteValuePPC64_OpNeq8(v *Value) bool {
3852 typ := &b.Func.Config.Types
3853 // match: (Neq8 x y)
3854 // cond: x.Type.IsSigned() && y.Type.IsSigned()
3855 // result: (NotEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
3857 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3860 if !(x.Type.IsSigned() && y.Type.IsSigned()) {
3863 v.reset(OpPPC64NotEqual)
3864 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3865 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
3867 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
3875 // match: (Neq8 x y)
3876 // result: (NotEqual (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
3880 v.reset(OpPPC64NotEqual)
3881 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3882 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
3884 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
3891 func rewriteValuePPC64_OpNeqPtr(v *Value) bool {
3895 // match: (NeqPtr x y)
3896 // result: (NotEqual (CMP x y))
3900 v.reset(OpPPC64NotEqual)
3901 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
3907 func rewriteValuePPC64_OpNot(v *Value) bool {
3910 // result: (XORconst [1] x)
3913 v.reset(OpPPC64XORconst)
3914 v.AuxInt = int64ToAuxInt(1)
3919 func rewriteValuePPC64_OpOffPtr(v *Value) bool {
3922 typ := &b.Func.Config.Types
3923 // match: (OffPtr [off] ptr)
3924 // result: (ADD (MOVDconst <typ.Int64> [off]) ptr)
3926 off := auxIntToInt64(v.AuxInt)
3929 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3930 v0.AuxInt = int64ToAuxInt(off)
3935 func rewriteValuePPC64_OpPPC64ADD(v *Value) bool {
3938 // match: (ADD l:(MULLD x y) z)
3939 // cond: buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)
3940 // result: (MADDLD x y z)
3942 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3944 if l.Op != OpPPC64MULLD {
3950 if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
3953 v.reset(OpPPC64MADDLD)
3959 // match: (ADD x (MOVDconst <t> [c]))
3960 // cond: is32Bit(c) && !t.IsPtr()
3961 // result: (ADDconst [c] x)
3963 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3965 if v_1.Op != OpPPC64MOVDconst {
3969 c := auxIntToInt64(v_1.AuxInt)
3970 if !(is32Bit(c) && !t.IsPtr()) {
3973 v.reset(OpPPC64ADDconst)
3974 v.AuxInt = int64ToAuxInt(c)
3982 func rewriteValuePPC64_OpPPC64ADDE(v *Value) bool {
3987 typ := &b.Func.Config.Types
3988 // match: (ADDE x y (Select1 <typ.UInt64> (ADDCconst (MOVDconst [0]) [-1])))
3989 // result: (ADDC x y)
3993 if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
3996 v_2_0 := v_2.Args[0]
3997 if v_2_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_2_0.AuxInt) != -1 {
4000 v_2_0_0 := v_2_0.Args[0]
4001 if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
4004 v.reset(OpPPC64ADDC)
4010 func rewriteValuePPC64_OpPPC64ADDconst(v *Value) bool {
4012 // match: (ADDconst [c] (ADDconst [d] x))
4013 // cond: is32Bit(c+d)
4014 // result: (ADDconst [c+d] x)
4016 c := auxIntToInt64(v.AuxInt)
4017 if v_0.Op != OpPPC64ADDconst {
4020 d := auxIntToInt64(v_0.AuxInt)
4022 if !(is32Bit(c + d)) {
4025 v.reset(OpPPC64ADDconst)
4026 v.AuxInt = int64ToAuxInt(c + d)
4030 // match: (ADDconst [0] x)
4033 if auxIntToInt64(v.AuxInt) != 0 {
4040 // match: (ADDconst [c] (MOVDaddr [d] {sym} x))
4041 // cond: is32Bit(c+int64(d))
4042 // result: (MOVDaddr [int32(c+int64(d))] {sym} x)
4044 c := auxIntToInt64(v.AuxInt)
4045 if v_0.Op != OpPPC64MOVDaddr {
4048 d := auxIntToInt32(v_0.AuxInt)
4049 sym := auxToSym(v_0.Aux)
4051 if !(is32Bit(c + int64(d))) {
4054 v.reset(OpPPC64MOVDaddr)
4055 v.AuxInt = int32ToAuxInt(int32(c + int64(d)))
4056 v.Aux = symToAux(sym)
4060 // match: (ADDconst [c] x:(SP))
4062 // result: (MOVDaddr [int32(c)] x)
4064 c := auxIntToInt64(v.AuxInt)
4066 if x.Op != OpSP || !(is32Bit(c)) {
4069 v.reset(OpPPC64MOVDaddr)
4070 v.AuxInt = int32ToAuxInt(int32(c))
4074 // match: (ADDconst [c] (SUBFCconst [d] x))
4075 // cond: is32Bit(c+d)
4076 // result: (SUBFCconst [c+d] x)
4078 c := auxIntToInt64(v.AuxInt)
4079 if v_0.Op != OpPPC64SUBFCconst {
4082 d := auxIntToInt64(v_0.AuxInt)
4084 if !(is32Bit(c + d)) {
4087 v.reset(OpPPC64SUBFCconst)
4088 v.AuxInt = int64ToAuxInt(c + d)
4094 func rewriteValuePPC64_OpPPC64AND(v *Value) bool {
4098 typ := &b.Func.Config.Types
4099 // match: (AND (MOVDconst [m]) (ROTLWconst [r] x))
4100 // cond: isPPC64WordRotateMask(m)
4101 // result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
4103 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4104 if v_0.Op != OpPPC64MOVDconst {
4107 m := auxIntToInt64(v_0.AuxInt)
4108 if v_1.Op != OpPPC64ROTLWconst {
4111 r := auxIntToInt64(v_1.AuxInt)
4113 if !(isPPC64WordRotateMask(m)) {
4116 v.reset(OpPPC64RLWINM)
4117 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
4123 // match: (AND (MOVDconst [m]) (ROTLW x r))
4124 // cond: isPPC64WordRotateMask(m)
4125 // result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
4127 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4128 if v_0.Op != OpPPC64MOVDconst {
4131 m := auxIntToInt64(v_0.AuxInt)
4132 if v_1.Op != OpPPC64ROTLW {
4137 if !(isPPC64WordRotateMask(m)) {
4140 v.reset(OpPPC64RLWNM)
4141 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
4147 // match: (AND (MOVDconst [m]) (SRWconst x [s]))
4148 // cond: mergePPC64RShiftMask(m,s,32) == 0
4149 // result: (MOVDconst [0])
4151 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4152 if v_0.Op != OpPPC64MOVDconst {
4155 m := auxIntToInt64(v_0.AuxInt)
4156 if v_1.Op != OpPPC64SRWconst {
4159 s := auxIntToInt64(v_1.AuxInt)
4160 if !(mergePPC64RShiftMask(m, s, 32) == 0) {
4163 v.reset(OpPPC64MOVDconst)
4164 v.AuxInt = int64ToAuxInt(0)
4169 // match: (AND (MOVDconst [m]) (SRWconst x [s]))
4170 // cond: mergePPC64AndSrwi(m,s) != 0
4171 // result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
4173 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4174 if v_0.Op != OpPPC64MOVDconst {
4177 m := auxIntToInt64(v_0.AuxInt)
4178 if v_1.Op != OpPPC64SRWconst {
4181 s := auxIntToInt64(v_1.AuxInt)
4183 if !(mergePPC64AndSrwi(m, s) != 0) {
4186 v.reset(OpPPC64RLWINM)
4187 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
4193 // match: (AND x (NOR y y))
4194 // result: (ANDN x y)
4196 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4198 if v_1.Op != OpPPC64NOR {
4202 if y != v_1.Args[0] {
4205 v.reset(OpPPC64ANDN)
4211 // match: (AND (MOVDconst [c]) (MOVDconst [d]))
4212 // result: (MOVDconst [c&d])
4214 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4215 if v_0.Op != OpPPC64MOVDconst {
4218 c := auxIntToInt64(v_0.AuxInt)
4219 if v_1.Op != OpPPC64MOVDconst {
4222 d := auxIntToInt64(v_1.AuxInt)
4223 v.reset(OpPPC64MOVDconst)
4224 v.AuxInt = int64ToAuxInt(c & d)
4229 // match: (AND x (MOVDconst [c]))
4230 // cond: isU16Bit(c)
4231 // result: (Select0 (ANDCCconst [c] x))
4233 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4235 if v_1.Op != OpPPC64MOVDconst {
4238 c := auxIntToInt64(v_1.AuxInt)
4243 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
4244 v0.AuxInt = int64ToAuxInt(c)
4251 // match: (AND (MOVDconst [c]) y:(MOVWZreg _))
4252 // cond: c&0xFFFFFFFF == 0xFFFFFFFF
4255 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4256 if v_0.Op != OpPPC64MOVDconst {
4259 c := auxIntToInt64(v_0.AuxInt)
4261 if y.Op != OpPPC64MOVWZreg || !(c&0xFFFFFFFF == 0xFFFFFFFF) {
4269 // match: (AND (MOVDconst [0xFFFFFFFF]) y:(MOVWreg x))
4270 // result: (MOVWZreg x)
4272 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4273 if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0xFFFFFFFF {
4277 if y.Op != OpPPC64MOVWreg {
4281 v.reset(OpPPC64MOVWZreg)
4287 // match: (AND (MOVDconst [c]) x:(MOVBZload _ _))
4288 // result: (Select0 (ANDCCconst [c&0xFF] x))
4290 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4291 if v_0.Op != OpPPC64MOVDconst {
4294 c := auxIntToInt64(v_0.AuxInt)
4296 if x.Op != OpPPC64MOVBZload {
4300 v0 := b.NewValue0(x.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
4301 v0.AuxInt = int64ToAuxInt(c & 0xFF)
4310 func rewriteValuePPC64_OpPPC64ANDCCconst(v *Value) bool {
4312 // match: (ANDCCconst [c] (Select0 (ANDCCconst [d] x)))
4313 // result: (ANDCCconst [c&d] x)
4315 c := auxIntToInt64(v.AuxInt)
4316 if v_0.Op != OpSelect0 {
4319 v_0_0 := v_0.Args[0]
4320 if v_0_0.Op != OpPPC64ANDCCconst {
4323 d := auxIntToInt64(v_0_0.AuxInt)
4325 v.reset(OpPPC64ANDCCconst)
4326 v.AuxInt = int64ToAuxInt(c & d)
4332 func rewriteValuePPC64_OpPPC64ANDN(v *Value) bool {
4335 // match: (ANDN (MOVDconst [c]) (MOVDconst [d]))
4336 // result: (MOVDconst [c&^d])
4338 if v_0.Op != OpPPC64MOVDconst {
4341 c := auxIntToInt64(v_0.AuxInt)
4342 if v_1.Op != OpPPC64MOVDconst {
4345 d := auxIntToInt64(v_1.AuxInt)
4346 v.reset(OpPPC64MOVDconst)
4347 v.AuxInt = int64ToAuxInt(c &^ d)
4352 func rewriteValuePPC64_OpPPC64BRD(v *Value) bool {
4355 typ := &b.Func.Config.Types
4356 // match: (BRD x:(MOVDload [off] {sym} ptr mem))
4357 // cond: x.Uses == 1
4358 // result: @x.Block (MOVDBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
4361 if x.Op != OpPPC64MOVDload {
4364 off := auxIntToInt32(x.AuxInt)
4365 sym := auxToSym(x.Aux)
4372 v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
4374 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
4375 v1.AuxInt = int32ToAuxInt(off)
4376 v1.Aux = symToAux(sym)
4381 // match: (BRD x:(MOVDloadidx ptr idx mem))
4382 // cond: x.Uses == 1
4383 // result: @x.Block (MOVDBRloadidx ptr idx mem)
4386 if x.Op != OpPPC64MOVDloadidx {
4396 v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
4398 v0.AddArg3(ptr, idx, mem)
4403 func rewriteValuePPC64_OpPPC64BRH(v *Value) bool {
4406 typ := &b.Func.Config.Types
4407 // match: (BRH x:(MOVHZload [off] {sym} ptr mem))
4408 // cond: x.Uses == 1
4409 // result: @x.Block (MOVHBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
4412 if x.Op != OpPPC64MOVHZload {
4415 off := auxIntToInt32(x.AuxInt)
4416 sym := auxToSym(x.Aux)
4423 v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
4425 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
4426 v1.AuxInt = int32ToAuxInt(off)
4427 v1.Aux = symToAux(sym)
4432 // match: (BRH x:(MOVHZloadidx ptr idx mem))
4433 // cond: x.Uses == 1
4434 // result: @x.Block (MOVHZreg (MOVHBRloadidx ptr idx mem))
4437 if x.Op != OpPPC64MOVHZloadidx {
4447 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
4449 v1 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
4450 v1.AddArg3(ptr, idx, mem)
4456 func rewriteValuePPC64_OpPPC64BRW(v *Value) bool {
4459 typ := &b.Func.Config.Types
4460 // match: (BRW x:(MOVWZload [off] {sym} ptr mem))
4461 // cond: x.Uses == 1
4462 // result: @x.Block (MOVWBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
4465 if x.Op != OpPPC64MOVWZload {
4468 off := auxIntToInt32(x.AuxInt)
4469 sym := auxToSym(x.Aux)
4476 v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
4478 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
4479 v1.AuxInt = int32ToAuxInt(off)
4480 v1.Aux = symToAux(sym)
4485 // match: (BRW x:(MOVWZloadidx ptr idx mem))
4486 // cond: x.Uses == 1
4487 // result: @x.Block (MOVWZreg (MOVWBRloadidx ptr idx mem))
4490 if x.Op != OpPPC64MOVWZloadidx {
4500 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
4502 v1 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
4503 v1.AddArg3(ptr, idx, mem)
4509 func rewriteValuePPC64_OpPPC64CLRLSLDI(v *Value) bool {
4511 // match: (CLRLSLDI [c] (SRWconst [s] x))
4512 // cond: mergePPC64ClrlsldiSrw(int64(c),s) != 0
4513 // result: (RLWINM [mergePPC64ClrlsldiSrw(int64(c),s)] x)
4515 c := auxIntToInt32(v.AuxInt)
4516 if v_0.Op != OpPPC64SRWconst {
4519 s := auxIntToInt64(v_0.AuxInt)
4521 if !(mergePPC64ClrlsldiSrw(int64(c), s) != 0) {
4524 v.reset(OpPPC64RLWINM)
4525 v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrw(int64(c), s))
4529 // match: (CLRLSLDI [c] i:(RLWINM [s] x))
4530 // cond: mergePPC64ClrlsldiRlwinm(c,s) != 0
4531 // result: (RLWINM [mergePPC64ClrlsldiRlwinm(c,s)] x)
4533 c := auxIntToInt32(v.AuxInt)
4535 if i.Op != OpPPC64RLWINM {
4538 s := auxIntToInt64(i.AuxInt)
4540 if !(mergePPC64ClrlsldiRlwinm(c, s) != 0) {
4543 v.reset(OpPPC64RLWINM)
4544 v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiRlwinm(c, s))
4550 func rewriteValuePPC64_OpPPC64CMP(v *Value) bool {
4554 // match: (CMP x (MOVDconst [c]))
4556 // result: (CMPconst x [c])
4559 if v_1.Op != OpPPC64MOVDconst {
4562 c := auxIntToInt64(v_1.AuxInt)
4566 v.reset(OpPPC64CMPconst)
4567 v.AuxInt = int64ToAuxInt(c)
4571 // match: (CMP (MOVDconst [c]) y)
4573 // result: (InvertFlags (CMPconst y [c]))
4575 if v_0.Op != OpPPC64MOVDconst {
4578 c := auxIntToInt64(v_0.AuxInt)
4583 v.reset(OpPPC64InvertFlags)
4584 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
4585 v0.AuxInt = int64ToAuxInt(c)
4591 // cond: canonLessThan(x,y)
4592 // result: (InvertFlags (CMP y x))
4596 if !(canonLessThan(x, y)) {
4599 v.reset(OpPPC64InvertFlags)
4600 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
4607 func rewriteValuePPC64_OpPPC64CMPU(v *Value) bool {
4611 // match: (CMPU x (MOVDconst [c]))
4612 // cond: isU16Bit(c)
4613 // result: (CMPUconst x [c])
4616 if v_1.Op != OpPPC64MOVDconst {
4619 c := auxIntToInt64(v_1.AuxInt)
4623 v.reset(OpPPC64CMPUconst)
4624 v.AuxInt = int64ToAuxInt(c)
4628 // match: (CMPU (MOVDconst [c]) y)
4629 // cond: isU16Bit(c)
4630 // result: (InvertFlags (CMPUconst y [c]))
4632 if v_0.Op != OpPPC64MOVDconst {
4635 c := auxIntToInt64(v_0.AuxInt)
4640 v.reset(OpPPC64InvertFlags)
4641 v0 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
4642 v0.AuxInt = int64ToAuxInt(c)
4647 // match: (CMPU x y)
4648 // cond: canonLessThan(x,y)
4649 // result: (InvertFlags (CMPU y x))
4653 if !(canonLessThan(x, y)) {
4656 v.reset(OpPPC64InvertFlags)
4657 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
4664 func rewriteValuePPC64_OpPPC64CMPUconst(v *Value) bool {
4666 // match: (CMPUconst [d] (Select0 (ANDCCconst z [c])))
4667 // cond: uint64(d) > uint64(c)
4670 d := auxIntToInt64(v.AuxInt)
4671 if v_0.Op != OpSelect0 {
4674 v_0_0 := v_0.Args[0]
4675 if v_0_0.Op != OpPPC64ANDCCconst {
4678 c := auxIntToInt64(v_0_0.AuxInt)
4679 if !(uint64(d) > uint64(c)) {
4682 v.reset(OpPPC64FlagLT)
4685 // match: (CMPUconst (MOVDconst [x]) [y])
4689 y := auxIntToInt64(v.AuxInt)
4690 if v_0.Op != OpPPC64MOVDconst {
4693 x := auxIntToInt64(v_0.AuxInt)
4697 v.reset(OpPPC64FlagEQ)
4700 // match: (CMPUconst (MOVDconst [x]) [y])
4701 // cond: uint64(x)<uint64(y)
4704 y := auxIntToInt64(v.AuxInt)
4705 if v_0.Op != OpPPC64MOVDconst {
4708 x := auxIntToInt64(v_0.AuxInt)
4709 if !(uint64(x) < uint64(y)) {
4712 v.reset(OpPPC64FlagLT)
4715 // match: (CMPUconst (MOVDconst [x]) [y])
4716 // cond: uint64(x)>uint64(y)
4719 y := auxIntToInt64(v.AuxInt)
4720 if v_0.Op != OpPPC64MOVDconst {
4723 x := auxIntToInt64(v_0.AuxInt)
4724 if !(uint64(x) > uint64(y)) {
4727 v.reset(OpPPC64FlagGT)
4732 func rewriteValuePPC64_OpPPC64CMPW(v *Value) bool {
4736 // match: (CMPW x (MOVWreg y))
4737 // result: (CMPW x y)
4740 if v_1.Op != OpPPC64MOVWreg {
4744 v.reset(OpPPC64CMPW)
4748 // match: (CMPW (MOVWreg x) y)
4749 // result: (CMPW x y)
4751 if v_0.Op != OpPPC64MOVWreg {
4756 v.reset(OpPPC64CMPW)
4760 // match: (CMPW x (MOVDconst [c]))
4762 // result: (CMPWconst x [int32(c)])
4765 if v_1.Op != OpPPC64MOVDconst {
4768 c := auxIntToInt64(v_1.AuxInt)
4772 v.reset(OpPPC64CMPWconst)
4773 v.AuxInt = int32ToAuxInt(int32(c))
4777 // match: (CMPW (MOVDconst [c]) y)
4779 // result: (InvertFlags (CMPWconst y [int32(c)]))
4781 if v_0.Op != OpPPC64MOVDconst {
4784 c := auxIntToInt64(v_0.AuxInt)
4789 v.reset(OpPPC64InvertFlags)
4790 v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, types.TypeFlags)
4791 v0.AuxInt = int32ToAuxInt(int32(c))
4796 // match: (CMPW x y)
4797 // cond: canonLessThan(x,y)
4798 // result: (InvertFlags (CMPW y x))
4802 if !(canonLessThan(x, y)) {
4805 v.reset(OpPPC64InvertFlags)
4806 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
4813 func rewriteValuePPC64_OpPPC64CMPWU(v *Value) bool {
4817 // match: (CMPWU x (MOVWZreg y))
4818 // result: (CMPWU x y)
4821 if v_1.Op != OpPPC64MOVWZreg {
4825 v.reset(OpPPC64CMPWU)
4829 // match: (CMPWU (MOVWZreg x) y)
4830 // result: (CMPWU x y)
4832 if v_0.Op != OpPPC64MOVWZreg {
4837 v.reset(OpPPC64CMPWU)
4841 // match: (CMPWU x (MOVDconst [c]))
4842 // cond: isU16Bit(c)
4843 // result: (CMPWUconst x [int32(c)])
4846 if v_1.Op != OpPPC64MOVDconst {
4849 c := auxIntToInt64(v_1.AuxInt)
4853 v.reset(OpPPC64CMPWUconst)
4854 v.AuxInt = int32ToAuxInt(int32(c))
4858 // match: (CMPWU (MOVDconst [c]) y)
4859 // cond: isU16Bit(c)
4860 // result: (InvertFlags (CMPWUconst y [int32(c)]))
4862 if v_0.Op != OpPPC64MOVDconst {
4865 c := auxIntToInt64(v_0.AuxInt)
4870 v.reset(OpPPC64InvertFlags)
4871 v0 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
4872 v0.AuxInt = int32ToAuxInt(int32(c))
4877 // match: (CMPWU x y)
4878 // cond: canonLessThan(x,y)
4879 // result: (InvertFlags (CMPWU y x))
4883 if !(canonLessThan(x, y)) {
4886 v.reset(OpPPC64InvertFlags)
4887 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
4894 func rewriteValuePPC64_OpPPC64CMPWUconst(v *Value) bool {
4896 // match: (CMPWUconst [d] (Select0 (ANDCCconst z [c])))
4897 // cond: uint64(d) > uint64(c)
4900 d := auxIntToInt32(v.AuxInt)
4901 if v_0.Op != OpSelect0 {
4904 v_0_0 := v_0.Args[0]
4905 if v_0_0.Op != OpPPC64ANDCCconst {
4908 c := auxIntToInt64(v_0_0.AuxInt)
4909 if !(uint64(d) > uint64(c)) {
4912 v.reset(OpPPC64FlagLT)
4915 // match: (CMPWUconst (MOVDconst [x]) [y])
4916 // cond: int32(x)==int32(y)
4919 y := auxIntToInt32(v.AuxInt)
4920 if v_0.Op != OpPPC64MOVDconst {
4923 x := auxIntToInt64(v_0.AuxInt)
4924 if !(int32(x) == int32(y)) {
4927 v.reset(OpPPC64FlagEQ)
4930 // match: (CMPWUconst (MOVDconst [x]) [y])
4931 // cond: uint32(x)<uint32(y)
4934 y := auxIntToInt32(v.AuxInt)
4935 if v_0.Op != OpPPC64MOVDconst {
4938 x := auxIntToInt64(v_0.AuxInt)
4939 if !(uint32(x) < uint32(y)) {
4942 v.reset(OpPPC64FlagLT)
4945 // match: (CMPWUconst (MOVDconst [x]) [y])
4946 // cond: uint32(x)>uint32(y)
4949 y := auxIntToInt32(v.AuxInt)
4950 if v_0.Op != OpPPC64MOVDconst {
4953 x := auxIntToInt64(v_0.AuxInt)
4954 if !(uint32(x) > uint32(y)) {
4957 v.reset(OpPPC64FlagGT)
4962 func rewriteValuePPC64_OpPPC64CMPWconst(v *Value) bool {
4964 // match: (CMPWconst (MOVDconst [x]) [y])
4965 // cond: int32(x)==int32(y)
4968 y := auxIntToInt32(v.AuxInt)
4969 if v_0.Op != OpPPC64MOVDconst {
4972 x := auxIntToInt64(v_0.AuxInt)
4973 if !(int32(x) == int32(y)) {
4976 v.reset(OpPPC64FlagEQ)
4979 // match: (CMPWconst (MOVDconst [x]) [y])
4980 // cond: int32(x)<int32(y)
4983 y := auxIntToInt32(v.AuxInt)
4984 if v_0.Op != OpPPC64MOVDconst {
4987 x := auxIntToInt64(v_0.AuxInt)
4988 if !(int32(x) < int32(y)) {
4991 v.reset(OpPPC64FlagLT)
4994 // match: (CMPWconst (MOVDconst [x]) [y])
4995 // cond: int32(x)>int32(y)
4998 y := auxIntToInt32(v.AuxInt)
4999 if v_0.Op != OpPPC64MOVDconst {
5002 x := auxIntToInt64(v_0.AuxInt)
5003 if !(int32(x) > int32(y)) {
5006 v.reset(OpPPC64FlagGT)
5011 func rewriteValuePPC64_OpPPC64CMPconst(v *Value) bool {
5013 // match: (CMPconst (MOVDconst [x]) [y])
5017 y := auxIntToInt64(v.AuxInt)
5018 if v_0.Op != OpPPC64MOVDconst {
5021 x := auxIntToInt64(v_0.AuxInt)
5025 v.reset(OpPPC64FlagEQ)
5028 // match: (CMPconst (MOVDconst [x]) [y])
5032 y := auxIntToInt64(v.AuxInt)
5033 if v_0.Op != OpPPC64MOVDconst {
5036 x := auxIntToInt64(v_0.AuxInt)
5040 v.reset(OpPPC64FlagLT)
5043 // match: (CMPconst (MOVDconst [x]) [y])
5047 y := auxIntToInt64(v.AuxInt)
5048 if v_0.Op != OpPPC64MOVDconst {
5051 x := auxIntToInt64(v_0.AuxInt)
5055 v.reset(OpPPC64FlagGT)
5060 func rewriteValuePPC64_OpPPC64Equal(v *Value) bool {
5062 // match: (Equal (FlagEQ))
5063 // result: (MOVDconst [1])
5065 if v_0.Op != OpPPC64FlagEQ {
5068 v.reset(OpPPC64MOVDconst)
5069 v.AuxInt = int64ToAuxInt(1)
5072 // match: (Equal (FlagLT))
5073 // result: (MOVDconst [0])
5075 if v_0.Op != OpPPC64FlagLT {
5078 v.reset(OpPPC64MOVDconst)
5079 v.AuxInt = int64ToAuxInt(0)
5082 // match: (Equal (FlagGT))
5083 // result: (MOVDconst [0])
5085 if v_0.Op != OpPPC64FlagGT {
5088 v.reset(OpPPC64MOVDconst)
5089 v.AuxInt = int64ToAuxInt(0)
5092 // match: (Equal (InvertFlags x))
5093 // result: (Equal x)
5095 if v_0.Op != OpPPC64InvertFlags {
5099 v.reset(OpPPC64Equal)
5103 // match: (Equal cmp)
5104 // result: (SETBC [2] cmp)
5107 v.reset(OpPPC64SETBC)
5108 v.AuxInt = int32ToAuxInt(2)
5113 func rewriteValuePPC64_OpPPC64FABS(v *Value) bool {
5115 // match: (FABS (FMOVDconst [x]))
5116 // result: (FMOVDconst [math.Abs(x)])
5118 if v_0.Op != OpPPC64FMOVDconst {
5121 x := auxIntToFloat64(v_0.AuxInt)
5122 v.reset(OpPPC64FMOVDconst)
5123 v.AuxInt = float64ToAuxInt(math.Abs(x))
5128 func rewriteValuePPC64_OpPPC64FADD(v *Value) bool {
5131 // match: (FADD (FMUL x y) z)
5132 // cond: x.Block.Func.useFMA(v)
5133 // result: (FMADD x y z)
5135 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5136 if v_0.Op != OpPPC64FMUL {
5140 v_0_0 := v_0.Args[0]
5141 v_0_1 := v_0.Args[1]
5142 for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
5146 if !(x.Block.Func.useFMA(v)) {
5149 v.reset(OpPPC64FMADD)
5158 func rewriteValuePPC64_OpPPC64FADDS(v *Value) bool {
5161 // match: (FADDS (FMULS x y) z)
5162 // cond: x.Block.Func.useFMA(v)
5163 // result: (FMADDS x y z)
5165 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5166 if v_0.Op != OpPPC64FMULS {
5170 v_0_0 := v_0.Args[0]
5171 v_0_1 := v_0.Args[1]
5172 for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
5176 if !(x.Block.Func.useFMA(v)) {
5179 v.reset(OpPPC64FMADDS)
5188 func rewriteValuePPC64_OpPPC64FCEIL(v *Value) bool {
5190 // match: (FCEIL (FMOVDconst [x]))
5191 // result: (FMOVDconst [math.Ceil(x)])
5193 if v_0.Op != OpPPC64FMOVDconst {
5196 x := auxIntToFloat64(v_0.AuxInt)
5197 v.reset(OpPPC64FMOVDconst)
5198 v.AuxInt = float64ToAuxInt(math.Ceil(x))
5203 func rewriteValuePPC64_OpPPC64FFLOOR(v *Value) bool {
5205 // match: (FFLOOR (FMOVDconst [x]))
5206 // result: (FMOVDconst [math.Floor(x)])
5208 if v_0.Op != OpPPC64FMOVDconst {
5211 x := auxIntToFloat64(v_0.AuxInt)
5212 v.reset(OpPPC64FMOVDconst)
5213 v.AuxInt = float64ToAuxInt(math.Floor(x))
5218 func rewriteValuePPC64_OpPPC64FGreaterEqual(v *Value) bool {
5221 typ := &b.Func.Config.Types
5222 // match: (FGreaterEqual cmp)
5223 // result: (OR (SETBC [2] cmp) (SETBC [1] cmp))
5227 v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
5228 v0.AuxInt = int32ToAuxInt(2)
5230 v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
5231 v1.AuxInt = int32ToAuxInt(1)
5237 func rewriteValuePPC64_OpPPC64FGreaterThan(v *Value) bool {
5239 // match: (FGreaterThan cmp)
5240 // result: (SETBC [1] cmp)
5243 v.reset(OpPPC64SETBC)
5244 v.AuxInt = int32ToAuxInt(1)
5249 func rewriteValuePPC64_OpPPC64FLessEqual(v *Value) bool {
5252 typ := &b.Func.Config.Types
5253 // match: (FLessEqual cmp)
5254 // result: (OR (SETBC [2] cmp) (SETBC [0] cmp))
5258 v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
5259 v0.AuxInt = int32ToAuxInt(2)
5261 v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
5262 v1.AuxInt = int32ToAuxInt(0)
5268 func rewriteValuePPC64_OpPPC64FLessThan(v *Value) bool {
5270 // match: (FLessThan cmp)
5271 // result: (SETBC [0] cmp)
5274 v.reset(OpPPC64SETBC)
5275 v.AuxInt = int32ToAuxInt(0)
5280 func rewriteValuePPC64_OpPPC64FMOVDload(v *Value) bool {
5283 // match: (FMOVDload [off] {sym} ptr (MOVDstore [off] {sym} ptr x _))
5284 // result: (MTVSRD x)
5286 off := auxIntToInt32(v.AuxInt)
5287 sym := auxToSym(v.Aux)
5289 if v_1.Op != OpPPC64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
5293 if ptr != v_1.Args[0] {
5296 v.reset(OpPPC64MTVSRD)
5300 // match: (FMOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
5301 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
5302 // result: (FMOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
5304 off1 := auxIntToInt32(v.AuxInt)
5305 sym1 := auxToSym(v.Aux)
5307 if p.Op != OpPPC64MOVDaddr {
5310 off2 := auxIntToInt32(p.AuxInt)
5311 sym2 := auxToSym(p.Aux)
5314 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
5317 v.reset(OpPPC64FMOVDload)
5318 v.AuxInt = int32ToAuxInt(off1 + off2)
5319 v.Aux = symToAux(mergeSym(sym1, sym2))
5323 // match: (FMOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
5324 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
5325 // result: (FMOVDload [off1+int32(off2)] {sym} ptr mem)
5327 off1 := auxIntToInt32(v.AuxInt)
5328 sym := auxToSym(v.Aux)
5329 if v_0.Op != OpPPC64ADDconst {
5332 off2 := auxIntToInt64(v_0.AuxInt)
5335 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
5338 v.reset(OpPPC64FMOVDload)
5339 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
5340 v.Aux = symToAux(sym)
5346 func rewriteValuePPC64_OpPPC64FMOVDstore(v *Value) bool {
5350 // match: (FMOVDstore [off] {sym} ptr (MTVSRD x) mem)
5351 // result: (MOVDstore [off] {sym} ptr x mem)
5353 off := auxIntToInt32(v.AuxInt)
5354 sym := auxToSym(v.Aux)
5356 if v_1.Op != OpPPC64MTVSRD {
5361 v.reset(OpPPC64MOVDstore)
5362 v.AuxInt = int32ToAuxInt(off)
5363 v.Aux = symToAux(sym)
5364 v.AddArg3(ptr, x, mem)
5367 // match: (FMOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
5368 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
5369 // result: (FMOVDstore [off1+int32(off2)] {sym} ptr val mem)
5371 off1 := auxIntToInt32(v.AuxInt)
5372 sym := auxToSym(v.Aux)
5373 if v_0.Op != OpPPC64ADDconst {
5376 off2 := auxIntToInt64(v_0.AuxInt)
5380 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
5383 v.reset(OpPPC64FMOVDstore)
5384 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
5385 v.Aux = symToAux(sym)
5386 v.AddArg3(ptr, val, mem)
5389 // match: (FMOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
5390 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
5391 // result: (FMOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
5393 off1 := auxIntToInt32(v.AuxInt)
5394 sym1 := auxToSym(v.Aux)
5396 if p.Op != OpPPC64MOVDaddr {
5399 off2 := auxIntToInt32(p.AuxInt)
5400 sym2 := auxToSym(p.Aux)
5404 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
5407 v.reset(OpPPC64FMOVDstore)
5408 v.AuxInt = int32ToAuxInt(off1 + off2)
5409 v.Aux = symToAux(mergeSym(sym1, sym2))
5410 v.AddArg3(ptr, val, mem)
5415 func rewriteValuePPC64_OpPPC64FMOVSload(v *Value) bool {
5418 // match: (FMOVSload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
5419 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
5420 // result: (FMOVSload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
5422 off1 := auxIntToInt32(v.AuxInt)
5423 sym1 := auxToSym(v.Aux)
5425 if p.Op != OpPPC64MOVDaddr {
5428 off2 := auxIntToInt32(p.AuxInt)
5429 sym2 := auxToSym(p.Aux)
5432 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
5435 v.reset(OpPPC64FMOVSload)
5436 v.AuxInt = int32ToAuxInt(off1 + off2)
5437 v.Aux = symToAux(mergeSym(sym1, sym2))
5441 // match: (FMOVSload [off1] {sym} (ADDconst [off2] ptr) mem)
5442 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
5443 // result: (FMOVSload [off1+int32(off2)] {sym} ptr mem)
5445 off1 := auxIntToInt32(v.AuxInt)
5446 sym := auxToSym(v.Aux)
5447 if v_0.Op != OpPPC64ADDconst {
5450 off2 := auxIntToInt64(v_0.AuxInt)
5453 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
5456 v.reset(OpPPC64FMOVSload)
5457 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
5458 v.Aux = symToAux(sym)
5464 func rewriteValuePPC64_OpPPC64FMOVSstore(v *Value) bool {
5468 // match: (FMOVSstore [off1] {sym} (ADDconst [off2] ptr) val mem)
5469 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
5470 // result: (FMOVSstore [off1+int32(off2)] {sym} ptr val mem)
5472 off1 := auxIntToInt32(v.AuxInt)
5473 sym := auxToSym(v.Aux)
5474 if v_0.Op != OpPPC64ADDconst {
5477 off2 := auxIntToInt64(v_0.AuxInt)
5481 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
5484 v.reset(OpPPC64FMOVSstore)
5485 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
5486 v.Aux = symToAux(sym)
5487 v.AddArg3(ptr, val, mem)
5490 // match: (FMOVSstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
5491 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
5492 // result: (FMOVSstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
5494 off1 := auxIntToInt32(v.AuxInt)
5495 sym1 := auxToSym(v.Aux)
5497 if p.Op != OpPPC64MOVDaddr {
5500 off2 := auxIntToInt32(p.AuxInt)
5501 sym2 := auxToSym(p.Aux)
5505 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
5508 v.reset(OpPPC64FMOVSstore)
5509 v.AuxInt = int32ToAuxInt(off1 + off2)
5510 v.Aux = symToAux(mergeSym(sym1, sym2))
5511 v.AddArg3(ptr, val, mem)
5516 func rewriteValuePPC64_OpPPC64FNEG(v *Value) bool {
5518 // match: (FNEG (FABS x))
5519 // result: (FNABS x)
5521 if v_0.Op != OpPPC64FABS {
5525 v.reset(OpPPC64FNABS)
5529 // match: (FNEG (FNABS x))
5532 if v_0.Op != OpPPC64FNABS {
5536 v.reset(OpPPC64FABS)
5542 func rewriteValuePPC64_OpPPC64FSQRT(v *Value) bool {
5544 // match: (FSQRT (FMOVDconst [x]))
5546 // result: (FMOVDconst [math.Sqrt(x)])
5548 if v_0.Op != OpPPC64FMOVDconst {
5551 x := auxIntToFloat64(v_0.AuxInt)
5555 v.reset(OpPPC64FMOVDconst)
5556 v.AuxInt = float64ToAuxInt(math.Sqrt(x))
5561 func rewriteValuePPC64_OpPPC64FSUB(v *Value) bool {
5564 // match: (FSUB (FMUL x y) z)
5565 // cond: x.Block.Func.useFMA(v)
5566 // result: (FMSUB x y z)
5568 if v_0.Op != OpPPC64FMUL {
5572 v_0_0 := v_0.Args[0]
5573 v_0_1 := v_0.Args[1]
5574 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
5578 if !(x.Block.Func.useFMA(v)) {
5581 v.reset(OpPPC64FMSUB)
5589 func rewriteValuePPC64_OpPPC64FSUBS(v *Value) bool {
5592 // match: (FSUBS (FMULS x y) z)
5593 // cond: x.Block.Func.useFMA(v)
5594 // result: (FMSUBS x y z)
5596 if v_0.Op != OpPPC64FMULS {
5600 v_0_0 := v_0.Args[0]
5601 v_0_1 := v_0.Args[1]
5602 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
5606 if !(x.Block.Func.useFMA(v)) {
5609 v.reset(OpPPC64FMSUBS)
5617 func rewriteValuePPC64_OpPPC64FTRUNC(v *Value) bool {
5619 // match: (FTRUNC (FMOVDconst [x]))
5620 // result: (FMOVDconst [math.Trunc(x)])
5622 if v_0.Op != OpPPC64FMOVDconst {
5625 x := auxIntToFloat64(v_0.AuxInt)
5626 v.reset(OpPPC64FMOVDconst)
5627 v.AuxInt = float64ToAuxInt(math.Trunc(x))
5632 func rewriteValuePPC64_OpPPC64GreaterEqual(v *Value) bool {
5634 // match: (GreaterEqual (FlagEQ))
5635 // result: (MOVDconst [1])
5637 if v_0.Op != OpPPC64FlagEQ {
5640 v.reset(OpPPC64MOVDconst)
5641 v.AuxInt = int64ToAuxInt(1)
5644 // match: (GreaterEqual (FlagLT))
5645 // result: (MOVDconst [0])
5647 if v_0.Op != OpPPC64FlagLT {
5650 v.reset(OpPPC64MOVDconst)
5651 v.AuxInt = int64ToAuxInt(0)
5654 // match: (GreaterEqual (FlagGT))
5655 // result: (MOVDconst [1])
5657 if v_0.Op != OpPPC64FlagGT {
5660 v.reset(OpPPC64MOVDconst)
5661 v.AuxInt = int64ToAuxInt(1)
5664 // match: (GreaterEqual (InvertFlags x))
5665 // result: (LessEqual x)
5667 if v_0.Op != OpPPC64InvertFlags {
5671 v.reset(OpPPC64LessEqual)
5675 // match: (GreaterEqual cmp)
5676 // result: (SETBCR [0] cmp)
5679 v.reset(OpPPC64SETBCR)
5680 v.AuxInt = int32ToAuxInt(0)
5685 func rewriteValuePPC64_OpPPC64GreaterThan(v *Value) bool {
5687 // match: (GreaterThan (FlagEQ))
5688 // result: (MOVDconst [0])
5690 if v_0.Op != OpPPC64FlagEQ {
5693 v.reset(OpPPC64MOVDconst)
5694 v.AuxInt = int64ToAuxInt(0)
5697 // match: (GreaterThan (FlagLT))
5698 // result: (MOVDconst [0])
5700 if v_0.Op != OpPPC64FlagLT {
5703 v.reset(OpPPC64MOVDconst)
5704 v.AuxInt = int64ToAuxInt(0)
5707 // match: (GreaterThan (FlagGT))
5708 // result: (MOVDconst [1])
5710 if v_0.Op != OpPPC64FlagGT {
5713 v.reset(OpPPC64MOVDconst)
5714 v.AuxInt = int64ToAuxInt(1)
5717 // match: (GreaterThan (InvertFlags x))
5718 // result: (LessThan x)
5720 if v_0.Op != OpPPC64InvertFlags {
5724 v.reset(OpPPC64LessThan)
5728 // match: (GreaterThan cmp)
5729 // result: (SETBC [1] cmp)
5732 v.reset(OpPPC64SETBC)
5733 v.AuxInt = int32ToAuxInt(1)
5738 func rewriteValuePPC64_OpPPC64ISEL(v *Value) bool {
5743 typ := &b.Func.Config.Types
5744 // match: (ISEL [6] x y (Select1 (ANDCCconst [1] (SETBC [c] cmp))))
5745 // result: (ISEL [c] x y cmp)
5747 if auxIntToInt32(v.AuxInt) != 6 {
5752 if v_2.Op != OpSelect1 {
5755 v_2_0 := v_2.Args[0]
5756 if v_2_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_2_0.AuxInt) != 1 {
5759 v_2_0_0 := v_2_0.Args[0]
5760 if v_2_0_0.Op != OpPPC64SETBC {
5763 c := auxIntToInt32(v_2_0_0.AuxInt)
5764 cmp := v_2_0_0.Args[0]
5765 v.reset(OpPPC64ISEL)
5766 v.AuxInt = int32ToAuxInt(c)
5767 v.AddArg3(x, y, cmp)
5770 // match: (ISEL [6] x y (CMPconst [0] (SETBC [c] cmp)))
5771 // result: (ISEL [c] x y cmp)
5773 if auxIntToInt32(v.AuxInt) != 6 {
5778 if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
5781 v_2_0 := v_2.Args[0]
5782 if v_2_0.Op != OpPPC64SETBC {
5785 c := auxIntToInt32(v_2_0.AuxInt)
5786 cmp := v_2_0.Args[0]
5787 v.reset(OpPPC64ISEL)
5788 v.AuxInt = int32ToAuxInt(c)
5789 v.AddArg3(x, y, cmp)
5792 // match: (ISEL [6] x y (CMPWconst [0] (SETBC [c] cmp)))
5793 // result: (ISEL [c] x y cmp)
5795 if auxIntToInt32(v.AuxInt) != 6 {
5800 if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
5803 v_2_0 := v_2.Args[0]
5804 if v_2_0.Op != OpPPC64SETBC {
5807 c := auxIntToInt32(v_2_0.AuxInt)
5808 cmp := v_2_0.Args[0]
5809 v.reset(OpPPC64ISEL)
5810 v.AuxInt = int32ToAuxInt(c)
5811 v.AddArg3(x, y, cmp)
5814 // match: (ISEL [6] x y (CMPconst [0] (SETBCR [c] cmp)))
5815 // result: (ISEL [c+4] x y cmp)
5817 if auxIntToInt32(v.AuxInt) != 6 {
5822 if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
5825 v_2_0 := v_2.Args[0]
5826 if v_2_0.Op != OpPPC64SETBCR {
5829 c := auxIntToInt32(v_2_0.AuxInt)
5830 cmp := v_2_0.Args[0]
5831 v.reset(OpPPC64ISEL)
5832 v.AuxInt = int32ToAuxInt(c + 4)
5833 v.AddArg3(x, y, cmp)
5836 // match: (ISEL [6] x y (CMPWconst [0] (SETBCR [c] cmp)))
5837 // result: (ISEL [c+4] x y cmp)
5839 if auxIntToInt32(v.AuxInt) != 6 {
5844 if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
5847 v_2_0 := v_2.Args[0]
5848 if v_2_0.Op != OpPPC64SETBCR {
5851 c := auxIntToInt32(v_2_0.AuxInt)
5852 cmp := v_2_0.Args[0]
5853 v.reset(OpPPC64ISEL)
5854 v.AuxInt = int32ToAuxInt(c + 4)
5855 v.AddArg3(x, y, cmp)
5858 // match: (ISEL [2] x _ (FlagEQ))
5861 if auxIntToInt32(v.AuxInt) != 2 {
5865 if v_2.Op != OpPPC64FlagEQ {
5871 // match: (ISEL [2] _ y (FlagLT))
5874 if auxIntToInt32(v.AuxInt) != 2 {
5878 if v_2.Op != OpPPC64FlagLT {
5884 // match: (ISEL [2] _ y (FlagGT))
5887 if auxIntToInt32(v.AuxInt) != 2 {
5891 if v_2.Op != OpPPC64FlagGT {
5897 // match: (ISEL [6] _ y (FlagEQ))
5900 if auxIntToInt32(v.AuxInt) != 6 {
5904 if v_2.Op != OpPPC64FlagEQ {
5910 // match: (ISEL [6] x _ (FlagLT))
5913 if auxIntToInt32(v.AuxInt) != 6 {
5917 if v_2.Op != OpPPC64FlagLT {
5923 // match: (ISEL [6] x _ (FlagGT))
5926 if auxIntToInt32(v.AuxInt) != 6 {
5930 if v_2.Op != OpPPC64FlagGT {
5936 // match: (ISEL [0] _ y (FlagEQ))
5939 if auxIntToInt32(v.AuxInt) != 0 {
5943 if v_2.Op != OpPPC64FlagEQ {
5949 // match: (ISEL [0] _ y (FlagGT))
5952 if auxIntToInt32(v.AuxInt) != 0 {
5956 if v_2.Op != OpPPC64FlagGT {
5962 // match: (ISEL [0] x _ (FlagLT))
5965 if auxIntToInt32(v.AuxInt) != 0 {
5969 if v_2.Op != OpPPC64FlagLT {
5975 // match: (ISEL [5] _ x (FlagEQ))
5978 if auxIntToInt32(v.AuxInt) != 5 {
5982 if v_2.Op != OpPPC64FlagEQ {
5988 // match: (ISEL [5] _ x (FlagLT))
5991 if auxIntToInt32(v.AuxInt) != 5 {
5995 if v_2.Op != OpPPC64FlagLT {
6001 // match: (ISEL [5] y _ (FlagGT))
6004 if auxIntToInt32(v.AuxInt) != 5 {
6008 if v_2.Op != OpPPC64FlagGT {
6014 // match: (ISEL [1] _ y (FlagEQ))
6017 if auxIntToInt32(v.AuxInt) != 1 {
6021 if v_2.Op != OpPPC64FlagEQ {
6027 // match: (ISEL [1] _ y (FlagLT))
6030 if auxIntToInt32(v.AuxInt) != 1 {
6034 if v_2.Op != OpPPC64FlagLT {
6040 // match: (ISEL [1] x _ (FlagGT))
6043 if auxIntToInt32(v.AuxInt) != 1 {
6047 if v_2.Op != OpPPC64FlagGT {
6053 // match: (ISEL [4] x _ (FlagEQ))
6056 if auxIntToInt32(v.AuxInt) != 4 {
6060 if v_2.Op != OpPPC64FlagEQ {
6066 // match: (ISEL [4] x _ (FlagGT))
6069 if auxIntToInt32(v.AuxInt) != 4 {
6073 if v_2.Op != OpPPC64FlagGT {
6079 // match: (ISEL [4] _ y (FlagLT))
6082 if auxIntToInt32(v.AuxInt) != 4 {
6086 if v_2.Op != OpPPC64FlagLT {
6092 // match: (ISEL [2] x y (CMPconst [0] (Select0 (ANDCCconst [n] z))))
6093 // result: (ISEL [2] x y (Select1 <types.TypeFlags> (ANDCCconst [n] z )))
6095 if auxIntToInt32(v.AuxInt) != 2 {
6100 if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
6103 v_2_0 := v_2.Args[0]
6104 if v_2_0.Op != OpSelect0 {
6107 v_2_0_0 := v_2_0.Args[0]
6108 if v_2_0_0.Op != OpPPC64ANDCCconst {
6111 n := auxIntToInt64(v_2_0_0.AuxInt)
6112 z := v_2_0_0.Args[0]
6113 v.reset(OpPPC64ISEL)
6114 v.AuxInt = int32ToAuxInt(2)
6115 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
6116 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
6117 v1.AuxInt = int64ToAuxInt(n)
6123 // match: (ISEL [2] x y (CMPWconst [0] (Select0 (ANDCCconst [n] z))))
6124 // result: (ISEL [2] x y (Select1 <types.TypeFlags> (ANDCCconst [n] z )))
6126 if auxIntToInt32(v.AuxInt) != 2 {
6131 if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
6134 v_2_0 := v_2.Args[0]
6135 if v_2_0.Op != OpSelect0 {
6138 v_2_0_0 := v_2_0.Args[0]
6139 if v_2_0_0.Op != OpPPC64ANDCCconst {
6142 n := auxIntToInt64(v_2_0_0.AuxInt)
6143 z := v_2_0_0.Args[0]
6144 v.reset(OpPPC64ISEL)
6145 v.AuxInt = int32ToAuxInt(2)
6146 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
6147 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
6148 v1.AuxInt = int64ToAuxInt(n)
6154 // match: (ISEL [6] x y (CMPconst [0] (Select0 (ANDCCconst [n] z))))
6155 // result: (ISEL [6] x y (Select1 <types.TypeFlags> (ANDCCconst [n] z )))
6157 if auxIntToInt32(v.AuxInt) != 6 {
6162 if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
6165 v_2_0 := v_2.Args[0]
6166 if v_2_0.Op != OpSelect0 {
6169 v_2_0_0 := v_2_0.Args[0]
6170 if v_2_0_0.Op != OpPPC64ANDCCconst {
6173 n := auxIntToInt64(v_2_0_0.AuxInt)
6174 z := v_2_0_0.Args[0]
6175 v.reset(OpPPC64ISEL)
6176 v.AuxInt = int32ToAuxInt(6)
6177 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
6178 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
6179 v1.AuxInt = int64ToAuxInt(n)
6185 // match: (ISEL [6] x y (CMPWconst [0] (Select0 (ANDCCconst [n] z))))
6186 // result: (ISEL [6] x y (Select1 <types.TypeFlags> (ANDCCconst [n] z )))
6188 if auxIntToInt32(v.AuxInt) != 6 {
6193 if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
6196 v_2_0 := v_2.Args[0]
6197 if v_2_0.Op != OpSelect0 {
6200 v_2_0_0 := v_2_0.Args[0]
6201 if v_2_0_0.Op != OpPPC64ANDCCconst {
6204 n := auxIntToInt64(v_2_0_0.AuxInt)
6205 z := v_2_0_0.Args[0]
6206 v.reset(OpPPC64ISEL)
6207 v.AuxInt = int32ToAuxInt(6)
6208 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
6209 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
6210 v1.AuxInt = int64ToAuxInt(n)
6216 // match: (ISEL [n] x y (InvertFlags bool))
6218 // result: (ISEL [n+1] x y bool)
6220 n := auxIntToInt32(v.AuxInt)
6223 if v_2.Op != OpPPC64InvertFlags {
6230 v.reset(OpPPC64ISEL)
6231 v.AuxInt = int32ToAuxInt(n + 1)
6232 v.AddArg3(x, y, bool)
6235 // match: (ISEL [n] x y (InvertFlags bool))
6237 // result: (ISEL [n-1] x y bool)
6239 n := auxIntToInt32(v.AuxInt)
6242 if v_2.Op != OpPPC64InvertFlags {
6249 v.reset(OpPPC64ISEL)
6250 v.AuxInt = int32ToAuxInt(n - 1)
6251 v.AddArg3(x, y, bool)
6254 // match: (ISEL [n] x y (InvertFlags bool))
6256 // result: (ISEL [n] x y bool)
6258 n := auxIntToInt32(v.AuxInt)
6261 if v_2.Op != OpPPC64InvertFlags {
6268 v.reset(OpPPC64ISEL)
6269 v.AuxInt = int32ToAuxInt(n)
6270 v.AddArg3(x, y, bool)
6275 func rewriteValuePPC64_OpPPC64LessEqual(v *Value) bool {
6277 // match: (LessEqual (FlagEQ))
6278 // result: (MOVDconst [1])
6280 if v_0.Op != OpPPC64FlagEQ {
6283 v.reset(OpPPC64MOVDconst)
6284 v.AuxInt = int64ToAuxInt(1)
6287 // match: (LessEqual (FlagLT))
6288 // result: (MOVDconst [1])
6290 if v_0.Op != OpPPC64FlagLT {
6293 v.reset(OpPPC64MOVDconst)
6294 v.AuxInt = int64ToAuxInt(1)
6297 // match: (LessEqual (FlagGT))
6298 // result: (MOVDconst [0])
6300 if v_0.Op != OpPPC64FlagGT {
6303 v.reset(OpPPC64MOVDconst)
6304 v.AuxInt = int64ToAuxInt(0)
6307 // match: (LessEqual (InvertFlags x))
6308 // result: (GreaterEqual x)
6310 if v_0.Op != OpPPC64InvertFlags {
6314 v.reset(OpPPC64GreaterEqual)
6318 // match: (LessEqual cmp)
6319 // result: (SETBCR [1] cmp)
6322 v.reset(OpPPC64SETBCR)
6323 v.AuxInt = int32ToAuxInt(1)
6328 func rewriteValuePPC64_OpPPC64LessThan(v *Value) bool {
6330 // match: (LessThan (FlagEQ))
6331 // result: (MOVDconst [0])
6333 if v_0.Op != OpPPC64FlagEQ {
6336 v.reset(OpPPC64MOVDconst)
6337 v.AuxInt = int64ToAuxInt(0)
6340 // match: (LessThan (FlagLT))
6341 // result: (MOVDconst [1])
6343 if v_0.Op != OpPPC64FlagLT {
6346 v.reset(OpPPC64MOVDconst)
6347 v.AuxInt = int64ToAuxInt(1)
6350 // match: (LessThan (FlagGT))
6351 // result: (MOVDconst [0])
6353 if v_0.Op != OpPPC64FlagGT {
6356 v.reset(OpPPC64MOVDconst)
6357 v.AuxInt = int64ToAuxInt(0)
6360 // match: (LessThan (InvertFlags x))
6361 // result: (GreaterThan x)
6363 if v_0.Op != OpPPC64InvertFlags {
6367 v.reset(OpPPC64GreaterThan)
6371 // match: (LessThan cmp)
6372 // result: (SETBC [0] cmp)
6375 v.reset(OpPPC64SETBC)
6376 v.AuxInt = int32ToAuxInt(0)
6381 func rewriteValuePPC64_OpPPC64MFVSRD(v *Value) bool {
6384 typ := &b.Func.Config.Types
6385 // match: (MFVSRD (FMOVDconst [c]))
6386 // result: (MOVDconst [int64(math.Float64bits(c))])
6388 if v_0.Op != OpPPC64FMOVDconst {
6391 c := auxIntToFloat64(v_0.AuxInt)
6392 v.reset(OpPPC64MOVDconst)
6393 v.AuxInt = int64ToAuxInt(int64(math.Float64bits(c)))
6396 // match: (MFVSRD x:(FMOVDload [off] {sym} ptr mem))
6397 // cond: x.Uses == 1 && clobber(x)
6398 // result: @x.Block (MOVDload [off] {sym} ptr mem)
6401 if x.Op != OpPPC64FMOVDload {
6404 off := auxIntToInt32(x.AuxInt)
6405 sym := auxToSym(x.Aux)
6408 if !(x.Uses == 1 && clobber(x)) {
6412 v0 := b.NewValue0(x.Pos, OpPPC64MOVDload, typ.Int64)
6414 v0.AuxInt = int32ToAuxInt(off)
6415 v0.Aux = symToAux(sym)
6416 v0.AddArg2(ptr, mem)
6421 func rewriteValuePPC64_OpPPC64MOVBZload(v *Value) bool {
6424 // match: (MOVBZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
6425 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
6426 // result: (MOVBZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
6428 off1 := auxIntToInt32(v.AuxInt)
6429 sym1 := auxToSym(v.Aux)
6431 if p.Op != OpPPC64MOVDaddr {
6434 off2 := auxIntToInt32(p.AuxInt)
6435 sym2 := auxToSym(p.Aux)
6438 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
6441 v.reset(OpPPC64MOVBZload)
6442 v.AuxInt = int32ToAuxInt(off1 + off2)
6443 v.Aux = symToAux(mergeSym(sym1, sym2))
6447 // match: (MOVBZload [off1] {sym} (ADDconst [off2] x) mem)
6448 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
6449 // result: (MOVBZload [off1+int32(off2)] {sym} x mem)
6451 off1 := auxIntToInt32(v.AuxInt)
6452 sym := auxToSym(v.Aux)
6453 if v_0.Op != OpPPC64ADDconst {
6456 off2 := auxIntToInt64(v_0.AuxInt)
6459 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
6462 v.reset(OpPPC64MOVBZload)
6463 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
6464 v.Aux = symToAux(sym)
6468 // match: (MOVBZload [0] {sym} p:(ADD ptr idx) mem)
6469 // cond: sym == nil && p.Uses == 1
6470 // result: (MOVBZloadidx ptr idx mem)
6472 if auxIntToInt32(v.AuxInt) != 0 {
6475 sym := auxToSym(v.Aux)
6477 if p.Op != OpPPC64ADD {
6483 if !(sym == nil && p.Uses == 1) {
6486 v.reset(OpPPC64MOVBZloadidx)
6487 v.AddArg3(ptr, idx, mem)
6492 func rewriteValuePPC64_OpPPC64MOVBZloadidx(v *Value) bool {
6496 // match: (MOVBZloadidx ptr (MOVDconst [c]) mem)
6497 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
6498 // result: (MOVBZload [int32(c)] ptr mem)
6501 if v_1.Op != OpPPC64MOVDconst {
6504 c := auxIntToInt64(v_1.AuxInt)
6506 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
6509 v.reset(OpPPC64MOVBZload)
6510 v.AuxInt = int32ToAuxInt(int32(c))
6514 // match: (MOVBZloadidx (MOVDconst [c]) ptr mem)
6515 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
6516 // result: (MOVBZload [int32(c)] ptr mem)
6518 if v_0.Op != OpPPC64MOVDconst {
6521 c := auxIntToInt64(v_0.AuxInt)
6524 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
6527 v.reset(OpPPC64MOVBZload)
6528 v.AuxInt = int32ToAuxInt(int32(c))
6534 func rewriteValuePPC64_OpPPC64MOVBZreg(v *Value) bool {
6537 typ := &b.Func.Config.Types
6538 // match: (MOVBZreg y:(Select0 (ANDCCconst [c] _)))
6539 // cond: uint64(c) <= 0xFF
6543 if y.Op != OpSelect0 {
6547 if y_0.Op != OpPPC64ANDCCconst {
6550 c := auxIntToInt64(y_0.AuxInt)
6551 if !(uint64(c) <= 0xFF) {
6557 // match: (MOVBZreg (SRWconst [c] (MOVBZreg x)))
6558 // result: (SRWconst [c] (MOVBZreg x))
6560 if v_0.Op != OpPPC64SRWconst {
6563 c := auxIntToInt64(v_0.AuxInt)
6564 v_0_0 := v_0.Args[0]
6565 if v_0_0.Op != OpPPC64MOVBZreg {
6569 v.reset(OpPPC64SRWconst)
6570 v.AuxInt = int64ToAuxInt(c)
6571 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
6576 // match: (MOVBZreg (SRWconst [c] x))
6577 // cond: sizeof(x.Type) == 8
6578 // result: (SRWconst [c] x)
6580 if v_0.Op != OpPPC64SRWconst {
6583 c := auxIntToInt64(v_0.AuxInt)
6585 if !(sizeof(x.Type) == 8) {
6588 v.reset(OpPPC64SRWconst)
6589 v.AuxInt = int64ToAuxInt(c)
6593 // match: (MOVBZreg (SRDconst [c] x))
6595 // result: (SRDconst [c] x)
6597 if v_0.Op != OpPPC64SRDconst {
6600 c := auxIntToInt64(v_0.AuxInt)
6605 v.reset(OpPPC64SRDconst)
6606 v.AuxInt = int64ToAuxInt(c)
6610 // match: (MOVBZreg (SRWconst [c] x))
6612 // result: (SRWconst [c] x)
6614 if v_0.Op != OpPPC64SRWconst {
6617 c := auxIntToInt64(v_0.AuxInt)
6622 v.reset(OpPPC64SRWconst)
6623 v.AuxInt = int64ToAuxInt(c)
6627 // match: (MOVBZreg y:(MOVBZreg _))
6631 if y.Op != OpPPC64MOVBZreg {
6637 // match: (MOVBZreg (MOVBreg x))
6638 // result: (MOVBZreg x)
6640 if v_0.Op != OpPPC64MOVBreg {
6644 v.reset(OpPPC64MOVBZreg)
6648 // match: (MOVBZreg (OR <t> x (MOVWZreg y)))
6649 // result: (MOVBZreg (OR <t> x y))
6651 if v_0.Op != OpPPC64OR {
6656 v_0_0 := v_0.Args[0]
6657 v_0_1 := v_0.Args[1]
6658 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6660 if v_0_1.Op != OpPPC64MOVWZreg {
6664 v.reset(OpPPC64MOVBZreg)
6665 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
6672 // match: (MOVBZreg (XOR <t> x (MOVWZreg y)))
6673 // result: (MOVBZreg (XOR <t> x y))
6675 if v_0.Op != OpPPC64XOR {
6680 v_0_0 := v_0.Args[0]
6681 v_0_1 := v_0.Args[1]
6682 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6684 if v_0_1.Op != OpPPC64MOVWZreg {
6688 v.reset(OpPPC64MOVBZreg)
6689 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
6696 // match: (MOVBZreg (AND <t> x (MOVWZreg y)))
6697 // result: (MOVBZreg (AND <t> x y))
6699 if v_0.Op != OpPPC64AND {
6704 v_0_0 := v_0.Args[0]
6705 v_0_1 := v_0.Args[1]
6706 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6708 if v_0_1.Op != OpPPC64MOVWZreg {
6712 v.reset(OpPPC64MOVBZreg)
6713 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
6720 // match: (MOVBZreg (OR <t> x (MOVHZreg y)))
6721 // result: (MOVBZreg (OR <t> x y))
6723 if v_0.Op != OpPPC64OR {
6728 v_0_0 := v_0.Args[0]
6729 v_0_1 := v_0.Args[1]
6730 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6732 if v_0_1.Op != OpPPC64MOVHZreg {
6736 v.reset(OpPPC64MOVBZreg)
6737 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
6744 // match: (MOVBZreg (XOR <t> x (MOVHZreg y)))
6745 // result: (MOVBZreg (XOR <t> x y))
6747 if v_0.Op != OpPPC64XOR {
6752 v_0_0 := v_0.Args[0]
6753 v_0_1 := v_0.Args[1]
6754 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6756 if v_0_1.Op != OpPPC64MOVHZreg {
6760 v.reset(OpPPC64MOVBZreg)
6761 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
6768 // match: (MOVBZreg (AND <t> x (MOVHZreg y)))
6769 // result: (MOVBZreg (AND <t> x y))
6771 if v_0.Op != OpPPC64AND {
6776 v_0_0 := v_0.Args[0]
6777 v_0_1 := v_0.Args[1]
6778 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6780 if v_0_1.Op != OpPPC64MOVHZreg {
6784 v.reset(OpPPC64MOVBZreg)
6785 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
6792 // match: (MOVBZreg (OR <t> x (MOVBZreg y)))
6793 // result: (MOVBZreg (OR <t> x y))
6795 if v_0.Op != OpPPC64OR {
6800 v_0_0 := v_0.Args[0]
6801 v_0_1 := v_0.Args[1]
6802 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6804 if v_0_1.Op != OpPPC64MOVBZreg {
6808 v.reset(OpPPC64MOVBZreg)
6809 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
6816 // match: (MOVBZreg (XOR <t> x (MOVBZreg y)))
6817 // result: (MOVBZreg (XOR <t> x y))
6819 if v_0.Op != OpPPC64XOR {
6824 v_0_0 := v_0.Args[0]
6825 v_0_1 := v_0.Args[1]
6826 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6828 if v_0_1.Op != OpPPC64MOVBZreg {
6832 v.reset(OpPPC64MOVBZreg)
6833 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
6840 // match: (MOVBZreg (AND <t> x (MOVBZreg y)))
6841 // result: (MOVBZreg (AND <t> x y))
6843 if v_0.Op != OpPPC64AND {
6848 v_0_0 := v_0.Args[0]
6849 v_0_1 := v_0.Args[1]
6850 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6852 if v_0_1.Op != OpPPC64MOVBZreg {
6856 v.reset(OpPPC64MOVBZreg)
6857 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
6864 // match: (MOVBZreg z:(Select0 (ANDCCconst [c] (MOVBZload ptr x))))
6868 if z.Op != OpSelect0 {
6872 if z_0.Op != OpPPC64ANDCCconst {
6875 z_0_0 := z_0.Args[0]
6876 if z_0_0.Op != OpPPC64MOVBZload {
6882 // match: (MOVBZreg z:(AND y (MOVBZload ptr x)))
6886 if z.Op != OpPPC64AND {
6892 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
6893 if z_1.Op != OpPPC64MOVBZload {
6901 // match: (MOVBZreg x:(MOVBZload _ _))
6905 if x.Op != OpPPC64MOVBZload {
6911 // match: (MOVBZreg x:(MOVBZloadidx _ _ _))
6915 if x.Op != OpPPC64MOVBZloadidx {
6921 // match: (MOVBZreg x:(Select0 (LoweredAtomicLoad8 _ _)))
6925 if x.Op != OpSelect0 {
6929 if x_0.Op != OpPPC64LoweredAtomicLoad8 {
6935 // match: (MOVBZreg x:(Arg <t>))
6936 // cond: is8BitInt(t) && !t.IsSigned()
6944 if !(is8BitInt(t) && !t.IsSigned()) {
6950 // match: (MOVBZreg (MOVDconst [c]))
6951 // result: (MOVDconst [int64(uint8(c))])
6953 if v_0.Op != OpPPC64MOVDconst {
6956 c := auxIntToInt64(v_0.AuxInt)
6957 v.reset(OpPPC64MOVDconst)
6958 v.AuxInt = int64ToAuxInt(int64(uint8(c)))
6963 func rewriteValuePPC64_OpPPC64MOVBreg(v *Value) bool {
6966 typ := &b.Func.Config.Types
6967 // match: (MOVBreg y:(Select0 (ANDCCconst [c] _)))
6968 // cond: uint64(c) <= 0x7F
6972 if y.Op != OpSelect0 {
6976 if y_0.Op != OpPPC64ANDCCconst {
6979 c := auxIntToInt64(y_0.AuxInt)
6980 if !(uint64(c) <= 0x7F) {
6986 // match: (MOVBreg (SRAWconst [c] (MOVBreg x)))
6987 // result: (SRAWconst [c] (MOVBreg x))
6989 if v_0.Op != OpPPC64SRAWconst {
6992 c := auxIntToInt64(v_0.AuxInt)
6993 v_0_0 := v_0.Args[0]
6994 if v_0_0.Op != OpPPC64MOVBreg {
6998 v.reset(OpPPC64SRAWconst)
6999 v.AuxInt = int64ToAuxInt(c)
7000 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
7005 // match: (MOVBreg (SRAWconst [c] x))
7006 // cond: sizeof(x.Type) == 8
7007 // result: (SRAWconst [c] x)
7009 if v_0.Op != OpPPC64SRAWconst {
7012 c := auxIntToInt64(v_0.AuxInt)
7014 if !(sizeof(x.Type) == 8) {
7017 v.reset(OpPPC64SRAWconst)
7018 v.AuxInt = int64ToAuxInt(c)
7022 // match: (MOVBreg (SRDconst [c] x))
7024 // result: (SRDconst [c] x)
7026 if v_0.Op != OpPPC64SRDconst {
7029 c := auxIntToInt64(v_0.AuxInt)
7034 v.reset(OpPPC64SRDconst)
7035 v.AuxInt = int64ToAuxInt(c)
7039 // match: (MOVBreg (SRDconst [c] x))
7041 // result: (SRADconst [c] x)
7043 if v_0.Op != OpPPC64SRDconst {
7046 c := auxIntToInt64(v_0.AuxInt)
7051 v.reset(OpPPC64SRADconst)
7052 v.AuxInt = int64ToAuxInt(c)
7056 // match: (MOVBreg (SRADconst [c] x))
7058 // result: (SRADconst [c] x)
7060 if v_0.Op != OpPPC64SRADconst {
7063 c := auxIntToInt64(v_0.AuxInt)
7068 v.reset(OpPPC64SRADconst)
7069 v.AuxInt = int64ToAuxInt(c)
7073 // match: (MOVBreg (SRWconst [c] x))
7075 // result: (SRWconst [c] x)
7077 if v_0.Op != OpPPC64SRWconst {
7080 c := auxIntToInt64(v_0.AuxInt)
7085 v.reset(OpPPC64SRWconst)
7086 v.AuxInt = int64ToAuxInt(c)
7090 // match: (MOVBreg (SRWconst [c] x))
7092 // result: (SRAWconst [c] x)
7094 if v_0.Op != OpPPC64SRWconst {
7097 c := auxIntToInt64(v_0.AuxInt)
7102 v.reset(OpPPC64SRAWconst)
7103 v.AuxInt = int64ToAuxInt(c)
7107 // match: (MOVBreg (SRAWconst [c] x))
7109 // result: (SRAWconst [c] x)
7111 if v_0.Op != OpPPC64SRAWconst {
7114 c := auxIntToInt64(v_0.AuxInt)
7119 v.reset(OpPPC64SRAWconst)
7120 v.AuxInt = int64ToAuxInt(c)
7124 // match: (MOVBreg y:(MOVBreg _))
7128 if y.Op != OpPPC64MOVBreg {
7134 // match: (MOVBreg (MOVBZreg x))
7135 // result: (MOVBreg x)
7137 if v_0.Op != OpPPC64MOVBZreg {
7141 v.reset(OpPPC64MOVBreg)
7145 // match: (MOVBreg x:(Arg <t>))
7146 // cond: is8BitInt(t) && t.IsSigned()
7154 if !(is8BitInt(t) && t.IsSigned()) {
7160 // match: (MOVBreg (MOVDconst [c]))
7161 // result: (MOVDconst [int64(int8(c))])
7163 if v_0.Op != OpPPC64MOVDconst {
7166 c := auxIntToInt64(v_0.AuxInt)
7167 v.reset(OpPPC64MOVDconst)
7168 v.AuxInt = int64ToAuxInt(int64(int8(c)))
7173 func rewriteValuePPC64_OpPPC64MOVBstore(v *Value) bool {
7178 typ := &b.Func.Config.Types
7179 // match: (MOVBstore [off1] {sym} (ADDconst [off2] x) val mem)
7180 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
7181 // result: (MOVBstore [off1+int32(off2)] {sym} x val mem)
7183 off1 := auxIntToInt32(v.AuxInt)
7184 sym := auxToSym(v.Aux)
7185 if v_0.Op != OpPPC64ADDconst {
7188 off2 := auxIntToInt64(v_0.AuxInt)
7192 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
7195 v.reset(OpPPC64MOVBstore)
7196 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
7197 v.Aux = symToAux(sym)
7198 v.AddArg3(x, val, mem)
7201 // match: (MOVBstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
7202 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
7203 // result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
7205 off1 := auxIntToInt32(v.AuxInt)
7206 sym1 := auxToSym(v.Aux)
7208 if p.Op != OpPPC64MOVDaddr {
7211 off2 := auxIntToInt32(p.AuxInt)
7212 sym2 := auxToSym(p.Aux)
7216 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
7219 v.reset(OpPPC64MOVBstore)
7220 v.AuxInt = int32ToAuxInt(off1 + off2)
7221 v.Aux = symToAux(mergeSym(sym1, sym2))
7222 v.AddArg3(ptr, val, mem)
7225 // match: (MOVBstore [off] {sym} ptr (MOVDconst [0]) mem)
7226 // result: (MOVBstorezero [off] {sym} ptr mem)
7228 off := auxIntToInt32(v.AuxInt)
7229 sym := auxToSym(v.Aux)
7231 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
7235 v.reset(OpPPC64MOVBstorezero)
7236 v.AuxInt = int32ToAuxInt(off)
7237 v.Aux = symToAux(sym)
7241 // match: (MOVBstore [0] {sym} p:(ADD ptr idx) val mem)
7242 // cond: sym == nil && p.Uses == 1
7243 // result: (MOVBstoreidx ptr idx val mem)
7245 if auxIntToInt32(v.AuxInt) != 0 {
7248 sym := auxToSym(v.Aux)
7250 if p.Op != OpPPC64ADD {
7257 if !(sym == nil && p.Uses == 1) {
7260 v.reset(OpPPC64MOVBstoreidx)
7261 v.AddArg4(ptr, idx, val, mem)
7264 // match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
7265 // result: (MOVBstore [off] {sym} ptr x mem)
7267 off := auxIntToInt32(v.AuxInt)
7268 sym := auxToSym(v.Aux)
7270 if v_1.Op != OpPPC64MOVBreg {
7275 v.reset(OpPPC64MOVBstore)
7276 v.AuxInt = int32ToAuxInt(off)
7277 v.Aux = symToAux(sym)
7278 v.AddArg3(ptr, x, mem)
7281 // match: (MOVBstore [off] {sym} ptr (MOVBZreg x) mem)
7282 // result: (MOVBstore [off] {sym} ptr x mem)
7284 off := auxIntToInt32(v.AuxInt)
7285 sym := auxToSym(v.Aux)
7287 if v_1.Op != OpPPC64MOVBZreg {
7292 v.reset(OpPPC64MOVBstore)
7293 v.AuxInt = int32ToAuxInt(off)
7294 v.Aux = symToAux(sym)
7295 v.AddArg3(ptr, x, mem)
7298 // match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
7299 // result: (MOVBstore [off] {sym} ptr x mem)
7301 off := auxIntToInt32(v.AuxInt)
7302 sym := auxToSym(v.Aux)
7304 if v_1.Op != OpPPC64MOVHreg {
7309 v.reset(OpPPC64MOVBstore)
7310 v.AuxInt = int32ToAuxInt(off)
7311 v.Aux = symToAux(sym)
7312 v.AddArg3(ptr, x, mem)
7315 // match: (MOVBstore [off] {sym} ptr (MOVHZreg x) mem)
7316 // result: (MOVBstore [off] {sym} ptr x mem)
7318 off := auxIntToInt32(v.AuxInt)
7319 sym := auxToSym(v.Aux)
7321 if v_1.Op != OpPPC64MOVHZreg {
7326 v.reset(OpPPC64MOVBstore)
7327 v.AuxInt = int32ToAuxInt(off)
7328 v.Aux = symToAux(sym)
7329 v.AddArg3(ptr, x, mem)
7332 // match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
7333 // result: (MOVBstore [off] {sym} ptr x mem)
7335 off := auxIntToInt32(v.AuxInt)
7336 sym := auxToSym(v.Aux)
7338 if v_1.Op != OpPPC64MOVWreg {
7343 v.reset(OpPPC64MOVBstore)
7344 v.AuxInt = int32ToAuxInt(off)
7345 v.Aux = symToAux(sym)
7346 v.AddArg3(ptr, x, mem)
7349 // match: (MOVBstore [off] {sym} ptr (MOVWZreg x) mem)
7350 // result: (MOVBstore [off] {sym} ptr x mem)
7352 off := auxIntToInt32(v.AuxInt)
7353 sym := auxToSym(v.Aux)
7355 if v_1.Op != OpPPC64MOVWZreg {
7360 v.reset(OpPPC64MOVBstore)
7361 v.AuxInt = int32ToAuxInt(off)
7362 v.Aux = symToAux(sym)
7363 v.AddArg3(ptr, x, mem)
7366 // match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHreg x) [c]) mem)
7368 // result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
7370 off := auxIntToInt32(v.AuxInt)
7371 sym := auxToSym(v.Aux)
7373 if v_1.Op != OpPPC64SRWconst {
7376 c := auxIntToInt64(v_1.AuxInt)
7377 v_1_0 := v_1.Args[0]
7378 if v_1_0.Op != OpPPC64MOVHreg {
7386 v.reset(OpPPC64MOVBstore)
7387 v.AuxInt = int32ToAuxInt(off)
7388 v.Aux = symToAux(sym)
7389 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7390 v0.AuxInt = int64ToAuxInt(c)
7392 v.AddArg3(ptr, v0, mem)
7395 // match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHZreg x) [c]) mem)
7397 // result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
7399 off := auxIntToInt32(v.AuxInt)
7400 sym := auxToSym(v.Aux)
7402 if v_1.Op != OpPPC64SRWconst {
7405 c := auxIntToInt64(v_1.AuxInt)
7406 v_1_0 := v_1.Args[0]
7407 if v_1_0.Op != OpPPC64MOVHZreg {
7415 v.reset(OpPPC64MOVBstore)
7416 v.AuxInt = int32ToAuxInt(off)
7417 v.Aux = symToAux(sym)
7418 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7419 v0.AuxInt = int64ToAuxInt(c)
7421 v.AddArg3(ptr, v0, mem)
7424 // match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWreg x) [c]) mem)
7426 // result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
7428 off := auxIntToInt32(v.AuxInt)
7429 sym := auxToSym(v.Aux)
7431 if v_1.Op != OpPPC64SRWconst {
7434 c := auxIntToInt64(v_1.AuxInt)
7435 v_1_0 := v_1.Args[0]
7436 if v_1_0.Op != OpPPC64MOVWreg {
7444 v.reset(OpPPC64MOVBstore)
7445 v.AuxInt = int32ToAuxInt(off)
7446 v.Aux = symToAux(sym)
7447 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7448 v0.AuxInt = int64ToAuxInt(c)
7450 v.AddArg3(ptr, v0, mem)
7453 // match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWZreg x) [c]) mem)
7455 // result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
7457 off := auxIntToInt32(v.AuxInt)
7458 sym := auxToSym(v.Aux)
7460 if v_1.Op != OpPPC64SRWconst {
7463 c := auxIntToInt64(v_1.AuxInt)
7464 v_1_0 := v_1.Args[0]
7465 if v_1_0.Op != OpPPC64MOVWZreg {
7473 v.reset(OpPPC64MOVBstore)
7474 v.AuxInt = int32ToAuxInt(off)
7475 v.Aux = symToAux(sym)
7476 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7477 v0.AuxInt = int64ToAuxInt(c)
7479 v.AddArg3(ptr, v0, mem)
7484 func rewriteValuePPC64_OpPPC64MOVBstoreidx(v *Value) bool {
7490 typ := &b.Func.Config.Types
7491 // match: (MOVBstoreidx ptr (MOVDconst [c]) val mem)
7492 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
7493 // result: (MOVBstore [int32(c)] ptr val mem)
7496 if v_1.Op != OpPPC64MOVDconst {
7499 c := auxIntToInt64(v_1.AuxInt)
7502 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
7505 v.reset(OpPPC64MOVBstore)
7506 v.AuxInt = int32ToAuxInt(int32(c))
7507 v.AddArg3(ptr, val, mem)
7510 // match: (MOVBstoreidx (MOVDconst [c]) ptr val mem)
7511 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
7512 // result: (MOVBstore [int32(c)] ptr val mem)
7514 if v_0.Op != OpPPC64MOVDconst {
7517 c := auxIntToInt64(v_0.AuxInt)
7521 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
7524 v.reset(OpPPC64MOVBstore)
7525 v.AuxInt = int32ToAuxInt(int32(c))
7526 v.AddArg3(ptr, val, mem)
7529 // match: (MOVBstoreidx ptr idx (MOVBreg x) mem)
7530 // result: (MOVBstoreidx ptr idx x mem)
7534 if v_2.Op != OpPPC64MOVBreg {
7539 v.reset(OpPPC64MOVBstoreidx)
7540 v.AddArg4(ptr, idx, x, mem)
7543 // match: (MOVBstoreidx ptr idx (MOVBZreg x) mem)
7544 // result: (MOVBstoreidx ptr idx x mem)
7548 if v_2.Op != OpPPC64MOVBZreg {
7553 v.reset(OpPPC64MOVBstoreidx)
7554 v.AddArg4(ptr, idx, x, mem)
7557 // match: (MOVBstoreidx ptr idx (MOVHreg x) mem)
7558 // result: (MOVBstoreidx ptr idx x mem)
7562 if v_2.Op != OpPPC64MOVHreg {
7567 v.reset(OpPPC64MOVBstoreidx)
7568 v.AddArg4(ptr, idx, x, mem)
7571 // match: (MOVBstoreidx ptr idx (MOVHZreg x) mem)
7572 // result: (MOVBstoreidx ptr idx x mem)
7576 if v_2.Op != OpPPC64MOVHZreg {
7581 v.reset(OpPPC64MOVBstoreidx)
7582 v.AddArg4(ptr, idx, x, mem)
7585 // match: (MOVBstoreidx ptr idx (MOVWreg x) mem)
7586 // result: (MOVBstoreidx ptr idx x mem)
7590 if v_2.Op != OpPPC64MOVWreg {
7595 v.reset(OpPPC64MOVBstoreidx)
7596 v.AddArg4(ptr, idx, x, mem)
7599 // match: (MOVBstoreidx ptr idx (MOVWZreg x) mem)
7600 // result: (MOVBstoreidx ptr idx x mem)
7604 if v_2.Op != OpPPC64MOVWZreg {
7609 v.reset(OpPPC64MOVBstoreidx)
7610 v.AddArg4(ptr, idx, x, mem)
7613 // match: (MOVBstoreidx ptr idx (SRWconst (MOVHreg x) [c]) mem)
7615 // result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
7619 if v_2.Op != OpPPC64SRWconst {
7622 c := auxIntToInt64(v_2.AuxInt)
7623 v_2_0 := v_2.Args[0]
7624 if v_2_0.Op != OpPPC64MOVHreg {
7632 v.reset(OpPPC64MOVBstoreidx)
7633 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7634 v0.AuxInt = int64ToAuxInt(c)
7636 v.AddArg4(ptr, idx, v0, mem)
7639 // match: (MOVBstoreidx ptr idx (SRWconst (MOVHZreg x) [c]) mem)
7641 // result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
7645 if v_2.Op != OpPPC64SRWconst {
7648 c := auxIntToInt64(v_2.AuxInt)
7649 v_2_0 := v_2.Args[0]
7650 if v_2_0.Op != OpPPC64MOVHZreg {
7658 v.reset(OpPPC64MOVBstoreidx)
7659 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7660 v0.AuxInt = int64ToAuxInt(c)
7662 v.AddArg4(ptr, idx, v0, mem)
7665 // match: (MOVBstoreidx ptr idx (SRWconst (MOVWreg x) [c]) mem)
7667 // result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
7671 if v_2.Op != OpPPC64SRWconst {
7674 c := auxIntToInt64(v_2.AuxInt)
7675 v_2_0 := v_2.Args[0]
7676 if v_2_0.Op != OpPPC64MOVWreg {
7684 v.reset(OpPPC64MOVBstoreidx)
7685 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7686 v0.AuxInt = int64ToAuxInt(c)
7688 v.AddArg4(ptr, idx, v0, mem)
7691 // match: (MOVBstoreidx ptr idx (SRWconst (MOVWZreg x) [c]) mem)
7693 // result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
7697 if v_2.Op != OpPPC64SRWconst {
7700 c := auxIntToInt64(v_2.AuxInt)
7701 v_2_0 := v_2.Args[0]
7702 if v_2_0.Op != OpPPC64MOVWZreg {
7710 v.reset(OpPPC64MOVBstoreidx)
7711 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7712 v0.AuxInt = int64ToAuxInt(c)
7714 v.AddArg4(ptr, idx, v0, mem)
7719 func rewriteValuePPC64_OpPPC64MOVBstorezero(v *Value) bool {
7722 // match: (MOVBstorezero [off1] {sym} (ADDconst [off2] x) mem)
7723 // cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
7724 // result: (MOVBstorezero [off1+int32(off2)] {sym} x mem)
7726 off1 := auxIntToInt32(v.AuxInt)
7727 sym := auxToSym(v.Aux)
7728 if v_0.Op != OpPPC64ADDconst {
7731 off2 := auxIntToInt64(v_0.AuxInt)
7734 if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
7737 v.reset(OpPPC64MOVBstorezero)
7738 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
7739 v.Aux = symToAux(sym)
7743 // match: (MOVBstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
7744 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
7745 // result: (MOVBstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
7747 off1 := auxIntToInt32(v.AuxInt)
7748 sym1 := auxToSym(v.Aux)
7750 if p.Op != OpPPC64MOVDaddr {
7753 off2 := auxIntToInt32(p.AuxInt)
7754 sym2 := auxToSym(p.Aux)
7757 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
7760 v.reset(OpPPC64MOVBstorezero)
7761 v.AuxInt = int32ToAuxInt(off1 + off2)
7762 v.Aux = symToAux(mergeSym(sym1, sym2))
7768 func rewriteValuePPC64_OpPPC64MOVDload(v *Value) bool {
7771 // match: (MOVDload [off] {sym} ptr (FMOVDstore [off] {sym} ptr x _))
7772 // result: (MFVSRD x)
7774 off := auxIntToInt32(v.AuxInt)
7775 sym := auxToSym(v.Aux)
7777 if v_1.Op != OpPPC64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
7781 if ptr != v_1.Args[0] {
7784 v.reset(OpPPC64MFVSRD)
7788 // match: (MOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
7789 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
7790 // result: (MOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
7792 off1 := auxIntToInt32(v.AuxInt)
7793 sym1 := auxToSym(v.Aux)
7795 if p.Op != OpPPC64MOVDaddr {
7798 off2 := auxIntToInt32(p.AuxInt)
7799 sym2 := auxToSym(p.Aux)
7802 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
7805 v.reset(OpPPC64MOVDload)
7806 v.AuxInt = int32ToAuxInt(off1 + off2)
7807 v.Aux = symToAux(mergeSym(sym1, sym2))
7811 // match: (MOVDload [off1] {sym} (ADDconst [off2] x) mem)
7812 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
7813 // result: (MOVDload [off1+int32(off2)] {sym} x mem)
7815 off1 := auxIntToInt32(v.AuxInt)
7816 sym := auxToSym(v.Aux)
7817 if v_0.Op != OpPPC64ADDconst {
7820 off2 := auxIntToInt64(v_0.AuxInt)
7823 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
7826 v.reset(OpPPC64MOVDload)
7827 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
7828 v.Aux = symToAux(sym)
7832 // match: (MOVDload [0] {sym} p:(ADD ptr idx) mem)
7833 // cond: sym == nil && p.Uses == 1
7834 // result: (MOVDloadidx ptr idx mem)
7836 if auxIntToInt32(v.AuxInt) != 0 {
7839 sym := auxToSym(v.Aux)
7841 if p.Op != OpPPC64ADD {
7847 if !(sym == nil && p.Uses == 1) {
7850 v.reset(OpPPC64MOVDloadidx)
7851 v.AddArg3(ptr, idx, mem)
7856 func rewriteValuePPC64_OpPPC64MOVDloadidx(v *Value) bool {
7860 // match: (MOVDloadidx ptr (MOVDconst [c]) mem)
7861 // cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
7862 // result: (MOVDload [int32(c)] ptr mem)
7865 if v_1.Op != OpPPC64MOVDconst {
7868 c := auxIntToInt64(v_1.AuxInt)
7870 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
7873 v.reset(OpPPC64MOVDload)
7874 v.AuxInt = int32ToAuxInt(int32(c))
7878 // match: (MOVDloadidx (MOVDconst [c]) ptr mem)
7879 // cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
7880 // result: (MOVDload [int32(c)] ptr mem)
7882 if v_0.Op != OpPPC64MOVDconst {
7885 c := auxIntToInt64(v_0.AuxInt)
7888 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
7891 v.reset(OpPPC64MOVDload)
7892 v.AuxInt = int32ToAuxInt(int32(c))
7898 func rewriteValuePPC64_OpPPC64MOVDstore(v *Value) bool {
7903 // match: (MOVDstore [off] {sym} ptr (MFVSRD x) mem)
7904 // result: (FMOVDstore [off] {sym} ptr x mem)
7906 off := auxIntToInt32(v.AuxInt)
7907 sym := auxToSym(v.Aux)
7909 if v_1.Op != OpPPC64MFVSRD {
7914 v.reset(OpPPC64FMOVDstore)
7915 v.AuxInt = int32ToAuxInt(off)
7916 v.Aux = symToAux(sym)
7917 v.AddArg3(ptr, x, mem)
7920 // match: (MOVDstore [off1] {sym} (ADDconst [off2] x) val mem)
7921 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
7922 // result: (MOVDstore [off1+int32(off2)] {sym} x val mem)
7924 off1 := auxIntToInt32(v.AuxInt)
7925 sym := auxToSym(v.Aux)
7926 if v_0.Op != OpPPC64ADDconst {
7929 off2 := auxIntToInt64(v_0.AuxInt)
7933 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
7936 v.reset(OpPPC64MOVDstore)
7937 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
7938 v.Aux = symToAux(sym)
7939 v.AddArg3(x, val, mem)
7942 // match: (MOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
7943 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
7944 // result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
7946 off1 := auxIntToInt32(v.AuxInt)
7947 sym1 := auxToSym(v.Aux)
7949 if p.Op != OpPPC64MOVDaddr {
7952 off2 := auxIntToInt32(p.AuxInt)
7953 sym2 := auxToSym(p.Aux)
7957 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
7960 v.reset(OpPPC64MOVDstore)
7961 v.AuxInt = int32ToAuxInt(off1 + off2)
7962 v.Aux = symToAux(mergeSym(sym1, sym2))
7963 v.AddArg3(ptr, val, mem)
7966 // match: (MOVDstore [off] {sym} ptr (MOVDconst [0]) mem)
7967 // result: (MOVDstorezero [off] {sym} ptr mem)
7969 off := auxIntToInt32(v.AuxInt)
7970 sym := auxToSym(v.Aux)
7972 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
7976 v.reset(OpPPC64MOVDstorezero)
7977 v.AuxInt = int32ToAuxInt(off)
7978 v.Aux = symToAux(sym)
7982 // match: (MOVDstore [0] {sym} p:(ADD ptr idx) val mem)
7983 // cond: sym == nil && p.Uses == 1
7984 // result: (MOVDstoreidx ptr idx val mem)
7986 if auxIntToInt32(v.AuxInt) != 0 {
7989 sym := auxToSym(v.Aux)
7991 if p.Op != OpPPC64ADD {
7998 if !(sym == nil && p.Uses == 1) {
8001 v.reset(OpPPC64MOVDstoreidx)
8002 v.AddArg4(ptr, idx, val, mem)
8005 // match: (MOVDstore [off] {sym} ptr r:(BRD val) mem)
8006 // cond: r.Uses == 1
8007 // result: (MOVDBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
8009 off := auxIntToInt32(v.AuxInt)
8010 sym := auxToSym(v.Aux)
8013 if r.Op != OpPPC64BRD {
8021 v.reset(OpPPC64MOVDBRstore)
8022 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
8023 v0.AuxInt = int32ToAuxInt(off)
8024 v0.Aux = symToAux(sym)
8026 v.AddArg3(v0, val, mem)
8029 // match: (MOVDstore [off] {sym} ptr (Bswap64 val) mem)
8030 // result: (MOVDBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
8032 off := auxIntToInt32(v.AuxInt)
8033 sym := auxToSym(v.Aux)
8035 if v_1.Op != OpBswap64 {
8040 v.reset(OpPPC64MOVDBRstore)
8041 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
8042 v0.AuxInt = int32ToAuxInt(off)
8043 v0.Aux = symToAux(sym)
8045 v.AddArg3(v0, val, mem)
8050 func rewriteValuePPC64_OpPPC64MOVDstoreidx(v *Value) bool {
8055 // match: (MOVDstoreidx ptr (MOVDconst [c]) val mem)
8056 // cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
8057 // result: (MOVDstore [int32(c)] ptr val mem)
8060 if v_1.Op != OpPPC64MOVDconst {
8063 c := auxIntToInt64(v_1.AuxInt)
8066 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8069 v.reset(OpPPC64MOVDstore)
8070 v.AuxInt = int32ToAuxInt(int32(c))
8071 v.AddArg3(ptr, val, mem)
8074 // match: (MOVDstoreidx (MOVDconst [c]) ptr val mem)
8075 // cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
8076 // result: (MOVDstore [int32(c)] ptr val mem)
8078 if v_0.Op != OpPPC64MOVDconst {
8081 c := auxIntToInt64(v_0.AuxInt)
8085 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8088 v.reset(OpPPC64MOVDstore)
8089 v.AuxInt = int32ToAuxInt(int32(c))
8090 v.AddArg3(ptr, val, mem)
8093 // match: (MOVDstoreidx ptr idx r:(BRD val) mem)
8094 // cond: r.Uses == 1
8095 // result: (MOVDBRstoreidx ptr idx val mem)
8100 if r.Op != OpPPC64BRD {
8108 v.reset(OpPPC64MOVDBRstoreidx)
8109 v.AddArg4(ptr, idx, val, mem)
8112 // match: (MOVDstoreidx ptr idx (Bswap64 val) mem)
8113 // result: (MOVDBRstoreidx ptr idx val mem)
8117 if v_2.Op != OpBswap64 {
8122 v.reset(OpPPC64MOVDBRstoreidx)
8123 v.AddArg4(ptr, idx, val, mem)
8128 func rewriteValuePPC64_OpPPC64MOVDstorezero(v *Value) bool {
8131 // match: (MOVDstorezero [off1] {sym} (ADDconst [off2] x) mem)
8132 // cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
8133 // result: (MOVDstorezero [off1+int32(off2)] {sym} x mem)
8135 off1 := auxIntToInt32(v.AuxInt)
8136 sym := auxToSym(v.Aux)
8137 if v_0.Op != OpPPC64ADDconst {
8140 off2 := auxIntToInt64(v_0.AuxInt)
8143 if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
8146 v.reset(OpPPC64MOVDstorezero)
8147 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8148 v.Aux = symToAux(sym)
8152 // match: (MOVDstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
8153 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
8154 // result: (MOVDstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
8156 off1 := auxIntToInt32(v.AuxInt)
8157 sym1 := auxToSym(v.Aux)
8159 if p.Op != OpPPC64MOVDaddr {
8162 off2 := auxIntToInt32(p.AuxInt)
8163 sym2 := auxToSym(p.Aux)
8166 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8169 v.reset(OpPPC64MOVDstorezero)
8170 v.AuxInt = int32ToAuxInt(off1 + off2)
8171 v.Aux = symToAux(mergeSym(sym1, sym2))
8177 func rewriteValuePPC64_OpPPC64MOVHBRstore(v *Value) bool {
8181 // match: (MOVHBRstore ptr (MOVHreg x) mem)
8182 // result: (MOVHBRstore ptr x mem)
8185 if v_1.Op != OpPPC64MOVHreg {
8190 v.reset(OpPPC64MOVHBRstore)
8191 v.AddArg3(ptr, x, mem)
8194 // match: (MOVHBRstore ptr (MOVHZreg x) mem)
8195 // result: (MOVHBRstore ptr x mem)
8198 if v_1.Op != OpPPC64MOVHZreg {
8203 v.reset(OpPPC64MOVHBRstore)
8204 v.AddArg3(ptr, x, mem)
8207 // match: (MOVHBRstore ptr (MOVWreg x) mem)
8208 // result: (MOVHBRstore ptr x mem)
8211 if v_1.Op != OpPPC64MOVWreg {
8216 v.reset(OpPPC64MOVHBRstore)
8217 v.AddArg3(ptr, x, mem)
8220 // match: (MOVHBRstore ptr (MOVWZreg x) mem)
8221 // result: (MOVHBRstore ptr x mem)
8224 if v_1.Op != OpPPC64MOVWZreg {
8229 v.reset(OpPPC64MOVHBRstore)
8230 v.AddArg3(ptr, x, mem)
8235 func rewriteValuePPC64_OpPPC64MOVHZload(v *Value) bool {
8238 // match: (MOVHZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
8239 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
8240 // result: (MOVHZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
8242 off1 := auxIntToInt32(v.AuxInt)
8243 sym1 := auxToSym(v.Aux)
8245 if p.Op != OpPPC64MOVDaddr {
8248 off2 := auxIntToInt32(p.AuxInt)
8249 sym2 := auxToSym(p.Aux)
8252 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8255 v.reset(OpPPC64MOVHZload)
8256 v.AuxInt = int32ToAuxInt(off1 + off2)
8257 v.Aux = symToAux(mergeSym(sym1, sym2))
8261 // match: (MOVHZload [off1] {sym} (ADDconst [off2] x) mem)
8262 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
8263 // result: (MOVHZload [off1+int32(off2)] {sym} x mem)
8265 off1 := auxIntToInt32(v.AuxInt)
8266 sym := auxToSym(v.Aux)
8267 if v_0.Op != OpPPC64ADDconst {
8270 off2 := auxIntToInt64(v_0.AuxInt)
8273 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
8276 v.reset(OpPPC64MOVHZload)
8277 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8278 v.Aux = symToAux(sym)
8282 // match: (MOVHZload [0] {sym} p:(ADD ptr idx) mem)
8283 // cond: sym == nil && p.Uses == 1
8284 // result: (MOVHZloadidx ptr idx mem)
8286 if auxIntToInt32(v.AuxInt) != 0 {
8289 sym := auxToSym(v.Aux)
8291 if p.Op != OpPPC64ADD {
8297 if !(sym == nil && p.Uses == 1) {
8300 v.reset(OpPPC64MOVHZloadidx)
8301 v.AddArg3(ptr, idx, mem)
8306 func rewriteValuePPC64_OpPPC64MOVHZloadidx(v *Value) bool {
8310 // match: (MOVHZloadidx ptr (MOVDconst [c]) mem)
8311 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
8312 // result: (MOVHZload [int32(c)] ptr mem)
8315 if v_1.Op != OpPPC64MOVDconst {
8318 c := auxIntToInt64(v_1.AuxInt)
8320 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8323 v.reset(OpPPC64MOVHZload)
8324 v.AuxInt = int32ToAuxInt(int32(c))
8328 // match: (MOVHZloadidx (MOVDconst [c]) ptr mem)
8329 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
8330 // result: (MOVHZload [int32(c)] ptr mem)
8332 if v_0.Op != OpPPC64MOVDconst {
8335 c := auxIntToInt64(v_0.AuxInt)
8338 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8341 v.reset(OpPPC64MOVHZload)
8342 v.AuxInt = int32ToAuxInt(int32(c))
8348 func rewriteValuePPC64_OpPPC64MOVHZreg(v *Value) bool {
8351 typ := &b.Func.Config.Types
8352 // match: (MOVHZreg y:(Select0 (ANDCCconst [c] _)))
8353 // cond: uint64(c) <= 0xFFFF
8357 if y.Op != OpSelect0 {
8361 if y_0.Op != OpPPC64ANDCCconst {
8364 c := auxIntToInt64(y_0.AuxInt)
8365 if !(uint64(c) <= 0xFFFF) {
8371 // match: (MOVHZreg (SRWconst [c] (MOVBZreg x)))
8372 // result: (SRWconst [c] (MOVBZreg x))
8374 if v_0.Op != OpPPC64SRWconst {
8377 c := auxIntToInt64(v_0.AuxInt)
8378 v_0_0 := v_0.Args[0]
8379 if v_0_0.Op != OpPPC64MOVBZreg {
8383 v.reset(OpPPC64SRWconst)
8384 v.AuxInt = int64ToAuxInt(c)
8385 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
8390 // match: (MOVHZreg (SRWconst [c] (MOVHZreg x)))
8391 // result: (SRWconst [c] (MOVHZreg x))
8393 if v_0.Op != OpPPC64SRWconst {
8396 c := auxIntToInt64(v_0.AuxInt)
8397 v_0_0 := v_0.Args[0]
8398 if v_0_0.Op != OpPPC64MOVHZreg {
8402 v.reset(OpPPC64SRWconst)
8403 v.AuxInt = int64ToAuxInt(c)
8404 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
8409 // match: (MOVHZreg (SRWconst [c] x))
8410 // cond: sizeof(x.Type) <= 16
8411 // result: (SRWconst [c] x)
8413 if v_0.Op != OpPPC64SRWconst {
8416 c := auxIntToInt64(v_0.AuxInt)
8418 if !(sizeof(x.Type) <= 16) {
8421 v.reset(OpPPC64SRWconst)
8422 v.AuxInt = int64ToAuxInt(c)
8426 // match: (MOVHZreg (SRDconst [c] x))
8428 // result: (SRDconst [c] x)
8430 if v_0.Op != OpPPC64SRDconst {
8433 c := auxIntToInt64(v_0.AuxInt)
8438 v.reset(OpPPC64SRDconst)
8439 v.AuxInt = int64ToAuxInt(c)
8443 // match: (MOVHZreg (SRWconst [c] x))
8445 // result: (SRWconst [c] x)
8447 if v_0.Op != OpPPC64SRWconst {
8450 c := auxIntToInt64(v_0.AuxInt)
8455 v.reset(OpPPC64SRWconst)
8456 v.AuxInt = int64ToAuxInt(c)
8460 // match: (MOVHZreg y:(MOVHZreg _))
8464 if y.Op != OpPPC64MOVHZreg {
8470 // match: (MOVHZreg y:(MOVBZreg _))
8474 if y.Op != OpPPC64MOVBZreg {
8480 // match: (MOVHZreg y:(MOVHBRload _ _))
8484 if y.Op != OpPPC64MOVHBRload {
8490 // match: (MOVHZreg y:(MOVHreg x))
8491 // result: (MOVHZreg x)
8494 if y.Op != OpPPC64MOVHreg {
8498 v.reset(OpPPC64MOVHZreg)
8502 // match: (MOVHZreg (OR <t> x (MOVWZreg y)))
8503 // result: (MOVHZreg (OR <t> x y))
8505 if v_0.Op != OpPPC64OR {
8510 v_0_0 := v_0.Args[0]
8511 v_0_1 := v_0.Args[1]
8512 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
8514 if v_0_1.Op != OpPPC64MOVWZreg {
8518 v.reset(OpPPC64MOVHZreg)
8519 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
8526 // match: (MOVHZreg (XOR <t> x (MOVWZreg y)))
8527 // result: (MOVHZreg (XOR <t> x y))
8529 if v_0.Op != OpPPC64XOR {
8534 v_0_0 := v_0.Args[0]
8535 v_0_1 := v_0.Args[1]
8536 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
8538 if v_0_1.Op != OpPPC64MOVWZreg {
8542 v.reset(OpPPC64MOVHZreg)
8543 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
8550 // match: (MOVHZreg (AND <t> x (MOVWZreg y)))
8551 // result: (MOVHZreg (AND <t> x y))
8553 if v_0.Op != OpPPC64AND {
8558 v_0_0 := v_0.Args[0]
8559 v_0_1 := v_0.Args[1]
8560 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
8562 if v_0_1.Op != OpPPC64MOVWZreg {
8566 v.reset(OpPPC64MOVHZreg)
8567 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
8574 // match: (MOVHZreg (OR <t> x (MOVHZreg y)))
8575 // result: (MOVHZreg (OR <t> x y))
8577 if v_0.Op != OpPPC64OR {
8582 v_0_0 := v_0.Args[0]
8583 v_0_1 := v_0.Args[1]
8584 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
8586 if v_0_1.Op != OpPPC64MOVHZreg {
8590 v.reset(OpPPC64MOVHZreg)
8591 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
8598 // match: (MOVHZreg (XOR <t> x (MOVHZreg y)))
8599 // result: (MOVHZreg (XOR <t> x y))
8601 if v_0.Op != OpPPC64XOR {
8606 v_0_0 := v_0.Args[0]
8607 v_0_1 := v_0.Args[1]
8608 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
8610 if v_0_1.Op != OpPPC64MOVHZreg {
8614 v.reset(OpPPC64MOVHZreg)
8615 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
8622 // match: (MOVHZreg (AND <t> x (MOVHZreg y)))
8623 // result: (MOVHZreg (AND <t> x y))
8625 if v_0.Op != OpPPC64AND {
8630 v_0_0 := v_0.Args[0]
8631 v_0_1 := v_0.Args[1]
8632 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
8634 if v_0_1.Op != OpPPC64MOVHZreg {
8638 v.reset(OpPPC64MOVHZreg)
8639 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
8646 // match: (MOVHZreg z:(Select0 (ANDCCconst [c] (MOVBZload ptr x))))
8650 if z.Op != OpSelect0 {
8654 if z_0.Op != OpPPC64ANDCCconst {
8657 z_0_0 := z_0.Args[0]
8658 if z_0_0.Op != OpPPC64MOVBZload {
8664 // match: (MOVHZreg z:(AND y (MOVHZload ptr x)))
8668 if z.Op != OpPPC64AND {
8674 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
8675 if z_1.Op != OpPPC64MOVHZload {
8683 // match: (MOVHZreg z:(Select0 (ANDCCconst [c] (MOVHZload ptr x))))
8687 if z.Op != OpSelect0 {
8691 if z_0.Op != OpPPC64ANDCCconst {
8694 z_0_0 := z_0.Args[0]
8695 if z_0_0.Op != OpPPC64MOVHZload {
8701 // match: (MOVHZreg x:(MOVBZload _ _))
8705 if x.Op != OpPPC64MOVBZload {
8711 // match: (MOVHZreg x:(MOVBZloadidx _ _ _))
8715 if x.Op != OpPPC64MOVBZloadidx {
8721 // match: (MOVHZreg x:(MOVHZload _ _))
8725 if x.Op != OpPPC64MOVHZload {
8731 // match: (MOVHZreg x:(MOVHZloadidx _ _ _))
8735 if x.Op != OpPPC64MOVHZloadidx {
8741 // match: (MOVHZreg x:(Arg <t>))
8742 // cond: (is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()
8750 if !((is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()) {
8756 // match: (MOVHZreg (MOVDconst [c]))
8757 // result: (MOVDconst [int64(uint16(c))])
8759 if v_0.Op != OpPPC64MOVDconst {
8762 c := auxIntToInt64(v_0.AuxInt)
8763 v.reset(OpPPC64MOVDconst)
8764 v.AuxInt = int64ToAuxInt(int64(uint16(c)))
8769 func rewriteValuePPC64_OpPPC64MOVHload(v *Value) bool {
8772 // match: (MOVHload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
8773 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
8774 // result: (MOVHload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
8776 off1 := auxIntToInt32(v.AuxInt)
8777 sym1 := auxToSym(v.Aux)
8779 if p.Op != OpPPC64MOVDaddr {
8782 off2 := auxIntToInt32(p.AuxInt)
8783 sym2 := auxToSym(p.Aux)
8786 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8789 v.reset(OpPPC64MOVHload)
8790 v.AuxInt = int32ToAuxInt(off1 + off2)
8791 v.Aux = symToAux(mergeSym(sym1, sym2))
8795 // match: (MOVHload [off1] {sym} (ADDconst [off2] x) mem)
8796 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
8797 // result: (MOVHload [off1+int32(off2)] {sym} x mem)
8799 off1 := auxIntToInt32(v.AuxInt)
8800 sym := auxToSym(v.Aux)
8801 if v_0.Op != OpPPC64ADDconst {
8804 off2 := auxIntToInt64(v_0.AuxInt)
8807 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
8810 v.reset(OpPPC64MOVHload)
8811 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8812 v.Aux = symToAux(sym)
8816 // match: (MOVHload [0] {sym} p:(ADD ptr idx) mem)
8817 // cond: sym == nil && p.Uses == 1
8818 // result: (MOVHloadidx ptr idx mem)
8820 if auxIntToInt32(v.AuxInt) != 0 {
8823 sym := auxToSym(v.Aux)
8825 if p.Op != OpPPC64ADD {
8831 if !(sym == nil && p.Uses == 1) {
8834 v.reset(OpPPC64MOVHloadidx)
8835 v.AddArg3(ptr, idx, mem)
8840 func rewriteValuePPC64_OpPPC64MOVHloadidx(v *Value) bool {
8844 // match: (MOVHloadidx ptr (MOVDconst [c]) mem)
8845 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
8846 // result: (MOVHload [int32(c)] ptr mem)
8849 if v_1.Op != OpPPC64MOVDconst {
8852 c := auxIntToInt64(v_1.AuxInt)
8854 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8857 v.reset(OpPPC64MOVHload)
8858 v.AuxInt = int32ToAuxInt(int32(c))
8862 // match: (MOVHloadidx (MOVDconst [c]) ptr mem)
8863 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
8864 // result: (MOVHload [int32(c)] ptr mem)
8866 if v_0.Op != OpPPC64MOVDconst {
8869 c := auxIntToInt64(v_0.AuxInt)
8872 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8875 v.reset(OpPPC64MOVHload)
8876 v.AuxInt = int32ToAuxInt(int32(c))
8882 func rewriteValuePPC64_OpPPC64MOVHreg(v *Value) bool {
8885 typ := &b.Func.Config.Types
8886 // match: (MOVHreg y:(Select0 (ANDCCconst [c] _)))
8887 // cond: uint64(c) <= 0x7FFF
8891 if y.Op != OpSelect0 {
8895 if y_0.Op != OpPPC64ANDCCconst {
8898 c := auxIntToInt64(y_0.AuxInt)
8899 if !(uint64(c) <= 0x7FFF) {
8905 // match: (MOVHreg (SRAWconst [c] (MOVBreg x)))
8906 // result: (SRAWconst [c] (MOVBreg x))
8908 if v_0.Op != OpPPC64SRAWconst {
8911 c := auxIntToInt64(v_0.AuxInt)
8912 v_0_0 := v_0.Args[0]
8913 if v_0_0.Op != OpPPC64MOVBreg {
8917 v.reset(OpPPC64SRAWconst)
8918 v.AuxInt = int64ToAuxInt(c)
8919 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
8924 // match: (MOVHreg (SRAWconst [c] (MOVHreg x)))
8925 // result: (SRAWconst [c] (MOVHreg x))
8927 if v_0.Op != OpPPC64SRAWconst {
8930 c := auxIntToInt64(v_0.AuxInt)
8931 v_0_0 := v_0.Args[0]
8932 if v_0_0.Op != OpPPC64MOVHreg {
8936 v.reset(OpPPC64SRAWconst)
8937 v.AuxInt = int64ToAuxInt(c)
8938 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
8943 // match: (MOVHreg (SRAWconst [c] x))
8944 // cond: sizeof(x.Type) <= 16
8945 // result: (SRAWconst [c] x)
8947 if v_0.Op != OpPPC64SRAWconst {
8950 c := auxIntToInt64(v_0.AuxInt)
8952 if !(sizeof(x.Type) <= 16) {
8955 v.reset(OpPPC64SRAWconst)
8956 v.AuxInt = int64ToAuxInt(c)
8960 // match: (MOVHreg (SRDconst [c] x))
8962 // result: (SRDconst [c] x)
8964 if v_0.Op != OpPPC64SRDconst {
8967 c := auxIntToInt64(v_0.AuxInt)
8972 v.reset(OpPPC64SRDconst)
8973 v.AuxInt = int64ToAuxInt(c)
8977 // match: (MOVHreg (SRDconst [c] x))
8979 // result: (SRADconst [c] x)
8981 if v_0.Op != OpPPC64SRDconst {
8984 c := auxIntToInt64(v_0.AuxInt)
8989 v.reset(OpPPC64SRADconst)
8990 v.AuxInt = int64ToAuxInt(c)
8994 // match: (MOVHreg (SRADconst [c] x))
8996 // result: (SRADconst [c] x)
8998 if v_0.Op != OpPPC64SRADconst {
9001 c := auxIntToInt64(v_0.AuxInt)
9006 v.reset(OpPPC64SRADconst)
9007 v.AuxInt = int64ToAuxInt(c)
9011 // match: (MOVHreg (SRWconst [c] x))
9013 // result: (SRWconst [c] x)
9015 if v_0.Op != OpPPC64SRWconst {
9018 c := auxIntToInt64(v_0.AuxInt)
9023 v.reset(OpPPC64SRWconst)
9024 v.AuxInt = int64ToAuxInt(c)
9028 // match: (MOVHreg (SRAWconst [c] x))
9030 // result: (SRAWconst [c] x)
9032 if v_0.Op != OpPPC64SRAWconst {
9035 c := auxIntToInt64(v_0.AuxInt)
9040 v.reset(OpPPC64SRAWconst)
9041 v.AuxInt = int64ToAuxInt(c)
9045 // match: (MOVHreg (SRWconst [c] x))
9047 // result: (SRAWconst [c] x)
9049 if v_0.Op != OpPPC64SRWconst {
9052 c := auxIntToInt64(v_0.AuxInt)
9057 v.reset(OpPPC64SRAWconst)
9058 v.AuxInt = int64ToAuxInt(c)
9062 // match: (MOVHreg y:(MOVHreg _))
9066 if y.Op != OpPPC64MOVHreg {
9072 // match: (MOVHreg y:(MOVBreg _))
9076 if y.Op != OpPPC64MOVBreg {
9082 // match: (MOVHreg y:(MOVHZreg x))
9083 // result: (MOVHreg x)
9086 if y.Op != OpPPC64MOVHZreg {
9090 v.reset(OpPPC64MOVHreg)
9094 // match: (MOVHreg x:(MOVHload _ _))
9098 if x.Op != OpPPC64MOVHload {
9104 // match: (MOVHreg x:(MOVHloadidx _ _ _))
9108 if x.Op != OpPPC64MOVHloadidx {
9114 // match: (MOVHreg x:(Arg <t>))
9115 // cond: (is8BitInt(t) || is16BitInt(t)) && t.IsSigned()
9123 if !((is8BitInt(t) || is16BitInt(t)) && t.IsSigned()) {
9129 // match: (MOVHreg (MOVDconst [c]))
9130 // result: (MOVDconst [int64(int16(c))])
9132 if v_0.Op != OpPPC64MOVDconst {
9135 c := auxIntToInt64(v_0.AuxInt)
9136 v.reset(OpPPC64MOVDconst)
9137 v.AuxInt = int64ToAuxInt(int64(int16(c)))
9142 func rewriteValuePPC64_OpPPC64MOVHstore(v *Value) bool {
9147 // match: (MOVHstore [off1] {sym} (ADDconst [off2] x) val mem)
9148 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
9149 // result: (MOVHstore [off1+int32(off2)] {sym} x val mem)
9151 off1 := auxIntToInt32(v.AuxInt)
9152 sym := auxToSym(v.Aux)
9153 if v_0.Op != OpPPC64ADDconst {
9156 off2 := auxIntToInt64(v_0.AuxInt)
9160 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
9163 v.reset(OpPPC64MOVHstore)
9164 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9165 v.Aux = symToAux(sym)
9166 v.AddArg3(x, val, mem)
9169 // match: (MOVHstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
9170 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
9171 // result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
9173 off1 := auxIntToInt32(v.AuxInt)
9174 sym1 := auxToSym(v.Aux)
9176 if p.Op != OpPPC64MOVDaddr {
9179 off2 := auxIntToInt32(p.AuxInt)
9180 sym2 := auxToSym(p.Aux)
9184 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
9187 v.reset(OpPPC64MOVHstore)
9188 v.AuxInt = int32ToAuxInt(off1 + off2)
9189 v.Aux = symToAux(mergeSym(sym1, sym2))
9190 v.AddArg3(ptr, val, mem)
9193 // match: (MOVHstore [off] {sym} ptr (MOVDconst [0]) mem)
9194 // result: (MOVHstorezero [off] {sym} ptr mem)
9196 off := auxIntToInt32(v.AuxInt)
9197 sym := auxToSym(v.Aux)
9199 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
9203 v.reset(OpPPC64MOVHstorezero)
9204 v.AuxInt = int32ToAuxInt(off)
9205 v.Aux = symToAux(sym)
9209 // match: (MOVHstore [0] {sym} p:(ADD ptr idx) val mem)
9210 // cond: sym == nil && p.Uses == 1
9211 // result: (MOVHstoreidx ptr idx val mem)
9213 if auxIntToInt32(v.AuxInt) != 0 {
9216 sym := auxToSym(v.Aux)
9218 if p.Op != OpPPC64ADD {
9225 if !(sym == nil && p.Uses == 1) {
9228 v.reset(OpPPC64MOVHstoreidx)
9229 v.AddArg4(ptr, idx, val, mem)
9232 // match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
9233 // result: (MOVHstore [off] {sym} ptr x mem)
9235 off := auxIntToInt32(v.AuxInt)
9236 sym := auxToSym(v.Aux)
9238 if v_1.Op != OpPPC64MOVHreg {
9243 v.reset(OpPPC64MOVHstore)
9244 v.AuxInt = int32ToAuxInt(off)
9245 v.Aux = symToAux(sym)
9246 v.AddArg3(ptr, x, mem)
9249 // match: (MOVHstore [off] {sym} ptr (MOVHZreg x) mem)
9250 // result: (MOVHstore [off] {sym} ptr x mem)
9252 off := auxIntToInt32(v.AuxInt)
9253 sym := auxToSym(v.Aux)
9255 if v_1.Op != OpPPC64MOVHZreg {
9260 v.reset(OpPPC64MOVHstore)
9261 v.AuxInt = int32ToAuxInt(off)
9262 v.Aux = symToAux(sym)
9263 v.AddArg3(ptr, x, mem)
9266 // match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
9267 // result: (MOVHstore [off] {sym} ptr x mem)
9269 off := auxIntToInt32(v.AuxInt)
9270 sym := auxToSym(v.Aux)
9272 if v_1.Op != OpPPC64MOVWreg {
9277 v.reset(OpPPC64MOVHstore)
9278 v.AuxInt = int32ToAuxInt(off)
9279 v.Aux = symToAux(sym)
9280 v.AddArg3(ptr, x, mem)
9283 // match: (MOVHstore [off] {sym} ptr (MOVWZreg x) mem)
9284 // result: (MOVHstore [off] {sym} ptr x mem)
9286 off := auxIntToInt32(v.AuxInt)
9287 sym := auxToSym(v.Aux)
9289 if v_1.Op != OpPPC64MOVWZreg {
9294 v.reset(OpPPC64MOVHstore)
9295 v.AuxInt = int32ToAuxInt(off)
9296 v.Aux = symToAux(sym)
9297 v.AddArg3(ptr, x, mem)
9300 // match: (MOVHstore [off] {sym} ptr r:(BRH val) mem)
9301 // cond: r.Uses == 1
9302 // result: (MOVHBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
9304 off := auxIntToInt32(v.AuxInt)
9305 sym := auxToSym(v.Aux)
9308 if r.Op != OpPPC64BRH {
9316 v.reset(OpPPC64MOVHBRstore)
9317 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
9318 v0.AuxInt = int32ToAuxInt(off)
9319 v0.Aux = symToAux(sym)
9321 v.AddArg3(v0, val, mem)
9324 // match: (MOVHstore [off] {sym} ptr (Bswap16 val) mem)
9325 // result: (MOVHBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
9327 off := auxIntToInt32(v.AuxInt)
9328 sym := auxToSym(v.Aux)
9330 if v_1.Op != OpBswap16 {
9335 v.reset(OpPPC64MOVHBRstore)
9336 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
9337 v0.AuxInt = int32ToAuxInt(off)
9338 v0.Aux = symToAux(sym)
9340 v.AddArg3(v0, val, mem)
9345 func rewriteValuePPC64_OpPPC64MOVHstoreidx(v *Value) bool {
9350 // match: (MOVHstoreidx ptr (MOVDconst [c]) val mem)
9351 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
9352 // result: (MOVHstore [int32(c)] ptr val mem)
9355 if v_1.Op != OpPPC64MOVDconst {
9358 c := auxIntToInt64(v_1.AuxInt)
9361 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
9364 v.reset(OpPPC64MOVHstore)
9365 v.AuxInt = int32ToAuxInt(int32(c))
9366 v.AddArg3(ptr, val, mem)
9369 // match: (MOVHstoreidx (MOVDconst [c]) ptr val mem)
9370 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
9371 // result: (MOVHstore [int32(c)] ptr val mem)
9373 if v_0.Op != OpPPC64MOVDconst {
9376 c := auxIntToInt64(v_0.AuxInt)
9380 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
9383 v.reset(OpPPC64MOVHstore)
9384 v.AuxInt = int32ToAuxInt(int32(c))
9385 v.AddArg3(ptr, val, mem)
9388 // match: (MOVHstoreidx ptr idx (MOVHreg x) mem)
9389 // result: (MOVHstoreidx ptr idx x mem)
9393 if v_2.Op != OpPPC64MOVHreg {
9398 v.reset(OpPPC64MOVHstoreidx)
9399 v.AddArg4(ptr, idx, x, mem)
9402 // match: (MOVHstoreidx ptr idx (MOVHZreg x) mem)
9403 // result: (MOVHstoreidx ptr idx x mem)
9407 if v_2.Op != OpPPC64MOVHZreg {
9412 v.reset(OpPPC64MOVHstoreidx)
9413 v.AddArg4(ptr, idx, x, mem)
9416 // match: (MOVHstoreidx ptr idx (MOVWreg x) mem)
9417 // result: (MOVHstoreidx ptr idx x mem)
9421 if v_2.Op != OpPPC64MOVWreg {
9426 v.reset(OpPPC64MOVHstoreidx)
9427 v.AddArg4(ptr, idx, x, mem)
9430 // match: (MOVHstoreidx ptr idx (MOVWZreg x) mem)
9431 // result: (MOVHstoreidx ptr idx x mem)
9435 if v_2.Op != OpPPC64MOVWZreg {
9440 v.reset(OpPPC64MOVHstoreidx)
9441 v.AddArg4(ptr, idx, x, mem)
9444 // match: (MOVHstoreidx ptr idx r:(BRH val) mem)
9445 // cond: r.Uses == 1
9446 // result: (MOVHBRstoreidx ptr idx val mem)
9451 if r.Op != OpPPC64BRH {
9459 v.reset(OpPPC64MOVHBRstoreidx)
9460 v.AddArg4(ptr, idx, val, mem)
9463 // match: (MOVHstoreidx ptr idx (Bswap16 val) mem)
9464 // result: (MOVHBRstoreidx ptr idx val mem)
9468 if v_2.Op != OpBswap16 {
9473 v.reset(OpPPC64MOVHBRstoreidx)
9474 v.AddArg4(ptr, idx, val, mem)
9479 func rewriteValuePPC64_OpPPC64MOVHstorezero(v *Value) bool {
9482 // match: (MOVHstorezero [off1] {sym} (ADDconst [off2] x) mem)
9483 // cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
9484 // result: (MOVHstorezero [off1+int32(off2)] {sym} x mem)
9486 off1 := auxIntToInt32(v.AuxInt)
9487 sym := auxToSym(v.Aux)
9488 if v_0.Op != OpPPC64ADDconst {
9491 off2 := auxIntToInt64(v_0.AuxInt)
9494 if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
9497 v.reset(OpPPC64MOVHstorezero)
9498 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9499 v.Aux = symToAux(sym)
9503 // match: (MOVHstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
9504 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
9505 // result: (MOVHstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
9507 off1 := auxIntToInt32(v.AuxInt)
9508 sym1 := auxToSym(v.Aux)
9510 if p.Op != OpPPC64MOVDaddr {
9513 off2 := auxIntToInt32(p.AuxInt)
9514 sym2 := auxToSym(p.Aux)
9517 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
9520 v.reset(OpPPC64MOVHstorezero)
9521 v.AuxInt = int32ToAuxInt(off1 + off2)
9522 v.Aux = symToAux(mergeSym(sym1, sym2))
9528 func rewriteValuePPC64_OpPPC64MOVWBRstore(v *Value) bool {
9532 // match: (MOVWBRstore ptr (MOVWreg x) mem)
9533 // result: (MOVWBRstore ptr x mem)
9536 if v_1.Op != OpPPC64MOVWreg {
9541 v.reset(OpPPC64MOVWBRstore)
9542 v.AddArg3(ptr, x, mem)
9545 // match: (MOVWBRstore ptr (MOVWZreg x) mem)
9546 // result: (MOVWBRstore ptr x mem)
9549 if v_1.Op != OpPPC64MOVWZreg {
9554 v.reset(OpPPC64MOVWBRstore)
9555 v.AddArg3(ptr, x, mem)
9560 func rewriteValuePPC64_OpPPC64MOVWZload(v *Value) bool {
9563 // match: (MOVWZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
9564 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
9565 // result: (MOVWZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
9567 off1 := auxIntToInt32(v.AuxInt)
9568 sym1 := auxToSym(v.Aux)
9570 if p.Op != OpPPC64MOVDaddr {
9573 off2 := auxIntToInt32(p.AuxInt)
9574 sym2 := auxToSym(p.Aux)
9577 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
9580 v.reset(OpPPC64MOVWZload)
9581 v.AuxInt = int32ToAuxInt(off1 + off2)
9582 v.Aux = symToAux(mergeSym(sym1, sym2))
9586 // match: (MOVWZload [off1] {sym} (ADDconst [off2] x) mem)
9587 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
9588 // result: (MOVWZload [off1+int32(off2)] {sym} x mem)
9590 off1 := auxIntToInt32(v.AuxInt)
9591 sym := auxToSym(v.Aux)
9592 if v_0.Op != OpPPC64ADDconst {
9595 off2 := auxIntToInt64(v_0.AuxInt)
9598 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
9601 v.reset(OpPPC64MOVWZload)
9602 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9603 v.Aux = symToAux(sym)
9607 // match: (MOVWZload [0] {sym} p:(ADD ptr idx) mem)
9608 // cond: sym == nil && p.Uses == 1
9609 // result: (MOVWZloadidx ptr idx mem)
9611 if auxIntToInt32(v.AuxInt) != 0 {
9614 sym := auxToSym(v.Aux)
9616 if p.Op != OpPPC64ADD {
9622 if !(sym == nil && p.Uses == 1) {
9625 v.reset(OpPPC64MOVWZloadidx)
9626 v.AddArg3(ptr, idx, mem)
9631 func rewriteValuePPC64_OpPPC64MOVWZloadidx(v *Value) bool {
9635 // match: (MOVWZloadidx ptr (MOVDconst [c]) mem)
9636 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
9637 // result: (MOVWZload [int32(c)] ptr mem)
9640 if v_1.Op != OpPPC64MOVDconst {
9643 c := auxIntToInt64(v_1.AuxInt)
9645 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
9648 v.reset(OpPPC64MOVWZload)
9649 v.AuxInt = int32ToAuxInt(int32(c))
9653 // match: (MOVWZloadidx (MOVDconst [c]) ptr mem)
9654 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
9655 // result: (MOVWZload [int32(c)] ptr mem)
9657 if v_0.Op != OpPPC64MOVDconst {
9660 c := auxIntToInt64(v_0.AuxInt)
9663 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
9666 v.reset(OpPPC64MOVWZload)
9667 v.AuxInt = int32ToAuxInt(int32(c))
9673 func rewriteValuePPC64_OpPPC64MOVWZreg(v *Value) bool {
9676 typ := &b.Func.Config.Types
9677 // match: (MOVWZreg y:(Select0 (ANDCCconst [c] _)))
9678 // cond: uint64(c) <= 0xFFFFFFFF
9682 if y.Op != OpSelect0 {
9686 if y_0.Op != OpPPC64ANDCCconst {
9689 c := auxIntToInt64(y_0.AuxInt)
9690 if !(uint64(c) <= 0xFFFFFFFF) {
9696 // match: (MOVWZreg y:(AND (MOVDconst [c]) _))
9697 // cond: uint64(c) <= 0xFFFFFFFF
9701 if y.Op != OpPPC64AND {
9706 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
9707 if y_0.Op != OpPPC64MOVDconst {
9710 c := auxIntToInt64(y_0.AuxInt)
9711 if !(uint64(c) <= 0xFFFFFFFF) {
9719 // match: (MOVWZreg (SRWconst [c] (MOVBZreg x)))
9720 // result: (SRWconst [c] (MOVBZreg x))
9722 if v_0.Op != OpPPC64SRWconst {
9725 c := auxIntToInt64(v_0.AuxInt)
9726 v_0_0 := v_0.Args[0]
9727 if v_0_0.Op != OpPPC64MOVBZreg {
9731 v.reset(OpPPC64SRWconst)
9732 v.AuxInt = int64ToAuxInt(c)
9733 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
9738 // match: (MOVWZreg (SRWconst [c] (MOVHZreg x)))
9739 // result: (SRWconst [c] (MOVHZreg x))
9741 if v_0.Op != OpPPC64SRWconst {
9744 c := auxIntToInt64(v_0.AuxInt)
9745 v_0_0 := v_0.Args[0]
9746 if v_0_0.Op != OpPPC64MOVHZreg {
9750 v.reset(OpPPC64SRWconst)
9751 v.AuxInt = int64ToAuxInt(c)
9752 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
9757 // match: (MOVWZreg (SRWconst [c] (MOVWZreg x)))
9758 // result: (SRWconst [c] (MOVWZreg x))
9760 if v_0.Op != OpPPC64SRWconst {
9763 c := auxIntToInt64(v_0.AuxInt)
9764 v_0_0 := v_0.Args[0]
9765 if v_0_0.Op != OpPPC64MOVWZreg {
9769 v.reset(OpPPC64SRWconst)
9770 v.AuxInt = int64ToAuxInt(c)
9771 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
9776 // match: (MOVWZreg (SRWconst [c] x))
9777 // cond: sizeof(x.Type) <= 32
9778 // result: (SRWconst [c] x)
9780 if v_0.Op != OpPPC64SRWconst {
9783 c := auxIntToInt64(v_0.AuxInt)
9785 if !(sizeof(x.Type) <= 32) {
9788 v.reset(OpPPC64SRWconst)
9789 v.AuxInt = int64ToAuxInt(c)
9793 // match: (MOVWZreg (SRDconst [c] x))
9795 // result: (SRDconst [c] x)
9797 if v_0.Op != OpPPC64SRDconst {
9800 c := auxIntToInt64(v_0.AuxInt)
9805 v.reset(OpPPC64SRDconst)
9806 v.AuxInt = int64ToAuxInt(c)
9810 // match: (MOVWZreg y:(MOVWZreg _))
9814 if y.Op != OpPPC64MOVWZreg {
9820 // match: (MOVWZreg y:(MOVHZreg _))
9824 if y.Op != OpPPC64MOVHZreg {
9830 // match: (MOVWZreg y:(MOVBZreg _))
9834 if y.Op != OpPPC64MOVBZreg {
9840 // match: (MOVWZreg y:(MOVHBRload _ _))
9844 if y.Op != OpPPC64MOVHBRload {
9850 // match: (MOVWZreg y:(MOVWBRload _ _))
9854 if y.Op != OpPPC64MOVWBRload {
9860 // match: (MOVWZreg y:(MOVWreg x))
9861 // result: (MOVWZreg x)
9864 if y.Op != OpPPC64MOVWreg {
9868 v.reset(OpPPC64MOVWZreg)
9872 // match: (MOVWZreg (OR <t> x (MOVWZreg y)))
9873 // result: (MOVWZreg (OR <t> x y))
9875 if v_0.Op != OpPPC64OR {
9880 v_0_0 := v_0.Args[0]
9881 v_0_1 := v_0.Args[1]
9882 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9884 if v_0_1.Op != OpPPC64MOVWZreg {
9888 v.reset(OpPPC64MOVWZreg)
9889 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
9896 // match: (MOVWZreg (XOR <t> x (MOVWZreg y)))
9897 // result: (MOVWZreg (XOR <t> x y))
9899 if v_0.Op != OpPPC64XOR {
9904 v_0_0 := v_0.Args[0]
9905 v_0_1 := v_0.Args[1]
9906 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9908 if v_0_1.Op != OpPPC64MOVWZreg {
9912 v.reset(OpPPC64MOVWZreg)
9913 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
9920 // match: (MOVWZreg (AND <t> x (MOVWZreg y)))
9921 // result: (MOVWZreg (AND <t> x y))
9923 if v_0.Op != OpPPC64AND {
9928 v_0_0 := v_0.Args[0]
9929 v_0_1 := v_0.Args[1]
9930 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9932 if v_0_1.Op != OpPPC64MOVWZreg {
9936 v.reset(OpPPC64MOVWZreg)
9937 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
9944 // match: (MOVWZreg z:(Select0 (ANDCCconst [c] (MOVBZload ptr x))))
9948 if z.Op != OpSelect0 {
9952 if z_0.Op != OpPPC64ANDCCconst {
9955 z_0_0 := z_0.Args[0]
9956 if z_0_0.Op != OpPPC64MOVBZload {
9962 // match: (MOVWZreg z:(AND y (MOVWZload ptr x)))
9966 if z.Op != OpPPC64AND {
9972 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
9973 if z_1.Op != OpPPC64MOVWZload {
9981 // match: (MOVWZreg z:(Select0 (ANDCCconst [c] (MOVHZload ptr x))))
9985 if z.Op != OpSelect0 {
9989 if z_0.Op != OpPPC64ANDCCconst {
9992 z_0_0 := z_0.Args[0]
9993 if z_0_0.Op != OpPPC64MOVHZload {
9999 // match: (MOVWZreg z:(Select0 (ANDCCconst [c] (MOVWZload ptr x))))
10003 if z.Op != OpSelect0 {
10007 if z_0.Op != OpPPC64ANDCCconst {
10010 z_0_0 := z_0.Args[0]
10011 if z_0_0.Op != OpPPC64MOVWZload {
10017 // match: (MOVWZreg x:(MOVBZload _ _))
10021 if x.Op != OpPPC64MOVBZload {
10027 // match: (MOVWZreg x:(MOVBZloadidx _ _ _))
10031 if x.Op != OpPPC64MOVBZloadidx {
10037 // match: (MOVWZreg x:(MOVHZload _ _))
10041 if x.Op != OpPPC64MOVHZload {
10047 // match: (MOVWZreg x:(MOVHZloadidx _ _ _))
10051 if x.Op != OpPPC64MOVHZloadidx {
10057 // match: (MOVWZreg x:(MOVWZload _ _))
10061 if x.Op != OpPPC64MOVWZload {
10067 // match: (MOVWZreg x:(MOVWZloadidx _ _ _))
10071 if x.Op != OpPPC64MOVWZloadidx {
10077 // match: (MOVWZreg x:(Select0 (LoweredAtomicLoad32 _ _)))
10081 if x.Op != OpSelect0 {
10085 if x_0.Op != OpPPC64LoweredAtomicLoad32 {
10091 // match: (MOVWZreg x:(Arg <t>))
10092 // cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()
10100 if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()) {
10106 // match: (MOVWZreg (MOVDconst [c]))
10107 // result: (MOVDconst [int64(uint32(c))])
10109 if v_0.Op != OpPPC64MOVDconst {
10112 c := auxIntToInt64(v_0.AuxInt)
10113 v.reset(OpPPC64MOVDconst)
10114 v.AuxInt = int64ToAuxInt(int64(uint32(c)))
10119 func rewriteValuePPC64_OpPPC64MOVWload(v *Value) bool {
10122 // match: (MOVWload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
10123 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
10124 // result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
10126 off1 := auxIntToInt32(v.AuxInt)
10127 sym1 := auxToSym(v.Aux)
10129 if p.Op != OpPPC64MOVDaddr {
10132 off2 := auxIntToInt32(p.AuxInt)
10133 sym2 := auxToSym(p.Aux)
10136 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
10139 v.reset(OpPPC64MOVWload)
10140 v.AuxInt = int32ToAuxInt(off1 + off2)
10141 v.Aux = symToAux(mergeSym(sym1, sym2))
10142 v.AddArg2(ptr, mem)
10145 // match: (MOVWload [off1] {sym} (ADDconst [off2] x) mem)
10146 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
10147 // result: (MOVWload [off1+int32(off2)] {sym} x mem)
10149 off1 := auxIntToInt32(v.AuxInt)
10150 sym := auxToSym(v.Aux)
10151 if v_0.Op != OpPPC64ADDconst {
10154 off2 := auxIntToInt64(v_0.AuxInt)
10157 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
10160 v.reset(OpPPC64MOVWload)
10161 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10162 v.Aux = symToAux(sym)
10166 // match: (MOVWload [0] {sym} p:(ADD ptr idx) mem)
10167 // cond: sym == nil && p.Uses == 1
10168 // result: (MOVWloadidx ptr idx mem)
10170 if auxIntToInt32(v.AuxInt) != 0 {
10173 sym := auxToSym(v.Aux)
10175 if p.Op != OpPPC64ADD {
10181 if !(sym == nil && p.Uses == 1) {
10184 v.reset(OpPPC64MOVWloadidx)
10185 v.AddArg3(ptr, idx, mem)
10190 func rewriteValuePPC64_OpPPC64MOVWloadidx(v *Value) bool {
10194 // match: (MOVWloadidx ptr (MOVDconst [c]) mem)
10195 // cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
10196 // result: (MOVWload [int32(c)] ptr mem)
10199 if v_1.Op != OpPPC64MOVDconst {
10202 c := auxIntToInt64(v_1.AuxInt)
10204 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10207 v.reset(OpPPC64MOVWload)
10208 v.AuxInt = int32ToAuxInt(int32(c))
10209 v.AddArg2(ptr, mem)
10212 // match: (MOVWloadidx (MOVDconst [c]) ptr mem)
10213 // cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
10214 // result: (MOVWload [int32(c)] ptr mem)
10216 if v_0.Op != OpPPC64MOVDconst {
10219 c := auxIntToInt64(v_0.AuxInt)
10222 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10225 v.reset(OpPPC64MOVWload)
10226 v.AuxInt = int32ToAuxInt(int32(c))
10227 v.AddArg2(ptr, mem)
10232 func rewriteValuePPC64_OpPPC64MOVWreg(v *Value) bool {
10235 typ := &b.Func.Config.Types
10236 // match: (MOVWreg y:(Select0 (ANDCCconst [c] _)))
10237 // cond: uint64(c) <= 0xFFFF
10241 if y.Op != OpSelect0 {
10245 if y_0.Op != OpPPC64ANDCCconst {
10248 c := auxIntToInt64(y_0.AuxInt)
10249 if !(uint64(c) <= 0xFFFF) {
10255 // match: (MOVWreg y:(AND (MOVDconst [c]) _))
10256 // cond: uint64(c) <= 0x7FFFFFFF
10260 if y.Op != OpPPC64AND {
10265 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
10266 if y_0.Op != OpPPC64MOVDconst {
10269 c := auxIntToInt64(y_0.AuxInt)
10270 if !(uint64(c) <= 0x7FFFFFFF) {
10278 // match: (MOVWreg (SRAWconst [c] (MOVBreg x)))
10279 // result: (SRAWconst [c] (MOVBreg x))
10281 if v_0.Op != OpPPC64SRAWconst {
10284 c := auxIntToInt64(v_0.AuxInt)
10285 v_0_0 := v_0.Args[0]
10286 if v_0_0.Op != OpPPC64MOVBreg {
10290 v.reset(OpPPC64SRAWconst)
10291 v.AuxInt = int64ToAuxInt(c)
10292 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
10297 // match: (MOVWreg (SRAWconst [c] (MOVHreg x)))
10298 // result: (SRAWconst [c] (MOVHreg x))
10300 if v_0.Op != OpPPC64SRAWconst {
10303 c := auxIntToInt64(v_0.AuxInt)
10304 v_0_0 := v_0.Args[0]
10305 if v_0_0.Op != OpPPC64MOVHreg {
10309 v.reset(OpPPC64SRAWconst)
10310 v.AuxInt = int64ToAuxInt(c)
10311 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
10316 // match: (MOVWreg (SRAWconst [c] (MOVWreg x)))
10317 // result: (SRAWconst [c] (MOVWreg x))
10319 if v_0.Op != OpPPC64SRAWconst {
10322 c := auxIntToInt64(v_0.AuxInt)
10323 v_0_0 := v_0.Args[0]
10324 if v_0_0.Op != OpPPC64MOVWreg {
10328 v.reset(OpPPC64SRAWconst)
10329 v.AuxInt = int64ToAuxInt(c)
10330 v0 := b.NewValue0(v.Pos, OpPPC64MOVWreg, typ.Int64)
10335 // match: (MOVWreg (SRAWconst [c] x))
10336 // cond: sizeof(x.Type) <= 32
10337 // result: (SRAWconst [c] x)
10339 if v_0.Op != OpPPC64SRAWconst {
10342 c := auxIntToInt64(v_0.AuxInt)
10344 if !(sizeof(x.Type) <= 32) {
10347 v.reset(OpPPC64SRAWconst)
10348 v.AuxInt = int64ToAuxInt(c)
10352 // match: (MOVWreg (SRDconst [c] x))
10354 // result: (SRDconst [c] x)
10356 if v_0.Op != OpPPC64SRDconst {
10359 c := auxIntToInt64(v_0.AuxInt)
10364 v.reset(OpPPC64SRDconst)
10365 v.AuxInt = int64ToAuxInt(c)
10369 // match: (MOVWreg (SRADconst [c] x))
10371 // result: (SRADconst [c] x)
10373 if v_0.Op != OpPPC64SRADconst {
10376 c := auxIntToInt64(v_0.AuxInt)
10381 v.reset(OpPPC64SRADconst)
10382 v.AuxInt = int64ToAuxInt(c)
10386 // match: (MOVWreg (SRDconst [c] x))
10388 // result: (SRADconst [c] x)
10390 if v_0.Op != OpPPC64SRDconst {
10393 c := auxIntToInt64(v_0.AuxInt)
10398 v.reset(OpPPC64SRADconst)
10399 v.AuxInt = int64ToAuxInt(c)
10403 // match: (MOVWreg y:(MOVWreg _))
10407 if y.Op != OpPPC64MOVWreg {
10413 // match: (MOVWreg y:(MOVHreg _))
10417 if y.Op != OpPPC64MOVHreg {
10423 // match: (MOVWreg y:(MOVBreg _))
10427 if y.Op != OpPPC64MOVBreg {
10433 // match: (MOVWreg y:(MOVWZreg x))
10434 // result: (MOVWreg x)
10437 if y.Op != OpPPC64MOVWZreg {
10441 v.reset(OpPPC64MOVWreg)
10445 // match: (MOVWreg x:(MOVHload _ _))
10449 if x.Op != OpPPC64MOVHload {
10455 // match: (MOVWreg x:(MOVHloadidx _ _ _))
10459 if x.Op != OpPPC64MOVHloadidx {
10465 // match: (MOVWreg x:(MOVWload _ _))
10469 if x.Op != OpPPC64MOVWload {
10475 // match: (MOVWreg x:(MOVWloadidx _ _ _))
10479 if x.Op != OpPPC64MOVWloadidx {
10485 // match: (MOVWreg x:(Arg <t>))
10486 // cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()
10494 if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()) {
10500 // match: (MOVWreg (MOVDconst [c]))
10501 // result: (MOVDconst [int64(int32(c))])
10503 if v_0.Op != OpPPC64MOVDconst {
10506 c := auxIntToInt64(v_0.AuxInt)
10507 v.reset(OpPPC64MOVDconst)
10508 v.AuxInt = int64ToAuxInt(int64(int32(c)))
10513 func rewriteValuePPC64_OpPPC64MOVWstore(v *Value) bool {
10518 // match: (MOVWstore [off1] {sym} (ADDconst [off2] x) val mem)
10519 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
10520 // result: (MOVWstore [off1+int32(off2)] {sym} x val mem)
10522 off1 := auxIntToInt32(v.AuxInt)
10523 sym := auxToSym(v.Aux)
10524 if v_0.Op != OpPPC64ADDconst {
10527 off2 := auxIntToInt64(v_0.AuxInt)
10531 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
10534 v.reset(OpPPC64MOVWstore)
10535 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10536 v.Aux = symToAux(sym)
10537 v.AddArg3(x, val, mem)
10540 // match: (MOVWstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
10541 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
10542 // result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
10544 off1 := auxIntToInt32(v.AuxInt)
10545 sym1 := auxToSym(v.Aux)
10547 if p.Op != OpPPC64MOVDaddr {
10550 off2 := auxIntToInt32(p.AuxInt)
10551 sym2 := auxToSym(p.Aux)
10555 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
10558 v.reset(OpPPC64MOVWstore)
10559 v.AuxInt = int32ToAuxInt(off1 + off2)
10560 v.Aux = symToAux(mergeSym(sym1, sym2))
10561 v.AddArg3(ptr, val, mem)
10564 // match: (MOVWstore [off] {sym} ptr (MOVDconst [0]) mem)
10565 // result: (MOVWstorezero [off] {sym} ptr mem)
10567 off := auxIntToInt32(v.AuxInt)
10568 sym := auxToSym(v.Aux)
10570 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
10574 v.reset(OpPPC64MOVWstorezero)
10575 v.AuxInt = int32ToAuxInt(off)
10576 v.Aux = symToAux(sym)
10577 v.AddArg2(ptr, mem)
10580 // match: (MOVWstore [0] {sym} p:(ADD ptr idx) val mem)
10581 // cond: sym == nil && p.Uses == 1
10582 // result: (MOVWstoreidx ptr idx val mem)
10584 if auxIntToInt32(v.AuxInt) != 0 {
10587 sym := auxToSym(v.Aux)
10589 if p.Op != OpPPC64ADD {
10596 if !(sym == nil && p.Uses == 1) {
10599 v.reset(OpPPC64MOVWstoreidx)
10600 v.AddArg4(ptr, idx, val, mem)
10603 // match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
10604 // result: (MOVWstore [off] {sym} ptr x mem)
10606 off := auxIntToInt32(v.AuxInt)
10607 sym := auxToSym(v.Aux)
10609 if v_1.Op != OpPPC64MOVWreg {
10614 v.reset(OpPPC64MOVWstore)
10615 v.AuxInt = int32ToAuxInt(off)
10616 v.Aux = symToAux(sym)
10617 v.AddArg3(ptr, x, mem)
10620 // match: (MOVWstore [off] {sym} ptr (MOVWZreg x) mem)
10621 // result: (MOVWstore [off] {sym} ptr x mem)
10623 off := auxIntToInt32(v.AuxInt)
10624 sym := auxToSym(v.Aux)
10626 if v_1.Op != OpPPC64MOVWZreg {
10631 v.reset(OpPPC64MOVWstore)
10632 v.AuxInt = int32ToAuxInt(off)
10633 v.Aux = symToAux(sym)
10634 v.AddArg3(ptr, x, mem)
10637 // match: (MOVWstore [off] {sym} ptr r:(BRW val) mem)
10638 // cond: r.Uses == 1
10639 // result: (MOVWBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
10641 off := auxIntToInt32(v.AuxInt)
10642 sym := auxToSym(v.Aux)
10645 if r.Op != OpPPC64BRW {
10650 if !(r.Uses == 1) {
10653 v.reset(OpPPC64MOVWBRstore)
10654 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
10655 v0.AuxInt = int32ToAuxInt(off)
10656 v0.Aux = symToAux(sym)
10658 v.AddArg3(v0, val, mem)
10661 // match: (MOVWstore [off] {sym} ptr (Bswap32 val) mem)
10662 // result: (MOVWBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
10664 off := auxIntToInt32(v.AuxInt)
10665 sym := auxToSym(v.Aux)
10667 if v_1.Op != OpBswap32 {
10672 v.reset(OpPPC64MOVWBRstore)
10673 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
10674 v0.AuxInt = int32ToAuxInt(off)
10675 v0.Aux = symToAux(sym)
10677 v.AddArg3(v0, val, mem)
10682 func rewriteValuePPC64_OpPPC64MOVWstoreidx(v *Value) bool {
10687 // match: (MOVWstoreidx ptr (MOVDconst [c]) val mem)
10688 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
10689 // result: (MOVWstore [int32(c)] ptr val mem)
10692 if v_1.Op != OpPPC64MOVDconst {
10695 c := auxIntToInt64(v_1.AuxInt)
10698 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10701 v.reset(OpPPC64MOVWstore)
10702 v.AuxInt = int32ToAuxInt(int32(c))
10703 v.AddArg3(ptr, val, mem)
10706 // match: (MOVWstoreidx (MOVDconst [c]) ptr val mem)
10707 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
10708 // result: (MOVWstore [int32(c)] ptr val mem)
10710 if v_0.Op != OpPPC64MOVDconst {
10713 c := auxIntToInt64(v_0.AuxInt)
10717 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10720 v.reset(OpPPC64MOVWstore)
10721 v.AuxInt = int32ToAuxInt(int32(c))
10722 v.AddArg3(ptr, val, mem)
10725 // match: (MOVWstoreidx ptr idx (MOVWreg x) mem)
10726 // result: (MOVWstoreidx ptr idx x mem)
10730 if v_2.Op != OpPPC64MOVWreg {
10735 v.reset(OpPPC64MOVWstoreidx)
10736 v.AddArg4(ptr, idx, x, mem)
10739 // match: (MOVWstoreidx ptr idx (MOVWZreg x) mem)
10740 // result: (MOVWstoreidx ptr idx x mem)
10744 if v_2.Op != OpPPC64MOVWZreg {
10749 v.reset(OpPPC64MOVWstoreidx)
10750 v.AddArg4(ptr, idx, x, mem)
10753 // match: (MOVWstoreidx ptr idx r:(BRW val) mem)
10754 // cond: r.Uses == 1
10755 // result: (MOVWBRstoreidx ptr idx val mem)
10760 if r.Op != OpPPC64BRW {
10765 if !(r.Uses == 1) {
10768 v.reset(OpPPC64MOVWBRstoreidx)
10769 v.AddArg4(ptr, idx, val, mem)
10772 // match: (MOVWstoreidx ptr idx (Bswap32 val) mem)
10773 // result: (MOVWBRstoreidx ptr idx val mem)
10777 if v_2.Op != OpBswap32 {
10782 v.reset(OpPPC64MOVWBRstoreidx)
10783 v.AddArg4(ptr, idx, val, mem)
10788 func rewriteValuePPC64_OpPPC64MOVWstorezero(v *Value) bool {
10791 // match: (MOVWstorezero [off1] {sym} (ADDconst [off2] x) mem)
10792 // cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
10793 // result: (MOVWstorezero [off1+int32(off2)] {sym} x mem)
10795 off1 := auxIntToInt32(v.AuxInt)
10796 sym := auxToSym(v.Aux)
10797 if v_0.Op != OpPPC64ADDconst {
10800 off2 := auxIntToInt64(v_0.AuxInt)
10803 if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
10806 v.reset(OpPPC64MOVWstorezero)
10807 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10808 v.Aux = symToAux(sym)
10812 // match: (MOVWstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
10813 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
10814 // result: (MOVWstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
10816 off1 := auxIntToInt32(v.AuxInt)
10817 sym1 := auxToSym(v.Aux)
10819 if p.Op != OpPPC64MOVDaddr {
10822 off2 := auxIntToInt32(p.AuxInt)
10823 sym2 := auxToSym(p.Aux)
10826 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
10829 v.reset(OpPPC64MOVWstorezero)
10830 v.AuxInt = int32ToAuxInt(off1 + off2)
10831 v.Aux = symToAux(mergeSym(sym1, sym2))
10837 func rewriteValuePPC64_OpPPC64MTVSRD(v *Value) bool {
10840 typ := &b.Func.Config.Types
10841 // match: (MTVSRD (MOVDconst [c]))
10842 // cond: !math.IsNaN(math.Float64frombits(uint64(c)))
10843 // result: (FMOVDconst [math.Float64frombits(uint64(c))])
10845 if v_0.Op != OpPPC64MOVDconst {
10848 c := auxIntToInt64(v_0.AuxInt)
10849 if !(!math.IsNaN(math.Float64frombits(uint64(c)))) {
10852 v.reset(OpPPC64FMOVDconst)
10853 v.AuxInt = float64ToAuxInt(math.Float64frombits(uint64(c)))
10856 // match: (MTVSRD x:(MOVDload [off] {sym} ptr mem))
10857 // cond: x.Uses == 1 && clobber(x)
10858 // result: @x.Block (FMOVDload [off] {sym} ptr mem)
10861 if x.Op != OpPPC64MOVDload {
10864 off := auxIntToInt32(x.AuxInt)
10865 sym := auxToSym(x.Aux)
10868 if !(x.Uses == 1 && clobber(x)) {
10872 v0 := b.NewValue0(x.Pos, OpPPC64FMOVDload, typ.Float64)
10874 v0.AuxInt = int32ToAuxInt(off)
10875 v0.Aux = symToAux(sym)
10876 v0.AddArg2(ptr, mem)
10881 func rewriteValuePPC64_OpPPC64MULLD(v *Value) bool {
10884 // match: (MULLD x (MOVDconst [c]))
10885 // cond: is16Bit(c)
10886 // result: (MULLDconst [int32(c)] x)
10888 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10890 if v_1.Op != OpPPC64MOVDconst {
10893 c := auxIntToInt64(v_1.AuxInt)
10897 v.reset(OpPPC64MULLDconst)
10898 v.AuxInt = int32ToAuxInt(int32(c))
10906 func rewriteValuePPC64_OpPPC64MULLW(v *Value) bool {
10909 // match: (MULLW x (MOVDconst [c]))
10910 // cond: is16Bit(c)
10911 // result: (MULLWconst [int32(c)] x)
10913 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10915 if v_1.Op != OpPPC64MOVDconst {
10918 c := auxIntToInt64(v_1.AuxInt)
10922 v.reset(OpPPC64MULLWconst)
10923 v.AuxInt = int32ToAuxInt(int32(c))
10931 func rewriteValuePPC64_OpPPC64NEG(v *Value) bool {
10933 // match: (NEG (ADDconst [c] x))
10934 // cond: is32Bit(-c)
10935 // result: (SUBFCconst [-c] x)
10937 if v_0.Op != OpPPC64ADDconst {
10940 c := auxIntToInt64(v_0.AuxInt)
10942 if !(is32Bit(-c)) {
10945 v.reset(OpPPC64SUBFCconst)
10946 v.AuxInt = int64ToAuxInt(-c)
10950 // match: (NEG (SUBFCconst [c] x))
10951 // cond: is32Bit(-c)
10952 // result: (ADDconst [-c] x)
10954 if v_0.Op != OpPPC64SUBFCconst {
10957 c := auxIntToInt64(v_0.AuxInt)
10959 if !(is32Bit(-c)) {
10962 v.reset(OpPPC64ADDconst)
10963 v.AuxInt = int64ToAuxInt(-c)
10967 // match: (NEG (SUB x y))
10968 // result: (SUB y x)
10970 if v_0.Op != OpPPC64SUB {
10975 v.reset(OpPPC64SUB)
10979 // match: (NEG (NEG x))
10982 if v_0.Op != OpPPC64NEG {
10991 func rewriteValuePPC64_OpPPC64NOR(v *Value) bool {
10994 // match: (NOR (MOVDconst [c]) (MOVDconst [d]))
10995 // result: (MOVDconst [^(c|d)])
10997 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10998 if v_0.Op != OpPPC64MOVDconst {
11001 c := auxIntToInt64(v_0.AuxInt)
11002 if v_1.Op != OpPPC64MOVDconst {
11005 d := auxIntToInt64(v_1.AuxInt)
11006 v.reset(OpPPC64MOVDconst)
11007 v.AuxInt = int64ToAuxInt(^(c | d))
11014 func rewriteValuePPC64_OpPPC64NotEqual(v *Value) bool {
11016 // match: (NotEqual (FlagEQ))
11017 // result: (MOVDconst [0])
11019 if v_0.Op != OpPPC64FlagEQ {
11022 v.reset(OpPPC64MOVDconst)
11023 v.AuxInt = int64ToAuxInt(0)
11026 // match: (NotEqual (FlagLT))
11027 // result: (MOVDconst [1])
11029 if v_0.Op != OpPPC64FlagLT {
11032 v.reset(OpPPC64MOVDconst)
11033 v.AuxInt = int64ToAuxInt(1)
11036 // match: (NotEqual (FlagGT))
11037 // result: (MOVDconst [1])
11039 if v_0.Op != OpPPC64FlagGT {
11042 v.reset(OpPPC64MOVDconst)
11043 v.AuxInt = int64ToAuxInt(1)
11046 // match: (NotEqual (InvertFlags x))
11047 // result: (NotEqual x)
11049 if v_0.Op != OpPPC64InvertFlags {
11053 v.reset(OpPPC64NotEqual)
11057 // match: (NotEqual cmp)
11058 // result: (SETBCR [2] cmp)
11061 v.reset(OpPPC64SETBCR)
11062 v.AuxInt = int32ToAuxInt(2)
11067 func rewriteValuePPC64_OpPPC64OR(v *Value) bool {
11070 // match: (OR x (NOR y y))
11071 // result: (ORN x y)
11073 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11075 if v_1.Op != OpPPC64NOR {
11079 if y != v_1.Args[0] {
11082 v.reset(OpPPC64ORN)
11088 // match: (OR (MOVDconst [c]) (MOVDconst [d]))
11089 // result: (MOVDconst [c|d])
11091 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11092 if v_0.Op != OpPPC64MOVDconst {
11095 c := auxIntToInt64(v_0.AuxInt)
11096 if v_1.Op != OpPPC64MOVDconst {
11099 d := auxIntToInt64(v_1.AuxInt)
11100 v.reset(OpPPC64MOVDconst)
11101 v.AuxInt = int64ToAuxInt(c | d)
11106 // match: (OR x (MOVDconst [c]))
11107 // cond: isU32Bit(c)
11108 // result: (ORconst [c] x)
11110 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11112 if v_1.Op != OpPPC64MOVDconst {
11115 c := auxIntToInt64(v_1.AuxInt)
11116 if !(isU32Bit(c)) {
11119 v.reset(OpPPC64ORconst)
11120 v.AuxInt = int64ToAuxInt(c)
11128 func rewriteValuePPC64_OpPPC64ORN(v *Value) bool {
11131 // match: (ORN x (MOVDconst [-1]))
11135 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
11141 // match: (ORN (MOVDconst [c]) (MOVDconst [d]))
11142 // result: (MOVDconst [c|^d])
11144 if v_0.Op != OpPPC64MOVDconst {
11147 c := auxIntToInt64(v_0.AuxInt)
11148 if v_1.Op != OpPPC64MOVDconst {
11151 d := auxIntToInt64(v_1.AuxInt)
11152 v.reset(OpPPC64MOVDconst)
11153 v.AuxInt = int64ToAuxInt(c | ^d)
11158 func rewriteValuePPC64_OpPPC64ORconst(v *Value) bool {
11160 // match: (ORconst [c] (ORconst [d] x))
11161 // result: (ORconst [c|d] x)
11163 c := auxIntToInt64(v.AuxInt)
11164 if v_0.Op != OpPPC64ORconst {
11167 d := auxIntToInt64(v_0.AuxInt)
11169 v.reset(OpPPC64ORconst)
11170 v.AuxInt = int64ToAuxInt(c | d)
11174 // match: (ORconst [-1] _)
11175 // result: (MOVDconst [-1])
11177 if auxIntToInt64(v.AuxInt) != -1 {
11180 v.reset(OpPPC64MOVDconst)
11181 v.AuxInt = int64ToAuxInt(-1)
11184 // match: (ORconst [0] x)
11187 if auxIntToInt64(v.AuxInt) != 0 {
11196 func rewriteValuePPC64_OpPPC64ROTL(v *Value) bool {
11199 // match: (ROTL x (MOVDconst [c]))
11200 // result: (ROTLconst x [c&63])
11203 if v_1.Op != OpPPC64MOVDconst {
11206 c := auxIntToInt64(v_1.AuxInt)
11207 v.reset(OpPPC64ROTLconst)
11208 v.AuxInt = int64ToAuxInt(c & 63)
11214 func rewriteValuePPC64_OpPPC64ROTLW(v *Value) bool {
11217 // match: (ROTLW x (MOVDconst [c]))
11218 // result: (ROTLWconst x [c&31])
11221 if v_1.Op != OpPPC64MOVDconst {
11224 c := auxIntToInt64(v_1.AuxInt)
11225 v.reset(OpPPC64ROTLWconst)
11226 v.AuxInt = int64ToAuxInt(c & 31)
11232 func rewriteValuePPC64_OpPPC64ROTLWconst(v *Value) bool {
11234 // match: (ROTLWconst [r] (AND (MOVDconst [m]) x))
11235 // cond: isPPC64WordRotateMask(m)
11236 // result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
11238 r := auxIntToInt64(v.AuxInt)
11239 if v_0.Op != OpPPC64AND {
11243 v_0_0 := v_0.Args[0]
11244 v_0_1 := v_0.Args[1]
11245 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
11246 if v_0_0.Op != OpPPC64MOVDconst {
11249 m := auxIntToInt64(v_0_0.AuxInt)
11251 if !(isPPC64WordRotateMask(m)) {
11254 v.reset(OpPPC64RLWINM)
11255 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
11261 // match: (ROTLWconst [r] (Select0 (ANDCCconst [m] x)))
11262 // cond: isPPC64WordRotateMask(m)
11263 // result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
11265 r := auxIntToInt64(v.AuxInt)
11266 if v_0.Op != OpSelect0 {
11269 v_0_0 := v_0.Args[0]
11270 if v_0_0.Op != OpPPC64ANDCCconst {
11273 m := auxIntToInt64(v_0_0.AuxInt)
11275 if !(isPPC64WordRotateMask(m)) {
11278 v.reset(OpPPC64RLWINM)
11279 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
11285 func rewriteValuePPC64_OpPPC64SETBC(v *Value) bool {
11288 typ := &b.Func.Config.Types
11289 // match: (SETBC [0] (FlagLT))
11290 // result: (MOVDconst [1])
11292 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
11295 v.reset(OpPPC64MOVDconst)
11296 v.AuxInt = int64ToAuxInt(1)
11299 // match: (SETBC [0] (FlagGT))
11300 // result: (MOVDconst [0])
11302 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
11305 v.reset(OpPPC64MOVDconst)
11306 v.AuxInt = int64ToAuxInt(0)
11309 // match: (SETBC [0] (FlagEQ))
11310 // result: (MOVDconst [0])
11312 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
11315 v.reset(OpPPC64MOVDconst)
11316 v.AuxInt = int64ToAuxInt(0)
11319 // match: (SETBC [1] (FlagGT))
11320 // result: (MOVDconst [1])
11322 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
11325 v.reset(OpPPC64MOVDconst)
11326 v.AuxInt = int64ToAuxInt(1)
11329 // match: (SETBC [1] (FlagLT))
11330 // result: (MOVDconst [0])
11332 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
11335 v.reset(OpPPC64MOVDconst)
11336 v.AuxInt = int64ToAuxInt(0)
11339 // match: (SETBC [1] (FlagEQ))
11340 // result: (MOVDconst [0])
11342 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
11345 v.reset(OpPPC64MOVDconst)
11346 v.AuxInt = int64ToAuxInt(0)
11349 // match: (SETBC [2] (FlagEQ))
11350 // result: (MOVDconst [1])
11352 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
11355 v.reset(OpPPC64MOVDconst)
11356 v.AuxInt = int64ToAuxInt(1)
11359 // match: (SETBC [2] (FlagLT))
11360 // result: (MOVDconst [0])
11362 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
11365 v.reset(OpPPC64MOVDconst)
11366 v.AuxInt = int64ToAuxInt(0)
11369 // match: (SETBC [2] (FlagGT))
11370 // result: (MOVDconst [0])
11372 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
11375 v.reset(OpPPC64MOVDconst)
11376 v.AuxInt = int64ToAuxInt(0)
11379 // match: (SETBC [0] (InvertFlags bool))
11380 // result: (SETBC [1] bool)
11382 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
11385 bool := v_0.Args[0]
11386 v.reset(OpPPC64SETBC)
11387 v.AuxInt = int32ToAuxInt(1)
11391 // match: (SETBC [1] (InvertFlags bool))
11392 // result: (SETBC [0] bool)
11394 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
11397 bool := v_0.Args[0]
11398 v.reset(OpPPC64SETBC)
11399 v.AuxInt = int32ToAuxInt(0)
11403 // match: (SETBC [2] (InvertFlags bool))
11404 // result: (SETBC [2] bool)
11406 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
11409 bool := v_0.Args[0]
11410 v.reset(OpPPC64SETBC)
11411 v.AuxInt = int32ToAuxInt(2)
11415 // match: (SETBC [n] (InvertFlags bool))
11416 // result: (SETBCR [n] bool)
11418 n := auxIntToInt32(v.AuxInt)
11419 if v_0.Op != OpPPC64InvertFlags {
11422 bool := v_0.Args[0]
11423 v.reset(OpPPC64SETBCR)
11424 v.AuxInt = int32ToAuxInt(n)
11428 // match: (SETBC [2] (CMPconst [0] (Select0 (ANDCCconst [1] z))))
11429 // result: (XORconst [1] (Select0 <typ.UInt64> (ANDCCconst [1] z )))
11431 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
11434 v_0_0 := v_0.Args[0]
11435 if v_0_0.Op != OpSelect0 {
11438 v_0_0_0 := v_0_0.Args[0]
11439 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
11442 z := v_0_0_0.Args[0]
11443 v.reset(OpPPC64XORconst)
11444 v.AuxInt = int64ToAuxInt(1)
11445 v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
11446 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
11447 v1.AuxInt = int64ToAuxInt(1)
11453 // match: (SETBC [2] (CMPWconst [0] (Select0 (ANDCCconst [1] z))))
11454 // result: (XORconst [1] (Select0 <typ.UInt64> (ANDCCconst [1] z )))
11456 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
11459 v_0_0 := v_0.Args[0]
11460 if v_0_0.Op != OpSelect0 {
11463 v_0_0_0 := v_0_0.Args[0]
11464 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
11467 z := v_0_0_0.Args[0]
11468 v.reset(OpPPC64XORconst)
11469 v.AuxInt = int64ToAuxInt(1)
11470 v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
11471 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
11472 v1.AuxInt = int64ToAuxInt(1)
11478 // match: (SETBC [2] (CMPWconst [0] (Select0 (ANDCCconst [n] z))))
11479 // result: (SETBC [2] (Select1 <types.TypeFlags> (ANDCCconst [n] z )))
11481 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
11484 v_0_0 := v_0.Args[0]
11485 if v_0_0.Op != OpSelect0 {
11488 v_0_0_0 := v_0_0.Args[0]
11489 if v_0_0_0.Op != OpPPC64ANDCCconst {
11492 n := auxIntToInt64(v_0_0_0.AuxInt)
11493 z := v_0_0_0.Args[0]
11494 v.reset(OpPPC64SETBC)
11495 v.AuxInt = int32ToAuxInt(2)
11496 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11497 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
11498 v1.AuxInt = int64ToAuxInt(n)
11504 // match: (SETBC [2] (CMPconst [0] a:(AND y z)))
11505 // cond: a.Uses == 1
11506 // result: (SETBC [2] (Select1 <types.TypeFlags> (ANDCC y z )))
11508 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
11512 if a.Op != OpPPC64AND {
11517 if !(a.Uses == 1) {
11520 v.reset(OpPPC64SETBC)
11521 v.AuxInt = int32ToAuxInt(2)
11522 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11523 v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
11529 // match: (SETBC [2] (CMPconst [0] o:(OR y z)))
11530 // cond: o.Uses == 1
11531 // result: (SETBC [2] (Select1 <types.TypeFlags> (ORCC y z )))
11533 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
11537 if o.Op != OpPPC64OR {
11542 if !(o.Uses == 1) {
11545 v.reset(OpPPC64SETBC)
11546 v.AuxInt = int32ToAuxInt(2)
11547 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11548 v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
11554 // match: (SETBC [2] (CMPconst [0] a:(XOR y z)))
11555 // cond: a.Uses == 1
11556 // result: (SETBC [2] (Select1 <types.TypeFlags> (XORCC y z )))
11558 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
11562 if a.Op != OpPPC64XOR {
11567 if !(a.Uses == 1) {
11570 v.reset(OpPPC64SETBC)
11571 v.AuxInt = int32ToAuxInt(2)
11572 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11573 v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
11581 func rewriteValuePPC64_OpPPC64SETBCR(v *Value) bool {
11584 typ := &b.Func.Config.Types
11585 // match: (SETBCR [0] (FlagLT))
11586 // result: (MOVDconst [0])
11588 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
11591 v.reset(OpPPC64MOVDconst)
11592 v.AuxInt = int64ToAuxInt(0)
11595 // match: (SETBCR [0] (FlagGT))
11596 // result: (MOVDconst [1])
11598 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
11601 v.reset(OpPPC64MOVDconst)
11602 v.AuxInt = int64ToAuxInt(1)
11605 // match: (SETBCR [0] (FlagEQ))
11606 // result: (MOVDconst [1])
11608 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
11611 v.reset(OpPPC64MOVDconst)
11612 v.AuxInt = int64ToAuxInt(1)
11615 // match: (SETBCR [1] (FlagGT))
11616 // result: (MOVDconst [0])
11618 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
11621 v.reset(OpPPC64MOVDconst)
11622 v.AuxInt = int64ToAuxInt(0)
11625 // match: (SETBCR [1] (FlagLT))
11626 // result: (MOVDconst [1])
11628 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
11631 v.reset(OpPPC64MOVDconst)
11632 v.AuxInt = int64ToAuxInt(1)
11635 // match: (SETBCR [1] (FlagEQ))
11636 // result: (MOVDconst [1])
11638 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
11641 v.reset(OpPPC64MOVDconst)
11642 v.AuxInt = int64ToAuxInt(1)
11645 // match: (SETBCR [2] (FlagEQ))
11646 // result: (MOVDconst [0])
11648 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
11651 v.reset(OpPPC64MOVDconst)
11652 v.AuxInt = int64ToAuxInt(0)
11655 // match: (SETBCR [2] (FlagLT))
11656 // result: (MOVDconst [1])
11658 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
11661 v.reset(OpPPC64MOVDconst)
11662 v.AuxInt = int64ToAuxInt(1)
11665 // match: (SETBCR [2] (FlagGT))
11666 // result: (MOVDconst [1])
11668 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
11671 v.reset(OpPPC64MOVDconst)
11672 v.AuxInt = int64ToAuxInt(1)
11675 // match: (SETBCR [0] (InvertFlags bool))
11676 // result: (SETBCR [1] bool)
11678 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
11681 bool := v_0.Args[0]
11682 v.reset(OpPPC64SETBCR)
11683 v.AuxInt = int32ToAuxInt(1)
11687 // match: (SETBCR [1] (InvertFlags bool))
11688 // result: (SETBCR [0] bool)
11690 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
11693 bool := v_0.Args[0]
11694 v.reset(OpPPC64SETBCR)
11695 v.AuxInt = int32ToAuxInt(0)
11699 // match: (SETBCR [2] (InvertFlags bool))
11700 // result: (SETBCR [2] bool)
11702 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
11705 bool := v_0.Args[0]
11706 v.reset(OpPPC64SETBCR)
11707 v.AuxInt = int32ToAuxInt(2)
11711 // match: (SETBCR [n] (InvertFlags bool))
11712 // result: (SETBC [n] bool)
11714 n := auxIntToInt32(v.AuxInt)
11715 if v_0.Op != OpPPC64InvertFlags {
11718 bool := v_0.Args[0]
11719 v.reset(OpPPC64SETBC)
11720 v.AuxInt = int32ToAuxInt(n)
11724 // match: (SETBCR [2] (CMPconst [0] (Select0 (ANDCCconst [1] z))))
11725 // result: (Select0 <typ.UInt64> (ANDCCconst [1] z ))
11727 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
11730 v_0_0 := v_0.Args[0]
11731 if v_0_0.Op != OpSelect0 {
11734 v_0_0_0 := v_0_0.Args[0]
11735 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
11738 z := v_0_0_0.Args[0]
11740 v.Type = typ.UInt64
11741 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
11742 v0.AuxInt = int64ToAuxInt(1)
11747 // match: (SETBCR [2] (CMPWconst [0] (Select0 (ANDCCconst [1] z))))
11748 // result: (Select0 <typ.UInt64> (ANDCCconst [1] z ))
11750 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
11753 v_0_0 := v_0.Args[0]
11754 if v_0_0.Op != OpSelect0 {
11757 v_0_0_0 := v_0_0.Args[0]
11758 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
11761 z := v_0_0_0.Args[0]
11763 v.Type = typ.UInt64
11764 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
11765 v0.AuxInt = int64ToAuxInt(1)
11770 // match: (SETBCR [2] (CMPWconst [0] (Select0 (ANDCCconst [n] z))))
11771 // result: (SETBCR [2] (Select1 <types.TypeFlags> (ANDCCconst [n] z )))
11773 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
11776 v_0_0 := v_0.Args[0]
11777 if v_0_0.Op != OpSelect0 {
11780 v_0_0_0 := v_0_0.Args[0]
11781 if v_0_0_0.Op != OpPPC64ANDCCconst {
11784 n := auxIntToInt64(v_0_0_0.AuxInt)
11785 z := v_0_0_0.Args[0]
11786 v.reset(OpPPC64SETBCR)
11787 v.AuxInt = int32ToAuxInt(2)
11788 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11789 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
11790 v1.AuxInt = int64ToAuxInt(n)
11796 // match: (SETBCR [2] (CMPconst [0] a:(AND y z)))
11797 // cond: a.Uses == 1
11798 // result: (SETBCR [2] (Select1 <types.TypeFlags> (ANDCC y z )))
11800 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
11804 if a.Op != OpPPC64AND {
11809 if !(a.Uses == 1) {
11812 v.reset(OpPPC64SETBCR)
11813 v.AuxInt = int32ToAuxInt(2)
11814 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11815 v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
11821 // match: (SETBCR [2] (CMPconst [0] o:(OR y z)))
11822 // cond: o.Uses == 1
11823 // result: (SETBCR [2] (Select1 <types.TypeFlags> (ORCC y z )))
11825 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
11829 if o.Op != OpPPC64OR {
11834 if !(o.Uses == 1) {
11837 v.reset(OpPPC64SETBCR)
11838 v.AuxInt = int32ToAuxInt(2)
11839 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11840 v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
11846 // match: (SETBCR [2] (CMPconst [0] a:(XOR y z)))
11847 // cond: a.Uses == 1
11848 // result: (SETBCR [2] (Select1 <types.TypeFlags> (XORCC y z )))
11850 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
11854 if a.Op != OpPPC64XOR {
11859 if !(a.Uses == 1) {
11862 v.reset(OpPPC64SETBCR)
11863 v.AuxInt = int32ToAuxInt(2)
11864 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11865 v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
11873 func rewriteValuePPC64_OpPPC64SLD(v *Value) bool {
11876 // match: (SLD x (MOVDconst [c]))
11877 // result: (SLDconst [c&63 | (c>>6&1*63)] x)
11880 if v_1.Op != OpPPC64MOVDconst {
11883 c := auxIntToInt64(v_1.AuxInt)
11884 v.reset(OpPPC64SLDconst)
11885 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
11891 func rewriteValuePPC64_OpPPC64SLDconst(v *Value) bool {
11893 // match: (SLDconst [l] (SRWconst [r] x))
11894 // cond: mergePPC64SldiSrw(l,r) != 0
11895 // result: (RLWINM [mergePPC64SldiSrw(l,r)] x)
11897 l := auxIntToInt64(v.AuxInt)
11898 if v_0.Op != OpPPC64SRWconst {
11901 r := auxIntToInt64(v_0.AuxInt)
11903 if !(mergePPC64SldiSrw(l, r) != 0) {
11906 v.reset(OpPPC64RLWINM)
11907 v.AuxInt = int64ToAuxInt(mergePPC64SldiSrw(l, r))
11911 // match: (SLDconst [c] z:(MOVBZreg x))
11912 // cond: c < 8 && z.Uses == 1
11913 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,56,63,64)] x)
11915 c := auxIntToInt64(v.AuxInt)
11917 if z.Op != OpPPC64MOVBZreg {
11921 if !(c < 8 && z.Uses == 1) {
11924 v.reset(OpPPC64CLRLSLDI)
11925 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 56, 63, 64))
11929 // match: (SLDconst [c] z:(MOVHZreg x))
11930 // cond: c < 16 && z.Uses == 1
11931 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,48,63,64)] x)
11933 c := auxIntToInt64(v.AuxInt)
11935 if z.Op != OpPPC64MOVHZreg {
11939 if !(c < 16 && z.Uses == 1) {
11942 v.reset(OpPPC64CLRLSLDI)
11943 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 48, 63, 64))
11947 // match: (SLDconst [c] z:(MOVWZreg x))
11948 // cond: c < 32 && z.Uses == 1
11949 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,32,63,64)] x)
11951 c := auxIntToInt64(v.AuxInt)
11953 if z.Op != OpPPC64MOVWZreg {
11957 if !(c < 32 && z.Uses == 1) {
11960 v.reset(OpPPC64CLRLSLDI)
11961 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32, 63, 64))
11965 // match: (SLDconst [c] z:(Select0 (ANDCCconst [d] x)))
11966 // cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))
11967 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
11969 c := auxIntToInt64(v.AuxInt)
11971 if z.Op != OpSelect0 {
11975 if z_0.Op != OpPPC64ANDCCconst {
11978 d := auxIntToInt64(z_0.AuxInt)
11980 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
11983 v.reset(OpPPC64CLRLSLDI)
11984 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
11988 // match: (SLDconst [c] z:(AND (MOVDconst [d]) x))
11989 // cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(64-getPPC64ShiftMaskLength(d))
11990 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
11992 c := auxIntToInt64(v.AuxInt)
11994 if z.Op != OpPPC64AND {
12000 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
12001 if z_0.Op != OpPPC64MOVDconst {
12004 d := auxIntToInt64(z_0.AuxInt)
12006 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
12009 v.reset(OpPPC64CLRLSLDI)
12010 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
12016 // match: (SLDconst [c] z:(MOVWreg x))
12017 // cond: c < 32 && buildcfg.GOPPC64 >= 9
12018 // result: (EXTSWSLconst [c] x)
12020 c := auxIntToInt64(v.AuxInt)
12022 if z.Op != OpPPC64MOVWreg {
12026 if !(c < 32 && buildcfg.GOPPC64 >= 9) {
12029 v.reset(OpPPC64EXTSWSLconst)
12030 v.AuxInt = int64ToAuxInt(c)
12036 func rewriteValuePPC64_OpPPC64SLW(v *Value) bool {
12039 // match: (SLW x (MOVDconst [c]))
12040 // result: (SLWconst [c&31 | (c>>5&1*31)] x)
12043 if v_1.Op != OpPPC64MOVDconst {
12046 c := auxIntToInt64(v_1.AuxInt)
12047 v.reset(OpPPC64SLWconst)
12048 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
12054 func rewriteValuePPC64_OpPPC64SLWconst(v *Value) bool {
12056 // match: (SLWconst [c] z:(MOVBZreg x))
12057 // cond: z.Uses == 1 && c < 8
12058 // result: (CLRLSLWI [newPPC64ShiftAuxInt(c,24,31,32)] x)
12060 c := auxIntToInt64(v.AuxInt)
12062 if z.Op != OpPPC64MOVBZreg {
12066 if !(z.Uses == 1 && c < 8) {
12069 v.reset(OpPPC64CLRLSLWI)
12070 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 24, 31, 32))
12074 // match: (SLWconst [c] z:(MOVHZreg x))
12075 // cond: z.Uses == 1 && c < 16
12076 // result: (CLRLSLWI [newPPC64ShiftAuxInt(c,16,31,32)] x)
12078 c := auxIntToInt64(v.AuxInt)
12080 if z.Op != OpPPC64MOVHZreg {
12084 if !(z.Uses == 1 && c < 16) {
12087 v.reset(OpPPC64CLRLSLWI)
12088 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 16, 31, 32))
12092 // match: (SLWconst [c] z:(Select0 (ANDCCconst [d] x)))
12093 // cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
12094 // result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
12096 c := auxIntToInt64(v.AuxInt)
12098 if z.Op != OpSelect0 {
12102 if z_0.Op != OpPPC64ANDCCconst {
12105 d := auxIntToInt64(z_0.AuxInt)
12107 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
12110 v.reset(OpPPC64CLRLSLWI)
12111 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
12115 // match: (SLWconst [c] z:(AND (MOVDconst [d]) x))
12116 // cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
12117 // result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
12119 c := auxIntToInt64(v.AuxInt)
12121 if z.Op != OpPPC64AND {
12127 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
12128 if z_0.Op != OpPPC64MOVDconst {
12131 d := auxIntToInt64(z_0.AuxInt)
12133 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
12136 v.reset(OpPPC64CLRLSLWI)
12137 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
12143 // match: (SLWconst [c] z:(MOVWreg x))
12144 // cond: c < 32 && buildcfg.GOPPC64 >= 9
12145 // result: (EXTSWSLconst [c] x)
12147 c := auxIntToInt64(v.AuxInt)
12149 if z.Op != OpPPC64MOVWreg {
12153 if !(c < 32 && buildcfg.GOPPC64 >= 9) {
12156 v.reset(OpPPC64EXTSWSLconst)
12157 v.AuxInt = int64ToAuxInt(c)
12163 func rewriteValuePPC64_OpPPC64SRAD(v *Value) bool {
12166 // match: (SRAD x (MOVDconst [c]))
12167 // result: (SRADconst [c&63 | (c>>6&1*63)] x)
12170 if v_1.Op != OpPPC64MOVDconst {
12173 c := auxIntToInt64(v_1.AuxInt)
12174 v.reset(OpPPC64SRADconst)
12175 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
12181 func rewriteValuePPC64_OpPPC64SRAW(v *Value) bool {
12184 // match: (SRAW x (MOVDconst [c]))
12185 // result: (SRAWconst [c&31 | (c>>5&1*31)] x)
12188 if v_1.Op != OpPPC64MOVDconst {
12191 c := auxIntToInt64(v_1.AuxInt)
12192 v.reset(OpPPC64SRAWconst)
12193 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
12199 func rewriteValuePPC64_OpPPC64SRD(v *Value) bool {
12202 // match: (SRD x (MOVDconst [c]))
12203 // result: (SRDconst [c&63 | (c>>6&1*63)] x)
12206 if v_1.Op != OpPPC64MOVDconst {
12209 c := auxIntToInt64(v_1.AuxInt)
12210 v.reset(OpPPC64SRDconst)
12211 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
12217 func rewriteValuePPC64_OpPPC64SRW(v *Value) bool {
12220 // match: (SRW x (MOVDconst [c]))
12221 // result: (SRWconst [c&31 | (c>>5&1*31)] x)
12224 if v_1.Op != OpPPC64MOVDconst {
12227 c := auxIntToInt64(v_1.AuxInt)
12228 v.reset(OpPPC64SRWconst)
12229 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
12235 func rewriteValuePPC64_OpPPC64SRWconst(v *Value) bool {
12237 // match: (SRWconst (Select0 (ANDCCconst [m] x)) [s])
12238 // cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
12239 // result: (MOVDconst [0])
12241 s := auxIntToInt64(v.AuxInt)
12242 if v_0.Op != OpSelect0 {
12245 v_0_0 := v_0.Args[0]
12246 if v_0_0.Op != OpPPC64ANDCCconst {
12249 m := auxIntToInt64(v_0_0.AuxInt)
12250 if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
12253 v.reset(OpPPC64MOVDconst)
12254 v.AuxInt = int64ToAuxInt(0)
12257 // match: (SRWconst (Select0 (ANDCCconst [m] x)) [s])
12258 // cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
12259 // result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
12261 s := auxIntToInt64(v.AuxInt)
12262 if v_0.Op != OpSelect0 {
12265 v_0_0 := v_0.Args[0]
12266 if v_0_0.Op != OpPPC64ANDCCconst {
12269 m := auxIntToInt64(v_0_0.AuxInt)
12271 if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
12274 v.reset(OpPPC64RLWINM)
12275 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
12279 // match: (SRWconst (AND (MOVDconst [m]) x) [s])
12280 // cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
12281 // result: (MOVDconst [0])
12283 s := auxIntToInt64(v.AuxInt)
12284 if v_0.Op != OpPPC64AND {
12288 v_0_0 := v_0.Args[0]
12289 v_0_1 := v_0.Args[1]
12290 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
12291 if v_0_0.Op != OpPPC64MOVDconst {
12294 m := auxIntToInt64(v_0_0.AuxInt)
12295 if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
12298 v.reset(OpPPC64MOVDconst)
12299 v.AuxInt = int64ToAuxInt(0)
12304 // match: (SRWconst (AND (MOVDconst [m]) x) [s])
12305 // cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
12306 // result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
12308 s := auxIntToInt64(v.AuxInt)
12309 if v_0.Op != OpPPC64AND {
12313 v_0_0 := v_0.Args[0]
12314 v_0_1 := v_0.Args[1]
12315 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
12316 if v_0_0.Op != OpPPC64MOVDconst {
12319 m := auxIntToInt64(v_0_0.AuxInt)
12321 if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
12324 v.reset(OpPPC64RLWINM)
12325 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
12333 func rewriteValuePPC64_OpPPC64SUB(v *Value) bool {
12336 // match: (SUB x (MOVDconst [c]))
12337 // cond: is32Bit(-c)
12338 // result: (ADDconst [-c] x)
12341 if v_1.Op != OpPPC64MOVDconst {
12344 c := auxIntToInt64(v_1.AuxInt)
12345 if !(is32Bit(-c)) {
12348 v.reset(OpPPC64ADDconst)
12349 v.AuxInt = int64ToAuxInt(-c)
12353 // match: (SUB (MOVDconst [c]) x)
12354 // cond: is32Bit(c)
12355 // result: (SUBFCconst [c] x)
12357 if v_0.Op != OpPPC64MOVDconst {
12360 c := auxIntToInt64(v_0.AuxInt)
12365 v.reset(OpPPC64SUBFCconst)
12366 v.AuxInt = int64ToAuxInt(c)
12372 func rewriteValuePPC64_OpPPC64SUBE(v *Value) bool {
12377 typ := &b.Func.Config.Types
12378 // match: (SUBE x y (Select1 <typ.UInt64> (SUBCconst (MOVDconst [0]) [0])))
12379 // result: (SUBC x y)
12383 if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
12386 v_2_0 := v_2.Args[0]
12387 if v_2_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_2_0.AuxInt) != 0 {
12390 v_2_0_0 := v_2_0.Args[0]
12391 if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
12394 v.reset(OpPPC64SUBC)
12400 func rewriteValuePPC64_OpPPC64SUBFCconst(v *Value) bool {
12402 // match: (SUBFCconst [c] (NEG x))
12403 // result: (ADDconst [c] x)
12405 c := auxIntToInt64(v.AuxInt)
12406 if v_0.Op != OpPPC64NEG {
12410 v.reset(OpPPC64ADDconst)
12411 v.AuxInt = int64ToAuxInt(c)
12415 // match: (SUBFCconst [c] (SUBFCconst [d] x))
12416 // cond: is32Bit(c-d)
12417 // result: (ADDconst [c-d] x)
12419 c := auxIntToInt64(v.AuxInt)
12420 if v_0.Op != OpPPC64SUBFCconst {
12423 d := auxIntToInt64(v_0.AuxInt)
12425 if !(is32Bit(c - d)) {
12428 v.reset(OpPPC64ADDconst)
12429 v.AuxInt = int64ToAuxInt(c - d)
12433 // match: (SUBFCconst [0] x)
12436 if auxIntToInt64(v.AuxInt) != 0 {
12440 v.reset(OpPPC64NEG)
12446 func rewriteValuePPC64_OpPPC64XOR(v *Value) bool {
12449 // match: (XOR (MOVDconst [c]) (MOVDconst [d]))
12450 // result: (MOVDconst [c^d])
12452 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
12453 if v_0.Op != OpPPC64MOVDconst {
12456 c := auxIntToInt64(v_0.AuxInt)
12457 if v_1.Op != OpPPC64MOVDconst {
12460 d := auxIntToInt64(v_1.AuxInt)
12461 v.reset(OpPPC64MOVDconst)
12462 v.AuxInt = int64ToAuxInt(c ^ d)
12467 // match: (XOR x (MOVDconst [c]))
12468 // cond: isU32Bit(c)
12469 // result: (XORconst [c] x)
12471 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
12473 if v_1.Op != OpPPC64MOVDconst {
12476 c := auxIntToInt64(v_1.AuxInt)
12477 if !(isU32Bit(c)) {
12480 v.reset(OpPPC64XORconst)
12481 v.AuxInt = int64ToAuxInt(c)
12489 func rewriteValuePPC64_OpPPC64XORconst(v *Value) bool {
12491 // match: (XORconst [c] (XORconst [d] x))
12492 // result: (XORconst [c^d] x)
12494 c := auxIntToInt64(v.AuxInt)
12495 if v_0.Op != OpPPC64XORconst {
12498 d := auxIntToInt64(v_0.AuxInt)
12500 v.reset(OpPPC64XORconst)
12501 v.AuxInt = int64ToAuxInt(c ^ d)
12505 // match: (XORconst [0] x)
12508 if auxIntToInt64(v.AuxInt) != 0 {
12515 // match: (XORconst [1] (SETBCR [n] cmp))
12516 // result: (SETBC [n] cmp)
12518 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBCR {
12521 n := auxIntToInt32(v_0.AuxInt)
12523 v.reset(OpPPC64SETBC)
12524 v.AuxInt = int32ToAuxInt(n)
12528 // match: (XORconst [1] (SETBC [n] cmp))
12529 // result: (SETBCR [n] cmp)
12531 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBC {
12534 n := auxIntToInt32(v_0.AuxInt)
12536 v.reset(OpPPC64SETBCR)
12537 v.AuxInt = int32ToAuxInt(n)
12543 func rewriteValuePPC64_OpPanicBounds(v *Value) bool {
12547 // match: (PanicBounds [kind] x y mem)
12548 // cond: boundsABI(kind) == 0
12549 // result: (LoweredPanicBoundsA [kind] x y mem)
12551 kind := auxIntToInt64(v.AuxInt)
12555 if !(boundsABI(kind) == 0) {
12558 v.reset(OpPPC64LoweredPanicBoundsA)
12559 v.AuxInt = int64ToAuxInt(kind)
12560 v.AddArg3(x, y, mem)
12563 // match: (PanicBounds [kind] x y mem)
12564 // cond: boundsABI(kind) == 1
12565 // result: (LoweredPanicBoundsB [kind] x y mem)
12567 kind := auxIntToInt64(v.AuxInt)
12571 if !(boundsABI(kind) == 1) {
12574 v.reset(OpPPC64LoweredPanicBoundsB)
12575 v.AuxInt = int64ToAuxInt(kind)
12576 v.AddArg3(x, y, mem)
12579 // match: (PanicBounds [kind] x y mem)
12580 // cond: boundsABI(kind) == 2
12581 // result: (LoweredPanicBoundsC [kind] x y mem)
12583 kind := auxIntToInt64(v.AuxInt)
12587 if !(boundsABI(kind) == 2) {
12590 v.reset(OpPPC64LoweredPanicBoundsC)
12591 v.AuxInt = int64ToAuxInt(kind)
12592 v.AddArg3(x, y, mem)
12597 func rewriteValuePPC64_OpPopCount16(v *Value) bool {
12600 typ := &b.Func.Config.Types
12601 // match: (PopCount16 x)
12602 // result: (POPCNTW (MOVHZreg x))
12605 v.reset(OpPPC64POPCNTW)
12606 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12612 func rewriteValuePPC64_OpPopCount32(v *Value) bool {
12615 typ := &b.Func.Config.Types
12616 // match: (PopCount32 x)
12617 // result: (POPCNTW (MOVWZreg x))
12620 v.reset(OpPPC64POPCNTW)
12621 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
12627 func rewriteValuePPC64_OpPopCount8(v *Value) bool {
12630 typ := &b.Func.Config.Types
12631 // match: (PopCount8 x)
12632 // result: (POPCNTB (MOVBZreg x))
12635 v.reset(OpPPC64POPCNTB)
12636 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
12642 func rewriteValuePPC64_OpPrefetchCache(v *Value) bool {
12645 // match: (PrefetchCache ptr mem)
12646 // result: (DCBT ptr mem [0])
12650 v.reset(OpPPC64DCBT)
12651 v.AuxInt = int64ToAuxInt(0)
12652 v.AddArg2(ptr, mem)
12656 func rewriteValuePPC64_OpPrefetchCacheStreamed(v *Value) bool {
12659 // match: (PrefetchCacheStreamed ptr mem)
12660 // result: (DCBT ptr mem [16])
12664 v.reset(OpPPC64DCBT)
12665 v.AuxInt = int64ToAuxInt(16)
12666 v.AddArg2(ptr, mem)
12670 func rewriteValuePPC64_OpRotateLeft16(v *Value) bool {
12674 typ := &b.Func.Config.Types
12675 // match: (RotateLeft16 <t> x (MOVDconst [c]))
12676 // result: (Or16 (Lsh16x64 <t> x (MOVDconst [c&15])) (Rsh16Ux64 <t> x (MOVDconst [-c&15])))
12680 if v_1.Op != OpPPC64MOVDconst {
12683 c := auxIntToInt64(v_1.AuxInt)
12685 v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
12686 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
12687 v1.AuxInt = int64ToAuxInt(c & 15)
12689 v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
12690 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
12691 v3.AuxInt = int64ToAuxInt(-c & 15)
12698 func rewriteValuePPC64_OpRotateLeft8(v *Value) bool {
12702 typ := &b.Func.Config.Types
12703 // match: (RotateLeft8 <t> x (MOVDconst [c]))
12704 // result: (Or8 (Lsh8x64 <t> x (MOVDconst [c&7])) (Rsh8Ux64 <t> x (MOVDconst [-c&7])))
12708 if v_1.Op != OpPPC64MOVDconst {
12711 c := auxIntToInt64(v_1.AuxInt)
12713 v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
12714 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
12715 v1.AuxInt = int64ToAuxInt(c & 7)
12717 v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
12718 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
12719 v3.AuxInt = int64ToAuxInt(-c & 7)
12726 func rewriteValuePPC64_OpRsh16Ux16(v *Value) bool {
12730 typ := &b.Func.Config.Types
12731 // match: (Rsh16Ux16 x y)
12732 // cond: shiftIsBounded(v)
12733 // result: (SRD (MOVHZreg x) y)
12737 if !(shiftIsBounded(v)) {
12740 v.reset(OpPPC64SRD)
12741 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12746 // match: (Rsh16Ux16 <t> x y)
12747 // result: (ISEL [2] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF0] y)))
12752 v.reset(OpPPC64ISEL)
12753 v.AuxInt = int32ToAuxInt(2)
12754 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
12755 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12758 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
12759 v2.AuxInt = int64ToAuxInt(0)
12760 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12761 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
12762 v4.AuxInt = int64ToAuxInt(0xFFF0)
12765 v.AddArg3(v0, v2, v3)
12769 func rewriteValuePPC64_OpRsh16Ux32(v *Value) bool {
12773 typ := &b.Func.Config.Types
12774 // match: (Rsh16Ux32 x y)
12775 // cond: shiftIsBounded(v)
12776 // result: (SRD (MOVHZreg x) y)
12780 if !(shiftIsBounded(v)) {
12783 v.reset(OpPPC64SRD)
12784 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12789 // match: (Rsh16Ux32 <t> x y)
12790 // result: (ISEL [0] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [16]))
12795 v.reset(OpPPC64ISEL)
12796 v.AuxInt = int32ToAuxInt(0)
12797 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
12798 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12801 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
12802 v2.AuxInt = int64ToAuxInt(0)
12803 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
12804 v3.AuxInt = int32ToAuxInt(16)
12806 v.AddArg3(v0, v2, v3)
12810 func rewriteValuePPC64_OpRsh16Ux64(v *Value) bool {
12814 typ := &b.Func.Config.Types
12815 // match: (Rsh16Ux64 x (MOVDconst [c]))
12816 // cond: uint64(c) < 16
12817 // result: (SRWconst (ZeroExt16to32 x) [c])
12820 if v_1.Op != OpPPC64MOVDconst {
12823 c := auxIntToInt64(v_1.AuxInt)
12824 if !(uint64(c) < 16) {
12827 v.reset(OpPPC64SRWconst)
12828 v.AuxInt = int64ToAuxInt(c)
12829 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
12834 // match: (Rsh16Ux64 x y)
12835 // cond: shiftIsBounded(v)
12836 // result: (SRD (MOVHZreg x) y)
12840 if !(shiftIsBounded(v)) {
12843 v.reset(OpPPC64SRD)
12844 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12849 // match: (Rsh16Ux64 <t> x y)
12850 // result: (ISEL [0] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [16]))
12855 v.reset(OpPPC64ISEL)
12856 v.AuxInt = int32ToAuxInt(0)
12857 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
12858 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12861 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
12862 v2.AuxInt = int64ToAuxInt(0)
12863 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
12864 v3.AuxInt = int64ToAuxInt(16)
12866 v.AddArg3(v0, v2, v3)
12870 func rewriteValuePPC64_OpRsh16Ux8(v *Value) bool {
12874 typ := &b.Func.Config.Types
12875 // match: (Rsh16Ux8 x y)
12876 // cond: shiftIsBounded(v)
12877 // result: (SRD (MOVHZreg x) y)
12881 if !(shiftIsBounded(v)) {
12884 v.reset(OpPPC64SRD)
12885 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12890 // match: (Rsh16Ux8 <t> x y)
12891 // result: (ISEL [2] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F0] y)))
12896 v.reset(OpPPC64ISEL)
12897 v.AuxInt = int32ToAuxInt(2)
12898 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
12899 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12902 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
12903 v2.AuxInt = int64ToAuxInt(0)
12904 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12905 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
12906 v4.AuxInt = int64ToAuxInt(0x00F0)
12909 v.AddArg3(v0, v2, v3)
12913 func rewriteValuePPC64_OpRsh16x16(v *Value) bool {
12917 typ := &b.Func.Config.Types
12918 // match: (Rsh16x16 x y)
12919 // cond: shiftIsBounded(v)
12920 // result: (SRAD (MOVHreg x) y)
12924 if !(shiftIsBounded(v)) {
12927 v.reset(OpPPC64SRAD)
12928 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
12933 // match: (Rsh16x16 <t> x y)
12934 // result: (ISEL [2] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF0] y)))
12939 v.reset(OpPPC64ISEL)
12940 v.AuxInt = int32ToAuxInt(2)
12941 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
12942 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
12945 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
12946 v2.AuxInt = int64ToAuxInt(15)
12948 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12949 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
12950 v4.AuxInt = int64ToAuxInt(0xFFF0)
12953 v.AddArg3(v0, v2, v3)
12957 func rewriteValuePPC64_OpRsh16x32(v *Value) bool {
12961 typ := &b.Func.Config.Types
12962 // match: (Rsh16x32 x y)
12963 // cond: shiftIsBounded(v)
12964 // result: (SRAD (MOVHreg x) y)
12968 if !(shiftIsBounded(v)) {
12971 v.reset(OpPPC64SRAD)
12972 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
12977 // match: (Rsh16x32 <t> x y)
12978 // result: (ISEL [0] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPWUconst y [16]))
12983 v.reset(OpPPC64ISEL)
12984 v.AuxInt = int32ToAuxInt(0)
12985 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
12986 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
12989 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
12990 v2.AuxInt = int64ToAuxInt(15)
12992 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
12993 v3.AuxInt = int32ToAuxInt(16)
12995 v.AddArg3(v0, v2, v3)
12999 func rewriteValuePPC64_OpRsh16x64(v *Value) bool {
13003 typ := &b.Func.Config.Types
13004 // match: (Rsh16x64 x (MOVDconst [c]))
13005 // cond: uint64(c) >= 16
13006 // result: (SRAWconst (SignExt16to32 x) [63])
13009 if v_1.Op != OpPPC64MOVDconst {
13012 c := auxIntToInt64(v_1.AuxInt)
13013 if !(uint64(c) >= 16) {
13016 v.reset(OpPPC64SRAWconst)
13017 v.AuxInt = int64ToAuxInt(63)
13018 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
13023 // match: (Rsh16x64 x (MOVDconst [c]))
13024 // cond: uint64(c) < 16
13025 // result: (SRAWconst (SignExt16to32 x) [c])
13028 if v_1.Op != OpPPC64MOVDconst {
13031 c := auxIntToInt64(v_1.AuxInt)
13032 if !(uint64(c) < 16) {
13035 v.reset(OpPPC64SRAWconst)
13036 v.AuxInt = int64ToAuxInt(c)
13037 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
13042 // match: (Rsh16x64 x y)
13043 // cond: shiftIsBounded(v)
13044 // result: (SRAD (MOVHreg x) y)
13048 if !(shiftIsBounded(v)) {
13051 v.reset(OpPPC64SRAD)
13052 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13057 // match: (Rsh16x64 <t> x y)
13058 // result: (ISEL [0] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPUconst y [16]))
13063 v.reset(OpPPC64ISEL)
13064 v.AuxInt = int32ToAuxInt(0)
13065 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13066 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13069 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13070 v2.AuxInt = int64ToAuxInt(15)
13072 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13073 v3.AuxInt = int64ToAuxInt(16)
13075 v.AddArg3(v0, v2, v3)
13079 func rewriteValuePPC64_OpRsh16x8(v *Value) bool {
13083 typ := &b.Func.Config.Types
13084 // match: (Rsh16x8 x y)
13085 // cond: shiftIsBounded(v)
13086 // result: (SRAD (MOVHreg x) y)
13090 if !(shiftIsBounded(v)) {
13093 v.reset(OpPPC64SRAD)
13094 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13099 // match: (Rsh16x8 <t> x y)
13100 // result: (ISEL [2] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F0] y)))
13105 v.reset(OpPPC64ISEL)
13106 v.AuxInt = int32ToAuxInt(2)
13107 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13108 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13111 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13112 v2.AuxInt = int64ToAuxInt(15)
13114 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13115 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13116 v4.AuxInt = int64ToAuxInt(0x00F0)
13119 v.AddArg3(v0, v2, v3)
13123 func rewriteValuePPC64_OpRsh32Ux16(v *Value) bool {
13127 typ := &b.Func.Config.Types
13128 // match: (Rsh32Ux16 x y)
13129 // cond: shiftIsBounded(v)
13130 // result: (SRW x y)
13134 if !(shiftIsBounded(v)) {
13137 v.reset(OpPPC64SRW)
13141 // match: (Rsh32Ux16 <t> x y)
13142 // result: (ISEL [2] (SRW <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFE0] y)))
13147 v.reset(OpPPC64ISEL)
13148 v.AuxInt = int32ToAuxInt(2)
13149 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13151 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13152 v1.AuxInt = int64ToAuxInt(0)
13153 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13154 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13155 v3.AuxInt = int64ToAuxInt(0xFFE0)
13158 v.AddArg3(v0, v1, v2)
13162 func rewriteValuePPC64_OpRsh32Ux32(v *Value) bool {
13166 typ := &b.Func.Config.Types
13167 // match: (Rsh32Ux32 x y)
13168 // cond: shiftIsBounded(v)
13169 // result: (SRW x y)
13173 if !(shiftIsBounded(v)) {
13176 v.reset(OpPPC64SRW)
13180 // match: (Rsh32Ux32 <t> x y)
13181 // result: (ISEL [0] (SRW <t> x y) (MOVDconst [0]) (CMPWUconst y [32]))
13186 v.reset(OpPPC64ISEL)
13187 v.AuxInt = int32ToAuxInt(0)
13188 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13190 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13191 v1.AuxInt = int64ToAuxInt(0)
13192 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13193 v2.AuxInt = int32ToAuxInt(32)
13195 v.AddArg3(v0, v1, v2)
13199 func rewriteValuePPC64_OpRsh32Ux64(v *Value) bool {
13203 typ := &b.Func.Config.Types
13204 // match: (Rsh32Ux64 x (MOVDconst [c]))
13205 // cond: uint64(c) < 32
13206 // result: (SRWconst x [c])
13209 if v_1.Op != OpPPC64MOVDconst {
13212 c := auxIntToInt64(v_1.AuxInt)
13213 if !(uint64(c) < 32) {
13216 v.reset(OpPPC64SRWconst)
13217 v.AuxInt = int64ToAuxInt(c)
13221 // match: (Rsh32Ux64 x y)
13222 // cond: shiftIsBounded(v)
13223 // result: (SRW x y)
13227 if !(shiftIsBounded(v)) {
13230 v.reset(OpPPC64SRW)
13234 // match: (Rsh32Ux64 <t> x y)
13235 // result: (ISEL [0] (SRW <t> x y) (MOVDconst [0]) (CMPUconst y [32]))
13240 v.reset(OpPPC64ISEL)
13241 v.AuxInt = int32ToAuxInt(0)
13242 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13244 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13245 v1.AuxInt = int64ToAuxInt(0)
13246 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13247 v2.AuxInt = int64ToAuxInt(32)
13249 v.AddArg3(v0, v1, v2)
13253 func rewriteValuePPC64_OpRsh32Ux8(v *Value) bool {
13257 typ := &b.Func.Config.Types
13258 // match: (Rsh32Ux8 x y)
13259 // cond: shiftIsBounded(v)
13260 // result: (SRW x y)
13264 if !(shiftIsBounded(v)) {
13267 v.reset(OpPPC64SRW)
13271 // match: (Rsh32Ux8 <t> x y)
13272 // result: (ISEL [2] (SRW <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00E0] y)))
13277 v.reset(OpPPC64ISEL)
13278 v.AuxInt = int32ToAuxInt(2)
13279 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13281 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13282 v1.AuxInt = int64ToAuxInt(0)
13283 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13284 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13285 v3.AuxInt = int64ToAuxInt(0x00E0)
13288 v.AddArg3(v0, v1, v2)
13292 func rewriteValuePPC64_OpRsh32x16(v *Value) bool {
13296 typ := &b.Func.Config.Types
13297 // match: (Rsh32x16 x y)
13298 // cond: shiftIsBounded(v)
13299 // result: (SRAW x y)
13303 if !(shiftIsBounded(v)) {
13306 v.reset(OpPPC64SRAW)
13310 // match: (Rsh32x16 <t> x y)
13311 // result: (ISEL [2] (SRAW <t> x y) (SRAWconst <t> x [31]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFE0] y)))
13316 v.reset(OpPPC64ISEL)
13317 v.AuxInt = int32ToAuxInt(2)
13318 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
13320 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
13321 v1.AuxInt = int64ToAuxInt(31)
13323 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13324 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13325 v3.AuxInt = int64ToAuxInt(0xFFE0)
13328 v.AddArg3(v0, v1, v2)
13332 func rewriteValuePPC64_OpRsh32x32(v *Value) bool {
13336 // match: (Rsh32x32 x y)
13337 // cond: shiftIsBounded(v)
13338 // result: (SRAW x y)
13342 if !(shiftIsBounded(v)) {
13345 v.reset(OpPPC64SRAW)
13349 // match: (Rsh32x32 <t> x y)
13350 // result: (ISEL [0] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPWUconst y [32]))
13355 v.reset(OpPPC64ISEL)
13356 v.AuxInt = int32ToAuxInt(0)
13357 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
13359 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
13360 v1.AuxInt = int64ToAuxInt(31)
13362 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13363 v2.AuxInt = int32ToAuxInt(32)
13365 v.AddArg3(v0, v1, v2)
13369 func rewriteValuePPC64_OpRsh32x64(v *Value) bool {
13373 // match: (Rsh32x64 x (MOVDconst [c]))
13374 // cond: uint64(c) >= 32
13375 // result: (SRAWconst x [63])
13378 if v_1.Op != OpPPC64MOVDconst {
13381 c := auxIntToInt64(v_1.AuxInt)
13382 if !(uint64(c) >= 32) {
13385 v.reset(OpPPC64SRAWconst)
13386 v.AuxInt = int64ToAuxInt(63)
13390 // match: (Rsh32x64 x (MOVDconst [c]))
13391 // cond: uint64(c) < 32
13392 // result: (SRAWconst x [c])
13395 if v_1.Op != OpPPC64MOVDconst {
13398 c := auxIntToInt64(v_1.AuxInt)
13399 if !(uint64(c) < 32) {
13402 v.reset(OpPPC64SRAWconst)
13403 v.AuxInt = int64ToAuxInt(c)
13407 // match: (Rsh32x64 x y)
13408 // cond: shiftIsBounded(v)
13409 // result: (SRAW x y)
13413 if !(shiftIsBounded(v)) {
13416 v.reset(OpPPC64SRAW)
13420 // match: (Rsh32x64 <t> x y)
13421 // result: (ISEL [0] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPUconst y [32]))
13426 v.reset(OpPPC64ISEL)
13427 v.AuxInt = int32ToAuxInt(0)
13428 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
13430 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
13431 v1.AuxInt = int64ToAuxInt(31)
13433 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13434 v2.AuxInt = int64ToAuxInt(32)
13436 v.AddArg3(v0, v1, v2)
13440 func rewriteValuePPC64_OpRsh32x8(v *Value) bool {
13444 typ := &b.Func.Config.Types
13445 // match: (Rsh32x8 x y)
13446 // cond: shiftIsBounded(v)
13447 // result: (SRAW x y)
13451 if !(shiftIsBounded(v)) {
13454 v.reset(OpPPC64SRAW)
13458 // match: (Rsh32x8 <t> x y)
13459 // result: (ISEL [2] (SRAW <t> x y) (SRAWconst <t> x [31]) (Select1 <types.TypeFlags> (ANDCCconst [0x00E0] y)))
13464 v.reset(OpPPC64ISEL)
13465 v.AuxInt = int32ToAuxInt(2)
13466 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
13468 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
13469 v1.AuxInt = int64ToAuxInt(31)
13471 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13472 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13473 v3.AuxInt = int64ToAuxInt(0x00E0)
13476 v.AddArg3(v0, v1, v2)
13480 func rewriteValuePPC64_OpRsh64Ux16(v *Value) bool {
13484 typ := &b.Func.Config.Types
13485 // match: (Rsh64Ux16 x y)
13486 // cond: shiftIsBounded(v)
13487 // result: (SRD x y)
13491 if !(shiftIsBounded(v)) {
13494 v.reset(OpPPC64SRD)
13498 // match: (Rsh64Ux16 <t> x y)
13499 // result: (ISEL [2] (SRD <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFC0] y)))
13504 v.reset(OpPPC64ISEL)
13505 v.AuxInt = int32ToAuxInt(2)
13506 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13508 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13509 v1.AuxInt = int64ToAuxInt(0)
13510 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13511 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13512 v3.AuxInt = int64ToAuxInt(0xFFC0)
13515 v.AddArg3(v0, v1, v2)
13519 func rewriteValuePPC64_OpRsh64Ux32(v *Value) bool {
13523 typ := &b.Func.Config.Types
13524 // match: (Rsh64Ux32 x y)
13525 // cond: shiftIsBounded(v)
13526 // result: (SRD x y)
13530 if !(shiftIsBounded(v)) {
13533 v.reset(OpPPC64SRD)
13537 // match: (Rsh64Ux32 <t> x y)
13538 // result: (ISEL [0] (SRD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
13543 v.reset(OpPPC64ISEL)
13544 v.AuxInt = int32ToAuxInt(0)
13545 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13547 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13548 v1.AuxInt = int64ToAuxInt(0)
13549 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13550 v2.AuxInt = int32ToAuxInt(64)
13552 v.AddArg3(v0, v1, v2)
13556 func rewriteValuePPC64_OpRsh64Ux64(v *Value) bool {
13560 typ := &b.Func.Config.Types
13561 // match: (Rsh64Ux64 x (MOVDconst [c]))
13562 // cond: uint64(c) < 64
13563 // result: (SRDconst x [c])
13566 if v_1.Op != OpPPC64MOVDconst {
13569 c := auxIntToInt64(v_1.AuxInt)
13570 if !(uint64(c) < 64) {
13573 v.reset(OpPPC64SRDconst)
13574 v.AuxInt = int64ToAuxInt(c)
13578 // match: (Rsh64Ux64 x y)
13579 // cond: shiftIsBounded(v)
13580 // result: (SRD x y)
13584 if !(shiftIsBounded(v)) {
13587 v.reset(OpPPC64SRD)
13591 // match: (Rsh64Ux64 <t> x y)
13592 // result: (ISEL [0] (SRD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
13597 v.reset(OpPPC64ISEL)
13598 v.AuxInt = int32ToAuxInt(0)
13599 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13601 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13602 v1.AuxInt = int64ToAuxInt(0)
13603 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13604 v2.AuxInt = int64ToAuxInt(64)
13606 v.AddArg3(v0, v1, v2)
13610 func rewriteValuePPC64_OpRsh64Ux8(v *Value) bool {
13614 typ := &b.Func.Config.Types
13615 // match: (Rsh64Ux8 x y)
13616 // cond: shiftIsBounded(v)
13617 // result: (SRD x y)
13621 if !(shiftIsBounded(v)) {
13624 v.reset(OpPPC64SRD)
13628 // match: (Rsh64Ux8 <t> x y)
13629 // result: (ISEL [2] (SRD <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00C0] y)))
13634 v.reset(OpPPC64ISEL)
13635 v.AuxInt = int32ToAuxInt(2)
13636 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13638 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13639 v1.AuxInt = int64ToAuxInt(0)
13640 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13641 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13642 v3.AuxInt = int64ToAuxInt(0x00C0)
13645 v.AddArg3(v0, v1, v2)
13649 func rewriteValuePPC64_OpRsh64x16(v *Value) bool {
13653 typ := &b.Func.Config.Types
13654 // match: (Rsh64x16 x y)
13655 // cond: shiftIsBounded(v)
13656 // result: (SRAD x y)
13660 if !(shiftIsBounded(v)) {
13663 v.reset(OpPPC64SRAD)
13667 // match: (Rsh64x16 <t> x y)
13668 // result: (ISEL [2] (SRAD <t> x y) (SRADconst <t> x [63]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFC0] y)))
13673 v.reset(OpPPC64ISEL)
13674 v.AuxInt = int32ToAuxInt(2)
13675 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13677 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13678 v1.AuxInt = int64ToAuxInt(63)
13680 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13681 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13682 v3.AuxInt = int64ToAuxInt(0xFFC0)
13685 v.AddArg3(v0, v1, v2)
13689 func rewriteValuePPC64_OpRsh64x32(v *Value) bool {
13693 // match: (Rsh64x32 x y)
13694 // cond: shiftIsBounded(v)
13695 // result: (SRAD x y)
13699 if !(shiftIsBounded(v)) {
13702 v.reset(OpPPC64SRAD)
13706 // match: (Rsh64x32 <t> x y)
13707 // result: (ISEL [0] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPWUconst y [64]))
13712 v.reset(OpPPC64ISEL)
13713 v.AuxInt = int32ToAuxInt(0)
13714 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13716 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13717 v1.AuxInt = int64ToAuxInt(63)
13719 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13720 v2.AuxInt = int32ToAuxInt(64)
13722 v.AddArg3(v0, v1, v2)
13726 func rewriteValuePPC64_OpRsh64x64(v *Value) bool {
13730 // match: (Rsh64x64 x (MOVDconst [c]))
13731 // cond: uint64(c) >= 64
13732 // result: (SRADconst x [63])
13735 if v_1.Op != OpPPC64MOVDconst {
13738 c := auxIntToInt64(v_1.AuxInt)
13739 if !(uint64(c) >= 64) {
13742 v.reset(OpPPC64SRADconst)
13743 v.AuxInt = int64ToAuxInt(63)
13747 // match: (Rsh64x64 x (MOVDconst [c]))
13748 // cond: uint64(c) < 64
13749 // result: (SRADconst x [c])
13752 if v_1.Op != OpPPC64MOVDconst {
13755 c := auxIntToInt64(v_1.AuxInt)
13756 if !(uint64(c) < 64) {
13759 v.reset(OpPPC64SRADconst)
13760 v.AuxInt = int64ToAuxInt(c)
13764 // match: (Rsh64x64 x y)
13765 // cond: shiftIsBounded(v)
13766 // result: (SRAD x y)
13770 if !(shiftIsBounded(v)) {
13773 v.reset(OpPPC64SRAD)
13777 // match: (Rsh64x64 <t> x y)
13778 // result: (ISEL [0] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPUconst y [64]))
13783 v.reset(OpPPC64ISEL)
13784 v.AuxInt = int32ToAuxInt(0)
13785 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13787 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13788 v1.AuxInt = int64ToAuxInt(63)
13790 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13791 v2.AuxInt = int64ToAuxInt(64)
13793 v.AddArg3(v0, v1, v2)
13797 func rewriteValuePPC64_OpRsh64x8(v *Value) bool {
13801 typ := &b.Func.Config.Types
13802 // match: (Rsh64x8 x y)
13803 // cond: shiftIsBounded(v)
13804 // result: (SRAD x y)
13808 if !(shiftIsBounded(v)) {
13811 v.reset(OpPPC64SRAD)
13815 // match: (Rsh64x8 <t> x y)
13816 // result: (ISEL [2] (SRAD <t> x y) (SRADconst <t> x [63]) (Select1 <types.TypeFlags> (ANDCCconst [0x00C0] y)))
13821 v.reset(OpPPC64ISEL)
13822 v.AuxInt = int32ToAuxInt(2)
13823 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13825 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13826 v1.AuxInt = int64ToAuxInt(63)
13828 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13829 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13830 v3.AuxInt = int64ToAuxInt(0x00C0)
13833 v.AddArg3(v0, v1, v2)
13837 func rewriteValuePPC64_OpRsh8Ux16(v *Value) bool {
13841 typ := &b.Func.Config.Types
13842 // match: (Rsh8Ux16 x y)
13843 // cond: shiftIsBounded(v)
13844 // result: (SRD (MOVBZreg x) y)
13848 if !(shiftIsBounded(v)) {
13851 v.reset(OpPPC64SRD)
13852 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
13857 // match: (Rsh8Ux16 <t> x y)
13858 // result: (ISEL [2] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF8] y)))
13863 v.reset(OpPPC64ISEL)
13864 v.AuxInt = int32ToAuxInt(2)
13865 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13866 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
13869 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13870 v2.AuxInt = int64ToAuxInt(0)
13871 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13872 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13873 v4.AuxInt = int64ToAuxInt(0xFFF8)
13876 v.AddArg3(v0, v2, v3)
13880 func rewriteValuePPC64_OpRsh8Ux32(v *Value) bool {
13884 typ := &b.Func.Config.Types
13885 // match: (Rsh8Ux32 x y)
13886 // cond: shiftIsBounded(v)
13887 // result: (SRD (MOVBZreg x) y)
13891 if !(shiftIsBounded(v)) {
13894 v.reset(OpPPC64SRD)
13895 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
13900 // match: (Rsh8Ux32 <t> x y)
13901 // result: (ISEL [0] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [8]))
13906 v.reset(OpPPC64ISEL)
13907 v.AuxInt = int32ToAuxInt(0)
13908 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13909 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
13912 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13913 v2.AuxInt = int64ToAuxInt(0)
13914 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13915 v3.AuxInt = int32ToAuxInt(8)
13917 v.AddArg3(v0, v2, v3)
13921 func rewriteValuePPC64_OpRsh8Ux64(v *Value) bool {
13925 typ := &b.Func.Config.Types
13926 // match: (Rsh8Ux64 x (MOVDconst [c]))
13927 // cond: uint64(c) < 8
13928 // result: (SRWconst (ZeroExt8to32 x) [c])
13931 if v_1.Op != OpPPC64MOVDconst {
13934 c := auxIntToInt64(v_1.AuxInt)
13935 if !(uint64(c) < 8) {
13938 v.reset(OpPPC64SRWconst)
13939 v.AuxInt = int64ToAuxInt(c)
13940 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
13945 // match: (Rsh8Ux64 x y)
13946 // cond: shiftIsBounded(v)
13947 // result: (SRD (MOVBZreg x) y)
13951 if !(shiftIsBounded(v)) {
13954 v.reset(OpPPC64SRD)
13955 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
13960 // match: (Rsh8Ux64 <t> x y)
13961 // result: (ISEL [0] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [8]))
13966 v.reset(OpPPC64ISEL)
13967 v.AuxInt = int32ToAuxInt(0)
13968 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13969 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
13972 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13973 v2.AuxInt = int64ToAuxInt(0)
13974 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13975 v3.AuxInt = int64ToAuxInt(8)
13977 v.AddArg3(v0, v2, v3)
13981 func rewriteValuePPC64_OpRsh8Ux8(v *Value) bool {
13985 typ := &b.Func.Config.Types
13986 // match: (Rsh8Ux8 x y)
13987 // cond: shiftIsBounded(v)
13988 // result: (SRD (MOVBZreg x) y)
13992 if !(shiftIsBounded(v)) {
13995 v.reset(OpPPC64SRD)
13996 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14001 // match: (Rsh8Ux8 <t> x y)
14002 // result: (ISEL [2] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F8] y)))
14007 v.reset(OpPPC64ISEL)
14008 v.AuxInt = int32ToAuxInt(2)
14009 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14010 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14013 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14014 v2.AuxInt = int64ToAuxInt(0)
14015 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
14016 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
14017 v4.AuxInt = int64ToAuxInt(0x00F8)
14020 v.AddArg3(v0, v2, v3)
14024 func rewriteValuePPC64_OpRsh8x16(v *Value) bool {
14028 typ := &b.Func.Config.Types
14029 // match: (Rsh8x16 x y)
14030 // cond: shiftIsBounded(v)
14031 // result: (SRAD (MOVBreg x) y)
14035 if !(shiftIsBounded(v)) {
14038 v.reset(OpPPC64SRAD)
14039 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14044 // match: (Rsh8x16 <t> x y)
14045 // result: (ISEL [2] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF8] y)))
14050 v.reset(OpPPC64ISEL)
14051 v.AuxInt = int32ToAuxInt(2)
14052 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14053 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14056 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14057 v2.AuxInt = int64ToAuxInt(7)
14059 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
14060 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
14061 v4.AuxInt = int64ToAuxInt(0xFFF8)
14064 v.AddArg3(v0, v2, v3)
14068 func rewriteValuePPC64_OpRsh8x32(v *Value) bool {
14072 typ := &b.Func.Config.Types
14073 // match: (Rsh8x32 x y)
14074 // cond: shiftIsBounded(v)
14075 // result: (SRAD (MOVBreg x) y)
14079 if !(shiftIsBounded(v)) {
14082 v.reset(OpPPC64SRAD)
14083 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14088 // match: (Rsh8x32 <t> x y)
14089 // result: (ISEL [0] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPWUconst y [8]))
14094 v.reset(OpPPC64ISEL)
14095 v.AuxInt = int32ToAuxInt(0)
14096 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14097 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14100 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14101 v2.AuxInt = int64ToAuxInt(7)
14103 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
14104 v3.AuxInt = int32ToAuxInt(8)
14106 v.AddArg3(v0, v2, v3)
14110 func rewriteValuePPC64_OpRsh8x64(v *Value) bool {
14114 typ := &b.Func.Config.Types
14115 // match: (Rsh8x64 x (MOVDconst [c]))
14116 // cond: uint64(c) >= 8
14117 // result: (SRAWconst (SignExt8to32 x) [63])
14120 if v_1.Op != OpPPC64MOVDconst {
14123 c := auxIntToInt64(v_1.AuxInt)
14124 if !(uint64(c) >= 8) {
14127 v.reset(OpPPC64SRAWconst)
14128 v.AuxInt = int64ToAuxInt(63)
14129 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
14134 // match: (Rsh8x64 x (MOVDconst [c]))
14135 // cond: uint64(c) < 8
14136 // result: (SRAWconst (SignExt8to32 x) [c])
14139 if v_1.Op != OpPPC64MOVDconst {
14142 c := auxIntToInt64(v_1.AuxInt)
14143 if !(uint64(c) < 8) {
14146 v.reset(OpPPC64SRAWconst)
14147 v.AuxInt = int64ToAuxInt(c)
14148 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
14153 // match: (Rsh8x64 x y)
14154 // cond: shiftIsBounded(v)
14155 // result: (SRAD (MOVBreg x) y)
14159 if !(shiftIsBounded(v)) {
14162 v.reset(OpPPC64SRAD)
14163 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14168 // match: (Rsh8x64 <t> x y)
14169 // result: (ISEL [0] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPUconst y [8]))
14174 v.reset(OpPPC64ISEL)
14175 v.AuxInt = int32ToAuxInt(0)
14176 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14177 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14180 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14181 v2.AuxInt = int64ToAuxInt(7)
14183 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
14184 v3.AuxInt = int64ToAuxInt(8)
14186 v.AddArg3(v0, v2, v3)
14190 func rewriteValuePPC64_OpRsh8x8(v *Value) bool {
14194 typ := &b.Func.Config.Types
14195 // match: (Rsh8x8 x y)
14196 // cond: shiftIsBounded(v)
14197 // result: (SRAD (MOVBreg x) y)
14201 if !(shiftIsBounded(v)) {
14204 v.reset(OpPPC64SRAD)
14205 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14210 // match: (Rsh8x8 <t> x y)
14211 // result: (ISEL [2] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F8] y)))
14216 v.reset(OpPPC64ISEL)
14217 v.AuxInt = int32ToAuxInt(2)
14218 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14219 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14222 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14223 v2.AuxInt = int64ToAuxInt(7)
14225 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
14226 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
14227 v4.AuxInt = int64ToAuxInt(0x00F8)
14230 v.AddArg3(v0, v2, v3)
14234 func rewriteValuePPC64_OpSelect0(v *Value) bool {
14237 typ := &b.Func.Config.Types
14238 // match: (Select0 (Mul64uhilo x y))
14239 // result: (MULHDU x y)
14241 if v_0.Op != OpMul64uhilo {
14246 v.reset(OpPPC64MULHDU)
14250 // match: (Select0 (Add64carry x y c))
14251 // result: (Select0 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1]))))
14253 if v_0.Op != OpAdd64carry {
14260 v.Type = typ.UInt64
14261 v0 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
14262 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14263 v2 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14264 v2.AuxInt = int64ToAuxInt(-1)
14267 v0.AddArg3(x, y, v1)
14271 // match: (Select0 (Sub64borrow x y c))
14272 // result: (Select0 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0]))))
14274 if v_0.Op != OpSub64borrow {
14281 v.Type = typ.UInt64
14282 v0 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
14283 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14284 v2 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14285 v2.AuxInt = int64ToAuxInt(0)
14288 v0.AddArg3(x, y, v1)
14292 // match: (Select0 (ANDCCconst [m] (ROTLWconst [r] x)))
14293 // cond: isPPC64WordRotateMask(m)
14294 // result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
14296 if v_0.Op != OpPPC64ANDCCconst {
14299 m := auxIntToInt64(v_0.AuxInt)
14300 v_0_0 := v_0.Args[0]
14301 if v_0_0.Op != OpPPC64ROTLWconst {
14304 r := auxIntToInt64(v_0_0.AuxInt)
14306 if !(isPPC64WordRotateMask(m)) {
14309 v.reset(OpPPC64RLWINM)
14310 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
14314 // match: (Select0 (ANDCCconst [m] (ROTLW x r)))
14315 // cond: isPPC64WordRotateMask(m)
14316 // result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
14318 if v_0.Op != OpPPC64ANDCCconst {
14321 m := auxIntToInt64(v_0.AuxInt)
14322 v_0_0 := v_0.Args[0]
14323 if v_0_0.Op != OpPPC64ROTLW {
14328 if !(isPPC64WordRotateMask(m)) {
14331 v.reset(OpPPC64RLWNM)
14332 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
14336 // match: (Select0 (ANDCCconst [m] (SRWconst x [s])))
14337 // cond: mergePPC64RShiftMask(m,s,32) == 0
14338 // result: (MOVDconst [0])
14340 if v_0.Op != OpPPC64ANDCCconst {
14343 m := auxIntToInt64(v_0.AuxInt)
14344 v_0_0 := v_0.Args[0]
14345 if v_0_0.Op != OpPPC64SRWconst {
14348 s := auxIntToInt64(v_0_0.AuxInt)
14349 if !(mergePPC64RShiftMask(m, s, 32) == 0) {
14352 v.reset(OpPPC64MOVDconst)
14353 v.AuxInt = int64ToAuxInt(0)
14356 // match: (Select0 (ANDCCconst [m] (SRWconst x [s])))
14357 // cond: mergePPC64AndSrwi(m,s) != 0
14358 // result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
14360 if v_0.Op != OpPPC64ANDCCconst {
14363 m := auxIntToInt64(v_0.AuxInt)
14364 v_0_0 := v_0.Args[0]
14365 if v_0_0.Op != OpPPC64SRWconst {
14368 s := auxIntToInt64(v_0_0.AuxInt)
14370 if !(mergePPC64AndSrwi(m, s) != 0) {
14373 v.reset(OpPPC64RLWINM)
14374 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
14378 // match: (Select0 (ANDCCconst [-1] x))
14381 if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != -1 {
14388 // match: (Select0 (ANDCCconst [0] _))
14389 // result: (MOVDconst [0])
14391 if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != 0 {
14394 v.reset(OpPPC64MOVDconst)
14395 v.AuxInt = int64ToAuxInt(0)
14398 // match: (Select0 (ANDCCconst [c] y:(MOVBZreg _)))
14399 // cond: c&0xFF == 0xFF
14402 if v_0.Op != OpPPC64ANDCCconst {
14405 c := auxIntToInt64(v_0.AuxInt)
14407 if y.Op != OpPPC64MOVBZreg || !(c&0xFF == 0xFF) {
14413 // match: (Select0 (ANDCCconst [0xFF] (MOVBreg x)))
14414 // result: (MOVBZreg x)
14416 if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != 0xFF {
14419 v_0_0 := v_0.Args[0]
14420 if v_0_0.Op != OpPPC64MOVBreg {
14424 v.reset(OpPPC64MOVBZreg)
14428 // match: (Select0 (ANDCCconst [c] y:(MOVHZreg _)))
14429 // cond: c&0xFFFF == 0xFFFF
14432 if v_0.Op != OpPPC64ANDCCconst {
14435 c := auxIntToInt64(v_0.AuxInt)
14437 if y.Op != OpPPC64MOVHZreg || !(c&0xFFFF == 0xFFFF) {
14443 // match: (Select0 (ANDCCconst [0xFFFF] (MOVHreg x)))
14444 // result: (MOVHZreg x)
14446 if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != 0xFFFF {
14449 v_0_0 := v_0.Args[0]
14450 if v_0_0.Op != OpPPC64MOVHreg {
14454 v.reset(OpPPC64MOVHZreg)
14458 // match: (Select0 (ANDCCconst [c] (MOVBZreg x)))
14459 // result: (Select0 (ANDCCconst [c&0xFF] x))
14461 if v_0.Op != OpPPC64ANDCCconst {
14464 c := auxIntToInt64(v_0.AuxInt)
14465 v_0_0 := v_0.Args[0]
14466 if v_0_0.Op != OpPPC64MOVBZreg {
14471 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
14472 v0.AuxInt = int64ToAuxInt(c & 0xFF)
14477 // match: (Select0 (ANDCCconst [c] (MOVHZreg x)))
14478 // result: (Select0 (ANDCCconst [c&0xFFFF] x))
14480 if v_0.Op != OpPPC64ANDCCconst {
14483 c := auxIntToInt64(v_0.AuxInt)
14484 v_0_0 := v_0.Args[0]
14485 if v_0_0.Op != OpPPC64MOVHZreg {
14490 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
14491 v0.AuxInt = int64ToAuxInt(c & 0xFFFF)
14496 // match: (Select0 (ANDCCconst [c] (MOVWZreg x)))
14497 // result: (Select0 (ANDCCconst [c&0xFFFFFFFF] x))
14499 if v_0.Op != OpPPC64ANDCCconst {
14502 c := auxIntToInt64(v_0.AuxInt)
14503 v_0_0 := v_0.Args[0]
14504 if v_0_0.Op != OpPPC64MOVWZreg {
14509 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
14510 v0.AuxInt = int64ToAuxInt(c & 0xFFFFFFFF)
14517 func rewriteValuePPC64_OpSelect1(v *Value) bool {
14520 typ := &b.Func.Config.Types
14521 // match: (Select1 (Mul64uhilo x y))
14522 // result: (MULLD x y)
14524 if v_0.Op != OpMul64uhilo {
14529 v.reset(OpPPC64MULLD)
14533 // match: (Select1 (Add64carry x y c))
14534 // result: (ADDZEzero (Select1 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1])))))
14536 if v_0.Op != OpAdd64carry {
14542 v.reset(OpPPC64ADDZEzero)
14543 v0 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14544 v1 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
14545 v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14546 v3 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14547 v3.AuxInt = int64ToAuxInt(-1)
14550 v1.AddArg3(x, y, v2)
14555 // match: (Select1 (ADDCconst n:(ADDZEzero x) [-1]))
14556 // cond: n.Uses <= 2
14559 if v_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_0.AuxInt) != -1 {
14563 if n.Op != OpPPC64ADDZEzero {
14567 if !(n.Uses <= 2) {
14573 // match: (Select1 (Sub64borrow x y c))
14574 // result: (NEG (SUBZEzero (Select1 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0]))))))
14576 if v_0.Op != OpSub64borrow {
14582 v.reset(OpPPC64NEG)
14583 v0 := b.NewValue0(v.Pos, OpPPC64SUBZEzero, typ.UInt64)
14584 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14585 v2 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
14586 v3 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14587 v4 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14588 v4.AuxInt = int64ToAuxInt(0)
14591 v2.AddArg3(x, y, v3)
14597 // match: (Select1 (SUBCconst n:(NEG (SUBZEzero x)) [0]))
14598 // cond: n.Uses <= 2
14601 if v_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_0.AuxInt) != 0 {
14605 if n.Op != OpPPC64NEG {
14609 if n_0.Op != OpPPC64SUBZEzero {
14613 if !(n.Uses <= 2) {
14619 // match: (Select1 (ANDCCconst [0] _))
14620 // result: (FlagEQ)
14622 if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != 0 {
14625 v.reset(OpPPC64FlagEQ)
14630 func rewriteValuePPC64_OpSelectN(v *Value) bool {
14633 config := b.Func.Config
14634 // match: (SelectN [0] call:(CALLstatic {sym} s1:(MOVDstore _ (MOVDconst [sz]) s2:(MOVDstore _ src s3:(MOVDstore {t} _ dst mem)))))
14635 // cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(s1, s2, s3, call)
14636 // result: (Move [sz] dst src mem)
14638 if auxIntToInt64(v.AuxInt) != 0 {
14642 if call.Op != OpPPC64CALLstatic || len(call.Args) != 1 {
14645 sym := auxToCall(call.Aux)
14647 if s1.Op != OpPPC64MOVDstore {
14652 if s1_1.Op != OpPPC64MOVDconst {
14655 sz := auxIntToInt64(s1_1.AuxInt)
14657 if s2.Op != OpPPC64MOVDstore {
14663 if s3.Op != OpPPC64MOVDstore {
14668 if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(s1, s2, s3, call)) {
14672 v.AuxInt = int64ToAuxInt(sz)
14673 v.AddArg3(dst, src, mem)
14676 // match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVDconst [sz]) mem))
14677 // cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)
14678 // result: (Move [sz] dst src mem)
14680 if auxIntToInt64(v.AuxInt) != 0 {
14684 if call.Op != OpPPC64CALLstatic || len(call.Args) != 4 {
14687 sym := auxToCall(call.Aux)
14688 mem := call.Args[3]
14689 dst := call.Args[0]
14690 src := call.Args[1]
14691 call_2 := call.Args[2]
14692 if call_2.Op != OpPPC64MOVDconst {
14695 sz := auxIntToInt64(call_2.AuxInt)
14696 if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
14700 v.AuxInt = int64ToAuxInt(sz)
14701 v.AddArg3(dst, src, mem)
14706 func rewriteValuePPC64_OpSlicemask(v *Value) bool {
14709 // match: (Slicemask <t> x)
14710 // result: (SRADconst (NEG <t> x) [63])
14714 v.reset(OpPPC64SRADconst)
14715 v.AuxInt = int64ToAuxInt(63)
14716 v0 := b.NewValue0(v.Pos, OpPPC64NEG, t)
14722 func rewriteValuePPC64_OpStore(v *Value) bool {
14726 // match: (Store {t} ptr val mem)
14727 // cond: t.Size() == 8 && t.IsFloat()
14728 // result: (FMOVDstore ptr val mem)
14730 t := auxToType(v.Aux)
14734 if !(t.Size() == 8 && t.IsFloat()) {
14737 v.reset(OpPPC64FMOVDstore)
14738 v.AddArg3(ptr, val, mem)
14741 // match: (Store {t} ptr val mem)
14742 // cond: t.Size() == 4 && t.IsFloat()
14743 // result: (FMOVSstore ptr val mem)
14745 t := auxToType(v.Aux)
14749 if !(t.Size() == 4 && t.IsFloat()) {
14752 v.reset(OpPPC64FMOVSstore)
14753 v.AddArg3(ptr, val, mem)
14756 // match: (Store {t} ptr val mem)
14757 // cond: t.Size() == 8 && !t.IsFloat()
14758 // result: (MOVDstore ptr val mem)
14760 t := auxToType(v.Aux)
14764 if !(t.Size() == 8 && !t.IsFloat()) {
14767 v.reset(OpPPC64MOVDstore)
14768 v.AddArg3(ptr, val, mem)
14771 // match: (Store {t} ptr val mem)
14772 // cond: t.Size() == 4 && !t.IsFloat()
14773 // result: (MOVWstore ptr val mem)
14775 t := auxToType(v.Aux)
14779 if !(t.Size() == 4 && !t.IsFloat()) {
14782 v.reset(OpPPC64MOVWstore)
14783 v.AddArg3(ptr, val, mem)
14786 // match: (Store {t} ptr val mem)
14787 // cond: t.Size() == 2
14788 // result: (MOVHstore ptr val mem)
14790 t := auxToType(v.Aux)
14794 if !(t.Size() == 2) {
14797 v.reset(OpPPC64MOVHstore)
14798 v.AddArg3(ptr, val, mem)
14801 // match: (Store {t} ptr val mem)
14802 // cond: t.Size() == 1
14803 // result: (MOVBstore ptr val mem)
14805 t := auxToType(v.Aux)
14809 if !(t.Size() == 1) {
14812 v.reset(OpPPC64MOVBstore)
14813 v.AddArg3(ptr, val, mem)
14818 func rewriteValuePPC64_OpTrunc16to8(v *Value) bool {
14820 // match: (Trunc16to8 <t> x)
14821 // cond: t.IsSigned()
14822 // result: (MOVBreg x)
14826 if !(t.IsSigned()) {
14829 v.reset(OpPPC64MOVBreg)
14833 // match: (Trunc16to8 x)
14834 // result: (MOVBZreg x)
14837 v.reset(OpPPC64MOVBZreg)
14842 func rewriteValuePPC64_OpTrunc32to16(v *Value) bool {
14844 // match: (Trunc32to16 <t> x)
14845 // cond: t.IsSigned()
14846 // result: (MOVHreg x)
14850 if !(t.IsSigned()) {
14853 v.reset(OpPPC64MOVHreg)
14857 // match: (Trunc32to16 x)
14858 // result: (MOVHZreg x)
14861 v.reset(OpPPC64MOVHZreg)
14866 func rewriteValuePPC64_OpTrunc32to8(v *Value) bool {
14868 // match: (Trunc32to8 <t> x)
14869 // cond: t.IsSigned()
14870 // result: (MOVBreg x)
14874 if !(t.IsSigned()) {
14877 v.reset(OpPPC64MOVBreg)
14881 // match: (Trunc32to8 x)
14882 // result: (MOVBZreg x)
14885 v.reset(OpPPC64MOVBZreg)
14890 func rewriteValuePPC64_OpTrunc64to16(v *Value) bool {
14892 // match: (Trunc64to16 <t> x)
14893 // cond: t.IsSigned()
14894 // result: (MOVHreg x)
14898 if !(t.IsSigned()) {
14901 v.reset(OpPPC64MOVHreg)
14905 // match: (Trunc64to16 x)
14906 // result: (MOVHZreg x)
14909 v.reset(OpPPC64MOVHZreg)
14914 func rewriteValuePPC64_OpTrunc64to32(v *Value) bool {
14916 // match: (Trunc64to32 <t> x)
14917 // cond: t.IsSigned()
14918 // result: (MOVWreg x)
14922 if !(t.IsSigned()) {
14925 v.reset(OpPPC64MOVWreg)
14929 // match: (Trunc64to32 x)
14930 // result: (MOVWZreg x)
14933 v.reset(OpPPC64MOVWZreg)
14938 func rewriteValuePPC64_OpTrunc64to8(v *Value) bool {
14940 // match: (Trunc64to8 <t> x)
14941 // cond: t.IsSigned()
14942 // result: (MOVBreg x)
14946 if !(t.IsSigned()) {
14949 v.reset(OpPPC64MOVBreg)
14953 // match: (Trunc64to8 x)
14954 // result: (MOVBZreg x)
14957 v.reset(OpPPC64MOVBZreg)
14962 func rewriteValuePPC64_OpZero(v *Value) bool {
14966 // match: (Zero [0] _ mem)
14969 if auxIntToInt64(v.AuxInt) != 0 {
14976 // match: (Zero [1] destptr mem)
14977 // result: (MOVBstorezero destptr mem)
14979 if auxIntToInt64(v.AuxInt) != 1 {
14984 v.reset(OpPPC64MOVBstorezero)
14985 v.AddArg2(destptr, mem)
14988 // match: (Zero [2] destptr mem)
14989 // result: (MOVHstorezero destptr mem)
14991 if auxIntToInt64(v.AuxInt) != 2 {
14996 v.reset(OpPPC64MOVHstorezero)
14997 v.AddArg2(destptr, mem)
15000 // match: (Zero [3] destptr mem)
15001 // result: (MOVBstorezero [2] destptr (MOVHstorezero destptr mem))
15003 if auxIntToInt64(v.AuxInt) != 3 {
15008 v.reset(OpPPC64MOVBstorezero)
15009 v.AuxInt = int32ToAuxInt(2)
15010 v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
15011 v0.AddArg2(destptr, mem)
15012 v.AddArg2(destptr, v0)
15015 // match: (Zero [4] destptr mem)
15016 // result: (MOVWstorezero destptr mem)
15018 if auxIntToInt64(v.AuxInt) != 4 {
15023 v.reset(OpPPC64MOVWstorezero)
15024 v.AddArg2(destptr, mem)
15027 // match: (Zero [5] destptr mem)
15028 // result: (MOVBstorezero [4] destptr (MOVWstorezero destptr mem))
15030 if auxIntToInt64(v.AuxInt) != 5 {
15035 v.reset(OpPPC64MOVBstorezero)
15036 v.AuxInt = int32ToAuxInt(4)
15037 v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
15038 v0.AddArg2(destptr, mem)
15039 v.AddArg2(destptr, v0)
15042 // match: (Zero [6] destptr mem)
15043 // result: (MOVHstorezero [4] destptr (MOVWstorezero destptr mem))
15045 if auxIntToInt64(v.AuxInt) != 6 {
15050 v.reset(OpPPC64MOVHstorezero)
15051 v.AuxInt = int32ToAuxInt(4)
15052 v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
15053 v0.AddArg2(destptr, mem)
15054 v.AddArg2(destptr, v0)
15057 // match: (Zero [7] destptr mem)
15058 // result: (MOVBstorezero [6] destptr (MOVHstorezero [4] destptr (MOVWstorezero destptr mem)))
15060 if auxIntToInt64(v.AuxInt) != 7 {
15065 v.reset(OpPPC64MOVBstorezero)
15066 v.AuxInt = int32ToAuxInt(6)
15067 v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
15068 v0.AuxInt = int32ToAuxInt(4)
15069 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
15070 v1.AddArg2(destptr, mem)
15071 v0.AddArg2(destptr, v1)
15072 v.AddArg2(destptr, v0)
15075 // match: (Zero [8] {t} destptr mem)
15076 // result: (MOVDstorezero destptr mem)
15078 if auxIntToInt64(v.AuxInt) != 8 {
15083 v.reset(OpPPC64MOVDstorezero)
15084 v.AddArg2(destptr, mem)
15087 // match: (Zero [12] {t} destptr mem)
15088 // result: (MOVWstorezero [8] destptr (MOVDstorezero [0] destptr mem))
15090 if auxIntToInt64(v.AuxInt) != 12 {
15095 v.reset(OpPPC64MOVWstorezero)
15096 v.AuxInt = int32ToAuxInt(8)
15097 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15098 v0.AuxInt = int32ToAuxInt(0)
15099 v0.AddArg2(destptr, mem)
15100 v.AddArg2(destptr, v0)
15103 // match: (Zero [16] {t} destptr mem)
15104 // result: (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))
15106 if auxIntToInt64(v.AuxInt) != 16 {
15111 v.reset(OpPPC64MOVDstorezero)
15112 v.AuxInt = int32ToAuxInt(8)
15113 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15114 v0.AuxInt = int32ToAuxInt(0)
15115 v0.AddArg2(destptr, mem)
15116 v.AddArg2(destptr, v0)
15119 // match: (Zero [24] {t} destptr mem)
15120 // result: (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem)))
15122 if auxIntToInt64(v.AuxInt) != 24 {
15127 v.reset(OpPPC64MOVDstorezero)
15128 v.AuxInt = int32ToAuxInt(16)
15129 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15130 v0.AuxInt = int32ToAuxInt(8)
15131 v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15132 v1.AuxInt = int32ToAuxInt(0)
15133 v1.AddArg2(destptr, mem)
15134 v0.AddArg2(destptr, v1)
15135 v.AddArg2(destptr, v0)
15138 // match: (Zero [32] {t} destptr mem)
15139 // result: (MOVDstorezero [24] destptr (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))))
15141 if auxIntToInt64(v.AuxInt) != 32 {
15146 v.reset(OpPPC64MOVDstorezero)
15147 v.AuxInt = int32ToAuxInt(24)
15148 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15149 v0.AuxInt = int32ToAuxInt(16)
15150 v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15151 v1.AuxInt = int32ToAuxInt(8)
15152 v2 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15153 v2.AuxInt = int32ToAuxInt(0)
15154 v2.AddArg2(destptr, mem)
15155 v1.AddArg2(destptr, v2)
15156 v0.AddArg2(destptr, v1)
15157 v.AddArg2(destptr, v0)
15160 // match: (Zero [s] ptr mem)
15161 // cond: buildcfg.GOPPC64 <= 8 && s < 64
15162 // result: (LoweredZeroShort [s] ptr mem)
15164 s := auxIntToInt64(v.AuxInt)
15167 if !(buildcfg.GOPPC64 <= 8 && s < 64) {
15170 v.reset(OpPPC64LoweredZeroShort)
15171 v.AuxInt = int64ToAuxInt(s)
15172 v.AddArg2(ptr, mem)
15175 // match: (Zero [s] ptr mem)
15176 // cond: buildcfg.GOPPC64 <= 8
15177 // result: (LoweredZero [s] ptr mem)
15179 s := auxIntToInt64(v.AuxInt)
15182 if !(buildcfg.GOPPC64 <= 8) {
15185 v.reset(OpPPC64LoweredZero)
15186 v.AuxInt = int64ToAuxInt(s)
15187 v.AddArg2(ptr, mem)
15190 // match: (Zero [s] ptr mem)
15191 // cond: s < 128 && buildcfg.GOPPC64 >= 9
15192 // result: (LoweredQuadZeroShort [s] ptr mem)
15194 s := auxIntToInt64(v.AuxInt)
15197 if !(s < 128 && buildcfg.GOPPC64 >= 9) {
15200 v.reset(OpPPC64LoweredQuadZeroShort)
15201 v.AuxInt = int64ToAuxInt(s)
15202 v.AddArg2(ptr, mem)
15205 // match: (Zero [s] ptr mem)
15206 // cond: buildcfg.GOPPC64 >= 9
15207 // result: (LoweredQuadZero [s] ptr mem)
15209 s := auxIntToInt64(v.AuxInt)
15212 if !(buildcfg.GOPPC64 >= 9) {
15215 v.reset(OpPPC64LoweredQuadZero)
15216 v.AuxInt = int64ToAuxInt(s)
15217 v.AddArg2(ptr, mem)
15222 func rewriteBlockPPC64(b *Block) bool {
15223 typ := &b.Func.Config.Types
15226 // match: (EQ (CMPconst [0] (Select0 (ANDCCconst [c] x))) yes no)
15227 // result: (EQ (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no)
15228 for b.Controls[0].Op == OpPPC64CMPconst {
15229 v_0 := b.Controls[0]
15230 if auxIntToInt64(v_0.AuxInt) != 0 {
15233 v_0_0 := v_0.Args[0]
15234 if v_0_0.Op != OpSelect0 {
15237 v_0_0_0 := v_0_0.Args[0]
15238 if v_0_0_0.Op != OpPPC64ANDCCconst {
15241 c := auxIntToInt64(v_0_0_0.AuxInt)
15242 x := v_0_0_0.Args[0]
15243 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15244 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
15245 v1.AuxInt = int64ToAuxInt(c)
15248 b.resetWithControl(BlockPPC64EQ, v0)
15251 // match: (EQ (CMPWconst [0] (Select0 (ANDCCconst [c] x))) yes no)
15252 // result: (EQ (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no)
15253 for b.Controls[0].Op == OpPPC64CMPWconst {
15254 v_0 := b.Controls[0]
15255 if auxIntToInt32(v_0.AuxInt) != 0 {
15258 v_0_0 := v_0.Args[0]
15259 if v_0_0.Op != OpSelect0 {
15262 v_0_0_0 := v_0_0.Args[0]
15263 if v_0_0_0.Op != OpPPC64ANDCCconst {
15266 c := auxIntToInt64(v_0_0_0.AuxInt)
15267 x := v_0_0_0.Args[0]
15268 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15269 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
15270 v1.AuxInt = int64ToAuxInt(c)
15273 b.resetWithControl(BlockPPC64EQ, v0)
15276 // match: (EQ (FlagEQ) yes no)
15277 // result: (First yes no)
15278 for b.Controls[0].Op == OpPPC64FlagEQ {
15279 b.Reset(BlockFirst)
15282 // match: (EQ (FlagLT) yes no)
15283 // result: (First no yes)
15284 for b.Controls[0].Op == OpPPC64FlagLT {
15285 b.Reset(BlockFirst)
15289 // match: (EQ (FlagGT) yes no)
15290 // result: (First no yes)
15291 for b.Controls[0].Op == OpPPC64FlagGT {
15292 b.Reset(BlockFirst)
15296 // match: (EQ (InvertFlags cmp) yes no)
15297 // result: (EQ cmp yes no)
15298 for b.Controls[0].Op == OpPPC64InvertFlags {
15299 v_0 := b.Controls[0]
15301 b.resetWithControl(BlockPPC64EQ, cmp)
15304 // match: (EQ (CMPconst [0] (Select0 (ANDCCconst [c] x))) yes no)
15305 // result: (EQ (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no)
15306 for b.Controls[0].Op == OpPPC64CMPconst {
15307 v_0 := b.Controls[0]
15308 if auxIntToInt64(v_0.AuxInt) != 0 {
15311 v_0_0 := v_0.Args[0]
15312 if v_0_0.Op != OpSelect0 {
15315 v_0_0_0 := v_0_0.Args[0]
15316 if v_0_0_0.Op != OpPPC64ANDCCconst {
15319 c := auxIntToInt64(v_0_0_0.AuxInt)
15320 x := v_0_0_0.Args[0]
15321 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15322 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
15323 v1.AuxInt = int64ToAuxInt(c)
15326 b.resetWithControl(BlockPPC64EQ, v0)
15329 // match: (EQ (CMPWconst [0] (Select0 (ANDCCconst [c] x))) yes no)
15330 // result: (EQ (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no)
15331 for b.Controls[0].Op == OpPPC64CMPWconst {
15332 v_0 := b.Controls[0]
15333 if auxIntToInt32(v_0.AuxInt) != 0 {
15336 v_0_0 := v_0.Args[0]
15337 if v_0_0.Op != OpSelect0 {
15340 v_0_0_0 := v_0_0.Args[0]
15341 if v_0_0_0.Op != OpPPC64ANDCCconst {
15344 c := auxIntToInt64(v_0_0_0.AuxInt)
15345 x := v_0_0_0.Args[0]
15346 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15347 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
15348 v1.AuxInt = int64ToAuxInt(c)
15351 b.resetWithControl(BlockPPC64EQ, v0)
15354 // match: (EQ (CMPconst [0] z:(AND x y)) yes no)
15355 // cond: z.Uses == 1
15356 // result: (EQ (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
15357 for b.Controls[0].Op == OpPPC64CMPconst {
15358 v_0 := b.Controls[0]
15359 if auxIntToInt64(v_0.AuxInt) != 0 {
15363 if z.Op != OpPPC64AND {
15369 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15372 if !(z.Uses == 1) {
15375 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15376 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15379 b.resetWithControl(BlockPPC64EQ, v0)
15384 // match: (EQ (CMPconst [0] z:(OR x y)) yes no)
15385 // cond: z.Uses == 1
15386 // result: (EQ (Select1 <types.TypeFlags> (ORCC x y)) yes no)
15387 for b.Controls[0].Op == OpPPC64CMPconst {
15388 v_0 := b.Controls[0]
15389 if auxIntToInt64(v_0.AuxInt) != 0 {
15393 if z.Op != OpPPC64OR {
15399 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15402 if !(z.Uses == 1) {
15405 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15406 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
15409 b.resetWithControl(BlockPPC64EQ, v0)
15414 // match: (EQ (CMPconst [0] z:(XOR x y)) yes no)
15415 // cond: z.Uses == 1
15416 // result: (EQ (Select1 <types.TypeFlags> (XORCC x y)) yes no)
15417 for b.Controls[0].Op == OpPPC64CMPconst {
15418 v_0 := b.Controls[0]
15419 if auxIntToInt64(v_0.AuxInt) != 0 {
15423 if z.Op != OpPPC64XOR {
15429 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15432 if !(z.Uses == 1) {
15435 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15436 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
15439 b.resetWithControl(BlockPPC64EQ, v0)
15445 // match: (GE (FlagEQ) yes no)
15446 // result: (First yes no)
15447 for b.Controls[0].Op == OpPPC64FlagEQ {
15448 b.Reset(BlockFirst)
15451 // match: (GE (FlagLT) yes no)
15452 // result: (First no yes)
15453 for b.Controls[0].Op == OpPPC64FlagLT {
15454 b.Reset(BlockFirst)
15458 // match: (GE (FlagGT) yes no)
15459 // result: (First yes no)
15460 for b.Controls[0].Op == OpPPC64FlagGT {
15461 b.Reset(BlockFirst)
15464 // match: (GE (InvertFlags cmp) yes no)
15465 // result: (LE cmp yes no)
15466 for b.Controls[0].Op == OpPPC64InvertFlags {
15467 v_0 := b.Controls[0]
15469 b.resetWithControl(BlockPPC64LE, cmp)
15472 // match: (GE (CMPconst [0] (Select0 (ANDCCconst [c] x))) yes no)
15473 // result: (GE (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no)
15474 for b.Controls[0].Op == OpPPC64CMPconst {
15475 v_0 := b.Controls[0]
15476 if auxIntToInt64(v_0.AuxInt) != 0 {
15479 v_0_0 := v_0.Args[0]
15480 if v_0_0.Op != OpSelect0 {
15483 v_0_0_0 := v_0_0.Args[0]
15484 if v_0_0_0.Op != OpPPC64ANDCCconst {
15487 c := auxIntToInt64(v_0_0_0.AuxInt)
15488 x := v_0_0_0.Args[0]
15489 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15490 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
15491 v1.AuxInt = int64ToAuxInt(c)
15494 b.resetWithControl(BlockPPC64GE, v0)
15497 // match: (GE (CMPWconst [0] (Select0 (ANDCCconst [c] x))) yes no)
15498 // result: (GE (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no)
15499 for b.Controls[0].Op == OpPPC64CMPWconst {
15500 v_0 := b.Controls[0]
15501 if auxIntToInt32(v_0.AuxInt) != 0 {
15504 v_0_0 := v_0.Args[0]
15505 if v_0_0.Op != OpSelect0 {
15508 v_0_0_0 := v_0_0.Args[0]
15509 if v_0_0_0.Op != OpPPC64ANDCCconst {
15512 c := auxIntToInt64(v_0_0_0.AuxInt)
15513 x := v_0_0_0.Args[0]
15514 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15515 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
15516 v1.AuxInt = int64ToAuxInt(c)
15519 b.resetWithControl(BlockPPC64GE, v0)
15522 // match: (GE (CMPconst [0] z:(AND x y)) yes no)
15523 // cond: z.Uses == 1
15524 // result: (GE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
15525 for b.Controls[0].Op == OpPPC64CMPconst {
15526 v_0 := b.Controls[0]
15527 if auxIntToInt64(v_0.AuxInt) != 0 {
15531 if z.Op != OpPPC64AND {
15537 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15540 if !(z.Uses == 1) {
15543 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15544 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15547 b.resetWithControl(BlockPPC64GE, v0)
15552 // match: (GE (CMPconst [0] z:(OR x y)) yes no)
15553 // cond: z.Uses == 1
15554 // result: (GE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
15555 for b.Controls[0].Op == OpPPC64CMPconst {
15556 v_0 := b.Controls[0]
15557 if auxIntToInt64(v_0.AuxInt) != 0 {
15561 if z.Op != OpPPC64OR {
15567 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15570 if !(z.Uses == 1) {
15573 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15574 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
15577 b.resetWithControl(BlockPPC64GE, v0)
15582 // match: (GE (CMPconst [0] z:(XOR x y)) yes no)
15583 // cond: z.Uses == 1
15584 // result: (GE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
15585 for b.Controls[0].Op == OpPPC64CMPconst {
15586 v_0 := b.Controls[0]
15587 if auxIntToInt64(v_0.AuxInt) != 0 {
15591 if z.Op != OpPPC64XOR {
15597 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15600 if !(z.Uses == 1) {
15603 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15604 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
15607 b.resetWithControl(BlockPPC64GE, v0)
15613 // match: (GT (FlagEQ) yes no)
15614 // result: (First no yes)
15615 for b.Controls[0].Op == OpPPC64FlagEQ {
15616 b.Reset(BlockFirst)
15620 // match: (GT (FlagLT) yes no)
15621 // result: (First no yes)
15622 for b.Controls[0].Op == OpPPC64FlagLT {
15623 b.Reset(BlockFirst)
15627 // match: (GT (FlagGT) yes no)
15628 // result: (First yes no)
15629 for b.Controls[0].Op == OpPPC64FlagGT {
15630 b.Reset(BlockFirst)
15633 // match: (GT (InvertFlags cmp) yes no)
15634 // result: (LT cmp yes no)
15635 for b.Controls[0].Op == OpPPC64InvertFlags {
15636 v_0 := b.Controls[0]
15638 b.resetWithControl(BlockPPC64LT, cmp)
15641 // match: (GT (CMPconst [0] (Select0 (ANDCCconst [c] x))) yes no)
15642 // result: (GT (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no)
15643 for b.Controls[0].Op == OpPPC64CMPconst {
15644 v_0 := b.Controls[0]
15645 if auxIntToInt64(v_0.AuxInt) != 0 {
15648 v_0_0 := v_0.Args[0]
15649 if v_0_0.Op != OpSelect0 {
15652 v_0_0_0 := v_0_0.Args[0]
15653 if v_0_0_0.Op != OpPPC64ANDCCconst {
15656 c := auxIntToInt64(v_0_0_0.AuxInt)
15657 x := v_0_0_0.Args[0]
15658 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15659 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
15660 v1.AuxInt = int64ToAuxInt(c)
15663 b.resetWithControl(BlockPPC64GT, v0)
15666 // match: (GT (CMPWconst [0] (Select0 (ANDCCconst [c] x))) yes no)
15667 // result: (GT (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no)
15668 for b.Controls[0].Op == OpPPC64CMPWconst {
15669 v_0 := b.Controls[0]
15670 if auxIntToInt32(v_0.AuxInt) != 0 {
15673 v_0_0 := v_0.Args[0]
15674 if v_0_0.Op != OpSelect0 {
15677 v_0_0_0 := v_0_0.Args[0]
15678 if v_0_0_0.Op != OpPPC64ANDCCconst {
15681 c := auxIntToInt64(v_0_0_0.AuxInt)
15682 x := v_0_0_0.Args[0]
15683 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15684 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
15685 v1.AuxInt = int64ToAuxInt(c)
15688 b.resetWithControl(BlockPPC64GT, v0)
15691 // match: (GT (CMPconst [0] z:(AND x y)) yes no)
15692 // cond: z.Uses == 1
15693 // result: (GT (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
15694 for b.Controls[0].Op == OpPPC64CMPconst {
15695 v_0 := b.Controls[0]
15696 if auxIntToInt64(v_0.AuxInt) != 0 {
15700 if z.Op != OpPPC64AND {
15706 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15709 if !(z.Uses == 1) {
15712 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15713 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15716 b.resetWithControl(BlockPPC64GT, v0)
15721 // match: (GT (CMPconst [0] z:(OR x y)) yes no)
15722 // cond: z.Uses == 1
15723 // result: (GT (Select1 <types.TypeFlags> (ORCC x y)) yes no)
15724 for b.Controls[0].Op == OpPPC64CMPconst {
15725 v_0 := b.Controls[0]
15726 if auxIntToInt64(v_0.AuxInt) != 0 {
15730 if z.Op != OpPPC64OR {
15736 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15739 if !(z.Uses == 1) {
15742 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15743 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
15746 b.resetWithControl(BlockPPC64GT, v0)
15751 // match: (GT (CMPconst [0] z:(XOR x y)) yes no)
15752 // cond: z.Uses == 1
15753 // result: (GT (Select1 <types.TypeFlags> (XORCC x y)) yes no)
15754 for b.Controls[0].Op == OpPPC64CMPconst {
15755 v_0 := b.Controls[0]
15756 if auxIntToInt64(v_0.AuxInt) != 0 {
15760 if z.Op != OpPPC64XOR {
15766 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15769 if !(z.Uses == 1) {
15772 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15773 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
15776 b.resetWithControl(BlockPPC64GT, v0)
15782 // match: (If (Equal cc) yes no)
15783 // result: (EQ cc yes no)
15784 for b.Controls[0].Op == OpPPC64Equal {
15785 v_0 := b.Controls[0]
15787 b.resetWithControl(BlockPPC64EQ, cc)
15790 // match: (If (NotEqual cc) yes no)
15791 // result: (NE cc yes no)
15792 for b.Controls[0].Op == OpPPC64NotEqual {
15793 v_0 := b.Controls[0]
15795 b.resetWithControl(BlockPPC64NE, cc)
15798 // match: (If (LessThan cc) yes no)
15799 // result: (LT cc yes no)
15800 for b.Controls[0].Op == OpPPC64LessThan {
15801 v_0 := b.Controls[0]
15803 b.resetWithControl(BlockPPC64LT, cc)
15806 // match: (If (LessEqual cc) yes no)
15807 // result: (LE cc yes no)
15808 for b.Controls[0].Op == OpPPC64LessEqual {
15809 v_0 := b.Controls[0]
15811 b.resetWithControl(BlockPPC64LE, cc)
15814 // match: (If (GreaterThan cc) yes no)
15815 // result: (GT cc yes no)
15816 for b.Controls[0].Op == OpPPC64GreaterThan {
15817 v_0 := b.Controls[0]
15819 b.resetWithControl(BlockPPC64GT, cc)
15822 // match: (If (GreaterEqual cc) yes no)
15823 // result: (GE cc yes no)
15824 for b.Controls[0].Op == OpPPC64GreaterEqual {
15825 v_0 := b.Controls[0]
15827 b.resetWithControl(BlockPPC64GE, cc)
15830 // match: (If (FLessThan cc) yes no)
15831 // result: (FLT cc yes no)
15832 for b.Controls[0].Op == OpPPC64FLessThan {
15833 v_0 := b.Controls[0]
15835 b.resetWithControl(BlockPPC64FLT, cc)
15838 // match: (If (FLessEqual cc) yes no)
15839 // result: (FLE cc yes no)
15840 for b.Controls[0].Op == OpPPC64FLessEqual {
15841 v_0 := b.Controls[0]
15843 b.resetWithControl(BlockPPC64FLE, cc)
15846 // match: (If (FGreaterThan cc) yes no)
15847 // result: (FGT cc yes no)
15848 for b.Controls[0].Op == OpPPC64FGreaterThan {
15849 v_0 := b.Controls[0]
15851 b.resetWithControl(BlockPPC64FGT, cc)
15854 // match: (If (FGreaterEqual cc) yes no)
15855 // result: (FGE cc yes no)
15856 for b.Controls[0].Op == OpPPC64FGreaterEqual {
15857 v_0 := b.Controls[0]
15859 b.resetWithControl(BlockPPC64FGE, cc)
15862 // match: (If cond yes no)
15863 // result: (NE (CMPWconst [0] (Select0 <typ.UInt32> (ANDCCconst [1] cond))) yes no)
15865 cond := b.Controls[0]
15866 v0 := b.NewValue0(cond.Pos, OpPPC64CMPWconst, types.TypeFlags)
15867 v0.AuxInt = int32ToAuxInt(0)
15868 v1 := b.NewValue0(cond.Pos, OpSelect0, typ.UInt32)
15869 v2 := b.NewValue0(cond.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
15870 v2.AuxInt = int64ToAuxInt(1)
15874 b.resetWithControl(BlockPPC64NE, v0)
15878 // match: (LE (FlagEQ) yes no)
15879 // result: (First yes no)
15880 for b.Controls[0].Op == OpPPC64FlagEQ {
15881 b.Reset(BlockFirst)
15884 // match: (LE (FlagLT) yes no)
15885 // result: (First yes no)
15886 for b.Controls[0].Op == OpPPC64FlagLT {
15887 b.Reset(BlockFirst)
15890 // match: (LE (FlagGT) yes no)
15891 // result: (First no yes)
15892 for b.Controls[0].Op == OpPPC64FlagGT {
15893 b.Reset(BlockFirst)
15897 // match: (LE (InvertFlags cmp) yes no)
15898 // result: (GE cmp yes no)
15899 for b.Controls[0].Op == OpPPC64InvertFlags {
15900 v_0 := b.Controls[0]
15902 b.resetWithControl(BlockPPC64GE, cmp)
15905 // match: (LE (CMPconst [0] (Select0 (ANDCCconst [c] x))) yes no)
15906 // result: (LE (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no)
15907 for b.Controls[0].Op == OpPPC64CMPconst {
15908 v_0 := b.Controls[0]
15909 if auxIntToInt64(v_0.AuxInt) != 0 {
15912 v_0_0 := v_0.Args[0]
15913 if v_0_0.Op != OpSelect0 {
15916 v_0_0_0 := v_0_0.Args[0]
15917 if v_0_0_0.Op != OpPPC64ANDCCconst {
15920 c := auxIntToInt64(v_0_0_0.AuxInt)
15921 x := v_0_0_0.Args[0]
15922 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15923 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
15924 v1.AuxInt = int64ToAuxInt(c)
15927 b.resetWithControl(BlockPPC64LE, v0)
15930 // match: (LE (CMPWconst [0] (Select0 (ANDCCconst [c] x))) yes no)
15931 // result: (LE (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no)
15932 for b.Controls[0].Op == OpPPC64CMPWconst {
15933 v_0 := b.Controls[0]
15934 if auxIntToInt32(v_0.AuxInt) != 0 {
15937 v_0_0 := v_0.Args[0]
15938 if v_0_0.Op != OpSelect0 {
15941 v_0_0_0 := v_0_0.Args[0]
15942 if v_0_0_0.Op != OpPPC64ANDCCconst {
15945 c := auxIntToInt64(v_0_0_0.AuxInt)
15946 x := v_0_0_0.Args[0]
15947 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15948 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
15949 v1.AuxInt = int64ToAuxInt(c)
15952 b.resetWithControl(BlockPPC64LE, v0)
15955 // match: (LE (CMPconst [0] z:(AND x y)) yes no)
15956 // cond: z.Uses == 1
15957 // result: (LE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
15958 for b.Controls[0].Op == OpPPC64CMPconst {
15959 v_0 := b.Controls[0]
15960 if auxIntToInt64(v_0.AuxInt) != 0 {
15964 if z.Op != OpPPC64AND {
15970 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15973 if !(z.Uses == 1) {
15976 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15977 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15980 b.resetWithControl(BlockPPC64LE, v0)
15985 // match: (LE (CMPconst [0] z:(OR x y)) yes no)
15986 // cond: z.Uses == 1
15987 // result: (LE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
15988 for b.Controls[0].Op == OpPPC64CMPconst {
15989 v_0 := b.Controls[0]
15990 if auxIntToInt64(v_0.AuxInt) != 0 {
15994 if z.Op != OpPPC64OR {
16000 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16003 if !(z.Uses == 1) {
16006 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16007 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
16010 b.resetWithControl(BlockPPC64LE, v0)
16015 // match: (LE (CMPconst [0] z:(XOR x y)) yes no)
16016 // cond: z.Uses == 1
16017 // result: (LE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
16018 for b.Controls[0].Op == OpPPC64CMPconst {
16019 v_0 := b.Controls[0]
16020 if auxIntToInt64(v_0.AuxInt) != 0 {
16024 if z.Op != OpPPC64XOR {
16030 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16033 if !(z.Uses == 1) {
16036 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16037 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
16040 b.resetWithControl(BlockPPC64LE, v0)
16046 // match: (LT (FlagEQ) yes no)
16047 // result: (First no yes)
16048 for b.Controls[0].Op == OpPPC64FlagEQ {
16049 b.Reset(BlockFirst)
16053 // match: (LT (FlagLT) yes no)
16054 // result: (First yes no)
16055 for b.Controls[0].Op == OpPPC64FlagLT {
16056 b.Reset(BlockFirst)
16059 // match: (LT (FlagGT) yes no)
16060 // result: (First no yes)
16061 for b.Controls[0].Op == OpPPC64FlagGT {
16062 b.Reset(BlockFirst)
16066 // match: (LT (InvertFlags cmp) yes no)
16067 // result: (GT cmp yes no)
16068 for b.Controls[0].Op == OpPPC64InvertFlags {
16069 v_0 := b.Controls[0]
16071 b.resetWithControl(BlockPPC64GT, cmp)
16074 // match: (LT (CMPconst [0] (Select0 (ANDCCconst [c] x))) yes no)
16075 // result: (LT (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no)
16076 for b.Controls[0].Op == OpPPC64CMPconst {
16077 v_0 := b.Controls[0]
16078 if auxIntToInt64(v_0.AuxInt) != 0 {
16081 v_0_0 := v_0.Args[0]
16082 if v_0_0.Op != OpSelect0 {
16085 v_0_0_0 := v_0_0.Args[0]
16086 if v_0_0_0.Op != OpPPC64ANDCCconst {
16089 c := auxIntToInt64(v_0_0_0.AuxInt)
16090 x := v_0_0_0.Args[0]
16091 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16092 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
16093 v1.AuxInt = int64ToAuxInt(c)
16096 b.resetWithControl(BlockPPC64LT, v0)
16099 // match: (LT (CMPWconst [0] (Select0 (ANDCCconst [c] x))) yes no)
16100 // result: (LT (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no)
16101 for b.Controls[0].Op == OpPPC64CMPWconst {
16102 v_0 := b.Controls[0]
16103 if auxIntToInt32(v_0.AuxInt) != 0 {
16106 v_0_0 := v_0.Args[0]
16107 if v_0_0.Op != OpSelect0 {
16110 v_0_0_0 := v_0_0.Args[0]
16111 if v_0_0_0.Op != OpPPC64ANDCCconst {
16114 c := auxIntToInt64(v_0_0_0.AuxInt)
16115 x := v_0_0_0.Args[0]
16116 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16117 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
16118 v1.AuxInt = int64ToAuxInt(c)
16121 b.resetWithControl(BlockPPC64LT, v0)
16124 // match: (LT (CMPconst [0] z:(AND x y)) yes no)
16125 // cond: z.Uses == 1
16126 // result: (LT (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
16127 for b.Controls[0].Op == OpPPC64CMPconst {
16128 v_0 := b.Controls[0]
16129 if auxIntToInt64(v_0.AuxInt) != 0 {
16133 if z.Op != OpPPC64AND {
16139 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16142 if !(z.Uses == 1) {
16145 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16146 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
16149 b.resetWithControl(BlockPPC64LT, v0)
16154 // match: (LT (CMPconst [0] z:(OR x y)) yes no)
16155 // cond: z.Uses == 1
16156 // result: (LT (Select1 <types.TypeFlags> (ORCC x y)) yes no)
16157 for b.Controls[0].Op == OpPPC64CMPconst {
16158 v_0 := b.Controls[0]
16159 if auxIntToInt64(v_0.AuxInt) != 0 {
16163 if z.Op != OpPPC64OR {
16169 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16172 if !(z.Uses == 1) {
16175 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16176 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
16179 b.resetWithControl(BlockPPC64LT, v0)
16184 // match: (LT (CMPconst [0] z:(XOR x y)) yes no)
16185 // cond: z.Uses == 1
16186 // result: (LT (Select1 <types.TypeFlags> (XORCC x y)) yes no)
16187 for b.Controls[0].Op == OpPPC64CMPconst {
16188 v_0 := b.Controls[0]
16189 if auxIntToInt64(v_0.AuxInt) != 0 {
16193 if z.Op != OpPPC64XOR {
16199 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16202 if !(z.Uses == 1) {
16205 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16206 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
16209 b.resetWithControl(BlockPPC64LT, v0)
16215 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (Equal cc)))) yes no)
16216 // result: (EQ cc yes no)
16217 for b.Controls[0].Op == OpPPC64CMPWconst {
16218 v_0 := b.Controls[0]
16219 if auxIntToInt32(v_0.AuxInt) != 0 {
16222 v_0_0 := v_0.Args[0]
16223 if v_0_0.Op != OpSelect0 {
16226 v_0_0_0 := v_0_0.Args[0]
16227 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16230 v_0_0_0_0 := v_0_0_0.Args[0]
16231 if v_0_0_0_0.Op != OpPPC64Equal {
16234 cc := v_0_0_0_0.Args[0]
16235 b.resetWithControl(BlockPPC64EQ, cc)
16238 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (NotEqual cc)))) yes no)
16239 // result: (NE cc yes no)
16240 for b.Controls[0].Op == OpPPC64CMPWconst {
16241 v_0 := b.Controls[0]
16242 if auxIntToInt32(v_0.AuxInt) != 0 {
16245 v_0_0 := v_0.Args[0]
16246 if v_0_0.Op != OpSelect0 {
16249 v_0_0_0 := v_0_0.Args[0]
16250 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16253 v_0_0_0_0 := v_0_0_0.Args[0]
16254 if v_0_0_0_0.Op != OpPPC64NotEqual {
16257 cc := v_0_0_0_0.Args[0]
16258 b.resetWithControl(BlockPPC64NE, cc)
16261 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (LessThan cc)))) yes no)
16262 // result: (LT cc yes no)
16263 for b.Controls[0].Op == OpPPC64CMPWconst {
16264 v_0 := b.Controls[0]
16265 if auxIntToInt32(v_0.AuxInt) != 0 {
16268 v_0_0 := v_0.Args[0]
16269 if v_0_0.Op != OpSelect0 {
16272 v_0_0_0 := v_0_0.Args[0]
16273 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16276 v_0_0_0_0 := v_0_0_0.Args[0]
16277 if v_0_0_0_0.Op != OpPPC64LessThan {
16280 cc := v_0_0_0_0.Args[0]
16281 b.resetWithControl(BlockPPC64LT, cc)
16284 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (LessEqual cc)))) yes no)
16285 // result: (LE cc yes no)
16286 for b.Controls[0].Op == OpPPC64CMPWconst {
16287 v_0 := b.Controls[0]
16288 if auxIntToInt32(v_0.AuxInt) != 0 {
16291 v_0_0 := v_0.Args[0]
16292 if v_0_0.Op != OpSelect0 {
16295 v_0_0_0 := v_0_0.Args[0]
16296 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16299 v_0_0_0_0 := v_0_0_0.Args[0]
16300 if v_0_0_0_0.Op != OpPPC64LessEqual {
16303 cc := v_0_0_0_0.Args[0]
16304 b.resetWithControl(BlockPPC64LE, cc)
16307 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (GreaterThan cc)))) yes no)
16308 // result: (GT cc yes no)
16309 for b.Controls[0].Op == OpPPC64CMPWconst {
16310 v_0 := b.Controls[0]
16311 if auxIntToInt32(v_0.AuxInt) != 0 {
16314 v_0_0 := v_0.Args[0]
16315 if v_0_0.Op != OpSelect0 {
16318 v_0_0_0 := v_0_0.Args[0]
16319 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16322 v_0_0_0_0 := v_0_0_0.Args[0]
16323 if v_0_0_0_0.Op != OpPPC64GreaterThan {
16326 cc := v_0_0_0_0.Args[0]
16327 b.resetWithControl(BlockPPC64GT, cc)
16330 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (GreaterEqual cc)))) yes no)
16331 // result: (GE cc yes no)
16332 for b.Controls[0].Op == OpPPC64CMPWconst {
16333 v_0 := b.Controls[0]
16334 if auxIntToInt32(v_0.AuxInt) != 0 {
16337 v_0_0 := v_0.Args[0]
16338 if v_0_0.Op != OpSelect0 {
16341 v_0_0_0 := v_0_0.Args[0]
16342 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16345 v_0_0_0_0 := v_0_0_0.Args[0]
16346 if v_0_0_0_0.Op != OpPPC64GreaterEqual {
16349 cc := v_0_0_0_0.Args[0]
16350 b.resetWithControl(BlockPPC64GE, cc)
16353 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (FLessThan cc)))) yes no)
16354 // result: (FLT cc yes no)
16355 for b.Controls[0].Op == OpPPC64CMPWconst {
16356 v_0 := b.Controls[0]
16357 if auxIntToInt32(v_0.AuxInt) != 0 {
16360 v_0_0 := v_0.Args[0]
16361 if v_0_0.Op != OpSelect0 {
16364 v_0_0_0 := v_0_0.Args[0]
16365 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16368 v_0_0_0_0 := v_0_0_0.Args[0]
16369 if v_0_0_0_0.Op != OpPPC64FLessThan {
16372 cc := v_0_0_0_0.Args[0]
16373 b.resetWithControl(BlockPPC64FLT, cc)
16376 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (FLessEqual cc)))) yes no)
16377 // result: (FLE cc yes no)
16378 for b.Controls[0].Op == OpPPC64CMPWconst {
16379 v_0 := b.Controls[0]
16380 if auxIntToInt32(v_0.AuxInt) != 0 {
16383 v_0_0 := v_0.Args[0]
16384 if v_0_0.Op != OpSelect0 {
16387 v_0_0_0 := v_0_0.Args[0]
16388 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16391 v_0_0_0_0 := v_0_0_0.Args[0]
16392 if v_0_0_0_0.Op != OpPPC64FLessEqual {
16395 cc := v_0_0_0_0.Args[0]
16396 b.resetWithControl(BlockPPC64FLE, cc)
16399 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (FGreaterThan cc)))) yes no)
16400 // result: (FGT cc yes no)
16401 for b.Controls[0].Op == OpPPC64CMPWconst {
16402 v_0 := b.Controls[0]
16403 if auxIntToInt32(v_0.AuxInt) != 0 {
16406 v_0_0 := v_0.Args[0]
16407 if v_0_0.Op != OpSelect0 {
16410 v_0_0_0 := v_0_0.Args[0]
16411 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16414 v_0_0_0_0 := v_0_0_0.Args[0]
16415 if v_0_0_0_0.Op != OpPPC64FGreaterThan {
16418 cc := v_0_0_0_0.Args[0]
16419 b.resetWithControl(BlockPPC64FGT, cc)
16422 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (FGreaterEqual cc)))) yes no)
16423 // result: (FGE cc yes no)
16424 for b.Controls[0].Op == OpPPC64CMPWconst {
16425 v_0 := b.Controls[0]
16426 if auxIntToInt32(v_0.AuxInt) != 0 {
16429 v_0_0 := v_0.Args[0]
16430 if v_0_0.Op != OpSelect0 {
16433 v_0_0_0 := v_0_0.Args[0]
16434 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16437 v_0_0_0_0 := v_0_0_0.Args[0]
16438 if v_0_0_0_0.Op != OpPPC64FGreaterEqual {
16441 cc := v_0_0_0_0.Args[0]
16442 b.resetWithControl(BlockPPC64FGE, cc)
16445 // match: (NE (CMPconst [0] (Select0 (ANDCCconst [c] x))) yes no)
16446 // result: (NE (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no)
16447 for b.Controls[0].Op == OpPPC64CMPconst {
16448 v_0 := b.Controls[0]
16449 if auxIntToInt64(v_0.AuxInt) != 0 {
16452 v_0_0 := v_0.Args[0]
16453 if v_0_0.Op != OpSelect0 {
16456 v_0_0_0 := v_0_0.Args[0]
16457 if v_0_0_0.Op != OpPPC64ANDCCconst {
16460 c := auxIntToInt64(v_0_0_0.AuxInt)
16461 x := v_0_0_0.Args[0]
16462 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16463 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
16464 v1.AuxInt = int64ToAuxInt(c)
16467 b.resetWithControl(BlockPPC64NE, v0)
16470 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [c] x))) yes no)
16471 // result: (NE (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no)
16472 for b.Controls[0].Op == OpPPC64CMPWconst {
16473 v_0 := b.Controls[0]
16474 if auxIntToInt32(v_0.AuxInt) != 0 {
16477 v_0_0 := v_0.Args[0]
16478 if v_0_0.Op != OpSelect0 {
16481 v_0_0_0 := v_0_0.Args[0]
16482 if v_0_0_0.Op != OpPPC64ANDCCconst {
16485 c := auxIntToInt64(v_0_0_0.AuxInt)
16486 x := v_0_0_0.Args[0]
16487 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16488 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
16489 v1.AuxInt = int64ToAuxInt(c)
16492 b.resetWithControl(BlockPPC64NE, v0)
16495 // match: (NE (FlagEQ) yes no)
16496 // result: (First no yes)
16497 for b.Controls[0].Op == OpPPC64FlagEQ {
16498 b.Reset(BlockFirst)
16502 // match: (NE (FlagLT) yes no)
16503 // result: (First yes no)
16504 for b.Controls[0].Op == OpPPC64FlagLT {
16505 b.Reset(BlockFirst)
16508 // match: (NE (FlagGT) yes no)
16509 // result: (First yes no)
16510 for b.Controls[0].Op == OpPPC64FlagGT {
16511 b.Reset(BlockFirst)
16514 // match: (NE (InvertFlags cmp) yes no)
16515 // result: (NE cmp yes no)
16516 for b.Controls[0].Op == OpPPC64InvertFlags {
16517 v_0 := b.Controls[0]
16519 b.resetWithControl(BlockPPC64NE, cmp)
16522 // match: (NE (CMPconst [0] (Select0 (ANDCCconst [c] x))) yes no)
16523 // result: (NE (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no)
16524 for b.Controls[0].Op == OpPPC64CMPconst {
16525 v_0 := b.Controls[0]
16526 if auxIntToInt64(v_0.AuxInt) != 0 {
16529 v_0_0 := v_0.Args[0]
16530 if v_0_0.Op != OpSelect0 {
16533 v_0_0_0 := v_0_0.Args[0]
16534 if v_0_0_0.Op != OpPPC64ANDCCconst {
16537 c := auxIntToInt64(v_0_0_0.AuxInt)
16538 x := v_0_0_0.Args[0]
16539 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16540 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
16541 v1.AuxInt = int64ToAuxInt(c)
16544 b.resetWithControl(BlockPPC64NE, v0)
16547 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [c] x))) yes no)
16548 // result: (NE (Select1 <types.TypeFlags> (ANDCCconst [c] x)) yes no)
16549 for b.Controls[0].Op == OpPPC64CMPWconst {
16550 v_0 := b.Controls[0]
16551 if auxIntToInt32(v_0.AuxInt) != 0 {
16554 v_0_0 := v_0.Args[0]
16555 if v_0_0.Op != OpSelect0 {
16558 v_0_0_0 := v_0_0.Args[0]
16559 if v_0_0_0.Op != OpPPC64ANDCCconst {
16562 c := auxIntToInt64(v_0_0_0.AuxInt)
16563 x := v_0_0_0.Args[0]
16564 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16565 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
16566 v1.AuxInt = int64ToAuxInt(c)
16569 b.resetWithControl(BlockPPC64NE, v0)
16572 // match: (NE (CMPconst [0] z:(AND x y)) yes no)
16573 // cond: z.Uses == 1
16574 // result: (NE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
16575 for b.Controls[0].Op == OpPPC64CMPconst {
16576 v_0 := b.Controls[0]
16577 if auxIntToInt64(v_0.AuxInt) != 0 {
16581 if z.Op != OpPPC64AND {
16587 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16590 if !(z.Uses == 1) {
16593 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16594 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
16597 b.resetWithControl(BlockPPC64NE, v0)
16602 // match: (NE (CMPconst [0] z:(OR x y)) yes no)
16603 // cond: z.Uses == 1
16604 // result: (NE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
16605 for b.Controls[0].Op == OpPPC64CMPconst {
16606 v_0 := b.Controls[0]
16607 if auxIntToInt64(v_0.AuxInt) != 0 {
16611 if z.Op != OpPPC64OR {
16617 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16620 if !(z.Uses == 1) {
16623 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16624 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
16627 b.resetWithControl(BlockPPC64NE, v0)
16632 // match: (NE (CMPconst [0] z:(XOR x y)) yes no)
16633 // cond: z.Uses == 1
16634 // result: (NE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
16635 for b.Controls[0].Op == OpPPC64CMPconst {
16636 v_0 := b.Controls[0]
16637 if auxIntToInt64(v_0.AuxInt) != 0 {
16641 if z.Op != OpPPC64XOR {
16647 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16650 if !(z.Uses == 1) {
16653 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16654 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
16657 b.resetWithControl(BlockPPC64NE, v0)