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 OpPPC64MOVDaddr:
537 return rewriteValuePPC64_OpPPC64MOVDaddr(v)
538 case OpPPC64MOVDload:
539 return rewriteValuePPC64_OpPPC64MOVDload(v)
540 case OpPPC64MOVDloadidx:
541 return rewriteValuePPC64_OpPPC64MOVDloadidx(v)
542 case OpPPC64MOVDstore:
543 return rewriteValuePPC64_OpPPC64MOVDstore(v)
544 case OpPPC64MOVDstoreidx:
545 return rewriteValuePPC64_OpPPC64MOVDstoreidx(v)
546 case OpPPC64MOVDstorezero:
547 return rewriteValuePPC64_OpPPC64MOVDstorezero(v)
548 case OpPPC64MOVHBRstore:
549 return rewriteValuePPC64_OpPPC64MOVHBRstore(v)
550 case OpPPC64MOVHZload:
551 return rewriteValuePPC64_OpPPC64MOVHZload(v)
552 case OpPPC64MOVHZloadidx:
553 return rewriteValuePPC64_OpPPC64MOVHZloadidx(v)
554 case OpPPC64MOVHZreg:
555 return rewriteValuePPC64_OpPPC64MOVHZreg(v)
556 case OpPPC64MOVHload:
557 return rewriteValuePPC64_OpPPC64MOVHload(v)
558 case OpPPC64MOVHloadidx:
559 return rewriteValuePPC64_OpPPC64MOVHloadidx(v)
561 return rewriteValuePPC64_OpPPC64MOVHreg(v)
562 case OpPPC64MOVHstore:
563 return rewriteValuePPC64_OpPPC64MOVHstore(v)
564 case OpPPC64MOVHstoreidx:
565 return rewriteValuePPC64_OpPPC64MOVHstoreidx(v)
566 case OpPPC64MOVHstorezero:
567 return rewriteValuePPC64_OpPPC64MOVHstorezero(v)
568 case OpPPC64MOVWBRstore:
569 return rewriteValuePPC64_OpPPC64MOVWBRstore(v)
570 case OpPPC64MOVWZload:
571 return rewriteValuePPC64_OpPPC64MOVWZload(v)
572 case OpPPC64MOVWZloadidx:
573 return rewriteValuePPC64_OpPPC64MOVWZloadidx(v)
574 case OpPPC64MOVWZreg:
575 return rewriteValuePPC64_OpPPC64MOVWZreg(v)
576 case OpPPC64MOVWload:
577 return rewriteValuePPC64_OpPPC64MOVWload(v)
578 case OpPPC64MOVWloadidx:
579 return rewriteValuePPC64_OpPPC64MOVWloadidx(v)
581 return rewriteValuePPC64_OpPPC64MOVWreg(v)
582 case OpPPC64MOVWstore:
583 return rewriteValuePPC64_OpPPC64MOVWstore(v)
584 case OpPPC64MOVWstoreidx:
585 return rewriteValuePPC64_OpPPC64MOVWstoreidx(v)
586 case OpPPC64MOVWstorezero:
587 return rewriteValuePPC64_OpPPC64MOVWstorezero(v)
589 return rewriteValuePPC64_OpPPC64MTVSRD(v)
591 return rewriteValuePPC64_OpPPC64MULLD(v)
593 return rewriteValuePPC64_OpPPC64MULLW(v)
595 return rewriteValuePPC64_OpPPC64NEG(v)
597 return rewriteValuePPC64_OpPPC64NOR(v)
598 case OpPPC64NotEqual:
599 return rewriteValuePPC64_OpPPC64NotEqual(v)
601 return rewriteValuePPC64_OpPPC64OR(v)
603 return rewriteValuePPC64_OpPPC64ORN(v)
605 return rewriteValuePPC64_OpPPC64ORconst(v)
607 return rewriteValuePPC64_OpPPC64ROTL(v)
609 return rewriteValuePPC64_OpPPC64ROTLW(v)
610 case OpPPC64ROTLWconst:
611 return rewriteValuePPC64_OpPPC64ROTLWconst(v)
613 return rewriteValuePPC64_OpPPC64SETBC(v)
615 return rewriteValuePPC64_OpPPC64SETBCR(v)
617 return rewriteValuePPC64_OpPPC64SLD(v)
618 case OpPPC64SLDconst:
619 return rewriteValuePPC64_OpPPC64SLDconst(v)
621 return rewriteValuePPC64_OpPPC64SLW(v)
622 case OpPPC64SLWconst:
623 return rewriteValuePPC64_OpPPC64SLWconst(v)
625 return rewriteValuePPC64_OpPPC64SRAD(v)
627 return rewriteValuePPC64_OpPPC64SRAW(v)
629 return rewriteValuePPC64_OpPPC64SRD(v)
631 return rewriteValuePPC64_OpPPC64SRW(v)
632 case OpPPC64SRWconst:
633 return rewriteValuePPC64_OpPPC64SRWconst(v)
635 return rewriteValuePPC64_OpPPC64SUB(v)
637 return rewriteValuePPC64_OpPPC64SUBE(v)
638 case OpPPC64SUBFCconst:
639 return rewriteValuePPC64_OpPPC64SUBFCconst(v)
641 return rewriteValuePPC64_OpPPC64XOR(v)
642 case OpPPC64XORconst:
643 return rewriteValuePPC64_OpPPC64XORconst(v)
645 return rewriteValuePPC64_OpPanicBounds(v)
647 return rewriteValuePPC64_OpPopCount16(v)
649 return rewriteValuePPC64_OpPopCount32(v)
651 v.Op = OpPPC64POPCNTD
654 return rewriteValuePPC64_OpPopCount8(v)
655 case OpPrefetchCache:
656 return rewriteValuePPC64_OpPrefetchCache(v)
657 case OpPrefetchCacheStreamed:
658 return rewriteValuePPC64_OpPrefetchCacheStreamed(v)
660 v.Op = OpPPC64LoweredPubBarrier
663 return rewriteValuePPC64_OpRotateLeft16(v)
671 return rewriteValuePPC64_OpRotateLeft8(v)
676 v.Op = OpPPC64LoweredRound32F
679 v.Op = OpPPC64LoweredRound64F
682 return rewriteValuePPC64_OpRsh16Ux16(v)
684 return rewriteValuePPC64_OpRsh16Ux32(v)
686 return rewriteValuePPC64_OpRsh16Ux64(v)
688 return rewriteValuePPC64_OpRsh16Ux8(v)
690 return rewriteValuePPC64_OpRsh16x16(v)
692 return rewriteValuePPC64_OpRsh16x32(v)
694 return rewriteValuePPC64_OpRsh16x64(v)
696 return rewriteValuePPC64_OpRsh16x8(v)
698 return rewriteValuePPC64_OpRsh32Ux16(v)
700 return rewriteValuePPC64_OpRsh32Ux32(v)
702 return rewriteValuePPC64_OpRsh32Ux64(v)
704 return rewriteValuePPC64_OpRsh32Ux8(v)
706 return rewriteValuePPC64_OpRsh32x16(v)
708 return rewriteValuePPC64_OpRsh32x32(v)
710 return rewriteValuePPC64_OpRsh32x64(v)
712 return rewriteValuePPC64_OpRsh32x8(v)
714 return rewriteValuePPC64_OpRsh64Ux16(v)
716 return rewriteValuePPC64_OpRsh64Ux32(v)
718 return rewriteValuePPC64_OpRsh64Ux64(v)
720 return rewriteValuePPC64_OpRsh64Ux8(v)
722 return rewriteValuePPC64_OpRsh64x16(v)
724 return rewriteValuePPC64_OpRsh64x32(v)
726 return rewriteValuePPC64_OpRsh64x64(v)
728 return rewriteValuePPC64_OpRsh64x8(v)
730 return rewriteValuePPC64_OpRsh8Ux16(v)
732 return rewriteValuePPC64_OpRsh8Ux32(v)
734 return rewriteValuePPC64_OpRsh8Ux64(v)
736 return rewriteValuePPC64_OpRsh8Ux8(v)
738 return rewriteValuePPC64_OpRsh8x16(v)
740 return rewriteValuePPC64_OpRsh8x32(v)
742 return rewriteValuePPC64_OpRsh8x64(v)
744 return rewriteValuePPC64_OpRsh8x8(v)
746 return rewriteValuePPC64_OpSelect0(v)
748 return rewriteValuePPC64_OpSelect1(v)
750 return rewriteValuePPC64_OpSelectN(v)
751 case OpSignExt16to32:
752 v.Op = OpPPC64MOVHreg
754 case OpSignExt16to64:
755 v.Op = OpPPC64MOVHreg
757 case OpSignExt32to64:
758 v.Op = OpPPC64MOVWreg
761 v.Op = OpPPC64MOVBreg
764 v.Op = OpPPC64MOVBreg
767 v.Op = OpPPC64MOVBreg
770 return rewriteValuePPC64_OpSlicemask(v)
778 v.Op = OpPPC64CALLstatic
781 return rewriteValuePPC64_OpStore(v)
804 v.Op = OpPPC64CALLtail
810 return rewriteValuePPC64_OpTrunc16to8(v)
812 return rewriteValuePPC64_OpTrunc32to16(v)
814 return rewriteValuePPC64_OpTrunc32to8(v)
816 return rewriteValuePPC64_OpTrunc64to16(v)
818 return rewriteValuePPC64_OpTrunc64to32(v)
820 return rewriteValuePPC64_OpTrunc64to8(v)
822 v.Op = OpPPC64LoweredWB
837 return rewriteValuePPC64_OpZero(v)
838 case OpZeroExt16to32:
839 v.Op = OpPPC64MOVHZreg
841 case OpZeroExt16to64:
842 v.Op = OpPPC64MOVHZreg
844 case OpZeroExt32to64:
845 v.Op = OpPPC64MOVWZreg
848 v.Op = OpPPC64MOVBZreg
851 v.Op = OpPPC64MOVBZreg
854 v.Op = OpPPC64MOVBZreg
859 func rewriteValuePPC64_OpAddr(v *Value) bool {
861 // match: (Addr {sym} base)
862 // result: (MOVDaddr {sym} [0] base)
864 sym := auxToSym(v.Aux)
866 v.reset(OpPPC64MOVDaddr)
867 v.AuxInt = int32ToAuxInt(0)
868 v.Aux = symToAux(sym)
873 func rewriteValuePPC64_OpAtomicCompareAndSwap32(v *Value) bool {
878 // match: (AtomicCompareAndSwap32 ptr old new_ mem)
879 // result: (LoweredAtomicCas32 [1] ptr old new_ mem)
885 v.reset(OpPPC64LoweredAtomicCas32)
886 v.AuxInt = int64ToAuxInt(1)
887 v.AddArg4(ptr, old, new_, mem)
891 func rewriteValuePPC64_OpAtomicCompareAndSwap64(v *Value) bool {
896 // match: (AtomicCompareAndSwap64 ptr old new_ mem)
897 // result: (LoweredAtomicCas64 [1] ptr old new_ mem)
903 v.reset(OpPPC64LoweredAtomicCas64)
904 v.AuxInt = int64ToAuxInt(1)
905 v.AddArg4(ptr, old, new_, mem)
909 func rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v *Value) bool {
914 // match: (AtomicCompareAndSwapRel32 ptr old new_ mem)
915 // result: (LoweredAtomicCas32 [0] ptr old new_ mem)
921 v.reset(OpPPC64LoweredAtomicCas32)
922 v.AuxInt = int64ToAuxInt(0)
923 v.AddArg4(ptr, old, new_, mem)
927 func rewriteValuePPC64_OpAtomicLoad32(v *Value) bool {
930 // match: (AtomicLoad32 ptr mem)
931 // result: (LoweredAtomicLoad32 [1] ptr mem)
935 v.reset(OpPPC64LoweredAtomicLoad32)
936 v.AuxInt = int64ToAuxInt(1)
941 func rewriteValuePPC64_OpAtomicLoad64(v *Value) bool {
944 // match: (AtomicLoad64 ptr mem)
945 // result: (LoweredAtomicLoad64 [1] ptr mem)
949 v.reset(OpPPC64LoweredAtomicLoad64)
950 v.AuxInt = int64ToAuxInt(1)
955 func rewriteValuePPC64_OpAtomicLoad8(v *Value) bool {
958 // match: (AtomicLoad8 ptr mem)
959 // result: (LoweredAtomicLoad8 [1] ptr mem)
963 v.reset(OpPPC64LoweredAtomicLoad8)
964 v.AuxInt = int64ToAuxInt(1)
969 func rewriteValuePPC64_OpAtomicLoadAcq32(v *Value) bool {
972 // match: (AtomicLoadAcq32 ptr mem)
973 // result: (LoweredAtomicLoad32 [0] ptr mem)
977 v.reset(OpPPC64LoweredAtomicLoad32)
978 v.AuxInt = int64ToAuxInt(0)
983 func rewriteValuePPC64_OpAtomicLoadAcq64(v *Value) bool {
986 // match: (AtomicLoadAcq64 ptr mem)
987 // result: (LoweredAtomicLoad64 [0] ptr mem)
991 v.reset(OpPPC64LoweredAtomicLoad64)
992 v.AuxInt = int64ToAuxInt(0)
997 func rewriteValuePPC64_OpAtomicLoadPtr(v *Value) bool {
1000 // match: (AtomicLoadPtr ptr mem)
1001 // result: (LoweredAtomicLoadPtr [1] ptr mem)
1005 v.reset(OpPPC64LoweredAtomicLoadPtr)
1006 v.AuxInt = int64ToAuxInt(1)
1011 func rewriteValuePPC64_OpAtomicStore32(v *Value) bool {
1015 // match: (AtomicStore32 ptr val mem)
1016 // result: (LoweredAtomicStore32 [1] ptr val mem)
1021 v.reset(OpPPC64LoweredAtomicStore32)
1022 v.AuxInt = int64ToAuxInt(1)
1023 v.AddArg3(ptr, val, mem)
1027 func rewriteValuePPC64_OpAtomicStore64(v *Value) bool {
1031 // match: (AtomicStore64 ptr val mem)
1032 // result: (LoweredAtomicStore64 [1] ptr val mem)
1037 v.reset(OpPPC64LoweredAtomicStore64)
1038 v.AuxInt = int64ToAuxInt(1)
1039 v.AddArg3(ptr, val, mem)
1043 func rewriteValuePPC64_OpAtomicStore8(v *Value) bool {
1047 // match: (AtomicStore8 ptr val mem)
1048 // result: (LoweredAtomicStore8 [1] ptr val mem)
1053 v.reset(OpPPC64LoweredAtomicStore8)
1054 v.AuxInt = int64ToAuxInt(1)
1055 v.AddArg3(ptr, val, mem)
1059 func rewriteValuePPC64_OpAtomicStoreRel32(v *Value) bool {
1063 // match: (AtomicStoreRel32 ptr val mem)
1064 // result: (LoweredAtomicStore32 [0] ptr val mem)
1069 v.reset(OpPPC64LoweredAtomicStore32)
1070 v.AuxInt = int64ToAuxInt(0)
1071 v.AddArg3(ptr, val, mem)
1075 func rewriteValuePPC64_OpAtomicStoreRel64(v *Value) bool {
1079 // match: (AtomicStoreRel64 ptr val mem)
1080 // result: (LoweredAtomicStore64 [0] ptr val mem)
1085 v.reset(OpPPC64LoweredAtomicStore64)
1086 v.AuxInt = int64ToAuxInt(0)
1087 v.AddArg3(ptr, val, mem)
1091 func rewriteValuePPC64_OpAvg64u(v *Value) bool {
1095 // match: (Avg64u <t> x y)
1096 // result: (ADD (SRDconst <t> (SUB <t> x y) [1]) y)
1102 v0 := b.NewValue0(v.Pos, OpPPC64SRDconst, t)
1103 v0.AuxInt = int64ToAuxInt(1)
1104 v1 := b.NewValue0(v.Pos, OpPPC64SUB, t)
1111 func rewriteValuePPC64_OpBitLen32(v *Value) bool {
1114 typ := &b.Func.Config.Types
1115 // match: (BitLen32 x)
1116 // result: (SUBFCconst [32] (CNTLZW <typ.Int> x))
1119 v.reset(OpPPC64SUBFCconst)
1120 v.AuxInt = int64ToAuxInt(32)
1121 v0 := b.NewValue0(v.Pos, OpPPC64CNTLZW, typ.Int)
1127 func rewriteValuePPC64_OpBitLen64(v *Value) bool {
1130 typ := &b.Func.Config.Types
1131 // match: (BitLen64 x)
1132 // result: (SUBFCconst [64] (CNTLZD <typ.Int> x))
1135 v.reset(OpPPC64SUBFCconst)
1136 v.AuxInt = int64ToAuxInt(64)
1137 v0 := b.NewValue0(v.Pos, OpPPC64CNTLZD, typ.Int)
1143 func rewriteValuePPC64_OpBswap16(v *Value) bool {
1146 typ := &b.Func.Config.Types
1147 // match: (Bswap16 x)
1148 // cond: buildcfg.GOPPC64>=10
1152 if !(buildcfg.GOPPC64 >= 10) {
1159 // match: (Bswap16 x:(MOVHZload [off] {sym} ptr mem))
1160 // result: @x.Block (MOVHBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
1163 if x.Op != OpPPC64MOVHZload {
1166 off := auxIntToInt32(x.AuxInt)
1167 sym := auxToSym(x.Aux)
1171 v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
1173 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
1174 v1.AuxInt = int32ToAuxInt(off)
1175 v1.Aux = symToAux(sym)
1180 // match: (Bswap16 x:(MOVHZloadidx ptr idx mem))
1181 // result: @x.Block (MOVHZreg (MOVHBRloadidx ptr idx mem))
1184 if x.Op != OpPPC64MOVHZloadidx {
1191 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
1193 v1 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
1194 v1.AddArg3(ptr, idx, mem)
1200 func rewriteValuePPC64_OpBswap32(v *Value) bool {
1203 typ := &b.Func.Config.Types
1204 // match: (Bswap32 x)
1205 // cond: buildcfg.GOPPC64>=10
1209 if !(buildcfg.GOPPC64 >= 10) {
1216 // match: (Bswap32 x:(MOVWZload [off] {sym} ptr mem))
1217 // result: @x.Block (MOVWBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
1220 if x.Op != OpPPC64MOVWZload {
1223 off := auxIntToInt32(x.AuxInt)
1224 sym := auxToSym(x.Aux)
1228 v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
1230 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
1231 v1.AuxInt = int32ToAuxInt(off)
1232 v1.Aux = symToAux(sym)
1237 // match: (Bswap32 x:(MOVWZloadidx ptr idx mem))
1238 // result: @x.Block (MOVWZreg (MOVWBRloadidx ptr idx mem))
1241 if x.Op != OpPPC64MOVWZloadidx {
1248 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
1250 v1 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
1251 v1.AddArg3(ptr, idx, mem)
1257 func rewriteValuePPC64_OpBswap64(v *Value) bool {
1260 typ := &b.Func.Config.Types
1261 // match: (Bswap64 x)
1262 // cond: buildcfg.GOPPC64>=10
1266 if !(buildcfg.GOPPC64 >= 10) {
1273 // match: (Bswap64 x:(MOVDload [off] {sym} ptr mem))
1274 // result: @x.Block (MOVDBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
1277 if x.Op != OpPPC64MOVDload {
1280 off := auxIntToInt32(x.AuxInt)
1281 sym := auxToSym(x.Aux)
1285 v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
1287 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
1288 v1.AuxInt = int32ToAuxInt(off)
1289 v1.Aux = symToAux(sym)
1294 // match: (Bswap64 x:(MOVDloadidx ptr idx mem))
1295 // result: @x.Block (MOVDBRloadidx ptr idx mem)
1298 if x.Op != OpPPC64MOVDloadidx {
1305 v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
1307 v0.AddArg3(ptr, idx, mem)
1312 func rewriteValuePPC64_OpCom16(v *Value) bool {
1315 // result: (NOR x x)
1323 func rewriteValuePPC64_OpCom32(v *Value) bool {
1326 // result: (NOR x x)
1334 func rewriteValuePPC64_OpCom64(v *Value) bool {
1337 // result: (NOR x x)
1345 func rewriteValuePPC64_OpCom8(v *Value) bool {
1348 // result: (NOR x x)
1356 func rewriteValuePPC64_OpCondSelect(v *Value) bool {
1361 typ := &b.Func.Config.Types
1362 // match: (CondSelect x y (SETBC [a] cmp))
1363 // result: (ISEL [a] x y cmp)
1367 if v_2.Op != OpPPC64SETBC {
1370 a := auxIntToInt32(v_2.AuxInt)
1372 v.reset(OpPPC64ISEL)
1373 v.AuxInt = int32ToAuxInt(a)
1374 v.AddArg3(x, y, cmp)
1377 // match: (CondSelect x y (SETBCR [a] cmp))
1378 // result: (ISEL [a+4] x y cmp)
1382 if v_2.Op != OpPPC64SETBCR {
1385 a := auxIntToInt32(v_2.AuxInt)
1387 v.reset(OpPPC64ISEL)
1388 v.AuxInt = int32ToAuxInt(a + 4)
1389 v.AddArg3(x, y, cmp)
1392 // match: (CondSelect x y bool)
1393 // cond: flagArg(bool) == nil
1394 // result: (ISEL [6] x y (Select1 <types.TypeFlags> (ANDCCconst [1] bool)))
1399 if !(flagArg(bool) == nil) {
1402 v.reset(OpPPC64ISEL)
1403 v.AuxInt = int32ToAuxInt(6)
1404 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
1405 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
1406 v1.AuxInt = int64ToAuxInt(1)
1414 func rewriteValuePPC64_OpConst16(v *Value) bool {
1415 // match: (Const16 [val])
1416 // result: (MOVDconst [int64(val)])
1418 val := auxIntToInt16(v.AuxInt)
1419 v.reset(OpPPC64MOVDconst)
1420 v.AuxInt = int64ToAuxInt(int64(val))
1424 func rewriteValuePPC64_OpConst32(v *Value) bool {
1425 // match: (Const32 [val])
1426 // result: (MOVDconst [int64(val)])
1428 val := auxIntToInt32(v.AuxInt)
1429 v.reset(OpPPC64MOVDconst)
1430 v.AuxInt = int64ToAuxInt(int64(val))
1434 func rewriteValuePPC64_OpConst64(v *Value) bool {
1435 // match: (Const64 [val])
1436 // result: (MOVDconst [int64(val)])
1438 val := auxIntToInt64(v.AuxInt)
1439 v.reset(OpPPC64MOVDconst)
1440 v.AuxInt = int64ToAuxInt(int64(val))
1444 func rewriteValuePPC64_OpConst8(v *Value) bool {
1445 // match: (Const8 [val])
1446 // result: (MOVDconst [int64(val)])
1448 val := auxIntToInt8(v.AuxInt)
1449 v.reset(OpPPC64MOVDconst)
1450 v.AuxInt = int64ToAuxInt(int64(val))
1454 func rewriteValuePPC64_OpConstBool(v *Value) bool {
1455 // match: (ConstBool [t])
1456 // result: (MOVDconst [b2i(t)])
1458 t := auxIntToBool(v.AuxInt)
1459 v.reset(OpPPC64MOVDconst)
1460 v.AuxInt = int64ToAuxInt(b2i(t))
1464 func rewriteValuePPC64_OpConstNil(v *Value) bool {
1465 // match: (ConstNil)
1466 // result: (MOVDconst [0])
1468 v.reset(OpPPC64MOVDconst)
1469 v.AuxInt = int64ToAuxInt(0)
1473 func rewriteValuePPC64_OpCopysign(v *Value) bool {
1476 // match: (Copysign x y)
1477 // result: (FCPSGN y x)
1481 v.reset(OpPPC64FCPSGN)
1486 func rewriteValuePPC64_OpCtz16(v *Value) bool {
1489 typ := &b.Func.Config.Types
1491 // result: (POPCNTW (MOVHZreg (ANDN <typ.Int16> (ADDconst <typ.Int16> [-1] x) x)))
1494 v.reset(OpPPC64POPCNTW)
1495 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
1496 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int16)
1497 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int16)
1498 v2.AuxInt = int64ToAuxInt(-1)
1506 func rewriteValuePPC64_OpCtz32(v *Value) bool {
1509 typ := &b.Func.Config.Types
1511 // cond: buildcfg.GOPPC64<=8
1512 // result: (POPCNTW (MOVWZreg (ANDN <typ.Int> (ADDconst <typ.Int> [-1] x) x)))
1515 if !(buildcfg.GOPPC64 <= 8) {
1518 v.reset(OpPPC64POPCNTW)
1519 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
1520 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int)
1521 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int)
1522 v2.AuxInt = int64ToAuxInt(-1)
1530 // result: (CNTTZW (MOVWZreg x))
1533 v.reset(OpPPC64CNTTZW)
1534 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
1540 func rewriteValuePPC64_OpCtz64(v *Value) bool {
1543 typ := &b.Func.Config.Types
1545 // cond: buildcfg.GOPPC64<=8
1546 // result: (POPCNTD (ANDN <typ.Int64> (ADDconst <typ.Int64> [-1] x) x))
1549 if !(buildcfg.GOPPC64 <= 8) {
1552 v.reset(OpPPC64POPCNTD)
1553 v0 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int64)
1554 v1 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int64)
1555 v1.AuxInt = int64ToAuxInt(-1)
1562 // result: (CNTTZD x)
1565 v.reset(OpPPC64CNTTZD)
1570 func rewriteValuePPC64_OpCtz8(v *Value) bool {
1573 typ := &b.Func.Config.Types
1575 // result: (POPCNTB (MOVBZreg (ANDN <typ.UInt8> (ADDconst <typ.UInt8> [-1] x) x)))
1578 v.reset(OpPPC64POPCNTB)
1579 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
1580 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.UInt8)
1581 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.UInt8)
1582 v2.AuxInt = int64ToAuxInt(-1)
1590 func rewriteValuePPC64_OpCvt32Fto32(v *Value) bool {
1593 typ := &b.Func.Config.Types
1594 // match: (Cvt32Fto32 x)
1595 // result: (MFVSRD (FCTIWZ x))
1598 v.reset(OpPPC64MFVSRD)
1599 v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
1605 func rewriteValuePPC64_OpCvt32Fto64(v *Value) bool {
1608 typ := &b.Func.Config.Types
1609 // match: (Cvt32Fto64 x)
1610 // result: (MFVSRD (FCTIDZ x))
1613 v.reset(OpPPC64MFVSRD)
1614 v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
1620 func rewriteValuePPC64_OpCvt32to32F(v *Value) bool {
1623 typ := &b.Func.Config.Types
1624 // match: (Cvt32to32F x)
1625 // result: (FCFIDS (MTVSRD (SignExt32to64 x)))
1628 v.reset(OpPPC64FCFIDS)
1629 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1630 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1637 func rewriteValuePPC64_OpCvt32to64F(v *Value) bool {
1640 typ := &b.Func.Config.Types
1641 // match: (Cvt32to64F x)
1642 // result: (FCFID (MTVSRD (SignExt32to64 x)))
1645 v.reset(OpPPC64FCFID)
1646 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1647 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1654 func rewriteValuePPC64_OpCvt64Fto32(v *Value) bool {
1657 typ := &b.Func.Config.Types
1658 // match: (Cvt64Fto32 x)
1659 // result: (MFVSRD (FCTIWZ x))
1662 v.reset(OpPPC64MFVSRD)
1663 v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
1669 func rewriteValuePPC64_OpCvt64Fto64(v *Value) bool {
1672 typ := &b.Func.Config.Types
1673 // match: (Cvt64Fto64 x)
1674 // result: (MFVSRD (FCTIDZ x))
1677 v.reset(OpPPC64MFVSRD)
1678 v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
1684 func rewriteValuePPC64_OpCvt64to32F(v *Value) bool {
1687 typ := &b.Func.Config.Types
1688 // match: (Cvt64to32F x)
1689 // result: (FCFIDS (MTVSRD x))
1692 v.reset(OpPPC64FCFIDS)
1693 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1699 func rewriteValuePPC64_OpCvt64to64F(v *Value) bool {
1702 typ := &b.Func.Config.Types
1703 // match: (Cvt64to64F x)
1704 // result: (FCFID (MTVSRD x))
1707 v.reset(OpPPC64FCFID)
1708 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1714 func rewriteValuePPC64_OpDiv16(v *Value) bool {
1718 typ := &b.Func.Config.Types
1719 // match: (Div16 [false] x y)
1720 // result: (DIVW (SignExt16to32 x) (SignExt16to32 y))
1722 if auxIntToBool(v.AuxInt) != false {
1727 v.reset(OpPPC64DIVW)
1728 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1730 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1737 func rewriteValuePPC64_OpDiv16u(v *Value) bool {
1741 typ := &b.Func.Config.Types
1742 // match: (Div16u x y)
1743 // result: (DIVWU (ZeroExt16to32 x) (ZeroExt16to32 y))
1747 v.reset(OpPPC64DIVWU)
1748 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1750 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1756 func rewriteValuePPC64_OpDiv32(v *Value) bool {
1759 // match: (Div32 [false] x y)
1760 // result: (DIVW x y)
1762 if auxIntToBool(v.AuxInt) != false {
1767 v.reset(OpPPC64DIVW)
1773 func rewriteValuePPC64_OpDiv64(v *Value) bool {
1776 // match: (Div64 [false] x y)
1777 // result: (DIVD x y)
1779 if auxIntToBool(v.AuxInt) != false {
1784 v.reset(OpPPC64DIVD)
1790 func rewriteValuePPC64_OpDiv8(v *Value) bool {
1794 typ := &b.Func.Config.Types
1795 // match: (Div8 x y)
1796 // result: (DIVW (SignExt8to32 x) (SignExt8to32 y))
1800 v.reset(OpPPC64DIVW)
1801 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1803 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1809 func rewriteValuePPC64_OpDiv8u(v *Value) bool {
1813 typ := &b.Func.Config.Types
1814 // match: (Div8u x y)
1815 // result: (DIVWU (ZeroExt8to32 x) (ZeroExt8to32 y))
1819 v.reset(OpPPC64DIVWU)
1820 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
1822 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
1828 func rewriteValuePPC64_OpEq16(v *Value) bool {
1832 typ := &b.Func.Config.Types
1833 // match: (Eq16 x y)
1834 // cond: x.Type.IsSigned() && y.Type.IsSigned()
1835 // result: (Equal (CMPW (SignExt16to32 x) (SignExt16to32 y)))
1837 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1840 if !(x.Type.IsSigned() && y.Type.IsSigned()) {
1843 v.reset(OpPPC64Equal)
1844 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1845 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1847 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1855 // match: (Eq16 x y)
1856 // result: (Equal (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
1860 v.reset(OpPPC64Equal)
1861 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1862 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1864 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1871 func rewriteValuePPC64_OpEq32(v *Value) bool {
1875 // match: (Eq32 x y)
1876 // result: (Equal (CMPW x y))
1880 v.reset(OpPPC64Equal)
1881 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1887 func rewriteValuePPC64_OpEq32F(v *Value) bool {
1891 // match: (Eq32F x y)
1892 // result: (Equal (FCMPU x y))
1896 v.reset(OpPPC64Equal)
1897 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
1903 func rewriteValuePPC64_OpEq64(v *Value) bool {
1907 // match: (Eq64 x y)
1908 // result: (Equal (CMP x y))
1912 v.reset(OpPPC64Equal)
1913 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
1919 func rewriteValuePPC64_OpEq64F(v *Value) bool {
1923 // match: (Eq64F x y)
1924 // result: (Equal (FCMPU x y))
1928 v.reset(OpPPC64Equal)
1929 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
1935 func rewriteValuePPC64_OpEq8(v *Value) bool {
1939 typ := &b.Func.Config.Types
1941 // cond: x.Type.IsSigned() && y.Type.IsSigned()
1942 // result: (Equal (CMPW (SignExt8to32 x) (SignExt8to32 y)))
1944 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1947 if !(x.Type.IsSigned() && y.Type.IsSigned()) {
1950 v.reset(OpPPC64Equal)
1951 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1952 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1954 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1963 // result: (Equal (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
1967 v.reset(OpPPC64Equal)
1968 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1969 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
1971 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
1978 func rewriteValuePPC64_OpEqB(v *Value) bool {
1982 typ := &b.Func.Config.Types
1984 // result: (Select0 <typ.Int> (ANDCCconst [1] (EQV x y)))
1990 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
1991 v0.AuxInt = int64ToAuxInt(1)
1992 v1 := b.NewValue0(v.Pos, OpPPC64EQV, typ.Int64)
1999 func rewriteValuePPC64_OpEqPtr(v *Value) bool {
2003 // match: (EqPtr x y)
2004 // result: (Equal (CMP x y))
2008 v.reset(OpPPC64Equal)
2009 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
2015 func rewriteValuePPC64_OpIsInBounds(v *Value) bool {
2019 // match: (IsInBounds idx len)
2020 // result: (LessThan (CMPU idx len))
2024 v.reset(OpPPC64LessThan)
2025 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2026 v0.AddArg2(idx, len)
2031 func rewriteValuePPC64_OpIsNonNil(v *Value) bool {
2034 // match: (IsNonNil ptr)
2035 // result: (NotEqual (CMPconst [0] ptr))
2038 v.reset(OpPPC64NotEqual)
2039 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
2040 v0.AuxInt = int64ToAuxInt(0)
2046 func rewriteValuePPC64_OpIsSliceInBounds(v *Value) bool {
2050 // match: (IsSliceInBounds idx len)
2051 // result: (LessEqual (CMPU idx len))
2055 v.reset(OpPPC64LessEqual)
2056 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2057 v0.AddArg2(idx, len)
2062 func rewriteValuePPC64_OpLeq16(v *Value) bool {
2066 typ := &b.Func.Config.Types
2067 // match: (Leq16 x y)
2068 // result: (LessEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
2072 v.reset(OpPPC64LessEqual)
2073 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2074 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2076 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2083 func rewriteValuePPC64_OpLeq16U(v *Value) bool {
2087 typ := &b.Func.Config.Types
2088 // match: (Leq16U x y)
2089 // result: (LessEqual (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
2093 v.reset(OpPPC64LessEqual)
2094 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2095 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2097 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2104 func rewriteValuePPC64_OpLeq32(v *Value) bool {
2108 // match: (Leq32 x y)
2109 // result: (LessEqual (CMPW x y))
2113 v.reset(OpPPC64LessEqual)
2114 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2120 func rewriteValuePPC64_OpLeq32F(v *Value) bool {
2124 // match: (Leq32F x y)
2125 // result: (FLessEqual (FCMPU x y))
2129 v.reset(OpPPC64FLessEqual)
2130 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2136 func rewriteValuePPC64_OpLeq32U(v *Value) bool {
2140 // match: (Leq32U x y)
2141 // result: (LessEqual (CMPWU x y))
2145 v.reset(OpPPC64LessEqual)
2146 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2152 func rewriteValuePPC64_OpLeq64(v *Value) bool {
2156 // match: (Leq64 x y)
2157 // result: (LessEqual (CMP x y))
2161 v.reset(OpPPC64LessEqual)
2162 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
2168 func rewriteValuePPC64_OpLeq64F(v *Value) bool {
2172 // match: (Leq64F x y)
2173 // result: (FLessEqual (FCMPU x y))
2177 v.reset(OpPPC64FLessEqual)
2178 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2184 func rewriteValuePPC64_OpLeq64U(v *Value) bool {
2188 // match: (Leq64U x y)
2189 // result: (LessEqual (CMPU x y))
2193 v.reset(OpPPC64LessEqual)
2194 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2200 func rewriteValuePPC64_OpLeq8(v *Value) bool {
2204 typ := &b.Func.Config.Types
2205 // match: (Leq8 x y)
2206 // result: (LessEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
2210 v.reset(OpPPC64LessEqual)
2211 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2212 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2214 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2221 func rewriteValuePPC64_OpLeq8U(v *Value) bool {
2225 typ := &b.Func.Config.Types
2226 // match: (Leq8U x y)
2227 // result: (LessEqual (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
2231 v.reset(OpPPC64LessEqual)
2232 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2233 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2235 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2242 func rewriteValuePPC64_OpLess16(v *Value) bool {
2246 typ := &b.Func.Config.Types
2247 // match: (Less16 x y)
2248 // result: (LessThan (CMPW (SignExt16to32 x) (SignExt16to32 y)))
2252 v.reset(OpPPC64LessThan)
2253 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2254 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2256 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2263 func rewriteValuePPC64_OpLess16U(v *Value) bool {
2267 typ := &b.Func.Config.Types
2268 // match: (Less16U x y)
2269 // result: (LessThan (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
2273 v.reset(OpPPC64LessThan)
2274 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2275 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2277 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2284 func rewriteValuePPC64_OpLess32(v *Value) bool {
2288 // match: (Less32 x y)
2289 // result: (LessThan (CMPW x y))
2293 v.reset(OpPPC64LessThan)
2294 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2300 func rewriteValuePPC64_OpLess32F(v *Value) bool {
2304 // match: (Less32F x y)
2305 // result: (FLessThan (FCMPU x y))
2309 v.reset(OpPPC64FLessThan)
2310 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2316 func rewriteValuePPC64_OpLess32U(v *Value) bool {
2320 // match: (Less32U x y)
2321 // result: (LessThan (CMPWU x y))
2325 v.reset(OpPPC64LessThan)
2326 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2332 func rewriteValuePPC64_OpLess64(v *Value) bool {
2336 // match: (Less64 x y)
2337 // result: (LessThan (CMP x y))
2341 v.reset(OpPPC64LessThan)
2342 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
2348 func rewriteValuePPC64_OpLess64F(v *Value) bool {
2352 // match: (Less64F x y)
2353 // result: (FLessThan (FCMPU x y))
2357 v.reset(OpPPC64FLessThan)
2358 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2364 func rewriteValuePPC64_OpLess64U(v *Value) bool {
2368 // match: (Less64U x y)
2369 // result: (LessThan (CMPU x y))
2373 v.reset(OpPPC64LessThan)
2374 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2380 func rewriteValuePPC64_OpLess8(v *Value) bool {
2384 typ := &b.Func.Config.Types
2385 // match: (Less8 x y)
2386 // result: (LessThan (CMPW (SignExt8to32 x) (SignExt8to32 y)))
2390 v.reset(OpPPC64LessThan)
2391 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2392 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2394 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2401 func rewriteValuePPC64_OpLess8U(v *Value) bool {
2405 typ := &b.Func.Config.Types
2406 // match: (Less8U x y)
2407 // result: (LessThan (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
2411 v.reset(OpPPC64LessThan)
2412 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2413 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2415 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2422 func rewriteValuePPC64_OpLoad(v *Value) bool {
2426 typ := &b.Func.Config.Types
2427 // match: (Load <t> ptr mem)
2428 // cond: (is64BitInt(t) || isPtr(t))
2429 // result: (MOVDload ptr mem)
2434 if !(is64BitInt(t) || isPtr(t)) {
2437 v.reset(OpPPC64MOVDload)
2441 // match: (Load <t> ptr mem)
2442 // cond: is32BitInt(t) && t.IsSigned()
2443 // result: (MOVWload ptr mem)
2448 if !(is32BitInt(t) && t.IsSigned()) {
2451 v.reset(OpPPC64MOVWload)
2455 // match: (Load <t> ptr mem)
2456 // cond: is32BitInt(t) && !t.IsSigned()
2457 // result: (MOVWZload ptr mem)
2462 if !(is32BitInt(t) && !t.IsSigned()) {
2465 v.reset(OpPPC64MOVWZload)
2469 // match: (Load <t> ptr mem)
2470 // cond: is16BitInt(t) && t.IsSigned()
2471 // result: (MOVHload ptr mem)
2476 if !(is16BitInt(t) && t.IsSigned()) {
2479 v.reset(OpPPC64MOVHload)
2483 // match: (Load <t> ptr mem)
2484 // cond: is16BitInt(t) && !t.IsSigned()
2485 // result: (MOVHZload ptr mem)
2490 if !(is16BitInt(t) && !t.IsSigned()) {
2493 v.reset(OpPPC64MOVHZload)
2497 // match: (Load <t> ptr mem)
2498 // cond: t.IsBoolean()
2499 // result: (MOVBZload ptr mem)
2504 if !(t.IsBoolean()) {
2507 v.reset(OpPPC64MOVBZload)
2511 // match: (Load <t> ptr mem)
2512 // cond: is8BitInt(t) && t.IsSigned()
2513 // result: (MOVBreg (MOVBZload ptr mem))
2518 if !(is8BitInt(t) && t.IsSigned()) {
2521 v.reset(OpPPC64MOVBreg)
2522 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
2523 v0.AddArg2(ptr, mem)
2527 // match: (Load <t> ptr mem)
2528 // cond: is8BitInt(t) && !t.IsSigned()
2529 // result: (MOVBZload ptr mem)
2534 if !(is8BitInt(t) && !t.IsSigned()) {
2537 v.reset(OpPPC64MOVBZload)
2541 // match: (Load <t> ptr mem)
2542 // cond: is32BitFloat(t)
2543 // result: (FMOVSload ptr mem)
2548 if !(is32BitFloat(t)) {
2551 v.reset(OpPPC64FMOVSload)
2555 // match: (Load <t> ptr mem)
2556 // cond: is64BitFloat(t)
2557 // result: (FMOVDload ptr mem)
2562 if !(is64BitFloat(t)) {
2565 v.reset(OpPPC64FMOVDload)
2571 func rewriteValuePPC64_OpLocalAddr(v *Value) bool {
2575 typ := &b.Func.Config.Types
2576 // match: (LocalAddr <t> {sym} base mem)
2577 // cond: t.Elem().HasPointers()
2578 // result: (MOVDaddr {sym} (SPanchored base mem))
2581 sym := auxToSym(v.Aux)
2584 if !(t.Elem().HasPointers()) {
2587 v.reset(OpPPC64MOVDaddr)
2588 v.Aux = symToAux(sym)
2589 v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
2590 v0.AddArg2(base, mem)
2594 // match: (LocalAddr <t> {sym} base _)
2595 // cond: !t.Elem().HasPointers()
2596 // result: (MOVDaddr {sym} base)
2599 sym := auxToSym(v.Aux)
2601 if !(!t.Elem().HasPointers()) {
2604 v.reset(OpPPC64MOVDaddr)
2605 v.Aux = symToAux(sym)
2611 func rewriteValuePPC64_OpLsh16x16(v *Value) bool {
2615 typ := &b.Func.Config.Types
2616 // match: (Lsh16x16 x y)
2617 // cond: shiftIsBounded(v)
2618 // result: (SLD x y)
2622 if !(shiftIsBounded(v)) {
2629 // match: (Lsh16x16 <t> x y)
2630 // result: (ISEL [2] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF0] y)))
2635 v.reset(OpPPC64ISEL)
2636 v.AuxInt = int32ToAuxInt(2)
2637 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2638 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
2641 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2642 v2.AuxInt = int64ToAuxInt(0)
2643 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
2644 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
2645 v4.AuxInt = int64ToAuxInt(0xFFF0)
2648 v.AddArg3(v0, v2, v3)
2652 func rewriteValuePPC64_OpLsh16x32(v *Value) bool {
2656 typ := &b.Func.Config.Types
2657 // match: (Lsh16x32 x y)
2658 // cond: shiftIsBounded(v)
2659 // result: (SLD x y)
2663 if !(shiftIsBounded(v)) {
2670 // match: (Lsh16x32 <t> x y)
2671 // result: (ISEL [0] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [16]))
2676 v.reset(OpPPC64ISEL)
2677 v.AuxInt = int32ToAuxInt(0)
2678 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2679 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
2682 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2683 v2.AuxInt = int64ToAuxInt(0)
2684 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
2685 v3.AuxInt = int32ToAuxInt(16)
2687 v.AddArg3(v0, v2, v3)
2691 func rewriteValuePPC64_OpLsh16x64(v *Value) bool {
2695 typ := &b.Func.Config.Types
2696 // match: (Lsh16x64 x (MOVDconst [c]))
2697 // cond: uint64(c) < 16
2698 // result: (SLWconst x [c])
2701 if v_1.Op != OpPPC64MOVDconst {
2704 c := auxIntToInt64(v_1.AuxInt)
2705 if !(uint64(c) < 16) {
2708 v.reset(OpPPC64SLWconst)
2709 v.AuxInt = int64ToAuxInt(c)
2713 // match: (Lsh16x64 x y)
2714 // cond: shiftIsBounded(v)
2715 // result: (SLD x y)
2719 if !(shiftIsBounded(v)) {
2726 // match: (Lsh16x64 <t> x y)
2727 // result: (ISEL [0] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [16]))
2732 v.reset(OpPPC64ISEL)
2733 v.AuxInt = int32ToAuxInt(0)
2734 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2735 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
2738 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2739 v2.AuxInt = int64ToAuxInt(0)
2740 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
2741 v3.AuxInt = int64ToAuxInt(16)
2743 v.AddArg3(v0, v2, v3)
2747 func rewriteValuePPC64_OpLsh16x8(v *Value) bool {
2751 typ := &b.Func.Config.Types
2752 // match: (Lsh16x8 x y)
2753 // cond: shiftIsBounded(v)
2754 // result: (SLD x y)
2758 if !(shiftIsBounded(v)) {
2765 // match: (Lsh16x8 <t> x y)
2766 // result: (ISEL [2] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F0] y)))
2771 v.reset(OpPPC64ISEL)
2772 v.AuxInt = int32ToAuxInt(2)
2773 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2774 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
2777 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2778 v2.AuxInt = int64ToAuxInt(0)
2779 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
2780 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
2781 v4.AuxInt = int64ToAuxInt(0x00F0)
2784 v.AddArg3(v0, v2, v3)
2788 func rewriteValuePPC64_OpLsh32x16(v *Value) bool {
2792 typ := &b.Func.Config.Types
2793 // match: (Lsh32x16 x y)
2794 // cond: shiftIsBounded(v)
2795 // result: (SLW x y)
2799 if !(shiftIsBounded(v)) {
2806 // match: (Lsh32x16 <t> x y)
2807 // result: (ISEL [2] (SLW <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFE0] y)))
2812 v.reset(OpPPC64ISEL)
2813 v.AuxInt = int32ToAuxInt(2)
2814 v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
2816 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2817 v1.AuxInt = int64ToAuxInt(0)
2818 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
2819 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
2820 v3.AuxInt = int64ToAuxInt(0xFFE0)
2823 v.AddArg3(v0, v1, v2)
2827 func rewriteValuePPC64_OpLsh32x32(v *Value) bool {
2831 typ := &b.Func.Config.Types
2832 // match: (Lsh32x32 x y)
2833 // cond: shiftIsBounded(v)
2834 // result: (SLW x y)
2838 if !(shiftIsBounded(v)) {
2845 // match: (Lsh32x32 <t> x y)
2846 // result: (ISEL [0] (SLW <t> x y) (MOVDconst [0]) (CMPWUconst y [32]))
2851 v.reset(OpPPC64ISEL)
2852 v.AuxInt = int32ToAuxInt(0)
2853 v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
2855 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2856 v1.AuxInt = int64ToAuxInt(0)
2857 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
2858 v2.AuxInt = int32ToAuxInt(32)
2860 v.AddArg3(v0, v1, v2)
2864 func rewriteValuePPC64_OpLsh32x64(v *Value) bool {
2868 typ := &b.Func.Config.Types
2869 // match: (Lsh32x64 x (MOVDconst [c]))
2870 // cond: uint64(c) < 32
2871 // result: (SLWconst x [c])
2874 if v_1.Op != OpPPC64MOVDconst {
2877 c := auxIntToInt64(v_1.AuxInt)
2878 if !(uint64(c) < 32) {
2881 v.reset(OpPPC64SLWconst)
2882 v.AuxInt = int64ToAuxInt(c)
2886 // match: (Lsh32x64 x y)
2887 // cond: shiftIsBounded(v)
2888 // result: (SLW x y)
2892 if !(shiftIsBounded(v)) {
2899 // match: (Lsh32x64 <t> x y)
2900 // result: (ISEL [0] (SLW <t> x y) (MOVDconst [0]) (CMPUconst y [32]))
2905 v.reset(OpPPC64ISEL)
2906 v.AuxInt = int32ToAuxInt(0)
2907 v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
2909 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2910 v1.AuxInt = int64ToAuxInt(0)
2911 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
2912 v2.AuxInt = int64ToAuxInt(32)
2914 v.AddArg3(v0, v1, v2)
2918 func rewriteValuePPC64_OpLsh32x8(v *Value) bool {
2922 typ := &b.Func.Config.Types
2923 // match: (Lsh32x8 x y)
2924 // cond: shiftIsBounded(v)
2925 // result: (SLW x y)
2929 if !(shiftIsBounded(v)) {
2936 // match: (Lsh32x8 <t> x y)
2937 // result: (ISEL [2] (SLW <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00E0] y)))
2942 v.reset(OpPPC64ISEL)
2943 v.AuxInt = int32ToAuxInt(2)
2944 v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
2946 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2947 v1.AuxInt = int64ToAuxInt(0)
2948 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
2949 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
2950 v3.AuxInt = int64ToAuxInt(0x00E0)
2953 v.AddArg3(v0, v1, v2)
2957 func rewriteValuePPC64_OpLsh64x16(v *Value) bool {
2961 typ := &b.Func.Config.Types
2962 // match: (Lsh64x16 x y)
2963 // cond: shiftIsBounded(v)
2964 // result: (SLD x y)
2968 if !(shiftIsBounded(v)) {
2975 // match: (Lsh64x16 <t> x y)
2976 // result: (ISEL [2] (SLD <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFC0] y)))
2981 v.reset(OpPPC64ISEL)
2982 v.AuxInt = int32ToAuxInt(2)
2983 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2985 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2986 v1.AuxInt = int64ToAuxInt(0)
2987 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
2988 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
2989 v3.AuxInt = int64ToAuxInt(0xFFC0)
2992 v.AddArg3(v0, v1, v2)
2996 func rewriteValuePPC64_OpLsh64x32(v *Value) bool {
3000 typ := &b.Func.Config.Types
3001 // match: (Lsh64x32 x y)
3002 // cond: shiftIsBounded(v)
3003 // result: (SLD x y)
3007 if !(shiftIsBounded(v)) {
3014 // match: (Lsh64x32 <t> x y)
3015 // result: (ISEL [0] (SLD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
3020 v.reset(OpPPC64ISEL)
3021 v.AuxInt = int32ToAuxInt(0)
3022 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3024 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3025 v1.AuxInt = int64ToAuxInt(0)
3026 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
3027 v2.AuxInt = int32ToAuxInt(64)
3029 v.AddArg3(v0, v1, v2)
3033 func rewriteValuePPC64_OpLsh64x64(v *Value) bool {
3037 typ := &b.Func.Config.Types
3038 // match: (Lsh64x64 x (MOVDconst [c]))
3039 // cond: uint64(c) < 64
3040 // result: (SLDconst x [c])
3043 if v_1.Op != OpPPC64MOVDconst {
3046 c := auxIntToInt64(v_1.AuxInt)
3047 if !(uint64(c) < 64) {
3050 v.reset(OpPPC64SLDconst)
3051 v.AuxInt = int64ToAuxInt(c)
3055 // match: (Lsh64x64 x y)
3056 // cond: shiftIsBounded(v)
3057 // result: (SLD x y)
3061 if !(shiftIsBounded(v)) {
3068 // match: (Lsh64x64 <t> x y)
3069 // result: (ISEL [0] (SLD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
3074 v.reset(OpPPC64ISEL)
3075 v.AuxInt = int32ToAuxInt(0)
3076 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3078 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3079 v1.AuxInt = int64ToAuxInt(0)
3080 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
3081 v2.AuxInt = int64ToAuxInt(64)
3083 v.AddArg3(v0, v1, v2)
3087 func rewriteValuePPC64_OpLsh64x8(v *Value) bool {
3091 typ := &b.Func.Config.Types
3092 // match: (Lsh64x8 x y)
3093 // cond: shiftIsBounded(v)
3094 // result: (SLD x y)
3098 if !(shiftIsBounded(v)) {
3105 // match: (Lsh64x8 <t> x y)
3106 // result: (ISEL [2] (SLD <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00C0] y)))
3111 v.reset(OpPPC64ISEL)
3112 v.AuxInt = int32ToAuxInt(2)
3113 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3115 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3116 v1.AuxInt = int64ToAuxInt(0)
3117 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
3118 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
3119 v3.AuxInt = int64ToAuxInt(0x00C0)
3122 v.AddArg3(v0, v1, v2)
3126 func rewriteValuePPC64_OpLsh8x16(v *Value) bool {
3130 typ := &b.Func.Config.Types
3131 // match: (Lsh8x16 x y)
3132 // cond: shiftIsBounded(v)
3133 // result: (SLD x y)
3137 if !(shiftIsBounded(v)) {
3144 // match: (Lsh8x16 <t> x y)
3145 // result: (ISEL [2] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF8] y)))
3150 v.reset(OpPPC64ISEL)
3151 v.AuxInt = int32ToAuxInt(2)
3152 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3153 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
3156 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3157 v2.AuxInt = int64ToAuxInt(0)
3158 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
3159 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
3160 v4.AuxInt = int64ToAuxInt(0xFFF8)
3163 v.AddArg3(v0, v2, v3)
3167 func rewriteValuePPC64_OpLsh8x32(v *Value) bool {
3171 typ := &b.Func.Config.Types
3172 // match: (Lsh8x32 x y)
3173 // cond: shiftIsBounded(v)
3174 // result: (SLD x y)
3178 if !(shiftIsBounded(v)) {
3185 // match: (Lsh8x32 <t> x y)
3186 // result: (ISEL [0] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [8]))
3191 v.reset(OpPPC64ISEL)
3192 v.AuxInt = int32ToAuxInt(0)
3193 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3194 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
3197 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3198 v2.AuxInt = int64ToAuxInt(0)
3199 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
3200 v3.AuxInt = int32ToAuxInt(8)
3202 v.AddArg3(v0, v2, v3)
3206 func rewriteValuePPC64_OpLsh8x64(v *Value) bool {
3210 typ := &b.Func.Config.Types
3211 // match: (Lsh8x64 x (MOVDconst [c]))
3212 // cond: uint64(c) < 8
3213 // result: (SLWconst x [c])
3216 if v_1.Op != OpPPC64MOVDconst {
3219 c := auxIntToInt64(v_1.AuxInt)
3220 if !(uint64(c) < 8) {
3223 v.reset(OpPPC64SLWconst)
3224 v.AuxInt = int64ToAuxInt(c)
3228 // match: (Lsh8x64 x y)
3229 // cond: shiftIsBounded(v)
3230 // result: (SLD x y)
3234 if !(shiftIsBounded(v)) {
3241 // match: (Lsh8x64 <t> x y)
3242 // result: (ISEL [0] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [8]))
3247 v.reset(OpPPC64ISEL)
3248 v.AuxInt = int32ToAuxInt(0)
3249 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3250 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
3253 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3254 v2.AuxInt = int64ToAuxInt(0)
3255 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
3256 v3.AuxInt = int64ToAuxInt(8)
3258 v.AddArg3(v0, v2, v3)
3262 func rewriteValuePPC64_OpLsh8x8(v *Value) bool {
3266 typ := &b.Func.Config.Types
3267 // match: (Lsh8x8 x y)
3268 // cond: shiftIsBounded(v)
3269 // result: (SLD x y)
3273 if !(shiftIsBounded(v)) {
3280 // match: (Lsh8x8 <t> x y)
3281 // result: (ISEL [2] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F8] y)))
3286 v.reset(OpPPC64ISEL)
3287 v.AuxInt = int32ToAuxInt(2)
3288 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3289 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
3292 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3293 v2.AuxInt = int64ToAuxInt(0)
3294 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
3295 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
3296 v4.AuxInt = int64ToAuxInt(0x00F8)
3299 v.AddArg3(v0, v2, v3)
3303 func rewriteValuePPC64_OpMod16(v *Value) bool {
3307 typ := &b.Func.Config.Types
3308 // match: (Mod16 x y)
3309 // result: (Mod32 (SignExt16to32 x) (SignExt16to32 y))
3314 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3316 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3322 func rewriteValuePPC64_OpMod16u(v *Value) bool {
3326 typ := &b.Func.Config.Types
3327 // match: (Mod16u x y)
3328 // result: (Mod32u (ZeroExt16to32 x) (ZeroExt16to32 y))
3333 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3335 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3341 func rewriteValuePPC64_OpMod32(v *Value) bool {
3345 typ := &b.Func.Config.Types
3346 // match: (Mod32 x y)
3347 // cond: buildcfg.GOPPC64 >= 9
3348 // result: (MODSW x y)
3352 if !(buildcfg.GOPPC64 >= 9) {
3355 v.reset(OpPPC64MODSW)
3359 // match: (Mod32 x y)
3360 // cond: buildcfg.GOPPC64 <= 8
3361 // result: (SUB x (MULLW y (DIVW x y)))
3365 if !(buildcfg.GOPPC64 <= 8) {
3369 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
3370 v1 := b.NewValue0(v.Pos, OpPPC64DIVW, typ.Int32)
3378 func rewriteValuePPC64_OpMod32u(v *Value) bool {
3382 typ := &b.Func.Config.Types
3383 // match: (Mod32u x y)
3384 // cond: buildcfg.GOPPC64 >= 9
3385 // result: (MODUW x y)
3389 if !(buildcfg.GOPPC64 >= 9) {
3392 v.reset(OpPPC64MODUW)
3396 // match: (Mod32u x y)
3397 // cond: buildcfg.GOPPC64 <= 8
3398 // result: (SUB x (MULLW y (DIVWU x y)))
3402 if !(buildcfg.GOPPC64 <= 8) {
3406 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
3407 v1 := b.NewValue0(v.Pos, OpPPC64DIVWU, typ.Int32)
3415 func rewriteValuePPC64_OpMod64(v *Value) bool {
3419 typ := &b.Func.Config.Types
3420 // match: (Mod64 x y)
3421 // cond: buildcfg.GOPPC64 >=9
3422 // result: (MODSD x y)
3426 if !(buildcfg.GOPPC64 >= 9) {
3429 v.reset(OpPPC64MODSD)
3433 // match: (Mod64 x y)
3434 // cond: buildcfg.GOPPC64 <=8
3435 // result: (SUB x (MULLD y (DIVD x y)))
3439 if !(buildcfg.GOPPC64 <= 8) {
3443 v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
3444 v1 := b.NewValue0(v.Pos, OpPPC64DIVD, typ.Int64)
3452 func rewriteValuePPC64_OpMod64u(v *Value) bool {
3456 typ := &b.Func.Config.Types
3457 // match: (Mod64u x y)
3458 // cond: buildcfg.GOPPC64 >= 9
3459 // result: (MODUD x y)
3463 if !(buildcfg.GOPPC64 >= 9) {
3466 v.reset(OpPPC64MODUD)
3470 // match: (Mod64u x y)
3471 // cond: buildcfg.GOPPC64 <= 8
3472 // result: (SUB x (MULLD y (DIVDU x y)))
3476 if !(buildcfg.GOPPC64 <= 8) {
3480 v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
3481 v1 := b.NewValue0(v.Pos, OpPPC64DIVDU, typ.Int64)
3489 func rewriteValuePPC64_OpMod8(v *Value) bool {
3493 typ := &b.Func.Config.Types
3494 // match: (Mod8 x y)
3495 // result: (Mod32 (SignExt8to32 x) (SignExt8to32 y))
3500 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
3502 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
3508 func rewriteValuePPC64_OpMod8u(v *Value) bool {
3512 typ := &b.Func.Config.Types
3513 // match: (Mod8u x y)
3514 // result: (Mod32u (ZeroExt8to32 x) (ZeroExt8to32 y))
3519 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
3521 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
3527 func rewriteValuePPC64_OpMove(v *Value) bool {
3532 typ := &b.Func.Config.Types
3533 // match: (Move [0] _ _ mem)
3536 if auxIntToInt64(v.AuxInt) != 0 {
3543 // match: (Move [1] dst src mem)
3544 // result: (MOVBstore dst (MOVBZload src mem) mem)
3546 if auxIntToInt64(v.AuxInt) != 1 {
3552 v.reset(OpPPC64MOVBstore)
3553 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3554 v0.AddArg2(src, mem)
3555 v.AddArg3(dst, v0, mem)
3558 // match: (Move [2] dst src mem)
3559 // result: (MOVHstore dst (MOVHZload src mem) mem)
3561 if auxIntToInt64(v.AuxInt) != 2 {
3567 v.reset(OpPPC64MOVHstore)
3568 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
3569 v0.AddArg2(src, mem)
3570 v.AddArg3(dst, v0, mem)
3573 // match: (Move [4] dst src mem)
3574 // result: (MOVWstore dst (MOVWZload src mem) mem)
3576 if auxIntToInt64(v.AuxInt) != 4 {
3582 v.reset(OpPPC64MOVWstore)
3583 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3584 v0.AddArg2(src, mem)
3585 v.AddArg3(dst, v0, mem)
3588 // match: (Move [8] {t} dst src mem)
3589 // result: (MOVDstore dst (MOVDload src mem) mem)
3591 if auxIntToInt64(v.AuxInt) != 8 {
3597 v.reset(OpPPC64MOVDstore)
3598 v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, typ.Int64)
3599 v0.AddArg2(src, mem)
3600 v.AddArg3(dst, v0, mem)
3603 // match: (Move [3] dst src mem)
3604 // result: (MOVBstore [2] dst (MOVBZload [2] src mem) (MOVHstore dst (MOVHload src mem) mem))
3606 if auxIntToInt64(v.AuxInt) != 3 {
3612 v.reset(OpPPC64MOVBstore)
3613 v.AuxInt = int32ToAuxInt(2)
3614 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3615 v0.AuxInt = int32ToAuxInt(2)
3616 v0.AddArg2(src, mem)
3617 v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
3618 v2 := b.NewValue0(v.Pos, OpPPC64MOVHload, typ.Int16)
3619 v2.AddArg2(src, mem)
3620 v1.AddArg3(dst, v2, mem)
3621 v.AddArg3(dst, v0, v1)
3624 // match: (Move [5] dst src mem)
3625 // result: (MOVBstore [4] dst (MOVBZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
3627 if auxIntToInt64(v.AuxInt) != 5 {
3633 v.reset(OpPPC64MOVBstore)
3634 v.AuxInt = int32ToAuxInt(4)
3635 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3636 v0.AuxInt = int32ToAuxInt(4)
3637 v0.AddArg2(src, mem)
3638 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
3639 v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3640 v2.AddArg2(src, mem)
3641 v1.AddArg3(dst, v2, mem)
3642 v.AddArg3(dst, v0, v1)
3645 // match: (Move [6] dst src mem)
3646 // result: (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
3648 if auxIntToInt64(v.AuxInt) != 6 {
3654 v.reset(OpPPC64MOVHstore)
3655 v.AuxInt = int32ToAuxInt(4)
3656 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
3657 v0.AuxInt = int32ToAuxInt(4)
3658 v0.AddArg2(src, mem)
3659 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
3660 v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3661 v2.AddArg2(src, mem)
3662 v1.AddArg3(dst, v2, mem)
3663 v.AddArg3(dst, v0, v1)
3666 // match: (Move [7] dst src mem)
3667 // result: (MOVBstore [6] dst (MOVBZload [6] src mem) (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem)))
3669 if auxIntToInt64(v.AuxInt) != 7 {
3675 v.reset(OpPPC64MOVBstore)
3676 v.AuxInt = int32ToAuxInt(6)
3677 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3678 v0.AuxInt = int32ToAuxInt(6)
3679 v0.AddArg2(src, mem)
3680 v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
3681 v1.AuxInt = int32ToAuxInt(4)
3682 v2 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
3683 v2.AuxInt = int32ToAuxInt(4)
3684 v2.AddArg2(src, mem)
3685 v3 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
3686 v4 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3687 v4.AddArg2(src, mem)
3688 v3.AddArg3(dst, v4, mem)
3689 v1.AddArg3(dst, v2, v3)
3690 v.AddArg3(dst, v0, v1)
3693 // match: (Move [s] dst src mem)
3694 // cond: s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)
3695 // result: (LoweredMove [s] dst src mem)
3697 s := auxIntToInt64(v.AuxInt)
3701 if !(s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)) {
3704 v.reset(OpPPC64LoweredMove)
3705 v.AuxInt = int64ToAuxInt(s)
3706 v.AddArg3(dst, src, mem)
3709 // match: (Move [s] dst src mem)
3710 // cond: s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9
3711 // result: (LoweredQuadMoveShort [s] dst src mem)
3713 s := auxIntToInt64(v.AuxInt)
3717 if !(s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9) {
3720 v.reset(OpPPC64LoweredQuadMoveShort)
3721 v.AuxInt = int64ToAuxInt(s)
3722 v.AddArg3(dst, src, mem)
3725 // match: (Move [s] dst src mem)
3726 // cond: s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)
3727 // result: (LoweredQuadMove [s] dst src mem)
3729 s := auxIntToInt64(v.AuxInt)
3733 if !(s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)) {
3736 v.reset(OpPPC64LoweredQuadMove)
3737 v.AuxInt = int64ToAuxInt(s)
3738 v.AddArg3(dst, src, mem)
3743 func rewriteValuePPC64_OpNeq16(v *Value) bool {
3747 typ := &b.Func.Config.Types
3748 // match: (Neq16 x y)
3749 // cond: x.Type.IsSigned() && y.Type.IsSigned()
3750 // result: (NotEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
3752 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3755 if !(x.Type.IsSigned() && y.Type.IsSigned()) {
3758 v.reset(OpPPC64NotEqual)
3759 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3760 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3762 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3770 // match: (Neq16 x y)
3771 // result: (NotEqual (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
3775 v.reset(OpPPC64NotEqual)
3776 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3777 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3779 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3786 func rewriteValuePPC64_OpNeq32(v *Value) bool {
3790 // match: (Neq32 x y)
3791 // result: (NotEqual (CMPW x y))
3795 v.reset(OpPPC64NotEqual)
3796 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3802 func rewriteValuePPC64_OpNeq32F(v *Value) bool {
3806 // match: (Neq32F x y)
3807 // result: (NotEqual (FCMPU x y))
3811 v.reset(OpPPC64NotEqual)
3812 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
3818 func rewriteValuePPC64_OpNeq64(v *Value) bool {
3822 // match: (Neq64 x y)
3823 // result: (NotEqual (CMP x y))
3827 v.reset(OpPPC64NotEqual)
3828 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
3834 func rewriteValuePPC64_OpNeq64F(v *Value) bool {
3838 // match: (Neq64F x y)
3839 // result: (NotEqual (FCMPU x y))
3843 v.reset(OpPPC64NotEqual)
3844 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
3850 func rewriteValuePPC64_OpNeq8(v *Value) bool {
3854 typ := &b.Func.Config.Types
3855 // match: (Neq8 x y)
3856 // cond: x.Type.IsSigned() && y.Type.IsSigned()
3857 // result: (NotEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
3859 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3862 if !(x.Type.IsSigned() && y.Type.IsSigned()) {
3865 v.reset(OpPPC64NotEqual)
3866 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3867 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
3869 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
3877 // match: (Neq8 x y)
3878 // result: (NotEqual (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
3882 v.reset(OpPPC64NotEqual)
3883 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3884 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
3886 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
3893 func rewriteValuePPC64_OpNeqPtr(v *Value) bool {
3897 // match: (NeqPtr x y)
3898 // result: (NotEqual (CMP x y))
3902 v.reset(OpPPC64NotEqual)
3903 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
3909 func rewriteValuePPC64_OpNot(v *Value) bool {
3912 // result: (XORconst [1] x)
3915 v.reset(OpPPC64XORconst)
3916 v.AuxInt = int64ToAuxInt(1)
3921 func rewriteValuePPC64_OpOffPtr(v *Value) bool {
3924 typ := &b.Func.Config.Types
3925 // match: (OffPtr [off] ptr)
3926 // result: (ADD (MOVDconst <typ.Int64> [off]) ptr)
3928 off := auxIntToInt64(v.AuxInt)
3931 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3932 v0.AuxInt = int64ToAuxInt(off)
3937 func rewriteValuePPC64_OpPPC64ADD(v *Value) bool {
3940 // match: (ADD l:(MULLD x y) z)
3941 // cond: buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)
3942 // result: (MADDLD x y z)
3944 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3946 if l.Op != OpPPC64MULLD {
3952 if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
3955 v.reset(OpPPC64MADDLD)
3961 // match: (ADD x (MOVDconst <t> [c]))
3962 // cond: is32Bit(c) && !t.IsPtr()
3963 // result: (ADDconst [c] x)
3965 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3967 if v_1.Op != OpPPC64MOVDconst {
3971 c := auxIntToInt64(v_1.AuxInt)
3972 if !(is32Bit(c) && !t.IsPtr()) {
3975 v.reset(OpPPC64ADDconst)
3976 v.AuxInt = int64ToAuxInt(c)
3984 func rewriteValuePPC64_OpPPC64ADDE(v *Value) bool {
3989 typ := &b.Func.Config.Types
3990 // match: (ADDE x y (Select1 <typ.UInt64> (ADDCconst (MOVDconst [0]) [-1])))
3991 // result: (ADDC x y)
3995 if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
3998 v_2_0 := v_2.Args[0]
3999 if v_2_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_2_0.AuxInt) != -1 {
4002 v_2_0_0 := v_2_0.Args[0]
4003 if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
4006 v.reset(OpPPC64ADDC)
4012 func rewriteValuePPC64_OpPPC64ADDconst(v *Value) bool {
4014 // match: (ADDconst [c] (ADDconst [d] x))
4015 // cond: is32Bit(c+d)
4016 // result: (ADDconst [c+d] x)
4018 c := auxIntToInt64(v.AuxInt)
4019 if v_0.Op != OpPPC64ADDconst {
4022 d := auxIntToInt64(v_0.AuxInt)
4024 if !(is32Bit(c + d)) {
4027 v.reset(OpPPC64ADDconst)
4028 v.AuxInt = int64ToAuxInt(c + d)
4032 // match: (ADDconst [0] x)
4035 if auxIntToInt64(v.AuxInt) != 0 {
4042 // match: (ADDconst [c] (MOVDaddr [d] {sym} x))
4043 // cond: is32Bit(c+int64(d))
4044 // result: (MOVDaddr [int32(c+int64(d))] {sym} x)
4046 c := auxIntToInt64(v.AuxInt)
4047 if v_0.Op != OpPPC64MOVDaddr {
4050 d := auxIntToInt32(v_0.AuxInt)
4051 sym := auxToSym(v_0.Aux)
4053 if !(is32Bit(c + int64(d))) {
4056 v.reset(OpPPC64MOVDaddr)
4057 v.AuxInt = int32ToAuxInt(int32(c + int64(d)))
4058 v.Aux = symToAux(sym)
4062 // match: (ADDconst [c] x:(SP))
4064 // result: (MOVDaddr [int32(c)] x)
4066 c := auxIntToInt64(v.AuxInt)
4068 if x.Op != OpSP || !(is32Bit(c)) {
4071 v.reset(OpPPC64MOVDaddr)
4072 v.AuxInt = int32ToAuxInt(int32(c))
4076 // match: (ADDconst [c] (SUBFCconst [d] x))
4077 // cond: is32Bit(c+d)
4078 // result: (SUBFCconst [c+d] x)
4080 c := auxIntToInt64(v.AuxInt)
4081 if v_0.Op != OpPPC64SUBFCconst {
4084 d := auxIntToInt64(v_0.AuxInt)
4086 if !(is32Bit(c + d)) {
4089 v.reset(OpPPC64SUBFCconst)
4090 v.AuxInt = int64ToAuxInt(c + d)
4096 func rewriteValuePPC64_OpPPC64AND(v *Value) bool {
4100 typ := &b.Func.Config.Types
4101 // match: (AND (MOVDconst [m]) (ROTLWconst [r] x))
4102 // cond: isPPC64WordRotateMask(m)
4103 // result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
4105 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4106 if v_0.Op != OpPPC64MOVDconst {
4109 m := auxIntToInt64(v_0.AuxInt)
4110 if v_1.Op != OpPPC64ROTLWconst {
4113 r := auxIntToInt64(v_1.AuxInt)
4115 if !(isPPC64WordRotateMask(m)) {
4118 v.reset(OpPPC64RLWINM)
4119 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
4125 // match: (AND (MOVDconst [m]) (ROTLW x r))
4126 // cond: isPPC64WordRotateMask(m)
4127 // result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
4129 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4130 if v_0.Op != OpPPC64MOVDconst {
4133 m := auxIntToInt64(v_0.AuxInt)
4134 if v_1.Op != OpPPC64ROTLW {
4139 if !(isPPC64WordRotateMask(m)) {
4142 v.reset(OpPPC64RLWNM)
4143 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
4149 // match: (AND (MOVDconst [m]) (SRWconst x [s]))
4150 // cond: mergePPC64RShiftMask(m,s,32) == 0
4151 // result: (MOVDconst [0])
4153 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4154 if v_0.Op != OpPPC64MOVDconst {
4157 m := auxIntToInt64(v_0.AuxInt)
4158 if v_1.Op != OpPPC64SRWconst {
4161 s := auxIntToInt64(v_1.AuxInt)
4162 if !(mergePPC64RShiftMask(m, s, 32) == 0) {
4165 v.reset(OpPPC64MOVDconst)
4166 v.AuxInt = int64ToAuxInt(0)
4171 // match: (AND (MOVDconst [m]) (SRWconst x [s]))
4172 // cond: mergePPC64AndSrwi(m,s) != 0
4173 // result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
4175 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4176 if v_0.Op != OpPPC64MOVDconst {
4179 m := auxIntToInt64(v_0.AuxInt)
4180 if v_1.Op != OpPPC64SRWconst {
4183 s := auxIntToInt64(v_1.AuxInt)
4185 if !(mergePPC64AndSrwi(m, s) != 0) {
4188 v.reset(OpPPC64RLWINM)
4189 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
4195 // match: (AND x (NOR y y))
4196 // result: (ANDN x y)
4198 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4200 if v_1.Op != OpPPC64NOR {
4204 if y != v_1.Args[0] {
4207 v.reset(OpPPC64ANDN)
4213 // match: (AND (MOVDconst [c]) (MOVDconst [d]))
4214 // result: (MOVDconst [c&d])
4216 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4217 if v_0.Op != OpPPC64MOVDconst {
4220 c := auxIntToInt64(v_0.AuxInt)
4221 if v_1.Op != OpPPC64MOVDconst {
4224 d := auxIntToInt64(v_1.AuxInt)
4225 v.reset(OpPPC64MOVDconst)
4226 v.AuxInt = int64ToAuxInt(c & d)
4231 // match: (AND x (MOVDconst [-1]))
4234 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4236 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
4244 // match: (AND x (MOVDconst [c]))
4245 // cond: isU16Bit(c)
4246 // result: (Select0 (ANDCCconst [c] x))
4248 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4250 if v_1.Op != OpPPC64MOVDconst {
4253 c := auxIntToInt64(v_1.AuxInt)
4258 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
4259 v0.AuxInt = int64ToAuxInt(c)
4266 // match: (AND (MOVDconst [c]) y:(MOVWZreg _))
4267 // cond: c&0xFFFFFFFF == 0xFFFFFFFF
4270 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4271 if v_0.Op != OpPPC64MOVDconst {
4274 c := auxIntToInt64(v_0.AuxInt)
4276 if y.Op != OpPPC64MOVWZreg || !(c&0xFFFFFFFF == 0xFFFFFFFF) {
4284 // match: (AND (MOVDconst [0xFFFFFFFF]) y:(MOVWreg x))
4285 // result: (MOVWZreg x)
4287 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4288 if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0xFFFFFFFF {
4292 if y.Op != OpPPC64MOVWreg {
4296 v.reset(OpPPC64MOVWZreg)
4302 // match: (AND (MOVDconst [c]) x:(MOVBZload _ _))
4303 // result: (Select0 (ANDCCconst [c&0xFF] x))
4305 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4306 if v_0.Op != OpPPC64MOVDconst {
4309 c := auxIntToInt64(v_0.AuxInt)
4311 if x.Op != OpPPC64MOVBZload {
4315 v0 := b.NewValue0(x.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
4316 v0.AuxInt = int64ToAuxInt(c & 0xFF)
4325 func rewriteValuePPC64_OpPPC64ANDCCconst(v *Value) bool {
4327 // match: (ANDCCconst [c] (Select0 (ANDCCconst [d] x)))
4328 // result: (ANDCCconst [c&d] x)
4330 c := auxIntToInt64(v.AuxInt)
4331 if v_0.Op != OpSelect0 {
4334 v_0_0 := v_0.Args[0]
4335 if v_0_0.Op != OpPPC64ANDCCconst {
4338 d := auxIntToInt64(v_0_0.AuxInt)
4340 v.reset(OpPPC64ANDCCconst)
4341 v.AuxInt = int64ToAuxInt(c & d)
4347 func rewriteValuePPC64_OpPPC64ANDN(v *Value) bool {
4350 // match: (ANDN (MOVDconst [c]) (MOVDconst [d]))
4351 // result: (MOVDconst [c&^d])
4353 if v_0.Op != OpPPC64MOVDconst {
4356 c := auxIntToInt64(v_0.AuxInt)
4357 if v_1.Op != OpPPC64MOVDconst {
4360 d := auxIntToInt64(v_1.AuxInt)
4361 v.reset(OpPPC64MOVDconst)
4362 v.AuxInt = int64ToAuxInt(c &^ d)
4367 func rewriteValuePPC64_OpPPC64BRD(v *Value) bool {
4370 typ := &b.Func.Config.Types
4371 // match: (BRD x:(MOVDload [off] {sym} ptr mem))
4372 // cond: x.Uses == 1
4373 // result: @x.Block (MOVDBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
4376 if x.Op != OpPPC64MOVDload {
4379 off := auxIntToInt32(x.AuxInt)
4380 sym := auxToSym(x.Aux)
4387 v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
4389 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
4390 v1.AuxInt = int32ToAuxInt(off)
4391 v1.Aux = symToAux(sym)
4396 // match: (BRD x:(MOVDloadidx ptr idx mem))
4397 // cond: x.Uses == 1
4398 // result: @x.Block (MOVDBRloadidx ptr idx mem)
4401 if x.Op != OpPPC64MOVDloadidx {
4411 v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
4413 v0.AddArg3(ptr, idx, mem)
4418 func rewriteValuePPC64_OpPPC64BRH(v *Value) bool {
4421 typ := &b.Func.Config.Types
4422 // match: (BRH x:(MOVHZload [off] {sym} ptr mem))
4423 // cond: x.Uses == 1
4424 // result: @x.Block (MOVHBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
4427 if x.Op != OpPPC64MOVHZload {
4430 off := auxIntToInt32(x.AuxInt)
4431 sym := auxToSym(x.Aux)
4438 v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
4440 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
4441 v1.AuxInt = int32ToAuxInt(off)
4442 v1.Aux = symToAux(sym)
4447 // match: (BRH x:(MOVHZloadidx ptr idx mem))
4448 // cond: x.Uses == 1
4449 // result: @x.Block (MOVHZreg (MOVHBRloadidx ptr idx mem))
4452 if x.Op != OpPPC64MOVHZloadidx {
4462 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
4464 v1 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
4465 v1.AddArg3(ptr, idx, mem)
4471 func rewriteValuePPC64_OpPPC64BRW(v *Value) bool {
4474 typ := &b.Func.Config.Types
4475 // match: (BRW x:(MOVWZload [off] {sym} ptr mem))
4476 // cond: x.Uses == 1
4477 // result: @x.Block (MOVWBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
4480 if x.Op != OpPPC64MOVWZload {
4483 off := auxIntToInt32(x.AuxInt)
4484 sym := auxToSym(x.Aux)
4491 v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
4493 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
4494 v1.AuxInt = int32ToAuxInt(off)
4495 v1.Aux = symToAux(sym)
4500 // match: (BRW x:(MOVWZloadidx ptr idx mem))
4501 // cond: x.Uses == 1
4502 // result: @x.Block (MOVWZreg (MOVWBRloadidx ptr idx mem))
4505 if x.Op != OpPPC64MOVWZloadidx {
4515 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
4517 v1 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
4518 v1.AddArg3(ptr, idx, mem)
4524 func rewriteValuePPC64_OpPPC64CLRLSLDI(v *Value) bool {
4526 // match: (CLRLSLDI [c] (SRWconst [s] x))
4527 // cond: mergePPC64ClrlsldiSrw(int64(c),s) != 0
4528 // result: (RLWINM [mergePPC64ClrlsldiSrw(int64(c),s)] x)
4530 c := auxIntToInt32(v.AuxInt)
4531 if v_0.Op != OpPPC64SRWconst {
4534 s := auxIntToInt64(v_0.AuxInt)
4536 if !(mergePPC64ClrlsldiSrw(int64(c), s) != 0) {
4539 v.reset(OpPPC64RLWINM)
4540 v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrw(int64(c), s))
4544 // match: (CLRLSLDI [c] i:(RLWINM [s] x))
4545 // cond: mergePPC64ClrlsldiRlwinm(c,s) != 0
4546 // result: (RLWINM [mergePPC64ClrlsldiRlwinm(c,s)] x)
4548 c := auxIntToInt32(v.AuxInt)
4550 if i.Op != OpPPC64RLWINM {
4553 s := auxIntToInt64(i.AuxInt)
4555 if !(mergePPC64ClrlsldiRlwinm(c, s) != 0) {
4558 v.reset(OpPPC64RLWINM)
4559 v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiRlwinm(c, s))
4565 func rewriteValuePPC64_OpPPC64CMP(v *Value) bool {
4569 // match: (CMP x (MOVDconst [c]))
4571 // result: (CMPconst x [c])
4574 if v_1.Op != OpPPC64MOVDconst {
4577 c := auxIntToInt64(v_1.AuxInt)
4581 v.reset(OpPPC64CMPconst)
4582 v.AuxInt = int64ToAuxInt(c)
4586 // match: (CMP (MOVDconst [c]) y)
4588 // result: (InvertFlags (CMPconst y [c]))
4590 if v_0.Op != OpPPC64MOVDconst {
4593 c := auxIntToInt64(v_0.AuxInt)
4598 v.reset(OpPPC64InvertFlags)
4599 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
4600 v0.AuxInt = int64ToAuxInt(c)
4606 // cond: canonLessThan(x,y)
4607 // result: (InvertFlags (CMP y x))
4611 if !(canonLessThan(x, y)) {
4614 v.reset(OpPPC64InvertFlags)
4615 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
4622 func rewriteValuePPC64_OpPPC64CMPU(v *Value) bool {
4626 // match: (CMPU x (MOVDconst [c]))
4627 // cond: isU16Bit(c)
4628 // result: (CMPUconst x [c])
4631 if v_1.Op != OpPPC64MOVDconst {
4634 c := auxIntToInt64(v_1.AuxInt)
4638 v.reset(OpPPC64CMPUconst)
4639 v.AuxInt = int64ToAuxInt(c)
4643 // match: (CMPU (MOVDconst [c]) y)
4644 // cond: isU16Bit(c)
4645 // result: (InvertFlags (CMPUconst y [c]))
4647 if v_0.Op != OpPPC64MOVDconst {
4650 c := auxIntToInt64(v_0.AuxInt)
4655 v.reset(OpPPC64InvertFlags)
4656 v0 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
4657 v0.AuxInt = int64ToAuxInt(c)
4662 // match: (CMPU x y)
4663 // cond: canonLessThan(x,y)
4664 // result: (InvertFlags (CMPU y x))
4668 if !(canonLessThan(x, y)) {
4671 v.reset(OpPPC64InvertFlags)
4672 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
4679 func rewriteValuePPC64_OpPPC64CMPUconst(v *Value) bool {
4681 // match: (CMPUconst [d] (Select0 (ANDCCconst z [c])))
4682 // cond: uint64(d) > uint64(c)
4685 d := auxIntToInt64(v.AuxInt)
4686 if v_0.Op != OpSelect0 {
4689 v_0_0 := v_0.Args[0]
4690 if v_0_0.Op != OpPPC64ANDCCconst {
4693 c := auxIntToInt64(v_0_0.AuxInt)
4694 if !(uint64(d) > uint64(c)) {
4697 v.reset(OpPPC64FlagLT)
4700 // match: (CMPUconst (MOVDconst [x]) [y])
4704 y := auxIntToInt64(v.AuxInt)
4705 if v_0.Op != OpPPC64MOVDconst {
4708 x := auxIntToInt64(v_0.AuxInt)
4712 v.reset(OpPPC64FlagEQ)
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(OpPPC64FlagLT)
4730 // match: (CMPUconst (MOVDconst [x]) [y])
4731 // cond: uint64(x)>uint64(y)
4734 y := auxIntToInt64(v.AuxInt)
4735 if v_0.Op != OpPPC64MOVDconst {
4738 x := auxIntToInt64(v_0.AuxInt)
4739 if !(uint64(x) > uint64(y)) {
4742 v.reset(OpPPC64FlagGT)
4747 func rewriteValuePPC64_OpPPC64CMPW(v *Value) bool {
4751 // match: (CMPW x (MOVWreg y))
4752 // result: (CMPW x y)
4755 if v_1.Op != OpPPC64MOVWreg {
4759 v.reset(OpPPC64CMPW)
4763 // match: (CMPW (MOVWreg x) y)
4764 // result: (CMPW x y)
4766 if v_0.Op != OpPPC64MOVWreg {
4771 v.reset(OpPPC64CMPW)
4775 // match: (CMPW x (MOVDconst [c]))
4777 // result: (CMPWconst x [int32(c)])
4780 if v_1.Op != OpPPC64MOVDconst {
4783 c := auxIntToInt64(v_1.AuxInt)
4787 v.reset(OpPPC64CMPWconst)
4788 v.AuxInt = int32ToAuxInt(int32(c))
4792 // match: (CMPW (MOVDconst [c]) y)
4794 // result: (InvertFlags (CMPWconst y [int32(c)]))
4796 if v_0.Op != OpPPC64MOVDconst {
4799 c := auxIntToInt64(v_0.AuxInt)
4804 v.reset(OpPPC64InvertFlags)
4805 v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, types.TypeFlags)
4806 v0.AuxInt = int32ToAuxInt(int32(c))
4811 // match: (CMPW x y)
4812 // cond: canonLessThan(x,y)
4813 // result: (InvertFlags (CMPW y x))
4817 if !(canonLessThan(x, y)) {
4820 v.reset(OpPPC64InvertFlags)
4821 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
4828 func rewriteValuePPC64_OpPPC64CMPWU(v *Value) bool {
4832 // match: (CMPWU x (MOVWZreg y))
4833 // result: (CMPWU x y)
4836 if v_1.Op != OpPPC64MOVWZreg {
4840 v.reset(OpPPC64CMPWU)
4844 // match: (CMPWU (MOVWZreg x) y)
4845 // result: (CMPWU x y)
4847 if v_0.Op != OpPPC64MOVWZreg {
4852 v.reset(OpPPC64CMPWU)
4856 // match: (CMPWU x (MOVDconst [c]))
4857 // cond: isU16Bit(c)
4858 // result: (CMPWUconst x [int32(c)])
4861 if v_1.Op != OpPPC64MOVDconst {
4864 c := auxIntToInt64(v_1.AuxInt)
4868 v.reset(OpPPC64CMPWUconst)
4869 v.AuxInt = int32ToAuxInt(int32(c))
4873 // match: (CMPWU (MOVDconst [c]) y)
4874 // cond: isU16Bit(c)
4875 // result: (InvertFlags (CMPWUconst y [int32(c)]))
4877 if v_0.Op != OpPPC64MOVDconst {
4880 c := auxIntToInt64(v_0.AuxInt)
4885 v.reset(OpPPC64InvertFlags)
4886 v0 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
4887 v0.AuxInt = int32ToAuxInt(int32(c))
4892 // match: (CMPWU x y)
4893 // cond: canonLessThan(x,y)
4894 // result: (InvertFlags (CMPWU y x))
4898 if !(canonLessThan(x, y)) {
4901 v.reset(OpPPC64InvertFlags)
4902 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
4909 func rewriteValuePPC64_OpPPC64CMPWUconst(v *Value) bool {
4911 // match: (CMPWUconst [d] (Select0 (ANDCCconst z [c])))
4912 // cond: uint64(d) > uint64(c)
4915 d := auxIntToInt32(v.AuxInt)
4916 if v_0.Op != OpSelect0 {
4919 v_0_0 := v_0.Args[0]
4920 if v_0_0.Op != OpPPC64ANDCCconst {
4923 c := auxIntToInt64(v_0_0.AuxInt)
4924 if !(uint64(d) > uint64(c)) {
4927 v.reset(OpPPC64FlagLT)
4930 // match: (CMPWUconst (MOVDconst [x]) [y])
4931 // cond: int32(x)==int32(y)
4934 y := auxIntToInt32(v.AuxInt)
4935 if v_0.Op != OpPPC64MOVDconst {
4938 x := auxIntToInt64(v_0.AuxInt)
4939 if !(int32(x) == int32(y)) {
4942 v.reset(OpPPC64FlagEQ)
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(OpPPC64FlagLT)
4960 // match: (CMPWUconst (MOVDconst [x]) [y])
4961 // cond: uint32(x)>uint32(y)
4964 y := auxIntToInt32(v.AuxInt)
4965 if v_0.Op != OpPPC64MOVDconst {
4968 x := auxIntToInt64(v_0.AuxInt)
4969 if !(uint32(x) > uint32(y)) {
4972 v.reset(OpPPC64FlagGT)
4977 func rewriteValuePPC64_OpPPC64CMPWconst(v *Value) bool {
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(OpPPC64FlagEQ)
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(OpPPC64FlagLT)
5009 // match: (CMPWconst (MOVDconst [x]) [y])
5010 // cond: int32(x)>int32(y)
5013 y := auxIntToInt32(v.AuxInt)
5014 if v_0.Op != OpPPC64MOVDconst {
5017 x := auxIntToInt64(v_0.AuxInt)
5018 if !(int32(x) > int32(y)) {
5021 v.reset(OpPPC64FlagGT)
5026 func rewriteValuePPC64_OpPPC64CMPconst(v *Value) bool {
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(OpPPC64FlagEQ)
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(OpPPC64FlagLT)
5058 // match: (CMPconst (MOVDconst [x]) [y])
5062 y := auxIntToInt64(v.AuxInt)
5063 if v_0.Op != OpPPC64MOVDconst {
5066 x := auxIntToInt64(v_0.AuxInt)
5070 v.reset(OpPPC64FlagGT)
5075 func rewriteValuePPC64_OpPPC64Equal(v *Value) bool {
5077 // match: (Equal (FlagEQ))
5078 // result: (MOVDconst [1])
5080 if v_0.Op != OpPPC64FlagEQ {
5083 v.reset(OpPPC64MOVDconst)
5084 v.AuxInt = int64ToAuxInt(1)
5087 // match: (Equal (FlagLT))
5088 // result: (MOVDconst [0])
5090 if v_0.Op != OpPPC64FlagLT {
5093 v.reset(OpPPC64MOVDconst)
5094 v.AuxInt = int64ToAuxInt(0)
5097 // match: (Equal (FlagGT))
5098 // result: (MOVDconst [0])
5100 if v_0.Op != OpPPC64FlagGT {
5103 v.reset(OpPPC64MOVDconst)
5104 v.AuxInt = int64ToAuxInt(0)
5107 // match: (Equal (InvertFlags x))
5108 // result: (Equal x)
5110 if v_0.Op != OpPPC64InvertFlags {
5114 v.reset(OpPPC64Equal)
5118 // match: (Equal cmp)
5119 // result: (SETBC [2] cmp)
5122 v.reset(OpPPC64SETBC)
5123 v.AuxInt = int32ToAuxInt(2)
5128 func rewriteValuePPC64_OpPPC64FABS(v *Value) bool {
5130 // match: (FABS (FMOVDconst [x]))
5131 // result: (FMOVDconst [math.Abs(x)])
5133 if v_0.Op != OpPPC64FMOVDconst {
5136 x := auxIntToFloat64(v_0.AuxInt)
5137 v.reset(OpPPC64FMOVDconst)
5138 v.AuxInt = float64ToAuxInt(math.Abs(x))
5143 func rewriteValuePPC64_OpPPC64FADD(v *Value) bool {
5146 // match: (FADD (FMUL x y) z)
5147 // cond: x.Block.Func.useFMA(v)
5148 // result: (FMADD x y z)
5150 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5151 if v_0.Op != OpPPC64FMUL {
5155 v_0_0 := v_0.Args[0]
5156 v_0_1 := v_0.Args[1]
5157 for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
5161 if !(x.Block.Func.useFMA(v)) {
5164 v.reset(OpPPC64FMADD)
5173 func rewriteValuePPC64_OpPPC64FADDS(v *Value) bool {
5176 // match: (FADDS (FMULS x y) z)
5177 // cond: x.Block.Func.useFMA(v)
5178 // result: (FMADDS x y z)
5180 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5181 if v_0.Op != OpPPC64FMULS {
5185 v_0_0 := v_0.Args[0]
5186 v_0_1 := v_0.Args[1]
5187 for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
5191 if !(x.Block.Func.useFMA(v)) {
5194 v.reset(OpPPC64FMADDS)
5203 func rewriteValuePPC64_OpPPC64FCEIL(v *Value) bool {
5205 // match: (FCEIL (FMOVDconst [x]))
5206 // result: (FMOVDconst [math.Ceil(x)])
5208 if v_0.Op != OpPPC64FMOVDconst {
5211 x := auxIntToFloat64(v_0.AuxInt)
5212 v.reset(OpPPC64FMOVDconst)
5213 v.AuxInt = float64ToAuxInt(math.Ceil(x))
5218 func rewriteValuePPC64_OpPPC64FFLOOR(v *Value) bool {
5220 // match: (FFLOOR (FMOVDconst [x]))
5221 // result: (FMOVDconst [math.Floor(x)])
5223 if v_0.Op != OpPPC64FMOVDconst {
5226 x := auxIntToFloat64(v_0.AuxInt)
5227 v.reset(OpPPC64FMOVDconst)
5228 v.AuxInt = float64ToAuxInt(math.Floor(x))
5233 func rewriteValuePPC64_OpPPC64FGreaterEqual(v *Value) bool {
5236 typ := &b.Func.Config.Types
5237 // match: (FGreaterEqual cmp)
5238 // result: (OR (SETBC [2] cmp) (SETBC [1] cmp))
5242 v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
5243 v0.AuxInt = int32ToAuxInt(2)
5245 v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
5246 v1.AuxInt = int32ToAuxInt(1)
5252 func rewriteValuePPC64_OpPPC64FGreaterThan(v *Value) bool {
5254 // match: (FGreaterThan cmp)
5255 // result: (SETBC [1] cmp)
5258 v.reset(OpPPC64SETBC)
5259 v.AuxInt = int32ToAuxInt(1)
5264 func rewriteValuePPC64_OpPPC64FLessEqual(v *Value) bool {
5267 typ := &b.Func.Config.Types
5268 // match: (FLessEqual cmp)
5269 // result: (OR (SETBC [2] cmp) (SETBC [0] cmp))
5273 v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
5274 v0.AuxInt = int32ToAuxInt(2)
5276 v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
5277 v1.AuxInt = int32ToAuxInt(0)
5283 func rewriteValuePPC64_OpPPC64FLessThan(v *Value) bool {
5285 // match: (FLessThan cmp)
5286 // result: (SETBC [0] cmp)
5289 v.reset(OpPPC64SETBC)
5290 v.AuxInt = int32ToAuxInt(0)
5295 func rewriteValuePPC64_OpPPC64FMOVDload(v *Value) bool {
5298 // match: (FMOVDload [off] {sym} ptr (MOVDstore [off] {sym} ptr x _))
5299 // result: (MTVSRD x)
5301 off := auxIntToInt32(v.AuxInt)
5302 sym := auxToSym(v.Aux)
5304 if v_1.Op != OpPPC64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
5308 if ptr != v_1.Args[0] {
5311 v.reset(OpPPC64MTVSRD)
5315 // match: (FMOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
5316 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
5317 // result: (FMOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
5319 off1 := auxIntToInt32(v.AuxInt)
5320 sym1 := auxToSym(v.Aux)
5322 if p.Op != OpPPC64MOVDaddr {
5325 off2 := auxIntToInt32(p.AuxInt)
5326 sym2 := auxToSym(p.Aux)
5329 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
5332 v.reset(OpPPC64FMOVDload)
5333 v.AuxInt = int32ToAuxInt(off1 + off2)
5334 v.Aux = symToAux(mergeSym(sym1, sym2))
5338 // match: (FMOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
5339 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
5340 // result: (FMOVDload [off1+int32(off2)] {sym} ptr mem)
5342 off1 := auxIntToInt32(v.AuxInt)
5343 sym := auxToSym(v.Aux)
5344 if v_0.Op != OpPPC64ADDconst {
5347 off2 := auxIntToInt64(v_0.AuxInt)
5350 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
5353 v.reset(OpPPC64FMOVDload)
5354 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
5355 v.Aux = symToAux(sym)
5361 func rewriteValuePPC64_OpPPC64FMOVDstore(v *Value) bool {
5365 // match: (FMOVDstore [off] {sym} ptr (MTVSRD x) mem)
5366 // result: (MOVDstore [off] {sym} ptr x mem)
5368 off := auxIntToInt32(v.AuxInt)
5369 sym := auxToSym(v.Aux)
5371 if v_1.Op != OpPPC64MTVSRD {
5376 v.reset(OpPPC64MOVDstore)
5377 v.AuxInt = int32ToAuxInt(off)
5378 v.Aux = symToAux(sym)
5379 v.AddArg3(ptr, x, mem)
5382 // match: (FMOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
5383 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
5384 // result: (FMOVDstore [off1+int32(off2)] {sym} ptr val mem)
5386 off1 := auxIntToInt32(v.AuxInt)
5387 sym := auxToSym(v.Aux)
5388 if v_0.Op != OpPPC64ADDconst {
5391 off2 := auxIntToInt64(v_0.AuxInt)
5395 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
5398 v.reset(OpPPC64FMOVDstore)
5399 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
5400 v.Aux = symToAux(sym)
5401 v.AddArg3(ptr, val, mem)
5404 // match: (FMOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
5405 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
5406 // result: (FMOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
5408 off1 := auxIntToInt32(v.AuxInt)
5409 sym1 := auxToSym(v.Aux)
5411 if p.Op != OpPPC64MOVDaddr {
5414 off2 := auxIntToInt32(p.AuxInt)
5415 sym2 := auxToSym(p.Aux)
5419 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
5422 v.reset(OpPPC64FMOVDstore)
5423 v.AuxInt = int32ToAuxInt(off1 + off2)
5424 v.Aux = symToAux(mergeSym(sym1, sym2))
5425 v.AddArg3(ptr, val, mem)
5430 func rewriteValuePPC64_OpPPC64FMOVSload(v *Value) bool {
5433 // match: (FMOVSload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
5434 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
5435 // result: (FMOVSload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
5437 off1 := auxIntToInt32(v.AuxInt)
5438 sym1 := auxToSym(v.Aux)
5440 if p.Op != OpPPC64MOVDaddr {
5443 off2 := auxIntToInt32(p.AuxInt)
5444 sym2 := auxToSym(p.Aux)
5447 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
5450 v.reset(OpPPC64FMOVSload)
5451 v.AuxInt = int32ToAuxInt(off1 + off2)
5452 v.Aux = symToAux(mergeSym(sym1, sym2))
5456 // match: (FMOVSload [off1] {sym} (ADDconst [off2] ptr) mem)
5457 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
5458 // result: (FMOVSload [off1+int32(off2)] {sym} ptr mem)
5460 off1 := auxIntToInt32(v.AuxInt)
5461 sym := auxToSym(v.Aux)
5462 if v_0.Op != OpPPC64ADDconst {
5465 off2 := auxIntToInt64(v_0.AuxInt)
5468 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
5471 v.reset(OpPPC64FMOVSload)
5472 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
5473 v.Aux = symToAux(sym)
5479 func rewriteValuePPC64_OpPPC64FMOVSstore(v *Value) bool {
5483 // match: (FMOVSstore [off1] {sym} (ADDconst [off2] ptr) val mem)
5484 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
5485 // result: (FMOVSstore [off1+int32(off2)] {sym} ptr val mem)
5487 off1 := auxIntToInt32(v.AuxInt)
5488 sym := auxToSym(v.Aux)
5489 if v_0.Op != OpPPC64ADDconst {
5492 off2 := auxIntToInt64(v_0.AuxInt)
5496 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
5499 v.reset(OpPPC64FMOVSstore)
5500 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
5501 v.Aux = symToAux(sym)
5502 v.AddArg3(ptr, val, mem)
5505 // match: (FMOVSstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
5506 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
5507 // result: (FMOVSstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
5509 off1 := auxIntToInt32(v.AuxInt)
5510 sym1 := auxToSym(v.Aux)
5512 if p.Op != OpPPC64MOVDaddr {
5515 off2 := auxIntToInt32(p.AuxInt)
5516 sym2 := auxToSym(p.Aux)
5520 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
5523 v.reset(OpPPC64FMOVSstore)
5524 v.AuxInt = int32ToAuxInt(off1 + off2)
5525 v.Aux = symToAux(mergeSym(sym1, sym2))
5526 v.AddArg3(ptr, val, mem)
5531 func rewriteValuePPC64_OpPPC64FNEG(v *Value) bool {
5533 // match: (FNEG (FABS x))
5534 // result: (FNABS x)
5536 if v_0.Op != OpPPC64FABS {
5540 v.reset(OpPPC64FNABS)
5544 // match: (FNEG (FNABS x))
5547 if v_0.Op != OpPPC64FNABS {
5551 v.reset(OpPPC64FABS)
5557 func rewriteValuePPC64_OpPPC64FSQRT(v *Value) bool {
5559 // match: (FSQRT (FMOVDconst [x]))
5561 // result: (FMOVDconst [math.Sqrt(x)])
5563 if v_0.Op != OpPPC64FMOVDconst {
5566 x := auxIntToFloat64(v_0.AuxInt)
5570 v.reset(OpPPC64FMOVDconst)
5571 v.AuxInt = float64ToAuxInt(math.Sqrt(x))
5576 func rewriteValuePPC64_OpPPC64FSUB(v *Value) bool {
5579 // match: (FSUB (FMUL x y) z)
5580 // cond: x.Block.Func.useFMA(v)
5581 // result: (FMSUB x y z)
5583 if v_0.Op != OpPPC64FMUL {
5587 v_0_0 := v_0.Args[0]
5588 v_0_1 := v_0.Args[1]
5589 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
5593 if !(x.Block.Func.useFMA(v)) {
5596 v.reset(OpPPC64FMSUB)
5604 func rewriteValuePPC64_OpPPC64FSUBS(v *Value) bool {
5607 // match: (FSUBS (FMULS x y) z)
5608 // cond: x.Block.Func.useFMA(v)
5609 // result: (FMSUBS x y z)
5611 if v_0.Op != OpPPC64FMULS {
5615 v_0_0 := v_0.Args[0]
5616 v_0_1 := v_0.Args[1]
5617 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
5621 if !(x.Block.Func.useFMA(v)) {
5624 v.reset(OpPPC64FMSUBS)
5632 func rewriteValuePPC64_OpPPC64FTRUNC(v *Value) bool {
5634 // match: (FTRUNC (FMOVDconst [x]))
5635 // result: (FMOVDconst [math.Trunc(x)])
5637 if v_0.Op != OpPPC64FMOVDconst {
5640 x := auxIntToFloat64(v_0.AuxInt)
5641 v.reset(OpPPC64FMOVDconst)
5642 v.AuxInt = float64ToAuxInt(math.Trunc(x))
5647 func rewriteValuePPC64_OpPPC64GreaterEqual(v *Value) bool {
5649 // match: (GreaterEqual (FlagEQ))
5650 // result: (MOVDconst [1])
5652 if v_0.Op != OpPPC64FlagEQ {
5655 v.reset(OpPPC64MOVDconst)
5656 v.AuxInt = int64ToAuxInt(1)
5659 // match: (GreaterEqual (FlagLT))
5660 // result: (MOVDconst [0])
5662 if v_0.Op != OpPPC64FlagLT {
5665 v.reset(OpPPC64MOVDconst)
5666 v.AuxInt = int64ToAuxInt(0)
5669 // match: (GreaterEqual (FlagGT))
5670 // result: (MOVDconst [1])
5672 if v_0.Op != OpPPC64FlagGT {
5675 v.reset(OpPPC64MOVDconst)
5676 v.AuxInt = int64ToAuxInt(1)
5679 // match: (GreaterEqual (InvertFlags x))
5680 // result: (LessEqual x)
5682 if v_0.Op != OpPPC64InvertFlags {
5686 v.reset(OpPPC64LessEqual)
5690 // match: (GreaterEqual cmp)
5691 // result: (SETBCR [0] cmp)
5694 v.reset(OpPPC64SETBCR)
5695 v.AuxInt = int32ToAuxInt(0)
5700 func rewriteValuePPC64_OpPPC64GreaterThan(v *Value) bool {
5702 // match: (GreaterThan (FlagEQ))
5703 // result: (MOVDconst [0])
5705 if v_0.Op != OpPPC64FlagEQ {
5708 v.reset(OpPPC64MOVDconst)
5709 v.AuxInt = int64ToAuxInt(0)
5712 // match: (GreaterThan (FlagLT))
5713 // result: (MOVDconst [0])
5715 if v_0.Op != OpPPC64FlagLT {
5718 v.reset(OpPPC64MOVDconst)
5719 v.AuxInt = int64ToAuxInt(0)
5722 // match: (GreaterThan (FlagGT))
5723 // result: (MOVDconst [1])
5725 if v_0.Op != OpPPC64FlagGT {
5728 v.reset(OpPPC64MOVDconst)
5729 v.AuxInt = int64ToAuxInt(1)
5732 // match: (GreaterThan (InvertFlags x))
5733 // result: (LessThan x)
5735 if v_0.Op != OpPPC64InvertFlags {
5739 v.reset(OpPPC64LessThan)
5743 // match: (GreaterThan cmp)
5744 // result: (SETBC [1] cmp)
5747 v.reset(OpPPC64SETBC)
5748 v.AuxInt = int32ToAuxInt(1)
5753 func rewriteValuePPC64_OpPPC64ISEL(v *Value) bool {
5758 typ := &b.Func.Config.Types
5759 // match: (ISEL [6] x y (Select1 (ANDCCconst [1] (SETBC [c] cmp))))
5760 // result: (ISEL [c] x y cmp)
5762 if auxIntToInt32(v.AuxInt) != 6 {
5767 if v_2.Op != OpSelect1 {
5770 v_2_0 := v_2.Args[0]
5771 if v_2_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_2_0.AuxInt) != 1 {
5774 v_2_0_0 := v_2_0.Args[0]
5775 if v_2_0_0.Op != OpPPC64SETBC {
5778 c := auxIntToInt32(v_2_0_0.AuxInt)
5779 cmp := v_2_0_0.Args[0]
5780 v.reset(OpPPC64ISEL)
5781 v.AuxInt = int32ToAuxInt(c)
5782 v.AddArg3(x, y, cmp)
5785 // match: (ISEL [6] x y (CMPconst [0] (SETBC [c] cmp)))
5786 // result: (ISEL [c] x y cmp)
5788 if auxIntToInt32(v.AuxInt) != 6 {
5793 if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
5796 v_2_0 := v_2.Args[0]
5797 if v_2_0.Op != OpPPC64SETBC {
5800 c := auxIntToInt32(v_2_0.AuxInt)
5801 cmp := v_2_0.Args[0]
5802 v.reset(OpPPC64ISEL)
5803 v.AuxInt = int32ToAuxInt(c)
5804 v.AddArg3(x, y, cmp)
5807 // match: (ISEL [6] x y (CMPWconst [0] (SETBC [c] cmp)))
5808 // result: (ISEL [c] x y cmp)
5810 if auxIntToInt32(v.AuxInt) != 6 {
5815 if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
5818 v_2_0 := v_2.Args[0]
5819 if v_2_0.Op != OpPPC64SETBC {
5822 c := auxIntToInt32(v_2_0.AuxInt)
5823 cmp := v_2_0.Args[0]
5824 v.reset(OpPPC64ISEL)
5825 v.AuxInt = int32ToAuxInt(c)
5826 v.AddArg3(x, y, cmp)
5829 // match: (ISEL [6] x y (CMPconst [0] (SETBCR [c] cmp)))
5830 // result: (ISEL [c+4] x y cmp)
5832 if auxIntToInt32(v.AuxInt) != 6 {
5837 if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
5840 v_2_0 := v_2.Args[0]
5841 if v_2_0.Op != OpPPC64SETBCR {
5844 c := auxIntToInt32(v_2_0.AuxInt)
5845 cmp := v_2_0.Args[0]
5846 v.reset(OpPPC64ISEL)
5847 v.AuxInt = int32ToAuxInt(c + 4)
5848 v.AddArg3(x, y, cmp)
5851 // match: (ISEL [6] x y (CMPWconst [0] (SETBCR [c] cmp)))
5852 // result: (ISEL [c+4] x y cmp)
5854 if auxIntToInt32(v.AuxInt) != 6 {
5859 if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
5862 v_2_0 := v_2.Args[0]
5863 if v_2_0.Op != OpPPC64SETBCR {
5866 c := auxIntToInt32(v_2_0.AuxInt)
5867 cmp := v_2_0.Args[0]
5868 v.reset(OpPPC64ISEL)
5869 v.AuxInt = int32ToAuxInt(c + 4)
5870 v.AddArg3(x, y, cmp)
5873 // match: (ISEL [2] x _ (FlagEQ))
5876 if auxIntToInt32(v.AuxInt) != 2 {
5880 if v_2.Op != OpPPC64FlagEQ {
5886 // match: (ISEL [2] _ y (FlagLT))
5889 if auxIntToInt32(v.AuxInt) != 2 {
5893 if v_2.Op != OpPPC64FlagLT {
5899 // match: (ISEL [2] _ y (FlagGT))
5902 if auxIntToInt32(v.AuxInt) != 2 {
5906 if v_2.Op != OpPPC64FlagGT {
5912 // match: (ISEL [6] _ y (FlagEQ))
5915 if auxIntToInt32(v.AuxInt) != 6 {
5919 if v_2.Op != OpPPC64FlagEQ {
5925 // match: (ISEL [6] x _ (FlagLT))
5928 if auxIntToInt32(v.AuxInt) != 6 {
5932 if v_2.Op != OpPPC64FlagLT {
5938 // match: (ISEL [6] x _ (FlagGT))
5941 if auxIntToInt32(v.AuxInt) != 6 {
5945 if v_2.Op != OpPPC64FlagGT {
5951 // match: (ISEL [0] _ y (FlagEQ))
5954 if auxIntToInt32(v.AuxInt) != 0 {
5958 if v_2.Op != OpPPC64FlagEQ {
5964 // match: (ISEL [0] _ y (FlagGT))
5967 if auxIntToInt32(v.AuxInt) != 0 {
5971 if v_2.Op != OpPPC64FlagGT {
5977 // match: (ISEL [0] x _ (FlagLT))
5980 if auxIntToInt32(v.AuxInt) != 0 {
5984 if v_2.Op != OpPPC64FlagLT {
5990 // match: (ISEL [5] _ x (FlagEQ))
5993 if auxIntToInt32(v.AuxInt) != 5 {
5997 if v_2.Op != OpPPC64FlagEQ {
6003 // match: (ISEL [5] _ x (FlagLT))
6006 if auxIntToInt32(v.AuxInt) != 5 {
6010 if v_2.Op != OpPPC64FlagLT {
6016 // match: (ISEL [5] y _ (FlagGT))
6019 if auxIntToInt32(v.AuxInt) != 5 {
6023 if v_2.Op != OpPPC64FlagGT {
6029 // match: (ISEL [1] _ y (FlagEQ))
6032 if auxIntToInt32(v.AuxInt) != 1 {
6036 if v_2.Op != OpPPC64FlagEQ {
6042 // match: (ISEL [1] _ y (FlagLT))
6045 if auxIntToInt32(v.AuxInt) != 1 {
6049 if v_2.Op != OpPPC64FlagLT {
6055 // match: (ISEL [1] x _ (FlagGT))
6058 if auxIntToInt32(v.AuxInt) != 1 {
6062 if v_2.Op != OpPPC64FlagGT {
6068 // match: (ISEL [4] x _ (FlagEQ))
6071 if auxIntToInt32(v.AuxInt) != 4 {
6075 if v_2.Op != OpPPC64FlagEQ {
6081 // match: (ISEL [4] x _ (FlagGT))
6084 if auxIntToInt32(v.AuxInt) != 4 {
6088 if v_2.Op != OpPPC64FlagGT {
6094 // match: (ISEL [4] _ y (FlagLT))
6097 if auxIntToInt32(v.AuxInt) != 4 {
6101 if v_2.Op != OpPPC64FlagLT {
6107 // match: (ISEL [2] x y (CMPconst [0] (Select0 (ANDCCconst [n] z))))
6108 // result: (ISEL [2] x y (Select1 <types.TypeFlags> (ANDCCconst [n] z )))
6110 if auxIntToInt32(v.AuxInt) != 2 {
6115 if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
6118 v_2_0 := v_2.Args[0]
6119 if v_2_0.Op != OpSelect0 {
6122 v_2_0_0 := v_2_0.Args[0]
6123 if v_2_0_0.Op != OpPPC64ANDCCconst {
6126 n := auxIntToInt64(v_2_0_0.AuxInt)
6127 z := v_2_0_0.Args[0]
6128 v.reset(OpPPC64ISEL)
6129 v.AuxInt = int32ToAuxInt(2)
6130 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
6131 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
6132 v1.AuxInt = int64ToAuxInt(n)
6138 // match: (ISEL [2] x y (CMPWconst [0] (Select0 (ANDCCconst [n] z))))
6139 // result: (ISEL [2] x y (Select1 <types.TypeFlags> (ANDCCconst [n] z )))
6141 if auxIntToInt32(v.AuxInt) != 2 {
6146 if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
6149 v_2_0 := v_2.Args[0]
6150 if v_2_0.Op != OpSelect0 {
6153 v_2_0_0 := v_2_0.Args[0]
6154 if v_2_0_0.Op != OpPPC64ANDCCconst {
6157 n := auxIntToInt64(v_2_0_0.AuxInt)
6158 z := v_2_0_0.Args[0]
6159 v.reset(OpPPC64ISEL)
6160 v.AuxInt = int32ToAuxInt(2)
6161 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
6162 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
6163 v1.AuxInt = int64ToAuxInt(n)
6169 // match: (ISEL [6] x y (CMPconst [0] (Select0 (ANDCCconst [n] z))))
6170 // result: (ISEL [6] x y (Select1 <types.TypeFlags> (ANDCCconst [n] z )))
6172 if auxIntToInt32(v.AuxInt) != 6 {
6177 if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
6180 v_2_0 := v_2.Args[0]
6181 if v_2_0.Op != OpSelect0 {
6184 v_2_0_0 := v_2_0.Args[0]
6185 if v_2_0_0.Op != OpPPC64ANDCCconst {
6188 n := auxIntToInt64(v_2_0_0.AuxInt)
6189 z := v_2_0_0.Args[0]
6190 v.reset(OpPPC64ISEL)
6191 v.AuxInt = int32ToAuxInt(6)
6192 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
6193 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
6194 v1.AuxInt = int64ToAuxInt(n)
6200 // match: (ISEL [6] x y (CMPWconst [0] (Select0 (ANDCCconst [n] z))))
6201 // result: (ISEL [6] x y (Select1 <types.TypeFlags> (ANDCCconst [n] z )))
6203 if auxIntToInt32(v.AuxInt) != 6 {
6208 if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
6211 v_2_0 := v_2.Args[0]
6212 if v_2_0.Op != OpSelect0 {
6215 v_2_0_0 := v_2_0.Args[0]
6216 if v_2_0_0.Op != OpPPC64ANDCCconst {
6219 n := auxIntToInt64(v_2_0_0.AuxInt)
6220 z := v_2_0_0.Args[0]
6221 v.reset(OpPPC64ISEL)
6222 v.AuxInt = int32ToAuxInt(6)
6223 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
6224 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
6225 v1.AuxInt = int64ToAuxInt(n)
6231 // match: (ISEL [n] x y (InvertFlags bool))
6233 // result: (ISEL [n+1] x y bool)
6235 n := auxIntToInt32(v.AuxInt)
6238 if v_2.Op != OpPPC64InvertFlags {
6245 v.reset(OpPPC64ISEL)
6246 v.AuxInt = int32ToAuxInt(n + 1)
6247 v.AddArg3(x, y, bool)
6250 // match: (ISEL [n] x y (InvertFlags bool))
6252 // result: (ISEL [n-1] x y bool)
6254 n := auxIntToInt32(v.AuxInt)
6257 if v_2.Op != OpPPC64InvertFlags {
6264 v.reset(OpPPC64ISEL)
6265 v.AuxInt = int32ToAuxInt(n - 1)
6266 v.AddArg3(x, y, bool)
6269 // match: (ISEL [n] x y (InvertFlags bool))
6271 // result: (ISEL [n] x y bool)
6273 n := auxIntToInt32(v.AuxInt)
6276 if v_2.Op != OpPPC64InvertFlags {
6283 v.reset(OpPPC64ISEL)
6284 v.AuxInt = int32ToAuxInt(n)
6285 v.AddArg3(x, y, bool)
6290 func rewriteValuePPC64_OpPPC64LessEqual(v *Value) bool {
6292 // match: (LessEqual (FlagEQ))
6293 // result: (MOVDconst [1])
6295 if v_0.Op != OpPPC64FlagEQ {
6298 v.reset(OpPPC64MOVDconst)
6299 v.AuxInt = int64ToAuxInt(1)
6302 // match: (LessEqual (FlagLT))
6303 // result: (MOVDconst [1])
6305 if v_0.Op != OpPPC64FlagLT {
6308 v.reset(OpPPC64MOVDconst)
6309 v.AuxInt = int64ToAuxInt(1)
6312 // match: (LessEqual (FlagGT))
6313 // result: (MOVDconst [0])
6315 if v_0.Op != OpPPC64FlagGT {
6318 v.reset(OpPPC64MOVDconst)
6319 v.AuxInt = int64ToAuxInt(0)
6322 // match: (LessEqual (InvertFlags x))
6323 // result: (GreaterEqual x)
6325 if v_0.Op != OpPPC64InvertFlags {
6329 v.reset(OpPPC64GreaterEqual)
6333 // match: (LessEqual cmp)
6334 // result: (SETBCR [1] cmp)
6337 v.reset(OpPPC64SETBCR)
6338 v.AuxInt = int32ToAuxInt(1)
6343 func rewriteValuePPC64_OpPPC64LessThan(v *Value) bool {
6345 // match: (LessThan (FlagEQ))
6346 // result: (MOVDconst [0])
6348 if v_0.Op != OpPPC64FlagEQ {
6351 v.reset(OpPPC64MOVDconst)
6352 v.AuxInt = int64ToAuxInt(0)
6355 // match: (LessThan (FlagLT))
6356 // result: (MOVDconst [1])
6358 if v_0.Op != OpPPC64FlagLT {
6361 v.reset(OpPPC64MOVDconst)
6362 v.AuxInt = int64ToAuxInt(1)
6365 // match: (LessThan (FlagGT))
6366 // result: (MOVDconst [0])
6368 if v_0.Op != OpPPC64FlagGT {
6371 v.reset(OpPPC64MOVDconst)
6372 v.AuxInt = int64ToAuxInt(0)
6375 // match: (LessThan (InvertFlags x))
6376 // result: (GreaterThan x)
6378 if v_0.Op != OpPPC64InvertFlags {
6382 v.reset(OpPPC64GreaterThan)
6386 // match: (LessThan cmp)
6387 // result: (SETBC [0] cmp)
6390 v.reset(OpPPC64SETBC)
6391 v.AuxInt = int32ToAuxInt(0)
6396 func rewriteValuePPC64_OpPPC64MFVSRD(v *Value) bool {
6399 typ := &b.Func.Config.Types
6400 // match: (MFVSRD (FMOVDconst [c]))
6401 // result: (MOVDconst [int64(math.Float64bits(c))])
6403 if v_0.Op != OpPPC64FMOVDconst {
6406 c := auxIntToFloat64(v_0.AuxInt)
6407 v.reset(OpPPC64MOVDconst)
6408 v.AuxInt = int64ToAuxInt(int64(math.Float64bits(c)))
6411 // match: (MFVSRD x:(FMOVDload [off] {sym} ptr mem))
6412 // cond: x.Uses == 1 && clobber(x)
6413 // result: @x.Block (MOVDload [off] {sym} ptr mem)
6416 if x.Op != OpPPC64FMOVDload {
6419 off := auxIntToInt32(x.AuxInt)
6420 sym := auxToSym(x.Aux)
6423 if !(x.Uses == 1 && clobber(x)) {
6427 v0 := b.NewValue0(x.Pos, OpPPC64MOVDload, typ.Int64)
6429 v0.AuxInt = int32ToAuxInt(off)
6430 v0.Aux = symToAux(sym)
6431 v0.AddArg2(ptr, mem)
6436 func rewriteValuePPC64_OpPPC64MOVBZload(v *Value) bool {
6439 // match: (MOVBZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
6440 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
6441 // result: (MOVBZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
6443 off1 := auxIntToInt32(v.AuxInt)
6444 sym1 := auxToSym(v.Aux)
6446 if p.Op != OpPPC64MOVDaddr {
6449 off2 := auxIntToInt32(p.AuxInt)
6450 sym2 := auxToSym(p.Aux)
6453 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
6456 v.reset(OpPPC64MOVBZload)
6457 v.AuxInt = int32ToAuxInt(off1 + off2)
6458 v.Aux = symToAux(mergeSym(sym1, sym2))
6462 // match: (MOVBZload [off1] {sym} (ADDconst [off2] x) mem)
6463 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
6464 // result: (MOVBZload [off1+int32(off2)] {sym} x mem)
6466 off1 := auxIntToInt32(v.AuxInt)
6467 sym := auxToSym(v.Aux)
6468 if v_0.Op != OpPPC64ADDconst {
6471 off2 := auxIntToInt64(v_0.AuxInt)
6474 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
6477 v.reset(OpPPC64MOVBZload)
6478 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
6479 v.Aux = symToAux(sym)
6483 // match: (MOVBZload [0] {sym} p:(ADD ptr idx) mem)
6484 // cond: sym == nil && p.Uses == 1
6485 // result: (MOVBZloadidx ptr idx mem)
6487 if auxIntToInt32(v.AuxInt) != 0 {
6490 sym := auxToSym(v.Aux)
6492 if p.Op != OpPPC64ADD {
6498 if !(sym == nil && p.Uses == 1) {
6501 v.reset(OpPPC64MOVBZloadidx)
6502 v.AddArg3(ptr, idx, mem)
6507 func rewriteValuePPC64_OpPPC64MOVBZloadidx(v *Value) bool {
6511 // match: (MOVBZloadidx ptr (MOVDconst [c]) mem)
6512 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
6513 // result: (MOVBZload [int32(c)] ptr mem)
6516 if v_1.Op != OpPPC64MOVDconst {
6519 c := auxIntToInt64(v_1.AuxInt)
6521 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
6524 v.reset(OpPPC64MOVBZload)
6525 v.AuxInt = int32ToAuxInt(int32(c))
6529 // match: (MOVBZloadidx (MOVDconst [c]) ptr mem)
6530 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
6531 // result: (MOVBZload [int32(c)] ptr mem)
6533 if v_0.Op != OpPPC64MOVDconst {
6536 c := auxIntToInt64(v_0.AuxInt)
6539 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
6542 v.reset(OpPPC64MOVBZload)
6543 v.AuxInt = int32ToAuxInt(int32(c))
6549 func rewriteValuePPC64_OpPPC64MOVBZreg(v *Value) bool {
6552 typ := &b.Func.Config.Types
6553 // match: (MOVBZreg y:(Select0 (ANDCCconst [c] _)))
6554 // cond: uint64(c) <= 0xFF
6558 if y.Op != OpSelect0 {
6562 if y_0.Op != OpPPC64ANDCCconst {
6565 c := auxIntToInt64(y_0.AuxInt)
6566 if !(uint64(c) <= 0xFF) {
6572 // match: (MOVBZreg (SRWconst [c] (MOVBZreg x)))
6573 // result: (SRWconst [c] (MOVBZreg x))
6575 if v_0.Op != OpPPC64SRWconst {
6578 c := auxIntToInt64(v_0.AuxInt)
6579 v_0_0 := v_0.Args[0]
6580 if v_0_0.Op != OpPPC64MOVBZreg {
6584 v.reset(OpPPC64SRWconst)
6585 v.AuxInt = int64ToAuxInt(c)
6586 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
6591 // match: (MOVBZreg (SRWconst [c] x))
6592 // cond: sizeof(x.Type) == 8
6593 // result: (SRWconst [c] x)
6595 if v_0.Op != OpPPC64SRWconst {
6598 c := auxIntToInt64(v_0.AuxInt)
6600 if !(sizeof(x.Type) == 8) {
6603 v.reset(OpPPC64SRWconst)
6604 v.AuxInt = int64ToAuxInt(c)
6608 // match: (MOVBZreg (SRDconst [c] x))
6610 // result: (SRDconst [c] x)
6612 if v_0.Op != OpPPC64SRDconst {
6615 c := auxIntToInt64(v_0.AuxInt)
6620 v.reset(OpPPC64SRDconst)
6621 v.AuxInt = int64ToAuxInt(c)
6625 // match: (MOVBZreg (SRWconst [c] x))
6627 // result: (SRWconst [c] x)
6629 if v_0.Op != OpPPC64SRWconst {
6632 c := auxIntToInt64(v_0.AuxInt)
6637 v.reset(OpPPC64SRWconst)
6638 v.AuxInt = int64ToAuxInt(c)
6642 // match: (MOVBZreg y:(MOVBZreg _))
6646 if y.Op != OpPPC64MOVBZreg {
6652 // match: (MOVBZreg (MOVBreg x))
6653 // result: (MOVBZreg x)
6655 if v_0.Op != OpPPC64MOVBreg {
6659 v.reset(OpPPC64MOVBZreg)
6663 // match: (MOVBZreg (OR <t> x (MOVWZreg y)))
6664 // result: (MOVBZreg (OR <t> x y))
6666 if v_0.Op != OpPPC64OR {
6671 v_0_0 := v_0.Args[0]
6672 v_0_1 := v_0.Args[1]
6673 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6675 if v_0_1.Op != OpPPC64MOVWZreg {
6679 v.reset(OpPPC64MOVBZreg)
6680 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
6687 // match: (MOVBZreg (XOR <t> x (MOVWZreg y)))
6688 // result: (MOVBZreg (XOR <t> x y))
6690 if v_0.Op != OpPPC64XOR {
6695 v_0_0 := v_0.Args[0]
6696 v_0_1 := v_0.Args[1]
6697 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6699 if v_0_1.Op != OpPPC64MOVWZreg {
6703 v.reset(OpPPC64MOVBZreg)
6704 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
6711 // match: (MOVBZreg (AND <t> x (MOVWZreg y)))
6712 // result: (MOVBZreg (AND <t> x y))
6714 if v_0.Op != OpPPC64AND {
6719 v_0_0 := v_0.Args[0]
6720 v_0_1 := v_0.Args[1]
6721 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6723 if v_0_1.Op != OpPPC64MOVWZreg {
6727 v.reset(OpPPC64MOVBZreg)
6728 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
6735 // match: (MOVBZreg (OR <t> x (MOVHZreg y)))
6736 // result: (MOVBZreg (OR <t> x y))
6738 if v_0.Op != OpPPC64OR {
6743 v_0_0 := v_0.Args[0]
6744 v_0_1 := v_0.Args[1]
6745 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6747 if v_0_1.Op != OpPPC64MOVHZreg {
6751 v.reset(OpPPC64MOVBZreg)
6752 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
6759 // match: (MOVBZreg (XOR <t> x (MOVHZreg y)))
6760 // result: (MOVBZreg (XOR <t> x y))
6762 if v_0.Op != OpPPC64XOR {
6767 v_0_0 := v_0.Args[0]
6768 v_0_1 := v_0.Args[1]
6769 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6771 if v_0_1.Op != OpPPC64MOVHZreg {
6775 v.reset(OpPPC64MOVBZreg)
6776 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
6783 // match: (MOVBZreg (AND <t> x (MOVHZreg y)))
6784 // result: (MOVBZreg (AND <t> x y))
6786 if v_0.Op != OpPPC64AND {
6791 v_0_0 := v_0.Args[0]
6792 v_0_1 := v_0.Args[1]
6793 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6795 if v_0_1.Op != OpPPC64MOVHZreg {
6799 v.reset(OpPPC64MOVBZreg)
6800 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
6807 // match: (MOVBZreg (OR <t> x (MOVBZreg y)))
6808 // result: (MOVBZreg (OR <t> x y))
6810 if v_0.Op != OpPPC64OR {
6815 v_0_0 := v_0.Args[0]
6816 v_0_1 := v_0.Args[1]
6817 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6819 if v_0_1.Op != OpPPC64MOVBZreg {
6823 v.reset(OpPPC64MOVBZreg)
6824 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
6831 // match: (MOVBZreg (XOR <t> x (MOVBZreg y)))
6832 // result: (MOVBZreg (XOR <t> x y))
6834 if v_0.Op != OpPPC64XOR {
6839 v_0_0 := v_0.Args[0]
6840 v_0_1 := v_0.Args[1]
6841 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6843 if v_0_1.Op != OpPPC64MOVBZreg {
6847 v.reset(OpPPC64MOVBZreg)
6848 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
6855 // match: (MOVBZreg (AND <t> x (MOVBZreg y)))
6856 // result: (MOVBZreg (AND <t> x y))
6858 if v_0.Op != OpPPC64AND {
6863 v_0_0 := v_0.Args[0]
6864 v_0_1 := v_0.Args[1]
6865 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6867 if v_0_1.Op != OpPPC64MOVBZreg {
6871 v.reset(OpPPC64MOVBZreg)
6872 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
6879 // match: (MOVBZreg z:(Select0 (ANDCCconst [c] (MOVBZload ptr x))))
6883 if z.Op != OpSelect0 {
6887 if z_0.Op != OpPPC64ANDCCconst {
6890 z_0_0 := z_0.Args[0]
6891 if z_0_0.Op != OpPPC64MOVBZload {
6897 // match: (MOVBZreg z:(AND y (MOVBZload ptr x)))
6901 if z.Op != OpPPC64AND {
6907 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
6908 if z_1.Op != OpPPC64MOVBZload {
6916 // match: (MOVBZreg x:(MOVBZload _ _))
6920 if x.Op != OpPPC64MOVBZload {
6926 // match: (MOVBZreg x:(MOVBZloadidx _ _ _))
6930 if x.Op != OpPPC64MOVBZloadidx {
6936 // match: (MOVBZreg x:(Select0 (LoweredAtomicLoad8 _ _)))
6940 if x.Op != OpSelect0 {
6944 if x_0.Op != OpPPC64LoweredAtomicLoad8 {
6950 // match: (MOVBZreg x:(Arg <t>))
6951 // cond: is8BitInt(t) && !t.IsSigned()
6959 if !(is8BitInt(t) && !t.IsSigned()) {
6965 // match: (MOVBZreg (MOVDconst [c]))
6966 // result: (MOVDconst [int64(uint8(c))])
6968 if v_0.Op != OpPPC64MOVDconst {
6971 c := auxIntToInt64(v_0.AuxInt)
6972 v.reset(OpPPC64MOVDconst)
6973 v.AuxInt = int64ToAuxInt(int64(uint8(c)))
6978 func rewriteValuePPC64_OpPPC64MOVBreg(v *Value) bool {
6981 typ := &b.Func.Config.Types
6982 // match: (MOVBreg y:(Select0 (ANDCCconst [c] _)))
6983 // cond: uint64(c) <= 0x7F
6987 if y.Op != OpSelect0 {
6991 if y_0.Op != OpPPC64ANDCCconst {
6994 c := auxIntToInt64(y_0.AuxInt)
6995 if !(uint64(c) <= 0x7F) {
7001 // match: (MOVBreg (SRAWconst [c] (MOVBreg x)))
7002 // result: (SRAWconst [c] (MOVBreg x))
7004 if v_0.Op != OpPPC64SRAWconst {
7007 c := auxIntToInt64(v_0.AuxInt)
7008 v_0_0 := v_0.Args[0]
7009 if v_0_0.Op != OpPPC64MOVBreg {
7013 v.reset(OpPPC64SRAWconst)
7014 v.AuxInt = int64ToAuxInt(c)
7015 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
7020 // match: (MOVBreg (SRAWconst [c] x))
7021 // cond: sizeof(x.Type) == 8
7022 // result: (SRAWconst [c] x)
7024 if v_0.Op != OpPPC64SRAWconst {
7027 c := auxIntToInt64(v_0.AuxInt)
7029 if !(sizeof(x.Type) == 8) {
7032 v.reset(OpPPC64SRAWconst)
7033 v.AuxInt = int64ToAuxInt(c)
7037 // match: (MOVBreg (SRDconst [c] x))
7039 // result: (SRDconst [c] x)
7041 if v_0.Op != OpPPC64SRDconst {
7044 c := auxIntToInt64(v_0.AuxInt)
7049 v.reset(OpPPC64SRDconst)
7050 v.AuxInt = int64ToAuxInt(c)
7054 // match: (MOVBreg (SRDconst [c] x))
7056 // result: (SRADconst [c] x)
7058 if v_0.Op != OpPPC64SRDconst {
7061 c := auxIntToInt64(v_0.AuxInt)
7066 v.reset(OpPPC64SRADconst)
7067 v.AuxInt = int64ToAuxInt(c)
7071 // match: (MOVBreg (SRADconst [c] x))
7073 // result: (SRADconst [c] x)
7075 if v_0.Op != OpPPC64SRADconst {
7078 c := auxIntToInt64(v_0.AuxInt)
7083 v.reset(OpPPC64SRADconst)
7084 v.AuxInt = int64ToAuxInt(c)
7088 // match: (MOVBreg (SRWconst [c] x))
7090 // result: (SRWconst [c] x)
7092 if v_0.Op != OpPPC64SRWconst {
7095 c := auxIntToInt64(v_0.AuxInt)
7100 v.reset(OpPPC64SRWconst)
7101 v.AuxInt = int64ToAuxInt(c)
7105 // match: (MOVBreg (SRWconst [c] x))
7107 // result: (SRAWconst [c] x)
7109 if v_0.Op != OpPPC64SRWconst {
7112 c := auxIntToInt64(v_0.AuxInt)
7117 v.reset(OpPPC64SRAWconst)
7118 v.AuxInt = int64ToAuxInt(c)
7122 // match: (MOVBreg (SRAWconst [c] x))
7124 // result: (SRAWconst [c] x)
7126 if v_0.Op != OpPPC64SRAWconst {
7129 c := auxIntToInt64(v_0.AuxInt)
7134 v.reset(OpPPC64SRAWconst)
7135 v.AuxInt = int64ToAuxInt(c)
7139 // match: (MOVBreg y:(MOVBreg _))
7143 if y.Op != OpPPC64MOVBreg {
7149 // match: (MOVBreg (MOVBZreg x))
7150 // result: (MOVBreg x)
7152 if v_0.Op != OpPPC64MOVBZreg {
7156 v.reset(OpPPC64MOVBreg)
7160 // match: (MOVBreg x:(Arg <t>))
7161 // cond: is8BitInt(t) && t.IsSigned()
7169 if !(is8BitInt(t) && t.IsSigned()) {
7175 // match: (MOVBreg (MOVDconst [c]))
7176 // result: (MOVDconst [int64(int8(c))])
7178 if v_0.Op != OpPPC64MOVDconst {
7181 c := auxIntToInt64(v_0.AuxInt)
7182 v.reset(OpPPC64MOVDconst)
7183 v.AuxInt = int64ToAuxInt(int64(int8(c)))
7188 func rewriteValuePPC64_OpPPC64MOVBstore(v *Value) bool {
7193 typ := &b.Func.Config.Types
7194 // match: (MOVBstore [off1] {sym} (ADDconst [off2] x) val mem)
7195 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
7196 // result: (MOVBstore [off1+int32(off2)] {sym} x val mem)
7198 off1 := auxIntToInt32(v.AuxInt)
7199 sym := auxToSym(v.Aux)
7200 if v_0.Op != OpPPC64ADDconst {
7203 off2 := auxIntToInt64(v_0.AuxInt)
7207 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
7210 v.reset(OpPPC64MOVBstore)
7211 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
7212 v.Aux = symToAux(sym)
7213 v.AddArg3(x, val, mem)
7216 // match: (MOVBstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
7217 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
7218 // result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
7220 off1 := auxIntToInt32(v.AuxInt)
7221 sym1 := auxToSym(v.Aux)
7223 if p.Op != OpPPC64MOVDaddr {
7226 off2 := auxIntToInt32(p.AuxInt)
7227 sym2 := auxToSym(p.Aux)
7231 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
7234 v.reset(OpPPC64MOVBstore)
7235 v.AuxInt = int32ToAuxInt(off1 + off2)
7236 v.Aux = symToAux(mergeSym(sym1, sym2))
7237 v.AddArg3(ptr, val, mem)
7240 // match: (MOVBstore [off] {sym} ptr (MOVDconst [0]) mem)
7241 // result: (MOVBstorezero [off] {sym} ptr mem)
7243 off := auxIntToInt32(v.AuxInt)
7244 sym := auxToSym(v.Aux)
7246 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
7250 v.reset(OpPPC64MOVBstorezero)
7251 v.AuxInt = int32ToAuxInt(off)
7252 v.Aux = symToAux(sym)
7256 // match: (MOVBstore [0] {sym} p:(ADD ptr idx) val mem)
7257 // cond: sym == nil && p.Uses == 1
7258 // result: (MOVBstoreidx ptr idx val mem)
7260 if auxIntToInt32(v.AuxInt) != 0 {
7263 sym := auxToSym(v.Aux)
7265 if p.Op != OpPPC64ADD {
7272 if !(sym == nil && p.Uses == 1) {
7275 v.reset(OpPPC64MOVBstoreidx)
7276 v.AddArg4(ptr, idx, val, mem)
7279 // match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
7280 // result: (MOVBstore [off] {sym} ptr x mem)
7282 off := auxIntToInt32(v.AuxInt)
7283 sym := auxToSym(v.Aux)
7285 if v_1.Op != OpPPC64MOVBreg {
7290 v.reset(OpPPC64MOVBstore)
7291 v.AuxInt = int32ToAuxInt(off)
7292 v.Aux = symToAux(sym)
7293 v.AddArg3(ptr, x, mem)
7296 // match: (MOVBstore [off] {sym} ptr (MOVBZreg x) mem)
7297 // result: (MOVBstore [off] {sym} ptr x mem)
7299 off := auxIntToInt32(v.AuxInt)
7300 sym := auxToSym(v.Aux)
7302 if v_1.Op != OpPPC64MOVBZreg {
7307 v.reset(OpPPC64MOVBstore)
7308 v.AuxInt = int32ToAuxInt(off)
7309 v.Aux = symToAux(sym)
7310 v.AddArg3(ptr, x, mem)
7313 // match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
7314 // result: (MOVBstore [off] {sym} ptr x mem)
7316 off := auxIntToInt32(v.AuxInt)
7317 sym := auxToSym(v.Aux)
7319 if v_1.Op != OpPPC64MOVHreg {
7324 v.reset(OpPPC64MOVBstore)
7325 v.AuxInt = int32ToAuxInt(off)
7326 v.Aux = symToAux(sym)
7327 v.AddArg3(ptr, x, mem)
7330 // match: (MOVBstore [off] {sym} ptr (MOVHZreg x) mem)
7331 // result: (MOVBstore [off] {sym} ptr x mem)
7333 off := auxIntToInt32(v.AuxInt)
7334 sym := auxToSym(v.Aux)
7336 if v_1.Op != OpPPC64MOVHZreg {
7341 v.reset(OpPPC64MOVBstore)
7342 v.AuxInt = int32ToAuxInt(off)
7343 v.Aux = symToAux(sym)
7344 v.AddArg3(ptr, x, mem)
7347 // match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
7348 // result: (MOVBstore [off] {sym} ptr x mem)
7350 off := auxIntToInt32(v.AuxInt)
7351 sym := auxToSym(v.Aux)
7353 if v_1.Op != OpPPC64MOVWreg {
7358 v.reset(OpPPC64MOVBstore)
7359 v.AuxInt = int32ToAuxInt(off)
7360 v.Aux = symToAux(sym)
7361 v.AddArg3(ptr, x, mem)
7364 // match: (MOVBstore [off] {sym} ptr (MOVWZreg x) mem)
7365 // result: (MOVBstore [off] {sym} ptr x mem)
7367 off := auxIntToInt32(v.AuxInt)
7368 sym := auxToSym(v.Aux)
7370 if v_1.Op != OpPPC64MOVWZreg {
7375 v.reset(OpPPC64MOVBstore)
7376 v.AuxInt = int32ToAuxInt(off)
7377 v.Aux = symToAux(sym)
7378 v.AddArg3(ptr, x, mem)
7381 // match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHreg x) [c]) mem)
7383 // result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
7385 off := auxIntToInt32(v.AuxInt)
7386 sym := auxToSym(v.Aux)
7388 if v_1.Op != OpPPC64SRWconst {
7391 c := auxIntToInt64(v_1.AuxInt)
7392 v_1_0 := v_1.Args[0]
7393 if v_1_0.Op != OpPPC64MOVHreg {
7401 v.reset(OpPPC64MOVBstore)
7402 v.AuxInt = int32ToAuxInt(off)
7403 v.Aux = symToAux(sym)
7404 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7405 v0.AuxInt = int64ToAuxInt(c)
7407 v.AddArg3(ptr, v0, mem)
7410 // match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHZreg x) [c]) mem)
7412 // result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
7414 off := auxIntToInt32(v.AuxInt)
7415 sym := auxToSym(v.Aux)
7417 if v_1.Op != OpPPC64SRWconst {
7420 c := auxIntToInt64(v_1.AuxInt)
7421 v_1_0 := v_1.Args[0]
7422 if v_1_0.Op != OpPPC64MOVHZreg {
7430 v.reset(OpPPC64MOVBstore)
7431 v.AuxInt = int32ToAuxInt(off)
7432 v.Aux = symToAux(sym)
7433 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7434 v0.AuxInt = int64ToAuxInt(c)
7436 v.AddArg3(ptr, v0, mem)
7439 // match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWreg x) [c]) mem)
7441 // result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
7443 off := auxIntToInt32(v.AuxInt)
7444 sym := auxToSym(v.Aux)
7446 if v_1.Op != OpPPC64SRWconst {
7449 c := auxIntToInt64(v_1.AuxInt)
7450 v_1_0 := v_1.Args[0]
7451 if v_1_0.Op != OpPPC64MOVWreg {
7459 v.reset(OpPPC64MOVBstore)
7460 v.AuxInt = int32ToAuxInt(off)
7461 v.Aux = symToAux(sym)
7462 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7463 v0.AuxInt = int64ToAuxInt(c)
7465 v.AddArg3(ptr, v0, mem)
7468 // match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWZreg x) [c]) mem)
7470 // result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
7472 off := auxIntToInt32(v.AuxInt)
7473 sym := auxToSym(v.Aux)
7475 if v_1.Op != OpPPC64SRWconst {
7478 c := auxIntToInt64(v_1.AuxInt)
7479 v_1_0 := v_1.Args[0]
7480 if v_1_0.Op != OpPPC64MOVWZreg {
7488 v.reset(OpPPC64MOVBstore)
7489 v.AuxInt = int32ToAuxInt(off)
7490 v.Aux = symToAux(sym)
7491 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7492 v0.AuxInt = int64ToAuxInt(c)
7494 v.AddArg3(ptr, v0, mem)
7499 func rewriteValuePPC64_OpPPC64MOVBstoreidx(v *Value) bool {
7505 typ := &b.Func.Config.Types
7506 // match: (MOVBstoreidx ptr (MOVDconst [c]) val mem)
7507 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
7508 // result: (MOVBstore [int32(c)] ptr val mem)
7511 if v_1.Op != OpPPC64MOVDconst {
7514 c := auxIntToInt64(v_1.AuxInt)
7517 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
7520 v.reset(OpPPC64MOVBstore)
7521 v.AuxInt = int32ToAuxInt(int32(c))
7522 v.AddArg3(ptr, val, mem)
7525 // match: (MOVBstoreidx (MOVDconst [c]) ptr val mem)
7526 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
7527 // result: (MOVBstore [int32(c)] ptr val mem)
7529 if v_0.Op != OpPPC64MOVDconst {
7532 c := auxIntToInt64(v_0.AuxInt)
7536 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
7539 v.reset(OpPPC64MOVBstore)
7540 v.AuxInt = int32ToAuxInt(int32(c))
7541 v.AddArg3(ptr, val, mem)
7544 // match: (MOVBstoreidx ptr idx (MOVBreg x) mem)
7545 // result: (MOVBstoreidx ptr idx x mem)
7549 if v_2.Op != OpPPC64MOVBreg {
7554 v.reset(OpPPC64MOVBstoreidx)
7555 v.AddArg4(ptr, idx, x, mem)
7558 // match: (MOVBstoreidx ptr idx (MOVBZreg x) mem)
7559 // result: (MOVBstoreidx ptr idx x mem)
7563 if v_2.Op != OpPPC64MOVBZreg {
7568 v.reset(OpPPC64MOVBstoreidx)
7569 v.AddArg4(ptr, idx, x, mem)
7572 // match: (MOVBstoreidx ptr idx (MOVHreg x) mem)
7573 // result: (MOVBstoreidx ptr idx x mem)
7577 if v_2.Op != OpPPC64MOVHreg {
7582 v.reset(OpPPC64MOVBstoreidx)
7583 v.AddArg4(ptr, idx, x, mem)
7586 // match: (MOVBstoreidx ptr idx (MOVHZreg x) mem)
7587 // result: (MOVBstoreidx ptr idx x mem)
7591 if v_2.Op != OpPPC64MOVHZreg {
7596 v.reset(OpPPC64MOVBstoreidx)
7597 v.AddArg4(ptr, idx, x, mem)
7600 // match: (MOVBstoreidx ptr idx (MOVWreg x) mem)
7601 // result: (MOVBstoreidx ptr idx x mem)
7605 if v_2.Op != OpPPC64MOVWreg {
7610 v.reset(OpPPC64MOVBstoreidx)
7611 v.AddArg4(ptr, idx, x, mem)
7614 // match: (MOVBstoreidx ptr idx (MOVWZreg x) mem)
7615 // result: (MOVBstoreidx ptr idx x mem)
7619 if v_2.Op != OpPPC64MOVWZreg {
7624 v.reset(OpPPC64MOVBstoreidx)
7625 v.AddArg4(ptr, idx, x, mem)
7628 // match: (MOVBstoreidx ptr idx (SRWconst (MOVHreg x) [c]) mem)
7630 // result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
7634 if v_2.Op != OpPPC64SRWconst {
7637 c := auxIntToInt64(v_2.AuxInt)
7638 v_2_0 := v_2.Args[0]
7639 if v_2_0.Op != OpPPC64MOVHreg {
7647 v.reset(OpPPC64MOVBstoreidx)
7648 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7649 v0.AuxInt = int64ToAuxInt(c)
7651 v.AddArg4(ptr, idx, v0, mem)
7654 // match: (MOVBstoreidx ptr idx (SRWconst (MOVHZreg x) [c]) mem)
7656 // result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
7660 if v_2.Op != OpPPC64SRWconst {
7663 c := auxIntToInt64(v_2.AuxInt)
7664 v_2_0 := v_2.Args[0]
7665 if v_2_0.Op != OpPPC64MOVHZreg {
7673 v.reset(OpPPC64MOVBstoreidx)
7674 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7675 v0.AuxInt = int64ToAuxInt(c)
7677 v.AddArg4(ptr, idx, v0, mem)
7680 // match: (MOVBstoreidx ptr idx (SRWconst (MOVWreg x) [c]) mem)
7682 // result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
7686 if v_2.Op != OpPPC64SRWconst {
7689 c := auxIntToInt64(v_2.AuxInt)
7690 v_2_0 := v_2.Args[0]
7691 if v_2_0.Op != OpPPC64MOVWreg {
7699 v.reset(OpPPC64MOVBstoreidx)
7700 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7701 v0.AuxInt = int64ToAuxInt(c)
7703 v.AddArg4(ptr, idx, v0, mem)
7706 // match: (MOVBstoreidx ptr idx (SRWconst (MOVWZreg x) [c]) mem)
7708 // result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
7712 if v_2.Op != OpPPC64SRWconst {
7715 c := auxIntToInt64(v_2.AuxInt)
7716 v_2_0 := v_2.Args[0]
7717 if v_2_0.Op != OpPPC64MOVWZreg {
7725 v.reset(OpPPC64MOVBstoreidx)
7726 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
7727 v0.AuxInt = int64ToAuxInt(c)
7729 v.AddArg4(ptr, idx, v0, mem)
7734 func rewriteValuePPC64_OpPPC64MOVBstorezero(v *Value) bool {
7737 // match: (MOVBstorezero [off1] {sym} (ADDconst [off2] x) mem)
7738 // cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
7739 // result: (MOVBstorezero [off1+int32(off2)] {sym} x mem)
7741 off1 := auxIntToInt32(v.AuxInt)
7742 sym := auxToSym(v.Aux)
7743 if v_0.Op != OpPPC64ADDconst {
7746 off2 := auxIntToInt64(v_0.AuxInt)
7749 if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
7752 v.reset(OpPPC64MOVBstorezero)
7753 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
7754 v.Aux = symToAux(sym)
7758 // match: (MOVBstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
7759 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
7760 // result: (MOVBstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
7762 off1 := auxIntToInt32(v.AuxInt)
7763 sym1 := auxToSym(v.Aux)
7765 if p.Op != OpPPC64MOVDaddr {
7768 off2 := auxIntToInt32(p.AuxInt)
7769 sym2 := auxToSym(p.Aux)
7772 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
7775 v.reset(OpPPC64MOVBstorezero)
7776 v.AuxInt = int32ToAuxInt(off1 + off2)
7777 v.Aux = symToAux(mergeSym(sym1, sym2))
7783 func rewriteValuePPC64_OpPPC64MOVDaddr(v *Value) bool {
7785 // match: (MOVDaddr {sym} [n] p:(ADD x y))
7786 // cond: sym == nil && n == 0
7789 n := auxIntToInt32(v.AuxInt)
7790 sym := auxToSym(v.Aux)
7792 if p.Op != OpPPC64ADD {
7795 if !(sym == nil && n == 0) {
7801 // match: (MOVDaddr {sym} [n] ptr)
7802 // cond: sym == nil && n == 0 && (ptr.Op == OpArgIntReg || ptr.Op == OpPhi)
7805 n := auxIntToInt32(v.AuxInt)
7806 sym := auxToSym(v.Aux)
7808 if !(sym == nil && n == 0 && (ptr.Op == OpArgIntReg || ptr.Op == OpPhi)) {
7816 func rewriteValuePPC64_OpPPC64MOVDload(v *Value) bool {
7819 // match: (MOVDload [off] {sym} ptr (FMOVDstore [off] {sym} ptr x _))
7820 // result: (MFVSRD x)
7822 off := auxIntToInt32(v.AuxInt)
7823 sym := auxToSym(v.Aux)
7825 if v_1.Op != OpPPC64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
7829 if ptr != v_1.Args[0] {
7832 v.reset(OpPPC64MFVSRD)
7836 // match: (MOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
7837 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
7838 // result: (MOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
7840 off1 := auxIntToInt32(v.AuxInt)
7841 sym1 := auxToSym(v.Aux)
7843 if p.Op != OpPPC64MOVDaddr {
7846 off2 := auxIntToInt32(p.AuxInt)
7847 sym2 := auxToSym(p.Aux)
7850 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
7853 v.reset(OpPPC64MOVDload)
7854 v.AuxInt = int32ToAuxInt(off1 + off2)
7855 v.Aux = symToAux(mergeSym(sym1, sym2))
7859 // match: (MOVDload [off1] {sym} (ADDconst [off2] x) mem)
7860 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
7861 // result: (MOVDload [off1+int32(off2)] {sym} x mem)
7863 off1 := auxIntToInt32(v.AuxInt)
7864 sym := auxToSym(v.Aux)
7865 if v_0.Op != OpPPC64ADDconst {
7868 off2 := auxIntToInt64(v_0.AuxInt)
7871 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
7874 v.reset(OpPPC64MOVDload)
7875 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
7876 v.Aux = symToAux(sym)
7880 // match: (MOVDload [0] {sym} p:(ADD ptr idx) mem)
7881 // cond: sym == nil && p.Uses == 1
7882 // result: (MOVDloadidx ptr idx mem)
7884 if auxIntToInt32(v.AuxInt) != 0 {
7887 sym := auxToSym(v.Aux)
7889 if p.Op != OpPPC64ADD {
7895 if !(sym == nil && p.Uses == 1) {
7898 v.reset(OpPPC64MOVDloadidx)
7899 v.AddArg3(ptr, idx, mem)
7904 func rewriteValuePPC64_OpPPC64MOVDloadidx(v *Value) bool {
7908 // match: (MOVDloadidx ptr (MOVDconst [c]) mem)
7909 // cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
7910 // result: (MOVDload [int32(c)] ptr mem)
7913 if v_1.Op != OpPPC64MOVDconst {
7916 c := auxIntToInt64(v_1.AuxInt)
7918 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
7921 v.reset(OpPPC64MOVDload)
7922 v.AuxInt = int32ToAuxInt(int32(c))
7926 // match: (MOVDloadidx (MOVDconst [c]) ptr mem)
7927 // cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
7928 // result: (MOVDload [int32(c)] ptr mem)
7930 if v_0.Op != OpPPC64MOVDconst {
7933 c := auxIntToInt64(v_0.AuxInt)
7936 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
7939 v.reset(OpPPC64MOVDload)
7940 v.AuxInt = int32ToAuxInt(int32(c))
7946 func rewriteValuePPC64_OpPPC64MOVDstore(v *Value) bool {
7951 // match: (MOVDstore [off] {sym} ptr (MFVSRD x) mem)
7952 // result: (FMOVDstore [off] {sym} ptr x mem)
7954 off := auxIntToInt32(v.AuxInt)
7955 sym := auxToSym(v.Aux)
7957 if v_1.Op != OpPPC64MFVSRD {
7962 v.reset(OpPPC64FMOVDstore)
7963 v.AuxInt = int32ToAuxInt(off)
7964 v.Aux = symToAux(sym)
7965 v.AddArg3(ptr, x, mem)
7968 // match: (MOVDstore [off1] {sym} (ADDconst [off2] x) val mem)
7969 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
7970 // result: (MOVDstore [off1+int32(off2)] {sym} x val mem)
7972 off1 := auxIntToInt32(v.AuxInt)
7973 sym := auxToSym(v.Aux)
7974 if v_0.Op != OpPPC64ADDconst {
7977 off2 := auxIntToInt64(v_0.AuxInt)
7981 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
7984 v.reset(OpPPC64MOVDstore)
7985 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
7986 v.Aux = symToAux(sym)
7987 v.AddArg3(x, val, mem)
7990 // match: (MOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
7991 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
7992 // result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
7994 off1 := auxIntToInt32(v.AuxInt)
7995 sym1 := auxToSym(v.Aux)
7997 if p.Op != OpPPC64MOVDaddr {
8000 off2 := auxIntToInt32(p.AuxInt)
8001 sym2 := auxToSym(p.Aux)
8005 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8008 v.reset(OpPPC64MOVDstore)
8009 v.AuxInt = int32ToAuxInt(off1 + off2)
8010 v.Aux = symToAux(mergeSym(sym1, sym2))
8011 v.AddArg3(ptr, val, mem)
8014 // match: (MOVDstore [off] {sym} ptr (MOVDconst [0]) mem)
8015 // result: (MOVDstorezero [off] {sym} ptr mem)
8017 off := auxIntToInt32(v.AuxInt)
8018 sym := auxToSym(v.Aux)
8020 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
8024 v.reset(OpPPC64MOVDstorezero)
8025 v.AuxInt = int32ToAuxInt(off)
8026 v.Aux = symToAux(sym)
8030 // match: (MOVDstore [0] {sym} p:(ADD ptr idx) val mem)
8031 // cond: sym == nil && p.Uses == 1
8032 // result: (MOVDstoreidx ptr idx val mem)
8034 if auxIntToInt32(v.AuxInt) != 0 {
8037 sym := auxToSym(v.Aux)
8039 if p.Op != OpPPC64ADD {
8046 if !(sym == nil && p.Uses == 1) {
8049 v.reset(OpPPC64MOVDstoreidx)
8050 v.AddArg4(ptr, idx, val, mem)
8053 // match: (MOVDstore [off] {sym} ptr r:(BRD val) mem)
8054 // cond: r.Uses == 1
8055 // result: (MOVDBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
8057 off := auxIntToInt32(v.AuxInt)
8058 sym := auxToSym(v.Aux)
8061 if r.Op != OpPPC64BRD {
8069 v.reset(OpPPC64MOVDBRstore)
8070 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
8071 v0.AuxInt = int32ToAuxInt(off)
8072 v0.Aux = symToAux(sym)
8074 v.AddArg3(v0, val, mem)
8077 // match: (MOVDstore [off] {sym} ptr (Bswap64 val) mem)
8078 // result: (MOVDBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
8080 off := auxIntToInt32(v.AuxInt)
8081 sym := auxToSym(v.Aux)
8083 if v_1.Op != OpBswap64 {
8088 v.reset(OpPPC64MOVDBRstore)
8089 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
8090 v0.AuxInt = int32ToAuxInt(off)
8091 v0.Aux = symToAux(sym)
8093 v.AddArg3(v0, val, mem)
8098 func rewriteValuePPC64_OpPPC64MOVDstoreidx(v *Value) bool {
8103 // match: (MOVDstoreidx ptr (MOVDconst [c]) val mem)
8104 // cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
8105 // result: (MOVDstore [int32(c)] ptr val mem)
8108 if v_1.Op != OpPPC64MOVDconst {
8111 c := auxIntToInt64(v_1.AuxInt)
8114 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8117 v.reset(OpPPC64MOVDstore)
8118 v.AuxInt = int32ToAuxInt(int32(c))
8119 v.AddArg3(ptr, val, mem)
8122 // match: (MOVDstoreidx (MOVDconst [c]) ptr val mem)
8123 // cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
8124 // result: (MOVDstore [int32(c)] ptr val mem)
8126 if v_0.Op != OpPPC64MOVDconst {
8129 c := auxIntToInt64(v_0.AuxInt)
8133 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8136 v.reset(OpPPC64MOVDstore)
8137 v.AuxInt = int32ToAuxInt(int32(c))
8138 v.AddArg3(ptr, val, mem)
8141 // match: (MOVDstoreidx ptr idx r:(BRD val) mem)
8142 // cond: r.Uses == 1
8143 // result: (MOVDBRstoreidx ptr idx val mem)
8148 if r.Op != OpPPC64BRD {
8156 v.reset(OpPPC64MOVDBRstoreidx)
8157 v.AddArg4(ptr, idx, val, mem)
8160 // match: (MOVDstoreidx ptr idx (Bswap64 val) mem)
8161 // result: (MOVDBRstoreidx ptr idx val mem)
8165 if v_2.Op != OpBswap64 {
8170 v.reset(OpPPC64MOVDBRstoreidx)
8171 v.AddArg4(ptr, idx, val, mem)
8176 func rewriteValuePPC64_OpPPC64MOVDstorezero(v *Value) bool {
8179 // match: (MOVDstorezero [off1] {sym} (ADDconst [off2] x) mem)
8180 // cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
8181 // result: (MOVDstorezero [off1+int32(off2)] {sym} x mem)
8183 off1 := auxIntToInt32(v.AuxInt)
8184 sym := auxToSym(v.Aux)
8185 if v_0.Op != OpPPC64ADDconst {
8188 off2 := auxIntToInt64(v_0.AuxInt)
8191 if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
8194 v.reset(OpPPC64MOVDstorezero)
8195 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8196 v.Aux = symToAux(sym)
8200 // match: (MOVDstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
8201 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
8202 // result: (MOVDstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
8204 off1 := auxIntToInt32(v.AuxInt)
8205 sym1 := auxToSym(v.Aux)
8207 if p.Op != OpPPC64MOVDaddr {
8210 off2 := auxIntToInt32(p.AuxInt)
8211 sym2 := auxToSym(p.Aux)
8214 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8217 v.reset(OpPPC64MOVDstorezero)
8218 v.AuxInt = int32ToAuxInt(off1 + off2)
8219 v.Aux = symToAux(mergeSym(sym1, sym2))
8225 func rewriteValuePPC64_OpPPC64MOVHBRstore(v *Value) bool {
8229 // match: (MOVHBRstore ptr (MOVHreg x) mem)
8230 // result: (MOVHBRstore ptr x mem)
8233 if v_1.Op != OpPPC64MOVHreg {
8238 v.reset(OpPPC64MOVHBRstore)
8239 v.AddArg3(ptr, x, mem)
8242 // match: (MOVHBRstore ptr (MOVHZreg x) mem)
8243 // result: (MOVHBRstore ptr x mem)
8246 if v_1.Op != OpPPC64MOVHZreg {
8251 v.reset(OpPPC64MOVHBRstore)
8252 v.AddArg3(ptr, x, mem)
8255 // match: (MOVHBRstore ptr (MOVWreg x) mem)
8256 // result: (MOVHBRstore ptr x mem)
8259 if v_1.Op != OpPPC64MOVWreg {
8264 v.reset(OpPPC64MOVHBRstore)
8265 v.AddArg3(ptr, x, mem)
8268 // match: (MOVHBRstore ptr (MOVWZreg x) mem)
8269 // result: (MOVHBRstore ptr x mem)
8272 if v_1.Op != OpPPC64MOVWZreg {
8277 v.reset(OpPPC64MOVHBRstore)
8278 v.AddArg3(ptr, x, mem)
8283 func rewriteValuePPC64_OpPPC64MOVHZload(v *Value) bool {
8286 // match: (MOVHZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
8287 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
8288 // result: (MOVHZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
8290 off1 := auxIntToInt32(v.AuxInt)
8291 sym1 := auxToSym(v.Aux)
8293 if p.Op != OpPPC64MOVDaddr {
8296 off2 := auxIntToInt32(p.AuxInt)
8297 sym2 := auxToSym(p.Aux)
8300 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8303 v.reset(OpPPC64MOVHZload)
8304 v.AuxInt = int32ToAuxInt(off1 + off2)
8305 v.Aux = symToAux(mergeSym(sym1, sym2))
8309 // match: (MOVHZload [off1] {sym} (ADDconst [off2] x) mem)
8310 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
8311 // result: (MOVHZload [off1+int32(off2)] {sym} x mem)
8313 off1 := auxIntToInt32(v.AuxInt)
8314 sym := auxToSym(v.Aux)
8315 if v_0.Op != OpPPC64ADDconst {
8318 off2 := auxIntToInt64(v_0.AuxInt)
8321 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
8324 v.reset(OpPPC64MOVHZload)
8325 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8326 v.Aux = symToAux(sym)
8330 // match: (MOVHZload [0] {sym} p:(ADD ptr idx) mem)
8331 // cond: sym == nil && p.Uses == 1
8332 // result: (MOVHZloadidx ptr idx mem)
8334 if auxIntToInt32(v.AuxInt) != 0 {
8337 sym := auxToSym(v.Aux)
8339 if p.Op != OpPPC64ADD {
8345 if !(sym == nil && p.Uses == 1) {
8348 v.reset(OpPPC64MOVHZloadidx)
8349 v.AddArg3(ptr, idx, mem)
8354 func rewriteValuePPC64_OpPPC64MOVHZloadidx(v *Value) bool {
8358 // match: (MOVHZloadidx ptr (MOVDconst [c]) mem)
8359 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
8360 // result: (MOVHZload [int32(c)] ptr mem)
8363 if v_1.Op != OpPPC64MOVDconst {
8366 c := auxIntToInt64(v_1.AuxInt)
8368 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8371 v.reset(OpPPC64MOVHZload)
8372 v.AuxInt = int32ToAuxInt(int32(c))
8376 // match: (MOVHZloadidx (MOVDconst [c]) ptr mem)
8377 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
8378 // result: (MOVHZload [int32(c)] ptr mem)
8380 if v_0.Op != OpPPC64MOVDconst {
8383 c := auxIntToInt64(v_0.AuxInt)
8386 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8389 v.reset(OpPPC64MOVHZload)
8390 v.AuxInt = int32ToAuxInt(int32(c))
8396 func rewriteValuePPC64_OpPPC64MOVHZreg(v *Value) bool {
8399 typ := &b.Func.Config.Types
8400 // match: (MOVHZreg y:(Select0 (ANDCCconst [c] _)))
8401 // cond: uint64(c) <= 0xFFFF
8405 if y.Op != OpSelect0 {
8409 if y_0.Op != OpPPC64ANDCCconst {
8412 c := auxIntToInt64(y_0.AuxInt)
8413 if !(uint64(c) <= 0xFFFF) {
8419 // match: (MOVHZreg (SRWconst [c] (MOVBZreg x)))
8420 // result: (SRWconst [c] (MOVBZreg x))
8422 if v_0.Op != OpPPC64SRWconst {
8425 c := auxIntToInt64(v_0.AuxInt)
8426 v_0_0 := v_0.Args[0]
8427 if v_0_0.Op != OpPPC64MOVBZreg {
8431 v.reset(OpPPC64SRWconst)
8432 v.AuxInt = int64ToAuxInt(c)
8433 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
8438 // match: (MOVHZreg (SRWconst [c] (MOVHZreg x)))
8439 // result: (SRWconst [c] (MOVHZreg x))
8441 if v_0.Op != OpPPC64SRWconst {
8444 c := auxIntToInt64(v_0.AuxInt)
8445 v_0_0 := v_0.Args[0]
8446 if v_0_0.Op != OpPPC64MOVHZreg {
8450 v.reset(OpPPC64SRWconst)
8451 v.AuxInt = int64ToAuxInt(c)
8452 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
8457 // match: (MOVHZreg (SRWconst [c] x))
8458 // cond: sizeof(x.Type) <= 16
8459 // result: (SRWconst [c] x)
8461 if v_0.Op != OpPPC64SRWconst {
8464 c := auxIntToInt64(v_0.AuxInt)
8466 if !(sizeof(x.Type) <= 16) {
8469 v.reset(OpPPC64SRWconst)
8470 v.AuxInt = int64ToAuxInt(c)
8474 // match: (MOVHZreg (SRDconst [c] x))
8476 // result: (SRDconst [c] x)
8478 if v_0.Op != OpPPC64SRDconst {
8481 c := auxIntToInt64(v_0.AuxInt)
8486 v.reset(OpPPC64SRDconst)
8487 v.AuxInt = int64ToAuxInt(c)
8491 // match: (MOVHZreg (SRWconst [c] x))
8493 // result: (SRWconst [c] x)
8495 if v_0.Op != OpPPC64SRWconst {
8498 c := auxIntToInt64(v_0.AuxInt)
8503 v.reset(OpPPC64SRWconst)
8504 v.AuxInt = int64ToAuxInt(c)
8508 // match: (MOVHZreg y:(MOVHZreg _))
8512 if y.Op != OpPPC64MOVHZreg {
8518 // match: (MOVHZreg y:(MOVBZreg _))
8522 if y.Op != OpPPC64MOVBZreg {
8528 // match: (MOVHZreg y:(MOVHBRload _ _))
8532 if y.Op != OpPPC64MOVHBRload {
8538 // match: (MOVHZreg y:(MOVHreg x))
8539 // result: (MOVHZreg x)
8542 if y.Op != OpPPC64MOVHreg {
8546 v.reset(OpPPC64MOVHZreg)
8550 // match: (MOVHZreg (OR <t> x (MOVWZreg y)))
8551 // result: (MOVHZreg (OR <t> x y))
8553 if v_0.Op != OpPPC64OR {
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, OpPPC64OR, t)
8574 // match: (MOVHZreg (XOR <t> x (MOVWZreg y)))
8575 // result: (MOVHZreg (XOR <t> x y))
8577 if v_0.Op != OpPPC64XOR {
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 != OpPPC64MOVWZreg {
8590 v.reset(OpPPC64MOVHZreg)
8591 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
8598 // match: (MOVHZreg (AND <t> x (MOVWZreg y)))
8599 // result: (MOVHZreg (AND <t> x y))
8601 if v_0.Op != OpPPC64AND {
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 != OpPPC64MOVWZreg {
8614 v.reset(OpPPC64MOVHZreg)
8615 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
8622 // match: (MOVHZreg (OR <t> x (MOVHZreg y)))
8623 // result: (MOVHZreg (OR <t> x y))
8625 if v_0.Op != OpPPC64OR {
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, OpPPC64OR, t)
8646 // match: (MOVHZreg (XOR <t> x (MOVHZreg y)))
8647 // result: (MOVHZreg (XOR <t> x y))
8649 if v_0.Op != OpPPC64XOR {
8654 v_0_0 := v_0.Args[0]
8655 v_0_1 := v_0.Args[1]
8656 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
8658 if v_0_1.Op != OpPPC64MOVHZreg {
8662 v.reset(OpPPC64MOVHZreg)
8663 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
8670 // match: (MOVHZreg (AND <t> x (MOVHZreg y)))
8671 // result: (MOVHZreg (AND <t> x y))
8673 if v_0.Op != OpPPC64AND {
8678 v_0_0 := v_0.Args[0]
8679 v_0_1 := v_0.Args[1]
8680 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
8682 if v_0_1.Op != OpPPC64MOVHZreg {
8686 v.reset(OpPPC64MOVHZreg)
8687 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
8694 // match: (MOVHZreg z:(Select0 (ANDCCconst [c] (MOVBZload ptr x))))
8698 if z.Op != OpSelect0 {
8702 if z_0.Op != OpPPC64ANDCCconst {
8705 z_0_0 := z_0.Args[0]
8706 if z_0_0.Op != OpPPC64MOVBZload {
8712 // match: (MOVHZreg z:(AND y (MOVHZload ptr x)))
8716 if z.Op != OpPPC64AND {
8722 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
8723 if z_1.Op != OpPPC64MOVHZload {
8731 // match: (MOVHZreg z:(Select0 (ANDCCconst [c] (MOVHZload ptr x))))
8735 if z.Op != OpSelect0 {
8739 if z_0.Op != OpPPC64ANDCCconst {
8742 z_0_0 := z_0.Args[0]
8743 if z_0_0.Op != OpPPC64MOVHZload {
8749 // match: (MOVHZreg x:(MOVBZload _ _))
8753 if x.Op != OpPPC64MOVBZload {
8759 // match: (MOVHZreg x:(MOVBZloadidx _ _ _))
8763 if x.Op != OpPPC64MOVBZloadidx {
8769 // match: (MOVHZreg x:(MOVHZload _ _))
8773 if x.Op != OpPPC64MOVHZload {
8779 // match: (MOVHZreg x:(MOVHZloadidx _ _ _))
8783 if x.Op != OpPPC64MOVHZloadidx {
8789 // match: (MOVHZreg x:(Arg <t>))
8790 // cond: (is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()
8798 if !((is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()) {
8804 // match: (MOVHZreg (MOVDconst [c]))
8805 // result: (MOVDconst [int64(uint16(c))])
8807 if v_0.Op != OpPPC64MOVDconst {
8810 c := auxIntToInt64(v_0.AuxInt)
8811 v.reset(OpPPC64MOVDconst)
8812 v.AuxInt = int64ToAuxInt(int64(uint16(c)))
8817 func rewriteValuePPC64_OpPPC64MOVHload(v *Value) bool {
8820 // match: (MOVHload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
8821 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
8822 // result: (MOVHload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
8824 off1 := auxIntToInt32(v.AuxInt)
8825 sym1 := auxToSym(v.Aux)
8827 if p.Op != OpPPC64MOVDaddr {
8830 off2 := auxIntToInt32(p.AuxInt)
8831 sym2 := auxToSym(p.Aux)
8834 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8837 v.reset(OpPPC64MOVHload)
8838 v.AuxInt = int32ToAuxInt(off1 + off2)
8839 v.Aux = symToAux(mergeSym(sym1, sym2))
8843 // match: (MOVHload [off1] {sym} (ADDconst [off2] x) mem)
8844 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
8845 // result: (MOVHload [off1+int32(off2)] {sym} x mem)
8847 off1 := auxIntToInt32(v.AuxInt)
8848 sym := auxToSym(v.Aux)
8849 if v_0.Op != OpPPC64ADDconst {
8852 off2 := auxIntToInt64(v_0.AuxInt)
8855 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
8858 v.reset(OpPPC64MOVHload)
8859 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8860 v.Aux = symToAux(sym)
8864 // match: (MOVHload [0] {sym} p:(ADD ptr idx) mem)
8865 // cond: sym == nil && p.Uses == 1
8866 // result: (MOVHloadidx ptr idx mem)
8868 if auxIntToInt32(v.AuxInt) != 0 {
8871 sym := auxToSym(v.Aux)
8873 if p.Op != OpPPC64ADD {
8879 if !(sym == nil && p.Uses == 1) {
8882 v.reset(OpPPC64MOVHloadidx)
8883 v.AddArg3(ptr, idx, mem)
8888 func rewriteValuePPC64_OpPPC64MOVHloadidx(v *Value) bool {
8892 // match: (MOVHloadidx ptr (MOVDconst [c]) mem)
8893 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
8894 // result: (MOVHload [int32(c)] ptr mem)
8897 if v_1.Op != OpPPC64MOVDconst {
8900 c := auxIntToInt64(v_1.AuxInt)
8902 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8905 v.reset(OpPPC64MOVHload)
8906 v.AuxInt = int32ToAuxInt(int32(c))
8910 // match: (MOVHloadidx (MOVDconst [c]) ptr mem)
8911 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
8912 // result: (MOVHload [int32(c)] ptr mem)
8914 if v_0.Op != OpPPC64MOVDconst {
8917 c := auxIntToInt64(v_0.AuxInt)
8920 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8923 v.reset(OpPPC64MOVHload)
8924 v.AuxInt = int32ToAuxInt(int32(c))
8930 func rewriteValuePPC64_OpPPC64MOVHreg(v *Value) bool {
8933 typ := &b.Func.Config.Types
8934 // match: (MOVHreg y:(Select0 (ANDCCconst [c] _)))
8935 // cond: uint64(c) <= 0x7FFF
8939 if y.Op != OpSelect0 {
8943 if y_0.Op != OpPPC64ANDCCconst {
8946 c := auxIntToInt64(y_0.AuxInt)
8947 if !(uint64(c) <= 0x7FFF) {
8953 // match: (MOVHreg (SRAWconst [c] (MOVBreg x)))
8954 // result: (SRAWconst [c] (MOVBreg x))
8956 if v_0.Op != OpPPC64SRAWconst {
8959 c := auxIntToInt64(v_0.AuxInt)
8960 v_0_0 := v_0.Args[0]
8961 if v_0_0.Op != OpPPC64MOVBreg {
8965 v.reset(OpPPC64SRAWconst)
8966 v.AuxInt = int64ToAuxInt(c)
8967 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
8972 // match: (MOVHreg (SRAWconst [c] (MOVHreg x)))
8973 // result: (SRAWconst [c] (MOVHreg x))
8975 if v_0.Op != OpPPC64SRAWconst {
8978 c := auxIntToInt64(v_0.AuxInt)
8979 v_0_0 := v_0.Args[0]
8980 if v_0_0.Op != OpPPC64MOVHreg {
8984 v.reset(OpPPC64SRAWconst)
8985 v.AuxInt = int64ToAuxInt(c)
8986 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
8991 // match: (MOVHreg (SRAWconst [c] x))
8992 // cond: sizeof(x.Type) <= 16
8993 // result: (SRAWconst [c] x)
8995 if v_0.Op != OpPPC64SRAWconst {
8998 c := auxIntToInt64(v_0.AuxInt)
9000 if !(sizeof(x.Type) <= 16) {
9003 v.reset(OpPPC64SRAWconst)
9004 v.AuxInt = int64ToAuxInt(c)
9008 // match: (MOVHreg (SRDconst [c] x))
9010 // result: (SRDconst [c] x)
9012 if v_0.Op != OpPPC64SRDconst {
9015 c := auxIntToInt64(v_0.AuxInt)
9020 v.reset(OpPPC64SRDconst)
9021 v.AuxInt = int64ToAuxInt(c)
9025 // match: (MOVHreg (SRDconst [c] x))
9027 // result: (SRADconst [c] x)
9029 if v_0.Op != OpPPC64SRDconst {
9032 c := auxIntToInt64(v_0.AuxInt)
9037 v.reset(OpPPC64SRADconst)
9038 v.AuxInt = int64ToAuxInt(c)
9042 // match: (MOVHreg (SRADconst [c] x))
9044 // result: (SRADconst [c] x)
9046 if v_0.Op != OpPPC64SRADconst {
9049 c := auxIntToInt64(v_0.AuxInt)
9054 v.reset(OpPPC64SRADconst)
9055 v.AuxInt = int64ToAuxInt(c)
9059 // match: (MOVHreg (SRWconst [c] x))
9061 // result: (SRWconst [c] x)
9063 if v_0.Op != OpPPC64SRWconst {
9066 c := auxIntToInt64(v_0.AuxInt)
9071 v.reset(OpPPC64SRWconst)
9072 v.AuxInt = int64ToAuxInt(c)
9076 // match: (MOVHreg (SRAWconst [c] x))
9078 // result: (SRAWconst [c] x)
9080 if v_0.Op != OpPPC64SRAWconst {
9083 c := auxIntToInt64(v_0.AuxInt)
9088 v.reset(OpPPC64SRAWconst)
9089 v.AuxInt = int64ToAuxInt(c)
9093 // match: (MOVHreg (SRWconst [c] x))
9095 // result: (SRAWconst [c] x)
9097 if v_0.Op != OpPPC64SRWconst {
9100 c := auxIntToInt64(v_0.AuxInt)
9105 v.reset(OpPPC64SRAWconst)
9106 v.AuxInt = int64ToAuxInt(c)
9110 // match: (MOVHreg y:(MOVHreg _))
9114 if y.Op != OpPPC64MOVHreg {
9120 // match: (MOVHreg y:(MOVBreg _))
9124 if y.Op != OpPPC64MOVBreg {
9130 // match: (MOVHreg y:(MOVHZreg x))
9131 // result: (MOVHreg x)
9134 if y.Op != OpPPC64MOVHZreg {
9138 v.reset(OpPPC64MOVHreg)
9142 // match: (MOVHreg x:(MOVHload _ _))
9146 if x.Op != OpPPC64MOVHload {
9152 // match: (MOVHreg x:(MOVHloadidx _ _ _))
9156 if x.Op != OpPPC64MOVHloadidx {
9162 // match: (MOVHreg x:(Arg <t>))
9163 // cond: (is8BitInt(t) || is16BitInt(t)) && t.IsSigned()
9171 if !((is8BitInt(t) || is16BitInt(t)) && t.IsSigned()) {
9177 // match: (MOVHreg (MOVDconst [c]))
9178 // result: (MOVDconst [int64(int16(c))])
9180 if v_0.Op != OpPPC64MOVDconst {
9183 c := auxIntToInt64(v_0.AuxInt)
9184 v.reset(OpPPC64MOVDconst)
9185 v.AuxInt = int64ToAuxInt(int64(int16(c)))
9190 func rewriteValuePPC64_OpPPC64MOVHstore(v *Value) bool {
9195 // match: (MOVHstore [off1] {sym} (ADDconst [off2] x) val mem)
9196 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
9197 // result: (MOVHstore [off1+int32(off2)] {sym} x val mem)
9199 off1 := auxIntToInt32(v.AuxInt)
9200 sym := auxToSym(v.Aux)
9201 if v_0.Op != OpPPC64ADDconst {
9204 off2 := auxIntToInt64(v_0.AuxInt)
9208 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
9211 v.reset(OpPPC64MOVHstore)
9212 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9213 v.Aux = symToAux(sym)
9214 v.AddArg3(x, val, mem)
9217 // match: (MOVHstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
9218 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
9219 // result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
9221 off1 := auxIntToInt32(v.AuxInt)
9222 sym1 := auxToSym(v.Aux)
9224 if p.Op != OpPPC64MOVDaddr {
9227 off2 := auxIntToInt32(p.AuxInt)
9228 sym2 := auxToSym(p.Aux)
9232 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
9235 v.reset(OpPPC64MOVHstore)
9236 v.AuxInt = int32ToAuxInt(off1 + off2)
9237 v.Aux = symToAux(mergeSym(sym1, sym2))
9238 v.AddArg3(ptr, val, mem)
9241 // match: (MOVHstore [off] {sym} ptr (MOVDconst [0]) mem)
9242 // result: (MOVHstorezero [off] {sym} ptr mem)
9244 off := auxIntToInt32(v.AuxInt)
9245 sym := auxToSym(v.Aux)
9247 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
9251 v.reset(OpPPC64MOVHstorezero)
9252 v.AuxInt = int32ToAuxInt(off)
9253 v.Aux = symToAux(sym)
9257 // match: (MOVHstore [0] {sym} p:(ADD ptr idx) val mem)
9258 // cond: sym == nil && p.Uses == 1
9259 // result: (MOVHstoreidx ptr idx val mem)
9261 if auxIntToInt32(v.AuxInt) != 0 {
9264 sym := auxToSym(v.Aux)
9266 if p.Op != OpPPC64ADD {
9273 if !(sym == nil && p.Uses == 1) {
9276 v.reset(OpPPC64MOVHstoreidx)
9277 v.AddArg4(ptr, idx, val, mem)
9280 // match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
9281 // result: (MOVHstore [off] {sym} ptr x mem)
9283 off := auxIntToInt32(v.AuxInt)
9284 sym := auxToSym(v.Aux)
9286 if v_1.Op != OpPPC64MOVHreg {
9291 v.reset(OpPPC64MOVHstore)
9292 v.AuxInt = int32ToAuxInt(off)
9293 v.Aux = symToAux(sym)
9294 v.AddArg3(ptr, x, mem)
9297 // match: (MOVHstore [off] {sym} ptr (MOVHZreg x) mem)
9298 // result: (MOVHstore [off] {sym} ptr x mem)
9300 off := auxIntToInt32(v.AuxInt)
9301 sym := auxToSym(v.Aux)
9303 if v_1.Op != OpPPC64MOVHZreg {
9308 v.reset(OpPPC64MOVHstore)
9309 v.AuxInt = int32ToAuxInt(off)
9310 v.Aux = symToAux(sym)
9311 v.AddArg3(ptr, x, mem)
9314 // match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
9315 // result: (MOVHstore [off] {sym} ptr x mem)
9317 off := auxIntToInt32(v.AuxInt)
9318 sym := auxToSym(v.Aux)
9320 if v_1.Op != OpPPC64MOVWreg {
9325 v.reset(OpPPC64MOVHstore)
9326 v.AuxInt = int32ToAuxInt(off)
9327 v.Aux = symToAux(sym)
9328 v.AddArg3(ptr, x, mem)
9331 // match: (MOVHstore [off] {sym} ptr (MOVWZreg x) mem)
9332 // result: (MOVHstore [off] {sym} ptr x mem)
9334 off := auxIntToInt32(v.AuxInt)
9335 sym := auxToSym(v.Aux)
9337 if v_1.Op != OpPPC64MOVWZreg {
9342 v.reset(OpPPC64MOVHstore)
9343 v.AuxInt = int32ToAuxInt(off)
9344 v.Aux = symToAux(sym)
9345 v.AddArg3(ptr, x, mem)
9348 // match: (MOVHstore [off] {sym} ptr r:(BRH val) mem)
9349 // cond: r.Uses == 1
9350 // result: (MOVHBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
9352 off := auxIntToInt32(v.AuxInt)
9353 sym := auxToSym(v.Aux)
9356 if r.Op != OpPPC64BRH {
9364 v.reset(OpPPC64MOVHBRstore)
9365 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
9366 v0.AuxInt = int32ToAuxInt(off)
9367 v0.Aux = symToAux(sym)
9369 v.AddArg3(v0, val, mem)
9372 // match: (MOVHstore [off] {sym} ptr (Bswap16 val) mem)
9373 // result: (MOVHBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
9375 off := auxIntToInt32(v.AuxInt)
9376 sym := auxToSym(v.Aux)
9378 if v_1.Op != OpBswap16 {
9383 v.reset(OpPPC64MOVHBRstore)
9384 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
9385 v0.AuxInt = int32ToAuxInt(off)
9386 v0.Aux = symToAux(sym)
9388 v.AddArg3(v0, val, mem)
9393 func rewriteValuePPC64_OpPPC64MOVHstoreidx(v *Value) bool {
9398 // match: (MOVHstoreidx ptr (MOVDconst [c]) val mem)
9399 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
9400 // result: (MOVHstore [int32(c)] ptr val mem)
9403 if v_1.Op != OpPPC64MOVDconst {
9406 c := auxIntToInt64(v_1.AuxInt)
9409 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
9412 v.reset(OpPPC64MOVHstore)
9413 v.AuxInt = int32ToAuxInt(int32(c))
9414 v.AddArg3(ptr, val, mem)
9417 // match: (MOVHstoreidx (MOVDconst [c]) ptr val mem)
9418 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
9419 // result: (MOVHstore [int32(c)] ptr val mem)
9421 if v_0.Op != OpPPC64MOVDconst {
9424 c := auxIntToInt64(v_0.AuxInt)
9428 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
9431 v.reset(OpPPC64MOVHstore)
9432 v.AuxInt = int32ToAuxInt(int32(c))
9433 v.AddArg3(ptr, val, mem)
9436 // match: (MOVHstoreidx ptr idx (MOVHreg x) mem)
9437 // result: (MOVHstoreidx ptr idx x mem)
9441 if v_2.Op != OpPPC64MOVHreg {
9446 v.reset(OpPPC64MOVHstoreidx)
9447 v.AddArg4(ptr, idx, x, mem)
9450 // match: (MOVHstoreidx ptr idx (MOVHZreg x) mem)
9451 // result: (MOVHstoreidx ptr idx x mem)
9455 if v_2.Op != OpPPC64MOVHZreg {
9460 v.reset(OpPPC64MOVHstoreidx)
9461 v.AddArg4(ptr, idx, x, mem)
9464 // match: (MOVHstoreidx ptr idx (MOVWreg x) mem)
9465 // result: (MOVHstoreidx ptr idx x mem)
9469 if v_2.Op != OpPPC64MOVWreg {
9474 v.reset(OpPPC64MOVHstoreidx)
9475 v.AddArg4(ptr, idx, x, mem)
9478 // match: (MOVHstoreidx ptr idx (MOVWZreg x) mem)
9479 // result: (MOVHstoreidx ptr idx x mem)
9483 if v_2.Op != OpPPC64MOVWZreg {
9488 v.reset(OpPPC64MOVHstoreidx)
9489 v.AddArg4(ptr, idx, x, mem)
9492 // match: (MOVHstoreidx ptr idx r:(BRH val) mem)
9493 // cond: r.Uses == 1
9494 // result: (MOVHBRstoreidx ptr idx val mem)
9499 if r.Op != OpPPC64BRH {
9507 v.reset(OpPPC64MOVHBRstoreidx)
9508 v.AddArg4(ptr, idx, val, mem)
9511 // match: (MOVHstoreidx ptr idx (Bswap16 val) mem)
9512 // result: (MOVHBRstoreidx ptr idx val mem)
9516 if v_2.Op != OpBswap16 {
9521 v.reset(OpPPC64MOVHBRstoreidx)
9522 v.AddArg4(ptr, idx, val, mem)
9527 func rewriteValuePPC64_OpPPC64MOVHstorezero(v *Value) bool {
9530 // match: (MOVHstorezero [off1] {sym} (ADDconst [off2] x) mem)
9531 // cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
9532 // result: (MOVHstorezero [off1+int32(off2)] {sym} x mem)
9534 off1 := auxIntToInt32(v.AuxInt)
9535 sym := auxToSym(v.Aux)
9536 if v_0.Op != OpPPC64ADDconst {
9539 off2 := auxIntToInt64(v_0.AuxInt)
9542 if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
9545 v.reset(OpPPC64MOVHstorezero)
9546 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9547 v.Aux = symToAux(sym)
9551 // match: (MOVHstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
9552 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
9553 // result: (MOVHstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
9555 off1 := auxIntToInt32(v.AuxInt)
9556 sym1 := auxToSym(v.Aux)
9558 if p.Op != OpPPC64MOVDaddr {
9561 off2 := auxIntToInt32(p.AuxInt)
9562 sym2 := auxToSym(p.Aux)
9565 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
9568 v.reset(OpPPC64MOVHstorezero)
9569 v.AuxInt = int32ToAuxInt(off1 + off2)
9570 v.Aux = symToAux(mergeSym(sym1, sym2))
9576 func rewriteValuePPC64_OpPPC64MOVWBRstore(v *Value) bool {
9580 // match: (MOVWBRstore ptr (MOVWreg x) mem)
9581 // result: (MOVWBRstore ptr x mem)
9584 if v_1.Op != OpPPC64MOVWreg {
9589 v.reset(OpPPC64MOVWBRstore)
9590 v.AddArg3(ptr, x, mem)
9593 // match: (MOVWBRstore ptr (MOVWZreg x) mem)
9594 // result: (MOVWBRstore ptr x mem)
9597 if v_1.Op != OpPPC64MOVWZreg {
9602 v.reset(OpPPC64MOVWBRstore)
9603 v.AddArg3(ptr, x, mem)
9608 func rewriteValuePPC64_OpPPC64MOVWZload(v *Value) bool {
9611 // match: (MOVWZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
9612 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
9613 // result: (MOVWZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
9615 off1 := auxIntToInt32(v.AuxInt)
9616 sym1 := auxToSym(v.Aux)
9618 if p.Op != OpPPC64MOVDaddr {
9621 off2 := auxIntToInt32(p.AuxInt)
9622 sym2 := auxToSym(p.Aux)
9625 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
9628 v.reset(OpPPC64MOVWZload)
9629 v.AuxInt = int32ToAuxInt(off1 + off2)
9630 v.Aux = symToAux(mergeSym(sym1, sym2))
9634 // match: (MOVWZload [off1] {sym} (ADDconst [off2] x) mem)
9635 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
9636 // result: (MOVWZload [off1+int32(off2)] {sym} x mem)
9638 off1 := auxIntToInt32(v.AuxInt)
9639 sym := auxToSym(v.Aux)
9640 if v_0.Op != OpPPC64ADDconst {
9643 off2 := auxIntToInt64(v_0.AuxInt)
9646 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
9649 v.reset(OpPPC64MOVWZload)
9650 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9651 v.Aux = symToAux(sym)
9655 // match: (MOVWZload [0] {sym} p:(ADD ptr idx) mem)
9656 // cond: sym == nil && p.Uses == 1
9657 // result: (MOVWZloadidx ptr idx mem)
9659 if auxIntToInt32(v.AuxInt) != 0 {
9662 sym := auxToSym(v.Aux)
9664 if p.Op != OpPPC64ADD {
9670 if !(sym == nil && p.Uses == 1) {
9673 v.reset(OpPPC64MOVWZloadidx)
9674 v.AddArg3(ptr, idx, mem)
9679 func rewriteValuePPC64_OpPPC64MOVWZloadidx(v *Value) bool {
9683 // match: (MOVWZloadidx ptr (MOVDconst [c]) mem)
9684 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
9685 // result: (MOVWZload [int32(c)] ptr mem)
9688 if v_1.Op != OpPPC64MOVDconst {
9691 c := auxIntToInt64(v_1.AuxInt)
9693 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
9696 v.reset(OpPPC64MOVWZload)
9697 v.AuxInt = int32ToAuxInt(int32(c))
9701 // match: (MOVWZloadidx (MOVDconst [c]) ptr mem)
9702 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
9703 // result: (MOVWZload [int32(c)] ptr mem)
9705 if v_0.Op != OpPPC64MOVDconst {
9708 c := auxIntToInt64(v_0.AuxInt)
9711 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
9714 v.reset(OpPPC64MOVWZload)
9715 v.AuxInt = int32ToAuxInt(int32(c))
9721 func rewriteValuePPC64_OpPPC64MOVWZreg(v *Value) bool {
9724 typ := &b.Func.Config.Types
9725 // match: (MOVWZreg y:(Select0 (ANDCCconst [c] _)))
9726 // cond: uint64(c) <= 0xFFFFFFFF
9730 if y.Op != OpSelect0 {
9734 if y_0.Op != OpPPC64ANDCCconst {
9737 c := auxIntToInt64(y_0.AuxInt)
9738 if !(uint64(c) <= 0xFFFFFFFF) {
9744 // match: (MOVWZreg y:(AND (MOVDconst [c]) _))
9745 // cond: uint64(c) <= 0xFFFFFFFF
9749 if y.Op != OpPPC64AND {
9754 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
9755 if y_0.Op != OpPPC64MOVDconst {
9758 c := auxIntToInt64(y_0.AuxInt)
9759 if !(uint64(c) <= 0xFFFFFFFF) {
9767 // match: (MOVWZreg (SRWconst [c] (MOVBZreg x)))
9768 // result: (SRWconst [c] (MOVBZreg x))
9770 if v_0.Op != OpPPC64SRWconst {
9773 c := auxIntToInt64(v_0.AuxInt)
9774 v_0_0 := v_0.Args[0]
9775 if v_0_0.Op != OpPPC64MOVBZreg {
9779 v.reset(OpPPC64SRWconst)
9780 v.AuxInt = int64ToAuxInt(c)
9781 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
9786 // match: (MOVWZreg (SRWconst [c] (MOVHZreg x)))
9787 // result: (SRWconst [c] (MOVHZreg x))
9789 if v_0.Op != OpPPC64SRWconst {
9792 c := auxIntToInt64(v_0.AuxInt)
9793 v_0_0 := v_0.Args[0]
9794 if v_0_0.Op != OpPPC64MOVHZreg {
9798 v.reset(OpPPC64SRWconst)
9799 v.AuxInt = int64ToAuxInt(c)
9800 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
9805 // match: (MOVWZreg (SRWconst [c] (MOVWZreg x)))
9806 // result: (SRWconst [c] (MOVWZreg x))
9808 if v_0.Op != OpPPC64SRWconst {
9811 c := auxIntToInt64(v_0.AuxInt)
9812 v_0_0 := v_0.Args[0]
9813 if v_0_0.Op != OpPPC64MOVWZreg {
9817 v.reset(OpPPC64SRWconst)
9818 v.AuxInt = int64ToAuxInt(c)
9819 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
9824 // match: (MOVWZreg (SRWconst [c] x))
9825 // cond: sizeof(x.Type) <= 32
9826 // result: (SRWconst [c] x)
9828 if v_0.Op != OpPPC64SRWconst {
9831 c := auxIntToInt64(v_0.AuxInt)
9833 if !(sizeof(x.Type) <= 32) {
9836 v.reset(OpPPC64SRWconst)
9837 v.AuxInt = int64ToAuxInt(c)
9841 // match: (MOVWZreg (SRDconst [c] x))
9843 // result: (SRDconst [c] x)
9845 if v_0.Op != OpPPC64SRDconst {
9848 c := auxIntToInt64(v_0.AuxInt)
9853 v.reset(OpPPC64SRDconst)
9854 v.AuxInt = int64ToAuxInt(c)
9858 // match: (MOVWZreg y:(MOVWZreg _))
9862 if y.Op != OpPPC64MOVWZreg {
9868 // match: (MOVWZreg y:(MOVHZreg _))
9872 if y.Op != OpPPC64MOVHZreg {
9878 // match: (MOVWZreg y:(MOVBZreg _))
9882 if y.Op != OpPPC64MOVBZreg {
9888 // match: (MOVWZreg y:(MOVHBRload _ _))
9892 if y.Op != OpPPC64MOVHBRload {
9898 // match: (MOVWZreg y:(MOVWBRload _ _))
9902 if y.Op != OpPPC64MOVWBRload {
9908 // match: (MOVWZreg y:(MOVWreg x))
9909 // result: (MOVWZreg x)
9912 if y.Op != OpPPC64MOVWreg {
9916 v.reset(OpPPC64MOVWZreg)
9920 // match: (MOVWZreg (OR <t> x (MOVWZreg y)))
9921 // result: (MOVWZreg (OR <t> x y))
9923 if v_0.Op != OpPPC64OR {
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, OpPPC64OR, t)
9944 // match: (MOVWZreg (XOR <t> x (MOVWZreg y)))
9945 // result: (MOVWZreg (XOR <t> x y))
9947 if v_0.Op != OpPPC64XOR {
9952 v_0_0 := v_0.Args[0]
9953 v_0_1 := v_0.Args[1]
9954 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9956 if v_0_1.Op != OpPPC64MOVWZreg {
9960 v.reset(OpPPC64MOVWZreg)
9961 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
9968 // match: (MOVWZreg (AND <t> x (MOVWZreg y)))
9969 // result: (MOVWZreg (AND <t> x y))
9971 if v_0.Op != OpPPC64AND {
9976 v_0_0 := v_0.Args[0]
9977 v_0_1 := v_0.Args[1]
9978 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9980 if v_0_1.Op != OpPPC64MOVWZreg {
9984 v.reset(OpPPC64MOVWZreg)
9985 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
9992 // match: (MOVWZreg z:(Select0 (ANDCCconst [c] (MOVBZload ptr x))))
9996 if z.Op != OpSelect0 {
10000 if z_0.Op != OpPPC64ANDCCconst {
10003 z_0_0 := z_0.Args[0]
10004 if z_0_0.Op != OpPPC64MOVBZload {
10010 // match: (MOVWZreg z:(AND y (MOVWZload ptr x)))
10014 if z.Op != OpPPC64AND {
10020 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
10021 if z_1.Op != OpPPC64MOVWZload {
10029 // match: (MOVWZreg z:(Select0 (ANDCCconst [c] (MOVHZload ptr x))))
10033 if z.Op != OpSelect0 {
10037 if z_0.Op != OpPPC64ANDCCconst {
10040 z_0_0 := z_0.Args[0]
10041 if z_0_0.Op != OpPPC64MOVHZload {
10047 // match: (MOVWZreg z:(Select0 (ANDCCconst [c] (MOVWZload ptr x))))
10051 if z.Op != OpSelect0 {
10055 if z_0.Op != OpPPC64ANDCCconst {
10058 z_0_0 := z_0.Args[0]
10059 if z_0_0.Op != OpPPC64MOVWZload {
10065 // match: (MOVWZreg x:(MOVBZload _ _))
10069 if x.Op != OpPPC64MOVBZload {
10075 // match: (MOVWZreg x:(MOVBZloadidx _ _ _))
10079 if x.Op != OpPPC64MOVBZloadidx {
10085 // match: (MOVWZreg x:(MOVHZload _ _))
10089 if x.Op != OpPPC64MOVHZload {
10095 // match: (MOVWZreg x:(MOVHZloadidx _ _ _))
10099 if x.Op != OpPPC64MOVHZloadidx {
10105 // match: (MOVWZreg x:(MOVWZload _ _))
10109 if x.Op != OpPPC64MOVWZload {
10115 // match: (MOVWZreg x:(MOVWZloadidx _ _ _))
10119 if x.Op != OpPPC64MOVWZloadidx {
10125 // match: (MOVWZreg x:(Select0 (LoweredAtomicLoad32 _ _)))
10129 if x.Op != OpSelect0 {
10133 if x_0.Op != OpPPC64LoweredAtomicLoad32 {
10139 // match: (MOVWZreg x:(Arg <t>))
10140 // cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()
10148 if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()) {
10154 // match: (MOVWZreg (MOVDconst [c]))
10155 // result: (MOVDconst [int64(uint32(c))])
10157 if v_0.Op != OpPPC64MOVDconst {
10160 c := auxIntToInt64(v_0.AuxInt)
10161 v.reset(OpPPC64MOVDconst)
10162 v.AuxInt = int64ToAuxInt(int64(uint32(c)))
10167 func rewriteValuePPC64_OpPPC64MOVWload(v *Value) bool {
10170 // match: (MOVWload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
10171 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
10172 // result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
10174 off1 := auxIntToInt32(v.AuxInt)
10175 sym1 := auxToSym(v.Aux)
10177 if p.Op != OpPPC64MOVDaddr {
10180 off2 := auxIntToInt32(p.AuxInt)
10181 sym2 := auxToSym(p.Aux)
10184 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
10187 v.reset(OpPPC64MOVWload)
10188 v.AuxInt = int32ToAuxInt(off1 + off2)
10189 v.Aux = symToAux(mergeSym(sym1, sym2))
10190 v.AddArg2(ptr, mem)
10193 // match: (MOVWload [off1] {sym} (ADDconst [off2] x) mem)
10194 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
10195 // result: (MOVWload [off1+int32(off2)] {sym} x mem)
10197 off1 := auxIntToInt32(v.AuxInt)
10198 sym := auxToSym(v.Aux)
10199 if v_0.Op != OpPPC64ADDconst {
10202 off2 := auxIntToInt64(v_0.AuxInt)
10205 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
10208 v.reset(OpPPC64MOVWload)
10209 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10210 v.Aux = symToAux(sym)
10214 // match: (MOVWload [0] {sym} p:(ADD ptr idx) mem)
10215 // cond: sym == nil && p.Uses == 1
10216 // result: (MOVWloadidx ptr idx mem)
10218 if auxIntToInt32(v.AuxInt) != 0 {
10221 sym := auxToSym(v.Aux)
10223 if p.Op != OpPPC64ADD {
10229 if !(sym == nil && p.Uses == 1) {
10232 v.reset(OpPPC64MOVWloadidx)
10233 v.AddArg3(ptr, idx, mem)
10238 func rewriteValuePPC64_OpPPC64MOVWloadidx(v *Value) bool {
10242 // match: (MOVWloadidx ptr (MOVDconst [c]) mem)
10243 // cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
10244 // result: (MOVWload [int32(c)] ptr mem)
10247 if v_1.Op != OpPPC64MOVDconst {
10250 c := auxIntToInt64(v_1.AuxInt)
10252 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10255 v.reset(OpPPC64MOVWload)
10256 v.AuxInt = int32ToAuxInt(int32(c))
10257 v.AddArg2(ptr, mem)
10260 // match: (MOVWloadidx (MOVDconst [c]) ptr mem)
10261 // cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
10262 // result: (MOVWload [int32(c)] ptr mem)
10264 if v_0.Op != OpPPC64MOVDconst {
10267 c := auxIntToInt64(v_0.AuxInt)
10270 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10273 v.reset(OpPPC64MOVWload)
10274 v.AuxInt = int32ToAuxInt(int32(c))
10275 v.AddArg2(ptr, mem)
10280 func rewriteValuePPC64_OpPPC64MOVWreg(v *Value) bool {
10283 typ := &b.Func.Config.Types
10284 // match: (MOVWreg y:(Select0 (ANDCCconst [c] _)))
10285 // cond: uint64(c) <= 0xFFFF
10289 if y.Op != OpSelect0 {
10293 if y_0.Op != OpPPC64ANDCCconst {
10296 c := auxIntToInt64(y_0.AuxInt)
10297 if !(uint64(c) <= 0xFFFF) {
10303 // match: (MOVWreg y:(AND (MOVDconst [c]) _))
10304 // cond: uint64(c) <= 0x7FFFFFFF
10308 if y.Op != OpPPC64AND {
10313 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
10314 if y_0.Op != OpPPC64MOVDconst {
10317 c := auxIntToInt64(y_0.AuxInt)
10318 if !(uint64(c) <= 0x7FFFFFFF) {
10326 // match: (MOVWreg (SRAWconst [c] (MOVBreg x)))
10327 // result: (SRAWconst [c] (MOVBreg x))
10329 if v_0.Op != OpPPC64SRAWconst {
10332 c := auxIntToInt64(v_0.AuxInt)
10333 v_0_0 := v_0.Args[0]
10334 if v_0_0.Op != OpPPC64MOVBreg {
10338 v.reset(OpPPC64SRAWconst)
10339 v.AuxInt = int64ToAuxInt(c)
10340 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
10345 // match: (MOVWreg (SRAWconst [c] (MOVHreg x)))
10346 // result: (SRAWconst [c] (MOVHreg x))
10348 if v_0.Op != OpPPC64SRAWconst {
10351 c := auxIntToInt64(v_0.AuxInt)
10352 v_0_0 := v_0.Args[0]
10353 if v_0_0.Op != OpPPC64MOVHreg {
10357 v.reset(OpPPC64SRAWconst)
10358 v.AuxInt = int64ToAuxInt(c)
10359 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
10364 // match: (MOVWreg (SRAWconst [c] (MOVWreg x)))
10365 // result: (SRAWconst [c] (MOVWreg x))
10367 if v_0.Op != OpPPC64SRAWconst {
10370 c := auxIntToInt64(v_0.AuxInt)
10371 v_0_0 := v_0.Args[0]
10372 if v_0_0.Op != OpPPC64MOVWreg {
10376 v.reset(OpPPC64SRAWconst)
10377 v.AuxInt = int64ToAuxInt(c)
10378 v0 := b.NewValue0(v.Pos, OpPPC64MOVWreg, typ.Int64)
10383 // match: (MOVWreg (SRAWconst [c] x))
10384 // cond: sizeof(x.Type) <= 32
10385 // result: (SRAWconst [c] x)
10387 if v_0.Op != OpPPC64SRAWconst {
10390 c := auxIntToInt64(v_0.AuxInt)
10392 if !(sizeof(x.Type) <= 32) {
10395 v.reset(OpPPC64SRAWconst)
10396 v.AuxInt = int64ToAuxInt(c)
10400 // match: (MOVWreg (SRDconst [c] x))
10402 // result: (SRDconst [c] x)
10404 if v_0.Op != OpPPC64SRDconst {
10407 c := auxIntToInt64(v_0.AuxInt)
10412 v.reset(OpPPC64SRDconst)
10413 v.AuxInt = int64ToAuxInt(c)
10417 // match: (MOVWreg (SRADconst [c] x))
10419 // result: (SRADconst [c] x)
10421 if v_0.Op != OpPPC64SRADconst {
10424 c := auxIntToInt64(v_0.AuxInt)
10429 v.reset(OpPPC64SRADconst)
10430 v.AuxInt = int64ToAuxInt(c)
10434 // match: (MOVWreg (SRDconst [c] x))
10436 // result: (SRADconst [c] x)
10438 if v_0.Op != OpPPC64SRDconst {
10441 c := auxIntToInt64(v_0.AuxInt)
10446 v.reset(OpPPC64SRADconst)
10447 v.AuxInt = int64ToAuxInt(c)
10451 // match: (MOVWreg y:(MOVWreg _))
10455 if y.Op != OpPPC64MOVWreg {
10461 // match: (MOVWreg y:(MOVHreg _))
10465 if y.Op != OpPPC64MOVHreg {
10471 // match: (MOVWreg y:(MOVBreg _))
10475 if y.Op != OpPPC64MOVBreg {
10481 // match: (MOVWreg y:(MOVWZreg x))
10482 // result: (MOVWreg x)
10485 if y.Op != OpPPC64MOVWZreg {
10489 v.reset(OpPPC64MOVWreg)
10493 // match: (MOVWreg x:(MOVHload _ _))
10497 if x.Op != OpPPC64MOVHload {
10503 // match: (MOVWreg x:(MOVHloadidx _ _ _))
10507 if x.Op != OpPPC64MOVHloadidx {
10513 // match: (MOVWreg x:(MOVWload _ _))
10517 if x.Op != OpPPC64MOVWload {
10523 // match: (MOVWreg x:(MOVWloadidx _ _ _))
10527 if x.Op != OpPPC64MOVWloadidx {
10533 // match: (MOVWreg x:(Arg <t>))
10534 // cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()
10542 if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()) {
10548 // match: (MOVWreg (MOVDconst [c]))
10549 // result: (MOVDconst [int64(int32(c))])
10551 if v_0.Op != OpPPC64MOVDconst {
10554 c := auxIntToInt64(v_0.AuxInt)
10555 v.reset(OpPPC64MOVDconst)
10556 v.AuxInt = int64ToAuxInt(int64(int32(c)))
10561 func rewriteValuePPC64_OpPPC64MOVWstore(v *Value) bool {
10566 // match: (MOVWstore [off1] {sym} (ADDconst [off2] x) val mem)
10567 // cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
10568 // result: (MOVWstore [off1+int32(off2)] {sym} x val mem)
10570 off1 := auxIntToInt32(v.AuxInt)
10571 sym := auxToSym(v.Aux)
10572 if v_0.Op != OpPPC64ADDconst {
10575 off2 := auxIntToInt64(v_0.AuxInt)
10579 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
10582 v.reset(OpPPC64MOVWstore)
10583 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10584 v.Aux = symToAux(sym)
10585 v.AddArg3(x, val, mem)
10588 // match: (MOVWstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
10589 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
10590 // result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
10592 off1 := auxIntToInt32(v.AuxInt)
10593 sym1 := auxToSym(v.Aux)
10595 if p.Op != OpPPC64MOVDaddr {
10598 off2 := auxIntToInt32(p.AuxInt)
10599 sym2 := auxToSym(p.Aux)
10603 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
10606 v.reset(OpPPC64MOVWstore)
10607 v.AuxInt = int32ToAuxInt(off1 + off2)
10608 v.Aux = symToAux(mergeSym(sym1, sym2))
10609 v.AddArg3(ptr, val, mem)
10612 // match: (MOVWstore [off] {sym} ptr (MOVDconst [0]) mem)
10613 // result: (MOVWstorezero [off] {sym} ptr mem)
10615 off := auxIntToInt32(v.AuxInt)
10616 sym := auxToSym(v.Aux)
10618 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
10622 v.reset(OpPPC64MOVWstorezero)
10623 v.AuxInt = int32ToAuxInt(off)
10624 v.Aux = symToAux(sym)
10625 v.AddArg2(ptr, mem)
10628 // match: (MOVWstore [0] {sym} p:(ADD ptr idx) val mem)
10629 // cond: sym == nil && p.Uses == 1
10630 // result: (MOVWstoreidx ptr idx val mem)
10632 if auxIntToInt32(v.AuxInt) != 0 {
10635 sym := auxToSym(v.Aux)
10637 if p.Op != OpPPC64ADD {
10644 if !(sym == nil && p.Uses == 1) {
10647 v.reset(OpPPC64MOVWstoreidx)
10648 v.AddArg4(ptr, idx, val, mem)
10651 // match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
10652 // result: (MOVWstore [off] {sym} ptr x mem)
10654 off := auxIntToInt32(v.AuxInt)
10655 sym := auxToSym(v.Aux)
10657 if v_1.Op != OpPPC64MOVWreg {
10662 v.reset(OpPPC64MOVWstore)
10663 v.AuxInt = int32ToAuxInt(off)
10664 v.Aux = symToAux(sym)
10665 v.AddArg3(ptr, x, mem)
10668 // match: (MOVWstore [off] {sym} ptr (MOVWZreg x) mem)
10669 // result: (MOVWstore [off] {sym} ptr x mem)
10671 off := auxIntToInt32(v.AuxInt)
10672 sym := auxToSym(v.Aux)
10674 if v_1.Op != OpPPC64MOVWZreg {
10679 v.reset(OpPPC64MOVWstore)
10680 v.AuxInt = int32ToAuxInt(off)
10681 v.Aux = symToAux(sym)
10682 v.AddArg3(ptr, x, mem)
10685 // match: (MOVWstore [off] {sym} ptr r:(BRW val) mem)
10686 // cond: r.Uses == 1
10687 // result: (MOVWBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
10689 off := auxIntToInt32(v.AuxInt)
10690 sym := auxToSym(v.Aux)
10693 if r.Op != OpPPC64BRW {
10698 if !(r.Uses == 1) {
10701 v.reset(OpPPC64MOVWBRstore)
10702 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
10703 v0.AuxInt = int32ToAuxInt(off)
10704 v0.Aux = symToAux(sym)
10706 v.AddArg3(v0, val, mem)
10709 // match: (MOVWstore [off] {sym} ptr (Bswap32 val) mem)
10710 // result: (MOVWBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
10712 off := auxIntToInt32(v.AuxInt)
10713 sym := auxToSym(v.Aux)
10715 if v_1.Op != OpBswap32 {
10720 v.reset(OpPPC64MOVWBRstore)
10721 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
10722 v0.AuxInt = int32ToAuxInt(off)
10723 v0.Aux = symToAux(sym)
10725 v.AddArg3(v0, val, mem)
10730 func rewriteValuePPC64_OpPPC64MOVWstoreidx(v *Value) bool {
10735 // match: (MOVWstoreidx ptr (MOVDconst [c]) val mem)
10736 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
10737 // result: (MOVWstore [int32(c)] ptr val mem)
10740 if v_1.Op != OpPPC64MOVDconst {
10743 c := auxIntToInt64(v_1.AuxInt)
10746 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10749 v.reset(OpPPC64MOVWstore)
10750 v.AuxInt = int32ToAuxInt(int32(c))
10751 v.AddArg3(ptr, val, mem)
10754 // match: (MOVWstoreidx (MOVDconst [c]) ptr val mem)
10755 // cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
10756 // result: (MOVWstore [int32(c)] ptr val mem)
10758 if v_0.Op != OpPPC64MOVDconst {
10761 c := auxIntToInt64(v_0.AuxInt)
10765 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10768 v.reset(OpPPC64MOVWstore)
10769 v.AuxInt = int32ToAuxInt(int32(c))
10770 v.AddArg3(ptr, val, mem)
10773 // match: (MOVWstoreidx ptr idx (MOVWreg x) mem)
10774 // result: (MOVWstoreidx ptr idx x mem)
10778 if v_2.Op != OpPPC64MOVWreg {
10783 v.reset(OpPPC64MOVWstoreidx)
10784 v.AddArg4(ptr, idx, x, mem)
10787 // match: (MOVWstoreidx ptr idx (MOVWZreg x) mem)
10788 // result: (MOVWstoreidx ptr idx x mem)
10792 if v_2.Op != OpPPC64MOVWZreg {
10797 v.reset(OpPPC64MOVWstoreidx)
10798 v.AddArg4(ptr, idx, x, mem)
10801 // match: (MOVWstoreidx ptr idx r:(BRW val) mem)
10802 // cond: r.Uses == 1
10803 // result: (MOVWBRstoreidx ptr idx val mem)
10808 if r.Op != OpPPC64BRW {
10813 if !(r.Uses == 1) {
10816 v.reset(OpPPC64MOVWBRstoreidx)
10817 v.AddArg4(ptr, idx, val, mem)
10820 // match: (MOVWstoreidx ptr idx (Bswap32 val) mem)
10821 // result: (MOVWBRstoreidx ptr idx val mem)
10825 if v_2.Op != OpBswap32 {
10830 v.reset(OpPPC64MOVWBRstoreidx)
10831 v.AddArg4(ptr, idx, val, mem)
10836 func rewriteValuePPC64_OpPPC64MOVWstorezero(v *Value) bool {
10839 // match: (MOVWstorezero [off1] {sym} (ADDconst [off2] x) mem)
10840 // cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
10841 // result: (MOVWstorezero [off1+int32(off2)] {sym} x mem)
10843 off1 := auxIntToInt32(v.AuxInt)
10844 sym := auxToSym(v.Aux)
10845 if v_0.Op != OpPPC64ADDconst {
10848 off2 := auxIntToInt64(v_0.AuxInt)
10851 if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
10854 v.reset(OpPPC64MOVWstorezero)
10855 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10856 v.Aux = symToAux(sym)
10860 // match: (MOVWstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
10861 // cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
10862 // result: (MOVWstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
10864 off1 := auxIntToInt32(v.AuxInt)
10865 sym1 := auxToSym(v.Aux)
10867 if p.Op != OpPPC64MOVDaddr {
10870 off2 := auxIntToInt32(p.AuxInt)
10871 sym2 := auxToSym(p.Aux)
10874 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
10877 v.reset(OpPPC64MOVWstorezero)
10878 v.AuxInt = int32ToAuxInt(off1 + off2)
10879 v.Aux = symToAux(mergeSym(sym1, sym2))
10885 func rewriteValuePPC64_OpPPC64MTVSRD(v *Value) bool {
10888 typ := &b.Func.Config.Types
10889 // match: (MTVSRD (MOVDconst [c]))
10890 // cond: !math.IsNaN(math.Float64frombits(uint64(c)))
10891 // result: (FMOVDconst [math.Float64frombits(uint64(c))])
10893 if v_0.Op != OpPPC64MOVDconst {
10896 c := auxIntToInt64(v_0.AuxInt)
10897 if !(!math.IsNaN(math.Float64frombits(uint64(c)))) {
10900 v.reset(OpPPC64FMOVDconst)
10901 v.AuxInt = float64ToAuxInt(math.Float64frombits(uint64(c)))
10904 // match: (MTVSRD x:(MOVDload [off] {sym} ptr mem))
10905 // cond: x.Uses == 1 && clobber(x)
10906 // result: @x.Block (FMOVDload [off] {sym} ptr mem)
10909 if x.Op != OpPPC64MOVDload {
10912 off := auxIntToInt32(x.AuxInt)
10913 sym := auxToSym(x.Aux)
10916 if !(x.Uses == 1 && clobber(x)) {
10920 v0 := b.NewValue0(x.Pos, OpPPC64FMOVDload, typ.Float64)
10922 v0.AuxInt = int32ToAuxInt(off)
10923 v0.Aux = symToAux(sym)
10924 v0.AddArg2(ptr, mem)
10929 func rewriteValuePPC64_OpPPC64MULLD(v *Value) bool {
10932 // match: (MULLD x (MOVDconst [c]))
10933 // cond: is16Bit(c)
10934 // result: (MULLDconst [int32(c)] x)
10936 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10938 if v_1.Op != OpPPC64MOVDconst {
10941 c := auxIntToInt64(v_1.AuxInt)
10945 v.reset(OpPPC64MULLDconst)
10946 v.AuxInt = int32ToAuxInt(int32(c))
10954 func rewriteValuePPC64_OpPPC64MULLW(v *Value) bool {
10957 // match: (MULLW x (MOVDconst [c]))
10958 // cond: is16Bit(c)
10959 // result: (MULLWconst [int32(c)] x)
10961 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10963 if v_1.Op != OpPPC64MOVDconst {
10966 c := auxIntToInt64(v_1.AuxInt)
10970 v.reset(OpPPC64MULLWconst)
10971 v.AuxInt = int32ToAuxInt(int32(c))
10979 func rewriteValuePPC64_OpPPC64NEG(v *Value) bool {
10981 // match: (NEG (ADDconst [c] x))
10982 // cond: is32Bit(-c)
10983 // result: (SUBFCconst [-c] x)
10985 if v_0.Op != OpPPC64ADDconst {
10988 c := auxIntToInt64(v_0.AuxInt)
10990 if !(is32Bit(-c)) {
10993 v.reset(OpPPC64SUBFCconst)
10994 v.AuxInt = int64ToAuxInt(-c)
10998 // match: (NEG (SUBFCconst [c] x))
10999 // cond: is32Bit(-c)
11000 // result: (ADDconst [-c] x)
11002 if v_0.Op != OpPPC64SUBFCconst {
11005 c := auxIntToInt64(v_0.AuxInt)
11007 if !(is32Bit(-c)) {
11010 v.reset(OpPPC64ADDconst)
11011 v.AuxInt = int64ToAuxInt(-c)
11015 // match: (NEG (SUB x y))
11016 // result: (SUB y x)
11018 if v_0.Op != OpPPC64SUB {
11023 v.reset(OpPPC64SUB)
11027 // match: (NEG (NEG x))
11030 if v_0.Op != OpPPC64NEG {
11039 func rewriteValuePPC64_OpPPC64NOR(v *Value) bool {
11042 // match: (NOR (MOVDconst [c]) (MOVDconst [d]))
11043 // result: (MOVDconst [^(c|d)])
11045 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11046 if v_0.Op != OpPPC64MOVDconst {
11049 c := auxIntToInt64(v_0.AuxInt)
11050 if v_1.Op != OpPPC64MOVDconst {
11053 d := auxIntToInt64(v_1.AuxInt)
11054 v.reset(OpPPC64MOVDconst)
11055 v.AuxInt = int64ToAuxInt(^(c | d))
11062 func rewriteValuePPC64_OpPPC64NotEqual(v *Value) bool {
11064 // match: (NotEqual (FlagEQ))
11065 // result: (MOVDconst [0])
11067 if v_0.Op != OpPPC64FlagEQ {
11070 v.reset(OpPPC64MOVDconst)
11071 v.AuxInt = int64ToAuxInt(0)
11074 // match: (NotEqual (FlagLT))
11075 // result: (MOVDconst [1])
11077 if v_0.Op != OpPPC64FlagLT {
11080 v.reset(OpPPC64MOVDconst)
11081 v.AuxInt = int64ToAuxInt(1)
11084 // match: (NotEqual (FlagGT))
11085 // result: (MOVDconst [1])
11087 if v_0.Op != OpPPC64FlagGT {
11090 v.reset(OpPPC64MOVDconst)
11091 v.AuxInt = int64ToAuxInt(1)
11094 // match: (NotEqual (InvertFlags x))
11095 // result: (NotEqual x)
11097 if v_0.Op != OpPPC64InvertFlags {
11101 v.reset(OpPPC64NotEqual)
11105 // match: (NotEqual cmp)
11106 // result: (SETBCR [2] cmp)
11109 v.reset(OpPPC64SETBCR)
11110 v.AuxInt = int32ToAuxInt(2)
11115 func rewriteValuePPC64_OpPPC64OR(v *Value) bool {
11118 // match: (OR x (NOR y y))
11119 // result: (ORN x y)
11121 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11123 if v_1.Op != OpPPC64NOR {
11127 if y != v_1.Args[0] {
11130 v.reset(OpPPC64ORN)
11136 // match: (OR (MOVDconst [c]) (MOVDconst [d]))
11137 // result: (MOVDconst [c|d])
11139 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11140 if v_0.Op != OpPPC64MOVDconst {
11143 c := auxIntToInt64(v_0.AuxInt)
11144 if v_1.Op != OpPPC64MOVDconst {
11147 d := auxIntToInt64(v_1.AuxInt)
11148 v.reset(OpPPC64MOVDconst)
11149 v.AuxInt = int64ToAuxInt(c | d)
11154 // match: (OR x (MOVDconst [c]))
11155 // cond: isU32Bit(c)
11156 // result: (ORconst [c] x)
11158 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11160 if v_1.Op != OpPPC64MOVDconst {
11163 c := auxIntToInt64(v_1.AuxInt)
11164 if !(isU32Bit(c)) {
11167 v.reset(OpPPC64ORconst)
11168 v.AuxInt = int64ToAuxInt(c)
11176 func rewriteValuePPC64_OpPPC64ORN(v *Value) bool {
11179 // match: (ORN x (MOVDconst [-1]))
11183 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
11189 // match: (ORN (MOVDconst [c]) (MOVDconst [d]))
11190 // result: (MOVDconst [c|^d])
11192 if v_0.Op != OpPPC64MOVDconst {
11195 c := auxIntToInt64(v_0.AuxInt)
11196 if v_1.Op != OpPPC64MOVDconst {
11199 d := auxIntToInt64(v_1.AuxInt)
11200 v.reset(OpPPC64MOVDconst)
11201 v.AuxInt = int64ToAuxInt(c | ^d)
11206 func rewriteValuePPC64_OpPPC64ORconst(v *Value) bool {
11208 // match: (ORconst [c] (ORconst [d] x))
11209 // result: (ORconst [c|d] x)
11211 c := auxIntToInt64(v.AuxInt)
11212 if v_0.Op != OpPPC64ORconst {
11215 d := auxIntToInt64(v_0.AuxInt)
11217 v.reset(OpPPC64ORconst)
11218 v.AuxInt = int64ToAuxInt(c | d)
11222 // match: (ORconst [-1] _)
11223 // result: (MOVDconst [-1])
11225 if auxIntToInt64(v.AuxInt) != -1 {
11228 v.reset(OpPPC64MOVDconst)
11229 v.AuxInt = int64ToAuxInt(-1)
11232 // match: (ORconst [0] x)
11235 if auxIntToInt64(v.AuxInt) != 0 {
11244 func rewriteValuePPC64_OpPPC64ROTL(v *Value) bool {
11247 // match: (ROTL x (MOVDconst [c]))
11248 // result: (ROTLconst x [c&63])
11251 if v_1.Op != OpPPC64MOVDconst {
11254 c := auxIntToInt64(v_1.AuxInt)
11255 v.reset(OpPPC64ROTLconst)
11256 v.AuxInt = int64ToAuxInt(c & 63)
11262 func rewriteValuePPC64_OpPPC64ROTLW(v *Value) bool {
11265 // match: (ROTLW x (MOVDconst [c]))
11266 // result: (ROTLWconst x [c&31])
11269 if v_1.Op != OpPPC64MOVDconst {
11272 c := auxIntToInt64(v_1.AuxInt)
11273 v.reset(OpPPC64ROTLWconst)
11274 v.AuxInt = int64ToAuxInt(c & 31)
11280 func rewriteValuePPC64_OpPPC64ROTLWconst(v *Value) bool {
11282 // match: (ROTLWconst [r] (AND (MOVDconst [m]) x))
11283 // cond: isPPC64WordRotateMask(m)
11284 // result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
11286 r := auxIntToInt64(v.AuxInt)
11287 if v_0.Op != OpPPC64AND {
11291 v_0_0 := v_0.Args[0]
11292 v_0_1 := v_0.Args[1]
11293 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
11294 if v_0_0.Op != OpPPC64MOVDconst {
11297 m := auxIntToInt64(v_0_0.AuxInt)
11299 if !(isPPC64WordRotateMask(m)) {
11302 v.reset(OpPPC64RLWINM)
11303 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
11309 // match: (ROTLWconst [r] (Select0 (ANDCCconst [m] x)))
11310 // cond: isPPC64WordRotateMask(m)
11311 // result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
11313 r := auxIntToInt64(v.AuxInt)
11314 if v_0.Op != OpSelect0 {
11317 v_0_0 := v_0.Args[0]
11318 if v_0_0.Op != OpPPC64ANDCCconst {
11321 m := auxIntToInt64(v_0_0.AuxInt)
11323 if !(isPPC64WordRotateMask(m)) {
11326 v.reset(OpPPC64RLWINM)
11327 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
11333 func rewriteValuePPC64_OpPPC64SETBC(v *Value) bool {
11336 typ := &b.Func.Config.Types
11337 // match: (SETBC [0] (FlagLT))
11338 // result: (MOVDconst [1])
11340 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
11343 v.reset(OpPPC64MOVDconst)
11344 v.AuxInt = int64ToAuxInt(1)
11347 // match: (SETBC [0] (FlagGT))
11348 // result: (MOVDconst [0])
11350 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
11353 v.reset(OpPPC64MOVDconst)
11354 v.AuxInt = int64ToAuxInt(0)
11357 // match: (SETBC [0] (FlagEQ))
11358 // result: (MOVDconst [0])
11360 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
11363 v.reset(OpPPC64MOVDconst)
11364 v.AuxInt = int64ToAuxInt(0)
11367 // match: (SETBC [1] (FlagGT))
11368 // result: (MOVDconst [1])
11370 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
11373 v.reset(OpPPC64MOVDconst)
11374 v.AuxInt = int64ToAuxInt(1)
11377 // match: (SETBC [1] (FlagLT))
11378 // result: (MOVDconst [0])
11380 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
11383 v.reset(OpPPC64MOVDconst)
11384 v.AuxInt = int64ToAuxInt(0)
11387 // match: (SETBC [1] (FlagEQ))
11388 // result: (MOVDconst [0])
11390 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
11393 v.reset(OpPPC64MOVDconst)
11394 v.AuxInt = int64ToAuxInt(0)
11397 // match: (SETBC [2] (FlagEQ))
11398 // result: (MOVDconst [1])
11400 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
11403 v.reset(OpPPC64MOVDconst)
11404 v.AuxInt = int64ToAuxInt(1)
11407 // match: (SETBC [2] (FlagLT))
11408 // result: (MOVDconst [0])
11410 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
11413 v.reset(OpPPC64MOVDconst)
11414 v.AuxInt = int64ToAuxInt(0)
11417 // match: (SETBC [2] (FlagGT))
11418 // result: (MOVDconst [0])
11420 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
11423 v.reset(OpPPC64MOVDconst)
11424 v.AuxInt = int64ToAuxInt(0)
11427 // match: (SETBC [0] (InvertFlags bool))
11428 // result: (SETBC [1] bool)
11430 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
11433 bool := v_0.Args[0]
11434 v.reset(OpPPC64SETBC)
11435 v.AuxInt = int32ToAuxInt(1)
11439 // match: (SETBC [1] (InvertFlags bool))
11440 // result: (SETBC [0] bool)
11442 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
11445 bool := v_0.Args[0]
11446 v.reset(OpPPC64SETBC)
11447 v.AuxInt = int32ToAuxInt(0)
11451 // match: (SETBC [2] (InvertFlags bool))
11452 // result: (SETBC [2] bool)
11454 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
11457 bool := v_0.Args[0]
11458 v.reset(OpPPC64SETBC)
11459 v.AuxInt = int32ToAuxInt(2)
11463 // match: (SETBC [n] (InvertFlags bool))
11464 // result: (SETBCR [n] bool)
11466 n := auxIntToInt32(v.AuxInt)
11467 if v_0.Op != OpPPC64InvertFlags {
11470 bool := v_0.Args[0]
11471 v.reset(OpPPC64SETBCR)
11472 v.AuxInt = int32ToAuxInt(n)
11476 // match: (SETBC [2] (CMPconst [0] (Select0 (ANDCCconst [1] z))))
11477 // result: (XORconst [1] (Select0 <typ.UInt64> (ANDCCconst [1] z )))
11479 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
11482 v_0_0 := v_0.Args[0]
11483 if v_0_0.Op != OpSelect0 {
11486 v_0_0_0 := v_0_0.Args[0]
11487 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
11490 z := v_0_0_0.Args[0]
11491 v.reset(OpPPC64XORconst)
11492 v.AuxInt = int64ToAuxInt(1)
11493 v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
11494 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
11495 v1.AuxInt = int64ToAuxInt(1)
11501 // match: (SETBC [2] (CMPWconst [0] (Select0 (ANDCCconst [1] z))))
11502 // result: (XORconst [1] (Select0 <typ.UInt64> (ANDCCconst [1] z )))
11504 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
11507 v_0_0 := v_0.Args[0]
11508 if v_0_0.Op != OpSelect0 {
11511 v_0_0_0 := v_0_0.Args[0]
11512 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
11515 z := v_0_0_0.Args[0]
11516 v.reset(OpPPC64XORconst)
11517 v.AuxInt = int64ToAuxInt(1)
11518 v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
11519 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
11520 v1.AuxInt = int64ToAuxInt(1)
11526 // match: (SETBC [2] (CMPWconst [0] (Select0 (ANDCCconst [n] z))))
11527 // result: (SETBC [2] (Select1 <types.TypeFlags> (ANDCCconst [n] z )))
11529 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
11532 v_0_0 := v_0.Args[0]
11533 if v_0_0.Op != OpSelect0 {
11536 v_0_0_0 := v_0_0.Args[0]
11537 if v_0_0_0.Op != OpPPC64ANDCCconst {
11540 n := auxIntToInt64(v_0_0_0.AuxInt)
11541 z := v_0_0_0.Args[0]
11542 v.reset(OpPPC64SETBC)
11543 v.AuxInt = int32ToAuxInt(2)
11544 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11545 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
11546 v1.AuxInt = int64ToAuxInt(n)
11552 // match: (SETBC [2] (CMPconst [0] a:(AND y z)))
11553 // cond: a.Uses == 1
11554 // result: (SETBC [2] (Select1 <types.TypeFlags> (ANDCC y z )))
11556 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
11560 if a.Op != OpPPC64AND {
11565 if !(a.Uses == 1) {
11568 v.reset(OpPPC64SETBC)
11569 v.AuxInt = int32ToAuxInt(2)
11570 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11571 v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
11577 // match: (SETBC [2] (CMPconst [0] o:(OR y z)))
11578 // cond: o.Uses == 1
11579 // result: (SETBC [2] (Select1 <types.TypeFlags> (ORCC y z )))
11581 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
11585 if o.Op != OpPPC64OR {
11590 if !(o.Uses == 1) {
11593 v.reset(OpPPC64SETBC)
11594 v.AuxInt = int32ToAuxInt(2)
11595 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11596 v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
11602 // match: (SETBC [2] (CMPconst [0] a:(XOR y z)))
11603 // cond: a.Uses == 1
11604 // result: (SETBC [2] (Select1 <types.TypeFlags> (XORCC y z )))
11606 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
11610 if a.Op != OpPPC64XOR {
11615 if !(a.Uses == 1) {
11618 v.reset(OpPPC64SETBC)
11619 v.AuxInt = int32ToAuxInt(2)
11620 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11621 v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
11629 func rewriteValuePPC64_OpPPC64SETBCR(v *Value) bool {
11632 typ := &b.Func.Config.Types
11633 // match: (SETBCR [0] (FlagLT))
11634 // result: (MOVDconst [0])
11636 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
11639 v.reset(OpPPC64MOVDconst)
11640 v.AuxInt = int64ToAuxInt(0)
11643 // match: (SETBCR [0] (FlagGT))
11644 // result: (MOVDconst [1])
11646 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
11649 v.reset(OpPPC64MOVDconst)
11650 v.AuxInt = int64ToAuxInt(1)
11653 // match: (SETBCR [0] (FlagEQ))
11654 // result: (MOVDconst [1])
11656 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
11659 v.reset(OpPPC64MOVDconst)
11660 v.AuxInt = int64ToAuxInt(1)
11663 // match: (SETBCR [1] (FlagGT))
11664 // result: (MOVDconst [0])
11666 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
11669 v.reset(OpPPC64MOVDconst)
11670 v.AuxInt = int64ToAuxInt(0)
11673 // match: (SETBCR [1] (FlagLT))
11674 // result: (MOVDconst [1])
11676 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
11679 v.reset(OpPPC64MOVDconst)
11680 v.AuxInt = int64ToAuxInt(1)
11683 // match: (SETBCR [1] (FlagEQ))
11684 // result: (MOVDconst [1])
11686 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
11689 v.reset(OpPPC64MOVDconst)
11690 v.AuxInt = int64ToAuxInt(1)
11693 // match: (SETBCR [2] (FlagEQ))
11694 // result: (MOVDconst [0])
11696 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
11699 v.reset(OpPPC64MOVDconst)
11700 v.AuxInt = int64ToAuxInt(0)
11703 // match: (SETBCR [2] (FlagLT))
11704 // result: (MOVDconst [1])
11706 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
11709 v.reset(OpPPC64MOVDconst)
11710 v.AuxInt = int64ToAuxInt(1)
11713 // match: (SETBCR [2] (FlagGT))
11714 // result: (MOVDconst [1])
11716 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
11719 v.reset(OpPPC64MOVDconst)
11720 v.AuxInt = int64ToAuxInt(1)
11723 // match: (SETBCR [0] (InvertFlags bool))
11724 // result: (SETBCR [1] bool)
11726 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
11729 bool := v_0.Args[0]
11730 v.reset(OpPPC64SETBCR)
11731 v.AuxInt = int32ToAuxInt(1)
11735 // match: (SETBCR [1] (InvertFlags bool))
11736 // result: (SETBCR [0] bool)
11738 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
11741 bool := v_0.Args[0]
11742 v.reset(OpPPC64SETBCR)
11743 v.AuxInt = int32ToAuxInt(0)
11747 // match: (SETBCR [2] (InvertFlags bool))
11748 // result: (SETBCR [2] bool)
11750 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
11753 bool := v_0.Args[0]
11754 v.reset(OpPPC64SETBCR)
11755 v.AuxInt = int32ToAuxInt(2)
11759 // match: (SETBCR [n] (InvertFlags bool))
11760 // result: (SETBC [n] bool)
11762 n := auxIntToInt32(v.AuxInt)
11763 if v_0.Op != OpPPC64InvertFlags {
11766 bool := v_0.Args[0]
11767 v.reset(OpPPC64SETBC)
11768 v.AuxInt = int32ToAuxInt(n)
11772 // match: (SETBCR [2] (CMPconst [0] (Select0 (ANDCCconst [1] z))))
11773 // result: (Select0 <typ.UInt64> (ANDCCconst [1] z ))
11775 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
11778 v_0_0 := v_0.Args[0]
11779 if v_0_0.Op != OpSelect0 {
11782 v_0_0_0 := v_0_0.Args[0]
11783 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
11786 z := v_0_0_0.Args[0]
11788 v.Type = typ.UInt64
11789 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
11790 v0.AuxInt = int64ToAuxInt(1)
11795 // match: (SETBCR [2] (CMPWconst [0] (Select0 (ANDCCconst [1] z))))
11796 // result: (Select0 <typ.UInt64> (ANDCCconst [1] z ))
11798 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
11801 v_0_0 := v_0.Args[0]
11802 if v_0_0.Op != OpSelect0 {
11805 v_0_0_0 := v_0_0.Args[0]
11806 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
11809 z := v_0_0_0.Args[0]
11811 v.Type = typ.UInt64
11812 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
11813 v0.AuxInt = int64ToAuxInt(1)
11818 // match: (SETBCR [2] (CMPWconst [0] (Select0 (ANDCCconst [n] z))))
11819 // result: (SETBCR [2] (Select1 <types.TypeFlags> (ANDCCconst [n] z )))
11821 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
11824 v_0_0 := v_0.Args[0]
11825 if v_0_0.Op != OpSelect0 {
11828 v_0_0_0 := v_0_0.Args[0]
11829 if v_0_0_0.Op != OpPPC64ANDCCconst {
11832 n := auxIntToInt64(v_0_0_0.AuxInt)
11833 z := v_0_0_0.Args[0]
11834 v.reset(OpPPC64SETBCR)
11835 v.AuxInt = int32ToAuxInt(2)
11836 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11837 v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
11838 v1.AuxInt = int64ToAuxInt(n)
11844 // match: (SETBCR [2] (CMPconst [0] a:(AND y z)))
11845 // cond: a.Uses == 1
11846 // result: (SETBCR [2] (Select1 <types.TypeFlags> (ANDCC y z )))
11848 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
11852 if a.Op != OpPPC64AND {
11857 if !(a.Uses == 1) {
11860 v.reset(OpPPC64SETBCR)
11861 v.AuxInt = int32ToAuxInt(2)
11862 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11863 v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
11869 // match: (SETBCR [2] (CMPconst [0] o:(OR y z)))
11870 // cond: o.Uses == 1
11871 // result: (SETBCR [2] (Select1 <types.TypeFlags> (ORCC y z )))
11873 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
11877 if o.Op != OpPPC64OR {
11882 if !(o.Uses == 1) {
11885 v.reset(OpPPC64SETBCR)
11886 v.AuxInt = int32ToAuxInt(2)
11887 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11888 v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
11894 // match: (SETBCR [2] (CMPconst [0] a:(XOR y z)))
11895 // cond: a.Uses == 1
11896 // result: (SETBCR [2] (Select1 <types.TypeFlags> (XORCC y z )))
11898 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
11902 if a.Op != OpPPC64XOR {
11907 if !(a.Uses == 1) {
11910 v.reset(OpPPC64SETBCR)
11911 v.AuxInt = int32ToAuxInt(2)
11912 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11913 v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
11921 func rewriteValuePPC64_OpPPC64SLD(v *Value) bool {
11924 // match: (SLD x (MOVDconst [c]))
11925 // result: (SLDconst [c&63 | (c>>6&1*63)] x)
11928 if v_1.Op != OpPPC64MOVDconst {
11931 c := auxIntToInt64(v_1.AuxInt)
11932 v.reset(OpPPC64SLDconst)
11933 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
11939 func rewriteValuePPC64_OpPPC64SLDconst(v *Value) bool {
11941 // match: (SLDconst [l] (SRWconst [r] x))
11942 // cond: mergePPC64SldiSrw(l,r) != 0
11943 // result: (RLWINM [mergePPC64SldiSrw(l,r)] x)
11945 l := auxIntToInt64(v.AuxInt)
11946 if v_0.Op != OpPPC64SRWconst {
11949 r := auxIntToInt64(v_0.AuxInt)
11951 if !(mergePPC64SldiSrw(l, r) != 0) {
11954 v.reset(OpPPC64RLWINM)
11955 v.AuxInt = int64ToAuxInt(mergePPC64SldiSrw(l, r))
11959 // match: (SLDconst [c] z:(MOVBZreg x))
11960 // cond: c < 8 && z.Uses == 1
11961 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,56,63,64)] x)
11963 c := auxIntToInt64(v.AuxInt)
11965 if z.Op != OpPPC64MOVBZreg {
11969 if !(c < 8 && z.Uses == 1) {
11972 v.reset(OpPPC64CLRLSLDI)
11973 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 56, 63, 64))
11977 // match: (SLDconst [c] z:(MOVHZreg x))
11978 // cond: c < 16 && z.Uses == 1
11979 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,48,63,64)] x)
11981 c := auxIntToInt64(v.AuxInt)
11983 if z.Op != OpPPC64MOVHZreg {
11987 if !(c < 16 && z.Uses == 1) {
11990 v.reset(OpPPC64CLRLSLDI)
11991 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 48, 63, 64))
11995 // match: (SLDconst [c] z:(MOVWZreg x))
11996 // cond: c < 32 && z.Uses == 1
11997 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,32,63,64)] x)
11999 c := auxIntToInt64(v.AuxInt)
12001 if z.Op != OpPPC64MOVWZreg {
12005 if !(c < 32 && z.Uses == 1) {
12008 v.reset(OpPPC64CLRLSLDI)
12009 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32, 63, 64))
12013 // match: (SLDconst [c] z:(Select0 (ANDCCconst [d] x)))
12014 // cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))
12015 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
12017 c := auxIntToInt64(v.AuxInt)
12019 if z.Op != OpSelect0 {
12023 if z_0.Op != OpPPC64ANDCCconst {
12026 d := auxIntToInt64(z_0.AuxInt)
12028 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
12031 v.reset(OpPPC64CLRLSLDI)
12032 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
12036 // match: (SLDconst [c] z:(AND (MOVDconst [d]) x))
12037 // cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(64-getPPC64ShiftMaskLength(d))
12038 // result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
12040 c := auxIntToInt64(v.AuxInt)
12042 if z.Op != OpPPC64AND {
12048 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
12049 if z_0.Op != OpPPC64MOVDconst {
12052 d := auxIntToInt64(z_0.AuxInt)
12054 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
12057 v.reset(OpPPC64CLRLSLDI)
12058 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
12064 // match: (SLDconst [c] z:(MOVWreg x))
12065 // cond: c < 32 && buildcfg.GOPPC64 >= 9
12066 // result: (EXTSWSLconst [c] x)
12068 c := auxIntToInt64(v.AuxInt)
12070 if z.Op != OpPPC64MOVWreg {
12074 if !(c < 32 && buildcfg.GOPPC64 >= 9) {
12077 v.reset(OpPPC64EXTSWSLconst)
12078 v.AuxInt = int64ToAuxInt(c)
12084 func rewriteValuePPC64_OpPPC64SLW(v *Value) bool {
12087 // match: (SLW x (MOVDconst [c]))
12088 // result: (SLWconst [c&31 | (c>>5&1*31)] x)
12091 if v_1.Op != OpPPC64MOVDconst {
12094 c := auxIntToInt64(v_1.AuxInt)
12095 v.reset(OpPPC64SLWconst)
12096 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
12102 func rewriteValuePPC64_OpPPC64SLWconst(v *Value) bool {
12104 // match: (SLWconst [c] z:(MOVBZreg x))
12105 // cond: z.Uses == 1 && c < 8
12106 // result: (CLRLSLWI [newPPC64ShiftAuxInt(c,24,31,32)] x)
12108 c := auxIntToInt64(v.AuxInt)
12110 if z.Op != OpPPC64MOVBZreg {
12114 if !(z.Uses == 1 && c < 8) {
12117 v.reset(OpPPC64CLRLSLWI)
12118 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 24, 31, 32))
12122 // match: (SLWconst [c] z:(MOVHZreg x))
12123 // cond: z.Uses == 1 && c < 16
12124 // result: (CLRLSLWI [newPPC64ShiftAuxInt(c,16,31,32)] x)
12126 c := auxIntToInt64(v.AuxInt)
12128 if z.Op != OpPPC64MOVHZreg {
12132 if !(z.Uses == 1 && c < 16) {
12135 v.reset(OpPPC64CLRLSLWI)
12136 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 16, 31, 32))
12140 // match: (SLWconst [c] z:(Select0 (ANDCCconst [d] x)))
12141 // cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
12142 // result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
12144 c := auxIntToInt64(v.AuxInt)
12146 if z.Op != OpSelect0 {
12150 if z_0.Op != OpPPC64ANDCCconst {
12153 d := auxIntToInt64(z_0.AuxInt)
12155 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
12158 v.reset(OpPPC64CLRLSLWI)
12159 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
12163 // match: (SLWconst [c] z:(AND (MOVDconst [d]) x))
12164 // cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
12165 // result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
12167 c := auxIntToInt64(v.AuxInt)
12169 if z.Op != OpPPC64AND {
12175 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
12176 if z_0.Op != OpPPC64MOVDconst {
12179 d := auxIntToInt64(z_0.AuxInt)
12181 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
12184 v.reset(OpPPC64CLRLSLWI)
12185 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
12191 // match: (SLWconst [c] z:(MOVWreg x))
12192 // cond: c < 32 && buildcfg.GOPPC64 >= 9
12193 // result: (EXTSWSLconst [c] x)
12195 c := auxIntToInt64(v.AuxInt)
12197 if z.Op != OpPPC64MOVWreg {
12201 if !(c < 32 && buildcfg.GOPPC64 >= 9) {
12204 v.reset(OpPPC64EXTSWSLconst)
12205 v.AuxInt = int64ToAuxInt(c)
12211 func rewriteValuePPC64_OpPPC64SRAD(v *Value) bool {
12214 // match: (SRAD x (MOVDconst [c]))
12215 // result: (SRADconst [c&63 | (c>>6&1*63)] x)
12218 if v_1.Op != OpPPC64MOVDconst {
12221 c := auxIntToInt64(v_1.AuxInt)
12222 v.reset(OpPPC64SRADconst)
12223 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
12229 func rewriteValuePPC64_OpPPC64SRAW(v *Value) bool {
12232 // match: (SRAW x (MOVDconst [c]))
12233 // result: (SRAWconst [c&31 | (c>>5&1*31)] x)
12236 if v_1.Op != OpPPC64MOVDconst {
12239 c := auxIntToInt64(v_1.AuxInt)
12240 v.reset(OpPPC64SRAWconst)
12241 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
12247 func rewriteValuePPC64_OpPPC64SRD(v *Value) bool {
12250 // match: (SRD x (MOVDconst [c]))
12251 // result: (SRDconst [c&63 | (c>>6&1*63)] x)
12254 if v_1.Op != OpPPC64MOVDconst {
12257 c := auxIntToInt64(v_1.AuxInt)
12258 v.reset(OpPPC64SRDconst)
12259 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
12265 func rewriteValuePPC64_OpPPC64SRW(v *Value) bool {
12268 // match: (SRW x (MOVDconst [c]))
12269 // result: (SRWconst [c&31 | (c>>5&1*31)] x)
12272 if v_1.Op != OpPPC64MOVDconst {
12275 c := auxIntToInt64(v_1.AuxInt)
12276 v.reset(OpPPC64SRWconst)
12277 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
12283 func rewriteValuePPC64_OpPPC64SRWconst(v *Value) bool {
12285 // match: (SRWconst (Select0 (ANDCCconst [m] x)) [s])
12286 // cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
12287 // result: (MOVDconst [0])
12289 s := auxIntToInt64(v.AuxInt)
12290 if v_0.Op != OpSelect0 {
12293 v_0_0 := v_0.Args[0]
12294 if v_0_0.Op != OpPPC64ANDCCconst {
12297 m := auxIntToInt64(v_0_0.AuxInt)
12298 if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
12301 v.reset(OpPPC64MOVDconst)
12302 v.AuxInt = int64ToAuxInt(0)
12305 // match: (SRWconst (Select0 (ANDCCconst [m] x)) [s])
12306 // cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
12307 // result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
12309 s := auxIntToInt64(v.AuxInt)
12310 if v_0.Op != OpSelect0 {
12313 v_0_0 := v_0.Args[0]
12314 if v_0_0.Op != OpPPC64ANDCCconst {
12317 m := auxIntToInt64(v_0_0.AuxInt)
12319 if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
12322 v.reset(OpPPC64RLWINM)
12323 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
12327 // match: (SRWconst (AND (MOVDconst [m]) x) [s])
12328 // cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
12329 // result: (MOVDconst [0])
12331 s := auxIntToInt64(v.AuxInt)
12332 if v_0.Op != OpPPC64AND {
12336 v_0_0 := v_0.Args[0]
12337 v_0_1 := v_0.Args[1]
12338 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
12339 if v_0_0.Op != OpPPC64MOVDconst {
12342 m := auxIntToInt64(v_0_0.AuxInt)
12343 if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
12346 v.reset(OpPPC64MOVDconst)
12347 v.AuxInt = int64ToAuxInt(0)
12352 // match: (SRWconst (AND (MOVDconst [m]) x) [s])
12353 // cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
12354 // result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
12356 s := auxIntToInt64(v.AuxInt)
12357 if v_0.Op != OpPPC64AND {
12361 v_0_0 := v_0.Args[0]
12362 v_0_1 := v_0.Args[1]
12363 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
12364 if v_0_0.Op != OpPPC64MOVDconst {
12367 m := auxIntToInt64(v_0_0.AuxInt)
12369 if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
12372 v.reset(OpPPC64RLWINM)
12373 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
12381 func rewriteValuePPC64_OpPPC64SUB(v *Value) bool {
12384 // match: (SUB x (MOVDconst [c]))
12385 // cond: is32Bit(-c)
12386 // result: (ADDconst [-c] x)
12389 if v_1.Op != OpPPC64MOVDconst {
12392 c := auxIntToInt64(v_1.AuxInt)
12393 if !(is32Bit(-c)) {
12396 v.reset(OpPPC64ADDconst)
12397 v.AuxInt = int64ToAuxInt(-c)
12401 // match: (SUB (MOVDconst [c]) x)
12402 // cond: is32Bit(c)
12403 // result: (SUBFCconst [c] x)
12405 if v_0.Op != OpPPC64MOVDconst {
12408 c := auxIntToInt64(v_0.AuxInt)
12413 v.reset(OpPPC64SUBFCconst)
12414 v.AuxInt = int64ToAuxInt(c)
12420 func rewriteValuePPC64_OpPPC64SUBE(v *Value) bool {
12425 typ := &b.Func.Config.Types
12426 // match: (SUBE x y (Select1 <typ.UInt64> (SUBCconst (MOVDconst [0]) [0])))
12427 // result: (SUBC x y)
12431 if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
12434 v_2_0 := v_2.Args[0]
12435 if v_2_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_2_0.AuxInt) != 0 {
12438 v_2_0_0 := v_2_0.Args[0]
12439 if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
12442 v.reset(OpPPC64SUBC)
12448 func rewriteValuePPC64_OpPPC64SUBFCconst(v *Value) bool {
12450 // match: (SUBFCconst [c] (NEG x))
12451 // result: (ADDconst [c] x)
12453 c := auxIntToInt64(v.AuxInt)
12454 if v_0.Op != OpPPC64NEG {
12458 v.reset(OpPPC64ADDconst)
12459 v.AuxInt = int64ToAuxInt(c)
12463 // match: (SUBFCconst [c] (SUBFCconst [d] x))
12464 // cond: is32Bit(c-d)
12465 // result: (ADDconst [c-d] x)
12467 c := auxIntToInt64(v.AuxInt)
12468 if v_0.Op != OpPPC64SUBFCconst {
12471 d := auxIntToInt64(v_0.AuxInt)
12473 if !(is32Bit(c - d)) {
12476 v.reset(OpPPC64ADDconst)
12477 v.AuxInt = int64ToAuxInt(c - d)
12481 // match: (SUBFCconst [0] x)
12484 if auxIntToInt64(v.AuxInt) != 0 {
12488 v.reset(OpPPC64NEG)
12494 func rewriteValuePPC64_OpPPC64XOR(v *Value) bool {
12497 // match: (XOR (MOVDconst [c]) (MOVDconst [d]))
12498 // result: (MOVDconst [c^d])
12500 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
12501 if v_0.Op != OpPPC64MOVDconst {
12504 c := auxIntToInt64(v_0.AuxInt)
12505 if v_1.Op != OpPPC64MOVDconst {
12508 d := auxIntToInt64(v_1.AuxInt)
12509 v.reset(OpPPC64MOVDconst)
12510 v.AuxInt = int64ToAuxInt(c ^ d)
12515 // match: (XOR x (MOVDconst [c]))
12516 // cond: isU32Bit(c)
12517 // result: (XORconst [c] x)
12519 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
12521 if v_1.Op != OpPPC64MOVDconst {
12524 c := auxIntToInt64(v_1.AuxInt)
12525 if !(isU32Bit(c)) {
12528 v.reset(OpPPC64XORconst)
12529 v.AuxInt = int64ToAuxInt(c)
12537 func rewriteValuePPC64_OpPPC64XORconst(v *Value) bool {
12539 // match: (XORconst [c] (XORconst [d] x))
12540 // result: (XORconst [c^d] x)
12542 c := auxIntToInt64(v.AuxInt)
12543 if v_0.Op != OpPPC64XORconst {
12546 d := auxIntToInt64(v_0.AuxInt)
12548 v.reset(OpPPC64XORconst)
12549 v.AuxInt = int64ToAuxInt(c ^ d)
12553 // match: (XORconst [0] x)
12556 if auxIntToInt64(v.AuxInt) != 0 {
12563 // match: (XORconst [1] (SETBCR [n] cmp))
12564 // result: (SETBC [n] cmp)
12566 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBCR {
12569 n := auxIntToInt32(v_0.AuxInt)
12571 v.reset(OpPPC64SETBC)
12572 v.AuxInt = int32ToAuxInt(n)
12576 // match: (XORconst [1] (SETBC [n] cmp))
12577 // result: (SETBCR [n] cmp)
12579 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBC {
12582 n := auxIntToInt32(v_0.AuxInt)
12584 v.reset(OpPPC64SETBCR)
12585 v.AuxInt = int32ToAuxInt(n)
12591 func rewriteValuePPC64_OpPanicBounds(v *Value) bool {
12595 // match: (PanicBounds [kind] x y mem)
12596 // cond: boundsABI(kind) == 0
12597 // result: (LoweredPanicBoundsA [kind] x y mem)
12599 kind := auxIntToInt64(v.AuxInt)
12603 if !(boundsABI(kind) == 0) {
12606 v.reset(OpPPC64LoweredPanicBoundsA)
12607 v.AuxInt = int64ToAuxInt(kind)
12608 v.AddArg3(x, y, mem)
12611 // match: (PanicBounds [kind] x y mem)
12612 // cond: boundsABI(kind) == 1
12613 // result: (LoweredPanicBoundsB [kind] x y mem)
12615 kind := auxIntToInt64(v.AuxInt)
12619 if !(boundsABI(kind) == 1) {
12622 v.reset(OpPPC64LoweredPanicBoundsB)
12623 v.AuxInt = int64ToAuxInt(kind)
12624 v.AddArg3(x, y, mem)
12627 // match: (PanicBounds [kind] x y mem)
12628 // cond: boundsABI(kind) == 2
12629 // result: (LoweredPanicBoundsC [kind] x y mem)
12631 kind := auxIntToInt64(v.AuxInt)
12635 if !(boundsABI(kind) == 2) {
12638 v.reset(OpPPC64LoweredPanicBoundsC)
12639 v.AuxInt = int64ToAuxInt(kind)
12640 v.AddArg3(x, y, mem)
12645 func rewriteValuePPC64_OpPopCount16(v *Value) bool {
12648 typ := &b.Func.Config.Types
12649 // match: (PopCount16 x)
12650 // result: (POPCNTW (MOVHZreg x))
12653 v.reset(OpPPC64POPCNTW)
12654 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12660 func rewriteValuePPC64_OpPopCount32(v *Value) bool {
12663 typ := &b.Func.Config.Types
12664 // match: (PopCount32 x)
12665 // result: (POPCNTW (MOVWZreg x))
12668 v.reset(OpPPC64POPCNTW)
12669 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
12675 func rewriteValuePPC64_OpPopCount8(v *Value) bool {
12678 typ := &b.Func.Config.Types
12679 // match: (PopCount8 x)
12680 // result: (POPCNTB (MOVBZreg x))
12683 v.reset(OpPPC64POPCNTB)
12684 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
12690 func rewriteValuePPC64_OpPrefetchCache(v *Value) bool {
12693 // match: (PrefetchCache ptr mem)
12694 // result: (DCBT ptr mem [0])
12698 v.reset(OpPPC64DCBT)
12699 v.AuxInt = int64ToAuxInt(0)
12700 v.AddArg2(ptr, mem)
12704 func rewriteValuePPC64_OpPrefetchCacheStreamed(v *Value) bool {
12707 // match: (PrefetchCacheStreamed ptr mem)
12708 // result: (DCBT ptr mem [16])
12712 v.reset(OpPPC64DCBT)
12713 v.AuxInt = int64ToAuxInt(16)
12714 v.AddArg2(ptr, mem)
12718 func rewriteValuePPC64_OpRotateLeft16(v *Value) bool {
12722 typ := &b.Func.Config.Types
12723 // match: (RotateLeft16 <t> x (MOVDconst [c]))
12724 // result: (Or16 (Lsh16x64 <t> x (MOVDconst [c&15])) (Rsh16Ux64 <t> x (MOVDconst [-c&15])))
12728 if v_1.Op != OpPPC64MOVDconst {
12731 c := auxIntToInt64(v_1.AuxInt)
12733 v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
12734 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
12735 v1.AuxInt = int64ToAuxInt(c & 15)
12737 v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
12738 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
12739 v3.AuxInt = int64ToAuxInt(-c & 15)
12746 func rewriteValuePPC64_OpRotateLeft8(v *Value) bool {
12750 typ := &b.Func.Config.Types
12751 // match: (RotateLeft8 <t> x (MOVDconst [c]))
12752 // result: (Or8 (Lsh8x64 <t> x (MOVDconst [c&7])) (Rsh8Ux64 <t> x (MOVDconst [-c&7])))
12756 if v_1.Op != OpPPC64MOVDconst {
12759 c := auxIntToInt64(v_1.AuxInt)
12761 v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
12762 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
12763 v1.AuxInt = int64ToAuxInt(c & 7)
12765 v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
12766 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
12767 v3.AuxInt = int64ToAuxInt(-c & 7)
12774 func rewriteValuePPC64_OpRsh16Ux16(v *Value) bool {
12778 typ := &b.Func.Config.Types
12779 // match: (Rsh16Ux16 x y)
12780 // cond: shiftIsBounded(v)
12781 // result: (SRD (MOVHZreg x) y)
12785 if !(shiftIsBounded(v)) {
12788 v.reset(OpPPC64SRD)
12789 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12794 // match: (Rsh16Ux16 <t> x y)
12795 // result: (ISEL [2] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF0] y)))
12800 v.reset(OpPPC64ISEL)
12801 v.AuxInt = int32ToAuxInt(2)
12802 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
12803 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12806 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
12807 v2.AuxInt = int64ToAuxInt(0)
12808 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12809 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
12810 v4.AuxInt = int64ToAuxInt(0xFFF0)
12813 v.AddArg3(v0, v2, v3)
12817 func rewriteValuePPC64_OpRsh16Ux32(v *Value) bool {
12821 typ := &b.Func.Config.Types
12822 // match: (Rsh16Ux32 x y)
12823 // cond: shiftIsBounded(v)
12824 // result: (SRD (MOVHZreg x) y)
12828 if !(shiftIsBounded(v)) {
12831 v.reset(OpPPC64SRD)
12832 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12837 // match: (Rsh16Ux32 <t> x y)
12838 // result: (ISEL [0] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [16]))
12843 v.reset(OpPPC64ISEL)
12844 v.AuxInt = int32ToAuxInt(0)
12845 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
12846 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12849 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
12850 v2.AuxInt = int64ToAuxInt(0)
12851 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
12852 v3.AuxInt = int32ToAuxInt(16)
12854 v.AddArg3(v0, v2, v3)
12858 func rewriteValuePPC64_OpRsh16Ux64(v *Value) bool {
12862 typ := &b.Func.Config.Types
12863 // match: (Rsh16Ux64 x (MOVDconst [c]))
12864 // cond: uint64(c) < 16
12865 // result: (SRWconst (ZeroExt16to32 x) [c])
12868 if v_1.Op != OpPPC64MOVDconst {
12871 c := auxIntToInt64(v_1.AuxInt)
12872 if !(uint64(c) < 16) {
12875 v.reset(OpPPC64SRWconst)
12876 v.AuxInt = int64ToAuxInt(c)
12877 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
12882 // match: (Rsh16Ux64 x y)
12883 // cond: shiftIsBounded(v)
12884 // result: (SRD (MOVHZreg x) y)
12888 if !(shiftIsBounded(v)) {
12891 v.reset(OpPPC64SRD)
12892 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12897 // match: (Rsh16Ux64 <t> x y)
12898 // result: (ISEL [0] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [16]))
12903 v.reset(OpPPC64ISEL)
12904 v.AuxInt = int32ToAuxInt(0)
12905 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
12906 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12909 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
12910 v2.AuxInt = int64ToAuxInt(0)
12911 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
12912 v3.AuxInt = int64ToAuxInt(16)
12914 v.AddArg3(v0, v2, v3)
12918 func rewriteValuePPC64_OpRsh16Ux8(v *Value) bool {
12922 typ := &b.Func.Config.Types
12923 // match: (Rsh16Ux8 x y)
12924 // cond: shiftIsBounded(v)
12925 // result: (SRD (MOVHZreg x) y)
12929 if !(shiftIsBounded(v)) {
12932 v.reset(OpPPC64SRD)
12933 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12938 // match: (Rsh16Ux8 <t> x y)
12939 // result: (ISEL [2] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F0] y)))
12944 v.reset(OpPPC64ISEL)
12945 v.AuxInt = int32ToAuxInt(2)
12946 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
12947 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
12950 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
12951 v2.AuxInt = int64ToAuxInt(0)
12952 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12953 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
12954 v4.AuxInt = int64ToAuxInt(0x00F0)
12957 v.AddArg3(v0, v2, v3)
12961 func rewriteValuePPC64_OpRsh16x16(v *Value) bool {
12965 typ := &b.Func.Config.Types
12966 // match: (Rsh16x16 x y)
12967 // cond: shiftIsBounded(v)
12968 // result: (SRAD (MOVHreg x) y)
12972 if !(shiftIsBounded(v)) {
12975 v.reset(OpPPC64SRAD)
12976 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
12981 // match: (Rsh16x16 <t> x y)
12982 // result: (ISEL [2] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF0] y)))
12987 v.reset(OpPPC64ISEL)
12988 v.AuxInt = int32ToAuxInt(2)
12989 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
12990 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
12993 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
12994 v2.AuxInt = int64ToAuxInt(15)
12996 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12997 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
12998 v4.AuxInt = int64ToAuxInt(0xFFF0)
13001 v.AddArg3(v0, v2, v3)
13005 func rewriteValuePPC64_OpRsh16x32(v *Value) bool {
13009 typ := &b.Func.Config.Types
13010 // match: (Rsh16x32 x y)
13011 // cond: shiftIsBounded(v)
13012 // result: (SRAD (MOVHreg x) y)
13016 if !(shiftIsBounded(v)) {
13019 v.reset(OpPPC64SRAD)
13020 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13025 // match: (Rsh16x32 <t> x y)
13026 // result: (ISEL [0] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPWUconst y [16]))
13031 v.reset(OpPPC64ISEL)
13032 v.AuxInt = int32ToAuxInt(0)
13033 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13034 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13037 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13038 v2.AuxInt = int64ToAuxInt(15)
13040 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13041 v3.AuxInt = int32ToAuxInt(16)
13043 v.AddArg3(v0, v2, v3)
13047 func rewriteValuePPC64_OpRsh16x64(v *Value) bool {
13051 typ := &b.Func.Config.Types
13052 // match: (Rsh16x64 x (MOVDconst [c]))
13053 // cond: uint64(c) >= 16
13054 // result: (SRAWconst (SignExt16to32 x) [63])
13057 if v_1.Op != OpPPC64MOVDconst {
13060 c := auxIntToInt64(v_1.AuxInt)
13061 if !(uint64(c) >= 16) {
13064 v.reset(OpPPC64SRAWconst)
13065 v.AuxInt = int64ToAuxInt(63)
13066 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
13071 // match: (Rsh16x64 x (MOVDconst [c]))
13072 // cond: uint64(c) < 16
13073 // result: (SRAWconst (SignExt16to32 x) [c])
13076 if v_1.Op != OpPPC64MOVDconst {
13079 c := auxIntToInt64(v_1.AuxInt)
13080 if !(uint64(c) < 16) {
13083 v.reset(OpPPC64SRAWconst)
13084 v.AuxInt = int64ToAuxInt(c)
13085 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
13090 // match: (Rsh16x64 x y)
13091 // cond: shiftIsBounded(v)
13092 // result: (SRAD (MOVHreg x) y)
13096 if !(shiftIsBounded(v)) {
13099 v.reset(OpPPC64SRAD)
13100 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13105 // match: (Rsh16x64 <t> x y)
13106 // result: (ISEL [0] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPUconst y [16]))
13111 v.reset(OpPPC64ISEL)
13112 v.AuxInt = int32ToAuxInt(0)
13113 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13114 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13117 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13118 v2.AuxInt = int64ToAuxInt(15)
13120 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13121 v3.AuxInt = int64ToAuxInt(16)
13123 v.AddArg3(v0, v2, v3)
13127 func rewriteValuePPC64_OpRsh16x8(v *Value) bool {
13131 typ := &b.Func.Config.Types
13132 // match: (Rsh16x8 x y)
13133 // cond: shiftIsBounded(v)
13134 // result: (SRAD (MOVHreg x) y)
13138 if !(shiftIsBounded(v)) {
13141 v.reset(OpPPC64SRAD)
13142 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13147 // match: (Rsh16x8 <t> x y)
13148 // result: (ISEL [2] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F0] y)))
13153 v.reset(OpPPC64ISEL)
13154 v.AuxInt = int32ToAuxInt(2)
13155 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13156 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13159 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13160 v2.AuxInt = int64ToAuxInt(15)
13162 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13163 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13164 v4.AuxInt = int64ToAuxInt(0x00F0)
13167 v.AddArg3(v0, v2, v3)
13171 func rewriteValuePPC64_OpRsh32Ux16(v *Value) bool {
13175 typ := &b.Func.Config.Types
13176 // match: (Rsh32Ux16 x y)
13177 // cond: shiftIsBounded(v)
13178 // result: (SRW x y)
13182 if !(shiftIsBounded(v)) {
13185 v.reset(OpPPC64SRW)
13189 // match: (Rsh32Ux16 <t> x y)
13190 // result: (ISEL [2] (SRW <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFE0] y)))
13195 v.reset(OpPPC64ISEL)
13196 v.AuxInt = int32ToAuxInt(2)
13197 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13199 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13200 v1.AuxInt = int64ToAuxInt(0)
13201 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13202 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13203 v3.AuxInt = int64ToAuxInt(0xFFE0)
13206 v.AddArg3(v0, v1, v2)
13210 func rewriteValuePPC64_OpRsh32Ux32(v *Value) bool {
13214 typ := &b.Func.Config.Types
13215 // match: (Rsh32Ux32 x y)
13216 // cond: shiftIsBounded(v)
13217 // result: (SRW x y)
13221 if !(shiftIsBounded(v)) {
13224 v.reset(OpPPC64SRW)
13228 // match: (Rsh32Ux32 <t> x y)
13229 // result: (ISEL [0] (SRW <t> x y) (MOVDconst [0]) (CMPWUconst y [32]))
13234 v.reset(OpPPC64ISEL)
13235 v.AuxInt = int32ToAuxInt(0)
13236 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13238 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13239 v1.AuxInt = int64ToAuxInt(0)
13240 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13241 v2.AuxInt = int32ToAuxInt(32)
13243 v.AddArg3(v0, v1, v2)
13247 func rewriteValuePPC64_OpRsh32Ux64(v *Value) bool {
13251 typ := &b.Func.Config.Types
13252 // match: (Rsh32Ux64 x (MOVDconst [c]))
13253 // cond: uint64(c) < 32
13254 // result: (SRWconst x [c])
13257 if v_1.Op != OpPPC64MOVDconst {
13260 c := auxIntToInt64(v_1.AuxInt)
13261 if !(uint64(c) < 32) {
13264 v.reset(OpPPC64SRWconst)
13265 v.AuxInt = int64ToAuxInt(c)
13269 // match: (Rsh32Ux64 x y)
13270 // cond: shiftIsBounded(v)
13271 // result: (SRW x y)
13275 if !(shiftIsBounded(v)) {
13278 v.reset(OpPPC64SRW)
13282 // match: (Rsh32Ux64 <t> x y)
13283 // result: (ISEL [0] (SRW <t> x y) (MOVDconst [0]) (CMPUconst y [32]))
13288 v.reset(OpPPC64ISEL)
13289 v.AuxInt = int32ToAuxInt(0)
13290 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13292 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13293 v1.AuxInt = int64ToAuxInt(0)
13294 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13295 v2.AuxInt = int64ToAuxInt(32)
13297 v.AddArg3(v0, v1, v2)
13301 func rewriteValuePPC64_OpRsh32Ux8(v *Value) bool {
13305 typ := &b.Func.Config.Types
13306 // match: (Rsh32Ux8 x y)
13307 // cond: shiftIsBounded(v)
13308 // result: (SRW x y)
13312 if !(shiftIsBounded(v)) {
13315 v.reset(OpPPC64SRW)
13319 // match: (Rsh32Ux8 <t> x y)
13320 // result: (ISEL [2] (SRW <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00E0] y)))
13325 v.reset(OpPPC64ISEL)
13326 v.AuxInt = int32ToAuxInt(2)
13327 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13329 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13330 v1.AuxInt = int64ToAuxInt(0)
13331 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13332 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13333 v3.AuxInt = int64ToAuxInt(0x00E0)
13336 v.AddArg3(v0, v1, v2)
13340 func rewriteValuePPC64_OpRsh32x16(v *Value) bool {
13344 typ := &b.Func.Config.Types
13345 // match: (Rsh32x16 x y)
13346 // cond: shiftIsBounded(v)
13347 // result: (SRAW x y)
13351 if !(shiftIsBounded(v)) {
13354 v.reset(OpPPC64SRAW)
13358 // match: (Rsh32x16 <t> x y)
13359 // result: (ISEL [2] (SRAW <t> x y) (SRAWconst <t> x [31]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFE0] y)))
13364 v.reset(OpPPC64ISEL)
13365 v.AuxInt = int32ToAuxInt(2)
13366 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
13368 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
13369 v1.AuxInt = int64ToAuxInt(31)
13371 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13372 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13373 v3.AuxInt = int64ToAuxInt(0xFFE0)
13376 v.AddArg3(v0, v1, v2)
13380 func rewriteValuePPC64_OpRsh32x32(v *Value) bool {
13384 // match: (Rsh32x32 x y)
13385 // cond: shiftIsBounded(v)
13386 // result: (SRAW x y)
13390 if !(shiftIsBounded(v)) {
13393 v.reset(OpPPC64SRAW)
13397 // match: (Rsh32x32 <t> x y)
13398 // result: (ISEL [0] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPWUconst y [32]))
13403 v.reset(OpPPC64ISEL)
13404 v.AuxInt = int32ToAuxInt(0)
13405 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
13407 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
13408 v1.AuxInt = int64ToAuxInt(31)
13410 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13411 v2.AuxInt = int32ToAuxInt(32)
13413 v.AddArg3(v0, v1, v2)
13417 func rewriteValuePPC64_OpRsh32x64(v *Value) bool {
13421 // match: (Rsh32x64 x (MOVDconst [c]))
13422 // cond: uint64(c) >= 32
13423 // result: (SRAWconst x [63])
13426 if v_1.Op != OpPPC64MOVDconst {
13429 c := auxIntToInt64(v_1.AuxInt)
13430 if !(uint64(c) >= 32) {
13433 v.reset(OpPPC64SRAWconst)
13434 v.AuxInt = int64ToAuxInt(63)
13438 // match: (Rsh32x64 x (MOVDconst [c]))
13439 // cond: uint64(c) < 32
13440 // result: (SRAWconst x [c])
13443 if v_1.Op != OpPPC64MOVDconst {
13446 c := auxIntToInt64(v_1.AuxInt)
13447 if !(uint64(c) < 32) {
13450 v.reset(OpPPC64SRAWconst)
13451 v.AuxInt = int64ToAuxInt(c)
13455 // match: (Rsh32x64 x y)
13456 // cond: shiftIsBounded(v)
13457 // result: (SRAW x y)
13461 if !(shiftIsBounded(v)) {
13464 v.reset(OpPPC64SRAW)
13468 // match: (Rsh32x64 <t> x y)
13469 // result: (ISEL [0] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPUconst y [32]))
13474 v.reset(OpPPC64ISEL)
13475 v.AuxInt = int32ToAuxInt(0)
13476 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
13478 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
13479 v1.AuxInt = int64ToAuxInt(31)
13481 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13482 v2.AuxInt = int64ToAuxInt(32)
13484 v.AddArg3(v0, v1, v2)
13488 func rewriteValuePPC64_OpRsh32x8(v *Value) bool {
13492 typ := &b.Func.Config.Types
13493 // match: (Rsh32x8 x y)
13494 // cond: shiftIsBounded(v)
13495 // result: (SRAW x y)
13499 if !(shiftIsBounded(v)) {
13502 v.reset(OpPPC64SRAW)
13506 // match: (Rsh32x8 <t> x y)
13507 // result: (ISEL [2] (SRAW <t> x y) (SRAWconst <t> x [31]) (Select1 <types.TypeFlags> (ANDCCconst [0x00E0] y)))
13512 v.reset(OpPPC64ISEL)
13513 v.AuxInt = int32ToAuxInt(2)
13514 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
13516 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
13517 v1.AuxInt = int64ToAuxInt(31)
13519 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13520 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13521 v3.AuxInt = int64ToAuxInt(0x00E0)
13524 v.AddArg3(v0, v1, v2)
13528 func rewriteValuePPC64_OpRsh64Ux16(v *Value) bool {
13532 typ := &b.Func.Config.Types
13533 // match: (Rsh64Ux16 x y)
13534 // cond: shiftIsBounded(v)
13535 // result: (SRD x y)
13539 if !(shiftIsBounded(v)) {
13542 v.reset(OpPPC64SRD)
13546 // match: (Rsh64Ux16 <t> x y)
13547 // result: (ISEL [2] (SRD <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFC0] y)))
13552 v.reset(OpPPC64ISEL)
13553 v.AuxInt = int32ToAuxInt(2)
13554 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13556 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13557 v1.AuxInt = int64ToAuxInt(0)
13558 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13559 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13560 v3.AuxInt = int64ToAuxInt(0xFFC0)
13563 v.AddArg3(v0, v1, v2)
13567 func rewriteValuePPC64_OpRsh64Ux32(v *Value) bool {
13571 typ := &b.Func.Config.Types
13572 // match: (Rsh64Ux32 x y)
13573 // cond: shiftIsBounded(v)
13574 // result: (SRD x y)
13578 if !(shiftIsBounded(v)) {
13581 v.reset(OpPPC64SRD)
13585 // match: (Rsh64Ux32 <t> x y)
13586 // result: (ISEL [0] (SRD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
13591 v.reset(OpPPC64ISEL)
13592 v.AuxInt = int32ToAuxInt(0)
13593 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13595 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13596 v1.AuxInt = int64ToAuxInt(0)
13597 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13598 v2.AuxInt = int32ToAuxInt(64)
13600 v.AddArg3(v0, v1, v2)
13604 func rewriteValuePPC64_OpRsh64Ux64(v *Value) bool {
13608 typ := &b.Func.Config.Types
13609 // match: (Rsh64Ux64 x (MOVDconst [c]))
13610 // cond: uint64(c) < 64
13611 // result: (SRDconst x [c])
13614 if v_1.Op != OpPPC64MOVDconst {
13617 c := auxIntToInt64(v_1.AuxInt)
13618 if !(uint64(c) < 64) {
13621 v.reset(OpPPC64SRDconst)
13622 v.AuxInt = int64ToAuxInt(c)
13626 // match: (Rsh64Ux64 x y)
13627 // cond: shiftIsBounded(v)
13628 // result: (SRD x y)
13632 if !(shiftIsBounded(v)) {
13635 v.reset(OpPPC64SRD)
13639 // match: (Rsh64Ux64 <t> x y)
13640 // result: (ISEL [0] (SRD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
13645 v.reset(OpPPC64ISEL)
13646 v.AuxInt = int32ToAuxInt(0)
13647 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13649 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13650 v1.AuxInt = int64ToAuxInt(0)
13651 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13652 v2.AuxInt = int64ToAuxInt(64)
13654 v.AddArg3(v0, v1, v2)
13658 func rewriteValuePPC64_OpRsh64Ux8(v *Value) bool {
13662 typ := &b.Func.Config.Types
13663 // match: (Rsh64Ux8 x y)
13664 // cond: shiftIsBounded(v)
13665 // result: (SRD x y)
13669 if !(shiftIsBounded(v)) {
13672 v.reset(OpPPC64SRD)
13676 // match: (Rsh64Ux8 <t> x y)
13677 // result: (ISEL [2] (SRD <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00C0] y)))
13682 v.reset(OpPPC64ISEL)
13683 v.AuxInt = int32ToAuxInt(2)
13684 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13686 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13687 v1.AuxInt = int64ToAuxInt(0)
13688 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13689 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13690 v3.AuxInt = int64ToAuxInt(0x00C0)
13693 v.AddArg3(v0, v1, v2)
13697 func rewriteValuePPC64_OpRsh64x16(v *Value) bool {
13701 typ := &b.Func.Config.Types
13702 // match: (Rsh64x16 x y)
13703 // cond: shiftIsBounded(v)
13704 // result: (SRAD x y)
13708 if !(shiftIsBounded(v)) {
13711 v.reset(OpPPC64SRAD)
13715 // match: (Rsh64x16 <t> x y)
13716 // result: (ISEL [2] (SRAD <t> x y) (SRADconst <t> x [63]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFC0] y)))
13721 v.reset(OpPPC64ISEL)
13722 v.AuxInt = int32ToAuxInt(2)
13723 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13725 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13726 v1.AuxInt = int64ToAuxInt(63)
13728 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13729 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13730 v3.AuxInt = int64ToAuxInt(0xFFC0)
13733 v.AddArg3(v0, v1, v2)
13737 func rewriteValuePPC64_OpRsh64x32(v *Value) bool {
13741 // match: (Rsh64x32 x y)
13742 // cond: shiftIsBounded(v)
13743 // result: (SRAD x y)
13747 if !(shiftIsBounded(v)) {
13750 v.reset(OpPPC64SRAD)
13754 // match: (Rsh64x32 <t> x y)
13755 // result: (ISEL [0] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPWUconst y [64]))
13760 v.reset(OpPPC64ISEL)
13761 v.AuxInt = int32ToAuxInt(0)
13762 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13764 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13765 v1.AuxInt = int64ToAuxInt(63)
13767 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13768 v2.AuxInt = int32ToAuxInt(64)
13770 v.AddArg3(v0, v1, v2)
13774 func rewriteValuePPC64_OpRsh64x64(v *Value) bool {
13778 // match: (Rsh64x64 x (MOVDconst [c]))
13779 // cond: uint64(c) >= 64
13780 // result: (SRADconst x [63])
13783 if v_1.Op != OpPPC64MOVDconst {
13786 c := auxIntToInt64(v_1.AuxInt)
13787 if !(uint64(c) >= 64) {
13790 v.reset(OpPPC64SRADconst)
13791 v.AuxInt = int64ToAuxInt(63)
13795 // match: (Rsh64x64 x (MOVDconst [c]))
13796 // cond: uint64(c) < 64
13797 // result: (SRADconst x [c])
13800 if v_1.Op != OpPPC64MOVDconst {
13803 c := auxIntToInt64(v_1.AuxInt)
13804 if !(uint64(c) < 64) {
13807 v.reset(OpPPC64SRADconst)
13808 v.AuxInt = int64ToAuxInt(c)
13812 // match: (Rsh64x64 x y)
13813 // cond: shiftIsBounded(v)
13814 // result: (SRAD x y)
13818 if !(shiftIsBounded(v)) {
13821 v.reset(OpPPC64SRAD)
13825 // match: (Rsh64x64 <t> x y)
13826 // result: (ISEL [0] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPUconst y [64]))
13831 v.reset(OpPPC64ISEL)
13832 v.AuxInt = int32ToAuxInt(0)
13833 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13835 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13836 v1.AuxInt = int64ToAuxInt(63)
13838 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13839 v2.AuxInt = int64ToAuxInt(64)
13841 v.AddArg3(v0, v1, v2)
13845 func rewriteValuePPC64_OpRsh64x8(v *Value) bool {
13849 typ := &b.Func.Config.Types
13850 // match: (Rsh64x8 x y)
13851 // cond: shiftIsBounded(v)
13852 // result: (SRAD x y)
13856 if !(shiftIsBounded(v)) {
13859 v.reset(OpPPC64SRAD)
13863 // match: (Rsh64x8 <t> x y)
13864 // result: (ISEL [2] (SRAD <t> x y) (SRADconst <t> x [63]) (Select1 <types.TypeFlags> (ANDCCconst [0x00C0] y)))
13869 v.reset(OpPPC64ISEL)
13870 v.AuxInt = int32ToAuxInt(2)
13871 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13873 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13874 v1.AuxInt = int64ToAuxInt(63)
13876 v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13877 v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13878 v3.AuxInt = int64ToAuxInt(0x00C0)
13881 v.AddArg3(v0, v1, v2)
13885 func rewriteValuePPC64_OpRsh8Ux16(v *Value) bool {
13889 typ := &b.Func.Config.Types
13890 // match: (Rsh8Ux16 x y)
13891 // cond: shiftIsBounded(v)
13892 // result: (SRD (MOVBZreg x) y)
13896 if !(shiftIsBounded(v)) {
13899 v.reset(OpPPC64SRD)
13900 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
13905 // match: (Rsh8Ux16 <t> x y)
13906 // result: (ISEL [2] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF8] y)))
13911 v.reset(OpPPC64ISEL)
13912 v.AuxInt = int32ToAuxInt(2)
13913 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13914 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
13917 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13918 v2.AuxInt = int64ToAuxInt(0)
13919 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
13920 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
13921 v4.AuxInt = int64ToAuxInt(0xFFF8)
13924 v.AddArg3(v0, v2, v3)
13928 func rewriteValuePPC64_OpRsh8Ux32(v *Value) bool {
13932 typ := &b.Func.Config.Types
13933 // match: (Rsh8Ux32 x y)
13934 // cond: shiftIsBounded(v)
13935 // result: (SRD (MOVBZreg x) y)
13939 if !(shiftIsBounded(v)) {
13942 v.reset(OpPPC64SRD)
13943 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
13948 // match: (Rsh8Ux32 <t> x y)
13949 // result: (ISEL [0] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [8]))
13954 v.reset(OpPPC64ISEL)
13955 v.AuxInt = int32ToAuxInt(0)
13956 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13957 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
13960 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13961 v2.AuxInt = int64ToAuxInt(0)
13962 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13963 v3.AuxInt = int32ToAuxInt(8)
13965 v.AddArg3(v0, v2, v3)
13969 func rewriteValuePPC64_OpRsh8Ux64(v *Value) bool {
13973 typ := &b.Func.Config.Types
13974 // match: (Rsh8Ux64 x (MOVDconst [c]))
13975 // cond: uint64(c) < 8
13976 // result: (SRWconst (ZeroExt8to32 x) [c])
13979 if v_1.Op != OpPPC64MOVDconst {
13982 c := auxIntToInt64(v_1.AuxInt)
13983 if !(uint64(c) < 8) {
13986 v.reset(OpPPC64SRWconst)
13987 v.AuxInt = int64ToAuxInt(c)
13988 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
13993 // match: (Rsh8Ux64 x y)
13994 // cond: shiftIsBounded(v)
13995 // result: (SRD (MOVBZreg x) y)
13999 if !(shiftIsBounded(v)) {
14002 v.reset(OpPPC64SRD)
14003 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14008 // match: (Rsh8Ux64 <t> x y)
14009 // result: (ISEL [0] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [8]))
14014 v.reset(OpPPC64ISEL)
14015 v.AuxInt = int32ToAuxInt(0)
14016 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14017 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14020 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14021 v2.AuxInt = int64ToAuxInt(0)
14022 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
14023 v3.AuxInt = int64ToAuxInt(8)
14025 v.AddArg3(v0, v2, v3)
14029 func rewriteValuePPC64_OpRsh8Ux8(v *Value) bool {
14033 typ := &b.Func.Config.Types
14034 // match: (Rsh8Ux8 x y)
14035 // cond: shiftIsBounded(v)
14036 // result: (SRD (MOVBZreg x) y)
14040 if !(shiftIsBounded(v)) {
14043 v.reset(OpPPC64SRD)
14044 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14049 // match: (Rsh8Ux8 <t> x y)
14050 // result: (ISEL [2] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F8] y)))
14055 v.reset(OpPPC64ISEL)
14056 v.AuxInt = int32ToAuxInt(2)
14057 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14058 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14061 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14062 v2.AuxInt = int64ToAuxInt(0)
14063 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
14064 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
14065 v4.AuxInt = int64ToAuxInt(0x00F8)
14068 v.AddArg3(v0, v2, v3)
14072 func rewriteValuePPC64_OpRsh8x16(v *Value) bool {
14076 typ := &b.Func.Config.Types
14077 // match: (Rsh8x16 x y)
14078 // cond: shiftIsBounded(v)
14079 // result: (SRAD (MOVBreg x) y)
14083 if !(shiftIsBounded(v)) {
14086 v.reset(OpPPC64SRAD)
14087 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14092 // match: (Rsh8x16 <t> x y)
14093 // result: (ISEL [2] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF8] y)))
14098 v.reset(OpPPC64ISEL)
14099 v.AuxInt = int32ToAuxInt(2)
14100 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14101 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14104 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14105 v2.AuxInt = int64ToAuxInt(7)
14107 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
14108 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
14109 v4.AuxInt = int64ToAuxInt(0xFFF8)
14112 v.AddArg3(v0, v2, v3)
14116 func rewriteValuePPC64_OpRsh8x32(v *Value) bool {
14120 typ := &b.Func.Config.Types
14121 // match: (Rsh8x32 x y)
14122 // cond: shiftIsBounded(v)
14123 // result: (SRAD (MOVBreg x) y)
14127 if !(shiftIsBounded(v)) {
14130 v.reset(OpPPC64SRAD)
14131 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14136 // match: (Rsh8x32 <t> x y)
14137 // result: (ISEL [0] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPWUconst y [8]))
14142 v.reset(OpPPC64ISEL)
14143 v.AuxInt = int32ToAuxInt(0)
14144 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14145 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14148 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14149 v2.AuxInt = int64ToAuxInt(7)
14151 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
14152 v3.AuxInt = int32ToAuxInt(8)
14154 v.AddArg3(v0, v2, v3)
14158 func rewriteValuePPC64_OpRsh8x64(v *Value) bool {
14162 typ := &b.Func.Config.Types
14163 // match: (Rsh8x64 x (MOVDconst [c]))
14164 // cond: uint64(c) >= 8
14165 // result: (SRAWconst (SignExt8to32 x) [63])
14168 if v_1.Op != OpPPC64MOVDconst {
14171 c := auxIntToInt64(v_1.AuxInt)
14172 if !(uint64(c) >= 8) {
14175 v.reset(OpPPC64SRAWconst)
14176 v.AuxInt = int64ToAuxInt(63)
14177 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
14182 // match: (Rsh8x64 x (MOVDconst [c]))
14183 // cond: uint64(c) < 8
14184 // result: (SRAWconst (SignExt8to32 x) [c])
14187 if v_1.Op != OpPPC64MOVDconst {
14190 c := auxIntToInt64(v_1.AuxInt)
14191 if !(uint64(c) < 8) {
14194 v.reset(OpPPC64SRAWconst)
14195 v.AuxInt = int64ToAuxInt(c)
14196 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
14201 // match: (Rsh8x64 x y)
14202 // cond: shiftIsBounded(v)
14203 // result: (SRAD (MOVBreg x) y)
14207 if !(shiftIsBounded(v)) {
14210 v.reset(OpPPC64SRAD)
14211 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14216 // match: (Rsh8x64 <t> x y)
14217 // result: (ISEL [0] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPUconst y [8]))
14222 v.reset(OpPPC64ISEL)
14223 v.AuxInt = int32ToAuxInt(0)
14224 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14225 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14228 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14229 v2.AuxInt = int64ToAuxInt(7)
14231 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
14232 v3.AuxInt = int64ToAuxInt(8)
14234 v.AddArg3(v0, v2, v3)
14238 func rewriteValuePPC64_OpRsh8x8(v *Value) bool {
14242 typ := &b.Func.Config.Types
14243 // match: (Rsh8x8 x y)
14244 // cond: shiftIsBounded(v)
14245 // result: (SRAD (MOVBreg x) y)
14249 if !(shiftIsBounded(v)) {
14252 v.reset(OpPPC64SRAD)
14253 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14258 // match: (Rsh8x8 <t> x y)
14259 // result: (ISEL [2] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F8] y)))
14264 v.reset(OpPPC64ISEL)
14265 v.AuxInt = int32ToAuxInt(2)
14266 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14267 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14270 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14271 v2.AuxInt = int64ToAuxInt(7)
14273 v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
14274 v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
14275 v4.AuxInt = int64ToAuxInt(0x00F8)
14278 v.AddArg3(v0, v2, v3)
14282 func rewriteValuePPC64_OpSelect0(v *Value) bool {
14285 typ := &b.Func.Config.Types
14286 // match: (Select0 (Mul64uhilo x y))
14287 // result: (MULHDU x y)
14289 if v_0.Op != OpMul64uhilo {
14294 v.reset(OpPPC64MULHDU)
14298 // match: (Select0 (Add64carry x y c))
14299 // result: (Select0 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1]))))
14301 if v_0.Op != OpAdd64carry {
14308 v.Type = typ.UInt64
14309 v0 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
14310 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14311 v2 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14312 v2.AuxInt = int64ToAuxInt(-1)
14315 v0.AddArg3(x, y, v1)
14319 // match: (Select0 (Sub64borrow x y c))
14320 // result: (Select0 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0]))))
14322 if v_0.Op != OpSub64borrow {
14329 v.Type = typ.UInt64
14330 v0 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
14331 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14332 v2 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14333 v2.AuxInt = int64ToAuxInt(0)
14336 v0.AddArg3(x, y, v1)
14340 // match: (Select0 (ANDCCconst [m] (ROTLWconst [r] x)))
14341 // cond: isPPC64WordRotateMask(m)
14342 // result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
14344 if v_0.Op != OpPPC64ANDCCconst {
14347 m := auxIntToInt64(v_0.AuxInt)
14348 v_0_0 := v_0.Args[0]
14349 if v_0_0.Op != OpPPC64ROTLWconst {
14352 r := auxIntToInt64(v_0_0.AuxInt)
14354 if !(isPPC64WordRotateMask(m)) {
14357 v.reset(OpPPC64RLWINM)
14358 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
14362 // match: (Select0 (ANDCCconst [m] (ROTLW x r)))
14363 // cond: isPPC64WordRotateMask(m)
14364 // result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
14366 if v_0.Op != OpPPC64ANDCCconst {
14369 m := auxIntToInt64(v_0.AuxInt)
14370 v_0_0 := v_0.Args[0]
14371 if v_0_0.Op != OpPPC64ROTLW {
14376 if !(isPPC64WordRotateMask(m)) {
14379 v.reset(OpPPC64RLWNM)
14380 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
14384 // match: (Select0 (ANDCCconst [m] (SRWconst x [s])))
14385 // cond: mergePPC64RShiftMask(m,s,32) == 0
14386 // result: (MOVDconst [0])
14388 if v_0.Op != OpPPC64ANDCCconst {
14391 m := auxIntToInt64(v_0.AuxInt)
14392 v_0_0 := v_0.Args[0]
14393 if v_0_0.Op != OpPPC64SRWconst {
14396 s := auxIntToInt64(v_0_0.AuxInt)
14397 if !(mergePPC64RShiftMask(m, s, 32) == 0) {
14400 v.reset(OpPPC64MOVDconst)
14401 v.AuxInt = int64ToAuxInt(0)
14404 // match: (Select0 (ANDCCconst [m] (SRWconst x [s])))
14405 // cond: mergePPC64AndSrwi(m,s) != 0
14406 // result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
14408 if v_0.Op != OpPPC64ANDCCconst {
14411 m := auxIntToInt64(v_0.AuxInt)
14412 v_0_0 := v_0.Args[0]
14413 if v_0_0.Op != OpPPC64SRWconst {
14416 s := auxIntToInt64(v_0_0.AuxInt)
14418 if !(mergePPC64AndSrwi(m, s) != 0) {
14421 v.reset(OpPPC64RLWINM)
14422 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
14426 // match: (Select0 (ANDCCconst [-1] x))
14429 if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != -1 {
14436 // match: (Select0 (ANDCCconst [0] _))
14437 // result: (MOVDconst [0])
14439 if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != 0 {
14442 v.reset(OpPPC64MOVDconst)
14443 v.AuxInt = int64ToAuxInt(0)
14446 // match: (Select0 (ANDCCconst [c] y:(MOVBZreg _)))
14447 // cond: c&0xFF == 0xFF
14450 if v_0.Op != OpPPC64ANDCCconst {
14453 c := auxIntToInt64(v_0.AuxInt)
14455 if y.Op != OpPPC64MOVBZreg || !(c&0xFF == 0xFF) {
14461 // match: (Select0 (ANDCCconst [0xFF] (MOVBreg x)))
14462 // result: (MOVBZreg x)
14464 if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != 0xFF {
14467 v_0_0 := v_0.Args[0]
14468 if v_0_0.Op != OpPPC64MOVBreg {
14472 v.reset(OpPPC64MOVBZreg)
14476 // match: (Select0 (ANDCCconst [c] y:(MOVHZreg _)))
14477 // cond: c&0xFFFF == 0xFFFF
14480 if v_0.Op != OpPPC64ANDCCconst {
14483 c := auxIntToInt64(v_0.AuxInt)
14485 if y.Op != OpPPC64MOVHZreg || !(c&0xFFFF == 0xFFFF) {
14491 // match: (Select0 (ANDCCconst [0xFFFF] (MOVHreg x)))
14492 // result: (MOVHZreg x)
14494 if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != 0xFFFF {
14497 v_0_0 := v_0.Args[0]
14498 if v_0_0.Op != OpPPC64MOVHreg {
14502 v.reset(OpPPC64MOVHZreg)
14506 // match: (Select0 (ANDCCconst [c] (MOVBZreg x)))
14507 // result: (Select0 (ANDCCconst [c&0xFF] x))
14509 if v_0.Op != OpPPC64ANDCCconst {
14512 c := auxIntToInt64(v_0.AuxInt)
14513 v_0_0 := v_0.Args[0]
14514 if v_0_0.Op != OpPPC64MOVBZreg {
14519 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
14520 v0.AuxInt = int64ToAuxInt(c & 0xFF)
14525 // match: (Select0 (ANDCCconst [c] (MOVHZreg x)))
14526 // result: (Select0 (ANDCCconst [c&0xFFFF] x))
14528 if v_0.Op != OpPPC64ANDCCconst {
14531 c := auxIntToInt64(v_0.AuxInt)
14532 v_0_0 := v_0.Args[0]
14533 if v_0_0.Op != OpPPC64MOVHZreg {
14538 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
14539 v0.AuxInt = int64ToAuxInt(c & 0xFFFF)
14544 // match: (Select0 (ANDCCconst [c] (MOVWZreg x)))
14545 // result: (Select0 (ANDCCconst [c&0xFFFFFFFF] x))
14547 if v_0.Op != OpPPC64ANDCCconst {
14550 c := auxIntToInt64(v_0.AuxInt)
14551 v_0_0 := v_0.Args[0]
14552 if v_0_0.Op != OpPPC64MOVWZreg {
14557 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
14558 v0.AuxInt = int64ToAuxInt(c & 0xFFFFFFFF)
14565 func rewriteValuePPC64_OpSelect1(v *Value) bool {
14568 typ := &b.Func.Config.Types
14569 // match: (Select1 (Mul64uhilo x y))
14570 // result: (MULLD x y)
14572 if v_0.Op != OpMul64uhilo {
14577 v.reset(OpPPC64MULLD)
14581 // match: (Select1 (Add64carry x y c))
14582 // result: (ADDZEzero (Select1 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1])))))
14584 if v_0.Op != OpAdd64carry {
14590 v.reset(OpPPC64ADDZEzero)
14591 v0 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14592 v1 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
14593 v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14594 v3 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14595 v3.AuxInt = int64ToAuxInt(-1)
14598 v1.AddArg3(x, y, v2)
14603 // match: (Select1 (ADDCconst n:(ADDZEzero x) [-1]))
14604 // cond: n.Uses <= 2
14607 if v_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_0.AuxInt) != -1 {
14611 if n.Op != OpPPC64ADDZEzero {
14615 if !(n.Uses <= 2) {
14621 // match: (Select1 (Sub64borrow x y c))
14622 // result: (NEG (SUBZEzero (Select1 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0]))))))
14624 if v_0.Op != OpSub64borrow {
14630 v.reset(OpPPC64NEG)
14631 v0 := b.NewValue0(v.Pos, OpPPC64SUBZEzero, typ.UInt64)
14632 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14633 v2 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
14634 v3 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14635 v4 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14636 v4.AuxInt = int64ToAuxInt(0)
14639 v2.AddArg3(x, y, v3)
14645 // match: (Select1 (SUBCconst n:(NEG (SUBZEzero x)) [0]))
14646 // cond: n.Uses <= 2
14649 if v_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_0.AuxInt) != 0 {
14653 if n.Op != OpPPC64NEG {
14657 if n_0.Op != OpPPC64SUBZEzero {
14661 if !(n.Uses <= 2) {
14667 // match: (Select1 (ANDCCconst [0] _))
14668 // result: (FlagEQ)
14670 if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != 0 {
14673 v.reset(OpPPC64FlagEQ)
14678 func rewriteValuePPC64_OpSelectN(v *Value) bool {
14681 config := b.Func.Config
14682 // match: (SelectN [0] call:(CALLstatic {sym} s1:(MOVDstore _ (MOVDconst [sz]) s2:(MOVDstore _ src s3:(MOVDstore {t} _ dst mem)))))
14683 // 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)
14684 // result: (Move [sz] dst src mem)
14686 if auxIntToInt64(v.AuxInt) != 0 {
14690 if call.Op != OpPPC64CALLstatic || len(call.Args) != 1 {
14693 sym := auxToCall(call.Aux)
14695 if s1.Op != OpPPC64MOVDstore {
14700 if s1_1.Op != OpPPC64MOVDconst {
14703 sz := auxIntToInt64(s1_1.AuxInt)
14705 if s2.Op != OpPPC64MOVDstore {
14711 if s3.Op != OpPPC64MOVDstore {
14716 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)) {
14720 v.AuxInt = int64ToAuxInt(sz)
14721 v.AddArg3(dst, src, mem)
14724 // match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVDconst [sz]) mem))
14725 // cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)
14726 // result: (Move [sz] dst src mem)
14728 if auxIntToInt64(v.AuxInt) != 0 {
14732 if call.Op != OpPPC64CALLstatic || len(call.Args) != 4 {
14735 sym := auxToCall(call.Aux)
14736 mem := call.Args[3]
14737 dst := call.Args[0]
14738 src := call.Args[1]
14739 call_2 := call.Args[2]
14740 if call_2.Op != OpPPC64MOVDconst {
14743 sz := auxIntToInt64(call_2.AuxInt)
14744 if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
14748 v.AuxInt = int64ToAuxInt(sz)
14749 v.AddArg3(dst, src, mem)
14754 func rewriteValuePPC64_OpSlicemask(v *Value) bool {
14757 // match: (Slicemask <t> x)
14758 // result: (SRADconst (NEG <t> x) [63])
14762 v.reset(OpPPC64SRADconst)
14763 v.AuxInt = int64ToAuxInt(63)
14764 v0 := b.NewValue0(v.Pos, OpPPC64NEG, t)
14770 func rewriteValuePPC64_OpStore(v *Value) bool {
14774 // match: (Store {t} ptr val mem)
14775 // cond: t.Size() == 8 && t.IsFloat()
14776 // result: (FMOVDstore ptr val mem)
14778 t := auxToType(v.Aux)
14782 if !(t.Size() == 8 && t.IsFloat()) {
14785 v.reset(OpPPC64FMOVDstore)
14786 v.AddArg3(ptr, val, mem)
14789 // match: (Store {t} ptr val mem)
14790 // cond: t.Size() == 4 && t.IsFloat()
14791 // result: (FMOVSstore ptr val mem)
14793 t := auxToType(v.Aux)
14797 if !(t.Size() == 4 && t.IsFloat()) {
14800 v.reset(OpPPC64FMOVSstore)
14801 v.AddArg3(ptr, val, mem)
14804 // match: (Store {t} ptr val mem)
14805 // cond: t.Size() == 8 && !t.IsFloat()
14806 // result: (MOVDstore ptr val mem)
14808 t := auxToType(v.Aux)
14812 if !(t.Size() == 8 && !t.IsFloat()) {
14815 v.reset(OpPPC64MOVDstore)
14816 v.AddArg3(ptr, val, mem)
14819 // match: (Store {t} ptr val mem)
14820 // cond: t.Size() == 4 && !t.IsFloat()
14821 // result: (MOVWstore ptr val mem)
14823 t := auxToType(v.Aux)
14827 if !(t.Size() == 4 && !t.IsFloat()) {
14830 v.reset(OpPPC64MOVWstore)
14831 v.AddArg3(ptr, val, mem)
14834 // match: (Store {t} ptr val mem)
14835 // cond: t.Size() == 2
14836 // result: (MOVHstore ptr val mem)
14838 t := auxToType(v.Aux)
14842 if !(t.Size() == 2) {
14845 v.reset(OpPPC64MOVHstore)
14846 v.AddArg3(ptr, val, mem)
14849 // match: (Store {t} ptr val mem)
14850 // cond: t.Size() == 1
14851 // result: (MOVBstore ptr val mem)
14853 t := auxToType(v.Aux)
14857 if !(t.Size() == 1) {
14860 v.reset(OpPPC64MOVBstore)
14861 v.AddArg3(ptr, val, mem)
14866 func rewriteValuePPC64_OpTrunc16to8(v *Value) bool {
14868 // match: (Trunc16to8 <t> x)
14869 // cond: t.IsSigned()
14870 // result: (MOVBreg x)
14874 if !(t.IsSigned()) {
14877 v.reset(OpPPC64MOVBreg)
14881 // match: (Trunc16to8 x)
14882 // result: (MOVBZreg x)
14885 v.reset(OpPPC64MOVBZreg)
14890 func rewriteValuePPC64_OpTrunc32to16(v *Value) bool {
14892 // match: (Trunc32to16 <t> x)
14893 // cond: t.IsSigned()
14894 // result: (MOVHreg x)
14898 if !(t.IsSigned()) {
14901 v.reset(OpPPC64MOVHreg)
14905 // match: (Trunc32to16 x)
14906 // result: (MOVHZreg x)
14909 v.reset(OpPPC64MOVHZreg)
14914 func rewriteValuePPC64_OpTrunc32to8(v *Value) bool {
14916 // match: (Trunc32to8 <t> x)
14917 // cond: t.IsSigned()
14918 // result: (MOVBreg x)
14922 if !(t.IsSigned()) {
14925 v.reset(OpPPC64MOVBreg)
14929 // match: (Trunc32to8 x)
14930 // result: (MOVBZreg x)
14933 v.reset(OpPPC64MOVBZreg)
14938 func rewriteValuePPC64_OpTrunc64to16(v *Value) bool {
14940 // match: (Trunc64to16 <t> x)
14941 // cond: t.IsSigned()
14942 // result: (MOVHreg x)
14946 if !(t.IsSigned()) {
14949 v.reset(OpPPC64MOVHreg)
14953 // match: (Trunc64to16 x)
14954 // result: (MOVHZreg x)
14957 v.reset(OpPPC64MOVHZreg)
14962 func rewriteValuePPC64_OpTrunc64to32(v *Value) bool {
14964 // match: (Trunc64to32 <t> x)
14965 // cond: t.IsSigned()
14966 // result: (MOVWreg x)
14970 if !(t.IsSigned()) {
14973 v.reset(OpPPC64MOVWreg)
14977 // match: (Trunc64to32 x)
14978 // result: (MOVWZreg x)
14981 v.reset(OpPPC64MOVWZreg)
14986 func rewriteValuePPC64_OpTrunc64to8(v *Value) bool {
14988 // match: (Trunc64to8 <t> x)
14989 // cond: t.IsSigned()
14990 // result: (MOVBreg x)
14994 if !(t.IsSigned()) {
14997 v.reset(OpPPC64MOVBreg)
15001 // match: (Trunc64to8 x)
15002 // result: (MOVBZreg x)
15005 v.reset(OpPPC64MOVBZreg)
15010 func rewriteValuePPC64_OpZero(v *Value) bool {
15014 // match: (Zero [0] _ mem)
15017 if auxIntToInt64(v.AuxInt) != 0 {
15024 // match: (Zero [1] destptr mem)
15025 // result: (MOVBstorezero destptr mem)
15027 if auxIntToInt64(v.AuxInt) != 1 {
15032 v.reset(OpPPC64MOVBstorezero)
15033 v.AddArg2(destptr, mem)
15036 // match: (Zero [2] destptr mem)
15037 // result: (MOVHstorezero destptr mem)
15039 if auxIntToInt64(v.AuxInt) != 2 {
15044 v.reset(OpPPC64MOVHstorezero)
15045 v.AddArg2(destptr, mem)
15048 // match: (Zero [3] destptr mem)
15049 // result: (MOVBstorezero [2] destptr (MOVHstorezero destptr mem))
15051 if auxIntToInt64(v.AuxInt) != 3 {
15056 v.reset(OpPPC64MOVBstorezero)
15057 v.AuxInt = int32ToAuxInt(2)
15058 v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
15059 v0.AddArg2(destptr, mem)
15060 v.AddArg2(destptr, v0)
15063 // match: (Zero [4] destptr mem)
15064 // result: (MOVWstorezero destptr mem)
15066 if auxIntToInt64(v.AuxInt) != 4 {
15071 v.reset(OpPPC64MOVWstorezero)
15072 v.AddArg2(destptr, mem)
15075 // match: (Zero [5] destptr mem)
15076 // result: (MOVBstorezero [4] destptr (MOVWstorezero destptr mem))
15078 if auxIntToInt64(v.AuxInt) != 5 {
15083 v.reset(OpPPC64MOVBstorezero)
15084 v.AuxInt = int32ToAuxInt(4)
15085 v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
15086 v0.AddArg2(destptr, mem)
15087 v.AddArg2(destptr, v0)
15090 // match: (Zero [6] destptr mem)
15091 // result: (MOVHstorezero [4] destptr (MOVWstorezero destptr mem))
15093 if auxIntToInt64(v.AuxInt) != 6 {
15098 v.reset(OpPPC64MOVHstorezero)
15099 v.AuxInt = int32ToAuxInt(4)
15100 v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
15101 v0.AddArg2(destptr, mem)
15102 v.AddArg2(destptr, v0)
15105 // match: (Zero [7] destptr mem)
15106 // result: (MOVBstorezero [6] destptr (MOVHstorezero [4] destptr (MOVWstorezero destptr mem)))
15108 if auxIntToInt64(v.AuxInt) != 7 {
15113 v.reset(OpPPC64MOVBstorezero)
15114 v.AuxInt = int32ToAuxInt(6)
15115 v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
15116 v0.AuxInt = int32ToAuxInt(4)
15117 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
15118 v1.AddArg2(destptr, mem)
15119 v0.AddArg2(destptr, v1)
15120 v.AddArg2(destptr, v0)
15123 // match: (Zero [8] {t} destptr mem)
15124 // result: (MOVDstorezero destptr mem)
15126 if auxIntToInt64(v.AuxInt) != 8 {
15131 v.reset(OpPPC64MOVDstorezero)
15132 v.AddArg2(destptr, mem)
15135 // match: (Zero [12] {t} destptr mem)
15136 // result: (MOVWstorezero [8] destptr (MOVDstorezero [0] destptr mem))
15138 if auxIntToInt64(v.AuxInt) != 12 {
15143 v.reset(OpPPC64MOVWstorezero)
15144 v.AuxInt = int32ToAuxInt(8)
15145 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15146 v0.AuxInt = int32ToAuxInt(0)
15147 v0.AddArg2(destptr, mem)
15148 v.AddArg2(destptr, v0)
15151 // match: (Zero [16] {t} destptr mem)
15152 // result: (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))
15154 if auxIntToInt64(v.AuxInt) != 16 {
15159 v.reset(OpPPC64MOVDstorezero)
15160 v.AuxInt = int32ToAuxInt(8)
15161 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15162 v0.AuxInt = int32ToAuxInt(0)
15163 v0.AddArg2(destptr, mem)
15164 v.AddArg2(destptr, v0)
15167 // match: (Zero [24] {t} destptr mem)
15168 // result: (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem)))
15170 if auxIntToInt64(v.AuxInt) != 24 {
15175 v.reset(OpPPC64MOVDstorezero)
15176 v.AuxInt = int32ToAuxInt(16)
15177 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15178 v0.AuxInt = int32ToAuxInt(8)
15179 v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15180 v1.AuxInt = int32ToAuxInt(0)
15181 v1.AddArg2(destptr, mem)
15182 v0.AddArg2(destptr, v1)
15183 v.AddArg2(destptr, v0)
15186 // match: (Zero [32] {t} destptr mem)
15187 // result: (MOVDstorezero [24] destptr (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))))
15189 if auxIntToInt64(v.AuxInt) != 32 {
15194 v.reset(OpPPC64MOVDstorezero)
15195 v.AuxInt = int32ToAuxInt(24)
15196 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15197 v0.AuxInt = int32ToAuxInt(16)
15198 v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15199 v1.AuxInt = int32ToAuxInt(8)
15200 v2 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15201 v2.AuxInt = int32ToAuxInt(0)
15202 v2.AddArg2(destptr, mem)
15203 v1.AddArg2(destptr, v2)
15204 v0.AddArg2(destptr, v1)
15205 v.AddArg2(destptr, v0)
15208 // match: (Zero [s] ptr mem)
15209 // cond: buildcfg.GOPPC64 <= 8 && s < 64
15210 // result: (LoweredZeroShort [s] ptr mem)
15212 s := auxIntToInt64(v.AuxInt)
15215 if !(buildcfg.GOPPC64 <= 8 && s < 64) {
15218 v.reset(OpPPC64LoweredZeroShort)
15219 v.AuxInt = int64ToAuxInt(s)
15220 v.AddArg2(ptr, mem)
15223 // match: (Zero [s] ptr mem)
15224 // cond: buildcfg.GOPPC64 <= 8
15225 // result: (LoweredZero [s] ptr mem)
15227 s := auxIntToInt64(v.AuxInt)
15230 if !(buildcfg.GOPPC64 <= 8) {
15233 v.reset(OpPPC64LoweredZero)
15234 v.AuxInt = int64ToAuxInt(s)
15235 v.AddArg2(ptr, mem)
15238 // match: (Zero [s] ptr mem)
15239 // cond: s < 128 && buildcfg.GOPPC64 >= 9
15240 // result: (LoweredQuadZeroShort [s] ptr mem)
15242 s := auxIntToInt64(v.AuxInt)
15245 if !(s < 128 && buildcfg.GOPPC64 >= 9) {
15248 v.reset(OpPPC64LoweredQuadZeroShort)
15249 v.AuxInt = int64ToAuxInt(s)
15250 v.AddArg2(ptr, mem)
15253 // match: (Zero [s] ptr mem)
15254 // cond: buildcfg.GOPPC64 >= 9
15255 // result: (LoweredQuadZero [s] ptr mem)
15257 s := auxIntToInt64(v.AuxInt)
15260 if !(buildcfg.GOPPC64 >= 9) {
15263 v.reset(OpPPC64LoweredQuadZero)
15264 v.AuxInt = int64ToAuxInt(s)
15265 v.AddArg2(ptr, mem)
15270 func rewriteBlockPPC64(b *Block) bool {
15271 typ := &b.Func.Config.Types
15274 // match: (EQ (FlagEQ) yes no)
15275 // result: (First yes no)
15276 for b.Controls[0].Op == OpPPC64FlagEQ {
15277 b.Reset(BlockFirst)
15280 // match: (EQ (FlagLT) yes no)
15281 // result: (First no yes)
15282 for b.Controls[0].Op == OpPPC64FlagLT {
15283 b.Reset(BlockFirst)
15287 // match: (EQ (FlagGT) yes no)
15288 // result: (First no yes)
15289 for b.Controls[0].Op == OpPPC64FlagGT {
15290 b.Reset(BlockFirst)
15294 // match: (EQ (InvertFlags cmp) yes no)
15295 // result: (EQ cmp yes no)
15296 for b.Controls[0].Op == OpPPC64InvertFlags {
15297 v_0 := b.Controls[0]
15299 b.resetWithControl(BlockPPC64EQ, cmp)
15302 // match: (EQ (CMPconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
15303 // result: (EQ (Select1 <types.TypeFlags> z) yes no)
15304 for b.Controls[0].Op == OpPPC64CMPconst {
15305 v_0 := b.Controls[0]
15306 if auxIntToInt64(v_0.AuxInt) != 0 {
15309 v_0_0 := v_0.Args[0]
15310 if v_0_0.Op != OpSelect0 {
15314 if z.Op != OpPPC64ANDCCconst {
15317 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15319 b.resetWithControl(BlockPPC64EQ, v0)
15322 // match: (EQ (CMPWconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
15323 // result: (EQ (Select1 <types.TypeFlags> z) yes no)
15324 for b.Controls[0].Op == OpPPC64CMPWconst {
15325 v_0 := b.Controls[0]
15326 if auxIntToInt32(v_0.AuxInt) != 0 {
15329 v_0_0 := v_0.Args[0]
15330 if v_0_0.Op != OpSelect0 {
15334 if z.Op != OpPPC64ANDCCconst {
15337 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15339 b.resetWithControl(BlockPPC64EQ, v0)
15342 // match: (EQ (CMPconst [0] z:(AND x y)) yes no)
15343 // cond: z.Uses == 1
15344 // result: (EQ (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
15345 for b.Controls[0].Op == OpPPC64CMPconst {
15346 v_0 := b.Controls[0]
15347 if auxIntToInt64(v_0.AuxInt) != 0 {
15351 if z.Op != OpPPC64AND {
15357 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15360 if !(z.Uses == 1) {
15363 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15364 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15367 b.resetWithControl(BlockPPC64EQ, v0)
15372 // match: (EQ (CMPconst [0] z:(OR x y)) yes no)
15373 // cond: z.Uses == 1
15374 // result: (EQ (Select1 <types.TypeFlags> (ORCC x y)) yes no)
15375 for b.Controls[0].Op == OpPPC64CMPconst {
15376 v_0 := b.Controls[0]
15377 if auxIntToInt64(v_0.AuxInt) != 0 {
15381 if z.Op != OpPPC64OR {
15387 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15390 if !(z.Uses == 1) {
15393 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15394 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
15397 b.resetWithControl(BlockPPC64EQ, v0)
15402 // match: (EQ (CMPconst [0] z:(XOR x y)) yes no)
15403 // cond: z.Uses == 1
15404 // result: (EQ (Select1 <types.TypeFlags> (XORCC x y)) yes no)
15405 for b.Controls[0].Op == OpPPC64CMPconst {
15406 v_0 := b.Controls[0]
15407 if auxIntToInt64(v_0.AuxInt) != 0 {
15411 if z.Op != OpPPC64XOR {
15417 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15420 if !(z.Uses == 1) {
15423 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15424 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
15427 b.resetWithControl(BlockPPC64EQ, v0)
15433 // match: (GE (FlagEQ) yes no)
15434 // result: (First yes no)
15435 for b.Controls[0].Op == OpPPC64FlagEQ {
15436 b.Reset(BlockFirst)
15439 // match: (GE (FlagLT) yes no)
15440 // result: (First no yes)
15441 for b.Controls[0].Op == OpPPC64FlagLT {
15442 b.Reset(BlockFirst)
15446 // match: (GE (FlagGT) yes no)
15447 // result: (First yes no)
15448 for b.Controls[0].Op == OpPPC64FlagGT {
15449 b.Reset(BlockFirst)
15452 // match: (GE (InvertFlags cmp) yes no)
15453 // result: (LE cmp yes no)
15454 for b.Controls[0].Op == OpPPC64InvertFlags {
15455 v_0 := b.Controls[0]
15457 b.resetWithControl(BlockPPC64LE, cmp)
15460 // match: (GE (CMPconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
15461 // result: (GE (Select1 <types.TypeFlags> z) yes no)
15462 for b.Controls[0].Op == OpPPC64CMPconst {
15463 v_0 := b.Controls[0]
15464 if auxIntToInt64(v_0.AuxInt) != 0 {
15467 v_0_0 := v_0.Args[0]
15468 if v_0_0.Op != OpSelect0 {
15472 if z.Op != OpPPC64ANDCCconst {
15475 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15477 b.resetWithControl(BlockPPC64GE, v0)
15480 // match: (GE (CMPWconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
15481 // result: (GE (Select1 <types.TypeFlags> z) yes no)
15482 for b.Controls[0].Op == OpPPC64CMPWconst {
15483 v_0 := b.Controls[0]
15484 if auxIntToInt32(v_0.AuxInt) != 0 {
15487 v_0_0 := v_0.Args[0]
15488 if v_0_0.Op != OpSelect0 {
15492 if z.Op != OpPPC64ANDCCconst {
15495 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15497 b.resetWithControl(BlockPPC64GE, v0)
15500 // match: (GE (CMPconst [0] z:(AND x y)) yes no)
15501 // cond: z.Uses == 1
15502 // result: (GE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
15503 for b.Controls[0].Op == OpPPC64CMPconst {
15504 v_0 := b.Controls[0]
15505 if auxIntToInt64(v_0.AuxInt) != 0 {
15509 if z.Op != OpPPC64AND {
15515 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15518 if !(z.Uses == 1) {
15521 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15522 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15525 b.resetWithControl(BlockPPC64GE, v0)
15530 // match: (GE (CMPconst [0] z:(OR x y)) yes no)
15531 // cond: z.Uses == 1
15532 // result: (GE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
15533 for b.Controls[0].Op == OpPPC64CMPconst {
15534 v_0 := b.Controls[0]
15535 if auxIntToInt64(v_0.AuxInt) != 0 {
15539 if z.Op != OpPPC64OR {
15545 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15548 if !(z.Uses == 1) {
15551 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15552 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
15555 b.resetWithControl(BlockPPC64GE, v0)
15560 // match: (GE (CMPconst [0] z:(XOR x y)) yes no)
15561 // cond: z.Uses == 1
15562 // result: (GE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
15563 for b.Controls[0].Op == OpPPC64CMPconst {
15564 v_0 := b.Controls[0]
15565 if auxIntToInt64(v_0.AuxInt) != 0 {
15569 if z.Op != OpPPC64XOR {
15575 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15578 if !(z.Uses == 1) {
15581 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15582 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
15585 b.resetWithControl(BlockPPC64GE, v0)
15591 // match: (GT (FlagEQ) yes no)
15592 // result: (First no yes)
15593 for b.Controls[0].Op == OpPPC64FlagEQ {
15594 b.Reset(BlockFirst)
15598 // match: (GT (FlagLT) yes no)
15599 // result: (First no yes)
15600 for b.Controls[0].Op == OpPPC64FlagLT {
15601 b.Reset(BlockFirst)
15605 // match: (GT (FlagGT) yes no)
15606 // result: (First yes no)
15607 for b.Controls[0].Op == OpPPC64FlagGT {
15608 b.Reset(BlockFirst)
15611 // match: (GT (InvertFlags cmp) yes no)
15612 // result: (LT cmp yes no)
15613 for b.Controls[0].Op == OpPPC64InvertFlags {
15614 v_0 := b.Controls[0]
15616 b.resetWithControl(BlockPPC64LT, cmp)
15619 // match: (GT (CMPconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
15620 // result: (GT (Select1 <types.TypeFlags> z) yes no)
15621 for b.Controls[0].Op == OpPPC64CMPconst {
15622 v_0 := b.Controls[0]
15623 if auxIntToInt64(v_0.AuxInt) != 0 {
15626 v_0_0 := v_0.Args[0]
15627 if v_0_0.Op != OpSelect0 {
15631 if z.Op != OpPPC64ANDCCconst {
15634 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15636 b.resetWithControl(BlockPPC64GT, v0)
15639 // match: (GT (CMPWconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
15640 // result: (GT (Select1 <types.TypeFlags> z) yes no)
15641 for b.Controls[0].Op == OpPPC64CMPWconst {
15642 v_0 := b.Controls[0]
15643 if auxIntToInt32(v_0.AuxInt) != 0 {
15646 v_0_0 := v_0.Args[0]
15647 if v_0_0.Op != OpSelect0 {
15651 if z.Op != OpPPC64ANDCCconst {
15654 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15656 b.resetWithControl(BlockPPC64GT, v0)
15659 // match: (GT (CMPconst [0] z:(AND x y)) yes no)
15660 // cond: z.Uses == 1
15661 // result: (GT (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
15662 for b.Controls[0].Op == OpPPC64CMPconst {
15663 v_0 := b.Controls[0]
15664 if auxIntToInt64(v_0.AuxInt) != 0 {
15668 if z.Op != OpPPC64AND {
15674 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15677 if !(z.Uses == 1) {
15680 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15681 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15684 b.resetWithControl(BlockPPC64GT, v0)
15689 // match: (GT (CMPconst [0] z:(OR x y)) yes no)
15690 // cond: z.Uses == 1
15691 // result: (GT (Select1 <types.TypeFlags> (ORCC x y)) yes no)
15692 for b.Controls[0].Op == OpPPC64CMPconst {
15693 v_0 := b.Controls[0]
15694 if auxIntToInt64(v_0.AuxInt) != 0 {
15698 if z.Op != OpPPC64OR {
15704 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15707 if !(z.Uses == 1) {
15710 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15711 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
15714 b.resetWithControl(BlockPPC64GT, v0)
15719 // match: (GT (CMPconst [0] z:(XOR x y)) yes no)
15720 // cond: z.Uses == 1
15721 // result: (GT (Select1 <types.TypeFlags> (XORCC x y)) yes no)
15722 for b.Controls[0].Op == OpPPC64CMPconst {
15723 v_0 := b.Controls[0]
15724 if auxIntToInt64(v_0.AuxInt) != 0 {
15728 if z.Op != OpPPC64XOR {
15734 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15737 if !(z.Uses == 1) {
15740 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15741 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
15744 b.resetWithControl(BlockPPC64GT, v0)
15750 // match: (If (Equal cc) yes no)
15751 // result: (EQ cc yes no)
15752 for b.Controls[0].Op == OpPPC64Equal {
15753 v_0 := b.Controls[0]
15755 b.resetWithControl(BlockPPC64EQ, cc)
15758 // match: (If (NotEqual cc) yes no)
15759 // result: (NE cc yes no)
15760 for b.Controls[0].Op == OpPPC64NotEqual {
15761 v_0 := b.Controls[0]
15763 b.resetWithControl(BlockPPC64NE, cc)
15766 // match: (If (LessThan cc) yes no)
15767 // result: (LT cc yes no)
15768 for b.Controls[0].Op == OpPPC64LessThan {
15769 v_0 := b.Controls[0]
15771 b.resetWithControl(BlockPPC64LT, cc)
15774 // match: (If (LessEqual cc) yes no)
15775 // result: (LE cc yes no)
15776 for b.Controls[0].Op == OpPPC64LessEqual {
15777 v_0 := b.Controls[0]
15779 b.resetWithControl(BlockPPC64LE, cc)
15782 // match: (If (GreaterThan cc) yes no)
15783 // result: (GT cc yes no)
15784 for b.Controls[0].Op == OpPPC64GreaterThan {
15785 v_0 := b.Controls[0]
15787 b.resetWithControl(BlockPPC64GT, cc)
15790 // match: (If (GreaterEqual cc) yes no)
15791 // result: (GE cc yes no)
15792 for b.Controls[0].Op == OpPPC64GreaterEqual {
15793 v_0 := b.Controls[0]
15795 b.resetWithControl(BlockPPC64GE, cc)
15798 // match: (If (FLessThan cc) yes no)
15799 // result: (FLT cc yes no)
15800 for b.Controls[0].Op == OpPPC64FLessThan {
15801 v_0 := b.Controls[0]
15803 b.resetWithControl(BlockPPC64FLT, cc)
15806 // match: (If (FLessEqual cc) yes no)
15807 // result: (FLE cc yes no)
15808 for b.Controls[0].Op == OpPPC64FLessEqual {
15809 v_0 := b.Controls[0]
15811 b.resetWithControl(BlockPPC64FLE, cc)
15814 // match: (If (FGreaterThan cc) yes no)
15815 // result: (FGT cc yes no)
15816 for b.Controls[0].Op == OpPPC64FGreaterThan {
15817 v_0 := b.Controls[0]
15819 b.resetWithControl(BlockPPC64FGT, cc)
15822 // match: (If (FGreaterEqual cc) yes no)
15823 // result: (FGE cc yes no)
15824 for b.Controls[0].Op == OpPPC64FGreaterEqual {
15825 v_0 := b.Controls[0]
15827 b.resetWithControl(BlockPPC64FGE, cc)
15830 // match: (If cond yes no)
15831 // result: (NE (CMPWconst [0] (Select0 <typ.UInt32> (ANDCCconst [1] cond))) yes no)
15833 cond := b.Controls[0]
15834 v0 := b.NewValue0(cond.Pos, OpPPC64CMPWconst, types.TypeFlags)
15835 v0.AuxInt = int32ToAuxInt(0)
15836 v1 := b.NewValue0(cond.Pos, OpSelect0, typ.UInt32)
15837 v2 := b.NewValue0(cond.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
15838 v2.AuxInt = int64ToAuxInt(1)
15842 b.resetWithControl(BlockPPC64NE, v0)
15846 // match: (LE (FlagEQ) yes no)
15847 // result: (First yes no)
15848 for b.Controls[0].Op == OpPPC64FlagEQ {
15849 b.Reset(BlockFirst)
15852 // match: (LE (FlagLT) yes no)
15853 // result: (First yes no)
15854 for b.Controls[0].Op == OpPPC64FlagLT {
15855 b.Reset(BlockFirst)
15858 // match: (LE (FlagGT) yes no)
15859 // result: (First no yes)
15860 for b.Controls[0].Op == OpPPC64FlagGT {
15861 b.Reset(BlockFirst)
15865 // match: (LE (InvertFlags cmp) yes no)
15866 // result: (GE cmp yes no)
15867 for b.Controls[0].Op == OpPPC64InvertFlags {
15868 v_0 := b.Controls[0]
15870 b.resetWithControl(BlockPPC64GE, cmp)
15873 // match: (LE (CMPconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
15874 // result: (LE (Select1 <types.TypeFlags> z) yes no)
15875 for b.Controls[0].Op == OpPPC64CMPconst {
15876 v_0 := b.Controls[0]
15877 if auxIntToInt64(v_0.AuxInt) != 0 {
15880 v_0_0 := v_0.Args[0]
15881 if v_0_0.Op != OpSelect0 {
15885 if z.Op != OpPPC64ANDCCconst {
15888 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15890 b.resetWithControl(BlockPPC64LE, v0)
15893 // match: (LE (CMPWconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
15894 // result: (LE (Select1 <types.TypeFlags> z) yes no)
15895 for b.Controls[0].Op == OpPPC64CMPWconst {
15896 v_0 := b.Controls[0]
15897 if auxIntToInt32(v_0.AuxInt) != 0 {
15900 v_0_0 := v_0.Args[0]
15901 if v_0_0.Op != OpSelect0 {
15905 if z.Op != OpPPC64ANDCCconst {
15908 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15910 b.resetWithControl(BlockPPC64LE, v0)
15913 // match: (LE (CMPconst [0] z:(AND x y)) yes no)
15914 // cond: z.Uses == 1
15915 // result: (LE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
15916 for b.Controls[0].Op == OpPPC64CMPconst {
15917 v_0 := b.Controls[0]
15918 if auxIntToInt64(v_0.AuxInt) != 0 {
15922 if z.Op != OpPPC64AND {
15928 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15931 if !(z.Uses == 1) {
15934 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15935 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15938 b.resetWithControl(BlockPPC64LE, v0)
15943 // match: (LE (CMPconst [0] z:(OR x y)) yes no)
15944 // cond: z.Uses == 1
15945 // result: (LE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
15946 for b.Controls[0].Op == OpPPC64CMPconst {
15947 v_0 := b.Controls[0]
15948 if auxIntToInt64(v_0.AuxInt) != 0 {
15952 if z.Op != OpPPC64OR {
15958 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15961 if !(z.Uses == 1) {
15964 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15965 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
15968 b.resetWithControl(BlockPPC64LE, v0)
15973 // match: (LE (CMPconst [0] z:(XOR x y)) yes no)
15974 // cond: z.Uses == 1
15975 // result: (LE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
15976 for b.Controls[0].Op == OpPPC64CMPconst {
15977 v_0 := b.Controls[0]
15978 if auxIntToInt64(v_0.AuxInt) != 0 {
15982 if z.Op != OpPPC64XOR {
15988 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15991 if !(z.Uses == 1) {
15994 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15995 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
15998 b.resetWithControl(BlockPPC64LE, v0)
16004 // match: (LT (FlagEQ) yes no)
16005 // result: (First no yes)
16006 for b.Controls[0].Op == OpPPC64FlagEQ {
16007 b.Reset(BlockFirst)
16011 // match: (LT (FlagLT) yes no)
16012 // result: (First yes no)
16013 for b.Controls[0].Op == OpPPC64FlagLT {
16014 b.Reset(BlockFirst)
16017 // match: (LT (FlagGT) yes no)
16018 // result: (First no yes)
16019 for b.Controls[0].Op == OpPPC64FlagGT {
16020 b.Reset(BlockFirst)
16024 // match: (LT (InvertFlags cmp) yes no)
16025 // result: (GT cmp yes no)
16026 for b.Controls[0].Op == OpPPC64InvertFlags {
16027 v_0 := b.Controls[0]
16029 b.resetWithControl(BlockPPC64GT, cmp)
16032 // match: (LT (CMPconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
16033 // result: (LT (Select1 <types.TypeFlags> z) yes no)
16034 for b.Controls[0].Op == OpPPC64CMPconst {
16035 v_0 := b.Controls[0]
16036 if auxIntToInt64(v_0.AuxInt) != 0 {
16039 v_0_0 := v_0.Args[0]
16040 if v_0_0.Op != OpSelect0 {
16044 if z.Op != OpPPC64ANDCCconst {
16047 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16049 b.resetWithControl(BlockPPC64LT, v0)
16052 // match: (LT (CMPWconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
16053 // result: (LT (Select1 <types.TypeFlags> z) yes no)
16054 for b.Controls[0].Op == OpPPC64CMPWconst {
16055 v_0 := b.Controls[0]
16056 if auxIntToInt32(v_0.AuxInt) != 0 {
16059 v_0_0 := v_0.Args[0]
16060 if v_0_0.Op != OpSelect0 {
16064 if z.Op != OpPPC64ANDCCconst {
16067 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16069 b.resetWithControl(BlockPPC64LT, v0)
16072 // match: (LT (CMPconst [0] z:(AND x y)) yes no)
16073 // cond: z.Uses == 1
16074 // result: (LT (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
16075 for b.Controls[0].Op == OpPPC64CMPconst {
16076 v_0 := b.Controls[0]
16077 if auxIntToInt64(v_0.AuxInt) != 0 {
16081 if z.Op != OpPPC64AND {
16087 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16090 if !(z.Uses == 1) {
16093 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16094 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
16097 b.resetWithControl(BlockPPC64LT, v0)
16102 // match: (LT (CMPconst [0] z:(OR x y)) yes no)
16103 // cond: z.Uses == 1
16104 // result: (LT (Select1 <types.TypeFlags> (ORCC x y)) yes no)
16105 for b.Controls[0].Op == OpPPC64CMPconst {
16106 v_0 := b.Controls[0]
16107 if auxIntToInt64(v_0.AuxInt) != 0 {
16111 if z.Op != OpPPC64OR {
16117 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16120 if !(z.Uses == 1) {
16123 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16124 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
16127 b.resetWithControl(BlockPPC64LT, v0)
16132 // match: (LT (CMPconst [0] z:(XOR x y)) yes no)
16133 // cond: z.Uses == 1
16134 // result: (LT (Select1 <types.TypeFlags> (XORCC x y)) yes no)
16135 for b.Controls[0].Op == OpPPC64CMPconst {
16136 v_0 := b.Controls[0]
16137 if auxIntToInt64(v_0.AuxInt) != 0 {
16141 if z.Op != OpPPC64XOR {
16147 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16150 if !(z.Uses == 1) {
16153 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16154 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
16157 b.resetWithControl(BlockPPC64LT, v0)
16163 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (Equal cc)))) yes no)
16164 // result: (EQ cc yes no)
16165 for b.Controls[0].Op == OpPPC64CMPWconst {
16166 v_0 := b.Controls[0]
16167 if auxIntToInt32(v_0.AuxInt) != 0 {
16170 v_0_0 := v_0.Args[0]
16171 if v_0_0.Op != OpSelect0 {
16174 v_0_0_0 := v_0_0.Args[0]
16175 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16178 v_0_0_0_0 := v_0_0_0.Args[0]
16179 if v_0_0_0_0.Op != OpPPC64Equal {
16182 cc := v_0_0_0_0.Args[0]
16183 b.resetWithControl(BlockPPC64EQ, cc)
16186 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (NotEqual cc)))) yes no)
16187 // result: (NE cc yes no)
16188 for b.Controls[0].Op == OpPPC64CMPWconst {
16189 v_0 := b.Controls[0]
16190 if auxIntToInt32(v_0.AuxInt) != 0 {
16193 v_0_0 := v_0.Args[0]
16194 if v_0_0.Op != OpSelect0 {
16197 v_0_0_0 := v_0_0.Args[0]
16198 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16201 v_0_0_0_0 := v_0_0_0.Args[0]
16202 if v_0_0_0_0.Op != OpPPC64NotEqual {
16205 cc := v_0_0_0_0.Args[0]
16206 b.resetWithControl(BlockPPC64NE, cc)
16209 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (LessThan cc)))) yes no)
16210 // result: (LT cc yes no)
16211 for b.Controls[0].Op == OpPPC64CMPWconst {
16212 v_0 := b.Controls[0]
16213 if auxIntToInt32(v_0.AuxInt) != 0 {
16216 v_0_0 := v_0.Args[0]
16217 if v_0_0.Op != OpSelect0 {
16220 v_0_0_0 := v_0_0.Args[0]
16221 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16224 v_0_0_0_0 := v_0_0_0.Args[0]
16225 if v_0_0_0_0.Op != OpPPC64LessThan {
16228 cc := v_0_0_0_0.Args[0]
16229 b.resetWithControl(BlockPPC64LT, cc)
16232 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (LessEqual cc)))) yes no)
16233 // result: (LE cc yes no)
16234 for b.Controls[0].Op == OpPPC64CMPWconst {
16235 v_0 := b.Controls[0]
16236 if auxIntToInt32(v_0.AuxInt) != 0 {
16239 v_0_0 := v_0.Args[0]
16240 if v_0_0.Op != OpSelect0 {
16243 v_0_0_0 := v_0_0.Args[0]
16244 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16247 v_0_0_0_0 := v_0_0_0.Args[0]
16248 if v_0_0_0_0.Op != OpPPC64LessEqual {
16251 cc := v_0_0_0_0.Args[0]
16252 b.resetWithControl(BlockPPC64LE, cc)
16255 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (GreaterThan cc)))) yes no)
16256 // result: (GT cc yes no)
16257 for b.Controls[0].Op == OpPPC64CMPWconst {
16258 v_0 := b.Controls[0]
16259 if auxIntToInt32(v_0.AuxInt) != 0 {
16262 v_0_0 := v_0.Args[0]
16263 if v_0_0.Op != OpSelect0 {
16266 v_0_0_0 := v_0_0.Args[0]
16267 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16270 v_0_0_0_0 := v_0_0_0.Args[0]
16271 if v_0_0_0_0.Op != OpPPC64GreaterThan {
16274 cc := v_0_0_0_0.Args[0]
16275 b.resetWithControl(BlockPPC64GT, cc)
16278 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (GreaterEqual cc)))) yes no)
16279 // result: (GE cc yes no)
16280 for b.Controls[0].Op == OpPPC64CMPWconst {
16281 v_0 := b.Controls[0]
16282 if auxIntToInt32(v_0.AuxInt) != 0 {
16285 v_0_0 := v_0.Args[0]
16286 if v_0_0.Op != OpSelect0 {
16289 v_0_0_0 := v_0_0.Args[0]
16290 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16293 v_0_0_0_0 := v_0_0_0.Args[0]
16294 if v_0_0_0_0.Op != OpPPC64GreaterEqual {
16297 cc := v_0_0_0_0.Args[0]
16298 b.resetWithControl(BlockPPC64GE, cc)
16301 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (FLessThan cc)))) yes no)
16302 // result: (FLT cc yes no)
16303 for b.Controls[0].Op == OpPPC64CMPWconst {
16304 v_0 := b.Controls[0]
16305 if auxIntToInt32(v_0.AuxInt) != 0 {
16308 v_0_0 := v_0.Args[0]
16309 if v_0_0.Op != OpSelect0 {
16312 v_0_0_0 := v_0_0.Args[0]
16313 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16316 v_0_0_0_0 := v_0_0_0.Args[0]
16317 if v_0_0_0_0.Op != OpPPC64FLessThan {
16320 cc := v_0_0_0_0.Args[0]
16321 b.resetWithControl(BlockPPC64FLT, cc)
16324 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (FLessEqual cc)))) yes no)
16325 // result: (FLE cc yes no)
16326 for b.Controls[0].Op == OpPPC64CMPWconst {
16327 v_0 := b.Controls[0]
16328 if auxIntToInt32(v_0.AuxInt) != 0 {
16331 v_0_0 := v_0.Args[0]
16332 if v_0_0.Op != OpSelect0 {
16335 v_0_0_0 := v_0_0.Args[0]
16336 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16339 v_0_0_0_0 := v_0_0_0.Args[0]
16340 if v_0_0_0_0.Op != OpPPC64FLessEqual {
16343 cc := v_0_0_0_0.Args[0]
16344 b.resetWithControl(BlockPPC64FLE, cc)
16347 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (FGreaterThan cc)))) yes no)
16348 // result: (FGT cc yes no)
16349 for b.Controls[0].Op == OpPPC64CMPWconst {
16350 v_0 := b.Controls[0]
16351 if auxIntToInt32(v_0.AuxInt) != 0 {
16354 v_0_0 := v_0.Args[0]
16355 if v_0_0.Op != OpSelect0 {
16358 v_0_0_0 := v_0_0.Args[0]
16359 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16362 v_0_0_0_0 := v_0_0_0.Args[0]
16363 if v_0_0_0_0.Op != OpPPC64FGreaterThan {
16366 cc := v_0_0_0_0.Args[0]
16367 b.resetWithControl(BlockPPC64FGT, cc)
16370 // match: (NE (CMPWconst [0] (Select0 (ANDCCconst [1] (FGreaterEqual cc)))) yes no)
16371 // result: (FGE cc yes no)
16372 for b.Controls[0].Op == OpPPC64CMPWconst {
16373 v_0 := b.Controls[0]
16374 if auxIntToInt32(v_0.AuxInt) != 0 {
16377 v_0_0 := v_0.Args[0]
16378 if v_0_0.Op != OpSelect0 {
16381 v_0_0_0 := v_0_0.Args[0]
16382 if v_0_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0_0.AuxInt) != 1 {
16385 v_0_0_0_0 := v_0_0_0.Args[0]
16386 if v_0_0_0_0.Op != OpPPC64FGreaterEqual {
16389 cc := v_0_0_0_0.Args[0]
16390 b.resetWithControl(BlockPPC64FGE, cc)
16393 // match: (NE (FlagEQ) yes no)
16394 // result: (First no yes)
16395 for b.Controls[0].Op == OpPPC64FlagEQ {
16396 b.Reset(BlockFirst)
16400 // match: (NE (FlagLT) yes no)
16401 // result: (First yes no)
16402 for b.Controls[0].Op == OpPPC64FlagLT {
16403 b.Reset(BlockFirst)
16406 // match: (NE (FlagGT) yes no)
16407 // result: (First yes no)
16408 for b.Controls[0].Op == OpPPC64FlagGT {
16409 b.Reset(BlockFirst)
16412 // match: (NE (InvertFlags cmp) yes no)
16413 // result: (NE cmp yes no)
16414 for b.Controls[0].Op == OpPPC64InvertFlags {
16415 v_0 := b.Controls[0]
16417 b.resetWithControl(BlockPPC64NE, cmp)
16420 // match: (NE (CMPconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
16421 // result: (NE (Select1 <types.TypeFlags> z) yes no)
16422 for b.Controls[0].Op == OpPPC64CMPconst {
16423 v_0 := b.Controls[0]
16424 if auxIntToInt64(v_0.AuxInt) != 0 {
16427 v_0_0 := v_0.Args[0]
16428 if v_0_0.Op != OpSelect0 {
16432 if z.Op != OpPPC64ANDCCconst {
16435 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16437 b.resetWithControl(BlockPPC64NE, v0)
16440 // match: (NE (CMPWconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
16441 // result: (NE (Select1 <types.TypeFlags> z) yes no)
16442 for b.Controls[0].Op == OpPPC64CMPWconst {
16443 v_0 := b.Controls[0]
16444 if auxIntToInt32(v_0.AuxInt) != 0 {
16447 v_0_0 := v_0.Args[0]
16448 if v_0_0.Op != OpSelect0 {
16452 if z.Op != OpPPC64ANDCCconst {
16455 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16457 b.resetWithControl(BlockPPC64NE, v0)
16460 // match: (NE (CMPconst [0] z:(AND x y)) yes no)
16461 // cond: z.Uses == 1
16462 // result: (NE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
16463 for b.Controls[0].Op == OpPPC64CMPconst {
16464 v_0 := b.Controls[0]
16465 if auxIntToInt64(v_0.AuxInt) != 0 {
16469 if z.Op != OpPPC64AND {
16475 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16478 if !(z.Uses == 1) {
16481 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16482 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
16485 b.resetWithControl(BlockPPC64NE, v0)
16490 // match: (NE (CMPconst [0] z:(OR x y)) yes no)
16491 // cond: z.Uses == 1
16492 // result: (NE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
16493 for b.Controls[0].Op == OpPPC64CMPconst {
16494 v_0 := b.Controls[0]
16495 if auxIntToInt64(v_0.AuxInt) != 0 {
16499 if z.Op != OpPPC64OR {
16505 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16508 if !(z.Uses == 1) {
16511 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16512 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
16515 b.resetWithControl(BlockPPC64NE, v0)
16520 // match: (NE (CMPconst [0] z:(XOR x y)) yes no)
16521 // cond: z.Uses == 1
16522 // result: (NE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
16523 for b.Controls[0].Op == OpPPC64CMPconst {
16524 v_0 := b.Controls[0]
16525 if auxIntToInt64(v_0.AuxInt) != 0 {
16529 if z.Op != OpPPC64XOR {
16535 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16538 if !(z.Uses == 1) {
16541 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16542 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
16545 b.resetWithControl(BlockPPC64NE, v0)