Source file src/cmd/compile/internal/ssa/rewritePPC64.go

     1  // Code generated from _gen/PPC64.rules using 'go generate'; DO NOT EDIT.
     2  
     3  package ssa
     4  
     5  import "internal/buildcfg"
     6  import "math"
     7  import "cmd/compile/internal/types"
     8  import "cmd/compile/internal/ssa/block"
     9  
    10  func rewriteValuePPC64(v *Value) bool {
    11  	switch v.Op {
    12  	case OpAbs:
    13  		v.Op = OpPPC64FABS
    14  		return true
    15  	case OpAdd16:
    16  		v.Op = OpPPC64ADD
    17  		return true
    18  	case OpAdd32:
    19  		v.Op = OpPPC64ADD
    20  		return true
    21  	case OpAdd32F:
    22  		v.Op = OpPPC64FADDS
    23  		return true
    24  	case OpAdd64:
    25  		v.Op = OpPPC64ADD
    26  		return true
    27  	case OpAdd64F:
    28  		v.Op = OpPPC64FADD
    29  		return true
    30  	case OpAdd8:
    31  		v.Op = OpPPC64ADD
    32  		return true
    33  	case OpAddPtr:
    34  		v.Op = OpPPC64ADD
    35  		return true
    36  	case OpAddr:
    37  		return rewriteValuePPC64_OpAddr(v)
    38  	case OpAnd16:
    39  		v.Op = OpPPC64AND
    40  		return true
    41  	case OpAnd32:
    42  		v.Op = OpPPC64AND
    43  		return true
    44  	case OpAnd64:
    45  		v.Op = OpPPC64AND
    46  		return true
    47  	case OpAnd8:
    48  		v.Op = OpPPC64AND
    49  		return true
    50  	case OpAndB:
    51  		v.Op = OpPPC64AND
    52  		return true
    53  	case OpAtomicAdd32:
    54  		v.Op = OpPPC64LoweredAtomicAdd32
    55  		return true
    56  	case OpAtomicAdd64:
    57  		v.Op = OpPPC64LoweredAtomicAdd64
    58  		return true
    59  	case OpAtomicAnd32:
    60  		v.Op = OpPPC64LoweredAtomicAnd32
    61  		return true
    62  	case OpAtomicAnd8:
    63  		v.Op = OpPPC64LoweredAtomicAnd8
    64  		return true
    65  	case OpAtomicCompareAndSwap32:
    66  		return rewriteValuePPC64_OpAtomicCompareAndSwap32(v)
    67  	case OpAtomicCompareAndSwap64:
    68  		return rewriteValuePPC64_OpAtomicCompareAndSwap64(v)
    69  	case OpAtomicCompareAndSwapRel32:
    70  		return rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v)
    71  	case OpAtomicExchange32:
    72  		v.Op = OpPPC64LoweredAtomicExchange32
    73  		return true
    74  	case OpAtomicExchange64:
    75  		v.Op = OpPPC64LoweredAtomicExchange64
    76  		return true
    77  	case OpAtomicExchange8:
    78  		v.Op = OpPPC64LoweredAtomicExchange8
    79  		return true
    80  	case OpAtomicLoad32:
    81  		return rewriteValuePPC64_OpAtomicLoad32(v)
    82  	case OpAtomicLoad64:
    83  		return rewriteValuePPC64_OpAtomicLoad64(v)
    84  	case OpAtomicLoad8:
    85  		return rewriteValuePPC64_OpAtomicLoad8(v)
    86  	case OpAtomicLoadAcq32:
    87  		return rewriteValuePPC64_OpAtomicLoadAcq32(v)
    88  	case OpAtomicLoadAcq64:
    89  		return rewriteValuePPC64_OpAtomicLoadAcq64(v)
    90  	case OpAtomicLoadPtr:
    91  		return rewriteValuePPC64_OpAtomicLoadPtr(v)
    92  	case OpAtomicOr32:
    93  		v.Op = OpPPC64LoweredAtomicOr32
    94  		return true
    95  	case OpAtomicOr8:
    96  		v.Op = OpPPC64LoweredAtomicOr8
    97  		return true
    98  	case OpAtomicStore32:
    99  		return rewriteValuePPC64_OpAtomicStore32(v)
   100  	case OpAtomicStore64:
   101  		return rewriteValuePPC64_OpAtomicStore64(v)
   102  	case OpAtomicStore8:
   103  		return rewriteValuePPC64_OpAtomicStore8(v)
   104  	case OpAtomicStoreRel32:
   105  		return rewriteValuePPC64_OpAtomicStoreRel32(v)
   106  	case OpAtomicStoreRel64:
   107  		return rewriteValuePPC64_OpAtomicStoreRel64(v)
   108  	case OpAvg64u:
   109  		return rewriteValuePPC64_OpAvg64u(v)
   110  	case OpBitLen16:
   111  		return rewriteValuePPC64_OpBitLen16(v)
   112  	case OpBitLen32:
   113  		return rewriteValuePPC64_OpBitLen32(v)
   114  	case OpBitLen64:
   115  		return rewriteValuePPC64_OpBitLen64(v)
   116  	case OpBitLen8:
   117  		return rewriteValuePPC64_OpBitLen8(v)
   118  	case OpBswap16:
   119  		return rewriteValuePPC64_OpBswap16(v)
   120  	case OpBswap32:
   121  		return rewriteValuePPC64_OpBswap32(v)
   122  	case OpBswap64:
   123  		return rewriteValuePPC64_OpBswap64(v)
   124  	case OpCeil:
   125  		v.Op = OpPPC64FCEIL
   126  		return true
   127  	case OpClosureCall:
   128  		v.Op = OpPPC64CALLclosure
   129  		return true
   130  	case OpCom16:
   131  		return rewriteValuePPC64_OpCom16(v)
   132  	case OpCom32:
   133  		return rewriteValuePPC64_OpCom32(v)
   134  	case OpCom64:
   135  		return rewriteValuePPC64_OpCom64(v)
   136  	case OpCom8:
   137  		return rewriteValuePPC64_OpCom8(v)
   138  	case OpCondSelect:
   139  		return rewriteValuePPC64_OpCondSelect(v)
   140  	case OpConst16:
   141  		return rewriteValuePPC64_OpConst16(v)
   142  	case OpConst32:
   143  		return rewriteValuePPC64_OpConst32(v)
   144  	case OpConst32F:
   145  		v.Op = OpPPC64FMOVSconst
   146  		return true
   147  	case OpConst64:
   148  		return rewriteValuePPC64_OpConst64(v)
   149  	case OpConst64F:
   150  		v.Op = OpPPC64FMOVDconst
   151  		return true
   152  	case OpConst8:
   153  		return rewriteValuePPC64_OpConst8(v)
   154  	case OpConstBool:
   155  		return rewriteValuePPC64_OpConstBool(v)
   156  	case OpConstNil:
   157  		return rewriteValuePPC64_OpConstNil(v)
   158  	case OpCopysign:
   159  		return rewriteValuePPC64_OpCopysign(v)
   160  	case OpCtz16:
   161  		return rewriteValuePPC64_OpCtz16(v)
   162  	case OpCtz16NonZero:
   163  		v.Op = OpCtz64
   164  		return true
   165  	case OpCtz32:
   166  		return rewriteValuePPC64_OpCtz32(v)
   167  	case OpCtz32NonZero:
   168  		v.Op = OpCtz64
   169  		return true
   170  	case OpCtz64:
   171  		return rewriteValuePPC64_OpCtz64(v)
   172  	case OpCtz64NonZero:
   173  		v.Op = OpCtz64
   174  		return true
   175  	case OpCtz8:
   176  		return rewriteValuePPC64_OpCtz8(v)
   177  	case OpCtz8NonZero:
   178  		v.Op = OpCtz64
   179  		return true
   180  	case OpCvt32Fto32:
   181  		return rewriteValuePPC64_OpCvt32Fto32(v)
   182  	case OpCvt32Fto64:
   183  		return rewriteValuePPC64_OpCvt32Fto64(v)
   184  	case OpCvt32Fto64F:
   185  		v.Op = OpCopy
   186  		return true
   187  	case OpCvt32to32F:
   188  		return rewriteValuePPC64_OpCvt32to32F(v)
   189  	case OpCvt32to64F:
   190  		return rewriteValuePPC64_OpCvt32to64F(v)
   191  	case OpCvt64Fto32:
   192  		return rewriteValuePPC64_OpCvt64Fto32(v)
   193  	case OpCvt64Fto32F:
   194  		v.Op = OpPPC64FRSP
   195  		return true
   196  	case OpCvt64Fto64:
   197  		return rewriteValuePPC64_OpCvt64Fto64(v)
   198  	case OpCvt64to32F:
   199  		return rewriteValuePPC64_OpCvt64to32F(v)
   200  	case OpCvt64to64F:
   201  		return rewriteValuePPC64_OpCvt64to64F(v)
   202  	case OpCvtBoolToUint8:
   203  		v.Op = OpCopy
   204  		return true
   205  	case OpDiv16:
   206  		return rewriteValuePPC64_OpDiv16(v)
   207  	case OpDiv16u:
   208  		return rewriteValuePPC64_OpDiv16u(v)
   209  	case OpDiv32:
   210  		return rewriteValuePPC64_OpDiv32(v)
   211  	case OpDiv32F:
   212  		v.Op = OpPPC64FDIVS
   213  		return true
   214  	case OpDiv32u:
   215  		v.Op = OpPPC64DIVWU
   216  		return true
   217  	case OpDiv64:
   218  		return rewriteValuePPC64_OpDiv64(v)
   219  	case OpDiv64F:
   220  		v.Op = OpPPC64FDIV
   221  		return true
   222  	case OpDiv64u:
   223  		v.Op = OpPPC64DIVDU
   224  		return true
   225  	case OpDiv8:
   226  		return rewriteValuePPC64_OpDiv8(v)
   227  	case OpDiv8u:
   228  		return rewriteValuePPC64_OpDiv8u(v)
   229  	case OpEq16:
   230  		return rewriteValuePPC64_OpEq16(v)
   231  	case OpEq32:
   232  		return rewriteValuePPC64_OpEq32(v)
   233  	case OpEq32F:
   234  		return rewriteValuePPC64_OpEq32F(v)
   235  	case OpEq64:
   236  		return rewriteValuePPC64_OpEq64(v)
   237  	case OpEq64F:
   238  		return rewriteValuePPC64_OpEq64F(v)
   239  	case OpEq8:
   240  		return rewriteValuePPC64_OpEq8(v)
   241  	case OpEqB:
   242  		return rewriteValuePPC64_OpEqB(v)
   243  	case OpEqPtr:
   244  		return rewriteValuePPC64_OpEqPtr(v)
   245  	case OpFMA:
   246  		v.Op = OpPPC64FMADD
   247  		return true
   248  	case OpFloor:
   249  		v.Op = OpPPC64FFLOOR
   250  		return true
   251  	case OpGetCallerPC:
   252  		v.Op = OpPPC64LoweredGetCallerPC
   253  		return true
   254  	case OpGetCallerSP:
   255  		v.Op = OpPPC64LoweredGetCallerSP
   256  		return true
   257  	case OpGetClosurePtr:
   258  		v.Op = OpPPC64LoweredGetClosurePtr
   259  		return true
   260  	case OpHmul32:
   261  		v.Op = OpPPC64MULHW
   262  		return true
   263  	case OpHmul32u:
   264  		v.Op = OpPPC64MULHWU
   265  		return true
   266  	case OpHmul64:
   267  		v.Op = OpPPC64MULHD
   268  		return true
   269  	case OpHmul64u:
   270  		v.Op = OpPPC64MULHDU
   271  		return true
   272  	case OpInterCall:
   273  		v.Op = OpPPC64CALLinter
   274  		return true
   275  	case OpIsInBounds:
   276  		return rewriteValuePPC64_OpIsInBounds(v)
   277  	case OpIsNonNil:
   278  		return rewriteValuePPC64_OpIsNonNil(v)
   279  	case OpIsSliceInBounds:
   280  		return rewriteValuePPC64_OpIsSliceInBounds(v)
   281  	case OpLeq16:
   282  		return rewriteValuePPC64_OpLeq16(v)
   283  	case OpLeq16U:
   284  		return rewriteValuePPC64_OpLeq16U(v)
   285  	case OpLeq32:
   286  		return rewriteValuePPC64_OpLeq32(v)
   287  	case OpLeq32F:
   288  		return rewriteValuePPC64_OpLeq32F(v)
   289  	case OpLeq32U:
   290  		return rewriteValuePPC64_OpLeq32U(v)
   291  	case OpLeq64:
   292  		return rewriteValuePPC64_OpLeq64(v)
   293  	case OpLeq64F:
   294  		return rewriteValuePPC64_OpLeq64F(v)
   295  	case OpLeq64U:
   296  		return rewriteValuePPC64_OpLeq64U(v)
   297  	case OpLeq8:
   298  		return rewriteValuePPC64_OpLeq8(v)
   299  	case OpLeq8U:
   300  		return rewriteValuePPC64_OpLeq8U(v)
   301  	case OpLess16:
   302  		return rewriteValuePPC64_OpLess16(v)
   303  	case OpLess16U:
   304  		return rewriteValuePPC64_OpLess16U(v)
   305  	case OpLess32:
   306  		return rewriteValuePPC64_OpLess32(v)
   307  	case OpLess32F:
   308  		return rewriteValuePPC64_OpLess32F(v)
   309  	case OpLess32U:
   310  		return rewriteValuePPC64_OpLess32U(v)
   311  	case OpLess64:
   312  		return rewriteValuePPC64_OpLess64(v)
   313  	case OpLess64F:
   314  		return rewriteValuePPC64_OpLess64F(v)
   315  	case OpLess64U:
   316  		return rewriteValuePPC64_OpLess64U(v)
   317  	case OpLess8:
   318  		return rewriteValuePPC64_OpLess8(v)
   319  	case OpLess8U:
   320  		return rewriteValuePPC64_OpLess8U(v)
   321  	case OpLoad:
   322  		return rewriteValuePPC64_OpLoad(v)
   323  	case OpLocalAddr:
   324  		return rewriteValuePPC64_OpLocalAddr(v)
   325  	case OpLsh16x16:
   326  		return rewriteValuePPC64_OpLsh16x16(v)
   327  	case OpLsh16x32:
   328  		return rewriteValuePPC64_OpLsh16x32(v)
   329  	case OpLsh16x64:
   330  		return rewriteValuePPC64_OpLsh16x64(v)
   331  	case OpLsh16x8:
   332  		return rewriteValuePPC64_OpLsh16x8(v)
   333  	case OpLsh32x16:
   334  		return rewriteValuePPC64_OpLsh32x16(v)
   335  	case OpLsh32x32:
   336  		return rewriteValuePPC64_OpLsh32x32(v)
   337  	case OpLsh32x64:
   338  		return rewriteValuePPC64_OpLsh32x64(v)
   339  	case OpLsh32x8:
   340  		return rewriteValuePPC64_OpLsh32x8(v)
   341  	case OpLsh64x16:
   342  		return rewriteValuePPC64_OpLsh64x16(v)
   343  	case OpLsh64x32:
   344  		return rewriteValuePPC64_OpLsh64x32(v)
   345  	case OpLsh64x64:
   346  		return rewriteValuePPC64_OpLsh64x64(v)
   347  	case OpLsh64x8:
   348  		return rewriteValuePPC64_OpLsh64x8(v)
   349  	case OpLsh8x16:
   350  		return rewriteValuePPC64_OpLsh8x16(v)
   351  	case OpLsh8x32:
   352  		return rewriteValuePPC64_OpLsh8x32(v)
   353  	case OpLsh8x64:
   354  		return rewriteValuePPC64_OpLsh8x64(v)
   355  	case OpLsh8x8:
   356  		return rewriteValuePPC64_OpLsh8x8(v)
   357  	case OpMax32F:
   358  		return rewriteValuePPC64_OpMax32F(v)
   359  	case OpMax64F:
   360  		return rewriteValuePPC64_OpMax64F(v)
   361  	case OpMin32F:
   362  		return rewriteValuePPC64_OpMin32F(v)
   363  	case OpMin64F:
   364  		return rewriteValuePPC64_OpMin64F(v)
   365  	case OpMod16:
   366  		return rewriteValuePPC64_OpMod16(v)
   367  	case OpMod16u:
   368  		return rewriteValuePPC64_OpMod16u(v)
   369  	case OpMod32:
   370  		return rewriteValuePPC64_OpMod32(v)
   371  	case OpMod32u:
   372  		return rewriteValuePPC64_OpMod32u(v)
   373  	case OpMod64:
   374  		return rewriteValuePPC64_OpMod64(v)
   375  	case OpMod64u:
   376  		return rewriteValuePPC64_OpMod64u(v)
   377  	case OpMod8:
   378  		return rewriteValuePPC64_OpMod8(v)
   379  	case OpMod8u:
   380  		return rewriteValuePPC64_OpMod8u(v)
   381  	case OpMove:
   382  		return rewriteValuePPC64_OpMove(v)
   383  	case OpMul16:
   384  		v.Op = OpPPC64MULLW
   385  		return true
   386  	case OpMul32:
   387  		v.Op = OpPPC64MULLW
   388  		return true
   389  	case OpMul32F:
   390  		v.Op = OpPPC64FMULS
   391  		return true
   392  	case OpMul64:
   393  		v.Op = OpPPC64MULLD
   394  		return true
   395  	case OpMul64F:
   396  		v.Op = OpPPC64FMUL
   397  		return true
   398  	case OpMul8:
   399  		v.Op = OpPPC64MULLW
   400  		return true
   401  	case OpNeg16:
   402  		v.Op = OpPPC64NEG
   403  		return true
   404  	case OpNeg32:
   405  		v.Op = OpPPC64NEG
   406  		return true
   407  	case OpNeg32F:
   408  		v.Op = OpPPC64FNEG
   409  		return true
   410  	case OpNeg64:
   411  		v.Op = OpPPC64NEG
   412  		return true
   413  	case OpNeg64F:
   414  		v.Op = OpPPC64FNEG
   415  		return true
   416  	case OpNeg8:
   417  		v.Op = OpPPC64NEG
   418  		return true
   419  	case OpNeq16:
   420  		return rewriteValuePPC64_OpNeq16(v)
   421  	case OpNeq32:
   422  		return rewriteValuePPC64_OpNeq32(v)
   423  	case OpNeq32F:
   424  		return rewriteValuePPC64_OpNeq32F(v)
   425  	case OpNeq64:
   426  		return rewriteValuePPC64_OpNeq64(v)
   427  	case OpNeq64F:
   428  		return rewriteValuePPC64_OpNeq64F(v)
   429  	case OpNeq8:
   430  		return rewriteValuePPC64_OpNeq8(v)
   431  	case OpNeqB:
   432  		v.Op = OpPPC64XOR
   433  		return true
   434  	case OpNeqPtr:
   435  		return rewriteValuePPC64_OpNeqPtr(v)
   436  	case OpNilCheck:
   437  		v.Op = OpPPC64LoweredNilCheck
   438  		return true
   439  	case OpNot:
   440  		return rewriteValuePPC64_OpNot(v)
   441  	case OpOffPtr:
   442  		return rewriteValuePPC64_OpOffPtr(v)
   443  	case OpOr16:
   444  		v.Op = OpPPC64OR
   445  		return true
   446  	case OpOr32:
   447  		v.Op = OpPPC64OR
   448  		return true
   449  	case OpOr64:
   450  		v.Op = OpPPC64OR
   451  		return true
   452  	case OpOr8:
   453  		v.Op = OpPPC64OR
   454  		return true
   455  	case OpOrB:
   456  		v.Op = OpPPC64OR
   457  		return true
   458  	case OpPPC64ADD:
   459  		return rewriteValuePPC64_OpPPC64ADD(v)
   460  	case OpPPC64ADDC:
   461  		return rewriteValuePPC64_OpPPC64ADDC(v)
   462  	case OpPPC64ADDE:
   463  		return rewriteValuePPC64_OpPPC64ADDE(v)
   464  	case OpPPC64ADDconst:
   465  		return rewriteValuePPC64_OpPPC64ADDconst(v)
   466  	case OpPPC64AND:
   467  		return rewriteValuePPC64_OpPPC64AND(v)
   468  	case OpPPC64ANDN:
   469  		return rewriteValuePPC64_OpPPC64ANDN(v)
   470  	case OpPPC64ANDconst:
   471  		return rewriteValuePPC64_OpPPC64ANDconst(v)
   472  	case OpPPC64BRD:
   473  		return rewriteValuePPC64_OpPPC64BRD(v)
   474  	case OpPPC64BRH:
   475  		return rewriteValuePPC64_OpPPC64BRH(v)
   476  	case OpPPC64BRW:
   477  		return rewriteValuePPC64_OpPPC64BRW(v)
   478  	case OpPPC64CLRLSLDI:
   479  		return rewriteValuePPC64_OpPPC64CLRLSLDI(v)
   480  	case OpPPC64CMP:
   481  		return rewriteValuePPC64_OpPPC64CMP(v)
   482  	case OpPPC64CMPU:
   483  		return rewriteValuePPC64_OpPPC64CMPU(v)
   484  	case OpPPC64CMPUconst:
   485  		return rewriteValuePPC64_OpPPC64CMPUconst(v)
   486  	case OpPPC64CMPW:
   487  		return rewriteValuePPC64_OpPPC64CMPW(v)
   488  	case OpPPC64CMPWU:
   489  		return rewriteValuePPC64_OpPPC64CMPWU(v)
   490  	case OpPPC64CMPWUconst:
   491  		return rewriteValuePPC64_OpPPC64CMPWUconst(v)
   492  	case OpPPC64CMPWconst:
   493  		return rewriteValuePPC64_OpPPC64CMPWconst(v)
   494  	case OpPPC64CMPconst:
   495  		return rewriteValuePPC64_OpPPC64CMPconst(v)
   496  	case OpPPC64Equal:
   497  		return rewriteValuePPC64_OpPPC64Equal(v)
   498  	case OpPPC64FABS:
   499  		return rewriteValuePPC64_OpPPC64FABS(v)
   500  	case OpPPC64FADD:
   501  		return rewriteValuePPC64_OpPPC64FADD(v)
   502  	case OpPPC64FADDS:
   503  		return rewriteValuePPC64_OpPPC64FADDS(v)
   504  	case OpPPC64FCEIL:
   505  		return rewriteValuePPC64_OpPPC64FCEIL(v)
   506  	case OpPPC64FFLOOR:
   507  		return rewriteValuePPC64_OpPPC64FFLOOR(v)
   508  	case OpPPC64FGreaterEqual:
   509  		return rewriteValuePPC64_OpPPC64FGreaterEqual(v)
   510  	case OpPPC64FGreaterThan:
   511  		return rewriteValuePPC64_OpPPC64FGreaterThan(v)
   512  	case OpPPC64FLessEqual:
   513  		return rewriteValuePPC64_OpPPC64FLessEqual(v)
   514  	case OpPPC64FLessThan:
   515  		return rewriteValuePPC64_OpPPC64FLessThan(v)
   516  	case OpPPC64FMOVDload:
   517  		return rewriteValuePPC64_OpPPC64FMOVDload(v)
   518  	case OpPPC64FMOVDstore:
   519  		return rewriteValuePPC64_OpPPC64FMOVDstore(v)
   520  	case OpPPC64FMOVSload:
   521  		return rewriteValuePPC64_OpPPC64FMOVSload(v)
   522  	case OpPPC64FMOVSstore:
   523  		return rewriteValuePPC64_OpPPC64FMOVSstore(v)
   524  	case OpPPC64FNEG:
   525  		return rewriteValuePPC64_OpPPC64FNEG(v)
   526  	case OpPPC64FSQRT:
   527  		return rewriteValuePPC64_OpPPC64FSQRT(v)
   528  	case OpPPC64FSUB:
   529  		return rewriteValuePPC64_OpPPC64FSUB(v)
   530  	case OpPPC64FSUBS:
   531  		return rewriteValuePPC64_OpPPC64FSUBS(v)
   532  	case OpPPC64FTRUNC:
   533  		return rewriteValuePPC64_OpPPC64FTRUNC(v)
   534  	case OpPPC64GreaterEqual:
   535  		return rewriteValuePPC64_OpPPC64GreaterEqual(v)
   536  	case OpPPC64GreaterThan:
   537  		return rewriteValuePPC64_OpPPC64GreaterThan(v)
   538  	case OpPPC64ISEL:
   539  		return rewriteValuePPC64_OpPPC64ISEL(v)
   540  	case OpPPC64LessEqual:
   541  		return rewriteValuePPC64_OpPPC64LessEqual(v)
   542  	case OpPPC64LessThan:
   543  		return rewriteValuePPC64_OpPPC64LessThan(v)
   544  	case OpPPC64LoweredPanicBoundsCR:
   545  		return rewriteValuePPC64_OpPPC64LoweredPanicBoundsCR(v)
   546  	case OpPPC64LoweredPanicBoundsRC:
   547  		return rewriteValuePPC64_OpPPC64LoweredPanicBoundsRC(v)
   548  	case OpPPC64LoweredPanicBoundsRR:
   549  		return rewriteValuePPC64_OpPPC64LoweredPanicBoundsRR(v)
   550  	case OpPPC64MFVSRD:
   551  		return rewriteValuePPC64_OpPPC64MFVSRD(v)
   552  	case OpPPC64MOVBZload:
   553  		return rewriteValuePPC64_OpPPC64MOVBZload(v)
   554  	case OpPPC64MOVBZloadidx:
   555  		return rewriteValuePPC64_OpPPC64MOVBZloadidx(v)
   556  	case OpPPC64MOVBZreg:
   557  		return rewriteValuePPC64_OpPPC64MOVBZreg(v)
   558  	case OpPPC64MOVBreg:
   559  		return rewriteValuePPC64_OpPPC64MOVBreg(v)
   560  	case OpPPC64MOVBstore:
   561  		return rewriteValuePPC64_OpPPC64MOVBstore(v)
   562  	case OpPPC64MOVBstoreidx:
   563  		return rewriteValuePPC64_OpPPC64MOVBstoreidx(v)
   564  	case OpPPC64MOVBstorezero:
   565  		return rewriteValuePPC64_OpPPC64MOVBstorezero(v)
   566  	case OpPPC64MOVDaddr:
   567  		return rewriteValuePPC64_OpPPC64MOVDaddr(v)
   568  	case OpPPC64MOVDload:
   569  		return rewriteValuePPC64_OpPPC64MOVDload(v)
   570  	case OpPPC64MOVDloadidx:
   571  		return rewriteValuePPC64_OpPPC64MOVDloadidx(v)
   572  	case OpPPC64MOVDstore:
   573  		return rewriteValuePPC64_OpPPC64MOVDstore(v)
   574  	case OpPPC64MOVDstoreidx:
   575  		return rewriteValuePPC64_OpPPC64MOVDstoreidx(v)
   576  	case OpPPC64MOVDstorezero:
   577  		return rewriteValuePPC64_OpPPC64MOVDstorezero(v)
   578  	case OpPPC64MOVHBRstore:
   579  		return rewriteValuePPC64_OpPPC64MOVHBRstore(v)
   580  	case OpPPC64MOVHZload:
   581  		return rewriteValuePPC64_OpPPC64MOVHZload(v)
   582  	case OpPPC64MOVHZloadidx:
   583  		return rewriteValuePPC64_OpPPC64MOVHZloadidx(v)
   584  	case OpPPC64MOVHZreg:
   585  		return rewriteValuePPC64_OpPPC64MOVHZreg(v)
   586  	case OpPPC64MOVHload:
   587  		return rewriteValuePPC64_OpPPC64MOVHload(v)
   588  	case OpPPC64MOVHloadidx:
   589  		return rewriteValuePPC64_OpPPC64MOVHloadidx(v)
   590  	case OpPPC64MOVHreg:
   591  		return rewriteValuePPC64_OpPPC64MOVHreg(v)
   592  	case OpPPC64MOVHstore:
   593  		return rewriteValuePPC64_OpPPC64MOVHstore(v)
   594  	case OpPPC64MOVHstoreidx:
   595  		return rewriteValuePPC64_OpPPC64MOVHstoreidx(v)
   596  	case OpPPC64MOVHstorezero:
   597  		return rewriteValuePPC64_OpPPC64MOVHstorezero(v)
   598  	case OpPPC64MOVWBRstore:
   599  		return rewriteValuePPC64_OpPPC64MOVWBRstore(v)
   600  	case OpPPC64MOVWZload:
   601  		return rewriteValuePPC64_OpPPC64MOVWZload(v)
   602  	case OpPPC64MOVWZloadidx:
   603  		return rewriteValuePPC64_OpPPC64MOVWZloadidx(v)
   604  	case OpPPC64MOVWZreg:
   605  		return rewriteValuePPC64_OpPPC64MOVWZreg(v)
   606  	case OpPPC64MOVWload:
   607  		return rewriteValuePPC64_OpPPC64MOVWload(v)
   608  	case OpPPC64MOVWloadidx:
   609  		return rewriteValuePPC64_OpPPC64MOVWloadidx(v)
   610  	case OpPPC64MOVWreg:
   611  		return rewriteValuePPC64_OpPPC64MOVWreg(v)
   612  	case OpPPC64MOVWstore:
   613  		return rewriteValuePPC64_OpPPC64MOVWstore(v)
   614  	case OpPPC64MOVWstoreidx:
   615  		return rewriteValuePPC64_OpPPC64MOVWstoreidx(v)
   616  	case OpPPC64MOVWstorezero:
   617  		return rewriteValuePPC64_OpPPC64MOVWstorezero(v)
   618  	case OpPPC64MTVSRD:
   619  		return rewriteValuePPC64_OpPPC64MTVSRD(v)
   620  	case OpPPC64MULLD:
   621  		return rewriteValuePPC64_OpPPC64MULLD(v)
   622  	case OpPPC64MULLW:
   623  		return rewriteValuePPC64_OpPPC64MULLW(v)
   624  	case OpPPC64NEG:
   625  		return rewriteValuePPC64_OpPPC64NEG(v)
   626  	case OpPPC64NOR:
   627  		return rewriteValuePPC64_OpPPC64NOR(v)
   628  	case OpPPC64NotEqual:
   629  		return rewriteValuePPC64_OpPPC64NotEqual(v)
   630  	case OpPPC64OR:
   631  		return rewriteValuePPC64_OpPPC64OR(v)
   632  	case OpPPC64ORN:
   633  		return rewriteValuePPC64_OpPPC64ORN(v)
   634  	case OpPPC64ORconst:
   635  		return rewriteValuePPC64_OpPPC64ORconst(v)
   636  	case OpPPC64RLWINM:
   637  		return rewriteValuePPC64_OpPPC64RLWINM(v)
   638  	case OpPPC64ROTL:
   639  		return rewriteValuePPC64_OpPPC64ROTL(v)
   640  	case OpPPC64ROTLW:
   641  		return rewriteValuePPC64_OpPPC64ROTLW(v)
   642  	case OpPPC64ROTLWconst:
   643  		return rewriteValuePPC64_OpPPC64ROTLWconst(v)
   644  	case OpPPC64SETBC:
   645  		return rewriteValuePPC64_OpPPC64SETBC(v)
   646  	case OpPPC64SETBCR:
   647  		return rewriteValuePPC64_OpPPC64SETBCR(v)
   648  	case OpPPC64SLD:
   649  		return rewriteValuePPC64_OpPPC64SLD(v)
   650  	case OpPPC64SLDconst:
   651  		return rewriteValuePPC64_OpPPC64SLDconst(v)
   652  	case OpPPC64SLW:
   653  		return rewriteValuePPC64_OpPPC64SLW(v)
   654  	case OpPPC64SLWconst:
   655  		return rewriteValuePPC64_OpPPC64SLWconst(v)
   656  	case OpPPC64SRAD:
   657  		return rewriteValuePPC64_OpPPC64SRAD(v)
   658  	case OpPPC64SRAW:
   659  		return rewriteValuePPC64_OpPPC64SRAW(v)
   660  	case OpPPC64SRD:
   661  		return rewriteValuePPC64_OpPPC64SRD(v)
   662  	case OpPPC64SRW:
   663  		return rewriteValuePPC64_OpPPC64SRW(v)
   664  	case OpPPC64SRWconst:
   665  		return rewriteValuePPC64_OpPPC64SRWconst(v)
   666  	case OpPPC64SUB:
   667  		return rewriteValuePPC64_OpPPC64SUB(v)
   668  	case OpPPC64SUBE:
   669  		return rewriteValuePPC64_OpPPC64SUBE(v)
   670  	case OpPPC64SUBFCconst:
   671  		return rewriteValuePPC64_OpPPC64SUBFCconst(v)
   672  	case OpPPC64XOR:
   673  		return rewriteValuePPC64_OpPPC64XOR(v)
   674  	case OpPPC64XORconst:
   675  		return rewriteValuePPC64_OpPPC64XORconst(v)
   676  	case OpPanicBounds:
   677  		v.Op = OpPPC64LoweredPanicBoundsRR
   678  		return true
   679  	case OpPopCount16:
   680  		return rewriteValuePPC64_OpPopCount16(v)
   681  	case OpPopCount32:
   682  		return rewriteValuePPC64_OpPopCount32(v)
   683  	case OpPopCount64:
   684  		v.Op = OpPPC64POPCNTD
   685  		return true
   686  	case OpPopCount8:
   687  		return rewriteValuePPC64_OpPopCount8(v)
   688  	case OpPrefetchCache:
   689  		return rewriteValuePPC64_OpPrefetchCache(v)
   690  	case OpPrefetchCacheStreamed:
   691  		return rewriteValuePPC64_OpPrefetchCacheStreamed(v)
   692  	case OpPubBarrier:
   693  		v.Op = OpPPC64LoweredPubBarrier
   694  		return true
   695  	case OpRotateLeft16:
   696  		return rewriteValuePPC64_OpRotateLeft16(v)
   697  	case OpRotateLeft32:
   698  		v.Op = OpPPC64ROTLW
   699  		return true
   700  	case OpRotateLeft64:
   701  		v.Op = OpPPC64ROTL
   702  		return true
   703  	case OpRotateLeft8:
   704  		return rewriteValuePPC64_OpRotateLeft8(v)
   705  	case OpRound:
   706  		v.Op = OpPPC64FROUND
   707  		return true
   708  	case OpRound32F:
   709  		v.Op = OpPPC64LoweredRound32F
   710  		return true
   711  	case OpRound64F:
   712  		v.Op = OpPPC64LoweredRound64F
   713  		return true
   714  	case OpRsh16Ux16:
   715  		return rewriteValuePPC64_OpRsh16Ux16(v)
   716  	case OpRsh16Ux32:
   717  		return rewriteValuePPC64_OpRsh16Ux32(v)
   718  	case OpRsh16Ux64:
   719  		return rewriteValuePPC64_OpRsh16Ux64(v)
   720  	case OpRsh16Ux8:
   721  		return rewriteValuePPC64_OpRsh16Ux8(v)
   722  	case OpRsh16x16:
   723  		return rewriteValuePPC64_OpRsh16x16(v)
   724  	case OpRsh16x32:
   725  		return rewriteValuePPC64_OpRsh16x32(v)
   726  	case OpRsh16x64:
   727  		return rewriteValuePPC64_OpRsh16x64(v)
   728  	case OpRsh16x8:
   729  		return rewriteValuePPC64_OpRsh16x8(v)
   730  	case OpRsh32Ux16:
   731  		return rewriteValuePPC64_OpRsh32Ux16(v)
   732  	case OpRsh32Ux32:
   733  		return rewriteValuePPC64_OpRsh32Ux32(v)
   734  	case OpRsh32Ux64:
   735  		return rewriteValuePPC64_OpRsh32Ux64(v)
   736  	case OpRsh32Ux8:
   737  		return rewriteValuePPC64_OpRsh32Ux8(v)
   738  	case OpRsh32x16:
   739  		return rewriteValuePPC64_OpRsh32x16(v)
   740  	case OpRsh32x32:
   741  		return rewriteValuePPC64_OpRsh32x32(v)
   742  	case OpRsh32x64:
   743  		return rewriteValuePPC64_OpRsh32x64(v)
   744  	case OpRsh32x8:
   745  		return rewriteValuePPC64_OpRsh32x8(v)
   746  	case OpRsh64Ux16:
   747  		return rewriteValuePPC64_OpRsh64Ux16(v)
   748  	case OpRsh64Ux32:
   749  		return rewriteValuePPC64_OpRsh64Ux32(v)
   750  	case OpRsh64Ux64:
   751  		return rewriteValuePPC64_OpRsh64Ux64(v)
   752  	case OpRsh64Ux8:
   753  		return rewriteValuePPC64_OpRsh64Ux8(v)
   754  	case OpRsh64x16:
   755  		return rewriteValuePPC64_OpRsh64x16(v)
   756  	case OpRsh64x32:
   757  		return rewriteValuePPC64_OpRsh64x32(v)
   758  	case OpRsh64x64:
   759  		return rewriteValuePPC64_OpRsh64x64(v)
   760  	case OpRsh64x8:
   761  		return rewriteValuePPC64_OpRsh64x8(v)
   762  	case OpRsh8Ux16:
   763  		return rewriteValuePPC64_OpRsh8Ux16(v)
   764  	case OpRsh8Ux32:
   765  		return rewriteValuePPC64_OpRsh8Ux32(v)
   766  	case OpRsh8Ux64:
   767  		return rewriteValuePPC64_OpRsh8Ux64(v)
   768  	case OpRsh8Ux8:
   769  		return rewriteValuePPC64_OpRsh8Ux8(v)
   770  	case OpRsh8x16:
   771  		return rewriteValuePPC64_OpRsh8x16(v)
   772  	case OpRsh8x32:
   773  		return rewriteValuePPC64_OpRsh8x32(v)
   774  	case OpRsh8x64:
   775  		return rewriteValuePPC64_OpRsh8x64(v)
   776  	case OpRsh8x8:
   777  		return rewriteValuePPC64_OpRsh8x8(v)
   778  	case OpSelect0:
   779  		return rewriteValuePPC64_OpSelect0(v)
   780  	case OpSelect1:
   781  		return rewriteValuePPC64_OpSelect1(v)
   782  	case OpSelectN:
   783  		return rewriteValuePPC64_OpSelectN(v)
   784  	case OpSignExt16to32:
   785  		v.Op = OpPPC64MOVHreg
   786  		return true
   787  	case OpSignExt16to64:
   788  		v.Op = OpPPC64MOVHreg
   789  		return true
   790  	case OpSignExt32to64:
   791  		v.Op = OpPPC64MOVWreg
   792  		return true
   793  	case OpSignExt8to16:
   794  		v.Op = OpPPC64MOVBreg
   795  		return true
   796  	case OpSignExt8to32:
   797  		v.Op = OpPPC64MOVBreg
   798  		return true
   799  	case OpSignExt8to64:
   800  		v.Op = OpPPC64MOVBreg
   801  		return true
   802  	case OpSlicemask:
   803  		return rewriteValuePPC64_OpSlicemask(v)
   804  	case OpSqrt:
   805  		v.Op = OpPPC64FSQRT
   806  		return true
   807  	case OpSqrt32:
   808  		v.Op = OpPPC64FSQRTS
   809  		return true
   810  	case OpStaticCall:
   811  		v.Op = OpPPC64CALLstatic
   812  		return true
   813  	case OpStore:
   814  		return rewriteValuePPC64_OpStore(v)
   815  	case OpSub16:
   816  		v.Op = OpPPC64SUB
   817  		return true
   818  	case OpSub32:
   819  		v.Op = OpPPC64SUB
   820  		return true
   821  	case OpSub32F:
   822  		v.Op = OpPPC64FSUBS
   823  		return true
   824  	case OpSub64:
   825  		v.Op = OpPPC64SUB
   826  		return true
   827  	case OpSub64F:
   828  		v.Op = OpPPC64FSUB
   829  		return true
   830  	case OpSub8:
   831  		v.Op = OpPPC64SUB
   832  		return true
   833  	case OpSubPtr:
   834  		v.Op = OpPPC64SUB
   835  		return true
   836  	case OpTailCall:
   837  		v.Op = OpPPC64CALLtail
   838  		return true
   839  	case OpTailCallInter:
   840  		v.Op = OpPPC64CALLtailinter
   841  		return true
   842  	case OpTrunc:
   843  		v.Op = OpPPC64FTRUNC
   844  		return true
   845  	case OpTrunc16to8:
   846  		return rewriteValuePPC64_OpTrunc16to8(v)
   847  	case OpTrunc32to16:
   848  		return rewriteValuePPC64_OpTrunc32to16(v)
   849  	case OpTrunc32to8:
   850  		return rewriteValuePPC64_OpTrunc32to8(v)
   851  	case OpTrunc64to16:
   852  		return rewriteValuePPC64_OpTrunc64to16(v)
   853  	case OpTrunc64to32:
   854  		return rewriteValuePPC64_OpTrunc64to32(v)
   855  	case OpTrunc64to8:
   856  		return rewriteValuePPC64_OpTrunc64to8(v)
   857  	case OpWB:
   858  		v.Op = OpPPC64LoweredWB
   859  		return true
   860  	case OpXor16:
   861  		v.Op = OpPPC64XOR
   862  		return true
   863  	case OpXor32:
   864  		v.Op = OpPPC64XOR
   865  		return true
   866  	case OpXor64:
   867  		v.Op = OpPPC64XOR
   868  		return true
   869  	case OpXor8:
   870  		v.Op = OpPPC64XOR
   871  		return true
   872  	case OpZero:
   873  		return rewriteValuePPC64_OpZero(v)
   874  	case OpZeroExt16to32:
   875  		v.Op = OpPPC64MOVHZreg
   876  		return true
   877  	case OpZeroExt16to64:
   878  		v.Op = OpPPC64MOVHZreg
   879  		return true
   880  	case OpZeroExt32to64:
   881  		v.Op = OpPPC64MOVWZreg
   882  		return true
   883  	case OpZeroExt8to16:
   884  		v.Op = OpPPC64MOVBZreg
   885  		return true
   886  	case OpZeroExt8to32:
   887  		v.Op = OpPPC64MOVBZreg
   888  		return true
   889  	case OpZeroExt8to64:
   890  		v.Op = OpPPC64MOVBZreg
   891  		return true
   892  	}
   893  	return false
   894  }
   895  func rewriteValuePPC64_OpAddr(v *Value) bool {
   896  	v_0 := v.Args[0]
   897  	// match: (Addr {sym} base)
   898  	// result: (MOVDaddr {sym} [0] base)
   899  	for {
   900  		sym := auxToSym(v.Aux)
   901  		base := v_0
   902  		v.reset(OpPPC64MOVDaddr)
   903  		v.AuxInt = int32ToAuxInt(0)
   904  		v.Aux = symToAux(sym)
   905  		v.AddArg(base)
   906  		return true
   907  	}
   908  }
   909  func rewriteValuePPC64_OpAtomicCompareAndSwap32(v *Value) bool {
   910  	v_3 := v.Args[3]
   911  	v_2 := v.Args[2]
   912  	v_1 := v.Args[1]
   913  	v_0 := v.Args[0]
   914  	// match: (AtomicCompareAndSwap32 ptr old new_ mem)
   915  	// result: (LoweredAtomicCas32 [1] ptr old new_ mem)
   916  	for {
   917  		ptr := v_0
   918  		old := v_1
   919  		new_ := v_2
   920  		mem := v_3
   921  		v.reset(OpPPC64LoweredAtomicCas32)
   922  		v.AuxInt = int64ToAuxInt(1)
   923  		v.AddArg4(ptr, old, new_, mem)
   924  		return true
   925  	}
   926  }
   927  func rewriteValuePPC64_OpAtomicCompareAndSwap64(v *Value) bool {
   928  	v_3 := v.Args[3]
   929  	v_2 := v.Args[2]
   930  	v_1 := v.Args[1]
   931  	v_0 := v.Args[0]
   932  	// match: (AtomicCompareAndSwap64 ptr old new_ mem)
   933  	// result: (LoweredAtomicCas64 [1] ptr old new_ mem)
   934  	for {
   935  		ptr := v_0
   936  		old := v_1
   937  		new_ := v_2
   938  		mem := v_3
   939  		v.reset(OpPPC64LoweredAtomicCas64)
   940  		v.AuxInt = int64ToAuxInt(1)
   941  		v.AddArg4(ptr, old, new_, mem)
   942  		return true
   943  	}
   944  }
   945  func rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v *Value) bool {
   946  	v_3 := v.Args[3]
   947  	v_2 := v.Args[2]
   948  	v_1 := v.Args[1]
   949  	v_0 := v.Args[0]
   950  	// match: (AtomicCompareAndSwapRel32 ptr old new_ mem)
   951  	// result: (LoweredAtomicCas32 [0] ptr old new_ mem)
   952  	for {
   953  		ptr := v_0
   954  		old := v_1
   955  		new_ := v_2
   956  		mem := v_3
   957  		v.reset(OpPPC64LoweredAtomicCas32)
   958  		v.AuxInt = int64ToAuxInt(0)
   959  		v.AddArg4(ptr, old, new_, mem)
   960  		return true
   961  	}
   962  }
   963  func rewriteValuePPC64_OpAtomicLoad32(v *Value) bool {
   964  	v_1 := v.Args[1]
   965  	v_0 := v.Args[0]
   966  	// match: (AtomicLoad32 ptr mem)
   967  	// result: (LoweredAtomicLoad32 [1] ptr mem)
   968  	for {
   969  		ptr := v_0
   970  		mem := v_1
   971  		v.reset(OpPPC64LoweredAtomicLoad32)
   972  		v.AuxInt = int64ToAuxInt(1)
   973  		v.AddArg2(ptr, mem)
   974  		return true
   975  	}
   976  }
   977  func rewriteValuePPC64_OpAtomicLoad64(v *Value) bool {
   978  	v_1 := v.Args[1]
   979  	v_0 := v.Args[0]
   980  	// match: (AtomicLoad64 ptr mem)
   981  	// result: (LoweredAtomicLoad64 [1] ptr mem)
   982  	for {
   983  		ptr := v_0
   984  		mem := v_1
   985  		v.reset(OpPPC64LoweredAtomicLoad64)
   986  		v.AuxInt = int64ToAuxInt(1)
   987  		v.AddArg2(ptr, mem)
   988  		return true
   989  	}
   990  }
   991  func rewriteValuePPC64_OpAtomicLoad8(v *Value) bool {
   992  	v_1 := v.Args[1]
   993  	v_0 := v.Args[0]
   994  	// match: (AtomicLoad8 ptr mem)
   995  	// result: (LoweredAtomicLoad8 [1] ptr mem)
   996  	for {
   997  		ptr := v_0
   998  		mem := v_1
   999  		v.reset(OpPPC64LoweredAtomicLoad8)
  1000  		v.AuxInt = int64ToAuxInt(1)
  1001  		v.AddArg2(ptr, mem)
  1002  		return true
  1003  	}
  1004  }
  1005  func rewriteValuePPC64_OpAtomicLoadAcq32(v *Value) bool {
  1006  	v_1 := v.Args[1]
  1007  	v_0 := v.Args[0]
  1008  	// match: (AtomicLoadAcq32 ptr mem)
  1009  	// result: (LoweredAtomicLoad32 [0] ptr mem)
  1010  	for {
  1011  		ptr := v_0
  1012  		mem := v_1
  1013  		v.reset(OpPPC64LoweredAtomicLoad32)
  1014  		v.AuxInt = int64ToAuxInt(0)
  1015  		v.AddArg2(ptr, mem)
  1016  		return true
  1017  	}
  1018  }
  1019  func rewriteValuePPC64_OpAtomicLoadAcq64(v *Value) bool {
  1020  	v_1 := v.Args[1]
  1021  	v_0 := v.Args[0]
  1022  	// match: (AtomicLoadAcq64 ptr mem)
  1023  	// result: (LoweredAtomicLoad64 [0] ptr mem)
  1024  	for {
  1025  		ptr := v_0
  1026  		mem := v_1
  1027  		v.reset(OpPPC64LoweredAtomicLoad64)
  1028  		v.AuxInt = int64ToAuxInt(0)
  1029  		v.AddArg2(ptr, mem)
  1030  		return true
  1031  	}
  1032  }
  1033  func rewriteValuePPC64_OpAtomicLoadPtr(v *Value) bool {
  1034  	v_1 := v.Args[1]
  1035  	v_0 := v.Args[0]
  1036  	// match: (AtomicLoadPtr ptr mem)
  1037  	// result: (LoweredAtomicLoadPtr [1] ptr mem)
  1038  	for {
  1039  		ptr := v_0
  1040  		mem := v_1
  1041  		v.reset(OpPPC64LoweredAtomicLoadPtr)
  1042  		v.AuxInt = int64ToAuxInt(1)
  1043  		v.AddArg2(ptr, mem)
  1044  		return true
  1045  	}
  1046  }
  1047  func rewriteValuePPC64_OpAtomicStore32(v *Value) bool {
  1048  	v_2 := v.Args[2]
  1049  	v_1 := v.Args[1]
  1050  	v_0 := v.Args[0]
  1051  	// match: (AtomicStore32 ptr val mem)
  1052  	// result: (LoweredAtomicStore32 [1] ptr val mem)
  1053  	for {
  1054  		ptr := v_0
  1055  		val := v_1
  1056  		mem := v_2
  1057  		v.reset(OpPPC64LoweredAtomicStore32)
  1058  		v.AuxInt = int64ToAuxInt(1)
  1059  		v.AddArg3(ptr, val, mem)
  1060  		return true
  1061  	}
  1062  }
  1063  func rewriteValuePPC64_OpAtomicStore64(v *Value) bool {
  1064  	v_2 := v.Args[2]
  1065  	v_1 := v.Args[1]
  1066  	v_0 := v.Args[0]
  1067  	// match: (AtomicStore64 ptr val mem)
  1068  	// result: (LoweredAtomicStore64 [1] ptr val mem)
  1069  	for {
  1070  		ptr := v_0
  1071  		val := v_1
  1072  		mem := v_2
  1073  		v.reset(OpPPC64LoweredAtomicStore64)
  1074  		v.AuxInt = int64ToAuxInt(1)
  1075  		v.AddArg3(ptr, val, mem)
  1076  		return true
  1077  	}
  1078  }
  1079  func rewriteValuePPC64_OpAtomicStore8(v *Value) bool {
  1080  	v_2 := v.Args[2]
  1081  	v_1 := v.Args[1]
  1082  	v_0 := v.Args[0]
  1083  	// match: (AtomicStore8 ptr val mem)
  1084  	// result: (LoweredAtomicStore8 [1] ptr val mem)
  1085  	for {
  1086  		ptr := v_0
  1087  		val := v_1
  1088  		mem := v_2
  1089  		v.reset(OpPPC64LoweredAtomicStore8)
  1090  		v.AuxInt = int64ToAuxInt(1)
  1091  		v.AddArg3(ptr, val, mem)
  1092  		return true
  1093  	}
  1094  }
  1095  func rewriteValuePPC64_OpAtomicStoreRel32(v *Value) bool {
  1096  	v_2 := v.Args[2]
  1097  	v_1 := v.Args[1]
  1098  	v_0 := v.Args[0]
  1099  	// match: (AtomicStoreRel32 ptr val mem)
  1100  	// result: (LoweredAtomicStore32 [0] ptr val mem)
  1101  	for {
  1102  		ptr := v_0
  1103  		val := v_1
  1104  		mem := v_2
  1105  		v.reset(OpPPC64LoweredAtomicStore32)
  1106  		v.AuxInt = int64ToAuxInt(0)
  1107  		v.AddArg3(ptr, val, mem)
  1108  		return true
  1109  	}
  1110  }
  1111  func rewriteValuePPC64_OpAtomicStoreRel64(v *Value) bool {
  1112  	v_2 := v.Args[2]
  1113  	v_1 := v.Args[1]
  1114  	v_0 := v.Args[0]
  1115  	// match: (AtomicStoreRel64 ptr val mem)
  1116  	// result: (LoweredAtomicStore64 [0] ptr val mem)
  1117  	for {
  1118  		ptr := v_0
  1119  		val := v_1
  1120  		mem := v_2
  1121  		v.reset(OpPPC64LoweredAtomicStore64)
  1122  		v.AuxInt = int64ToAuxInt(0)
  1123  		v.AddArg3(ptr, val, mem)
  1124  		return true
  1125  	}
  1126  }
  1127  func rewriteValuePPC64_OpAvg64u(v *Value) bool {
  1128  	v_1 := v.Args[1]
  1129  	v_0 := v.Args[0]
  1130  	b := v.Block
  1131  	// match: (Avg64u <t> x y)
  1132  	// result: (ADD (SRDconst <t> (SUB <t> x y) [1]) y)
  1133  	for {
  1134  		t := v.Type
  1135  		x := v_0
  1136  		y := v_1
  1137  		v.reset(OpPPC64ADD)
  1138  		v0 := b.NewValue0(v.Pos, OpPPC64SRDconst, t)
  1139  		v0.AuxInt = int64ToAuxInt(1)
  1140  		v1 := b.NewValue0(v.Pos, OpPPC64SUB, t)
  1141  		v1.AddArg2(x, y)
  1142  		v0.AddArg(v1)
  1143  		v.AddArg2(v0, y)
  1144  		return true
  1145  	}
  1146  }
  1147  func rewriteValuePPC64_OpBitLen16(v *Value) bool {
  1148  	v_0 := v.Args[0]
  1149  	b := v.Block
  1150  	typ := &b.Func.Config.Types
  1151  	// match: (BitLen16 x)
  1152  	// result: (BitLen64 (ZeroExt16to64 x))
  1153  	for {
  1154  		x := v_0
  1155  		v.reset(OpBitLen64)
  1156  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1157  		v0.AddArg(x)
  1158  		v.AddArg(v0)
  1159  		return true
  1160  	}
  1161  }
  1162  func rewriteValuePPC64_OpBitLen32(v *Value) bool {
  1163  	v_0 := v.Args[0]
  1164  	b := v.Block
  1165  	typ := &b.Func.Config.Types
  1166  	// match: (BitLen32 x)
  1167  	// result: (SUBFCconst [32] (CNTLZW <typ.Int> x))
  1168  	for {
  1169  		x := v_0
  1170  		v.reset(OpPPC64SUBFCconst)
  1171  		v.AuxInt = int64ToAuxInt(32)
  1172  		v0 := b.NewValue0(v.Pos, OpPPC64CNTLZW, typ.Int)
  1173  		v0.AddArg(x)
  1174  		v.AddArg(v0)
  1175  		return true
  1176  	}
  1177  }
  1178  func rewriteValuePPC64_OpBitLen64(v *Value) bool {
  1179  	v_0 := v.Args[0]
  1180  	b := v.Block
  1181  	typ := &b.Func.Config.Types
  1182  	// match: (BitLen64 x)
  1183  	// result: (SUBFCconst [64] (CNTLZD <typ.Int> x))
  1184  	for {
  1185  		x := v_0
  1186  		v.reset(OpPPC64SUBFCconst)
  1187  		v.AuxInt = int64ToAuxInt(64)
  1188  		v0 := b.NewValue0(v.Pos, OpPPC64CNTLZD, typ.Int)
  1189  		v0.AddArg(x)
  1190  		v.AddArg(v0)
  1191  		return true
  1192  	}
  1193  }
  1194  func rewriteValuePPC64_OpBitLen8(v *Value) bool {
  1195  	v_0 := v.Args[0]
  1196  	b := v.Block
  1197  	typ := &b.Func.Config.Types
  1198  	// match: (BitLen8 x)
  1199  	// result: (BitLen64 (ZeroExt8to64 x))
  1200  	for {
  1201  		x := v_0
  1202  		v.reset(OpBitLen64)
  1203  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1204  		v0.AddArg(x)
  1205  		v.AddArg(v0)
  1206  		return true
  1207  	}
  1208  }
  1209  func rewriteValuePPC64_OpBswap16(v *Value) bool {
  1210  	v_0 := v.Args[0]
  1211  	b := v.Block
  1212  	typ := &b.Func.Config.Types
  1213  	// match: (Bswap16 x)
  1214  	// cond: buildcfg.GOPPC64>=10
  1215  	// result: (BRH x)
  1216  	for {
  1217  		x := v_0
  1218  		if !(buildcfg.GOPPC64 >= 10) {
  1219  			break
  1220  		}
  1221  		v.reset(OpPPC64BRH)
  1222  		v.AddArg(x)
  1223  		return true
  1224  	}
  1225  	// match: (Bswap16 x:(MOVHZload [off] {sym} ptr mem))
  1226  	// result: @x.Block (MOVHBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1227  	for {
  1228  		x := v_0
  1229  		if x.Op != OpPPC64MOVHZload {
  1230  			break
  1231  		}
  1232  		off := auxIntToInt32(x.AuxInt)
  1233  		sym := auxToSym(x.Aux)
  1234  		mem := x.Args[1]
  1235  		ptr := x.Args[0]
  1236  		b = x.Block
  1237  		v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
  1238  		v.copyOf(v0)
  1239  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  1240  		v1.AuxInt = int32ToAuxInt(off)
  1241  		v1.Aux = symToAux(sym)
  1242  		v1.AddArg(ptr)
  1243  		v0.AddArg2(v1, mem)
  1244  		return true
  1245  	}
  1246  	// match: (Bswap16 x:(MOVHZloadidx ptr idx mem))
  1247  	// result: @x.Block (MOVHBRloadidx ptr idx mem)
  1248  	for {
  1249  		x := v_0
  1250  		if x.Op != OpPPC64MOVHZloadidx {
  1251  			break
  1252  		}
  1253  		mem := x.Args[2]
  1254  		ptr := x.Args[0]
  1255  		idx := x.Args[1]
  1256  		b = x.Block
  1257  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
  1258  		v.copyOf(v0)
  1259  		v0.AddArg3(ptr, idx, mem)
  1260  		return true
  1261  	}
  1262  	return false
  1263  }
  1264  func rewriteValuePPC64_OpBswap32(v *Value) bool {
  1265  	v_0 := v.Args[0]
  1266  	b := v.Block
  1267  	typ := &b.Func.Config.Types
  1268  	// match: (Bswap32 x)
  1269  	// cond: buildcfg.GOPPC64>=10
  1270  	// result: (BRW x)
  1271  	for {
  1272  		x := v_0
  1273  		if !(buildcfg.GOPPC64 >= 10) {
  1274  			break
  1275  		}
  1276  		v.reset(OpPPC64BRW)
  1277  		v.AddArg(x)
  1278  		return true
  1279  	}
  1280  	// match: (Bswap32 x:(MOVWZload [off] {sym} ptr mem))
  1281  	// result: @x.Block (MOVWBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1282  	for {
  1283  		x := v_0
  1284  		if x.Op != OpPPC64MOVWZload {
  1285  			break
  1286  		}
  1287  		off := auxIntToInt32(x.AuxInt)
  1288  		sym := auxToSym(x.Aux)
  1289  		mem := x.Args[1]
  1290  		ptr := x.Args[0]
  1291  		b = x.Block
  1292  		v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
  1293  		v.copyOf(v0)
  1294  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  1295  		v1.AuxInt = int32ToAuxInt(off)
  1296  		v1.Aux = symToAux(sym)
  1297  		v1.AddArg(ptr)
  1298  		v0.AddArg2(v1, mem)
  1299  		return true
  1300  	}
  1301  	// match: (Bswap32 x:(MOVWZloadidx ptr idx mem))
  1302  	// result: @x.Block (MOVWBRloadidx ptr idx mem)
  1303  	for {
  1304  		x := v_0
  1305  		if x.Op != OpPPC64MOVWZloadidx {
  1306  			break
  1307  		}
  1308  		mem := x.Args[2]
  1309  		ptr := x.Args[0]
  1310  		idx := x.Args[1]
  1311  		b = x.Block
  1312  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
  1313  		v.copyOf(v0)
  1314  		v0.AddArg3(ptr, idx, mem)
  1315  		return true
  1316  	}
  1317  	return false
  1318  }
  1319  func rewriteValuePPC64_OpBswap64(v *Value) bool {
  1320  	v_0 := v.Args[0]
  1321  	b := v.Block
  1322  	typ := &b.Func.Config.Types
  1323  	// match: (Bswap64 x)
  1324  	// cond: buildcfg.GOPPC64>=10
  1325  	// result: (BRD x)
  1326  	for {
  1327  		x := v_0
  1328  		if !(buildcfg.GOPPC64 >= 10) {
  1329  			break
  1330  		}
  1331  		v.reset(OpPPC64BRD)
  1332  		v.AddArg(x)
  1333  		return true
  1334  	}
  1335  	// match: (Bswap64 x:(MOVDload [off] {sym} ptr mem))
  1336  	// result: @x.Block (MOVDBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1337  	for {
  1338  		x := v_0
  1339  		if x.Op != OpPPC64MOVDload {
  1340  			break
  1341  		}
  1342  		off := auxIntToInt32(x.AuxInt)
  1343  		sym := auxToSym(x.Aux)
  1344  		mem := x.Args[1]
  1345  		ptr := x.Args[0]
  1346  		b = x.Block
  1347  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
  1348  		v.copyOf(v0)
  1349  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  1350  		v1.AuxInt = int32ToAuxInt(off)
  1351  		v1.Aux = symToAux(sym)
  1352  		v1.AddArg(ptr)
  1353  		v0.AddArg2(v1, mem)
  1354  		return true
  1355  	}
  1356  	// match: (Bswap64 x:(MOVDloadidx ptr idx mem))
  1357  	// result: @x.Block (MOVDBRloadidx ptr idx mem)
  1358  	for {
  1359  		x := v_0
  1360  		if x.Op != OpPPC64MOVDloadidx {
  1361  			break
  1362  		}
  1363  		mem := x.Args[2]
  1364  		ptr := x.Args[0]
  1365  		idx := x.Args[1]
  1366  		b = x.Block
  1367  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
  1368  		v.copyOf(v0)
  1369  		v0.AddArg3(ptr, idx, mem)
  1370  		return true
  1371  	}
  1372  	return false
  1373  }
  1374  func rewriteValuePPC64_OpCom16(v *Value) bool {
  1375  	v_0 := v.Args[0]
  1376  	// match: (Com16 x)
  1377  	// result: (NOR x x)
  1378  	for {
  1379  		x := v_0
  1380  		v.reset(OpPPC64NOR)
  1381  		v.AddArg2(x, x)
  1382  		return true
  1383  	}
  1384  }
  1385  func rewriteValuePPC64_OpCom32(v *Value) bool {
  1386  	v_0 := v.Args[0]
  1387  	// match: (Com32 x)
  1388  	// result: (NOR x x)
  1389  	for {
  1390  		x := v_0
  1391  		v.reset(OpPPC64NOR)
  1392  		v.AddArg2(x, x)
  1393  		return true
  1394  	}
  1395  }
  1396  func rewriteValuePPC64_OpCom64(v *Value) bool {
  1397  	v_0 := v.Args[0]
  1398  	// match: (Com64 x)
  1399  	// result: (NOR x x)
  1400  	for {
  1401  		x := v_0
  1402  		v.reset(OpPPC64NOR)
  1403  		v.AddArg2(x, x)
  1404  		return true
  1405  	}
  1406  }
  1407  func rewriteValuePPC64_OpCom8(v *Value) bool {
  1408  	v_0 := v.Args[0]
  1409  	// match: (Com8 x)
  1410  	// result: (NOR x x)
  1411  	for {
  1412  		x := v_0
  1413  		v.reset(OpPPC64NOR)
  1414  		v.AddArg2(x, x)
  1415  		return true
  1416  	}
  1417  }
  1418  func rewriteValuePPC64_OpCondSelect(v *Value) bool {
  1419  	v_2 := v.Args[2]
  1420  	v_1 := v.Args[1]
  1421  	v_0 := v.Args[0]
  1422  	b := v.Block
  1423  	typ := &b.Func.Config.Types
  1424  	// match: (CondSelect x y (SETBC [a] cmp))
  1425  	// result: (ISEL [a] x y cmp)
  1426  	for {
  1427  		x := v_0
  1428  		y := v_1
  1429  		if v_2.Op != OpPPC64SETBC {
  1430  			break
  1431  		}
  1432  		a := auxIntToInt32(v_2.AuxInt)
  1433  		cmp := v_2.Args[0]
  1434  		v.reset(OpPPC64ISEL)
  1435  		v.AuxInt = int32ToAuxInt(a)
  1436  		v.AddArg3(x, y, cmp)
  1437  		return true
  1438  	}
  1439  	// match: (CondSelect x y (SETBCR [a] cmp))
  1440  	// result: (ISEL [a+4] x y cmp)
  1441  	for {
  1442  		x := v_0
  1443  		y := v_1
  1444  		if v_2.Op != OpPPC64SETBCR {
  1445  			break
  1446  		}
  1447  		a := auxIntToInt32(v_2.AuxInt)
  1448  		cmp := v_2.Args[0]
  1449  		v.reset(OpPPC64ISEL)
  1450  		v.AuxInt = int32ToAuxInt(a + 4)
  1451  		v.AddArg3(x, y, cmp)
  1452  		return true
  1453  	}
  1454  	// match: (CondSelect x y bool)
  1455  	// cond: flagArg(bool) == nil
  1456  	// result: (ISEL [6] x y (CMPconst [0] (ANDconst [1] bool)))
  1457  	for {
  1458  		x := v_0
  1459  		y := v_1
  1460  		bool := v_2
  1461  		if !(flagArg(bool) == nil) {
  1462  			break
  1463  		}
  1464  		v.reset(OpPPC64ISEL)
  1465  		v.AuxInt = int32ToAuxInt(6)
  1466  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  1467  		v0.AuxInt = int64ToAuxInt(0)
  1468  		v1 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  1469  		v1.AuxInt = int64ToAuxInt(1)
  1470  		v1.AddArg(bool)
  1471  		v0.AddArg(v1)
  1472  		v.AddArg3(x, y, v0)
  1473  		return true
  1474  	}
  1475  	return false
  1476  }
  1477  func rewriteValuePPC64_OpConst16(v *Value) bool {
  1478  	// match: (Const16 [val])
  1479  	// result: (MOVDconst [int64(val)])
  1480  	for {
  1481  		val := auxIntToInt16(v.AuxInt)
  1482  		v.reset(OpPPC64MOVDconst)
  1483  		v.AuxInt = int64ToAuxInt(int64(val))
  1484  		return true
  1485  	}
  1486  }
  1487  func rewriteValuePPC64_OpConst32(v *Value) bool {
  1488  	// match: (Const32 [val])
  1489  	// result: (MOVDconst [int64(val)])
  1490  	for {
  1491  		val := auxIntToInt32(v.AuxInt)
  1492  		v.reset(OpPPC64MOVDconst)
  1493  		v.AuxInt = int64ToAuxInt(int64(val))
  1494  		return true
  1495  	}
  1496  }
  1497  func rewriteValuePPC64_OpConst64(v *Value) bool {
  1498  	// match: (Const64 [val])
  1499  	// result: (MOVDconst [int64(val)])
  1500  	for {
  1501  		val := auxIntToInt64(v.AuxInt)
  1502  		v.reset(OpPPC64MOVDconst)
  1503  		v.AuxInt = int64ToAuxInt(int64(val))
  1504  		return true
  1505  	}
  1506  }
  1507  func rewriteValuePPC64_OpConst8(v *Value) bool {
  1508  	// match: (Const8 [val])
  1509  	// result: (MOVDconst [int64(val)])
  1510  	for {
  1511  		val := auxIntToInt8(v.AuxInt)
  1512  		v.reset(OpPPC64MOVDconst)
  1513  		v.AuxInt = int64ToAuxInt(int64(val))
  1514  		return true
  1515  	}
  1516  }
  1517  func rewriteValuePPC64_OpConstBool(v *Value) bool {
  1518  	// match: (ConstBool [t])
  1519  	// result: (MOVDconst [b2i(t)])
  1520  	for {
  1521  		t := auxIntToBool(v.AuxInt)
  1522  		v.reset(OpPPC64MOVDconst)
  1523  		v.AuxInt = int64ToAuxInt(b2i(t))
  1524  		return true
  1525  	}
  1526  }
  1527  func rewriteValuePPC64_OpConstNil(v *Value) bool {
  1528  	// match: (ConstNil)
  1529  	// result: (MOVDconst [0])
  1530  	for {
  1531  		v.reset(OpPPC64MOVDconst)
  1532  		v.AuxInt = int64ToAuxInt(0)
  1533  		return true
  1534  	}
  1535  }
  1536  func rewriteValuePPC64_OpCopysign(v *Value) bool {
  1537  	v_1 := v.Args[1]
  1538  	v_0 := v.Args[0]
  1539  	// match: (Copysign x y)
  1540  	// result: (FCPSGN y x)
  1541  	for {
  1542  		x := v_0
  1543  		y := v_1
  1544  		v.reset(OpPPC64FCPSGN)
  1545  		v.AddArg2(y, x)
  1546  		return true
  1547  	}
  1548  }
  1549  func rewriteValuePPC64_OpCtz16(v *Value) bool {
  1550  	v_0 := v.Args[0]
  1551  	b := v.Block
  1552  	typ := &b.Func.Config.Types
  1553  	// match: (Ctz16 x)
  1554  	// cond: buildcfg.GOPPC64 <= 8
  1555  	// result: (POPCNTW (MOVHZreg (ANDN <typ.Int16> (ADDconst <typ.Int16> [-1] x) x)))
  1556  	for {
  1557  		x := v_0
  1558  		if !(buildcfg.GOPPC64 <= 8) {
  1559  			break
  1560  		}
  1561  		v.reset(OpPPC64POPCNTW)
  1562  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  1563  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int16)
  1564  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int16)
  1565  		v2.AuxInt = int64ToAuxInt(-1)
  1566  		v2.AddArg(x)
  1567  		v1.AddArg2(v2, x)
  1568  		v0.AddArg(v1)
  1569  		v.AddArg(v0)
  1570  		return true
  1571  	}
  1572  	// match: (Ctz16 x)
  1573  	// cond: buildcfg.GOPPC64 >= 9
  1574  	// result: (CNTTZD (OR <typ.UInt64> x (MOVDconst [1<<16])))
  1575  	for {
  1576  		x := v_0
  1577  		if !(buildcfg.GOPPC64 >= 9) {
  1578  			break
  1579  		}
  1580  		v.reset(OpPPC64CNTTZD)
  1581  		v0 := b.NewValue0(v.Pos, OpPPC64OR, typ.UInt64)
  1582  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  1583  		v1.AuxInt = int64ToAuxInt(1 << 16)
  1584  		v0.AddArg2(x, v1)
  1585  		v.AddArg(v0)
  1586  		return true
  1587  	}
  1588  	return false
  1589  }
  1590  func rewriteValuePPC64_OpCtz32(v *Value) bool {
  1591  	v_0 := v.Args[0]
  1592  	b := v.Block
  1593  	typ := &b.Func.Config.Types
  1594  	// match: (Ctz32 x)
  1595  	// cond: buildcfg.GOPPC64 <= 8
  1596  	// result: (POPCNTW (MOVWZreg (ANDN <typ.Int> (ADDconst <typ.Int> [-1] x) x)))
  1597  	for {
  1598  		x := v_0
  1599  		if !(buildcfg.GOPPC64 <= 8) {
  1600  			break
  1601  		}
  1602  		v.reset(OpPPC64POPCNTW)
  1603  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
  1604  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int)
  1605  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int)
  1606  		v2.AuxInt = int64ToAuxInt(-1)
  1607  		v2.AddArg(x)
  1608  		v1.AddArg2(v2, x)
  1609  		v0.AddArg(v1)
  1610  		v.AddArg(v0)
  1611  		return true
  1612  	}
  1613  	// match: (Ctz32 x)
  1614  	// cond: buildcfg.GOPPC64 >= 9
  1615  	// result: (CNTTZW (MOVWZreg x))
  1616  	for {
  1617  		x := v_0
  1618  		if !(buildcfg.GOPPC64 >= 9) {
  1619  			break
  1620  		}
  1621  		v.reset(OpPPC64CNTTZW)
  1622  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
  1623  		v0.AddArg(x)
  1624  		v.AddArg(v0)
  1625  		return true
  1626  	}
  1627  	return false
  1628  }
  1629  func rewriteValuePPC64_OpCtz64(v *Value) bool {
  1630  	v_0 := v.Args[0]
  1631  	b := v.Block
  1632  	typ := &b.Func.Config.Types
  1633  	// match: (Ctz64 x)
  1634  	// cond: buildcfg.GOPPC64 <= 8
  1635  	// result: (POPCNTD (ANDN <typ.Int64> (ADDconst <typ.Int64> [-1] x) x))
  1636  	for {
  1637  		x := v_0
  1638  		if !(buildcfg.GOPPC64 <= 8) {
  1639  			break
  1640  		}
  1641  		v.reset(OpPPC64POPCNTD)
  1642  		v0 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int64)
  1643  		v1 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int64)
  1644  		v1.AuxInt = int64ToAuxInt(-1)
  1645  		v1.AddArg(x)
  1646  		v0.AddArg2(v1, x)
  1647  		v.AddArg(v0)
  1648  		return true
  1649  	}
  1650  	// match: (Ctz64 x)
  1651  	// cond: buildcfg.GOPPC64 >= 9
  1652  	// result: (CNTTZD x)
  1653  	for {
  1654  		x := v_0
  1655  		if !(buildcfg.GOPPC64 >= 9) {
  1656  			break
  1657  		}
  1658  		v.reset(OpPPC64CNTTZD)
  1659  		v.AddArg(x)
  1660  		return true
  1661  	}
  1662  	return false
  1663  }
  1664  func rewriteValuePPC64_OpCtz8(v *Value) bool {
  1665  	v_0 := v.Args[0]
  1666  	b := v.Block
  1667  	typ := &b.Func.Config.Types
  1668  	// match: (Ctz8 x)
  1669  	// cond: buildcfg.GOPPC64 <= 8
  1670  	// result: (POPCNTB (MOVBZreg (ANDN <typ.UInt8> (ADDconst <typ.UInt8> [-1] x) x)))
  1671  	for {
  1672  		x := v_0
  1673  		if !(buildcfg.GOPPC64 <= 8) {
  1674  			break
  1675  		}
  1676  		v.reset(OpPPC64POPCNTB)
  1677  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  1678  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.UInt8)
  1679  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.UInt8)
  1680  		v2.AuxInt = int64ToAuxInt(-1)
  1681  		v2.AddArg(x)
  1682  		v1.AddArg2(v2, x)
  1683  		v0.AddArg(v1)
  1684  		v.AddArg(v0)
  1685  		return true
  1686  	}
  1687  	// match: (Ctz8 x)
  1688  	// cond: buildcfg.GOPPC64 >= 9
  1689  	// result: (CNTTZD (OR <typ.UInt64> x (MOVDconst [1<<8])))
  1690  	for {
  1691  		x := v_0
  1692  		if !(buildcfg.GOPPC64 >= 9) {
  1693  			break
  1694  		}
  1695  		v.reset(OpPPC64CNTTZD)
  1696  		v0 := b.NewValue0(v.Pos, OpPPC64OR, typ.UInt64)
  1697  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  1698  		v1.AuxInt = int64ToAuxInt(1 << 8)
  1699  		v0.AddArg2(x, v1)
  1700  		v.AddArg(v0)
  1701  		return true
  1702  	}
  1703  	return false
  1704  }
  1705  func rewriteValuePPC64_OpCvt32Fto32(v *Value) bool {
  1706  	v_0 := v.Args[0]
  1707  	b := v.Block
  1708  	typ := &b.Func.Config.Types
  1709  	// match: (Cvt32Fto32 x)
  1710  	// result: (MFVSRD (FCTIWZ x))
  1711  	for {
  1712  		x := v_0
  1713  		v.reset(OpPPC64MFVSRD)
  1714  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
  1715  		v0.AddArg(x)
  1716  		v.AddArg(v0)
  1717  		return true
  1718  	}
  1719  }
  1720  func rewriteValuePPC64_OpCvt32Fto64(v *Value) bool {
  1721  	v_0 := v.Args[0]
  1722  	b := v.Block
  1723  	typ := &b.Func.Config.Types
  1724  	// match: (Cvt32Fto64 x)
  1725  	// result: (MFVSRD (FCTIDZ x))
  1726  	for {
  1727  		x := v_0
  1728  		v.reset(OpPPC64MFVSRD)
  1729  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
  1730  		v0.AddArg(x)
  1731  		v.AddArg(v0)
  1732  		return true
  1733  	}
  1734  }
  1735  func rewriteValuePPC64_OpCvt32to32F(v *Value) bool {
  1736  	v_0 := v.Args[0]
  1737  	b := v.Block
  1738  	typ := &b.Func.Config.Types
  1739  	// match: (Cvt32to32F x)
  1740  	// result: (FCFIDS (MTVSRD (SignExt32to64 x)))
  1741  	for {
  1742  		x := v_0
  1743  		v.reset(OpPPC64FCFIDS)
  1744  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1745  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1746  		v1.AddArg(x)
  1747  		v0.AddArg(v1)
  1748  		v.AddArg(v0)
  1749  		return true
  1750  	}
  1751  }
  1752  func rewriteValuePPC64_OpCvt32to64F(v *Value) bool {
  1753  	v_0 := v.Args[0]
  1754  	b := v.Block
  1755  	typ := &b.Func.Config.Types
  1756  	// match: (Cvt32to64F x)
  1757  	// result: (FCFID (MTVSRD (SignExt32to64 x)))
  1758  	for {
  1759  		x := v_0
  1760  		v.reset(OpPPC64FCFID)
  1761  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1762  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1763  		v1.AddArg(x)
  1764  		v0.AddArg(v1)
  1765  		v.AddArg(v0)
  1766  		return true
  1767  	}
  1768  }
  1769  func rewriteValuePPC64_OpCvt64Fto32(v *Value) bool {
  1770  	v_0 := v.Args[0]
  1771  	b := v.Block
  1772  	typ := &b.Func.Config.Types
  1773  	// match: (Cvt64Fto32 x)
  1774  	// result: (MFVSRD (FCTIWZ x))
  1775  	for {
  1776  		x := v_0
  1777  		v.reset(OpPPC64MFVSRD)
  1778  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
  1779  		v0.AddArg(x)
  1780  		v.AddArg(v0)
  1781  		return true
  1782  	}
  1783  }
  1784  func rewriteValuePPC64_OpCvt64Fto64(v *Value) bool {
  1785  	v_0 := v.Args[0]
  1786  	b := v.Block
  1787  	typ := &b.Func.Config.Types
  1788  	// match: (Cvt64Fto64 x)
  1789  	// result: (MFVSRD (FCTIDZ x))
  1790  	for {
  1791  		x := v_0
  1792  		v.reset(OpPPC64MFVSRD)
  1793  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
  1794  		v0.AddArg(x)
  1795  		v.AddArg(v0)
  1796  		return true
  1797  	}
  1798  }
  1799  func rewriteValuePPC64_OpCvt64to32F(v *Value) bool {
  1800  	v_0 := v.Args[0]
  1801  	b := v.Block
  1802  	typ := &b.Func.Config.Types
  1803  	// match: (Cvt64to32F x)
  1804  	// result: (FCFIDS (MTVSRD x))
  1805  	for {
  1806  		x := v_0
  1807  		v.reset(OpPPC64FCFIDS)
  1808  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1809  		v0.AddArg(x)
  1810  		v.AddArg(v0)
  1811  		return true
  1812  	}
  1813  }
  1814  func rewriteValuePPC64_OpCvt64to64F(v *Value) bool {
  1815  	v_0 := v.Args[0]
  1816  	b := v.Block
  1817  	typ := &b.Func.Config.Types
  1818  	// match: (Cvt64to64F x)
  1819  	// result: (FCFID (MTVSRD x))
  1820  	for {
  1821  		x := v_0
  1822  		v.reset(OpPPC64FCFID)
  1823  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1824  		v0.AddArg(x)
  1825  		v.AddArg(v0)
  1826  		return true
  1827  	}
  1828  }
  1829  func rewriteValuePPC64_OpDiv16(v *Value) bool {
  1830  	v_1 := v.Args[1]
  1831  	v_0 := v.Args[0]
  1832  	b := v.Block
  1833  	typ := &b.Func.Config.Types
  1834  	// match: (Div16 [false] x y)
  1835  	// result: (DIVW (SignExt16to32 x) (SignExt16to32 y))
  1836  	for {
  1837  		if auxIntToBool(v.AuxInt) != false {
  1838  			break
  1839  		}
  1840  		x := v_0
  1841  		y := v_1
  1842  		v.reset(OpPPC64DIVW)
  1843  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1844  		v0.AddArg(x)
  1845  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1846  		v1.AddArg(y)
  1847  		v.AddArg2(v0, v1)
  1848  		return true
  1849  	}
  1850  	return false
  1851  }
  1852  func rewriteValuePPC64_OpDiv16u(v *Value) bool {
  1853  	v_1 := v.Args[1]
  1854  	v_0 := v.Args[0]
  1855  	b := v.Block
  1856  	typ := &b.Func.Config.Types
  1857  	// match: (Div16u x y)
  1858  	// result: (DIVWU (ZeroExt16to32 x) (ZeroExt16to32 y))
  1859  	for {
  1860  		x := v_0
  1861  		y := v_1
  1862  		v.reset(OpPPC64DIVWU)
  1863  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1864  		v0.AddArg(x)
  1865  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1866  		v1.AddArg(y)
  1867  		v.AddArg2(v0, v1)
  1868  		return true
  1869  	}
  1870  }
  1871  func rewriteValuePPC64_OpDiv32(v *Value) bool {
  1872  	v_1 := v.Args[1]
  1873  	v_0 := v.Args[0]
  1874  	// match: (Div32 [false] x y)
  1875  	// result: (DIVW x y)
  1876  	for {
  1877  		if auxIntToBool(v.AuxInt) != false {
  1878  			break
  1879  		}
  1880  		x := v_0
  1881  		y := v_1
  1882  		v.reset(OpPPC64DIVW)
  1883  		v.AddArg2(x, y)
  1884  		return true
  1885  	}
  1886  	return false
  1887  }
  1888  func rewriteValuePPC64_OpDiv64(v *Value) bool {
  1889  	v_1 := v.Args[1]
  1890  	v_0 := v.Args[0]
  1891  	// match: (Div64 [false] x y)
  1892  	// result: (DIVD x y)
  1893  	for {
  1894  		if auxIntToBool(v.AuxInt) != false {
  1895  			break
  1896  		}
  1897  		x := v_0
  1898  		y := v_1
  1899  		v.reset(OpPPC64DIVD)
  1900  		v.AddArg2(x, y)
  1901  		return true
  1902  	}
  1903  	return false
  1904  }
  1905  func rewriteValuePPC64_OpDiv8(v *Value) bool {
  1906  	v_1 := v.Args[1]
  1907  	v_0 := v.Args[0]
  1908  	b := v.Block
  1909  	typ := &b.Func.Config.Types
  1910  	// match: (Div8 x y)
  1911  	// result: (DIVW (SignExt8to32 x) (SignExt8to32 y))
  1912  	for {
  1913  		x := v_0
  1914  		y := v_1
  1915  		v.reset(OpPPC64DIVW)
  1916  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1917  		v0.AddArg(x)
  1918  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1919  		v1.AddArg(y)
  1920  		v.AddArg2(v0, v1)
  1921  		return true
  1922  	}
  1923  }
  1924  func rewriteValuePPC64_OpDiv8u(v *Value) bool {
  1925  	v_1 := v.Args[1]
  1926  	v_0 := v.Args[0]
  1927  	b := v.Block
  1928  	typ := &b.Func.Config.Types
  1929  	// match: (Div8u x y)
  1930  	// result: (DIVWU (ZeroExt8to32 x) (ZeroExt8to32 y))
  1931  	for {
  1932  		x := v_0
  1933  		y := v_1
  1934  		v.reset(OpPPC64DIVWU)
  1935  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1936  		v0.AddArg(x)
  1937  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1938  		v1.AddArg(y)
  1939  		v.AddArg2(v0, v1)
  1940  		return true
  1941  	}
  1942  }
  1943  func rewriteValuePPC64_OpEq16(v *Value) bool {
  1944  	v_1 := v.Args[1]
  1945  	v_0 := v.Args[0]
  1946  	b := v.Block
  1947  	typ := &b.Func.Config.Types
  1948  	// match: (Eq16 x y)
  1949  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  1950  	// result: (Equal (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  1951  	for {
  1952  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1953  			x := v_0
  1954  			y := v_1
  1955  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  1956  				continue
  1957  			}
  1958  			v.reset(OpPPC64Equal)
  1959  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1960  			v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1961  			v1.AddArg(x)
  1962  			v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1963  			v2.AddArg(y)
  1964  			v0.AddArg2(v1, v2)
  1965  			v.AddArg(v0)
  1966  			return true
  1967  		}
  1968  		break
  1969  	}
  1970  	// match: (Eq16 x y)
  1971  	// result: (Equal (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
  1972  	for {
  1973  		x := v_0
  1974  		y := v_1
  1975  		v.reset(OpPPC64Equal)
  1976  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1977  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1978  		v1.AddArg(x)
  1979  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1980  		v2.AddArg(y)
  1981  		v0.AddArg2(v1, v2)
  1982  		v.AddArg(v0)
  1983  		return true
  1984  	}
  1985  }
  1986  func rewriteValuePPC64_OpEq32(v *Value) bool {
  1987  	v_1 := v.Args[1]
  1988  	v_0 := v.Args[0]
  1989  	b := v.Block
  1990  	// match: (Eq32 x y)
  1991  	// result: (Equal (CMPW x y))
  1992  	for {
  1993  		x := v_0
  1994  		y := v_1
  1995  		v.reset(OpPPC64Equal)
  1996  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1997  		v0.AddArg2(x, y)
  1998  		v.AddArg(v0)
  1999  		return true
  2000  	}
  2001  }
  2002  func rewriteValuePPC64_OpEq32F(v *Value) bool {
  2003  	v_1 := v.Args[1]
  2004  	v_0 := v.Args[0]
  2005  	b := v.Block
  2006  	// match: (Eq32F x y)
  2007  	// result: (Equal (FCMPU x y))
  2008  	for {
  2009  		x := v_0
  2010  		y := v_1
  2011  		v.reset(OpPPC64Equal)
  2012  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2013  		v0.AddArg2(x, y)
  2014  		v.AddArg(v0)
  2015  		return true
  2016  	}
  2017  }
  2018  func rewriteValuePPC64_OpEq64(v *Value) bool {
  2019  	v_1 := v.Args[1]
  2020  	v_0 := v.Args[0]
  2021  	b := v.Block
  2022  	// match: (Eq64 x y)
  2023  	// result: (Equal (CMP x y))
  2024  	for {
  2025  		x := v_0
  2026  		y := v_1
  2027  		v.reset(OpPPC64Equal)
  2028  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2029  		v0.AddArg2(x, y)
  2030  		v.AddArg(v0)
  2031  		return true
  2032  	}
  2033  }
  2034  func rewriteValuePPC64_OpEq64F(v *Value) bool {
  2035  	v_1 := v.Args[1]
  2036  	v_0 := v.Args[0]
  2037  	b := v.Block
  2038  	// match: (Eq64F x y)
  2039  	// result: (Equal (FCMPU x y))
  2040  	for {
  2041  		x := v_0
  2042  		y := v_1
  2043  		v.reset(OpPPC64Equal)
  2044  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2045  		v0.AddArg2(x, y)
  2046  		v.AddArg(v0)
  2047  		return true
  2048  	}
  2049  }
  2050  func rewriteValuePPC64_OpEq8(v *Value) bool {
  2051  	v_1 := v.Args[1]
  2052  	v_0 := v.Args[0]
  2053  	b := v.Block
  2054  	typ := &b.Func.Config.Types
  2055  	// match: (Eq8 x y)
  2056  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  2057  	// result: (Equal (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2058  	for {
  2059  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2060  			x := v_0
  2061  			y := v_1
  2062  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  2063  				continue
  2064  			}
  2065  			v.reset(OpPPC64Equal)
  2066  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2067  			v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2068  			v1.AddArg(x)
  2069  			v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2070  			v2.AddArg(y)
  2071  			v0.AddArg2(v1, v2)
  2072  			v.AddArg(v0)
  2073  			return true
  2074  		}
  2075  		break
  2076  	}
  2077  	// match: (Eq8 x y)
  2078  	// result: (Equal (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2079  	for {
  2080  		x := v_0
  2081  		y := v_1
  2082  		v.reset(OpPPC64Equal)
  2083  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2084  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2085  		v1.AddArg(x)
  2086  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2087  		v2.AddArg(y)
  2088  		v0.AddArg2(v1, v2)
  2089  		v.AddArg(v0)
  2090  		return true
  2091  	}
  2092  }
  2093  func rewriteValuePPC64_OpEqB(v *Value) bool {
  2094  	v_1 := v.Args[1]
  2095  	v_0 := v.Args[0]
  2096  	b := v.Block
  2097  	typ := &b.Func.Config.Types
  2098  	// match: (EqB x y)
  2099  	// result: (ANDconst [1] (EQV x y))
  2100  	for {
  2101  		x := v_0
  2102  		y := v_1
  2103  		v.reset(OpPPC64ANDconst)
  2104  		v.AuxInt = int64ToAuxInt(1)
  2105  		v0 := b.NewValue0(v.Pos, OpPPC64EQV, typ.Int64)
  2106  		v0.AddArg2(x, y)
  2107  		v.AddArg(v0)
  2108  		return true
  2109  	}
  2110  }
  2111  func rewriteValuePPC64_OpEqPtr(v *Value) bool {
  2112  	v_1 := v.Args[1]
  2113  	v_0 := v.Args[0]
  2114  	b := v.Block
  2115  	// match: (EqPtr x y)
  2116  	// result: (Equal (CMP x y))
  2117  	for {
  2118  		x := v_0
  2119  		y := v_1
  2120  		v.reset(OpPPC64Equal)
  2121  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2122  		v0.AddArg2(x, y)
  2123  		v.AddArg(v0)
  2124  		return true
  2125  	}
  2126  }
  2127  func rewriteValuePPC64_OpIsInBounds(v *Value) bool {
  2128  	v_1 := v.Args[1]
  2129  	v_0 := v.Args[0]
  2130  	b := v.Block
  2131  	// match: (IsInBounds idx len)
  2132  	// result: (LessThan (CMPU idx len))
  2133  	for {
  2134  		idx := v_0
  2135  		len := v_1
  2136  		v.reset(OpPPC64LessThan)
  2137  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2138  		v0.AddArg2(idx, len)
  2139  		v.AddArg(v0)
  2140  		return true
  2141  	}
  2142  }
  2143  func rewriteValuePPC64_OpIsNonNil(v *Value) bool {
  2144  	v_0 := v.Args[0]
  2145  	b := v.Block
  2146  	// match: (IsNonNil ptr)
  2147  	// result: (NotEqual (CMPconst [0] ptr))
  2148  	for {
  2149  		ptr := v_0
  2150  		v.reset(OpPPC64NotEqual)
  2151  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2152  		v0.AuxInt = int64ToAuxInt(0)
  2153  		v0.AddArg(ptr)
  2154  		v.AddArg(v0)
  2155  		return true
  2156  	}
  2157  }
  2158  func rewriteValuePPC64_OpIsSliceInBounds(v *Value) bool {
  2159  	v_1 := v.Args[1]
  2160  	v_0 := v.Args[0]
  2161  	b := v.Block
  2162  	// match: (IsSliceInBounds idx len)
  2163  	// result: (LessEqual (CMPU idx len))
  2164  	for {
  2165  		idx := v_0
  2166  		len := v_1
  2167  		v.reset(OpPPC64LessEqual)
  2168  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2169  		v0.AddArg2(idx, len)
  2170  		v.AddArg(v0)
  2171  		return true
  2172  	}
  2173  }
  2174  func rewriteValuePPC64_OpLeq16(v *Value) bool {
  2175  	v_1 := v.Args[1]
  2176  	v_0 := v.Args[0]
  2177  	b := v.Block
  2178  	typ := &b.Func.Config.Types
  2179  	// match: (Leq16 x y)
  2180  	// result: (LessEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  2181  	for {
  2182  		x := v_0
  2183  		y := v_1
  2184  		v.reset(OpPPC64LessEqual)
  2185  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2186  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2187  		v1.AddArg(x)
  2188  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2189  		v2.AddArg(y)
  2190  		v0.AddArg2(v1, v2)
  2191  		v.AddArg(v0)
  2192  		return true
  2193  	}
  2194  }
  2195  func rewriteValuePPC64_OpLeq16U(v *Value) bool {
  2196  	v_1 := v.Args[1]
  2197  	v_0 := v.Args[0]
  2198  	b := v.Block
  2199  	typ := &b.Func.Config.Types
  2200  	// match: (Leq16U x y)
  2201  	// result: (LessEqual (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  2202  	for {
  2203  		x := v_0
  2204  		y := v_1
  2205  		v.reset(OpPPC64LessEqual)
  2206  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2207  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2208  		v1.AddArg(x)
  2209  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2210  		v2.AddArg(y)
  2211  		v0.AddArg2(v1, v2)
  2212  		v.AddArg(v0)
  2213  		return true
  2214  	}
  2215  }
  2216  func rewriteValuePPC64_OpLeq32(v *Value) bool {
  2217  	v_1 := v.Args[1]
  2218  	v_0 := v.Args[0]
  2219  	b := v.Block
  2220  	// match: (Leq32 x y)
  2221  	// result: (LessEqual (CMPW x y))
  2222  	for {
  2223  		x := v_0
  2224  		y := v_1
  2225  		v.reset(OpPPC64LessEqual)
  2226  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2227  		v0.AddArg2(x, y)
  2228  		v.AddArg(v0)
  2229  		return true
  2230  	}
  2231  }
  2232  func rewriteValuePPC64_OpLeq32F(v *Value) bool {
  2233  	v_1 := v.Args[1]
  2234  	v_0 := v.Args[0]
  2235  	b := v.Block
  2236  	// match: (Leq32F x y)
  2237  	// result: (FLessEqual (FCMPU x y))
  2238  	for {
  2239  		x := v_0
  2240  		y := v_1
  2241  		v.reset(OpPPC64FLessEqual)
  2242  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2243  		v0.AddArg2(x, y)
  2244  		v.AddArg(v0)
  2245  		return true
  2246  	}
  2247  }
  2248  func rewriteValuePPC64_OpLeq32U(v *Value) bool {
  2249  	v_1 := v.Args[1]
  2250  	v_0 := v.Args[0]
  2251  	b := v.Block
  2252  	// match: (Leq32U x y)
  2253  	// result: (LessEqual (CMPWU x y))
  2254  	for {
  2255  		x := v_0
  2256  		y := v_1
  2257  		v.reset(OpPPC64LessEqual)
  2258  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2259  		v0.AddArg2(x, y)
  2260  		v.AddArg(v0)
  2261  		return true
  2262  	}
  2263  }
  2264  func rewriteValuePPC64_OpLeq64(v *Value) bool {
  2265  	v_1 := v.Args[1]
  2266  	v_0 := v.Args[0]
  2267  	b := v.Block
  2268  	// match: (Leq64 x y)
  2269  	// result: (LessEqual (CMP x y))
  2270  	for {
  2271  		x := v_0
  2272  		y := v_1
  2273  		v.reset(OpPPC64LessEqual)
  2274  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2275  		v0.AddArg2(x, y)
  2276  		v.AddArg(v0)
  2277  		return true
  2278  	}
  2279  }
  2280  func rewriteValuePPC64_OpLeq64F(v *Value) bool {
  2281  	v_1 := v.Args[1]
  2282  	v_0 := v.Args[0]
  2283  	b := v.Block
  2284  	// match: (Leq64F x y)
  2285  	// result: (FLessEqual (FCMPU x y))
  2286  	for {
  2287  		x := v_0
  2288  		y := v_1
  2289  		v.reset(OpPPC64FLessEqual)
  2290  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2291  		v0.AddArg2(x, y)
  2292  		v.AddArg(v0)
  2293  		return true
  2294  	}
  2295  }
  2296  func rewriteValuePPC64_OpLeq64U(v *Value) bool {
  2297  	v_1 := v.Args[1]
  2298  	v_0 := v.Args[0]
  2299  	b := v.Block
  2300  	// match: (Leq64U x y)
  2301  	// result: (LessEqual (CMPU x y))
  2302  	for {
  2303  		x := v_0
  2304  		y := v_1
  2305  		v.reset(OpPPC64LessEqual)
  2306  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2307  		v0.AddArg2(x, y)
  2308  		v.AddArg(v0)
  2309  		return true
  2310  	}
  2311  }
  2312  func rewriteValuePPC64_OpLeq8(v *Value) bool {
  2313  	v_1 := v.Args[1]
  2314  	v_0 := v.Args[0]
  2315  	b := v.Block
  2316  	typ := &b.Func.Config.Types
  2317  	// match: (Leq8 x y)
  2318  	// result: (LessEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2319  	for {
  2320  		x := v_0
  2321  		y := v_1
  2322  		v.reset(OpPPC64LessEqual)
  2323  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2324  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2325  		v1.AddArg(x)
  2326  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2327  		v2.AddArg(y)
  2328  		v0.AddArg2(v1, v2)
  2329  		v.AddArg(v0)
  2330  		return true
  2331  	}
  2332  }
  2333  func rewriteValuePPC64_OpLeq8U(v *Value) bool {
  2334  	v_1 := v.Args[1]
  2335  	v_0 := v.Args[0]
  2336  	b := v.Block
  2337  	typ := &b.Func.Config.Types
  2338  	// match: (Leq8U x y)
  2339  	// result: (LessEqual (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2340  	for {
  2341  		x := v_0
  2342  		y := v_1
  2343  		v.reset(OpPPC64LessEqual)
  2344  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2345  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2346  		v1.AddArg(x)
  2347  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2348  		v2.AddArg(y)
  2349  		v0.AddArg2(v1, v2)
  2350  		v.AddArg(v0)
  2351  		return true
  2352  	}
  2353  }
  2354  func rewriteValuePPC64_OpLess16(v *Value) bool {
  2355  	v_1 := v.Args[1]
  2356  	v_0 := v.Args[0]
  2357  	b := v.Block
  2358  	typ := &b.Func.Config.Types
  2359  	// match: (Less16 x y)
  2360  	// result: (LessThan (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  2361  	for {
  2362  		x := v_0
  2363  		y := v_1
  2364  		v.reset(OpPPC64LessThan)
  2365  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2366  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2367  		v1.AddArg(x)
  2368  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2369  		v2.AddArg(y)
  2370  		v0.AddArg2(v1, v2)
  2371  		v.AddArg(v0)
  2372  		return true
  2373  	}
  2374  }
  2375  func rewriteValuePPC64_OpLess16U(v *Value) bool {
  2376  	v_1 := v.Args[1]
  2377  	v_0 := v.Args[0]
  2378  	b := v.Block
  2379  	typ := &b.Func.Config.Types
  2380  	// match: (Less16U x y)
  2381  	// result: (LessThan (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  2382  	for {
  2383  		x := v_0
  2384  		y := v_1
  2385  		v.reset(OpPPC64LessThan)
  2386  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2387  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2388  		v1.AddArg(x)
  2389  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2390  		v2.AddArg(y)
  2391  		v0.AddArg2(v1, v2)
  2392  		v.AddArg(v0)
  2393  		return true
  2394  	}
  2395  }
  2396  func rewriteValuePPC64_OpLess32(v *Value) bool {
  2397  	v_1 := v.Args[1]
  2398  	v_0 := v.Args[0]
  2399  	b := v.Block
  2400  	// match: (Less32 x y)
  2401  	// result: (LessThan (CMPW x y))
  2402  	for {
  2403  		x := v_0
  2404  		y := v_1
  2405  		v.reset(OpPPC64LessThan)
  2406  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2407  		v0.AddArg2(x, y)
  2408  		v.AddArg(v0)
  2409  		return true
  2410  	}
  2411  }
  2412  func rewriteValuePPC64_OpLess32F(v *Value) bool {
  2413  	v_1 := v.Args[1]
  2414  	v_0 := v.Args[0]
  2415  	b := v.Block
  2416  	// match: (Less32F x y)
  2417  	// result: (FLessThan (FCMPU x y))
  2418  	for {
  2419  		x := v_0
  2420  		y := v_1
  2421  		v.reset(OpPPC64FLessThan)
  2422  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2423  		v0.AddArg2(x, y)
  2424  		v.AddArg(v0)
  2425  		return true
  2426  	}
  2427  }
  2428  func rewriteValuePPC64_OpLess32U(v *Value) bool {
  2429  	v_1 := v.Args[1]
  2430  	v_0 := v.Args[0]
  2431  	b := v.Block
  2432  	// match: (Less32U x y)
  2433  	// result: (LessThan (CMPWU x y))
  2434  	for {
  2435  		x := v_0
  2436  		y := v_1
  2437  		v.reset(OpPPC64LessThan)
  2438  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2439  		v0.AddArg2(x, y)
  2440  		v.AddArg(v0)
  2441  		return true
  2442  	}
  2443  }
  2444  func rewriteValuePPC64_OpLess64(v *Value) bool {
  2445  	v_1 := v.Args[1]
  2446  	v_0 := v.Args[0]
  2447  	b := v.Block
  2448  	// match: (Less64 x y)
  2449  	// result: (LessThan (CMP x y))
  2450  	for {
  2451  		x := v_0
  2452  		y := v_1
  2453  		v.reset(OpPPC64LessThan)
  2454  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2455  		v0.AddArg2(x, y)
  2456  		v.AddArg(v0)
  2457  		return true
  2458  	}
  2459  }
  2460  func rewriteValuePPC64_OpLess64F(v *Value) bool {
  2461  	v_1 := v.Args[1]
  2462  	v_0 := v.Args[0]
  2463  	b := v.Block
  2464  	// match: (Less64F x y)
  2465  	// result: (FLessThan (FCMPU x y))
  2466  	for {
  2467  		x := v_0
  2468  		y := v_1
  2469  		v.reset(OpPPC64FLessThan)
  2470  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2471  		v0.AddArg2(x, y)
  2472  		v.AddArg(v0)
  2473  		return true
  2474  	}
  2475  }
  2476  func rewriteValuePPC64_OpLess64U(v *Value) bool {
  2477  	v_1 := v.Args[1]
  2478  	v_0 := v.Args[0]
  2479  	b := v.Block
  2480  	// match: (Less64U x y)
  2481  	// result: (LessThan (CMPU x y))
  2482  	for {
  2483  		x := v_0
  2484  		y := v_1
  2485  		v.reset(OpPPC64LessThan)
  2486  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2487  		v0.AddArg2(x, y)
  2488  		v.AddArg(v0)
  2489  		return true
  2490  	}
  2491  }
  2492  func rewriteValuePPC64_OpLess8(v *Value) bool {
  2493  	v_1 := v.Args[1]
  2494  	v_0 := v.Args[0]
  2495  	b := v.Block
  2496  	typ := &b.Func.Config.Types
  2497  	// match: (Less8 x y)
  2498  	// result: (LessThan (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2499  	for {
  2500  		x := v_0
  2501  		y := v_1
  2502  		v.reset(OpPPC64LessThan)
  2503  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2504  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2505  		v1.AddArg(x)
  2506  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2507  		v2.AddArg(y)
  2508  		v0.AddArg2(v1, v2)
  2509  		v.AddArg(v0)
  2510  		return true
  2511  	}
  2512  }
  2513  func rewriteValuePPC64_OpLess8U(v *Value) bool {
  2514  	v_1 := v.Args[1]
  2515  	v_0 := v.Args[0]
  2516  	b := v.Block
  2517  	typ := &b.Func.Config.Types
  2518  	// match: (Less8U x y)
  2519  	// result: (LessThan (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2520  	for {
  2521  		x := v_0
  2522  		y := v_1
  2523  		v.reset(OpPPC64LessThan)
  2524  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2525  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2526  		v1.AddArg(x)
  2527  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2528  		v2.AddArg(y)
  2529  		v0.AddArg2(v1, v2)
  2530  		v.AddArg(v0)
  2531  		return true
  2532  	}
  2533  }
  2534  func rewriteValuePPC64_OpLoad(v *Value) bool {
  2535  	v_1 := v.Args[1]
  2536  	v_0 := v.Args[0]
  2537  	b := v.Block
  2538  	typ := &b.Func.Config.Types
  2539  	// match: (Load <t> ptr mem)
  2540  	// cond: (is64BitInt(t) || isPtr(t))
  2541  	// result: (MOVDload ptr mem)
  2542  	for {
  2543  		t := v.Type
  2544  		ptr := v_0
  2545  		mem := v_1
  2546  		if !(is64BitInt(t) || isPtr(t)) {
  2547  			break
  2548  		}
  2549  		v.reset(OpPPC64MOVDload)
  2550  		v.AddArg2(ptr, mem)
  2551  		return true
  2552  	}
  2553  	// match: (Load <t> ptr mem)
  2554  	// cond: is32BitInt(t) && t.IsSigned()
  2555  	// result: (MOVWload ptr mem)
  2556  	for {
  2557  		t := v.Type
  2558  		ptr := v_0
  2559  		mem := v_1
  2560  		if !(is32BitInt(t) && t.IsSigned()) {
  2561  			break
  2562  		}
  2563  		v.reset(OpPPC64MOVWload)
  2564  		v.AddArg2(ptr, mem)
  2565  		return true
  2566  	}
  2567  	// match: (Load <t> ptr mem)
  2568  	// cond: is32BitInt(t) && !t.IsSigned()
  2569  	// result: (MOVWZload ptr mem)
  2570  	for {
  2571  		t := v.Type
  2572  		ptr := v_0
  2573  		mem := v_1
  2574  		if !(is32BitInt(t) && !t.IsSigned()) {
  2575  			break
  2576  		}
  2577  		v.reset(OpPPC64MOVWZload)
  2578  		v.AddArg2(ptr, mem)
  2579  		return true
  2580  	}
  2581  	// match: (Load <t> ptr mem)
  2582  	// cond: is16BitInt(t) && t.IsSigned()
  2583  	// result: (MOVHload ptr mem)
  2584  	for {
  2585  		t := v.Type
  2586  		ptr := v_0
  2587  		mem := v_1
  2588  		if !(is16BitInt(t) && t.IsSigned()) {
  2589  			break
  2590  		}
  2591  		v.reset(OpPPC64MOVHload)
  2592  		v.AddArg2(ptr, mem)
  2593  		return true
  2594  	}
  2595  	// match: (Load <t> ptr mem)
  2596  	// cond: is16BitInt(t) && !t.IsSigned()
  2597  	// result: (MOVHZload ptr mem)
  2598  	for {
  2599  		t := v.Type
  2600  		ptr := v_0
  2601  		mem := v_1
  2602  		if !(is16BitInt(t) && !t.IsSigned()) {
  2603  			break
  2604  		}
  2605  		v.reset(OpPPC64MOVHZload)
  2606  		v.AddArg2(ptr, mem)
  2607  		return true
  2608  	}
  2609  	// match: (Load <t> ptr mem)
  2610  	// cond: t.IsBoolean()
  2611  	// result: (MOVBZload ptr mem)
  2612  	for {
  2613  		t := v.Type
  2614  		ptr := v_0
  2615  		mem := v_1
  2616  		if !(t.IsBoolean()) {
  2617  			break
  2618  		}
  2619  		v.reset(OpPPC64MOVBZload)
  2620  		v.AddArg2(ptr, mem)
  2621  		return true
  2622  	}
  2623  	// match: (Load <t> ptr mem)
  2624  	// cond: is8BitInt(t) && t.IsSigned()
  2625  	// result: (MOVBreg (MOVBZload ptr mem))
  2626  	for {
  2627  		t := v.Type
  2628  		ptr := v_0
  2629  		mem := v_1
  2630  		if !(is8BitInt(t) && t.IsSigned()) {
  2631  			break
  2632  		}
  2633  		v.reset(OpPPC64MOVBreg)
  2634  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  2635  		v0.AddArg2(ptr, mem)
  2636  		v.AddArg(v0)
  2637  		return true
  2638  	}
  2639  	// match: (Load <t> ptr mem)
  2640  	// cond: is8BitInt(t) && !t.IsSigned()
  2641  	// result: (MOVBZload ptr mem)
  2642  	for {
  2643  		t := v.Type
  2644  		ptr := v_0
  2645  		mem := v_1
  2646  		if !(is8BitInt(t) && !t.IsSigned()) {
  2647  			break
  2648  		}
  2649  		v.reset(OpPPC64MOVBZload)
  2650  		v.AddArg2(ptr, mem)
  2651  		return true
  2652  	}
  2653  	// match: (Load <t> ptr mem)
  2654  	// cond: is32BitFloat(t)
  2655  	// result: (FMOVSload ptr mem)
  2656  	for {
  2657  		t := v.Type
  2658  		ptr := v_0
  2659  		mem := v_1
  2660  		if !(is32BitFloat(t)) {
  2661  			break
  2662  		}
  2663  		v.reset(OpPPC64FMOVSload)
  2664  		v.AddArg2(ptr, mem)
  2665  		return true
  2666  	}
  2667  	// match: (Load <t> ptr mem)
  2668  	// cond: is64BitFloat(t)
  2669  	// result: (FMOVDload ptr mem)
  2670  	for {
  2671  		t := v.Type
  2672  		ptr := v_0
  2673  		mem := v_1
  2674  		if !(is64BitFloat(t)) {
  2675  			break
  2676  		}
  2677  		v.reset(OpPPC64FMOVDload)
  2678  		v.AddArg2(ptr, mem)
  2679  		return true
  2680  	}
  2681  	return false
  2682  }
  2683  func rewriteValuePPC64_OpLocalAddr(v *Value) bool {
  2684  	v_1 := v.Args[1]
  2685  	v_0 := v.Args[0]
  2686  	b := v.Block
  2687  	typ := &b.Func.Config.Types
  2688  	// match: (LocalAddr <t> {sym} base mem)
  2689  	// cond: t.Elem().HasPointers()
  2690  	// result: (MOVDaddr {sym} (SPanchored base mem))
  2691  	for {
  2692  		t := v.Type
  2693  		sym := auxToSym(v.Aux)
  2694  		base := v_0
  2695  		mem := v_1
  2696  		if !(t.Elem().HasPointers()) {
  2697  			break
  2698  		}
  2699  		v.reset(OpPPC64MOVDaddr)
  2700  		v.Aux = symToAux(sym)
  2701  		v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
  2702  		v0.AddArg2(base, mem)
  2703  		v.AddArg(v0)
  2704  		return true
  2705  	}
  2706  	// match: (LocalAddr <t> {sym} base _)
  2707  	// cond: !t.Elem().HasPointers()
  2708  	// result: (MOVDaddr {sym} base)
  2709  	for {
  2710  		t := v.Type
  2711  		sym := auxToSym(v.Aux)
  2712  		base := v_0
  2713  		if !(!t.Elem().HasPointers()) {
  2714  			break
  2715  		}
  2716  		v.reset(OpPPC64MOVDaddr)
  2717  		v.Aux = symToAux(sym)
  2718  		v.AddArg(base)
  2719  		return true
  2720  	}
  2721  	return false
  2722  }
  2723  func rewriteValuePPC64_OpLsh16x16(v *Value) bool {
  2724  	v_1 := v.Args[1]
  2725  	v_0 := v.Args[0]
  2726  	b := v.Block
  2727  	typ := &b.Func.Config.Types
  2728  	// match: (Lsh16x16 x y)
  2729  	// cond: shiftIsBounded(v)
  2730  	// result: (SLD x y)
  2731  	for {
  2732  		x := v_0
  2733  		y := v_1
  2734  		if !(shiftIsBounded(v)) {
  2735  			break
  2736  		}
  2737  		v.reset(OpPPC64SLD)
  2738  		v.AddArg2(x, y)
  2739  		return true
  2740  	}
  2741  	// match: (Lsh16x16 <t> x y)
  2742  	// result: (ISEL [2] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF0] y)))
  2743  	for {
  2744  		t := v.Type
  2745  		x := v_0
  2746  		y := v_1
  2747  		v.reset(OpPPC64ISEL)
  2748  		v.AuxInt = int32ToAuxInt(2)
  2749  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2750  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2751  		v1.AddArg(x)
  2752  		v0.AddArg2(v1, y)
  2753  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2754  		v2.AuxInt = int64ToAuxInt(0)
  2755  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2756  		v3.AuxInt = int64ToAuxInt(0)
  2757  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  2758  		v4.AuxInt = int64ToAuxInt(0xFFF0)
  2759  		v4.AddArg(y)
  2760  		v3.AddArg(v4)
  2761  		v.AddArg3(v0, v2, v3)
  2762  		return true
  2763  	}
  2764  }
  2765  func rewriteValuePPC64_OpLsh16x32(v *Value) bool {
  2766  	v_1 := v.Args[1]
  2767  	v_0 := v.Args[0]
  2768  	b := v.Block
  2769  	typ := &b.Func.Config.Types
  2770  	// match: (Lsh16x32 x y)
  2771  	// cond: shiftIsBounded(v)
  2772  	// result: (SLD x y)
  2773  	for {
  2774  		x := v_0
  2775  		y := v_1
  2776  		if !(shiftIsBounded(v)) {
  2777  			break
  2778  		}
  2779  		v.reset(OpPPC64SLD)
  2780  		v.AddArg2(x, y)
  2781  		return true
  2782  	}
  2783  	// match: (Lsh16x32 <t> x y)
  2784  	// result: (ISEL [0] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [16]))
  2785  	for {
  2786  		t := v.Type
  2787  		x := v_0
  2788  		y := v_1
  2789  		v.reset(OpPPC64ISEL)
  2790  		v.AuxInt = int32ToAuxInt(0)
  2791  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2792  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2793  		v1.AddArg(x)
  2794  		v0.AddArg2(v1, y)
  2795  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2796  		v2.AuxInt = int64ToAuxInt(0)
  2797  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  2798  		v3.AuxInt = int32ToAuxInt(16)
  2799  		v3.AddArg(y)
  2800  		v.AddArg3(v0, v2, v3)
  2801  		return true
  2802  	}
  2803  }
  2804  func rewriteValuePPC64_OpLsh16x64(v *Value) bool {
  2805  	v_1 := v.Args[1]
  2806  	v_0 := v.Args[0]
  2807  	b := v.Block
  2808  	typ := &b.Func.Config.Types
  2809  	// match: (Lsh16x64 x (MOVDconst [c]))
  2810  	// cond: uint64(c) < 16
  2811  	// result: (SLWconst x [c])
  2812  	for {
  2813  		x := v_0
  2814  		if v_1.Op != OpPPC64MOVDconst {
  2815  			break
  2816  		}
  2817  		c := auxIntToInt64(v_1.AuxInt)
  2818  		if !(uint64(c) < 16) {
  2819  			break
  2820  		}
  2821  		v.reset(OpPPC64SLWconst)
  2822  		v.AuxInt = int64ToAuxInt(c)
  2823  		v.AddArg(x)
  2824  		return true
  2825  	}
  2826  	// match: (Lsh16x64 x y)
  2827  	// cond: shiftIsBounded(v)
  2828  	// result: (SLD x y)
  2829  	for {
  2830  		x := v_0
  2831  		y := v_1
  2832  		if !(shiftIsBounded(v)) {
  2833  			break
  2834  		}
  2835  		v.reset(OpPPC64SLD)
  2836  		v.AddArg2(x, y)
  2837  		return true
  2838  	}
  2839  	// match: (Lsh16x64 <t> x y)
  2840  	// result: (ISEL [0] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [16]))
  2841  	for {
  2842  		t := v.Type
  2843  		x := v_0
  2844  		y := v_1
  2845  		v.reset(OpPPC64ISEL)
  2846  		v.AuxInt = int32ToAuxInt(0)
  2847  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2848  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2849  		v1.AddArg(x)
  2850  		v0.AddArg2(v1, y)
  2851  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2852  		v2.AuxInt = int64ToAuxInt(0)
  2853  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  2854  		v3.AuxInt = int64ToAuxInt(16)
  2855  		v3.AddArg(y)
  2856  		v.AddArg3(v0, v2, v3)
  2857  		return true
  2858  	}
  2859  }
  2860  func rewriteValuePPC64_OpLsh16x8(v *Value) bool {
  2861  	v_1 := v.Args[1]
  2862  	v_0 := v.Args[0]
  2863  	b := v.Block
  2864  	typ := &b.Func.Config.Types
  2865  	// match: (Lsh16x8 x y)
  2866  	// cond: shiftIsBounded(v)
  2867  	// result: (SLD x y)
  2868  	for {
  2869  		x := v_0
  2870  		y := v_1
  2871  		if !(shiftIsBounded(v)) {
  2872  			break
  2873  		}
  2874  		v.reset(OpPPC64SLD)
  2875  		v.AddArg2(x, y)
  2876  		return true
  2877  	}
  2878  	// match: (Lsh16x8 <t> x y)
  2879  	// result: (ISEL [2] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F0] y)))
  2880  	for {
  2881  		t := v.Type
  2882  		x := v_0
  2883  		y := v_1
  2884  		v.reset(OpPPC64ISEL)
  2885  		v.AuxInt = int32ToAuxInt(2)
  2886  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2887  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2888  		v1.AddArg(x)
  2889  		v0.AddArg2(v1, y)
  2890  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2891  		v2.AuxInt = int64ToAuxInt(0)
  2892  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2893  		v3.AuxInt = int64ToAuxInt(0)
  2894  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  2895  		v4.AuxInt = int64ToAuxInt(0x00F0)
  2896  		v4.AddArg(y)
  2897  		v3.AddArg(v4)
  2898  		v.AddArg3(v0, v2, v3)
  2899  		return true
  2900  	}
  2901  }
  2902  func rewriteValuePPC64_OpLsh32x16(v *Value) bool {
  2903  	v_1 := v.Args[1]
  2904  	v_0 := v.Args[0]
  2905  	b := v.Block
  2906  	typ := &b.Func.Config.Types
  2907  	// match: (Lsh32x16 x y)
  2908  	// cond: shiftIsBounded(v)
  2909  	// result: (SLW x y)
  2910  	for {
  2911  		x := v_0
  2912  		y := v_1
  2913  		if !(shiftIsBounded(v)) {
  2914  			break
  2915  		}
  2916  		v.reset(OpPPC64SLW)
  2917  		v.AddArg2(x, y)
  2918  		return true
  2919  	}
  2920  	// match: (Lsh32x16 <t> x y)
  2921  	// result: (ISEL [2] (SLW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFE0] y)))
  2922  	for {
  2923  		t := v.Type
  2924  		x := v_0
  2925  		y := v_1
  2926  		v.reset(OpPPC64ISEL)
  2927  		v.AuxInt = int32ToAuxInt(2)
  2928  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  2929  		v0.AddArg2(x, y)
  2930  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2931  		v1.AuxInt = int64ToAuxInt(0)
  2932  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2933  		v2.AuxInt = int64ToAuxInt(0)
  2934  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  2935  		v3.AuxInt = int64ToAuxInt(0xFFE0)
  2936  		v3.AddArg(y)
  2937  		v2.AddArg(v3)
  2938  		v.AddArg3(v0, v1, v2)
  2939  		return true
  2940  	}
  2941  }
  2942  func rewriteValuePPC64_OpLsh32x32(v *Value) bool {
  2943  	v_1 := v.Args[1]
  2944  	v_0 := v.Args[0]
  2945  	b := v.Block
  2946  	typ := &b.Func.Config.Types
  2947  	// match: (Lsh32x32 x y)
  2948  	// cond: shiftIsBounded(v)
  2949  	// result: (SLW x y)
  2950  	for {
  2951  		x := v_0
  2952  		y := v_1
  2953  		if !(shiftIsBounded(v)) {
  2954  			break
  2955  		}
  2956  		v.reset(OpPPC64SLW)
  2957  		v.AddArg2(x, y)
  2958  		return true
  2959  	}
  2960  	// match: (Lsh32x32 <t> x y)
  2961  	// result: (ISEL [0] (SLW <t> x y) (MOVDconst [0]) (CMPWUconst y [32]))
  2962  	for {
  2963  		t := v.Type
  2964  		x := v_0
  2965  		y := v_1
  2966  		v.reset(OpPPC64ISEL)
  2967  		v.AuxInt = int32ToAuxInt(0)
  2968  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  2969  		v0.AddArg2(x, y)
  2970  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2971  		v1.AuxInt = int64ToAuxInt(0)
  2972  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  2973  		v2.AuxInt = int32ToAuxInt(32)
  2974  		v2.AddArg(y)
  2975  		v.AddArg3(v0, v1, v2)
  2976  		return true
  2977  	}
  2978  }
  2979  func rewriteValuePPC64_OpLsh32x64(v *Value) bool {
  2980  	v_1 := v.Args[1]
  2981  	v_0 := v.Args[0]
  2982  	b := v.Block
  2983  	typ := &b.Func.Config.Types
  2984  	// match: (Lsh32x64 x (MOVDconst [c]))
  2985  	// cond: uint64(c) < 32
  2986  	// result: (SLWconst x [c])
  2987  	for {
  2988  		x := v_0
  2989  		if v_1.Op != OpPPC64MOVDconst {
  2990  			break
  2991  		}
  2992  		c := auxIntToInt64(v_1.AuxInt)
  2993  		if !(uint64(c) < 32) {
  2994  			break
  2995  		}
  2996  		v.reset(OpPPC64SLWconst)
  2997  		v.AuxInt = int64ToAuxInt(c)
  2998  		v.AddArg(x)
  2999  		return true
  3000  	}
  3001  	// match: (Lsh32x64 x y)
  3002  	// cond: shiftIsBounded(v)
  3003  	// result: (SLW x y)
  3004  	for {
  3005  		x := v_0
  3006  		y := v_1
  3007  		if !(shiftIsBounded(v)) {
  3008  			break
  3009  		}
  3010  		v.reset(OpPPC64SLW)
  3011  		v.AddArg2(x, y)
  3012  		return true
  3013  	}
  3014  	// match: (Lsh32x64 <t> x y)
  3015  	// result: (ISEL [0] (SLW <t> x y) (MOVDconst [0]) (CMPUconst y [32]))
  3016  	for {
  3017  		t := v.Type
  3018  		x := v_0
  3019  		y := v_1
  3020  		v.reset(OpPPC64ISEL)
  3021  		v.AuxInt = int32ToAuxInt(0)
  3022  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  3023  		v0.AddArg2(x, y)
  3024  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3025  		v1.AuxInt = int64ToAuxInt(0)
  3026  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  3027  		v2.AuxInt = int64ToAuxInt(32)
  3028  		v2.AddArg(y)
  3029  		v.AddArg3(v0, v1, v2)
  3030  		return true
  3031  	}
  3032  }
  3033  func rewriteValuePPC64_OpLsh32x8(v *Value) bool {
  3034  	v_1 := v.Args[1]
  3035  	v_0 := v.Args[0]
  3036  	b := v.Block
  3037  	typ := &b.Func.Config.Types
  3038  	// match: (Lsh32x8 x y)
  3039  	// cond: shiftIsBounded(v)
  3040  	// result: (SLW x y)
  3041  	for {
  3042  		x := v_0
  3043  		y := v_1
  3044  		if !(shiftIsBounded(v)) {
  3045  			break
  3046  		}
  3047  		v.reset(OpPPC64SLW)
  3048  		v.AddArg2(x, y)
  3049  		return true
  3050  	}
  3051  	// match: (Lsh32x8 <t> x y)
  3052  	// result: (ISEL [2] (SLW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00E0] y)))
  3053  	for {
  3054  		t := v.Type
  3055  		x := v_0
  3056  		y := v_1
  3057  		v.reset(OpPPC64ISEL)
  3058  		v.AuxInt = int32ToAuxInt(2)
  3059  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  3060  		v0.AddArg2(x, y)
  3061  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3062  		v1.AuxInt = int64ToAuxInt(0)
  3063  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3064  		v2.AuxInt = int64ToAuxInt(0)
  3065  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3066  		v3.AuxInt = int64ToAuxInt(0x00E0)
  3067  		v3.AddArg(y)
  3068  		v2.AddArg(v3)
  3069  		v.AddArg3(v0, v1, v2)
  3070  		return true
  3071  	}
  3072  }
  3073  func rewriteValuePPC64_OpLsh64x16(v *Value) bool {
  3074  	v_1 := v.Args[1]
  3075  	v_0 := v.Args[0]
  3076  	b := v.Block
  3077  	typ := &b.Func.Config.Types
  3078  	// match: (Lsh64x16 x y)
  3079  	// cond: shiftIsBounded(v)
  3080  	// result: (SLD x y)
  3081  	for {
  3082  		x := v_0
  3083  		y := v_1
  3084  		if !(shiftIsBounded(v)) {
  3085  			break
  3086  		}
  3087  		v.reset(OpPPC64SLD)
  3088  		v.AddArg2(x, y)
  3089  		return true
  3090  	}
  3091  	// match: (Lsh64x16 <t> x y)
  3092  	// result: (ISEL [2] (SLD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFC0] y)))
  3093  	for {
  3094  		t := v.Type
  3095  		x := v_0
  3096  		y := v_1
  3097  		v.reset(OpPPC64ISEL)
  3098  		v.AuxInt = int32ToAuxInt(2)
  3099  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3100  		v0.AddArg2(x, y)
  3101  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3102  		v1.AuxInt = int64ToAuxInt(0)
  3103  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3104  		v2.AuxInt = int64ToAuxInt(0)
  3105  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3106  		v3.AuxInt = int64ToAuxInt(0xFFC0)
  3107  		v3.AddArg(y)
  3108  		v2.AddArg(v3)
  3109  		v.AddArg3(v0, v1, v2)
  3110  		return true
  3111  	}
  3112  }
  3113  func rewriteValuePPC64_OpLsh64x32(v *Value) bool {
  3114  	v_1 := v.Args[1]
  3115  	v_0 := v.Args[0]
  3116  	b := v.Block
  3117  	typ := &b.Func.Config.Types
  3118  	// match: (Lsh64x32 x y)
  3119  	// cond: shiftIsBounded(v)
  3120  	// result: (SLD x y)
  3121  	for {
  3122  		x := v_0
  3123  		y := v_1
  3124  		if !(shiftIsBounded(v)) {
  3125  			break
  3126  		}
  3127  		v.reset(OpPPC64SLD)
  3128  		v.AddArg2(x, y)
  3129  		return true
  3130  	}
  3131  	// match: (Lsh64x32 <t> x y)
  3132  	// result: (ISEL [0] (SLD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
  3133  	for {
  3134  		t := v.Type
  3135  		x := v_0
  3136  		y := v_1
  3137  		v.reset(OpPPC64ISEL)
  3138  		v.AuxInt = int32ToAuxInt(0)
  3139  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3140  		v0.AddArg2(x, y)
  3141  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3142  		v1.AuxInt = int64ToAuxInt(0)
  3143  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  3144  		v2.AuxInt = int32ToAuxInt(64)
  3145  		v2.AddArg(y)
  3146  		v.AddArg3(v0, v1, v2)
  3147  		return true
  3148  	}
  3149  }
  3150  func rewriteValuePPC64_OpLsh64x64(v *Value) bool {
  3151  	v_1 := v.Args[1]
  3152  	v_0 := v.Args[0]
  3153  	b := v.Block
  3154  	typ := &b.Func.Config.Types
  3155  	// match: (Lsh64x64 x (MOVDconst [c]))
  3156  	// cond: uint64(c) < 64
  3157  	// result: (SLDconst x [c])
  3158  	for {
  3159  		x := v_0
  3160  		if v_1.Op != OpPPC64MOVDconst {
  3161  			break
  3162  		}
  3163  		c := auxIntToInt64(v_1.AuxInt)
  3164  		if !(uint64(c) < 64) {
  3165  			break
  3166  		}
  3167  		v.reset(OpPPC64SLDconst)
  3168  		v.AuxInt = int64ToAuxInt(c)
  3169  		v.AddArg(x)
  3170  		return true
  3171  	}
  3172  	// match: (Lsh64x64 x y)
  3173  	// cond: shiftIsBounded(v)
  3174  	// result: (SLD x y)
  3175  	for {
  3176  		x := v_0
  3177  		y := v_1
  3178  		if !(shiftIsBounded(v)) {
  3179  			break
  3180  		}
  3181  		v.reset(OpPPC64SLD)
  3182  		v.AddArg2(x, y)
  3183  		return true
  3184  	}
  3185  	// match: (Lsh64x64 <t> x y)
  3186  	// result: (ISEL [0] (SLD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
  3187  	for {
  3188  		t := v.Type
  3189  		x := v_0
  3190  		y := v_1
  3191  		v.reset(OpPPC64ISEL)
  3192  		v.AuxInt = int32ToAuxInt(0)
  3193  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3194  		v0.AddArg2(x, y)
  3195  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3196  		v1.AuxInt = int64ToAuxInt(0)
  3197  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  3198  		v2.AuxInt = int64ToAuxInt(64)
  3199  		v2.AddArg(y)
  3200  		v.AddArg3(v0, v1, v2)
  3201  		return true
  3202  	}
  3203  }
  3204  func rewriteValuePPC64_OpLsh64x8(v *Value) bool {
  3205  	v_1 := v.Args[1]
  3206  	v_0 := v.Args[0]
  3207  	b := v.Block
  3208  	typ := &b.Func.Config.Types
  3209  	// match: (Lsh64x8 x y)
  3210  	// cond: shiftIsBounded(v)
  3211  	// result: (SLD x y)
  3212  	for {
  3213  		x := v_0
  3214  		y := v_1
  3215  		if !(shiftIsBounded(v)) {
  3216  			break
  3217  		}
  3218  		v.reset(OpPPC64SLD)
  3219  		v.AddArg2(x, y)
  3220  		return true
  3221  	}
  3222  	// match: (Lsh64x8 <t> x y)
  3223  	// result: (ISEL [2] (SLD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00C0] y)))
  3224  	for {
  3225  		t := v.Type
  3226  		x := v_0
  3227  		y := v_1
  3228  		v.reset(OpPPC64ISEL)
  3229  		v.AuxInt = int32ToAuxInt(2)
  3230  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3231  		v0.AddArg2(x, y)
  3232  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3233  		v1.AuxInt = int64ToAuxInt(0)
  3234  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3235  		v2.AuxInt = int64ToAuxInt(0)
  3236  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3237  		v3.AuxInt = int64ToAuxInt(0x00C0)
  3238  		v3.AddArg(y)
  3239  		v2.AddArg(v3)
  3240  		v.AddArg3(v0, v1, v2)
  3241  		return true
  3242  	}
  3243  }
  3244  func rewriteValuePPC64_OpLsh8x16(v *Value) bool {
  3245  	v_1 := v.Args[1]
  3246  	v_0 := v.Args[0]
  3247  	b := v.Block
  3248  	typ := &b.Func.Config.Types
  3249  	// match: (Lsh8x16 x y)
  3250  	// cond: shiftIsBounded(v)
  3251  	// result: (SLD x y)
  3252  	for {
  3253  		x := v_0
  3254  		y := v_1
  3255  		if !(shiftIsBounded(v)) {
  3256  			break
  3257  		}
  3258  		v.reset(OpPPC64SLD)
  3259  		v.AddArg2(x, y)
  3260  		return true
  3261  	}
  3262  	// match: (Lsh8x16 <t> x y)
  3263  	// result: (ISEL [2] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF8] y)))
  3264  	for {
  3265  		t := v.Type
  3266  		x := v_0
  3267  		y := v_1
  3268  		v.reset(OpPPC64ISEL)
  3269  		v.AuxInt = int32ToAuxInt(2)
  3270  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3271  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3272  		v1.AddArg(x)
  3273  		v0.AddArg2(v1, y)
  3274  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3275  		v2.AuxInt = int64ToAuxInt(0)
  3276  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3277  		v3.AuxInt = int64ToAuxInt(0)
  3278  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3279  		v4.AuxInt = int64ToAuxInt(0xFFF8)
  3280  		v4.AddArg(y)
  3281  		v3.AddArg(v4)
  3282  		v.AddArg3(v0, v2, v3)
  3283  		return true
  3284  	}
  3285  }
  3286  func rewriteValuePPC64_OpLsh8x32(v *Value) bool {
  3287  	v_1 := v.Args[1]
  3288  	v_0 := v.Args[0]
  3289  	b := v.Block
  3290  	typ := &b.Func.Config.Types
  3291  	// match: (Lsh8x32 x y)
  3292  	// cond: shiftIsBounded(v)
  3293  	// result: (SLD x y)
  3294  	for {
  3295  		x := v_0
  3296  		y := v_1
  3297  		if !(shiftIsBounded(v)) {
  3298  			break
  3299  		}
  3300  		v.reset(OpPPC64SLD)
  3301  		v.AddArg2(x, y)
  3302  		return true
  3303  	}
  3304  	// match: (Lsh8x32 <t> x y)
  3305  	// result: (ISEL [0] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [8]))
  3306  	for {
  3307  		t := v.Type
  3308  		x := v_0
  3309  		y := v_1
  3310  		v.reset(OpPPC64ISEL)
  3311  		v.AuxInt = int32ToAuxInt(0)
  3312  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3313  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3314  		v1.AddArg(x)
  3315  		v0.AddArg2(v1, y)
  3316  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3317  		v2.AuxInt = int64ToAuxInt(0)
  3318  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  3319  		v3.AuxInt = int32ToAuxInt(8)
  3320  		v3.AddArg(y)
  3321  		v.AddArg3(v0, v2, v3)
  3322  		return true
  3323  	}
  3324  }
  3325  func rewriteValuePPC64_OpLsh8x64(v *Value) bool {
  3326  	v_1 := v.Args[1]
  3327  	v_0 := v.Args[0]
  3328  	b := v.Block
  3329  	typ := &b.Func.Config.Types
  3330  	// match: (Lsh8x64 x (MOVDconst [c]))
  3331  	// cond: uint64(c) < 8
  3332  	// result: (SLWconst x [c])
  3333  	for {
  3334  		x := v_0
  3335  		if v_1.Op != OpPPC64MOVDconst {
  3336  			break
  3337  		}
  3338  		c := auxIntToInt64(v_1.AuxInt)
  3339  		if !(uint64(c) < 8) {
  3340  			break
  3341  		}
  3342  		v.reset(OpPPC64SLWconst)
  3343  		v.AuxInt = int64ToAuxInt(c)
  3344  		v.AddArg(x)
  3345  		return true
  3346  	}
  3347  	// match: (Lsh8x64 x y)
  3348  	// cond: shiftIsBounded(v)
  3349  	// result: (SLD x y)
  3350  	for {
  3351  		x := v_0
  3352  		y := v_1
  3353  		if !(shiftIsBounded(v)) {
  3354  			break
  3355  		}
  3356  		v.reset(OpPPC64SLD)
  3357  		v.AddArg2(x, y)
  3358  		return true
  3359  	}
  3360  	// match: (Lsh8x64 <t> x y)
  3361  	// result: (ISEL [0] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [8]))
  3362  	for {
  3363  		t := v.Type
  3364  		x := v_0
  3365  		y := v_1
  3366  		v.reset(OpPPC64ISEL)
  3367  		v.AuxInt = int32ToAuxInt(0)
  3368  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3369  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3370  		v1.AddArg(x)
  3371  		v0.AddArg2(v1, y)
  3372  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3373  		v2.AuxInt = int64ToAuxInt(0)
  3374  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  3375  		v3.AuxInt = int64ToAuxInt(8)
  3376  		v3.AddArg(y)
  3377  		v.AddArg3(v0, v2, v3)
  3378  		return true
  3379  	}
  3380  }
  3381  func rewriteValuePPC64_OpLsh8x8(v *Value) bool {
  3382  	v_1 := v.Args[1]
  3383  	v_0 := v.Args[0]
  3384  	b := v.Block
  3385  	typ := &b.Func.Config.Types
  3386  	// match: (Lsh8x8 x y)
  3387  	// cond: shiftIsBounded(v)
  3388  	// result: (SLD x y)
  3389  	for {
  3390  		x := v_0
  3391  		y := v_1
  3392  		if !(shiftIsBounded(v)) {
  3393  			break
  3394  		}
  3395  		v.reset(OpPPC64SLD)
  3396  		v.AddArg2(x, y)
  3397  		return true
  3398  	}
  3399  	// match: (Lsh8x8 <t> x y)
  3400  	// result: (ISEL [2] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F8] y)))
  3401  	for {
  3402  		t := v.Type
  3403  		x := v_0
  3404  		y := v_1
  3405  		v.reset(OpPPC64ISEL)
  3406  		v.AuxInt = int32ToAuxInt(2)
  3407  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3408  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3409  		v1.AddArg(x)
  3410  		v0.AddArg2(v1, y)
  3411  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3412  		v2.AuxInt = int64ToAuxInt(0)
  3413  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3414  		v3.AuxInt = int64ToAuxInt(0)
  3415  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3416  		v4.AuxInt = int64ToAuxInt(0x00F8)
  3417  		v4.AddArg(y)
  3418  		v3.AddArg(v4)
  3419  		v.AddArg3(v0, v2, v3)
  3420  		return true
  3421  	}
  3422  }
  3423  func rewriteValuePPC64_OpMax32F(v *Value) bool {
  3424  	v_1 := v.Args[1]
  3425  	v_0 := v.Args[0]
  3426  	// match: (Max32F x y)
  3427  	// cond: buildcfg.GOPPC64 >= 9
  3428  	// result: (XSMAXJDP x y)
  3429  	for {
  3430  		x := v_0
  3431  		y := v_1
  3432  		if !(buildcfg.GOPPC64 >= 9) {
  3433  			break
  3434  		}
  3435  		v.reset(OpPPC64XSMAXJDP)
  3436  		v.AddArg2(x, y)
  3437  		return true
  3438  	}
  3439  	return false
  3440  }
  3441  func rewriteValuePPC64_OpMax64F(v *Value) bool {
  3442  	v_1 := v.Args[1]
  3443  	v_0 := v.Args[0]
  3444  	// match: (Max64F x y)
  3445  	// cond: buildcfg.GOPPC64 >= 9
  3446  	// result: (XSMAXJDP x y)
  3447  	for {
  3448  		x := v_0
  3449  		y := v_1
  3450  		if !(buildcfg.GOPPC64 >= 9) {
  3451  			break
  3452  		}
  3453  		v.reset(OpPPC64XSMAXJDP)
  3454  		v.AddArg2(x, y)
  3455  		return true
  3456  	}
  3457  	return false
  3458  }
  3459  func rewriteValuePPC64_OpMin32F(v *Value) bool {
  3460  	v_1 := v.Args[1]
  3461  	v_0 := v.Args[0]
  3462  	// match: (Min32F x y)
  3463  	// cond: buildcfg.GOPPC64 >= 9
  3464  	// result: (XSMINJDP x y)
  3465  	for {
  3466  		x := v_0
  3467  		y := v_1
  3468  		if !(buildcfg.GOPPC64 >= 9) {
  3469  			break
  3470  		}
  3471  		v.reset(OpPPC64XSMINJDP)
  3472  		v.AddArg2(x, y)
  3473  		return true
  3474  	}
  3475  	return false
  3476  }
  3477  func rewriteValuePPC64_OpMin64F(v *Value) bool {
  3478  	v_1 := v.Args[1]
  3479  	v_0 := v.Args[0]
  3480  	// match: (Min64F x y)
  3481  	// cond: buildcfg.GOPPC64 >= 9
  3482  	// result: (XSMINJDP x y)
  3483  	for {
  3484  		x := v_0
  3485  		y := v_1
  3486  		if !(buildcfg.GOPPC64 >= 9) {
  3487  			break
  3488  		}
  3489  		v.reset(OpPPC64XSMINJDP)
  3490  		v.AddArg2(x, y)
  3491  		return true
  3492  	}
  3493  	return false
  3494  }
  3495  func rewriteValuePPC64_OpMod16(v *Value) bool {
  3496  	v_1 := v.Args[1]
  3497  	v_0 := v.Args[0]
  3498  	b := v.Block
  3499  	typ := &b.Func.Config.Types
  3500  	// match: (Mod16 x y)
  3501  	// result: (Mod32 (SignExt16to32 x) (SignExt16to32 y))
  3502  	for {
  3503  		x := v_0
  3504  		y := v_1
  3505  		v.reset(OpMod32)
  3506  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3507  		v0.AddArg(x)
  3508  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3509  		v1.AddArg(y)
  3510  		v.AddArg2(v0, v1)
  3511  		return true
  3512  	}
  3513  }
  3514  func rewriteValuePPC64_OpMod16u(v *Value) bool {
  3515  	v_1 := v.Args[1]
  3516  	v_0 := v.Args[0]
  3517  	b := v.Block
  3518  	typ := &b.Func.Config.Types
  3519  	// match: (Mod16u x y)
  3520  	// result: (Mod32u (ZeroExt16to32 x) (ZeroExt16to32 y))
  3521  	for {
  3522  		x := v_0
  3523  		y := v_1
  3524  		v.reset(OpMod32u)
  3525  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3526  		v0.AddArg(x)
  3527  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3528  		v1.AddArg(y)
  3529  		v.AddArg2(v0, v1)
  3530  		return true
  3531  	}
  3532  }
  3533  func rewriteValuePPC64_OpMod32(v *Value) bool {
  3534  	v_1 := v.Args[1]
  3535  	v_0 := v.Args[0]
  3536  	b := v.Block
  3537  	typ := &b.Func.Config.Types
  3538  	// match: (Mod32 x y)
  3539  	// cond: buildcfg.GOPPC64 >= 9
  3540  	// result: (MODSW x y)
  3541  	for {
  3542  		x := v_0
  3543  		y := v_1
  3544  		if !(buildcfg.GOPPC64 >= 9) {
  3545  			break
  3546  		}
  3547  		v.reset(OpPPC64MODSW)
  3548  		v.AddArg2(x, y)
  3549  		return true
  3550  	}
  3551  	// match: (Mod32 x y)
  3552  	// cond: buildcfg.GOPPC64 <= 8
  3553  	// result: (SUB x (MULLW y (DIVW x y)))
  3554  	for {
  3555  		x := v_0
  3556  		y := v_1
  3557  		if !(buildcfg.GOPPC64 <= 8) {
  3558  			break
  3559  		}
  3560  		v.reset(OpPPC64SUB)
  3561  		v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
  3562  		v1 := b.NewValue0(v.Pos, OpPPC64DIVW, typ.Int32)
  3563  		v1.AddArg2(x, y)
  3564  		v0.AddArg2(y, v1)
  3565  		v.AddArg2(x, v0)
  3566  		return true
  3567  	}
  3568  	return false
  3569  }
  3570  func rewriteValuePPC64_OpMod32u(v *Value) bool {
  3571  	v_1 := v.Args[1]
  3572  	v_0 := v.Args[0]
  3573  	b := v.Block
  3574  	typ := &b.Func.Config.Types
  3575  	// match: (Mod32u x y)
  3576  	// cond: buildcfg.GOPPC64 >= 9
  3577  	// result: (MODUW x y)
  3578  	for {
  3579  		x := v_0
  3580  		y := v_1
  3581  		if !(buildcfg.GOPPC64 >= 9) {
  3582  			break
  3583  		}
  3584  		v.reset(OpPPC64MODUW)
  3585  		v.AddArg2(x, y)
  3586  		return true
  3587  	}
  3588  	// match: (Mod32u x y)
  3589  	// cond: buildcfg.GOPPC64 <= 8
  3590  	// result: (SUB x (MULLW y (DIVWU x y)))
  3591  	for {
  3592  		x := v_0
  3593  		y := v_1
  3594  		if !(buildcfg.GOPPC64 <= 8) {
  3595  			break
  3596  		}
  3597  		v.reset(OpPPC64SUB)
  3598  		v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
  3599  		v1 := b.NewValue0(v.Pos, OpPPC64DIVWU, typ.Int32)
  3600  		v1.AddArg2(x, y)
  3601  		v0.AddArg2(y, v1)
  3602  		v.AddArg2(x, v0)
  3603  		return true
  3604  	}
  3605  	return false
  3606  }
  3607  func rewriteValuePPC64_OpMod64(v *Value) bool {
  3608  	v_1 := v.Args[1]
  3609  	v_0 := v.Args[0]
  3610  	b := v.Block
  3611  	typ := &b.Func.Config.Types
  3612  	// match: (Mod64 x y)
  3613  	// cond: buildcfg.GOPPC64 >=9
  3614  	// result: (MODSD x y)
  3615  	for {
  3616  		x := v_0
  3617  		y := v_1
  3618  		if !(buildcfg.GOPPC64 >= 9) {
  3619  			break
  3620  		}
  3621  		v.reset(OpPPC64MODSD)
  3622  		v.AddArg2(x, y)
  3623  		return true
  3624  	}
  3625  	// match: (Mod64 x y)
  3626  	// cond: buildcfg.GOPPC64 <=8
  3627  	// result: (SUB x (MULLD y (DIVD x y)))
  3628  	for {
  3629  		x := v_0
  3630  		y := v_1
  3631  		if !(buildcfg.GOPPC64 <= 8) {
  3632  			break
  3633  		}
  3634  		v.reset(OpPPC64SUB)
  3635  		v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
  3636  		v1 := b.NewValue0(v.Pos, OpPPC64DIVD, typ.Int64)
  3637  		v1.AddArg2(x, y)
  3638  		v0.AddArg2(y, v1)
  3639  		v.AddArg2(x, v0)
  3640  		return true
  3641  	}
  3642  	return false
  3643  }
  3644  func rewriteValuePPC64_OpMod64u(v *Value) bool {
  3645  	v_1 := v.Args[1]
  3646  	v_0 := v.Args[0]
  3647  	b := v.Block
  3648  	typ := &b.Func.Config.Types
  3649  	// match: (Mod64u x y)
  3650  	// cond: buildcfg.GOPPC64 >= 9
  3651  	// result: (MODUD x y)
  3652  	for {
  3653  		x := v_0
  3654  		y := v_1
  3655  		if !(buildcfg.GOPPC64 >= 9) {
  3656  			break
  3657  		}
  3658  		v.reset(OpPPC64MODUD)
  3659  		v.AddArg2(x, y)
  3660  		return true
  3661  	}
  3662  	// match: (Mod64u x y)
  3663  	// cond: buildcfg.GOPPC64 <= 8
  3664  	// result: (SUB x (MULLD y (DIVDU x y)))
  3665  	for {
  3666  		x := v_0
  3667  		y := v_1
  3668  		if !(buildcfg.GOPPC64 <= 8) {
  3669  			break
  3670  		}
  3671  		v.reset(OpPPC64SUB)
  3672  		v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
  3673  		v1 := b.NewValue0(v.Pos, OpPPC64DIVDU, typ.Int64)
  3674  		v1.AddArg2(x, y)
  3675  		v0.AddArg2(y, v1)
  3676  		v.AddArg2(x, v0)
  3677  		return true
  3678  	}
  3679  	return false
  3680  }
  3681  func rewriteValuePPC64_OpMod8(v *Value) bool {
  3682  	v_1 := v.Args[1]
  3683  	v_0 := v.Args[0]
  3684  	b := v.Block
  3685  	typ := &b.Func.Config.Types
  3686  	// match: (Mod8 x y)
  3687  	// result: (Mod32 (SignExt8to32 x) (SignExt8to32 y))
  3688  	for {
  3689  		x := v_0
  3690  		y := v_1
  3691  		v.reset(OpMod32)
  3692  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3693  		v0.AddArg(x)
  3694  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3695  		v1.AddArg(y)
  3696  		v.AddArg2(v0, v1)
  3697  		return true
  3698  	}
  3699  }
  3700  func rewriteValuePPC64_OpMod8u(v *Value) bool {
  3701  	v_1 := v.Args[1]
  3702  	v_0 := v.Args[0]
  3703  	b := v.Block
  3704  	typ := &b.Func.Config.Types
  3705  	// match: (Mod8u x y)
  3706  	// result: (Mod32u (ZeroExt8to32 x) (ZeroExt8to32 y))
  3707  	for {
  3708  		x := v_0
  3709  		y := v_1
  3710  		v.reset(OpMod32u)
  3711  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3712  		v0.AddArg(x)
  3713  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3714  		v1.AddArg(y)
  3715  		v.AddArg2(v0, v1)
  3716  		return true
  3717  	}
  3718  }
  3719  func rewriteValuePPC64_OpMove(v *Value) bool {
  3720  	v_2 := v.Args[2]
  3721  	v_1 := v.Args[1]
  3722  	v_0 := v.Args[0]
  3723  	b := v.Block
  3724  	typ := &b.Func.Config.Types
  3725  	// match: (Move [0] _ _ mem)
  3726  	// result: mem
  3727  	for {
  3728  		if auxIntToInt64(v.AuxInt) != 0 {
  3729  			break
  3730  		}
  3731  		mem := v_2
  3732  		v.copyOf(mem)
  3733  		return true
  3734  	}
  3735  	// match: (Move [1] dst src mem)
  3736  	// result: (MOVBstore dst (MOVBZload src mem) mem)
  3737  	for {
  3738  		if auxIntToInt64(v.AuxInt) != 1 {
  3739  			break
  3740  		}
  3741  		dst := v_0
  3742  		src := v_1
  3743  		mem := v_2
  3744  		v.reset(OpPPC64MOVBstore)
  3745  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3746  		v0.AddArg2(src, mem)
  3747  		v.AddArg3(dst, v0, mem)
  3748  		return true
  3749  	}
  3750  	// match: (Move [2] dst src mem)
  3751  	// result: (MOVHstore dst (MOVHZload src mem) mem)
  3752  	for {
  3753  		if auxIntToInt64(v.AuxInt) != 2 {
  3754  			break
  3755  		}
  3756  		dst := v_0
  3757  		src := v_1
  3758  		mem := v_2
  3759  		v.reset(OpPPC64MOVHstore)
  3760  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3761  		v0.AddArg2(src, mem)
  3762  		v.AddArg3(dst, v0, mem)
  3763  		return true
  3764  	}
  3765  	// match: (Move [4] dst src mem)
  3766  	// result: (MOVWstore dst (MOVWZload src mem) mem)
  3767  	for {
  3768  		if auxIntToInt64(v.AuxInt) != 4 {
  3769  			break
  3770  		}
  3771  		dst := v_0
  3772  		src := v_1
  3773  		mem := v_2
  3774  		v.reset(OpPPC64MOVWstore)
  3775  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3776  		v0.AddArg2(src, mem)
  3777  		v.AddArg3(dst, v0, mem)
  3778  		return true
  3779  	}
  3780  	// match: (Move [8] {t} dst src mem)
  3781  	// result: (MOVDstore dst (MOVDload src mem) mem)
  3782  	for {
  3783  		if auxIntToInt64(v.AuxInt) != 8 {
  3784  			break
  3785  		}
  3786  		dst := v_0
  3787  		src := v_1
  3788  		mem := v_2
  3789  		v.reset(OpPPC64MOVDstore)
  3790  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, typ.Int64)
  3791  		v0.AddArg2(src, mem)
  3792  		v.AddArg3(dst, v0, mem)
  3793  		return true
  3794  	}
  3795  	// match: (Move [3] dst src mem)
  3796  	// result: (MOVBstore [2] dst (MOVBZload [2] src mem) (MOVHstore dst (MOVHload src mem) mem))
  3797  	for {
  3798  		if auxIntToInt64(v.AuxInt) != 3 {
  3799  			break
  3800  		}
  3801  		dst := v_0
  3802  		src := v_1
  3803  		mem := v_2
  3804  		v.reset(OpPPC64MOVBstore)
  3805  		v.AuxInt = int32ToAuxInt(2)
  3806  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3807  		v0.AuxInt = int32ToAuxInt(2)
  3808  		v0.AddArg2(src, mem)
  3809  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
  3810  		v2 := b.NewValue0(v.Pos, OpPPC64MOVHload, typ.Int16)
  3811  		v2.AddArg2(src, mem)
  3812  		v1.AddArg3(dst, v2, mem)
  3813  		v.AddArg3(dst, v0, v1)
  3814  		return true
  3815  	}
  3816  	// match: (Move [5] dst src mem)
  3817  	// result: (MOVBstore [4] dst (MOVBZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
  3818  	for {
  3819  		if auxIntToInt64(v.AuxInt) != 5 {
  3820  			break
  3821  		}
  3822  		dst := v_0
  3823  		src := v_1
  3824  		mem := v_2
  3825  		v.reset(OpPPC64MOVBstore)
  3826  		v.AuxInt = int32ToAuxInt(4)
  3827  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3828  		v0.AuxInt = int32ToAuxInt(4)
  3829  		v0.AddArg2(src, mem)
  3830  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3831  		v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3832  		v2.AddArg2(src, mem)
  3833  		v1.AddArg3(dst, v2, mem)
  3834  		v.AddArg3(dst, v0, v1)
  3835  		return true
  3836  	}
  3837  	// match: (Move [6] dst src mem)
  3838  	// result: (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
  3839  	for {
  3840  		if auxIntToInt64(v.AuxInt) != 6 {
  3841  			break
  3842  		}
  3843  		dst := v_0
  3844  		src := v_1
  3845  		mem := v_2
  3846  		v.reset(OpPPC64MOVHstore)
  3847  		v.AuxInt = int32ToAuxInt(4)
  3848  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3849  		v0.AuxInt = int32ToAuxInt(4)
  3850  		v0.AddArg2(src, mem)
  3851  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3852  		v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3853  		v2.AddArg2(src, mem)
  3854  		v1.AddArg3(dst, v2, mem)
  3855  		v.AddArg3(dst, v0, v1)
  3856  		return true
  3857  	}
  3858  	// match: (Move [7] dst src mem)
  3859  	// result: (MOVBstore [6] dst (MOVBZload [6] src mem) (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem)))
  3860  	for {
  3861  		if auxIntToInt64(v.AuxInt) != 7 {
  3862  			break
  3863  		}
  3864  		dst := v_0
  3865  		src := v_1
  3866  		mem := v_2
  3867  		v.reset(OpPPC64MOVBstore)
  3868  		v.AuxInt = int32ToAuxInt(6)
  3869  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3870  		v0.AuxInt = int32ToAuxInt(6)
  3871  		v0.AddArg2(src, mem)
  3872  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
  3873  		v1.AuxInt = int32ToAuxInt(4)
  3874  		v2 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3875  		v2.AuxInt = int32ToAuxInt(4)
  3876  		v2.AddArg2(src, mem)
  3877  		v3 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3878  		v4 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3879  		v4.AddArg2(src, mem)
  3880  		v3.AddArg3(dst, v4, mem)
  3881  		v1.AddArg3(dst, v2, v3)
  3882  		v.AddArg3(dst, v0, v1)
  3883  		return true
  3884  	}
  3885  	// match: (Move [s] dst src mem)
  3886  	// cond: s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)
  3887  	// result: (LoweredMove [s] dst src mem)
  3888  	for {
  3889  		s := auxIntToInt64(v.AuxInt)
  3890  		dst := v_0
  3891  		src := v_1
  3892  		mem := v_2
  3893  		if !(s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)) {
  3894  			break
  3895  		}
  3896  		v.reset(OpPPC64LoweredMove)
  3897  		v.AuxInt = int64ToAuxInt(s)
  3898  		v.AddArg3(dst, src, mem)
  3899  		return true
  3900  	}
  3901  	// match: (Move [s] dst src mem)
  3902  	// cond: s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9
  3903  	// result: (LoweredQuadMoveShort [s] dst src mem)
  3904  	for {
  3905  		s := auxIntToInt64(v.AuxInt)
  3906  		dst := v_0
  3907  		src := v_1
  3908  		mem := v_2
  3909  		if !(s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9) {
  3910  			break
  3911  		}
  3912  		v.reset(OpPPC64LoweredQuadMoveShort)
  3913  		v.AuxInt = int64ToAuxInt(s)
  3914  		v.AddArg3(dst, src, mem)
  3915  		return true
  3916  	}
  3917  	// match: (Move [s] dst src mem)
  3918  	// cond: s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)
  3919  	// result: (LoweredQuadMove [s] dst src mem)
  3920  	for {
  3921  		s := auxIntToInt64(v.AuxInt)
  3922  		dst := v_0
  3923  		src := v_1
  3924  		mem := v_2
  3925  		if !(s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)) {
  3926  			break
  3927  		}
  3928  		v.reset(OpPPC64LoweredQuadMove)
  3929  		v.AuxInt = int64ToAuxInt(s)
  3930  		v.AddArg3(dst, src, mem)
  3931  		return true
  3932  	}
  3933  	return false
  3934  }
  3935  func rewriteValuePPC64_OpNeq16(v *Value) bool {
  3936  	v_1 := v.Args[1]
  3937  	v_0 := v.Args[0]
  3938  	b := v.Block
  3939  	typ := &b.Func.Config.Types
  3940  	// match: (Neq16 x y)
  3941  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  3942  	// result: (NotEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  3943  	for {
  3944  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  3945  			x := v_0
  3946  			y := v_1
  3947  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  3948  				continue
  3949  			}
  3950  			v.reset(OpPPC64NotEqual)
  3951  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3952  			v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3953  			v1.AddArg(x)
  3954  			v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3955  			v2.AddArg(y)
  3956  			v0.AddArg2(v1, v2)
  3957  			v.AddArg(v0)
  3958  			return true
  3959  		}
  3960  		break
  3961  	}
  3962  	// match: (Neq16 x y)
  3963  	// result: (NotEqual (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
  3964  	for {
  3965  		x := v_0
  3966  		y := v_1
  3967  		v.reset(OpPPC64NotEqual)
  3968  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3969  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3970  		v1.AddArg(x)
  3971  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3972  		v2.AddArg(y)
  3973  		v0.AddArg2(v1, v2)
  3974  		v.AddArg(v0)
  3975  		return true
  3976  	}
  3977  }
  3978  func rewriteValuePPC64_OpNeq32(v *Value) bool {
  3979  	v_1 := v.Args[1]
  3980  	v_0 := v.Args[0]
  3981  	b := v.Block
  3982  	// match: (Neq32 x y)
  3983  	// result: (NotEqual (CMPW x y))
  3984  	for {
  3985  		x := v_0
  3986  		y := v_1
  3987  		v.reset(OpPPC64NotEqual)
  3988  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3989  		v0.AddArg2(x, y)
  3990  		v.AddArg(v0)
  3991  		return true
  3992  	}
  3993  }
  3994  func rewriteValuePPC64_OpNeq32F(v *Value) bool {
  3995  	v_1 := v.Args[1]
  3996  	v_0 := v.Args[0]
  3997  	b := v.Block
  3998  	// match: (Neq32F x y)
  3999  	// result: (NotEqual (FCMPU x y))
  4000  	for {
  4001  		x := v_0
  4002  		y := v_1
  4003  		v.reset(OpPPC64NotEqual)
  4004  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  4005  		v0.AddArg2(x, y)
  4006  		v.AddArg(v0)
  4007  		return true
  4008  	}
  4009  }
  4010  func rewriteValuePPC64_OpNeq64(v *Value) bool {
  4011  	v_1 := v.Args[1]
  4012  	v_0 := v.Args[0]
  4013  	b := v.Block
  4014  	// match: (Neq64 x y)
  4015  	// result: (NotEqual (CMP x y))
  4016  	for {
  4017  		x := v_0
  4018  		y := v_1
  4019  		v.reset(OpPPC64NotEqual)
  4020  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  4021  		v0.AddArg2(x, y)
  4022  		v.AddArg(v0)
  4023  		return true
  4024  	}
  4025  }
  4026  func rewriteValuePPC64_OpNeq64F(v *Value) bool {
  4027  	v_1 := v.Args[1]
  4028  	v_0 := v.Args[0]
  4029  	b := v.Block
  4030  	// match: (Neq64F x y)
  4031  	// result: (NotEqual (FCMPU x y))
  4032  	for {
  4033  		x := v_0
  4034  		y := v_1
  4035  		v.reset(OpPPC64NotEqual)
  4036  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  4037  		v0.AddArg2(x, y)
  4038  		v.AddArg(v0)
  4039  		return true
  4040  	}
  4041  }
  4042  func rewriteValuePPC64_OpNeq8(v *Value) bool {
  4043  	v_1 := v.Args[1]
  4044  	v_0 := v.Args[0]
  4045  	b := v.Block
  4046  	typ := &b.Func.Config.Types
  4047  	// match: (Neq8 x y)
  4048  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  4049  	// result: (NotEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  4050  	for {
  4051  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4052  			x := v_0
  4053  			y := v_1
  4054  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  4055  				continue
  4056  			}
  4057  			v.reset(OpPPC64NotEqual)
  4058  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  4059  			v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  4060  			v1.AddArg(x)
  4061  			v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  4062  			v2.AddArg(y)
  4063  			v0.AddArg2(v1, v2)
  4064  			v.AddArg(v0)
  4065  			return true
  4066  		}
  4067  		break
  4068  	}
  4069  	// match: (Neq8 x y)
  4070  	// result: (NotEqual (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
  4071  	for {
  4072  		x := v_0
  4073  		y := v_1
  4074  		v.reset(OpPPC64NotEqual)
  4075  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  4076  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  4077  		v1.AddArg(x)
  4078  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  4079  		v2.AddArg(y)
  4080  		v0.AddArg2(v1, v2)
  4081  		v.AddArg(v0)
  4082  		return true
  4083  	}
  4084  }
  4085  func rewriteValuePPC64_OpNeqPtr(v *Value) bool {
  4086  	v_1 := v.Args[1]
  4087  	v_0 := v.Args[0]
  4088  	b := v.Block
  4089  	// match: (NeqPtr x y)
  4090  	// result: (NotEqual (CMP x y))
  4091  	for {
  4092  		x := v_0
  4093  		y := v_1
  4094  		v.reset(OpPPC64NotEqual)
  4095  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  4096  		v0.AddArg2(x, y)
  4097  		v.AddArg(v0)
  4098  		return true
  4099  	}
  4100  }
  4101  func rewriteValuePPC64_OpNot(v *Value) bool {
  4102  	v_0 := v.Args[0]
  4103  	// match: (Not x)
  4104  	// result: (XORconst [1] x)
  4105  	for {
  4106  		x := v_0
  4107  		v.reset(OpPPC64XORconst)
  4108  		v.AuxInt = int64ToAuxInt(1)
  4109  		v.AddArg(x)
  4110  		return true
  4111  	}
  4112  }
  4113  func rewriteValuePPC64_OpOffPtr(v *Value) bool {
  4114  	v_0 := v.Args[0]
  4115  	b := v.Block
  4116  	typ := &b.Func.Config.Types
  4117  	// match: (OffPtr [off] ptr)
  4118  	// result: (ADD (MOVDconst <typ.Int64> [off]) ptr)
  4119  	for {
  4120  		off := auxIntToInt64(v.AuxInt)
  4121  		ptr := v_0
  4122  		v.reset(OpPPC64ADD)
  4123  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  4124  		v0.AuxInt = int64ToAuxInt(off)
  4125  		v.AddArg2(v0, ptr)
  4126  		return true
  4127  	}
  4128  }
  4129  func rewriteValuePPC64_OpPPC64ADD(v *Value) bool {
  4130  	v_1 := v.Args[1]
  4131  	v_0 := v.Args[0]
  4132  	b := v.Block
  4133  	// match: (ADD z l:(MULLD x y))
  4134  	// cond: buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)
  4135  	// result: (MADDLD x y z )
  4136  	for {
  4137  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4138  			z := v_0
  4139  			l := v_1
  4140  			if l.Op != OpPPC64MULLD {
  4141  				continue
  4142  			}
  4143  			y := l.Args[1]
  4144  			x := l.Args[0]
  4145  			if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
  4146  				continue
  4147  			}
  4148  			v.reset(OpPPC64MADDLD)
  4149  			v.AddArg3(x, y, z)
  4150  			return true
  4151  		}
  4152  		break
  4153  	}
  4154  	// match: (ADD z l:(MULLDconst <mt> [x] y))
  4155  	// cond: buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)
  4156  	// result: (MADDLD (MOVDconst <mt> [int64(x)]) y z )
  4157  	for {
  4158  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4159  			z := v_0
  4160  			l := v_1
  4161  			if l.Op != OpPPC64MULLDconst {
  4162  				continue
  4163  			}
  4164  			mt := l.Type
  4165  			x := auxIntToInt32(l.AuxInt)
  4166  			y := l.Args[0]
  4167  			if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
  4168  				continue
  4169  			}
  4170  			v.reset(OpPPC64MADDLD)
  4171  			v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, mt)
  4172  			v0.AuxInt = int64ToAuxInt(int64(x))
  4173  			v.AddArg3(v0, y, z)
  4174  			return true
  4175  		}
  4176  		break
  4177  	}
  4178  	// match: (ADD x (MOVDconst <t> [c]))
  4179  	// cond: is32Bit(c) && !t.IsPtr()
  4180  	// result: (ADDconst [c] x)
  4181  	for {
  4182  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4183  			x := v_0
  4184  			if v_1.Op != OpPPC64MOVDconst {
  4185  				continue
  4186  			}
  4187  			t := v_1.Type
  4188  			c := auxIntToInt64(v_1.AuxInt)
  4189  			if !(is32Bit(c) && !t.IsPtr()) {
  4190  				continue
  4191  			}
  4192  			v.reset(OpPPC64ADDconst)
  4193  			v.AuxInt = int64ToAuxInt(c)
  4194  			v.AddArg(x)
  4195  			return true
  4196  		}
  4197  		break
  4198  	}
  4199  	return false
  4200  }
  4201  func rewriteValuePPC64_OpPPC64ADDC(v *Value) bool {
  4202  	v_1 := v.Args[1]
  4203  	v_0 := v.Args[0]
  4204  	// match: (ADDC x (MOVDconst [y]))
  4205  	// cond: is16Bit(y)
  4206  	// result: (ADDCconst [y] x)
  4207  	for {
  4208  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4209  			x := v_0
  4210  			if v_1.Op != OpPPC64MOVDconst {
  4211  				continue
  4212  			}
  4213  			y := auxIntToInt64(v_1.AuxInt)
  4214  			if !(is16Bit(y)) {
  4215  				continue
  4216  			}
  4217  			v.reset(OpPPC64ADDCconst)
  4218  			v.AuxInt = int64ToAuxInt(y)
  4219  			v.AddArg(x)
  4220  			return true
  4221  		}
  4222  		break
  4223  	}
  4224  	return false
  4225  }
  4226  func rewriteValuePPC64_OpPPC64ADDE(v *Value) bool {
  4227  	v_2 := v.Args[2]
  4228  	v_1 := v.Args[1]
  4229  	v_0 := v.Args[0]
  4230  	b := v.Block
  4231  	typ := &b.Func.Config.Types
  4232  	// match: (ADDE x y (Select1 <typ.UInt64> (ADDCconst (MOVDconst [0]) [-1])))
  4233  	// result: (ADDC x y)
  4234  	for {
  4235  		x := v_0
  4236  		y := v_1
  4237  		if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
  4238  			break
  4239  		}
  4240  		v_2_0 := v_2.Args[0]
  4241  		if v_2_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_2_0.AuxInt) != -1 {
  4242  			break
  4243  		}
  4244  		v_2_0_0 := v_2_0.Args[0]
  4245  		if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
  4246  			break
  4247  		}
  4248  		v.reset(OpPPC64ADDC)
  4249  		v.AddArg2(x, y)
  4250  		return true
  4251  	}
  4252  	// match: (ADDE (MOVDconst [0]) y c)
  4253  	// result: (ADDZE y c)
  4254  	for {
  4255  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4256  			if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4257  				continue
  4258  			}
  4259  			y := v_1
  4260  			c := v_2
  4261  			v.reset(OpPPC64ADDZE)
  4262  			v.AddArg2(y, c)
  4263  			return true
  4264  		}
  4265  		break
  4266  	}
  4267  	return false
  4268  }
  4269  func rewriteValuePPC64_OpPPC64ADDconst(v *Value) bool {
  4270  	v_0 := v.Args[0]
  4271  	b := v.Block
  4272  	// match: (ADDconst <at> [z] l:(MULLD x y))
  4273  	// cond: buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)
  4274  	// result: (MADDLD x y (MOVDconst <at> [int64(z)]))
  4275  	for {
  4276  		at := v.Type
  4277  		z := auxIntToInt64(v.AuxInt)
  4278  		l := v_0
  4279  		if l.Op != OpPPC64MULLD {
  4280  			break
  4281  		}
  4282  		y := l.Args[1]
  4283  		x := l.Args[0]
  4284  		if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
  4285  			break
  4286  		}
  4287  		v.reset(OpPPC64MADDLD)
  4288  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, at)
  4289  		v0.AuxInt = int64ToAuxInt(int64(z))
  4290  		v.AddArg3(x, y, v0)
  4291  		return true
  4292  	}
  4293  	// match: (ADDconst <at> [z] l:(MULLDconst <mt> [x] y))
  4294  	// cond: buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)
  4295  	// result: (MADDLD (MOVDconst <mt> [int64(x)]) y (MOVDconst <at> [int64(z)]))
  4296  	for {
  4297  		at := v.Type
  4298  		z := auxIntToInt64(v.AuxInt)
  4299  		l := v_0
  4300  		if l.Op != OpPPC64MULLDconst {
  4301  			break
  4302  		}
  4303  		mt := l.Type
  4304  		x := auxIntToInt32(l.AuxInt)
  4305  		y := l.Args[0]
  4306  		if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
  4307  			break
  4308  		}
  4309  		v.reset(OpPPC64MADDLD)
  4310  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, mt)
  4311  		v0.AuxInt = int64ToAuxInt(int64(x))
  4312  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, at)
  4313  		v1.AuxInt = int64ToAuxInt(int64(z))
  4314  		v.AddArg3(v0, y, v1)
  4315  		return true
  4316  	}
  4317  	// match: (ADDconst [c] (ADDconst [d] x))
  4318  	// cond: is32Bit(c+d)
  4319  	// result: (ADDconst [c+d] x)
  4320  	for {
  4321  		c := auxIntToInt64(v.AuxInt)
  4322  		if v_0.Op != OpPPC64ADDconst {
  4323  			break
  4324  		}
  4325  		d := auxIntToInt64(v_0.AuxInt)
  4326  		x := v_0.Args[0]
  4327  		if !(is32Bit(c + d)) {
  4328  			break
  4329  		}
  4330  		v.reset(OpPPC64ADDconst)
  4331  		v.AuxInt = int64ToAuxInt(c + d)
  4332  		v.AddArg(x)
  4333  		return true
  4334  	}
  4335  	// match: (ADDconst [0] x)
  4336  	// result: x
  4337  	for {
  4338  		if auxIntToInt64(v.AuxInt) != 0 {
  4339  			break
  4340  		}
  4341  		x := v_0
  4342  		v.copyOf(x)
  4343  		return true
  4344  	}
  4345  	// match: (ADDconst [c] (MOVDaddr [d] {sym} x))
  4346  	// cond: is32Bit(c+int64(d))
  4347  	// result: (MOVDaddr [int32(c+int64(d))] {sym} x)
  4348  	for {
  4349  		c := auxIntToInt64(v.AuxInt)
  4350  		if v_0.Op != OpPPC64MOVDaddr {
  4351  			break
  4352  		}
  4353  		d := auxIntToInt32(v_0.AuxInt)
  4354  		sym := auxToSym(v_0.Aux)
  4355  		x := v_0.Args[0]
  4356  		if !(is32Bit(c + int64(d))) {
  4357  			break
  4358  		}
  4359  		v.reset(OpPPC64MOVDaddr)
  4360  		v.AuxInt = int32ToAuxInt(int32(c + int64(d)))
  4361  		v.Aux = symToAux(sym)
  4362  		v.AddArg(x)
  4363  		return true
  4364  	}
  4365  	// match: (ADDconst [c] x:(SP))
  4366  	// cond: is32Bit(c)
  4367  	// result: (MOVDaddr [int32(c)] x)
  4368  	for {
  4369  		c := auxIntToInt64(v.AuxInt)
  4370  		x := v_0
  4371  		if x.Op != OpSP || !(is32Bit(c)) {
  4372  			break
  4373  		}
  4374  		v.reset(OpPPC64MOVDaddr)
  4375  		v.AuxInt = int32ToAuxInt(int32(c))
  4376  		v.AddArg(x)
  4377  		return true
  4378  	}
  4379  	// match: (ADDconst [c] (SUBFCconst [d] x))
  4380  	// cond: is32Bit(c+d)
  4381  	// result: (SUBFCconst [c+d] x)
  4382  	for {
  4383  		c := auxIntToInt64(v.AuxInt)
  4384  		if v_0.Op != OpPPC64SUBFCconst {
  4385  			break
  4386  		}
  4387  		d := auxIntToInt64(v_0.AuxInt)
  4388  		x := v_0.Args[0]
  4389  		if !(is32Bit(c + d)) {
  4390  			break
  4391  		}
  4392  		v.reset(OpPPC64SUBFCconst)
  4393  		v.AuxInt = int64ToAuxInt(c + d)
  4394  		v.AddArg(x)
  4395  		return true
  4396  	}
  4397  	return false
  4398  }
  4399  func rewriteValuePPC64_OpPPC64AND(v *Value) bool {
  4400  	v_1 := v.Args[1]
  4401  	v_0 := v.Args[0]
  4402  	// match: (AND <t> x (MOVDconst [m]))
  4403  	// cond: t.IsUnsigned() && t.Size() == 1 && m != int64(uint8(m))
  4404  	// result: (ANDconst [int64(uint8(m))] x)
  4405  	for {
  4406  		t := v.Type
  4407  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4408  			x := v_0
  4409  			if v_1.Op != OpPPC64MOVDconst {
  4410  				continue
  4411  			}
  4412  			m := auxIntToInt64(v_1.AuxInt)
  4413  			if !(t.IsUnsigned() && t.Size() == 1 && m != int64(uint8(m))) {
  4414  				continue
  4415  			}
  4416  			v.reset(OpPPC64ANDconst)
  4417  			v.AuxInt = int64ToAuxInt(int64(uint8(m)))
  4418  			v.AddArg(x)
  4419  			return true
  4420  		}
  4421  		break
  4422  	}
  4423  	// match: (AND <t> x (MOVDconst [m]))
  4424  	// cond: t.IsUnsigned() && t.Size() == 2 && m != int64(uint16(m))
  4425  	// result: (ANDconst [int64(uint16(m))] x)
  4426  	for {
  4427  		t := v.Type
  4428  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4429  			x := v_0
  4430  			if v_1.Op != OpPPC64MOVDconst {
  4431  				continue
  4432  			}
  4433  			m := auxIntToInt64(v_1.AuxInt)
  4434  			if !(t.IsUnsigned() && t.Size() == 2 && m != int64(uint16(m))) {
  4435  				continue
  4436  			}
  4437  			v.reset(OpPPC64ANDconst)
  4438  			v.AuxInt = int64ToAuxInt(int64(uint16(m)))
  4439  			v.AddArg(x)
  4440  			return true
  4441  		}
  4442  		break
  4443  	}
  4444  	// match: (AND (MOVDconst [m]) (ROTLWconst [r] x))
  4445  	// cond: isPPC64WordRotateMask(m)
  4446  	// result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
  4447  	for {
  4448  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4449  			if v_0.Op != OpPPC64MOVDconst {
  4450  				continue
  4451  			}
  4452  			m := auxIntToInt64(v_0.AuxInt)
  4453  			if v_1.Op != OpPPC64ROTLWconst {
  4454  				continue
  4455  			}
  4456  			r := auxIntToInt64(v_1.AuxInt)
  4457  			x := v_1.Args[0]
  4458  			if !(isPPC64WordRotateMask(m)) {
  4459  				continue
  4460  			}
  4461  			v.reset(OpPPC64RLWINM)
  4462  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
  4463  			v.AddArg(x)
  4464  			return true
  4465  		}
  4466  		break
  4467  	}
  4468  	// match: (AND (MOVDconst [m]) (ROTLW x r))
  4469  	// cond: isPPC64WordRotateMask(m)
  4470  	// result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
  4471  	for {
  4472  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4473  			if v_0.Op != OpPPC64MOVDconst {
  4474  				continue
  4475  			}
  4476  			m := auxIntToInt64(v_0.AuxInt)
  4477  			if v_1.Op != OpPPC64ROTLW {
  4478  				continue
  4479  			}
  4480  			r := v_1.Args[1]
  4481  			x := v_1.Args[0]
  4482  			if !(isPPC64WordRotateMask(m)) {
  4483  				continue
  4484  			}
  4485  			v.reset(OpPPC64RLWNM)
  4486  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
  4487  			v.AddArg2(x, r)
  4488  			return true
  4489  		}
  4490  		break
  4491  	}
  4492  	// match: (AND (MOVDconst [m]) (SRWconst x [s]))
  4493  	// cond: mergePPC64RShiftMask(m,s,32) == 0
  4494  	// result: (MOVDconst [0])
  4495  	for {
  4496  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4497  			if v_0.Op != OpPPC64MOVDconst {
  4498  				continue
  4499  			}
  4500  			m := auxIntToInt64(v_0.AuxInt)
  4501  			if v_1.Op != OpPPC64SRWconst {
  4502  				continue
  4503  			}
  4504  			s := auxIntToInt64(v_1.AuxInt)
  4505  			if !(mergePPC64RShiftMask(m, s, 32) == 0) {
  4506  				continue
  4507  			}
  4508  			v.reset(OpPPC64MOVDconst)
  4509  			v.AuxInt = int64ToAuxInt(0)
  4510  			return true
  4511  		}
  4512  		break
  4513  	}
  4514  	// match: (AND (MOVDconst [m]) (SRWconst x [s]))
  4515  	// cond: mergePPC64AndSrwi(m,s) != 0
  4516  	// result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
  4517  	for {
  4518  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4519  			if v_0.Op != OpPPC64MOVDconst {
  4520  				continue
  4521  			}
  4522  			m := auxIntToInt64(v_0.AuxInt)
  4523  			if v_1.Op != OpPPC64SRWconst {
  4524  				continue
  4525  			}
  4526  			s := auxIntToInt64(v_1.AuxInt)
  4527  			x := v_1.Args[0]
  4528  			if !(mergePPC64AndSrwi(m, s) != 0) {
  4529  				continue
  4530  			}
  4531  			v.reset(OpPPC64RLWINM)
  4532  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
  4533  			v.AddArg(x)
  4534  			return true
  4535  		}
  4536  		break
  4537  	}
  4538  	// match: (AND (MOVDconst [m]) (SRDconst x [s]))
  4539  	// cond: mergePPC64AndSrdi(m,s) != 0
  4540  	// result: (RLWINM [mergePPC64AndSrdi(m,s)] x)
  4541  	for {
  4542  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4543  			if v_0.Op != OpPPC64MOVDconst {
  4544  				continue
  4545  			}
  4546  			m := auxIntToInt64(v_0.AuxInt)
  4547  			if v_1.Op != OpPPC64SRDconst {
  4548  				continue
  4549  			}
  4550  			s := auxIntToInt64(v_1.AuxInt)
  4551  			x := v_1.Args[0]
  4552  			if !(mergePPC64AndSrdi(m, s) != 0) {
  4553  				continue
  4554  			}
  4555  			v.reset(OpPPC64RLWINM)
  4556  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrdi(m, s))
  4557  			v.AddArg(x)
  4558  			return true
  4559  		}
  4560  		break
  4561  	}
  4562  	// match: (AND (MOVDconst [m]) (SLDconst x [s]))
  4563  	// cond: mergePPC64AndSldi(m,s) != 0
  4564  	// result: (RLWINM [mergePPC64AndSldi(m,s)] x)
  4565  	for {
  4566  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4567  			if v_0.Op != OpPPC64MOVDconst {
  4568  				continue
  4569  			}
  4570  			m := auxIntToInt64(v_0.AuxInt)
  4571  			if v_1.Op != OpPPC64SLDconst {
  4572  				continue
  4573  			}
  4574  			s := auxIntToInt64(v_1.AuxInt)
  4575  			x := v_1.Args[0]
  4576  			if !(mergePPC64AndSldi(m, s) != 0) {
  4577  				continue
  4578  			}
  4579  			v.reset(OpPPC64RLWINM)
  4580  			v.AuxInt = int64ToAuxInt(mergePPC64AndSldi(m, s))
  4581  			v.AddArg(x)
  4582  			return true
  4583  		}
  4584  		break
  4585  	}
  4586  	// match: (AND x (NOR y y))
  4587  	// result: (ANDN x y)
  4588  	for {
  4589  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4590  			x := v_0
  4591  			if v_1.Op != OpPPC64NOR {
  4592  				continue
  4593  			}
  4594  			y := v_1.Args[1]
  4595  			if y != v_1.Args[0] {
  4596  				continue
  4597  			}
  4598  			v.reset(OpPPC64ANDN)
  4599  			v.AddArg2(x, y)
  4600  			return true
  4601  		}
  4602  		break
  4603  	}
  4604  	// match: (AND (MOVDconst [c]) (MOVDconst [d]))
  4605  	// result: (MOVDconst [c&d])
  4606  	for {
  4607  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4608  			if v_0.Op != OpPPC64MOVDconst {
  4609  				continue
  4610  			}
  4611  			c := auxIntToInt64(v_0.AuxInt)
  4612  			if v_1.Op != OpPPC64MOVDconst {
  4613  				continue
  4614  			}
  4615  			d := auxIntToInt64(v_1.AuxInt)
  4616  			v.reset(OpPPC64MOVDconst)
  4617  			v.AuxInt = int64ToAuxInt(c & d)
  4618  			return true
  4619  		}
  4620  		break
  4621  	}
  4622  	// match: (AND x (MOVDconst [-1]))
  4623  	// result: x
  4624  	for {
  4625  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4626  			x := v_0
  4627  			if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
  4628  				continue
  4629  			}
  4630  			v.copyOf(x)
  4631  			return true
  4632  		}
  4633  		break
  4634  	}
  4635  	// match: (AND x (MOVDconst [c]))
  4636  	// cond: isU16Bit(c)
  4637  	// result: (ANDconst [c] x)
  4638  	for {
  4639  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4640  			x := v_0
  4641  			if v_1.Op != OpPPC64MOVDconst {
  4642  				continue
  4643  			}
  4644  			c := auxIntToInt64(v_1.AuxInt)
  4645  			if !(isU16Bit(c)) {
  4646  				continue
  4647  			}
  4648  			v.reset(OpPPC64ANDconst)
  4649  			v.AuxInt = int64ToAuxInt(c)
  4650  			v.AddArg(x)
  4651  			return true
  4652  		}
  4653  		break
  4654  	}
  4655  	// match: (AND (MOVDconst [c]) y:(MOVWZreg _))
  4656  	// cond: c&0xFFFFFFFF == 0xFFFFFFFF
  4657  	// result: y
  4658  	for {
  4659  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4660  			if v_0.Op != OpPPC64MOVDconst {
  4661  				continue
  4662  			}
  4663  			c := auxIntToInt64(v_0.AuxInt)
  4664  			y := v_1
  4665  			if y.Op != OpPPC64MOVWZreg || !(c&0xFFFFFFFF == 0xFFFFFFFF) {
  4666  				continue
  4667  			}
  4668  			v.copyOf(y)
  4669  			return true
  4670  		}
  4671  		break
  4672  	}
  4673  	// match: (AND (MOVDconst [0xFFFFFFFF]) y:(MOVWreg x))
  4674  	// result: (MOVWZreg x)
  4675  	for {
  4676  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4677  			if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0xFFFFFFFF {
  4678  				continue
  4679  			}
  4680  			y := v_1
  4681  			if y.Op != OpPPC64MOVWreg {
  4682  				continue
  4683  			}
  4684  			x := y.Args[0]
  4685  			v.reset(OpPPC64MOVWZreg)
  4686  			v.AddArg(x)
  4687  			return true
  4688  		}
  4689  		break
  4690  	}
  4691  	// match: (AND (MOVDconst [c]) x:(MOVBZload _ _))
  4692  	// result: (ANDconst [c&0xFF] x)
  4693  	for {
  4694  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4695  			if v_0.Op != OpPPC64MOVDconst {
  4696  				continue
  4697  			}
  4698  			c := auxIntToInt64(v_0.AuxInt)
  4699  			x := v_1
  4700  			if x.Op != OpPPC64MOVBZload {
  4701  				continue
  4702  			}
  4703  			v.reset(OpPPC64ANDconst)
  4704  			v.AuxInt = int64ToAuxInt(c & 0xFF)
  4705  			v.AddArg(x)
  4706  			return true
  4707  		}
  4708  		break
  4709  	}
  4710  	return false
  4711  }
  4712  func rewriteValuePPC64_OpPPC64ANDN(v *Value) bool {
  4713  	v_1 := v.Args[1]
  4714  	v_0 := v.Args[0]
  4715  	// match: (ANDN (MOVDconst [c]) (MOVDconst [d]))
  4716  	// result: (MOVDconst [c&^d])
  4717  	for {
  4718  		if v_0.Op != OpPPC64MOVDconst {
  4719  			break
  4720  		}
  4721  		c := auxIntToInt64(v_0.AuxInt)
  4722  		if v_1.Op != OpPPC64MOVDconst {
  4723  			break
  4724  		}
  4725  		d := auxIntToInt64(v_1.AuxInt)
  4726  		v.reset(OpPPC64MOVDconst)
  4727  		v.AuxInt = int64ToAuxInt(c &^ d)
  4728  		return true
  4729  	}
  4730  	return false
  4731  }
  4732  func rewriteValuePPC64_OpPPC64ANDconst(v *Value) bool {
  4733  	v_0 := v.Args[0]
  4734  	// match: (ANDconst [m] (ROTLWconst [r] x))
  4735  	// cond: isPPC64WordRotateMask(m)
  4736  	// result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
  4737  	for {
  4738  		m := auxIntToInt64(v.AuxInt)
  4739  		if v_0.Op != OpPPC64ROTLWconst {
  4740  			break
  4741  		}
  4742  		r := auxIntToInt64(v_0.AuxInt)
  4743  		x := v_0.Args[0]
  4744  		if !(isPPC64WordRotateMask(m)) {
  4745  			break
  4746  		}
  4747  		v.reset(OpPPC64RLWINM)
  4748  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
  4749  		v.AddArg(x)
  4750  		return true
  4751  	}
  4752  	// match: (ANDconst [m] (ROTLW x r))
  4753  	// cond: isPPC64WordRotateMask(m)
  4754  	// result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
  4755  	for {
  4756  		m := auxIntToInt64(v.AuxInt)
  4757  		if v_0.Op != OpPPC64ROTLW {
  4758  			break
  4759  		}
  4760  		r := v_0.Args[1]
  4761  		x := v_0.Args[0]
  4762  		if !(isPPC64WordRotateMask(m)) {
  4763  			break
  4764  		}
  4765  		v.reset(OpPPC64RLWNM)
  4766  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
  4767  		v.AddArg2(x, r)
  4768  		return true
  4769  	}
  4770  	// match: (ANDconst [m] (SRWconst x [s]))
  4771  	// cond: mergePPC64RShiftMask(m,s,32) == 0
  4772  	// result: (MOVDconst [0])
  4773  	for {
  4774  		m := auxIntToInt64(v.AuxInt)
  4775  		if v_0.Op != OpPPC64SRWconst {
  4776  			break
  4777  		}
  4778  		s := auxIntToInt64(v_0.AuxInt)
  4779  		if !(mergePPC64RShiftMask(m, s, 32) == 0) {
  4780  			break
  4781  		}
  4782  		v.reset(OpPPC64MOVDconst)
  4783  		v.AuxInt = int64ToAuxInt(0)
  4784  		return true
  4785  	}
  4786  	// match: (ANDconst [m] (SRWconst x [s]))
  4787  	// cond: mergePPC64AndSrwi(m,s) != 0
  4788  	// result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
  4789  	for {
  4790  		m := auxIntToInt64(v.AuxInt)
  4791  		if v_0.Op != OpPPC64SRWconst {
  4792  			break
  4793  		}
  4794  		s := auxIntToInt64(v_0.AuxInt)
  4795  		x := v_0.Args[0]
  4796  		if !(mergePPC64AndSrwi(m, s) != 0) {
  4797  			break
  4798  		}
  4799  		v.reset(OpPPC64RLWINM)
  4800  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
  4801  		v.AddArg(x)
  4802  		return true
  4803  	}
  4804  	// match: (ANDconst [m] (SRDconst x [s]))
  4805  	// cond: mergePPC64AndSrdi(m,s) != 0
  4806  	// result: (RLWINM [mergePPC64AndSrdi(m,s)] x)
  4807  	for {
  4808  		m := auxIntToInt64(v.AuxInt)
  4809  		if v_0.Op != OpPPC64SRDconst {
  4810  			break
  4811  		}
  4812  		s := auxIntToInt64(v_0.AuxInt)
  4813  		x := v_0.Args[0]
  4814  		if !(mergePPC64AndSrdi(m, s) != 0) {
  4815  			break
  4816  		}
  4817  		v.reset(OpPPC64RLWINM)
  4818  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrdi(m, s))
  4819  		v.AddArg(x)
  4820  		return true
  4821  	}
  4822  	// match: (ANDconst [m] (SLDconst x [s]))
  4823  	// cond: mergePPC64AndSldi(m,s) != 0
  4824  	// result: (RLWINM [mergePPC64AndSldi(m,s)] x)
  4825  	for {
  4826  		m := auxIntToInt64(v.AuxInt)
  4827  		if v_0.Op != OpPPC64SLDconst {
  4828  			break
  4829  		}
  4830  		s := auxIntToInt64(v_0.AuxInt)
  4831  		x := v_0.Args[0]
  4832  		if !(mergePPC64AndSldi(m, s) != 0) {
  4833  			break
  4834  		}
  4835  		v.reset(OpPPC64RLWINM)
  4836  		v.AuxInt = int64ToAuxInt(mergePPC64AndSldi(m, s))
  4837  		v.AddArg(x)
  4838  		return true
  4839  	}
  4840  	// match: (ANDconst [c] (ANDconst [d] x))
  4841  	// result: (ANDconst [c&d] x)
  4842  	for {
  4843  		c := auxIntToInt64(v.AuxInt)
  4844  		if v_0.Op != OpPPC64ANDconst {
  4845  			break
  4846  		}
  4847  		d := auxIntToInt64(v_0.AuxInt)
  4848  		x := v_0.Args[0]
  4849  		v.reset(OpPPC64ANDconst)
  4850  		v.AuxInt = int64ToAuxInt(c & d)
  4851  		v.AddArg(x)
  4852  		return true
  4853  	}
  4854  	// match: (ANDconst [-1] x)
  4855  	// result: x
  4856  	for {
  4857  		if auxIntToInt64(v.AuxInt) != -1 {
  4858  			break
  4859  		}
  4860  		x := v_0
  4861  		v.copyOf(x)
  4862  		return true
  4863  	}
  4864  	// match: (ANDconst [0] _)
  4865  	// result: (MOVDconst [0])
  4866  	for {
  4867  		if auxIntToInt64(v.AuxInt) != 0 {
  4868  			break
  4869  		}
  4870  		v.reset(OpPPC64MOVDconst)
  4871  		v.AuxInt = int64ToAuxInt(0)
  4872  		return true
  4873  	}
  4874  	// match: (ANDconst [c] y:(MOVBZreg _))
  4875  	// cond: c&0xFF == 0xFF
  4876  	// result: y
  4877  	for {
  4878  		c := auxIntToInt64(v.AuxInt)
  4879  		y := v_0
  4880  		if y.Op != OpPPC64MOVBZreg || !(c&0xFF == 0xFF) {
  4881  			break
  4882  		}
  4883  		v.copyOf(y)
  4884  		return true
  4885  	}
  4886  	// match: (ANDconst [0xFF] (MOVBreg x))
  4887  	// result: (MOVBZreg x)
  4888  	for {
  4889  		if auxIntToInt64(v.AuxInt) != 0xFF || v_0.Op != OpPPC64MOVBreg {
  4890  			break
  4891  		}
  4892  		x := v_0.Args[0]
  4893  		v.reset(OpPPC64MOVBZreg)
  4894  		v.AddArg(x)
  4895  		return true
  4896  	}
  4897  	// match: (ANDconst [c] y:(MOVHZreg _))
  4898  	// cond: c&0xFFFF == 0xFFFF
  4899  	// result: y
  4900  	for {
  4901  		c := auxIntToInt64(v.AuxInt)
  4902  		y := v_0
  4903  		if y.Op != OpPPC64MOVHZreg || !(c&0xFFFF == 0xFFFF) {
  4904  			break
  4905  		}
  4906  		v.copyOf(y)
  4907  		return true
  4908  	}
  4909  	// match: (ANDconst [0xFFFF] (MOVHreg x))
  4910  	// result: (MOVHZreg x)
  4911  	for {
  4912  		if auxIntToInt64(v.AuxInt) != 0xFFFF || v_0.Op != OpPPC64MOVHreg {
  4913  			break
  4914  		}
  4915  		x := v_0.Args[0]
  4916  		v.reset(OpPPC64MOVHZreg)
  4917  		v.AddArg(x)
  4918  		return true
  4919  	}
  4920  	// match: (ANDconst [c] (MOVBZreg x))
  4921  	// result: (ANDconst [c&0xFF] x)
  4922  	for {
  4923  		c := auxIntToInt64(v.AuxInt)
  4924  		if v_0.Op != OpPPC64MOVBZreg {
  4925  			break
  4926  		}
  4927  		x := v_0.Args[0]
  4928  		v.reset(OpPPC64ANDconst)
  4929  		v.AuxInt = int64ToAuxInt(c & 0xFF)
  4930  		v.AddArg(x)
  4931  		return true
  4932  	}
  4933  	// match: (ANDconst [c] (MOVHZreg x))
  4934  	// result: (ANDconst [c&0xFFFF] x)
  4935  	for {
  4936  		c := auxIntToInt64(v.AuxInt)
  4937  		if v_0.Op != OpPPC64MOVHZreg {
  4938  			break
  4939  		}
  4940  		x := v_0.Args[0]
  4941  		v.reset(OpPPC64ANDconst)
  4942  		v.AuxInt = int64ToAuxInt(c & 0xFFFF)
  4943  		v.AddArg(x)
  4944  		return true
  4945  	}
  4946  	// match: (ANDconst [c] (MOVWZreg x))
  4947  	// result: (ANDconst [c&0xFFFFFFFF] x)
  4948  	for {
  4949  		c := auxIntToInt64(v.AuxInt)
  4950  		if v_0.Op != OpPPC64MOVWZreg {
  4951  			break
  4952  		}
  4953  		x := v_0.Args[0]
  4954  		v.reset(OpPPC64ANDconst)
  4955  		v.AuxInt = int64ToAuxInt(c & 0xFFFFFFFF)
  4956  		v.AddArg(x)
  4957  		return true
  4958  	}
  4959  	// match: (ANDconst [m] (RLWINM [r] y))
  4960  	// cond: mergePPC64AndRlwinm(uint32(m),r) != 0
  4961  	// result: (RLWINM [mergePPC64AndRlwinm(uint32(m),r)] y)
  4962  	for {
  4963  		m := auxIntToInt64(v.AuxInt)
  4964  		if v_0.Op != OpPPC64RLWINM {
  4965  			break
  4966  		}
  4967  		r := auxIntToInt64(v_0.AuxInt)
  4968  		y := v_0.Args[0]
  4969  		if !(mergePPC64AndRlwinm(uint32(m), r) != 0) {
  4970  			break
  4971  		}
  4972  		v.reset(OpPPC64RLWINM)
  4973  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(uint32(m), r))
  4974  		v.AddArg(y)
  4975  		return true
  4976  	}
  4977  	// match: (ANDconst [1] z:(SRADconst [63] x))
  4978  	// cond: z.Uses == 1
  4979  	// result: (SRDconst [63] x)
  4980  	for {
  4981  		if auxIntToInt64(v.AuxInt) != 1 {
  4982  			break
  4983  		}
  4984  		z := v_0
  4985  		if z.Op != OpPPC64SRADconst || auxIntToInt64(z.AuxInt) != 63 {
  4986  			break
  4987  		}
  4988  		x := z.Args[0]
  4989  		if !(z.Uses == 1) {
  4990  			break
  4991  		}
  4992  		v.reset(OpPPC64SRDconst)
  4993  		v.AuxInt = int64ToAuxInt(63)
  4994  		v.AddArg(x)
  4995  		return true
  4996  	}
  4997  	return false
  4998  }
  4999  func rewriteValuePPC64_OpPPC64BRD(v *Value) bool {
  5000  	v_0 := v.Args[0]
  5001  	b := v.Block
  5002  	typ := &b.Func.Config.Types
  5003  	// match: (BRD x:(MOVDload [off] {sym} ptr mem))
  5004  	// cond: x.Uses == 1
  5005  	// result: @x.Block (MOVDBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  5006  	for {
  5007  		x := v_0
  5008  		if x.Op != OpPPC64MOVDload {
  5009  			break
  5010  		}
  5011  		off := auxIntToInt32(x.AuxInt)
  5012  		sym := auxToSym(x.Aux)
  5013  		mem := x.Args[1]
  5014  		ptr := x.Args[0]
  5015  		if !(x.Uses == 1) {
  5016  			break
  5017  		}
  5018  		b = x.Block
  5019  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
  5020  		v.copyOf(v0)
  5021  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  5022  		v1.AuxInt = int32ToAuxInt(off)
  5023  		v1.Aux = symToAux(sym)
  5024  		v1.AddArg(ptr)
  5025  		v0.AddArg2(v1, mem)
  5026  		return true
  5027  	}
  5028  	// match: (BRD x:(MOVDloadidx ptr idx mem))
  5029  	// cond: x.Uses == 1
  5030  	// result: @x.Block (MOVDBRloadidx ptr idx mem)
  5031  	for {
  5032  		x := v_0
  5033  		if x.Op != OpPPC64MOVDloadidx {
  5034  			break
  5035  		}
  5036  		mem := x.Args[2]
  5037  		ptr := x.Args[0]
  5038  		idx := x.Args[1]
  5039  		if !(x.Uses == 1) {
  5040  			break
  5041  		}
  5042  		b = x.Block
  5043  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
  5044  		v.copyOf(v0)
  5045  		v0.AddArg3(ptr, idx, mem)
  5046  		return true
  5047  	}
  5048  	return false
  5049  }
  5050  func rewriteValuePPC64_OpPPC64BRH(v *Value) bool {
  5051  	v_0 := v.Args[0]
  5052  	b := v.Block
  5053  	typ := &b.Func.Config.Types
  5054  	// match: (BRH x:(MOVHZload [off] {sym} ptr mem))
  5055  	// cond: x.Uses == 1
  5056  	// result: @x.Block (MOVHBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  5057  	for {
  5058  		x := v_0
  5059  		if x.Op != OpPPC64MOVHZload {
  5060  			break
  5061  		}
  5062  		off := auxIntToInt32(x.AuxInt)
  5063  		sym := auxToSym(x.Aux)
  5064  		mem := x.Args[1]
  5065  		ptr := x.Args[0]
  5066  		if !(x.Uses == 1) {
  5067  			break
  5068  		}
  5069  		b = x.Block
  5070  		v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
  5071  		v.copyOf(v0)
  5072  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  5073  		v1.AuxInt = int32ToAuxInt(off)
  5074  		v1.Aux = symToAux(sym)
  5075  		v1.AddArg(ptr)
  5076  		v0.AddArg2(v1, mem)
  5077  		return true
  5078  	}
  5079  	// match: (BRH x:(MOVHZloadidx ptr idx mem))
  5080  	// cond: x.Uses == 1
  5081  	// result: @x.Block (MOVHBRloadidx ptr idx mem)
  5082  	for {
  5083  		x := v_0
  5084  		if x.Op != OpPPC64MOVHZloadidx {
  5085  			break
  5086  		}
  5087  		mem := x.Args[2]
  5088  		ptr := x.Args[0]
  5089  		idx := x.Args[1]
  5090  		if !(x.Uses == 1) {
  5091  			break
  5092  		}
  5093  		b = x.Block
  5094  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
  5095  		v.copyOf(v0)
  5096  		v0.AddArg3(ptr, idx, mem)
  5097  		return true
  5098  	}
  5099  	return false
  5100  }
  5101  func rewriteValuePPC64_OpPPC64BRW(v *Value) bool {
  5102  	v_0 := v.Args[0]
  5103  	b := v.Block
  5104  	typ := &b.Func.Config.Types
  5105  	// match: (BRW x:(MOVWZload [off] {sym} ptr mem))
  5106  	// cond: x.Uses == 1
  5107  	// result: @x.Block (MOVWBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  5108  	for {
  5109  		x := v_0
  5110  		if x.Op != OpPPC64MOVWZload {
  5111  			break
  5112  		}
  5113  		off := auxIntToInt32(x.AuxInt)
  5114  		sym := auxToSym(x.Aux)
  5115  		mem := x.Args[1]
  5116  		ptr := x.Args[0]
  5117  		if !(x.Uses == 1) {
  5118  			break
  5119  		}
  5120  		b = x.Block
  5121  		v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
  5122  		v.copyOf(v0)
  5123  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  5124  		v1.AuxInt = int32ToAuxInt(off)
  5125  		v1.Aux = symToAux(sym)
  5126  		v1.AddArg(ptr)
  5127  		v0.AddArg2(v1, mem)
  5128  		return true
  5129  	}
  5130  	// match: (BRW x:(MOVWZloadidx ptr idx mem))
  5131  	// cond: x.Uses == 1
  5132  	// result: @x.Block (MOVWBRloadidx ptr idx mem)
  5133  	for {
  5134  		x := v_0
  5135  		if x.Op != OpPPC64MOVWZloadidx {
  5136  			break
  5137  		}
  5138  		mem := x.Args[2]
  5139  		ptr := x.Args[0]
  5140  		idx := x.Args[1]
  5141  		if !(x.Uses == 1) {
  5142  			break
  5143  		}
  5144  		b = x.Block
  5145  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
  5146  		v.copyOf(v0)
  5147  		v0.AddArg3(ptr, idx, mem)
  5148  		return true
  5149  	}
  5150  	return false
  5151  }
  5152  func rewriteValuePPC64_OpPPC64CLRLSLDI(v *Value) bool {
  5153  	v_0 := v.Args[0]
  5154  	// match: (CLRLSLDI [c] (SRWconst [s] x))
  5155  	// cond: mergePPC64ClrlsldiSrw(int64(c),s) != 0
  5156  	// result: (RLWINM [mergePPC64ClrlsldiSrw(int64(c),s)] x)
  5157  	for {
  5158  		c := auxIntToInt32(v.AuxInt)
  5159  		if v_0.Op != OpPPC64SRWconst {
  5160  			break
  5161  		}
  5162  		s := auxIntToInt64(v_0.AuxInt)
  5163  		x := v_0.Args[0]
  5164  		if !(mergePPC64ClrlsldiSrw(int64(c), s) != 0) {
  5165  			break
  5166  		}
  5167  		v.reset(OpPPC64RLWINM)
  5168  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrw(int64(c), s))
  5169  		v.AddArg(x)
  5170  		return true
  5171  	}
  5172  	// match: (CLRLSLDI [c] (SRDconst [s] x))
  5173  	// cond: mergePPC64ClrlsldiSrd(int64(c),s) != 0
  5174  	// result: (RLWINM [mergePPC64ClrlsldiSrd(int64(c),s)] x)
  5175  	for {
  5176  		c := auxIntToInt32(v.AuxInt)
  5177  		if v_0.Op != OpPPC64SRDconst {
  5178  			break
  5179  		}
  5180  		s := auxIntToInt64(v_0.AuxInt)
  5181  		x := v_0.Args[0]
  5182  		if !(mergePPC64ClrlsldiSrd(int64(c), s) != 0) {
  5183  			break
  5184  		}
  5185  		v.reset(OpPPC64RLWINM)
  5186  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrd(int64(c), s))
  5187  		v.AddArg(x)
  5188  		return true
  5189  	}
  5190  	// match: (CLRLSLDI [c] i:(RLWINM [s] x))
  5191  	// cond: mergePPC64ClrlsldiRlwinm(c,s) != 0
  5192  	// result: (RLWINM [mergePPC64ClrlsldiRlwinm(c,s)] x)
  5193  	for {
  5194  		c := auxIntToInt32(v.AuxInt)
  5195  		i := v_0
  5196  		if i.Op != OpPPC64RLWINM {
  5197  			break
  5198  		}
  5199  		s := auxIntToInt64(i.AuxInt)
  5200  		x := i.Args[0]
  5201  		if !(mergePPC64ClrlsldiRlwinm(c, s) != 0) {
  5202  			break
  5203  		}
  5204  		v.reset(OpPPC64RLWINM)
  5205  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiRlwinm(c, s))
  5206  		v.AddArg(x)
  5207  		return true
  5208  	}
  5209  	return false
  5210  }
  5211  func rewriteValuePPC64_OpPPC64CMP(v *Value) bool {
  5212  	v_1 := v.Args[1]
  5213  	v_0 := v.Args[0]
  5214  	b := v.Block
  5215  	// match: (CMP x (MOVDconst [c]))
  5216  	// cond: is16Bit(c)
  5217  	// result: (CMPconst x [c])
  5218  	for {
  5219  		x := v_0
  5220  		if v_1.Op != OpPPC64MOVDconst {
  5221  			break
  5222  		}
  5223  		c := auxIntToInt64(v_1.AuxInt)
  5224  		if !(is16Bit(c)) {
  5225  			break
  5226  		}
  5227  		v.reset(OpPPC64CMPconst)
  5228  		v.AuxInt = int64ToAuxInt(c)
  5229  		v.AddArg(x)
  5230  		return true
  5231  	}
  5232  	// match: (CMP (MOVDconst [c]) y)
  5233  	// cond: is16Bit(c)
  5234  	// result: (InvertFlags (CMPconst y [c]))
  5235  	for {
  5236  		if v_0.Op != OpPPC64MOVDconst {
  5237  			break
  5238  		}
  5239  		c := auxIntToInt64(v_0.AuxInt)
  5240  		y := v_1
  5241  		if !(is16Bit(c)) {
  5242  			break
  5243  		}
  5244  		v.reset(OpPPC64InvertFlags)
  5245  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  5246  		v0.AuxInt = int64ToAuxInt(c)
  5247  		v0.AddArg(y)
  5248  		v.AddArg(v0)
  5249  		return true
  5250  	}
  5251  	// match: (CMP x y)
  5252  	// cond: canonLessThan(x,y)
  5253  	// result: (InvertFlags (CMP y x))
  5254  	for {
  5255  		x := v_0
  5256  		y := v_1
  5257  		if !(canonLessThan(x, y)) {
  5258  			break
  5259  		}
  5260  		v.reset(OpPPC64InvertFlags)
  5261  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  5262  		v0.AddArg2(y, x)
  5263  		v.AddArg(v0)
  5264  		return true
  5265  	}
  5266  	return false
  5267  }
  5268  func rewriteValuePPC64_OpPPC64CMPU(v *Value) bool {
  5269  	v_1 := v.Args[1]
  5270  	v_0 := v.Args[0]
  5271  	b := v.Block
  5272  	// match: (CMPU x (MOVDconst [c]))
  5273  	// cond: isU16Bit(c)
  5274  	// result: (CMPUconst x [c])
  5275  	for {
  5276  		x := v_0
  5277  		if v_1.Op != OpPPC64MOVDconst {
  5278  			break
  5279  		}
  5280  		c := auxIntToInt64(v_1.AuxInt)
  5281  		if !(isU16Bit(c)) {
  5282  			break
  5283  		}
  5284  		v.reset(OpPPC64CMPUconst)
  5285  		v.AuxInt = int64ToAuxInt(c)
  5286  		v.AddArg(x)
  5287  		return true
  5288  	}
  5289  	// match: (CMPU (MOVDconst [c]) y)
  5290  	// cond: isU16Bit(c)
  5291  	// result: (InvertFlags (CMPUconst y [c]))
  5292  	for {
  5293  		if v_0.Op != OpPPC64MOVDconst {
  5294  			break
  5295  		}
  5296  		c := auxIntToInt64(v_0.AuxInt)
  5297  		y := v_1
  5298  		if !(isU16Bit(c)) {
  5299  			break
  5300  		}
  5301  		v.reset(OpPPC64InvertFlags)
  5302  		v0 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  5303  		v0.AuxInt = int64ToAuxInt(c)
  5304  		v0.AddArg(y)
  5305  		v.AddArg(v0)
  5306  		return true
  5307  	}
  5308  	// match: (CMPU x y)
  5309  	// cond: canonLessThan(x,y)
  5310  	// result: (InvertFlags (CMPU y x))
  5311  	for {
  5312  		x := v_0
  5313  		y := v_1
  5314  		if !(canonLessThan(x, y)) {
  5315  			break
  5316  		}
  5317  		v.reset(OpPPC64InvertFlags)
  5318  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  5319  		v0.AddArg2(y, x)
  5320  		v.AddArg(v0)
  5321  		return true
  5322  	}
  5323  	return false
  5324  }
  5325  func rewriteValuePPC64_OpPPC64CMPUconst(v *Value) bool {
  5326  	v_0 := v.Args[0]
  5327  	// match: (CMPUconst [d] (ANDconst z [c]))
  5328  	// cond: uint64(d) > uint64(c)
  5329  	// result: (FlagLT)
  5330  	for {
  5331  		d := auxIntToInt64(v.AuxInt)
  5332  		if v_0.Op != OpPPC64ANDconst {
  5333  			break
  5334  		}
  5335  		c := auxIntToInt64(v_0.AuxInt)
  5336  		if !(uint64(d) > uint64(c)) {
  5337  			break
  5338  		}
  5339  		v.reset(OpPPC64FlagLT)
  5340  		return true
  5341  	}
  5342  	// match: (CMPUconst (MOVDconst [x]) [y])
  5343  	// cond: x==y
  5344  	// result: (FlagEQ)
  5345  	for {
  5346  		y := auxIntToInt64(v.AuxInt)
  5347  		if v_0.Op != OpPPC64MOVDconst {
  5348  			break
  5349  		}
  5350  		x := auxIntToInt64(v_0.AuxInt)
  5351  		if !(x == y) {
  5352  			break
  5353  		}
  5354  		v.reset(OpPPC64FlagEQ)
  5355  		return true
  5356  	}
  5357  	// match: (CMPUconst (MOVDconst [x]) [y])
  5358  	// cond: uint64(x)<uint64(y)
  5359  	// result: (FlagLT)
  5360  	for {
  5361  		y := auxIntToInt64(v.AuxInt)
  5362  		if v_0.Op != OpPPC64MOVDconst {
  5363  			break
  5364  		}
  5365  		x := auxIntToInt64(v_0.AuxInt)
  5366  		if !(uint64(x) < uint64(y)) {
  5367  			break
  5368  		}
  5369  		v.reset(OpPPC64FlagLT)
  5370  		return true
  5371  	}
  5372  	// match: (CMPUconst (MOVDconst [x]) [y])
  5373  	// cond: uint64(x)>uint64(y)
  5374  	// result: (FlagGT)
  5375  	for {
  5376  		y := auxIntToInt64(v.AuxInt)
  5377  		if v_0.Op != OpPPC64MOVDconst {
  5378  			break
  5379  		}
  5380  		x := auxIntToInt64(v_0.AuxInt)
  5381  		if !(uint64(x) > uint64(y)) {
  5382  			break
  5383  		}
  5384  		v.reset(OpPPC64FlagGT)
  5385  		return true
  5386  	}
  5387  	// match: (CMPUconst [0] a:(ANDconst [n] z))
  5388  	// result: (CMPconst [0] a)
  5389  	for {
  5390  		if auxIntToInt64(v.AuxInt) != 0 {
  5391  			break
  5392  		}
  5393  		a := v_0
  5394  		if a.Op != OpPPC64ANDconst {
  5395  			break
  5396  		}
  5397  		v.reset(OpPPC64CMPconst)
  5398  		v.AuxInt = int64ToAuxInt(0)
  5399  		v.AddArg(a)
  5400  		return true
  5401  	}
  5402  	return false
  5403  }
  5404  func rewriteValuePPC64_OpPPC64CMPW(v *Value) bool {
  5405  	v_1 := v.Args[1]
  5406  	v_0 := v.Args[0]
  5407  	b := v.Block
  5408  	// match: (CMPW x (MOVWreg y))
  5409  	// result: (CMPW x y)
  5410  	for {
  5411  		x := v_0
  5412  		if v_1.Op != OpPPC64MOVWreg {
  5413  			break
  5414  		}
  5415  		y := v_1.Args[0]
  5416  		v.reset(OpPPC64CMPW)
  5417  		v.AddArg2(x, y)
  5418  		return true
  5419  	}
  5420  	// match: (CMPW (MOVWreg x) y)
  5421  	// result: (CMPW x y)
  5422  	for {
  5423  		if v_0.Op != OpPPC64MOVWreg {
  5424  			break
  5425  		}
  5426  		x := v_0.Args[0]
  5427  		y := v_1
  5428  		v.reset(OpPPC64CMPW)
  5429  		v.AddArg2(x, y)
  5430  		return true
  5431  	}
  5432  	// match: (CMPW x (MOVDconst [c]))
  5433  	// cond: is16Bit(c)
  5434  	// result: (CMPWconst x [int32(c)])
  5435  	for {
  5436  		x := v_0
  5437  		if v_1.Op != OpPPC64MOVDconst {
  5438  			break
  5439  		}
  5440  		c := auxIntToInt64(v_1.AuxInt)
  5441  		if !(is16Bit(c)) {
  5442  			break
  5443  		}
  5444  		v.reset(OpPPC64CMPWconst)
  5445  		v.AuxInt = int32ToAuxInt(int32(c))
  5446  		v.AddArg(x)
  5447  		return true
  5448  	}
  5449  	// match: (CMPW (MOVDconst [c]) y)
  5450  	// cond: is16Bit(c)
  5451  	// result: (InvertFlags (CMPWconst y [int32(c)]))
  5452  	for {
  5453  		if v_0.Op != OpPPC64MOVDconst {
  5454  			break
  5455  		}
  5456  		c := auxIntToInt64(v_0.AuxInt)
  5457  		y := v_1
  5458  		if !(is16Bit(c)) {
  5459  			break
  5460  		}
  5461  		v.reset(OpPPC64InvertFlags)
  5462  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, types.TypeFlags)
  5463  		v0.AuxInt = int32ToAuxInt(int32(c))
  5464  		v0.AddArg(y)
  5465  		v.AddArg(v0)
  5466  		return true
  5467  	}
  5468  	// match: (CMPW x y)
  5469  	// cond: canonLessThan(x,y)
  5470  	// result: (InvertFlags (CMPW y x))
  5471  	for {
  5472  		x := v_0
  5473  		y := v_1
  5474  		if !(canonLessThan(x, y)) {
  5475  			break
  5476  		}
  5477  		v.reset(OpPPC64InvertFlags)
  5478  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  5479  		v0.AddArg2(y, x)
  5480  		v.AddArg(v0)
  5481  		return true
  5482  	}
  5483  	return false
  5484  }
  5485  func rewriteValuePPC64_OpPPC64CMPWU(v *Value) bool {
  5486  	v_1 := v.Args[1]
  5487  	v_0 := v.Args[0]
  5488  	b := v.Block
  5489  	// match: (CMPWU x (MOVWZreg y))
  5490  	// result: (CMPWU x y)
  5491  	for {
  5492  		x := v_0
  5493  		if v_1.Op != OpPPC64MOVWZreg {
  5494  			break
  5495  		}
  5496  		y := v_1.Args[0]
  5497  		v.reset(OpPPC64CMPWU)
  5498  		v.AddArg2(x, y)
  5499  		return true
  5500  	}
  5501  	// match: (CMPWU (MOVWZreg x) y)
  5502  	// result: (CMPWU x y)
  5503  	for {
  5504  		if v_0.Op != OpPPC64MOVWZreg {
  5505  			break
  5506  		}
  5507  		x := v_0.Args[0]
  5508  		y := v_1
  5509  		v.reset(OpPPC64CMPWU)
  5510  		v.AddArg2(x, y)
  5511  		return true
  5512  	}
  5513  	// match: (CMPWU x (MOVDconst [c]))
  5514  	// cond: isU16Bit(c)
  5515  	// result: (CMPWUconst x [int32(c)])
  5516  	for {
  5517  		x := v_0
  5518  		if v_1.Op != OpPPC64MOVDconst {
  5519  			break
  5520  		}
  5521  		c := auxIntToInt64(v_1.AuxInt)
  5522  		if !(isU16Bit(c)) {
  5523  			break
  5524  		}
  5525  		v.reset(OpPPC64CMPWUconst)
  5526  		v.AuxInt = int32ToAuxInt(int32(c))
  5527  		v.AddArg(x)
  5528  		return true
  5529  	}
  5530  	// match: (CMPWU (MOVDconst [c]) y)
  5531  	// cond: isU16Bit(c)
  5532  	// result: (InvertFlags (CMPWUconst y [int32(c)]))
  5533  	for {
  5534  		if v_0.Op != OpPPC64MOVDconst {
  5535  			break
  5536  		}
  5537  		c := auxIntToInt64(v_0.AuxInt)
  5538  		y := v_1
  5539  		if !(isU16Bit(c)) {
  5540  			break
  5541  		}
  5542  		v.reset(OpPPC64InvertFlags)
  5543  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  5544  		v0.AuxInt = int32ToAuxInt(int32(c))
  5545  		v0.AddArg(y)
  5546  		v.AddArg(v0)
  5547  		return true
  5548  	}
  5549  	// match: (CMPWU x y)
  5550  	// cond: canonLessThan(x,y)
  5551  	// result: (InvertFlags (CMPWU y x))
  5552  	for {
  5553  		x := v_0
  5554  		y := v_1
  5555  		if !(canonLessThan(x, y)) {
  5556  			break
  5557  		}
  5558  		v.reset(OpPPC64InvertFlags)
  5559  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  5560  		v0.AddArg2(y, x)
  5561  		v.AddArg(v0)
  5562  		return true
  5563  	}
  5564  	return false
  5565  }
  5566  func rewriteValuePPC64_OpPPC64CMPWUconst(v *Value) bool {
  5567  	v_0 := v.Args[0]
  5568  	// match: (CMPWUconst [d] (ANDconst z [c]))
  5569  	// cond: uint64(d) > uint64(c)
  5570  	// result: (FlagLT)
  5571  	for {
  5572  		d := auxIntToInt32(v.AuxInt)
  5573  		if v_0.Op != OpPPC64ANDconst {
  5574  			break
  5575  		}
  5576  		c := auxIntToInt64(v_0.AuxInt)
  5577  		if !(uint64(d) > uint64(c)) {
  5578  			break
  5579  		}
  5580  		v.reset(OpPPC64FlagLT)
  5581  		return true
  5582  	}
  5583  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5584  	// cond: int32(x)==int32(y)
  5585  	// result: (FlagEQ)
  5586  	for {
  5587  		y := auxIntToInt32(v.AuxInt)
  5588  		if v_0.Op != OpPPC64MOVDconst {
  5589  			break
  5590  		}
  5591  		x := auxIntToInt64(v_0.AuxInt)
  5592  		if !(int32(x) == int32(y)) {
  5593  			break
  5594  		}
  5595  		v.reset(OpPPC64FlagEQ)
  5596  		return true
  5597  	}
  5598  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5599  	// cond: uint32(x)<uint32(y)
  5600  	// result: (FlagLT)
  5601  	for {
  5602  		y := auxIntToInt32(v.AuxInt)
  5603  		if v_0.Op != OpPPC64MOVDconst {
  5604  			break
  5605  		}
  5606  		x := auxIntToInt64(v_0.AuxInt)
  5607  		if !(uint32(x) < uint32(y)) {
  5608  			break
  5609  		}
  5610  		v.reset(OpPPC64FlagLT)
  5611  		return true
  5612  	}
  5613  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5614  	// cond: uint32(x)>uint32(y)
  5615  	// result: (FlagGT)
  5616  	for {
  5617  		y := auxIntToInt32(v.AuxInt)
  5618  		if v_0.Op != OpPPC64MOVDconst {
  5619  			break
  5620  		}
  5621  		x := auxIntToInt64(v_0.AuxInt)
  5622  		if !(uint32(x) > uint32(y)) {
  5623  			break
  5624  		}
  5625  		v.reset(OpPPC64FlagGT)
  5626  		return true
  5627  	}
  5628  	// match: (CMPWUconst [0] a:(ANDconst [n] z))
  5629  	// result: (CMPconst [0] a)
  5630  	for {
  5631  		if auxIntToInt32(v.AuxInt) != 0 {
  5632  			break
  5633  		}
  5634  		a := v_0
  5635  		if a.Op != OpPPC64ANDconst {
  5636  			break
  5637  		}
  5638  		v.reset(OpPPC64CMPconst)
  5639  		v.AuxInt = int64ToAuxInt(0)
  5640  		v.AddArg(a)
  5641  		return true
  5642  	}
  5643  	return false
  5644  }
  5645  func rewriteValuePPC64_OpPPC64CMPWconst(v *Value) bool {
  5646  	v_0 := v.Args[0]
  5647  	// match: (CMPWconst (MOVDconst [x]) [y])
  5648  	// cond: int32(x)==int32(y)
  5649  	// result: (FlagEQ)
  5650  	for {
  5651  		y := auxIntToInt32(v.AuxInt)
  5652  		if v_0.Op != OpPPC64MOVDconst {
  5653  			break
  5654  		}
  5655  		x := auxIntToInt64(v_0.AuxInt)
  5656  		if !(int32(x) == int32(y)) {
  5657  			break
  5658  		}
  5659  		v.reset(OpPPC64FlagEQ)
  5660  		return true
  5661  	}
  5662  	// match: (CMPWconst (MOVDconst [x]) [y])
  5663  	// cond: int32(x)<int32(y)
  5664  	// result: (FlagLT)
  5665  	for {
  5666  		y := auxIntToInt32(v.AuxInt)
  5667  		if v_0.Op != OpPPC64MOVDconst {
  5668  			break
  5669  		}
  5670  		x := auxIntToInt64(v_0.AuxInt)
  5671  		if !(int32(x) < int32(y)) {
  5672  			break
  5673  		}
  5674  		v.reset(OpPPC64FlagLT)
  5675  		return true
  5676  	}
  5677  	// match: (CMPWconst (MOVDconst [x]) [y])
  5678  	// cond: int32(x)>int32(y)
  5679  	// result: (FlagGT)
  5680  	for {
  5681  		y := auxIntToInt32(v.AuxInt)
  5682  		if v_0.Op != OpPPC64MOVDconst {
  5683  			break
  5684  		}
  5685  		x := auxIntToInt64(v_0.AuxInt)
  5686  		if !(int32(x) > int32(y)) {
  5687  			break
  5688  		}
  5689  		v.reset(OpPPC64FlagGT)
  5690  		return true
  5691  	}
  5692  	// match: (CMPWconst [0] a:(ANDconst [n] z))
  5693  	// result: (CMPconst [0] a)
  5694  	for {
  5695  		if auxIntToInt32(v.AuxInt) != 0 {
  5696  			break
  5697  		}
  5698  		a := v_0
  5699  		if a.Op != OpPPC64ANDconst {
  5700  			break
  5701  		}
  5702  		v.reset(OpPPC64CMPconst)
  5703  		v.AuxInt = int64ToAuxInt(0)
  5704  		v.AddArg(a)
  5705  		return true
  5706  	}
  5707  	return false
  5708  }
  5709  func rewriteValuePPC64_OpPPC64CMPconst(v *Value) bool {
  5710  	v_0 := v.Args[0]
  5711  	// match: (CMPconst (MOVDconst [x]) [y])
  5712  	// cond: x==y
  5713  	// result: (FlagEQ)
  5714  	for {
  5715  		y := auxIntToInt64(v.AuxInt)
  5716  		if v_0.Op != OpPPC64MOVDconst {
  5717  			break
  5718  		}
  5719  		x := auxIntToInt64(v_0.AuxInt)
  5720  		if !(x == y) {
  5721  			break
  5722  		}
  5723  		v.reset(OpPPC64FlagEQ)
  5724  		return true
  5725  	}
  5726  	// match: (CMPconst (MOVDconst [x]) [y])
  5727  	// cond: x<y
  5728  	// result: (FlagLT)
  5729  	for {
  5730  		y := auxIntToInt64(v.AuxInt)
  5731  		if v_0.Op != OpPPC64MOVDconst {
  5732  			break
  5733  		}
  5734  		x := auxIntToInt64(v_0.AuxInt)
  5735  		if !(x < y) {
  5736  			break
  5737  		}
  5738  		v.reset(OpPPC64FlagLT)
  5739  		return true
  5740  	}
  5741  	// match: (CMPconst (MOVDconst [x]) [y])
  5742  	// cond: x>y
  5743  	// result: (FlagGT)
  5744  	for {
  5745  		y := auxIntToInt64(v.AuxInt)
  5746  		if v_0.Op != OpPPC64MOVDconst {
  5747  			break
  5748  		}
  5749  		x := auxIntToInt64(v_0.AuxInt)
  5750  		if !(x > y) {
  5751  			break
  5752  		}
  5753  		v.reset(OpPPC64FlagGT)
  5754  		return true
  5755  	}
  5756  	return false
  5757  }
  5758  func rewriteValuePPC64_OpPPC64Equal(v *Value) bool {
  5759  	v_0 := v.Args[0]
  5760  	// match: (Equal (FlagEQ))
  5761  	// result: (MOVDconst [1])
  5762  	for {
  5763  		if v_0.Op != OpPPC64FlagEQ {
  5764  			break
  5765  		}
  5766  		v.reset(OpPPC64MOVDconst)
  5767  		v.AuxInt = int64ToAuxInt(1)
  5768  		return true
  5769  	}
  5770  	// match: (Equal (FlagLT))
  5771  	// result: (MOVDconst [0])
  5772  	for {
  5773  		if v_0.Op != OpPPC64FlagLT {
  5774  			break
  5775  		}
  5776  		v.reset(OpPPC64MOVDconst)
  5777  		v.AuxInt = int64ToAuxInt(0)
  5778  		return true
  5779  	}
  5780  	// match: (Equal (FlagGT))
  5781  	// result: (MOVDconst [0])
  5782  	for {
  5783  		if v_0.Op != OpPPC64FlagGT {
  5784  			break
  5785  		}
  5786  		v.reset(OpPPC64MOVDconst)
  5787  		v.AuxInt = int64ToAuxInt(0)
  5788  		return true
  5789  	}
  5790  	// match: (Equal (InvertFlags x))
  5791  	// result: (Equal x)
  5792  	for {
  5793  		if v_0.Op != OpPPC64InvertFlags {
  5794  			break
  5795  		}
  5796  		x := v_0.Args[0]
  5797  		v.reset(OpPPC64Equal)
  5798  		v.AddArg(x)
  5799  		return true
  5800  	}
  5801  	// match: (Equal cmp)
  5802  	// result: (SETBC [2] cmp)
  5803  	for {
  5804  		cmp := v_0
  5805  		v.reset(OpPPC64SETBC)
  5806  		v.AuxInt = int32ToAuxInt(2)
  5807  		v.AddArg(cmp)
  5808  		return true
  5809  	}
  5810  }
  5811  func rewriteValuePPC64_OpPPC64FABS(v *Value) bool {
  5812  	v_0 := v.Args[0]
  5813  	// match: (FABS (FMOVDconst [x]))
  5814  	// result: (FMOVDconst [math.Abs(x)])
  5815  	for {
  5816  		if v_0.Op != OpPPC64FMOVDconst {
  5817  			break
  5818  		}
  5819  		x := auxIntToFloat64(v_0.AuxInt)
  5820  		v.reset(OpPPC64FMOVDconst)
  5821  		v.AuxInt = float64ToAuxInt(math.Abs(x))
  5822  		return true
  5823  	}
  5824  	return false
  5825  }
  5826  func rewriteValuePPC64_OpPPC64FADD(v *Value) bool {
  5827  	v_1 := v.Args[1]
  5828  	v_0 := v.Args[0]
  5829  	// match: (FADD (FMUL x y) z)
  5830  	// cond: x.Block.Func.useFMA(v)
  5831  	// result: (FMADD x y z)
  5832  	for {
  5833  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5834  			if v_0.Op != OpPPC64FMUL {
  5835  				continue
  5836  			}
  5837  			_ = v_0.Args[1]
  5838  			v_0_0 := v_0.Args[0]
  5839  			v_0_1 := v_0.Args[1]
  5840  			for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
  5841  				x := v_0_0
  5842  				y := v_0_1
  5843  				z := v_1
  5844  				if !(x.Block.Func.useFMA(v)) {
  5845  					continue
  5846  				}
  5847  				v.reset(OpPPC64FMADD)
  5848  				v.AddArg3(x, y, z)
  5849  				return true
  5850  			}
  5851  		}
  5852  		break
  5853  	}
  5854  	return false
  5855  }
  5856  func rewriteValuePPC64_OpPPC64FADDS(v *Value) bool {
  5857  	v_1 := v.Args[1]
  5858  	v_0 := v.Args[0]
  5859  	// match: (FADDS (FMULS x y) z)
  5860  	// cond: x.Block.Func.useFMA(v)
  5861  	// result: (FMADDS x y z)
  5862  	for {
  5863  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5864  			if v_0.Op != OpPPC64FMULS {
  5865  				continue
  5866  			}
  5867  			_ = v_0.Args[1]
  5868  			v_0_0 := v_0.Args[0]
  5869  			v_0_1 := v_0.Args[1]
  5870  			for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
  5871  				x := v_0_0
  5872  				y := v_0_1
  5873  				z := v_1
  5874  				if !(x.Block.Func.useFMA(v)) {
  5875  					continue
  5876  				}
  5877  				v.reset(OpPPC64FMADDS)
  5878  				v.AddArg3(x, y, z)
  5879  				return true
  5880  			}
  5881  		}
  5882  		break
  5883  	}
  5884  	return false
  5885  }
  5886  func rewriteValuePPC64_OpPPC64FCEIL(v *Value) bool {
  5887  	v_0 := v.Args[0]
  5888  	// match: (FCEIL (FMOVDconst [x]))
  5889  	// result: (FMOVDconst [math.Ceil(x)])
  5890  	for {
  5891  		if v_0.Op != OpPPC64FMOVDconst {
  5892  			break
  5893  		}
  5894  		x := auxIntToFloat64(v_0.AuxInt)
  5895  		v.reset(OpPPC64FMOVDconst)
  5896  		v.AuxInt = float64ToAuxInt(math.Ceil(x))
  5897  		return true
  5898  	}
  5899  	return false
  5900  }
  5901  func rewriteValuePPC64_OpPPC64FFLOOR(v *Value) bool {
  5902  	v_0 := v.Args[0]
  5903  	// match: (FFLOOR (FMOVDconst [x]))
  5904  	// result: (FMOVDconst [math.Floor(x)])
  5905  	for {
  5906  		if v_0.Op != OpPPC64FMOVDconst {
  5907  			break
  5908  		}
  5909  		x := auxIntToFloat64(v_0.AuxInt)
  5910  		v.reset(OpPPC64FMOVDconst)
  5911  		v.AuxInt = float64ToAuxInt(math.Floor(x))
  5912  		return true
  5913  	}
  5914  	return false
  5915  }
  5916  func rewriteValuePPC64_OpPPC64FGreaterEqual(v *Value) bool {
  5917  	v_0 := v.Args[0]
  5918  	b := v.Block
  5919  	typ := &b.Func.Config.Types
  5920  	// match: (FGreaterEqual cmp)
  5921  	// result: (OR (SETBC [2] cmp) (SETBC [1] cmp))
  5922  	for {
  5923  		cmp := v_0
  5924  		v.reset(OpPPC64OR)
  5925  		v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5926  		v0.AuxInt = int32ToAuxInt(2)
  5927  		v0.AddArg(cmp)
  5928  		v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5929  		v1.AuxInt = int32ToAuxInt(1)
  5930  		v1.AddArg(cmp)
  5931  		v.AddArg2(v0, v1)
  5932  		return true
  5933  	}
  5934  }
  5935  func rewriteValuePPC64_OpPPC64FGreaterThan(v *Value) bool {
  5936  	v_0 := v.Args[0]
  5937  	// match: (FGreaterThan cmp)
  5938  	// result: (SETBC [1] cmp)
  5939  	for {
  5940  		cmp := v_0
  5941  		v.reset(OpPPC64SETBC)
  5942  		v.AuxInt = int32ToAuxInt(1)
  5943  		v.AddArg(cmp)
  5944  		return true
  5945  	}
  5946  }
  5947  func rewriteValuePPC64_OpPPC64FLessEqual(v *Value) bool {
  5948  	v_0 := v.Args[0]
  5949  	b := v.Block
  5950  	typ := &b.Func.Config.Types
  5951  	// match: (FLessEqual cmp)
  5952  	// result: (OR (SETBC [2] cmp) (SETBC [0] cmp))
  5953  	for {
  5954  		cmp := v_0
  5955  		v.reset(OpPPC64OR)
  5956  		v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5957  		v0.AuxInt = int32ToAuxInt(2)
  5958  		v0.AddArg(cmp)
  5959  		v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5960  		v1.AuxInt = int32ToAuxInt(0)
  5961  		v1.AddArg(cmp)
  5962  		v.AddArg2(v0, v1)
  5963  		return true
  5964  	}
  5965  }
  5966  func rewriteValuePPC64_OpPPC64FLessThan(v *Value) bool {
  5967  	v_0 := v.Args[0]
  5968  	// match: (FLessThan cmp)
  5969  	// result: (SETBC [0] cmp)
  5970  	for {
  5971  		cmp := v_0
  5972  		v.reset(OpPPC64SETBC)
  5973  		v.AuxInt = int32ToAuxInt(0)
  5974  		v.AddArg(cmp)
  5975  		return true
  5976  	}
  5977  }
  5978  func rewriteValuePPC64_OpPPC64FMOVDload(v *Value) bool {
  5979  	v_1 := v.Args[1]
  5980  	v_0 := v.Args[0]
  5981  	// match: (FMOVDload [off] {sym} ptr (MOVDstore [off] {sym} ptr x _))
  5982  	// result: (MTVSRD x)
  5983  	for {
  5984  		off := auxIntToInt32(v.AuxInt)
  5985  		sym := auxToSym(v.Aux)
  5986  		ptr := v_0
  5987  		if v_1.Op != OpPPC64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5988  			break
  5989  		}
  5990  		x := v_1.Args[1]
  5991  		if ptr != v_1.Args[0] {
  5992  			break
  5993  		}
  5994  		v.reset(OpPPC64MTVSRD)
  5995  		v.AddArg(x)
  5996  		return true
  5997  	}
  5998  	// match: (FMOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  5999  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  6000  	// result: (FMOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  6001  	for {
  6002  		off1 := auxIntToInt32(v.AuxInt)
  6003  		sym1 := auxToSym(v.Aux)
  6004  		p := v_0
  6005  		if p.Op != OpPPC64MOVDaddr {
  6006  			break
  6007  		}
  6008  		off2 := auxIntToInt32(p.AuxInt)
  6009  		sym2 := auxToSym(p.Aux)
  6010  		ptr := p.Args[0]
  6011  		mem := v_1
  6012  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  6013  			break
  6014  		}
  6015  		v.reset(OpPPC64FMOVDload)
  6016  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6017  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6018  		v.AddArg2(ptr, mem)
  6019  		return true
  6020  	}
  6021  	// match: (FMOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
  6022  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  6023  	// result: (FMOVDload [off1+int32(off2)] {sym} ptr mem)
  6024  	for {
  6025  		off1 := auxIntToInt32(v.AuxInt)
  6026  		sym := auxToSym(v.Aux)
  6027  		if v_0.Op != OpPPC64ADDconst {
  6028  			break
  6029  		}
  6030  		off2 := auxIntToInt64(v_0.AuxInt)
  6031  		ptr := v_0.Args[0]
  6032  		mem := v_1
  6033  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  6034  			break
  6035  		}
  6036  		v.reset(OpPPC64FMOVDload)
  6037  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6038  		v.Aux = symToAux(sym)
  6039  		v.AddArg2(ptr, mem)
  6040  		return true
  6041  	}
  6042  	return false
  6043  }
  6044  func rewriteValuePPC64_OpPPC64FMOVDstore(v *Value) bool {
  6045  	v_2 := v.Args[2]
  6046  	v_1 := v.Args[1]
  6047  	v_0 := v.Args[0]
  6048  	// match: (FMOVDstore [off] {sym} ptr (MTVSRD x) mem)
  6049  	// result: (MOVDstore [off] {sym} ptr x mem)
  6050  	for {
  6051  		off := auxIntToInt32(v.AuxInt)
  6052  		sym := auxToSym(v.Aux)
  6053  		ptr := v_0
  6054  		if v_1.Op != OpPPC64MTVSRD {
  6055  			break
  6056  		}
  6057  		x := v_1.Args[0]
  6058  		mem := v_2
  6059  		v.reset(OpPPC64MOVDstore)
  6060  		v.AuxInt = int32ToAuxInt(off)
  6061  		v.Aux = symToAux(sym)
  6062  		v.AddArg3(ptr, x, mem)
  6063  		return true
  6064  	}
  6065  	// match: (FMOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  6066  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  6067  	// result: (FMOVDstore [off1+int32(off2)] {sym} ptr val mem)
  6068  	for {
  6069  		off1 := auxIntToInt32(v.AuxInt)
  6070  		sym := auxToSym(v.Aux)
  6071  		if v_0.Op != OpPPC64ADDconst {
  6072  			break
  6073  		}
  6074  		off2 := auxIntToInt64(v_0.AuxInt)
  6075  		ptr := v_0.Args[0]
  6076  		val := v_1
  6077  		mem := v_2
  6078  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  6079  			break
  6080  		}
  6081  		v.reset(OpPPC64FMOVDstore)
  6082  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6083  		v.Aux = symToAux(sym)
  6084  		v.AddArg3(ptr, val, mem)
  6085  		return true
  6086  	}
  6087  	// match: (FMOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  6088  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  6089  	// result: (FMOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  6090  	for {
  6091  		off1 := auxIntToInt32(v.AuxInt)
  6092  		sym1 := auxToSym(v.Aux)
  6093  		p := v_0
  6094  		if p.Op != OpPPC64MOVDaddr {
  6095  			break
  6096  		}
  6097  		off2 := auxIntToInt32(p.AuxInt)
  6098  		sym2 := auxToSym(p.Aux)
  6099  		ptr := p.Args[0]
  6100  		val := v_1
  6101  		mem := v_2
  6102  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  6103  			break
  6104  		}
  6105  		v.reset(OpPPC64FMOVDstore)
  6106  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6107  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6108  		v.AddArg3(ptr, val, mem)
  6109  		return true
  6110  	}
  6111  	return false
  6112  }
  6113  func rewriteValuePPC64_OpPPC64FMOVSload(v *Value) bool {
  6114  	v_1 := v.Args[1]
  6115  	v_0 := v.Args[0]
  6116  	// match: (FMOVSload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  6117  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  6118  	// result: (FMOVSload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  6119  	for {
  6120  		off1 := auxIntToInt32(v.AuxInt)
  6121  		sym1 := auxToSym(v.Aux)
  6122  		p := v_0
  6123  		if p.Op != OpPPC64MOVDaddr {
  6124  			break
  6125  		}
  6126  		off2 := auxIntToInt32(p.AuxInt)
  6127  		sym2 := auxToSym(p.Aux)
  6128  		ptr := p.Args[0]
  6129  		mem := v_1
  6130  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  6131  			break
  6132  		}
  6133  		v.reset(OpPPC64FMOVSload)
  6134  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6135  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6136  		v.AddArg2(ptr, mem)
  6137  		return true
  6138  	}
  6139  	// match: (FMOVSload [off1] {sym} (ADDconst [off2] ptr) mem)
  6140  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  6141  	// result: (FMOVSload [off1+int32(off2)] {sym} ptr mem)
  6142  	for {
  6143  		off1 := auxIntToInt32(v.AuxInt)
  6144  		sym := auxToSym(v.Aux)
  6145  		if v_0.Op != OpPPC64ADDconst {
  6146  			break
  6147  		}
  6148  		off2 := auxIntToInt64(v_0.AuxInt)
  6149  		ptr := v_0.Args[0]
  6150  		mem := v_1
  6151  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  6152  			break
  6153  		}
  6154  		v.reset(OpPPC64FMOVSload)
  6155  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6156  		v.Aux = symToAux(sym)
  6157  		v.AddArg2(ptr, mem)
  6158  		return true
  6159  	}
  6160  	return false
  6161  }
  6162  func rewriteValuePPC64_OpPPC64FMOVSstore(v *Value) bool {
  6163  	v_2 := v.Args[2]
  6164  	v_1 := v.Args[1]
  6165  	v_0 := v.Args[0]
  6166  	// match: (FMOVSstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  6167  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  6168  	// result: (FMOVSstore [off1+int32(off2)] {sym} ptr val mem)
  6169  	for {
  6170  		off1 := auxIntToInt32(v.AuxInt)
  6171  		sym := auxToSym(v.Aux)
  6172  		if v_0.Op != OpPPC64ADDconst {
  6173  			break
  6174  		}
  6175  		off2 := auxIntToInt64(v_0.AuxInt)
  6176  		ptr := v_0.Args[0]
  6177  		val := v_1
  6178  		mem := v_2
  6179  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  6180  			break
  6181  		}
  6182  		v.reset(OpPPC64FMOVSstore)
  6183  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6184  		v.Aux = symToAux(sym)
  6185  		v.AddArg3(ptr, val, mem)
  6186  		return true
  6187  	}
  6188  	// match: (FMOVSstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  6189  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  6190  	// result: (FMOVSstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  6191  	for {
  6192  		off1 := auxIntToInt32(v.AuxInt)
  6193  		sym1 := auxToSym(v.Aux)
  6194  		p := v_0
  6195  		if p.Op != OpPPC64MOVDaddr {
  6196  			break
  6197  		}
  6198  		off2 := auxIntToInt32(p.AuxInt)
  6199  		sym2 := auxToSym(p.Aux)
  6200  		ptr := p.Args[0]
  6201  		val := v_1
  6202  		mem := v_2
  6203  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  6204  			break
  6205  		}
  6206  		v.reset(OpPPC64FMOVSstore)
  6207  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6208  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6209  		v.AddArg3(ptr, val, mem)
  6210  		return true
  6211  	}
  6212  	return false
  6213  }
  6214  func rewriteValuePPC64_OpPPC64FNEG(v *Value) bool {
  6215  	v_0 := v.Args[0]
  6216  	// match: (FNEG (FABS x))
  6217  	// result: (FNABS x)
  6218  	for {
  6219  		if v_0.Op != OpPPC64FABS {
  6220  			break
  6221  		}
  6222  		x := v_0.Args[0]
  6223  		v.reset(OpPPC64FNABS)
  6224  		v.AddArg(x)
  6225  		return true
  6226  	}
  6227  	// match: (FNEG (FNABS x))
  6228  	// result: (FABS x)
  6229  	for {
  6230  		if v_0.Op != OpPPC64FNABS {
  6231  			break
  6232  		}
  6233  		x := v_0.Args[0]
  6234  		v.reset(OpPPC64FABS)
  6235  		v.AddArg(x)
  6236  		return true
  6237  	}
  6238  	return false
  6239  }
  6240  func rewriteValuePPC64_OpPPC64FSQRT(v *Value) bool {
  6241  	v_0 := v.Args[0]
  6242  	// match: (FSQRT (FMOVDconst [x]))
  6243  	// cond: x >= 0
  6244  	// result: (FMOVDconst [math.Sqrt(x)])
  6245  	for {
  6246  		if v_0.Op != OpPPC64FMOVDconst {
  6247  			break
  6248  		}
  6249  		x := auxIntToFloat64(v_0.AuxInt)
  6250  		if !(x >= 0) {
  6251  			break
  6252  		}
  6253  		v.reset(OpPPC64FMOVDconst)
  6254  		v.AuxInt = float64ToAuxInt(math.Sqrt(x))
  6255  		return true
  6256  	}
  6257  	return false
  6258  }
  6259  func rewriteValuePPC64_OpPPC64FSUB(v *Value) bool {
  6260  	v_1 := v.Args[1]
  6261  	v_0 := v.Args[0]
  6262  	// match: (FSUB (FMUL x y) z)
  6263  	// cond: x.Block.Func.useFMA(v)
  6264  	// result: (FMSUB x y z)
  6265  	for {
  6266  		if v_0.Op != OpPPC64FMUL {
  6267  			break
  6268  		}
  6269  		_ = v_0.Args[1]
  6270  		v_0_0 := v_0.Args[0]
  6271  		v_0_1 := v_0.Args[1]
  6272  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6273  			x := v_0_0
  6274  			y := v_0_1
  6275  			z := v_1
  6276  			if !(x.Block.Func.useFMA(v)) {
  6277  				continue
  6278  			}
  6279  			v.reset(OpPPC64FMSUB)
  6280  			v.AddArg3(x, y, z)
  6281  			return true
  6282  		}
  6283  		break
  6284  	}
  6285  	return false
  6286  }
  6287  func rewriteValuePPC64_OpPPC64FSUBS(v *Value) bool {
  6288  	v_1 := v.Args[1]
  6289  	v_0 := v.Args[0]
  6290  	// match: (FSUBS (FMULS x y) z)
  6291  	// cond: x.Block.Func.useFMA(v)
  6292  	// result: (FMSUBS x y z)
  6293  	for {
  6294  		if v_0.Op != OpPPC64FMULS {
  6295  			break
  6296  		}
  6297  		_ = v_0.Args[1]
  6298  		v_0_0 := v_0.Args[0]
  6299  		v_0_1 := v_0.Args[1]
  6300  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6301  			x := v_0_0
  6302  			y := v_0_1
  6303  			z := v_1
  6304  			if !(x.Block.Func.useFMA(v)) {
  6305  				continue
  6306  			}
  6307  			v.reset(OpPPC64FMSUBS)
  6308  			v.AddArg3(x, y, z)
  6309  			return true
  6310  		}
  6311  		break
  6312  	}
  6313  	return false
  6314  }
  6315  func rewriteValuePPC64_OpPPC64FTRUNC(v *Value) bool {
  6316  	v_0 := v.Args[0]
  6317  	// match: (FTRUNC (FMOVDconst [x]))
  6318  	// result: (FMOVDconst [math.Trunc(x)])
  6319  	for {
  6320  		if v_0.Op != OpPPC64FMOVDconst {
  6321  			break
  6322  		}
  6323  		x := auxIntToFloat64(v_0.AuxInt)
  6324  		v.reset(OpPPC64FMOVDconst)
  6325  		v.AuxInt = float64ToAuxInt(math.Trunc(x))
  6326  		return true
  6327  	}
  6328  	return false
  6329  }
  6330  func rewriteValuePPC64_OpPPC64GreaterEqual(v *Value) bool {
  6331  	v_0 := v.Args[0]
  6332  	// match: (GreaterEqual (FlagEQ))
  6333  	// result: (MOVDconst [1])
  6334  	for {
  6335  		if v_0.Op != OpPPC64FlagEQ {
  6336  			break
  6337  		}
  6338  		v.reset(OpPPC64MOVDconst)
  6339  		v.AuxInt = int64ToAuxInt(1)
  6340  		return true
  6341  	}
  6342  	// match: (GreaterEqual (FlagLT))
  6343  	// result: (MOVDconst [0])
  6344  	for {
  6345  		if v_0.Op != OpPPC64FlagLT {
  6346  			break
  6347  		}
  6348  		v.reset(OpPPC64MOVDconst)
  6349  		v.AuxInt = int64ToAuxInt(0)
  6350  		return true
  6351  	}
  6352  	// match: (GreaterEqual (FlagGT))
  6353  	// result: (MOVDconst [1])
  6354  	for {
  6355  		if v_0.Op != OpPPC64FlagGT {
  6356  			break
  6357  		}
  6358  		v.reset(OpPPC64MOVDconst)
  6359  		v.AuxInt = int64ToAuxInt(1)
  6360  		return true
  6361  	}
  6362  	// match: (GreaterEqual (InvertFlags x))
  6363  	// result: (LessEqual x)
  6364  	for {
  6365  		if v_0.Op != OpPPC64InvertFlags {
  6366  			break
  6367  		}
  6368  		x := v_0.Args[0]
  6369  		v.reset(OpPPC64LessEqual)
  6370  		v.AddArg(x)
  6371  		return true
  6372  	}
  6373  	// match: (GreaterEqual cmp)
  6374  	// result: (SETBCR [0] cmp)
  6375  	for {
  6376  		cmp := v_0
  6377  		v.reset(OpPPC64SETBCR)
  6378  		v.AuxInt = int32ToAuxInt(0)
  6379  		v.AddArg(cmp)
  6380  		return true
  6381  	}
  6382  }
  6383  func rewriteValuePPC64_OpPPC64GreaterThan(v *Value) bool {
  6384  	v_0 := v.Args[0]
  6385  	// match: (GreaterThan (FlagEQ))
  6386  	// result: (MOVDconst [0])
  6387  	for {
  6388  		if v_0.Op != OpPPC64FlagEQ {
  6389  			break
  6390  		}
  6391  		v.reset(OpPPC64MOVDconst)
  6392  		v.AuxInt = int64ToAuxInt(0)
  6393  		return true
  6394  	}
  6395  	// match: (GreaterThan (FlagLT))
  6396  	// result: (MOVDconst [0])
  6397  	for {
  6398  		if v_0.Op != OpPPC64FlagLT {
  6399  			break
  6400  		}
  6401  		v.reset(OpPPC64MOVDconst)
  6402  		v.AuxInt = int64ToAuxInt(0)
  6403  		return true
  6404  	}
  6405  	// match: (GreaterThan (FlagGT))
  6406  	// result: (MOVDconst [1])
  6407  	for {
  6408  		if v_0.Op != OpPPC64FlagGT {
  6409  			break
  6410  		}
  6411  		v.reset(OpPPC64MOVDconst)
  6412  		v.AuxInt = int64ToAuxInt(1)
  6413  		return true
  6414  	}
  6415  	// match: (GreaterThan (InvertFlags x))
  6416  	// result: (LessThan x)
  6417  	for {
  6418  		if v_0.Op != OpPPC64InvertFlags {
  6419  			break
  6420  		}
  6421  		x := v_0.Args[0]
  6422  		v.reset(OpPPC64LessThan)
  6423  		v.AddArg(x)
  6424  		return true
  6425  	}
  6426  	// match: (GreaterThan cmp)
  6427  	// result: (SETBC [1] cmp)
  6428  	for {
  6429  		cmp := v_0
  6430  		v.reset(OpPPC64SETBC)
  6431  		v.AuxInt = int32ToAuxInt(1)
  6432  		v.AddArg(cmp)
  6433  		return true
  6434  	}
  6435  }
  6436  func rewriteValuePPC64_OpPPC64ISEL(v *Value) bool {
  6437  	v_2 := v.Args[2]
  6438  	v_1 := v.Args[1]
  6439  	v_0 := v.Args[0]
  6440  	// match: (ISEL [6] x y (CMPconst [0] (ANDconst [1] (SETBC [c] cmp))))
  6441  	// result: (ISEL [c] x y cmp)
  6442  	for {
  6443  		if auxIntToInt32(v.AuxInt) != 6 {
  6444  			break
  6445  		}
  6446  		x := v_0
  6447  		y := v_1
  6448  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6449  			break
  6450  		}
  6451  		v_2_0 := v_2.Args[0]
  6452  		if v_2_0.Op != OpPPC64ANDconst || auxIntToInt64(v_2_0.AuxInt) != 1 {
  6453  			break
  6454  		}
  6455  		v_2_0_0 := v_2_0.Args[0]
  6456  		if v_2_0_0.Op != OpPPC64SETBC {
  6457  			break
  6458  		}
  6459  		c := auxIntToInt32(v_2_0_0.AuxInt)
  6460  		cmp := v_2_0_0.Args[0]
  6461  		v.reset(OpPPC64ISEL)
  6462  		v.AuxInt = int32ToAuxInt(c)
  6463  		v.AddArg3(x, y, cmp)
  6464  		return true
  6465  	}
  6466  	// match: (ISEL [6] x y (CMPconst [0] (SETBC [c] cmp)))
  6467  	// result: (ISEL [c] x y cmp)
  6468  	for {
  6469  		if auxIntToInt32(v.AuxInt) != 6 {
  6470  			break
  6471  		}
  6472  		x := v_0
  6473  		y := v_1
  6474  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6475  			break
  6476  		}
  6477  		v_2_0 := v_2.Args[0]
  6478  		if v_2_0.Op != OpPPC64SETBC {
  6479  			break
  6480  		}
  6481  		c := auxIntToInt32(v_2_0.AuxInt)
  6482  		cmp := v_2_0.Args[0]
  6483  		v.reset(OpPPC64ISEL)
  6484  		v.AuxInt = int32ToAuxInt(c)
  6485  		v.AddArg3(x, y, cmp)
  6486  		return true
  6487  	}
  6488  	// match: (ISEL [6] x y (CMPWconst [0] (SETBC [c] cmp)))
  6489  	// result: (ISEL [c] x y cmp)
  6490  	for {
  6491  		if auxIntToInt32(v.AuxInt) != 6 {
  6492  			break
  6493  		}
  6494  		x := v_0
  6495  		y := v_1
  6496  		if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  6497  			break
  6498  		}
  6499  		v_2_0 := v_2.Args[0]
  6500  		if v_2_0.Op != OpPPC64SETBC {
  6501  			break
  6502  		}
  6503  		c := auxIntToInt32(v_2_0.AuxInt)
  6504  		cmp := v_2_0.Args[0]
  6505  		v.reset(OpPPC64ISEL)
  6506  		v.AuxInt = int32ToAuxInt(c)
  6507  		v.AddArg3(x, y, cmp)
  6508  		return true
  6509  	}
  6510  	// match: (ISEL [6] x y (CMPconst [0] (SETBCR [c] cmp)))
  6511  	// result: (ISEL [c+4] x y cmp)
  6512  	for {
  6513  		if auxIntToInt32(v.AuxInt) != 6 {
  6514  			break
  6515  		}
  6516  		x := v_0
  6517  		y := v_1
  6518  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6519  			break
  6520  		}
  6521  		v_2_0 := v_2.Args[0]
  6522  		if v_2_0.Op != OpPPC64SETBCR {
  6523  			break
  6524  		}
  6525  		c := auxIntToInt32(v_2_0.AuxInt)
  6526  		cmp := v_2_0.Args[0]
  6527  		v.reset(OpPPC64ISEL)
  6528  		v.AuxInt = int32ToAuxInt(c + 4)
  6529  		v.AddArg3(x, y, cmp)
  6530  		return true
  6531  	}
  6532  	// match: (ISEL [6] x y (CMPWconst [0] (SETBCR [c] cmp)))
  6533  	// result: (ISEL [c+4] x y cmp)
  6534  	for {
  6535  		if auxIntToInt32(v.AuxInt) != 6 {
  6536  			break
  6537  		}
  6538  		x := v_0
  6539  		y := v_1
  6540  		if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  6541  			break
  6542  		}
  6543  		v_2_0 := v_2.Args[0]
  6544  		if v_2_0.Op != OpPPC64SETBCR {
  6545  			break
  6546  		}
  6547  		c := auxIntToInt32(v_2_0.AuxInt)
  6548  		cmp := v_2_0.Args[0]
  6549  		v.reset(OpPPC64ISEL)
  6550  		v.AuxInt = int32ToAuxInt(c + 4)
  6551  		v.AddArg3(x, y, cmp)
  6552  		return true
  6553  	}
  6554  	// match: (ISEL [2] x _ (FlagEQ))
  6555  	// result: x
  6556  	for {
  6557  		if auxIntToInt32(v.AuxInt) != 2 {
  6558  			break
  6559  		}
  6560  		x := v_0
  6561  		if v_2.Op != OpPPC64FlagEQ {
  6562  			break
  6563  		}
  6564  		v.copyOf(x)
  6565  		return true
  6566  	}
  6567  	// match: (ISEL [2] _ y (FlagLT))
  6568  	// result: y
  6569  	for {
  6570  		if auxIntToInt32(v.AuxInt) != 2 {
  6571  			break
  6572  		}
  6573  		y := v_1
  6574  		if v_2.Op != OpPPC64FlagLT {
  6575  			break
  6576  		}
  6577  		v.copyOf(y)
  6578  		return true
  6579  	}
  6580  	// match: (ISEL [2] _ y (FlagGT))
  6581  	// result: y
  6582  	for {
  6583  		if auxIntToInt32(v.AuxInt) != 2 {
  6584  			break
  6585  		}
  6586  		y := v_1
  6587  		if v_2.Op != OpPPC64FlagGT {
  6588  			break
  6589  		}
  6590  		v.copyOf(y)
  6591  		return true
  6592  	}
  6593  	// match: (ISEL [6] _ y (FlagEQ))
  6594  	// result: y
  6595  	for {
  6596  		if auxIntToInt32(v.AuxInt) != 6 {
  6597  			break
  6598  		}
  6599  		y := v_1
  6600  		if v_2.Op != OpPPC64FlagEQ {
  6601  			break
  6602  		}
  6603  		v.copyOf(y)
  6604  		return true
  6605  	}
  6606  	// match: (ISEL [6] x _ (FlagLT))
  6607  	// result: x
  6608  	for {
  6609  		if auxIntToInt32(v.AuxInt) != 6 {
  6610  			break
  6611  		}
  6612  		x := v_0
  6613  		if v_2.Op != OpPPC64FlagLT {
  6614  			break
  6615  		}
  6616  		v.copyOf(x)
  6617  		return true
  6618  	}
  6619  	// match: (ISEL [6] x _ (FlagGT))
  6620  	// result: x
  6621  	for {
  6622  		if auxIntToInt32(v.AuxInt) != 6 {
  6623  			break
  6624  		}
  6625  		x := v_0
  6626  		if v_2.Op != OpPPC64FlagGT {
  6627  			break
  6628  		}
  6629  		v.copyOf(x)
  6630  		return true
  6631  	}
  6632  	// match: (ISEL [0] _ y (FlagEQ))
  6633  	// result: y
  6634  	for {
  6635  		if auxIntToInt32(v.AuxInt) != 0 {
  6636  			break
  6637  		}
  6638  		y := v_1
  6639  		if v_2.Op != OpPPC64FlagEQ {
  6640  			break
  6641  		}
  6642  		v.copyOf(y)
  6643  		return true
  6644  	}
  6645  	// match: (ISEL [0] _ y (FlagGT))
  6646  	// result: y
  6647  	for {
  6648  		if auxIntToInt32(v.AuxInt) != 0 {
  6649  			break
  6650  		}
  6651  		y := v_1
  6652  		if v_2.Op != OpPPC64FlagGT {
  6653  			break
  6654  		}
  6655  		v.copyOf(y)
  6656  		return true
  6657  	}
  6658  	// match: (ISEL [0] x _ (FlagLT))
  6659  	// result: x
  6660  	for {
  6661  		if auxIntToInt32(v.AuxInt) != 0 {
  6662  			break
  6663  		}
  6664  		x := v_0
  6665  		if v_2.Op != OpPPC64FlagLT {
  6666  			break
  6667  		}
  6668  		v.copyOf(x)
  6669  		return true
  6670  	}
  6671  	// match: (ISEL [5] _ x (FlagEQ))
  6672  	// result: x
  6673  	for {
  6674  		if auxIntToInt32(v.AuxInt) != 5 {
  6675  			break
  6676  		}
  6677  		x := v_1
  6678  		if v_2.Op != OpPPC64FlagEQ {
  6679  			break
  6680  		}
  6681  		v.copyOf(x)
  6682  		return true
  6683  	}
  6684  	// match: (ISEL [5] _ x (FlagLT))
  6685  	// result: x
  6686  	for {
  6687  		if auxIntToInt32(v.AuxInt) != 5 {
  6688  			break
  6689  		}
  6690  		x := v_1
  6691  		if v_2.Op != OpPPC64FlagLT {
  6692  			break
  6693  		}
  6694  		v.copyOf(x)
  6695  		return true
  6696  	}
  6697  	// match: (ISEL [5] y _ (FlagGT))
  6698  	// result: y
  6699  	for {
  6700  		if auxIntToInt32(v.AuxInt) != 5 {
  6701  			break
  6702  		}
  6703  		y := v_0
  6704  		if v_2.Op != OpPPC64FlagGT {
  6705  			break
  6706  		}
  6707  		v.copyOf(y)
  6708  		return true
  6709  	}
  6710  	// match: (ISEL [1] _ y (FlagEQ))
  6711  	// result: y
  6712  	for {
  6713  		if auxIntToInt32(v.AuxInt) != 1 {
  6714  			break
  6715  		}
  6716  		y := v_1
  6717  		if v_2.Op != OpPPC64FlagEQ {
  6718  			break
  6719  		}
  6720  		v.copyOf(y)
  6721  		return true
  6722  	}
  6723  	// match: (ISEL [1] _ y (FlagLT))
  6724  	// result: y
  6725  	for {
  6726  		if auxIntToInt32(v.AuxInt) != 1 {
  6727  			break
  6728  		}
  6729  		y := v_1
  6730  		if v_2.Op != OpPPC64FlagLT {
  6731  			break
  6732  		}
  6733  		v.copyOf(y)
  6734  		return true
  6735  	}
  6736  	// match: (ISEL [1] x _ (FlagGT))
  6737  	// result: x
  6738  	for {
  6739  		if auxIntToInt32(v.AuxInt) != 1 {
  6740  			break
  6741  		}
  6742  		x := v_0
  6743  		if v_2.Op != OpPPC64FlagGT {
  6744  			break
  6745  		}
  6746  		v.copyOf(x)
  6747  		return true
  6748  	}
  6749  	// match: (ISEL [4] x _ (FlagEQ))
  6750  	// result: x
  6751  	for {
  6752  		if auxIntToInt32(v.AuxInt) != 4 {
  6753  			break
  6754  		}
  6755  		x := v_0
  6756  		if v_2.Op != OpPPC64FlagEQ {
  6757  			break
  6758  		}
  6759  		v.copyOf(x)
  6760  		return true
  6761  	}
  6762  	// match: (ISEL [4] x _ (FlagGT))
  6763  	// result: x
  6764  	for {
  6765  		if auxIntToInt32(v.AuxInt) != 4 {
  6766  			break
  6767  		}
  6768  		x := v_0
  6769  		if v_2.Op != OpPPC64FlagGT {
  6770  			break
  6771  		}
  6772  		v.copyOf(x)
  6773  		return true
  6774  	}
  6775  	// match: (ISEL [4] _ y (FlagLT))
  6776  	// result: y
  6777  	for {
  6778  		if auxIntToInt32(v.AuxInt) != 4 {
  6779  			break
  6780  		}
  6781  		y := v_1
  6782  		if v_2.Op != OpPPC64FlagLT {
  6783  			break
  6784  		}
  6785  		v.copyOf(y)
  6786  		return true
  6787  	}
  6788  	// match: (ISEL [n] x y (InvertFlags bool))
  6789  	// cond: n%4 == 0
  6790  	// result: (ISEL [n+1] x y bool)
  6791  	for {
  6792  		n := auxIntToInt32(v.AuxInt)
  6793  		x := v_0
  6794  		y := v_1
  6795  		if v_2.Op != OpPPC64InvertFlags {
  6796  			break
  6797  		}
  6798  		bool := v_2.Args[0]
  6799  		if !(n%4 == 0) {
  6800  			break
  6801  		}
  6802  		v.reset(OpPPC64ISEL)
  6803  		v.AuxInt = int32ToAuxInt(n + 1)
  6804  		v.AddArg3(x, y, bool)
  6805  		return true
  6806  	}
  6807  	// match: (ISEL [n] x y (InvertFlags bool))
  6808  	// cond: n%4 == 1
  6809  	// result: (ISEL [n-1] x y bool)
  6810  	for {
  6811  		n := auxIntToInt32(v.AuxInt)
  6812  		x := v_0
  6813  		y := v_1
  6814  		if v_2.Op != OpPPC64InvertFlags {
  6815  			break
  6816  		}
  6817  		bool := v_2.Args[0]
  6818  		if !(n%4 == 1) {
  6819  			break
  6820  		}
  6821  		v.reset(OpPPC64ISEL)
  6822  		v.AuxInt = int32ToAuxInt(n - 1)
  6823  		v.AddArg3(x, y, bool)
  6824  		return true
  6825  	}
  6826  	// match: (ISEL [n] x y (InvertFlags bool))
  6827  	// cond: n%4 == 2
  6828  	// result: (ISEL [n] x y bool)
  6829  	for {
  6830  		n := auxIntToInt32(v.AuxInt)
  6831  		x := v_0
  6832  		y := v_1
  6833  		if v_2.Op != OpPPC64InvertFlags {
  6834  			break
  6835  		}
  6836  		bool := v_2.Args[0]
  6837  		if !(n%4 == 2) {
  6838  			break
  6839  		}
  6840  		v.reset(OpPPC64ISEL)
  6841  		v.AuxInt = int32ToAuxInt(n)
  6842  		v.AddArg3(x, y, bool)
  6843  		return true
  6844  	}
  6845  	return false
  6846  }
  6847  func rewriteValuePPC64_OpPPC64LessEqual(v *Value) bool {
  6848  	v_0 := v.Args[0]
  6849  	// match: (LessEqual (FlagEQ))
  6850  	// result: (MOVDconst [1])
  6851  	for {
  6852  		if v_0.Op != OpPPC64FlagEQ {
  6853  			break
  6854  		}
  6855  		v.reset(OpPPC64MOVDconst)
  6856  		v.AuxInt = int64ToAuxInt(1)
  6857  		return true
  6858  	}
  6859  	// match: (LessEqual (FlagLT))
  6860  	// result: (MOVDconst [1])
  6861  	for {
  6862  		if v_0.Op != OpPPC64FlagLT {
  6863  			break
  6864  		}
  6865  		v.reset(OpPPC64MOVDconst)
  6866  		v.AuxInt = int64ToAuxInt(1)
  6867  		return true
  6868  	}
  6869  	// match: (LessEqual (FlagGT))
  6870  	// result: (MOVDconst [0])
  6871  	for {
  6872  		if v_0.Op != OpPPC64FlagGT {
  6873  			break
  6874  		}
  6875  		v.reset(OpPPC64MOVDconst)
  6876  		v.AuxInt = int64ToAuxInt(0)
  6877  		return true
  6878  	}
  6879  	// match: (LessEqual (InvertFlags x))
  6880  	// result: (GreaterEqual x)
  6881  	for {
  6882  		if v_0.Op != OpPPC64InvertFlags {
  6883  			break
  6884  		}
  6885  		x := v_0.Args[0]
  6886  		v.reset(OpPPC64GreaterEqual)
  6887  		v.AddArg(x)
  6888  		return true
  6889  	}
  6890  	// match: (LessEqual cmp)
  6891  	// result: (SETBCR [1] cmp)
  6892  	for {
  6893  		cmp := v_0
  6894  		v.reset(OpPPC64SETBCR)
  6895  		v.AuxInt = int32ToAuxInt(1)
  6896  		v.AddArg(cmp)
  6897  		return true
  6898  	}
  6899  }
  6900  func rewriteValuePPC64_OpPPC64LessThan(v *Value) bool {
  6901  	v_0 := v.Args[0]
  6902  	// match: (LessThan (FlagEQ))
  6903  	// result: (MOVDconst [0])
  6904  	for {
  6905  		if v_0.Op != OpPPC64FlagEQ {
  6906  			break
  6907  		}
  6908  		v.reset(OpPPC64MOVDconst)
  6909  		v.AuxInt = int64ToAuxInt(0)
  6910  		return true
  6911  	}
  6912  	// match: (LessThan (FlagLT))
  6913  	// result: (MOVDconst [1])
  6914  	for {
  6915  		if v_0.Op != OpPPC64FlagLT {
  6916  			break
  6917  		}
  6918  		v.reset(OpPPC64MOVDconst)
  6919  		v.AuxInt = int64ToAuxInt(1)
  6920  		return true
  6921  	}
  6922  	// match: (LessThan (FlagGT))
  6923  	// result: (MOVDconst [0])
  6924  	for {
  6925  		if v_0.Op != OpPPC64FlagGT {
  6926  			break
  6927  		}
  6928  		v.reset(OpPPC64MOVDconst)
  6929  		v.AuxInt = int64ToAuxInt(0)
  6930  		return true
  6931  	}
  6932  	// match: (LessThan (InvertFlags x))
  6933  	// result: (GreaterThan x)
  6934  	for {
  6935  		if v_0.Op != OpPPC64InvertFlags {
  6936  			break
  6937  		}
  6938  		x := v_0.Args[0]
  6939  		v.reset(OpPPC64GreaterThan)
  6940  		v.AddArg(x)
  6941  		return true
  6942  	}
  6943  	// match: (LessThan cmp)
  6944  	// result: (SETBC [0] cmp)
  6945  	for {
  6946  		cmp := v_0
  6947  		v.reset(OpPPC64SETBC)
  6948  		v.AuxInt = int32ToAuxInt(0)
  6949  		v.AddArg(cmp)
  6950  		return true
  6951  	}
  6952  }
  6953  func rewriteValuePPC64_OpPPC64LoweredPanicBoundsCR(v *Value) bool {
  6954  	v_1 := v.Args[1]
  6955  	v_0 := v.Args[0]
  6956  	// match: (LoweredPanicBoundsCR [kind] {p} (MOVDconst [c]) mem)
  6957  	// result: (LoweredPanicBoundsCC [kind] {PanicBoundsCC{Cx:p.C, Cy:c}} mem)
  6958  	for {
  6959  		kind := auxIntToInt64(v.AuxInt)
  6960  		p := auxToPanicBoundsC(v.Aux)
  6961  		if v_0.Op != OpPPC64MOVDconst {
  6962  			break
  6963  		}
  6964  		c := auxIntToInt64(v_0.AuxInt)
  6965  		mem := v_1
  6966  		v.reset(OpPPC64LoweredPanicBoundsCC)
  6967  		v.AuxInt = int64ToAuxInt(kind)
  6968  		v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: p.C, Cy: c})
  6969  		v.AddArg(mem)
  6970  		return true
  6971  	}
  6972  	return false
  6973  }
  6974  func rewriteValuePPC64_OpPPC64LoweredPanicBoundsRC(v *Value) bool {
  6975  	v_1 := v.Args[1]
  6976  	v_0 := v.Args[0]
  6977  	// match: (LoweredPanicBoundsRC [kind] {p} (MOVDconst [c]) mem)
  6978  	// result: (LoweredPanicBoundsCC [kind] {PanicBoundsCC{Cx:c, Cy:p.C}} mem)
  6979  	for {
  6980  		kind := auxIntToInt64(v.AuxInt)
  6981  		p := auxToPanicBoundsC(v.Aux)
  6982  		if v_0.Op != OpPPC64MOVDconst {
  6983  			break
  6984  		}
  6985  		c := auxIntToInt64(v_0.AuxInt)
  6986  		mem := v_1
  6987  		v.reset(OpPPC64LoweredPanicBoundsCC)
  6988  		v.AuxInt = int64ToAuxInt(kind)
  6989  		v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: c, Cy: p.C})
  6990  		v.AddArg(mem)
  6991  		return true
  6992  	}
  6993  	return false
  6994  }
  6995  func rewriteValuePPC64_OpPPC64LoweredPanicBoundsRR(v *Value) bool {
  6996  	v_2 := v.Args[2]
  6997  	v_1 := v.Args[1]
  6998  	v_0 := v.Args[0]
  6999  	// match: (LoweredPanicBoundsRR [kind] x (MOVDconst [c]) mem)
  7000  	// result: (LoweredPanicBoundsRC [kind] x {PanicBoundsC{C:c}} mem)
  7001  	for {
  7002  		kind := auxIntToInt64(v.AuxInt)
  7003  		x := v_0
  7004  		if v_1.Op != OpPPC64MOVDconst {
  7005  			break
  7006  		}
  7007  		c := auxIntToInt64(v_1.AuxInt)
  7008  		mem := v_2
  7009  		v.reset(OpPPC64LoweredPanicBoundsRC)
  7010  		v.AuxInt = int64ToAuxInt(kind)
  7011  		v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
  7012  		v.AddArg2(x, mem)
  7013  		return true
  7014  	}
  7015  	// match: (LoweredPanicBoundsRR [kind] (MOVDconst [c]) y mem)
  7016  	// result: (LoweredPanicBoundsCR [kind] {PanicBoundsC{C:c}} y mem)
  7017  	for {
  7018  		kind := auxIntToInt64(v.AuxInt)
  7019  		if v_0.Op != OpPPC64MOVDconst {
  7020  			break
  7021  		}
  7022  		c := auxIntToInt64(v_0.AuxInt)
  7023  		y := v_1
  7024  		mem := v_2
  7025  		v.reset(OpPPC64LoweredPanicBoundsCR)
  7026  		v.AuxInt = int64ToAuxInt(kind)
  7027  		v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
  7028  		v.AddArg2(y, mem)
  7029  		return true
  7030  	}
  7031  	return false
  7032  }
  7033  func rewriteValuePPC64_OpPPC64MFVSRD(v *Value) bool {
  7034  	v_0 := v.Args[0]
  7035  	b := v.Block
  7036  	typ := &b.Func.Config.Types
  7037  	// match: (MFVSRD (FMOVDconst [c]))
  7038  	// result: (MOVDconst [int64(math.Float64bits(c))])
  7039  	for {
  7040  		if v_0.Op != OpPPC64FMOVDconst {
  7041  			break
  7042  		}
  7043  		c := auxIntToFloat64(v_0.AuxInt)
  7044  		v.reset(OpPPC64MOVDconst)
  7045  		v.AuxInt = int64ToAuxInt(int64(math.Float64bits(c)))
  7046  		return true
  7047  	}
  7048  	// match: (MFVSRD x:(FMOVDload [off] {sym} ptr mem))
  7049  	// cond: x.Uses == 1 && clobber(x)
  7050  	// result: @x.Block (MOVDload [off] {sym} ptr mem)
  7051  	for {
  7052  		x := v_0
  7053  		if x.Op != OpPPC64FMOVDload {
  7054  			break
  7055  		}
  7056  		off := auxIntToInt32(x.AuxInt)
  7057  		sym := auxToSym(x.Aux)
  7058  		mem := x.Args[1]
  7059  		ptr := x.Args[0]
  7060  		if !(x.Uses == 1 && clobber(x)) {
  7061  			break
  7062  		}
  7063  		b = x.Block
  7064  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDload, typ.Int64)
  7065  		v.copyOf(v0)
  7066  		v0.AuxInt = int32ToAuxInt(off)
  7067  		v0.Aux = symToAux(sym)
  7068  		v0.AddArg2(ptr, mem)
  7069  		return true
  7070  	}
  7071  	return false
  7072  }
  7073  func rewriteValuePPC64_OpPPC64MOVBZload(v *Value) bool {
  7074  	v_1 := v.Args[1]
  7075  	v_0 := v.Args[0]
  7076  	// match: (MOVBZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  7077  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  7078  	// result: (MOVBZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  7079  	for {
  7080  		off1 := auxIntToInt32(v.AuxInt)
  7081  		sym1 := auxToSym(v.Aux)
  7082  		p := v_0
  7083  		if p.Op != OpPPC64MOVDaddr {
  7084  			break
  7085  		}
  7086  		off2 := auxIntToInt32(p.AuxInt)
  7087  		sym2 := auxToSym(p.Aux)
  7088  		ptr := p.Args[0]
  7089  		mem := v_1
  7090  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  7091  			break
  7092  		}
  7093  		v.reset(OpPPC64MOVBZload)
  7094  		v.AuxInt = int32ToAuxInt(off1 + off2)
  7095  		v.Aux = symToAux(mergeSym(sym1, sym2))
  7096  		v.AddArg2(ptr, mem)
  7097  		return true
  7098  	}
  7099  	// match: (MOVBZload [off1] {sym} (ADDconst [off2] x) mem)
  7100  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  7101  	// result: (MOVBZload [off1+int32(off2)] {sym} x mem)
  7102  	for {
  7103  		off1 := auxIntToInt32(v.AuxInt)
  7104  		sym := auxToSym(v.Aux)
  7105  		if v_0.Op != OpPPC64ADDconst {
  7106  			break
  7107  		}
  7108  		off2 := auxIntToInt64(v_0.AuxInt)
  7109  		x := v_0.Args[0]
  7110  		mem := v_1
  7111  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  7112  			break
  7113  		}
  7114  		v.reset(OpPPC64MOVBZload)
  7115  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  7116  		v.Aux = symToAux(sym)
  7117  		v.AddArg2(x, mem)
  7118  		return true
  7119  	}
  7120  	// match: (MOVBZload [0] {sym} p:(ADD ptr idx) mem)
  7121  	// cond: sym == nil && p.Uses == 1
  7122  	// result: (MOVBZloadidx ptr idx mem)
  7123  	for {
  7124  		if auxIntToInt32(v.AuxInt) != 0 {
  7125  			break
  7126  		}
  7127  		sym := auxToSym(v.Aux)
  7128  		p := v_0
  7129  		if p.Op != OpPPC64ADD {
  7130  			break
  7131  		}
  7132  		idx := p.Args[1]
  7133  		ptr := p.Args[0]
  7134  		mem := v_1
  7135  		if !(sym == nil && p.Uses == 1) {
  7136  			break
  7137  		}
  7138  		v.reset(OpPPC64MOVBZloadidx)
  7139  		v.AddArg3(ptr, idx, mem)
  7140  		return true
  7141  	}
  7142  	return false
  7143  }
  7144  func rewriteValuePPC64_OpPPC64MOVBZloadidx(v *Value) bool {
  7145  	v_2 := v.Args[2]
  7146  	v_1 := v.Args[1]
  7147  	v_0 := v.Args[0]
  7148  	// match: (MOVBZloadidx ptr (MOVDconst [c]) mem)
  7149  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  7150  	// result: (MOVBZload [int32(c)] ptr mem)
  7151  	for {
  7152  		ptr := v_0
  7153  		if v_1.Op != OpPPC64MOVDconst {
  7154  			break
  7155  		}
  7156  		c := auxIntToInt64(v_1.AuxInt)
  7157  		mem := v_2
  7158  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  7159  			break
  7160  		}
  7161  		v.reset(OpPPC64MOVBZload)
  7162  		v.AuxInt = int32ToAuxInt(int32(c))
  7163  		v.AddArg2(ptr, mem)
  7164  		return true
  7165  	}
  7166  	// match: (MOVBZloadidx (MOVDconst [c]) ptr mem)
  7167  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  7168  	// result: (MOVBZload [int32(c)] ptr mem)
  7169  	for {
  7170  		if v_0.Op != OpPPC64MOVDconst {
  7171  			break
  7172  		}
  7173  		c := auxIntToInt64(v_0.AuxInt)
  7174  		ptr := v_1
  7175  		mem := v_2
  7176  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  7177  			break
  7178  		}
  7179  		v.reset(OpPPC64MOVBZload)
  7180  		v.AuxInt = int32ToAuxInt(int32(c))
  7181  		v.AddArg2(ptr, mem)
  7182  		return true
  7183  	}
  7184  	return false
  7185  }
  7186  func rewriteValuePPC64_OpPPC64MOVBZreg(v *Value) bool {
  7187  	v_0 := v.Args[0]
  7188  	b := v.Block
  7189  	typ := &b.Func.Config.Types
  7190  	// match: (MOVBZreg y:(ANDconst [c] _))
  7191  	// cond: uint64(c) <= 0xFF
  7192  	// result: y
  7193  	for {
  7194  		y := v_0
  7195  		if y.Op != OpPPC64ANDconst {
  7196  			break
  7197  		}
  7198  		c := auxIntToInt64(y.AuxInt)
  7199  		if !(uint64(c) <= 0xFF) {
  7200  			break
  7201  		}
  7202  		v.copyOf(y)
  7203  		return true
  7204  	}
  7205  	// match: (MOVBZreg (SRWconst [c] (MOVBZreg x)))
  7206  	// result: (SRWconst [c] (MOVBZreg x))
  7207  	for {
  7208  		if v_0.Op != OpPPC64SRWconst {
  7209  			break
  7210  		}
  7211  		c := auxIntToInt64(v_0.AuxInt)
  7212  		v_0_0 := v_0.Args[0]
  7213  		if v_0_0.Op != OpPPC64MOVBZreg {
  7214  			break
  7215  		}
  7216  		x := v_0_0.Args[0]
  7217  		v.reset(OpPPC64SRWconst)
  7218  		v.AuxInt = int64ToAuxInt(c)
  7219  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  7220  		v0.AddArg(x)
  7221  		v.AddArg(v0)
  7222  		return true
  7223  	}
  7224  	// match: (MOVBZreg (SRWconst [c] x))
  7225  	// cond: x.Type.Size() == 8
  7226  	// result: (SRWconst [c] x)
  7227  	for {
  7228  		if v_0.Op != OpPPC64SRWconst {
  7229  			break
  7230  		}
  7231  		c := auxIntToInt64(v_0.AuxInt)
  7232  		x := v_0.Args[0]
  7233  		if !(x.Type.Size() == 8) {
  7234  			break
  7235  		}
  7236  		v.reset(OpPPC64SRWconst)
  7237  		v.AuxInt = int64ToAuxInt(c)
  7238  		v.AddArg(x)
  7239  		return true
  7240  	}
  7241  	// match: (MOVBZreg (SRDconst [c] x))
  7242  	// cond: c>=56
  7243  	// result: (SRDconst [c] x)
  7244  	for {
  7245  		if v_0.Op != OpPPC64SRDconst {
  7246  			break
  7247  		}
  7248  		c := auxIntToInt64(v_0.AuxInt)
  7249  		x := v_0.Args[0]
  7250  		if !(c >= 56) {
  7251  			break
  7252  		}
  7253  		v.reset(OpPPC64SRDconst)
  7254  		v.AuxInt = int64ToAuxInt(c)
  7255  		v.AddArg(x)
  7256  		return true
  7257  	}
  7258  	// match: (MOVBZreg (SRWconst [c] x))
  7259  	// cond: c>=24
  7260  	// result: (SRWconst [c] x)
  7261  	for {
  7262  		if v_0.Op != OpPPC64SRWconst {
  7263  			break
  7264  		}
  7265  		c := auxIntToInt64(v_0.AuxInt)
  7266  		x := v_0.Args[0]
  7267  		if !(c >= 24) {
  7268  			break
  7269  		}
  7270  		v.reset(OpPPC64SRWconst)
  7271  		v.AuxInt = int64ToAuxInt(c)
  7272  		v.AddArg(x)
  7273  		return true
  7274  	}
  7275  	// match: (MOVBZreg y:(MOVBZreg _))
  7276  	// result: y
  7277  	for {
  7278  		y := v_0
  7279  		if y.Op != OpPPC64MOVBZreg {
  7280  			break
  7281  		}
  7282  		v.copyOf(y)
  7283  		return true
  7284  	}
  7285  	// match: (MOVBZreg (MOVBreg x))
  7286  	// result: (MOVBZreg x)
  7287  	for {
  7288  		if v_0.Op != OpPPC64MOVBreg {
  7289  			break
  7290  		}
  7291  		x := v_0.Args[0]
  7292  		v.reset(OpPPC64MOVBZreg)
  7293  		v.AddArg(x)
  7294  		return true
  7295  	}
  7296  	// match: (MOVBZreg (SRWconst x [s]))
  7297  	// cond: mergePPC64AndSrwi(0xFF,s) != 0
  7298  	// result: (RLWINM [mergePPC64AndSrwi(0xFF,s)] x)
  7299  	for {
  7300  		if v_0.Op != OpPPC64SRWconst {
  7301  			break
  7302  		}
  7303  		s := auxIntToInt64(v_0.AuxInt)
  7304  		x := v_0.Args[0]
  7305  		if !(mergePPC64AndSrwi(0xFF, s) != 0) {
  7306  			break
  7307  		}
  7308  		v.reset(OpPPC64RLWINM)
  7309  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(0xFF, s))
  7310  		v.AddArg(x)
  7311  		return true
  7312  	}
  7313  	// match: (MOVBZreg (RLWINM [r] y))
  7314  	// cond: mergePPC64AndRlwinm(0xFF,r) != 0
  7315  	// result: (RLWINM [mergePPC64AndRlwinm(0xFF,r)] y)
  7316  	for {
  7317  		if v_0.Op != OpPPC64RLWINM {
  7318  			break
  7319  		}
  7320  		r := auxIntToInt64(v_0.AuxInt)
  7321  		y := v_0.Args[0]
  7322  		if !(mergePPC64AndRlwinm(0xFF, r) != 0) {
  7323  			break
  7324  		}
  7325  		v.reset(OpPPC64RLWINM)
  7326  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFF, r))
  7327  		v.AddArg(y)
  7328  		return true
  7329  	}
  7330  	// match: (MOVBZreg (OR <t> x (MOVWZreg y)))
  7331  	// result: (MOVBZreg (OR <t> x y))
  7332  	for {
  7333  		if v_0.Op != OpPPC64OR {
  7334  			break
  7335  		}
  7336  		t := v_0.Type
  7337  		_ = v_0.Args[1]
  7338  		v_0_0 := v_0.Args[0]
  7339  		v_0_1 := v_0.Args[1]
  7340  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7341  			x := v_0_0
  7342  			if v_0_1.Op != OpPPC64MOVWZreg {
  7343  				continue
  7344  			}
  7345  			y := v_0_1.Args[0]
  7346  			v.reset(OpPPC64MOVBZreg)
  7347  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  7348  			v0.AddArg2(x, y)
  7349  			v.AddArg(v0)
  7350  			return true
  7351  		}
  7352  		break
  7353  	}
  7354  	// match: (MOVBZreg (XOR <t> x (MOVWZreg y)))
  7355  	// result: (MOVBZreg (XOR <t> x y))
  7356  	for {
  7357  		if v_0.Op != OpPPC64XOR {
  7358  			break
  7359  		}
  7360  		t := v_0.Type
  7361  		_ = v_0.Args[1]
  7362  		v_0_0 := v_0.Args[0]
  7363  		v_0_1 := v_0.Args[1]
  7364  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7365  			x := v_0_0
  7366  			if v_0_1.Op != OpPPC64MOVWZreg {
  7367  				continue
  7368  			}
  7369  			y := v_0_1.Args[0]
  7370  			v.reset(OpPPC64MOVBZreg)
  7371  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  7372  			v0.AddArg2(x, y)
  7373  			v.AddArg(v0)
  7374  			return true
  7375  		}
  7376  		break
  7377  	}
  7378  	// match: (MOVBZreg (AND <t> x (MOVWZreg y)))
  7379  	// result: (MOVBZreg (AND <t> x y))
  7380  	for {
  7381  		if v_0.Op != OpPPC64AND {
  7382  			break
  7383  		}
  7384  		t := v_0.Type
  7385  		_ = v_0.Args[1]
  7386  		v_0_0 := v_0.Args[0]
  7387  		v_0_1 := v_0.Args[1]
  7388  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7389  			x := v_0_0
  7390  			if v_0_1.Op != OpPPC64MOVWZreg {
  7391  				continue
  7392  			}
  7393  			y := v_0_1.Args[0]
  7394  			v.reset(OpPPC64MOVBZreg)
  7395  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  7396  			v0.AddArg2(x, y)
  7397  			v.AddArg(v0)
  7398  			return true
  7399  		}
  7400  		break
  7401  	}
  7402  	// match: (MOVBZreg (OR <t> x (MOVHZreg y)))
  7403  	// result: (MOVBZreg (OR <t> x y))
  7404  	for {
  7405  		if v_0.Op != OpPPC64OR {
  7406  			break
  7407  		}
  7408  		t := v_0.Type
  7409  		_ = v_0.Args[1]
  7410  		v_0_0 := v_0.Args[0]
  7411  		v_0_1 := v_0.Args[1]
  7412  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7413  			x := v_0_0
  7414  			if v_0_1.Op != OpPPC64MOVHZreg {
  7415  				continue
  7416  			}
  7417  			y := v_0_1.Args[0]
  7418  			v.reset(OpPPC64MOVBZreg)
  7419  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  7420  			v0.AddArg2(x, y)
  7421  			v.AddArg(v0)
  7422  			return true
  7423  		}
  7424  		break
  7425  	}
  7426  	// match: (MOVBZreg (XOR <t> x (MOVHZreg y)))
  7427  	// result: (MOVBZreg (XOR <t> x y))
  7428  	for {
  7429  		if v_0.Op != OpPPC64XOR {
  7430  			break
  7431  		}
  7432  		t := v_0.Type
  7433  		_ = v_0.Args[1]
  7434  		v_0_0 := v_0.Args[0]
  7435  		v_0_1 := v_0.Args[1]
  7436  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7437  			x := v_0_0
  7438  			if v_0_1.Op != OpPPC64MOVHZreg {
  7439  				continue
  7440  			}
  7441  			y := v_0_1.Args[0]
  7442  			v.reset(OpPPC64MOVBZreg)
  7443  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  7444  			v0.AddArg2(x, y)
  7445  			v.AddArg(v0)
  7446  			return true
  7447  		}
  7448  		break
  7449  	}
  7450  	// match: (MOVBZreg (AND <t> x (MOVHZreg y)))
  7451  	// result: (MOVBZreg (AND <t> x y))
  7452  	for {
  7453  		if v_0.Op != OpPPC64AND {
  7454  			break
  7455  		}
  7456  		t := v_0.Type
  7457  		_ = v_0.Args[1]
  7458  		v_0_0 := v_0.Args[0]
  7459  		v_0_1 := v_0.Args[1]
  7460  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7461  			x := v_0_0
  7462  			if v_0_1.Op != OpPPC64MOVHZreg {
  7463  				continue
  7464  			}
  7465  			y := v_0_1.Args[0]
  7466  			v.reset(OpPPC64MOVBZreg)
  7467  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  7468  			v0.AddArg2(x, y)
  7469  			v.AddArg(v0)
  7470  			return true
  7471  		}
  7472  		break
  7473  	}
  7474  	// match: (MOVBZreg (OR <t> x (MOVBZreg y)))
  7475  	// result: (MOVBZreg (OR <t> x y))
  7476  	for {
  7477  		if v_0.Op != OpPPC64OR {
  7478  			break
  7479  		}
  7480  		t := v_0.Type
  7481  		_ = v_0.Args[1]
  7482  		v_0_0 := v_0.Args[0]
  7483  		v_0_1 := v_0.Args[1]
  7484  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7485  			x := v_0_0
  7486  			if v_0_1.Op != OpPPC64MOVBZreg {
  7487  				continue
  7488  			}
  7489  			y := v_0_1.Args[0]
  7490  			v.reset(OpPPC64MOVBZreg)
  7491  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  7492  			v0.AddArg2(x, y)
  7493  			v.AddArg(v0)
  7494  			return true
  7495  		}
  7496  		break
  7497  	}
  7498  	// match: (MOVBZreg (XOR <t> x (MOVBZreg y)))
  7499  	// result: (MOVBZreg (XOR <t> x y))
  7500  	for {
  7501  		if v_0.Op != OpPPC64XOR {
  7502  			break
  7503  		}
  7504  		t := v_0.Type
  7505  		_ = v_0.Args[1]
  7506  		v_0_0 := v_0.Args[0]
  7507  		v_0_1 := v_0.Args[1]
  7508  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7509  			x := v_0_0
  7510  			if v_0_1.Op != OpPPC64MOVBZreg {
  7511  				continue
  7512  			}
  7513  			y := v_0_1.Args[0]
  7514  			v.reset(OpPPC64MOVBZreg)
  7515  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  7516  			v0.AddArg2(x, y)
  7517  			v.AddArg(v0)
  7518  			return true
  7519  		}
  7520  		break
  7521  	}
  7522  	// match: (MOVBZreg (AND <t> x (MOVBZreg y)))
  7523  	// result: (MOVBZreg (AND <t> x y))
  7524  	for {
  7525  		if v_0.Op != OpPPC64AND {
  7526  			break
  7527  		}
  7528  		t := v_0.Type
  7529  		_ = v_0.Args[1]
  7530  		v_0_0 := v_0.Args[0]
  7531  		v_0_1 := v_0.Args[1]
  7532  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7533  			x := v_0_0
  7534  			if v_0_1.Op != OpPPC64MOVBZreg {
  7535  				continue
  7536  			}
  7537  			y := v_0_1.Args[0]
  7538  			v.reset(OpPPC64MOVBZreg)
  7539  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  7540  			v0.AddArg2(x, y)
  7541  			v.AddArg(v0)
  7542  			return true
  7543  		}
  7544  		break
  7545  	}
  7546  	// match: (MOVBZreg z:(ANDconst [c] (MOVBZload ptr x)))
  7547  	// result: z
  7548  	for {
  7549  		z := v_0
  7550  		if z.Op != OpPPC64ANDconst {
  7551  			break
  7552  		}
  7553  		z_0 := z.Args[0]
  7554  		if z_0.Op != OpPPC64MOVBZload {
  7555  			break
  7556  		}
  7557  		v.copyOf(z)
  7558  		return true
  7559  	}
  7560  	// match: (MOVBZreg z:(AND y (MOVBZload ptr x)))
  7561  	// result: z
  7562  	for {
  7563  		z := v_0
  7564  		if z.Op != OpPPC64AND {
  7565  			break
  7566  		}
  7567  		_ = z.Args[1]
  7568  		z_0 := z.Args[0]
  7569  		z_1 := z.Args[1]
  7570  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
  7571  			if z_1.Op != OpPPC64MOVBZload {
  7572  				continue
  7573  			}
  7574  			v.copyOf(z)
  7575  			return true
  7576  		}
  7577  		break
  7578  	}
  7579  	// match: (MOVBZreg x:(MOVBZload _ _))
  7580  	// result: x
  7581  	for {
  7582  		x := v_0
  7583  		if x.Op != OpPPC64MOVBZload {
  7584  			break
  7585  		}
  7586  		v.copyOf(x)
  7587  		return true
  7588  	}
  7589  	// match: (MOVBZreg x:(MOVBZloadidx _ _ _))
  7590  	// result: x
  7591  	for {
  7592  		x := v_0
  7593  		if x.Op != OpPPC64MOVBZloadidx {
  7594  			break
  7595  		}
  7596  		v.copyOf(x)
  7597  		return true
  7598  	}
  7599  	// match: (MOVBZreg x:(Select0 (LoweredAtomicLoad8 _ _)))
  7600  	// result: x
  7601  	for {
  7602  		x := v_0
  7603  		if x.Op != OpSelect0 {
  7604  			break
  7605  		}
  7606  		x_0 := x.Args[0]
  7607  		if x_0.Op != OpPPC64LoweredAtomicLoad8 {
  7608  			break
  7609  		}
  7610  		v.copyOf(x)
  7611  		return true
  7612  	}
  7613  	// match: (MOVBZreg x:(Arg <t>))
  7614  	// cond: is8BitInt(t) && !t.IsSigned()
  7615  	// result: x
  7616  	for {
  7617  		x := v_0
  7618  		if x.Op != OpArg {
  7619  			break
  7620  		}
  7621  		t := x.Type
  7622  		if !(is8BitInt(t) && !t.IsSigned()) {
  7623  			break
  7624  		}
  7625  		v.copyOf(x)
  7626  		return true
  7627  	}
  7628  	// match: (MOVBZreg (MOVDconst [c]))
  7629  	// result: (MOVDconst [int64(uint8(c))])
  7630  	for {
  7631  		if v_0.Op != OpPPC64MOVDconst {
  7632  			break
  7633  		}
  7634  		c := auxIntToInt64(v_0.AuxInt)
  7635  		v.reset(OpPPC64MOVDconst)
  7636  		v.AuxInt = int64ToAuxInt(int64(uint8(c)))
  7637  		return true
  7638  	}
  7639  	return false
  7640  }
  7641  func rewriteValuePPC64_OpPPC64MOVBreg(v *Value) bool {
  7642  	v_0 := v.Args[0]
  7643  	b := v.Block
  7644  	typ := &b.Func.Config.Types
  7645  	// match: (MOVBreg y:(ANDconst [c] _))
  7646  	// cond: uint64(c) <= 0x7F
  7647  	// result: y
  7648  	for {
  7649  		y := v_0
  7650  		if y.Op != OpPPC64ANDconst {
  7651  			break
  7652  		}
  7653  		c := auxIntToInt64(y.AuxInt)
  7654  		if !(uint64(c) <= 0x7F) {
  7655  			break
  7656  		}
  7657  		v.copyOf(y)
  7658  		return true
  7659  	}
  7660  	// match: (MOVBreg (SRAWconst [c] (MOVBreg x)))
  7661  	// result: (SRAWconst [c] (MOVBreg x))
  7662  	for {
  7663  		if v_0.Op != OpPPC64SRAWconst {
  7664  			break
  7665  		}
  7666  		c := auxIntToInt64(v_0.AuxInt)
  7667  		v_0_0 := v_0.Args[0]
  7668  		if v_0_0.Op != OpPPC64MOVBreg {
  7669  			break
  7670  		}
  7671  		x := v_0_0.Args[0]
  7672  		v.reset(OpPPC64SRAWconst)
  7673  		v.AuxInt = int64ToAuxInt(c)
  7674  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
  7675  		v0.AddArg(x)
  7676  		v.AddArg(v0)
  7677  		return true
  7678  	}
  7679  	// match: (MOVBreg (SRAWconst [c] x))
  7680  	// cond: x.Type.Size() == 8
  7681  	// result: (SRAWconst [c] x)
  7682  	for {
  7683  		if v_0.Op != OpPPC64SRAWconst {
  7684  			break
  7685  		}
  7686  		c := auxIntToInt64(v_0.AuxInt)
  7687  		x := v_0.Args[0]
  7688  		if !(x.Type.Size() == 8) {
  7689  			break
  7690  		}
  7691  		v.reset(OpPPC64SRAWconst)
  7692  		v.AuxInt = int64ToAuxInt(c)
  7693  		v.AddArg(x)
  7694  		return true
  7695  	}
  7696  	// match: (MOVBreg (SRDconst [c] x))
  7697  	// cond: c>56
  7698  	// result: (SRDconst [c] x)
  7699  	for {
  7700  		if v_0.Op != OpPPC64SRDconst {
  7701  			break
  7702  		}
  7703  		c := auxIntToInt64(v_0.AuxInt)
  7704  		x := v_0.Args[0]
  7705  		if !(c > 56) {
  7706  			break
  7707  		}
  7708  		v.reset(OpPPC64SRDconst)
  7709  		v.AuxInt = int64ToAuxInt(c)
  7710  		v.AddArg(x)
  7711  		return true
  7712  	}
  7713  	// match: (MOVBreg (SRDconst [c] x))
  7714  	// cond: c==56
  7715  	// result: (SRADconst [c] x)
  7716  	for {
  7717  		if v_0.Op != OpPPC64SRDconst {
  7718  			break
  7719  		}
  7720  		c := auxIntToInt64(v_0.AuxInt)
  7721  		x := v_0.Args[0]
  7722  		if !(c == 56) {
  7723  			break
  7724  		}
  7725  		v.reset(OpPPC64SRADconst)
  7726  		v.AuxInt = int64ToAuxInt(c)
  7727  		v.AddArg(x)
  7728  		return true
  7729  	}
  7730  	// match: (MOVBreg (SRADconst [c] x))
  7731  	// cond: c>=56
  7732  	// result: (SRADconst [c] x)
  7733  	for {
  7734  		if v_0.Op != OpPPC64SRADconst {
  7735  			break
  7736  		}
  7737  		c := auxIntToInt64(v_0.AuxInt)
  7738  		x := v_0.Args[0]
  7739  		if !(c >= 56) {
  7740  			break
  7741  		}
  7742  		v.reset(OpPPC64SRADconst)
  7743  		v.AuxInt = int64ToAuxInt(c)
  7744  		v.AddArg(x)
  7745  		return true
  7746  	}
  7747  	// match: (MOVBreg (SRWconst [c] x))
  7748  	// cond: c>24
  7749  	// result: (SRWconst [c] x)
  7750  	for {
  7751  		if v_0.Op != OpPPC64SRWconst {
  7752  			break
  7753  		}
  7754  		c := auxIntToInt64(v_0.AuxInt)
  7755  		x := v_0.Args[0]
  7756  		if !(c > 24) {
  7757  			break
  7758  		}
  7759  		v.reset(OpPPC64SRWconst)
  7760  		v.AuxInt = int64ToAuxInt(c)
  7761  		v.AddArg(x)
  7762  		return true
  7763  	}
  7764  	// match: (MOVBreg (SRWconst [c] x))
  7765  	// cond: c==24
  7766  	// result: (SRAWconst [c] x)
  7767  	for {
  7768  		if v_0.Op != OpPPC64SRWconst {
  7769  			break
  7770  		}
  7771  		c := auxIntToInt64(v_0.AuxInt)
  7772  		x := v_0.Args[0]
  7773  		if !(c == 24) {
  7774  			break
  7775  		}
  7776  		v.reset(OpPPC64SRAWconst)
  7777  		v.AuxInt = int64ToAuxInt(c)
  7778  		v.AddArg(x)
  7779  		return true
  7780  	}
  7781  	// match: (MOVBreg (SRAWconst [c] x))
  7782  	// cond: c>=24
  7783  	// result: (SRAWconst [c] x)
  7784  	for {
  7785  		if v_0.Op != OpPPC64SRAWconst {
  7786  			break
  7787  		}
  7788  		c := auxIntToInt64(v_0.AuxInt)
  7789  		x := v_0.Args[0]
  7790  		if !(c >= 24) {
  7791  			break
  7792  		}
  7793  		v.reset(OpPPC64SRAWconst)
  7794  		v.AuxInt = int64ToAuxInt(c)
  7795  		v.AddArg(x)
  7796  		return true
  7797  	}
  7798  	// match: (MOVBreg y:(MOVBreg _))
  7799  	// result: y
  7800  	for {
  7801  		y := v_0
  7802  		if y.Op != OpPPC64MOVBreg {
  7803  			break
  7804  		}
  7805  		v.copyOf(y)
  7806  		return true
  7807  	}
  7808  	// match: (MOVBreg (MOVBZreg x))
  7809  	// result: (MOVBreg x)
  7810  	for {
  7811  		if v_0.Op != OpPPC64MOVBZreg {
  7812  			break
  7813  		}
  7814  		x := v_0.Args[0]
  7815  		v.reset(OpPPC64MOVBreg)
  7816  		v.AddArg(x)
  7817  		return true
  7818  	}
  7819  	// match: (MOVBreg x:(Arg <t>))
  7820  	// cond: is8BitInt(t) && t.IsSigned()
  7821  	// result: x
  7822  	for {
  7823  		x := v_0
  7824  		if x.Op != OpArg {
  7825  			break
  7826  		}
  7827  		t := x.Type
  7828  		if !(is8BitInt(t) && t.IsSigned()) {
  7829  			break
  7830  		}
  7831  		v.copyOf(x)
  7832  		return true
  7833  	}
  7834  	// match: (MOVBreg (MOVDconst [c]))
  7835  	// result: (MOVDconst [int64(int8(c))])
  7836  	for {
  7837  		if v_0.Op != OpPPC64MOVDconst {
  7838  			break
  7839  		}
  7840  		c := auxIntToInt64(v_0.AuxInt)
  7841  		v.reset(OpPPC64MOVDconst)
  7842  		v.AuxInt = int64ToAuxInt(int64(int8(c)))
  7843  		return true
  7844  	}
  7845  	return false
  7846  }
  7847  func rewriteValuePPC64_OpPPC64MOVBstore(v *Value) bool {
  7848  	v_2 := v.Args[2]
  7849  	v_1 := v.Args[1]
  7850  	v_0 := v.Args[0]
  7851  	b := v.Block
  7852  	typ := &b.Func.Config.Types
  7853  	// match: (MOVBstore [off1] {sym} (ADDconst [off2] x) val mem)
  7854  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  7855  	// result: (MOVBstore [off1+int32(off2)] {sym} x val mem)
  7856  	for {
  7857  		off1 := auxIntToInt32(v.AuxInt)
  7858  		sym := auxToSym(v.Aux)
  7859  		if v_0.Op != OpPPC64ADDconst {
  7860  			break
  7861  		}
  7862  		off2 := auxIntToInt64(v_0.AuxInt)
  7863  		x := v_0.Args[0]
  7864  		val := v_1
  7865  		mem := v_2
  7866  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  7867  			break
  7868  		}
  7869  		v.reset(OpPPC64MOVBstore)
  7870  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  7871  		v.Aux = symToAux(sym)
  7872  		v.AddArg3(x, val, mem)
  7873  		return true
  7874  	}
  7875  	// match: (MOVBstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  7876  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  7877  	// result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  7878  	for {
  7879  		off1 := auxIntToInt32(v.AuxInt)
  7880  		sym1 := auxToSym(v.Aux)
  7881  		p := v_0
  7882  		if p.Op != OpPPC64MOVDaddr {
  7883  			break
  7884  		}
  7885  		off2 := auxIntToInt32(p.AuxInt)
  7886  		sym2 := auxToSym(p.Aux)
  7887  		ptr := p.Args[0]
  7888  		val := v_1
  7889  		mem := v_2
  7890  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  7891  			break
  7892  		}
  7893  		v.reset(OpPPC64MOVBstore)
  7894  		v.AuxInt = int32ToAuxInt(off1 + off2)
  7895  		v.Aux = symToAux(mergeSym(sym1, sym2))
  7896  		v.AddArg3(ptr, val, mem)
  7897  		return true
  7898  	}
  7899  	// match: (MOVBstore [off] {sym} ptr (MOVDconst [0]) mem)
  7900  	// result: (MOVBstorezero [off] {sym} ptr mem)
  7901  	for {
  7902  		off := auxIntToInt32(v.AuxInt)
  7903  		sym := auxToSym(v.Aux)
  7904  		ptr := v_0
  7905  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  7906  			break
  7907  		}
  7908  		mem := v_2
  7909  		v.reset(OpPPC64MOVBstorezero)
  7910  		v.AuxInt = int32ToAuxInt(off)
  7911  		v.Aux = symToAux(sym)
  7912  		v.AddArg2(ptr, mem)
  7913  		return true
  7914  	}
  7915  	// match: (MOVBstore [0] {sym} p:(ADD ptr idx) val mem)
  7916  	// cond: sym == nil && p.Uses == 1
  7917  	// result: (MOVBstoreidx ptr idx val mem)
  7918  	for {
  7919  		if auxIntToInt32(v.AuxInt) != 0 {
  7920  			break
  7921  		}
  7922  		sym := auxToSym(v.Aux)
  7923  		p := v_0
  7924  		if p.Op != OpPPC64ADD {
  7925  			break
  7926  		}
  7927  		idx := p.Args[1]
  7928  		ptr := p.Args[0]
  7929  		val := v_1
  7930  		mem := v_2
  7931  		if !(sym == nil && p.Uses == 1) {
  7932  			break
  7933  		}
  7934  		v.reset(OpPPC64MOVBstoreidx)
  7935  		v.AddArg4(ptr, idx, val, mem)
  7936  		return true
  7937  	}
  7938  	// match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
  7939  	// result: (MOVBstore [off] {sym} ptr x mem)
  7940  	for {
  7941  		off := auxIntToInt32(v.AuxInt)
  7942  		sym := auxToSym(v.Aux)
  7943  		ptr := v_0
  7944  		if v_1.Op != OpPPC64MOVBreg {
  7945  			break
  7946  		}
  7947  		x := v_1.Args[0]
  7948  		mem := v_2
  7949  		v.reset(OpPPC64MOVBstore)
  7950  		v.AuxInt = int32ToAuxInt(off)
  7951  		v.Aux = symToAux(sym)
  7952  		v.AddArg3(ptr, x, mem)
  7953  		return true
  7954  	}
  7955  	// match: (MOVBstore [off] {sym} ptr (MOVBZreg x) mem)
  7956  	// result: (MOVBstore [off] {sym} ptr x mem)
  7957  	for {
  7958  		off := auxIntToInt32(v.AuxInt)
  7959  		sym := auxToSym(v.Aux)
  7960  		ptr := v_0
  7961  		if v_1.Op != OpPPC64MOVBZreg {
  7962  			break
  7963  		}
  7964  		x := v_1.Args[0]
  7965  		mem := v_2
  7966  		v.reset(OpPPC64MOVBstore)
  7967  		v.AuxInt = int32ToAuxInt(off)
  7968  		v.Aux = symToAux(sym)
  7969  		v.AddArg3(ptr, x, mem)
  7970  		return true
  7971  	}
  7972  	// match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
  7973  	// result: (MOVBstore [off] {sym} ptr x mem)
  7974  	for {
  7975  		off := auxIntToInt32(v.AuxInt)
  7976  		sym := auxToSym(v.Aux)
  7977  		ptr := v_0
  7978  		if v_1.Op != OpPPC64MOVHreg {
  7979  			break
  7980  		}
  7981  		x := v_1.Args[0]
  7982  		mem := v_2
  7983  		v.reset(OpPPC64MOVBstore)
  7984  		v.AuxInt = int32ToAuxInt(off)
  7985  		v.Aux = symToAux(sym)
  7986  		v.AddArg3(ptr, x, mem)
  7987  		return true
  7988  	}
  7989  	// match: (MOVBstore [off] {sym} ptr (MOVHZreg x) mem)
  7990  	// result: (MOVBstore [off] {sym} ptr x mem)
  7991  	for {
  7992  		off := auxIntToInt32(v.AuxInt)
  7993  		sym := auxToSym(v.Aux)
  7994  		ptr := v_0
  7995  		if v_1.Op != OpPPC64MOVHZreg {
  7996  			break
  7997  		}
  7998  		x := v_1.Args[0]
  7999  		mem := v_2
  8000  		v.reset(OpPPC64MOVBstore)
  8001  		v.AuxInt = int32ToAuxInt(off)
  8002  		v.Aux = symToAux(sym)
  8003  		v.AddArg3(ptr, x, mem)
  8004  		return true
  8005  	}
  8006  	// match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
  8007  	// result: (MOVBstore [off] {sym} ptr x mem)
  8008  	for {
  8009  		off := auxIntToInt32(v.AuxInt)
  8010  		sym := auxToSym(v.Aux)
  8011  		ptr := v_0
  8012  		if v_1.Op != OpPPC64MOVWreg {
  8013  			break
  8014  		}
  8015  		x := v_1.Args[0]
  8016  		mem := v_2
  8017  		v.reset(OpPPC64MOVBstore)
  8018  		v.AuxInt = int32ToAuxInt(off)
  8019  		v.Aux = symToAux(sym)
  8020  		v.AddArg3(ptr, x, mem)
  8021  		return true
  8022  	}
  8023  	// match: (MOVBstore [off] {sym} ptr (MOVWZreg x) mem)
  8024  	// result: (MOVBstore [off] {sym} ptr x mem)
  8025  	for {
  8026  		off := auxIntToInt32(v.AuxInt)
  8027  		sym := auxToSym(v.Aux)
  8028  		ptr := v_0
  8029  		if v_1.Op != OpPPC64MOVWZreg {
  8030  			break
  8031  		}
  8032  		x := v_1.Args[0]
  8033  		mem := v_2
  8034  		v.reset(OpPPC64MOVBstore)
  8035  		v.AuxInt = int32ToAuxInt(off)
  8036  		v.Aux = symToAux(sym)
  8037  		v.AddArg3(ptr, x, mem)
  8038  		return true
  8039  	}
  8040  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHreg x) [c]) mem)
  8041  	// cond: c <= 8
  8042  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  8043  	for {
  8044  		off := auxIntToInt32(v.AuxInt)
  8045  		sym := auxToSym(v.Aux)
  8046  		ptr := v_0
  8047  		if v_1.Op != OpPPC64SRWconst {
  8048  			break
  8049  		}
  8050  		c := auxIntToInt64(v_1.AuxInt)
  8051  		v_1_0 := v_1.Args[0]
  8052  		if v_1_0.Op != OpPPC64MOVHreg {
  8053  			break
  8054  		}
  8055  		x := v_1_0.Args[0]
  8056  		mem := v_2
  8057  		if !(c <= 8) {
  8058  			break
  8059  		}
  8060  		v.reset(OpPPC64MOVBstore)
  8061  		v.AuxInt = int32ToAuxInt(off)
  8062  		v.Aux = symToAux(sym)
  8063  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8064  		v0.AuxInt = int64ToAuxInt(c)
  8065  		v0.AddArg(x)
  8066  		v.AddArg3(ptr, v0, mem)
  8067  		return true
  8068  	}
  8069  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHZreg x) [c]) mem)
  8070  	// cond: c <= 8
  8071  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  8072  	for {
  8073  		off := auxIntToInt32(v.AuxInt)
  8074  		sym := auxToSym(v.Aux)
  8075  		ptr := v_0
  8076  		if v_1.Op != OpPPC64SRWconst {
  8077  			break
  8078  		}
  8079  		c := auxIntToInt64(v_1.AuxInt)
  8080  		v_1_0 := v_1.Args[0]
  8081  		if v_1_0.Op != OpPPC64MOVHZreg {
  8082  			break
  8083  		}
  8084  		x := v_1_0.Args[0]
  8085  		mem := v_2
  8086  		if !(c <= 8) {
  8087  			break
  8088  		}
  8089  		v.reset(OpPPC64MOVBstore)
  8090  		v.AuxInt = int32ToAuxInt(off)
  8091  		v.Aux = symToAux(sym)
  8092  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8093  		v0.AuxInt = int64ToAuxInt(c)
  8094  		v0.AddArg(x)
  8095  		v.AddArg3(ptr, v0, mem)
  8096  		return true
  8097  	}
  8098  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWreg x) [c]) mem)
  8099  	// cond: c <= 24
  8100  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  8101  	for {
  8102  		off := auxIntToInt32(v.AuxInt)
  8103  		sym := auxToSym(v.Aux)
  8104  		ptr := v_0
  8105  		if v_1.Op != OpPPC64SRWconst {
  8106  			break
  8107  		}
  8108  		c := auxIntToInt64(v_1.AuxInt)
  8109  		v_1_0 := v_1.Args[0]
  8110  		if v_1_0.Op != OpPPC64MOVWreg {
  8111  			break
  8112  		}
  8113  		x := v_1_0.Args[0]
  8114  		mem := v_2
  8115  		if !(c <= 24) {
  8116  			break
  8117  		}
  8118  		v.reset(OpPPC64MOVBstore)
  8119  		v.AuxInt = int32ToAuxInt(off)
  8120  		v.Aux = symToAux(sym)
  8121  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8122  		v0.AuxInt = int64ToAuxInt(c)
  8123  		v0.AddArg(x)
  8124  		v.AddArg3(ptr, v0, mem)
  8125  		return true
  8126  	}
  8127  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWZreg x) [c]) mem)
  8128  	// cond: c <= 24
  8129  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  8130  	for {
  8131  		off := auxIntToInt32(v.AuxInt)
  8132  		sym := auxToSym(v.Aux)
  8133  		ptr := v_0
  8134  		if v_1.Op != OpPPC64SRWconst {
  8135  			break
  8136  		}
  8137  		c := auxIntToInt64(v_1.AuxInt)
  8138  		v_1_0 := v_1.Args[0]
  8139  		if v_1_0.Op != OpPPC64MOVWZreg {
  8140  			break
  8141  		}
  8142  		x := v_1_0.Args[0]
  8143  		mem := v_2
  8144  		if !(c <= 24) {
  8145  			break
  8146  		}
  8147  		v.reset(OpPPC64MOVBstore)
  8148  		v.AuxInt = int32ToAuxInt(off)
  8149  		v.Aux = symToAux(sym)
  8150  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8151  		v0.AuxInt = int64ToAuxInt(c)
  8152  		v0.AddArg(x)
  8153  		v.AddArg3(ptr, v0, mem)
  8154  		return true
  8155  	}
  8156  	return false
  8157  }
  8158  func rewriteValuePPC64_OpPPC64MOVBstoreidx(v *Value) bool {
  8159  	v_3 := v.Args[3]
  8160  	v_2 := v.Args[2]
  8161  	v_1 := v.Args[1]
  8162  	v_0 := v.Args[0]
  8163  	b := v.Block
  8164  	typ := &b.Func.Config.Types
  8165  	// match: (MOVBstoreidx ptr (MOVDconst [c]) val mem)
  8166  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8167  	// result: (MOVBstore [int32(c)] ptr val mem)
  8168  	for {
  8169  		ptr := v_0
  8170  		if v_1.Op != OpPPC64MOVDconst {
  8171  			break
  8172  		}
  8173  		c := auxIntToInt64(v_1.AuxInt)
  8174  		val := v_2
  8175  		mem := v_3
  8176  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8177  			break
  8178  		}
  8179  		v.reset(OpPPC64MOVBstore)
  8180  		v.AuxInt = int32ToAuxInt(int32(c))
  8181  		v.AddArg3(ptr, val, mem)
  8182  		return true
  8183  	}
  8184  	// match: (MOVBstoreidx (MOVDconst [c]) ptr val mem)
  8185  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8186  	// result: (MOVBstore [int32(c)] ptr val mem)
  8187  	for {
  8188  		if v_0.Op != OpPPC64MOVDconst {
  8189  			break
  8190  		}
  8191  		c := auxIntToInt64(v_0.AuxInt)
  8192  		ptr := v_1
  8193  		val := v_2
  8194  		mem := v_3
  8195  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8196  			break
  8197  		}
  8198  		v.reset(OpPPC64MOVBstore)
  8199  		v.AuxInt = int32ToAuxInt(int32(c))
  8200  		v.AddArg3(ptr, val, mem)
  8201  		return true
  8202  	}
  8203  	// match: (MOVBstoreidx ptr idx (MOVBreg x) mem)
  8204  	// result: (MOVBstoreidx ptr idx x mem)
  8205  	for {
  8206  		ptr := v_0
  8207  		idx := v_1
  8208  		if v_2.Op != OpPPC64MOVBreg {
  8209  			break
  8210  		}
  8211  		x := v_2.Args[0]
  8212  		mem := v_3
  8213  		v.reset(OpPPC64MOVBstoreidx)
  8214  		v.AddArg4(ptr, idx, x, mem)
  8215  		return true
  8216  	}
  8217  	// match: (MOVBstoreidx ptr idx (MOVBZreg x) mem)
  8218  	// result: (MOVBstoreidx ptr idx x mem)
  8219  	for {
  8220  		ptr := v_0
  8221  		idx := v_1
  8222  		if v_2.Op != OpPPC64MOVBZreg {
  8223  			break
  8224  		}
  8225  		x := v_2.Args[0]
  8226  		mem := v_3
  8227  		v.reset(OpPPC64MOVBstoreidx)
  8228  		v.AddArg4(ptr, idx, x, mem)
  8229  		return true
  8230  	}
  8231  	// match: (MOVBstoreidx ptr idx (MOVHreg x) mem)
  8232  	// result: (MOVBstoreidx ptr idx x mem)
  8233  	for {
  8234  		ptr := v_0
  8235  		idx := v_1
  8236  		if v_2.Op != OpPPC64MOVHreg {
  8237  			break
  8238  		}
  8239  		x := v_2.Args[0]
  8240  		mem := v_3
  8241  		v.reset(OpPPC64MOVBstoreidx)
  8242  		v.AddArg4(ptr, idx, x, mem)
  8243  		return true
  8244  	}
  8245  	// match: (MOVBstoreidx ptr idx (MOVHZreg x) mem)
  8246  	// result: (MOVBstoreidx ptr idx x mem)
  8247  	for {
  8248  		ptr := v_0
  8249  		idx := v_1
  8250  		if v_2.Op != OpPPC64MOVHZreg {
  8251  			break
  8252  		}
  8253  		x := v_2.Args[0]
  8254  		mem := v_3
  8255  		v.reset(OpPPC64MOVBstoreidx)
  8256  		v.AddArg4(ptr, idx, x, mem)
  8257  		return true
  8258  	}
  8259  	// match: (MOVBstoreidx ptr idx (MOVWreg x) mem)
  8260  	// result: (MOVBstoreidx ptr idx x mem)
  8261  	for {
  8262  		ptr := v_0
  8263  		idx := v_1
  8264  		if v_2.Op != OpPPC64MOVWreg {
  8265  			break
  8266  		}
  8267  		x := v_2.Args[0]
  8268  		mem := v_3
  8269  		v.reset(OpPPC64MOVBstoreidx)
  8270  		v.AddArg4(ptr, idx, x, mem)
  8271  		return true
  8272  	}
  8273  	// match: (MOVBstoreidx ptr idx (MOVWZreg x) mem)
  8274  	// result: (MOVBstoreidx ptr idx x mem)
  8275  	for {
  8276  		ptr := v_0
  8277  		idx := v_1
  8278  		if v_2.Op != OpPPC64MOVWZreg {
  8279  			break
  8280  		}
  8281  		x := v_2.Args[0]
  8282  		mem := v_3
  8283  		v.reset(OpPPC64MOVBstoreidx)
  8284  		v.AddArg4(ptr, idx, x, mem)
  8285  		return true
  8286  	}
  8287  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVHreg x) [c]) mem)
  8288  	// cond: c <= 8
  8289  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8290  	for {
  8291  		ptr := v_0
  8292  		idx := v_1
  8293  		if v_2.Op != OpPPC64SRWconst {
  8294  			break
  8295  		}
  8296  		c := auxIntToInt64(v_2.AuxInt)
  8297  		v_2_0 := v_2.Args[0]
  8298  		if v_2_0.Op != OpPPC64MOVHreg {
  8299  			break
  8300  		}
  8301  		x := v_2_0.Args[0]
  8302  		mem := v_3
  8303  		if !(c <= 8) {
  8304  			break
  8305  		}
  8306  		v.reset(OpPPC64MOVBstoreidx)
  8307  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8308  		v0.AuxInt = int64ToAuxInt(c)
  8309  		v0.AddArg(x)
  8310  		v.AddArg4(ptr, idx, v0, mem)
  8311  		return true
  8312  	}
  8313  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVHZreg x) [c]) mem)
  8314  	// cond: c <= 8
  8315  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8316  	for {
  8317  		ptr := v_0
  8318  		idx := v_1
  8319  		if v_2.Op != OpPPC64SRWconst {
  8320  			break
  8321  		}
  8322  		c := auxIntToInt64(v_2.AuxInt)
  8323  		v_2_0 := v_2.Args[0]
  8324  		if v_2_0.Op != OpPPC64MOVHZreg {
  8325  			break
  8326  		}
  8327  		x := v_2_0.Args[0]
  8328  		mem := v_3
  8329  		if !(c <= 8) {
  8330  			break
  8331  		}
  8332  		v.reset(OpPPC64MOVBstoreidx)
  8333  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8334  		v0.AuxInt = int64ToAuxInt(c)
  8335  		v0.AddArg(x)
  8336  		v.AddArg4(ptr, idx, v0, mem)
  8337  		return true
  8338  	}
  8339  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVWreg x) [c]) mem)
  8340  	// cond: c <= 24
  8341  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8342  	for {
  8343  		ptr := v_0
  8344  		idx := v_1
  8345  		if v_2.Op != OpPPC64SRWconst {
  8346  			break
  8347  		}
  8348  		c := auxIntToInt64(v_2.AuxInt)
  8349  		v_2_0 := v_2.Args[0]
  8350  		if v_2_0.Op != OpPPC64MOVWreg {
  8351  			break
  8352  		}
  8353  		x := v_2_0.Args[0]
  8354  		mem := v_3
  8355  		if !(c <= 24) {
  8356  			break
  8357  		}
  8358  		v.reset(OpPPC64MOVBstoreidx)
  8359  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8360  		v0.AuxInt = int64ToAuxInt(c)
  8361  		v0.AddArg(x)
  8362  		v.AddArg4(ptr, idx, v0, mem)
  8363  		return true
  8364  	}
  8365  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVWZreg x) [c]) mem)
  8366  	// cond: c <= 24
  8367  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8368  	for {
  8369  		ptr := v_0
  8370  		idx := v_1
  8371  		if v_2.Op != OpPPC64SRWconst {
  8372  			break
  8373  		}
  8374  		c := auxIntToInt64(v_2.AuxInt)
  8375  		v_2_0 := v_2.Args[0]
  8376  		if v_2_0.Op != OpPPC64MOVWZreg {
  8377  			break
  8378  		}
  8379  		x := v_2_0.Args[0]
  8380  		mem := v_3
  8381  		if !(c <= 24) {
  8382  			break
  8383  		}
  8384  		v.reset(OpPPC64MOVBstoreidx)
  8385  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8386  		v0.AuxInt = int64ToAuxInt(c)
  8387  		v0.AddArg(x)
  8388  		v.AddArg4(ptr, idx, v0, mem)
  8389  		return true
  8390  	}
  8391  	return false
  8392  }
  8393  func rewriteValuePPC64_OpPPC64MOVBstorezero(v *Value) bool {
  8394  	v_1 := v.Args[1]
  8395  	v_0 := v.Args[0]
  8396  	// match: (MOVBstorezero [off1] {sym} (ADDconst [off2] x) mem)
  8397  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
  8398  	// result: (MOVBstorezero [off1+int32(off2)] {sym} x mem)
  8399  	for {
  8400  		off1 := auxIntToInt32(v.AuxInt)
  8401  		sym := auxToSym(v.Aux)
  8402  		if v_0.Op != OpPPC64ADDconst {
  8403  			break
  8404  		}
  8405  		off2 := auxIntToInt64(v_0.AuxInt)
  8406  		x := v_0.Args[0]
  8407  		mem := v_1
  8408  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
  8409  			break
  8410  		}
  8411  		v.reset(OpPPC64MOVBstorezero)
  8412  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8413  		v.Aux = symToAux(sym)
  8414  		v.AddArg2(x, mem)
  8415  		return true
  8416  	}
  8417  	// match: (MOVBstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
  8418  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8419  	// result: (MOVBstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
  8420  	for {
  8421  		off1 := auxIntToInt32(v.AuxInt)
  8422  		sym1 := auxToSym(v.Aux)
  8423  		p := v_0
  8424  		if p.Op != OpPPC64MOVDaddr {
  8425  			break
  8426  		}
  8427  		off2 := auxIntToInt32(p.AuxInt)
  8428  		sym2 := auxToSym(p.Aux)
  8429  		x := p.Args[0]
  8430  		mem := v_1
  8431  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8432  			break
  8433  		}
  8434  		v.reset(OpPPC64MOVBstorezero)
  8435  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8436  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8437  		v.AddArg2(x, mem)
  8438  		return true
  8439  	}
  8440  	return false
  8441  }
  8442  func rewriteValuePPC64_OpPPC64MOVDaddr(v *Value) bool {
  8443  	v_0 := v.Args[0]
  8444  	// match: (MOVDaddr {sym} [n] p:(ADD x y))
  8445  	// cond: sym == nil && n == 0
  8446  	// result: p
  8447  	for {
  8448  		n := auxIntToInt32(v.AuxInt)
  8449  		sym := auxToSym(v.Aux)
  8450  		p := v_0
  8451  		if p.Op != OpPPC64ADD {
  8452  			break
  8453  		}
  8454  		if !(sym == nil && n == 0) {
  8455  			break
  8456  		}
  8457  		v.copyOf(p)
  8458  		return true
  8459  	}
  8460  	// match: (MOVDaddr {sym} [n] ptr)
  8461  	// cond: sym == nil && n == 0 && (ptr.Op == OpArgIntReg || ptr.Op == OpPhi)
  8462  	// result: ptr
  8463  	for {
  8464  		n := auxIntToInt32(v.AuxInt)
  8465  		sym := auxToSym(v.Aux)
  8466  		ptr := v_0
  8467  		if !(sym == nil && n == 0 && (ptr.Op == OpArgIntReg || ptr.Op == OpPhi)) {
  8468  			break
  8469  		}
  8470  		v.copyOf(ptr)
  8471  		return true
  8472  	}
  8473  	return false
  8474  }
  8475  func rewriteValuePPC64_OpPPC64MOVDload(v *Value) bool {
  8476  	v_1 := v.Args[1]
  8477  	v_0 := v.Args[0]
  8478  	// match: (MOVDload [off] {sym} ptr (FMOVDstore [off] {sym} ptr x _))
  8479  	// result: (MFVSRD x)
  8480  	for {
  8481  		off := auxIntToInt32(v.AuxInt)
  8482  		sym := auxToSym(v.Aux)
  8483  		ptr := v_0
  8484  		if v_1.Op != OpPPC64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  8485  			break
  8486  		}
  8487  		x := v_1.Args[1]
  8488  		if ptr != v_1.Args[0] {
  8489  			break
  8490  		}
  8491  		v.reset(OpPPC64MFVSRD)
  8492  		v.AddArg(x)
  8493  		return true
  8494  	}
  8495  	// match: (MOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  8496  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8497  	// result: (MOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8498  	for {
  8499  		off1 := auxIntToInt32(v.AuxInt)
  8500  		sym1 := auxToSym(v.Aux)
  8501  		p := v_0
  8502  		if p.Op != OpPPC64MOVDaddr {
  8503  			break
  8504  		}
  8505  		off2 := auxIntToInt32(p.AuxInt)
  8506  		sym2 := auxToSym(p.Aux)
  8507  		ptr := p.Args[0]
  8508  		mem := v_1
  8509  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8510  			break
  8511  		}
  8512  		v.reset(OpPPC64MOVDload)
  8513  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8514  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8515  		v.AddArg2(ptr, mem)
  8516  		return true
  8517  	}
  8518  	// match: (MOVDload [off1] {sym} (ADDconst [off2] x) mem)
  8519  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8520  	// result: (MOVDload [off1+int32(off2)] {sym} x mem)
  8521  	for {
  8522  		off1 := auxIntToInt32(v.AuxInt)
  8523  		sym := auxToSym(v.Aux)
  8524  		if v_0.Op != OpPPC64ADDconst {
  8525  			break
  8526  		}
  8527  		off2 := auxIntToInt64(v_0.AuxInt)
  8528  		x := v_0.Args[0]
  8529  		mem := v_1
  8530  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8531  			break
  8532  		}
  8533  		v.reset(OpPPC64MOVDload)
  8534  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8535  		v.Aux = symToAux(sym)
  8536  		v.AddArg2(x, mem)
  8537  		return true
  8538  	}
  8539  	// match: (MOVDload [0] {sym} p:(ADD ptr idx) mem)
  8540  	// cond: sym == nil && p.Uses == 1
  8541  	// result: (MOVDloadidx ptr idx mem)
  8542  	for {
  8543  		if auxIntToInt32(v.AuxInt) != 0 {
  8544  			break
  8545  		}
  8546  		sym := auxToSym(v.Aux)
  8547  		p := v_0
  8548  		if p.Op != OpPPC64ADD {
  8549  			break
  8550  		}
  8551  		idx := p.Args[1]
  8552  		ptr := p.Args[0]
  8553  		mem := v_1
  8554  		if !(sym == nil && p.Uses == 1) {
  8555  			break
  8556  		}
  8557  		v.reset(OpPPC64MOVDloadidx)
  8558  		v.AddArg3(ptr, idx, mem)
  8559  		return true
  8560  	}
  8561  	return false
  8562  }
  8563  func rewriteValuePPC64_OpPPC64MOVDloadidx(v *Value) bool {
  8564  	v_2 := v.Args[2]
  8565  	v_1 := v.Args[1]
  8566  	v_0 := v.Args[0]
  8567  	// match: (MOVDloadidx ptr (MOVDconst [c]) mem)
  8568  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8569  	// result: (MOVDload [int32(c)] ptr mem)
  8570  	for {
  8571  		ptr := v_0
  8572  		if v_1.Op != OpPPC64MOVDconst {
  8573  			break
  8574  		}
  8575  		c := auxIntToInt64(v_1.AuxInt)
  8576  		mem := v_2
  8577  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8578  			break
  8579  		}
  8580  		v.reset(OpPPC64MOVDload)
  8581  		v.AuxInt = int32ToAuxInt(int32(c))
  8582  		v.AddArg2(ptr, mem)
  8583  		return true
  8584  	}
  8585  	// match: (MOVDloadidx (MOVDconst [c]) ptr mem)
  8586  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8587  	// result: (MOVDload [int32(c)] ptr mem)
  8588  	for {
  8589  		if v_0.Op != OpPPC64MOVDconst {
  8590  			break
  8591  		}
  8592  		c := auxIntToInt64(v_0.AuxInt)
  8593  		ptr := v_1
  8594  		mem := v_2
  8595  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8596  			break
  8597  		}
  8598  		v.reset(OpPPC64MOVDload)
  8599  		v.AuxInt = int32ToAuxInt(int32(c))
  8600  		v.AddArg2(ptr, mem)
  8601  		return true
  8602  	}
  8603  	return false
  8604  }
  8605  func rewriteValuePPC64_OpPPC64MOVDstore(v *Value) bool {
  8606  	v_2 := v.Args[2]
  8607  	v_1 := v.Args[1]
  8608  	v_0 := v.Args[0]
  8609  	b := v.Block
  8610  	// match: (MOVDstore [off] {sym} ptr (MFVSRD x) mem)
  8611  	// result: (FMOVDstore [off] {sym} ptr x mem)
  8612  	for {
  8613  		off := auxIntToInt32(v.AuxInt)
  8614  		sym := auxToSym(v.Aux)
  8615  		ptr := v_0
  8616  		if v_1.Op != OpPPC64MFVSRD {
  8617  			break
  8618  		}
  8619  		x := v_1.Args[0]
  8620  		mem := v_2
  8621  		v.reset(OpPPC64FMOVDstore)
  8622  		v.AuxInt = int32ToAuxInt(off)
  8623  		v.Aux = symToAux(sym)
  8624  		v.AddArg3(ptr, x, mem)
  8625  		return true
  8626  	}
  8627  	// match: (MOVDstore [off1] {sym} (ADDconst [off2] x) val mem)
  8628  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8629  	// result: (MOVDstore [off1+int32(off2)] {sym} x val mem)
  8630  	for {
  8631  		off1 := auxIntToInt32(v.AuxInt)
  8632  		sym := auxToSym(v.Aux)
  8633  		if v_0.Op != OpPPC64ADDconst {
  8634  			break
  8635  		}
  8636  		off2 := auxIntToInt64(v_0.AuxInt)
  8637  		x := v_0.Args[0]
  8638  		val := v_1
  8639  		mem := v_2
  8640  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8641  			break
  8642  		}
  8643  		v.reset(OpPPC64MOVDstore)
  8644  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8645  		v.Aux = symToAux(sym)
  8646  		v.AddArg3(x, val, mem)
  8647  		return true
  8648  	}
  8649  	// match: (MOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  8650  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8651  	// result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  8652  	for {
  8653  		off1 := auxIntToInt32(v.AuxInt)
  8654  		sym1 := auxToSym(v.Aux)
  8655  		p := v_0
  8656  		if p.Op != OpPPC64MOVDaddr {
  8657  			break
  8658  		}
  8659  		off2 := auxIntToInt32(p.AuxInt)
  8660  		sym2 := auxToSym(p.Aux)
  8661  		ptr := p.Args[0]
  8662  		val := v_1
  8663  		mem := v_2
  8664  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8665  			break
  8666  		}
  8667  		v.reset(OpPPC64MOVDstore)
  8668  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8669  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8670  		v.AddArg3(ptr, val, mem)
  8671  		return true
  8672  	}
  8673  	// match: (MOVDstore [off] {sym} ptr (MOVDconst [0]) mem)
  8674  	// result: (MOVDstorezero [off] {sym} ptr mem)
  8675  	for {
  8676  		off := auxIntToInt32(v.AuxInt)
  8677  		sym := auxToSym(v.Aux)
  8678  		ptr := v_0
  8679  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  8680  			break
  8681  		}
  8682  		mem := v_2
  8683  		v.reset(OpPPC64MOVDstorezero)
  8684  		v.AuxInt = int32ToAuxInt(off)
  8685  		v.Aux = symToAux(sym)
  8686  		v.AddArg2(ptr, mem)
  8687  		return true
  8688  	}
  8689  	// match: (MOVDstore [0] {sym} p:(ADD ptr idx) val mem)
  8690  	// cond: sym == nil && p.Uses == 1
  8691  	// result: (MOVDstoreidx ptr idx val mem)
  8692  	for {
  8693  		if auxIntToInt32(v.AuxInt) != 0 {
  8694  			break
  8695  		}
  8696  		sym := auxToSym(v.Aux)
  8697  		p := v_0
  8698  		if p.Op != OpPPC64ADD {
  8699  			break
  8700  		}
  8701  		idx := p.Args[1]
  8702  		ptr := p.Args[0]
  8703  		val := v_1
  8704  		mem := v_2
  8705  		if !(sym == nil && p.Uses == 1) {
  8706  			break
  8707  		}
  8708  		v.reset(OpPPC64MOVDstoreidx)
  8709  		v.AddArg4(ptr, idx, val, mem)
  8710  		return true
  8711  	}
  8712  	// match: (MOVDstore [off] {sym} ptr r:(BRD val) mem)
  8713  	// cond: r.Uses == 1
  8714  	// result: (MOVDBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  8715  	for {
  8716  		off := auxIntToInt32(v.AuxInt)
  8717  		sym := auxToSym(v.Aux)
  8718  		ptr := v_0
  8719  		r := v_1
  8720  		if r.Op != OpPPC64BRD {
  8721  			break
  8722  		}
  8723  		val := r.Args[0]
  8724  		mem := v_2
  8725  		if !(r.Uses == 1) {
  8726  			break
  8727  		}
  8728  		v.reset(OpPPC64MOVDBRstore)
  8729  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  8730  		v0.AuxInt = int32ToAuxInt(off)
  8731  		v0.Aux = symToAux(sym)
  8732  		v0.AddArg(ptr)
  8733  		v.AddArg3(v0, val, mem)
  8734  		return true
  8735  	}
  8736  	// match: (MOVDstore [off] {sym} ptr (Bswap64 val) mem)
  8737  	// result: (MOVDBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  8738  	for {
  8739  		off := auxIntToInt32(v.AuxInt)
  8740  		sym := auxToSym(v.Aux)
  8741  		ptr := v_0
  8742  		if v_1.Op != OpBswap64 {
  8743  			break
  8744  		}
  8745  		val := v_1.Args[0]
  8746  		mem := v_2
  8747  		v.reset(OpPPC64MOVDBRstore)
  8748  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  8749  		v0.AuxInt = int32ToAuxInt(off)
  8750  		v0.Aux = symToAux(sym)
  8751  		v0.AddArg(ptr)
  8752  		v.AddArg3(v0, val, mem)
  8753  		return true
  8754  	}
  8755  	return false
  8756  }
  8757  func rewriteValuePPC64_OpPPC64MOVDstoreidx(v *Value) bool {
  8758  	v_3 := v.Args[3]
  8759  	v_2 := v.Args[2]
  8760  	v_1 := v.Args[1]
  8761  	v_0 := v.Args[0]
  8762  	// match: (MOVDstoreidx ptr (MOVDconst [c]) val mem)
  8763  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8764  	// result: (MOVDstore [int32(c)] ptr val mem)
  8765  	for {
  8766  		ptr := v_0
  8767  		if v_1.Op != OpPPC64MOVDconst {
  8768  			break
  8769  		}
  8770  		c := auxIntToInt64(v_1.AuxInt)
  8771  		val := v_2
  8772  		mem := v_3
  8773  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8774  			break
  8775  		}
  8776  		v.reset(OpPPC64MOVDstore)
  8777  		v.AuxInt = int32ToAuxInt(int32(c))
  8778  		v.AddArg3(ptr, val, mem)
  8779  		return true
  8780  	}
  8781  	// match: (MOVDstoreidx (MOVDconst [c]) ptr val mem)
  8782  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8783  	// result: (MOVDstore [int32(c)] ptr val mem)
  8784  	for {
  8785  		if v_0.Op != OpPPC64MOVDconst {
  8786  			break
  8787  		}
  8788  		c := auxIntToInt64(v_0.AuxInt)
  8789  		ptr := v_1
  8790  		val := v_2
  8791  		mem := v_3
  8792  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8793  			break
  8794  		}
  8795  		v.reset(OpPPC64MOVDstore)
  8796  		v.AuxInt = int32ToAuxInt(int32(c))
  8797  		v.AddArg3(ptr, val, mem)
  8798  		return true
  8799  	}
  8800  	// match: (MOVDstoreidx ptr idx r:(BRD val) mem)
  8801  	// cond: r.Uses == 1
  8802  	// result: (MOVDBRstoreidx ptr idx val mem)
  8803  	for {
  8804  		ptr := v_0
  8805  		idx := v_1
  8806  		r := v_2
  8807  		if r.Op != OpPPC64BRD {
  8808  			break
  8809  		}
  8810  		val := r.Args[0]
  8811  		mem := v_3
  8812  		if !(r.Uses == 1) {
  8813  			break
  8814  		}
  8815  		v.reset(OpPPC64MOVDBRstoreidx)
  8816  		v.AddArg4(ptr, idx, val, mem)
  8817  		return true
  8818  	}
  8819  	// match: (MOVDstoreidx ptr idx (Bswap64 val) mem)
  8820  	// result: (MOVDBRstoreidx ptr idx val mem)
  8821  	for {
  8822  		ptr := v_0
  8823  		idx := v_1
  8824  		if v_2.Op != OpBswap64 {
  8825  			break
  8826  		}
  8827  		val := v_2.Args[0]
  8828  		mem := v_3
  8829  		v.reset(OpPPC64MOVDBRstoreidx)
  8830  		v.AddArg4(ptr, idx, val, mem)
  8831  		return true
  8832  	}
  8833  	return false
  8834  }
  8835  func rewriteValuePPC64_OpPPC64MOVDstorezero(v *Value) bool {
  8836  	v_1 := v.Args[1]
  8837  	v_0 := v.Args[0]
  8838  	// match: (MOVDstorezero [off1] {sym} (ADDconst [off2] x) mem)
  8839  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
  8840  	// result: (MOVDstorezero [off1+int32(off2)] {sym} x mem)
  8841  	for {
  8842  		off1 := auxIntToInt32(v.AuxInt)
  8843  		sym := auxToSym(v.Aux)
  8844  		if v_0.Op != OpPPC64ADDconst {
  8845  			break
  8846  		}
  8847  		off2 := auxIntToInt64(v_0.AuxInt)
  8848  		x := v_0.Args[0]
  8849  		mem := v_1
  8850  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
  8851  			break
  8852  		}
  8853  		v.reset(OpPPC64MOVDstorezero)
  8854  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8855  		v.Aux = symToAux(sym)
  8856  		v.AddArg2(x, mem)
  8857  		return true
  8858  	}
  8859  	// match: (MOVDstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
  8860  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8861  	// result: (MOVDstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
  8862  	for {
  8863  		off1 := auxIntToInt32(v.AuxInt)
  8864  		sym1 := auxToSym(v.Aux)
  8865  		p := v_0
  8866  		if p.Op != OpPPC64MOVDaddr {
  8867  			break
  8868  		}
  8869  		off2 := auxIntToInt32(p.AuxInt)
  8870  		sym2 := auxToSym(p.Aux)
  8871  		x := p.Args[0]
  8872  		mem := v_1
  8873  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8874  			break
  8875  		}
  8876  		v.reset(OpPPC64MOVDstorezero)
  8877  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8878  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8879  		v.AddArg2(x, mem)
  8880  		return true
  8881  	}
  8882  	return false
  8883  }
  8884  func rewriteValuePPC64_OpPPC64MOVHBRstore(v *Value) bool {
  8885  	v_2 := v.Args[2]
  8886  	v_1 := v.Args[1]
  8887  	v_0 := v.Args[0]
  8888  	// match: (MOVHBRstore ptr (MOVHreg x) mem)
  8889  	// result: (MOVHBRstore ptr x mem)
  8890  	for {
  8891  		ptr := v_0
  8892  		if v_1.Op != OpPPC64MOVHreg {
  8893  			break
  8894  		}
  8895  		x := v_1.Args[0]
  8896  		mem := v_2
  8897  		v.reset(OpPPC64MOVHBRstore)
  8898  		v.AddArg3(ptr, x, mem)
  8899  		return true
  8900  	}
  8901  	// match: (MOVHBRstore ptr (MOVHZreg x) mem)
  8902  	// result: (MOVHBRstore ptr x mem)
  8903  	for {
  8904  		ptr := v_0
  8905  		if v_1.Op != OpPPC64MOVHZreg {
  8906  			break
  8907  		}
  8908  		x := v_1.Args[0]
  8909  		mem := v_2
  8910  		v.reset(OpPPC64MOVHBRstore)
  8911  		v.AddArg3(ptr, x, mem)
  8912  		return true
  8913  	}
  8914  	// match: (MOVHBRstore ptr (MOVWreg x) mem)
  8915  	// result: (MOVHBRstore ptr x mem)
  8916  	for {
  8917  		ptr := v_0
  8918  		if v_1.Op != OpPPC64MOVWreg {
  8919  			break
  8920  		}
  8921  		x := v_1.Args[0]
  8922  		mem := v_2
  8923  		v.reset(OpPPC64MOVHBRstore)
  8924  		v.AddArg3(ptr, x, mem)
  8925  		return true
  8926  	}
  8927  	// match: (MOVHBRstore ptr (MOVWZreg x) mem)
  8928  	// result: (MOVHBRstore ptr x mem)
  8929  	for {
  8930  		ptr := v_0
  8931  		if v_1.Op != OpPPC64MOVWZreg {
  8932  			break
  8933  		}
  8934  		x := v_1.Args[0]
  8935  		mem := v_2
  8936  		v.reset(OpPPC64MOVHBRstore)
  8937  		v.AddArg3(ptr, x, mem)
  8938  		return true
  8939  	}
  8940  	return false
  8941  }
  8942  func rewriteValuePPC64_OpPPC64MOVHZload(v *Value) bool {
  8943  	v_1 := v.Args[1]
  8944  	v_0 := v.Args[0]
  8945  	// match: (MOVHZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  8946  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8947  	// result: (MOVHZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8948  	for {
  8949  		off1 := auxIntToInt32(v.AuxInt)
  8950  		sym1 := auxToSym(v.Aux)
  8951  		p := v_0
  8952  		if p.Op != OpPPC64MOVDaddr {
  8953  			break
  8954  		}
  8955  		off2 := auxIntToInt32(p.AuxInt)
  8956  		sym2 := auxToSym(p.Aux)
  8957  		ptr := p.Args[0]
  8958  		mem := v_1
  8959  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8960  			break
  8961  		}
  8962  		v.reset(OpPPC64MOVHZload)
  8963  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8964  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8965  		v.AddArg2(ptr, mem)
  8966  		return true
  8967  	}
  8968  	// match: (MOVHZload [off1] {sym} (ADDconst [off2] x) mem)
  8969  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8970  	// result: (MOVHZload [off1+int32(off2)] {sym} x mem)
  8971  	for {
  8972  		off1 := auxIntToInt32(v.AuxInt)
  8973  		sym := auxToSym(v.Aux)
  8974  		if v_0.Op != OpPPC64ADDconst {
  8975  			break
  8976  		}
  8977  		off2 := auxIntToInt64(v_0.AuxInt)
  8978  		x := v_0.Args[0]
  8979  		mem := v_1
  8980  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8981  			break
  8982  		}
  8983  		v.reset(OpPPC64MOVHZload)
  8984  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8985  		v.Aux = symToAux(sym)
  8986  		v.AddArg2(x, mem)
  8987  		return true
  8988  	}
  8989  	// match: (MOVHZload [0] {sym} p:(ADD ptr idx) mem)
  8990  	// cond: sym == nil && p.Uses == 1
  8991  	// result: (MOVHZloadidx ptr idx mem)
  8992  	for {
  8993  		if auxIntToInt32(v.AuxInt) != 0 {
  8994  			break
  8995  		}
  8996  		sym := auxToSym(v.Aux)
  8997  		p := v_0
  8998  		if p.Op != OpPPC64ADD {
  8999  			break
  9000  		}
  9001  		idx := p.Args[1]
  9002  		ptr := p.Args[0]
  9003  		mem := v_1
  9004  		if !(sym == nil && p.Uses == 1) {
  9005  			break
  9006  		}
  9007  		v.reset(OpPPC64MOVHZloadidx)
  9008  		v.AddArg3(ptr, idx, mem)
  9009  		return true
  9010  	}
  9011  	return false
  9012  }
  9013  func rewriteValuePPC64_OpPPC64MOVHZloadidx(v *Value) bool {
  9014  	v_2 := v.Args[2]
  9015  	v_1 := v.Args[1]
  9016  	v_0 := v.Args[0]
  9017  	// match: (MOVHZloadidx ptr (MOVDconst [c]) mem)
  9018  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9019  	// result: (MOVHZload [int32(c)] ptr mem)
  9020  	for {
  9021  		ptr := v_0
  9022  		if v_1.Op != OpPPC64MOVDconst {
  9023  			break
  9024  		}
  9025  		c := auxIntToInt64(v_1.AuxInt)
  9026  		mem := v_2
  9027  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9028  			break
  9029  		}
  9030  		v.reset(OpPPC64MOVHZload)
  9031  		v.AuxInt = int32ToAuxInt(int32(c))
  9032  		v.AddArg2(ptr, mem)
  9033  		return true
  9034  	}
  9035  	// match: (MOVHZloadidx (MOVDconst [c]) ptr mem)
  9036  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9037  	// result: (MOVHZload [int32(c)] ptr mem)
  9038  	for {
  9039  		if v_0.Op != OpPPC64MOVDconst {
  9040  			break
  9041  		}
  9042  		c := auxIntToInt64(v_0.AuxInt)
  9043  		ptr := v_1
  9044  		mem := v_2
  9045  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9046  			break
  9047  		}
  9048  		v.reset(OpPPC64MOVHZload)
  9049  		v.AuxInt = int32ToAuxInt(int32(c))
  9050  		v.AddArg2(ptr, mem)
  9051  		return true
  9052  	}
  9053  	return false
  9054  }
  9055  func rewriteValuePPC64_OpPPC64MOVHZreg(v *Value) bool {
  9056  	v_0 := v.Args[0]
  9057  	b := v.Block
  9058  	typ := &b.Func.Config.Types
  9059  	// match: (MOVHZreg y:(ANDconst [c] _))
  9060  	// cond: uint64(c) <= 0xFFFF
  9061  	// result: y
  9062  	for {
  9063  		y := v_0
  9064  		if y.Op != OpPPC64ANDconst {
  9065  			break
  9066  		}
  9067  		c := auxIntToInt64(y.AuxInt)
  9068  		if !(uint64(c) <= 0xFFFF) {
  9069  			break
  9070  		}
  9071  		v.copyOf(y)
  9072  		return true
  9073  	}
  9074  	// match: (MOVHZreg (SRWconst [c] (MOVBZreg x)))
  9075  	// result: (SRWconst [c] (MOVBZreg x))
  9076  	for {
  9077  		if v_0.Op != OpPPC64SRWconst {
  9078  			break
  9079  		}
  9080  		c := auxIntToInt64(v_0.AuxInt)
  9081  		v_0_0 := v_0.Args[0]
  9082  		if v_0_0.Op != OpPPC64MOVBZreg {
  9083  			break
  9084  		}
  9085  		x := v_0_0.Args[0]
  9086  		v.reset(OpPPC64SRWconst)
  9087  		v.AuxInt = int64ToAuxInt(c)
  9088  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  9089  		v0.AddArg(x)
  9090  		v.AddArg(v0)
  9091  		return true
  9092  	}
  9093  	// match: (MOVHZreg (SRWconst [c] (MOVHZreg x)))
  9094  	// result: (SRWconst [c] (MOVHZreg x))
  9095  	for {
  9096  		if v_0.Op != OpPPC64SRWconst {
  9097  			break
  9098  		}
  9099  		c := auxIntToInt64(v_0.AuxInt)
  9100  		v_0_0 := v_0.Args[0]
  9101  		if v_0_0.Op != OpPPC64MOVHZreg {
  9102  			break
  9103  		}
  9104  		x := v_0_0.Args[0]
  9105  		v.reset(OpPPC64SRWconst)
  9106  		v.AuxInt = int64ToAuxInt(c)
  9107  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  9108  		v0.AddArg(x)
  9109  		v.AddArg(v0)
  9110  		return true
  9111  	}
  9112  	// match: (MOVHZreg (SRWconst [c] x))
  9113  	// cond: x.Type.Size() <= 16
  9114  	// result: (SRWconst [c] x)
  9115  	for {
  9116  		if v_0.Op != OpPPC64SRWconst {
  9117  			break
  9118  		}
  9119  		c := auxIntToInt64(v_0.AuxInt)
  9120  		x := v_0.Args[0]
  9121  		if !(x.Type.Size() <= 16) {
  9122  			break
  9123  		}
  9124  		v.reset(OpPPC64SRWconst)
  9125  		v.AuxInt = int64ToAuxInt(c)
  9126  		v.AddArg(x)
  9127  		return true
  9128  	}
  9129  	// match: (MOVHZreg (SRDconst [c] x))
  9130  	// cond: c>=48
  9131  	// result: (SRDconst [c] x)
  9132  	for {
  9133  		if v_0.Op != OpPPC64SRDconst {
  9134  			break
  9135  		}
  9136  		c := auxIntToInt64(v_0.AuxInt)
  9137  		x := v_0.Args[0]
  9138  		if !(c >= 48) {
  9139  			break
  9140  		}
  9141  		v.reset(OpPPC64SRDconst)
  9142  		v.AuxInt = int64ToAuxInt(c)
  9143  		v.AddArg(x)
  9144  		return true
  9145  	}
  9146  	// match: (MOVHZreg (SRWconst [c] x))
  9147  	// cond: c>=16
  9148  	// result: (SRWconst [c] x)
  9149  	for {
  9150  		if v_0.Op != OpPPC64SRWconst {
  9151  			break
  9152  		}
  9153  		c := auxIntToInt64(v_0.AuxInt)
  9154  		x := v_0.Args[0]
  9155  		if !(c >= 16) {
  9156  			break
  9157  		}
  9158  		v.reset(OpPPC64SRWconst)
  9159  		v.AuxInt = int64ToAuxInt(c)
  9160  		v.AddArg(x)
  9161  		return true
  9162  	}
  9163  	// match: (MOVHZreg (RLWINM [r] y))
  9164  	// cond: mergePPC64AndRlwinm(0xFFFF,r) != 0
  9165  	// result: (RLWINM [mergePPC64AndRlwinm(0xFFFF,r)] y)
  9166  	for {
  9167  		if v_0.Op != OpPPC64RLWINM {
  9168  			break
  9169  		}
  9170  		r := auxIntToInt64(v_0.AuxInt)
  9171  		y := v_0.Args[0]
  9172  		if !(mergePPC64AndRlwinm(0xFFFF, r) != 0) {
  9173  			break
  9174  		}
  9175  		v.reset(OpPPC64RLWINM)
  9176  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFFFF, r))
  9177  		v.AddArg(y)
  9178  		return true
  9179  	}
  9180  	// match: (MOVHZreg y:(MOVHZreg _))
  9181  	// result: y
  9182  	for {
  9183  		y := v_0
  9184  		if y.Op != OpPPC64MOVHZreg {
  9185  			break
  9186  		}
  9187  		v.copyOf(y)
  9188  		return true
  9189  	}
  9190  	// match: (MOVHZreg y:(MOVBZreg _))
  9191  	// result: y
  9192  	for {
  9193  		y := v_0
  9194  		if y.Op != OpPPC64MOVBZreg {
  9195  			break
  9196  		}
  9197  		v.copyOf(y)
  9198  		return true
  9199  	}
  9200  	// match: (MOVHZreg y:(MOVHBRload _ _))
  9201  	// result: y
  9202  	for {
  9203  		y := v_0
  9204  		if y.Op != OpPPC64MOVHBRload {
  9205  			break
  9206  		}
  9207  		v.copyOf(y)
  9208  		return true
  9209  	}
  9210  	// match: (MOVHZreg y:(MOVHreg x))
  9211  	// result: (MOVHZreg x)
  9212  	for {
  9213  		y := v_0
  9214  		if y.Op != OpPPC64MOVHreg {
  9215  			break
  9216  		}
  9217  		x := y.Args[0]
  9218  		v.reset(OpPPC64MOVHZreg)
  9219  		v.AddArg(x)
  9220  		return true
  9221  	}
  9222  	// match: (MOVHZreg (OR <t> x (MOVWZreg y)))
  9223  	// result: (MOVHZreg (OR <t> x y))
  9224  	for {
  9225  		if v_0.Op != OpPPC64OR {
  9226  			break
  9227  		}
  9228  		t := v_0.Type
  9229  		_ = v_0.Args[1]
  9230  		v_0_0 := v_0.Args[0]
  9231  		v_0_1 := v_0.Args[1]
  9232  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9233  			x := v_0_0
  9234  			if v_0_1.Op != OpPPC64MOVWZreg {
  9235  				continue
  9236  			}
  9237  			y := v_0_1.Args[0]
  9238  			v.reset(OpPPC64MOVHZreg)
  9239  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  9240  			v0.AddArg2(x, y)
  9241  			v.AddArg(v0)
  9242  			return true
  9243  		}
  9244  		break
  9245  	}
  9246  	// match: (MOVHZreg (XOR <t> x (MOVWZreg y)))
  9247  	// result: (MOVHZreg (XOR <t> x y))
  9248  	for {
  9249  		if v_0.Op != OpPPC64XOR {
  9250  			break
  9251  		}
  9252  		t := v_0.Type
  9253  		_ = v_0.Args[1]
  9254  		v_0_0 := v_0.Args[0]
  9255  		v_0_1 := v_0.Args[1]
  9256  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9257  			x := v_0_0
  9258  			if v_0_1.Op != OpPPC64MOVWZreg {
  9259  				continue
  9260  			}
  9261  			y := v_0_1.Args[0]
  9262  			v.reset(OpPPC64MOVHZreg)
  9263  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  9264  			v0.AddArg2(x, y)
  9265  			v.AddArg(v0)
  9266  			return true
  9267  		}
  9268  		break
  9269  	}
  9270  	// match: (MOVHZreg (AND <t> x (MOVWZreg y)))
  9271  	// result: (MOVHZreg (AND <t> x y))
  9272  	for {
  9273  		if v_0.Op != OpPPC64AND {
  9274  			break
  9275  		}
  9276  		t := v_0.Type
  9277  		_ = v_0.Args[1]
  9278  		v_0_0 := v_0.Args[0]
  9279  		v_0_1 := v_0.Args[1]
  9280  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9281  			x := v_0_0
  9282  			if v_0_1.Op != OpPPC64MOVWZreg {
  9283  				continue
  9284  			}
  9285  			y := v_0_1.Args[0]
  9286  			v.reset(OpPPC64MOVHZreg)
  9287  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  9288  			v0.AddArg2(x, y)
  9289  			v.AddArg(v0)
  9290  			return true
  9291  		}
  9292  		break
  9293  	}
  9294  	// match: (MOVHZreg (OR <t> x (MOVHZreg y)))
  9295  	// result: (MOVHZreg (OR <t> x y))
  9296  	for {
  9297  		if v_0.Op != OpPPC64OR {
  9298  			break
  9299  		}
  9300  		t := v_0.Type
  9301  		_ = v_0.Args[1]
  9302  		v_0_0 := v_0.Args[0]
  9303  		v_0_1 := v_0.Args[1]
  9304  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9305  			x := v_0_0
  9306  			if v_0_1.Op != OpPPC64MOVHZreg {
  9307  				continue
  9308  			}
  9309  			y := v_0_1.Args[0]
  9310  			v.reset(OpPPC64MOVHZreg)
  9311  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  9312  			v0.AddArg2(x, y)
  9313  			v.AddArg(v0)
  9314  			return true
  9315  		}
  9316  		break
  9317  	}
  9318  	// match: (MOVHZreg (XOR <t> x (MOVHZreg y)))
  9319  	// result: (MOVHZreg (XOR <t> x y))
  9320  	for {
  9321  		if v_0.Op != OpPPC64XOR {
  9322  			break
  9323  		}
  9324  		t := v_0.Type
  9325  		_ = v_0.Args[1]
  9326  		v_0_0 := v_0.Args[0]
  9327  		v_0_1 := v_0.Args[1]
  9328  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9329  			x := v_0_0
  9330  			if v_0_1.Op != OpPPC64MOVHZreg {
  9331  				continue
  9332  			}
  9333  			y := v_0_1.Args[0]
  9334  			v.reset(OpPPC64MOVHZreg)
  9335  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  9336  			v0.AddArg2(x, y)
  9337  			v.AddArg(v0)
  9338  			return true
  9339  		}
  9340  		break
  9341  	}
  9342  	// match: (MOVHZreg (AND <t> x (MOVHZreg y)))
  9343  	// result: (MOVHZreg (AND <t> x y))
  9344  	for {
  9345  		if v_0.Op != OpPPC64AND {
  9346  			break
  9347  		}
  9348  		t := v_0.Type
  9349  		_ = v_0.Args[1]
  9350  		v_0_0 := v_0.Args[0]
  9351  		v_0_1 := v_0.Args[1]
  9352  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9353  			x := v_0_0
  9354  			if v_0_1.Op != OpPPC64MOVHZreg {
  9355  				continue
  9356  			}
  9357  			y := v_0_1.Args[0]
  9358  			v.reset(OpPPC64MOVHZreg)
  9359  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  9360  			v0.AddArg2(x, y)
  9361  			v.AddArg(v0)
  9362  			return true
  9363  		}
  9364  		break
  9365  	}
  9366  	// match: (MOVHZreg z:(ANDconst [c] (MOVBZload ptr x)))
  9367  	// result: z
  9368  	for {
  9369  		z := v_0
  9370  		if z.Op != OpPPC64ANDconst {
  9371  			break
  9372  		}
  9373  		z_0 := z.Args[0]
  9374  		if z_0.Op != OpPPC64MOVBZload {
  9375  			break
  9376  		}
  9377  		v.copyOf(z)
  9378  		return true
  9379  	}
  9380  	// match: (MOVHZreg z:(AND y (MOVHZload ptr x)))
  9381  	// result: z
  9382  	for {
  9383  		z := v_0
  9384  		if z.Op != OpPPC64AND {
  9385  			break
  9386  		}
  9387  		_ = z.Args[1]
  9388  		z_0 := z.Args[0]
  9389  		z_1 := z.Args[1]
  9390  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
  9391  			if z_1.Op != OpPPC64MOVHZload {
  9392  				continue
  9393  			}
  9394  			v.copyOf(z)
  9395  			return true
  9396  		}
  9397  		break
  9398  	}
  9399  	// match: (MOVHZreg z:(ANDconst [c] (MOVHZload ptr x)))
  9400  	// result: z
  9401  	for {
  9402  		z := v_0
  9403  		if z.Op != OpPPC64ANDconst {
  9404  			break
  9405  		}
  9406  		z_0 := z.Args[0]
  9407  		if z_0.Op != OpPPC64MOVHZload {
  9408  			break
  9409  		}
  9410  		v.copyOf(z)
  9411  		return true
  9412  	}
  9413  	// match: (MOVHZreg x:(MOVBZload _ _))
  9414  	// result: x
  9415  	for {
  9416  		x := v_0
  9417  		if x.Op != OpPPC64MOVBZload {
  9418  			break
  9419  		}
  9420  		v.copyOf(x)
  9421  		return true
  9422  	}
  9423  	// match: (MOVHZreg x:(MOVBZloadidx _ _ _))
  9424  	// result: x
  9425  	for {
  9426  		x := v_0
  9427  		if x.Op != OpPPC64MOVBZloadidx {
  9428  			break
  9429  		}
  9430  		v.copyOf(x)
  9431  		return true
  9432  	}
  9433  	// match: (MOVHZreg x:(MOVHZload _ _))
  9434  	// result: x
  9435  	for {
  9436  		x := v_0
  9437  		if x.Op != OpPPC64MOVHZload {
  9438  			break
  9439  		}
  9440  		v.copyOf(x)
  9441  		return true
  9442  	}
  9443  	// match: (MOVHZreg x:(MOVHZloadidx _ _ _))
  9444  	// result: x
  9445  	for {
  9446  		x := v_0
  9447  		if x.Op != OpPPC64MOVHZloadidx {
  9448  			break
  9449  		}
  9450  		v.copyOf(x)
  9451  		return true
  9452  	}
  9453  	// match: (MOVHZreg x:(Arg <t>))
  9454  	// cond: (is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()
  9455  	// result: x
  9456  	for {
  9457  		x := v_0
  9458  		if x.Op != OpArg {
  9459  			break
  9460  		}
  9461  		t := x.Type
  9462  		if !((is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()) {
  9463  			break
  9464  		}
  9465  		v.copyOf(x)
  9466  		return true
  9467  	}
  9468  	// match: (MOVHZreg (MOVDconst [c]))
  9469  	// result: (MOVDconst [int64(uint16(c))])
  9470  	for {
  9471  		if v_0.Op != OpPPC64MOVDconst {
  9472  			break
  9473  		}
  9474  		c := auxIntToInt64(v_0.AuxInt)
  9475  		v.reset(OpPPC64MOVDconst)
  9476  		v.AuxInt = int64ToAuxInt(int64(uint16(c)))
  9477  		return true
  9478  	}
  9479  	return false
  9480  }
  9481  func rewriteValuePPC64_OpPPC64MOVHload(v *Value) bool {
  9482  	v_1 := v.Args[1]
  9483  	v_0 := v.Args[0]
  9484  	// match: (MOVHload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  9485  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  9486  	// result: (MOVHload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9487  	for {
  9488  		off1 := auxIntToInt32(v.AuxInt)
  9489  		sym1 := auxToSym(v.Aux)
  9490  		p := v_0
  9491  		if p.Op != OpPPC64MOVDaddr {
  9492  			break
  9493  		}
  9494  		off2 := auxIntToInt32(p.AuxInt)
  9495  		sym2 := auxToSym(p.Aux)
  9496  		ptr := p.Args[0]
  9497  		mem := v_1
  9498  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  9499  			break
  9500  		}
  9501  		v.reset(OpPPC64MOVHload)
  9502  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9503  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9504  		v.AddArg2(ptr, mem)
  9505  		return true
  9506  	}
  9507  	// match: (MOVHload [off1] {sym} (ADDconst [off2] x) mem)
  9508  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  9509  	// result: (MOVHload [off1+int32(off2)] {sym} x mem)
  9510  	for {
  9511  		off1 := auxIntToInt32(v.AuxInt)
  9512  		sym := auxToSym(v.Aux)
  9513  		if v_0.Op != OpPPC64ADDconst {
  9514  			break
  9515  		}
  9516  		off2 := auxIntToInt64(v_0.AuxInt)
  9517  		x := v_0.Args[0]
  9518  		mem := v_1
  9519  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  9520  			break
  9521  		}
  9522  		v.reset(OpPPC64MOVHload)
  9523  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9524  		v.Aux = symToAux(sym)
  9525  		v.AddArg2(x, mem)
  9526  		return true
  9527  	}
  9528  	// match: (MOVHload [0] {sym} p:(ADD ptr idx) mem)
  9529  	// cond: sym == nil && p.Uses == 1
  9530  	// result: (MOVHloadidx ptr idx mem)
  9531  	for {
  9532  		if auxIntToInt32(v.AuxInt) != 0 {
  9533  			break
  9534  		}
  9535  		sym := auxToSym(v.Aux)
  9536  		p := v_0
  9537  		if p.Op != OpPPC64ADD {
  9538  			break
  9539  		}
  9540  		idx := p.Args[1]
  9541  		ptr := p.Args[0]
  9542  		mem := v_1
  9543  		if !(sym == nil && p.Uses == 1) {
  9544  			break
  9545  		}
  9546  		v.reset(OpPPC64MOVHloadidx)
  9547  		v.AddArg3(ptr, idx, mem)
  9548  		return true
  9549  	}
  9550  	return false
  9551  }
  9552  func rewriteValuePPC64_OpPPC64MOVHloadidx(v *Value) bool {
  9553  	v_2 := v.Args[2]
  9554  	v_1 := v.Args[1]
  9555  	v_0 := v.Args[0]
  9556  	// match: (MOVHloadidx ptr (MOVDconst [c]) mem)
  9557  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9558  	// result: (MOVHload [int32(c)] ptr mem)
  9559  	for {
  9560  		ptr := v_0
  9561  		if v_1.Op != OpPPC64MOVDconst {
  9562  			break
  9563  		}
  9564  		c := auxIntToInt64(v_1.AuxInt)
  9565  		mem := v_2
  9566  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9567  			break
  9568  		}
  9569  		v.reset(OpPPC64MOVHload)
  9570  		v.AuxInt = int32ToAuxInt(int32(c))
  9571  		v.AddArg2(ptr, mem)
  9572  		return true
  9573  	}
  9574  	// match: (MOVHloadidx (MOVDconst [c]) ptr mem)
  9575  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9576  	// result: (MOVHload [int32(c)] ptr mem)
  9577  	for {
  9578  		if v_0.Op != OpPPC64MOVDconst {
  9579  			break
  9580  		}
  9581  		c := auxIntToInt64(v_0.AuxInt)
  9582  		ptr := v_1
  9583  		mem := v_2
  9584  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9585  			break
  9586  		}
  9587  		v.reset(OpPPC64MOVHload)
  9588  		v.AuxInt = int32ToAuxInt(int32(c))
  9589  		v.AddArg2(ptr, mem)
  9590  		return true
  9591  	}
  9592  	return false
  9593  }
  9594  func rewriteValuePPC64_OpPPC64MOVHreg(v *Value) bool {
  9595  	v_0 := v.Args[0]
  9596  	b := v.Block
  9597  	typ := &b.Func.Config.Types
  9598  	// match: (MOVHreg y:(ANDconst [c] _))
  9599  	// cond: uint64(c) <= 0x7FFF
  9600  	// result: y
  9601  	for {
  9602  		y := v_0
  9603  		if y.Op != OpPPC64ANDconst {
  9604  			break
  9605  		}
  9606  		c := auxIntToInt64(y.AuxInt)
  9607  		if !(uint64(c) <= 0x7FFF) {
  9608  			break
  9609  		}
  9610  		v.copyOf(y)
  9611  		return true
  9612  	}
  9613  	// match: (MOVHreg (SRAWconst [c] (MOVBreg x)))
  9614  	// result: (SRAWconst [c] (MOVBreg x))
  9615  	for {
  9616  		if v_0.Op != OpPPC64SRAWconst {
  9617  			break
  9618  		}
  9619  		c := auxIntToInt64(v_0.AuxInt)
  9620  		v_0_0 := v_0.Args[0]
  9621  		if v_0_0.Op != OpPPC64MOVBreg {
  9622  			break
  9623  		}
  9624  		x := v_0_0.Args[0]
  9625  		v.reset(OpPPC64SRAWconst)
  9626  		v.AuxInt = int64ToAuxInt(c)
  9627  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
  9628  		v0.AddArg(x)
  9629  		v.AddArg(v0)
  9630  		return true
  9631  	}
  9632  	// match: (MOVHreg (SRAWconst [c] (MOVHreg x)))
  9633  	// result: (SRAWconst [c] (MOVHreg x))
  9634  	for {
  9635  		if v_0.Op != OpPPC64SRAWconst {
  9636  			break
  9637  		}
  9638  		c := auxIntToInt64(v_0.AuxInt)
  9639  		v_0_0 := v_0.Args[0]
  9640  		if v_0_0.Op != OpPPC64MOVHreg {
  9641  			break
  9642  		}
  9643  		x := v_0_0.Args[0]
  9644  		v.reset(OpPPC64SRAWconst)
  9645  		v.AuxInt = int64ToAuxInt(c)
  9646  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
  9647  		v0.AddArg(x)
  9648  		v.AddArg(v0)
  9649  		return true
  9650  	}
  9651  	// match: (MOVHreg (SRAWconst [c] x))
  9652  	// cond: x.Type.Size() <= 16
  9653  	// result: (SRAWconst [c] x)
  9654  	for {
  9655  		if v_0.Op != OpPPC64SRAWconst {
  9656  			break
  9657  		}
  9658  		c := auxIntToInt64(v_0.AuxInt)
  9659  		x := v_0.Args[0]
  9660  		if !(x.Type.Size() <= 16) {
  9661  			break
  9662  		}
  9663  		v.reset(OpPPC64SRAWconst)
  9664  		v.AuxInt = int64ToAuxInt(c)
  9665  		v.AddArg(x)
  9666  		return true
  9667  	}
  9668  	// match: (MOVHreg (SRDconst [c] x))
  9669  	// cond: c>48
  9670  	// result: (SRDconst [c] x)
  9671  	for {
  9672  		if v_0.Op != OpPPC64SRDconst {
  9673  			break
  9674  		}
  9675  		c := auxIntToInt64(v_0.AuxInt)
  9676  		x := v_0.Args[0]
  9677  		if !(c > 48) {
  9678  			break
  9679  		}
  9680  		v.reset(OpPPC64SRDconst)
  9681  		v.AuxInt = int64ToAuxInt(c)
  9682  		v.AddArg(x)
  9683  		return true
  9684  	}
  9685  	// match: (MOVHreg (SRDconst [c] x))
  9686  	// cond: c==48
  9687  	// result: (SRADconst [c] x)
  9688  	for {
  9689  		if v_0.Op != OpPPC64SRDconst {
  9690  			break
  9691  		}
  9692  		c := auxIntToInt64(v_0.AuxInt)
  9693  		x := v_0.Args[0]
  9694  		if !(c == 48) {
  9695  			break
  9696  		}
  9697  		v.reset(OpPPC64SRADconst)
  9698  		v.AuxInt = int64ToAuxInt(c)
  9699  		v.AddArg(x)
  9700  		return true
  9701  	}
  9702  	// match: (MOVHreg (SRADconst [c] x))
  9703  	// cond: c>=48
  9704  	// result: (SRADconst [c] x)
  9705  	for {
  9706  		if v_0.Op != OpPPC64SRADconst {
  9707  			break
  9708  		}
  9709  		c := auxIntToInt64(v_0.AuxInt)
  9710  		x := v_0.Args[0]
  9711  		if !(c >= 48) {
  9712  			break
  9713  		}
  9714  		v.reset(OpPPC64SRADconst)
  9715  		v.AuxInt = int64ToAuxInt(c)
  9716  		v.AddArg(x)
  9717  		return true
  9718  	}
  9719  	// match: (MOVHreg (SRWconst [c] x))
  9720  	// cond: c>16
  9721  	// result: (SRWconst [c] x)
  9722  	for {
  9723  		if v_0.Op != OpPPC64SRWconst {
  9724  			break
  9725  		}
  9726  		c := auxIntToInt64(v_0.AuxInt)
  9727  		x := v_0.Args[0]
  9728  		if !(c > 16) {
  9729  			break
  9730  		}
  9731  		v.reset(OpPPC64SRWconst)
  9732  		v.AuxInt = int64ToAuxInt(c)
  9733  		v.AddArg(x)
  9734  		return true
  9735  	}
  9736  	// match: (MOVHreg (SRAWconst [c] x))
  9737  	// cond: c>=16
  9738  	// result: (SRAWconst [c] x)
  9739  	for {
  9740  		if v_0.Op != OpPPC64SRAWconst {
  9741  			break
  9742  		}
  9743  		c := auxIntToInt64(v_0.AuxInt)
  9744  		x := v_0.Args[0]
  9745  		if !(c >= 16) {
  9746  			break
  9747  		}
  9748  		v.reset(OpPPC64SRAWconst)
  9749  		v.AuxInt = int64ToAuxInt(c)
  9750  		v.AddArg(x)
  9751  		return true
  9752  	}
  9753  	// match: (MOVHreg (SRWconst [c] x))
  9754  	// cond: c==16
  9755  	// result: (SRAWconst [c] x)
  9756  	for {
  9757  		if v_0.Op != OpPPC64SRWconst {
  9758  			break
  9759  		}
  9760  		c := auxIntToInt64(v_0.AuxInt)
  9761  		x := v_0.Args[0]
  9762  		if !(c == 16) {
  9763  			break
  9764  		}
  9765  		v.reset(OpPPC64SRAWconst)
  9766  		v.AuxInt = int64ToAuxInt(c)
  9767  		v.AddArg(x)
  9768  		return true
  9769  	}
  9770  	// match: (MOVHreg y:(MOVHreg _))
  9771  	// result: y
  9772  	for {
  9773  		y := v_0
  9774  		if y.Op != OpPPC64MOVHreg {
  9775  			break
  9776  		}
  9777  		v.copyOf(y)
  9778  		return true
  9779  	}
  9780  	// match: (MOVHreg y:(MOVBreg _))
  9781  	// result: y
  9782  	for {
  9783  		y := v_0
  9784  		if y.Op != OpPPC64MOVBreg {
  9785  			break
  9786  		}
  9787  		v.copyOf(y)
  9788  		return true
  9789  	}
  9790  	// match: (MOVHreg y:(MOVHZreg x))
  9791  	// result: (MOVHreg x)
  9792  	for {
  9793  		y := v_0
  9794  		if y.Op != OpPPC64MOVHZreg {
  9795  			break
  9796  		}
  9797  		x := y.Args[0]
  9798  		v.reset(OpPPC64MOVHreg)
  9799  		v.AddArg(x)
  9800  		return true
  9801  	}
  9802  	// match: (MOVHreg x:(MOVHload _ _))
  9803  	// result: x
  9804  	for {
  9805  		x := v_0
  9806  		if x.Op != OpPPC64MOVHload {
  9807  			break
  9808  		}
  9809  		v.copyOf(x)
  9810  		return true
  9811  	}
  9812  	// match: (MOVHreg x:(MOVHloadidx _ _ _))
  9813  	// result: x
  9814  	for {
  9815  		x := v_0
  9816  		if x.Op != OpPPC64MOVHloadidx {
  9817  			break
  9818  		}
  9819  		v.copyOf(x)
  9820  		return true
  9821  	}
  9822  	// match: (MOVHreg x:(Arg <t>))
  9823  	// cond: (is8BitInt(t) || is16BitInt(t)) && t.IsSigned()
  9824  	// result: x
  9825  	for {
  9826  		x := v_0
  9827  		if x.Op != OpArg {
  9828  			break
  9829  		}
  9830  		t := x.Type
  9831  		if !((is8BitInt(t) || is16BitInt(t)) && t.IsSigned()) {
  9832  			break
  9833  		}
  9834  		v.copyOf(x)
  9835  		return true
  9836  	}
  9837  	// match: (MOVHreg (MOVDconst [c]))
  9838  	// result: (MOVDconst [int64(int16(c))])
  9839  	for {
  9840  		if v_0.Op != OpPPC64MOVDconst {
  9841  			break
  9842  		}
  9843  		c := auxIntToInt64(v_0.AuxInt)
  9844  		v.reset(OpPPC64MOVDconst)
  9845  		v.AuxInt = int64ToAuxInt(int64(int16(c)))
  9846  		return true
  9847  	}
  9848  	return false
  9849  }
  9850  func rewriteValuePPC64_OpPPC64MOVHstore(v *Value) bool {
  9851  	v_2 := v.Args[2]
  9852  	v_1 := v.Args[1]
  9853  	v_0 := v.Args[0]
  9854  	b := v.Block
  9855  	// match: (MOVHstore [off1] {sym} (ADDconst [off2] x) val mem)
  9856  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  9857  	// result: (MOVHstore [off1+int32(off2)] {sym} x val mem)
  9858  	for {
  9859  		off1 := auxIntToInt32(v.AuxInt)
  9860  		sym := auxToSym(v.Aux)
  9861  		if v_0.Op != OpPPC64ADDconst {
  9862  			break
  9863  		}
  9864  		off2 := auxIntToInt64(v_0.AuxInt)
  9865  		x := v_0.Args[0]
  9866  		val := v_1
  9867  		mem := v_2
  9868  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  9869  			break
  9870  		}
  9871  		v.reset(OpPPC64MOVHstore)
  9872  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9873  		v.Aux = symToAux(sym)
  9874  		v.AddArg3(x, val, mem)
  9875  		return true
  9876  	}
  9877  	// match: (MOVHstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  9878  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  9879  	// result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  9880  	for {
  9881  		off1 := auxIntToInt32(v.AuxInt)
  9882  		sym1 := auxToSym(v.Aux)
  9883  		p := v_0
  9884  		if p.Op != OpPPC64MOVDaddr {
  9885  			break
  9886  		}
  9887  		off2 := auxIntToInt32(p.AuxInt)
  9888  		sym2 := auxToSym(p.Aux)
  9889  		ptr := p.Args[0]
  9890  		val := v_1
  9891  		mem := v_2
  9892  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  9893  			break
  9894  		}
  9895  		v.reset(OpPPC64MOVHstore)
  9896  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9897  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9898  		v.AddArg3(ptr, val, mem)
  9899  		return true
  9900  	}
  9901  	// match: (MOVHstore [off] {sym} ptr (MOVDconst [0]) mem)
  9902  	// result: (MOVHstorezero [off] {sym} ptr mem)
  9903  	for {
  9904  		off := auxIntToInt32(v.AuxInt)
  9905  		sym := auxToSym(v.Aux)
  9906  		ptr := v_0
  9907  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  9908  			break
  9909  		}
  9910  		mem := v_2
  9911  		v.reset(OpPPC64MOVHstorezero)
  9912  		v.AuxInt = int32ToAuxInt(off)
  9913  		v.Aux = symToAux(sym)
  9914  		v.AddArg2(ptr, mem)
  9915  		return true
  9916  	}
  9917  	// match: (MOVHstore [0] {sym} p:(ADD ptr idx) val mem)
  9918  	// cond: sym == nil && p.Uses == 1
  9919  	// result: (MOVHstoreidx ptr idx val mem)
  9920  	for {
  9921  		if auxIntToInt32(v.AuxInt) != 0 {
  9922  			break
  9923  		}
  9924  		sym := auxToSym(v.Aux)
  9925  		p := v_0
  9926  		if p.Op != OpPPC64ADD {
  9927  			break
  9928  		}
  9929  		idx := p.Args[1]
  9930  		ptr := p.Args[0]
  9931  		val := v_1
  9932  		mem := v_2
  9933  		if !(sym == nil && p.Uses == 1) {
  9934  			break
  9935  		}
  9936  		v.reset(OpPPC64MOVHstoreidx)
  9937  		v.AddArg4(ptr, idx, val, mem)
  9938  		return true
  9939  	}
  9940  	// match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
  9941  	// result: (MOVHstore [off] {sym} ptr x mem)
  9942  	for {
  9943  		off := auxIntToInt32(v.AuxInt)
  9944  		sym := auxToSym(v.Aux)
  9945  		ptr := v_0
  9946  		if v_1.Op != OpPPC64MOVHreg {
  9947  			break
  9948  		}
  9949  		x := v_1.Args[0]
  9950  		mem := v_2
  9951  		v.reset(OpPPC64MOVHstore)
  9952  		v.AuxInt = int32ToAuxInt(off)
  9953  		v.Aux = symToAux(sym)
  9954  		v.AddArg3(ptr, x, mem)
  9955  		return true
  9956  	}
  9957  	// match: (MOVHstore [off] {sym} ptr (MOVHZreg x) mem)
  9958  	// result: (MOVHstore [off] {sym} ptr x mem)
  9959  	for {
  9960  		off := auxIntToInt32(v.AuxInt)
  9961  		sym := auxToSym(v.Aux)
  9962  		ptr := v_0
  9963  		if v_1.Op != OpPPC64MOVHZreg {
  9964  			break
  9965  		}
  9966  		x := v_1.Args[0]
  9967  		mem := v_2
  9968  		v.reset(OpPPC64MOVHstore)
  9969  		v.AuxInt = int32ToAuxInt(off)
  9970  		v.Aux = symToAux(sym)
  9971  		v.AddArg3(ptr, x, mem)
  9972  		return true
  9973  	}
  9974  	// match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
  9975  	// result: (MOVHstore [off] {sym} ptr x mem)
  9976  	for {
  9977  		off := auxIntToInt32(v.AuxInt)
  9978  		sym := auxToSym(v.Aux)
  9979  		ptr := v_0
  9980  		if v_1.Op != OpPPC64MOVWreg {
  9981  			break
  9982  		}
  9983  		x := v_1.Args[0]
  9984  		mem := v_2
  9985  		v.reset(OpPPC64MOVHstore)
  9986  		v.AuxInt = int32ToAuxInt(off)
  9987  		v.Aux = symToAux(sym)
  9988  		v.AddArg3(ptr, x, mem)
  9989  		return true
  9990  	}
  9991  	// match: (MOVHstore [off] {sym} ptr (MOVWZreg x) mem)
  9992  	// result: (MOVHstore [off] {sym} ptr x mem)
  9993  	for {
  9994  		off := auxIntToInt32(v.AuxInt)
  9995  		sym := auxToSym(v.Aux)
  9996  		ptr := v_0
  9997  		if v_1.Op != OpPPC64MOVWZreg {
  9998  			break
  9999  		}
 10000  		x := v_1.Args[0]
 10001  		mem := v_2
 10002  		v.reset(OpPPC64MOVHstore)
 10003  		v.AuxInt = int32ToAuxInt(off)
 10004  		v.Aux = symToAux(sym)
 10005  		v.AddArg3(ptr, x, mem)
 10006  		return true
 10007  	}
 10008  	// match: (MOVHstore [off] {sym} ptr r:(BRH val) mem)
 10009  	// cond: r.Uses == 1
 10010  	// result: (MOVHBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
 10011  	for {
 10012  		off := auxIntToInt32(v.AuxInt)
 10013  		sym := auxToSym(v.Aux)
 10014  		ptr := v_0
 10015  		r := v_1
 10016  		if r.Op != OpPPC64BRH {
 10017  			break
 10018  		}
 10019  		val := r.Args[0]
 10020  		mem := v_2
 10021  		if !(r.Uses == 1) {
 10022  			break
 10023  		}
 10024  		v.reset(OpPPC64MOVHBRstore)
 10025  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
 10026  		v0.AuxInt = int32ToAuxInt(off)
 10027  		v0.Aux = symToAux(sym)
 10028  		v0.AddArg(ptr)
 10029  		v.AddArg3(v0, val, mem)
 10030  		return true
 10031  	}
 10032  	// match: (MOVHstore [off] {sym} ptr (Bswap16 val) mem)
 10033  	// result: (MOVHBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
 10034  	for {
 10035  		off := auxIntToInt32(v.AuxInt)
 10036  		sym := auxToSym(v.Aux)
 10037  		ptr := v_0
 10038  		if v_1.Op != OpBswap16 {
 10039  			break
 10040  		}
 10041  		val := v_1.Args[0]
 10042  		mem := v_2
 10043  		v.reset(OpPPC64MOVHBRstore)
 10044  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
 10045  		v0.AuxInt = int32ToAuxInt(off)
 10046  		v0.Aux = symToAux(sym)
 10047  		v0.AddArg(ptr)
 10048  		v.AddArg3(v0, val, mem)
 10049  		return true
 10050  	}
 10051  	return false
 10052  }
 10053  func rewriteValuePPC64_OpPPC64MOVHstoreidx(v *Value) bool {
 10054  	v_3 := v.Args[3]
 10055  	v_2 := v.Args[2]
 10056  	v_1 := v.Args[1]
 10057  	v_0 := v.Args[0]
 10058  	// match: (MOVHstoreidx ptr (MOVDconst [c]) val mem)
 10059  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10060  	// result: (MOVHstore [int32(c)] ptr val mem)
 10061  	for {
 10062  		ptr := v_0
 10063  		if v_1.Op != OpPPC64MOVDconst {
 10064  			break
 10065  		}
 10066  		c := auxIntToInt64(v_1.AuxInt)
 10067  		val := v_2
 10068  		mem := v_3
 10069  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10070  			break
 10071  		}
 10072  		v.reset(OpPPC64MOVHstore)
 10073  		v.AuxInt = int32ToAuxInt(int32(c))
 10074  		v.AddArg3(ptr, val, mem)
 10075  		return true
 10076  	}
 10077  	// match: (MOVHstoreidx (MOVDconst [c]) ptr val mem)
 10078  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10079  	// result: (MOVHstore [int32(c)] ptr val mem)
 10080  	for {
 10081  		if v_0.Op != OpPPC64MOVDconst {
 10082  			break
 10083  		}
 10084  		c := auxIntToInt64(v_0.AuxInt)
 10085  		ptr := v_1
 10086  		val := v_2
 10087  		mem := v_3
 10088  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10089  			break
 10090  		}
 10091  		v.reset(OpPPC64MOVHstore)
 10092  		v.AuxInt = int32ToAuxInt(int32(c))
 10093  		v.AddArg3(ptr, val, mem)
 10094  		return true
 10095  	}
 10096  	// match: (MOVHstoreidx ptr idx (MOVHreg x) mem)
 10097  	// result: (MOVHstoreidx ptr idx x mem)
 10098  	for {
 10099  		ptr := v_0
 10100  		idx := v_1
 10101  		if v_2.Op != OpPPC64MOVHreg {
 10102  			break
 10103  		}
 10104  		x := v_2.Args[0]
 10105  		mem := v_3
 10106  		v.reset(OpPPC64MOVHstoreidx)
 10107  		v.AddArg4(ptr, idx, x, mem)
 10108  		return true
 10109  	}
 10110  	// match: (MOVHstoreidx ptr idx (MOVHZreg x) mem)
 10111  	// result: (MOVHstoreidx ptr idx x mem)
 10112  	for {
 10113  		ptr := v_0
 10114  		idx := v_1
 10115  		if v_2.Op != OpPPC64MOVHZreg {
 10116  			break
 10117  		}
 10118  		x := v_2.Args[0]
 10119  		mem := v_3
 10120  		v.reset(OpPPC64MOVHstoreidx)
 10121  		v.AddArg4(ptr, idx, x, mem)
 10122  		return true
 10123  	}
 10124  	// match: (MOVHstoreidx ptr idx (MOVWreg x) mem)
 10125  	// result: (MOVHstoreidx ptr idx x mem)
 10126  	for {
 10127  		ptr := v_0
 10128  		idx := v_1
 10129  		if v_2.Op != OpPPC64MOVWreg {
 10130  			break
 10131  		}
 10132  		x := v_2.Args[0]
 10133  		mem := v_3
 10134  		v.reset(OpPPC64MOVHstoreidx)
 10135  		v.AddArg4(ptr, idx, x, mem)
 10136  		return true
 10137  	}
 10138  	// match: (MOVHstoreidx ptr idx (MOVWZreg x) mem)
 10139  	// result: (MOVHstoreidx ptr idx x mem)
 10140  	for {
 10141  		ptr := v_0
 10142  		idx := v_1
 10143  		if v_2.Op != OpPPC64MOVWZreg {
 10144  			break
 10145  		}
 10146  		x := v_2.Args[0]
 10147  		mem := v_3
 10148  		v.reset(OpPPC64MOVHstoreidx)
 10149  		v.AddArg4(ptr, idx, x, mem)
 10150  		return true
 10151  	}
 10152  	// match: (MOVHstoreidx ptr idx r:(BRH val) mem)
 10153  	// cond: r.Uses == 1
 10154  	// result: (MOVHBRstoreidx ptr idx val mem)
 10155  	for {
 10156  		ptr := v_0
 10157  		idx := v_1
 10158  		r := v_2
 10159  		if r.Op != OpPPC64BRH {
 10160  			break
 10161  		}
 10162  		val := r.Args[0]
 10163  		mem := v_3
 10164  		if !(r.Uses == 1) {
 10165  			break
 10166  		}
 10167  		v.reset(OpPPC64MOVHBRstoreidx)
 10168  		v.AddArg4(ptr, idx, val, mem)
 10169  		return true
 10170  	}
 10171  	// match: (MOVHstoreidx ptr idx (Bswap16 val) mem)
 10172  	// result: (MOVHBRstoreidx ptr idx val mem)
 10173  	for {
 10174  		ptr := v_0
 10175  		idx := v_1
 10176  		if v_2.Op != OpBswap16 {
 10177  			break
 10178  		}
 10179  		val := v_2.Args[0]
 10180  		mem := v_3
 10181  		v.reset(OpPPC64MOVHBRstoreidx)
 10182  		v.AddArg4(ptr, idx, val, mem)
 10183  		return true
 10184  	}
 10185  	return false
 10186  }
 10187  func rewriteValuePPC64_OpPPC64MOVHstorezero(v *Value) bool {
 10188  	v_1 := v.Args[1]
 10189  	v_0 := v.Args[0]
 10190  	// match: (MOVHstorezero [off1] {sym} (ADDconst [off2] x) mem)
 10191  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
 10192  	// result: (MOVHstorezero [off1+int32(off2)] {sym} x mem)
 10193  	for {
 10194  		off1 := auxIntToInt32(v.AuxInt)
 10195  		sym := auxToSym(v.Aux)
 10196  		if v_0.Op != OpPPC64ADDconst {
 10197  			break
 10198  		}
 10199  		off2 := auxIntToInt64(v_0.AuxInt)
 10200  		x := v_0.Args[0]
 10201  		mem := v_1
 10202  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
 10203  			break
 10204  		}
 10205  		v.reset(OpPPC64MOVHstorezero)
 10206  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10207  		v.Aux = symToAux(sym)
 10208  		v.AddArg2(x, mem)
 10209  		return true
 10210  	}
 10211  	// match: (MOVHstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
 10212  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10213  	// result: (MOVHstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
 10214  	for {
 10215  		off1 := auxIntToInt32(v.AuxInt)
 10216  		sym1 := auxToSym(v.Aux)
 10217  		p := v_0
 10218  		if p.Op != OpPPC64MOVDaddr {
 10219  			break
 10220  		}
 10221  		off2 := auxIntToInt32(p.AuxInt)
 10222  		sym2 := auxToSym(p.Aux)
 10223  		x := p.Args[0]
 10224  		mem := v_1
 10225  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10226  			break
 10227  		}
 10228  		v.reset(OpPPC64MOVHstorezero)
 10229  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10230  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10231  		v.AddArg2(x, mem)
 10232  		return true
 10233  	}
 10234  	return false
 10235  }
 10236  func rewriteValuePPC64_OpPPC64MOVWBRstore(v *Value) bool {
 10237  	v_2 := v.Args[2]
 10238  	v_1 := v.Args[1]
 10239  	v_0 := v.Args[0]
 10240  	// match: (MOVWBRstore ptr (MOVWreg x) mem)
 10241  	// result: (MOVWBRstore ptr x mem)
 10242  	for {
 10243  		ptr := v_0
 10244  		if v_1.Op != OpPPC64MOVWreg {
 10245  			break
 10246  		}
 10247  		x := v_1.Args[0]
 10248  		mem := v_2
 10249  		v.reset(OpPPC64MOVWBRstore)
 10250  		v.AddArg3(ptr, x, mem)
 10251  		return true
 10252  	}
 10253  	// match: (MOVWBRstore ptr (MOVWZreg x) mem)
 10254  	// result: (MOVWBRstore ptr x mem)
 10255  	for {
 10256  		ptr := v_0
 10257  		if v_1.Op != OpPPC64MOVWZreg {
 10258  			break
 10259  		}
 10260  		x := v_1.Args[0]
 10261  		mem := v_2
 10262  		v.reset(OpPPC64MOVWBRstore)
 10263  		v.AddArg3(ptr, x, mem)
 10264  		return true
 10265  	}
 10266  	return false
 10267  }
 10268  func rewriteValuePPC64_OpPPC64MOVWZload(v *Value) bool {
 10269  	v_1 := v.Args[1]
 10270  	v_0 := v.Args[0]
 10271  	// match: (MOVWZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
 10272  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10273  	// result: (MOVWZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10274  	for {
 10275  		off1 := auxIntToInt32(v.AuxInt)
 10276  		sym1 := auxToSym(v.Aux)
 10277  		p := v_0
 10278  		if p.Op != OpPPC64MOVDaddr {
 10279  			break
 10280  		}
 10281  		off2 := auxIntToInt32(p.AuxInt)
 10282  		sym2 := auxToSym(p.Aux)
 10283  		ptr := p.Args[0]
 10284  		mem := v_1
 10285  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10286  			break
 10287  		}
 10288  		v.reset(OpPPC64MOVWZload)
 10289  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10290  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10291  		v.AddArg2(ptr, mem)
 10292  		return true
 10293  	}
 10294  	// match: (MOVWZload [off1] {sym} (ADDconst [off2] x) mem)
 10295  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 10296  	// result: (MOVWZload [off1+int32(off2)] {sym} x mem)
 10297  	for {
 10298  		off1 := auxIntToInt32(v.AuxInt)
 10299  		sym := auxToSym(v.Aux)
 10300  		if v_0.Op != OpPPC64ADDconst {
 10301  			break
 10302  		}
 10303  		off2 := auxIntToInt64(v_0.AuxInt)
 10304  		x := v_0.Args[0]
 10305  		mem := v_1
 10306  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 10307  			break
 10308  		}
 10309  		v.reset(OpPPC64MOVWZload)
 10310  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10311  		v.Aux = symToAux(sym)
 10312  		v.AddArg2(x, mem)
 10313  		return true
 10314  	}
 10315  	// match: (MOVWZload [0] {sym} p:(ADD ptr idx) mem)
 10316  	// cond: sym == nil && p.Uses == 1
 10317  	// result: (MOVWZloadidx ptr idx mem)
 10318  	for {
 10319  		if auxIntToInt32(v.AuxInt) != 0 {
 10320  			break
 10321  		}
 10322  		sym := auxToSym(v.Aux)
 10323  		p := v_0
 10324  		if p.Op != OpPPC64ADD {
 10325  			break
 10326  		}
 10327  		idx := p.Args[1]
 10328  		ptr := p.Args[0]
 10329  		mem := v_1
 10330  		if !(sym == nil && p.Uses == 1) {
 10331  			break
 10332  		}
 10333  		v.reset(OpPPC64MOVWZloadidx)
 10334  		v.AddArg3(ptr, idx, mem)
 10335  		return true
 10336  	}
 10337  	return false
 10338  }
 10339  func rewriteValuePPC64_OpPPC64MOVWZloadidx(v *Value) bool {
 10340  	v_2 := v.Args[2]
 10341  	v_1 := v.Args[1]
 10342  	v_0 := v.Args[0]
 10343  	// match: (MOVWZloadidx ptr (MOVDconst [c]) mem)
 10344  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10345  	// result: (MOVWZload [int32(c)] ptr mem)
 10346  	for {
 10347  		ptr := v_0
 10348  		if v_1.Op != OpPPC64MOVDconst {
 10349  			break
 10350  		}
 10351  		c := auxIntToInt64(v_1.AuxInt)
 10352  		mem := v_2
 10353  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10354  			break
 10355  		}
 10356  		v.reset(OpPPC64MOVWZload)
 10357  		v.AuxInt = int32ToAuxInt(int32(c))
 10358  		v.AddArg2(ptr, mem)
 10359  		return true
 10360  	}
 10361  	// match: (MOVWZloadidx (MOVDconst [c]) ptr mem)
 10362  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10363  	// result: (MOVWZload [int32(c)] ptr mem)
 10364  	for {
 10365  		if v_0.Op != OpPPC64MOVDconst {
 10366  			break
 10367  		}
 10368  		c := auxIntToInt64(v_0.AuxInt)
 10369  		ptr := v_1
 10370  		mem := v_2
 10371  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10372  			break
 10373  		}
 10374  		v.reset(OpPPC64MOVWZload)
 10375  		v.AuxInt = int32ToAuxInt(int32(c))
 10376  		v.AddArg2(ptr, mem)
 10377  		return true
 10378  	}
 10379  	return false
 10380  }
 10381  func rewriteValuePPC64_OpPPC64MOVWZreg(v *Value) bool {
 10382  	v_0 := v.Args[0]
 10383  	b := v.Block
 10384  	typ := &b.Func.Config.Types
 10385  	// match: (MOVWZreg y:(ANDconst [c] _))
 10386  	// cond: uint64(c) <= 0xFFFFFFFF
 10387  	// result: y
 10388  	for {
 10389  		y := v_0
 10390  		if y.Op != OpPPC64ANDconst {
 10391  			break
 10392  		}
 10393  		c := auxIntToInt64(y.AuxInt)
 10394  		if !(uint64(c) <= 0xFFFFFFFF) {
 10395  			break
 10396  		}
 10397  		v.copyOf(y)
 10398  		return true
 10399  	}
 10400  	// match: (MOVWZreg y:(AND (MOVDconst [c]) _))
 10401  	// cond: uint64(c) <= 0xFFFFFFFF
 10402  	// result: y
 10403  	for {
 10404  		y := v_0
 10405  		if y.Op != OpPPC64AND {
 10406  			break
 10407  		}
 10408  		y_0 := y.Args[0]
 10409  		y_1 := y.Args[1]
 10410  		for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
 10411  			if y_0.Op != OpPPC64MOVDconst {
 10412  				continue
 10413  			}
 10414  			c := auxIntToInt64(y_0.AuxInt)
 10415  			if !(uint64(c) <= 0xFFFFFFFF) {
 10416  				continue
 10417  			}
 10418  			v.copyOf(y)
 10419  			return true
 10420  		}
 10421  		break
 10422  	}
 10423  	// match: (MOVWZreg (SRWconst [c] (MOVBZreg x)))
 10424  	// result: (SRWconst [c] (MOVBZreg x))
 10425  	for {
 10426  		if v_0.Op != OpPPC64SRWconst {
 10427  			break
 10428  		}
 10429  		c := auxIntToInt64(v_0.AuxInt)
 10430  		v_0_0 := v_0.Args[0]
 10431  		if v_0_0.Op != OpPPC64MOVBZreg {
 10432  			break
 10433  		}
 10434  		x := v_0_0.Args[0]
 10435  		v.reset(OpPPC64SRWconst)
 10436  		v.AuxInt = int64ToAuxInt(c)
 10437  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 10438  		v0.AddArg(x)
 10439  		v.AddArg(v0)
 10440  		return true
 10441  	}
 10442  	// match: (MOVWZreg (SRWconst [c] (MOVHZreg x)))
 10443  	// result: (SRWconst [c] (MOVHZreg x))
 10444  	for {
 10445  		if v_0.Op != OpPPC64SRWconst {
 10446  			break
 10447  		}
 10448  		c := auxIntToInt64(v_0.AuxInt)
 10449  		v_0_0 := v_0.Args[0]
 10450  		if v_0_0.Op != OpPPC64MOVHZreg {
 10451  			break
 10452  		}
 10453  		x := v_0_0.Args[0]
 10454  		v.reset(OpPPC64SRWconst)
 10455  		v.AuxInt = int64ToAuxInt(c)
 10456  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 10457  		v0.AddArg(x)
 10458  		v.AddArg(v0)
 10459  		return true
 10460  	}
 10461  	// match: (MOVWZreg (SRWconst [c] (MOVWZreg x)))
 10462  	// result: (SRWconst [c] (MOVWZreg x))
 10463  	for {
 10464  		if v_0.Op != OpPPC64SRWconst {
 10465  			break
 10466  		}
 10467  		c := auxIntToInt64(v_0.AuxInt)
 10468  		v_0_0 := v_0.Args[0]
 10469  		if v_0_0.Op != OpPPC64MOVWZreg {
 10470  			break
 10471  		}
 10472  		x := v_0_0.Args[0]
 10473  		v.reset(OpPPC64SRWconst)
 10474  		v.AuxInt = int64ToAuxInt(c)
 10475  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
 10476  		v0.AddArg(x)
 10477  		v.AddArg(v0)
 10478  		return true
 10479  	}
 10480  	// match: (MOVWZreg (SRWconst [c] x))
 10481  	// cond: x.Type.Size() <= 32
 10482  	// result: (SRWconst [c] x)
 10483  	for {
 10484  		if v_0.Op != OpPPC64SRWconst {
 10485  			break
 10486  		}
 10487  		c := auxIntToInt64(v_0.AuxInt)
 10488  		x := v_0.Args[0]
 10489  		if !(x.Type.Size() <= 32) {
 10490  			break
 10491  		}
 10492  		v.reset(OpPPC64SRWconst)
 10493  		v.AuxInt = int64ToAuxInt(c)
 10494  		v.AddArg(x)
 10495  		return true
 10496  	}
 10497  	// match: (MOVWZreg (SRDconst [c] x))
 10498  	// cond: c>=32
 10499  	// result: (SRDconst [c] x)
 10500  	for {
 10501  		if v_0.Op != OpPPC64SRDconst {
 10502  			break
 10503  		}
 10504  		c := auxIntToInt64(v_0.AuxInt)
 10505  		x := v_0.Args[0]
 10506  		if !(c >= 32) {
 10507  			break
 10508  		}
 10509  		v.reset(OpPPC64SRDconst)
 10510  		v.AuxInt = int64ToAuxInt(c)
 10511  		v.AddArg(x)
 10512  		return true
 10513  	}
 10514  	// match: (MOVWZreg (RLWINM [r] y))
 10515  	// cond: mergePPC64MovwzregRlwinm(r) != 0
 10516  	// result: (RLWINM [mergePPC64MovwzregRlwinm(r)] y)
 10517  	for {
 10518  		if v_0.Op != OpPPC64RLWINM {
 10519  			break
 10520  		}
 10521  		r := auxIntToInt64(v_0.AuxInt)
 10522  		y := v_0.Args[0]
 10523  		if !(mergePPC64MovwzregRlwinm(r) != 0) {
 10524  			break
 10525  		}
 10526  		v.reset(OpPPC64RLWINM)
 10527  		v.AuxInt = int64ToAuxInt(mergePPC64MovwzregRlwinm(r))
 10528  		v.AddArg(y)
 10529  		return true
 10530  	}
 10531  	// match: (MOVWZreg w:(SLWconst u))
 10532  	// result: w
 10533  	for {
 10534  		w := v_0
 10535  		if w.Op != OpPPC64SLWconst {
 10536  			break
 10537  		}
 10538  		v.copyOf(w)
 10539  		return true
 10540  	}
 10541  	// match: (MOVWZreg y:(MOVWZreg _))
 10542  	// result: y
 10543  	for {
 10544  		y := v_0
 10545  		if y.Op != OpPPC64MOVWZreg {
 10546  			break
 10547  		}
 10548  		v.copyOf(y)
 10549  		return true
 10550  	}
 10551  	// match: (MOVWZreg y:(MOVHZreg _))
 10552  	// result: y
 10553  	for {
 10554  		y := v_0
 10555  		if y.Op != OpPPC64MOVHZreg {
 10556  			break
 10557  		}
 10558  		v.copyOf(y)
 10559  		return true
 10560  	}
 10561  	// match: (MOVWZreg y:(MOVBZreg _))
 10562  	// result: y
 10563  	for {
 10564  		y := v_0
 10565  		if y.Op != OpPPC64MOVBZreg {
 10566  			break
 10567  		}
 10568  		v.copyOf(y)
 10569  		return true
 10570  	}
 10571  	// match: (MOVWZreg y:(MOVHBRload _ _))
 10572  	// result: y
 10573  	for {
 10574  		y := v_0
 10575  		if y.Op != OpPPC64MOVHBRload {
 10576  			break
 10577  		}
 10578  		v.copyOf(y)
 10579  		return true
 10580  	}
 10581  	// match: (MOVWZreg y:(MOVWBRload _ _))
 10582  	// result: y
 10583  	for {
 10584  		y := v_0
 10585  		if y.Op != OpPPC64MOVWBRload {
 10586  			break
 10587  		}
 10588  		v.copyOf(y)
 10589  		return true
 10590  	}
 10591  	// match: (MOVWZreg y:(MOVWreg x))
 10592  	// result: (MOVWZreg x)
 10593  	for {
 10594  		y := v_0
 10595  		if y.Op != OpPPC64MOVWreg {
 10596  			break
 10597  		}
 10598  		x := y.Args[0]
 10599  		v.reset(OpPPC64MOVWZreg)
 10600  		v.AddArg(x)
 10601  		return true
 10602  	}
 10603  	// match: (MOVWZreg (OR <t> x (MOVWZreg y)))
 10604  	// result: (MOVWZreg (OR <t> x y))
 10605  	for {
 10606  		if v_0.Op != OpPPC64OR {
 10607  			break
 10608  		}
 10609  		t := v_0.Type
 10610  		_ = v_0.Args[1]
 10611  		v_0_0 := v_0.Args[0]
 10612  		v_0_1 := v_0.Args[1]
 10613  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10614  			x := v_0_0
 10615  			if v_0_1.Op != OpPPC64MOVWZreg {
 10616  				continue
 10617  			}
 10618  			y := v_0_1.Args[0]
 10619  			v.reset(OpPPC64MOVWZreg)
 10620  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
 10621  			v0.AddArg2(x, y)
 10622  			v.AddArg(v0)
 10623  			return true
 10624  		}
 10625  		break
 10626  	}
 10627  	// match: (MOVWZreg (XOR <t> x (MOVWZreg y)))
 10628  	// result: (MOVWZreg (XOR <t> x y))
 10629  	for {
 10630  		if v_0.Op != OpPPC64XOR {
 10631  			break
 10632  		}
 10633  		t := v_0.Type
 10634  		_ = v_0.Args[1]
 10635  		v_0_0 := v_0.Args[0]
 10636  		v_0_1 := v_0.Args[1]
 10637  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10638  			x := v_0_0
 10639  			if v_0_1.Op != OpPPC64MOVWZreg {
 10640  				continue
 10641  			}
 10642  			y := v_0_1.Args[0]
 10643  			v.reset(OpPPC64MOVWZreg)
 10644  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
 10645  			v0.AddArg2(x, y)
 10646  			v.AddArg(v0)
 10647  			return true
 10648  		}
 10649  		break
 10650  	}
 10651  	// match: (MOVWZreg (AND <t> x (MOVWZreg y)))
 10652  	// result: (MOVWZreg (AND <t> x y))
 10653  	for {
 10654  		if v_0.Op != OpPPC64AND {
 10655  			break
 10656  		}
 10657  		t := v_0.Type
 10658  		_ = v_0.Args[1]
 10659  		v_0_0 := v_0.Args[0]
 10660  		v_0_1 := v_0.Args[1]
 10661  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10662  			x := v_0_0
 10663  			if v_0_1.Op != OpPPC64MOVWZreg {
 10664  				continue
 10665  			}
 10666  			y := v_0_1.Args[0]
 10667  			v.reset(OpPPC64MOVWZreg)
 10668  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
 10669  			v0.AddArg2(x, y)
 10670  			v.AddArg(v0)
 10671  			return true
 10672  		}
 10673  		break
 10674  	}
 10675  	// match: (MOVWZreg z:(ANDconst [c] (MOVBZload ptr x)))
 10676  	// result: z
 10677  	for {
 10678  		z := v_0
 10679  		if z.Op != OpPPC64ANDconst {
 10680  			break
 10681  		}
 10682  		z_0 := z.Args[0]
 10683  		if z_0.Op != OpPPC64MOVBZload {
 10684  			break
 10685  		}
 10686  		v.copyOf(z)
 10687  		return true
 10688  	}
 10689  	// match: (MOVWZreg z:(AND y (MOVWZload ptr x)))
 10690  	// result: z
 10691  	for {
 10692  		z := v_0
 10693  		if z.Op != OpPPC64AND {
 10694  			break
 10695  		}
 10696  		_ = z.Args[1]
 10697  		z_0 := z.Args[0]
 10698  		z_1 := z.Args[1]
 10699  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 10700  			if z_1.Op != OpPPC64MOVWZload {
 10701  				continue
 10702  			}
 10703  			v.copyOf(z)
 10704  			return true
 10705  		}
 10706  		break
 10707  	}
 10708  	// match: (MOVWZreg z:(ANDconst [c] (MOVHZload ptr x)))
 10709  	// result: z
 10710  	for {
 10711  		z := v_0
 10712  		if z.Op != OpPPC64ANDconst {
 10713  			break
 10714  		}
 10715  		z_0 := z.Args[0]
 10716  		if z_0.Op != OpPPC64MOVHZload {
 10717  			break
 10718  		}
 10719  		v.copyOf(z)
 10720  		return true
 10721  	}
 10722  	// match: (MOVWZreg z:(ANDconst [c] (MOVWZload ptr x)))
 10723  	// result: z
 10724  	for {
 10725  		z := v_0
 10726  		if z.Op != OpPPC64ANDconst {
 10727  			break
 10728  		}
 10729  		z_0 := z.Args[0]
 10730  		if z_0.Op != OpPPC64MOVWZload {
 10731  			break
 10732  		}
 10733  		v.copyOf(z)
 10734  		return true
 10735  	}
 10736  	// match: (MOVWZreg x:(MOVBZload _ _))
 10737  	// result: x
 10738  	for {
 10739  		x := v_0
 10740  		if x.Op != OpPPC64MOVBZload {
 10741  			break
 10742  		}
 10743  		v.copyOf(x)
 10744  		return true
 10745  	}
 10746  	// match: (MOVWZreg x:(MOVBZloadidx _ _ _))
 10747  	// result: x
 10748  	for {
 10749  		x := v_0
 10750  		if x.Op != OpPPC64MOVBZloadidx {
 10751  			break
 10752  		}
 10753  		v.copyOf(x)
 10754  		return true
 10755  	}
 10756  	// match: (MOVWZreg x:(MOVHZload _ _))
 10757  	// result: x
 10758  	for {
 10759  		x := v_0
 10760  		if x.Op != OpPPC64MOVHZload {
 10761  			break
 10762  		}
 10763  		v.copyOf(x)
 10764  		return true
 10765  	}
 10766  	// match: (MOVWZreg x:(MOVHZloadidx _ _ _))
 10767  	// result: x
 10768  	for {
 10769  		x := v_0
 10770  		if x.Op != OpPPC64MOVHZloadidx {
 10771  			break
 10772  		}
 10773  		v.copyOf(x)
 10774  		return true
 10775  	}
 10776  	// match: (MOVWZreg x:(MOVWZload _ _))
 10777  	// result: x
 10778  	for {
 10779  		x := v_0
 10780  		if x.Op != OpPPC64MOVWZload {
 10781  			break
 10782  		}
 10783  		v.copyOf(x)
 10784  		return true
 10785  	}
 10786  	// match: (MOVWZreg x:(MOVWZloadidx _ _ _))
 10787  	// result: x
 10788  	for {
 10789  		x := v_0
 10790  		if x.Op != OpPPC64MOVWZloadidx {
 10791  			break
 10792  		}
 10793  		v.copyOf(x)
 10794  		return true
 10795  	}
 10796  	// match: (MOVWZreg x:(Select0 (LoweredAtomicLoad32 _ _)))
 10797  	// result: x
 10798  	for {
 10799  		x := v_0
 10800  		if x.Op != OpSelect0 {
 10801  			break
 10802  		}
 10803  		x_0 := x.Args[0]
 10804  		if x_0.Op != OpPPC64LoweredAtomicLoad32 {
 10805  			break
 10806  		}
 10807  		v.copyOf(x)
 10808  		return true
 10809  	}
 10810  	// match: (MOVWZreg x:(Arg <t>))
 10811  	// cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()
 10812  	// result: x
 10813  	for {
 10814  		x := v_0
 10815  		if x.Op != OpArg {
 10816  			break
 10817  		}
 10818  		t := x.Type
 10819  		if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()) {
 10820  			break
 10821  		}
 10822  		v.copyOf(x)
 10823  		return true
 10824  	}
 10825  	// match: (MOVWZreg (MOVDconst [c]))
 10826  	// result: (MOVDconst [int64(uint32(c))])
 10827  	for {
 10828  		if v_0.Op != OpPPC64MOVDconst {
 10829  			break
 10830  		}
 10831  		c := auxIntToInt64(v_0.AuxInt)
 10832  		v.reset(OpPPC64MOVDconst)
 10833  		v.AuxInt = int64ToAuxInt(int64(uint32(c)))
 10834  		return true
 10835  	}
 10836  	return false
 10837  }
 10838  func rewriteValuePPC64_OpPPC64MOVWload(v *Value) bool {
 10839  	v_1 := v.Args[1]
 10840  	v_0 := v.Args[0]
 10841  	// match: (MOVWload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
 10842  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10843  	// result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10844  	for {
 10845  		off1 := auxIntToInt32(v.AuxInt)
 10846  		sym1 := auxToSym(v.Aux)
 10847  		p := v_0
 10848  		if p.Op != OpPPC64MOVDaddr {
 10849  			break
 10850  		}
 10851  		off2 := auxIntToInt32(p.AuxInt)
 10852  		sym2 := auxToSym(p.Aux)
 10853  		ptr := p.Args[0]
 10854  		mem := v_1
 10855  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10856  			break
 10857  		}
 10858  		v.reset(OpPPC64MOVWload)
 10859  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10860  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10861  		v.AddArg2(ptr, mem)
 10862  		return true
 10863  	}
 10864  	// match: (MOVWload [off1] {sym} (ADDconst [off2] x) mem)
 10865  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 10866  	// result: (MOVWload [off1+int32(off2)] {sym} x mem)
 10867  	for {
 10868  		off1 := auxIntToInt32(v.AuxInt)
 10869  		sym := auxToSym(v.Aux)
 10870  		if v_0.Op != OpPPC64ADDconst {
 10871  			break
 10872  		}
 10873  		off2 := auxIntToInt64(v_0.AuxInt)
 10874  		x := v_0.Args[0]
 10875  		mem := v_1
 10876  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 10877  			break
 10878  		}
 10879  		v.reset(OpPPC64MOVWload)
 10880  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10881  		v.Aux = symToAux(sym)
 10882  		v.AddArg2(x, mem)
 10883  		return true
 10884  	}
 10885  	// match: (MOVWload [0] {sym} p:(ADD ptr idx) mem)
 10886  	// cond: sym == nil && p.Uses == 1
 10887  	// result: (MOVWloadidx ptr idx mem)
 10888  	for {
 10889  		if auxIntToInt32(v.AuxInt) != 0 {
 10890  			break
 10891  		}
 10892  		sym := auxToSym(v.Aux)
 10893  		p := v_0
 10894  		if p.Op != OpPPC64ADD {
 10895  			break
 10896  		}
 10897  		idx := p.Args[1]
 10898  		ptr := p.Args[0]
 10899  		mem := v_1
 10900  		if !(sym == nil && p.Uses == 1) {
 10901  			break
 10902  		}
 10903  		v.reset(OpPPC64MOVWloadidx)
 10904  		v.AddArg3(ptr, idx, mem)
 10905  		return true
 10906  	}
 10907  	return false
 10908  }
 10909  func rewriteValuePPC64_OpPPC64MOVWloadidx(v *Value) bool {
 10910  	v_2 := v.Args[2]
 10911  	v_1 := v.Args[1]
 10912  	v_0 := v.Args[0]
 10913  	// match: (MOVWloadidx ptr (MOVDconst [c]) mem)
 10914  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10915  	// result: (MOVWload [int32(c)] ptr mem)
 10916  	for {
 10917  		ptr := v_0
 10918  		if v_1.Op != OpPPC64MOVDconst {
 10919  			break
 10920  		}
 10921  		c := auxIntToInt64(v_1.AuxInt)
 10922  		mem := v_2
 10923  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10924  			break
 10925  		}
 10926  		v.reset(OpPPC64MOVWload)
 10927  		v.AuxInt = int32ToAuxInt(int32(c))
 10928  		v.AddArg2(ptr, mem)
 10929  		return true
 10930  	}
 10931  	// match: (MOVWloadidx (MOVDconst [c]) ptr mem)
 10932  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10933  	// result: (MOVWload [int32(c)] ptr mem)
 10934  	for {
 10935  		if v_0.Op != OpPPC64MOVDconst {
 10936  			break
 10937  		}
 10938  		c := auxIntToInt64(v_0.AuxInt)
 10939  		ptr := v_1
 10940  		mem := v_2
 10941  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10942  			break
 10943  		}
 10944  		v.reset(OpPPC64MOVWload)
 10945  		v.AuxInt = int32ToAuxInt(int32(c))
 10946  		v.AddArg2(ptr, mem)
 10947  		return true
 10948  	}
 10949  	return false
 10950  }
 10951  func rewriteValuePPC64_OpPPC64MOVWreg(v *Value) bool {
 10952  	v_0 := v.Args[0]
 10953  	b := v.Block
 10954  	typ := &b.Func.Config.Types
 10955  	// match: (MOVWreg y:(ANDconst [c] _))
 10956  	// cond: uint64(c) <= 0xFFFF
 10957  	// result: y
 10958  	for {
 10959  		y := v_0
 10960  		if y.Op != OpPPC64ANDconst {
 10961  			break
 10962  		}
 10963  		c := auxIntToInt64(y.AuxInt)
 10964  		if !(uint64(c) <= 0xFFFF) {
 10965  			break
 10966  		}
 10967  		v.copyOf(y)
 10968  		return true
 10969  	}
 10970  	// match: (MOVWreg y:(AND (MOVDconst [c]) _))
 10971  	// cond: uint64(c) <= 0x7FFFFFFF
 10972  	// result: y
 10973  	for {
 10974  		y := v_0
 10975  		if y.Op != OpPPC64AND {
 10976  			break
 10977  		}
 10978  		y_0 := y.Args[0]
 10979  		y_1 := y.Args[1]
 10980  		for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
 10981  			if y_0.Op != OpPPC64MOVDconst {
 10982  				continue
 10983  			}
 10984  			c := auxIntToInt64(y_0.AuxInt)
 10985  			if !(uint64(c) <= 0x7FFFFFFF) {
 10986  				continue
 10987  			}
 10988  			v.copyOf(y)
 10989  			return true
 10990  		}
 10991  		break
 10992  	}
 10993  	// match: (MOVWreg (SRAWconst [c] (MOVBreg x)))
 10994  	// result: (SRAWconst [c] (MOVBreg x))
 10995  	for {
 10996  		if v_0.Op != OpPPC64SRAWconst {
 10997  			break
 10998  		}
 10999  		c := auxIntToInt64(v_0.AuxInt)
 11000  		v_0_0 := v_0.Args[0]
 11001  		if v_0_0.Op != OpPPC64MOVBreg {
 11002  			break
 11003  		}
 11004  		x := v_0_0.Args[0]
 11005  		v.reset(OpPPC64SRAWconst)
 11006  		v.AuxInt = int64ToAuxInt(c)
 11007  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 11008  		v0.AddArg(x)
 11009  		v.AddArg(v0)
 11010  		return true
 11011  	}
 11012  	// match: (MOVWreg (SRAWconst [c] (MOVHreg x)))
 11013  	// result: (SRAWconst [c] (MOVHreg x))
 11014  	for {
 11015  		if v_0.Op != OpPPC64SRAWconst {
 11016  			break
 11017  		}
 11018  		c := auxIntToInt64(v_0.AuxInt)
 11019  		v_0_0 := v_0.Args[0]
 11020  		if v_0_0.Op != OpPPC64MOVHreg {
 11021  			break
 11022  		}
 11023  		x := v_0_0.Args[0]
 11024  		v.reset(OpPPC64SRAWconst)
 11025  		v.AuxInt = int64ToAuxInt(c)
 11026  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 11027  		v0.AddArg(x)
 11028  		v.AddArg(v0)
 11029  		return true
 11030  	}
 11031  	// match: (MOVWreg (SRAWconst [c] (MOVWreg x)))
 11032  	// result: (SRAWconst [c] (MOVWreg x))
 11033  	for {
 11034  		if v_0.Op != OpPPC64SRAWconst {
 11035  			break
 11036  		}
 11037  		c := auxIntToInt64(v_0.AuxInt)
 11038  		v_0_0 := v_0.Args[0]
 11039  		if v_0_0.Op != OpPPC64MOVWreg {
 11040  			break
 11041  		}
 11042  		x := v_0_0.Args[0]
 11043  		v.reset(OpPPC64SRAWconst)
 11044  		v.AuxInt = int64ToAuxInt(c)
 11045  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWreg, typ.Int64)
 11046  		v0.AddArg(x)
 11047  		v.AddArg(v0)
 11048  		return true
 11049  	}
 11050  	// match: (MOVWreg (SRAWconst [c] x))
 11051  	// cond: x.Type.Size() <= 32
 11052  	// result: (SRAWconst [c] x)
 11053  	for {
 11054  		if v_0.Op != OpPPC64SRAWconst {
 11055  			break
 11056  		}
 11057  		c := auxIntToInt64(v_0.AuxInt)
 11058  		x := v_0.Args[0]
 11059  		if !(x.Type.Size() <= 32) {
 11060  			break
 11061  		}
 11062  		v.reset(OpPPC64SRAWconst)
 11063  		v.AuxInt = int64ToAuxInt(c)
 11064  		v.AddArg(x)
 11065  		return true
 11066  	}
 11067  	// match: (MOVWreg (SRDconst [c] x))
 11068  	// cond: c>32
 11069  	// result: (SRDconst [c] x)
 11070  	for {
 11071  		if v_0.Op != OpPPC64SRDconst {
 11072  			break
 11073  		}
 11074  		c := auxIntToInt64(v_0.AuxInt)
 11075  		x := v_0.Args[0]
 11076  		if !(c > 32) {
 11077  			break
 11078  		}
 11079  		v.reset(OpPPC64SRDconst)
 11080  		v.AuxInt = int64ToAuxInt(c)
 11081  		v.AddArg(x)
 11082  		return true
 11083  	}
 11084  	// match: (MOVWreg (SRADconst [c] x))
 11085  	// cond: c>=32
 11086  	// result: (SRADconst [c] x)
 11087  	for {
 11088  		if v_0.Op != OpPPC64SRADconst {
 11089  			break
 11090  		}
 11091  		c := auxIntToInt64(v_0.AuxInt)
 11092  		x := v_0.Args[0]
 11093  		if !(c >= 32) {
 11094  			break
 11095  		}
 11096  		v.reset(OpPPC64SRADconst)
 11097  		v.AuxInt = int64ToAuxInt(c)
 11098  		v.AddArg(x)
 11099  		return true
 11100  	}
 11101  	// match: (MOVWreg (SRDconst [c] x))
 11102  	// cond: c==32
 11103  	// result: (SRADconst [c] x)
 11104  	for {
 11105  		if v_0.Op != OpPPC64SRDconst {
 11106  			break
 11107  		}
 11108  		c := auxIntToInt64(v_0.AuxInt)
 11109  		x := v_0.Args[0]
 11110  		if !(c == 32) {
 11111  			break
 11112  		}
 11113  		v.reset(OpPPC64SRADconst)
 11114  		v.AuxInt = int64ToAuxInt(c)
 11115  		v.AddArg(x)
 11116  		return true
 11117  	}
 11118  	// match: (MOVWreg y:(MOVWreg _))
 11119  	// result: y
 11120  	for {
 11121  		y := v_0
 11122  		if y.Op != OpPPC64MOVWreg {
 11123  			break
 11124  		}
 11125  		v.copyOf(y)
 11126  		return true
 11127  	}
 11128  	// match: (MOVWreg y:(MOVHreg _))
 11129  	// result: y
 11130  	for {
 11131  		y := v_0
 11132  		if y.Op != OpPPC64MOVHreg {
 11133  			break
 11134  		}
 11135  		v.copyOf(y)
 11136  		return true
 11137  	}
 11138  	// match: (MOVWreg y:(MOVBreg _))
 11139  	// result: y
 11140  	for {
 11141  		y := v_0
 11142  		if y.Op != OpPPC64MOVBreg {
 11143  			break
 11144  		}
 11145  		v.copyOf(y)
 11146  		return true
 11147  	}
 11148  	// match: (MOVWreg y:(MOVWZreg x))
 11149  	// result: (MOVWreg x)
 11150  	for {
 11151  		y := v_0
 11152  		if y.Op != OpPPC64MOVWZreg {
 11153  			break
 11154  		}
 11155  		x := y.Args[0]
 11156  		v.reset(OpPPC64MOVWreg)
 11157  		v.AddArg(x)
 11158  		return true
 11159  	}
 11160  	// match: (MOVWreg x:(MOVHload _ _))
 11161  	// result: x
 11162  	for {
 11163  		x := v_0
 11164  		if x.Op != OpPPC64MOVHload {
 11165  			break
 11166  		}
 11167  		v.copyOf(x)
 11168  		return true
 11169  	}
 11170  	// match: (MOVWreg x:(MOVHloadidx _ _ _))
 11171  	// result: x
 11172  	for {
 11173  		x := v_0
 11174  		if x.Op != OpPPC64MOVHloadidx {
 11175  			break
 11176  		}
 11177  		v.copyOf(x)
 11178  		return true
 11179  	}
 11180  	// match: (MOVWreg x:(MOVWload _ _))
 11181  	// result: x
 11182  	for {
 11183  		x := v_0
 11184  		if x.Op != OpPPC64MOVWload {
 11185  			break
 11186  		}
 11187  		v.copyOf(x)
 11188  		return true
 11189  	}
 11190  	// match: (MOVWreg x:(MOVWloadidx _ _ _))
 11191  	// result: x
 11192  	for {
 11193  		x := v_0
 11194  		if x.Op != OpPPC64MOVWloadidx {
 11195  			break
 11196  		}
 11197  		v.copyOf(x)
 11198  		return true
 11199  	}
 11200  	// match: (MOVWreg x:(Arg <t>))
 11201  	// cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()
 11202  	// result: x
 11203  	for {
 11204  		x := v_0
 11205  		if x.Op != OpArg {
 11206  			break
 11207  		}
 11208  		t := x.Type
 11209  		if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()) {
 11210  			break
 11211  		}
 11212  		v.copyOf(x)
 11213  		return true
 11214  	}
 11215  	// match: (MOVWreg (MOVDconst [c]))
 11216  	// result: (MOVDconst [int64(int32(c))])
 11217  	for {
 11218  		if v_0.Op != OpPPC64MOVDconst {
 11219  			break
 11220  		}
 11221  		c := auxIntToInt64(v_0.AuxInt)
 11222  		v.reset(OpPPC64MOVDconst)
 11223  		v.AuxInt = int64ToAuxInt(int64(int32(c)))
 11224  		return true
 11225  	}
 11226  	return false
 11227  }
 11228  func rewriteValuePPC64_OpPPC64MOVWstore(v *Value) bool {
 11229  	v_2 := v.Args[2]
 11230  	v_1 := v.Args[1]
 11231  	v_0 := v.Args[0]
 11232  	b := v.Block
 11233  	// match: (MOVWstore [off1] {sym} (ADDconst [off2] x) val mem)
 11234  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 11235  	// result: (MOVWstore [off1+int32(off2)] {sym} x val mem)
 11236  	for {
 11237  		off1 := auxIntToInt32(v.AuxInt)
 11238  		sym := auxToSym(v.Aux)
 11239  		if v_0.Op != OpPPC64ADDconst {
 11240  			break
 11241  		}
 11242  		off2 := auxIntToInt64(v_0.AuxInt)
 11243  		x := v_0.Args[0]
 11244  		val := v_1
 11245  		mem := v_2
 11246  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 11247  			break
 11248  		}
 11249  		v.reset(OpPPC64MOVWstore)
 11250  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11251  		v.Aux = symToAux(sym)
 11252  		v.AddArg3(x, val, mem)
 11253  		return true
 11254  	}
 11255  	// match: (MOVWstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
 11256  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 11257  	// result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
 11258  	for {
 11259  		off1 := auxIntToInt32(v.AuxInt)
 11260  		sym1 := auxToSym(v.Aux)
 11261  		p := v_0
 11262  		if p.Op != OpPPC64MOVDaddr {
 11263  			break
 11264  		}
 11265  		off2 := auxIntToInt32(p.AuxInt)
 11266  		sym2 := auxToSym(p.Aux)
 11267  		ptr := p.Args[0]
 11268  		val := v_1
 11269  		mem := v_2
 11270  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 11271  			break
 11272  		}
 11273  		v.reset(OpPPC64MOVWstore)
 11274  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11275  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11276  		v.AddArg3(ptr, val, mem)
 11277  		return true
 11278  	}
 11279  	// match: (MOVWstore [off] {sym} ptr (MOVDconst [0]) mem)
 11280  	// result: (MOVWstorezero [off] {sym} ptr mem)
 11281  	for {
 11282  		off := auxIntToInt32(v.AuxInt)
 11283  		sym := auxToSym(v.Aux)
 11284  		ptr := v_0
 11285  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
 11286  			break
 11287  		}
 11288  		mem := v_2
 11289  		v.reset(OpPPC64MOVWstorezero)
 11290  		v.AuxInt = int32ToAuxInt(off)
 11291  		v.Aux = symToAux(sym)
 11292  		v.AddArg2(ptr, mem)
 11293  		return true
 11294  	}
 11295  	// match: (MOVWstore [0] {sym} p:(ADD ptr idx) val mem)
 11296  	// cond: sym == nil && p.Uses == 1
 11297  	// result: (MOVWstoreidx ptr idx val mem)
 11298  	for {
 11299  		if auxIntToInt32(v.AuxInt) != 0 {
 11300  			break
 11301  		}
 11302  		sym := auxToSym(v.Aux)
 11303  		p := v_0
 11304  		if p.Op != OpPPC64ADD {
 11305  			break
 11306  		}
 11307  		idx := p.Args[1]
 11308  		ptr := p.Args[0]
 11309  		val := v_1
 11310  		mem := v_2
 11311  		if !(sym == nil && p.Uses == 1) {
 11312  			break
 11313  		}
 11314  		v.reset(OpPPC64MOVWstoreidx)
 11315  		v.AddArg4(ptr, idx, val, mem)
 11316  		return true
 11317  	}
 11318  	// match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
 11319  	// result: (MOVWstore [off] {sym} ptr x mem)
 11320  	for {
 11321  		off := auxIntToInt32(v.AuxInt)
 11322  		sym := auxToSym(v.Aux)
 11323  		ptr := v_0
 11324  		if v_1.Op != OpPPC64MOVWreg {
 11325  			break
 11326  		}
 11327  		x := v_1.Args[0]
 11328  		mem := v_2
 11329  		v.reset(OpPPC64MOVWstore)
 11330  		v.AuxInt = int32ToAuxInt(off)
 11331  		v.Aux = symToAux(sym)
 11332  		v.AddArg3(ptr, x, mem)
 11333  		return true
 11334  	}
 11335  	// match: (MOVWstore [off] {sym} ptr (MOVWZreg x) mem)
 11336  	// result: (MOVWstore [off] {sym} ptr x mem)
 11337  	for {
 11338  		off := auxIntToInt32(v.AuxInt)
 11339  		sym := auxToSym(v.Aux)
 11340  		ptr := v_0
 11341  		if v_1.Op != OpPPC64MOVWZreg {
 11342  			break
 11343  		}
 11344  		x := v_1.Args[0]
 11345  		mem := v_2
 11346  		v.reset(OpPPC64MOVWstore)
 11347  		v.AuxInt = int32ToAuxInt(off)
 11348  		v.Aux = symToAux(sym)
 11349  		v.AddArg3(ptr, x, mem)
 11350  		return true
 11351  	}
 11352  	// match: (MOVWstore [off] {sym} ptr r:(BRW val) mem)
 11353  	// cond: r.Uses == 1
 11354  	// result: (MOVWBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
 11355  	for {
 11356  		off := auxIntToInt32(v.AuxInt)
 11357  		sym := auxToSym(v.Aux)
 11358  		ptr := v_0
 11359  		r := v_1
 11360  		if r.Op != OpPPC64BRW {
 11361  			break
 11362  		}
 11363  		val := r.Args[0]
 11364  		mem := v_2
 11365  		if !(r.Uses == 1) {
 11366  			break
 11367  		}
 11368  		v.reset(OpPPC64MOVWBRstore)
 11369  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
 11370  		v0.AuxInt = int32ToAuxInt(off)
 11371  		v0.Aux = symToAux(sym)
 11372  		v0.AddArg(ptr)
 11373  		v.AddArg3(v0, val, mem)
 11374  		return true
 11375  	}
 11376  	// match: (MOVWstore [off] {sym} ptr (Bswap32 val) mem)
 11377  	// result: (MOVWBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
 11378  	for {
 11379  		off := auxIntToInt32(v.AuxInt)
 11380  		sym := auxToSym(v.Aux)
 11381  		ptr := v_0
 11382  		if v_1.Op != OpBswap32 {
 11383  			break
 11384  		}
 11385  		val := v_1.Args[0]
 11386  		mem := v_2
 11387  		v.reset(OpPPC64MOVWBRstore)
 11388  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
 11389  		v0.AuxInt = int32ToAuxInt(off)
 11390  		v0.Aux = symToAux(sym)
 11391  		v0.AddArg(ptr)
 11392  		v.AddArg3(v0, val, mem)
 11393  		return true
 11394  	}
 11395  	return false
 11396  }
 11397  func rewriteValuePPC64_OpPPC64MOVWstoreidx(v *Value) bool {
 11398  	v_3 := v.Args[3]
 11399  	v_2 := v.Args[2]
 11400  	v_1 := v.Args[1]
 11401  	v_0 := v.Args[0]
 11402  	// match: (MOVWstoreidx ptr (MOVDconst [c]) val mem)
 11403  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 11404  	// result: (MOVWstore [int32(c)] ptr val mem)
 11405  	for {
 11406  		ptr := v_0
 11407  		if v_1.Op != OpPPC64MOVDconst {
 11408  			break
 11409  		}
 11410  		c := auxIntToInt64(v_1.AuxInt)
 11411  		val := v_2
 11412  		mem := v_3
 11413  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 11414  			break
 11415  		}
 11416  		v.reset(OpPPC64MOVWstore)
 11417  		v.AuxInt = int32ToAuxInt(int32(c))
 11418  		v.AddArg3(ptr, val, mem)
 11419  		return true
 11420  	}
 11421  	// match: (MOVWstoreidx (MOVDconst [c]) ptr val mem)
 11422  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 11423  	// result: (MOVWstore [int32(c)] ptr val mem)
 11424  	for {
 11425  		if v_0.Op != OpPPC64MOVDconst {
 11426  			break
 11427  		}
 11428  		c := auxIntToInt64(v_0.AuxInt)
 11429  		ptr := v_1
 11430  		val := v_2
 11431  		mem := v_3
 11432  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 11433  			break
 11434  		}
 11435  		v.reset(OpPPC64MOVWstore)
 11436  		v.AuxInt = int32ToAuxInt(int32(c))
 11437  		v.AddArg3(ptr, val, mem)
 11438  		return true
 11439  	}
 11440  	// match: (MOVWstoreidx ptr idx (MOVWreg x) mem)
 11441  	// result: (MOVWstoreidx ptr idx x mem)
 11442  	for {
 11443  		ptr := v_0
 11444  		idx := v_1
 11445  		if v_2.Op != OpPPC64MOVWreg {
 11446  			break
 11447  		}
 11448  		x := v_2.Args[0]
 11449  		mem := v_3
 11450  		v.reset(OpPPC64MOVWstoreidx)
 11451  		v.AddArg4(ptr, idx, x, mem)
 11452  		return true
 11453  	}
 11454  	// match: (MOVWstoreidx ptr idx (MOVWZreg x) mem)
 11455  	// result: (MOVWstoreidx ptr idx x mem)
 11456  	for {
 11457  		ptr := v_0
 11458  		idx := v_1
 11459  		if v_2.Op != OpPPC64MOVWZreg {
 11460  			break
 11461  		}
 11462  		x := v_2.Args[0]
 11463  		mem := v_3
 11464  		v.reset(OpPPC64MOVWstoreidx)
 11465  		v.AddArg4(ptr, idx, x, mem)
 11466  		return true
 11467  	}
 11468  	// match: (MOVWstoreidx ptr idx r:(BRW val) mem)
 11469  	// cond: r.Uses == 1
 11470  	// result: (MOVWBRstoreidx ptr idx val mem)
 11471  	for {
 11472  		ptr := v_0
 11473  		idx := v_1
 11474  		r := v_2
 11475  		if r.Op != OpPPC64BRW {
 11476  			break
 11477  		}
 11478  		val := r.Args[0]
 11479  		mem := v_3
 11480  		if !(r.Uses == 1) {
 11481  			break
 11482  		}
 11483  		v.reset(OpPPC64MOVWBRstoreidx)
 11484  		v.AddArg4(ptr, idx, val, mem)
 11485  		return true
 11486  	}
 11487  	// match: (MOVWstoreidx ptr idx (Bswap32 val) mem)
 11488  	// result: (MOVWBRstoreidx ptr idx val mem)
 11489  	for {
 11490  		ptr := v_0
 11491  		idx := v_1
 11492  		if v_2.Op != OpBswap32 {
 11493  			break
 11494  		}
 11495  		val := v_2.Args[0]
 11496  		mem := v_3
 11497  		v.reset(OpPPC64MOVWBRstoreidx)
 11498  		v.AddArg4(ptr, idx, val, mem)
 11499  		return true
 11500  	}
 11501  	return false
 11502  }
 11503  func rewriteValuePPC64_OpPPC64MOVWstorezero(v *Value) bool {
 11504  	v_1 := v.Args[1]
 11505  	v_0 := v.Args[0]
 11506  	// match: (MOVWstorezero [off1] {sym} (ADDconst [off2] x) mem)
 11507  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
 11508  	// result: (MOVWstorezero [off1+int32(off2)] {sym} x mem)
 11509  	for {
 11510  		off1 := auxIntToInt32(v.AuxInt)
 11511  		sym := auxToSym(v.Aux)
 11512  		if v_0.Op != OpPPC64ADDconst {
 11513  			break
 11514  		}
 11515  		off2 := auxIntToInt64(v_0.AuxInt)
 11516  		x := v_0.Args[0]
 11517  		mem := v_1
 11518  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
 11519  			break
 11520  		}
 11521  		v.reset(OpPPC64MOVWstorezero)
 11522  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11523  		v.Aux = symToAux(sym)
 11524  		v.AddArg2(x, mem)
 11525  		return true
 11526  	}
 11527  	// match: (MOVWstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
 11528  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 11529  	// result: (MOVWstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
 11530  	for {
 11531  		off1 := auxIntToInt32(v.AuxInt)
 11532  		sym1 := auxToSym(v.Aux)
 11533  		p := v_0
 11534  		if p.Op != OpPPC64MOVDaddr {
 11535  			break
 11536  		}
 11537  		off2 := auxIntToInt32(p.AuxInt)
 11538  		sym2 := auxToSym(p.Aux)
 11539  		x := p.Args[0]
 11540  		mem := v_1
 11541  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 11542  			break
 11543  		}
 11544  		v.reset(OpPPC64MOVWstorezero)
 11545  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11546  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11547  		v.AddArg2(x, mem)
 11548  		return true
 11549  	}
 11550  	return false
 11551  }
 11552  func rewriteValuePPC64_OpPPC64MTVSRD(v *Value) bool {
 11553  	v_0 := v.Args[0]
 11554  	b := v.Block
 11555  	typ := &b.Func.Config.Types
 11556  	// match: (MTVSRD (MOVDconst [c]))
 11557  	// cond: !math.IsNaN(math.Float64frombits(uint64(c)))
 11558  	// result: (FMOVDconst [math.Float64frombits(uint64(c))])
 11559  	for {
 11560  		if v_0.Op != OpPPC64MOVDconst {
 11561  			break
 11562  		}
 11563  		c := auxIntToInt64(v_0.AuxInt)
 11564  		if !(!math.IsNaN(math.Float64frombits(uint64(c)))) {
 11565  			break
 11566  		}
 11567  		v.reset(OpPPC64FMOVDconst)
 11568  		v.AuxInt = float64ToAuxInt(math.Float64frombits(uint64(c)))
 11569  		return true
 11570  	}
 11571  	// match: (MTVSRD x:(MOVDload [off] {sym} ptr mem))
 11572  	// cond: x.Uses == 1 && clobber(x)
 11573  	// result: @x.Block (FMOVDload [off] {sym} ptr mem)
 11574  	for {
 11575  		x := v_0
 11576  		if x.Op != OpPPC64MOVDload {
 11577  			break
 11578  		}
 11579  		off := auxIntToInt32(x.AuxInt)
 11580  		sym := auxToSym(x.Aux)
 11581  		mem := x.Args[1]
 11582  		ptr := x.Args[0]
 11583  		if !(x.Uses == 1 && clobber(x)) {
 11584  			break
 11585  		}
 11586  		b = x.Block
 11587  		v0 := b.NewValue0(x.Pos, OpPPC64FMOVDload, typ.Float64)
 11588  		v.copyOf(v0)
 11589  		v0.AuxInt = int32ToAuxInt(off)
 11590  		v0.Aux = symToAux(sym)
 11591  		v0.AddArg2(ptr, mem)
 11592  		return true
 11593  	}
 11594  	return false
 11595  }
 11596  func rewriteValuePPC64_OpPPC64MULLD(v *Value) bool {
 11597  	v_1 := v.Args[1]
 11598  	v_0 := v.Args[0]
 11599  	// match: (MULLD x (MOVDconst [c]))
 11600  	// cond: is16Bit(c)
 11601  	// result: (MULLDconst [int32(c)] x)
 11602  	for {
 11603  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11604  			x := v_0
 11605  			if v_1.Op != OpPPC64MOVDconst {
 11606  				continue
 11607  			}
 11608  			c := auxIntToInt64(v_1.AuxInt)
 11609  			if !(is16Bit(c)) {
 11610  				continue
 11611  			}
 11612  			v.reset(OpPPC64MULLDconst)
 11613  			v.AuxInt = int32ToAuxInt(int32(c))
 11614  			v.AddArg(x)
 11615  			return true
 11616  		}
 11617  		break
 11618  	}
 11619  	return false
 11620  }
 11621  func rewriteValuePPC64_OpPPC64MULLW(v *Value) bool {
 11622  	v_1 := v.Args[1]
 11623  	v_0 := v.Args[0]
 11624  	// match: (MULLW x (MOVDconst [c]))
 11625  	// cond: is16Bit(c)
 11626  	// result: (MULLWconst [int32(c)] x)
 11627  	for {
 11628  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11629  			x := v_0
 11630  			if v_1.Op != OpPPC64MOVDconst {
 11631  				continue
 11632  			}
 11633  			c := auxIntToInt64(v_1.AuxInt)
 11634  			if !(is16Bit(c)) {
 11635  				continue
 11636  			}
 11637  			v.reset(OpPPC64MULLWconst)
 11638  			v.AuxInt = int32ToAuxInt(int32(c))
 11639  			v.AddArg(x)
 11640  			return true
 11641  		}
 11642  		break
 11643  	}
 11644  	return false
 11645  }
 11646  func rewriteValuePPC64_OpPPC64NEG(v *Value) bool {
 11647  	v_0 := v.Args[0]
 11648  	// match: (NEG (ADDconst [c] x))
 11649  	// cond: is32Bit(-c)
 11650  	// result: (SUBFCconst [-c] x)
 11651  	for {
 11652  		if v_0.Op != OpPPC64ADDconst {
 11653  			break
 11654  		}
 11655  		c := auxIntToInt64(v_0.AuxInt)
 11656  		x := v_0.Args[0]
 11657  		if !(is32Bit(-c)) {
 11658  			break
 11659  		}
 11660  		v.reset(OpPPC64SUBFCconst)
 11661  		v.AuxInt = int64ToAuxInt(-c)
 11662  		v.AddArg(x)
 11663  		return true
 11664  	}
 11665  	// match: (NEG (SUBFCconst [c] x))
 11666  	// cond: is32Bit(-c)
 11667  	// result: (ADDconst [-c] x)
 11668  	for {
 11669  		if v_0.Op != OpPPC64SUBFCconst {
 11670  			break
 11671  		}
 11672  		c := auxIntToInt64(v_0.AuxInt)
 11673  		x := v_0.Args[0]
 11674  		if !(is32Bit(-c)) {
 11675  			break
 11676  		}
 11677  		v.reset(OpPPC64ADDconst)
 11678  		v.AuxInt = int64ToAuxInt(-c)
 11679  		v.AddArg(x)
 11680  		return true
 11681  	}
 11682  	// match: (NEG (SUB x y))
 11683  	// result: (SUB y x)
 11684  	for {
 11685  		if v_0.Op != OpPPC64SUB {
 11686  			break
 11687  		}
 11688  		y := v_0.Args[1]
 11689  		x := v_0.Args[0]
 11690  		v.reset(OpPPC64SUB)
 11691  		v.AddArg2(y, x)
 11692  		return true
 11693  	}
 11694  	// match: (NEG (NEG x))
 11695  	// result: x
 11696  	for {
 11697  		if v_0.Op != OpPPC64NEG {
 11698  			break
 11699  		}
 11700  		x := v_0.Args[0]
 11701  		v.copyOf(x)
 11702  		return true
 11703  	}
 11704  	return false
 11705  }
 11706  func rewriteValuePPC64_OpPPC64NOR(v *Value) bool {
 11707  	v_1 := v.Args[1]
 11708  	v_0 := v.Args[0]
 11709  	// match: (NOR (MOVDconst [c]) (MOVDconst [d]))
 11710  	// result: (MOVDconst [^(c|d)])
 11711  	for {
 11712  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11713  			if v_0.Op != OpPPC64MOVDconst {
 11714  				continue
 11715  			}
 11716  			c := auxIntToInt64(v_0.AuxInt)
 11717  			if v_1.Op != OpPPC64MOVDconst {
 11718  				continue
 11719  			}
 11720  			d := auxIntToInt64(v_1.AuxInt)
 11721  			v.reset(OpPPC64MOVDconst)
 11722  			v.AuxInt = int64ToAuxInt(^(c | d))
 11723  			return true
 11724  		}
 11725  		break
 11726  	}
 11727  	return false
 11728  }
 11729  func rewriteValuePPC64_OpPPC64NotEqual(v *Value) bool {
 11730  	v_0 := v.Args[0]
 11731  	// match: (NotEqual (FlagEQ))
 11732  	// result: (MOVDconst [0])
 11733  	for {
 11734  		if v_0.Op != OpPPC64FlagEQ {
 11735  			break
 11736  		}
 11737  		v.reset(OpPPC64MOVDconst)
 11738  		v.AuxInt = int64ToAuxInt(0)
 11739  		return true
 11740  	}
 11741  	// match: (NotEqual (FlagLT))
 11742  	// result: (MOVDconst [1])
 11743  	for {
 11744  		if v_0.Op != OpPPC64FlagLT {
 11745  			break
 11746  		}
 11747  		v.reset(OpPPC64MOVDconst)
 11748  		v.AuxInt = int64ToAuxInt(1)
 11749  		return true
 11750  	}
 11751  	// match: (NotEqual (FlagGT))
 11752  	// result: (MOVDconst [1])
 11753  	for {
 11754  		if v_0.Op != OpPPC64FlagGT {
 11755  			break
 11756  		}
 11757  		v.reset(OpPPC64MOVDconst)
 11758  		v.AuxInt = int64ToAuxInt(1)
 11759  		return true
 11760  	}
 11761  	// match: (NotEqual (InvertFlags x))
 11762  	// result: (NotEqual x)
 11763  	for {
 11764  		if v_0.Op != OpPPC64InvertFlags {
 11765  			break
 11766  		}
 11767  		x := v_0.Args[0]
 11768  		v.reset(OpPPC64NotEqual)
 11769  		v.AddArg(x)
 11770  		return true
 11771  	}
 11772  	// match: (NotEqual cmp)
 11773  	// result: (SETBCR [2] cmp)
 11774  	for {
 11775  		cmp := v_0
 11776  		v.reset(OpPPC64SETBCR)
 11777  		v.AuxInt = int32ToAuxInt(2)
 11778  		v.AddArg(cmp)
 11779  		return true
 11780  	}
 11781  }
 11782  func rewriteValuePPC64_OpPPC64OR(v *Value) bool {
 11783  	v_1 := v.Args[1]
 11784  	v_0 := v.Args[0]
 11785  	// match: (OR <t> x (MOVDconst [m]))
 11786  	// cond: t.IsUnsigned() && t.Size() == 1 && m != int64(uint8(m))
 11787  	// result: (ORconst [int64(uint8(m))] x)
 11788  	for {
 11789  		t := v.Type
 11790  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11791  			x := v_0
 11792  			if v_1.Op != OpPPC64MOVDconst {
 11793  				continue
 11794  			}
 11795  			m := auxIntToInt64(v_1.AuxInt)
 11796  			if !(t.IsUnsigned() && t.Size() == 1 && m != int64(uint8(m))) {
 11797  				continue
 11798  			}
 11799  			v.reset(OpPPC64ORconst)
 11800  			v.AuxInt = int64ToAuxInt(int64(uint8(m)))
 11801  			v.AddArg(x)
 11802  			return true
 11803  		}
 11804  		break
 11805  	}
 11806  	// match: (OR <t> x (MOVDconst [m]))
 11807  	// cond: t.IsUnsigned() && t.Size() == 2 && m != int64(uint16(m))
 11808  	// result: (ORconst [int64(uint16(m))] x)
 11809  	for {
 11810  		t := v.Type
 11811  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11812  			x := v_0
 11813  			if v_1.Op != OpPPC64MOVDconst {
 11814  				continue
 11815  			}
 11816  			m := auxIntToInt64(v_1.AuxInt)
 11817  			if !(t.IsUnsigned() && t.Size() == 2 && m != int64(uint16(m))) {
 11818  				continue
 11819  			}
 11820  			v.reset(OpPPC64ORconst)
 11821  			v.AuxInt = int64ToAuxInt(int64(uint16(m)))
 11822  			v.AddArg(x)
 11823  			return true
 11824  		}
 11825  		break
 11826  	}
 11827  	// match: (OR x (NOR y y))
 11828  	// result: (ORN x y)
 11829  	for {
 11830  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11831  			x := v_0
 11832  			if v_1.Op != OpPPC64NOR {
 11833  				continue
 11834  			}
 11835  			y := v_1.Args[1]
 11836  			if y != v_1.Args[0] {
 11837  				continue
 11838  			}
 11839  			v.reset(OpPPC64ORN)
 11840  			v.AddArg2(x, y)
 11841  			return true
 11842  		}
 11843  		break
 11844  	}
 11845  	// match: (OR (MOVDconst [c]) (MOVDconst [d]))
 11846  	// result: (MOVDconst [c|d])
 11847  	for {
 11848  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11849  			if v_0.Op != OpPPC64MOVDconst {
 11850  				continue
 11851  			}
 11852  			c := auxIntToInt64(v_0.AuxInt)
 11853  			if v_1.Op != OpPPC64MOVDconst {
 11854  				continue
 11855  			}
 11856  			d := auxIntToInt64(v_1.AuxInt)
 11857  			v.reset(OpPPC64MOVDconst)
 11858  			v.AuxInt = int64ToAuxInt(c | d)
 11859  			return true
 11860  		}
 11861  		break
 11862  	}
 11863  	// match: (OR x (MOVDconst [c]))
 11864  	// cond: isU32Bit(c)
 11865  	// result: (ORconst [c] x)
 11866  	for {
 11867  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11868  			x := v_0
 11869  			if v_1.Op != OpPPC64MOVDconst {
 11870  				continue
 11871  			}
 11872  			c := auxIntToInt64(v_1.AuxInt)
 11873  			if !(isU32Bit(c)) {
 11874  				continue
 11875  			}
 11876  			v.reset(OpPPC64ORconst)
 11877  			v.AuxInt = int64ToAuxInt(c)
 11878  			v.AddArg(x)
 11879  			return true
 11880  		}
 11881  		break
 11882  	}
 11883  	return false
 11884  }
 11885  func rewriteValuePPC64_OpPPC64ORN(v *Value) bool {
 11886  	v_1 := v.Args[1]
 11887  	v_0 := v.Args[0]
 11888  	// match: (ORN x (MOVDconst [-1]))
 11889  	// result: x
 11890  	for {
 11891  		x := v_0
 11892  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
 11893  			break
 11894  		}
 11895  		v.copyOf(x)
 11896  		return true
 11897  	}
 11898  	// match: (ORN (MOVDconst [c]) (MOVDconst [d]))
 11899  	// result: (MOVDconst [c|^d])
 11900  	for {
 11901  		if v_0.Op != OpPPC64MOVDconst {
 11902  			break
 11903  		}
 11904  		c := auxIntToInt64(v_0.AuxInt)
 11905  		if v_1.Op != OpPPC64MOVDconst {
 11906  			break
 11907  		}
 11908  		d := auxIntToInt64(v_1.AuxInt)
 11909  		v.reset(OpPPC64MOVDconst)
 11910  		v.AuxInt = int64ToAuxInt(c | ^d)
 11911  		return true
 11912  	}
 11913  	return false
 11914  }
 11915  func rewriteValuePPC64_OpPPC64ORconst(v *Value) bool {
 11916  	v_0 := v.Args[0]
 11917  	// match: (ORconst [c] (ORconst [d] x))
 11918  	// result: (ORconst [c|d] x)
 11919  	for {
 11920  		c := auxIntToInt64(v.AuxInt)
 11921  		if v_0.Op != OpPPC64ORconst {
 11922  			break
 11923  		}
 11924  		d := auxIntToInt64(v_0.AuxInt)
 11925  		x := v_0.Args[0]
 11926  		v.reset(OpPPC64ORconst)
 11927  		v.AuxInt = int64ToAuxInt(c | d)
 11928  		v.AddArg(x)
 11929  		return true
 11930  	}
 11931  	// match: (ORconst [-1] _)
 11932  	// result: (MOVDconst [-1])
 11933  	for {
 11934  		if auxIntToInt64(v.AuxInt) != -1 {
 11935  			break
 11936  		}
 11937  		v.reset(OpPPC64MOVDconst)
 11938  		v.AuxInt = int64ToAuxInt(-1)
 11939  		return true
 11940  	}
 11941  	// match: (ORconst [0] x)
 11942  	// result: x
 11943  	for {
 11944  		if auxIntToInt64(v.AuxInt) != 0 {
 11945  			break
 11946  		}
 11947  		x := v_0
 11948  		v.copyOf(x)
 11949  		return true
 11950  	}
 11951  	return false
 11952  }
 11953  func rewriteValuePPC64_OpPPC64RLWINM(v *Value) bool {
 11954  	v_0 := v.Args[0]
 11955  	// match: (RLWINM [r] (MOVHZreg u))
 11956  	// cond: mergePPC64RlwinmAnd(r,0xFFFF) != 0
 11957  	// result: (RLWINM [mergePPC64RlwinmAnd(r,0xFFFF)] u)
 11958  	for {
 11959  		r := auxIntToInt64(v.AuxInt)
 11960  		if v_0.Op != OpPPC64MOVHZreg {
 11961  			break
 11962  		}
 11963  		u := v_0.Args[0]
 11964  		if !(mergePPC64RlwinmAnd(r, 0xFFFF) != 0) {
 11965  			break
 11966  		}
 11967  		v.reset(OpPPC64RLWINM)
 11968  		v.AuxInt = int64ToAuxInt(mergePPC64RlwinmAnd(r, 0xFFFF))
 11969  		v.AddArg(u)
 11970  		return true
 11971  	}
 11972  	// match: (RLWINM [r] (ANDconst [a] u))
 11973  	// cond: mergePPC64RlwinmAnd(r,uint32(a)) != 0
 11974  	// result: (RLWINM [mergePPC64RlwinmAnd(r,uint32(a))] u)
 11975  	for {
 11976  		r := auxIntToInt64(v.AuxInt)
 11977  		if v_0.Op != OpPPC64ANDconst {
 11978  			break
 11979  		}
 11980  		a := auxIntToInt64(v_0.AuxInt)
 11981  		u := v_0.Args[0]
 11982  		if !(mergePPC64RlwinmAnd(r, uint32(a)) != 0) {
 11983  			break
 11984  		}
 11985  		v.reset(OpPPC64RLWINM)
 11986  		v.AuxInt = int64ToAuxInt(mergePPC64RlwinmAnd(r, uint32(a)))
 11987  		v.AddArg(u)
 11988  		return true
 11989  	}
 11990  	return false
 11991  }
 11992  func rewriteValuePPC64_OpPPC64ROTL(v *Value) bool {
 11993  	v_1 := v.Args[1]
 11994  	v_0 := v.Args[0]
 11995  	// match: (ROTL x (MOVDconst [c]))
 11996  	// result: (ROTLconst x [c&63])
 11997  	for {
 11998  		x := v_0
 11999  		if v_1.Op != OpPPC64MOVDconst {
 12000  			break
 12001  		}
 12002  		c := auxIntToInt64(v_1.AuxInt)
 12003  		v.reset(OpPPC64ROTLconst)
 12004  		v.AuxInt = int64ToAuxInt(c & 63)
 12005  		v.AddArg(x)
 12006  		return true
 12007  	}
 12008  	return false
 12009  }
 12010  func rewriteValuePPC64_OpPPC64ROTLW(v *Value) bool {
 12011  	v_1 := v.Args[1]
 12012  	v_0 := v.Args[0]
 12013  	// match: (ROTLW x (MOVDconst [c]))
 12014  	// result: (ROTLWconst x [c&31])
 12015  	for {
 12016  		x := v_0
 12017  		if v_1.Op != OpPPC64MOVDconst {
 12018  			break
 12019  		}
 12020  		c := auxIntToInt64(v_1.AuxInt)
 12021  		v.reset(OpPPC64ROTLWconst)
 12022  		v.AuxInt = int64ToAuxInt(c & 31)
 12023  		v.AddArg(x)
 12024  		return true
 12025  	}
 12026  	return false
 12027  }
 12028  func rewriteValuePPC64_OpPPC64ROTLWconst(v *Value) bool {
 12029  	v_0 := v.Args[0]
 12030  	// match: (ROTLWconst [r] (AND (MOVDconst [m]) x))
 12031  	// cond: isPPC64WordRotateMask(m)
 12032  	// result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
 12033  	for {
 12034  		r := auxIntToInt64(v.AuxInt)
 12035  		if v_0.Op != OpPPC64AND {
 12036  			break
 12037  		}
 12038  		_ = v_0.Args[1]
 12039  		v_0_0 := v_0.Args[0]
 12040  		v_0_1 := v_0.Args[1]
 12041  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 12042  			if v_0_0.Op != OpPPC64MOVDconst {
 12043  				continue
 12044  			}
 12045  			m := auxIntToInt64(v_0_0.AuxInt)
 12046  			x := v_0_1
 12047  			if !(isPPC64WordRotateMask(m)) {
 12048  				continue
 12049  			}
 12050  			v.reset(OpPPC64RLWINM)
 12051  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
 12052  			v.AddArg(x)
 12053  			return true
 12054  		}
 12055  		break
 12056  	}
 12057  	// match: (ROTLWconst [r] (ANDconst [m] x))
 12058  	// cond: isPPC64WordRotateMask(m)
 12059  	// result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
 12060  	for {
 12061  		r := auxIntToInt64(v.AuxInt)
 12062  		if v_0.Op != OpPPC64ANDconst {
 12063  			break
 12064  		}
 12065  		m := auxIntToInt64(v_0.AuxInt)
 12066  		x := v_0.Args[0]
 12067  		if !(isPPC64WordRotateMask(m)) {
 12068  			break
 12069  		}
 12070  		v.reset(OpPPC64RLWINM)
 12071  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
 12072  		v.AddArg(x)
 12073  		return true
 12074  	}
 12075  	return false
 12076  }
 12077  func rewriteValuePPC64_OpPPC64SETBC(v *Value) bool {
 12078  	v_0 := v.Args[0]
 12079  	b := v.Block
 12080  	typ := &b.Func.Config.Types
 12081  	// match: (SETBC [0] (FlagLT))
 12082  	// result: (MOVDconst [1])
 12083  	for {
 12084  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
 12085  			break
 12086  		}
 12087  		v.reset(OpPPC64MOVDconst)
 12088  		v.AuxInt = int64ToAuxInt(1)
 12089  		return true
 12090  	}
 12091  	// match: (SETBC [0] (FlagGT))
 12092  	// result: (MOVDconst [0])
 12093  	for {
 12094  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
 12095  			break
 12096  		}
 12097  		v.reset(OpPPC64MOVDconst)
 12098  		v.AuxInt = int64ToAuxInt(0)
 12099  		return true
 12100  	}
 12101  	// match: (SETBC [0] (FlagEQ))
 12102  	// result: (MOVDconst [0])
 12103  	for {
 12104  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
 12105  			break
 12106  		}
 12107  		v.reset(OpPPC64MOVDconst)
 12108  		v.AuxInt = int64ToAuxInt(0)
 12109  		return true
 12110  	}
 12111  	// match: (SETBC [1] (FlagGT))
 12112  	// result: (MOVDconst [1])
 12113  	for {
 12114  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
 12115  			break
 12116  		}
 12117  		v.reset(OpPPC64MOVDconst)
 12118  		v.AuxInt = int64ToAuxInt(1)
 12119  		return true
 12120  	}
 12121  	// match: (SETBC [1] (FlagLT))
 12122  	// result: (MOVDconst [0])
 12123  	for {
 12124  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
 12125  			break
 12126  		}
 12127  		v.reset(OpPPC64MOVDconst)
 12128  		v.AuxInt = int64ToAuxInt(0)
 12129  		return true
 12130  	}
 12131  	// match: (SETBC [1] (FlagEQ))
 12132  	// result: (MOVDconst [0])
 12133  	for {
 12134  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
 12135  			break
 12136  		}
 12137  		v.reset(OpPPC64MOVDconst)
 12138  		v.AuxInt = int64ToAuxInt(0)
 12139  		return true
 12140  	}
 12141  	// match: (SETBC [2] (FlagEQ))
 12142  	// result: (MOVDconst [1])
 12143  	for {
 12144  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
 12145  			break
 12146  		}
 12147  		v.reset(OpPPC64MOVDconst)
 12148  		v.AuxInt = int64ToAuxInt(1)
 12149  		return true
 12150  	}
 12151  	// match: (SETBC [2] (FlagLT))
 12152  	// result: (MOVDconst [0])
 12153  	for {
 12154  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
 12155  			break
 12156  		}
 12157  		v.reset(OpPPC64MOVDconst)
 12158  		v.AuxInt = int64ToAuxInt(0)
 12159  		return true
 12160  	}
 12161  	// match: (SETBC [2] (FlagGT))
 12162  	// result: (MOVDconst [0])
 12163  	for {
 12164  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
 12165  			break
 12166  		}
 12167  		v.reset(OpPPC64MOVDconst)
 12168  		v.AuxInt = int64ToAuxInt(0)
 12169  		return true
 12170  	}
 12171  	// match: (SETBC [0] (InvertFlags bool))
 12172  	// result: (SETBC [1] bool)
 12173  	for {
 12174  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
 12175  			break
 12176  		}
 12177  		bool := v_0.Args[0]
 12178  		v.reset(OpPPC64SETBC)
 12179  		v.AuxInt = int32ToAuxInt(1)
 12180  		v.AddArg(bool)
 12181  		return true
 12182  	}
 12183  	// match: (SETBC [1] (InvertFlags bool))
 12184  	// result: (SETBC [0] bool)
 12185  	for {
 12186  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
 12187  			break
 12188  		}
 12189  		bool := v_0.Args[0]
 12190  		v.reset(OpPPC64SETBC)
 12191  		v.AuxInt = int32ToAuxInt(0)
 12192  		v.AddArg(bool)
 12193  		return true
 12194  	}
 12195  	// match: (SETBC [2] (InvertFlags bool))
 12196  	// result: (SETBC [2] bool)
 12197  	for {
 12198  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
 12199  			break
 12200  		}
 12201  		bool := v_0.Args[0]
 12202  		v.reset(OpPPC64SETBC)
 12203  		v.AuxInt = int32ToAuxInt(2)
 12204  		v.AddArg(bool)
 12205  		return true
 12206  	}
 12207  	// match: (SETBC [n] (InvertFlags bool))
 12208  	// result: (SETBCR [n] bool)
 12209  	for {
 12210  		n := auxIntToInt32(v.AuxInt)
 12211  		if v_0.Op != OpPPC64InvertFlags {
 12212  			break
 12213  		}
 12214  		bool := v_0.Args[0]
 12215  		v.reset(OpPPC64SETBCR)
 12216  		v.AuxInt = int32ToAuxInt(n)
 12217  		v.AddArg(bool)
 12218  		return true
 12219  	}
 12220  	// match: (SETBC [2] (CMPconst [0] a:(ANDconst [1] _)))
 12221  	// result: (XORconst [1] a)
 12222  	for {
 12223  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12224  			break
 12225  		}
 12226  		a := v_0.Args[0]
 12227  		if a.Op != OpPPC64ANDconst || auxIntToInt64(a.AuxInt) != 1 {
 12228  			break
 12229  		}
 12230  		v.reset(OpPPC64XORconst)
 12231  		v.AuxInt = int64ToAuxInt(1)
 12232  		v.AddArg(a)
 12233  		return true
 12234  	}
 12235  	// match: (SETBC [2] (CMPconst [0] a:(AND y z)))
 12236  	// cond: a.Uses == 1
 12237  	// result: (SETBC [2] (Select1 <types.TypeFlags> (ANDCC y z )))
 12238  	for {
 12239  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12240  			break
 12241  		}
 12242  		a := v_0.Args[0]
 12243  		if a.Op != OpPPC64AND {
 12244  			break
 12245  		}
 12246  		z := a.Args[1]
 12247  		y := a.Args[0]
 12248  		if !(a.Uses == 1) {
 12249  			break
 12250  		}
 12251  		v.reset(OpPPC64SETBC)
 12252  		v.AuxInt = int32ToAuxInt(2)
 12253  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12254  		v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 12255  		v1.AddArg2(y, z)
 12256  		v0.AddArg(v1)
 12257  		v.AddArg(v0)
 12258  		return true
 12259  	}
 12260  	// match: (SETBC [2] (CMPconst [0] o:(OR y z)))
 12261  	// cond: o.Uses == 1
 12262  	// result: (SETBC [2] (Select1 <types.TypeFlags> (ORCC y z )))
 12263  	for {
 12264  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12265  			break
 12266  		}
 12267  		o := v_0.Args[0]
 12268  		if o.Op != OpPPC64OR {
 12269  			break
 12270  		}
 12271  		z := o.Args[1]
 12272  		y := o.Args[0]
 12273  		if !(o.Uses == 1) {
 12274  			break
 12275  		}
 12276  		v.reset(OpPPC64SETBC)
 12277  		v.AuxInt = int32ToAuxInt(2)
 12278  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12279  		v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12280  		v1.AddArg2(y, z)
 12281  		v0.AddArg(v1)
 12282  		v.AddArg(v0)
 12283  		return true
 12284  	}
 12285  	// match: (SETBC [2] (CMPconst [0] a:(XOR y z)))
 12286  	// cond: a.Uses == 1
 12287  	// result: (SETBC [2] (Select1 <types.TypeFlags> (XORCC y z )))
 12288  	for {
 12289  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12290  			break
 12291  		}
 12292  		a := v_0.Args[0]
 12293  		if a.Op != OpPPC64XOR {
 12294  			break
 12295  		}
 12296  		z := a.Args[1]
 12297  		y := a.Args[0]
 12298  		if !(a.Uses == 1) {
 12299  			break
 12300  		}
 12301  		v.reset(OpPPC64SETBC)
 12302  		v.AuxInt = int32ToAuxInt(2)
 12303  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12304  		v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12305  		v1.AddArg2(y, z)
 12306  		v0.AddArg(v1)
 12307  		v.AddArg(v0)
 12308  		return true
 12309  	}
 12310  	return false
 12311  }
 12312  func rewriteValuePPC64_OpPPC64SETBCR(v *Value) bool {
 12313  	v_0 := v.Args[0]
 12314  	b := v.Block
 12315  	typ := &b.Func.Config.Types
 12316  	// match: (SETBCR [0] (FlagLT))
 12317  	// result: (MOVDconst [0])
 12318  	for {
 12319  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
 12320  			break
 12321  		}
 12322  		v.reset(OpPPC64MOVDconst)
 12323  		v.AuxInt = int64ToAuxInt(0)
 12324  		return true
 12325  	}
 12326  	// match: (SETBCR [0] (FlagGT))
 12327  	// result: (MOVDconst [1])
 12328  	for {
 12329  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
 12330  			break
 12331  		}
 12332  		v.reset(OpPPC64MOVDconst)
 12333  		v.AuxInt = int64ToAuxInt(1)
 12334  		return true
 12335  	}
 12336  	// match: (SETBCR [0] (FlagEQ))
 12337  	// result: (MOVDconst [1])
 12338  	for {
 12339  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
 12340  			break
 12341  		}
 12342  		v.reset(OpPPC64MOVDconst)
 12343  		v.AuxInt = int64ToAuxInt(1)
 12344  		return true
 12345  	}
 12346  	// match: (SETBCR [1] (FlagGT))
 12347  	// result: (MOVDconst [0])
 12348  	for {
 12349  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
 12350  			break
 12351  		}
 12352  		v.reset(OpPPC64MOVDconst)
 12353  		v.AuxInt = int64ToAuxInt(0)
 12354  		return true
 12355  	}
 12356  	// match: (SETBCR [1] (FlagLT))
 12357  	// result: (MOVDconst [1])
 12358  	for {
 12359  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
 12360  			break
 12361  		}
 12362  		v.reset(OpPPC64MOVDconst)
 12363  		v.AuxInt = int64ToAuxInt(1)
 12364  		return true
 12365  	}
 12366  	// match: (SETBCR [1] (FlagEQ))
 12367  	// result: (MOVDconst [1])
 12368  	for {
 12369  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
 12370  			break
 12371  		}
 12372  		v.reset(OpPPC64MOVDconst)
 12373  		v.AuxInt = int64ToAuxInt(1)
 12374  		return true
 12375  	}
 12376  	// match: (SETBCR [2] (FlagEQ))
 12377  	// result: (MOVDconst [0])
 12378  	for {
 12379  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
 12380  			break
 12381  		}
 12382  		v.reset(OpPPC64MOVDconst)
 12383  		v.AuxInt = int64ToAuxInt(0)
 12384  		return true
 12385  	}
 12386  	// match: (SETBCR [2] (FlagLT))
 12387  	// result: (MOVDconst [1])
 12388  	for {
 12389  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
 12390  			break
 12391  		}
 12392  		v.reset(OpPPC64MOVDconst)
 12393  		v.AuxInt = int64ToAuxInt(1)
 12394  		return true
 12395  	}
 12396  	// match: (SETBCR [2] (FlagGT))
 12397  	// result: (MOVDconst [1])
 12398  	for {
 12399  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
 12400  			break
 12401  		}
 12402  		v.reset(OpPPC64MOVDconst)
 12403  		v.AuxInt = int64ToAuxInt(1)
 12404  		return true
 12405  	}
 12406  	// match: (SETBCR [0] (InvertFlags bool))
 12407  	// result: (SETBCR [1] bool)
 12408  	for {
 12409  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
 12410  			break
 12411  		}
 12412  		bool := v_0.Args[0]
 12413  		v.reset(OpPPC64SETBCR)
 12414  		v.AuxInt = int32ToAuxInt(1)
 12415  		v.AddArg(bool)
 12416  		return true
 12417  	}
 12418  	// match: (SETBCR [1] (InvertFlags bool))
 12419  	// result: (SETBCR [0] bool)
 12420  	for {
 12421  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
 12422  			break
 12423  		}
 12424  		bool := v_0.Args[0]
 12425  		v.reset(OpPPC64SETBCR)
 12426  		v.AuxInt = int32ToAuxInt(0)
 12427  		v.AddArg(bool)
 12428  		return true
 12429  	}
 12430  	// match: (SETBCR [2] (InvertFlags bool))
 12431  	// result: (SETBCR [2] bool)
 12432  	for {
 12433  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
 12434  			break
 12435  		}
 12436  		bool := v_0.Args[0]
 12437  		v.reset(OpPPC64SETBCR)
 12438  		v.AuxInt = int32ToAuxInt(2)
 12439  		v.AddArg(bool)
 12440  		return true
 12441  	}
 12442  	// match: (SETBCR [n] (InvertFlags bool))
 12443  	// result: (SETBC [n] bool)
 12444  	for {
 12445  		n := auxIntToInt32(v.AuxInt)
 12446  		if v_0.Op != OpPPC64InvertFlags {
 12447  			break
 12448  		}
 12449  		bool := v_0.Args[0]
 12450  		v.reset(OpPPC64SETBC)
 12451  		v.AuxInt = int32ToAuxInt(n)
 12452  		v.AddArg(bool)
 12453  		return true
 12454  	}
 12455  	// match: (SETBCR [2] (CMPconst [0] a:(ANDconst [1] _)))
 12456  	// result: a
 12457  	for {
 12458  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12459  			break
 12460  		}
 12461  		a := v_0.Args[0]
 12462  		if a.Op != OpPPC64ANDconst || auxIntToInt64(a.AuxInt) != 1 {
 12463  			break
 12464  		}
 12465  		v.copyOf(a)
 12466  		return true
 12467  	}
 12468  	// match: (SETBCR [2] (CMPconst [0] a:(AND y z)))
 12469  	// cond: a.Uses == 1
 12470  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (ANDCC y z )))
 12471  	for {
 12472  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12473  			break
 12474  		}
 12475  		a := v_0.Args[0]
 12476  		if a.Op != OpPPC64AND {
 12477  			break
 12478  		}
 12479  		z := a.Args[1]
 12480  		y := a.Args[0]
 12481  		if !(a.Uses == 1) {
 12482  			break
 12483  		}
 12484  		v.reset(OpPPC64SETBCR)
 12485  		v.AuxInt = int32ToAuxInt(2)
 12486  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12487  		v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 12488  		v1.AddArg2(y, z)
 12489  		v0.AddArg(v1)
 12490  		v.AddArg(v0)
 12491  		return true
 12492  	}
 12493  	// match: (SETBCR [2] (CMPconst [0] o:(OR y z)))
 12494  	// cond: o.Uses == 1
 12495  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (ORCC y z )))
 12496  	for {
 12497  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12498  			break
 12499  		}
 12500  		o := v_0.Args[0]
 12501  		if o.Op != OpPPC64OR {
 12502  			break
 12503  		}
 12504  		z := o.Args[1]
 12505  		y := o.Args[0]
 12506  		if !(o.Uses == 1) {
 12507  			break
 12508  		}
 12509  		v.reset(OpPPC64SETBCR)
 12510  		v.AuxInt = int32ToAuxInt(2)
 12511  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12512  		v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12513  		v1.AddArg2(y, z)
 12514  		v0.AddArg(v1)
 12515  		v.AddArg(v0)
 12516  		return true
 12517  	}
 12518  	// match: (SETBCR [2] (CMPconst [0] a:(XOR y z)))
 12519  	// cond: a.Uses == 1
 12520  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (XORCC y z )))
 12521  	for {
 12522  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12523  			break
 12524  		}
 12525  		a := v_0.Args[0]
 12526  		if a.Op != OpPPC64XOR {
 12527  			break
 12528  		}
 12529  		z := a.Args[1]
 12530  		y := a.Args[0]
 12531  		if !(a.Uses == 1) {
 12532  			break
 12533  		}
 12534  		v.reset(OpPPC64SETBCR)
 12535  		v.AuxInt = int32ToAuxInt(2)
 12536  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12537  		v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12538  		v1.AddArg2(y, z)
 12539  		v0.AddArg(v1)
 12540  		v.AddArg(v0)
 12541  		return true
 12542  	}
 12543  	return false
 12544  }
 12545  func rewriteValuePPC64_OpPPC64SLD(v *Value) bool {
 12546  	v_1 := v.Args[1]
 12547  	v_0 := v.Args[0]
 12548  	// match: (SLD x (MOVDconst [c]))
 12549  	// result: (SLDconst [c&63 | (c>>6&1*63)] x)
 12550  	for {
 12551  		x := v_0
 12552  		if v_1.Op != OpPPC64MOVDconst {
 12553  			break
 12554  		}
 12555  		c := auxIntToInt64(v_1.AuxInt)
 12556  		v.reset(OpPPC64SLDconst)
 12557  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12558  		v.AddArg(x)
 12559  		return true
 12560  	}
 12561  	return false
 12562  }
 12563  func rewriteValuePPC64_OpPPC64SLDconst(v *Value) bool {
 12564  	v_0 := v.Args[0]
 12565  	// match: (SLDconst [l] (SRWconst [r] x))
 12566  	// cond: mergePPC64SldiSrw(l,r) != 0
 12567  	// result: (RLWINM [mergePPC64SldiSrw(l,r)] x)
 12568  	for {
 12569  		l := auxIntToInt64(v.AuxInt)
 12570  		if v_0.Op != OpPPC64SRWconst {
 12571  			break
 12572  		}
 12573  		r := auxIntToInt64(v_0.AuxInt)
 12574  		x := v_0.Args[0]
 12575  		if !(mergePPC64SldiSrw(l, r) != 0) {
 12576  			break
 12577  		}
 12578  		v.reset(OpPPC64RLWINM)
 12579  		v.AuxInt = int64ToAuxInt(mergePPC64SldiSrw(l, r))
 12580  		v.AddArg(x)
 12581  		return true
 12582  	}
 12583  	// match: (SLDconst [s] (RLWINM [r] y))
 12584  	// cond: mergePPC64SldiRlwinm(s,r) != 0
 12585  	// result: (RLWINM [mergePPC64SldiRlwinm(s,r)] y)
 12586  	for {
 12587  		s := auxIntToInt64(v.AuxInt)
 12588  		if v_0.Op != OpPPC64RLWINM {
 12589  			break
 12590  		}
 12591  		r := auxIntToInt64(v_0.AuxInt)
 12592  		y := v_0.Args[0]
 12593  		if !(mergePPC64SldiRlwinm(s, r) != 0) {
 12594  			break
 12595  		}
 12596  		v.reset(OpPPC64RLWINM)
 12597  		v.AuxInt = int64ToAuxInt(mergePPC64SldiRlwinm(s, r))
 12598  		v.AddArg(y)
 12599  		return true
 12600  	}
 12601  	// match: (SLDconst [c] z:(MOVBZreg x))
 12602  	// cond: c < 8 && z.Uses == 1
 12603  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,56,63,64)] x)
 12604  	for {
 12605  		c := auxIntToInt64(v.AuxInt)
 12606  		z := v_0
 12607  		if z.Op != OpPPC64MOVBZreg {
 12608  			break
 12609  		}
 12610  		x := z.Args[0]
 12611  		if !(c < 8 && z.Uses == 1) {
 12612  			break
 12613  		}
 12614  		v.reset(OpPPC64CLRLSLDI)
 12615  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 56, 63, 64))
 12616  		v.AddArg(x)
 12617  		return true
 12618  	}
 12619  	// match: (SLDconst [c] z:(MOVHZreg x))
 12620  	// cond: c < 16 && z.Uses == 1
 12621  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,48,63,64)] x)
 12622  	for {
 12623  		c := auxIntToInt64(v.AuxInt)
 12624  		z := v_0
 12625  		if z.Op != OpPPC64MOVHZreg {
 12626  			break
 12627  		}
 12628  		x := z.Args[0]
 12629  		if !(c < 16 && z.Uses == 1) {
 12630  			break
 12631  		}
 12632  		v.reset(OpPPC64CLRLSLDI)
 12633  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 48, 63, 64))
 12634  		v.AddArg(x)
 12635  		return true
 12636  	}
 12637  	// match: (SLDconst [c] z:(MOVWZreg x))
 12638  	// cond: c < 32 && z.Uses == 1
 12639  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,32,63,64)] x)
 12640  	for {
 12641  		c := auxIntToInt64(v.AuxInt)
 12642  		z := v_0
 12643  		if z.Op != OpPPC64MOVWZreg {
 12644  			break
 12645  		}
 12646  		x := z.Args[0]
 12647  		if !(c < 32 && z.Uses == 1) {
 12648  			break
 12649  		}
 12650  		v.reset(OpPPC64CLRLSLDI)
 12651  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32, 63, 64))
 12652  		v.AddArg(x)
 12653  		return true
 12654  	}
 12655  	// match: (SLDconst [c] z:(ANDconst [d] x))
 12656  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))
 12657  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
 12658  	for {
 12659  		c := auxIntToInt64(v.AuxInt)
 12660  		z := v_0
 12661  		if z.Op != OpPPC64ANDconst {
 12662  			break
 12663  		}
 12664  		d := auxIntToInt64(z.AuxInt)
 12665  		x := z.Args[0]
 12666  		if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
 12667  			break
 12668  		}
 12669  		v.reset(OpPPC64CLRLSLDI)
 12670  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
 12671  		v.AddArg(x)
 12672  		return true
 12673  	}
 12674  	// match: (SLDconst [c] z:(AND (MOVDconst [d]) x))
 12675  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(64-getPPC64ShiftMaskLength(d))
 12676  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
 12677  	for {
 12678  		c := auxIntToInt64(v.AuxInt)
 12679  		z := v_0
 12680  		if z.Op != OpPPC64AND {
 12681  			break
 12682  		}
 12683  		_ = z.Args[1]
 12684  		z_0 := z.Args[0]
 12685  		z_1 := z.Args[1]
 12686  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 12687  			if z_0.Op != OpPPC64MOVDconst {
 12688  				continue
 12689  			}
 12690  			d := auxIntToInt64(z_0.AuxInt)
 12691  			x := z_1
 12692  			if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
 12693  				continue
 12694  			}
 12695  			v.reset(OpPPC64CLRLSLDI)
 12696  			v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
 12697  			v.AddArg(x)
 12698  			return true
 12699  		}
 12700  		break
 12701  	}
 12702  	// match: (SLDconst [c] (ADD x x))
 12703  	// cond: c < 63
 12704  	// result: (SLDconst [c+1] x)
 12705  	for {
 12706  		c := auxIntToInt64(v.AuxInt)
 12707  		if v_0.Op != OpPPC64ADD {
 12708  			break
 12709  		}
 12710  		x := v_0.Args[1]
 12711  		if x != v_0.Args[0] || !(c < 63) {
 12712  			break
 12713  		}
 12714  		v.reset(OpPPC64SLDconst)
 12715  		v.AuxInt = int64ToAuxInt(c + 1)
 12716  		v.AddArg(x)
 12717  		return true
 12718  	}
 12719  	// match: (SLDconst [c] z:(MOVWreg x))
 12720  	// cond: c < 32 && buildcfg.GOPPC64 >= 9
 12721  	// result: (EXTSWSLconst [c] x)
 12722  	for {
 12723  		c := auxIntToInt64(v.AuxInt)
 12724  		z := v_0
 12725  		if z.Op != OpPPC64MOVWreg {
 12726  			break
 12727  		}
 12728  		x := z.Args[0]
 12729  		if !(c < 32 && buildcfg.GOPPC64 >= 9) {
 12730  			break
 12731  		}
 12732  		v.reset(OpPPC64EXTSWSLconst)
 12733  		v.AuxInt = int64ToAuxInt(c)
 12734  		v.AddArg(x)
 12735  		return true
 12736  	}
 12737  	return false
 12738  }
 12739  func rewriteValuePPC64_OpPPC64SLW(v *Value) bool {
 12740  	v_1 := v.Args[1]
 12741  	v_0 := v.Args[0]
 12742  	// match: (SLW x (MOVDconst [c]))
 12743  	// result: (SLWconst [c&31 | (c>>5&1*31)] x)
 12744  	for {
 12745  		x := v_0
 12746  		if v_1.Op != OpPPC64MOVDconst {
 12747  			break
 12748  		}
 12749  		c := auxIntToInt64(v_1.AuxInt)
 12750  		v.reset(OpPPC64SLWconst)
 12751  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12752  		v.AddArg(x)
 12753  		return true
 12754  	}
 12755  	return false
 12756  }
 12757  func rewriteValuePPC64_OpPPC64SLWconst(v *Value) bool {
 12758  	v_0 := v.Args[0]
 12759  	// match: (SLWconst [s] (MOVWZreg w))
 12760  	// result: (SLWconst [s] w)
 12761  	for {
 12762  		s := auxIntToInt64(v.AuxInt)
 12763  		if v_0.Op != OpPPC64MOVWZreg {
 12764  			break
 12765  		}
 12766  		w := v_0.Args[0]
 12767  		v.reset(OpPPC64SLWconst)
 12768  		v.AuxInt = int64ToAuxInt(s)
 12769  		v.AddArg(w)
 12770  		return true
 12771  	}
 12772  	// match: (SLWconst [c] z:(MOVBZreg x))
 12773  	// cond: z.Uses == 1 && c < 8
 12774  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,24,31,32)] x)
 12775  	for {
 12776  		c := auxIntToInt64(v.AuxInt)
 12777  		z := v_0
 12778  		if z.Op != OpPPC64MOVBZreg {
 12779  			break
 12780  		}
 12781  		x := z.Args[0]
 12782  		if !(z.Uses == 1 && c < 8) {
 12783  			break
 12784  		}
 12785  		v.reset(OpPPC64CLRLSLWI)
 12786  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 24, 31, 32))
 12787  		v.AddArg(x)
 12788  		return true
 12789  	}
 12790  	// match: (SLWconst [c] z:(MOVHZreg x))
 12791  	// cond: z.Uses == 1 && c < 16
 12792  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,16,31,32)] x)
 12793  	for {
 12794  		c := auxIntToInt64(v.AuxInt)
 12795  		z := v_0
 12796  		if z.Op != OpPPC64MOVHZreg {
 12797  			break
 12798  		}
 12799  		x := z.Args[0]
 12800  		if !(z.Uses == 1 && c < 16) {
 12801  			break
 12802  		}
 12803  		v.reset(OpPPC64CLRLSLWI)
 12804  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 16, 31, 32))
 12805  		v.AddArg(x)
 12806  		return true
 12807  	}
 12808  	// match: (SLWconst [c] z:(ANDconst [d] x))
 12809  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
 12810  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
 12811  	for {
 12812  		c := auxIntToInt64(v.AuxInt)
 12813  		z := v_0
 12814  		if z.Op != OpPPC64ANDconst {
 12815  			break
 12816  		}
 12817  		d := auxIntToInt64(z.AuxInt)
 12818  		x := z.Args[0]
 12819  		if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
 12820  			break
 12821  		}
 12822  		v.reset(OpPPC64CLRLSLWI)
 12823  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
 12824  		v.AddArg(x)
 12825  		return true
 12826  	}
 12827  	// match: (SLWconst [c] z:(AND (MOVDconst [d]) x))
 12828  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
 12829  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
 12830  	for {
 12831  		c := auxIntToInt64(v.AuxInt)
 12832  		z := v_0
 12833  		if z.Op != OpPPC64AND {
 12834  			break
 12835  		}
 12836  		_ = z.Args[1]
 12837  		z_0 := z.Args[0]
 12838  		z_1 := z.Args[1]
 12839  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 12840  			if z_0.Op != OpPPC64MOVDconst {
 12841  				continue
 12842  			}
 12843  			d := auxIntToInt64(z_0.AuxInt)
 12844  			x := z_1
 12845  			if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
 12846  				continue
 12847  			}
 12848  			v.reset(OpPPC64CLRLSLWI)
 12849  			v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
 12850  			v.AddArg(x)
 12851  			return true
 12852  		}
 12853  		break
 12854  	}
 12855  	// match: (SLWconst [c] (ADD x x))
 12856  	// cond: c < 31
 12857  	// result: (SLWconst [c+1] x)
 12858  	for {
 12859  		c := auxIntToInt64(v.AuxInt)
 12860  		if v_0.Op != OpPPC64ADD {
 12861  			break
 12862  		}
 12863  		x := v_0.Args[1]
 12864  		if x != v_0.Args[0] || !(c < 31) {
 12865  			break
 12866  		}
 12867  		v.reset(OpPPC64SLWconst)
 12868  		v.AuxInt = int64ToAuxInt(c + 1)
 12869  		v.AddArg(x)
 12870  		return true
 12871  	}
 12872  	// match: (SLWconst [c] z:(MOVWreg x))
 12873  	// cond: c < 32 && buildcfg.GOPPC64 >= 9
 12874  	// result: (EXTSWSLconst [c] x)
 12875  	for {
 12876  		c := auxIntToInt64(v.AuxInt)
 12877  		z := v_0
 12878  		if z.Op != OpPPC64MOVWreg {
 12879  			break
 12880  		}
 12881  		x := z.Args[0]
 12882  		if !(c < 32 && buildcfg.GOPPC64 >= 9) {
 12883  			break
 12884  		}
 12885  		v.reset(OpPPC64EXTSWSLconst)
 12886  		v.AuxInt = int64ToAuxInt(c)
 12887  		v.AddArg(x)
 12888  		return true
 12889  	}
 12890  	return false
 12891  }
 12892  func rewriteValuePPC64_OpPPC64SRAD(v *Value) bool {
 12893  	v_1 := v.Args[1]
 12894  	v_0 := v.Args[0]
 12895  	// match: (SRAD x (MOVDconst [c]))
 12896  	// result: (SRADconst [c&63 | (c>>6&1*63)] x)
 12897  	for {
 12898  		x := v_0
 12899  		if v_1.Op != OpPPC64MOVDconst {
 12900  			break
 12901  		}
 12902  		c := auxIntToInt64(v_1.AuxInt)
 12903  		v.reset(OpPPC64SRADconst)
 12904  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12905  		v.AddArg(x)
 12906  		return true
 12907  	}
 12908  	return false
 12909  }
 12910  func rewriteValuePPC64_OpPPC64SRAW(v *Value) bool {
 12911  	v_1 := v.Args[1]
 12912  	v_0 := v.Args[0]
 12913  	// match: (SRAW x (MOVDconst [c]))
 12914  	// result: (SRAWconst [c&31 | (c>>5&1*31)] x)
 12915  	for {
 12916  		x := v_0
 12917  		if v_1.Op != OpPPC64MOVDconst {
 12918  			break
 12919  		}
 12920  		c := auxIntToInt64(v_1.AuxInt)
 12921  		v.reset(OpPPC64SRAWconst)
 12922  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12923  		v.AddArg(x)
 12924  		return true
 12925  	}
 12926  	return false
 12927  }
 12928  func rewriteValuePPC64_OpPPC64SRD(v *Value) bool {
 12929  	v_1 := v.Args[1]
 12930  	v_0 := v.Args[0]
 12931  	// match: (SRD x (MOVDconst [c]))
 12932  	// result: (SRDconst [c&63 | (c>>6&1*63)] x)
 12933  	for {
 12934  		x := v_0
 12935  		if v_1.Op != OpPPC64MOVDconst {
 12936  			break
 12937  		}
 12938  		c := auxIntToInt64(v_1.AuxInt)
 12939  		v.reset(OpPPC64SRDconst)
 12940  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12941  		v.AddArg(x)
 12942  		return true
 12943  	}
 12944  	return false
 12945  }
 12946  func rewriteValuePPC64_OpPPC64SRW(v *Value) bool {
 12947  	v_1 := v.Args[1]
 12948  	v_0 := v.Args[0]
 12949  	// match: (SRW x (MOVDconst [c]))
 12950  	// result: (SRWconst [c&31 | (c>>5&1*31)] x)
 12951  	for {
 12952  		x := v_0
 12953  		if v_1.Op != OpPPC64MOVDconst {
 12954  			break
 12955  		}
 12956  		c := auxIntToInt64(v_1.AuxInt)
 12957  		v.reset(OpPPC64SRWconst)
 12958  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12959  		v.AddArg(x)
 12960  		return true
 12961  	}
 12962  	return false
 12963  }
 12964  func rewriteValuePPC64_OpPPC64SRWconst(v *Value) bool {
 12965  	v_0 := v.Args[0]
 12966  	// match: (SRWconst (ANDconst [m] x) [s])
 12967  	// cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
 12968  	// result: (MOVDconst [0])
 12969  	for {
 12970  		s := auxIntToInt64(v.AuxInt)
 12971  		if v_0.Op != OpPPC64ANDconst {
 12972  			break
 12973  		}
 12974  		m := auxIntToInt64(v_0.AuxInt)
 12975  		if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
 12976  			break
 12977  		}
 12978  		v.reset(OpPPC64MOVDconst)
 12979  		v.AuxInt = int64ToAuxInt(0)
 12980  		return true
 12981  	}
 12982  	// match: (SRWconst (ANDconst [m] x) [s])
 12983  	// cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
 12984  	// result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
 12985  	for {
 12986  		s := auxIntToInt64(v.AuxInt)
 12987  		if v_0.Op != OpPPC64ANDconst {
 12988  			break
 12989  		}
 12990  		m := auxIntToInt64(v_0.AuxInt)
 12991  		x := v_0.Args[0]
 12992  		if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
 12993  			break
 12994  		}
 12995  		v.reset(OpPPC64RLWINM)
 12996  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
 12997  		v.AddArg(x)
 12998  		return true
 12999  	}
 13000  	// match: (SRWconst (AND (MOVDconst [m]) x) [s])
 13001  	// cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
 13002  	// result: (MOVDconst [0])
 13003  	for {
 13004  		s := auxIntToInt64(v.AuxInt)
 13005  		if v_0.Op != OpPPC64AND {
 13006  			break
 13007  		}
 13008  		_ = v_0.Args[1]
 13009  		v_0_0 := v_0.Args[0]
 13010  		v_0_1 := v_0.Args[1]
 13011  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 13012  			if v_0_0.Op != OpPPC64MOVDconst {
 13013  				continue
 13014  			}
 13015  			m := auxIntToInt64(v_0_0.AuxInt)
 13016  			if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
 13017  				continue
 13018  			}
 13019  			v.reset(OpPPC64MOVDconst)
 13020  			v.AuxInt = int64ToAuxInt(0)
 13021  			return true
 13022  		}
 13023  		break
 13024  	}
 13025  	// match: (SRWconst (AND (MOVDconst [m]) x) [s])
 13026  	// cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
 13027  	// result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
 13028  	for {
 13029  		s := auxIntToInt64(v.AuxInt)
 13030  		if v_0.Op != OpPPC64AND {
 13031  			break
 13032  		}
 13033  		_ = v_0.Args[1]
 13034  		v_0_0 := v_0.Args[0]
 13035  		v_0_1 := v_0.Args[1]
 13036  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 13037  			if v_0_0.Op != OpPPC64MOVDconst {
 13038  				continue
 13039  			}
 13040  			m := auxIntToInt64(v_0_0.AuxInt)
 13041  			x := v_0_1
 13042  			if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
 13043  				continue
 13044  			}
 13045  			v.reset(OpPPC64RLWINM)
 13046  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
 13047  			v.AddArg(x)
 13048  			return true
 13049  		}
 13050  		break
 13051  	}
 13052  	return false
 13053  }
 13054  func rewriteValuePPC64_OpPPC64SUB(v *Value) bool {
 13055  	v_1 := v.Args[1]
 13056  	v_0 := v.Args[0]
 13057  	// match: (SUB x (MOVDconst [c]))
 13058  	// cond: is32Bit(-c)
 13059  	// result: (ADDconst [-c] x)
 13060  	for {
 13061  		x := v_0
 13062  		if v_1.Op != OpPPC64MOVDconst {
 13063  			break
 13064  		}
 13065  		c := auxIntToInt64(v_1.AuxInt)
 13066  		if !(is32Bit(-c)) {
 13067  			break
 13068  		}
 13069  		v.reset(OpPPC64ADDconst)
 13070  		v.AuxInt = int64ToAuxInt(-c)
 13071  		v.AddArg(x)
 13072  		return true
 13073  	}
 13074  	// match: (SUB (MOVDconst [c]) x)
 13075  	// cond: is32Bit(c)
 13076  	// result: (SUBFCconst [c] x)
 13077  	for {
 13078  		if v_0.Op != OpPPC64MOVDconst {
 13079  			break
 13080  		}
 13081  		c := auxIntToInt64(v_0.AuxInt)
 13082  		x := v_1
 13083  		if !(is32Bit(c)) {
 13084  			break
 13085  		}
 13086  		v.reset(OpPPC64SUBFCconst)
 13087  		v.AuxInt = int64ToAuxInt(c)
 13088  		v.AddArg(x)
 13089  		return true
 13090  	}
 13091  	return false
 13092  }
 13093  func rewriteValuePPC64_OpPPC64SUBE(v *Value) bool {
 13094  	v_2 := v.Args[2]
 13095  	v_1 := v.Args[1]
 13096  	v_0 := v.Args[0]
 13097  	b := v.Block
 13098  	typ := &b.Func.Config.Types
 13099  	// match: (SUBE x y (Select1 <typ.UInt64> (SUBCconst (MOVDconst [0]) [0])))
 13100  	// result: (SUBC x y)
 13101  	for {
 13102  		x := v_0
 13103  		y := v_1
 13104  		if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
 13105  			break
 13106  		}
 13107  		v_2_0 := v_2.Args[0]
 13108  		if v_2_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_2_0.AuxInt) != 0 {
 13109  			break
 13110  		}
 13111  		v_2_0_0 := v_2_0.Args[0]
 13112  		if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
 13113  			break
 13114  		}
 13115  		v.reset(OpPPC64SUBC)
 13116  		v.AddArg2(x, y)
 13117  		return true
 13118  	}
 13119  	return false
 13120  }
 13121  func rewriteValuePPC64_OpPPC64SUBFCconst(v *Value) bool {
 13122  	v_0 := v.Args[0]
 13123  	// match: (SUBFCconst [c] (NEG x))
 13124  	// result: (ADDconst [c] x)
 13125  	for {
 13126  		c := auxIntToInt64(v.AuxInt)
 13127  		if v_0.Op != OpPPC64NEG {
 13128  			break
 13129  		}
 13130  		x := v_0.Args[0]
 13131  		v.reset(OpPPC64ADDconst)
 13132  		v.AuxInt = int64ToAuxInt(c)
 13133  		v.AddArg(x)
 13134  		return true
 13135  	}
 13136  	// match: (SUBFCconst [c] (SUBFCconst [d] x))
 13137  	// cond: is32Bit(c-d)
 13138  	// result: (ADDconst [c-d] x)
 13139  	for {
 13140  		c := auxIntToInt64(v.AuxInt)
 13141  		if v_0.Op != OpPPC64SUBFCconst {
 13142  			break
 13143  		}
 13144  		d := auxIntToInt64(v_0.AuxInt)
 13145  		x := v_0.Args[0]
 13146  		if !(is32Bit(c - d)) {
 13147  			break
 13148  		}
 13149  		v.reset(OpPPC64ADDconst)
 13150  		v.AuxInt = int64ToAuxInt(c - d)
 13151  		v.AddArg(x)
 13152  		return true
 13153  	}
 13154  	// match: (SUBFCconst [0] x)
 13155  	// result: (NEG x)
 13156  	for {
 13157  		if auxIntToInt64(v.AuxInt) != 0 {
 13158  			break
 13159  		}
 13160  		x := v_0
 13161  		v.reset(OpPPC64NEG)
 13162  		v.AddArg(x)
 13163  		return true
 13164  	}
 13165  	return false
 13166  }
 13167  func rewriteValuePPC64_OpPPC64XOR(v *Value) bool {
 13168  	v_1 := v.Args[1]
 13169  	v_0 := v.Args[0]
 13170  	// match: (XOR <t> x (MOVDconst [m]))
 13171  	// cond: t.IsUnsigned() && t.Size() == 1 && m != int64(uint8(m))
 13172  	// result: (XORconst [int64(uint8(m))] x)
 13173  	for {
 13174  		t := v.Type
 13175  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13176  			x := v_0
 13177  			if v_1.Op != OpPPC64MOVDconst {
 13178  				continue
 13179  			}
 13180  			m := auxIntToInt64(v_1.AuxInt)
 13181  			if !(t.IsUnsigned() && t.Size() == 1 && m != int64(uint8(m))) {
 13182  				continue
 13183  			}
 13184  			v.reset(OpPPC64XORconst)
 13185  			v.AuxInt = int64ToAuxInt(int64(uint8(m)))
 13186  			v.AddArg(x)
 13187  			return true
 13188  		}
 13189  		break
 13190  	}
 13191  	// match: (XOR <t> x (MOVDconst [m]))
 13192  	// cond: t.IsUnsigned() && t.Size() == 2 && m != int64(uint16(m))
 13193  	// result: (XORconst [int64(uint16(m))] x)
 13194  	for {
 13195  		t := v.Type
 13196  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13197  			x := v_0
 13198  			if v_1.Op != OpPPC64MOVDconst {
 13199  				continue
 13200  			}
 13201  			m := auxIntToInt64(v_1.AuxInt)
 13202  			if !(t.IsUnsigned() && t.Size() == 2 && m != int64(uint16(m))) {
 13203  				continue
 13204  			}
 13205  			v.reset(OpPPC64XORconst)
 13206  			v.AuxInt = int64ToAuxInt(int64(uint16(m)))
 13207  			v.AddArg(x)
 13208  			return true
 13209  		}
 13210  		break
 13211  	}
 13212  	// match: (XOR (MOVDconst [c]) (MOVDconst [d]))
 13213  	// result: (MOVDconst [c^d])
 13214  	for {
 13215  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13216  			if v_0.Op != OpPPC64MOVDconst {
 13217  				continue
 13218  			}
 13219  			c := auxIntToInt64(v_0.AuxInt)
 13220  			if v_1.Op != OpPPC64MOVDconst {
 13221  				continue
 13222  			}
 13223  			d := auxIntToInt64(v_1.AuxInt)
 13224  			v.reset(OpPPC64MOVDconst)
 13225  			v.AuxInt = int64ToAuxInt(c ^ d)
 13226  			return true
 13227  		}
 13228  		break
 13229  	}
 13230  	// match: (XOR x (MOVDconst [c]))
 13231  	// cond: isU32Bit(c)
 13232  	// result: (XORconst [c] x)
 13233  	for {
 13234  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13235  			x := v_0
 13236  			if v_1.Op != OpPPC64MOVDconst {
 13237  				continue
 13238  			}
 13239  			c := auxIntToInt64(v_1.AuxInt)
 13240  			if !(isU32Bit(c)) {
 13241  				continue
 13242  			}
 13243  			v.reset(OpPPC64XORconst)
 13244  			v.AuxInt = int64ToAuxInt(c)
 13245  			v.AddArg(x)
 13246  			return true
 13247  		}
 13248  		break
 13249  	}
 13250  	return false
 13251  }
 13252  func rewriteValuePPC64_OpPPC64XORconst(v *Value) bool {
 13253  	v_0 := v.Args[0]
 13254  	// match: (XORconst [c] (XORconst [d] x))
 13255  	// result: (XORconst [c^d] x)
 13256  	for {
 13257  		c := auxIntToInt64(v.AuxInt)
 13258  		if v_0.Op != OpPPC64XORconst {
 13259  			break
 13260  		}
 13261  		d := auxIntToInt64(v_0.AuxInt)
 13262  		x := v_0.Args[0]
 13263  		v.reset(OpPPC64XORconst)
 13264  		v.AuxInt = int64ToAuxInt(c ^ d)
 13265  		v.AddArg(x)
 13266  		return true
 13267  	}
 13268  	// match: (XORconst [0] x)
 13269  	// result: x
 13270  	for {
 13271  		if auxIntToInt64(v.AuxInt) != 0 {
 13272  			break
 13273  		}
 13274  		x := v_0
 13275  		v.copyOf(x)
 13276  		return true
 13277  	}
 13278  	// match: (XORconst [1] (SETBCR [n] cmp))
 13279  	// result: (SETBC [n] cmp)
 13280  	for {
 13281  		if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBCR {
 13282  			break
 13283  		}
 13284  		n := auxIntToInt32(v_0.AuxInt)
 13285  		cmp := v_0.Args[0]
 13286  		v.reset(OpPPC64SETBC)
 13287  		v.AuxInt = int32ToAuxInt(n)
 13288  		v.AddArg(cmp)
 13289  		return true
 13290  	}
 13291  	// match: (XORconst [1] (SETBC [n] cmp))
 13292  	// result: (SETBCR [n] cmp)
 13293  	for {
 13294  		if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBC {
 13295  			break
 13296  		}
 13297  		n := auxIntToInt32(v_0.AuxInt)
 13298  		cmp := v_0.Args[0]
 13299  		v.reset(OpPPC64SETBCR)
 13300  		v.AuxInt = int32ToAuxInt(n)
 13301  		v.AddArg(cmp)
 13302  		return true
 13303  	}
 13304  	return false
 13305  }
 13306  func rewriteValuePPC64_OpPopCount16(v *Value) bool {
 13307  	v_0 := v.Args[0]
 13308  	b := v.Block
 13309  	typ := &b.Func.Config.Types
 13310  	// match: (PopCount16 x)
 13311  	// result: (POPCNTW (MOVHZreg x))
 13312  	for {
 13313  		x := v_0
 13314  		v.reset(OpPPC64POPCNTW)
 13315  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13316  		v0.AddArg(x)
 13317  		v.AddArg(v0)
 13318  		return true
 13319  	}
 13320  }
 13321  func rewriteValuePPC64_OpPopCount32(v *Value) bool {
 13322  	v_0 := v.Args[0]
 13323  	b := v.Block
 13324  	typ := &b.Func.Config.Types
 13325  	// match: (PopCount32 x)
 13326  	// result: (POPCNTW (MOVWZreg x))
 13327  	for {
 13328  		x := v_0
 13329  		v.reset(OpPPC64POPCNTW)
 13330  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
 13331  		v0.AddArg(x)
 13332  		v.AddArg(v0)
 13333  		return true
 13334  	}
 13335  }
 13336  func rewriteValuePPC64_OpPopCount8(v *Value) bool {
 13337  	v_0 := v.Args[0]
 13338  	b := v.Block
 13339  	typ := &b.Func.Config.Types
 13340  	// match: (PopCount8 x)
 13341  	// result: (POPCNTB (MOVBZreg x))
 13342  	for {
 13343  		x := v_0
 13344  		v.reset(OpPPC64POPCNTB)
 13345  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 13346  		v0.AddArg(x)
 13347  		v.AddArg(v0)
 13348  		return true
 13349  	}
 13350  }
 13351  func rewriteValuePPC64_OpPrefetchCache(v *Value) bool {
 13352  	v_1 := v.Args[1]
 13353  	v_0 := v.Args[0]
 13354  	// match: (PrefetchCache ptr mem)
 13355  	// result: (DCBT ptr mem [0])
 13356  	for {
 13357  		ptr := v_0
 13358  		mem := v_1
 13359  		v.reset(OpPPC64DCBT)
 13360  		v.AuxInt = int64ToAuxInt(0)
 13361  		v.AddArg2(ptr, mem)
 13362  		return true
 13363  	}
 13364  }
 13365  func rewriteValuePPC64_OpPrefetchCacheStreamed(v *Value) bool {
 13366  	v_1 := v.Args[1]
 13367  	v_0 := v.Args[0]
 13368  	// match: (PrefetchCacheStreamed ptr mem)
 13369  	// result: (DCBT ptr mem [16])
 13370  	for {
 13371  		ptr := v_0
 13372  		mem := v_1
 13373  		v.reset(OpPPC64DCBT)
 13374  		v.AuxInt = int64ToAuxInt(16)
 13375  		v.AddArg2(ptr, mem)
 13376  		return true
 13377  	}
 13378  }
 13379  func rewriteValuePPC64_OpRotateLeft16(v *Value) bool {
 13380  	v_1 := v.Args[1]
 13381  	v_0 := v.Args[0]
 13382  	b := v.Block
 13383  	typ := &b.Func.Config.Types
 13384  	// match: (RotateLeft16 <t> x (MOVDconst [c]))
 13385  	// result: (Or16 (Lsh16x64 <t> x (MOVDconst [c&15])) (Rsh16Ux64 <t> x (MOVDconst [-c&15])))
 13386  	for {
 13387  		t := v.Type
 13388  		x := v_0
 13389  		if v_1.Op != OpPPC64MOVDconst {
 13390  			break
 13391  		}
 13392  		c := auxIntToInt64(v_1.AuxInt)
 13393  		v.reset(OpOr16)
 13394  		v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
 13395  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13396  		v1.AuxInt = int64ToAuxInt(c & 15)
 13397  		v0.AddArg2(x, v1)
 13398  		v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
 13399  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13400  		v3.AuxInt = int64ToAuxInt(-c & 15)
 13401  		v2.AddArg2(x, v3)
 13402  		v.AddArg2(v0, v2)
 13403  		return true
 13404  	}
 13405  	return false
 13406  }
 13407  func rewriteValuePPC64_OpRotateLeft8(v *Value) bool {
 13408  	v_1 := v.Args[1]
 13409  	v_0 := v.Args[0]
 13410  	b := v.Block
 13411  	typ := &b.Func.Config.Types
 13412  	// match: (RotateLeft8 <t> x (MOVDconst [c]))
 13413  	// result: (Or8 (Lsh8x64 <t> x (MOVDconst [c&7])) (Rsh8Ux64 <t> x (MOVDconst [-c&7])))
 13414  	for {
 13415  		t := v.Type
 13416  		x := v_0
 13417  		if v_1.Op != OpPPC64MOVDconst {
 13418  			break
 13419  		}
 13420  		c := auxIntToInt64(v_1.AuxInt)
 13421  		v.reset(OpOr8)
 13422  		v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
 13423  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13424  		v1.AuxInt = int64ToAuxInt(c & 7)
 13425  		v0.AddArg2(x, v1)
 13426  		v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
 13427  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13428  		v3.AuxInt = int64ToAuxInt(-c & 7)
 13429  		v2.AddArg2(x, v3)
 13430  		v.AddArg2(v0, v2)
 13431  		return true
 13432  	}
 13433  	return false
 13434  }
 13435  func rewriteValuePPC64_OpRsh16Ux16(v *Value) bool {
 13436  	v_1 := v.Args[1]
 13437  	v_0 := v.Args[0]
 13438  	b := v.Block
 13439  	typ := &b.Func.Config.Types
 13440  	// match: (Rsh16Ux16 x y)
 13441  	// cond: shiftIsBounded(v)
 13442  	// result: (SRD (MOVHZreg x) y)
 13443  	for {
 13444  		x := v_0
 13445  		y := v_1
 13446  		if !(shiftIsBounded(v)) {
 13447  			break
 13448  		}
 13449  		v.reset(OpPPC64SRD)
 13450  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13451  		v0.AddArg(x)
 13452  		v.AddArg2(v0, y)
 13453  		return true
 13454  	}
 13455  	// match: (Rsh16Ux16 <t> x y)
 13456  	// result: (ISEL [2] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF0] y)))
 13457  	for {
 13458  		t := v.Type
 13459  		x := v_0
 13460  		y := v_1
 13461  		v.reset(OpPPC64ISEL)
 13462  		v.AuxInt = int32ToAuxInt(2)
 13463  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13464  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13465  		v1.AddArg(x)
 13466  		v0.AddArg2(v1, y)
 13467  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13468  		v2.AuxInt = int64ToAuxInt(0)
 13469  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13470  		v3.AuxInt = int64ToAuxInt(0)
 13471  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13472  		v4.AuxInt = int64ToAuxInt(0xFFF0)
 13473  		v4.AddArg(y)
 13474  		v3.AddArg(v4)
 13475  		v.AddArg3(v0, v2, v3)
 13476  		return true
 13477  	}
 13478  }
 13479  func rewriteValuePPC64_OpRsh16Ux32(v *Value) bool {
 13480  	v_1 := v.Args[1]
 13481  	v_0 := v.Args[0]
 13482  	b := v.Block
 13483  	typ := &b.Func.Config.Types
 13484  	// match: (Rsh16Ux32 x y)
 13485  	// cond: shiftIsBounded(v)
 13486  	// result: (SRD (MOVHZreg x) y)
 13487  	for {
 13488  		x := v_0
 13489  		y := v_1
 13490  		if !(shiftIsBounded(v)) {
 13491  			break
 13492  		}
 13493  		v.reset(OpPPC64SRD)
 13494  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13495  		v0.AddArg(x)
 13496  		v.AddArg2(v0, y)
 13497  		return true
 13498  	}
 13499  	// match: (Rsh16Ux32 <t> x y)
 13500  	// result: (ISEL [0] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [16]))
 13501  	for {
 13502  		t := v.Type
 13503  		x := v_0
 13504  		y := v_1
 13505  		v.reset(OpPPC64ISEL)
 13506  		v.AuxInt = int32ToAuxInt(0)
 13507  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13508  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13509  		v1.AddArg(x)
 13510  		v0.AddArg2(v1, y)
 13511  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13512  		v2.AuxInt = int64ToAuxInt(0)
 13513  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13514  		v3.AuxInt = int32ToAuxInt(16)
 13515  		v3.AddArg(y)
 13516  		v.AddArg3(v0, v2, v3)
 13517  		return true
 13518  	}
 13519  }
 13520  func rewriteValuePPC64_OpRsh16Ux64(v *Value) bool {
 13521  	v_1 := v.Args[1]
 13522  	v_0 := v.Args[0]
 13523  	b := v.Block
 13524  	typ := &b.Func.Config.Types
 13525  	// match: (Rsh16Ux64 x (MOVDconst [c]))
 13526  	// cond: uint64(c) < 16
 13527  	// result: (SRWconst (ZeroExt16to32 x) [c])
 13528  	for {
 13529  		x := v_0
 13530  		if v_1.Op != OpPPC64MOVDconst {
 13531  			break
 13532  		}
 13533  		c := auxIntToInt64(v_1.AuxInt)
 13534  		if !(uint64(c) < 16) {
 13535  			break
 13536  		}
 13537  		v.reset(OpPPC64SRWconst)
 13538  		v.AuxInt = int64ToAuxInt(c)
 13539  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 13540  		v0.AddArg(x)
 13541  		v.AddArg(v0)
 13542  		return true
 13543  	}
 13544  	// match: (Rsh16Ux64 x y)
 13545  	// cond: shiftIsBounded(v)
 13546  	// result: (SRD (MOVHZreg x) y)
 13547  	for {
 13548  		x := v_0
 13549  		y := v_1
 13550  		if !(shiftIsBounded(v)) {
 13551  			break
 13552  		}
 13553  		v.reset(OpPPC64SRD)
 13554  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13555  		v0.AddArg(x)
 13556  		v.AddArg2(v0, y)
 13557  		return true
 13558  	}
 13559  	// match: (Rsh16Ux64 <t> x y)
 13560  	// result: (ISEL [0] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [16]))
 13561  	for {
 13562  		t := v.Type
 13563  		x := v_0
 13564  		y := v_1
 13565  		v.reset(OpPPC64ISEL)
 13566  		v.AuxInt = int32ToAuxInt(0)
 13567  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13568  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13569  		v1.AddArg(x)
 13570  		v0.AddArg2(v1, y)
 13571  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13572  		v2.AuxInt = int64ToAuxInt(0)
 13573  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13574  		v3.AuxInt = int64ToAuxInt(16)
 13575  		v3.AddArg(y)
 13576  		v.AddArg3(v0, v2, v3)
 13577  		return true
 13578  	}
 13579  }
 13580  func rewriteValuePPC64_OpRsh16Ux8(v *Value) bool {
 13581  	v_1 := v.Args[1]
 13582  	v_0 := v.Args[0]
 13583  	b := v.Block
 13584  	typ := &b.Func.Config.Types
 13585  	// match: (Rsh16Ux8 x y)
 13586  	// cond: shiftIsBounded(v)
 13587  	// result: (SRD (MOVHZreg x) y)
 13588  	for {
 13589  		x := v_0
 13590  		y := v_1
 13591  		if !(shiftIsBounded(v)) {
 13592  			break
 13593  		}
 13594  		v.reset(OpPPC64SRD)
 13595  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13596  		v0.AddArg(x)
 13597  		v.AddArg2(v0, y)
 13598  		return true
 13599  	}
 13600  	// match: (Rsh16Ux8 <t> x y)
 13601  	// result: (ISEL [2] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F0] y)))
 13602  	for {
 13603  		t := v.Type
 13604  		x := v_0
 13605  		y := v_1
 13606  		v.reset(OpPPC64ISEL)
 13607  		v.AuxInt = int32ToAuxInt(2)
 13608  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13609  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13610  		v1.AddArg(x)
 13611  		v0.AddArg2(v1, y)
 13612  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13613  		v2.AuxInt = int64ToAuxInt(0)
 13614  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13615  		v3.AuxInt = int64ToAuxInt(0)
 13616  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13617  		v4.AuxInt = int64ToAuxInt(0x00F0)
 13618  		v4.AddArg(y)
 13619  		v3.AddArg(v4)
 13620  		v.AddArg3(v0, v2, v3)
 13621  		return true
 13622  	}
 13623  }
 13624  func rewriteValuePPC64_OpRsh16x16(v *Value) bool {
 13625  	v_1 := v.Args[1]
 13626  	v_0 := v.Args[0]
 13627  	b := v.Block
 13628  	typ := &b.Func.Config.Types
 13629  	// match: (Rsh16x16 x y)
 13630  	// cond: shiftIsBounded(v)
 13631  	// result: (SRAD (MOVHreg x) y)
 13632  	for {
 13633  		x := v_0
 13634  		y := v_1
 13635  		if !(shiftIsBounded(v)) {
 13636  			break
 13637  		}
 13638  		v.reset(OpPPC64SRAD)
 13639  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13640  		v0.AddArg(x)
 13641  		v.AddArg2(v0, y)
 13642  		return true
 13643  	}
 13644  	// match: (Rsh16x16 <t> x y)
 13645  	// result: (ISEL [2] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPconst [0] (ANDconst [0xFFF0] y)))
 13646  	for {
 13647  		t := v.Type
 13648  		x := v_0
 13649  		y := v_1
 13650  		v.reset(OpPPC64ISEL)
 13651  		v.AuxInt = int32ToAuxInt(2)
 13652  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13653  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13654  		v1.AddArg(x)
 13655  		v0.AddArg2(v1, y)
 13656  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13657  		v2.AuxInt = int64ToAuxInt(15)
 13658  		v2.AddArg(v1)
 13659  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13660  		v3.AuxInt = int64ToAuxInt(0)
 13661  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13662  		v4.AuxInt = int64ToAuxInt(0xFFF0)
 13663  		v4.AddArg(y)
 13664  		v3.AddArg(v4)
 13665  		v.AddArg3(v0, v2, v3)
 13666  		return true
 13667  	}
 13668  }
 13669  func rewriteValuePPC64_OpRsh16x32(v *Value) bool {
 13670  	v_1 := v.Args[1]
 13671  	v_0 := v.Args[0]
 13672  	b := v.Block
 13673  	typ := &b.Func.Config.Types
 13674  	// match: (Rsh16x32 x y)
 13675  	// cond: shiftIsBounded(v)
 13676  	// result: (SRAD (MOVHreg x) y)
 13677  	for {
 13678  		x := v_0
 13679  		y := v_1
 13680  		if !(shiftIsBounded(v)) {
 13681  			break
 13682  		}
 13683  		v.reset(OpPPC64SRAD)
 13684  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13685  		v0.AddArg(x)
 13686  		v.AddArg2(v0, y)
 13687  		return true
 13688  	}
 13689  	// match: (Rsh16x32 <t> x y)
 13690  	// result: (ISEL [0] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPWUconst y [16]))
 13691  	for {
 13692  		t := v.Type
 13693  		x := v_0
 13694  		y := v_1
 13695  		v.reset(OpPPC64ISEL)
 13696  		v.AuxInt = int32ToAuxInt(0)
 13697  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13698  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13699  		v1.AddArg(x)
 13700  		v0.AddArg2(v1, y)
 13701  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13702  		v2.AuxInt = int64ToAuxInt(15)
 13703  		v2.AddArg(v1)
 13704  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13705  		v3.AuxInt = int32ToAuxInt(16)
 13706  		v3.AddArg(y)
 13707  		v.AddArg3(v0, v2, v3)
 13708  		return true
 13709  	}
 13710  }
 13711  func rewriteValuePPC64_OpRsh16x64(v *Value) bool {
 13712  	v_1 := v.Args[1]
 13713  	v_0 := v.Args[0]
 13714  	b := v.Block
 13715  	typ := &b.Func.Config.Types
 13716  	// match: (Rsh16x64 x (MOVDconst [c]))
 13717  	// cond: uint64(c) >= 16
 13718  	// result: (SRAWconst (SignExt16to32 x) [63])
 13719  	for {
 13720  		x := v_0
 13721  		if v_1.Op != OpPPC64MOVDconst {
 13722  			break
 13723  		}
 13724  		c := auxIntToInt64(v_1.AuxInt)
 13725  		if !(uint64(c) >= 16) {
 13726  			break
 13727  		}
 13728  		v.reset(OpPPC64SRAWconst)
 13729  		v.AuxInt = int64ToAuxInt(63)
 13730  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 13731  		v0.AddArg(x)
 13732  		v.AddArg(v0)
 13733  		return true
 13734  	}
 13735  	// match: (Rsh16x64 x (MOVDconst [c]))
 13736  	// cond: uint64(c) < 16
 13737  	// result: (SRAWconst (SignExt16to32 x) [c])
 13738  	for {
 13739  		x := v_0
 13740  		if v_1.Op != OpPPC64MOVDconst {
 13741  			break
 13742  		}
 13743  		c := auxIntToInt64(v_1.AuxInt)
 13744  		if !(uint64(c) < 16) {
 13745  			break
 13746  		}
 13747  		v.reset(OpPPC64SRAWconst)
 13748  		v.AuxInt = int64ToAuxInt(c)
 13749  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 13750  		v0.AddArg(x)
 13751  		v.AddArg(v0)
 13752  		return true
 13753  	}
 13754  	// match: (Rsh16x64 x y)
 13755  	// cond: shiftIsBounded(v)
 13756  	// result: (SRAD (MOVHreg x) y)
 13757  	for {
 13758  		x := v_0
 13759  		y := v_1
 13760  		if !(shiftIsBounded(v)) {
 13761  			break
 13762  		}
 13763  		v.reset(OpPPC64SRAD)
 13764  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13765  		v0.AddArg(x)
 13766  		v.AddArg2(v0, y)
 13767  		return true
 13768  	}
 13769  	// match: (Rsh16x64 <t> x y)
 13770  	// result: (ISEL [0] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPUconst y [16]))
 13771  	for {
 13772  		t := v.Type
 13773  		x := v_0
 13774  		y := v_1
 13775  		v.reset(OpPPC64ISEL)
 13776  		v.AuxInt = int32ToAuxInt(0)
 13777  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13778  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13779  		v1.AddArg(x)
 13780  		v0.AddArg2(v1, y)
 13781  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13782  		v2.AuxInt = int64ToAuxInt(15)
 13783  		v2.AddArg(v1)
 13784  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13785  		v3.AuxInt = int64ToAuxInt(16)
 13786  		v3.AddArg(y)
 13787  		v.AddArg3(v0, v2, v3)
 13788  		return true
 13789  	}
 13790  }
 13791  func rewriteValuePPC64_OpRsh16x8(v *Value) bool {
 13792  	v_1 := v.Args[1]
 13793  	v_0 := v.Args[0]
 13794  	b := v.Block
 13795  	typ := &b.Func.Config.Types
 13796  	// match: (Rsh16x8 x y)
 13797  	// cond: shiftIsBounded(v)
 13798  	// result: (SRAD (MOVHreg x) y)
 13799  	for {
 13800  		x := v_0
 13801  		y := v_1
 13802  		if !(shiftIsBounded(v)) {
 13803  			break
 13804  		}
 13805  		v.reset(OpPPC64SRAD)
 13806  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13807  		v0.AddArg(x)
 13808  		v.AddArg2(v0, y)
 13809  		return true
 13810  	}
 13811  	// match: (Rsh16x8 <t> x y)
 13812  	// result: (ISEL [2] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPconst [0] (ANDconst [0x00F0] y)))
 13813  	for {
 13814  		t := v.Type
 13815  		x := v_0
 13816  		y := v_1
 13817  		v.reset(OpPPC64ISEL)
 13818  		v.AuxInt = int32ToAuxInt(2)
 13819  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13820  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13821  		v1.AddArg(x)
 13822  		v0.AddArg2(v1, y)
 13823  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13824  		v2.AuxInt = int64ToAuxInt(15)
 13825  		v2.AddArg(v1)
 13826  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13827  		v3.AuxInt = int64ToAuxInt(0)
 13828  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13829  		v4.AuxInt = int64ToAuxInt(0x00F0)
 13830  		v4.AddArg(y)
 13831  		v3.AddArg(v4)
 13832  		v.AddArg3(v0, v2, v3)
 13833  		return true
 13834  	}
 13835  }
 13836  func rewriteValuePPC64_OpRsh32Ux16(v *Value) bool {
 13837  	v_1 := v.Args[1]
 13838  	v_0 := v.Args[0]
 13839  	b := v.Block
 13840  	typ := &b.Func.Config.Types
 13841  	// match: (Rsh32Ux16 x y)
 13842  	// cond: shiftIsBounded(v)
 13843  	// result: (SRW x y)
 13844  	for {
 13845  		x := v_0
 13846  		y := v_1
 13847  		if !(shiftIsBounded(v)) {
 13848  			break
 13849  		}
 13850  		v.reset(OpPPC64SRW)
 13851  		v.AddArg2(x, y)
 13852  		return true
 13853  	}
 13854  	// match: (Rsh32Ux16 <t> x y)
 13855  	// result: (ISEL [2] (SRW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFE0] y)))
 13856  	for {
 13857  		t := v.Type
 13858  		x := v_0
 13859  		y := v_1
 13860  		v.reset(OpPPC64ISEL)
 13861  		v.AuxInt = int32ToAuxInt(2)
 13862  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13863  		v0.AddArg2(x, y)
 13864  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13865  		v1.AuxInt = int64ToAuxInt(0)
 13866  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13867  		v2.AuxInt = int64ToAuxInt(0)
 13868  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13869  		v3.AuxInt = int64ToAuxInt(0xFFE0)
 13870  		v3.AddArg(y)
 13871  		v2.AddArg(v3)
 13872  		v.AddArg3(v0, v1, v2)
 13873  		return true
 13874  	}
 13875  }
 13876  func rewriteValuePPC64_OpRsh32Ux32(v *Value) bool {
 13877  	v_1 := v.Args[1]
 13878  	v_0 := v.Args[0]
 13879  	b := v.Block
 13880  	typ := &b.Func.Config.Types
 13881  	// match: (Rsh32Ux32 x y)
 13882  	// cond: shiftIsBounded(v)
 13883  	// result: (SRW x y)
 13884  	for {
 13885  		x := v_0
 13886  		y := v_1
 13887  		if !(shiftIsBounded(v)) {
 13888  			break
 13889  		}
 13890  		v.reset(OpPPC64SRW)
 13891  		v.AddArg2(x, y)
 13892  		return true
 13893  	}
 13894  	// match: (Rsh32Ux32 <t> x y)
 13895  	// result: (ISEL [0] (SRW <t> x y) (MOVDconst [0]) (CMPWUconst y [32]))
 13896  	for {
 13897  		t := v.Type
 13898  		x := v_0
 13899  		y := v_1
 13900  		v.reset(OpPPC64ISEL)
 13901  		v.AuxInt = int32ToAuxInt(0)
 13902  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13903  		v0.AddArg2(x, y)
 13904  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13905  		v1.AuxInt = int64ToAuxInt(0)
 13906  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13907  		v2.AuxInt = int32ToAuxInt(32)
 13908  		v2.AddArg(y)
 13909  		v.AddArg3(v0, v1, v2)
 13910  		return true
 13911  	}
 13912  }
 13913  func rewriteValuePPC64_OpRsh32Ux64(v *Value) bool {
 13914  	v_1 := v.Args[1]
 13915  	v_0 := v.Args[0]
 13916  	b := v.Block
 13917  	typ := &b.Func.Config.Types
 13918  	// match: (Rsh32Ux64 x (MOVDconst [c]))
 13919  	// cond: uint64(c) < 32
 13920  	// result: (SRWconst x [c])
 13921  	for {
 13922  		x := v_0
 13923  		if v_1.Op != OpPPC64MOVDconst {
 13924  			break
 13925  		}
 13926  		c := auxIntToInt64(v_1.AuxInt)
 13927  		if !(uint64(c) < 32) {
 13928  			break
 13929  		}
 13930  		v.reset(OpPPC64SRWconst)
 13931  		v.AuxInt = int64ToAuxInt(c)
 13932  		v.AddArg(x)
 13933  		return true
 13934  	}
 13935  	// match: (Rsh32Ux64 x y)
 13936  	// cond: shiftIsBounded(v)
 13937  	// result: (SRW x y)
 13938  	for {
 13939  		x := v_0
 13940  		y := v_1
 13941  		if !(shiftIsBounded(v)) {
 13942  			break
 13943  		}
 13944  		v.reset(OpPPC64SRW)
 13945  		v.AddArg2(x, y)
 13946  		return true
 13947  	}
 13948  	// match: (Rsh32Ux64 <t> x y)
 13949  	// result: (ISEL [0] (SRW <t> x y) (MOVDconst [0]) (CMPUconst y [32]))
 13950  	for {
 13951  		t := v.Type
 13952  		x := v_0
 13953  		y := v_1
 13954  		v.reset(OpPPC64ISEL)
 13955  		v.AuxInt = int32ToAuxInt(0)
 13956  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13957  		v0.AddArg2(x, y)
 13958  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13959  		v1.AuxInt = int64ToAuxInt(0)
 13960  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13961  		v2.AuxInt = int64ToAuxInt(32)
 13962  		v2.AddArg(y)
 13963  		v.AddArg3(v0, v1, v2)
 13964  		return true
 13965  	}
 13966  }
 13967  func rewriteValuePPC64_OpRsh32Ux8(v *Value) bool {
 13968  	v_1 := v.Args[1]
 13969  	v_0 := v.Args[0]
 13970  	b := v.Block
 13971  	typ := &b.Func.Config.Types
 13972  	// match: (Rsh32Ux8 x y)
 13973  	// cond: shiftIsBounded(v)
 13974  	// result: (SRW x y)
 13975  	for {
 13976  		x := v_0
 13977  		y := v_1
 13978  		if !(shiftIsBounded(v)) {
 13979  			break
 13980  		}
 13981  		v.reset(OpPPC64SRW)
 13982  		v.AddArg2(x, y)
 13983  		return true
 13984  	}
 13985  	// match: (Rsh32Ux8 <t> x y)
 13986  	// result: (ISEL [2] (SRW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00E0] y)))
 13987  	for {
 13988  		t := v.Type
 13989  		x := v_0
 13990  		y := v_1
 13991  		v.reset(OpPPC64ISEL)
 13992  		v.AuxInt = int32ToAuxInt(2)
 13993  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13994  		v0.AddArg2(x, y)
 13995  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13996  		v1.AuxInt = int64ToAuxInt(0)
 13997  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13998  		v2.AuxInt = int64ToAuxInt(0)
 13999  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14000  		v3.AuxInt = int64ToAuxInt(0x00E0)
 14001  		v3.AddArg(y)
 14002  		v2.AddArg(v3)
 14003  		v.AddArg3(v0, v1, v2)
 14004  		return true
 14005  	}
 14006  }
 14007  func rewriteValuePPC64_OpRsh32x16(v *Value) bool {
 14008  	v_1 := v.Args[1]
 14009  	v_0 := v.Args[0]
 14010  	b := v.Block
 14011  	typ := &b.Func.Config.Types
 14012  	// match: (Rsh32x16 x y)
 14013  	// cond: shiftIsBounded(v)
 14014  	// result: (SRAW x y)
 14015  	for {
 14016  		x := v_0
 14017  		y := v_1
 14018  		if !(shiftIsBounded(v)) {
 14019  			break
 14020  		}
 14021  		v.reset(OpPPC64SRAW)
 14022  		v.AddArg2(x, y)
 14023  		return true
 14024  	}
 14025  	// match: (Rsh32x16 <t> x y)
 14026  	// result: (ISEL [2] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPconst [0] (ANDconst [0xFFE0] y)))
 14027  	for {
 14028  		t := v.Type
 14029  		x := v_0
 14030  		y := v_1
 14031  		v.reset(OpPPC64ISEL)
 14032  		v.AuxInt = int32ToAuxInt(2)
 14033  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 14034  		v0.AddArg2(x, y)
 14035  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 14036  		v1.AuxInt = int64ToAuxInt(31)
 14037  		v1.AddArg(x)
 14038  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14039  		v2.AuxInt = int64ToAuxInt(0)
 14040  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14041  		v3.AuxInt = int64ToAuxInt(0xFFE0)
 14042  		v3.AddArg(y)
 14043  		v2.AddArg(v3)
 14044  		v.AddArg3(v0, v1, v2)
 14045  		return true
 14046  	}
 14047  }
 14048  func rewriteValuePPC64_OpRsh32x32(v *Value) bool {
 14049  	v_1 := v.Args[1]
 14050  	v_0 := v.Args[0]
 14051  	b := v.Block
 14052  	// match: (Rsh32x32 x y)
 14053  	// cond: shiftIsBounded(v)
 14054  	// result: (SRAW x y)
 14055  	for {
 14056  		x := v_0
 14057  		y := v_1
 14058  		if !(shiftIsBounded(v)) {
 14059  			break
 14060  		}
 14061  		v.reset(OpPPC64SRAW)
 14062  		v.AddArg2(x, y)
 14063  		return true
 14064  	}
 14065  	// match: (Rsh32x32 <t> x y)
 14066  	// result: (ISEL [0] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPWUconst y [32]))
 14067  	for {
 14068  		t := v.Type
 14069  		x := v_0
 14070  		y := v_1
 14071  		v.reset(OpPPC64ISEL)
 14072  		v.AuxInt = int32ToAuxInt(0)
 14073  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 14074  		v0.AddArg2(x, y)
 14075  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 14076  		v1.AuxInt = int64ToAuxInt(31)
 14077  		v1.AddArg(x)
 14078  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14079  		v2.AuxInt = int32ToAuxInt(32)
 14080  		v2.AddArg(y)
 14081  		v.AddArg3(v0, v1, v2)
 14082  		return true
 14083  	}
 14084  }
 14085  func rewriteValuePPC64_OpRsh32x64(v *Value) bool {
 14086  	v_1 := v.Args[1]
 14087  	v_0 := v.Args[0]
 14088  	b := v.Block
 14089  	// match: (Rsh32x64 x (MOVDconst [c]))
 14090  	// cond: uint64(c) >= 32
 14091  	// result: (SRAWconst x [63])
 14092  	for {
 14093  		x := v_0
 14094  		if v_1.Op != OpPPC64MOVDconst {
 14095  			break
 14096  		}
 14097  		c := auxIntToInt64(v_1.AuxInt)
 14098  		if !(uint64(c) >= 32) {
 14099  			break
 14100  		}
 14101  		v.reset(OpPPC64SRAWconst)
 14102  		v.AuxInt = int64ToAuxInt(63)
 14103  		v.AddArg(x)
 14104  		return true
 14105  	}
 14106  	// match: (Rsh32x64 x (MOVDconst [c]))
 14107  	// cond: uint64(c) < 32
 14108  	// result: (SRAWconst x [c])
 14109  	for {
 14110  		x := v_0
 14111  		if v_1.Op != OpPPC64MOVDconst {
 14112  			break
 14113  		}
 14114  		c := auxIntToInt64(v_1.AuxInt)
 14115  		if !(uint64(c) < 32) {
 14116  			break
 14117  		}
 14118  		v.reset(OpPPC64SRAWconst)
 14119  		v.AuxInt = int64ToAuxInt(c)
 14120  		v.AddArg(x)
 14121  		return true
 14122  	}
 14123  	// match: (Rsh32x64 x y)
 14124  	// cond: shiftIsBounded(v)
 14125  	// result: (SRAW x y)
 14126  	for {
 14127  		x := v_0
 14128  		y := v_1
 14129  		if !(shiftIsBounded(v)) {
 14130  			break
 14131  		}
 14132  		v.reset(OpPPC64SRAW)
 14133  		v.AddArg2(x, y)
 14134  		return true
 14135  	}
 14136  	// match: (Rsh32x64 <t> x y)
 14137  	// result: (ISEL [0] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPUconst y [32]))
 14138  	for {
 14139  		t := v.Type
 14140  		x := v_0
 14141  		y := v_1
 14142  		v.reset(OpPPC64ISEL)
 14143  		v.AuxInt = int32ToAuxInt(0)
 14144  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 14145  		v0.AddArg2(x, y)
 14146  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 14147  		v1.AuxInt = int64ToAuxInt(31)
 14148  		v1.AddArg(x)
 14149  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14150  		v2.AuxInt = int64ToAuxInt(32)
 14151  		v2.AddArg(y)
 14152  		v.AddArg3(v0, v1, v2)
 14153  		return true
 14154  	}
 14155  }
 14156  func rewriteValuePPC64_OpRsh32x8(v *Value) bool {
 14157  	v_1 := v.Args[1]
 14158  	v_0 := v.Args[0]
 14159  	b := v.Block
 14160  	typ := &b.Func.Config.Types
 14161  	// match: (Rsh32x8 x y)
 14162  	// cond: shiftIsBounded(v)
 14163  	// result: (SRAW x y)
 14164  	for {
 14165  		x := v_0
 14166  		y := v_1
 14167  		if !(shiftIsBounded(v)) {
 14168  			break
 14169  		}
 14170  		v.reset(OpPPC64SRAW)
 14171  		v.AddArg2(x, y)
 14172  		return true
 14173  	}
 14174  	// match: (Rsh32x8 <t> x y)
 14175  	// result: (ISEL [2] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPconst [0] (ANDconst [0x00E0] y)))
 14176  	for {
 14177  		t := v.Type
 14178  		x := v_0
 14179  		y := v_1
 14180  		v.reset(OpPPC64ISEL)
 14181  		v.AuxInt = int32ToAuxInt(2)
 14182  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 14183  		v0.AddArg2(x, y)
 14184  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 14185  		v1.AuxInt = int64ToAuxInt(31)
 14186  		v1.AddArg(x)
 14187  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14188  		v2.AuxInt = int64ToAuxInt(0)
 14189  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14190  		v3.AuxInt = int64ToAuxInt(0x00E0)
 14191  		v3.AddArg(y)
 14192  		v2.AddArg(v3)
 14193  		v.AddArg3(v0, v1, v2)
 14194  		return true
 14195  	}
 14196  }
 14197  func rewriteValuePPC64_OpRsh64Ux16(v *Value) bool {
 14198  	v_1 := v.Args[1]
 14199  	v_0 := v.Args[0]
 14200  	b := v.Block
 14201  	typ := &b.Func.Config.Types
 14202  	// match: (Rsh64Ux16 x y)
 14203  	// cond: shiftIsBounded(v)
 14204  	// result: (SRD x y)
 14205  	for {
 14206  		x := v_0
 14207  		y := v_1
 14208  		if !(shiftIsBounded(v)) {
 14209  			break
 14210  		}
 14211  		v.reset(OpPPC64SRD)
 14212  		v.AddArg2(x, y)
 14213  		return true
 14214  	}
 14215  	// match: (Rsh64Ux16 <t> x y)
 14216  	// result: (ISEL [2] (SRD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFC0] y)))
 14217  	for {
 14218  		t := v.Type
 14219  		x := v_0
 14220  		y := v_1
 14221  		v.reset(OpPPC64ISEL)
 14222  		v.AuxInt = int32ToAuxInt(2)
 14223  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14224  		v0.AddArg2(x, y)
 14225  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14226  		v1.AuxInt = int64ToAuxInt(0)
 14227  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14228  		v2.AuxInt = int64ToAuxInt(0)
 14229  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14230  		v3.AuxInt = int64ToAuxInt(0xFFC0)
 14231  		v3.AddArg(y)
 14232  		v2.AddArg(v3)
 14233  		v.AddArg3(v0, v1, v2)
 14234  		return true
 14235  	}
 14236  }
 14237  func rewriteValuePPC64_OpRsh64Ux32(v *Value) bool {
 14238  	v_1 := v.Args[1]
 14239  	v_0 := v.Args[0]
 14240  	b := v.Block
 14241  	typ := &b.Func.Config.Types
 14242  	// match: (Rsh64Ux32 x y)
 14243  	// cond: shiftIsBounded(v)
 14244  	// result: (SRD x y)
 14245  	for {
 14246  		x := v_0
 14247  		y := v_1
 14248  		if !(shiftIsBounded(v)) {
 14249  			break
 14250  		}
 14251  		v.reset(OpPPC64SRD)
 14252  		v.AddArg2(x, y)
 14253  		return true
 14254  	}
 14255  	// match: (Rsh64Ux32 <t> x y)
 14256  	// result: (ISEL [0] (SRD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
 14257  	for {
 14258  		t := v.Type
 14259  		x := v_0
 14260  		y := v_1
 14261  		v.reset(OpPPC64ISEL)
 14262  		v.AuxInt = int32ToAuxInt(0)
 14263  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14264  		v0.AddArg2(x, y)
 14265  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14266  		v1.AuxInt = int64ToAuxInt(0)
 14267  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14268  		v2.AuxInt = int32ToAuxInt(64)
 14269  		v2.AddArg(y)
 14270  		v.AddArg3(v0, v1, v2)
 14271  		return true
 14272  	}
 14273  }
 14274  func rewriteValuePPC64_OpRsh64Ux64(v *Value) bool {
 14275  	v_1 := v.Args[1]
 14276  	v_0 := v.Args[0]
 14277  	b := v.Block
 14278  	typ := &b.Func.Config.Types
 14279  	// match: (Rsh64Ux64 x (MOVDconst [c]))
 14280  	// cond: uint64(c) < 64
 14281  	// result: (SRDconst x [c])
 14282  	for {
 14283  		x := v_0
 14284  		if v_1.Op != OpPPC64MOVDconst {
 14285  			break
 14286  		}
 14287  		c := auxIntToInt64(v_1.AuxInt)
 14288  		if !(uint64(c) < 64) {
 14289  			break
 14290  		}
 14291  		v.reset(OpPPC64SRDconst)
 14292  		v.AuxInt = int64ToAuxInt(c)
 14293  		v.AddArg(x)
 14294  		return true
 14295  	}
 14296  	// match: (Rsh64Ux64 x y)
 14297  	// cond: shiftIsBounded(v)
 14298  	// result: (SRD x y)
 14299  	for {
 14300  		x := v_0
 14301  		y := v_1
 14302  		if !(shiftIsBounded(v)) {
 14303  			break
 14304  		}
 14305  		v.reset(OpPPC64SRD)
 14306  		v.AddArg2(x, y)
 14307  		return true
 14308  	}
 14309  	// match: (Rsh64Ux64 <t> x y)
 14310  	// result: (ISEL [0] (SRD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
 14311  	for {
 14312  		t := v.Type
 14313  		x := v_0
 14314  		y := v_1
 14315  		v.reset(OpPPC64ISEL)
 14316  		v.AuxInt = int32ToAuxInt(0)
 14317  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14318  		v0.AddArg2(x, y)
 14319  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14320  		v1.AuxInt = int64ToAuxInt(0)
 14321  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14322  		v2.AuxInt = int64ToAuxInt(64)
 14323  		v2.AddArg(y)
 14324  		v.AddArg3(v0, v1, v2)
 14325  		return true
 14326  	}
 14327  }
 14328  func rewriteValuePPC64_OpRsh64Ux8(v *Value) bool {
 14329  	v_1 := v.Args[1]
 14330  	v_0 := v.Args[0]
 14331  	b := v.Block
 14332  	typ := &b.Func.Config.Types
 14333  	// match: (Rsh64Ux8 x y)
 14334  	// cond: shiftIsBounded(v)
 14335  	// result: (SRD x y)
 14336  	for {
 14337  		x := v_0
 14338  		y := v_1
 14339  		if !(shiftIsBounded(v)) {
 14340  			break
 14341  		}
 14342  		v.reset(OpPPC64SRD)
 14343  		v.AddArg2(x, y)
 14344  		return true
 14345  	}
 14346  	// match: (Rsh64Ux8 <t> x y)
 14347  	// result: (ISEL [2] (SRD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00C0] y)))
 14348  	for {
 14349  		t := v.Type
 14350  		x := v_0
 14351  		y := v_1
 14352  		v.reset(OpPPC64ISEL)
 14353  		v.AuxInt = int32ToAuxInt(2)
 14354  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14355  		v0.AddArg2(x, y)
 14356  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14357  		v1.AuxInt = int64ToAuxInt(0)
 14358  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14359  		v2.AuxInt = int64ToAuxInt(0)
 14360  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14361  		v3.AuxInt = int64ToAuxInt(0x00C0)
 14362  		v3.AddArg(y)
 14363  		v2.AddArg(v3)
 14364  		v.AddArg3(v0, v1, v2)
 14365  		return true
 14366  	}
 14367  }
 14368  func rewriteValuePPC64_OpRsh64x16(v *Value) bool {
 14369  	v_1 := v.Args[1]
 14370  	v_0 := v.Args[0]
 14371  	b := v.Block
 14372  	typ := &b.Func.Config.Types
 14373  	// match: (Rsh64x16 x y)
 14374  	// cond: shiftIsBounded(v)
 14375  	// result: (SRAD x y)
 14376  	for {
 14377  		x := v_0
 14378  		y := v_1
 14379  		if !(shiftIsBounded(v)) {
 14380  			break
 14381  		}
 14382  		v.reset(OpPPC64SRAD)
 14383  		v.AddArg2(x, y)
 14384  		return true
 14385  	}
 14386  	// match: (Rsh64x16 <t> x y)
 14387  	// result: (ISEL [2] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPconst [0] (ANDconst [0xFFC0] y)))
 14388  	for {
 14389  		t := v.Type
 14390  		x := v_0
 14391  		y := v_1
 14392  		v.reset(OpPPC64ISEL)
 14393  		v.AuxInt = int32ToAuxInt(2)
 14394  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14395  		v0.AddArg2(x, y)
 14396  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14397  		v1.AuxInt = int64ToAuxInt(63)
 14398  		v1.AddArg(x)
 14399  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14400  		v2.AuxInt = int64ToAuxInt(0)
 14401  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14402  		v3.AuxInt = int64ToAuxInt(0xFFC0)
 14403  		v3.AddArg(y)
 14404  		v2.AddArg(v3)
 14405  		v.AddArg3(v0, v1, v2)
 14406  		return true
 14407  	}
 14408  }
 14409  func rewriteValuePPC64_OpRsh64x32(v *Value) bool {
 14410  	v_1 := v.Args[1]
 14411  	v_0 := v.Args[0]
 14412  	b := v.Block
 14413  	// match: (Rsh64x32 x y)
 14414  	// cond: shiftIsBounded(v)
 14415  	// result: (SRAD x y)
 14416  	for {
 14417  		x := v_0
 14418  		y := v_1
 14419  		if !(shiftIsBounded(v)) {
 14420  			break
 14421  		}
 14422  		v.reset(OpPPC64SRAD)
 14423  		v.AddArg2(x, y)
 14424  		return true
 14425  	}
 14426  	// match: (Rsh64x32 <t> x y)
 14427  	// result: (ISEL [0] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPWUconst y [64]))
 14428  	for {
 14429  		t := v.Type
 14430  		x := v_0
 14431  		y := v_1
 14432  		v.reset(OpPPC64ISEL)
 14433  		v.AuxInt = int32ToAuxInt(0)
 14434  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14435  		v0.AddArg2(x, y)
 14436  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14437  		v1.AuxInt = int64ToAuxInt(63)
 14438  		v1.AddArg(x)
 14439  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14440  		v2.AuxInt = int32ToAuxInt(64)
 14441  		v2.AddArg(y)
 14442  		v.AddArg3(v0, v1, v2)
 14443  		return true
 14444  	}
 14445  }
 14446  func rewriteValuePPC64_OpRsh64x64(v *Value) bool {
 14447  	v_1 := v.Args[1]
 14448  	v_0 := v.Args[0]
 14449  	b := v.Block
 14450  	// match: (Rsh64x64 x (MOVDconst [c]))
 14451  	// cond: uint64(c) >= 64
 14452  	// result: (SRADconst x [63])
 14453  	for {
 14454  		x := v_0
 14455  		if v_1.Op != OpPPC64MOVDconst {
 14456  			break
 14457  		}
 14458  		c := auxIntToInt64(v_1.AuxInt)
 14459  		if !(uint64(c) >= 64) {
 14460  			break
 14461  		}
 14462  		v.reset(OpPPC64SRADconst)
 14463  		v.AuxInt = int64ToAuxInt(63)
 14464  		v.AddArg(x)
 14465  		return true
 14466  	}
 14467  	// match: (Rsh64x64 x (MOVDconst [c]))
 14468  	// cond: uint64(c) < 64
 14469  	// result: (SRADconst x [c])
 14470  	for {
 14471  		x := v_0
 14472  		if v_1.Op != OpPPC64MOVDconst {
 14473  			break
 14474  		}
 14475  		c := auxIntToInt64(v_1.AuxInt)
 14476  		if !(uint64(c) < 64) {
 14477  			break
 14478  		}
 14479  		v.reset(OpPPC64SRADconst)
 14480  		v.AuxInt = int64ToAuxInt(c)
 14481  		v.AddArg(x)
 14482  		return true
 14483  	}
 14484  	// match: (Rsh64x64 x y)
 14485  	// cond: shiftIsBounded(v)
 14486  	// result: (SRAD x y)
 14487  	for {
 14488  		x := v_0
 14489  		y := v_1
 14490  		if !(shiftIsBounded(v)) {
 14491  			break
 14492  		}
 14493  		v.reset(OpPPC64SRAD)
 14494  		v.AddArg2(x, y)
 14495  		return true
 14496  	}
 14497  	// match: (Rsh64x64 <t> x y)
 14498  	// result: (ISEL [0] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPUconst y [64]))
 14499  	for {
 14500  		t := v.Type
 14501  		x := v_0
 14502  		y := v_1
 14503  		v.reset(OpPPC64ISEL)
 14504  		v.AuxInt = int32ToAuxInt(0)
 14505  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14506  		v0.AddArg2(x, y)
 14507  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14508  		v1.AuxInt = int64ToAuxInt(63)
 14509  		v1.AddArg(x)
 14510  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14511  		v2.AuxInt = int64ToAuxInt(64)
 14512  		v2.AddArg(y)
 14513  		v.AddArg3(v0, v1, v2)
 14514  		return true
 14515  	}
 14516  }
 14517  func rewriteValuePPC64_OpRsh64x8(v *Value) bool {
 14518  	v_1 := v.Args[1]
 14519  	v_0 := v.Args[0]
 14520  	b := v.Block
 14521  	typ := &b.Func.Config.Types
 14522  	// match: (Rsh64x8 x y)
 14523  	// cond: shiftIsBounded(v)
 14524  	// result: (SRAD x y)
 14525  	for {
 14526  		x := v_0
 14527  		y := v_1
 14528  		if !(shiftIsBounded(v)) {
 14529  			break
 14530  		}
 14531  		v.reset(OpPPC64SRAD)
 14532  		v.AddArg2(x, y)
 14533  		return true
 14534  	}
 14535  	// match: (Rsh64x8 <t> x y)
 14536  	// result: (ISEL [2] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPconst [0] (ANDconst [0x00C0] y)))
 14537  	for {
 14538  		t := v.Type
 14539  		x := v_0
 14540  		y := v_1
 14541  		v.reset(OpPPC64ISEL)
 14542  		v.AuxInt = int32ToAuxInt(2)
 14543  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14544  		v0.AddArg2(x, y)
 14545  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14546  		v1.AuxInt = int64ToAuxInt(63)
 14547  		v1.AddArg(x)
 14548  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14549  		v2.AuxInt = int64ToAuxInt(0)
 14550  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14551  		v3.AuxInt = int64ToAuxInt(0x00C0)
 14552  		v3.AddArg(y)
 14553  		v2.AddArg(v3)
 14554  		v.AddArg3(v0, v1, v2)
 14555  		return true
 14556  	}
 14557  }
 14558  func rewriteValuePPC64_OpRsh8Ux16(v *Value) bool {
 14559  	v_1 := v.Args[1]
 14560  	v_0 := v.Args[0]
 14561  	b := v.Block
 14562  	typ := &b.Func.Config.Types
 14563  	// match: (Rsh8Ux16 x y)
 14564  	// cond: shiftIsBounded(v)
 14565  	// result: (SRD (MOVBZreg x) y)
 14566  	for {
 14567  		x := v_0
 14568  		y := v_1
 14569  		if !(shiftIsBounded(v)) {
 14570  			break
 14571  		}
 14572  		v.reset(OpPPC64SRD)
 14573  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14574  		v0.AddArg(x)
 14575  		v.AddArg2(v0, y)
 14576  		return true
 14577  	}
 14578  	// match: (Rsh8Ux16 <t> x y)
 14579  	// result: (ISEL [2] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF8] y)))
 14580  	for {
 14581  		t := v.Type
 14582  		x := v_0
 14583  		y := v_1
 14584  		v.reset(OpPPC64ISEL)
 14585  		v.AuxInt = int32ToAuxInt(2)
 14586  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14587  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14588  		v1.AddArg(x)
 14589  		v0.AddArg2(v1, y)
 14590  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14591  		v2.AuxInt = int64ToAuxInt(0)
 14592  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14593  		v3.AuxInt = int64ToAuxInt(0)
 14594  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14595  		v4.AuxInt = int64ToAuxInt(0xFFF8)
 14596  		v4.AddArg(y)
 14597  		v3.AddArg(v4)
 14598  		v.AddArg3(v0, v2, v3)
 14599  		return true
 14600  	}
 14601  }
 14602  func rewriteValuePPC64_OpRsh8Ux32(v *Value) bool {
 14603  	v_1 := v.Args[1]
 14604  	v_0 := v.Args[0]
 14605  	b := v.Block
 14606  	typ := &b.Func.Config.Types
 14607  	// match: (Rsh8Ux32 x y)
 14608  	// cond: shiftIsBounded(v)
 14609  	// result: (SRD (MOVBZreg x) y)
 14610  	for {
 14611  		x := v_0
 14612  		y := v_1
 14613  		if !(shiftIsBounded(v)) {
 14614  			break
 14615  		}
 14616  		v.reset(OpPPC64SRD)
 14617  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14618  		v0.AddArg(x)
 14619  		v.AddArg2(v0, y)
 14620  		return true
 14621  	}
 14622  	// match: (Rsh8Ux32 <t> x y)
 14623  	// result: (ISEL [0] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [8]))
 14624  	for {
 14625  		t := v.Type
 14626  		x := v_0
 14627  		y := v_1
 14628  		v.reset(OpPPC64ISEL)
 14629  		v.AuxInt = int32ToAuxInt(0)
 14630  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14631  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14632  		v1.AddArg(x)
 14633  		v0.AddArg2(v1, y)
 14634  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14635  		v2.AuxInt = int64ToAuxInt(0)
 14636  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14637  		v3.AuxInt = int32ToAuxInt(8)
 14638  		v3.AddArg(y)
 14639  		v.AddArg3(v0, v2, v3)
 14640  		return true
 14641  	}
 14642  }
 14643  func rewriteValuePPC64_OpRsh8Ux64(v *Value) bool {
 14644  	v_1 := v.Args[1]
 14645  	v_0 := v.Args[0]
 14646  	b := v.Block
 14647  	typ := &b.Func.Config.Types
 14648  	// match: (Rsh8Ux64 x (MOVDconst [c]))
 14649  	// cond: uint64(c) < 8
 14650  	// result: (SRWconst (ZeroExt8to32 x) [c])
 14651  	for {
 14652  		x := v_0
 14653  		if v_1.Op != OpPPC64MOVDconst {
 14654  			break
 14655  		}
 14656  		c := auxIntToInt64(v_1.AuxInt)
 14657  		if !(uint64(c) < 8) {
 14658  			break
 14659  		}
 14660  		v.reset(OpPPC64SRWconst)
 14661  		v.AuxInt = int64ToAuxInt(c)
 14662  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 14663  		v0.AddArg(x)
 14664  		v.AddArg(v0)
 14665  		return true
 14666  	}
 14667  	// match: (Rsh8Ux64 x y)
 14668  	// cond: shiftIsBounded(v)
 14669  	// result: (SRD (MOVBZreg x) y)
 14670  	for {
 14671  		x := v_0
 14672  		y := v_1
 14673  		if !(shiftIsBounded(v)) {
 14674  			break
 14675  		}
 14676  		v.reset(OpPPC64SRD)
 14677  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14678  		v0.AddArg(x)
 14679  		v.AddArg2(v0, y)
 14680  		return true
 14681  	}
 14682  	// match: (Rsh8Ux64 <t> x y)
 14683  	// result: (ISEL [0] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [8]))
 14684  	for {
 14685  		t := v.Type
 14686  		x := v_0
 14687  		y := v_1
 14688  		v.reset(OpPPC64ISEL)
 14689  		v.AuxInt = int32ToAuxInt(0)
 14690  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14691  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14692  		v1.AddArg(x)
 14693  		v0.AddArg2(v1, y)
 14694  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14695  		v2.AuxInt = int64ToAuxInt(0)
 14696  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14697  		v3.AuxInt = int64ToAuxInt(8)
 14698  		v3.AddArg(y)
 14699  		v.AddArg3(v0, v2, v3)
 14700  		return true
 14701  	}
 14702  }
 14703  func rewriteValuePPC64_OpRsh8Ux8(v *Value) bool {
 14704  	v_1 := v.Args[1]
 14705  	v_0 := v.Args[0]
 14706  	b := v.Block
 14707  	typ := &b.Func.Config.Types
 14708  	// match: (Rsh8Ux8 x y)
 14709  	// cond: shiftIsBounded(v)
 14710  	// result: (SRD (MOVBZreg x) y)
 14711  	for {
 14712  		x := v_0
 14713  		y := v_1
 14714  		if !(shiftIsBounded(v)) {
 14715  			break
 14716  		}
 14717  		v.reset(OpPPC64SRD)
 14718  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14719  		v0.AddArg(x)
 14720  		v.AddArg2(v0, y)
 14721  		return true
 14722  	}
 14723  	// match: (Rsh8Ux8 <t> x y)
 14724  	// result: (ISEL [2] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F8] y)))
 14725  	for {
 14726  		t := v.Type
 14727  		x := v_0
 14728  		y := v_1
 14729  		v.reset(OpPPC64ISEL)
 14730  		v.AuxInt = int32ToAuxInt(2)
 14731  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14732  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14733  		v1.AddArg(x)
 14734  		v0.AddArg2(v1, y)
 14735  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14736  		v2.AuxInt = int64ToAuxInt(0)
 14737  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14738  		v3.AuxInt = int64ToAuxInt(0)
 14739  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14740  		v4.AuxInt = int64ToAuxInt(0x00F8)
 14741  		v4.AddArg(y)
 14742  		v3.AddArg(v4)
 14743  		v.AddArg3(v0, v2, v3)
 14744  		return true
 14745  	}
 14746  }
 14747  func rewriteValuePPC64_OpRsh8x16(v *Value) bool {
 14748  	v_1 := v.Args[1]
 14749  	v_0 := v.Args[0]
 14750  	b := v.Block
 14751  	typ := &b.Func.Config.Types
 14752  	// match: (Rsh8x16 x y)
 14753  	// cond: shiftIsBounded(v)
 14754  	// result: (SRAD (MOVBreg x) y)
 14755  	for {
 14756  		x := v_0
 14757  		y := v_1
 14758  		if !(shiftIsBounded(v)) {
 14759  			break
 14760  		}
 14761  		v.reset(OpPPC64SRAD)
 14762  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14763  		v0.AddArg(x)
 14764  		v.AddArg2(v0, y)
 14765  		return true
 14766  	}
 14767  	// match: (Rsh8x16 <t> x y)
 14768  	// result: (ISEL [2] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPconst [0] (ANDconst [0xFFF8] y)))
 14769  	for {
 14770  		t := v.Type
 14771  		x := v_0
 14772  		y := v_1
 14773  		v.reset(OpPPC64ISEL)
 14774  		v.AuxInt = int32ToAuxInt(2)
 14775  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14776  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14777  		v1.AddArg(x)
 14778  		v0.AddArg2(v1, y)
 14779  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14780  		v2.AuxInt = int64ToAuxInt(7)
 14781  		v2.AddArg(v1)
 14782  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14783  		v3.AuxInt = int64ToAuxInt(0)
 14784  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14785  		v4.AuxInt = int64ToAuxInt(0xFFF8)
 14786  		v4.AddArg(y)
 14787  		v3.AddArg(v4)
 14788  		v.AddArg3(v0, v2, v3)
 14789  		return true
 14790  	}
 14791  }
 14792  func rewriteValuePPC64_OpRsh8x32(v *Value) bool {
 14793  	v_1 := v.Args[1]
 14794  	v_0 := v.Args[0]
 14795  	b := v.Block
 14796  	typ := &b.Func.Config.Types
 14797  	// match: (Rsh8x32 x y)
 14798  	// cond: shiftIsBounded(v)
 14799  	// result: (SRAD (MOVBreg x) y)
 14800  	for {
 14801  		x := v_0
 14802  		y := v_1
 14803  		if !(shiftIsBounded(v)) {
 14804  			break
 14805  		}
 14806  		v.reset(OpPPC64SRAD)
 14807  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14808  		v0.AddArg(x)
 14809  		v.AddArg2(v0, y)
 14810  		return true
 14811  	}
 14812  	// match: (Rsh8x32 <t> x y)
 14813  	// result: (ISEL [0] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPWUconst y [8]))
 14814  	for {
 14815  		t := v.Type
 14816  		x := v_0
 14817  		y := v_1
 14818  		v.reset(OpPPC64ISEL)
 14819  		v.AuxInt = int32ToAuxInt(0)
 14820  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14821  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14822  		v1.AddArg(x)
 14823  		v0.AddArg2(v1, y)
 14824  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14825  		v2.AuxInt = int64ToAuxInt(7)
 14826  		v2.AddArg(v1)
 14827  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14828  		v3.AuxInt = int32ToAuxInt(8)
 14829  		v3.AddArg(y)
 14830  		v.AddArg3(v0, v2, v3)
 14831  		return true
 14832  	}
 14833  }
 14834  func rewriteValuePPC64_OpRsh8x64(v *Value) bool {
 14835  	v_1 := v.Args[1]
 14836  	v_0 := v.Args[0]
 14837  	b := v.Block
 14838  	typ := &b.Func.Config.Types
 14839  	// match: (Rsh8x64 x (MOVDconst [c]))
 14840  	// cond: uint64(c) >= 8
 14841  	// result: (SRAWconst (SignExt8to32 x) [63])
 14842  	for {
 14843  		x := v_0
 14844  		if v_1.Op != OpPPC64MOVDconst {
 14845  			break
 14846  		}
 14847  		c := auxIntToInt64(v_1.AuxInt)
 14848  		if !(uint64(c) >= 8) {
 14849  			break
 14850  		}
 14851  		v.reset(OpPPC64SRAWconst)
 14852  		v.AuxInt = int64ToAuxInt(63)
 14853  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 14854  		v0.AddArg(x)
 14855  		v.AddArg(v0)
 14856  		return true
 14857  	}
 14858  	// match: (Rsh8x64 x (MOVDconst [c]))
 14859  	// cond: uint64(c) < 8
 14860  	// result: (SRAWconst (SignExt8to32 x) [c])
 14861  	for {
 14862  		x := v_0
 14863  		if v_1.Op != OpPPC64MOVDconst {
 14864  			break
 14865  		}
 14866  		c := auxIntToInt64(v_1.AuxInt)
 14867  		if !(uint64(c) < 8) {
 14868  			break
 14869  		}
 14870  		v.reset(OpPPC64SRAWconst)
 14871  		v.AuxInt = int64ToAuxInt(c)
 14872  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 14873  		v0.AddArg(x)
 14874  		v.AddArg(v0)
 14875  		return true
 14876  	}
 14877  	// match: (Rsh8x64 x y)
 14878  	// cond: shiftIsBounded(v)
 14879  	// result: (SRAD (MOVBreg x) y)
 14880  	for {
 14881  		x := v_0
 14882  		y := v_1
 14883  		if !(shiftIsBounded(v)) {
 14884  			break
 14885  		}
 14886  		v.reset(OpPPC64SRAD)
 14887  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14888  		v0.AddArg(x)
 14889  		v.AddArg2(v0, y)
 14890  		return true
 14891  	}
 14892  	// match: (Rsh8x64 <t> x y)
 14893  	// result: (ISEL [0] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPUconst y [8]))
 14894  	for {
 14895  		t := v.Type
 14896  		x := v_0
 14897  		y := v_1
 14898  		v.reset(OpPPC64ISEL)
 14899  		v.AuxInt = int32ToAuxInt(0)
 14900  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14901  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14902  		v1.AddArg(x)
 14903  		v0.AddArg2(v1, y)
 14904  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14905  		v2.AuxInt = int64ToAuxInt(7)
 14906  		v2.AddArg(v1)
 14907  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14908  		v3.AuxInt = int64ToAuxInt(8)
 14909  		v3.AddArg(y)
 14910  		v.AddArg3(v0, v2, v3)
 14911  		return true
 14912  	}
 14913  }
 14914  func rewriteValuePPC64_OpRsh8x8(v *Value) bool {
 14915  	v_1 := v.Args[1]
 14916  	v_0 := v.Args[0]
 14917  	b := v.Block
 14918  	typ := &b.Func.Config.Types
 14919  	// match: (Rsh8x8 x y)
 14920  	// cond: shiftIsBounded(v)
 14921  	// result: (SRAD (MOVBreg x) y)
 14922  	for {
 14923  		x := v_0
 14924  		y := v_1
 14925  		if !(shiftIsBounded(v)) {
 14926  			break
 14927  		}
 14928  		v.reset(OpPPC64SRAD)
 14929  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14930  		v0.AddArg(x)
 14931  		v.AddArg2(v0, y)
 14932  		return true
 14933  	}
 14934  	// match: (Rsh8x8 <t> x y)
 14935  	// result: (ISEL [2] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPconst [0] (ANDconst [0x00F8] y)))
 14936  	for {
 14937  		t := v.Type
 14938  		x := v_0
 14939  		y := v_1
 14940  		v.reset(OpPPC64ISEL)
 14941  		v.AuxInt = int32ToAuxInt(2)
 14942  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14943  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14944  		v1.AddArg(x)
 14945  		v0.AddArg2(v1, y)
 14946  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14947  		v2.AuxInt = int64ToAuxInt(7)
 14948  		v2.AddArg(v1)
 14949  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14950  		v3.AuxInt = int64ToAuxInt(0)
 14951  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14952  		v4.AuxInt = int64ToAuxInt(0x00F8)
 14953  		v4.AddArg(y)
 14954  		v3.AddArg(v4)
 14955  		v.AddArg3(v0, v2, v3)
 14956  		return true
 14957  	}
 14958  }
 14959  func rewriteValuePPC64_OpSelect0(v *Value) bool {
 14960  	v_0 := v.Args[0]
 14961  	b := v.Block
 14962  	typ := &b.Func.Config.Types
 14963  	// match: (Select0 (Mul64uhilo x y))
 14964  	// result: (MULHDU x y)
 14965  	for {
 14966  		if v_0.Op != OpMul64uhilo {
 14967  			break
 14968  		}
 14969  		y := v_0.Args[1]
 14970  		x := v_0.Args[0]
 14971  		v.reset(OpPPC64MULHDU)
 14972  		v.AddArg2(x, y)
 14973  		return true
 14974  	}
 14975  	// match: (Select0 (Mul64uover x y))
 14976  	// result: (MULLD x y)
 14977  	for {
 14978  		if v_0.Op != OpMul64uover {
 14979  			break
 14980  		}
 14981  		y := v_0.Args[1]
 14982  		x := v_0.Args[0]
 14983  		v.reset(OpPPC64MULLD)
 14984  		v.AddArg2(x, y)
 14985  		return true
 14986  	}
 14987  	// match: (Select0 (Add64carry x y c))
 14988  	// result: (Select0 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1]))))
 14989  	for {
 14990  		if v_0.Op != OpAdd64carry {
 14991  			break
 14992  		}
 14993  		c := v_0.Args[2]
 14994  		x := v_0.Args[0]
 14995  		y := v_0.Args[1]
 14996  		v.reset(OpSelect0)
 14997  		v.Type = typ.UInt64
 14998  		v0 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
 14999  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 15000  		v2 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 15001  		v2.AuxInt = int64ToAuxInt(-1)
 15002  		v2.AddArg(c)
 15003  		v1.AddArg(v2)
 15004  		v0.AddArg3(x, y, v1)
 15005  		v.AddArg(v0)
 15006  		return true
 15007  	}
 15008  	// match: (Select0 (Sub64borrow x y c))
 15009  	// result: (Select0 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0]))))
 15010  	for {
 15011  		if v_0.Op != OpSub64borrow {
 15012  			break
 15013  		}
 15014  		c := v_0.Args[2]
 15015  		x := v_0.Args[0]
 15016  		y := v_0.Args[1]
 15017  		v.reset(OpSelect0)
 15018  		v.Type = typ.UInt64
 15019  		v0 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
 15020  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 15021  		v2 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 15022  		v2.AuxInt = int64ToAuxInt(0)
 15023  		v2.AddArg(c)
 15024  		v1.AddArg(v2)
 15025  		v0.AddArg3(x, y, v1)
 15026  		v.AddArg(v0)
 15027  		return true
 15028  	}
 15029  	return false
 15030  }
 15031  func rewriteValuePPC64_OpSelect1(v *Value) bool {
 15032  	v_0 := v.Args[0]
 15033  	b := v.Block
 15034  	typ := &b.Func.Config.Types
 15035  	// match: (Select1 (Mul64uhilo x y))
 15036  	// result: (MULLD x y)
 15037  	for {
 15038  		if v_0.Op != OpMul64uhilo {
 15039  			break
 15040  		}
 15041  		y := v_0.Args[1]
 15042  		x := v_0.Args[0]
 15043  		v.reset(OpPPC64MULLD)
 15044  		v.AddArg2(x, y)
 15045  		return true
 15046  	}
 15047  	// match: (Select1 (Mul64uover x y))
 15048  	// result: (SETBCR [2] (CMPconst [0] (MULHDU <x.Type> x y)))
 15049  	for {
 15050  		if v_0.Op != OpMul64uover {
 15051  			break
 15052  		}
 15053  		y := v_0.Args[1]
 15054  		x := v_0.Args[0]
 15055  		v.reset(OpPPC64SETBCR)
 15056  		v.AuxInt = int32ToAuxInt(2)
 15057  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 15058  		v0.AuxInt = int64ToAuxInt(0)
 15059  		v1 := b.NewValue0(v.Pos, OpPPC64MULHDU, x.Type)
 15060  		v1.AddArg2(x, y)
 15061  		v0.AddArg(v1)
 15062  		v.AddArg(v0)
 15063  		return true
 15064  	}
 15065  	// match: (Select1 (Add64carry x y c))
 15066  	// result: (ADDZEzero (Select1 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1])))))
 15067  	for {
 15068  		if v_0.Op != OpAdd64carry {
 15069  			break
 15070  		}
 15071  		c := v_0.Args[2]
 15072  		x := v_0.Args[0]
 15073  		y := v_0.Args[1]
 15074  		v.reset(OpPPC64ADDZEzero)
 15075  		v0 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 15076  		v1 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
 15077  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 15078  		v3 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 15079  		v3.AuxInt = int64ToAuxInt(-1)
 15080  		v3.AddArg(c)
 15081  		v2.AddArg(v3)
 15082  		v1.AddArg3(x, y, v2)
 15083  		v0.AddArg(v1)
 15084  		v.AddArg(v0)
 15085  		return true
 15086  	}
 15087  	// match: (Select1 (ADDCconst n:(ADDZEzero x) [-1]))
 15088  	// cond: n.Uses <= 2
 15089  	// result: x
 15090  	for {
 15091  		if v_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_0.AuxInt) != -1 {
 15092  			break
 15093  		}
 15094  		n := v_0.Args[0]
 15095  		if n.Op != OpPPC64ADDZEzero {
 15096  			break
 15097  		}
 15098  		x := n.Args[0]
 15099  		if !(n.Uses <= 2) {
 15100  			break
 15101  		}
 15102  		v.copyOf(x)
 15103  		return true
 15104  	}
 15105  	// match: (Select1 (Sub64borrow x y c))
 15106  	// result: (NEG (SUBZEzero (Select1 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0]))))))
 15107  	for {
 15108  		if v_0.Op != OpSub64borrow {
 15109  			break
 15110  		}
 15111  		c := v_0.Args[2]
 15112  		x := v_0.Args[0]
 15113  		y := v_0.Args[1]
 15114  		v.reset(OpPPC64NEG)
 15115  		v0 := b.NewValue0(v.Pos, OpPPC64SUBZEzero, typ.UInt64)
 15116  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 15117  		v2 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
 15118  		v3 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 15119  		v4 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 15120  		v4.AuxInt = int64ToAuxInt(0)
 15121  		v4.AddArg(c)
 15122  		v3.AddArg(v4)
 15123  		v2.AddArg3(x, y, v3)
 15124  		v1.AddArg(v2)
 15125  		v0.AddArg(v1)
 15126  		v.AddArg(v0)
 15127  		return true
 15128  	}
 15129  	// match: (Select1 (SUBCconst n:(NEG (SUBZEzero x)) [0]))
 15130  	// cond: n.Uses <= 2
 15131  	// result: x
 15132  	for {
 15133  		if v_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_0.AuxInt) != 0 {
 15134  			break
 15135  		}
 15136  		n := v_0.Args[0]
 15137  		if n.Op != OpPPC64NEG {
 15138  			break
 15139  		}
 15140  		n_0 := n.Args[0]
 15141  		if n_0.Op != OpPPC64SUBZEzero {
 15142  			break
 15143  		}
 15144  		x := n_0.Args[0]
 15145  		if !(n.Uses <= 2) {
 15146  			break
 15147  		}
 15148  		v.copyOf(x)
 15149  		return true
 15150  	}
 15151  	return false
 15152  }
 15153  func rewriteValuePPC64_OpSelectN(v *Value) bool {
 15154  	v_0 := v.Args[0]
 15155  	b := v.Block
 15156  	config := b.Func.Config
 15157  	// match: (SelectN [0] call:(CALLstatic {sym} s1:(MOVDstore _ (MOVDconst [sz]) s2:(MOVDstore _ src s3:(MOVDstore {t} _ dst mem)))))
 15158  	// 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)
 15159  	// result: (Move [sz] dst src mem)
 15160  	for {
 15161  		if auxIntToInt64(v.AuxInt) != 0 {
 15162  			break
 15163  		}
 15164  		call := v_0
 15165  		if call.Op != OpPPC64CALLstatic || len(call.Args) != 1 {
 15166  			break
 15167  		}
 15168  		sym := auxToCall(call.Aux)
 15169  		s1 := call.Args[0]
 15170  		if s1.Op != OpPPC64MOVDstore {
 15171  			break
 15172  		}
 15173  		_ = s1.Args[2]
 15174  		s1_1 := s1.Args[1]
 15175  		if s1_1.Op != OpPPC64MOVDconst {
 15176  			break
 15177  		}
 15178  		sz := auxIntToInt64(s1_1.AuxInt)
 15179  		s2 := s1.Args[2]
 15180  		if s2.Op != OpPPC64MOVDstore {
 15181  			break
 15182  		}
 15183  		_ = s2.Args[2]
 15184  		src := s2.Args[1]
 15185  		s3 := s2.Args[2]
 15186  		if s3.Op != OpPPC64MOVDstore {
 15187  			break
 15188  		}
 15189  		mem := s3.Args[2]
 15190  		dst := s3.Args[1]
 15191  		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)) {
 15192  			break
 15193  		}
 15194  		v.reset(OpMove)
 15195  		v.AuxInt = int64ToAuxInt(sz)
 15196  		v.AddArg3(dst, src, mem)
 15197  		return true
 15198  	}
 15199  	// match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVDconst [sz]) mem))
 15200  	// cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)
 15201  	// result: (Move [sz] dst src mem)
 15202  	for {
 15203  		if auxIntToInt64(v.AuxInt) != 0 {
 15204  			break
 15205  		}
 15206  		call := v_0
 15207  		if call.Op != OpPPC64CALLstatic || len(call.Args) != 4 {
 15208  			break
 15209  		}
 15210  		sym := auxToCall(call.Aux)
 15211  		mem := call.Args[3]
 15212  		dst := call.Args[0]
 15213  		src := call.Args[1]
 15214  		call_2 := call.Args[2]
 15215  		if call_2.Op != OpPPC64MOVDconst {
 15216  			break
 15217  		}
 15218  		sz := auxIntToInt64(call_2.AuxInt)
 15219  		if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
 15220  			break
 15221  		}
 15222  		v.reset(OpMove)
 15223  		v.AuxInt = int64ToAuxInt(sz)
 15224  		v.AddArg3(dst, src, mem)
 15225  		return true
 15226  	}
 15227  	return false
 15228  }
 15229  func rewriteValuePPC64_OpSlicemask(v *Value) bool {
 15230  	v_0 := v.Args[0]
 15231  	b := v.Block
 15232  	// match: (Slicemask <t> x)
 15233  	// result: (SRADconst (NEG <t> x) [63])
 15234  	for {
 15235  		t := v.Type
 15236  		x := v_0
 15237  		v.reset(OpPPC64SRADconst)
 15238  		v.AuxInt = int64ToAuxInt(63)
 15239  		v0 := b.NewValue0(v.Pos, OpPPC64NEG, t)
 15240  		v0.AddArg(x)
 15241  		v.AddArg(v0)
 15242  		return true
 15243  	}
 15244  }
 15245  func rewriteValuePPC64_OpStore(v *Value) bool {
 15246  	v_2 := v.Args[2]
 15247  	v_1 := v.Args[1]
 15248  	v_0 := v.Args[0]
 15249  	// match: (Store {t} ptr val mem)
 15250  	// cond: t.Size() == 8 && t.IsFloat()
 15251  	// result: (FMOVDstore ptr val mem)
 15252  	for {
 15253  		t := auxToType(v.Aux)
 15254  		ptr := v_0
 15255  		val := v_1
 15256  		mem := v_2
 15257  		if !(t.Size() == 8 && t.IsFloat()) {
 15258  			break
 15259  		}
 15260  		v.reset(OpPPC64FMOVDstore)
 15261  		v.AddArg3(ptr, val, mem)
 15262  		return true
 15263  	}
 15264  	// match: (Store {t} ptr val mem)
 15265  	// cond: t.Size() == 4 && t.IsFloat()
 15266  	// result: (FMOVSstore ptr val mem)
 15267  	for {
 15268  		t := auxToType(v.Aux)
 15269  		ptr := v_0
 15270  		val := v_1
 15271  		mem := v_2
 15272  		if !(t.Size() == 4 && t.IsFloat()) {
 15273  			break
 15274  		}
 15275  		v.reset(OpPPC64FMOVSstore)
 15276  		v.AddArg3(ptr, val, mem)
 15277  		return true
 15278  	}
 15279  	// match: (Store {t} ptr val mem)
 15280  	// cond: t.Size() == 8 && !t.IsFloat()
 15281  	// result: (MOVDstore ptr val mem)
 15282  	for {
 15283  		t := auxToType(v.Aux)
 15284  		ptr := v_0
 15285  		val := v_1
 15286  		mem := v_2
 15287  		if !(t.Size() == 8 && !t.IsFloat()) {
 15288  			break
 15289  		}
 15290  		v.reset(OpPPC64MOVDstore)
 15291  		v.AddArg3(ptr, val, mem)
 15292  		return true
 15293  	}
 15294  	// match: (Store {t} ptr val mem)
 15295  	// cond: t.Size() == 4 && !t.IsFloat()
 15296  	// result: (MOVWstore ptr val mem)
 15297  	for {
 15298  		t := auxToType(v.Aux)
 15299  		ptr := v_0
 15300  		val := v_1
 15301  		mem := v_2
 15302  		if !(t.Size() == 4 && !t.IsFloat()) {
 15303  			break
 15304  		}
 15305  		v.reset(OpPPC64MOVWstore)
 15306  		v.AddArg3(ptr, val, mem)
 15307  		return true
 15308  	}
 15309  	// match: (Store {t} ptr val mem)
 15310  	// cond: t.Size() == 2
 15311  	// result: (MOVHstore ptr val mem)
 15312  	for {
 15313  		t := auxToType(v.Aux)
 15314  		ptr := v_0
 15315  		val := v_1
 15316  		mem := v_2
 15317  		if !(t.Size() == 2) {
 15318  			break
 15319  		}
 15320  		v.reset(OpPPC64MOVHstore)
 15321  		v.AddArg3(ptr, val, mem)
 15322  		return true
 15323  	}
 15324  	// match: (Store {t} ptr val mem)
 15325  	// cond: t.Size() == 1
 15326  	// result: (MOVBstore ptr val mem)
 15327  	for {
 15328  		t := auxToType(v.Aux)
 15329  		ptr := v_0
 15330  		val := v_1
 15331  		mem := v_2
 15332  		if !(t.Size() == 1) {
 15333  			break
 15334  		}
 15335  		v.reset(OpPPC64MOVBstore)
 15336  		v.AddArg3(ptr, val, mem)
 15337  		return true
 15338  	}
 15339  	return false
 15340  }
 15341  func rewriteValuePPC64_OpTrunc16to8(v *Value) bool {
 15342  	v_0 := v.Args[0]
 15343  	// match: (Trunc16to8 <t> x)
 15344  	// cond: t.IsSigned()
 15345  	// result: (MOVBreg x)
 15346  	for {
 15347  		t := v.Type
 15348  		x := v_0
 15349  		if !(t.IsSigned()) {
 15350  			break
 15351  		}
 15352  		v.reset(OpPPC64MOVBreg)
 15353  		v.AddArg(x)
 15354  		return true
 15355  	}
 15356  	// match: (Trunc16to8 x)
 15357  	// result: (MOVBZreg x)
 15358  	for {
 15359  		x := v_0
 15360  		v.reset(OpPPC64MOVBZreg)
 15361  		v.AddArg(x)
 15362  		return true
 15363  	}
 15364  }
 15365  func rewriteValuePPC64_OpTrunc32to16(v *Value) bool {
 15366  	v_0 := v.Args[0]
 15367  	// match: (Trunc32to16 <t> x)
 15368  	// cond: t.IsSigned()
 15369  	// result: (MOVHreg x)
 15370  	for {
 15371  		t := v.Type
 15372  		x := v_0
 15373  		if !(t.IsSigned()) {
 15374  			break
 15375  		}
 15376  		v.reset(OpPPC64MOVHreg)
 15377  		v.AddArg(x)
 15378  		return true
 15379  	}
 15380  	// match: (Trunc32to16 x)
 15381  	// result: (MOVHZreg x)
 15382  	for {
 15383  		x := v_0
 15384  		v.reset(OpPPC64MOVHZreg)
 15385  		v.AddArg(x)
 15386  		return true
 15387  	}
 15388  }
 15389  func rewriteValuePPC64_OpTrunc32to8(v *Value) bool {
 15390  	v_0 := v.Args[0]
 15391  	// match: (Trunc32to8 <t> x)
 15392  	// cond: t.IsSigned()
 15393  	// result: (MOVBreg x)
 15394  	for {
 15395  		t := v.Type
 15396  		x := v_0
 15397  		if !(t.IsSigned()) {
 15398  			break
 15399  		}
 15400  		v.reset(OpPPC64MOVBreg)
 15401  		v.AddArg(x)
 15402  		return true
 15403  	}
 15404  	// match: (Trunc32to8 x)
 15405  	// result: (MOVBZreg x)
 15406  	for {
 15407  		x := v_0
 15408  		v.reset(OpPPC64MOVBZreg)
 15409  		v.AddArg(x)
 15410  		return true
 15411  	}
 15412  }
 15413  func rewriteValuePPC64_OpTrunc64to16(v *Value) bool {
 15414  	v_0 := v.Args[0]
 15415  	// match: (Trunc64to16 <t> x)
 15416  	// cond: t.IsSigned()
 15417  	// result: (MOVHreg x)
 15418  	for {
 15419  		t := v.Type
 15420  		x := v_0
 15421  		if !(t.IsSigned()) {
 15422  			break
 15423  		}
 15424  		v.reset(OpPPC64MOVHreg)
 15425  		v.AddArg(x)
 15426  		return true
 15427  	}
 15428  	// match: (Trunc64to16 x)
 15429  	// result: (MOVHZreg x)
 15430  	for {
 15431  		x := v_0
 15432  		v.reset(OpPPC64MOVHZreg)
 15433  		v.AddArg(x)
 15434  		return true
 15435  	}
 15436  }
 15437  func rewriteValuePPC64_OpTrunc64to32(v *Value) bool {
 15438  	v_0 := v.Args[0]
 15439  	// match: (Trunc64to32 <t> x)
 15440  	// cond: t.IsSigned()
 15441  	// result: (MOVWreg x)
 15442  	for {
 15443  		t := v.Type
 15444  		x := v_0
 15445  		if !(t.IsSigned()) {
 15446  			break
 15447  		}
 15448  		v.reset(OpPPC64MOVWreg)
 15449  		v.AddArg(x)
 15450  		return true
 15451  	}
 15452  	// match: (Trunc64to32 x)
 15453  	// result: (MOVWZreg x)
 15454  	for {
 15455  		x := v_0
 15456  		v.reset(OpPPC64MOVWZreg)
 15457  		v.AddArg(x)
 15458  		return true
 15459  	}
 15460  }
 15461  func rewriteValuePPC64_OpTrunc64to8(v *Value) bool {
 15462  	v_0 := v.Args[0]
 15463  	// match: (Trunc64to8 <t> x)
 15464  	// cond: t.IsSigned()
 15465  	// result: (MOVBreg x)
 15466  	for {
 15467  		t := v.Type
 15468  		x := v_0
 15469  		if !(t.IsSigned()) {
 15470  			break
 15471  		}
 15472  		v.reset(OpPPC64MOVBreg)
 15473  		v.AddArg(x)
 15474  		return true
 15475  	}
 15476  	// match: (Trunc64to8 x)
 15477  	// result: (MOVBZreg x)
 15478  	for {
 15479  		x := v_0
 15480  		v.reset(OpPPC64MOVBZreg)
 15481  		v.AddArg(x)
 15482  		return true
 15483  	}
 15484  }
 15485  func rewriteValuePPC64_OpZero(v *Value) bool {
 15486  	v_1 := v.Args[1]
 15487  	v_0 := v.Args[0]
 15488  	b := v.Block
 15489  	// match: (Zero [0] _ mem)
 15490  	// result: mem
 15491  	for {
 15492  		if auxIntToInt64(v.AuxInt) != 0 {
 15493  			break
 15494  		}
 15495  		mem := v_1
 15496  		v.copyOf(mem)
 15497  		return true
 15498  	}
 15499  	// match: (Zero [1] destptr mem)
 15500  	// result: (MOVBstorezero destptr mem)
 15501  	for {
 15502  		if auxIntToInt64(v.AuxInt) != 1 {
 15503  			break
 15504  		}
 15505  		destptr := v_0
 15506  		mem := v_1
 15507  		v.reset(OpPPC64MOVBstorezero)
 15508  		v.AddArg2(destptr, mem)
 15509  		return true
 15510  	}
 15511  	// match: (Zero [2] destptr mem)
 15512  	// result: (MOVHstorezero destptr mem)
 15513  	for {
 15514  		if auxIntToInt64(v.AuxInt) != 2 {
 15515  			break
 15516  		}
 15517  		destptr := v_0
 15518  		mem := v_1
 15519  		v.reset(OpPPC64MOVHstorezero)
 15520  		v.AddArg2(destptr, mem)
 15521  		return true
 15522  	}
 15523  	// match: (Zero [3] destptr mem)
 15524  	// result: (MOVBstorezero [2] destptr (MOVHstorezero destptr mem))
 15525  	for {
 15526  		if auxIntToInt64(v.AuxInt) != 3 {
 15527  			break
 15528  		}
 15529  		destptr := v_0
 15530  		mem := v_1
 15531  		v.reset(OpPPC64MOVBstorezero)
 15532  		v.AuxInt = int32ToAuxInt(2)
 15533  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
 15534  		v0.AddArg2(destptr, mem)
 15535  		v.AddArg2(destptr, v0)
 15536  		return true
 15537  	}
 15538  	// match: (Zero [4] destptr mem)
 15539  	// result: (MOVWstorezero destptr mem)
 15540  	for {
 15541  		if auxIntToInt64(v.AuxInt) != 4 {
 15542  			break
 15543  		}
 15544  		destptr := v_0
 15545  		mem := v_1
 15546  		v.reset(OpPPC64MOVWstorezero)
 15547  		v.AddArg2(destptr, mem)
 15548  		return true
 15549  	}
 15550  	// match: (Zero [5] destptr mem)
 15551  	// result: (MOVBstorezero [4] destptr (MOVWstorezero destptr mem))
 15552  	for {
 15553  		if auxIntToInt64(v.AuxInt) != 5 {
 15554  			break
 15555  		}
 15556  		destptr := v_0
 15557  		mem := v_1
 15558  		v.reset(OpPPC64MOVBstorezero)
 15559  		v.AuxInt = int32ToAuxInt(4)
 15560  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15561  		v0.AddArg2(destptr, mem)
 15562  		v.AddArg2(destptr, v0)
 15563  		return true
 15564  	}
 15565  	// match: (Zero [6] destptr mem)
 15566  	// result: (MOVHstorezero [4] destptr (MOVWstorezero destptr mem))
 15567  	for {
 15568  		if auxIntToInt64(v.AuxInt) != 6 {
 15569  			break
 15570  		}
 15571  		destptr := v_0
 15572  		mem := v_1
 15573  		v.reset(OpPPC64MOVHstorezero)
 15574  		v.AuxInt = int32ToAuxInt(4)
 15575  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15576  		v0.AddArg2(destptr, mem)
 15577  		v.AddArg2(destptr, v0)
 15578  		return true
 15579  	}
 15580  	// match: (Zero [7] destptr mem)
 15581  	// result: (MOVBstorezero [6] destptr (MOVHstorezero [4] destptr (MOVWstorezero destptr mem)))
 15582  	for {
 15583  		if auxIntToInt64(v.AuxInt) != 7 {
 15584  			break
 15585  		}
 15586  		destptr := v_0
 15587  		mem := v_1
 15588  		v.reset(OpPPC64MOVBstorezero)
 15589  		v.AuxInt = int32ToAuxInt(6)
 15590  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
 15591  		v0.AuxInt = int32ToAuxInt(4)
 15592  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15593  		v1.AddArg2(destptr, mem)
 15594  		v0.AddArg2(destptr, v1)
 15595  		v.AddArg2(destptr, v0)
 15596  		return true
 15597  	}
 15598  	// match: (Zero [8] {t} destptr mem)
 15599  	// result: (MOVDstorezero destptr mem)
 15600  	for {
 15601  		if auxIntToInt64(v.AuxInt) != 8 {
 15602  			break
 15603  		}
 15604  		destptr := v_0
 15605  		mem := v_1
 15606  		v.reset(OpPPC64MOVDstorezero)
 15607  		v.AddArg2(destptr, mem)
 15608  		return true
 15609  	}
 15610  	// match: (Zero [12] {t} destptr mem)
 15611  	// result: (MOVWstorezero [8] destptr (MOVDstorezero [0] destptr mem))
 15612  	for {
 15613  		if auxIntToInt64(v.AuxInt) != 12 {
 15614  			break
 15615  		}
 15616  		destptr := v_0
 15617  		mem := v_1
 15618  		v.reset(OpPPC64MOVWstorezero)
 15619  		v.AuxInt = int32ToAuxInt(8)
 15620  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15621  		v0.AuxInt = int32ToAuxInt(0)
 15622  		v0.AddArg2(destptr, mem)
 15623  		v.AddArg2(destptr, v0)
 15624  		return true
 15625  	}
 15626  	// match: (Zero [16] {t} destptr mem)
 15627  	// result: (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))
 15628  	for {
 15629  		if auxIntToInt64(v.AuxInt) != 16 {
 15630  			break
 15631  		}
 15632  		destptr := v_0
 15633  		mem := v_1
 15634  		v.reset(OpPPC64MOVDstorezero)
 15635  		v.AuxInt = int32ToAuxInt(8)
 15636  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15637  		v0.AuxInt = int32ToAuxInt(0)
 15638  		v0.AddArg2(destptr, mem)
 15639  		v.AddArg2(destptr, v0)
 15640  		return true
 15641  	}
 15642  	// match: (Zero [24] {t} destptr mem)
 15643  	// result: (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem)))
 15644  	for {
 15645  		if auxIntToInt64(v.AuxInt) != 24 {
 15646  			break
 15647  		}
 15648  		destptr := v_0
 15649  		mem := v_1
 15650  		v.reset(OpPPC64MOVDstorezero)
 15651  		v.AuxInt = int32ToAuxInt(16)
 15652  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15653  		v0.AuxInt = int32ToAuxInt(8)
 15654  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15655  		v1.AuxInt = int32ToAuxInt(0)
 15656  		v1.AddArg2(destptr, mem)
 15657  		v0.AddArg2(destptr, v1)
 15658  		v.AddArg2(destptr, v0)
 15659  		return true
 15660  	}
 15661  	// match: (Zero [32] {t} destptr mem)
 15662  	// result: (MOVDstorezero [24] destptr (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))))
 15663  	for {
 15664  		if auxIntToInt64(v.AuxInt) != 32 {
 15665  			break
 15666  		}
 15667  		destptr := v_0
 15668  		mem := v_1
 15669  		v.reset(OpPPC64MOVDstorezero)
 15670  		v.AuxInt = int32ToAuxInt(24)
 15671  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15672  		v0.AuxInt = int32ToAuxInt(16)
 15673  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15674  		v1.AuxInt = int32ToAuxInt(8)
 15675  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15676  		v2.AuxInt = int32ToAuxInt(0)
 15677  		v2.AddArg2(destptr, mem)
 15678  		v1.AddArg2(destptr, v2)
 15679  		v0.AddArg2(destptr, v1)
 15680  		v.AddArg2(destptr, v0)
 15681  		return true
 15682  	}
 15683  	// match: (Zero [s] ptr mem)
 15684  	// cond: buildcfg.GOPPC64 <= 8 && s < 64
 15685  	// result: (LoweredZeroShort [s] ptr mem)
 15686  	for {
 15687  		s := auxIntToInt64(v.AuxInt)
 15688  		ptr := v_0
 15689  		mem := v_1
 15690  		if !(buildcfg.GOPPC64 <= 8 && s < 64) {
 15691  			break
 15692  		}
 15693  		v.reset(OpPPC64LoweredZeroShort)
 15694  		v.AuxInt = int64ToAuxInt(s)
 15695  		v.AddArg2(ptr, mem)
 15696  		return true
 15697  	}
 15698  	// match: (Zero [s] ptr mem)
 15699  	// cond: buildcfg.GOPPC64 <= 8
 15700  	// result: (LoweredZero [s] ptr mem)
 15701  	for {
 15702  		s := auxIntToInt64(v.AuxInt)
 15703  		ptr := v_0
 15704  		mem := v_1
 15705  		if !(buildcfg.GOPPC64 <= 8) {
 15706  			break
 15707  		}
 15708  		v.reset(OpPPC64LoweredZero)
 15709  		v.AuxInt = int64ToAuxInt(s)
 15710  		v.AddArg2(ptr, mem)
 15711  		return true
 15712  	}
 15713  	// match: (Zero [s] ptr mem)
 15714  	// cond: s < 128 && buildcfg.GOPPC64 >= 9
 15715  	// result: (LoweredQuadZeroShort [s] ptr mem)
 15716  	for {
 15717  		s := auxIntToInt64(v.AuxInt)
 15718  		ptr := v_0
 15719  		mem := v_1
 15720  		if !(s < 128 && buildcfg.GOPPC64 >= 9) {
 15721  			break
 15722  		}
 15723  		v.reset(OpPPC64LoweredQuadZeroShort)
 15724  		v.AuxInt = int64ToAuxInt(s)
 15725  		v.AddArg2(ptr, mem)
 15726  		return true
 15727  	}
 15728  	// match: (Zero [s] ptr mem)
 15729  	// cond: buildcfg.GOPPC64 >= 9
 15730  	// result: (LoweredQuadZero [s] ptr mem)
 15731  	for {
 15732  		s := auxIntToInt64(v.AuxInt)
 15733  		ptr := v_0
 15734  		mem := v_1
 15735  		if !(buildcfg.GOPPC64 >= 9) {
 15736  			break
 15737  		}
 15738  		v.reset(OpPPC64LoweredQuadZero)
 15739  		v.AuxInt = int64ToAuxInt(s)
 15740  		v.AddArg2(ptr, mem)
 15741  		return true
 15742  	}
 15743  	return false
 15744  }
 15745  func rewriteBlockPPC64(b *Block) bool {
 15746  	typ := &b.Func.Config.Types
 15747  	switch b.Kind {
 15748  	case block.BlockPPC64EQ:
 15749  		// match: (EQ (FlagEQ) yes no)
 15750  		// result: (First yes no)
 15751  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15752  			b.Reset(block.BlockFirst)
 15753  			return true
 15754  		}
 15755  		// match: (EQ (FlagLT) yes no)
 15756  		// result: (First no yes)
 15757  		for b.Controls[0].Op == OpPPC64FlagLT {
 15758  			b.Reset(block.BlockFirst)
 15759  			b.swapSuccessors()
 15760  			return true
 15761  		}
 15762  		// match: (EQ (FlagGT) yes no)
 15763  		// result: (First no yes)
 15764  		for b.Controls[0].Op == OpPPC64FlagGT {
 15765  			b.Reset(block.BlockFirst)
 15766  			b.swapSuccessors()
 15767  			return true
 15768  		}
 15769  		// match: (EQ (InvertFlags cmp) yes no)
 15770  		// result: (EQ cmp yes no)
 15771  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15772  			v_0 := b.Controls[0]
 15773  			cmp := v_0.Args[0]
 15774  			b.resetWithControl(block.BlockPPC64EQ, cmp)
 15775  			return true
 15776  		}
 15777  		// match: (EQ (CMPconst [0] z:(AND x y)) yes no)
 15778  		// cond: z.Uses == 1
 15779  		// result: (EQ (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15780  		for b.Controls[0].Op == OpPPC64CMPconst {
 15781  			v_0 := b.Controls[0]
 15782  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15783  				break
 15784  			}
 15785  			z := v_0.Args[0]
 15786  			if z.Op != OpPPC64AND {
 15787  				break
 15788  			}
 15789  			_ = z.Args[1]
 15790  			z_0 := z.Args[0]
 15791  			z_1 := z.Args[1]
 15792  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15793  				x := z_0
 15794  				y := z_1
 15795  				if !(z.Uses == 1) {
 15796  					continue
 15797  				}
 15798  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15799  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15800  				v1.AddArg2(x, y)
 15801  				v0.AddArg(v1)
 15802  				b.resetWithControl(block.BlockPPC64EQ, v0)
 15803  				return true
 15804  			}
 15805  			break
 15806  		}
 15807  		// match: (EQ (CMPconst [0] z:(OR x y)) yes no)
 15808  		// cond: z.Uses == 1
 15809  		// result: (EQ (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15810  		for b.Controls[0].Op == OpPPC64CMPconst {
 15811  			v_0 := b.Controls[0]
 15812  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15813  				break
 15814  			}
 15815  			z := v_0.Args[0]
 15816  			if z.Op != OpPPC64OR {
 15817  				break
 15818  			}
 15819  			_ = z.Args[1]
 15820  			z_0 := z.Args[0]
 15821  			z_1 := z.Args[1]
 15822  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15823  				x := z_0
 15824  				y := z_1
 15825  				if !(z.Uses == 1) {
 15826  					continue
 15827  				}
 15828  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15829  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15830  				v1.AddArg2(x, y)
 15831  				v0.AddArg(v1)
 15832  				b.resetWithControl(block.BlockPPC64EQ, v0)
 15833  				return true
 15834  			}
 15835  			break
 15836  		}
 15837  		// match: (EQ (CMPconst [0] z:(XOR x y)) yes no)
 15838  		// cond: z.Uses == 1
 15839  		// result: (EQ (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15840  		for b.Controls[0].Op == OpPPC64CMPconst {
 15841  			v_0 := b.Controls[0]
 15842  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15843  				break
 15844  			}
 15845  			z := v_0.Args[0]
 15846  			if z.Op != OpPPC64XOR {
 15847  				break
 15848  			}
 15849  			_ = z.Args[1]
 15850  			z_0 := z.Args[0]
 15851  			z_1 := z.Args[1]
 15852  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15853  				x := z_0
 15854  				y := z_1
 15855  				if !(z.Uses == 1) {
 15856  					continue
 15857  				}
 15858  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15859  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15860  				v1.AddArg2(x, y)
 15861  				v0.AddArg(v1)
 15862  				b.resetWithControl(block.BlockPPC64EQ, v0)
 15863  				return true
 15864  			}
 15865  			break
 15866  		}
 15867  	case block.BlockPPC64GE:
 15868  		// match: (GE (FlagEQ) yes no)
 15869  		// result: (First yes no)
 15870  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15871  			b.Reset(block.BlockFirst)
 15872  			return true
 15873  		}
 15874  		// match: (GE (FlagLT) yes no)
 15875  		// result: (First no yes)
 15876  		for b.Controls[0].Op == OpPPC64FlagLT {
 15877  			b.Reset(block.BlockFirst)
 15878  			b.swapSuccessors()
 15879  			return true
 15880  		}
 15881  		// match: (GE (FlagGT) yes no)
 15882  		// result: (First yes no)
 15883  		for b.Controls[0].Op == OpPPC64FlagGT {
 15884  			b.Reset(block.BlockFirst)
 15885  			return true
 15886  		}
 15887  		// match: (GE (InvertFlags cmp) yes no)
 15888  		// result: (LE cmp yes no)
 15889  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15890  			v_0 := b.Controls[0]
 15891  			cmp := v_0.Args[0]
 15892  			b.resetWithControl(block.BlockPPC64LE, cmp)
 15893  			return true
 15894  		}
 15895  		// match: (GE (CMPconst [0] z:(AND x y)) yes no)
 15896  		// cond: z.Uses == 1
 15897  		// result: (GE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15898  		for b.Controls[0].Op == OpPPC64CMPconst {
 15899  			v_0 := b.Controls[0]
 15900  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15901  				break
 15902  			}
 15903  			z := v_0.Args[0]
 15904  			if z.Op != OpPPC64AND {
 15905  				break
 15906  			}
 15907  			_ = z.Args[1]
 15908  			z_0 := z.Args[0]
 15909  			z_1 := z.Args[1]
 15910  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15911  				x := z_0
 15912  				y := z_1
 15913  				if !(z.Uses == 1) {
 15914  					continue
 15915  				}
 15916  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15917  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15918  				v1.AddArg2(x, y)
 15919  				v0.AddArg(v1)
 15920  				b.resetWithControl(block.BlockPPC64GE, v0)
 15921  				return true
 15922  			}
 15923  			break
 15924  		}
 15925  		// match: (GE (CMPconst [0] z:(OR x y)) yes no)
 15926  		// cond: z.Uses == 1
 15927  		// result: (GE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15928  		for b.Controls[0].Op == OpPPC64CMPconst {
 15929  			v_0 := b.Controls[0]
 15930  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15931  				break
 15932  			}
 15933  			z := v_0.Args[0]
 15934  			if z.Op != OpPPC64OR {
 15935  				break
 15936  			}
 15937  			_ = z.Args[1]
 15938  			z_0 := z.Args[0]
 15939  			z_1 := z.Args[1]
 15940  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15941  				x := z_0
 15942  				y := z_1
 15943  				if !(z.Uses == 1) {
 15944  					continue
 15945  				}
 15946  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15947  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15948  				v1.AddArg2(x, y)
 15949  				v0.AddArg(v1)
 15950  				b.resetWithControl(block.BlockPPC64GE, v0)
 15951  				return true
 15952  			}
 15953  			break
 15954  		}
 15955  		// match: (GE (CMPconst [0] z:(XOR x y)) yes no)
 15956  		// cond: z.Uses == 1
 15957  		// result: (GE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15958  		for b.Controls[0].Op == OpPPC64CMPconst {
 15959  			v_0 := b.Controls[0]
 15960  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15961  				break
 15962  			}
 15963  			z := v_0.Args[0]
 15964  			if z.Op != OpPPC64XOR {
 15965  				break
 15966  			}
 15967  			_ = z.Args[1]
 15968  			z_0 := z.Args[0]
 15969  			z_1 := z.Args[1]
 15970  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15971  				x := z_0
 15972  				y := z_1
 15973  				if !(z.Uses == 1) {
 15974  					continue
 15975  				}
 15976  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15977  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15978  				v1.AddArg2(x, y)
 15979  				v0.AddArg(v1)
 15980  				b.resetWithControl(block.BlockPPC64GE, v0)
 15981  				return true
 15982  			}
 15983  			break
 15984  		}
 15985  	case block.BlockPPC64GT:
 15986  		// match: (GT (FlagEQ) yes no)
 15987  		// result: (First no yes)
 15988  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15989  			b.Reset(block.BlockFirst)
 15990  			b.swapSuccessors()
 15991  			return true
 15992  		}
 15993  		// match: (GT (FlagLT) yes no)
 15994  		// result: (First no yes)
 15995  		for b.Controls[0].Op == OpPPC64FlagLT {
 15996  			b.Reset(block.BlockFirst)
 15997  			b.swapSuccessors()
 15998  			return true
 15999  		}
 16000  		// match: (GT (FlagGT) yes no)
 16001  		// result: (First yes no)
 16002  		for b.Controls[0].Op == OpPPC64FlagGT {
 16003  			b.Reset(block.BlockFirst)
 16004  			return true
 16005  		}
 16006  		// match: (GT (InvertFlags cmp) yes no)
 16007  		// result: (LT cmp yes no)
 16008  		for b.Controls[0].Op == OpPPC64InvertFlags {
 16009  			v_0 := b.Controls[0]
 16010  			cmp := v_0.Args[0]
 16011  			b.resetWithControl(block.BlockPPC64LT, cmp)
 16012  			return true
 16013  		}
 16014  		// match: (GT (CMPconst [0] z:(AND x y)) yes no)
 16015  		// cond: z.Uses == 1
 16016  		// result: (GT (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 16017  		for b.Controls[0].Op == OpPPC64CMPconst {
 16018  			v_0 := b.Controls[0]
 16019  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16020  				break
 16021  			}
 16022  			z := v_0.Args[0]
 16023  			if z.Op != OpPPC64AND {
 16024  				break
 16025  			}
 16026  			_ = z.Args[1]
 16027  			z_0 := z.Args[0]
 16028  			z_1 := z.Args[1]
 16029  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16030  				x := z_0
 16031  				y := z_1
 16032  				if !(z.Uses == 1) {
 16033  					continue
 16034  				}
 16035  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16036  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16037  				v1.AddArg2(x, y)
 16038  				v0.AddArg(v1)
 16039  				b.resetWithControl(block.BlockPPC64GT, v0)
 16040  				return true
 16041  			}
 16042  			break
 16043  		}
 16044  		// match: (GT (CMPconst [0] z:(OR x y)) yes no)
 16045  		// cond: z.Uses == 1
 16046  		// result: (GT (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16047  		for b.Controls[0].Op == OpPPC64CMPconst {
 16048  			v_0 := b.Controls[0]
 16049  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16050  				break
 16051  			}
 16052  			z := v_0.Args[0]
 16053  			if z.Op != OpPPC64OR {
 16054  				break
 16055  			}
 16056  			_ = z.Args[1]
 16057  			z_0 := z.Args[0]
 16058  			z_1 := z.Args[1]
 16059  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16060  				x := z_0
 16061  				y := z_1
 16062  				if !(z.Uses == 1) {
 16063  					continue
 16064  				}
 16065  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16066  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16067  				v1.AddArg2(x, y)
 16068  				v0.AddArg(v1)
 16069  				b.resetWithControl(block.BlockPPC64GT, v0)
 16070  				return true
 16071  			}
 16072  			break
 16073  		}
 16074  		// match: (GT (CMPconst [0] z:(XOR x y)) yes no)
 16075  		// cond: z.Uses == 1
 16076  		// result: (GT (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16077  		for b.Controls[0].Op == OpPPC64CMPconst {
 16078  			v_0 := b.Controls[0]
 16079  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16080  				break
 16081  			}
 16082  			z := v_0.Args[0]
 16083  			if z.Op != OpPPC64XOR {
 16084  				break
 16085  			}
 16086  			_ = z.Args[1]
 16087  			z_0 := z.Args[0]
 16088  			z_1 := z.Args[1]
 16089  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16090  				x := z_0
 16091  				y := z_1
 16092  				if !(z.Uses == 1) {
 16093  					continue
 16094  				}
 16095  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16096  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16097  				v1.AddArg2(x, y)
 16098  				v0.AddArg(v1)
 16099  				b.resetWithControl(block.BlockPPC64GT, v0)
 16100  				return true
 16101  			}
 16102  			break
 16103  		}
 16104  	case block.BlockIf:
 16105  		// match: (If (Equal cc) yes no)
 16106  		// result: (EQ cc yes no)
 16107  		for b.Controls[0].Op == OpPPC64Equal {
 16108  			v_0 := b.Controls[0]
 16109  			cc := v_0.Args[0]
 16110  			b.resetWithControl(block.BlockPPC64EQ, cc)
 16111  			return true
 16112  		}
 16113  		// match: (If (NotEqual cc) yes no)
 16114  		// result: (NE cc yes no)
 16115  		for b.Controls[0].Op == OpPPC64NotEqual {
 16116  			v_0 := b.Controls[0]
 16117  			cc := v_0.Args[0]
 16118  			b.resetWithControl(block.BlockPPC64NE, cc)
 16119  			return true
 16120  		}
 16121  		// match: (If (LessThan cc) yes no)
 16122  		// result: (LT cc yes no)
 16123  		for b.Controls[0].Op == OpPPC64LessThan {
 16124  			v_0 := b.Controls[0]
 16125  			cc := v_0.Args[0]
 16126  			b.resetWithControl(block.BlockPPC64LT, cc)
 16127  			return true
 16128  		}
 16129  		// match: (If (LessEqual cc) yes no)
 16130  		// result: (LE cc yes no)
 16131  		for b.Controls[0].Op == OpPPC64LessEqual {
 16132  			v_0 := b.Controls[0]
 16133  			cc := v_0.Args[0]
 16134  			b.resetWithControl(block.BlockPPC64LE, cc)
 16135  			return true
 16136  		}
 16137  		// match: (If (GreaterThan cc) yes no)
 16138  		// result: (GT cc yes no)
 16139  		for b.Controls[0].Op == OpPPC64GreaterThan {
 16140  			v_0 := b.Controls[0]
 16141  			cc := v_0.Args[0]
 16142  			b.resetWithControl(block.BlockPPC64GT, cc)
 16143  			return true
 16144  		}
 16145  		// match: (If (GreaterEqual cc) yes no)
 16146  		// result: (GE cc yes no)
 16147  		for b.Controls[0].Op == OpPPC64GreaterEqual {
 16148  			v_0 := b.Controls[0]
 16149  			cc := v_0.Args[0]
 16150  			b.resetWithControl(block.BlockPPC64GE, cc)
 16151  			return true
 16152  		}
 16153  		// match: (If (FLessThan cc) yes no)
 16154  		// result: (FLT cc yes no)
 16155  		for b.Controls[0].Op == OpPPC64FLessThan {
 16156  			v_0 := b.Controls[0]
 16157  			cc := v_0.Args[0]
 16158  			b.resetWithControl(block.BlockPPC64FLT, cc)
 16159  			return true
 16160  		}
 16161  		// match: (If (FLessEqual cc) yes no)
 16162  		// result: (FLE cc yes no)
 16163  		for b.Controls[0].Op == OpPPC64FLessEqual {
 16164  			v_0 := b.Controls[0]
 16165  			cc := v_0.Args[0]
 16166  			b.resetWithControl(block.BlockPPC64FLE, cc)
 16167  			return true
 16168  		}
 16169  		// match: (If (FGreaterThan cc) yes no)
 16170  		// result: (FGT cc yes no)
 16171  		for b.Controls[0].Op == OpPPC64FGreaterThan {
 16172  			v_0 := b.Controls[0]
 16173  			cc := v_0.Args[0]
 16174  			b.resetWithControl(block.BlockPPC64FGT, cc)
 16175  			return true
 16176  		}
 16177  		// match: (If (FGreaterEqual cc) yes no)
 16178  		// result: (FGE cc yes no)
 16179  		for b.Controls[0].Op == OpPPC64FGreaterEqual {
 16180  			v_0 := b.Controls[0]
 16181  			cc := v_0.Args[0]
 16182  			b.resetWithControl(block.BlockPPC64FGE, cc)
 16183  			return true
 16184  		}
 16185  		// match: (If cond yes no)
 16186  		// result: (NE (CMPconst [0] (ANDconst [1] cond)) yes no)
 16187  		for {
 16188  			cond := b.Controls[0]
 16189  			v0 := b.NewValue0(cond.Pos, OpPPC64CMPconst, types.TypeFlags)
 16190  			v0.AuxInt = int64ToAuxInt(0)
 16191  			v1 := b.NewValue0(cond.Pos, OpPPC64ANDconst, typ.Int)
 16192  			v1.AuxInt = int64ToAuxInt(1)
 16193  			v1.AddArg(cond)
 16194  			v0.AddArg(v1)
 16195  			b.resetWithControl(block.BlockPPC64NE, v0)
 16196  			return true
 16197  		}
 16198  	case block.BlockPPC64LE:
 16199  		// match: (LE (FlagEQ) yes no)
 16200  		// result: (First yes no)
 16201  		for b.Controls[0].Op == OpPPC64FlagEQ {
 16202  			b.Reset(block.BlockFirst)
 16203  			return true
 16204  		}
 16205  		// match: (LE (FlagLT) yes no)
 16206  		// result: (First yes no)
 16207  		for b.Controls[0].Op == OpPPC64FlagLT {
 16208  			b.Reset(block.BlockFirst)
 16209  			return true
 16210  		}
 16211  		// match: (LE (FlagGT) yes no)
 16212  		// result: (First no yes)
 16213  		for b.Controls[0].Op == OpPPC64FlagGT {
 16214  			b.Reset(block.BlockFirst)
 16215  			b.swapSuccessors()
 16216  			return true
 16217  		}
 16218  		// match: (LE (InvertFlags cmp) yes no)
 16219  		// result: (GE cmp yes no)
 16220  		for b.Controls[0].Op == OpPPC64InvertFlags {
 16221  			v_0 := b.Controls[0]
 16222  			cmp := v_0.Args[0]
 16223  			b.resetWithControl(block.BlockPPC64GE, cmp)
 16224  			return true
 16225  		}
 16226  		// match: (LE (CMPconst [0] z:(AND x y)) yes no)
 16227  		// cond: z.Uses == 1
 16228  		// result: (LE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 16229  		for b.Controls[0].Op == OpPPC64CMPconst {
 16230  			v_0 := b.Controls[0]
 16231  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16232  				break
 16233  			}
 16234  			z := v_0.Args[0]
 16235  			if z.Op != OpPPC64AND {
 16236  				break
 16237  			}
 16238  			_ = z.Args[1]
 16239  			z_0 := z.Args[0]
 16240  			z_1 := z.Args[1]
 16241  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16242  				x := z_0
 16243  				y := z_1
 16244  				if !(z.Uses == 1) {
 16245  					continue
 16246  				}
 16247  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16248  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16249  				v1.AddArg2(x, y)
 16250  				v0.AddArg(v1)
 16251  				b.resetWithControl(block.BlockPPC64LE, v0)
 16252  				return true
 16253  			}
 16254  			break
 16255  		}
 16256  		// match: (LE (CMPconst [0] z:(OR x y)) yes no)
 16257  		// cond: z.Uses == 1
 16258  		// result: (LE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16259  		for b.Controls[0].Op == OpPPC64CMPconst {
 16260  			v_0 := b.Controls[0]
 16261  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16262  				break
 16263  			}
 16264  			z := v_0.Args[0]
 16265  			if z.Op != OpPPC64OR {
 16266  				break
 16267  			}
 16268  			_ = z.Args[1]
 16269  			z_0 := z.Args[0]
 16270  			z_1 := z.Args[1]
 16271  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16272  				x := z_0
 16273  				y := z_1
 16274  				if !(z.Uses == 1) {
 16275  					continue
 16276  				}
 16277  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16278  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16279  				v1.AddArg2(x, y)
 16280  				v0.AddArg(v1)
 16281  				b.resetWithControl(block.BlockPPC64LE, v0)
 16282  				return true
 16283  			}
 16284  			break
 16285  		}
 16286  		// match: (LE (CMPconst [0] z:(XOR x y)) yes no)
 16287  		// cond: z.Uses == 1
 16288  		// result: (LE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16289  		for b.Controls[0].Op == OpPPC64CMPconst {
 16290  			v_0 := b.Controls[0]
 16291  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16292  				break
 16293  			}
 16294  			z := v_0.Args[0]
 16295  			if z.Op != OpPPC64XOR {
 16296  				break
 16297  			}
 16298  			_ = z.Args[1]
 16299  			z_0 := z.Args[0]
 16300  			z_1 := z.Args[1]
 16301  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16302  				x := z_0
 16303  				y := z_1
 16304  				if !(z.Uses == 1) {
 16305  					continue
 16306  				}
 16307  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16308  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16309  				v1.AddArg2(x, y)
 16310  				v0.AddArg(v1)
 16311  				b.resetWithControl(block.BlockPPC64LE, v0)
 16312  				return true
 16313  			}
 16314  			break
 16315  		}
 16316  	case block.BlockPPC64LT:
 16317  		// match: (LT (FlagEQ) yes no)
 16318  		// result: (First no yes)
 16319  		for b.Controls[0].Op == OpPPC64FlagEQ {
 16320  			b.Reset(block.BlockFirst)
 16321  			b.swapSuccessors()
 16322  			return true
 16323  		}
 16324  		// match: (LT (FlagLT) yes no)
 16325  		// result: (First yes no)
 16326  		for b.Controls[0].Op == OpPPC64FlagLT {
 16327  			b.Reset(block.BlockFirst)
 16328  			return true
 16329  		}
 16330  		// match: (LT (FlagGT) yes no)
 16331  		// result: (First no yes)
 16332  		for b.Controls[0].Op == OpPPC64FlagGT {
 16333  			b.Reset(block.BlockFirst)
 16334  			b.swapSuccessors()
 16335  			return true
 16336  		}
 16337  		// match: (LT (InvertFlags cmp) yes no)
 16338  		// result: (GT cmp yes no)
 16339  		for b.Controls[0].Op == OpPPC64InvertFlags {
 16340  			v_0 := b.Controls[0]
 16341  			cmp := v_0.Args[0]
 16342  			b.resetWithControl(block.BlockPPC64GT, cmp)
 16343  			return true
 16344  		}
 16345  		// match: (LT (CMPconst [0] z:(AND x y)) yes no)
 16346  		// cond: z.Uses == 1
 16347  		// result: (LT (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 16348  		for b.Controls[0].Op == OpPPC64CMPconst {
 16349  			v_0 := b.Controls[0]
 16350  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16351  				break
 16352  			}
 16353  			z := v_0.Args[0]
 16354  			if z.Op != OpPPC64AND {
 16355  				break
 16356  			}
 16357  			_ = z.Args[1]
 16358  			z_0 := z.Args[0]
 16359  			z_1 := z.Args[1]
 16360  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16361  				x := z_0
 16362  				y := z_1
 16363  				if !(z.Uses == 1) {
 16364  					continue
 16365  				}
 16366  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16367  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16368  				v1.AddArg2(x, y)
 16369  				v0.AddArg(v1)
 16370  				b.resetWithControl(block.BlockPPC64LT, v0)
 16371  				return true
 16372  			}
 16373  			break
 16374  		}
 16375  		// match: (LT (CMPconst [0] z:(OR x y)) yes no)
 16376  		// cond: z.Uses == 1
 16377  		// result: (LT (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16378  		for b.Controls[0].Op == OpPPC64CMPconst {
 16379  			v_0 := b.Controls[0]
 16380  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16381  				break
 16382  			}
 16383  			z := v_0.Args[0]
 16384  			if z.Op != OpPPC64OR {
 16385  				break
 16386  			}
 16387  			_ = z.Args[1]
 16388  			z_0 := z.Args[0]
 16389  			z_1 := z.Args[1]
 16390  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16391  				x := z_0
 16392  				y := z_1
 16393  				if !(z.Uses == 1) {
 16394  					continue
 16395  				}
 16396  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16397  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16398  				v1.AddArg2(x, y)
 16399  				v0.AddArg(v1)
 16400  				b.resetWithControl(block.BlockPPC64LT, v0)
 16401  				return true
 16402  			}
 16403  			break
 16404  		}
 16405  		// match: (LT (CMPconst [0] z:(XOR x y)) yes no)
 16406  		// cond: z.Uses == 1
 16407  		// result: (LT (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16408  		for b.Controls[0].Op == OpPPC64CMPconst {
 16409  			v_0 := b.Controls[0]
 16410  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16411  				break
 16412  			}
 16413  			z := v_0.Args[0]
 16414  			if z.Op != OpPPC64XOR {
 16415  				break
 16416  			}
 16417  			_ = z.Args[1]
 16418  			z_0 := z.Args[0]
 16419  			z_1 := z.Args[1]
 16420  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16421  				x := z_0
 16422  				y := z_1
 16423  				if !(z.Uses == 1) {
 16424  					continue
 16425  				}
 16426  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16427  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16428  				v1.AddArg2(x, y)
 16429  				v0.AddArg(v1)
 16430  				b.resetWithControl(block.BlockPPC64LT, v0)
 16431  				return true
 16432  			}
 16433  			break
 16434  		}
 16435  	case block.BlockPPC64NE:
 16436  		// match: (NE (CMPconst [0] (ANDconst [1] (Equal cc))) yes no)
 16437  		// result: (EQ cc yes no)
 16438  		for b.Controls[0].Op == OpPPC64CMPconst {
 16439  			v_0 := b.Controls[0]
 16440  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16441  				break
 16442  			}
 16443  			v_0_0 := v_0.Args[0]
 16444  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16445  				break
 16446  			}
 16447  			v_0_0_0 := v_0_0.Args[0]
 16448  			if v_0_0_0.Op != OpPPC64Equal {
 16449  				break
 16450  			}
 16451  			cc := v_0_0_0.Args[0]
 16452  			b.resetWithControl(block.BlockPPC64EQ, cc)
 16453  			return true
 16454  		}
 16455  		// match: (NE (CMPconst [0] (ANDconst [1] (NotEqual cc))) yes no)
 16456  		// result: (NE cc yes no)
 16457  		for b.Controls[0].Op == OpPPC64CMPconst {
 16458  			v_0 := b.Controls[0]
 16459  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16460  				break
 16461  			}
 16462  			v_0_0 := v_0.Args[0]
 16463  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16464  				break
 16465  			}
 16466  			v_0_0_0 := v_0_0.Args[0]
 16467  			if v_0_0_0.Op != OpPPC64NotEqual {
 16468  				break
 16469  			}
 16470  			cc := v_0_0_0.Args[0]
 16471  			b.resetWithControl(block.BlockPPC64NE, cc)
 16472  			return true
 16473  		}
 16474  		// match: (NE (CMPconst [0] (ANDconst [1] (LessThan cc))) yes no)
 16475  		// result: (LT cc yes no)
 16476  		for b.Controls[0].Op == OpPPC64CMPconst {
 16477  			v_0 := b.Controls[0]
 16478  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16479  				break
 16480  			}
 16481  			v_0_0 := v_0.Args[0]
 16482  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16483  				break
 16484  			}
 16485  			v_0_0_0 := v_0_0.Args[0]
 16486  			if v_0_0_0.Op != OpPPC64LessThan {
 16487  				break
 16488  			}
 16489  			cc := v_0_0_0.Args[0]
 16490  			b.resetWithControl(block.BlockPPC64LT, cc)
 16491  			return true
 16492  		}
 16493  		// match: (NE (CMPconst [0] (ANDconst [1] (LessEqual cc))) yes no)
 16494  		// result: (LE cc yes no)
 16495  		for b.Controls[0].Op == OpPPC64CMPconst {
 16496  			v_0 := b.Controls[0]
 16497  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16498  				break
 16499  			}
 16500  			v_0_0 := v_0.Args[0]
 16501  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16502  				break
 16503  			}
 16504  			v_0_0_0 := v_0_0.Args[0]
 16505  			if v_0_0_0.Op != OpPPC64LessEqual {
 16506  				break
 16507  			}
 16508  			cc := v_0_0_0.Args[0]
 16509  			b.resetWithControl(block.BlockPPC64LE, cc)
 16510  			return true
 16511  		}
 16512  		// match: (NE (CMPconst [0] (ANDconst [1] (GreaterThan cc))) yes no)
 16513  		// result: (GT cc yes no)
 16514  		for b.Controls[0].Op == OpPPC64CMPconst {
 16515  			v_0 := b.Controls[0]
 16516  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16517  				break
 16518  			}
 16519  			v_0_0 := v_0.Args[0]
 16520  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16521  				break
 16522  			}
 16523  			v_0_0_0 := v_0_0.Args[0]
 16524  			if v_0_0_0.Op != OpPPC64GreaterThan {
 16525  				break
 16526  			}
 16527  			cc := v_0_0_0.Args[0]
 16528  			b.resetWithControl(block.BlockPPC64GT, cc)
 16529  			return true
 16530  		}
 16531  		// match: (NE (CMPconst [0] (ANDconst [1] (GreaterEqual cc))) yes no)
 16532  		// result: (GE cc yes no)
 16533  		for b.Controls[0].Op == OpPPC64CMPconst {
 16534  			v_0 := b.Controls[0]
 16535  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16536  				break
 16537  			}
 16538  			v_0_0 := v_0.Args[0]
 16539  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16540  				break
 16541  			}
 16542  			v_0_0_0 := v_0_0.Args[0]
 16543  			if v_0_0_0.Op != OpPPC64GreaterEqual {
 16544  				break
 16545  			}
 16546  			cc := v_0_0_0.Args[0]
 16547  			b.resetWithControl(block.BlockPPC64GE, cc)
 16548  			return true
 16549  		}
 16550  		// match: (NE (CMPconst [0] (ANDconst [1] (FLessThan cc))) yes no)
 16551  		// result: (FLT cc yes no)
 16552  		for b.Controls[0].Op == OpPPC64CMPconst {
 16553  			v_0 := b.Controls[0]
 16554  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16555  				break
 16556  			}
 16557  			v_0_0 := v_0.Args[0]
 16558  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16559  				break
 16560  			}
 16561  			v_0_0_0 := v_0_0.Args[0]
 16562  			if v_0_0_0.Op != OpPPC64FLessThan {
 16563  				break
 16564  			}
 16565  			cc := v_0_0_0.Args[0]
 16566  			b.resetWithControl(block.BlockPPC64FLT, cc)
 16567  			return true
 16568  		}
 16569  		// match: (NE (CMPconst [0] (ANDconst [1] (FLessEqual cc))) yes no)
 16570  		// result: (FLE cc yes no)
 16571  		for b.Controls[0].Op == OpPPC64CMPconst {
 16572  			v_0 := b.Controls[0]
 16573  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16574  				break
 16575  			}
 16576  			v_0_0 := v_0.Args[0]
 16577  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16578  				break
 16579  			}
 16580  			v_0_0_0 := v_0_0.Args[0]
 16581  			if v_0_0_0.Op != OpPPC64FLessEqual {
 16582  				break
 16583  			}
 16584  			cc := v_0_0_0.Args[0]
 16585  			b.resetWithControl(block.BlockPPC64FLE, cc)
 16586  			return true
 16587  		}
 16588  		// match: (NE (CMPconst [0] (ANDconst [1] (FGreaterThan cc))) yes no)
 16589  		// result: (FGT cc yes no)
 16590  		for b.Controls[0].Op == OpPPC64CMPconst {
 16591  			v_0 := b.Controls[0]
 16592  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16593  				break
 16594  			}
 16595  			v_0_0 := v_0.Args[0]
 16596  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16597  				break
 16598  			}
 16599  			v_0_0_0 := v_0_0.Args[0]
 16600  			if v_0_0_0.Op != OpPPC64FGreaterThan {
 16601  				break
 16602  			}
 16603  			cc := v_0_0_0.Args[0]
 16604  			b.resetWithControl(block.BlockPPC64FGT, cc)
 16605  			return true
 16606  		}
 16607  		// match: (NE (CMPconst [0] (ANDconst [1] (FGreaterEqual cc))) yes no)
 16608  		// result: (FGE cc yes no)
 16609  		for b.Controls[0].Op == OpPPC64CMPconst {
 16610  			v_0 := b.Controls[0]
 16611  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16612  				break
 16613  			}
 16614  			v_0_0 := v_0.Args[0]
 16615  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16616  				break
 16617  			}
 16618  			v_0_0_0 := v_0_0.Args[0]
 16619  			if v_0_0_0.Op != OpPPC64FGreaterEqual {
 16620  				break
 16621  			}
 16622  			cc := v_0_0_0.Args[0]
 16623  			b.resetWithControl(block.BlockPPC64FGE, cc)
 16624  			return true
 16625  		}
 16626  		// match: (NE (FlagEQ) yes no)
 16627  		// result: (First no yes)
 16628  		for b.Controls[0].Op == OpPPC64FlagEQ {
 16629  			b.Reset(block.BlockFirst)
 16630  			b.swapSuccessors()
 16631  			return true
 16632  		}
 16633  		// match: (NE (FlagLT) yes no)
 16634  		// result: (First yes no)
 16635  		for b.Controls[0].Op == OpPPC64FlagLT {
 16636  			b.Reset(block.BlockFirst)
 16637  			return true
 16638  		}
 16639  		// match: (NE (FlagGT) yes no)
 16640  		// result: (First yes no)
 16641  		for b.Controls[0].Op == OpPPC64FlagGT {
 16642  			b.Reset(block.BlockFirst)
 16643  			return true
 16644  		}
 16645  		// match: (NE (InvertFlags cmp) yes no)
 16646  		// result: (NE cmp yes no)
 16647  		for b.Controls[0].Op == OpPPC64InvertFlags {
 16648  			v_0 := b.Controls[0]
 16649  			cmp := v_0.Args[0]
 16650  			b.resetWithControl(block.BlockPPC64NE, cmp)
 16651  			return true
 16652  		}
 16653  		// match: (NE (CMPconst [0] z:(AND x y)) yes no)
 16654  		// cond: z.Uses == 1
 16655  		// result: (NE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 16656  		for b.Controls[0].Op == OpPPC64CMPconst {
 16657  			v_0 := b.Controls[0]
 16658  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16659  				break
 16660  			}
 16661  			z := v_0.Args[0]
 16662  			if z.Op != OpPPC64AND {
 16663  				break
 16664  			}
 16665  			_ = z.Args[1]
 16666  			z_0 := z.Args[0]
 16667  			z_1 := z.Args[1]
 16668  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16669  				x := z_0
 16670  				y := z_1
 16671  				if !(z.Uses == 1) {
 16672  					continue
 16673  				}
 16674  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16675  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16676  				v1.AddArg2(x, y)
 16677  				v0.AddArg(v1)
 16678  				b.resetWithControl(block.BlockPPC64NE, v0)
 16679  				return true
 16680  			}
 16681  			break
 16682  		}
 16683  		// match: (NE (CMPconst [0] z:(OR x y)) yes no)
 16684  		// cond: z.Uses == 1
 16685  		// result: (NE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16686  		for b.Controls[0].Op == OpPPC64CMPconst {
 16687  			v_0 := b.Controls[0]
 16688  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16689  				break
 16690  			}
 16691  			z := v_0.Args[0]
 16692  			if z.Op != OpPPC64OR {
 16693  				break
 16694  			}
 16695  			_ = z.Args[1]
 16696  			z_0 := z.Args[0]
 16697  			z_1 := z.Args[1]
 16698  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16699  				x := z_0
 16700  				y := z_1
 16701  				if !(z.Uses == 1) {
 16702  					continue
 16703  				}
 16704  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16705  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16706  				v1.AddArg2(x, y)
 16707  				v0.AddArg(v1)
 16708  				b.resetWithControl(block.BlockPPC64NE, v0)
 16709  				return true
 16710  			}
 16711  			break
 16712  		}
 16713  		// match: (NE (CMPconst [0] z:(XOR x y)) yes no)
 16714  		// cond: z.Uses == 1
 16715  		// result: (NE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16716  		for b.Controls[0].Op == OpPPC64CMPconst {
 16717  			v_0 := b.Controls[0]
 16718  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16719  				break
 16720  			}
 16721  			z := v_0.Args[0]
 16722  			if z.Op != OpPPC64XOR {
 16723  				break
 16724  			}
 16725  			_ = z.Args[1]
 16726  			z_0 := z.Args[0]
 16727  			z_1 := z.Args[1]
 16728  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16729  				x := z_0
 16730  				y := z_1
 16731  				if !(z.Uses == 1) {
 16732  					continue
 16733  				}
 16734  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16735  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16736  				v1.AddArg2(x, y)
 16737  				v0.AddArg(v1)
 16738  				b.resetWithControl(block.BlockPPC64NE, v0)
 16739  				return true
 16740  			}
 16741  			break
 16742  		}
 16743  	}
 16744  	return false
 16745  }
 16746  

View as plain text