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  
     9  func rewriteValuePPC64(v *Value) bool {
    10  	switch v.Op {
    11  	case OpAbs:
    12  		v.Op = OpPPC64FABS
    13  		return true
    14  	case OpAdd16:
    15  		v.Op = OpPPC64ADD
    16  		return true
    17  	case OpAdd32:
    18  		v.Op = OpPPC64ADD
    19  		return true
    20  	case OpAdd32F:
    21  		v.Op = OpPPC64FADDS
    22  		return true
    23  	case OpAdd64:
    24  		v.Op = OpPPC64ADD
    25  		return true
    26  	case OpAdd64F:
    27  		v.Op = OpPPC64FADD
    28  		return true
    29  	case OpAdd8:
    30  		v.Op = OpPPC64ADD
    31  		return true
    32  	case OpAddPtr:
    33  		v.Op = OpPPC64ADD
    34  		return true
    35  	case OpAddr:
    36  		return rewriteValuePPC64_OpAddr(v)
    37  	case OpAnd16:
    38  		v.Op = OpPPC64AND
    39  		return true
    40  	case OpAnd32:
    41  		v.Op = OpPPC64AND
    42  		return true
    43  	case OpAnd64:
    44  		v.Op = OpPPC64AND
    45  		return true
    46  	case OpAnd8:
    47  		v.Op = OpPPC64AND
    48  		return true
    49  	case OpAndB:
    50  		v.Op = OpPPC64AND
    51  		return true
    52  	case OpAtomicAdd32:
    53  		v.Op = OpPPC64LoweredAtomicAdd32
    54  		return true
    55  	case OpAtomicAdd64:
    56  		v.Op = OpPPC64LoweredAtomicAdd64
    57  		return true
    58  	case OpAtomicAnd32:
    59  		v.Op = OpPPC64LoweredAtomicAnd32
    60  		return true
    61  	case OpAtomicAnd8:
    62  		v.Op = OpPPC64LoweredAtomicAnd8
    63  		return true
    64  	case OpAtomicCompareAndSwap32:
    65  		return rewriteValuePPC64_OpAtomicCompareAndSwap32(v)
    66  	case OpAtomicCompareAndSwap64:
    67  		return rewriteValuePPC64_OpAtomicCompareAndSwap64(v)
    68  	case OpAtomicCompareAndSwapRel32:
    69  		return rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v)
    70  	case OpAtomicExchange32:
    71  		v.Op = OpPPC64LoweredAtomicExchange32
    72  		return true
    73  	case OpAtomicExchange64:
    74  		v.Op = OpPPC64LoweredAtomicExchange64
    75  		return true
    76  	case OpAtomicExchange8:
    77  		v.Op = OpPPC64LoweredAtomicExchange8
    78  		return true
    79  	case OpAtomicLoad32:
    80  		return rewriteValuePPC64_OpAtomicLoad32(v)
    81  	case OpAtomicLoad64:
    82  		return rewriteValuePPC64_OpAtomicLoad64(v)
    83  	case OpAtomicLoad8:
    84  		return rewriteValuePPC64_OpAtomicLoad8(v)
    85  	case OpAtomicLoadAcq32:
    86  		return rewriteValuePPC64_OpAtomicLoadAcq32(v)
    87  	case OpAtomicLoadAcq64:
    88  		return rewriteValuePPC64_OpAtomicLoadAcq64(v)
    89  	case OpAtomicLoadPtr:
    90  		return rewriteValuePPC64_OpAtomicLoadPtr(v)
    91  	case OpAtomicOr32:
    92  		v.Op = OpPPC64LoweredAtomicOr32
    93  		return true
    94  	case OpAtomicOr8:
    95  		v.Op = OpPPC64LoweredAtomicOr8
    96  		return true
    97  	case OpAtomicStore32:
    98  		return rewriteValuePPC64_OpAtomicStore32(v)
    99  	case OpAtomicStore64:
   100  		return rewriteValuePPC64_OpAtomicStore64(v)
   101  	case OpAtomicStore8:
   102  		return rewriteValuePPC64_OpAtomicStore8(v)
   103  	case OpAtomicStoreRel32:
   104  		return rewriteValuePPC64_OpAtomicStoreRel32(v)
   105  	case OpAtomicStoreRel64:
   106  		return rewriteValuePPC64_OpAtomicStoreRel64(v)
   107  	case OpAvg64u:
   108  		return rewriteValuePPC64_OpAvg64u(v)
   109  	case OpBitLen32:
   110  		return rewriteValuePPC64_OpBitLen32(v)
   111  	case OpBitLen64:
   112  		return rewriteValuePPC64_OpBitLen64(v)
   113  	case OpBswap16:
   114  		return rewriteValuePPC64_OpBswap16(v)
   115  	case OpBswap32:
   116  		return rewriteValuePPC64_OpBswap32(v)
   117  	case OpBswap64:
   118  		return rewriteValuePPC64_OpBswap64(v)
   119  	case OpCeil:
   120  		v.Op = OpPPC64FCEIL
   121  		return true
   122  	case OpClosureCall:
   123  		v.Op = OpPPC64CALLclosure
   124  		return true
   125  	case OpCom16:
   126  		return rewriteValuePPC64_OpCom16(v)
   127  	case OpCom32:
   128  		return rewriteValuePPC64_OpCom32(v)
   129  	case OpCom64:
   130  		return rewriteValuePPC64_OpCom64(v)
   131  	case OpCom8:
   132  		return rewriteValuePPC64_OpCom8(v)
   133  	case OpCondSelect:
   134  		return rewriteValuePPC64_OpCondSelect(v)
   135  	case OpConst16:
   136  		return rewriteValuePPC64_OpConst16(v)
   137  	case OpConst32:
   138  		return rewriteValuePPC64_OpConst32(v)
   139  	case OpConst32F:
   140  		v.Op = OpPPC64FMOVSconst
   141  		return true
   142  	case OpConst64:
   143  		return rewriteValuePPC64_OpConst64(v)
   144  	case OpConst64F:
   145  		v.Op = OpPPC64FMOVDconst
   146  		return true
   147  	case OpConst8:
   148  		return rewriteValuePPC64_OpConst8(v)
   149  	case OpConstBool:
   150  		return rewriteValuePPC64_OpConstBool(v)
   151  	case OpConstNil:
   152  		return rewriteValuePPC64_OpConstNil(v)
   153  	case OpCopysign:
   154  		return rewriteValuePPC64_OpCopysign(v)
   155  	case OpCtz16:
   156  		return rewriteValuePPC64_OpCtz16(v)
   157  	case OpCtz32:
   158  		return rewriteValuePPC64_OpCtz32(v)
   159  	case OpCtz32NonZero:
   160  		v.Op = OpCtz32
   161  		return true
   162  	case OpCtz64:
   163  		return rewriteValuePPC64_OpCtz64(v)
   164  	case OpCtz64NonZero:
   165  		v.Op = OpCtz64
   166  		return true
   167  	case OpCtz8:
   168  		return rewriteValuePPC64_OpCtz8(v)
   169  	case OpCvt32Fto32:
   170  		return rewriteValuePPC64_OpCvt32Fto32(v)
   171  	case OpCvt32Fto64:
   172  		return rewriteValuePPC64_OpCvt32Fto64(v)
   173  	case OpCvt32Fto64F:
   174  		v.Op = OpCopy
   175  		return true
   176  	case OpCvt32to32F:
   177  		return rewriteValuePPC64_OpCvt32to32F(v)
   178  	case OpCvt32to64F:
   179  		return rewriteValuePPC64_OpCvt32to64F(v)
   180  	case OpCvt64Fto32:
   181  		return rewriteValuePPC64_OpCvt64Fto32(v)
   182  	case OpCvt64Fto32F:
   183  		v.Op = OpPPC64FRSP
   184  		return true
   185  	case OpCvt64Fto64:
   186  		return rewriteValuePPC64_OpCvt64Fto64(v)
   187  	case OpCvt64to32F:
   188  		return rewriteValuePPC64_OpCvt64to32F(v)
   189  	case OpCvt64to64F:
   190  		return rewriteValuePPC64_OpCvt64to64F(v)
   191  	case OpCvtBoolToUint8:
   192  		v.Op = OpCopy
   193  		return true
   194  	case OpDiv16:
   195  		return rewriteValuePPC64_OpDiv16(v)
   196  	case OpDiv16u:
   197  		return rewriteValuePPC64_OpDiv16u(v)
   198  	case OpDiv32:
   199  		return rewriteValuePPC64_OpDiv32(v)
   200  	case OpDiv32F:
   201  		v.Op = OpPPC64FDIVS
   202  		return true
   203  	case OpDiv32u:
   204  		v.Op = OpPPC64DIVWU
   205  		return true
   206  	case OpDiv64:
   207  		return rewriteValuePPC64_OpDiv64(v)
   208  	case OpDiv64F:
   209  		v.Op = OpPPC64FDIV
   210  		return true
   211  	case OpDiv64u:
   212  		v.Op = OpPPC64DIVDU
   213  		return true
   214  	case OpDiv8:
   215  		return rewriteValuePPC64_OpDiv8(v)
   216  	case OpDiv8u:
   217  		return rewriteValuePPC64_OpDiv8u(v)
   218  	case OpEq16:
   219  		return rewriteValuePPC64_OpEq16(v)
   220  	case OpEq32:
   221  		return rewriteValuePPC64_OpEq32(v)
   222  	case OpEq32F:
   223  		return rewriteValuePPC64_OpEq32F(v)
   224  	case OpEq64:
   225  		return rewriteValuePPC64_OpEq64(v)
   226  	case OpEq64F:
   227  		return rewriteValuePPC64_OpEq64F(v)
   228  	case OpEq8:
   229  		return rewriteValuePPC64_OpEq8(v)
   230  	case OpEqB:
   231  		return rewriteValuePPC64_OpEqB(v)
   232  	case OpEqPtr:
   233  		return rewriteValuePPC64_OpEqPtr(v)
   234  	case OpFMA:
   235  		v.Op = OpPPC64FMADD
   236  		return true
   237  	case OpFloor:
   238  		v.Op = OpPPC64FFLOOR
   239  		return true
   240  	case OpGetCallerPC:
   241  		v.Op = OpPPC64LoweredGetCallerPC
   242  		return true
   243  	case OpGetCallerSP:
   244  		v.Op = OpPPC64LoweredGetCallerSP
   245  		return true
   246  	case OpGetClosurePtr:
   247  		v.Op = OpPPC64LoweredGetClosurePtr
   248  		return true
   249  	case OpHmul32:
   250  		v.Op = OpPPC64MULHW
   251  		return true
   252  	case OpHmul32u:
   253  		v.Op = OpPPC64MULHWU
   254  		return true
   255  	case OpHmul64:
   256  		v.Op = OpPPC64MULHD
   257  		return true
   258  	case OpHmul64u:
   259  		v.Op = OpPPC64MULHDU
   260  		return true
   261  	case OpInterCall:
   262  		v.Op = OpPPC64CALLinter
   263  		return true
   264  	case OpIsInBounds:
   265  		return rewriteValuePPC64_OpIsInBounds(v)
   266  	case OpIsNonNil:
   267  		return rewriteValuePPC64_OpIsNonNil(v)
   268  	case OpIsSliceInBounds:
   269  		return rewriteValuePPC64_OpIsSliceInBounds(v)
   270  	case OpLeq16:
   271  		return rewriteValuePPC64_OpLeq16(v)
   272  	case OpLeq16U:
   273  		return rewriteValuePPC64_OpLeq16U(v)
   274  	case OpLeq32:
   275  		return rewriteValuePPC64_OpLeq32(v)
   276  	case OpLeq32F:
   277  		return rewriteValuePPC64_OpLeq32F(v)
   278  	case OpLeq32U:
   279  		return rewriteValuePPC64_OpLeq32U(v)
   280  	case OpLeq64:
   281  		return rewriteValuePPC64_OpLeq64(v)
   282  	case OpLeq64F:
   283  		return rewriteValuePPC64_OpLeq64F(v)
   284  	case OpLeq64U:
   285  		return rewriteValuePPC64_OpLeq64U(v)
   286  	case OpLeq8:
   287  		return rewriteValuePPC64_OpLeq8(v)
   288  	case OpLeq8U:
   289  		return rewriteValuePPC64_OpLeq8U(v)
   290  	case OpLess16:
   291  		return rewriteValuePPC64_OpLess16(v)
   292  	case OpLess16U:
   293  		return rewriteValuePPC64_OpLess16U(v)
   294  	case OpLess32:
   295  		return rewriteValuePPC64_OpLess32(v)
   296  	case OpLess32F:
   297  		return rewriteValuePPC64_OpLess32F(v)
   298  	case OpLess32U:
   299  		return rewriteValuePPC64_OpLess32U(v)
   300  	case OpLess64:
   301  		return rewriteValuePPC64_OpLess64(v)
   302  	case OpLess64F:
   303  		return rewriteValuePPC64_OpLess64F(v)
   304  	case OpLess64U:
   305  		return rewriteValuePPC64_OpLess64U(v)
   306  	case OpLess8:
   307  		return rewriteValuePPC64_OpLess8(v)
   308  	case OpLess8U:
   309  		return rewriteValuePPC64_OpLess8U(v)
   310  	case OpLoad:
   311  		return rewriteValuePPC64_OpLoad(v)
   312  	case OpLocalAddr:
   313  		return rewriteValuePPC64_OpLocalAddr(v)
   314  	case OpLsh16x16:
   315  		return rewriteValuePPC64_OpLsh16x16(v)
   316  	case OpLsh16x32:
   317  		return rewriteValuePPC64_OpLsh16x32(v)
   318  	case OpLsh16x64:
   319  		return rewriteValuePPC64_OpLsh16x64(v)
   320  	case OpLsh16x8:
   321  		return rewriteValuePPC64_OpLsh16x8(v)
   322  	case OpLsh32x16:
   323  		return rewriteValuePPC64_OpLsh32x16(v)
   324  	case OpLsh32x32:
   325  		return rewriteValuePPC64_OpLsh32x32(v)
   326  	case OpLsh32x64:
   327  		return rewriteValuePPC64_OpLsh32x64(v)
   328  	case OpLsh32x8:
   329  		return rewriteValuePPC64_OpLsh32x8(v)
   330  	case OpLsh64x16:
   331  		return rewriteValuePPC64_OpLsh64x16(v)
   332  	case OpLsh64x32:
   333  		return rewriteValuePPC64_OpLsh64x32(v)
   334  	case OpLsh64x64:
   335  		return rewriteValuePPC64_OpLsh64x64(v)
   336  	case OpLsh64x8:
   337  		return rewriteValuePPC64_OpLsh64x8(v)
   338  	case OpLsh8x16:
   339  		return rewriteValuePPC64_OpLsh8x16(v)
   340  	case OpLsh8x32:
   341  		return rewriteValuePPC64_OpLsh8x32(v)
   342  	case OpLsh8x64:
   343  		return rewriteValuePPC64_OpLsh8x64(v)
   344  	case OpLsh8x8:
   345  		return rewriteValuePPC64_OpLsh8x8(v)
   346  	case OpMax32F:
   347  		return rewriteValuePPC64_OpMax32F(v)
   348  	case OpMax64F:
   349  		return rewriteValuePPC64_OpMax64F(v)
   350  	case OpMin32F:
   351  		return rewriteValuePPC64_OpMin32F(v)
   352  	case OpMin64F:
   353  		return rewriteValuePPC64_OpMin64F(v)
   354  	case OpMod16:
   355  		return rewriteValuePPC64_OpMod16(v)
   356  	case OpMod16u:
   357  		return rewriteValuePPC64_OpMod16u(v)
   358  	case OpMod32:
   359  		return rewriteValuePPC64_OpMod32(v)
   360  	case OpMod32u:
   361  		return rewriteValuePPC64_OpMod32u(v)
   362  	case OpMod64:
   363  		return rewriteValuePPC64_OpMod64(v)
   364  	case OpMod64u:
   365  		return rewriteValuePPC64_OpMod64u(v)
   366  	case OpMod8:
   367  		return rewriteValuePPC64_OpMod8(v)
   368  	case OpMod8u:
   369  		return rewriteValuePPC64_OpMod8u(v)
   370  	case OpMove:
   371  		return rewriteValuePPC64_OpMove(v)
   372  	case OpMul16:
   373  		v.Op = OpPPC64MULLW
   374  		return true
   375  	case OpMul32:
   376  		v.Op = OpPPC64MULLW
   377  		return true
   378  	case OpMul32F:
   379  		v.Op = OpPPC64FMULS
   380  		return true
   381  	case OpMul64:
   382  		v.Op = OpPPC64MULLD
   383  		return true
   384  	case OpMul64F:
   385  		v.Op = OpPPC64FMUL
   386  		return true
   387  	case OpMul8:
   388  		v.Op = OpPPC64MULLW
   389  		return true
   390  	case OpNeg16:
   391  		v.Op = OpPPC64NEG
   392  		return true
   393  	case OpNeg32:
   394  		v.Op = OpPPC64NEG
   395  		return true
   396  	case OpNeg32F:
   397  		v.Op = OpPPC64FNEG
   398  		return true
   399  	case OpNeg64:
   400  		v.Op = OpPPC64NEG
   401  		return true
   402  	case OpNeg64F:
   403  		v.Op = OpPPC64FNEG
   404  		return true
   405  	case OpNeg8:
   406  		v.Op = OpPPC64NEG
   407  		return true
   408  	case OpNeq16:
   409  		return rewriteValuePPC64_OpNeq16(v)
   410  	case OpNeq32:
   411  		return rewriteValuePPC64_OpNeq32(v)
   412  	case OpNeq32F:
   413  		return rewriteValuePPC64_OpNeq32F(v)
   414  	case OpNeq64:
   415  		return rewriteValuePPC64_OpNeq64(v)
   416  	case OpNeq64F:
   417  		return rewriteValuePPC64_OpNeq64F(v)
   418  	case OpNeq8:
   419  		return rewriteValuePPC64_OpNeq8(v)
   420  	case OpNeqB:
   421  		v.Op = OpPPC64XOR
   422  		return true
   423  	case OpNeqPtr:
   424  		return rewriteValuePPC64_OpNeqPtr(v)
   425  	case OpNilCheck:
   426  		v.Op = OpPPC64LoweredNilCheck
   427  		return true
   428  	case OpNot:
   429  		return rewriteValuePPC64_OpNot(v)
   430  	case OpOffPtr:
   431  		return rewriteValuePPC64_OpOffPtr(v)
   432  	case OpOr16:
   433  		v.Op = OpPPC64OR
   434  		return true
   435  	case OpOr32:
   436  		v.Op = OpPPC64OR
   437  		return true
   438  	case OpOr64:
   439  		v.Op = OpPPC64OR
   440  		return true
   441  	case OpOr8:
   442  		v.Op = OpPPC64OR
   443  		return true
   444  	case OpOrB:
   445  		v.Op = OpPPC64OR
   446  		return true
   447  	case OpPPC64ADD:
   448  		return rewriteValuePPC64_OpPPC64ADD(v)
   449  	case OpPPC64ADDC:
   450  		return rewriteValuePPC64_OpPPC64ADDC(v)
   451  	case OpPPC64ADDE:
   452  		return rewriteValuePPC64_OpPPC64ADDE(v)
   453  	case OpPPC64ADDconst:
   454  		return rewriteValuePPC64_OpPPC64ADDconst(v)
   455  	case OpPPC64AND:
   456  		return rewriteValuePPC64_OpPPC64AND(v)
   457  	case OpPPC64ANDN:
   458  		return rewriteValuePPC64_OpPPC64ANDN(v)
   459  	case OpPPC64ANDconst:
   460  		return rewriteValuePPC64_OpPPC64ANDconst(v)
   461  	case OpPPC64BRD:
   462  		return rewriteValuePPC64_OpPPC64BRD(v)
   463  	case OpPPC64BRH:
   464  		return rewriteValuePPC64_OpPPC64BRH(v)
   465  	case OpPPC64BRW:
   466  		return rewriteValuePPC64_OpPPC64BRW(v)
   467  	case OpPPC64CLRLSLDI:
   468  		return rewriteValuePPC64_OpPPC64CLRLSLDI(v)
   469  	case OpPPC64CMP:
   470  		return rewriteValuePPC64_OpPPC64CMP(v)
   471  	case OpPPC64CMPU:
   472  		return rewriteValuePPC64_OpPPC64CMPU(v)
   473  	case OpPPC64CMPUconst:
   474  		return rewriteValuePPC64_OpPPC64CMPUconst(v)
   475  	case OpPPC64CMPW:
   476  		return rewriteValuePPC64_OpPPC64CMPW(v)
   477  	case OpPPC64CMPWU:
   478  		return rewriteValuePPC64_OpPPC64CMPWU(v)
   479  	case OpPPC64CMPWUconst:
   480  		return rewriteValuePPC64_OpPPC64CMPWUconst(v)
   481  	case OpPPC64CMPWconst:
   482  		return rewriteValuePPC64_OpPPC64CMPWconst(v)
   483  	case OpPPC64CMPconst:
   484  		return rewriteValuePPC64_OpPPC64CMPconst(v)
   485  	case OpPPC64Equal:
   486  		return rewriteValuePPC64_OpPPC64Equal(v)
   487  	case OpPPC64FABS:
   488  		return rewriteValuePPC64_OpPPC64FABS(v)
   489  	case OpPPC64FADD:
   490  		return rewriteValuePPC64_OpPPC64FADD(v)
   491  	case OpPPC64FADDS:
   492  		return rewriteValuePPC64_OpPPC64FADDS(v)
   493  	case OpPPC64FCEIL:
   494  		return rewriteValuePPC64_OpPPC64FCEIL(v)
   495  	case OpPPC64FFLOOR:
   496  		return rewriteValuePPC64_OpPPC64FFLOOR(v)
   497  	case OpPPC64FGreaterEqual:
   498  		return rewriteValuePPC64_OpPPC64FGreaterEqual(v)
   499  	case OpPPC64FGreaterThan:
   500  		return rewriteValuePPC64_OpPPC64FGreaterThan(v)
   501  	case OpPPC64FLessEqual:
   502  		return rewriteValuePPC64_OpPPC64FLessEqual(v)
   503  	case OpPPC64FLessThan:
   504  		return rewriteValuePPC64_OpPPC64FLessThan(v)
   505  	case OpPPC64FMOVDload:
   506  		return rewriteValuePPC64_OpPPC64FMOVDload(v)
   507  	case OpPPC64FMOVDstore:
   508  		return rewriteValuePPC64_OpPPC64FMOVDstore(v)
   509  	case OpPPC64FMOVSload:
   510  		return rewriteValuePPC64_OpPPC64FMOVSload(v)
   511  	case OpPPC64FMOVSstore:
   512  		return rewriteValuePPC64_OpPPC64FMOVSstore(v)
   513  	case OpPPC64FNEG:
   514  		return rewriteValuePPC64_OpPPC64FNEG(v)
   515  	case OpPPC64FSQRT:
   516  		return rewriteValuePPC64_OpPPC64FSQRT(v)
   517  	case OpPPC64FSUB:
   518  		return rewriteValuePPC64_OpPPC64FSUB(v)
   519  	case OpPPC64FSUBS:
   520  		return rewriteValuePPC64_OpPPC64FSUBS(v)
   521  	case OpPPC64FTRUNC:
   522  		return rewriteValuePPC64_OpPPC64FTRUNC(v)
   523  	case OpPPC64GreaterEqual:
   524  		return rewriteValuePPC64_OpPPC64GreaterEqual(v)
   525  	case OpPPC64GreaterThan:
   526  		return rewriteValuePPC64_OpPPC64GreaterThan(v)
   527  	case OpPPC64ISEL:
   528  		return rewriteValuePPC64_OpPPC64ISEL(v)
   529  	case OpPPC64LessEqual:
   530  		return rewriteValuePPC64_OpPPC64LessEqual(v)
   531  	case OpPPC64LessThan:
   532  		return rewriteValuePPC64_OpPPC64LessThan(v)
   533  	case OpPPC64MFVSRD:
   534  		return rewriteValuePPC64_OpPPC64MFVSRD(v)
   535  	case OpPPC64MOVBZload:
   536  		return rewriteValuePPC64_OpPPC64MOVBZload(v)
   537  	case OpPPC64MOVBZloadidx:
   538  		return rewriteValuePPC64_OpPPC64MOVBZloadidx(v)
   539  	case OpPPC64MOVBZreg:
   540  		return rewriteValuePPC64_OpPPC64MOVBZreg(v)
   541  	case OpPPC64MOVBreg:
   542  		return rewriteValuePPC64_OpPPC64MOVBreg(v)
   543  	case OpPPC64MOVBstore:
   544  		return rewriteValuePPC64_OpPPC64MOVBstore(v)
   545  	case OpPPC64MOVBstoreidx:
   546  		return rewriteValuePPC64_OpPPC64MOVBstoreidx(v)
   547  	case OpPPC64MOVBstorezero:
   548  		return rewriteValuePPC64_OpPPC64MOVBstorezero(v)
   549  	case OpPPC64MOVDaddr:
   550  		return rewriteValuePPC64_OpPPC64MOVDaddr(v)
   551  	case OpPPC64MOVDload:
   552  		return rewriteValuePPC64_OpPPC64MOVDload(v)
   553  	case OpPPC64MOVDloadidx:
   554  		return rewriteValuePPC64_OpPPC64MOVDloadidx(v)
   555  	case OpPPC64MOVDstore:
   556  		return rewriteValuePPC64_OpPPC64MOVDstore(v)
   557  	case OpPPC64MOVDstoreidx:
   558  		return rewriteValuePPC64_OpPPC64MOVDstoreidx(v)
   559  	case OpPPC64MOVDstorezero:
   560  		return rewriteValuePPC64_OpPPC64MOVDstorezero(v)
   561  	case OpPPC64MOVHBRstore:
   562  		return rewriteValuePPC64_OpPPC64MOVHBRstore(v)
   563  	case OpPPC64MOVHZload:
   564  		return rewriteValuePPC64_OpPPC64MOVHZload(v)
   565  	case OpPPC64MOVHZloadidx:
   566  		return rewriteValuePPC64_OpPPC64MOVHZloadidx(v)
   567  	case OpPPC64MOVHZreg:
   568  		return rewriteValuePPC64_OpPPC64MOVHZreg(v)
   569  	case OpPPC64MOVHload:
   570  		return rewriteValuePPC64_OpPPC64MOVHload(v)
   571  	case OpPPC64MOVHloadidx:
   572  		return rewriteValuePPC64_OpPPC64MOVHloadidx(v)
   573  	case OpPPC64MOVHreg:
   574  		return rewriteValuePPC64_OpPPC64MOVHreg(v)
   575  	case OpPPC64MOVHstore:
   576  		return rewriteValuePPC64_OpPPC64MOVHstore(v)
   577  	case OpPPC64MOVHstoreidx:
   578  		return rewriteValuePPC64_OpPPC64MOVHstoreidx(v)
   579  	case OpPPC64MOVHstorezero:
   580  		return rewriteValuePPC64_OpPPC64MOVHstorezero(v)
   581  	case OpPPC64MOVWBRstore:
   582  		return rewriteValuePPC64_OpPPC64MOVWBRstore(v)
   583  	case OpPPC64MOVWZload:
   584  		return rewriteValuePPC64_OpPPC64MOVWZload(v)
   585  	case OpPPC64MOVWZloadidx:
   586  		return rewriteValuePPC64_OpPPC64MOVWZloadidx(v)
   587  	case OpPPC64MOVWZreg:
   588  		return rewriteValuePPC64_OpPPC64MOVWZreg(v)
   589  	case OpPPC64MOVWload:
   590  		return rewriteValuePPC64_OpPPC64MOVWload(v)
   591  	case OpPPC64MOVWloadidx:
   592  		return rewriteValuePPC64_OpPPC64MOVWloadidx(v)
   593  	case OpPPC64MOVWreg:
   594  		return rewriteValuePPC64_OpPPC64MOVWreg(v)
   595  	case OpPPC64MOVWstore:
   596  		return rewriteValuePPC64_OpPPC64MOVWstore(v)
   597  	case OpPPC64MOVWstoreidx:
   598  		return rewriteValuePPC64_OpPPC64MOVWstoreidx(v)
   599  	case OpPPC64MOVWstorezero:
   600  		return rewriteValuePPC64_OpPPC64MOVWstorezero(v)
   601  	case OpPPC64MTVSRD:
   602  		return rewriteValuePPC64_OpPPC64MTVSRD(v)
   603  	case OpPPC64MULLD:
   604  		return rewriteValuePPC64_OpPPC64MULLD(v)
   605  	case OpPPC64MULLW:
   606  		return rewriteValuePPC64_OpPPC64MULLW(v)
   607  	case OpPPC64NEG:
   608  		return rewriteValuePPC64_OpPPC64NEG(v)
   609  	case OpPPC64NOR:
   610  		return rewriteValuePPC64_OpPPC64NOR(v)
   611  	case OpPPC64NotEqual:
   612  		return rewriteValuePPC64_OpPPC64NotEqual(v)
   613  	case OpPPC64OR:
   614  		return rewriteValuePPC64_OpPPC64OR(v)
   615  	case OpPPC64ORN:
   616  		return rewriteValuePPC64_OpPPC64ORN(v)
   617  	case OpPPC64ORconst:
   618  		return rewriteValuePPC64_OpPPC64ORconst(v)
   619  	case OpPPC64RLWINM:
   620  		return rewriteValuePPC64_OpPPC64RLWINM(v)
   621  	case OpPPC64ROTL:
   622  		return rewriteValuePPC64_OpPPC64ROTL(v)
   623  	case OpPPC64ROTLW:
   624  		return rewriteValuePPC64_OpPPC64ROTLW(v)
   625  	case OpPPC64ROTLWconst:
   626  		return rewriteValuePPC64_OpPPC64ROTLWconst(v)
   627  	case OpPPC64SETBC:
   628  		return rewriteValuePPC64_OpPPC64SETBC(v)
   629  	case OpPPC64SETBCR:
   630  		return rewriteValuePPC64_OpPPC64SETBCR(v)
   631  	case OpPPC64SLD:
   632  		return rewriteValuePPC64_OpPPC64SLD(v)
   633  	case OpPPC64SLDconst:
   634  		return rewriteValuePPC64_OpPPC64SLDconst(v)
   635  	case OpPPC64SLW:
   636  		return rewriteValuePPC64_OpPPC64SLW(v)
   637  	case OpPPC64SLWconst:
   638  		return rewriteValuePPC64_OpPPC64SLWconst(v)
   639  	case OpPPC64SRAD:
   640  		return rewriteValuePPC64_OpPPC64SRAD(v)
   641  	case OpPPC64SRAW:
   642  		return rewriteValuePPC64_OpPPC64SRAW(v)
   643  	case OpPPC64SRD:
   644  		return rewriteValuePPC64_OpPPC64SRD(v)
   645  	case OpPPC64SRW:
   646  		return rewriteValuePPC64_OpPPC64SRW(v)
   647  	case OpPPC64SRWconst:
   648  		return rewriteValuePPC64_OpPPC64SRWconst(v)
   649  	case OpPPC64SUB:
   650  		return rewriteValuePPC64_OpPPC64SUB(v)
   651  	case OpPPC64SUBE:
   652  		return rewriteValuePPC64_OpPPC64SUBE(v)
   653  	case OpPPC64SUBFCconst:
   654  		return rewriteValuePPC64_OpPPC64SUBFCconst(v)
   655  	case OpPPC64XOR:
   656  		return rewriteValuePPC64_OpPPC64XOR(v)
   657  	case OpPPC64XORconst:
   658  		return rewriteValuePPC64_OpPPC64XORconst(v)
   659  	case OpPanicBounds:
   660  		return rewriteValuePPC64_OpPanicBounds(v)
   661  	case OpPopCount16:
   662  		return rewriteValuePPC64_OpPopCount16(v)
   663  	case OpPopCount32:
   664  		return rewriteValuePPC64_OpPopCount32(v)
   665  	case OpPopCount64:
   666  		v.Op = OpPPC64POPCNTD
   667  		return true
   668  	case OpPopCount8:
   669  		return rewriteValuePPC64_OpPopCount8(v)
   670  	case OpPrefetchCache:
   671  		return rewriteValuePPC64_OpPrefetchCache(v)
   672  	case OpPrefetchCacheStreamed:
   673  		return rewriteValuePPC64_OpPrefetchCacheStreamed(v)
   674  	case OpPubBarrier:
   675  		v.Op = OpPPC64LoweredPubBarrier
   676  		return true
   677  	case OpRotateLeft16:
   678  		return rewriteValuePPC64_OpRotateLeft16(v)
   679  	case OpRotateLeft32:
   680  		v.Op = OpPPC64ROTLW
   681  		return true
   682  	case OpRotateLeft64:
   683  		v.Op = OpPPC64ROTL
   684  		return true
   685  	case OpRotateLeft8:
   686  		return rewriteValuePPC64_OpRotateLeft8(v)
   687  	case OpRound:
   688  		v.Op = OpPPC64FROUND
   689  		return true
   690  	case OpRound32F:
   691  		v.Op = OpPPC64LoweredRound32F
   692  		return true
   693  	case OpRound64F:
   694  		v.Op = OpPPC64LoweredRound64F
   695  		return true
   696  	case OpRsh16Ux16:
   697  		return rewriteValuePPC64_OpRsh16Ux16(v)
   698  	case OpRsh16Ux32:
   699  		return rewriteValuePPC64_OpRsh16Ux32(v)
   700  	case OpRsh16Ux64:
   701  		return rewriteValuePPC64_OpRsh16Ux64(v)
   702  	case OpRsh16Ux8:
   703  		return rewriteValuePPC64_OpRsh16Ux8(v)
   704  	case OpRsh16x16:
   705  		return rewriteValuePPC64_OpRsh16x16(v)
   706  	case OpRsh16x32:
   707  		return rewriteValuePPC64_OpRsh16x32(v)
   708  	case OpRsh16x64:
   709  		return rewriteValuePPC64_OpRsh16x64(v)
   710  	case OpRsh16x8:
   711  		return rewriteValuePPC64_OpRsh16x8(v)
   712  	case OpRsh32Ux16:
   713  		return rewriteValuePPC64_OpRsh32Ux16(v)
   714  	case OpRsh32Ux32:
   715  		return rewriteValuePPC64_OpRsh32Ux32(v)
   716  	case OpRsh32Ux64:
   717  		return rewriteValuePPC64_OpRsh32Ux64(v)
   718  	case OpRsh32Ux8:
   719  		return rewriteValuePPC64_OpRsh32Ux8(v)
   720  	case OpRsh32x16:
   721  		return rewriteValuePPC64_OpRsh32x16(v)
   722  	case OpRsh32x32:
   723  		return rewriteValuePPC64_OpRsh32x32(v)
   724  	case OpRsh32x64:
   725  		return rewriteValuePPC64_OpRsh32x64(v)
   726  	case OpRsh32x8:
   727  		return rewriteValuePPC64_OpRsh32x8(v)
   728  	case OpRsh64Ux16:
   729  		return rewriteValuePPC64_OpRsh64Ux16(v)
   730  	case OpRsh64Ux32:
   731  		return rewriteValuePPC64_OpRsh64Ux32(v)
   732  	case OpRsh64Ux64:
   733  		return rewriteValuePPC64_OpRsh64Ux64(v)
   734  	case OpRsh64Ux8:
   735  		return rewriteValuePPC64_OpRsh64Ux8(v)
   736  	case OpRsh64x16:
   737  		return rewriteValuePPC64_OpRsh64x16(v)
   738  	case OpRsh64x32:
   739  		return rewriteValuePPC64_OpRsh64x32(v)
   740  	case OpRsh64x64:
   741  		return rewriteValuePPC64_OpRsh64x64(v)
   742  	case OpRsh64x8:
   743  		return rewriteValuePPC64_OpRsh64x8(v)
   744  	case OpRsh8Ux16:
   745  		return rewriteValuePPC64_OpRsh8Ux16(v)
   746  	case OpRsh8Ux32:
   747  		return rewriteValuePPC64_OpRsh8Ux32(v)
   748  	case OpRsh8Ux64:
   749  		return rewriteValuePPC64_OpRsh8Ux64(v)
   750  	case OpRsh8Ux8:
   751  		return rewriteValuePPC64_OpRsh8Ux8(v)
   752  	case OpRsh8x16:
   753  		return rewriteValuePPC64_OpRsh8x16(v)
   754  	case OpRsh8x32:
   755  		return rewriteValuePPC64_OpRsh8x32(v)
   756  	case OpRsh8x64:
   757  		return rewriteValuePPC64_OpRsh8x64(v)
   758  	case OpRsh8x8:
   759  		return rewriteValuePPC64_OpRsh8x8(v)
   760  	case OpSelect0:
   761  		return rewriteValuePPC64_OpSelect0(v)
   762  	case OpSelect1:
   763  		return rewriteValuePPC64_OpSelect1(v)
   764  	case OpSelectN:
   765  		return rewriteValuePPC64_OpSelectN(v)
   766  	case OpSignExt16to32:
   767  		v.Op = OpPPC64MOVHreg
   768  		return true
   769  	case OpSignExt16to64:
   770  		v.Op = OpPPC64MOVHreg
   771  		return true
   772  	case OpSignExt32to64:
   773  		v.Op = OpPPC64MOVWreg
   774  		return true
   775  	case OpSignExt8to16:
   776  		v.Op = OpPPC64MOVBreg
   777  		return true
   778  	case OpSignExt8to32:
   779  		v.Op = OpPPC64MOVBreg
   780  		return true
   781  	case OpSignExt8to64:
   782  		v.Op = OpPPC64MOVBreg
   783  		return true
   784  	case OpSlicemask:
   785  		return rewriteValuePPC64_OpSlicemask(v)
   786  	case OpSqrt:
   787  		v.Op = OpPPC64FSQRT
   788  		return true
   789  	case OpSqrt32:
   790  		v.Op = OpPPC64FSQRTS
   791  		return true
   792  	case OpStaticCall:
   793  		v.Op = OpPPC64CALLstatic
   794  		return true
   795  	case OpStore:
   796  		return rewriteValuePPC64_OpStore(v)
   797  	case OpSub16:
   798  		v.Op = OpPPC64SUB
   799  		return true
   800  	case OpSub32:
   801  		v.Op = OpPPC64SUB
   802  		return true
   803  	case OpSub32F:
   804  		v.Op = OpPPC64FSUBS
   805  		return true
   806  	case OpSub64:
   807  		v.Op = OpPPC64SUB
   808  		return true
   809  	case OpSub64F:
   810  		v.Op = OpPPC64FSUB
   811  		return true
   812  	case OpSub8:
   813  		v.Op = OpPPC64SUB
   814  		return true
   815  	case OpSubPtr:
   816  		v.Op = OpPPC64SUB
   817  		return true
   818  	case OpTailCall:
   819  		v.Op = OpPPC64CALLtail
   820  		return true
   821  	case OpTrunc:
   822  		v.Op = OpPPC64FTRUNC
   823  		return true
   824  	case OpTrunc16to8:
   825  		return rewriteValuePPC64_OpTrunc16to8(v)
   826  	case OpTrunc32to16:
   827  		return rewriteValuePPC64_OpTrunc32to16(v)
   828  	case OpTrunc32to8:
   829  		return rewriteValuePPC64_OpTrunc32to8(v)
   830  	case OpTrunc64to16:
   831  		return rewriteValuePPC64_OpTrunc64to16(v)
   832  	case OpTrunc64to32:
   833  		return rewriteValuePPC64_OpTrunc64to32(v)
   834  	case OpTrunc64to8:
   835  		return rewriteValuePPC64_OpTrunc64to8(v)
   836  	case OpWB:
   837  		v.Op = OpPPC64LoweredWB
   838  		return true
   839  	case OpXor16:
   840  		v.Op = OpPPC64XOR
   841  		return true
   842  	case OpXor32:
   843  		v.Op = OpPPC64XOR
   844  		return true
   845  	case OpXor64:
   846  		v.Op = OpPPC64XOR
   847  		return true
   848  	case OpXor8:
   849  		v.Op = OpPPC64XOR
   850  		return true
   851  	case OpZero:
   852  		return rewriteValuePPC64_OpZero(v)
   853  	case OpZeroExt16to32:
   854  		v.Op = OpPPC64MOVHZreg
   855  		return true
   856  	case OpZeroExt16to64:
   857  		v.Op = OpPPC64MOVHZreg
   858  		return true
   859  	case OpZeroExt32to64:
   860  		v.Op = OpPPC64MOVWZreg
   861  		return true
   862  	case OpZeroExt8to16:
   863  		v.Op = OpPPC64MOVBZreg
   864  		return true
   865  	case OpZeroExt8to32:
   866  		v.Op = OpPPC64MOVBZreg
   867  		return true
   868  	case OpZeroExt8to64:
   869  		v.Op = OpPPC64MOVBZreg
   870  		return true
   871  	}
   872  	return false
   873  }
   874  func rewriteValuePPC64_OpAddr(v *Value) bool {
   875  	v_0 := v.Args[0]
   876  	// match: (Addr {sym} base)
   877  	// result: (MOVDaddr {sym} [0] base)
   878  	for {
   879  		sym := auxToSym(v.Aux)
   880  		base := v_0
   881  		v.reset(OpPPC64MOVDaddr)
   882  		v.AuxInt = int32ToAuxInt(0)
   883  		v.Aux = symToAux(sym)
   884  		v.AddArg(base)
   885  		return true
   886  	}
   887  }
   888  func rewriteValuePPC64_OpAtomicCompareAndSwap32(v *Value) bool {
   889  	v_3 := v.Args[3]
   890  	v_2 := v.Args[2]
   891  	v_1 := v.Args[1]
   892  	v_0 := v.Args[0]
   893  	// match: (AtomicCompareAndSwap32 ptr old new_ mem)
   894  	// result: (LoweredAtomicCas32 [1] ptr old new_ mem)
   895  	for {
   896  		ptr := v_0
   897  		old := v_1
   898  		new_ := v_2
   899  		mem := v_3
   900  		v.reset(OpPPC64LoweredAtomicCas32)
   901  		v.AuxInt = int64ToAuxInt(1)
   902  		v.AddArg4(ptr, old, new_, mem)
   903  		return true
   904  	}
   905  }
   906  func rewriteValuePPC64_OpAtomicCompareAndSwap64(v *Value) bool {
   907  	v_3 := v.Args[3]
   908  	v_2 := v.Args[2]
   909  	v_1 := v.Args[1]
   910  	v_0 := v.Args[0]
   911  	// match: (AtomicCompareAndSwap64 ptr old new_ mem)
   912  	// result: (LoweredAtomicCas64 [1] ptr old new_ mem)
   913  	for {
   914  		ptr := v_0
   915  		old := v_1
   916  		new_ := v_2
   917  		mem := v_3
   918  		v.reset(OpPPC64LoweredAtomicCas64)
   919  		v.AuxInt = int64ToAuxInt(1)
   920  		v.AddArg4(ptr, old, new_, mem)
   921  		return true
   922  	}
   923  }
   924  func rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v *Value) bool {
   925  	v_3 := v.Args[3]
   926  	v_2 := v.Args[2]
   927  	v_1 := v.Args[1]
   928  	v_0 := v.Args[0]
   929  	// match: (AtomicCompareAndSwapRel32 ptr old new_ mem)
   930  	// result: (LoweredAtomicCas32 [0] ptr old new_ mem)
   931  	for {
   932  		ptr := v_0
   933  		old := v_1
   934  		new_ := v_2
   935  		mem := v_3
   936  		v.reset(OpPPC64LoweredAtomicCas32)
   937  		v.AuxInt = int64ToAuxInt(0)
   938  		v.AddArg4(ptr, old, new_, mem)
   939  		return true
   940  	}
   941  }
   942  func rewriteValuePPC64_OpAtomicLoad32(v *Value) bool {
   943  	v_1 := v.Args[1]
   944  	v_0 := v.Args[0]
   945  	// match: (AtomicLoad32 ptr mem)
   946  	// result: (LoweredAtomicLoad32 [1] ptr mem)
   947  	for {
   948  		ptr := v_0
   949  		mem := v_1
   950  		v.reset(OpPPC64LoweredAtomicLoad32)
   951  		v.AuxInt = int64ToAuxInt(1)
   952  		v.AddArg2(ptr, mem)
   953  		return true
   954  	}
   955  }
   956  func rewriteValuePPC64_OpAtomicLoad64(v *Value) bool {
   957  	v_1 := v.Args[1]
   958  	v_0 := v.Args[0]
   959  	// match: (AtomicLoad64 ptr mem)
   960  	// result: (LoweredAtomicLoad64 [1] ptr mem)
   961  	for {
   962  		ptr := v_0
   963  		mem := v_1
   964  		v.reset(OpPPC64LoweredAtomicLoad64)
   965  		v.AuxInt = int64ToAuxInt(1)
   966  		v.AddArg2(ptr, mem)
   967  		return true
   968  	}
   969  }
   970  func rewriteValuePPC64_OpAtomicLoad8(v *Value) bool {
   971  	v_1 := v.Args[1]
   972  	v_0 := v.Args[0]
   973  	// match: (AtomicLoad8 ptr mem)
   974  	// result: (LoweredAtomicLoad8 [1] ptr mem)
   975  	for {
   976  		ptr := v_0
   977  		mem := v_1
   978  		v.reset(OpPPC64LoweredAtomicLoad8)
   979  		v.AuxInt = int64ToAuxInt(1)
   980  		v.AddArg2(ptr, mem)
   981  		return true
   982  	}
   983  }
   984  func rewriteValuePPC64_OpAtomicLoadAcq32(v *Value) bool {
   985  	v_1 := v.Args[1]
   986  	v_0 := v.Args[0]
   987  	// match: (AtomicLoadAcq32 ptr mem)
   988  	// result: (LoweredAtomicLoad32 [0] ptr mem)
   989  	for {
   990  		ptr := v_0
   991  		mem := v_1
   992  		v.reset(OpPPC64LoweredAtomicLoad32)
   993  		v.AuxInt = int64ToAuxInt(0)
   994  		v.AddArg2(ptr, mem)
   995  		return true
   996  	}
   997  }
   998  func rewriteValuePPC64_OpAtomicLoadAcq64(v *Value) bool {
   999  	v_1 := v.Args[1]
  1000  	v_0 := v.Args[0]
  1001  	// match: (AtomicLoadAcq64 ptr mem)
  1002  	// result: (LoweredAtomicLoad64 [0] ptr mem)
  1003  	for {
  1004  		ptr := v_0
  1005  		mem := v_1
  1006  		v.reset(OpPPC64LoweredAtomicLoad64)
  1007  		v.AuxInt = int64ToAuxInt(0)
  1008  		v.AddArg2(ptr, mem)
  1009  		return true
  1010  	}
  1011  }
  1012  func rewriteValuePPC64_OpAtomicLoadPtr(v *Value) bool {
  1013  	v_1 := v.Args[1]
  1014  	v_0 := v.Args[0]
  1015  	// match: (AtomicLoadPtr ptr mem)
  1016  	// result: (LoweredAtomicLoadPtr [1] ptr mem)
  1017  	for {
  1018  		ptr := v_0
  1019  		mem := v_1
  1020  		v.reset(OpPPC64LoweredAtomicLoadPtr)
  1021  		v.AuxInt = int64ToAuxInt(1)
  1022  		v.AddArg2(ptr, mem)
  1023  		return true
  1024  	}
  1025  }
  1026  func rewriteValuePPC64_OpAtomicStore32(v *Value) bool {
  1027  	v_2 := v.Args[2]
  1028  	v_1 := v.Args[1]
  1029  	v_0 := v.Args[0]
  1030  	// match: (AtomicStore32 ptr val mem)
  1031  	// result: (LoweredAtomicStore32 [1] ptr val mem)
  1032  	for {
  1033  		ptr := v_0
  1034  		val := v_1
  1035  		mem := v_2
  1036  		v.reset(OpPPC64LoweredAtomicStore32)
  1037  		v.AuxInt = int64ToAuxInt(1)
  1038  		v.AddArg3(ptr, val, mem)
  1039  		return true
  1040  	}
  1041  }
  1042  func rewriteValuePPC64_OpAtomicStore64(v *Value) bool {
  1043  	v_2 := v.Args[2]
  1044  	v_1 := v.Args[1]
  1045  	v_0 := v.Args[0]
  1046  	// match: (AtomicStore64 ptr val mem)
  1047  	// result: (LoweredAtomicStore64 [1] ptr val mem)
  1048  	for {
  1049  		ptr := v_0
  1050  		val := v_1
  1051  		mem := v_2
  1052  		v.reset(OpPPC64LoweredAtomicStore64)
  1053  		v.AuxInt = int64ToAuxInt(1)
  1054  		v.AddArg3(ptr, val, mem)
  1055  		return true
  1056  	}
  1057  }
  1058  func rewriteValuePPC64_OpAtomicStore8(v *Value) bool {
  1059  	v_2 := v.Args[2]
  1060  	v_1 := v.Args[1]
  1061  	v_0 := v.Args[0]
  1062  	// match: (AtomicStore8 ptr val mem)
  1063  	// result: (LoweredAtomicStore8 [1] ptr val mem)
  1064  	for {
  1065  		ptr := v_0
  1066  		val := v_1
  1067  		mem := v_2
  1068  		v.reset(OpPPC64LoweredAtomicStore8)
  1069  		v.AuxInt = int64ToAuxInt(1)
  1070  		v.AddArg3(ptr, val, mem)
  1071  		return true
  1072  	}
  1073  }
  1074  func rewriteValuePPC64_OpAtomicStoreRel32(v *Value) bool {
  1075  	v_2 := v.Args[2]
  1076  	v_1 := v.Args[1]
  1077  	v_0 := v.Args[0]
  1078  	// match: (AtomicStoreRel32 ptr val mem)
  1079  	// result: (LoweredAtomicStore32 [0] ptr val mem)
  1080  	for {
  1081  		ptr := v_0
  1082  		val := v_1
  1083  		mem := v_2
  1084  		v.reset(OpPPC64LoweredAtomicStore32)
  1085  		v.AuxInt = int64ToAuxInt(0)
  1086  		v.AddArg3(ptr, val, mem)
  1087  		return true
  1088  	}
  1089  }
  1090  func rewriteValuePPC64_OpAtomicStoreRel64(v *Value) bool {
  1091  	v_2 := v.Args[2]
  1092  	v_1 := v.Args[1]
  1093  	v_0 := v.Args[0]
  1094  	// match: (AtomicStoreRel64 ptr val mem)
  1095  	// result: (LoweredAtomicStore64 [0] ptr val mem)
  1096  	for {
  1097  		ptr := v_0
  1098  		val := v_1
  1099  		mem := v_2
  1100  		v.reset(OpPPC64LoweredAtomicStore64)
  1101  		v.AuxInt = int64ToAuxInt(0)
  1102  		v.AddArg3(ptr, val, mem)
  1103  		return true
  1104  	}
  1105  }
  1106  func rewriteValuePPC64_OpAvg64u(v *Value) bool {
  1107  	v_1 := v.Args[1]
  1108  	v_0 := v.Args[0]
  1109  	b := v.Block
  1110  	// match: (Avg64u <t> x y)
  1111  	// result: (ADD (SRDconst <t> (SUB <t> x y) [1]) y)
  1112  	for {
  1113  		t := v.Type
  1114  		x := v_0
  1115  		y := v_1
  1116  		v.reset(OpPPC64ADD)
  1117  		v0 := b.NewValue0(v.Pos, OpPPC64SRDconst, t)
  1118  		v0.AuxInt = int64ToAuxInt(1)
  1119  		v1 := b.NewValue0(v.Pos, OpPPC64SUB, t)
  1120  		v1.AddArg2(x, y)
  1121  		v0.AddArg(v1)
  1122  		v.AddArg2(v0, y)
  1123  		return true
  1124  	}
  1125  }
  1126  func rewriteValuePPC64_OpBitLen32(v *Value) bool {
  1127  	v_0 := v.Args[0]
  1128  	b := v.Block
  1129  	typ := &b.Func.Config.Types
  1130  	// match: (BitLen32 x)
  1131  	// result: (SUBFCconst [32] (CNTLZW <typ.Int> x))
  1132  	for {
  1133  		x := v_0
  1134  		v.reset(OpPPC64SUBFCconst)
  1135  		v.AuxInt = int64ToAuxInt(32)
  1136  		v0 := b.NewValue0(v.Pos, OpPPC64CNTLZW, typ.Int)
  1137  		v0.AddArg(x)
  1138  		v.AddArg(v0)
  1139  		return true
  1140  	}
  1141  }
  1142  func rewriteValuePPC64_OpBitLen64(v *Value) bool {
  1143  	v_0 := v.Args[0]
  1144  	b := v.Block
  1145  	typ := &b.Func.Config.Types
  1146  	// match: (BitLen64 x)
  1147  	// result: (SUBFCconst [64] (CNTLZD <typ.Int> x))
  1148  	for {
  1149  		x := v_0
  1150  		v.reset(OpPPC64SUBFCconst)
  1151  		v.AuxInt = int64ToAuxInt(64)
  1152  		v0 := b.NewValue0(v.Pos, OpPPC64CNTLZD, typ.Int)
  1153  		v0.AddArg(x)
  1154  		v.AddArg(v0)
  1155  		return true
  1156  	}
  1157  }
  1158  func rewriteValuePPC64_OpBswap16(v *Value) bool {
  1159  	v_0 := v.Args[0]
  1160  	b := v.Block
  1161  	typ := &b.Func.Config.Types
  1162  	// match: (Bswap16 x)
  1163  	// cond: buildcfg.GOPPC64>=10
  1164  	// result: (BRH x)
  1165  	for {
  1166  		x := v_0
  1167  		if !(buildcfg.GOPPC64 >= 10) {
  1168  			break
  1169  		}
  1170  		v.reset(OpPPC64BRH)
  1171  		v.AddArg(x)
  1172  		return true
  1173  	}
  1174  	// match: (Bswap16 x:(MOVHZload [off] {sym} ptr mem))
  1175  	// result: @x.Block (MOVHBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1176  	for {
  1177  		x := v_0
  1178  		if x.Op != OpPPC64MOVHZload {
  1179  			break
  1180  		}
  1181  		off := auxIntToInt32(x.AuxInt)
  1182  		sym := auxToSym(x.Aux)
  1183  		mem := x.Args[1]
  1184  		ptr := x.Args[0]
  1185  		b = x.Block
  1186  		v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
  1187  		v.copyOf(v0)
  1188  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  1189  		v1.AuxInt = int32ToAuxInt(off)
  1190  		v1.Aux = symToAux(sym)
  1191  		v1.AddArg(ptr)
  1192  		v0.AddArg2(v1, mem)
  1193  		return true
  1194  	}
  1195  	// match: (Bswap16 x:(MOVHZloadidx ptr idx mem))
  1196  	// result: @x.Block (MOVHBRloadidx ptr idx mem)
  1197  	for {
  1198  		x := v_0
  1199  		if x.Op != OpPPC64MOVHZloadidx {
  1200  			break
  1201  		}
  1202  		mem := x.Args[2]
  1203  		ptr := x.Args[0]
  1204  		idx := x.Args[1]
  1205  		b = x.Block
  1206  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
  1207  		v.copyOf(v0)
  1208  		v0.AddArg3(ptr, idx, mem)
  1209  		return true
  1210  	}
  1211  	return false
  1212  }
  1213  func rewriteValuePPC64_OpBswap32(v *Value) bool {
  1214  	v_0 := v.Args[0]
  1215  	b := v.Block
  1216  	typ := &b.Func.Config.Types
  1217  	// match: (Bswap32 x)
  1218  	// cond: buildcfg.GOPPC64>=10
  1219  	// result: (BRW x)
  1220  	for {
  1221  		x := v_0
  1222  		if !(buildcfg.GOPPC64 >= 10) {
  1223  			break
  1224  		}
  1225  		v.reset(OpPPC64BRW)
  1226  		v.AddArg(x)
  1227  		return true
  1228  	}
  1229  	// match: (Bswap32 x:(MOVWZload [off] {sym} ptr mem))
  1230  	// result: @x.Block (MOVWBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1231  	for {
  1232  		x := v_0
  1233  		if x.Op != OpPPC64MOVWZload {
  1234  			break
  1235  		}
  1236  		off := auxIntToInt32(x.AuxInt)
  1237  		sym := auxToSym(x.Aux)
  1238  		mem := x.Args[1]
  1239  		ptr := x.Args[0]
  1240  		b = x.Block
  1241  		v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
  1242  		v.copyOf(v0)
  1243  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  1244  		v1.AuxInt = int32ToAuxInt(off)
  1245  		v1.Aux = symToAux(sym)
  1246  		v1.AddArg(ptr)
  1247  		v0.AddArg2(v1, mem)
  1248  		return true
  1249  	}
  1250  	// match: (Bswap32 x:(MOVWZloadidx ptr idx mem))
  1251  	// result: @x.Block (MOVWBRloadidx ptr idx mem)
  1252  	for {
  1253  		x := v_0
  1254  		if x.Op != OpPPC64MOVWZloadidx {
  1255  			break
  1256  		}
  1257  		mem := x.Args[2]
  1258  		ptr := x.Args[0]
  1259  		idx := x.Args[1]
  1260  		b = x.Block
  1261  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
  1262  		v.copyOf(v0)
  1263  		v0.AddArg3(ptr, idx, mem)
  1264  		return true
  1265  	}
  1266  	return false
  1267  }
  1268  func rewriteValuePPC64_OpBswap64(v *Value) bool {
  1269  	v_0 := v.Args[0]
  1270  	b := v.Block
  1271  	typ := &b.Func.Config.Types
  1272  	// match: (Bswap64 x)
  1273  	// cond: buildcfg.GOPPC64>=10
  1274  	// result: (BRD x)
  1275  	for {
  1276  		x := v_0
  1277  		if !(buildcfg.GOPPC64 >= 10) {
  1278  			break
  1279  		}
  1280  		v.reset(OpPPC64BRD)
  1281  		v.AddArg(x)
  1282  		return true
  1283  	}
  1284  	// match: (Bswap64 x:(MOVDload [off] {sym} ptr mem))
  1285  	// result: @x.Block (MOVDBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1286  	for {
  1287  		x := v_0
  1288  		if x.Op != OpPPC64MOVDload {
  1289  			break
  1290  		}
  1291  		off := auxIntToInt32(x.AuxInt)
  1292  		sym := auxToSym(x.Aux)
  1293  		mem := x.Args[1]
  1294  		ptr := x.Args[0]
  1295  		b = x.Block
  1296  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
  1297  		v.copyOf(v0)
  1298  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  1299  		v1.AuxInt = int32ToAuxInt(off)
  1300  		v1.Aux = symToAux(sym)
  1301  		v1.AddArg(ptr)
  1302  		v0.AddArg2(v1, mem)
  1303  		return true
  1304  	}
  1305  	// match: (Bswap64 x:(MOVDloadidx ptr idx mem))
  1306  	// result: @x.Block (MOVDBRloadidx ptr idx mem)
  1307  	for {
  1308  		x := v_0
  1309  		if x.Op != OpPPC64MOVDloadidx {
  1310  			break
  1311  		}
  1312  		mem := x.Args[2]
  1313  		ptr := x.Args[0]
  1314  		idx := x.Args[1]
  1315  		b = x.Block
  1316  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
  1317  		v.copyOf(v0)
  1318  		v0.AddArg3(ptr, idx, mem)
  1319  		return true
  1320  	}
  1321  	return false
  1322  }
  1323  func rewriteValuePPC64_OpCom16(v *Value) bool {
  1324  	v_0 := v.Args[0]
  1325  	// match: (Com16 x)
  1326  	// result: (NOR x x)
  1327  	for {
  1328  		x := v_0
  1329  		v.reset(OpPPC64NOR)
  1330  		v.AddArg2(x, x)
  1331  		return true
  1332  	}
  1333  }
  1334  func rewriteValuePPC64_OpCom32(v *Value) bool {
  1335  	v_0 := v.Args[0]
  1336  	// match: (Com32 x)
  1337  	// result: (NOR x x)
  1338  	for {
  1339  		x := v_0
  1340  		v.reset(OpPPC64NOR)
  1341  		v.AddArg2(x, x)
  1342  		return true
  1343  	}
  1344  }
  1345  func rewriteValuePPC64_OpCom64(v *Value) bool {
  1346  	v_0 := v.Args[0]
  1347  	// match: (Com64 x)
  1348  	// result: (NOR x x)
  1349  	for {
  1350  		x := v_0
  1351  		v.reset(OpPPC64NOR)
  1352  		v.AddArg2(x, x)
  1353  		return true
  1354  	}
  1355  }
  1356  func rewriteValuePPC64_OpCom8(v *Value) bool {
  1357  	v_0 := v.Args[0]
  1358  	// match: (Com8 x)
  1359  	// result: (NOR x x)
  1360  	for {
  1361  		x := v_0
  1362  		v.reset(OpPPC64NOR)
  1363  		v.AddArg2(x, x)
  1364  		return true
  1365  	}
  1366  }
  1367  func rewriteValuePPC64_OpCondSelect(v *Value) bool {
  1368  	v_2 := v.Args[2]
  1369  	v_1 := v.Args[1]
  1370  	v_0 := v.Args[0]
  1371  	b := v.Block
  1372  	typ := &b.Func.Config.Types
  1373  	// match: (CondSelect x y (SETBC [a] cmp))
  1374  	// result: (ISEL [a] x y cmp)
  1375  	for {
  1376  		x := v_0
  1377  		y := v_1
  1378  		if v_2.Op != OpPPC64SETBC {
  1379  			break
  1380  		}
  1381  		a := auxIntToInt32(v_2.AuxInt)
  1382  		cmp := v_2.Args[0]
  1383  		v.reset(OpPPC64ISEL)
  1384  		v.AuxInt = int32ToAuxInt(a)
  1385  		v.AddArg3(x, y, cmp)
  1386  		return true
  1387  	}
  1388  	// match: (CondSelect x y (SETBCR [a] cmp))
  1389  	// result: (ISEL [a+4] x y cmp)
  1390  	for {
  1391  		x := v_0
  1392  		y := v_1
  1393  		if v_2.Op != OpPPC64SETBCR {
  1394  			break
  1395  		}
  1396  		a := auxIntToInt32(v_2.AuxInt)
  1397  		cmp := v_2.Args[0]
  1398  		v.reset(OpPPC64ISEL)
  1399  		v.AuxInt = int32ToAuxInt(a + 4)
  1400  		v.AddArg3(x, y, cmp)
  1401  		return true
  1402  	}
  1403  	// match: (CondSelect x y bool)
  1404  	// cond: flagArg(bool) == nil
  1405  	// result: (ISEL [6] x y (CMPconst [0] (ANDconst [1] bool)))
  1406  	for {
  1407  		x := v_0
  1408  		y := v_1
  1409  		bool := v_2
  1410  		if !(flagArg(bool) == nil) {
  1411  			break
  1412  		}
  1413  		v.reset(OpPPC64ISEL)
  1414  		v.AuxInt = int32ToAuxInt(6)
  1415  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  1416  		v0.AuxInt = int64ToAuxInt(0)
  1417  		v1 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  1418  		v1.AuxInt = int64ToAuxInt(1)
  1419  		v1.AddArg(bool)
  1420  		v0.AddArg(v1)
  1421  		v.AddArg3(x, y, v0)
  1422  		return true
  1423  	}
  1424  	return false
  1425  }
  1426  func rewriteValuePPC64_OpConst16(v *Value) bool {
  1427  	// match: (Const16 [val])
  1428  	// result: (MOVDconst [int64(val)])
  1429  	for {
  1430  		val := auxIntToInt16(v.AuxInt)
  1431  		v.reset(OpPPC64MOVDconst)
  1432  		v.AuxInt = int64ToAuxInt(int64(val))
  1433  		return true
  1434  	}
  1435  }
  1436  func rewriteValuePPC64_OpConst32(v *Value) bool {
  1437  	// match: (Const32 [val])
  1438  	// result: (MOVDconst [int64(val)])
  1439  	for {
  1440  		val := auxIntToInt32(v.AuxInt)
  1441  		v.reset(OpPPC64MOVDconst)
  1442  		v.AuxInt = int64ToAuxInt(int64(val))
  1443  		return true
  1444  	}
  1445  }
  1446  func rewriteValuePPC64_OpConst64(v *Value) bool {
  1447  	// match: (Const64 [val])
  1448  	// result: (MOVDconst [int64(val)])
  1449  	for {
  1450  		val := auxIntToInt64(v.AuxInt)
  1451  		v.reset(OpPPC64MOVDconst)
  1452  		v.AuxInt = int64ToAuxInt(int64(val))
  1453  		return true
  1454  	}
  1455  }
  1456  func rewriteValuePPC64_OpConst8(v *Value) bool {
  1457  	// match: (Const8 [val])
  1458  	// result: (MOVDconst [int64(val)])
  1459  	for {
  1460  		val := auxIntToInt8(v.AuxInt)
  1461  		v.reset(OpPPC64MOVDconst)
  1462  		v.AuxInt = int64ToAuxInt(int64(val))
  1463  		return true
  1464  	}
  1465  }
  1466  func rewriteValuePPC64_OpConstBool(v *Value) bool {
  1467  	// match: (ConstBool [t])
  1468  	// result: (MOVDconst [b2i(t)])
  1469  	for {
  1470  		t := auxIntToBool(v.AuxInt)
  1471  		v.reset(OpPPC64MOVDconst)
  1472  		v.AuxInt = int64ToAuxInt(b2i(t))
  1473  		return true
  1474  	}
  1475  }
  1476  func rewriteValuePPC64_OpConstNil(v *Value) bool {
  1477  	// match: (ConstNil)
  1478  	// result: (MOVDconst [0])
  1479  	for {
  1480  		v.reset(OpPPC64MOVDconst)
  1481  		v.AuxInt = int64ToAuxInt(0)
  1482  		return true
  1483  	}
  1484  }
  1485  func rewriteValuePPC64_OpCopysign(v *Value) bool {
  1486  	v_1 := v.Args[1]
  1487  	v_0 := v.Args[0]
  1488  	// match: (Copysign x y)
  1489  	// result: (FCPSGN y x)
  1490  	for {
  1491  		x := v_0
  1492  		y := v_1
  1493  		v.reset(OpPPC64FCPSGN)
  1494  		v.AddArg2(y, x)
  1495  		return true
  1496  	}
  1497  }
  1498  func rewriteValuePPC64_OpCtz16(v *Value) bool {
  1499  	v_0 := v.Args[0]
  1500  	b := v.Block
  1501  	typ := &b.Func.Config.Types
  1502  	// match: (Ctz16 x)
  1503  	// result: (POPCNTW (MOVHZreg (ANDN <typ.Int16> (ADDconst <typ.Int16> [-1] x) x)))
  1504  	for {
  1505  		x := v_0
  1506  		v.reset(OpPPC64POPCNTW)
  1507  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  1508  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int16)
  1509  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int16)
  1510  		v2.AuxInt = int64ToAuxInt(-1)
  1511  		v2.AddArg(x)
  1512  		v1.AddArg2(v2, x)
  1513  		v0.AddArg(v1)
  1514  		v.AddArg(v0)
  1515  		return true
  1516  	}
  1517  }
  1518  func rewriteValuePPC64_OpCtz32(v *Value) bool {
  1519  	v_0 := v.Args[0]
  1520  	b := v.Block
  1521  	typ := &b.Func.Config.Types
  1522  	// match: (Ctz32 x)
  1523  	// cond: buildcfg.GOPPC64<=8
  1524  	// result: (POPCNTW (MOVWZreg (ANDN <typ.Int> (ADDconst <typ.Int> [-1] x) x)))
  1525  	for {
  1526  		x := v_0
  1527  		if !(buildcfg.GOPPC64 <= 8) {
  1528  			break
  1529  		}
  1530  		v.reset(OpPPC64POPCNTW)
  1531  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
  1532  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int)
  1533  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int)
  1534  		v2.AuxInt = int64ToAuxInt(-1)
  1535  		v2.AddArg(x)
  1536  		v1.AddArg2(v2, x)
  1537  		v0.AddArg(v1)
  1538  		v.AddArg(v0)
  1539  		return true
  1540  	}
  1541  	// match: (Ctz32 x)
  1542  	// result: (CNTTZW (MOVWZreg x))
  1543  	for {
  1544  		x := v_0
  1545  		v.reset(OpPPC64CNTTZW)
  1546  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
  1547  		v0.AddArg(x)
  1548  		v.AddArg(v0)
  1549  		return true
  1550  	}
  1551  }
  1552  func rewriteValuePPC64_OpCtz64(v *Value) bool {
  1553  	v_0 := v.Args[0]
  1554  	b := v.Block
  1555  	typ := &b.Func.Config.Types
  1556  	// match: (Ctz64 x)
  1557  	// cond: buildcfg.GOPPC64<=8
  1558  	// result: (POPCNTD (ANDN <typ.Int64> (ADDconst <typ.Int64> [-1] x) x))
  1559  	for {
  1560  		x := v_0
  1561  		if !(buildcfg.GOPPC64 <= 8) {
  1562  			break
  1563  		}
  1564  		v.reset(OpPPC64POPCNTD)
  1565  		v0 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int64)
  1566  		v1 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int64)
  1567  		v1.AuxInt = int64ToAuxInt(-1)
  1568  		v1.AddArg(x)
  1569  		v0.AddArg2(v1, x)
  1570  		v.AddArg(v0)
  1571  		return true
  1572  	}
  1573  	// match: (Ctz64 x)
  1574  	// result: (CNTTZD x)
  1575  	for {
  1576  		x := v_0
  1577  		v.reset(OpPPC64CNTTZD)
  1578  		v.AddArg(x)
  1579  		return true
  1580  	}
  1581  }
  1582  func rewriteValuePPC64_OpCtz8(v *Value) bool {
  1583  	v_0 := v.Args[0]
  1584  	b := v.Block
  1585  	typ := &b.Func.Config.Types
  1586  	// match: (Ctz8 x)
  1587  	// result: (POPCNTB (MOVBZreg (ANDN <typ.UInt8> (ADDconst <typ.UInt8> [-1] x) x)))
  1588  	for {
  1589  		x := v_0
  1590  		v.reset(OpPPC64POPCNTB)
  1591  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  1592  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.UInt8)
  1593  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.UInt8)
  1594  		v2.AuxInt = int64ToAuxInt(-1)
  1595  		v2.AddArg(x)
  1596  		v1.AddArg2(v2, x)
  1597  		v0.AddArg(v1)
  1598  		v.AddArg(v0)
  1599  		return true
  1600  	}
  1601  }
  1602  func rewriteValuePPC64_OpCvt32Fto32(v *Value) bool {
  1603  	v_0 := v.Args[0]
  1604  	b := v.Block
  1605  	typ := &b.Func.Config.Types
  1606  	// match: (Cvt32Fto32 x)
  1607  	// result: (MFVSRD (FCTIWZ x))
  1608  	for {
  1609  		x := v_0
  1610  		v.reset(OpPPC64MFVSRD)
  1611  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
  1612  		v0.AddArg(x)
  1613  		v.AddArg(v0)
  1614  		return true
  1615  	}
  1616  }
  1617  func rewriteValuePPC64_OpCvt32Fto64(v *Value) bool {
  1618  	v_0 := v.Args[0]
  1619  	b := v.Block
  1620  	typ := &b.Func.Config.Types
  1621  	// match: (Cvt32Fto64 x)
  1622  	// result: (MFVSRD (FCTIDZ x))
  1623  	for {
  1624  		x := v_0
  1625  		v.reset(OpPPC64MFVSRD)
  1626  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
  1627  		v0.AddArg(x)
  1628  		v.AddArg(v0)
  1629  		return true
  1630  	}
  1631  }
  1632  func rewriteValuePPC64_OpCvt32to32F(v *Value) bool {
  1633  	v_0 := v.Args[0]
  1634  	b := v.Block
  1635  	typ := &b.Func.Config.Types
  1636  	// match: (Cvt32to32F x)
  1637  	// result: (FCFIDS (MTVSRD (SignExt32to64 x)))
  1638  	for {
  1639  		x := v_0
  1640  		v.reset(OpPPC64FCFIDS)
  1641  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1642  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1643  		v1.AddArg(x)
  1644  		v0.AddArg(v1)
  1645  		v.AddArg(v0)
  1646  		return true
  1647  	}
  1648  }
  1649  func rewriteValuePPC64_OpCvt32to64F(v *Value) bool {
  1650  	v_0 := v.Args[0]
  1651  	b := v.Block
  1652  	typ := &b.Func.Config.Types
  1653  	// match: (Cvt32to64F x)
  1654  	// result: (FCFID (MTVSRD (SignExt32to64 x)))
  1655  	for {
  1656  		x := v_0
  1657  		v.reset(OpPPC64FCFID)
  1658  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1659  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1660  		v1.AddArg(x)
  1661  		v0.AddArg(v1)
  1662  		v.AddArg(v0)
  1663  		return true
  1664  	}
  1665  }
  1666  func rewriteValuePPC64_OpCvt64Fto32(v *Value) bool {
  1667  	v_0 := v.Args[0]
  1668  	b := v.Block
  1669  	typ := &b.Func.Config.Types
  1670  	// match: (Cvt64Fto32 x)
  1671  	// result: (MFVSRD (FCTIWZ x))
  1672  	for {
  1673  		x := v_0
  1674  		v.reset(OpPPC64MFVSRD)
  1675  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
  1676  		v0.AddArg(x)
  1677  		v.AddArg(v0)
  1678  		return true
  1679  	}
  1680  }
  1681  func rewriteValuePPC64_OpCvt64Fto64(v *Value) bool {
  1682  	v_0 := v.Args[0]
  1683  	b := v.Block
  1684  	typ := &b.Func.Config.Types
  1685  	// match: (Cvt64Fto64 x)
  1686  	// result: (MFVSRD (FCTIDZ x))
  1687  	for {
  1688  		x := v_0
  1689  		v.reset(OpPPC64MFVSRD)
  1690  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
  1691  		v0.AddArg(x)
  1692  		v.AddArg(v0)
  1693  		return true
  1694  	}
  1695  }
  1696  func rewriteValuePPC64_OpCvt64to32F(v *Value) bool {
  1697  	v_0 := v.Args[0]
  1698  	b := v.Block
  1699  	typ := &b.Func.Config.Types
  1700  	// match: (Cvt64to32F x)
  1701  	// result: (FCFIDS (MTVSRD x))
  1702  	for {
  1703  		x := v_0
  1704  		v.reset(OpPPC64FCFIDS)
  1705  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1706  		v0.AddArg(x)
  1707  		v.AddArg(v0)
  1708  		return true
  1709  	}
  1710  }
  1711  func rewriteValuePPC64_OpCvt64to64F(v *Value) bool {
  1712  	v_0 := v.Args[0]
  1713  	b := v.Block
  1714  	typ := &b.Func.Config.Types
  1715  	// match: (Cvt64to64F x)
  1716  	// result: (FCFID (MTVSRD x))
  1717  	for {
  1718  		x := v_0
  1719  		v.reset(OpPPC64FCFID)
  1720  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1721  		v0.AddArg(x)
  1722  		v.AddArg(v0)
  1723  		return true
  1724  	}
  1725  }
  1726  func rewriteValuePPC64_OpDiv16(v *Value) bool {
  1727  	v_1 := v.Args[1]
  1728  	v_0 := v.Args[0]
  1729  	b := v.Block
  1730  	typ := &b.Func.Config.Types
  1731  	// match: (Div16 [false] x y)
  1732  	// result: (DIVW (SignExt16to32 x) (SignExt16to32 y))
  1733  	for {
  1734  		if auxIntToBool(v.AuxInt) != false {
  1735  			break
  1736  		}
  1737  		x := v_0
  1738  		y := v_1
  1739  		v.reset(OpPPC64DIVW)
  1740  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1741  		v0.AddArg(x)
  1742  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1743  		v1.AddArg(y)
  1744  		v.AddArg2(v0, v1)
  1745  		return true
  1746  	}
  1747  	return false
  1748  }
  1749  func rewriteValuePPC64_OpDiv16u(v *Value) bool {
  1750  	v_1 := v.Args[1]
  1751  	v_0 := v.Args[0]
  1752  	b := v.Block
  1753  	typ := &b.Func.Config.Types
  1754  	// match: (Div16u x y)
  1755  	// result: (DIVWU (ZeroExt16to32 x) (ZeroExt16to32 y))
  1756  	for {
  1757  		x := v_0
  1758  		y := v_1
  1759  		v.reset(OpPPC64DIVWU)
  1760  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1761  		v0.AddArg(x)
  1762  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1763  		v1.AddArg(y)
  1764  		v.AddArg2(v0, v1)
  1765  		return true
  1766  	}
  1767  }
  1768  func rewriteValuePPC64_OpDiv32(v *Value) bool {
  1769  	v_1 := v.Args[1]
  1770  	v_0 := v.Args[0]
  1771  	// match: (Div32 [false] x y)
  1772  	// result: (DIVW x y)
  1773  	for {
  1774  		if auxIntToBool(v.AuxInt) != false {
  1775  			break
  1776  		}
  1777  		x := v_0
  1778  		y := v_1
  1779  		v.reset(OpPPC64DIVW)
  1780  		v.AddArg2(x, y)
  1781  		return true
  1782  	}
  1783  	return false
  1784  }
  1785  func rewriteValuePPC64_OpDiv64(v *Value) bool {
  1786  	v_1 := v.Args[1]
  1787  	v_0 := v.Args[0]
  1788  	// match: (Div64 [false] x y)
  1789  	// result: (DIVD x y)
  1790  	for {
  1791  		if auxIntToBool(v.AuxInt) != false {
  1792  			break
  1793  		}
  1794  		x := v_0
  1795  		y := v_1
  1796  		v.reset(OpPPC64DIVD)
  1797  		v.AddArg2(x, y)
  1798  		return true
  1799  	}
  1800  	return false
  1801  }
  1802  func rewriteValuePPC64_OpDiv8(v *Value) bool {
  1803  	v_1 := v.Args[1]
  1804  	v_0 := v.Args[0]
  1805  	b := v.Block
  1806  	typ := &b.Func.Config.Types
  1807  	// match: (Div8 x y)
  1808  	// result: (DIVW (SignExt8to32 x) (SignExt8to32 y))
  1809  	for {
  1810  		x := v_0
  1811  		y := v_1
  1812  		v.reset(OpPPC64DIVW)
  1813  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1814  		v0.AddArg(x)
  1815  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1816  		v1.AddArg(y)
  1817  		v.AddArg2(v0, v1)
  1818  		return true
  1819  	}
  1820  }
  1821  func rewriteValuePPC64_OpDiv8u(v *Value) bool {
  1822  	v_1 := v.Args[1]
  1823  	v_0 := v.Args[0]
  1824  	b := v.Block
  1825  	typ := &b.Func.Config.Types
  1826  	// match: (Div8u x y)
  1827  	// result: (DIVWU (ZeroExt8to32 x) (ZeroExt8to32 y))
  1828  	for {
  1829  		x := v_0
  1830  		y := v_1
  1831  		v.reset(OpPPC64DIVWU)
  1832  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1833  		v0.AddArg(x)
  1834  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1835  		v1.AddArg(y)
  1836  		v.AddArg2(v0, v1)
  1837  		return true
  1838  	}
  1839  }
  1840  func rewriteValuePPC64_OpEq16(v *Value) bool {
  1841  	v_1 := v.Args[1]
  1842  	v_0 := v.Args[0]
  1843  	b := v.Block
  1844  	typ := &b.Func.Config.Types
  1845  	// match: (Eq16 x y)
  1846  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  1847  	// result: (Equal (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  1848  	for {
  1849  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1850  			x := v_0
  1851  			y := v_1
  1852  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  1853  				continue
  1854  			}
  1855  			v.reset(OpPPC64Equal)
  1856  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1857  			v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1858  			v1.AddArg(x)
  1859  			v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1860  			v2.AddArg(y)
  1861  			v0.AddArg2(v1, v2)
  1862  			v.AddArg(v0)
  1863  			return true
  1864  		}
  1865  		break
  1866  	}
  1867  	// match: (Eq16 x y)
  1868  	// result: (Equal (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
  1869  	for {
  1870  		x := v_0
  1871  		y := v_1
  1872  		v.reset(OpPPC64Equal)
  1873  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1874  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1875  		v1.AddArg(x)
  1876  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1877  		v2.AddArg(y)
  1878  		v0.AddArg2(v1, v2)
  1879  		v.AddArg(v0)
  1880  		return true
  1881  	}
  1882  }
  1883  func rewriteValuePPC64_OpEq32(v *Value) bool {
  1884  	v_1 := v.Args[1]
  1885  	v_0 := v.Args[0]
  1886  	b := v.Block
  1887  	// match: (Eq32 x y)
  1888  	// result: (Equal (CMPW x y))
  1889  	for {
  1890  		x := v_0
  1891  		y := v_1
  1892  		v.reset(OpPPC64Equal)
  1893  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1894  		v0.AddArg2(x, y)
  1895  		v.AddArg(v0)
  1896  		return true
  1897  	}
  1898  }
  1899  func rewriteValuePPC64_OpEq32F(v *Value) bool {
  1900  	v_1 := v.Args[1]
  1901  	v_0 := v.Args[0]
  1902  	b := v.Block
  1903  	// match: (Eq32F x y)
  1904  	// result: (Equal (FCMPU x y))
  1905  	for {
  1906  		x := v_0
  1907  		y := v_1
  1908  		v.reset(OpPPC64Equal)
  1909  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  1910  		v0.AddArg2(x, y)
  1911  		v.AddArg(v0)
  1912  		return true
  1913  	}
  1914  }
  1915  func rewriteValuePPC64_OpEq64(v *Value) bool {
  1916  	v_1 := v.Args[1]
  1917  	v_0 := v.Args[0]
  1918  	b := v.Block
  1919  	// match: (Eq64 x y)
  1920  	// result: (Equal (CMP x y))
  1921  	for {
  1922  		x := v_0
  1923  		y := v_1
  1924  		v.reset(OpPPC64Equal)
  1925  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  1926  		v0.AddArg2(x, y)
  1927  		v.AddArg(v0)
  1928  		return true
  1929  	}
  1930  }
  1931  func rewriteValuePPC64_OpEq64F(v *Value) bool {
  1932  	v_1 := v.Args[1]
  1933  	v_0 := v.Args[0]
  1934  	b := v.Block
  1935  	// match: (Eq64F x y)
  1936  	// result: (Equal (FCMPU x y))
  1937  	for {
  1938  		x := v_0
  1939  		y := v_1
  1940  		v.reset(OpPPC64Equal)
  1941  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  1942  		v0.AddArg2(x, y)
  1943  		v.AddArg(v0)
  1944  		return true
  1945  	}
  1946  }
  1947  func rewriteValuePPC64_OpEq8(v *Value) bool {
  1948  	v_1 := v.Args[1]
  1949  	v_0 := v.Args[0]
  1950  	b := v.Block
  1951  	typ := &b.Func.Config.Types
  1952  	// match: (Eq8 x y)
  1953  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  1954  	// result: (Equal (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  1955  	for {
  1956  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1957  			x := v_0
  1958  			y := v_1
  1959  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  1960  				continue
  1961  			}
  1962  			v.reset(OpPPC64Equal)
  1963  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1964  			v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1965  			v1.AddArg(x)
  1966  			v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1967  			v2.AddArg(y)
  1968  			v0.AddArg2(v1, v2)
  1969  			v.AddArg(v0)
  1970  			return true
  1971  		}
  1972  		break
  1973  	}
  1974  	// match: (Eq8 x y)
  1975  	// result: (Equal (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
  1976  	for {
  1977  		x := v_0
  1978  		y := v_1
  1979  		v.reset(OpPPC64Equal)
  1980  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1981  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1982  		v1.AddArg(x)
  1983  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1984  		v2.AddArg(y)
  1985  		v0.AddArg2(v1, v2)
  1986  		v.AddArg(v0)
  1987  		return true
  1988  	}
  1989  }
  1990  func rewriteValuePPC64_OpEqB(v *Value) bool {
  1991  	v_1 := v.Args[1]
  1992  	v_0 := v.Args[0]
  1993  	b := v.Block
  1994  	typ := &b.Func.Config.Types
  1995  	// match: (EqB x y)
  1996  	// result: (ANDconst [1] (EQV x y))
  1997  	for {
  1998  		x := v_0
  1999  		y := v_1
  2000  		v.reset(OpPPC64ANDconst)
  2001  		v.AuxInt = int64ToAuxInt(1)
  2002  		v0 := b.NewValue0(v.Pos, OpPPC64EQV, typ.Int64)
  2003  		v0.AddArg2(x, y)
  2004  		v.AddArg(v0)
  2005  		return true
  2006  	}
  2007  }
  2008  func rewriteValuePPC64_OpEqPtr(v *Value) bool {
  2009  	v_1 := v.Args[1]
  2010  	v_0 := v.Args[0]
  2011  	b := v.Block
  2012  	// match: (EqPtr x y)
  2013  	// result: (Equal (CMP x y))
  2014  	for {
  2015  		x := v_0
  2016  		y := v_1
  2017  		v.reset(OpPPC64Equal)
  2018  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2019  		v0.AddArg2(x, y)
  2020  		v.AddArg(v0)
  2021  		return true
  2022  	}
  2023  }
  2024  func rewriteValuePPC64_OpIsInBounds(v *Value) bool {
  2025  	v_1 := v.Args[1]
  2026  	v_0 := v.Args[0]
  2027  	b := v.Block
  2028  	// match: (IsInBounds idx len)
  2029  	// result: (LessThan (CMPU idx len))
  2030  	for {
  2031  		idx := v_0
  2032  		len := v_1
  2033  		v.reset(OpPPC64LessThan)
  2034  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2035  		v0.AddArg2(idx, len)
  2036  		v.AddArg(v0)
  2037  		return true
  2038  	}
  2039  }
  2040  func rewriteValuePPC64_OpIsNonNil(v *Value) bool {
  2041  	v_0 := v.Args[0]
  2042  	b := v.Block
  2043  	// match: (IsNonNil ptr)
  2044  	// result: (NotEqual (CMPconst [0] ptr))
  2045  	for {
  2046  		ptr := v_0
  2047  		v.reset(OpPPC64NotEqual)
  2048  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2049  		v0.AuxInt = int64ToAuxInt(0)
  2050  		v0.AddArg(ptr)
  2051  		v.AddArg(v0)
  2052  		return true
  2053  	}
  2054  }
  2055  func rewriteValuePPC64_OpIsSliceInBounds(v *Value) bool {
  2056  	v_1 := v.Args[1]
  2057  	v_0 := v.Args[0]
  2058  	b := v.Block
  2059  	// match: (IsSliceInBounds idx len)
  2060  	// result: (LessEqual (CMPU idx len))
  2061  	for {
  2062  		idx := v_0
  2063  		len := v_1
  2064  		v.reset(OpPPC64LessEqual)
  2065  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2066  		v0.AddArg2(idx, len)
  2067  		v.AddArg(v0)
  2068  		return true
  2069  	}
  2070  }
  2071  func rewriteValuePPC64_OpLeq16(v *Value) bool {
  2072  	v_1 := v.Args[1]
  2073  	v_0 := v.Args[0]
  2074  	b := v.Block
  2075  	typ := &b.Func.Config.Types
  2076  	// match: (Leq16 x y)
  2077  	// result: (LessEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  2078  	for {
  2079  		x := v_0
  2080  		y := v_1
  2081  		v.reset(OpPPC64LessEqual)
  2082  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2083  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2084  		v1.AddArg(x)
  2085  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2086  		v2.AddArg(y)
  2087  		v0.AddArg2(v1, v2)
  2088  		v.AddArg(v0)
  2089  		return true
  2090  	}
  2091  }
  2092  func rewriteValuePPC64_OpLeq16U(v *Value) bool {
  2093  	v_1 := v.Args[1]
  2094  	v_0 := v.Args[0]
  2095  	b := v.Block
  2096  	typ := &b.Func.Config.Types
  2097  	// match: (Leq16U x y)
  2098  	// result: (LessEqual (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  2099  	for {
  2100  		x := v_0
  2101  		y := v_1
  2102  		v.reset(OpPPC64LessEqual)
  2103  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2104  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2105  		v1.AddArg(x)
  2106  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2107  		v2.AddArg(y)
  2108  		v0.AddArg2(v1, v2)
  2109  		v.AddArg(v0)
  2110  		return true
  2111  	}
  2112  }
  2113  func rewriteValuePPC64_OpLeq32(v *Value) bool {
  2114  	v_1 := v.Args[1]
  2115  	v_0 := v.Args[0]
  2116  	b := v.Block
  2117  	// match: (Leq32 x y)
  2118  	// result: (LessEqual (CMPW x y))
  2119  	for {
  2120  		x := v_0
  2121  		y := v_1
  2122  		v.reset(OpPPC64LessEqual)
  2123  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2124  		v0.AddArg2(x, y)
  2125  		v.AddArg(v0)
  2126  		return true
  2127  	}
  2128  }
  2129  func rewriteValuePPC64_OpLeq32F(v *Value) bool {
  2130  	v_1 := v.Args[1]
  2131  	v_0 := v.Args[0]
  2132  	b := v.Block
  2133  	// match: (Leq32F x y)
  2134  	// result: (FLessEqual (FCMPU x y))
  2135  	for {
  2136  		x := v_0
  2137  		y := v_1
  2138  		v.reset(OpPPC64FLessEqual)
  2139  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2140  		v0.AddArg2(x, y)
  2141  		v.AddArg(v0)
  2142  		return true
  2143  	}
  2144  }
  2145  func rewriteValuePPC64_OpLeq32U(v *Value) bool {
  2146  	v_1 := v.Args[1]
  2147  	v_0 := v.Args[0]
  2148  	b := v.Block
  2149  	// match: (Leq32U x y)
  2150  	// result: (LessEqual (CMPWU x y))
  2151  	for {
  2152  		x := v_0
  2153  		y := v_1
  2154  		v.reset(OpPPC64LessEqual)
  2155  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2156  		v0.AddArg2(x, y)
  2157  		v.AddArg(v0)
  2158  		return true
  2159  	}
  2160  }
  2161  func rewriteValuePPC64_OpLeq64(v *Value) bool {
  2162  	v_1 := v.Args[1]
  2163  	v_0 := v.Args[0]
  2164  	b := v.Block
  2165  	// match: (Leq64 x y)
  2166  	// result: (LessEqual (CMP x y))
  2167  	for {
  2168  		x := v_0
  2169  		y := v_1
  2170  		v.reset(OpPPC64LessEqual)
  2171  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2172  		v0.AddArg2(x, y)
  2173  		v.AddArg(v0)
  2174  		return true
  2175  	}
  2176  }
  2177  func rewriteValuePPC64_OpLeq64F(v *Value) bool {
  2178  	v_1 := v.Args[1]
  2179  	v_0 := v.Args[0]
  2180  	b := v.Block
  2181  	// match: (Leq64F x y)
  2182  	// result: (FLessEqual (FCMPU x y))
  2183  	for {
  2184  		x := v_0
  2185  		y := v_1
  2186  		v.reset(OpPPC64FLessEqual)
  2187  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2188  		v0.AddArg2(x, y)
  2189  		v.AddArg(v0)
  2190  		return true
  2191  	}
  2192  }
  2193  func rewriteValuePPC64_OpLeq64U(v *Value) bool {
  2194  	v_1 := v.Args[1]
  2195  	v_0 := v.Args[0]
  2196  	b := v.Block
  2197  	// match: (Leq64U x y)
  2198  	// result: (LessEqual (CMPU x y))
  2199  	for {
  2200  		x := v_0
  2201  		y := v_1
  2202  		v.reset(OpPPC64LessEqual)
  2203  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2204  		v0.AddArg2(x, y)
  2205  		v.AddArg(v0)
  2206  		return true
  2207  	}
  2208  }
  2209  func rewriteValuePPC64_OpLeq8(v *Value) bool {
  2210  	v_1 := v.Args[1]
  2211  	v_0 := v.Args[0]
  2212  	b := v.Block
  2213  	typ := &b.Func.Config.Types
  2214  	// match: (Leq8 x y)
  2215  	// result: (LessEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2216  	for {
  2217  		x := v_0
  2218  		y := v_1
  2219  		v.reset(OpPPC64LessEqual)
  2220  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2221  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2222  		v1.AddArg(x)
  2223  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2224  		v2.AddArg(y)
  2225  		v0.AddArg2(v1, v2)
  2226  		v.AddArg(v0)
  2227  		return true
  2228  	}
  2229  }
  2230  func rewriteValuePPC64_OpLeq8U(v *Value) bool {
  2231  	v_1 := v.Args[1]
  2232  	v_0 := v.Args[0]
  2233  	b := v.Block
  2234  	typ := &b.Func.Config.Types
  2235  	// match: (Leq8U x y)
  2236  	// result: (LessEqual (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2237  	for {
  2238  		x := v_0
  2239  		y := v_1
  2240  		v.reset(OpPPC64LessEqual)
  2241  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2242  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2243  		v1.AddArg(x)
  2244  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2245  		v2.AddArg(y)
  2246  		v0.AddArg2(v1, v2)
  2247  		v.AddArg(v0)
  2248  		return true
  2249  	}
  2250  }
  2251  func rewriteValuePPC64_OpLess16(v *Value) bool {
  2252  	v_1 := v.Args[1]
  2253  	v_0 := v.Args[0]
  2254  	b := v.Block
  2255  	typ := &b.Func.Config.Types
  2256  	// match: (Less16 x y)
  2257  	// result: (LessThan (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  2258  	for {
  2259  		x := v_0
  2260  		y := v_1
  2261  		v.reset(OpPPC64LessThan)
  2262  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2263  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2264  		v1.AddArg(x)
  2265  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2266  		v2.AddArg(y)
  2267  		v0.AddArg2(v1, v2)
  2268  		v.AddArg(v0)
  2269  		return true
  2270  	}
  2271  }
  2272  func rewriteValuePPC64_OpLess16U(v *Value) bool {
  2273  	v_1 := v.Args[1]
  2274  	v_0 := v.Args[0]
  2275  	b := v.Block
  2276  	typ := &b.Func.Config.Types
  2277  	// match: (Less16U x y)
  2278  	// result: (LessThan (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  2279  	for {
  2280  		x := v_0
  2281  		y := v_1
  2282  		v.reset(OpPPC64LessThan)
  2283  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2284  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2285  		v1.AddArg(x)
  2286  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2287  		v2.AddArg(y)
  2288  		v0.AddArg2(v1, v2)
  2289  		v.AddArg(v0)
  2290  		return true
  2291  	}
  2292  }
  2293  func rewriteValuePPC64_OpLess32(v *Value) bool {
  2294  	v_1 := v.Args[1]
  2295  	v_0 := v.Args[0]
  2296  	b := v.Block
  2297  	// match: (Less32 x y)
  2298  	// result: (LessThan (CMPW x y))
  2299  	for {
  2300  		x := v_0
  2301  		y := v_1
  2302  		v.reset(OpPPC64LessThan)
  2303  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2304  		v0.AddArg2(x, y)
  2305  		v.AddArg(v0)
  2306  		return true
  2307  	}
  2308  }
  2309  func rewriteValuePPC64_OpLess32F(v *Value) bool {
  2310  	v_1 := v.Args[1]
  2311  	v_0 := v.Args[0]
  2312  	b := v.Block
  2313  	// match: (Less32F x y)
  2314  	// result: (FLessThan (FCMPU x y))
  2315  	for {
  2316  		x := v_0
  2317  		y := v_1
  2318  		v.reset(OpPPC64FLessThan)
  2319  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2320  		v0.AddArg2(x, y)
  2321  		v.AddArg(v0)
  2322  		return true
  2323  	}
  2324  }
  2325  func rewriteValuePPC64_OpLess32U(v *Value) bool {
  2326  	v_1 := v.Args[1]
  2327  	v_0 := v.Args[0]
  2328  	b := v.Block
  2329  	// match: (Less32U x y)
  2330  	// result: (LessThan (CMPWU x y))
  2331  	for {
  2332  		x := v_0
  2333  		y := v_1
  2334  		v.reset(OpPPC64LessThan)
  2335  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2336  		v0.AddArg2(x, y)
  2337  		v.AddArg(v0)
  2338  		return true
  2339  	}
  2340  }
  2341  func rewriteValuePPC64_OpLess64(v *Value) bool {
  2342  	v_1 := v.Args[1]
  2343  	v_0 := v.Args[0]
  2344  	b := v.Block
  2345  	// match: (Less64 x y)
  2346  	// result: (LessThan (CMP x y))
  2347  	for {
  2348  		x := v_0
  2349  		y := v_1
  2350  		v.reset(OpPPC64LessThan)
  2351  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2352  		v0.AddArg2(x, y)
  2353  		v.AddArg(v0)
  2354  		return true
  2355  	}
  2356  }
  2357  func rewriteValuePPC64_OpLess64F(v *Value) bool {
  2358  	v_1 := v.Args[1]
  2359  	v_0 := v.Args[0]
  2360  	b := v.Block
  2361  	// match: (Less64F x y)
  2362  	// result: (FLessThan (FCMPU x y))
  2363  	for {
  2364  		x := v_0
  2365  		y := v_1
  2366  		v.reset(OpPPC64FLessThan)
  2367  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2368  		v0.AddArg2(x, y)
  2369  		v.AddArg(v0)
  2370  		return true
  2371  	}
  2372  }
  2373  func rewriteValuePPC64_OpLess64U(v *Value) bool {
  2374  	v_1 := v.Args[1]
  2375  	v_0 := v.Args[0]
  2376  	b := v.Block
  2377  	// match: (Less64U x y)
  2378  	// result: (LessThan (CMPU x y))
  2379  	for {
  2380  		x := v_0
  2381  		y := v_1
  2382  		v.reset(OpPPC64LessThan)
  2383  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2384  		v0.AddArg2(x, y)
  2385  		v.AddArg(v0)
  2386  		return true
  2387  	}
  2388  }
  2389  func rewriteValuePPC64_OpLess8(v *Value) bool {
  2390  	v_1 := v.Args[1]
  2391  	v_0 := v.Args[0]
  2392  	b := v.Block
  2393  	typ := &b.Func.Config.Types
  2394  	// match: (Less8 x y)
  2395  	// result: (LessThan (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2396  	for {
  2397  		x := v_0
  2398  		y := v_1
  2399  		v.reset(OpPPC64LessThan)
  2400  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2401  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2402  		v1.AddArg(x)
  2403  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2404  		v2.AddArg(y)
  2405  		v0.AddArg2(v1, v2)
  2406  		v.AddArg(v0)
  2407  		return true
  2408  	}
  2409  }
  2410  func rewriteValuePPC64_OpLess8U(v *Value) bool {
  2411  	v_1 := v.Args[1]
  2412  	v_0 := v.Args[0]
  2413  	b := v.Block
  2414  	typ := &b.Func.Config.Types
  2415  	// match: (Less8U x y)
  2416  	// result: (LessThan (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2417  	for {
  2418  		x := v_0
  2419  		y := v_1
  2420  		v.reset(OpPPC64LessThan)
  2421  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2422  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2423  		v1.AddArg(x)
  2424  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2425  		v2.AddArg(y)
  2426  		v0.AddArg2(v1, v2)
  2427  		v.AddArg(v0)
  2428  		return true
  2429  	}
  2430  }
  2431  func rewriteValuePPC64_OpLoad(v *Value) bool {
  2432  	v_1 := v.Args[1]
  2433  	v_0 := v.Args[0]
  2434  	b := v.Block
  2435  	typ := &b.Func.Config.Types
  2436  	// match: (Load <t> ptr mem)
  2437  	// cond: (is64BitInt(t) || isPtr(t))
  2438  	// result: (MOVDload ptr mem)
  2439  	for {
  2440  		t := v.Type
  2441  		ptr := v_0
  2442  		mem := v_1
  2443  		if !(is64BitInt(t) || isPtr(t)) {
  2444  			break
  2445  		}
  2446  		v.reset(OpPPC64MOVDload)
  2447  		v.AddArg2(ptr, mem)
  2448  		return true
  2449  	}
  2450  	// match: (Load <t> ptr mem)
  2451  	// cond: is32BitInt(t) && t.IsSigned()
  2452  	// result: (MOVWload ptr mem)
  2453  	for {
  2454  		t := v.Type
  2455  		ptr := v_0
  2456  		mem := v_1
  2457  		if !(is32BitInt(t) && t.IsSigned()) {
  2458  			break
  2459  		}
  2460  		v.reset(OpPPC64MOVWload)
  2461  		v.AddArg2(ptr, mem)
  2462  		return true
  2463  	}
  2464  	// match: (Load <t> ptr mem)
  2465  	// cond: is32BitInt(t) && !t.IsSigned()
  2466  	// result: (MOVWZload ptr mem)
  2467  	for {
  2468  		t := v.Type
  2469  		ptr := v_0
  2470  		mem := v_1
  2471  		if !(is32BitInt(t) && !t.IsSigned()) {
  2472  			break
  2473  		}
  2474  		v.reset(OpPPC64MOVWZload)
  2475  		v.AddArg2(ptr, mem)
  2476  		return true
  2477  	}
  2478  	// match: (Load <t> ptr mem)
  2479  	// cond: is16BitInt(t) && t.IsSigned()
  2480  	// result: (MOVHload ptr mem)
  2481  	for {
  2482  		t := v.Type
  2483  		ptr := v_0
  2484  		mem := v_1
  2485  		if !(is16BitInt(t) && t.IsSigned()) {
  2486  			break
  2487  		}
  2488  		v.reset(OpPPC64MOVHload)
  2489  		v.AddArg2(ptr, mem)
  2490  		return true
  2491  	}
  2492  	// match: (Load <t> ptr mem)
  2493  	// cond: is16BitInt(t) && !t.IsSigned()
  2494  	// result: (MOVHZload ptr mem)
  2495  	for {
  2496  		t := v.Type
  2497  		ptr := v_0
  2498  		mem := v_1
  2499  		if !(is16BitInt(t) && !t.IsSigned()) {
  2500  			break
  2501  		}
  2502  		v.reset(OpPPC64MOVHZload)
  2503  		v.AddArg2(ptr, mem)
  2504  		return true
  2505  	}
  2506  	// match: (Load <t> ptr mem)
  2507  	// cond: t.IsBoolean()
  2508  	// result: (MOVBZload ptr mem)
  2509  	for {
  2510  		t := v.Type
  2511  		ptr := v_0
  2512  		mem := v_1
  2513  		if !(t.IsBoolean()) {
  2514  			break
  2515  		}
  2516  		v.reset(OpPPC64MOVBZload)
  2517  		v.AddArg2(ptr, mem)
  2518  		return true
  2519  	}
  2520  	// match: (Load <t> ptr mem)
  2521  	// cond: is8BitInt(t) && t.IsSigned()
  2522  	// result: (MOVBreg (MOVBZload ptr mem))
  2523  	for {
  2524  		t := v.Type
  2525  		ptr := v_0
  2526  		mem := v_1
  2527  		if !(is8BitInt(t) && t.IsSigned()) {
  2528  			break
  2529  		}
  2530  		v.reset(OpPPC64MOVBreg)
  2531  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  2532  		v0.AddArg2(ptr, mem)
  2533  		v.AddArg(v0)
  2534  		return true
  2535  	}
  2536  	// match: (Load <t> ptr mem)
  2537  	// cond: is8BitInt(t) && !t.IsSigned()
  2538  	// result: (MOVBZload ptr mem)
  2539  	for {
  2540  		t := v.Type
  2541  		ptr := v_0
  2542  		mem := v_1
  2543  		if !(is8BitInt(t) && !t.IsSigned()) {
  2544  			break
  2545  		}
  2546  		v.reset(OpPPC64MOVBZload)
  2547  		v.AddArg2(ptr, mem)
  2548  		return true
  2549  	}
  2550  	// match: (Load <t> ptr mem)
  2551  	// cond: is32BitFloat(t)
  2552  	// result: (FMOVSload ptr mem)
  2553  	for {
  2554  		t := v.Type
  2555  		ptr := v_0
  2556  		mem := v_1
  2557  		if !(is32BitFloat(t)) {
  2558  			break
  2559  		}
  2560  		v.reset(OpPPC64FMOVSload)
  2561  		v.AddArg2(ptr, mem)
  2562  		return true
  2563  	}
  2564  	// match: (Load <t> ptr mem)
  2565  	// cond: is64BitFloat(t)
  2566  	// result: (FMOVDload ptr mem)
  2567  	for {
  2568  		t := v.Type
  2569  		ptr := v_0
  2570  		mem := v_1
  2571  		if !(is64BitFloat(t)) {
  2572  			break
  2573  		}
  2574  		v.reset(OpPPC64FMOVDload)
  2575  		v.AddArg2(ptr, mem)
  2576  		return true
  2577  	}
  2578  	return false
  2579  }
  2580  func rewriteValuePPC64_OpLocalAddr(v *Value) bool {
  2581  	v_1 := v.Args[1]
  2582  	v_0 := v.Args[0]
  2583  	b := v.Block
  2584  	typ := &b.Func.Config.Types
  2585  	// match: (LocalAddr <t> {sym} base mem)
  2586  	// cond: t.Elem().HasPointers()
  2587  	// result: (MOVDaddr {sym} (SPanchored base mem))
  2588  	for {
  2589  		t := v.Type
  2590  		sym := auxToSym(v.Aux)
  2591  		base := v_0
  2592  		mem := v_1
  2593  		if !(t.Elem().HasPointers()) {
  2594  			break
  2595  		}
  2596  		v.reset(OpPPC64MOVDaddr)
  2597  		v.Aux = symToAux(sym)
  2598  		v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
  2599  		v0.AddArg2(base, mem)
  2600  		v.AddArg(v0)
  2601  		return true
  2602  	}
  2603  	// match: (LocalAddr <t> {sym} base _)
  2604  	// cond: !t.Elem().HasPointers()
  2605  	// result: (MOVDaddr {sym} base)
  2606  	for {
  2607  		t := v.Type
  2608  		sym := auxToSym(v.Aux)
  2609  		base := v_0
  2610  		if !(!t.Elem().HasPointers()) {
  2611  			break
  2612  		}
  2613  		v.reset(OpPPC64MOVDaddr)
  2614  		v.Aux = symToAux(sym)
  2615  		v.AddArg(base)
  2616  		return true
  2617  	}
  2618  	return false
  2619  }
  2620  func rewriteValuePPC64_OpLsh16x16(v *Value) bool {
  2621  	v_1 := v.Args[1]
  2622  	v_0 := v.Args[0]
  2623  	b := v.Block
  2624  	typ := &b.Func.Config.Types
  2625  	// match: (Lsh16x16 x y)
  2626  	// cond: shiftIsBounded(v)
  2627  	// result: (SLD x y)
  2628  	for {
  2629  		x := v_0
  2630  		y := v_1
  2631  		if !(shiftIsBounded(v)) {
  2632  			break
  2633  		}
  2634  		v.reset(OpPPC64SLD)
  2635  		v.AddArg2(x, y)
  2636  		return true
  2637  	}
  2638  	// match: (Lsh16x16 <t> x y)
  2639  	// result: (ISEL [2] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF0] y)))
  2640  	for {
  2641  		t := v.Type
  2642  		x := v_0
  2643  		y := v_1
  2644  		v.reset(OpPPC64ISEL)
  2645  		v.AuxInt = int32ToAuxInt(2)
  2646  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2647  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2648  		v1.AddArg(x)
  2649  		v0.AddArg2(v1, y)
  2650  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2651  		v2.AuxInt = int64ToAuxInt(0)
  2652  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2653  		v3.AuxInt = int64ToAuxInt(0)
  2654  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  2655  		v4.AuxInt = int64ToAuxInt(0xFFF0)
  2656  		v4.AddArg(y)
  2657  		v3.AddArg(v4)
  2658  		v.AddArg3(v0, v2, v3)
  2659  		return true
  2660  	}
  2661  }
  2662  func rewriteValuePPC64_OpLsh16x32(v *Value) bool {
  2663  	v_1 := v.Args[1]
  2664  	v_0 := v.Args[0]
  2665  	b := v.Block
  2666  	typ := &b.Func.Config.Types
  2667  	// match: (Lsh16x32 x y)
  2668  	// cond: shiftIsBounded(v)
  2669  	// result: (SLD x y)
  2670  	for {
  2671  		x := v_0
  2672  		y := v_1
  2673  		if !(shiftIsBounded(v)) {
  2674  			break
  2675  		}
  2676  		v.reset(OpPPC64SLD)
  2677  		v.AddArg2(x, y)
  2678  		return true
  2679  	}
  2680  	// match: (Lsh16x32 <t> x y)
  2681  	// result: (ISEL [0] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [16]))
  2682  	for {
  2683  		t := v.Type
  2684  		x := v_0
  2685  		y := v_1
  2686  		v.reset(OpPPC64ISEL)
  2687  		v.AuxInt = int32ToAuxInt(0)
  2688  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2689  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2690  		v1.AddArg(x)
  2691  		v0.AddArg2(v1, y)
  2692  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2693  		v2.AuxInt = int64ToAuxInt(0)
  2694  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  2695  		v3.AuxInt = int32ToAuxInt(16)
  2696  		v3.AddArg(y)
  2697  		v.AddArg3(v0, v2, v3)
  2698  		return true
  2699  	}
  2700  }
  2701  func rewriteValuePPC64_OpLsh16x64(v *Value) bool {
  2702  	v_1 := v.Args[1]
  2703  	v_0 := v.Args[0]
  2704  	b := v.Block
  2705  	typ := &b.Func.Config.Types
  2706  	// match: (Lsh16x64 x (MOVDconst [c]))
  2707  	// cond: uint64(c) < 16
  2708  	// result: (SLWconst x [c])
  2709  	for {
  2710  		x := v_0
  2711  		if v_1.Op != OpPPC64MOVDconst {
  2712  			break
  2713  		}
  2714  		c := auxIntToInt64(v_1.AuxInt)
  2715  		if !(uint64(c) < 16) {
  2716  			break
  2717  		}
  2718  		v.reset(OpPPC64SLWconst)
  2719  		v.AuxInt = int64ToAuxInt(c)
  2720  		v.AddArg(x)
  2721  		return true
  2722  	}
  2723  	// match: (Lsh16x64 x y)
  2724  	// cond: shiftIsBounded(v)
  2725  	// result: (SLD x y)
  2726  	for {
  2727  		x := v_0
  2728  		y := v_1
  2729  		if !(shiftIsBounded(v)) {
  2730  			break
  2731  		}
  2732  		v.reset(OpPPC64SLD)
  2733  		v.AddArg2(x, y)
  2734  		return true
  2735  	}
  2736  	// match: (Lsh16x64 <t> x y)
  2737  	// result: (ISEL [0] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [16]))
  2738  	for {
  2739  		t := v.Type
  2740  		x := v_0
  2741  		y := v_1
  2742  		v.reset(OpPPC64ISEL)
  2743  		v.AuxInt = int32ToAuxInt(0)
  2744  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2745  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2746  		v1.AddArg(x)
  2747  		v0.AddArg2(v1, y)
  2748  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2749  		v2.AuxInt = int64ToAuxInt(0)
  2750  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  2751  		v3.AuxInt = int64ToAuxInt(16)
  2752  		v3.AddArg(y)
  2753  		v.AddArg3(v0, v2, v3)
  2754  		return true
  2755  	}
  2756  }
  2757  func rewriteValuePPC64_OpLsh16x8(v *Value) bool {
  2758  	v_1 := v.Args[1]
  2759  	v_0 := v.Args[0]
  2760  	b := v.Block
  2761  	typ := &b.Func.Config.Types
  2762  	// match: (Lsh16x8 x y)
  2763  	// cond: shiftIsBounded(v)
  2764  	// result: (SLD x y)
  2765  	for {
  2766  		x := v_0
  2767  		y := v_1
  2768  		if !(shiftIsBounded(v)) {
  2769  			break
  2770  		}
  2771  		v.reset(OpPPC64SLD)
  2772  		v.AddArg2(x, y)
  2773  		return true
  2774  	}
  2775  	// match: (Lsh16x8 <t> x y)
  2776  	// result: (ISEL [2] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F0] y)))
  2777  	for {
  2778  		t := v.Type
  2779  		x := v_0
  2780  		y := v_1
  2781  		v.reset(OpPPC64ISEL)
  2782  		v.AuxInt = int32ToAuxInt(2)
  2783  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2784  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2785  		v1.AddArg(x)
  2786  		v0.AddArg2(v1, y)
  2787  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2788  		v2.AuxInt = int64ToAuxInt(0)
  2789  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2790  		v3.AuxInt = int64ToAuxInt(0)
  2791  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  2792  		v4.AuxInt = int64ToAuxInt(0x00F0)
  2793  		v4.AddArg(y)
  2794  		v3.AddArg(v4)
  2795  		v.AddArg3(v0, v2, v3)
  2796  		return true
  2797  	}
  2798  }
  2799  func rewriteValuePPC64_OpLsh32x16(v *Value) bool {
  2800  	v_1 := v.Args[1]
  2801  	v_0 := v.Args[0]
  2802  	b := v.Block
  2803  	typ := &b.Func.Config.Types
  2804  	// match: (Lsh32x16 x y)
  2805  	// cond: shiftIsBounded(v)
  2806  	// result: (SLW x y)
  2807  	for {
  2808  		x := v_0
  2809  		y := v_1
  2810  		if !(shiftIsBounded(v)) {
  2811  			break
  2812  		}
  2813  		v.reset(OpPPC64SLW)
  2814  		v.AddArg2(x, y)
  2815  		return true
  2816  	}
  2817  	// match: (Lsh32x16 <t> x y)
  2818  	// result: (ISEL [2] (SLW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFE0] y)))
  2819  	for {
  2820  		t := v.Type
  2821  		x := v_0
  2822  		y := v_1
  2823  		v.reset(OpPPC64ISEL)
  2824  		v.AuxInt = int32ToAuxInt(2)
  2825  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  2826  		v0.AddArg2(x, y)
  2827  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2828  		v1.AuxInt = int64ToAuxInt(0)
  2829  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2830  		v2.AuxInt = int64ToAuxInt(0)
  2831  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  2832  		v3.AuxInt = int64ToAuxInt(0xFFE0)
  2833  		v3.AddArg(y)
  2834  		v2.AddArg(v3)
  2835  		v.AddArg3(v0, v1, v2)
  2836  		return true
  2837  	}
  2838  }
  2839  func rewriteValuePPC64_OpLsh32x32(v *Value) bool {
  2840  	v_1 := v.Args[1]
  2841  	v_0 := v.Args[0]
  2842  	b := v.Block
  2843  	typ := &b.Func.Config.Types
  2844  	// match: (Lsh32x32 x y)
  2845  	// cond: shiftIsBounded(v)
  2846  	// result: (SLW x y)
  2847  	for {
  2848  		x := v_0
  2849  		y := v_1
  2850  		if !(shiftIsBounded(v)) {
  2851  			break
  2852  		}
  2853  		v.reset(OpPPC64SLW)
  2854  		v.AddArg2(x, y)
  2855  		return true
  2856  	}
  2857  	// match: (Lsh32x32 <t> x y)
  2858  	// result: (ISEL [0] (SLW <t> x y) (MOVDconst [0]) (CMPWUconst y [32]))
  2859  	for {
  2860  		t := v.Type
  2861  		x := v_0
  2862  		y := v_1
  2863  		v.reset(OpPPC64ISEL)
  2864  		v.AuxInt = int32ToAuxInt(0)
  2865  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  2866  		v0.AddArg2(x, y)
  2867  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2868  		v1.AuxInt = int64ToAuxInt(0)
  2869  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  2870  		v2.AuxInt = int32ToAuxInt(32)
  2871  		v2.AddArg(y)
  2872  		v.AddArg3(v0, v1, v2)
  2873  		return true
  2874  	}
  2875  }
  2876  func rewriteValuePPC64_OpLsh32x64(v *Value) bool {
  2877  	v_1 := v.Args[1]
  2878  	v_0 := v.Args[0]
  2879  	b := v.Block
  2880  	typ := &b.Func.Config.Types
  2881  	// match: (Lsh32x64 x (MOVDconst [c]))
  2882  	// cond: uint64(c) < 32
  2883  	// result: (SLWconst x [c])
  2884  	for {
  2885  		x := v_0
  2886  		if v_1.Op != OpPPC64MOVDconst {
  2887  			break
  2888  		}
  2889  		c := auxIntToInt64(v_1.AuxInt)
  2890  		if !(uint64(c) < 32) {
  2891  			break
  2892  		}
  2893  		v.reset(OpPPC64SLWconst)
  2894  		v.AuxInt = int64ToAuxInt(c)
  2895  		v.AddArg(x)
  2896  		return true
  2897  	}
  2898  	// match: (Lsh32x64 x y)
  2899  	// cond: shiftIsBounded(v)
  2900  	// result: (SLW x y)
  2901  	for {
  2902  		x := v_0
  2903  		y := v_1
  2904  		if !(shiftIsBounded(v)) {
  2905  			break
  2906  		}
  2907  		v.reset(OpPPC64SLW)
  2908  		v.AddArg2(x, y)
  2909  		return true
  2910  	}
  2911  	// match: (Lsh32x64 <t> x y)
  2912  	// result: (ISEL [0] (SLW <t> x y) (MOVDconst [0]) (CMPUconst y [32]))
  2913  	for {
  2914  		t := v.Type
  2915  		x := v_0
  2916  		y := v_1
  2917  		v.reset(OpPPC64ISEL)
  2918  		v.AuxInt = int32ToAuxInt(0)
  2919  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  2920  		v0.AddArg2(x, y)
  2921  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2922  		v1.AuxInt = int64ToAuxInt(0)
  2923  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  2924  		v2.AuxInt = int64ToAuxInt(32)
  2925  		v2.AddArg(y)
  2926  		v.AddArg3(v0, v1, v2)
  2927  		return true
  2928  	}
  2929  }
  2930  func rewriteValuePPC64_OpLsh32x8(v *Value) bool {
  2931  	v_1 := v.Args[1]
  2932  	v_0 := v.Args[0]
  2933  	b := v.Block
  2934  	typ := &b.Func.Config.Types
  2935  	// match: (Lsh32x8 x y)
  2936  	// cond: shiftIsBounded(v)
  2937  	// result: (SLW x y)
  2938  	for {
  2939  		x := v_0
  2940  		y := v_1
  2941  		if !(shiftIsBounded(v)) {
  2942  			break
  2943  		}
  2944  		v.reset(OpPPC64SLW)
  2945  		v.AddArg2(x, y)
  2946  		return true
  2947  	}
  2948  	// match: (Lsh32x8 <t> x y)
  2949  	// result: (ISEL [2] (SLW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00E0] y)))
  2950  	for {
  2951  		t := v.Type
  2952  		x := v_0
  2953  		y := v_1
  2954  		v.reset(OpPPC64ISEL)
  2955  		v.AuxInt = int32ToAuxInt(2)
  2956  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  2957  		v0.AddArg2(x, y)
  2958  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2959  		v1.AuxInt = int64ToAuxInt(0)
  2960  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2961  		v2.AuxInt = int64ToAuxInt(0)
  2962  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  2963  		v3.AuxInt = int64ToAuxInt(0x00E0)
  2964  		v3.AddArg(y)
  2965  		v2.AddArg(v3)
  2966  		v.AddArg3(v0, v1, v2)
  2967  		return true
  2968  	}
  2969  }
  2970  func rewriteValuePPC64_OpLsh64x16(v *Value) bool {
  2971  	v_1 := v.Args[1]
  2972  	v_0 := v.Args[0]
  2973  	b := v.Block
  2974  	typ := &b.Func.Config.Types
  2975  	// match: (Lsh64x16 x y)
  2976  	// cond: shiftIsBounded(v)
  2977  	// result: (SLD x y)
  2978  	for {
  2979  		x := v_0
  2980  		y := v_1
  2981  		if !(shiftIsBounded(v)) {
  2982  			break
  2983  		}
  2984  		v.reset(OpPPC64SLD)
  2985  		v.AddArg2(x, y)
  2986  		return true
  2987  	}
  2988  	// match: (Lsh64x16 <t> x y)
  2989  	// result: (ISEL [2] (SLD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFC0] y)))
  2990  	for {
  2991  		t := v.Type
  2992  		x := v_0
  2993  		y := v_1
  2994  		v.reset(OpPPC64ISEL)
  2995  		v.AuxInt = int32ToAuxInt(2)
  2996  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2997  		v0.AddArg2(x, y)
  2998  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2999  		v1.AuxInt = int64ToAuxInt(0)
  3000  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3001  		v2.AuxInt = int64ToAuxInt(0)
  3002  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3003  		v3.AuxInt = int64ToAuxInt(0xFFC0)
  3004  		v3.AddArg(y)
  3005  		v2.AddArg(v3)
  3006  		v.AddArg3(v0, v1, v2)
  3007  		return true
  3008  	}
  3009  }
  3010  func rewriteValuePPC64_OpLsh64x32(v *Value) bool {
  3011  	v_1 := v.Args[1]
  3012  	v_0 := v.Args[0]
  3013  	b := v.Block
  3014  	typ := &b.Func.Config.Types
  3015  	// match: (Lsh64x32 x y)
  3016  	// cond: shiftIsBounded(v)
  3017  	// result: (SLD x y)
  3018  	for {
  3019  		x := v_0
  3020  		y := v_1
  3021  		if !(shiftIsBounded(v)) {
  3022  			break
  3023  		}
  3024  		v.reset(OpPPC64SLD)
  3025  		v.AddArg2(x, y)
  3026  		return true
  3027  	}
  3028  	// match: (Lsh64x32 <t> x y)
  3029  	// result: (ISEL [0] (SLD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
  3030  	for {
  3031  		t := v.Type
  3032  		x := v_0
  3033  		y := v_1
  3034  		v.reset(OpPPC64ISEL)
  3035  		v.AuxInt = int32ToAuxInt(0)
  3036  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3037  		v0.AddArg2(x, y)
  3038  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3039  		v1.AuxInt = int64ToAuxInt(0)
  3040  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  3041  		v2.AuxInt = int32ToAuxInt(64)
  3042  		v2.AddArg(y)
  3043  		v.AddArg3(v0, v1, v2)
  3044  		return true
  3045  	}
  3046  }
  3047  func rewriteValuePPC64_OpLsh64x64(v *Value) bool {
  3048  	v_1 := v.Args[1]
  3049  	v_0 := v.Args[0]
  3050  	b := v.Block
  3051  	typ := &b.Func.Config.Types
  3052  	// match: (Lsh64x64 x (MOVDconst [c]))
  3053  	// cond: uint64(c) < 64
  3054  	// result: (SLDconst x [c])
  3055  	for {
  3056  		x := v_0
  3057  		if v_1.Op != OpPPC64MOVDconst {
  3058  			break
  3059  		}
  3060  		c := auxIntToInt64(v_1.AuxInt)
  3061  		if !(uint64(c) < 64) {
  3062  			break
  3063  		}
  3064  		v.reset(OpPPC64SLDconst)
  3065  		v.AuxInt = int64ToAuxInt(c)
  3066  		v.AddArg(x)
  3067  		return true
  3068  	}
  3069  	// match: (Lsh64x64 x y)
  3070  	// cond: shiftIsBounded(v)
  3071  	// result: (SLD x y)
  3072  	for {
  3073  		x := v_0
  3074  		y := v_1
  3075  		if !(shiftIsBounded(v)) {
  3076  			break
  3077  		}
  3078  		v.reset(OpPPC64SLD)
  3079  		v.AddArg2(x, y)
  3080  		return true
  3081  	}
  3082  	// match: (Lsh64x64 <t> x y)
  3083  	// result: (ISEL [0] (SLD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
  3084  	for {
  3085  		t := v.Type
  3086  		x := v_0
  3087  		y := v_1
  3088  		v.reset(OpPPC64ISEL)
  3089  		v.AuxInt = int32ToAuxInt(0)
  3090  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3091  		v0.AddArg2(x, y)
  3092  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3093  		v1.AuxInt = int64ToAuxInt(0)
  3094  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  3095  		v2.AuxInt = int64ToAuxInt(64)
  3096  		v2.AddArg(y)
  3097  		v.AddArg3(v0, v1, v2)
  3098  		return true
  3099  	}
  3100  }
  3101  func rewriteValuePPC64_OpLsh64x8(v *Value) bool {
  3102  	v_1 := v.Args[1]
  3103  	v_0 := v.Args[0]
  3104  	b := v.Block
  3105  	typ := &b.Func.Config.Types
  3106  	// match: (Lsh64x8 x y)
  3107  	// cond: shiftIsBounded(v)
  3108  	// result: (SLD x y)
  3109  	for {
  3110  		x := v_0
  3111  		y := v_1
  3112  		if !(shiftIsBounded(v)) {
  3113  			break
  3114  		}
  3115  		v.reset(OpPPC64SLD)
  3116  		v.AddArg2(x, y)
  3117  		return true
  3118  	}
  3119  	// match: (Lsh64x8 <t> x y)
  3120  	// result: (ISEL [2] (SLD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00C0] y)))
  3121  	for {
  3122  		t := v.Type
  3123  		x := v_0
  3124  		y := v_1
  3125  		v.reset(OpPPC64ISEL)
  3126  		v.AuxInt = int32ToAuxInt(2)
  3127  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3128  		v0.AddArg2(x, y)
  3129  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3130  		v1.AuxInt = int64ToAuxInt(0)
  3131  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3132  		v2.AuxInt = int64ToAuxInt(0)
  3133  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3134  		v3.AuxInt = int64ToAuxInt(0x00C0)
  3135  		v3.AddArg(y)
  3136  		v2.AddArg(v3)
  3137  		v.AddArg3(v0, v1, v2)
  3138  		return true
  3139  	}
  3140  }
  3141  func rewriteValuePPC64_OpLsh8x16(v *Value) bool {
  3142  	v_1 := v.Args[1]
  3143  	v_0 := v.Args[0]
  3144  	b := v.Block
  3145  	typ := &b.Func.Config.Types
  3146  	// match: (Lsh8x16 x y)
  3147  	// cond: shiftIsBounded(v)
  3148  	// result: (SLD x y)
  3149  	for {
  3150  		x := v_0
  3151  		y := v_1
  3152  		if !(shiftIsBounded(v)) {
  3153  			break
  3154  		}
  3155  		v.reset(OpPPC64SLD)
  3156  		v.AddArg2(x, y)
  3157  		return true
  3158  	}
  3159  	// match: (Lsh8x16 <t> x y)
  3160  	// result: (ISEL [2] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF8] y)))
  3161  	for {
  3162  		t := v.Type
  3163  		x := v_0
  3164  		y := v_1
  3165  		v.reset(OpPPC64ISEL)
  3166  		v.AuxInt = int32ToAuxInt(2)
  3167  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3168  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3169  		v1.AddArg(x)
  3170  		v0.AddArg2(v1, y)
  3171  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3172  		v2.AuxInt = int64ToAuxInt(0)
  3173  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3174  		v3.AuxInt = int64ToAuxInt(0)
  3175  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3176  		v4.AuxInt = int64ToAuxInt(0xFFF8)
  3177  		v4.AddArg(y)
  3178  		v3.AddArg(v4)
  3179  		v.AddArg3(v0, v2, v3)
  3180  		return true
  3181  	}
  3182  }
  3183  func rewriteValuePPC64_OpLsh8x32(v *Value) bool {
  3184  	v_1 := v.Args[1]
  3185  	v_0 := v.Args[0]
  3186  	b := v.Block
  3187  	typ := &b.Func.Config.Types
  3188  	// match: (Lsh8x32 x y)
  3189  	// cond: shiftIsBounded(v)
  3190  	// result: (SLD x y)
  3191  	for {
  3192  		x := v_0
  3193  		y := v_1
  3194  		if !(shiftIsBounded(v)) {
  3195  			break
  3196  		}
  3197  		v.reset(OpPPC64SLD)
  3198  		v.AddArg2(x, y)
  3199  		return true
  3200  	}
  3201  	// match: (Lsh8x32 <t> x y)
  3202  	// result: (ISEL [0] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [8]))
  3203  	for {
  3204  		t := v.Type
  3205  		x := v_0
  3206  		y := v_1
  3207  		v.reset(OpPPC64ISEL)
  3208  		v.AuxInt = int32ToAuxInt(0)
  3209  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3210  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3211  		v1.AddArg(x)
  3212  		v0.AddArg2(v1, y)
  3213  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3214  		v2.AuxInt = int64ToAuxInt(0)
  3215  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  3216  		v3.AuxInt = int32ToAuxInt(8)
  3217  		v3.AddArg(y)
  3218  		v.AddArg3(v0, v2, v3)
  3219  		return true
  3220  	}
  3221  }
  3222  func rewriteValuePPC64_OpLsh8x64(v *Value) bool {
  3223  	v_1 := v.Args[1]
  3224  	v_0 := v.Args[0]
  3225  	b := v.Block
  3226  	typ := &b.Func.Config.Types
  3227  	// match: (Lsh8x64 x (MOVDconst [c]))
  3228  	// cond: uint64(c) < 8
  3229  	// result: (SLWconst x [c])
  3230  	for {
  3231  		x := v_0
  3232  		if v_1.Op != OpPPC64MOVDconst {
  3233  			break
  3234  		}
  3235  		c := auxIntToInt64(v_1.AuxInt)
  3236  		if !(uint64(c) < 8) {
  3237  			break
  3238  		}
  3239  		v.reset(OpPPC64SLWconst)
  3240  		v.AuxInt = int64ToAuxInt(c)
  3241  		v.AddArg(x)
  3242  		return true
  3243  	}
  3244  	// match: (Lsh8x64 x y)
  3245  	// cond: shiftIsBounded(v)
  3246  	// result: (SLD x y)
  3247  	for {
  3248  		x := v_0
  3249  		y := v_1
  3250  		if !(shiftIsBounded(v)) {
  3251  			break
  3252  		}
  3253  		v.reset(OpPPC64SLD)
  3254  		v.AddArg2(x, y)
  3255  		return true
  3256  	}
  3257  	// match: (Lsh8x64 <t> x y)
  3258  	// result: (ISEL [0] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [8]))
  3259  	for {
  3260  		t := v.Type
  3261  		x := v_0
  3262  		y := v_1
  3263  		v.reset(OpPPC64ISEL)
  3264  		v.AuxInt = int32ToAuxInt(0)
  3265  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3266  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3267  		v1.AddArg(x)
  3268  		v0.AddArg2(v1, y)
  3269  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3270  		v2.AuxInt = int64ToAuxInt(0)
  3271  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  3272  		v3.AuxInt = int64ToAuxInt(8)
  3273  		v3.AddArg(y)
  3274  		v.AddArg3(v0, v2, v3)
  3275  		return true
  3276  	}
  3277  }
  3278  func rewriteValuePPC64_OpLsh8x8(v *Value) bool {
  3279  	v_1 := v.Args[1]
  3280  	v_0 := v.Args[0]
  3281  	b := v.Block
  3282  	typ := &b.Func.Config.Types
  3283  	// match: (Lsh8x8 x y)
  3284  	// cond: shiftIsBounded(v)
  3285  	// result: (SLD x y)
  3286  	for {
  3287  		x := v_0
  3288  		y := v_1
  3289  		if !(shiftIsBounded(v)) {
  3290  			break
  3291  		}
  3292  		v.reset(OpPPC64SLD)
  3293  		v.AddArg2(x, y)
  3294  		return true
  3295  	}
  3296  	// match: (Lsh8x8 <t> x y)
  3297  	// result: (ISEL [2] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F8] y)))
  3298  	for {
  3299  		t := v.Type
  3300  		x := v_0
  3301  		y := v_1
  3302  		v.reset(OpPPC64ISEL)
  3303  		v.AuxInt = int32ToAuxInt(2)
  3304  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3305  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3306  		v1.AddArg(x)
  3307  		v0.AddArg2(v1, y)
  3308  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3309  		v2.AuxInt = int64ToAuxInt(0)
  3310  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3311  		v3.AuxInt = int64ToAuxInt(0)
  3312  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3313  		v4.AuxInt = int64ToAuxInt(0x00F8)
  3314  		v4.AddArg(y)
  3315  		v3.AddArg(v4)
  3316  		v.AddArg3(v0, v2, v3)
  3317  		return true
  3318  	}
  3319  }
  3320  func rewriteValuePPC64_OpMax32F(v *Value) bool {
  3321  	v_1 := v.Args[1]
  3322  	v_0 := v.Args[0]
  3323  	// match: (Max32F x y)
  3324  	// cond: buildcfg.GOPPC64 >= 9
  3325  	// result: (XSMAXJDP x y)
  3326  	for {
  3327  		x := v_0
  3328  		y := v_1
  3329  		if !(buildcfg.GOPPC64 >= 9) {
  3330  			break
  3331  		}
  3332  		v.reset(OpPPC64XSMAXJDP)
  3333  		v.AddArg2(x, y)
  3334  		return true
  3335  	}
  3336  	return false
  3337  }
  3338  func rewriteValuePPC64_OpMax64F(v *Value) bool {
  3339  	v_1 := v.Args[1]
  3340  	v_0 := v.Args[0]
  3341  	// match: (Max64F x y)
  3342  	// cond: buildcfg.GOPPC64 >= 9
  3343  	// result: (XSMAXJDP x y)
  3344  	for {
  3345  		x := v_0
  3346  		y := v_1
  3347  		if !(buildcfg.GOPPC64 >= 9) {
  3348  			break
  3349  		}
  3350  		v.reset(OpPPC64XSMAXJDP)
  3351  		v.AddArg2(x, y)
  3352  		return true
  3353  	}
  3354  	return false
  3355  }
  3356  func rewriteValuePPC64_OpMin32F(v *Value) bool {
  3357  	v_1 := v.Args[1]
  3358  	v_0 := v.Args[0]
  3359  	// match: (Min32F x y)
  3360  	// cond: buildcfg.GOPPC64 >= 9
  3361  	// result: (XSMINJDP x y)
  3362  	for {
  3363  		x := v_0
  3364  		y := v_1
  3365  		if !(buildcfg.GOPPC64 >= 9) {
  3366  			break
  3367  		}
  3368  		v.reset(OpPPC64XSMINJDP)
  3369  		v.AddArg2(x, y)
  3370  		return true
  3371  	}
  3372  	return false
  3373  }
  3374  func rewriteValuePPC64_OpMin64F(v *Value) bool {
  3375  	v_1 := v.Args[1]
  3376  	v_0 := v.Args[0]
  3377  	// match: (Min64F x y)
  3378  	// cond: buildcfg.GOPPC64 >= 9
  3379  	// result: (XSMINJDP x y)
  3380  	for {
  3381  		x := v_0
  3382  		y := v_1
  3383  		if !(buildcfg.GOPPC64 >= 9) {
  3384  			break
  3385  		}
  3386  		v.reset(OpPPC64XSMINJDP)
  3387  		v.AddArg2(x, y)
  3388  		return true
  3389  	}
  3390  	return false
  3391  }
  3392  func rewriteValuePPC64_OpMod16(v *Value) bool {
  3393  	v_1 := v.Args[1]
  3394  	v_0 := v.Args[0]
  3395  	b := v.Block
  3396  	typ := &b.Func.Config.Types
  3397  	// match: (Mod16 x y)
  3398  	// result: (Mod32 (SignExt16to32 x) (SignExt16to32 y))
  3399  	for {
  3400  		x := v_0
  3401  		y := v_1
  3402  		v.reset(OpMod32)
  3403  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3404  		v0.AddArg(x)
  3405  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3406  		v1.AddArg(y)
  3407  		v.AddArg2(v0, v1)
  3408  		return true
  3409  	}
  3410  }
  3411  func rewriteValuePPC64_OpMod16u(v *Value) bool {
  3412  	v_1 := v.Args[1]
  3413  	v_0 := v.Args[0]
  3414  	b := v.Block
  3415  	typ := &b.Func.Config.Types
  3416  	// match: (Mod16u x y)
  3417  	// result: (Mod32u (ZeroExt16to32 x) (ZeroExt16to32 y))
  3418  	for {
  3419  		x := v_0
  3420  		y := v_1
  3421  		v.reset(OpMod32u)
  3422  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3423  		v0.AddArg(x)
  3424  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3425  		v1.AddArg(y)
  3426  		v.AddArg2(v0, v1)
  3427  		return true
  3428  	}
  3429  }
  3430  func rewriteValuePPC64_OpMod32(v *Value) bool {
  3431  	v_1 := v.Args[1]
  3432  	v_0 := v.Args[0]
  3433  	b := v.Block
  3434  	typ := &b.Func.Config.Types
  3435  	// match: (Mod32 x y)
  3436  	// cond: buildcfg.GOPPC64 >= 9
  3437  	// result: (MODSW x y)
  3438  	for {
  3439  		x := v_0
  3440  		y := v_1
  3441  		if !(buildcfg.GOPPC64 >= 9) {
  3442  			break
  3443  		}
  3444  		v.reset(OpPPC64MODSW)
  3445  		v.AddArg2(x, y)
  3446  		return true
  3447  	}
  3448  	// match: (Mod32 x y)
  3449  	// cond: buildcfg.GOPPC64 <= 8
  3450  	// result: (SUB x (MULLW y (DIVW x y)))
  3451  	for {
  3452  		x := v_0
  3453  		y := v_1
  3454  		if !(buildcfg.GOPPC64 <= 8) {
  3455  			break
  3456  		}
  3457  		v.reset(OpPPC64SUB)
  3458  		v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
  3459  		v1 := b.NewValue0(v.Pos, OpPPC64DIVW, typ.Int32)
  3460  		v1.AddArg2(x, y)
  3461  		v0.AddArg2(y, v1)
  3462  		v.AddArg2(x, v0)
  3463  		return true
  3464  	}
  3465  	return false
  3466  }
  3467  func rewriteValuePPC64_OpMod32u(v *Value) bool {
  3468  	v_1 := v.Args[1]
  3469  	v_0 := v.Args[0]
  3470  	b := v.Block
  3471  	typ := &b.Func.Config.Types
  3472  	// match: (Mod32u x y)
  3473  	// cond: buildcfg.GOPPC64 >= 9
  3474  	// result: (MODUW x y)
  3475  	for {
  3476  		x := v_0
  3477  		y := v_1
  3478  		if !(buildcfg.GOPPC64 >= 9) {
  3479  			break
  3480  		}
  3481  		v.reset(OpPPC64MODUW)
  3482  		v.AddArg2(x, y)
  3483  		return true
  3484  	}
  3485  	// match: (Mod32u x y)
  3486  	// cond: buildcfg.GOPPC64 <= 8
  3487  	// result: (SUB x (MULLW y (DIVWU x y)))
  3488  	for {
  3489  		x := v_0
  3490  		y := v_1
  3491  		if !(buildcfg.GOPPC64 <= 8) {
  3492  			break
  3493  		}
  3494  		v.reset(OpPPC64SUB)
  3495  		v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
  3496  		v1 := b.NewValue0(v.Pos, OpPPC64DIVWU, typ.Int32)
  3497  		v1.AddArg2(x, y)
  3498  		v0.AddArg2(y, v1)
  3499  		v.AddArg2(x, v0)
  3500  		return true
  3501  	}
  3502  	return false
  3503  }
  3504  func rewriteValuePPC64_OpMod64(v *Value) bool {
  3505  	v_1 := v.Args[1]
  3506  	v_0 := v.Args[0]
  3507  	b := v.Block
  3508  	typ := &b.Func.Config.Types
  3509  	// match: (Mod64 x y)
  3510  	// cond: buildcfg.GOPPC64 >=9
  3511  	// result: (MODSD x y)
  3512  	for {
  3513  		x := v_0
  3514  		y := v_1
  3515  		if !(buildcfg.GOPPC64 >= 9) {
  3516  			break
  3517  		}
  3518  		v.reset(OpPPC64MODSD)
  3519  		v.AddArg2(x, y)
  3520  		return true
  3521  	}
  3522  	// match: (Mod64 x y)
  3523  	// cond: buildcfg.GOPPC64 <=8
  3524  	// result: (SUB x (MULLD y (DIVD x y)))
  3525  	for {
  3526  		x := v_0
  3527  		y := v_1
  3528  		if !(buildcfg.GOPPC64 <= 8) {
  3529  			break
  3530  		}
  3531  		v.reset(OpPPC64SUB)
  3532  		v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
  3533  		v1 := b.NewValue0(v.Pos, OpPPC64DIVD, typ.Int64)
  3534  		v1.AddArg2(x, y)
  3535  		v0.AddArg2(y, v1)
  3536  		v.AddArg2(x, v0)
  3537  		return true
  3538  	}
  3539  	return false
  3540  }
  3541  func rewriteValuePPC64_OpMod64u(v *Value) bool {
  3542  	v_1 := v.Args[1]
  3543  	v_0 := v.Args[0]
  3544  	b := v.Block
  3545  	typ := &b.Func.Config.Types
  3546  	// match: (Mod64u x y)
  3547  	// cond: buildcfg.GOPPC64 >= 9
  3548  	// result: (MODUD x y)
  3549  	for {
  3550  		x := v_0
  3551  		y := v_1
  3552  		if !(buildcfg.GOPPC64 >= 9) {
  3553  			break
  3554  		}
  3555  		v.reset(OpPPC64MODUD)
  3556  		v.AddArg2(x, y)
  3557  		return true
  3558  	}
  3559  	// match: (Mod64u x y)
  3560  	// cond: buildcfg.GOPPC64 <= 8
  3561  	// result: (SUB x (MULLD y (DIVDU x y)))
  3562  	for {
  3563  		x := v_0
  3564  		y := v_1
  3565  		if !(buildcfg.GOPPC64 <= 8) {
  3566  			break
  3567  		}
  3568  		v.reset(OpPPC64SUB)
  3569  		v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
  3570  		v1 := b.NewValue0(v.Pos, OpPPC64DIVDU, typ.Int64)
  3571  		v1.AddArg2(x, y)
  3572  		v0.AddArg2(y, v1)
  3573  		v.AddArg2(x, v0)
  3574  		return true
  3575  	}
  3576  	return false
  3577  }
  3578  func rewriteValuePPC64_OpMod8(v *Value) bool {
  3579  	v_1 := v.Args[1]
  3580  	v_0 := v.Args[0]
  3581  	b := v.Block
  3582  	typ := &b.Func.Config.Types
  3583  	// match: (Mod8 x y)
  3584  	// result: (Mod32 (SignExt8to32 x) (SignExt8to32 y))
  3585  	for {
  3586  		x := v_0
  3587  		y := v_1
  3588  		v.reset(OpMod32)
  3589  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3590  		v0.AddArg(x)
  3591  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3592  		v1.AddArg(y)
  3593  		v.AddArg2(v0, v1)
  3594  		return true
  3595  	}
  3596  }
  3597  func rewriteValuePPC64_OpMod8u(v *Value) bool {
  3598  	v_1 := v.Args[1]
  3599  	v_0 := v.Args[0]
  3600  	b := v.Block
  3601  	typ := &b.Func.Config.Types
  3602  	// match: (Mod8u x y)
  3603  	// result: (Mod32u (ZeroExt8to32 x) (ZeroExt8to32 y))
  3604  	for {
  3605  		x := v_0
  3606  		y := v_1
  3607  		v.reset(OpMod32u)
  3608  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3609  		v0.AddArg(x)
  3610  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3611  		v1.AddArg(y)
  3612  		v.AddArg2(v0, v1)
  3613  		return true
  3614  	}
  3615  }
  3616  func rewriteValuePPC64_OpMove(v *Value) bool {
  3617  	v_2 := v.Args[2]
  3618  	v_1 := v.Args[1]
  3619  	v_0 := v.Args[0]
  3620  	b := v.Block
  3621  	typ := &b.Func.Config.Types
  3622  	// match: (Move [0] _ _ mem)
  3623  	// result: mem
  3624  	for {
  3625  		if auxIntToInt64(v.AuxInt) != 0 {
  3626  			break
  3627  		}
  3628  		mem := v_2
  3629  		v.copyOf(mem)
  3630  		return true
  3631  	}
  3632  	// match: (Move [1] dst src mem)
  3633  	// result: (MOVBstore dst (MOVBZload src mem) mem)
  3634  	for {
  3635  		if auxIntToInt64(v.AuxInt) != 1 {
  3636  			break
  3637  		}
  3638  		dst := v_0
  3639  		src := v_1
  3640  		mem := v_2
  3641  		v.reset(OpPPC64MOVBstore)
  3642  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3643  		v0.AddArg2(src, mem)
  3644  		v.AddArg3(dst, v0, mem)
  3645  		return true
  3646  	}
  3647  	// match: (Move [2] dst src mem)
  3648  	// result: (MOVHstore dst (MOVHZload src mem) mem)
  3649  	for {
  3650  		if auxIntToInt64(v.AuxInt) != 2 {
  3651  			break
  3652  		}
  3653  		dst := v_0
  3654  		src := v_1
  3655  		mem := v_2
  3656  		v.reset(OpPPC64MOVHstore)
  3657  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3658  		v0.AddArg2(src, mem)
  3659  		v.AddArg3(dst, v0, mem)
  3660  		return true
  3661  	}
  3662  	// match: (Move [4] dst src mem)
  3663  	// result: (MOVWstore dst (MOVWZload src mem) mem)
  3664  	for {
  3665  		if auxIntToInt64(v.AuxInt) != 4 {
  3666  			break
  3667  		}
  3668  		dst := v_0
  3669  		src := v_1
  3670  		mem := v_2
  3671  		v.reset(OpPPC64MOVWstore)
  3672  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3673  		v0.AddArg2(src, mem)
  3674  		v.AddArg3(dst, v0, mem)
  3675  		return true
  3676  	}
  3677  	// match: (Move [8] {t} dst src mem)
  3678  	// result: (MOVDstore dst (MOVDload src mem) mem)
  3679  	for {
  3680  		if auxIntToInt64(v.AuxInt) != 8 {
  3681  			break
  3682  		}
  3683  		dst := v_0
  3684  		src := v_1
  3685  		mem := v_2
  3686  		v.reset(OpPPC64MOVDstore)
  3687  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, typ.Int64)
  3688  		v0.AddArg2(src, mem)
  3689  		v.AddArg3(dst, v0, mem)
  3690  		return true
  3691  	}
  3692  	// match: (Move [3] dst src mem)
  3693  	// result: (MOVBstore [2] dst (MOVBZload [2] src mem) (MOVHstore dst (MOVHload src mem) mem))
  3694  	for {
  3695  		if auxIntToInt64(v.AuxInt) != 3 {
  3696  			break
  3697  		}
  3698  		dst := v_0
  3699  		src := v_1
  3700  		mem := v_2
  3701  		v.reset(OpPPC64MOVBstore)
  3702  		v.AuxInt = int32ToAuxInt(2)
  3703  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3704  		v0.AuxInt = int32ToAuxInt(2)
  3705  		v0.AddArg2(src, mem)
  3706  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
  3707  		v2 := b.NewValue0(v.Pos, OpPPC64MOVHload, typ.Int16)
  3708  		v2.AddArg2(src, mem)
  3709  		v1.AddArg3(dst, v2, mem)
  3710  		v.AddArg3(dst, v0, v1)
  3711  		return true
  3712  	}
  3713  	// match: (Move [5] dst src mem)
  3714  	// result: (MOVBstore [4] dst (MOVBZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
  3715  	for {
  3716  		if auxIntToInt64(v.AuxInt) != 5 {
  3717  			break
  3718  		}
  3719  		dst := v_0
  3720  		src := v_1
  3721  		mem := v_2
  3722  		v.reset(OpPPC64MOVBstore)
  3723  		v.AuxInt = int32ToAuxInt(4)
  3724  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3725  		v0.AuxInt = int32ToAuxInt(4)
  3726  		v0.AddArg2(src, mem)
  3727  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3728  		v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3729  		v2.AddArg2(src, mem)
  3730  		v1.AddArg3(dst, v2, mem)
  3731  		v.AddArg3(dst, v0, v1)
  3732  		return true
  3733  	}
  3734  	// match: (Move [6] dst src mem)
  3735  	// result: (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
  3736  	for {
  3737  		if auxIntToInt64(v.AuxInt) != 6 {
  3738  			break
  3739  		}
  3740  		dst := v_0
  3741  		src := v_1
  3742  		mem := v_2
  3743  		v.reset(OpPPC64MOVHstore)
  3744  		v.AuxInt = int32ToAuxInt(4)
  3745  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3746  		v0.AuxInt = int32ToAuxInt(4)
  3747  		v0.AddArg2(src, mem)
  3748  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3749  		v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3750  		v2.AddArg2(src, mem)
  3751  		v1.AddArg3(dst, v2, mem)
  3752  		v.AddArg3(dst, v0, v1)
  3753  		return true
  3754  	}
  3755  	// match: (Move [7] dst src mem)
  3756  	// result: (MOVBstore [6] dst (MOVBZload [6] src mem) (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem)))
  3757  	for {
  3758  		if auxIntToInt64(v.AuxInt) != 7 {
  3759  			break
  3760  		}
  3761  		dst := v_0
  3762  		src := v_1
  3763  		mem := v_2
  3764  		v.reset(OpPPC64MOVBstore)
  3765  		v.AuxInt = int32ToAuxInt(6)
  3766  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3767  		v0.AuxInt = int32ToAuxInt(6)
  3768  		v0.AddArg2(src, mem)
  3769  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
  3770  		v1.AuxInt = int32ToAuxInt(4)
  3771  		v2 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3772  		v2.AuxInt = int32ToAuxInt(4)
  3773  		v2.AddArg2(src, mem)
  3774  		v3 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3775  		v4 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3776  		v4.AddArg2(src, mem)
  3777  		v3.AddArg3(dst, v4, mem)
  3778  		v1.AddArg3(dst, v2, v3)
  3779  		v.AddArg3(dst, v0, v1)
  3780  		return true
  3781  	}
  3782  	// match: (Move [s] dst src mem)
  3783  	// cond: s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)
  3784  	// result: (LoweredMove [s] dst src mem)
  3785  	for {
  3786  		s := auxIntToInt64(v.AuxInt)
  3787  		dst := v_0
  3788  		src := v_1
  3789  		mem := v_2
  3790  		if !(s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)) {
  3791  			break
  3792  		}
  3793  		v.reset(OpPPC64LoweredMove)
  3794  		v.AuxInt = int64ToAuxInt(s)
  3795  		v.AddArg3(dst, src, mem)
  3796  		return true
  3797  	}
  3798  	// match: (Move [s] dst src mem)
  3799  	// cond: s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9
  3800  	// result: (LoweredQuadMoveShort [s] dst src mem)
  3801  	for {
  3802  		s := auxIntToInt64(v.AuxInt)
  3803  		dst := v_0
  3804  		src := v_1
  3805  		mem := v_2
  3806  		if !(s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9) {
  3807  			break
  3808  		}
  3809  		v.reset(OpPPC64LoweredQuadMoveShort)
  3810  		v.AuxInt = int64ToAuxInt(s)
  3811  		v.AddArg3(dst, src, mem)
  3812  		return true
  3813  	}
  3814  	// match: (Move [s] dst src mem)
  3815  	// cond: s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)
  3816  	// result: (LoweredQuadMove [s] dst src mem)
  3817  	for {
  3818  		s := auxIntToInt64(v.AuxInt)
  3819  		dst := v_0
  3820  		src := v_1
  3821  		mem := v_2
  3822  		if !(s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)) {
  3823  			break
  3824  		}
  3825  		v.reset(OpPPC64LoweredQuadMove)
  3826  		v.AuxInt = int64ToAuxInt(s)
  3827  		v.AddArg3(dst, src, mem)
  3828  		return true
  3829  	}
  3830  	return false
  3831  }
  3832  func rewriteValuePPC64_OpNeq16(v *Value) bool {
  3833  	v_1 := v.Args[1]
  3834  	v_0 := v.Args[0]
  3835  	b := v.Block
  3836  	typ := &b.Func.Config.Types
  3837  	// match: (Neq16 x y)
  3838  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  3839  	// result: (NotEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  3840  	for {
  3841  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  3842  			x := v_0
  3843  			y := v_1
  3844  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  3845  				continue
  3846  			}
  3847  			v.reset(OpPPC64NotEqual)
  3848  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3849  			v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3850  			v1.AddArg(x)
  3851  			v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3852  			v2.AddArg(y)
  3853  			v0.AddArg2(v1, v2)
  3854  			v.AddArg(v0)
  3855  			return true
  3856  		}
  3857  		break
  3858  	}
  3859  	// match: (Neq16 x y)
  3860  	// result: (NotEqual (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
  3861  	for {
  3862  		x := v_0
  3863  		y := v_1
  3864  		v.reset(OpPPC64NotEqual)
  3865  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3866  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3867  		v1.AddArg(x)
  3868  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3869  		v2.AddArg(y)
  3870  		v0.AddArg2(v1, v2)
  3871  		v.AddArg(v0)
  3872  		return true
  3873  	}
  3874  }
  3875  func rewriteValuePPC64_OpNeq32(v *Value) bool {
  3876  	v_1 := v.Args[1]
  3877  	v_0 := v.Args[0]
  3878  	b := v.Block
  3879  	// match: (Neq32 x y)
  3880  	// result: (NotEqual (CMPW x y))
  3881  	for {
  3882  		x := v_0
  3883  		y := v_1
  3884  		v.reset(OpPPC64NotEqual)
  3885  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3886  		v0.AddArg2(x, y)
  3887  		v.AddArg(v0)
  3888  		return true
  3889  	}
  3890  }
  3891  func rewriteValuePPC64_OpNeq32F(v *Value) bool {
  3892  	v_1 := v.Args[1]
  3893  	v_0 := v.Args[0]
  3894  	b := v.Block
  3895  	// match: (Neq32F x y)
  3896  	// result: (NotEqual (FCMPU x y))
  3897  	for {
  3898  		x := v_0
  3899  		y := v_1
  3900  		v.reset(OpPPC64NotEqual)
  3901  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  3902  		v0.AddArg2(x, y)
  3903  		v.AddArg(v0)
  3904  		return true
  3905  	}
  3906  }
  3907  func rewriteValuePPC64_OpNeq64(v *Value) bool {
  3908  	v_1 := v.Args[1]
  3909  	v_0 := v.Args[0]
  3910  	b := v.Block
  3911  	// match: (Neq64 x y)
  3912  	// result: (NotEqual (CMP x y))
  3913  	for {
  3914  		x := v_0
  3915  		y := v_1
  3916  		v.reset(OpPPC64NotEqual)
  3917  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  3918  		v0.AddArg2(x, y)
  3919  		v.AddArg(v0)
  3920  		return true
  3921  	}
  3922  }
  3923  func rewriteValuePPC64_OpNeq64F(v *Value) bool {
  3924  	v_1 := v.Args[1]
  3925  	v_0 := v.Args[0]
  3926  	b := v.Block
  3927  	// match: (Neq64F x y)
  3928  	// result: (NotEqual (FCMPU x y))
  3929  	for {
  3930  		x := v_0
  3931  		y := v_1
  3932  		v.reset(OpPPC64NotEqual)
  3933  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  3934  		v0.AddArg2(x, y)
  3935  		v.AddArg(v0)
  3936  		return true
  3937  	}
  3938  }
  3939  func rewriteValuePPC64_OpNeq8(v *Value) bool {
  3940  	v_1 := v.Args[1]
  3941  	v_0 := v.Args[0]
  3942  	b := v.Block
  3943  	typ := &b.Func.Config.Types
  3944  	// match: (Neq8 x y)
  3945  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  3946  	// result: (NotEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  3947  	for {
  3948  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  3949  			x := v_0
  3950  			y := v_1
  3951  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  3952  				continue
  3953  			}
  3954  			v.reset(OpPPC64NotEqual)
  3955  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3956  			v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3957  			v1.AddArg(x)
  3958  			v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3959  			v2.AddArg(y)
  3960  			v0.AddArg2(v1, v2)
  3961  			v.AddArg(v0)
  3962  			return true
  3963  		}
  3964  		break
  3965  	}
  3966  	// match: (Neq8 x y)
  3967  	// result: (NotEqual (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
  3968  	for {
  3969  		x := v_0
  3970  		y := v_1
  3971  		v.reset(OpPPC64NotEqual)
  3972  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3973  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3974  		v1.AddArg(x)
  3975  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3976  		v2.AddArg(y)
  3977  		v0.AddArg2(v1, v2)
  3978  		v.AddArg(v0)
  3979  		return true
  3980  	}
  3981  }
  3982  func rewriteValuePPC64_OpNeqPtr(v *Value) bool {
  3983  	v_1 := v.Args[1]
  3984  	v_0 := v.Args[0]
  3985  	b := v.Block
  3986  	// match: (NeqPtr x y)
  3987  	// result: (NotEqual (CMP x y))
  3988  	for {
  3989  		x := v_0
  3990  		y := v_1
  3991  		v.reset(OpPPC64NotEqual)
  3992  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  3993  		v0.AddArg2(x, y)
  3994  		v.AddArg(v0)
  3995  		return true
  3996  	}
  3997  }
  3998  func rewriteValuePPC64_OpNot(v *Value) bool {
  3999  	v_0 := v.Args[0]
  4000  	// match: (Not x)
  4001  	// result: (XORconst [1] x)
  4002  	for {
  4003  		x := v_0
  4004  		v.reset(OpPPC64XORconst)
  4005  		v.AuxInt = int64ToAuxInt(1)
  4006  		v.AddArg(x)
  4007  		return true
  4008  	}
  4009  }
  4010  func rewriteValuePPC64_OpOffPtr(v *Value) bool {
  4011  	v_0 := v.Args[0]
  4012  	b := v.Block
  4013  	typ := &b.Func.Config.Types
  4014  	// match: (OffPtr [off] ptr)
  4015  	// result: (ADD (MOVDconst <typ.Int64> [off]) ptr)
  4016  	for {
  4017  		off := auxIntToInt64(v.AuxInt)
  4018  		ptr := v_0
  4019  		v.reset(OpPPC64ADD)
  4020  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  4021  		v0.AuxInt = int64ToAuxInt(off)
  4022  		v.AddArg2(v0, ptr)
  4023  		return true
  4024  	}
  4025  }
  4026  func rewriteValuePPC64_OpPPC64ADD(v *Value) bool {
  4027  	v_1 := v.Args[1]
  4028  	v_0 := v.Args[0]
  4029  	// match: (ADD l:(MULLD x y) z)
  4030  	// cond: buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)
  4031  	// result: (MADDLD x y z)
  4032  	for {
  4033  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4034  			l := v_0
  4035  			if l.Op != OpPPC64MULLD {
  4036  				continue
  4037  			}
  4038  			y := l.Args[1]
  4039  			x := l.Args[0]
  4040  			z := v_1
  4041  			if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
  4042  				continue
  4043  			}
  4044  			v.reset(OpPPC64MADDLD)
  4045  			v.AddArg3(x, y, z)
  4046  			return true
  4047  		}
  4048  		break
  4049  	}
  4050  	// match: (ADD x (MOVDconst <t> [c]))
  4051  	// cond: is32Bit(c) && !t.IsPtr()
  4052  	// result: (ADDconst [c] x)
  4053  	for {
  4054  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4055  			x := v_0
  4056  			if v_1.Op != OpPPC64MOVDconst {
  4057  				continue
  4058  			}
  4059  			t := v_1.Type
  4060  			c := auxIntToInt64(v_1.AuxInt)
  4061  			if !(is32Bit(c) && !t.IsPtr()) {
  4062  				continue
  4063  			}
  4064  			v.reset(OpPPC64ADDconst)
  4065  			v.AuxInt = int64ToAuxInt(c)
  4066  			v.AddArg(x)
  4067  			return true
  4068  		}
  4069  		break
  4070  	}
  4071  	return false
  4072  }
  4073  func rewriteValuePPC64_OpPPC64ADDC(v *Value) bool {
  4074  	v_1 := v.Args[1]
  4075  	v_0 := v.Args[0]
  4076  	// match: (ADDC x (MOVDconst [y]))
  4077  	// cond: is16Bit(y)
  4078  	// result: (ADDCconst [y] x)
  4079  	for {
  4080  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4081  			x := v_0
  4082  			if v_1.Op != OpPPC64MOVDconst {
  4083  				continue
  4084  			}
  4085  			y := auxIntToInt64(v_1.AuxInt)
  4086  			if !(is16Bit(y)) {
  4087  				continue
  4088  			}
  4089  			v.reset(OpPPC64ADDCconst)
  4090  			v.AuxInt = int64ToAuxInt(y)
  4091  			v.AddArg(x)
  4092  			return true
  4093  		}
  4094  		break
  4095  	}
  4096  	return false
  4097  }
  4098  func rewriteValuePPC64_OpPPC64ADDE(v *Value) bool {
  4099  	v_2 := v.Args[2]
  4100  	v_1 := v.Args[1]
  4101  	v_0 := v.Args[0]
  4102  	b := v.Block
  4103  	typ := &b.Func.Config.Types
  4104  	// match: (ADDE x y (Select1 <typ.UInt64> (ADDCconst (MOVDconst [0]) [-1])))
  4105  	// result: (ADDC x y)
  4106  	for {
  4107  		x := v_0
  4108  		y := v_1
  4109  		if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
  4110  			break
  4111  		}
  4112  		v_2_0 := v_2.Args[0]
  4113  		if v_2_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_2_0.AuxInt) != -1 {
  4114  			break
  4115  		}
  4116  		v_2_0_0 := v_2_0.Args[0]
  4117  		if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
  4118  			break
  4119  		}
  4120  		v.reset(OpPPC64ADDC)
  4121  		v.AddArg2(x, y)
  4122  		return true
  4123  	}
  4124  	// match: (ADDE (MOVDconst [0]) y c)
  4125  	// result: (ADDZE y c)
  4126  	for {
  4127  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4128  			if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4129  				continue
  4130  			}
  4131  			y := v_1
  4132  			c := v_2
  4133  			v.reset(OpPPC64ADDZE)
  4134  			v.AddArg2(y, c)
  4135  			return true
  4136  		}
  4137  		break
  4138  	}
  4139  	return false
  4140  }
  4141  func rewriteValuePPC64_OpPPC64ADDconst(v *Value) bool {
  4142  	v_0 := v.Args[0]
  4143  	// match: (ADDconst [c] (ADDconst [d] x))
  4144  	// cond: is32Bit(c+d)
  4145  	// result: (ADDconst [c+d] x)
  4146  	for {
  4147  		c := auxIntToInt64(v.AuxInt)
  4148  		if v_0.Op != OpPPC64ADDconst {
  4149  			break
  4150  		}
  4151  		d := auxIntToInt64(v_0.AuxInt)
  4152  		x := v_0.Args[0]
  4153  		if !(is32Bit(c + d)) {
  4154  			break
  4155  		}
  4156  		v.reset(OpPPC64ADDconst)
  4157  		v.AuxInt = int64ToAuxInt(c + d)
  4158  		v.AddArg(x)
  4159  		return true
  4160  	}
  4161  	// match: (ADDconst [0] x)
  4162  	// result: x
  4163  	for {
  4164  		if auxIntToInt64(v.AuxInt) != 0 {
  4165  			break
  4166  		}
  4167  		x := v_0
  4168  		v.copyOf(x)
  4169  		return true
  4170  	}
  4171  	// match: (ADDconst [c] (MOVDaddr [d] {sym} x))
  4172  	// cond: is32Bit(c+int64(d))
  4173  	// result: (MOVDaddr [int32(c+int64(d))] {sym} x)
  4174  	for {
  4175  		c := auxIntToInt64(v.AuxInt)
  4176  		if v_0.Op != OpPPC64MOVDaddr {
  4177  			break
  4178  		}
  4179  		d := auxIntToInt32(v_0.AuxInt)
  4180  		sym := auxToSym(v_0.Aux)
  4181  		x := v_0.Args[0]
  4182  		if !(is32Bit(c + int64(d))) {
  4183  			break
  4184  		}
  4185  		v.reset(OpPPC64MOVDaddr)
  4186  		v.AuxInt = int32ToAuxInt(int32(c + int64(d)))
  4187  		v.Aux = symToAux(sym)
  4188  		v.AddArg(x)
  4189  		return true
  4190  	}
  4191  	// match: (ADDconst [c] x:(SP))
  4192  	// cond: is32Bit(c)
  4193  	// result: (MOVDaddr [int32(c)] x)
  4194  	for {
  4195  		c := auxIntToInt64(v.AuxInt)
  4196  		x := v_0
  4197  		if x.Op != OpSP || !(is32Bit(c)) {
  4198  			break
  4199  		}
  4200  		v.reset(OpPPC64MOVDaddr)
  4201  		v.AuxInt = int32ToAuxInt(int32(c))
  4202  		v.AddArg(x)
  4203  		return true
  4204  	}
  4205  	// match: (ADDconst [c] (SUBFCconst [d] x))
  4206  	// cond: is32Bit(c+d)
  4207  	// result: (SUBFCconst [c+d] x)
  4208  	for {
  4209  		c := auxIntToInt64(v.AuxInt)
  4210  		if v_0.Op != OpPPC64SUBFCconst {
  4211  			break
  4212  		}
  4213  		d := auxIntToInt64(v_0.AuxInt)
  4214  		x := v_0.Args[0]
  4215  		if !(is32Bit(c + d)) {
  4216  			break
  4217  		}
  4218  		v.reset(OpPPC64SUBFCconst)
  4219  		v.AuxInt = int64ToAuxInt(c + d)
  4220  		v.AddArg(x)
  4221  		return true
  4222  	}
  4223  	return false
  4224  }
  4225  func rewriteValuePPC64_OpPPC64AND(v *Value) bool {
  4226  	v_1 := v.Args[1]
  4227  	v_0 := v.Args[0]
  4228  	// match: (AND (MOVDconst [m]) (ROTLWconst [r] x))
  4229  	// cond: isPPC64WordRotateMask(m)
  4230  	// result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
  4231  	for {
  4232  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4233  			if v_0.Op != OpPPC64MOVDconst {
  4234  				continue
  4235  			}
  4236  			m := auxIntToInt64(v_0.AuxInt)
  4237  			if v_1.Op != OpPPC64ROTLWconst {
  4238  				continue
  4239  			}
  4240  			r := auxIntToInt64(v_1.AuxInt)
  4241  			x := v_1.Args[0]
  4242  			if !(isPPC64WordRotateMask(m)) {
  4243  				continue
  4244  			}
  4245  			v.reset(OpPPC64RLWINM)
  4246  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
  4247  			v.AddArg(x)
  4248  			return true
  4249  		}
  4250  		break
  4251  	}
  4252  	// match: (AND (MOVDconst [m]) (ROTLW x r))
  4253  	// cond: isPPC64WordRotateMask(m)
  4254  	// result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
  4255  	for {
  4256  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4257  			if v_0.Op != OpPPC64MOVDconst {
  4258  				continue
  4259  			}
  4260  			m := auxIntToInt64(v_0.AuxInt)
  4261  			if v_1.Op != OpPPC64ROTLW {
  4262  				continue
  4263  			}
  4264  			r := v_1.Args[1]
  4265  			x := v_1.Args[0]
  4266  			if !(isPPC64WordRotateMask(m)) {
  4267  				continue
  4268  			}
  4269  			v.reset(OpPPC64RLWNM)
  4270  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
  4271  			v.AddArg2(x, r)
  4272  			return true
  4273  		}
  4274  		break
  4275  	}
  4276  	// match: (AND (MOVDconst [m]) (SRWconst x [s]))
  4277  	// cond: mergePPC64RShiftMask(m,s,32) == 0
  4278  	// result: (MOVDconst [0])
  4279  	for {
  4280  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4281  			if v_0.Op != OpPPC64MOVDconst {
  4282  				continue
  4283  			}
  4284  			m := auxIntToInt64(v_0.AuxInt)
  4285  			if v_1.Op != OpPPC64SRWconst {
  4286  				continue
  4287  			}
  4288  			s := auxIntToInt64(v_1.AuxInt)
  4289  			if !(mergePPC64RShiftMask(m, s, 32) == 0) {
  4290  				continue
  4291  			}
  4292  			v.reset(OpPPC64MOVDconst)
  4293  			v.AuxInt = int64ToAuxInt(0)
  4294  			return true
  4295  		}
  4296  		break
  4297  	}
  4298  	// match: (AND (MOVDconst [m]) (SRWconst x [s]))
  4299  	// cond: mergePPC64AndSrwi(m,s) != 0
  4300  	// result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
  4301  	for {
  4302  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4303  			if v_0.Op != OpPPC64MOVDconst {
  4304  				continue
  4305  			}
  4306  			m := auxIntToInt64(v_0.AuxInt)
  4307  			if v_1.Op != OpPPC64SRWconst {
  4308  				continue
  4309  			}
  4310  			s := auxIntToInt64(v_1.AuxInt)
  4311  			x := v_1.Args[0]
  4312  			if !(mergePPC64AndSrwi(m, s) != 0) {
  4313  				continue
  4314  			}
  4315  			v.reset(OpPPC64RLWINM)
  4316  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
  4317  			v.AddArg(x)
  4318  			return true
  4319  		}
  4320  		break
  4321  	}
  4322  	// match: (AND (MOVDconst [m]) (SRDconst x [s]))
  4323  	// cond: mergePPC64AndSrdi(m,s) != 0
  4324  	// result: (RLWINM [mergePPC64AndSrdi(m,s)] x)
  4325  	for {
  4326  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4327  			if v_0.Op != OpPPC64MOVDconst {
  4328  				continue
  4329  			}
  4330  			m := auxIntToInt64(v_0.AuxInt)
  4331  			if v_1.Op != OpPPC64SRDconst {
  4332  				continue
  4333  			}
  4334  			s := auxIntToInt64(v_1.AuxInt)
  4335  			x := v_1.Args[0]
  4336  			if !(mergePPC64AndSrdi(m, s) != 0) {
  4337  				continue
  4338  			}
  4339  			v.reset(OpPPC64RLWINM)
  4340  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrdi(m, s))
  4341  			v.AddArg(x)
  4342  			return true
  4343  		}
  4344  		break
  4345  	}
  4346  	// match: (AND (MOVDconst [m]) (SLDconst x [s]))
  4347  	// cond: mergePPC64AndSldi(m,s) != 0
  4348  	// result: (RLWINM [mergePPC64AndSldi(m,s)] x)
  4349  	for {
  4350  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4351  			if v_0.Op != OpPPC64MOVDconst {
  4352  				continue
  4353  			}
  4354  			m := auxIntToInt64(v_0.AuxInt)
  4355  			if v_1.Op != OpPPC64SLDconst {
  4356  				continue
  4357  			}
  4358  			s := auxIntToInt64(v_1.AuxInt)
  4359  			x := v_1.Args[0]
  4360  			if !(mergePPC64AndSldi(m, s) != 0) {
  4361  				continue
  4362  			}
  4363  			v.reset(OpPPC64RLWINM)
  4364  			v.AuxInt = int64ToAuxInt(mergePPC64AndSldi(m, s))
  4365  			v.AddArg(x)
  4366  			return true
  4367  		}
  4368  		break
  4369  	}
  4370  	// match: (AND x (NOR y y))
  4371  	// result: (ANDN x y)
  4372  	for {
  4373  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4374  			x := v_0
  4375  			if v_1.Op != OpPPC64NOR {
  4376  				continue
  4377  			}
  4378  			y := v_1.Args[1]
  4379  			if y != v_1.Args[0] {
  4380  				continue
  4381  			}
  4382  			v.reset(OpPPC64ANDN)
  4383  			v.AddArg2(x, y)
  4384  			return true
  4385  		}
  4386  		break
  4387  	}
  4388  	// match: (AND (MOVDconst [c]) (MOVDconst [d]))
  4389  	// result: (MOVDconst [c&d])
  4390  	for {
  4391  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4392  			if v_0.Op != OpPPC64MOVDconst {
  4393  				continue
  4394  			}
  4395  			c := auxIntToInt64(v_0.AuxInt)
  4396  			if v_1.Op != OpPPC64MOVDconst {
  4397  				continue
  4398  			}
  4399  			d := auxIntToInt64(v_1.AuxInt)
  4400  			v.reset(OpPPC64MOVDconst)
  4401  			v.AuxInt = int64ToAuxInt(c & d)
  4402  			return true
  4403  		}
  4404  		break
  4405  	}
  4406  	// match: (AND x (MOVDconst [-1]))
  4407  	// result: x
  4408  	for {
  4409  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4410  			x := v_0
  4411  			if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
  4412  				continue
  4413  			}
  4414  			v.copyOf(x)
  4415  			return true
  4416  		}
  4417  		break
  4418  	}
  4419  	// match: (AND x (MOVDconst [c]))
  4420  	// cond: isU16Bit(c)
  4421  	// result: (ANDconst [c] x)
  4422  	for {
  4423  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4424  			x := v_0
  4425  			if v_1.Op != OpPPC64MOVDconst {
  4426  				continue
  4427  			}
  4428  			c := auxIntToInt64(v_1.AuxInt)
  4429  			if !(isU16Bit(c)) {
  4430  				continue
  4431  			}
  4432  			v.reset(OpPPC64ANDconst)
  4433  			v.AuxInt = int64ToAuxInt(c)
  4434  			v.AddArg(x)
  4435  			return true
  4436  		}
  4437  		break
  4438  	}
  4439  	// match: (AND (MOVDconst [c]) y:(MOVWZreg _))
  4440  	// cond: c&0xFFFFFFFF == 0xFFFFFFFF
  4441  	// result: y
  4442  	for {
  4443  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4444  			if v_0.Op != OpPPC64MOVDconst {
  4445  				continue
  4446  			}
  4447  			c := auxIntToInt64(v_0.AuxInt)
  4448  			y := v_1
  4449  			if y.Op != OpPPC64MOVWZreg || !(c&0xFFFFFFFF == 0xFFFFFFFF) {
  4450  				continue
  4451  			}
  4452  			v.copyOf(y)
  4453  			return true
  4454  		}
  4455  		break
  4456  	}
  4457  	// match: (AND (MOVDconst [0xFFFFFFFF]) y:(MOVWreg x))
  4458  	// result: (MOVWZreg x)
  4459  	for {
  4460  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4461  			if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0xFFFFFFFF {
  4462  				continue
  4463  			}
  4464  			y := v_1
  4465  			if y.Op != OpPPC64MOVWreg {
  4466  				continue
  4467  			}
  4468  			x := y.Args[0]
  4469  			v.reset(OpPPC64MOVWZreg)
  4470  			v.AddArg(x)
  4471  			return true
  4472  		}
  4473  		break
  4474  	}
  4475  	// match: (AND (MOVDconst [c]) x:(MOVBZload _ _))
  4476  	// result: (ANDconst [c&0xFF] x)
  4477  	for {
  4478  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4479  			if v_0.Op != OpPPC64MOVDconst {
  4480  				continue
  4481  			}
  4482  			c := auxIntToInt64(v_0.AuxInt)
  4483  			x := v_1
  4484  			if x.Op != OpPPC64MOVBZload {
  4485  				continue
  4486  			}
  4487  			v.reset(OpPPC64ANDconst)
  4488  			v.AuxInt = int64ToAuxInt(c & 0xFF)
  4489  			v.AddArg(x)
  4490  			return true
  4491  		}
  4492  		break
  4493  	}
  4494  	return false
  4495  }
  4496  func rewriteValuePPC64_OpPPC64ANDN(v *Value) bool {
  4497  	v_1 := v.Args[1]
  4498  	v_0 := v.Args[0]
  4499  	// match: (ANDN (MOVDconst [c]) (MOVDconst [d]))
  4500  	// result: (MOVDconst [c&^d])
  4501  	for {
  4502  		if v_0.Op != OpPPC64MOVDconst {
  4503  			break
  4504  		}
  4505  		c := auxIntToInt64(v_0.AuxInt)
  4506  		if v_1.Op != OpPPC64MOVDconst {
  4507  			break
  4508  		}
  4509  		d := auxIntToInt64(v_1.AuxInt)
  4510  		v.reset(OpPPC64MOVDconst)
  4511  		v.AuxInt = int64ToAuxInt(c &^ d)
  4512  		return true
  4513  	}
  4514  	return false
  4515  }
  4516  func rewriteValuePPC64_OpPPC64ANDconst(v *Value) bool {
  4517  	v_0 := v.Args[0]
  4518  	// match: (ANDconst [m] (ROTLWconst [r] x))
  4519  	// cond: isPPC64WordRotateMask(m)
  4520  	// result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
  4521  	for {
  4522  		m := auxIntToInt64(v.AuxInt)
  4523  		if v_0.Op != OpPPC64ROTLWconst {
  4524  			break
  4525  		}
  4526  		r := auxIntToInt64(v_0.AuxInt)
  4527  		x := v_0.Args[0]
  4528  		if !(isPPC64WordRotateMask(m)) {
  4529  			break
  4530  		}
  4531  		v.reset(OpPPC64RLWINM)
  4532  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
  4533  		v.AddArg(x)
  4534  		return true
  4535  	}
  4536  	// match: (ANDconst [m] (ROTLW x r))
  4537  	// cond: isPPC64WordRotateMask(m)
  4538  	// result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
  4539  	for {
  4540  		m := auxIntToInt64(v.AuxInt)
  4541  		if v_0.Op != OpPPC64ROTLW {
  4542  			break
  4543  		}
  4544  		r := v_0.Args[1]
  4545  		x := v_0.Args[0]
  4546  		if !(isPPC64WordRotateMask(m)) {
  4547  			break
  4548  		}
  4549  		v.reset(OpPPC64RLWNM)
  4550  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
  4551  		v.AddArg2(x, r)
  4552  		return true
  4553  	}
  4554  	// match: (ANDconst [m] (SRWconst x [s]))
  4555  	// cond: mergePPC64RShiftMask(m,s,32) == 0
  4556  	// result: (MOVDconst [0])
  4557  	for {
  4558  		m := auxIntToInt64(v.AuxInt)
  4559  		if v_0.Op != OpPPC64SRWconst {
  4560  			break
  4561  		}
  4562  		s := auxIntToInt64(v_0.AuxInt)
  4563  		if !(mergePPC64RShiftMask(m, s, 32) == 0) {
  4564  			break
  4565  		}
  4566  		v.reset(OpPPC64MOVDconst)
  4567  		v.AuxInt = int64ToAuxInt(0)
  4568  		return true
  4569  	}
  4570  	// match: (ANDconst [m] (SRWconst x [s]))
  4571  	// cond: mergePPC64AndSrwi(m,s) != 0
  4572  	// result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
  4573  	for {
  4574  		m := auxIntToInt64(v.AuxInt)
  4575  		if v_0.Op != OpPPC64SRWconst {
  4576  			break
  4577  		}
  4578  		s := auxIntToInt64(v_0.AuxInt)
  4579  		x := v_0.Args[0]
  4580  		if !(mergePPC64AndSrwi(m, s) != 0) {
  4581  			break
  4582  		}
  4583  		v.reset(OpPPC64RLWINM)
  4584  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
  4585  		v.AddArg(x)
  4586  		return true
  4587  	}
  4588  	// match: (ANDconst [m] (SRDconst x [s]))
  4589  	// cond: mergePPC64AndSrdi(m,s) != 0
  4590  	// result: (RLWINM [mergePPC64AndSrdi(m,s)] x)
  4591  	for {
  4592  		m := auxIntToInt64(v.AuxInt)
  4593  		if v_0.Op != OpPPC64SRDconst {
  4594  			break
  4595  		}
  4596  		s := auxIntToInt64(v_0.AuxInt)
  4597  		x := v_0.Args[0]
  4598  		if !(mergePPC64AndSrdi(m, s) != 0) {
  4599  			break
  4600  		}
  4601  		v.reset(OpPPC64RLWINM)
  4602  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrdi(m, s))
  4603  		v.AddArg(x)
  4604  		return true
  4605  	}
  4606  	// match: (ANDconst [m] (SLDconst x [s]))
  4607  	// cond: mergePPC64AndSldi(m,s) != 0
  4608  	// result: (RLWINM [mergePPC64AndSldi(m,s)] x)
  4609  	for {
  4610  		m := auxIntToInt64(v.AuxInt)
  4611  		if v_0.Op != OpPPC64SLDconst {
  4612  			break
  4613  		}
  4614  		s := auxIntToInt64(v_0.AuxInt)
  4615  		x := v_0.Args[0]
  4616  		if !(mergePPC64AndSldi(m, s) != 0) {
  4617  			break
  4618  		}
  4619  		v.reset(OpPPC64RLWINM)
  4620  		v.AuxInt = int64ToAuxInt(mergePPC64AndSldi(m, s))
  4621  		v.AddArg(x)
  4622  		return true
  4623  	}
  4624  	// match: (ANDconst [c] (ANDconst [d] x))
  4625  	// result: (ANDconst [c&d] x)
  4626  	for {
  4627  		c := auxIntToInt64(v.AuxInt)
  4628  		if v_0.Op != OpPPC64ANDconst {
  4629  			break
  4630  		}
  4631  		d := auxIntToInt64(v_0.AuxInt)
  4632  		x := v_0.Args[0]
  4633  		v.reset(OpPPC64ANDconst)
  4634  		v.AuxInt = int64ToAuxInt(c & d)
  4635  		v.AddArg(x)
  4636  		return true
  4637  	}
  4638  	// match: (ANDconst [-1] x)
  4639  	// result: x
  4640  	for {
  4641  		if auxIntToInt64(v.AuxInt) != -1 {
  4642  			break
  4643  		}
  4644  		x := v_0
  4645  		v.copyOf(x)
  4646  		return true
  4647  	}
  4648  	// match: (ANDconst [0] _)
  4649  	// result: (MOVDconst [0])
  4650  	for {
  4651  		if auxIntToInt64(v.AuxInt) != 0 {
  4652  			break
  4653  		}
  4654  		v.reset(OpPPC64MOVDconst)
  4655  		v.AuxInt = int64ToAuxInt(0)
  4656  		return true
  4657  	}
  4658  	// match: (ANDconst [c] y:(MOVBZreg _))
  4659  	// cond: c&0xFF == 0xFF
  4660  	// result: y
  4661  	for {
  4662  		c := auxIntToInt64(v.AuxInt)
  4663  		y := v_0
  4664  		if y.Op != OpPPC64MOVBZreg || !(c&0xFF == 0xFF) {
  4665  			break
  4666  		}
  4667  		v.copyOf(y)
  4668  		return true
  4669  	}
  4670  	// match: (ANDconst [0xFF] (MOVBreg x))
  4671  	// result: (MOVBZreg x)
  4672  	for {
  4673  		if auxIntToInt64(v.AuxInt) != 0xFF || v_0.Op != OpPPC64MOVBreg {
  4674  			break
  4675  		}
  4676  		x := v_0.Args[0]
  4677  		v.reset(OpPPC64MOVBZreg)
  4678  		v.AddArg(x)
  4679  		return true
  4680  	}
  4681  	// match: (ANDconst [c] y:(MOVHZreg _))
  4682  	// cond: c&0xFFFF == 0xFFFF
  4683  	// result: y
  4684  	for {
  4685  		c := auxIntToInt64(v.AuxInt)
  4686  		y := v_0
  4687  		if y.Op != OpPPC64MOVHZreg || !(c&0xFFFF == 0xFFFF) {
  4688  			break
  4689  		}
  4690  		v.copyOf(y)
  4691  		return true
  4692  	}
  4693  	// match: (ANDconst [0xFFFF] (MOVHreg x))
  4694  	// result: (MOVHZreg x)
  4695  	for {
  4696  		if auxIntToInt64(v.AuxInt) != 0xFFFF || v_0.Op != OpPPC64MOVHreg {
  4697  			break
  4698  		}
  4699  		x := v_0.Args[0]
  4700  		v.reset(OpPPC64MOVHZreg)
  4701  		v.AddArg(x)
  4702  		return true
  4703  	}
  4704  	// match: (ANDconst [c] (MOVBZreg x))
  4705  	// result: (ANDconst [c&0xFF] x)
  4706  	for {
  4707  		c := auxIntToInt64(v.AuxInt)
  4708  		if v_0.Op != OpPPC64MOVBZreg {
  4709  			break
  4710  		}
  4711  		x := v_0.Args[0]
  4712  		v.reset(OpPPC64ANDconst)
  4713  		v.AuxInt = int64ToAuxInt(c & 0xFF)
  4714  		v.AddArg(x)
  4715  		return true
  4716  	}
  4717  	// match: (ANDconst [c] (MOVHZreg x))
  4718  	// result: (ANDconst [c&0xFFFF] x)
  4719  	for {
  4720  		c := auxIntToInt64(v.AuxInt)
  4721  		if v_0.Op != OpPPC64MOVHZreg {
  4722  			break
  4723  		}
  4724  		x := v_0.Args[0]
  4725  		v.reset(OpPPC64ANDconst)
  4726  		v.AuxInt = int64ToAuxInt(c & 0xFFFF)
  4727  		v.AddArg(x)
  4728  		return true
  4729  	}
  4730  	// match: (ANDconst [c] (MOVWZreg x))
  4731  	// result: (ANDconst [c&0xFFFFFFFF] x)
  4732  	for {
  4733  		c := auxIntToInt64(v.AuxInt)
  4734  		if v_0.Op != OpPPC64MOVWZreg {
  4735  			break
  4736  		}
  4737  		x := v_0.Args[0]
  4738  		v.reset(OpPPC64ANDconst)
  4739  		v.AuxInt = int64ToAuxInt(c & 0xFFFFFFFF)
  4740  		v.AddArg(x)
  4741  		return true
  4742  	}
  4743  	// match: (ANDconst [m] (RLWINM [r] y))
  4744  	// cond: mergePPC64AndRlwinm(uint32(m),r) != 0
  4745  	// result: (RLWINM [mergePPC64AndRlwinm(uint32(m),r)] y)
  4746  	for {
  4747  		m := auxIntToInt64(v.AuxInt)
  4748  		if v_0.Op != OpPPC64RLWINM {
  4749  			break
  4750  		}
  4751  		r := auxIntToInt64(v_0.AuxInt)
  4752  		y := v_0.Args[0]
  4753  		if !(mergePPC64AndRlwinm(uint32(m), r) != 0) {
  4754  			break
  4755  		}
  4756  		v.reset(OpPPC64RLWINM)
  4757  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(uint32(m), r))
  4758  		v.AddArg(y)
  4759  		return true
  4760  	}
  4761  	// match: (ANDconst [1] z:(SRADconst [63] x))
  4762  	// cond: z.Uses == 1
  4763  	// result: (SRDconst [63] x)
  4764  	for {
  4765  		if auxIntToInt64(v.AuxInt) != 1 {
  4766  			break
  4767  		}
  4768  		z := v_0
  4769  		if z.Op != OpPPC64SRADconst || auxIntToInt64(z.AuxInt) != 63 {
  4770  			break
  4771  		}
  4772  		x := z.Args[0]
  4773  		if !(z.Uses == 1) {
  4774  			break
  4775  		}
  4776  		v.reset(OpPPC64SRDconst)
  4777  		v.AuxInt = int64ToAuxInt(63)
  4778  		v.AddArg(x)
  4779  		return true
  4780  	}
  4781  	return false
  4782  }
  4783  func rewriteValuePPC64_OpPPC64BRD(v *Value) bool {
  4784  	v_0 := v.Args[0]
  4785  	b := v.Block
  4786  	typ := &b.Func.Config.Types
  4787  	// match: (BRD x:(MOVDload [off] {sym} ptr mem))
  4788  	// cond: x.Uses == 1
  4789  	// result: @x.Block (MOVDBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  4790  	for {
  4791  		x := v_0
  4792  		if x.Op != OpPPC64MOVDload {
  4793  			break
  4794  		}
  4795  		off := auxIntToInt32(x.AuxInt)
  4796  		sym := auxToSym(x.Aux)
  4797  		mem := x.Args[1]
  4798  		ptr := x.Args[0]
  4799  		if !(x.Uses == 1) {
  4800  			break
  4801  		}
  4802  		b = x.Block
  4803  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
  4804  		v.copyOf(v0)
  4805  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  4806  		v1.AuxInt = int32ToAuxInt(off)
  4807  		v1.Aux = symToAux(sym)
  4808  		v1.AddArg(ptr)
  4809  		v0.AddArg2(v1, mem)
  4810  		return true
  4811  	}
  4812  	// match: (BRD x:(MOVDloadidx ptr idx mem))
  4813  	// cond: x.Uses == 1
  4814  	// result: @x.Block (MOVDBRloadidx ptr idx mem)
  4815  	for {
  4816  		x := v_0
  4817  		if x.Op != OpPPC64MOVDloadidx {
  4818  			break
  4819  		}
  4820  		mem := x.Args[2]
  4821  		ptr := x.Args[0]
  4822  		idx := x.Args[1]
  4823  		if !(x.Uses == 1) {
  4824  			break
  4825  		}
  4826  		b = x.Block
  4827  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
  4828  		v.copyOf(v0)
  4829  		v0.AddArg3(ptr, idx, mem)
  4830  		return true
  4831  	}
  4832  	return false
  4833  }
  4834  func rewriteValuePPC64_OpPPC64BRH(v *Value) bool {
  4835  	v_0 := v.Args[0]
  4836  	b := v.Block
  4837  	typ := &b.Func.Config.Types
  4838  	// match: (BRH x:(MOVHZload [off] {sym} ptr mem))
  4839  	// cond: x.Uses == 1
  4840  	// result: @x.Block (MOVHBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  4841  	for {
  4842  		x := v_0
  4843  		if x.Op != OpPPC64MOVHZload {
  4844  			break
  4845  		}
  4846  		off := auxIntToInt32(x.AuxInt)
  4847  		sym := auxToSym(x.Aux)
  4848  		mem := x.Args[1]
  4849  		ptr := x.Args[0]
  4850  		if !(x.Uses == 1) {
  4851  			break
  4852  		}
  4853  		b = x.Block
  4854  		v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
  4855  		v.copyOf(v0)
  4856  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  4857  		v1.AuxInt = int32ToAuxInt(off)
  4858  		v1.Aux = symToAux(sym)
  4859  		v1.AddArg(ptr)
  4860  		v0.AddArg2(v1, mem)
  4861  		return true
  4862  	}
  4863  	// match: (BRH x:(MOVHZloadidx ptr idx mem))
  4864  	// cond: x.Uses == 1
  4865  	// result: @x.Block (MOVHBRloadidx ptr idx mem)
  4866  	for {
  4867  		x := v_0
  4868  		if x.Op != OpPPC64MOVHZloadidx {
  4869  			break
  4870  		}
  4871  		mem := x.Args[2]
  4872  		ptr := x.Args[0]
  4873  		idx := x.Args[1]
  4874  		if !(x.Uses == 1) {
  4875  			break
  4876  		}
  4877  		b = x.Block
  4878  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
  4879  		v.copyOf(v0)
  4880  		v0.AddArg3(ptr, idx, mem)
  4881  		return true
  4882  	}
  4883  	return false
  4884  }
  4885  func rewriteValuePPC64_OpPPC64BRW(v *Value) bool {
  4886  	v_0 := v.Args[0]
  4887  	b := v.Block
  4888  	typ := &b.Func.Config.Types
  4889  	// match: (BRW x:(MOVWZload [off] {sym} ptr mem))
  4890  	// cond: x.Uses == 1
  4891  	// result: @x.Block (MOVWBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  4892  	for {
  4893  		x := v_0
  4894  		if x.Op != OpPPC64MOVWZload {
  4895  			break
  4896  		}
  4897  		off := auxIntToInt32(x.AuxInt)
  4898  		sym := auxToSym(x.Aux)
  4899  		mem := x.Args[1]
  4900  		ptr := x.Args[0]
  4901  		if !(x.Uses == 1) {
  4902  			break
  4903  		}
  4904  		b = x.Block
  4905  		v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
  4906  		v.copyOf(v0)
  4907  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  4908  		v1.AuxInt = int32ToAuxInt(off)
  4909  		v1.Aux = symToAux(sym)
  4910  		v1.AddArg(ptr)
  4911  		v0.AddArg2(v1, mem)
  4912  		return true
  4913  	}
  4914  	// match: (BRW x:(MOVWZloadidx ptr idx mem))
  4915  	// cond: x.Uses == 1
  4916  	// result: @x.Block (MOVWBRloadidx ptr idx mem)
  4917  	for {
  4918  		x := v_0
  4919  		if x.Op != OpPPC64MOVWZloadidx {
  4920  			break
  4921  		}
  4922  		mem := x.Args[2]
  4923  		ptr := x.Args[0]
  4924  		idx := x.Args[1]
  4925  		if !(x.Uses == 1) {
  4926  			break
  4927  		}
  4928  		b = x.Block
  4929  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
  4930  		v.copyOf(v0)
  4931  		v0.AddArg3(ptr, idx, mem)
  4932  		return true
  4933  	}
  4934  	return false
  4935  }
  4936  func rewriteValuePPC64_OpPPC64CLRLSLDI(v *Value) bool {
  4937  	v_0 := v.Args[0]
  4938  	// match: (CLRLSLDI [c] (SRWconst [s] x))
  4939  	// cond: mergePPC64ClrlsldiSrw(int64(c),s) != 0
  4940  	// result: (RLWINM [mergePPC64ClrlsldiSrw(int64(c),s)] x)
  4941  	for {
  4942  		c := auxIntToInt32(v.AuxInt)
  4943  		if v_0.Op != OpPPC64SRWconst {
  4944  			break
  4945  		}
  4946  		s := auxIntToInt64(v_0.AuxInt)
  4947  		x := v_0.Args[0]
  4948  		if !(mergePPC64ClrlsldiSrw(int64(c), s) != 0) {
  4949  			break
  4950  		}
  4951  		v.reset(OpPPC64RLWINM)
  4952  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrw(int64(c), s))
  4953  		v.AddArg(x)
  4954  		return true
  4955  	}
  4956  	// match: (CLRLSLDI [c] (SRDconst [s] x))
  4957  	// cond: mergePPC64ClrlsldiSrd(int64(c),s) != 0
  4958  	// result: (RLWINM [mergePPC64ClrlsldiSrd(int64(c),s)] x)
  4959  	for {
  4960  		c := auxIntToInt32(v.AuxInt)
  4961  		if v_0.Op != OpPPC64SRDconst {
  4962  			break
  4963  		}
  4964  		s := auxIntToInt64(v_0.AuxInt)
  4965  		x := v_0.Args[0]
  4966  		if !(mergePPC64ClrlsldiSrd(int64(c), s) != 0) {
  4967  			break
  4968  		}
  4969  		v.reset(OpPPC64RLWINM)
  4970  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrd(int64(c), s))
  4971  		v.AddArg(x)
  4972  		return true
  4973  	}
  4974  	// match: (CLRLSLDI [c] i:(RLWINM [s] x))
  4975  	// cond: mergePPC64ClrlsldiRlwinm(c,s) != 0
  4976  	// result: (RLWINM [mergePPC64ClrlsldiRlwinm(c,s)] x)
  4977  	for {
  4978  		c := auxIntToInt32(v.AuxInt)
  4979  		i := v_0
  4980  		if i.Op != OpPPC64RLWINM {
  4981  			break
  4982  		}
  4983  		s := auxIntToInt64(i.AuxInt)
  4984  		x := i.Args[0]
  4985  		if !(mergePPC64ClrlsldiRlwinm(c, s) != 0) {
  4986  			break
  4987  		}
  4988  		v.reset(OpPPC64RLWINM)
  4989  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiRlwinm(c, s))
  4990  		v.AddArg(x)
  4991  		return true
  4992  	}
  4993  	return false
  4994  }
  4995  func rewriteValuePPC64_OpPPC64CMP(v *Value) bool {
  4996  	v_1 := v.Args[1]
  4997  	v_0 := v.Args[0]
  4998  	b := v.Block
  4999  	// match: (CMP x (MOVDconst [c]))
  5000  	// cond: is16Bit(c)
  5001  	// result: (CMPconst x [c])
  5002  	for {
  5003  		x := v_0
  5004  		if v_1.Op != OpPPC64MOVDconst {
  5005  			break
  5006  		}
  5007  		c := auxIntToInt64(v_1.AuxInt)
  5008  		if !(is16Bit(c)) {
  5009  			break
  5010  		}
  5011  		v.reset(OpPPC64CMPconst)
  5012  		v.AuxInt = int64ToAuxInt(c)
  5013  		v.AddArg(x)
  5014  		return true
  5015  	}
  5016  	// match: (CMP (MOVDconst [c]) y)
  5017  	// cond: is16Bit(c)
  5018  	// result: (InvertFlags (CMPconst y [c]))
  5019  	for {
  5020  		if v_0.Op != OpPPC64MOVDconst {
  5021  			break
  5022  		}
  5023  		c := auxIntToInt64(v_0.AuxInt)
  5024  		y := v_1
  5025  		if !(is16Bit(c)) {
  5026  			break
  5027  		}
  5028  		v.reset(OpPPC64InvertFlags)
  5029  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  5030  		v0.AuxInt = int64ToAuxInt(c)
  5031  		v0.AddArg(y)
  5032  		v.AddArg(v0)
  5033  		return true
  5034  	}
  5035  	// match: (CMP x y)
  5036  	// cond: canonLessThan(x,y)
  5037  	// result: (InvertFlags (CMP y x))
  5038  	for {
  5039  		x := v_0
  5040  		y := v_1
  5041  		if !(canonLessThan(x, y)) {
  5042  			break
  5043  		}
  5044  		v.reset(OpPPC64InvertFlags)
  5045  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  5046  		v0.AddArg2(y, x)
  5047  		v.AddArg(v0)
  5048  		return true
  5049  	}
  5050  	return false
  5051  }
  5052  func rewriteValuePPC64_OpPPC64CMPU(v *Value) bool {
  5053  	v_1 := v.Args[1]
  5054  	v_0 := v.Args[0]
  5055  	b := v.Block
  5056  	// match: (CMPU x (MOVDconst [c]))
  5057  	// cond: isU16Bit(c)
  5058  	// result: (CMPUconst x [c])
  5059  	for {
  5060  		x := v_0
  5061  		if v_1.Op != OpPPC64MOVDconst {
  5062  			break
  5063  		}
  5064  		c := auxIntToInt64(v_1.AuxInt)
  5065  		if !(isU16Bit(c)) {
  5066  			break
  5067  		}
  5068  		v.reset(OpPPC64CMPUconst)
  5069  		v.AuxInt = int64ToAuxInt(c)
  5070  		v.AddArg(x)
  5071  		return true
  5072  	}
  5073  	// match: (CMPU (MOVDconst [c]) y)
  5074  	// cond: isU16Bit(c)
  5075  	// result: (InvertFlags (CMPUconst y [c]))
  5076  	for {
  5077  		if v_0.Op != OpPPC64MOVDconst {
  5078  			break
  5079  		}
  5080  		c := auxIntToInt64(v_0.AuxInt)
  5081  		y := v_1
  5082  		if !(isU16Bit(c)) {
  5083  			break
  5084  		}
  5085  		v.reset(OpPPC64InvertFlags)
  5086  		v0 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  5087  		v0.AuxInt = int64ToAuxInt(c)
  5088  		v0.AddArg(y)
  5089  		v.AddArg(v0)
  5090  		return true
  5091  	}
  5092  	// match: (CMPU x y)
  5093  	// cond: canonLessThan(x,y)
  5094  	// result: (InvertFlags (CMPU y x))
  5095  	for {
  5096  		x := v_0
  5097  		y := v_1
  5098  		if !(canonLessThan(x, y)) {
  5099  			break
  5100  		}
  5101  		v.reset(OpPPC64InvertFlags)
  5102  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  5103  		v0.AddArg2(y, x)
  5104  		v.AddArg(v0)
  5105  		return true
  5106  	}
  5107  	return false
  5108  }
  5109  func rewriteValuePPC64_OpPPC64CMPUconst(v *Value) bool {
  5110  	v_0 := v.Args[0]
  5111  	// match: (CMPUconst [d] (ANDconst z [c]))
  5112  	// cond: uint64(d) > uint64(c)
  5113  	// result: (FlagLT)
  5114  	for {
  5115  		d := auxIntToInt64(v.AuxInt)
  5116  		if v_0.Op != OpPPC64ANDconst {
  5117  			break
  5118  		}
  5119  		c := auxIntToInt64(v_0.AuxInt)
  5120  		if !(uint64(d) > uint64(c)) {
  5121  			break
  5122  		}
  5123  		v.reset(OpPPC64FlagLT)
  5124  		return true
  5125  	}
  5126  	// match: (CMPUconst (MOVDconst [x]) [y])
  5127  	// cond: x==y
  5128  	// result: (FlagEQ)
  5129  	for {
  5130  		y := auxIntToInt64(v.AuxInt)
  5131  		if v_0.Op != OpPPC64MOVDconst {
  5132  			break
  5133  		}
  5134  		x := auxIntToInt64(v_0.AuxInt)
  5135  		if !(x == y) {
  5136  			break
  5137  		}
  5138  		v.reset(OpPPC64FlagEQ)
  5139  		return true
  5140  	}
  5141  	// match: (CMPUconst (MOVDconst [x]) [y])
  5142  	// cond: uint64(x)<uint64(y)
  5143  	// result: (FlagLT)
  5144  	for {
  5145  		y := auxIntToInt64(v.AuxInt)
  5146  		if v_0.Op != OpPPC64MOVDconst {
  5147  			break
  5148  		}
  5149  		x := auxIntToInt64(v_0.AuxInt)
  5150  		if !(uint64(x) < uint64(y)) {
  5151  			break
  5152  		}
  5153  		v.reset(OpPPC64FlagLT)
  5154  		return true
  5155  	}
  5156  	// match: (CMPUconst (MOVDconst [x]) [y])
  5157  	// cond: uint64(x)>uint64(y)
  5158  	// result: (FlagGT)
  5159  	for {
  5160  		y := auxIntToInt64(v.AuxInt)
  5161  		if v_0.Op != OpPPC64MOVDconst {
  5162  			break
  5163  		}
  5164  		x := auxIntToInt64(v_0.AuxInt)
  5165  		if !(uint64(x) > uint64(y)) {
  5166  			break
  5167  		}
  5168  		v.reset(OpPPC64FlagGT)
  5169  		return true
  5170  	}
  5171  	// match: (CMPUconst [0] a:(ANDconst [n] z))
  5172  	// result: (CMPconst [0] a)
  5173  	for {
  5174  		if auxIntToInt64(v.AuxInt) != 0 {
  5175  			break
  5176  		}
  5177  		a := v_0
  5178  		if a.Op != OpPPC64ANDconst {
  5179  			break
  5180  		}
  5181  		v.reset(OpPPC64CMPconst)
  5182  		v.AuxInt = int64ToAuxInt(0)
  5183  		v.AddArg(a)
  5184  		return true
  5185  	}
  5186  	return false
  5187  }
  5188  func rewriteValuePPC64_OpPPC64CMPW(v *Value) bool {
  5189  	v_1 := v.Args[1]
  5190  	v_0 := v.Args[0]
  5191  	b := v.Block
  5192  	// match: (CMPW x (MOVWreg y))
  5193  	// result: (CMPW x y)
  5194  	for {
  5195  		x := v_0
  5196  		if v_1.Op != OpPPC64MOVWreg {
  5197  			break
  5198  		}
  5199  		y := v_1.Args[0]
  5200  		v.reset(OpPPC64CMPW)
  5201  		v.AddArg2(x, y)
  5202  		return true
  5203  	}
  5204  	// match: (CMPW (MOVWreg x) y)
  5205  	// result: (CMPW x y)
  5206  	for {
  5207  		if v_0.Op != OpPPC64MOVWreg {
  5208  			break
  5209  		}
  5210  		x := v_0.Args[0]
  5211  		y := v_1
  5212  		v.reset(OpPPC64CMPW)
  5213  		v.AddArg2(x, y)
  5214  		return true
  5215  	}
  5216  	// match: (CMPW x (MOVDconst [c]))
  5217  	// cond: is16Bit(c)
  5218  	// result: (CMPWconst x [int32(c)])
  5219  	for {
  5220  		x := v_0
  5221  		if v_1.Op != OpPPC64MOVDconst {
  5222  			break
  5223  		}
  5224  		c := auxIntToInt64(v_1.AuxInt)
  5225  		if !(is16Bit(c)) {
  5226  			break
  5227  		}
  5228  		v.reset(OpPPC64CMPWconst)
  5229  		v.AuxInt = int32ToAuxInt(int32(c))
  5230  		v.AddArg(x)
  5231  		return true
  5232  	}
  5233  	// match: (CMPW (MOVDconst [c]) y)
  5234  	// cond: is16Bit(c)
  5235  	// result: (InvertFlags (CMPWconst y [int32(c)]))
  5236  	for {
  5237  		if v_0.Op != OpPPC64MOVDconst {
  5238  			break
  5239  		}
  5240  		c := auxIntToInt64(v_0.AuxInt)
  5241  		y := v_1
  5242  		if !(is16Bit(c)) {
  5243  			break
  5244  		}
  5245  		v.reset(OpPPC64InvertFlags)
  5246  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, types.TypeFlags)
  5247  		v0.AuxInt = int32ToAuxInt(int32(c))
  5248  		v0.AddArg(y)
  5249  		v.AddArg(v0)
  5250  		return true
  5251  	}
  5252  	// match: (CMPW x y)
  5253  	// cond: canonLessThan(x,y)
  5254  	// result: (InvertFlags (CMPW y x))
  5255  	for {
  5256  		x := v_0
  5257  		y := v_1
  5258  		if !(canonLessThan(x, y)) {
  5259  			break
  5260  		}
  5261  		v.reset(OpPPC64InvertFlags)
  5262  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  5263  		v0.AddArg2(y, x)
  5264  		v.AddArg(v0)
  5265  		return true
  5266  	}
  5267  	return false
  5268  }
  5269  func rewriteValuePPC64_OpPPC64CMPWU(v *Value) bool {
  5270  	v_1 := v.Args[1]
  5271  	v_0 := v.Args[0]
  5272  	b := v.Block
  5273  	// match: (CMPWU x (MOVWZreg y))
  5274  	// result: (CMPWU x y)
  5275  	for {
  5276  		x := v_0
  5277  		if v_1.Op != OpPPC64MOVWZreg {
  5278  			break
  5279  		}
  5280  		y := v_1.Args[0]
  5281  		v.reset(OpPPC64CMPWU)
  5282  		v.AddArg2(x, y)
  5283  		return true
  5284  	}
  5285  	// match: (CMPWU (MOVWZreg x) y)
  5286  	// result: (CMPWU x y)
  5287  	for {
  5288  		if v_0.Op != OpPPC64MOVWZreg {
  5289  			break
  5290  		}
  5291  		x := v_0.Args[0]
  5292  		y := v_1
  5293  		v.reset(OpPPC64CMPWU)
  5294  		v.AddArg2(x, y)
  5295  		return true
  5296  	}
  5297  	// match: (CMPWU x (MOVDconst [c]))
  5298  	// cond: isU16Bit(c)
  5299  	// result: (CMPWUconst x [int32(c)])
  5300  	for {
  5301  		x := v_0
  5302  		if v_1.Op != OpPPC64MOVDconst {
  5303  			break
  5304  		}
  5305  		c := auxIntToInt64(v_1.AuxInt)
  5306  		if !(isU16Bit(c)) {
  5307  			break
  5308  		}
  5309  		v.reset(OpPPC64CMPWUconst)
  5310  		v.AuxInt = int32ToAuxInt(int32(c))
  5311  		v.AddArg(x)
  5312  		return true
  5313  	}
  5314  	// match: (CMPWU (MOVDconst [c]) y)
  5315  	// cond: isU16Bit(c)
  5316  	// result: (InvertFlags (CMPWUconst y [int32(c)]))
  5317  	for {
  5318  		if v_0.Op != OpPPC64MOVDconst {
  5319  			break
  5320  		}
  5321  		c := auxIntToInt64(v_0.AuxInt)
  5322  		y := v_1
  5323  		if !(isU16Bit(c)) {
  5324  			break
  5325  		}
  5326  		v.reset(OpPPC64InvertFlags)
  5327  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  5328  		v0.AuxInt = int32ToAuxInt(int32(c))
  5329  		v0.AddArg(y)
  5330  		v.AddArg(v0)
  5331  		return true
  5332  	}
  5333  	// match: (CMPWU x y)
  5334  	// cond: canonLessThan(x,y)
  5335  	// result: (InvertFlags (CMPWU y x))
  5336  	for {
  5337  		x := v_0
  5338  		y := v_1
  5339  		if !(canonLessThan(x, y)) {
  5340  			break
  5341  		}
  5342  		v.reset(OpPPC64InvertFlags)
  5343  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  5344  		v0.AddArg2(y, x)
  5345  		v.AddArg(v0)
  5346  		return true
  5347  	}
  5348  	return false
  5349  }
  5350  func rewriteValuePPC64_OpPPC64CMPWUconst(v *Value) bool {
  5351  	v_0 := v.Args[0]
  5352  	// match: (CMPWUconst [d] (ANDconst z [c]))
  5353  	// cond: uint64(d) > uint64(c)
  5354  	// result: (FlagLT)
  5355  	for {
  5356  		d := auxIntToInt32(v.AuxInt)
  5357  		if v_0.Op != OpPPC64ANDconst {
  5358  			break
  5359  		}
  5360  		c := auxIntToInt64(v_0.AuxInt)
  5361  		if !(uint64(d) > uint64(c)) {
  5362  			break
  5363  		}
  5364  		v.reset(OpPPC64FlagLT)
  5365  		return true
  5366  	}
  5367  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5368  	// cond: int32(x)==int32(y)
  5369  	// result: (FlagEQ)
  5370  	for {
  5371  		y := auxIntToInt32(v.AuxInt)
  5372  		if v_0.Op != OpPPC64MOVDconst {
  5373  			break
  5374  		}
  5375  		x := auxIntToInt64(v_0.AuxInt)
  5376  		if !(int32(x) == int32(y)) {
  5377  			break
  5378  		}
  5379  		v.reset(OpPPC64FlagEQ)
  5380  		return true
  5381  	}
  5382  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5383  	// cond: uint32(x)<uint32(y)
  5384  	// result: (FlagLT)
  5385  	for {
  5386  		y := auxIntToInt32(v.AuxInt)
  5387  		if v_0.Op != OpPPC64MOVDconst {
  5388  			break
  5389  		}
  5390  		x := auxIntToInt64(v_0.AuxInt)
  5391  		if !(uint32(x) < uint32(y)) {
  5392  			break
  5393  		}
  5394  		v.reset(OpPPC64FlagLT)
  5395  		return true
  5396  	}
  5397  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5398  	// cond: uint32(x)>uint32(y)
  5399  	// result: (FlagGT)
  5400  	for {
  5401  		y := auxIntToInt32(v.AuxInt)
  5402  		if v_0.Op != OpPPC64MOVDconst {
  5403  			break
  5404  		}
  5405  		x := auxIntToInt64(v_0.AuxInt)
  5406  		if !(uint32(x) > uint32(y)) {
  5407  			break
  5408  		}
  5409  		v.reset(OpPPC64FlagGT)
  5410  		return true
  5411  	}
  5412  	// match: (CMPWUconst [0] a:(ANDconst [n] z))
  5413  	// result: (CMPconst [0] a)
  5414  	for {
  5415  		if auxIntToInt32(v.AuxInt) != 0 {
  5416  			break
  5417  		}
  5418  		a := v_0
  5419  		if a.Op != OpPPC64ANDconst {
  5420  			break
  5421  		}
  5422  		v.reset(OpPPC64CMPconst)
  5423  		v.AuxInt = int64ToAuxInt(0)
  5424  		v.AddArg(a)
  5425  		return true
  5426  	}
  5427  	return false
  5428  }
  5429  func rewriteValuePPC64_OpPPC64CMPWconst(v *Value) bool {
  5430  	v_0 := v.Args[0]
  5431  	// match: (CMPWconst (MOVDconst [x]) [y])
  5432  	// cond: int32(x)==int32(y)
  5433  	// result: (FlagEQ)
  5434  	for {
  5435  		y := auxIntToInt32(v.AuxInt)
  5436  		if v_0.Op != OpPPC64MOVDconst {
  5437  			break
  5438  		}
  5439  		x := auxIntToInt64(v_0.AuxInt)
  5440  		if !(int32(x) == int32(y)) {
  5441  			break
  5442  		}
  5443  		v.reset(OpPPC64FlagEQ)
  5444  		return true
  5445  	}
  5446  	// match: (CMPWconst (MOVDconst [x]) [y])
  5447  	// cond: int32(x)<int32(y)
  5448  	// result: (FlagLT)
  5449  	for {
  5450  		y := auxIntToInt32(v.AuxInt)
  5451  		if v_0.Op != OpPPC64MOVDconst {
  5452  			break
  5453  		}
  5454  		x := auxIntToInt64(v_0.AuxInt)
  5455  		if !(int32(x) < int32(y)) {
  5456  			break
  5457  		}
  5458  		v.reset(OpPPC64FlagLT)
  5459  		return true
  5460  	}
  5461  	// match: (CMPWconst (MOVDconst [x]) [y])
  5462  	// cond: int32(x)>int32(y)
  5463  	// result: (FlagGT)
  5464  	for {
  5465  		y := auxIntToInt32(v.AuxInt)
  5466  		if v_0.Op != OpPPC64MOVDconst {
  5467  			break
  5468  		}
  5469  		x := auxIntToInt64(v_0.AuxInt)
  5470  		if !(int32(x) > int32(y)) {
  5471  			break
  5472  		}
  5473  		v.reset(OpPPC64FlagGT)
  5474  		return true
  5475  	}
  5476  	// match: (CMPWconst [0] a:(ANDconst [n] z))
  5477  	// result: (CMPconst [0] a)
  5478  	for {
  5479  		if auxIntToInt32(v.AuxInt) != 0 {
  5480  			break
  5481  		}
  5482  		a := v_0
  5483  		if a.Op != OpPPC64ANDconst {
  5484  			break
  5485  		}
  5486  		v.reset(OpPPC64CMPconst)
  5487  		v.AuxInt = int64ToAuxInt(0)
  5488  		v.AddArg(a)
  5489  		return true
  5490  	}
  5491  	return false
  5492  }
  5493  func rewriteValuePPC64_OpPPC64CMPconst(v *Value) bool {
  5494  	v_0 := v.Args[0]
  5495  	// match: (CMPconst (MOVDconst [x]) [y])
  5496  	// cond: x==y
  5497  	// result: (FlagEQ)
  5498  	for {
  5499  		y := auxIntToInt64(v.AuxInt)
  5500  		if v_0.Op != OpPPC64MOVDconst {
  5501  			break
  5502  		}
  5503  		x := auxIntToInt64(v_0.AuxInt)
  5504  		if !(x == y) {
  5505  			break
  5506  		}
  5507  		v.reset(OpPPC64FlagEQ)
  5508  		return true
  5509  	}
  5510  	// match: (CMPconst (MOVDconst [x]) [y])
  5511  	// cond: x<y
  5512  	// result: (FlagLT)
  5513  	for {
  5514  		y := auxIntToInt64(v.AuxInt)
  5515  		if v_0.Op != OpPPC64MOVDconst {
  5516  			break
  5517  		}
  5518  		x := auxIntToInt64(v_0.AuxInt)
  5519  		if !(x < y) {
  5520  			break
  5521  		}
  5522  		v.reset(OpPPC64FlagLT)
  5523  		return true
  5524  	}
  5525  	// match: (CMPconst (MOVDconst [x]) [y])
  5526  	// cond: x>y
  5527  	// result: (FlagGT)
  5528  	for {
  5529  		y := auxIntToInt64(v.AuxInt)
  5530  		if v_0.Op != OpPPC64MOVDconst {
  5531  			break
  5532  		}
  5533  		x := auxIntToInt64(v_0.AuxInt)
  5534  		if !(x > y) {
  5535  			break
  5536  		}
  5537  		v.reset(OpPPC64FlagGT)
  5538  		return true
  5539  	}
  5540  	return false
  5541  }
  5542  func rewriteValuePPC64_OpPPC64Equal(v *Value) bool {
  5543  	v_0 := v.Args[0]
  5544  	// match: (Equal (FlagEQ))
  5545  	// result: (MOVDconst [1])
  5546  	for {
  5547  		if v_0.Op != OpPPC64FlagEQ {
  5548  			break
  5549  		}
  5550  		v.reset(OpPPC64MOVDconst)
  5551  		v.AuxInt = int64ToAuxInt(1)
  5552  		return true
  5553  	}
  5554  	// match: (Equal (FlagLT))
  5555  	// result: (MOVDconst [0])
  5556  	for {
  5557  		if v_0.Op != OpPPC64FlagLT {
  5558  			break
  5559  		}
  5560  		v.reset(OpPPC64MOVDconst)
  5561  		v.AuxInt = int64ToAuxInt(0)
  5562  		return true
  5563  	}
  5564  	// match: (Equal (FlagGT))
  5565  	// result: (MOVDconst [0])
  5566  	for {
  5567  		if v_0.Op != OpPPC64FlagGT {
  5568  			break
  5569  		}
  5570  		v.reset(OpPPC64MOVDconst)
  5571  		v.AuxInt = int64ToAuxInt(0)
  5572  		return true
  5573  	}
  5574  	// match: (Equal (InvertFlags x))
  5575  	// result: (Equal x)
  5576  	for {
  5577  		if v_0.Op != OpPPC64InvertFlags {
  5578  			break
  5579  		}
  5580  		x := v_0.Args[0]
  5581  		v.reset(OpPPC64Equal)
  5582  		v.AddArg(x)
  5583  		return true
  5584  	}
  5585  	// match: (Equal cmp)
  5586  	// result: (SETBC [2] cmp)
  5587  	for {
  5588  		cmp := v_0
  5589  		v.reset(OpPPC64SETBC)
  5590  		v.AuxInt = int32ToAuxInt(2)
  5591  		v.AddArg(cmp)
  5592  		return true
  5593  	}
  5594  }
  5595  func rewriteValuePPC64_OpPPC64FABS(v *Value) bool {
  5596  	v_0 := v.Args[0]
  5597  	// match: (FABS (FMOVDconst [x]))
  5598  	// result: (FMOVDconst [math.Abs(x)])
  5599  	for {
  5600  		if v_0.Op != OpPPC64FMOVDconst {
  5601  			break
  5602  		}
  5603  		x := auxIntToFloat64(v_0.AuxInt)
  5604  		v.reset(OpPPC64FMOVDconst)
  5605  		v.AuxInt = float64ToAuxInt(math.Abs(x))
  5606  		return true
  5607  	}
  5608  	return false
  5609  }
  5610  func rewriteValuePPC64_OpPPC64FADD(v *Value) bool {
  5611  	v_1 := v.Args[1]
  5612  	v_0 := v.Args[0]
  5613  	// match: (FADD (FMUL x y) z)
  5614  	// cond: x.Block.Func.useFMA(v)
  5615  	// result: (FMADD x y z)
  5616  	for {
  5617  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5618  			if v_0.Op != OpPPC64FMUL {
  5619  				continue
  5620  			}
  5621  			_ = v_0.Args[1]
  5622  			v_0_0 := v_0.Args[0]
  5623  			v_0_1 := v_0.Args[1]
  5624  			for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
  5625  				x := v_0_0
  5626  				y := v_0_1
  5627  				z := v_1
  5628  				if !(x.Block.Func.useFMA(v)) {
  5629  					continue
  5630  				}
  5631  				v.reset(OpPPC64FMADD)
  5632  				v.AddArg3(x, y, z)
  5633  				return true
  5634  			}
  5635  		}
  5636  		break
  5637  	}
  5638  	return false
  5639  }
  5640  func rewriteValuePPC64_OpPPC64FADDS(v *Value) bool {
  5641  	v_1 := v.Args[1]
  5642  	v_0 := v.Args[0]
  5643  	// match: (FADDS (FMULS x y) z)
  5644  	// cond: x.Block.Func.useFMA(v)
  5645  	// result: (FMADDS x y z)
  5646  	for {
  5647  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5648  			if v_0.Op != OpPPC64FMULS {
  5649  				continue
  5650  			}
  5651  			_ = v_0.Args[1]
  5652  			v_0_0 := v_0.Args[0]
  5653  			v_0_1 := v_0.Args[1]
  5654  			for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
  5655  				x := v_0_0
  5656  				y := v_0_1
  5657  				z := v_1
  5658  				if !(x.Block.Func.useFMA(v)) {
  5659  					continue
  5660  				}
  5661  				v.reset(OpPPC64FMADDS)
  5662  				v.AddArg3(x, y, z)
  5663  				return true
  5664  			}
  5665  		}
  5666  		break
  5667  	}
  5668  	return false
  5669  }
  5670  func rewriteValuePPC64_OpPPC64FCEIL(v *Value) bool {
  5671  	v_0 := v.Args[0]
  5672  	// match: (FCEIL (FMOVDconst [x]))
  5673  	// result: (FMOVDconst [math.Ceil(x)])
  5674  	for {
  5675  		if v_0.Op != OpPPC64FMOVDconst {
  5676  			break
  5677  		}
  5678  		x := auxIntToFloat64(v_0.AuxInt)
  5679  		v.reset(OpPPC64FMOVDconst)
  5680  		v.AuxInt = float64ToAuxInt(math.Ceil(x))
  5681  		return true
  5682  	}
  5683  	return false
  5684  }
  5685  func rewriteValuePPC64_OpPPC64FFLOOR(v *Value) bool {
  5686  	v_0 := v.Args[0]
  5687  	// match: (FFLOOR (FMOVDconst [x]))
  5688  	// result: (FMOVDconst [math.Floor(x)])
  5689  	for {
  5690  		if v_0.Op != OpPPC64FMOVDconst {
  5691  			break
  5692  		}
  5693  		x := auxIntToFloat64(v_0.AuxInt)
  5694  		v.reset(OpPPC64FMOVDconst)
  5695  		v.AuxInt = float64ToAuxInt(math.Floor(x))
  5696  		return true
  5697  	}
  5698  	return false
  5699  }
  5700  func rewriteValuePPC64_OpPPC64FGreaterEqual(v *Value) bool {
  5701  	v_0 := v.Args[0]
  5702  	b := v.Block
  5703  	typ := &b.Func.Config.Types
  5704  	// match: (FGreaterEqual cmp)
  5705  	// result: (OR (SETBC [2] cmp) (SETBC [1] cmp))
  5706  	for {
  5707  		cmp := v_0
  5708  		v.reset(OpPPC64OR)
  5709  		v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5710  		v0.AuxInt = int32ToAuxInt(2)
  5711  		v0.AddArg(cmp)
  5712  		v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5713  		v1.AuxInt = int32ToAuxInt(1)
  5714  		v1.AddArg(cmp)
  5715  		v.AddArg2(v0, v1)
  5716  		return true
  5717  	}
  5718  }
  5719  func rewriteValuePPC64_OpPPC64FGreaterThan(v *Value) bool {
  5720  	v_0 := v.Args[0]
  5721  	// match: (FGreaterThan cmp)
  5722  	// result: (SETBC [1] cmp)
  5723  	for {
  5724  		cmp := v_0
  5725  		v.reset(OpPPC64SETBC)
  5726  		v.AuxInt = int32ToAuxInt(1)
  5727  		v.AddArg(cmp)
  5728  		return true
  5729  	}
  5730  }
  5731  func rewriteValuePPC64_OpPPC64FLessEqual(v *Value) bool {
  5732  	v_0 := v.Args[0]
  5733  	b := v.Block
  5734  	typ := &b.Func.Config.Types
  5735  	// match: (FLessEqual cmp)
  5736  	// result: (OR (SETBC [2] cmp) (SETBC [0] cmp))
  5737  	for {
  5738  		cmp := v_0
  5739  		v.reset(OpPPC64OR)
  5740  		v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5741  		v0.AuxInt = int32ToAuxInt(2)
  5742  		v0.AddArg(cmp)
  5743  		v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5744  		v1.AuxInt = int32ToAuxInt(0)
  5745  		v1.AddArg(cmp)
  5746  		v.AddArg2(v0, v1)
  5747  		return true
  5748  	}
  5749  }
  5750  func rewriteValuePPC64_OpPPC64FLessThan(v *Value) bool {
  5751  	v_0 := v.Args[0]
  5752  	// match: (FLessThan cmp)
  5753  	// result: (SETBC [0] cmp)
  5754  	for {
  5755  		cmp := v_0
  5756  		v.reset(OpPPC64SETBC)
  5757  		v.AuxInt = int32ToAuxInt(0)
  5758  		v.AddArg(cmp)
  5759  		return true
  5760  	}
  5761  }
  5762  func rewriteValuePPC64_OpPPC64FMOVDload(v *Value) bool {
  5763  	v_1 := v.Args[1]
  5764  	v_0 := v.Args[0]
  5765  	// match: (FMOVDload [off] {sym} ptr (MOVDstore [off] {sym} ptr x _))
  5766  	// result: (MTVSRD x)
  5767  	for {
  5768  		off := auxIntToInt32(v.AuxInt)
  5769  		sym := auxToSym(v.Aux)
  5770  		ptr := v_0
  5771  		if v_1.Op != OpPPC64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5772  			break
  5773  		}
  5774  		x := v_1.Args[1]
  5775  		if ptr != v_1.Args[0] {
  5776  			break
  5777  		}
  5778  		v.reset(OpPPC64MTVSRD)
  5779  		v.AddArg(x)
  5780  		return true
  5781  	}
  5782  	// match: (FMOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  5783  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  5784  	// result: (FMOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  5785  	for {
  5786  		off1 := auxIntToInt32(v.AuxInt)
  5787  		sym1 := auxToSym(v.Aux)
  5788  		p := v_0
  5789  		if p.Op != OpPPC64MOVDaddr {
  5790  			break
  5791  		}
  5792  		off2 := auxIntToInt32(p.AuxInt)
  5793  		sym2 := auxToSym(p.Aux)
  5794  		ptr := p.Args[0]
  5795  		mem := v_1
  5796  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  5797  			break
  5798  		}
  5799  		v.reset(OpPPC64FMOVDload)
  5800  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5801  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5802  		v.AddArg2(ptr, mem)
  5803  		return true
  5804  	}
  5805  	// match: (FMOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
  5806  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  5807  	// result: (FMOVDload [off1+int32(off2)] {sym} ptr mem)
  5808  	for {
  5809  		off1 := auxIntToInt32(v.AuxInt)
  5810  		sym := auxToSym(v.Aux)
  5811  		if v_0.Op != OpPPC64ADDconst {
  5812  			break
  5813  		}
  5814  		off2 := auxIntToInt64(v_0.AuxInt)
  5815  		ptr := v_0.Args[0]
  5816  		mem := v_1
  5817  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  5818  			break
  5819  		}
  5820  		v.reset(OpPPC64FMOVDload)
  5821  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5822  		v.Aux = symToAux(sym)
  5823  		v.AddArg2(ptr, mem)
  5824  		return true
  5825  	}
  5826  	return false
  5827  }
  5828  func rewriteValuePPC64_OpPPC64FMOVDstore(v *Value) bool {
  5829  	v_2 := v.Args[2]
  5830  	v_1 := v.Args[1]
  5831  	v_0 := v.Args[0]
  5832  	// match: (FMOVDstore [off] {sym} ptr (MTVSRD x) mem)
  5833  	// result: (MOVDstore [off] {sym} ptr x mem)
  5834  	for {
  5835  		off := auxIntToInt32(v.AuxInt)
  5836  		sym := auxToSym(v.Aux)
  5837  		ptr := v_0
  5838  		if v_1.Op != OpPPC64MTVSRD {
  5839  			break
  5840  		}
  5841  		x := v_1.Args[0]
  5842  		mem := v_2
  5843  		v.reset(OpPPC64MOVDstore)
  5844  		v.AuxInt = int32ToAuxInt(off)
  5845  		v.Aux = symToAux(sym)
  5846  		v.AddArg3(ptr, x, mem)
  5847  		return true
  5848  	}
  5849  	// match: (FMOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  5850  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  5851  	// result: (FMOVDstore [off1+int32(off2)] {sym} ptr val mem)
  5852  	for {
  5853  		off1 := auxIntToInt32(v.AuxInt)
  5854  		sym := auxToSym(v.Aux)
  5855  		if v_0.Op != OpPPC64ADDconst {
  5856  			break
  5857  		}
  5858  		off2 := auxIntToInt64(v_0.AuxInt)
  5859  		ptr := v_0.Args[0]
  5860  		val := v_1
  5861  		mem := v_2
  5862  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  5863  			break
  5864  		}
  5865  		v.reset(OpPPC64FMOVDstore)
  5866  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5867  		v.Aux = symToAux(sym)
  5868  		v.AddArg3(ptr, val, mem)
  5869  		return true
  5870  	}
  5871  	// match: (FMOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  5872  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  5873  	// result: (FMOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  5874  	for {
  5875  		off1 := auxIntToInt32(v.AuxInt)
  5876  		sym1 := auxToSym(v.Aux)
  5877  		p := v_0
  5878  		if p.Op != OpPPC64MOVDaddr {
  5879  			break
  5880  		}
  5881  		off2 := auxIntToInt32(p.AuxInt)
  5882  		sym2 := auxToSym(p.Aux)
  5883  		ptr := p.Args[0]
  5884  		val := v_1
  5885  		mem := v_2
  5886  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  5887  			break
  5888  		}
  5889  		v.reset(OpPPC64FMOVDstore)
  5890  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5891  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5892  		v.AddArg3(ptr, val, mem)
  5893  		return true
  5894  	}
  5895  	return false
  5896  }
  5897  func rewriteValuePPC64_OpPPC64FMOVSload(v *Value) bool {
  5898  	v_1 := v.Args[1]
  5899  	v_0 := v.Args[0]
  5900  	// match: (FMOVSload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  5901  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  5902  	// result: (FMOVSload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  5903  	for {
  5904  		off1 := auxIntToInt32(v.AuxInt)
  5905  		sym1 := auxToSym(v.Aux)
  5906  		p := v_0
  5907  		if p.Op != OpPPC64MOVDaddr {
  5908  			break
  5909  		}
  5910  		off2 := auxIntToInt32(p.AuxInt)
  5911  		sym2 := auxToSym(p.Aux)
  5912  		ptr := p.Args[0]
  5913  		mem := v_1
  5914  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  5915  			break
  5916  		}
  5917  		v.reset(OpPPC64FMOVSload)
  5918  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5919  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5920  		v.AddArg2(ptr, mem)
  5921  		return true
  5922  	}
  5923  	// match: (FMOVSload [off1] {sym} (ADDconst [off2] ptr) mem)
  5924  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  5925  	// result: (FMOVSload [off1+int32(off2)] {sym} ptr mem)
  5926  	for {
  5927  		off1 := auxIntToInt32(v.AuxInt)
  5928  		sym := auxToSym(v.Aux)
  5929  		if v_0.Op != OpPPC64ADDconst {
  5930  			break
  5931  		}
  5932  		off2 := auxIntToInt64(v_0.AuxInt)
  5933  		ptr := v_0.Args[0]
  5934  		mem := v_1
  5935  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  5936  			break
  5937  		}
  5938  		v.reset(OpPPC64FMOVSload)
  5939  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5940  		v.Aux = symToAux(sym)
  5941  		v.AddArg2(ptr, mem)
  5942  		return true
  5943  	}
  5944  	return false
  5945  }
  5946  func rewriteValuePPC64_OpPPC64FMOVSstore(v *Value) bool {
  5947  	v_2 := v.Args[2]
  5948  	v_1 := v.Args[1]
  5949  	v_0 := v.Args[0]
  5950  	// match: (FMOVSstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  5951  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  5952  	// result: (FMOVSstore [off1+int32(off2)] {sym} ptr val mem)
  5953  	for {
  5954  		off1 := auxIntToInt32(v.AuxInt)
  5955  		sym := auxToSym(v.Aux)
  5956  		if v_0.Op != OpPPC64ADDconst {
  5957  			break
  5958  		}
  5959  		off2 := auxIntToInt64(v_0.AuxInt)
  5960  		ptr := v_0.Args[0]
  5961  		val := v_1
  5962  		mem := v_2
  5963  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  5964  			break
  5965  		}
  5966  		v.reset(OpPPC64FMOVSstore)
  5967  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5968  		v.Aux = symToAux(sym)
  5969  		v.AddArg3(ptr, val, mem)
  5970  		return true
  5971  	}
  5972  	// match: (FMOVSstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  5973  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  5974  	// result: (FMOVSstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  5975  	for {
  5976  		off1 := auxIntToInt32(v.AuxInt)
  5977  		sym1 := auxToSym(v.Aux)
  5978  		p := v_0
  5979  		if p.Op != OpPPC64MOVDaddr {
  5980  			break
  5981  		}
  5982  		off2 := auxIntToInt32(p.AuxInt)
  5983  		sym2 := auxToSym(p.Aux)
  5984  		ptr := p.Args[0]
  5985  		val := v_1
  5986  		mem := v_2
  5987  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  5988  			break
  5989  		}
  5990  		v.reset(OpPPC64FMOVSstore)
  5991  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5992  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5993  		v.AddArg3(ptr, val, mem)
  5994  		return true
  5995  	}
  5996  	return false
  5997  }
  5998  func rewriteValuePPC64_OpPPC64FNEG(v *Value) bool {
  5999  	v_0 := v.Args[0]
  6000  	// match: (FNEG (FABS x))
  6001  	// result: (FNABS x)
  6002  	for {
  6003  		if v_0.Op != OpPPC64FABS {
  6004  			break
  6005  		}
  6006  		x := v_0.Args[0]
  6007  		v.reset(OpPPC64FNABS)
  6008  		v.AddArg(x)
  6009  		return true
  6010  	}
  6011  	// match: (FNEG (FNABS x))
  6012  	// result: (FABS x)
  6013  	for {
  6014  		if v_0.Op != OpPPC64FNABS {
  6015  			break
  6016  		}
  6017  		x := v_0.Args[0]
  6018  		v.reset(OpPPC64FABS)
  6019  		v.AddArg(x)
  6020  		return true
  6021  	}
  6022  	return false
  6023  }
  6024  func rewriteValuePPC64_OpPPC64FSQRT(v *Value) bool {
  6025  	v_0 := v.Args[0]
  6026  	// match: (FSQRT (FMOVDconst [x]))
  6027  	// cond: x >= 0
  6028  	// result: (FMOVDconst [math.Sqrt(x)])
  6029  	for {
  6030  		if v_0.Op != OpPPC64FMOVDconst {
  6031  			break
  6032  		}
  6033  		x := auxIntToFloat64(v_0.AuxInt)
  6034  		if !(x >= 0) {
  6035  			break
  6036  		}
  6037  		v.reset(OpPPC64FMOVDconst)
  6038  		v.AuxInt = float64ToAuxInt(math.Sqrt(x))
  6039  		return true
  6040  	}
  6041  	return false
  6042  }
  6043  func rewriteValuePPC64_OpPPC64FSUB(v *Value) bool {
  6044  	v_1 := v.Args[1]
  6045  	v_0 := v.Args[0]
  6046  	// match: (FSUB (FMUL x y) z)
  6047  	// cond: x.Block.Func.useFMA(v)
  6048  	// result: (FMSUB x y z)
  6049  	for {
  6050  		if v_0.Op != OpPPC64FMUL {
  6051  			break
  6052  		}
  6053  		_ = v_0.Args[1]
  6054  		v_0_0 := v_0.Args[0]
  6055  		v_0_1 := v_0.Args[1]
  6056  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6057  			x := v_0_0
  6058  			y := v_0_1
  6059  			z := v_1
  6060  			if !(x.Block.Func.useFMA(v)) {
  6061  				continue
  6062  			}
  6063  			v.reset(OpPPC64FMSUB)
  6064  			v.AddArg3(x, y, z)
  6065  			return true
  6066  		}
  6067  		break
  6068  	}
  6069  	return false
  6070  }
  6071  func rewriteValuePPC64_OpPPC64FSUBS(v *Value) bool {
  6072  	v_1 := v.Args[1]
  6073  	v_0 := v.Args[0]
  6074  	// match: (FSUBS (FMULS x y) z)
  6075  	// cond: x.Block.Func.useFMA(v)
  6076  	// result: (FMSUBS x y z)
  6077  	for {
  6078  		if v_0.Op != OpPPC64FMULS {
  6079  			break
  6080  		}
  6081  		_ = v_0.Args[1]
  6082  		v_0_0 := v_0.Args[0]
  6083  		v_0_1 := v_0.Args[1]
  6084  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6085  			x := v_0_0
  6086  			y := v_0_1
  6087  			z := v_1
  6088  			if !(x.Block.Func.useFMA(v)) {
  6089  				continue
  6090  			}
  6091  			v.reset(OpPPC64FMSUBS)
  6092  			v.AddArg3(x, y, z)
  6093  			return true
  6094  		}
  6095  		break
  6096  	}
  6097  	return false
  6098  }
  6099  func rewriteValuePPC64_OpPPC64FTRUNC(v *Value) bool {
  6100  	v_0 := v.Args[0]
  6101  	// match: (FTRUNC (FMOVDconst [x]))
  6102  	// result: (FMOVDconst [math.Trunc(x)])
  6103  	for {
  6104  		if v_0.Op != OpPPC64FMOVDconst {
  6105  			break
  6106  		}
  6107  		x := auxIntToFloat64(v_0.AuxInt)
  6108  		v.reset(OpPPC64FMOVDconst)
  6109  		v.AuxInt = float64ToAuxInt(math.Trunc(x))
  6110  		return true
  6111  	}
  6112  	return false
  6113  }
  6114  func rewriteValuePPC64_OpPPC64GreaterEqual(v *Value) bool {
  6115  	v_0 := v.Args[0]
  6116  	// match: (GreaterEqual (FlagEQ))
  6117  	// result: (MOVDconst [1])
  6118  	for {
  6119  		if v_0.Op != OpPPC64FlagEQ {
  6120  			break
  6121  		}
  6122  		v.reset(OpPPC64MOVDconst)
  6123  		v.AuxInt = int64ToAuxInt(1)
  6124  		return true
  6125  	}
  6126  	// match: (GreaterEqual (FlagLT))
  6127  	// result: (MOVDconst [0])
  6128  	for {
  6129  		if v_0.Op != OpPPC64FlagLT {
  6130  			break
  6131  		}
  6132  		v.reset(OpPPC64MOVDconst)
  6133  		v.AuxInt = int64ToAuxInt(0)
  6134  		return true
  6135  	}
  6136  	// match: (GreaterEqual (FlagGT))
  6137  	// result: (MOVDconst [1])
  6138  	for {
  6139  		if v_0.Op != OpPPC64FlagGT {
  6140  			break
  6141  		}
  6142  		v.reset(OpPPC64MOVDconst)
  6143  		v.AuxInt = int64ToAuxInt(1)
  6144  		return true
  6145  	}
  6146  	// match: (GreaterEqual (InvertFlags x))
  6147  	// result: (LessEqual x)
  6148  	for {
  6149  		if v_0.Op != OpPPC64InvertFlags {
  6150  			break
  6151  		}
  6152  		x := v_0.Args[0]
  6153  		v.reset(OpPPC64LessEqual)
  6154  		v.AddArg(x)
  6155  		return true
  6156  	}
  6157  	// match: (GreaterEqual cmp)
  6158  	// result: (SETBCR [0] cmp)
  6159  	for {
  6160  		cmp := v_0
  6161  		v.reset(OpPPC64SETBCR)
  6162  		v.AuxInt = int32ToAuxInt(0)
  6163  		v.AddArg(cmp)
  6164  		return true
  6165  	}
  6166  }
  6167  func rewriteValuePPC64_OpPPC64GreaterThan(v *Value) bool {
  6168  	v_0 := v.Args[0]
  6169  	// match: (GreaterThan (FlagEQ))
  6170  	// result: (MOVDconst [0])
  6171  	for {
  6172  		if v_0.Op != OpPPC64FlagEQ {
  6173  			break
  6174  		}
  6175  		v.reset(OpPPC64MOVDconst)
  6176  		v.AuxInt = int64ToAuxInt(0)
  6177  		return true
  6178  	}
  6179  	// match: (GreaterThan (FlagLT))
  6180  	// result: (MOVDconst [0])
  6181  	for {
  6182  		if v_0.Op != OpPPC64FlagLT {
  6183  			break
  6184  		}
  6185  		v.reset(OpPPC64MOVDconst)
  6186  		v.AuxInt = int64ToAuxInt(0)
  6187  		return true
  6188  	}
  6189  	// match: (GreaterThan (FlagGT))
  6190  	// result: (MOVDconst [1])
  6191  	for {
  6192  		if v_0.Op != OpPPC64FlagGT {
  6193  			break
  6194  		}
  6195  		v.reset(OpPPC64MOVDconst)
  6196  		v.AuxInt = int64ToAuxInt(1)
  6197  		return true
  6198  	}
  6199  	// match: (GreaterThan (InvertFlags x))
  6200  	// result: (LessThan x)
  6201  	for {
  6202  		if v_0.Op != OpPPC64InvertFlags {
  6203  			break
  6204  		}
  6205  		x := v_0.Args[0]
  6206  		v.reset(OpPPC64LessThan)
  6207  		v.AddArg(x)
  6208  		return true
  6209  	}
  6210  	// match: (GreaterThan cmp)
  6211  	// result: (SETBC [1] cmp)
  6212  	for {
  6213  		cmp := v_0
  6214  		v.reset(OpPPC64SETBC)
  6215  		v.AuxInt = int32ToAuxInt(1)
  6216  		v.AddArg(cmp)
  6217  		return true
  6218  	}
  6219  }
  6220  func rewriteValuePPC64_OpPPC64ISEL(v *Value) bool {
  6221  	v_2 := v.Args[2]
  6222  	v_1 := v.Args[1]
  6223  	v_0 := v.Args[0]
  6224  	// match: (ISEL [6] x y (CMPconst [0] (ANDconst [1] (SETBC [c] cmp))))
  6225  	// result: (ISEL [c] x y cmp)
  6226  	for {
  6227  		if auxIntToInt32(v.AuxInt) != 6 {
  6228  			break
  6229  		}
  6230  		x := v_0
  6231  		y := v_1
  6232  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6233  			break
  6234  		}
  6235  		v_2_0 := v_2.Args[0]
  6236  		if v_2_0.Op != OpPPC64ANDconst || auxIntToInt64(v_2_0.AuxInt) != 1 {
  6237  			break
  6238  		}
  6239  		v_2_0_0 := v_2_0.Args[0]
  6240  		if v_2_0_0.Op != OpPPC64SETBC {
  6241  			break
  6242  		}
  6243  		c := auxIntToInt32(v_2_0_0.AuxInt)
  6244  		cmp := v_2_0_0.Args[0]
  6245  		v.reset(OpPPC64ISEL)
  6246  		v.AuxInt = int32ToAuxInt(c)
  6247  		v.AddArg3(x, y, cmp)
  6248  		return true
  6249  	}
  6250  	// match: (ISEL [6] x y (CMPconst [0] (SETBC [c] cmp)))
  6251  	// result: (ISEL [c] x y cmp)
  6252  	for {
  6253  		if auxIntToInt32(v.AuxInt) != 6 {
  6254  			break
  6255  		}
  6256  		x := v_0
  6257  		y := v_1
  6258  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6259  			break
  6260  		}
  6261  		v_2_0 := v_2.Args[0]
  6262  		if v_2_0.Op != OpPPC64SETBC {
  6263  			break
  6264  		}
  6265  		c := auxIntToInt32(v_2_0.AuxInt)
  6266  		cmp := v_2_0.Args[0]
  6267  		v.reset(OpPPC64ISEL)
  6268  		v.AuxInt = int32ToAuxInt(c)
  6269  		v.AddArg3(x, y, cmp)
  6270  		return true
  6271  	}
  6272  	// match: (ISEL [6] x y (CMPWconst [0] (SETBC [c] cmp)))
  6273  	// result: (ISEL [c] x y cmp)
  6274  	for {
  6275  		if auxIntToInt32(v.AuxInt) != 6 {
  6276  			break
  6277  		}
  6278  		x := v_0
  6279  		y := v_1
  6280  		if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  6281  			break
  6282  		}
  6283  		v_2_0 := v_2.Args[0]
  6284  		if v_2_0.Op != OpPPC64SETBC {
  6285  			break
  6286  		}
  6287  		c := auxIntToInt32(v_2_0.AuxInt)
  6288  		cmp := v_2_0.Args[0]
  6289  		v.reset(OpPPC64ISEL)
  6290  		v.AuxInt = int32ToAuxInt(c)
  6291  		v.AddArg3(x, y, cmp)
  6292  		return true
  6293  	}
  6294  	// match: (ISEL [6] x y (CMPconst [0] (SETBCR [c] cmp)))
  6295  	// result: (ISEL [c+4] x y cmp)
  6296  	for {
  6297  		if auxIntToInt32(v.AuxInt) != 6 {
  6298  			break
  6299  		}
  6300  		x := v_0
  6301  		y := v_1
  6302  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6303  			break
  6304  		}
  6305  		v_2_0 := v_2.Args[0]
  6306  		if v_2_0.Op != OpPPC64SETBCR {
  6307  			break
  6308  		}
  6309  		c := auxIntToInt32(v_2_0.AuxInt)
  6310  		cmp := v_2_0.Args[0]
  6311  		v.reset(OpPPC64ISEL)
  6312  		v.AuxInt = int32ToAuxInt(c + 4)
  6313  		v.AddArg3(x, y, cmp)
  6314  		return true
  6315  	}
  6316  	// match: (ISEL [6] x y (CMPWconst [0] (SETBCR [c] cmp)))
  6317  	// result: (ISEL [c+4] x y cmp)
  6318  	for {
  6319  		if auxIntToInt32(v.AuxInt) != 6 {
  6320  			break
  6321  		}
  6322  		x := v_0
  6323  		y := v_1
  6324  		if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  6325  			break
  6326  		}
  6327  		v_2_0 := v_2.Args[0]
  6328  		if v_2_0.Op != OpPPC64SETBCR {
  6329  			break
  6330  		}
  6331  		c := auxIntToInt32(v_2_0.AuxInt)
  6332  		cmp := v_2_0.Args[0]
  6333  		v.reset(OpPPC64ISEL)
  6334  		v.AuxInt = int32ToAuxInt(c + 4)
  6335  		v.AddArg3(x, y, cmp)
  6336  		return true
  6337  	}
  6338  	// match: (ISEL [2] x _ (FlagEQ))
  6339  	// result: x
  6340  	for {
  6341  		if auxIntToInt32(v.AuxInt) != 2 {
  6342  			break
  6343  		}
  6344  		x := v_0
  6345  		if v_2.Op != OpPPC64FlagEQ {
  6346  			break
  6347  		}
  6348  		v.copyOf(x)
  6349  		return true
  6350  	}
  6351  	// match: (ISEL [2] _ y (FlagLT))
  6352  	// result: y
  6353  	for {
  6354  		if auxIntToInt32(v.AuxInt) != 2 {
  6355  			break
  6356  		}
  6357  		y := v_1
  6358  		if v_2.Op != OpPPC64FlagLT {
  6359  			break
  6360  		}
  6361  		v.copyOf(y)
  6362  		return true
  6363  	}
  6364  	// match: (ISEL [2] _ y (FlagGT))
  6365  	// result: y
  6366  	for {
  6367  		if auxIntToInt32(v.AuxInt) != 2 {
  6368  			break
  6369  		}
  6370  		y := v_1
  6371  		if v_2.Op != OpPPC64FlagGT {
  6372  			break
  6373  		}
  6374  		v.copyOf(y)
  6375  		return true
  6376  	}
  6377  	// match: (ISEL [6] _ y (FlagEQ))
  6378  	// result: y
  6379  	for {
  6380  		if auxIntToInt32(v.AuxInt) != 6 {
  6381  			break
  6382  		}
  6383  		y := v_1
  6384  		if v_2.Op != OpPPC64FlagEQ {
  6385  			break
  6386  		}
  6387  		v.copyOf(y)
  6388  		return true
  6389  	}
  6390  	// match: (ISEL [6] x _ (FlagLT))
  6391  	// result: x
  6392  	for {
  6393  		if auxIntToInt32(v.AuxInt) != 6 {
  6394  			break
  6395  		}
  6396  		x := v_0
  6397  		if v_2.Op != OpPPC64FlagLT {
  6398  			break
  6399  		}
  6400  		v.copyOf(x)
  6401  		return true
  6402  	}
  6403  	// match: (ISEL [6] x _ (FlagGT))
  6404  	// result: x
  6405  	for {
  6406  		if auxIntToInt32(v.AuxInt) != 6 {
  6407  			break
  6408  		}
  6409  		x := v_0
  6410  		if v_2.Op != OpPPC64FlagGT {
  6411  			break
  6412  		}
  6413  		v.copyOf(x)
  6414  		return true
  6415  	}
  6416  	// match: (ISEL [0] _ y (FlagEQ))
  6417  	// result: y
  6418  	for {
  6419  		if auxIntToInt32(v.AuxInt) != 0 {
  6420  			break
  6421  		}
  6422  		y := v_1
  6423  		if v_2.Op != OpPPC64FlagEQ {
  6424  			break
  6425  		}
  6426  		v.copyOf(y)
  6427  		return true
  6428  	}
  6429  	// match: (ISEL [0] _ y (FlagGT))
  6430  	// result: y
  6431  	for {
  6432  		if auxIntToInt32(v.AuxInt) != 0 {
  6433  			break
  6434  		}
  6435  		y := v_1
  6436  		if v_2.Op != OpPPC64FlagGT {
  6437  			break
  6438  		}
  6439  		v.copyOf(y)
  6440  		return true
  6441  	}
  6442  	// match: (ISEL [0] x _ (FlagLT))
  6443  	// result: x
  6444  	for {
  6445  		if auxIntToInt32(v.AuxInt) != 0 {
  6446  			break
  6447  		}
  6448  		x := v_0
  6449  		if v_2.Op != OpPPC64FlagLT {
  6450  			break
  6451  		}
  6452  		v.copyOf(x)
  6453  		return true
  6454  	}
  6455  	// match: (ISEL [5] _ x (FlagEQ))
  6456  	// result: x
  6457  	for {
  6458  		if auxIntToInt32(v.AuxInt) != 5 {
  6459  			break
  6460  		}
  6461  		x := v_1
  6462  		if v_2.Op != OpPPC64FlagEQ {
  6463  			break
  6464  		}
  6465  		v.copyOf(x)
  6466  		return true
  6467  	}
  6468  	// match: (ISEL [5] _ x (FlagLT))
  6469  	// result: x
  6470  	for {
  6471  		if auxIntToInt32(v.AuxInt) != 5 {
  6472  			break
  6473  		}
  6474  		x := v_1
  6475  		if v_2.Op != OpPPC64FlagLT {
  6476  			break
  6477  		}
  6478  		v.copyOf(x)
  6479  		return true
  6480  	}
  6481  	// match: (ISEL [5] y _ (FlagGT))
  6482  	// result: y
  6483  	for {
  6484  		if auxIntToInt32(v.AuxInt) != 5 {
  6485  			break
  6486  		}
  6487  		y := v_0
  6488  		if v_2.Op != OpPPC64FlagGT {
  6489  			break
  6490  		}
  6491  		v.copyOf(y)
  6492  		return true
  6493  	}
  6494  	// match: (ISEL [1] _ y (FlagEQ))
  6495  	// result: y
  6496  	for {
  6497  		if auxIntToInt32(v.AuxInt) != 1 {
  6498  			break
  6499  		}
  6500  		y := v_1
  6501  		if v_2.Op != OpPPC64FlagEQ {
  6502  			break
  6503  		}
  6504  		v.copyOf(y)
  6505  		return true
  6506  	}
  6507  	// match: (ISEL [1] _ y (FlagLT))
  6508  	// result: y
  6509  	for {
  6510  		if auxIntToInt32(v.AuxInt) != 1 {
  6511  			break
  6512  		}
  6513  		y := v_1
  6514  		if v_2.Op != OpPPC64FlagLT {
  6515  			break
  6516  		}
  6517  		v.copyOf(y)
  6518  		return true
  6519  	}
  6520  	// match: (ISEL [1] x _ (FlagGT))
  6521  	// result: x
  6522  	for {
  6523  		if auxIntToInt32(v.AuxInt) != 1 {
  6524  			break
  6525  		}
  6526  		x := v_0
  6527  		if v_2.Op != OpPPC64FlagGT {
  6528  			break
  6529  		}
  6530  		v.copyOf(x)
  6531  		return true
  6532  	}
  6533  	// match: (ISEL [4] x _ (FlagEQ))
  6534  	// result: x
  6535  	for {
  6536  		if auxIntToInt32(v.AuxInt) != 4 {
  6537  			break
  6538  		}
  6539  		x := v_0
  6540  		if v_2.Op != OpPPC64FlagEQ {
  6541  			break
  6542  		}
  6543  		v.copyOf(x)
  6544  		return true
  6545  	}
  6546  	// match: (ISEL [4] x _ (FlagGT))
  6547  	// result: x
  6548  	for {
  6549  		if auxIntToInt32(v.AuxInt) != 4 {
  6550  			break
  6551  		}
  6552  		x := v_0
  6553  		if v_2.Op != OpPPC64FlagGT {
  6554  			break
  6555  		}
  6556  		v.copyOf(x)
  6557  		return true
  6558  	}
  6559  	// match: (ISEL [4] _ y (FlagLT))
  6560  	// result: y
  6561  	for {
  6562  		if auxIntToInt32(v.AuxInt) != 4 {
  6563  			break
  6564  		}
  6565  		y := v_1
  6566  		if v_2.Op != OpPPC64FlagLT {
  6567  			break
  6568  		}
  6569  		v.copyOf(y)
  6570  		return true
  6571  	}
  6572  	// match: (ISEL [n] x y (InvertFlags bool))
  6573  	// cond: n%4 == 0
  6574  	// result: (ISEL [n+1] x y bool)
  6575  	for {
  6576  		n := auxIntToInt32(v.AuxInt)
  6577  		x := v_0
  6578  		y := v_1
  6579  		if v_2.Op != OpPPC64InvertFlags {
  6580  			break
  6581  		}
  6582  		bool := v_2.Args[0]
  6583  		if !(n%4 == 0) {
  6584  			break
  6585  		}
  6586  		v.reset(OpPPC64ISEL)
  6587  		v.AuxInt = int32ToAuxInt(n + 1)
  6588  		v.AddArg3(x, y, bool)
  6589  		return true
  6590  	}
  6591  	// match: (ISEL [n] x y (InvertFlags bool))
  6592  	// cond: n%4 == 1
  6593  	// result: (ISEL [n-1] x y bool)
  6594  	for {
  6595  		n := auxIntToInt32(v.AuxInt)
  6596  		x := v_0
  6597  		y := v_1
  6598  		if v_2.Op != OpPPC64InvertFlags {
  6599  			break
  6600  		}
  6601  		bool := v_2.Args[0]
  6602  		if !(n%4 == 1) {
  6603  			break
  6604  		}
  6605  		v.reset(OpPPC64ISEL)
  6606  		v.AuxInt = int32ToAuxInt(n - 1)
  6607  		v.AddArg3(x, y, bool)
  6608  		return true
  6609  	}
  6610  	// match: (ISEL [n] x y (InvertFlags bool))
  6611  	// cond: n%4 == 2
  6612  	// result: (ISEL [n] x y bool)
  6613  	for {
  6614  		n := auxIntToInt32(v.AuxInt)
  6615  		x := v_0
  6616  		y := v_1
  6617  		if v_2.Op != OpPPC64InvertFlags {
  6618  			break
  6619  		}
  6620  		bool := v_2.Args[0]
  6621  		if !(n%4 == 2) {
  6622  			break
  6623  		}
  6624  		v.reset(OpPPC64ISEL)
  6625  		v.AuxInt = int32ToAuxInt(n)
  6626  		v.AddArg3(x, y, bool)
  6627  		return true
  6628  	}
  6629  	return false
  6630  }
  6631  func rewriteValuePPC64_OpPPC64LessEqual(v *Value) bool {
  6632  	v_0 := v.Args[0]
  6633  	// match: (LessEqual (FlagEQ))
  6634  	// result: (MOVDconst [1])
  6635  	for {
  6636  		if v_0.Op != OpPPC64FlagEQ {
  6637  			break
  6638  		}
  6639  		v.reset(OpPPC64MOVDconst)
  6640  		v.AuxInt = int64ToAuxInt(1)
  6641  		return true
  6642  	}
  6643  	// match: (LessEqual (FlagLT))
  6644  	// result: (MOVDconst [1])
  6645  	for {
  6646  		if v_0.Op != OpPPC64FlagLT {
  6647  			break
  6648  		}
  6649  		v.reset(OpPPC64MOVDconst)
  6650  		v.AuxInt = int64ToAuxInt(1)
  6651  		return true
  6652  	}
  6653  	// match: (LessEqual (FlagGT))
  6654  	// result: (MOVDconst [0])
  6655  	for {
  6656  		if v_0.Op != OpPPC64FlagGT {
  6657  			break
  6658  		}
  6659  		v.reset(OpPPC64MOVDconst)
  6660  		v.AuxInt = int64ToAuxInt(0)
  6661  		return true
  6662  	}
  6663  	// match: (LessEqual (InvertFlags x))
  6664  	// result: (GreaterEqual x)
  6665  	for {
  6666  		if v_0.Op != OpPPC64InvertFlags {
  6667  			break
  6668  		}
  6669  		x := v_0.Args[0]
  6670  		v.reset(OpPPC64GreaterEqual)
  6671  		v.AddArg(x)
  6672  		return true
  6673  	}
  6674  	// match: (LessEqual cmp)
  6675  	// result: (SETBCR [1] cmp)
  6676  	for {
  6677  		cmp := v_0
  6678  		v.reset(OpPPC64SETBCR)
  6679  		v.AuxInt = int32ToAuxInt(1)
  6680  		v.AddArg(cmp)
  6681  		return true
  6682  	}
  6683  }
  6684  func rewriteValuePPC64_OpPPC64LessThan(v *Value) bool {
  6685  	v_0 := v.Args[0]
  6686  	// match: (LessThan (FlagEQ))
  6687  	// result: (MOVDconst [0])
  6688  	for {
  6689  		if v_0.Op != OpPPC64FlagEQ {
  6690  			break
  6691  		}
  6692  		v.reset(OpPPC64MOVDconst)
  6693  		v.AuxInt = int64ToAuxInt(0)
  6694  		return true
  6695  	}
  6696  	// match: (LessThan (FlagLT))
  6697  	// result: (MOVDconst [1])
  6698  	for {
  6699  		if v_0.Op != OpPPC64FlagLT {
  6700  			break
  6701  		}
  6702  		v.reset(OpPPC64MOVDconst)
  6703  		v.AuxInt = int64ToAuxInt(1)
  6704  		return true
  6705  	}
  6706  	// match: (LessThan (FlagGT))
  6707  	// result: (MOVDconst [0])
  6708  	for {
  6709  		if v_0.Op != OpPPC64FlagGT {
  6710  			break
  6711  		}
  6712  		v.reset(OpPPC64MOVDconst)
  6713  		v.AuxInt = int64ToAuxInt(0)
  6714  		return true
  6715  	}
  6716  	// match: (LessThan (InvertFlags x))
  6717  	// result: (GreaterThan x)
  6718  	for {
  6719  		if v_0.Op != OpPPC64InvertFlags {
  6720  			break
  6721  		}
  6722  		x := v_0.Args[0]
  6723  		v.reset(OpPPC64GreaterThan)
  6724  		v.AddArg(x)
  6725  		return true
  6726  	}
  6727  	// match: (LessThan cmp)
  6728  	// result: (SETBC [0] cmp)
  6729  	for {
  6730  		cmp := v_0
  6731  		v.reset(OpPPC64SETBC)
  6732  		v.AuxInt = int32ToAuxInt(0)
  6733  		v.AddArg(cmp)
  6734  		return true
  6735  	}
  6736  }
  6737  func rewriteValuePPC64_OpPPC64MFVSRD(v *Value) bool {
  6738  	v_0 := v.Args[0]
  6739  	b := v.Block
  6740  	typ := &b.Func.Config.Types
  6741  	// match: (MFVSRD (FMOVDconst [c]))
  6742  	// result: (MOVDconst [int64(math.Float64bits(c))])
  6743  	for {
  6744  		if v_0.Op != OpPPC64FMOVDconst {
  6745  			break
  6746  		}
  6747  		c := auxIntToFloat64(v_0.AuxInt)
  6748  		v.reset(OpPPC64MOVDconst)
  6749  		v.AuxInt = int64ToAuxInt(int64(math.Float64bits(c)))
  6750  		return true
  6751  	}
  6752  	// match: (MFVSRD x:(FMOVDload [off] {sym} ptr mem))
  6753  	// cond: x.Uses == 1 && clobber(x)
  6754  	// result: @x.Block (MOVDload [off] {sym} ptr mem)
  6755  	for {
  6756  		x := v_0
  6757  		if x.Op != OpPPC64FMOVDload {
  6758  			break
  6759  		}
  6760  		off := auxIntToInt32(x.AuxInt)
  6761  		sym := auxToSym(x.Aux)
  6762  		mem := x.Args[1]
  6763  		ptr := x.Args[0]
  6764  		if !(x.Uses == 1 && clobber(x)) {
  6765  			break
  6766  		}
  6767  		b = x.Block
  6768  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDload, typ.Int64)
  6769  		v.copyOf(v0)
  6770  		v0.AuxInt = int32ToAuxInt(off)
  6771  		v0.Aux = symToAux(sym)
  6772  		v0.AddArg2(ptr, mem)
  6773  		return true
  6774  	}
  6775  	return false
  6776  }
  6777  func rewriteValuePPC64_OpPPC64MOVBZload(v *Value) bool {
  6778  	v_1 := v.Args[1]
  6779  	v_0 := v.Args[0]
  6780  	// match: (MOVBZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  6781  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  6782  	// result: (MOVBZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  6783  	for {
  6784  		off1 := auxIntToInt32(v.AuxInt)
  6785  		sym1 := auxToSym(v.Aux)
  6786  		p := v_0
  6787  		if p.Op != OpPPC64MOVDaddr {
  6788  			break
  6789  		}
  6790  		off2 := auxIntToInt32(p.AuxInt)
  6791  		sym2 := auxToSym(p.Aux)
  6792  		ptr := p.Args[0]
  6793  		mem := v_1
  6794  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  6795  			break
  6796  		}
  6797  		v.reset(OpPPC64MOVBZload)
  6798  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6799  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6800  		v.AddArg2(ptr, mem)
  6801  		return true
  6802  	}
  6803  	// match: (MOVBZload [off1] {sym} (ADDconst [off2] x) mem)
  6804  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  6805  	// result: (MOVBZload [off1+int32(off2)] {sym} x mem)
  6806  	for {
  6807  		off1 := auxIntToInt32(v.AuxInt)
  6808  		sym := auxToSym(v.Aux)
  6809  		if v_0.Op != OpPPC64ADDconst {
  6810  			break
  6811  		}
  6812  		off2 := auxIntToInt64(v_0.AuxInt)
  6813  		x := v_0.Args[0]
  6814  		mem := v_1
  6815  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  6816  			break
  6817  		}
  6818  		v.reset(OpPPC64MOVBZload)
  6819  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6820  		v.Aux = symToAux(sym)
  6821  		v.AddArg2(x, mem)
  6822  		return true
  6823  	}
  6824  	// match: (MOVBZload [0] {sym} p:(ADD ptr idx) mem)
  6825  	// cond: sym == nil && p.Uses == 1
  6826  	// result: (MOVBZloadidx ptr idx mem)
  6827  	for {
  6828  		if auxIntToInt32(v.AuxInt) != 0 {
  6829  			break
  6830  		}
  6831  		sym := auxToSym(v.Aux)
  6832  		p := v_0
  6833  		if p.Op != OpPPC64ADD {
  6834  			break
  6835  		}
  6836  		idx := p.Args[1]
  6837  		ptr := p.Args[0]
  6838  		mem := v_1
  6839  		if !(sym == nil && p.Uses == 1) {
  6840  			break
  6841  		}
  6842  		v.reset(OpPPC64MOVBZloadidx)
  6843  		v.AddArg3(ptr, idx, mem)
  6844  		return true
  6845  	}
  6846  	return false
  6847  }
  6848  func rewriteValuePPC64_OpPPC64MOVBZloadidx(v *Value) bool {
  6849  	v_2 := v.Args[2]
  6850  	v_1 := v.Args[1]
  6851  	v_0 := v.Args[0]
  6852  	// match: (MOVBZloadidx ptr (MOVDconst [c]) mem)
  6853  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  6854  	// result: (MOVBZload [int32(c)] ptr mem)
  6855  	for {
  6856  		ptr := v_0
  6857  		if v_1.Op != OpPPC64MOVDconst {
  6858  			break
  6859  		}
  6860  		c := auxIntToInt64(v_1.AuxInt)
  6861  		mem := v_2
  6862  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  6863  			break
  6864  		}
  6865  		v.reset(OpPPC64MOVBZload)
  6866  		v.AuxInt = int32ToAuxInt(int32(c))
  6867  		v.AddArg2(ptr, mem)
  6868  		return true
  6869  	}
  6870  	// match: (MOVBZloadidx (MOVDconst [c]) ptr mem)
  6871  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  6872  	// result: (MOVBZload [int32(c)] ptr mem)
  6873  	for {
  6874  		if v_0.Op != OpPPC64MOVDconst {
  6875  			break
  6876  		}
  6877  		c := auxIntToInt64(v_0.AuxInt)
  6878  		ptr := v_1
  6879  		mem := v_2
  6880  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  6881  			break
  6882  		}
  6883  		v.reset(OpPPC64MOVBZload)
  6884  		v.AuxInt = int32ToAuxInt(int32(c))
  6885  		v.AddArg2(ptr, mem)
  6886  		return true
  6887  	}
  6888  	return false
  6889  }
  6890  func rewriteValuePPC64_OpPPC64MOVBZreg(v *Value) bool {
  6891  	v_0 := v.Args[0]
  6892  	b := v.Block
  6893  	typ := &b.Func.Config.Types
  6894  	// match: (MOVBZreg y:(ANDconst [c] _))
  6895  	// cond: uint64(c) <= 0xFF
  6896  	// result: y
  6897  	for {
  6898  		y := v_0
  6899  		if y.Op != OpPPC64ANDconst {
  6900  			break
  6901  		}
  6902  		c := auxIntToInt64(y.AuxInt)
  6903  		if !(uint64(c) <= 0xFF) {
  6904  			break
  6905  		}
  6906  		v.copyOf(y)
  6907  		return true
  6908  	}
  6909  	// match: (MOVBZreg (SRWconst [c] (MOVBZreg x)))
  6910  	// result: (SRWconst [c] (MOVBZreg x))
  6911  	for {
  6912  		if v_0.Op != OpPPC64SRWconst {
  6913  			break
  6914  		}
  6915  		c := auxIntToInt64(v_0.AuxInt)
  6916  		v_0_0 := v_0.Args[0]
  6917  		if v_0_0.Op != OpPPC64MOVBZreg {
  6918  			break
  6919  		}
  6920  		x := v_0_0.Args[0]
  6921  		v.reset(OpPPC64SRWconst)
  6922  		v.AuxInt = int64ToAuxInt(c)
  6923  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  6924  		v0.AddArg(x)
  6925  		v.AddArg(v0)
  6926  		return true
  6927  	}
  6928  	// match: (MOVBZreg (SRWconst [c] x))
  6929  	// cond: x.Type.Size() == 8
  6930  	// result: (SRWconst [c] x)
  6931  	for {
  6932  		if v_0.Op != OpPPC64SRWconst {
  6933  			break
  6934  		}
  6935  		c := auxIntToInt64(v_0.AuxInt)
  6936  		x := v_0.Args[0]
  6937  		if !(x.Type.Size() == 8) {
  6938  			break
  6939  		}
  6940  		v.reset(OpPPC64SRWconst)
  6941  		v.AuxInt = int64ToAuxInt(c)
  6942  		v.AddArg(x)
  6943  		return true
  6944  	}
  6945  	// match: (MOVBZreg (SRDconst [c] x))
  6946  	// cond: c>=56
  6947  	// result: (SRDconst [c] x)
  6948  	for {
  6949  		if v_0.Op != OpPPC64SRDconst {
  6950  			break
  6951  		}
  6952  		c := auxIntToInt64(v_0.AuxInt)
  6953  		x := v_0.Args[0]
  6954  		if !(c >= 56) {
  6955  			break
  6956  		}
  6957  		v.reset(OpPPC64SRDconst)
  6958  		v.AuxInt = int64ToAuxInt(c)
  6959  		v.AddArg(x)
  6960  		return true
  6961  	}
  6962  	// match: (MOVBZreg (SRWconst [c] x))
  6963  	// cond: c>=24
  6964  	// result: (SRWconst [c] x)
  6965  	for {
  6966  		if v_0.Op != OpPPC64SRWconst {
  6967  			break
  6968  		}
  6969  		c := auxIntToInt64(v_0.AuxInt)
  6970  		x := v_0.Args[0]
  6971  		if !(c >= 24) {
  6972  			break
  6973  		}
  6974  		v.reset(OpPPC64SRWconst)
  6975  		v.AuxInt = int64ToAuxInt(c)
  6976  		v.AddArg(x)
  6977  		return true
  6978  	}
  6979  	// match: (MOVBZreg y:(MOVBZreg _))
  6980  	// result: y
  6981  	for {
  6982  		y := v_0
  6983  		if y.Op != OpPPC64MOVBZreg {
  6984  			break
  6985  		}
  6986  		v.copyOf(y)
  6987  		return true
  6988  	}
  6989  	// match: (MOVBZreg (MOVBreg x))
  6990  	// result: (MOVBZreg x)
  6991  	for {
  6992  		if v_0.Op != OpPPC64MOVBreg {
  6993  			break
  6994  		}
  6995  		x := v_0.Args[0]
  6996  		v.reset(OpPPC64MOVBZreg)
  6997  		v.AddArg(x)
  6998  		return true
  6999  	}
  7000  	// match: (MOVBZreg (SRWconst x [s]))
  7001  	// cond: mergePPC64AndSrwi(0xFF,s) != 0
  7002  	// result: (RLWINM [mergePPC64AndSrwi(0xFF,s)] x)
  7003  	for {
  7004  		if v_0.Op != OpPPC64SRWconst {
  7005  			break
  7006  		}
  7007  		s := auxIntToInt64(v_0.AuxInt)
  7008  		x := v_0.Args[0]
  7009  		if !(mergePPC64AndSrwi(0xFF, s) != 0) {
  7010  			break
  7011  		}
  7012  		v.reset(OpPPC64RLWINM)
  7013  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(0xFF, s))
  7014  		v.AddArg(x)
  7015  		return true
  7016  	}
  7017  	// match: (MOVBZreg (RLWINM [r] y))
  7018  	// cond: mergePPC64AndRlwinm(0xFF,r) != 0
  7019  	// result: (RLWINM [mergePPC64AndRlwinm(0xFF,r)] y)
  7020  	for {
  7021  		if v_0.Op != OpPPC64RLWINM {
  7022  			break
  7023  		}
  7024  		r := auxIntToInt64(v_0.AuxInt)
  7025  		y := v_0.Args[0]
  7026  		if !(mergePPC64AndRlwinm(0xFF, r) != 0) {
  7027  			break
  7028  		}
  7029  		v.reset(OpPPC64RLWINM)
  7030  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFF, r))
  7031  		v.AddArg(y)
  7032  		return true
  7033  	}
  7034  	// match: (MOVBZreg (OR <t> x (MOVWZreg y)))
  7035  	// result: (MOVBZreg (OR <t> x y))
  7036  	for {
  7037  		if v_0.Op != OpPPC64OR {
  7038  			break
  7039  		}
  7040  		t := v_0.Type
  7041  		_ = v_0.Args[1]
  7042  		v_0_0 := v_0.Args[0]
  7043  		v_0_1 := v_0.Args[1]
  7044  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7045  			x := v_0_0
  7046  			if v_0_1.Op != OpPPC64MOVWZreg {
  7047  				continue
  7048  			}
  7049  			y := v_0_1.Args[0]
  7050  			v.reset(OpPPC64MOVBZreg)
  7051  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  7052  			v0.AddArg2(x, y)
  7053  			v.AddArg(v0)
  7054  			return true
  7055  		}
  7056  		break
  7057  	}
  7058  	// match: (MOVBZreg (XOR <t> x (MOVWZreg y)))
  7059  	// result: (MOVBZreg (XOR <t> x y))
  7060  	for {
  7061  		if v_0.Op != OpPPC64XOR {
  7062  			break
  7063  		}
  7064  		t := v_0.Type
  7065  		_ = v_0.Args[1]
  7066  		v_0_0 := v_0.Args[0]
  7067  		v_0_1 := v_0.Args[1]
  7068  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7069  			x := v_0_0
  7070  			if v_0_1.Op != OpPPC64MOVWZreg {
  7071  				continue
  7072  			}
  7073  			y := v_0_1.Args[0]
  7074  			v.reset(OpPPC64MOVBZreg)
  7075  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  7076  			v0.AddArg2(x, y)
  7077  			v.AddArg(v0)
  7078  			return true
  7079  		}
  7080  		break
  7081  	}
  7082  	// match: (MOVBZreg (AND <t> x (MOVWZreg y)))
  7083  	// result: (MOVBZreg (AND <t> x y))
  7084  	for {
  7085  		if v_0.Op != OpPPC64AND {
  7086  			break
  7087  		}
  7088  		t := v_0.Type
  7089  		_ = v_0.Args[1]
  7090  		v_0_0 := v_0.Args[0]
  7091  		v_0_1 := v_0.Args[1]
  7092  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7093  			x := v_0_0
  7094  			if v_0_1.Op != OpPPC64MOVWZreg {
  7095  				continue
  7096  			}
  7097  			y := v_0_1.Args[0]
  7098  			v.reset(OpPPC64MOVBZreg)
  7099  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  7100  			v0.AddArg2(x, y)
  7101  			v.AddArg(v0)
  7102  			return true
  7103  		}
  7104  		break
  7105  	}
  7106  	// match: (MOVBZreg (OR <t> x (MOVHZreg y)))
  7107  	// result: (MOVBZreg (OR <t> x y))
  7108  	for {
  7109  		if v_0.Op != OpPPC64OR {
  7110  			break
  7111  		}
  7112  		t := v_0.Type
  7113  		_ = v_0.Args[1]
  7114  		v_0_0 := v_0.Args[0]
  7115  		v_0_1 := v_0.Args[1]
  7116  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7117  			x := v_0_0
  7118  			if v_0_1.Op != OpPPC64MOVHZreg {
  7119  				continue
  7120  			}
  7121  			y := v_0_1.Args[0]
  7122  			v.reset(OpPPC64MOVBZreg)
  7123  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  7124  			v0.AddArg2(x, y)
  7125  			v.AddArg(v0)
  7126  			return true
  7127  		}
  7128  		break
  7129  	}
  7130  	// match: (MOVBZreg (XOR <t> x (MOVHZreg y)))
  7131  	// result: (MOVBZreg (XOR <t> x y))
  7132  	for {
  7133  		if v_0.Op != OpPPC64XOR {
  7134  			break
  7135  		}
  7136  		t := v_0.Type
  7137  		_ = v_0.Args[1]
  7138  		v_0_0 := v_0.Args[0]
  7139  		v_0_1 := v_0.Args[1]
  7140  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7141  			x := v_0_0
  7142  			if v_0_1.Op != OpPPC64MOVHZreg {
  7143  				continue
  7144  			}
  7145  			y := v_0_1.Args[0]
  7146  			v.reset(OpPPC64MOVBZreg)
  7147  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  7148  			v0.AddArg2(x, y)
  7149  			v.AddArg(v0)
  7150  			return true
  7151  		}
  7152  		break
  7153  	}
  7154  	// match: (MOVBZreg (AND <t> x (MOVHZreg y)))
  7155  	// result: (MOVBZreg (AND <t> x y))
  7156  	for {
  7157  		if v_0.Op != OpPPC64AND {
  7158  			break
  7159  		}
  7160  		t := v_0.Type
  7161  		_ = v_0.Args[1]
  7162  		v_0_0 := v_0.Args[0]
  7163  		v_0_1 := v_0.Args[1]
  7164  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7165  			x := v_0_0
  7166  			if v_0_1.Op != OpPPC64MOVHZreg {
  7167  				continue
  7168  			}
  7169  			y := v_0_1.Args[0]
  7170  			v.reset(OpPPC64MOVBZreg)
  7171  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  7172  			v0.AddArg2(x, y)
  7173  			v.AddArg(v0)
  7174  			return true
  7175  		}
  7176  		break
  7177  	}
  7178  	// match: (MOVBZreg (OR <t> x (MOVBZreg y)))
  7179  	// result: (MOVBZreg (OR <t> x y))
  7180  	for {
  7181  		if v_0.Op != OpPPC64OR {
  7182  			break
  7183  		}
  7184  		t := v_0.Type
  7185  		_ = v_0.Args[1]
  7186  		v_0_0 := v_0.Args[0]
  7187  		v_0_1 := v_0.Args[1]
  7188  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7189  			x := v_0_0
  7190  			if v_0_1.Op != OpPPC64MOVBZreg {
  7191  				continue
  7192  			}
  7193  			y := v_0_1.Args[0]
  7194  			v.reset(OpPPC64MOVBZreg)
  7195  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  7196  			v0.AddArg2(x, y)
  7197  			v.AddArg(v0)
  7198  			return true
  7199  		}
  7200  		break
  7201  	}
  7202  	// match: (MOVBZreg (XOR <t> x (MOVBZreg y)))
  7203  	// result: (MOVBZreg (XOR <t> x y))
  7204  	for {
  7205  		if v_0.Op != OpPPC64XOR {
  7206  			break
  7207  		}
  7208  		t := v_0.Type
  7209  		_ = v_0.Args[1]
  7210  		v_0_0 := v_0.Args[0]
  7211  		v_0_1 := v_0.Args[1]
  7212  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7213  			x := v_0_0
  7214  			if v_0_1.Op != OpPPC64MOVBZreg {
  7215  				continue
  7216  			}
  7217  			y := v_0_1.Args[0]
  7218  			v.reset(OpPPC64MOVBZreg)
  7219  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  7220  			v0.AddArg2(x, y)
  7221  			v.AddArg(v0)
  7222  			return true
  7223  		}
  7224  		break
  7225  	}
  7226  	// match: (MOVBZreg (AND <t> x (MOVBZreg y)))
  7227  	// result: (MOVBZreg (AND <t> x y))
  7228  	for {
  7229  		if v_0.Op != OpPPC64AND {
  7230  			break
  7231  		}
  7232  		t := v_0.Type
  7233  		_ = v_0.Args[1]
  7234  		v_0_0 := v_0.Args[0]
  7235  		v_0_1 := v_0.Args[1]
  7236  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7237  			x := v_0_0
  7238  			if v_0_1.Op != OpPPC64MOVBZreg {
  7239  				continue
  7240  			}
  7241  			y := v_0_1.Args[0]
  7242  			v.reset(OpPPC64MOVBZreg)
  7243  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  7244  			v0.AddArg2(x, y)
  7245  			v.AddArg(v0)
  7246  			return true
  7247  		}
  7248  		break
  7249  	}
  7250  	// match: (MOVBZreg z:(ANDconst [c] (MOVBZload ptr x)))
  7251  	// result: z
  7252  	for {
  7253  		z := v_0
  7254  		if z.Op != OpPPC64ANDconst {
  7255  			break
  7256  		}
  7257  		z_0 := z.Args[0]
  7258  		if z_0.Op != OpPPC64MOVBZload {
  7259  			break
  7260  		}
  7261  		v.copyOf(z)
  7262  		return true
  7263  	}
  7264  	// match: (MOVBZreg z:(AND y (MOVBZload ptr x)))
  7265  	// result: z
  7266  	for {
  7267  		z := v_0
  7268  		if z.Op != OpPPC64AND {
  7269  			break
  7270  		}
  7271  		_ = z.Args[1]
  7272  		z_0 := z.Args[0]
  7273  		z_1 := z.Args[1]
  7274  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
  7275  			if z_1.Op != OpPPC64MOVBZload {
  7276  				continue
  7277  			}
  7278  			v.copyOf(z)
  7279  			return true
  7280  		}
  7281  		break
  7282  	}
  7283  	// match: (MOVBZreg x:(MOVBZload _ _))
  7284  	// result: x
  7285  	for {
  7286  		x := v_0
  7287  		if x.Op != OpPPC64MOVBZload {
  7288  			break
  7289  		}
  7290  		v.copyOf(x)
  7291  		return true
  7292  	}
  7293  	// match: (MOVBZreg x:(MOVBZloadidx _ _ _))
  7294  	// result: x
  7295  	for {
  7296  		x := v_0
  7297  		if x.Op != OpPPC64MOVBZloadidx {
  7298  			break
  7299  		}
  7300  		v.copyOf(x)
  7301  		return true
  7302  	}
  7303  	// match: (MOVBZreg x:(Select0 (LoweredAtomicLoad8 _ _)))
  7304  	// result: x
  7305  	for {
  7306  		x := v_0
  7307  		if x.Op != OpSelect0 {
  7308  			break
  7309  		}
  7310  		x_0 := x.Args[0]
  7311  		if x_0.Op != OpPPC64LoweredAtomicLoad8 {
  7312  			break
  7313  		}
  7314  		v.copyOf(x)
  7315  		return true
  7316  	}
  7317  	// match: (MOVBZreg x:(Arg <t>))
  7318  	// cond: is8BitInt(t) && !t.IsSigned()
  7319  	// result: x
  7320  	for {
  7321  		x := v_0
  7322  		if x.Op != OpArg {
  7323  			break
  7324  		}
  7325  		t := x.Type
  7326  		if !(is8BitInt(t) && !t.IsSigned()) {
  7327  			break
  7328  		}
  7329  		v.copyOf(x)
  7330  		return true
  7331  	}
  7332  	// match: (MOVBZreg (MOVDconst [c]))
  7333  	// result: (MOVDconst [int64(uint8(c))])
  7334  	for {
  7335  		if v_0.Op != OpPPC64MOVDconst {
  7336  			break
  7337  		}
  7338  		c := auxIntToInt64(v_0.AuxInt)
  7339  		v.reset(OpPPC64MOVDconst)
  7340  		v.AuxInt = int64ToAuxInt(int64(uint8(c)))
  7341  		return true
  7342  	}
  7343  	return false
  7344  }
  7345  func rewriteValuePPC64_OpPPC64MOVBreg(v *Value) bool {
  7346  	v_0 := v.Args[0]
  7347  	b := v.Block
  7348  	typ := &b.Func.Config.Types
  7349  	// match: (MOVBreg y:(ANDconst [c] _))
  7350  	// cond: uint64(c) <= 0x7F
  7351  	// result: y
  7352  	for {
  7353  		y := v_0
  7354  		if y.Op != OpPPC64ANDconst {
  7355  			break
  7356  		}
  7357  		c := auxIntToInt64(y.AuxInt)
  7358  		if !(uint64(c) <= 0x7F) {
  7359  			break
  7360  		}
  7361  		v.copyOf(y)
  7362  		return true
  7363  	}
  7364  	// match: (MOVBreg (SRAWconst [c] (MOVBreg x)))
  7365  	// result: (SRAWconst [c] (MOVBreg x))
  7366  	for {
  7367  		if v_0.Op != OpPPC64SRAWconst {
  7368  			break
  7369  		}
  7370  		c := auxIntToInt64(v_0.AuxInt)
  7371  		v_0_0 := v_0.Args[0]
  7372  		if v_0_0.Op != OpPPC64MOVBreg {
  7373  			break
  7374  		}
  7375  		x := v_0_0.Args[0]
  7376  		v.reset(OpPPC64SRAWconst)
  7377  		v.AuxInt = int64ToAuxInt(c)
  7378  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
  7379  		v0.AddArg(x)
  7380  		v.AddArg(v0)
  7381  		return true
  7382  	}
  7383  	// match: (MOVBreg (SRAWconst [c] x))
  7384  	// cond: x.Type.Size() == 8
  7385  	// result: (SRAWconst [c] x)
  7386  	for {
  7387  		if v_0.Op != OpPPC64SRAWconst {
  7388  			break
  7389  		}
  7390  		c := auxIntToInt64(v_0.AuxInt)
  7391  		x := v_0.Args[0]
  7392  		if !(x.Type.Size() == 8) {
  7393  			break
  7394  		}
  7395  		v.reset(OpPPC64SRAWconst)
  7396  		v.AuxInt = int64ToAuxInt(c)
  7397  		v.AddArg(x)
  7398  		return true
  7399  	}
  7400  	// match: (MOVBreg (SRDconst [c] x))
  7401  	// cond: c>56
  7402  	// result: (SRDconst [c] x)
  7403  	for {
  7404  		if v_0.Op != OpPPC64SRDconst {
  7405  			break
  7406  		}
  7407  		c := auxIntToInt64(v_0.AuxInt)
  7408  		x := v_0.Args[0]
  7409  		if !(c > 56) {
  7410  			break
  7411  		}
  7412  		v.reset(OpPPC64SRDconst)
  7413  		v.AuxInt = int64ToAuxInt(c)
  7414  		v.AddArg(x)
  7415  		return true
  7416  	}
  7417  	// match: (MOVBreg (SRDconst [c] x))
  7418  	// cond: c==56
  7419  	// result: (SRADconst [c] x)
  7420  	for {
  7421  		if v_0.Op != OpPPC64SRDconst {
  7422  			break
  7423  		}
  7424  		c := auxIntToInt64(v_0.AuxInt)
  7425  		x := v_0.Args[0]
  7426  		if !(c == 56) {
  7427  			break
  7428  		}
  7429  		v.reset(OpPPC64SRADconst)
  7430  		v.AuxInt = int64ToAuxInt(c)
  7431  		v.AddArg(x)
  7432  		return true
  7433  	}
  7434  	// match: (MOVBreg (SRADconst [c] x))
  7435  	// cond: c>=56
  7436  	// result: (SRADconst [c] x)
  7437  	for {
  7438  		if v_0.Op != OpPPC64SRADconst {
  7439  			break
  7440  		}
  7441  		c := auxIntToInt64(v_0.AuxInt)
  7442  		x := v_0.Args[0]
  7443  		if !(c >= 56) {
  7444  			break
  7445  		}
  7446  		v.reset(OpPPC64SRADconst)
  7447  		v.AuxInt = int64ToAuxInt(c)
  7448  		v.AddArg(x)
  7449  		return true
  7450  	}
  7451  	// match: (MOVBreg (SRWconst [c] x))
  7452  	// cond: c>24
  7453  	// result: (SRWconst [c] x)
  7454  	for {
  7455  		if v_0.Op != OpPPC64SRWconst {
  7456  			break
  7457  		}
  7458  		c := auxIntToInt64(v_0.AuxInt)
  7459  		x := v_0.Args[0]
  7460  		if !(c > 24) {
  7461  			break
  7462  		}
  7463  		v.reset(OpPPC64SRWconst)
  7464  		v.AuxInt = int64ToAuxInt(c)
  7465  		v.AddArg(x)
  7466  		return true
  7467  	}
  7468  	// match: (MOVBreg (SRWconst [c] x))
  7469  	// cond: c==24
  7470  	// result: (SRAWconst [c] x)
  7471  	for {
  7472  		if v_0.Op != OpPPC64SRWconst {
  7473  			break
  7474  		}
  7475  		c := auxIntToInt64(v_0.AuxInt)
  7476  		x := v_0.Args[0]
  7477  		if !(c == 24) {
  7478  			break
  7479  		}
  7480  		v.reset(OpPPC64SRAWconst)
  7481  		v.AuxInt = int64ToAuxInt(c)
  7482  		v.AddArg(x)
  7483  		return true
  7484  	}
  7485  	// match: (MOVBreg (SRAWconst [c] x))
  7486  	// cond: c>=24
  7487  	// result: (SRAWconst [c] x)
  7488  	for {
  7489  		if v_0.Op != OpPPC64SRAWconst {
  7490  			break
  7491  		}
  7492  		c := auxIntToInt64(v_0.AuxInt)
  7493  		x := v_0.Args[0]
  7494  		if !(c >= 24) {
  7495  			break
  7496  		}
  7497  		v.reset(OpPPC64SRAWconst)
  7498  		v.AuxInt = int64ToAuxInt(c)
  7499  		v.AddArg(x)
  7500  		return true
  7501  	}
  7502  	// match: (MOVBreg y:(MOVBreg _))
  7503  	// result: y
  7504  	for {
  7505  		y := v_0
  7506  		if y.Op != OpPPC64MOVBreg {
  7507  			break
  7508  		}
  7509  		v.copyOf(y)
  7510  		return true
  7511  	}
  7512  	// match: (MOVBreg (MOVBZreg x))
  7513  	// result: (MOVBreg x)
  7514  	for {
  7515  		if v_0.Op != OpPPC64MOVBZreg {
  7516  			break
  7517  		}
  7518  		x := v_0.Args[0]
  7519  		v.reset(OpPPC64MOVBreg)
  7520  		v.AddArg(x)
  7521  		return true
  7522  	}
  7523  	// match: (MOVBreg x:(Arg <t>))
  7524  	// cond: is8BitInt(t) && t.IsSigned()
  7525  	// result: x
  7526  	for {
  7527  		x := v_0
  7528  		if x.Op != OpArg {
  7529  			break
  7530  		}
  7531  		t := x.Type
  7532  		if !(is8BitInt(t) && t.IsSigned()) {
  7533  			break
  7534  		}
  7535  		v.copyOf(x)
  7536  		return true
  7537  	}
  7538  	// match: (MOVBreg (MOVDconst [c]))
  7539  	// result: (MOVDconst [int64(int8(c))])
  7540  	for {
  7541  		if v_0.Op != OpPPC64MOVDconst {
  7542  			break
  7543  		}
  7544  		c := auxIntToInt64(v_0.AuxInt)
  7545  		v.reset(OpPPC64MOVDconst)
  7546  		v.AuxInt = int64ToAuxInt(int64(int8(c)))
  7547  		return true
  7548  	}
  7549  	return false
  7550  }
  7551  func rewriteValuePPC64_OpPPC64MOVBstore(v *Value) bool {
  7552  	v_2 := v.Args[2]
  7553  	v_1 := v.Args[1]
  7554  	v_0 := v.Args[0]
  7555  	b := v.Block
  7556  	typ := &b.Func.Config.Types
  7557  	// match: (MOVBstore [off1] {sym} (ADDconst [off2] x) val mem)
  7558  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  7559  	// result: (MOVBstore [off1+int32(off2)] {sym} x val mem)
  7560  	for {
  7561  		off1 := auxIntToInt32(v.AuxInt)
  7562  		sym := auxToSym(v.Aux)
  7563  		if v_0.Op != OpPPC64ADDconst {
  7564  			break
  7565  		}
  7566  		off2 := auxIntToInt64(v_0.AuxInt)
  7567  		x := v_0.Args[0]
  7568  		val := v_1
  7569  		mem := v_2
  7570  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  7571  			break
  7572  		}
  7573  		v.reset(OpPPC64MOVBstore)
  7574  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  7575  		v.Aux = symToAux(sym)
  7576  		v.AddArg3(x, val, mem)
  7577  		return true
  7578  	}
  7579  	// match: (MOVBstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  7580  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  7581  	// result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  7582  	for {
  7583  		off1 := auxIntToInt32(v.AuxInt)
  7584  		sym1 := auxToSym(v.Aux)
  7585  		p := v_0
  7586  		if p.Op != OpPPC64MOVDaddr {
  7587  			break
  7588  		}
  7589  		off2 := auxIntToInt32(p.AuxInt)
  7590  		sym2 := auxToSym(p.Aux)
  7591  		ptr := p.Args[0]
  7592  		val := v_1
  7593  		mem := v_2
  7594  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  7595  			break
  7596  		}
  7597  		v.reset(OpPPC64MOVBstore)
  7598  		v.AuxInt = int32ToAuxInt(off1 + off2)
  7599  		v.Aux = symToAux(mergeSym(sym1, sym2))
  7600  		v.AddArg3(ptr, val, mem)
  7601  		return true
  7602  	}
  7603  	// match: (MOVBstore [off] {sym} ptr (MOVDconst [0]) mem)
  7604  	// result: (MOVBstorezero [off] {sym} ptr mem)
  7605  	for {
  7606  		off := auxIntToInt32(v.AuxInt)
  7607  		sym := auxToSym(v.Aux)
  7608  		ptr := v_0
  7609  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  7610  			break
  7611  		}
  7612  		mem := v_2
  7613  		v.reset(OpPPC64MOVBstorezero)
  7614  		v.AuxInt = int32ToAuxInt(off)
  7615  		v.Aux = symToAux(sym)
  7616  		v.AddArg2(ptr, mem)
  7617  		return true
  7618  	}
  7619  	// match: (MOVBstore [0] {sym} p:(ADD ptr idx) val mem)
  7620  	// cond: sym == nil && p.Uses == 1
  7621  	// result: (MOVBstoreidx ptr idx val mem)
  7622  	for {
  7623  		if auxIntToInt32(v.AuxInt) != 0 {
  7624  			break
  7625  		}
  7626  		sym := auxToSym(v.Aux)
  7627  		p := v_0
  7628  		if p.Op != OpPPC64ADD {
  7629  			break
  7630  		}
  7631  		idx := p.Args[1]
  7632  		ptr := p.Args[0]
  7633  		val := v_1
  7634  		mem := v_2
  7635  		if !(sym == nil && p.Uses == 1) {
  7636  			break
  7637  		}
  7638  		v.reset(OpPPC64MOVBstoreidx)
  7639  		v.AddArg4(ptr, idx, val, mem)
  7640  		return true
  7641  	}
  7642  	// match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
  7643  	// result: (MOVBstore [off] {sym} ptr x mem)
  7644  	for {
  7645  		off := auxIntToInt32(v.AuxInt)
  7646  		sym := auxToSym(v.Aux)
  7647  		ptr := v_0
  7648  		if v_1.Op != OpPPC64MOVBreg {
  7649  			break
  7650  		}
  7651  		x := v_1.Args[0]
  7652  		mem := v_2
  7653  		v.reset(OpPPC64MOVBstore)
  7654  		v.AuxInt = int32ToAuxInt(off)
  7655  		v.Aux = symToAux(sym)
  7656  		v.AddArg3(ptr, x, mem)
  7657  		return true
  7658  	}
  7659  	// match: (MOVBstore [off] {sym} ptr (MOVBZreg x) mem)
  7660  	// result: (MOVBstore [off] {sym} ptr x mem)
  7661  	for {
  7662  		off := auxIntToInt32(v.AuxInt)
  7663  		sym := auxToSym(v.Aux)
  7664  		ptr := v_0
  7665  		if v_1.Op != OpPPC64MOVBZreg {
  7666  			break
  7667  		}
  7668  		x := v_1.Args[0]
  7669  		mem := v_2
  7670  		v.reset(OpPPC64MOVBstore)
  7671  		v.AuxInt = int32ToAuxInt(off)
  7672  		v.Aux = symToAux(sym)
  7673  		v.AddArg3(ptr, x, mem)
  7674  		return true
  7675  	}
  7676  	// match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
  7677  	// result: (MOVBstore [off] {sym} ptr x mem)
  7678  	for {
  7679  		off := auxIntToInt32(v.AuxInt)
  7680  		sym := auxToSym(v.Aux)
  7681  		ptr := v_0
  7682  		if v_1.Op != OpPPC64MOVHreg {
  7683  			break
  7684  		}
  7685  		x := v_1.Args[0]
  7686  		mem := v_2
  7687  		v.reset(OpPPC64MOVBstore)
  7688  		v.AuxInt = int32ToAuxInt(off)
  7689  		v.Aux = symToAux(sym)
  7690  		v.AddArg3(ptr, x, mem)
  7691  		return true
  7692  	}
  7693  	// match: (MOVBstore [off] {sym} ptr (MOVHZreg x) mem)
  7694  	// result: (MOVBstore [off] {sym} ptr x mem)
  7695  	for {
  7696  		off := auxIntToInt32(v.AuxInt)
  7697  		sym := auxToSym(v.Aux)
  7698  		ptr := v_0
  7699  		if v_1.Op != OpPPC64MOVHZreg {
  7700  			break
  7701  		}
  7702  		x := v_1.Args[0]
  7703  		mem := v_2
  7704  		v.reset(OpPPC64MOVBstore)
  7705  		v.AuxInt = int32ToAuxInt(off)
  7706  		v.Aux = symToAux(sym)
  7707  		v.AddArg3(ptr, x, mem)
  7708  		return true
  7709  	}
  7710  	// match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
  7711  	// result: (MOVBstore [off] {sym} ptr x mem)
  7712  	for {
  7713  		off := auxIntToInt32(v.AuxInt)
  7714  		sym := auxToSym(v.Aux)
  7715  		ptr := v_0
  7716  		if v_1.Op != OpPPC64MOVWreg {
  7717  			break
  7718  		}
  7719  		x := v_1.Args[0]
  7720  		mem := v_2
  7721  		v.reset(OpPPC64MOVBstore)
  7722  		v.AuxInt = int32ToAuxInt(off)
  7723  		v.Aux = symToAux(sym)
  7724  		v.AddArg3(ptr, x, mem)
  7725  		return true
  7726  	}
  7727  	// match: (MOVBstore [off] {sym} ptr (MOVWZreg x) mem)
  7728  	// result: (MOVBstore [off] {sym} ptr x mem)
  7729  	for {
  7730  		off := auxIntToInt32(v.AuxInt)
  7731  		sym := auxToSym(v.Aux)
  7732  		ptr := v_0
  7733  		if v_1.Op != OpPPC64MOVWZreg {
  7734  			break
  7735  		}
  7736  		x := v_1.Args[0]
  7737  		mem := v_2
  7738  		v.reset(OpPPC64MOVBstore)
  7739  		v.AuxInt = int32ToAuxInt(off)
  7740  		v.Aux = symToAux(sym)
  7741  		v.AddArg3(ptr, x, mem)
  7742  		return true
  7743  	}
  7744  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHreg x) [c]) mem)
  7745  	// cond: c <= 8
  7746  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7747  	for {
  7748  		off := auxIntToInt32(v.AuxInt)
  7749  		sym := auxToSym(v.Aux)
  7750  		ptr := v_0
  7751  		if v_1.Op != OpPPC64SRWconst {
  7752  			break
  7753  		}
  7754  		c := auxIntToInt64(v_1.AuxInt)
  7755  		v_1_0 := v_1.Args[0]
  7756  		if v_1_0.Op != OpPPC64MOVHreg {
  7757  			break
  7758  		}
  7759  		x := v_1_0.Args[0]
  7760  		mem := v_2
  7761  		if !(c <= 8) {
  7762  			break
  7763  		}
  7764  		v.reset(OpPPC64MOVBstore)
  7765  		v.AuxInt = int32ToAuxInt(off)
  7766  		v.Aux = symToAux(sym)
  7767  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7768  		v0.AuxInt = int64ToAuxInt(c)
  7769  		v0.AddArg(x)
  7770  		v.AddArg3(ptr, v0, mem)
  7771  		return true
  7772  	}
  7773  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHZreg x) [c]) mem)
  7774  	// cond: c <= 8
  7775  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7776  	for {
  7777  		off := auxIntToInt32(v.AuxInt)
  7778  		sym := auxToSym(v.Aux)
  7779  		ptr := v_0
  7780  		if v_1.Op != OpPPC64SRWconst {
  7781  			break
  7782  		}
  7783  		c := auxIntToInt64(v_1.AuxInt)
  7784  		v_1_0 := v_1.Args[0]
  7785  		if v_1_0.Op != OpPPC64MOVHZreg {
  7786  			break
  7787  		}
  7788  		x := v_1_0.Args[0]
  7789  		mem := v_2
  7790  		if !(c <= 8) {
  7791  			break
  7792  		}
  7793  		v.reset(OpPPC64MOVBstore)
  7794  		v.AuxInt = int32ToAuxInt(off)
  7795  		v.Aux = symToAux(sym)
  7796  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7797  		v0.AuxInt = int64ToAuxInt(c)
  7798  		v0.AddArg(x)
  7799  		v.AddArg3(ptr, v0, mem)
  7800  		return true
  7801  	}
  7802  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWreg x) [c]) mem)
  7803  	// cond: c <= 24
  7804  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7805  	for {
  7806  		off := auxIntToInt32(v.AuxInt)
  7807  		sym := auxToSym(v.Aux)
  7808  		ptr := v_0
  7809  		if v_1.Op != OpPPC64SRWconst {
  7810  			break
  7811  		}
  7812  		c := auxIntToInt64(v_1.AuxInt)
  7813  		v_1_0 := v_1.Args[0]
  7814  		if v_1_0.Op != OpPPC64MOVWreg {
  7815  			break
  7816  		}
  7817  		x := v_1_0.Args[0]
  7818  		mem := v_2
  7819  		if !(c <= 24) {
  7820  			break
  7821  		}
  7822  		v.reset(OpPPC64MOVBstore)
  7823  		v.AuxInt = int32ToAuxInt(off)
  7824  		v.Aux = symToAux(sym)
  7825  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7826  		v0.AuxInt = int64ToAuxInt(c)
  7827  		v0.AddArg(x)
  7828  		v.AddArg3(ptr, v0, mem)
  7829  		return true
  7830  	}
  7831  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWZreg x) [c]) mem)
  7832  	// cond: c <= 24
  7833  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7834  	for {
  7835  		off := auxIntToInt32(v.AuxInt)
  7836  		sym := auxToSym(v.Aux)
  7837  		ptr := v_0
  7838  		if v_1.Op != OpPPC64SRWconst {
  7839  			break
  7840  		}
  7841  		c := auxIntToInt64(v_1.AuxInt)
  7842  		v_1_0 := v_1.Args[0]
  7843  		if v_1_0.Op != OpPPC64MOVWZreg {
  7844  			break
  7845  		}
  7846  		x := v_1_0.Args[0]
  7847  		mem := v_2
  7848  		if !(c <= 24) {
  7849  			break
  7850  		}
  7851  		v.reset(OpPPC64MOVBstore)
  7852  		v.AuxInt = int32ToAuxInt(off)
  7853  		v.Aux = symToAux(sym)
  7854  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7855  		v0.AuxInt = int64ToAuxInt(c)
  7856  		v0.AddArg(x)
  7857  		v.AddArg3(ptr, v0, mem)
  7858  		return true
  7859  	}
  7860  	return false
  7861  }
  7862  func rewriteValuePPC64_OpPPC64MOVBstoreidx(v *Value) bool {
  7863  	v_3 := v.Args[3]
  7864  	v_2 := v.Args[2]
  7865  	v_1 := v.Args[1]
  7866  	v_0 := v.Args[0]
  7867  	b := v.Block
  7868  	typ := &b.Func.Config.Types
  7869  	// match: (MOVBstoreidx ptr (MOVDconst [c]) val mem)
  7870  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  7871  	// result: (MOVBstore [int32(c)] ptr val mem)
  7872  	for {
  7873  		ptr := v_0
  7874  		if v_1.Op != OpPPC64MOVDconst {
  7875  			break
  7876  		}
  7877  		c := auxIntToInt64(v_1.AuxInt)
  7878  		val := v_2
  7879  		mem := v_3
  7880  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  7881  			break
  7882  		}
  7883  		v.reset(OpPPC64MOVBstore)
  7884  		v.AuxInt = int32ToAuxInt(int32(c))
  7885  		v.AddArg3(ptr, val, mem)
  7886  		return true
  7887  	}
  7888  	// match: (MOVBstoreidx (MOVDconst [c]) ptr val mem)
  7889  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  7890  	// result: (MOVBstore [int32(c)] ptr val mem)
  7891  	for {
  7892  		if v_0.Op != OpPPC64MOVDconst {
  7893  			break
  7894  		}
  7895  		c := auxIntToInt64(v_0.AuxInt)
  7896  		ptr := v_1
  7897  		val := v_2
  7898  		mem := v_3
  7899  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  7900  			break
  7901  		}
  7902  		v.reset(OpPPC64MOVBstore)
  7903  		v.AuxInt = int32ToAuxInt(int32(c))
  7904  		v.AddArg3(ptr, val, mem)
  7905  		return true
  7906  	}
  7907  	// match: (MOVBstoreidx ptr idx (MOVBreg x) mem)
  7908  	// result: (MOVBstoreidx ptr idx x mem)
  7909  	for {
  7910  		ptr := v_0
  7911  		idx := v_1
  7912  		if v_2.Op != OpPPC64MOVBreg {
  7913  			break
  7914  		}
  7915  		x := v_2.Args[0]
  7916  		mem := v_3
  7917  		v.reset(OpPPC64MOVBstoreidx)
  7918  		v.AddArg4(ptr, idx, x, mem)
  7919  		return true
  7920  	}
  7921  	// match: (MOVBstoreidx ptr idx (MOVBZreg x) mem)
  7922  	// result: (MOVBstoreidx ptr idx x mem)
  7923  	for {
  7924  		ptr := v_0
  7925  		idx := v_1
  7926  		if v_2.Op != OpPPC64MOVBZreg {
  7927  			break
  7928  		}
  7929  		x := v_2.Args[0]
  7930  		mem := v_3
  7931  		v.reset(OpPPC64MOVBstoreidx)
  7932  		v.AddArg4(ptr, idx, x, mem)
  7933  		return true
  7934  	}
  7935  	// match: (MOVBstoreidx ptr idx (MOVHreg x) mem)
  7936  	// result: (MOVBstoreidx ptr idx x mem)
  7937  	for {
  7938  		ptr := v_0
  7939  		idx := v_1
  7940  		if v_2.Op != OpPPC64MOVHreg {
  7941  			break
  7942  		}
  7943  		x := v_2.Args[0]
  7944  		mem := v_3
  7945  		v.reset(OpPPC64MOVBstoreidx)
  7946  		v.AddArg4(ptr, idx, x, mem)
  7947  		return true
  7948  	}
  7949  	// match: (MOVBstoreidx ptr idx (MOVHZreg x) mem)
  7950  	// result: (MOVBstoreidx ptr idx x mem)
  7951  	for {
  7952  		ptr := v_0
  7953  		idx := v_1
  7954  		if v_2.Op != OpPPC64MOVHZreg {
  7955  			break
  7956  		}
  7957  		x := v_2.Args[0]
  7958  		mem := v_3
  7959  		v.reset(OpPPC64MOVBstoreidx)
  7960  		v.AddArg4(ptr, idx, x, mem)
  7961  		return true
  7962  	}
  7963  	// match: (MOVBstoreidx ptr idx (MOVWreg x) mem)
  7964  	// result: (MOVBstoreidx ptr idx x mem)
  7965  	for {
  7966  		ptr := v_0
  7967  		idx := v_1
  7968  		if v_2.Op != OpPPC64MOVWreg {
  7969  			break
  7970  		}
  7971  		x := v_2.Args[0]
  7972  		mem := v_3
  7973  		v.reset(OpPPC64MOVBstoreidx)
  7974  		v.AddArg4(ptr, idx, x, mem)
  7975  		return true
  7976  	}
  7977  	// match: (MOVBstoreidx ptr idx (MOVWZreg x) mem)
  7978  	// result: (MOVBstoreidx ptr idx x mem)
  7979  	for {
  7980  		ptr := v_0
  7981  		idx := v_1
  7982  		if v_2.Op != OpPPC64MOVWZreg {
  7983  			break
  7984  		}
  7985  		x := v_2.Args[0]
  7986  		mem := v_3
  7987  		v.reset(OpPPC64MOVBstoreidx)
  7988  		v.AddArg4(ptr, idx, x, mem)
  7989  		return true
  7990  	}
  7991  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVHreg x) [c]) mem)
  7992  	// cond: c <= 8
  7993  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  7994  	for {
  7995  		ptr := v_0
  7996  		idx := v_1
  7997  		if v_2.Op != OpPPC64SRWconst {
  7998  			break
  7999  		}
  8000  		c := auxIntToInt64(v_2.AuxInt)
  8001  		v_2_0 := v_2.Args[0]
  8002  		if v_2_0.Op != OpPPC64MOVHreg {
  8003  			break
  8004  		}
  8005  		x := v_2_0.Args[0]
  8006  		mem := v_3
  8007  		if !(c <= 8) {
  8008  			break
  8009  		}
  8010  		v.reset(OpPPC64MOVBstoreidx)
  8011  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8012  		v0.AuxInt = int64ToAuxInt(c)
  8013  		v0.AddArg(x)
  8014  		v.AddArg4(ptr, idx, v0, mem)
  8015  		return true
  8016  	}
  8017  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVHZreg x) [c]) mem)
  8018  	// cond: c <= 8
  8019  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8020  	for {
  8021  		ptr := v_0
  8022  		idx := v_1
  8023  		if v_2.Op != OpPPC64SRWconst {
  8024  			break
  8025  		}
  8026  		c := auxIntToInt64(v_2.AuxInt)
  8027  		v_2_0 := v_2.Args[0]
  8028  		if v_2_0.Op != OpPPC64MOVHZreg {
  8029  			break
  8030  		}
  8031  		x := v_2_0.Args[0]
  8032  		mem := v_3
  8033  		if !(c <= 8) {
  8034  			break
  8035  		}
  8036  		v.reset(OpPPC64MOVBstoreidx)
  8037  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8038  		v0.AuxInt = int64ToAuxInt(c)
  8039  		v0.AddArg(x)
  8040  		v.AddArg4(ptr, idx, v0, mem)
  8041  		return true
  8042  	}
  8043  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVWreg x) [c]) mem)
  8044  	// cond: c <= 24
  8045  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8046  	for {
  8047  		ptr := v_0
  8048  		idx := v_1
  8049  		if v_2.Op != OpPPC64SRWconst {
  8050  			break
  8051  		}
  8052  		c := auxIntToInt64(v_2.AuxInt)
  8053  		v_2_0 := v_2.Args[0]
  8054  		if v_2_0.Op != OpPPC64MOVWreg {
  8055  			break
  8056  		}
  8057  		x := v_2_0.Args[0]
  8058  		mem := v_3
  8059  		if !(c <= 24) {
  8060  			break
  8061  		}
  8062  		v.reset(OpPPC64MOVBstoreidx)
  8063  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8064  		v0.AuxInt = int64ToAuxInt(c)
  8065  		v0.AddArg(x)
  8066  		v.AddArg4(ptr, idx, v0, mem)
  8067  		return true
  8068  	}
  8069  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVWZreg x) [c]) mem)
  8070  	// cond: c <= 24
  8071  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8072  	for {
  8073  		ptr := v_0
  8074  		idx := v_1
  8075  		if v_2.Op != OpPPC64SRWconst {
  8076  			break
  8077  		}
  8078  		c := auxIntToInt64(v_2.AuxInt)
  8079  		v_2_0 := v_2.Args[0]
  8080  		if v_2_0.Op != OpPPC64MOVWZreg {
  8081  			break
  8082  		}
  8083  		x := v_2_0.Args[0]
  8084  		mem := v_3
  8085  		if !(c <= 24) {
  8086  			break
  8087  		}
  8088  		v.reset(OpPPC64MOVBstoreidx)
  8089  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8090  		v0.AuxInt = int64ToAuxInt(c)
  8091  		v0.AddArg(x)
  8092  		v.AddArg4(ptr, idx, v0, mem)
  8093  		return true
  8094  	}
  8095  	return false
  8096  }
  8097  func rewriteValuePPC64_OpPPC64MOVBstorezero(v *Value) bool {
  8098  	v_1 := v.Args[1]
  8099  	v_0 := v.Args[0]
  8100  	// match: (MOVBstorezero [off1] {sym} (ADDconst [off2] x) mem)
  8101  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
  8102  	// result: (MOVBstorezero [off1+int32(off2)] {sym} x mem)
  8103  	for {
  8104  		off1 := auxIntToInt32(v.AuxInt)
  8105  		sym := auxToSym(v.Aux)
  8106  		if v_0.Op != OpPPC64ADDconst {
  8107  			break
  8108  		}
  8109  		off2 := auxIntToInt64(v_0.AuxInt)
  8110  		x := v_0.Args[0]
  8111  		mem := v_1
  8112  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
  8113  			break
  8114  		}
  8115  		v.reset(OpPPC64MOVBstorezero)
  8116  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8117  		v.Aux = symToAux(sym)
  8118  		v.AddArg2(x, mem)
  8119  		return true
  8120  	}
  8121  	// match: (MOVBstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
  8122  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8123  	// result: (MOVBstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
  8124  	for {
  8125  		off1 := auxIntToInt32(v.AuxInt)
  8126  		sym1 := auxToSym(v.Aux)
  8127  		p := v_0
  8128  		if p.Op != OpPPC64MOVDaddr {
  8129  			break
  8130  		}
  8131  		off2 := auxIntToInt32(p.AuxInt)
  8132  		sym2 := auxToSym(p.Aux)
  8133  		x := p.Args[0]
  8134  		mem := v_1
  8135  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8136  			break
  8137  		}
  8138  		v.reset(OpPPC64MOVBstorezero)
  8139  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8140  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8141  		v.AddArg2(x, mem)
  8142  		return true
  8143  	}
  8144  	return false
  8145  }
  8146  func rewriteValuePPC64_OpPPC64MOVDaddr(v *Value) bool {
  8147  	v_0 := v.Args[0]
  8148  	// match: (MOVDaddr {sym} [n] p:(ADD x y))
  8149  	// cond: sym == nil && n == 0
  8150  	// result: p
  8151  	for {
  8152  		n := auxIntToInt32(v.AuxInt)
  8153  		sym := auxToSym(v.Aux)
  8154  		p := v_0
  8155  		if p.Op != OpPPC64ADD {
  8156  			break
  8157  		}
  8158  		if !(sym == nil && n == 0) {
  8159  			break
  8160  		}
  8161  		v.copyOf(p)
  8162  		return true
  8163  	}
  8164  	// match: (MOVDaddr {sym} [n] ptr)
  8165  	// cond: sym == nil && n == 0 && (ptr.Op == OpArgIntReg || ptr.Op == OpPhi)
  8166  	// result: ptr
  8167  	for {
  8168  		n := auxIntToInt32(v.AuxInt)
  8169  		sym := auxToSym(v.Aux)
  8170  		ptr := v_0
  8171  		if !(sym == nil && n == 0 && (ptr.Op == OpArgIntReg || ptr.Op == OpPhi)) {
  8172  			break
  8173  		}
  8174  		v.copyOf(ptr)
  8175  		return true
  8176  	}
  8177  	return false
  8178  }
  8179  func rewriteValuePPC64_OpPPC64MOVDload(v *Value) bool {
  8180  	v_1 := v.Args[1]
  8181  	v_0 := v.Args[0]
  8182  	// match: (MOVDload [off] {sym} ptr (FMOVDstore [off] {sym} ptr x _))
  8183  	// result: (MFVSRD x)
  8184  	for {
  8185  		off := auxIntToInt32(v.AuxInt)
  8186  		sym := auxToSym(v.Aux)
  8187  		ptr := v_0
  8188  		if v_1.Op != OpPPC64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  8189  			break
  8190  		}
  8191  		x := v_1.Args[1]
  8192  		if ptr != v_1.Args[0] {
  8193  			break
  8194  		}
  8195  		v.reset(OpPPC64MFVSRD)
  8196  		v.AddArg(x)
  8197  		return true
  8198  	}
  8199  	// match: (MOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  8200  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8201  	// result: (MOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8202  	for {
  8203  		off1 := auxIntToInt32(v.AuxInt)
  8204  		sym1 := auxToSym(v.Aux)
  8205  		p := v_0
  8206  		if p.Op != OpPPC64MOVDaddr {
  8207  			break
  8208  		}
  8209  		off2 := auxIntToInt32(p.AuxInt)
  8210  		sym2 := auxToSym(p.Aux)
  8211  		ptr := p.Args[0]
  8212  		mem := v_1
  8213  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8214  			break
  8215  		}
  8216  		v.reset(OpPPC64MOVDload)
  8217  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8218  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8219  		v.AddArg2(ptr, mem)
  8220  		return true
  8221  	}
  8222  	// match: (MOVDload [off1] {sym} (ADDconst [off2] x) mem)
  8223  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8224  	// result: (MOVDload [off1+int32(off2)] {sym} x mem)
  8225  	for {
  8226  		off1 := auxIntToInt32(v.AuxInt)
  8227  		sym := auxToSym(v.Aux)
  8228  		if v_0.Op != OpPPC64ADDconst {
  8229  			break
  8230  		}
  8231  		off2 := auxIntToInt64(v_0.AuxInt)
  8232  		x := v_0.Args[0]
  8233  		mem := v_1
  8234  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8235  			break
  8236  		}
  8237  		v.reset(OpPPC64MOVDload)
  8238  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8239  		v.Aux = symToAux(sym)
  8240  		v.AddArg2(x, mem)
  8241  		return true
  8242  	}
  8243  	// match: (MOVDload [0] {sym} p:(ADD ptr idx) mem)
  8244  	// cond: sym == nil && p.Uses == 1
  8245  	// result: (MOVDloadidx ptr idx mem)
  8246  	for {
  8247  		if auxIntToInt32(v.AuxInt) != 0 {
  8248  			break
  8249  		}
  8250  		sym := auxToSym(v.Aux)
  8251  		p := v_0
  8252  		if p.Op != OpPPC64ADD {
  8253  			break
  8254  		}
  8255  		idx := p.Args[1]
  8256  		ptr := p.Args[0]
  8257  		mem := v_1
  8258  		if !(sym == nil && p.Uses == 1) {
  8259  			break
  8260  		}
  8261  		v.reset(OpPPC64MOVDloadidx)
  8262  		v.AddArg3(ptr, idx, mem)
  8263  		return true
  8264  	}
  8265  	return false
  8266  }
  8267  func rewriteValuePPC64_OpPPC64MOVDloadidx(v *Value) bool {
  8268  	v_2 := v.Args[2]
  8269  	v_1 := v.Args[1]
  8270  	v_0 := v.Args[0]
  8271  	// match: (MOVDloadidx ptr (MOVDconst [c]) mem)
  8272  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8273  	// result: (MOVDload [int32(c)] ptr mem)
  8274  	for {
  8275  		ptr := v_0
  8276  		if v_1.Op != OpPPC64MOVDconst {
  8277  			break
  8278  		}
  8279  		c := auxIntToInt64(v_1.AuxInt)
  8280  		mem := v_2
  8281  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8282  			break
  8283  		}
  8284  		v.reset(OpPPC64MOVDload)
  8285  		v.AuxInt = int32ToAuxInt(int32(c))
  8286  		v.AddArg2(ptr, mem)
  8287  		return true
  8288  	}
  8289  	// match: (MOVDloadidx (MOVDconst [c]) ptr mem)
  8290  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8291  	// result: (MOVDload [int32(c)] ptr mem)
  8292  	for {
  8293  		if v_0.Op != OpPPC64MOVDconst {
  8294  			break
  8295  		}
  8296  		c := auxIntToInt64(v_0.AuxInt)
  8297  		ptr := v_1
  8298  		mem := v_2
  8299  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8300  			break
  8301  		}
  8302  		v.reset(OpPPC64MOVDload)
  8303  		v.AuxInt = int32ToAuxInt(int32(c))
  8304  		v.AddArg2(ptr, mem)
  8305  		return true
  8306  	}
  8307  	return false
  8308  }
  8309  func rewriteValuePPC64_OpPPC64MOVDstore(v *Value) bool {
  8310  	v_2 := v.Args[2]
  8311  	v_1 := v.Args[1]
  8312  	v_0 := v.Args[0]
  8313  	b := v.Block
  8314  	// match: (MOVDstore [off] {sym} ptr (MFVSRD x) mem)
  8315  	// result: (FMOVDstore [off] {sym} ptr x mem)
  8316  	for {
  8317  		off := auxIntToInt32(v.AuxInt)
  8318  		sym := auxToSym(v.Aux)
  8319  		ptr := v_0
  8320  		if v_1.Op != OpPPC64MFVSRD {
  8321  			break
  8322  		}
  8323  		x := v_1.Args[0]
  8324  		mem := v_2
  8325  		v.reset(OpPPC64FMOVDstore)
  8326  		v.AuxInt = int32ToAuxInt(off)
  8327  		v.Aux = symToAux(sym)
  8328  		v.AddArg3(ptr, x, mem)
  8329  		return true
  8330  	}
  8331  	// match: (MOVDstore [off1] {sym} (ADDconst [off2] x) val mem)
  8332  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8333  	// result: (MOVDstore [off1+int32(off2)] {sym} x val mem)
  8334  	for {
  8335  		off1 := auxIntToInt32(v.AuxInt)
  8336  		sym := auxToSym(v.Aux)
  8337  		if v_0.Op != OpPPC64ADDconst {
  8338  			break
  8339  		}
  8340  		off2 := auxIntToInt64(v_0.AuxInt)
  8341  		x := v_0.Args[0]
  8342  		val := v_1
  8343  		mem := v_2
  8344  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8345  			break
  8346  		}
  8347  		v.reset(OpPPC64MOVDstore)
  8348  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8349  		v.Aux = symToAux(sym)
  8350  		v.AddArg3(x, val, mem)
  8351  		return true
  8352  	}
  8353  	// match: (MOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  8354  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8355  	// result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  8356  	for {
  8357  		off1 := auxIntToInt32(v.AuxInt)
  8358  		sym1 := auxToSym(v.Aux)
  8359  		p := v_0
  8360  		if p.Op != OpPPC64MOVDaddr {
  8361  			break
  8362  		}
  8363  		off2 := auxIntToInt32(p.AuxInt)
  8364  		sym2 := auxToSym(p.Aux)
  8365  		ptr := p.Args[0]
  8366  		val := v_1
  8367  		mem := v_2
  8368  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8369  			break
  8370  		}
  8371  		v.reset(OpPPC64MOVDstore)
  8372  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8373  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8374  		v.AddArg3(ptr, val, mem)
  8375  		return true
  8376  	}
  8377  	// match: (MOVDstore [off] {sym} ptr (MOVDconst [0]) mem)
  8378  	// result: (MOVDstorezero [off] {sym} ptr mem)
  8379  	for {
  8380  		off := auxIntToInt32(v.AuxInt)
  8381  		sym := auxToSym(v.Aux)
  8382  		ptr := v_0
  8383  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  8384  			break
  8385  		}
  8386  		mem := v_2
  8387  		v.reset(OpPPC64MOVDstorezero)
  8388  		v.AuxInt = int32ToAuxInt(off)
  8389  		v.Aux = symToAux(sym)
  8390  		v.AddArg2(ptr, mem)
  8391  		return true
  8392  	}
  8393  	// match: (MOVDstore [0] {sym} p:(ADD ptr idx) val mem)
  8394  	// cond: sym == nil && p.Uses == 1
  8395  	// result: (MOVDstoreidx ptr idx val mem)
  8396  	for {
  8397  		if auxIntToInt32(v.AuxInt) != 0 {
  8398  			break
  8399  		}
  8400  		sym := auxToSym(v.Aux)
  8401  		p := v_0
  8402  		if p.Op != OpPPC64ADD {
  8403  			break
  8404  		}
  8405  		idx := p.Args[1]
  8406  		ptr := p.Args[0]
  8407  		val := v_1
  8408  		mem := v_2
  8409  		if !(sym == nil && p.Uses == 1) {
  8410  			break
  8411  		}
  8412  		v.reset(OpPPC64MOVDstoreidx)
  8413  		v.AddArg4(ptr, idx, val, mem)
  8414  		return true
  8415  	}
  8416  	// match: (MOVDstore [off] {sym} ptr r:(BRD val) mem)
  8417  	// cond: r.Uses == 1
  8418  	// result: (MOVDBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  8419  	for {
  8420  		off := auxIntToInt32(v.AuxInt)
  8421  		sym := auxToSym(v.Aux)
  8422  		ptr := v_0
  8423  		r := v_1
  8424  		if r.Op != OpPPC64BRD {
  8425  			break
  8426  		}
  8427  		val := r.Args[0]
  8428  		mem := v_2
  8429  		if !(r.Uses == 1) {
  8430  			break
  8431  		}
  8432  		v.reset(OpPPC64MOVDBRstore)
  8433  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  8434  		v0.AuxInt = int32ToAuxInt(off)
  8435  		v0.Aux = symToAux(sym)
  8436  		v0.AddArg(ptr)
  8437  		v.AddArg3(v0, val, mem)
  8438  		return true
  8439  	}
  8440  	// match: (MOVDstore [off] {sym} ptr (Bswap64 val) mem)
  8441  	// result: (MOVDBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  8442  	for {
  8443  		off := auxIntToInt32(v.AuxInt)
  8444  		sym := auxToSym(v.Aux)
  8445  		ptr := v_0
  8446  		if v_1.Op != OpBswap64 {
  8447  			break
  8448  		}
  8449  		val := v_1.Args[0]
  8450  		mem := v_2
  8451  		v.reset(OpPPC64MOVDBRstore)
  8452  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  8453  		v0.AuxInt = int32ToAuxInt(off)
  8454  		v0.Aux = symToAux(sym)
  8455  		v0.AddArg(ptr)
  8456  		v.AddArg3(v0, val, mem)
  8457  		return true
  8458  	}
  8459  	return false
  8460  }
  8461  func rewriteValuePPC64_OpPPC64MOVDstoreidx(v *Value) bool {
  8462  	v_3 := v.Args[3]
  8463  	v_2 := v.Args[2]
  8464  	v_1 := v.Args[1]
  8465  	v_0 := v.Args[0]
  8466  	// match: (MOVDstoreidx ptr (MOVDconst [c]) val mem)
  8467  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8468  	// result: (MOVDstore [int32(c)] ptr val mem)
  8469  	for {
  8470  		ptr := v_0
  8471  		if v_1.Op != OpPPC64MOVDconst {
  8472  			break
  8473  		}
  8474  		c := auxIntToInt64(v_1.AuxInt)
  8475  		val := v_2
  8476  		mem := v_3
  8477  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8478  			break
  8479  		}
  8480  		v.reset(OpPPC64MOVDstore)
  8481  		v.AuxInt = int32ToAuxInt(int32(c))
  8482  		v.AddArg3(ptr, val, mem)
  8483  		return true
  8484  	}
  8485  	// match: (MOVDstoreidx (MOVDconst [c]) ptr val mem)
  8486  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8487  	// result: (MOVDstore [int32(c)] ptr val mem)
  8488  	for {
  8489  		if v_0.Op != OpPPC64MOVDconst {
  8490  			break
  8491  		}
  8492  		c := auxIntToInt64(v_0.AuxInt)
  8493  		ptr := v_1
  8494  		val := v_2
  8495  		mem := v_3
  8496  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8497  			break
  8498  		}
  8499  		v.reset(OpPPC64MOVDstore)
  8500  		v.AuxInt = int32ToAuxInt(int32(c))
  8501  		v.AddArg3(ptr, val, mem)
  8502  		return true
  8503  	}
  8504  	// match: (MOVDstoreidx ptr idx r:(BRD val) mem)
  8505  	// cond: r.Uses == 1
  8506  	// result: (MOVDBRstoreidx ptr idx val mem)
  8507  	for {
  8508  		ptr := v_0
  8509  		idx := v_1
  8510  		r := v_2
  8511  		if r.Op != OpPPC64BRD {
  8512  			break
  8513  		}
  8514  		val := r.Args[0]
  8515  		mem := v_3
  8516  		if !(r.Uses == 1) {
  8517  			break
  8518  		}
  8519  		v.reset(OpPPC64MOVDBRstoreidx)
  8520  		v.AddArg4(ptr, idx, val, mem)
  8521  		return true
  8522  	}
  8523  	// match: (MOVDstoreidx ptr idx (Bswap64 val) mem)
  8524  	// result: (MOVDBRstoreidx ptr idx val mem)
  8525  	for {
  8526  		ptr := v_0
  8527  		idx := v_1
  8528  		if v_2.Op != OpBswap64 {
  8529  			break
  8530  		}
  8531  		val := v_2.Args[0]
  8532  		mem := v_3
  8533  		v.reset(OpPPC64MOVDBRstoreidx)
  8534  		v.AddArg4(ptr, idx, val, mem)
  8535  		return true
  8536  	}
  8537  	return false
  8538  }
  8539  func rewriteValuePPC64_OpPPC64MOVDstorezero(v *Value) bool {
  8540  	v_1 := v.Args[1]
  8541  	v_0 := v.Args[0]
  8542  	// match: (MOVDstorezero [off1] {sym} (ADDconst [off2] x) mem)
  8543  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
  8544  	// result: (MOVDstorezero [off1+int32(off2)] {sym} x mem)
  8545  	for {
  8546  		off1 := auxIntToInt32(v.AuxInt)
  8547  		sym := auxToSym(v.Aux)
  8548  		if v_0.Op != OpPPC64ADDconst {
  8549  			break
  8550  		}
  8551  		off2 := auxIntToInt64(v_0.AuxInt)
  8552  		x := v_0.Args[0]
  8553  		mem := v_1
  8554  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
  8555  			break
  8556  		}
  8557  		v.reset(OpPPC64MOVDstorezero)
  8558  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8559  		v.Aux = symToAux(sym)
  8560  		v.AddArg2(x, mem)
  8561  		return true
  8562  	}
  8563  	// match: (MOVDstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
  8564  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8565  	// result: (MOVDstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
  8566  	for {
  8567  		off1 := auxIntToInt32(v.AuxInt)
  8568  		sym1 := auxToSym(v.Aux)
  8569  		p := v_0
  8570  		if p.Op != OpPPC64MOVDaddr {
  8571  			break
  8572  		}
  8573  		off2 := auxIntToInt32(p.AuxInt)
  8574  		sym2 := auxToSym(p.Aux)
  8575  		x := p.Args[0]
  8576  		mem := v_1
  8577  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8578  			break
  8579  		}
  8580  		v.reset(OpPPC64MOVDstorezero)
  8581  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8582  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8583  		v.AddArg2(x, mem)
  8584  		return true
  8585  	}
  8586  	return false
  8587  }
  8588  func rewriteValuePPC64_OpPPC64MOVHBRstore(v *Value) bool {
  8589  	v_2 := v.Args[2]
  8590  	v_1 := v.Args[1]
  8591  	v_0 := v.Args[0]
  8592  	// match: (MOVHBRstore ptr (MOVHreg x) mem)
  8593  	// result: (MOVHBRstore ptr x mem)
  8594  	for {
  8595  		ptr := v_0
  8596  		if v_1.Op != OpPPC64MOVHreg {
  8597  			break
  8598  		}
  8599  		x := v_1.Args[0]
  8600  		mem := v_2
  8601  		v.reset(OpPPC64MOVHBRstore)
  8602  		v.AddArg3(ptr, x, mem)
  8603  		return true
  8604  	}
  8605  	// match: (MOVHBRstore ptr (MOVHZreg x) mem)
  8606  	// result: (MOVHBRstore ptr x mem)
  8607  	for {
  8608  		ptr := v_0
  8609  		if v_1.Op != OpPPC64MOVHZreg {
  8610  			break
  8611  		}
  8612  		x := v_1.Args[0]
  8613  		mem := v_2
  8614  		v.reset(OpPPC64MOVHBRstore)
  8615  		v.AddArg3(ptr, x, mem)
  8616  		return true
  8617  	}
  8618  	// match: (MOVHBRstore ptr (MOVWreg x) mem)
  8619  	// result: (MOVHBRstore ptr x mem)
  8620  	for {
  8621  		ptr := v_0
  8622  		if v_1.Op != OpPPC64MOVWreg {
  8623  			break
  8624  		}
  8625  		x := v_1.Args[0]
  8626  		mem := v_2
  8627  		v.reset(OpPPC64MOVHBRstore)
  8628  		v.AddArg3(ptr, x, mem)
  8629  		return true
  8630  	}
  8631  	// match: (MOVHBRstore ptr (MOVWZreg x) mem)
  8632  	// result: (MOVHBRstore ptr x mem)
  8633  	for {
  8634  		ptr := v_0
  8635  		if v_1.Op != OpPPC64MOVWZreg {
  8636  			break
  8637  		}
  8638  		x := v_1.Args[0]
  8639  		mem := v_2
  8640  		v.reset(OpPPC64MOVHBRstore)
  8641  		v.AddArg3(ptr, x, mem)
  8642  		return true
  8643  	}
  8644  	return false
  8645  }
  8646  func rewriteValuePPC64_OpPPC64MOVHZload(v *Value) bool {
  8647  	v_1 := v.Args[1]
  8648  	v_0 := v.Args[0]
  8649  	// match: (MOVHZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  8650  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8651  	// result: (MOVHZload [off1+off2] {mergeSym(sym1,sym2)} ptr 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  		mem := v_1
  8663  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8664  			break
  8665  		}
  8666  		v.reset(OpPPC64MOVHZload)
  8667  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8668  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8669  		v.AddArg2(ptr, mem)
  8670  		return true
  8671  	}
  8672  	// match: (MOVHZload [off1] {sym} (ADDconst [off2] x) mem)
  8673  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8674  	// result: (MOVHZload [off1+int32(off2)] {sym} x mem)
  8675  	for {
  8676  		off1 := auxIntToInt32(v.AuxInt)
  8677  		sym := auxToSym(v.Aux)
  8678  		if v_0.Op != OpPPC64ADDconst {
  8679  			break
  8680  		}
  8681  		off2 := auxIntToInt64(v_0.AuxInt)
  8682  		x := v_0.Args[0]
  8683  		mem := v_1
  8684  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8685  			break
  8686  		}
  8687  		v.reset(OpPPC64MOVHZload)
  8688  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8689  		v.Aux = symToAux(sym)
  8690  		v.AddArg2(x, mem)
  8691  		return true
  8692  	}
  8693  	// match: (MOVHZload [0] {sym} p:(ADD ptr idx) mem)
  8694  	// cond: sym == nil && p.Uses == 1
  8695  	// result: (MOVHZloadidx ptr idx mem)
  8696  	for {
  8697  		if auxIntToInt32(v.AuxInt) != 0 {
  8698  			break
  8699  		}
  8700  		sym := auxToSym(v.Aux)
  8701  		p := v_0
  8702  		if p.Op != OpPPC64ADD {
  8703  			break
  8704  		}
  8705  		idx := p.Args[1]
  8706  		ptr := p.Args[0]
  8707  		mem := v_1
  8708  		if !(sym == nil && p.Uses == 1) {
  8709  			break
  8710  		}
  8711  		v.reset(OpPPC64MOVHZloadidx)
  8712  		v.AddArg3(ptr, idx, mem)
  8713  		return true
  8714  	}
  8715  	return false
  8716  }
  8717  func rewriteValuePPC64_OpPPC64MOVHZloadidx(v *Value) bool {
  8718  	v_2 := v.Args[2]
  8719  	v_1 := v.Args[1]
  8720  	v_0 := v.Args[0]
  8721  	// match: (MOVHZloadidx ptr (MOVDconst [c]) mem)
  8722  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8723  	// result: (MOVHZload [int32(c)] ptr mem)
  8724  	for {
  8725  		ptr := v_0
  8726  		if v_1.Op != OpPPC64MOVDconst {
  8727  			break
  8728  		}
  8729  		c := auxIntToInt64(v_1.AuxInt)
  8730  		mem := v_2
  8731  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8732  			break
  8733  		}
  8734  		v.reset(OpPPC64MOVHZload)
  8735  		v.AuxInt = int32ToAuxInt(int32(c))
  8736  		v.AddArg2(ptr, mem)
  8737  		return true
  8738  	}
  8739  	// match: (MOVHZloadidx (MOVDconst [c]) ptr mem)
  8740  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8741  	// result: (MOVHZload [int32(c)] ptr mem)
  8742  	for {
  8743  		if v_0.Op != OpPPC64MOVDconst {
  8744  			break
  8745  		}
  8746  		c := auxIntToInt64(v_0.AuxInt)
  8747  		ptr := v_1
  8748  		mem := v_2
  8749  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8750  			break
  8751  		}
  8752  		v.reset(OpPPC64MOVHZload)
  8753  		v.AuxInt = int32ToAuxInt(int32(c))
  8754  		v.AddArg2(ptr, mem)
  8755  		return true
  8756  	}
  8757  	return false
  8758  }
  8759  func rewriteValuePPC64_OpPPC64MOVHZreg(v *Value) bool {
  8760  	v_0 := v.Args[0]
  8761  	b := v.Block
  8762  	typ := &b.Func.Config.Types
  8763  	// match: (MOVHZreg y:(ANDconst [c] _))
  8764  	// cond: uint64(c) <= 0xFFFF
  8765  	// result: y
  8766  	for {
  8767  		y := v_0
  8768  		if y.Op != OpPPC64ANDconst {
  8769  			break
  8770  		}
  8771  		c := auxIntToInt64(y.AuxInt)
  8772  		if !(uint64(c) <= 0xFFFF) {
  8773  			break
  8774  		}
  8775  		v.copyOf(y)
  8776  		return true
  8777  	}
  8778  	// match: (MOVHZreg (SRWconst [c] (MOVBZreg x)))
  8779  	// result: (SRWconst [c] (MOVBZreg x))
  8780  	for {
  8781  		if v_0.Op != OpPPC64SRWconst {
  8782  			break
  8783  		}
  8784  		c := auxIntToInt64(v_0.AuxInt)
  8785  		v_0_0 := v_0.Args[0]
  8786  		if v_0_0.Op != OpPPC64MOVBZreg {
  8787  			break
  8788  		}
  8789  		x := v_0_0.Args[0]
  8790  		v.reset(OpPPC64SRWconst)
  8791  		v.AuxInt = int64ToAuxInt(c)
  8792  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  8793  		v0.AddArg(x)
  8794  		v.AddArg(v0)
  8795  		return true
  8796  	}
  8797  	// match: (MOVHZreg (SRWconst [c] (MOVHZreg x)))
  8798  	// result: (SRWconst [c] (MOVHZreg x))
  8799  	for {
  8800  		if v_0.Op != OpPPC64SRWconst {
  8801  			break
  8802  		}
  8803  		c := auxIntToInt64(v_0.AuxInt)
  8804  		v_0_0 := v_0.Args[0]
  8805  		if v_0_0.Op != OpPPC64MOVHZreg {
  8806  			break
  8807  		}
  8808  		x := v_0_0.Args[0]
  8809  		v.reset(OpPPC64SRWconst)
  8810  		v.AuxInt = int64ToAuxInt(c)
  8811  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  8812  		v0.AddArg(x)
  8813  		v.AddArg(v0)
  8814  		return true
  8815  	}
  8816  	// match: (MOVHZreg (SRWconst [c] x))
  8817  	// cond: x.Type.Size() <= 16
  8818  	// result: (SRWconst [c] x)
  8819  	for {
  8820  		if v_0.Op != OpPPC64SRWconst {
  8821  			break
  8822  		}
  8823  		c := auxIntToInt64(v_0.AuxInt)
  8824  		x := v_0.Args[0]
  8825  		if !(x.Type.Size() <= 16) {
  8826  			break
  8827  		}
  8828  		v.reset(OpPPC64SRWconst)
  8829  		v.AuxInt = int64ToAuxInt(c)
  8830  		v.AddArg(x)
  8831  		return true
  8832  	}
  8833  	// match: (MOVHZreg (SRDconst [c] x))
  8834  	// cond: c>=48
  8835  	// result: (SRDconst [c] x)
  8836  	for {
  8837  		if v_0.Op != OpPPC64SRDconst {
  8838  			break
  8839  		}
  8840  		c := auxIntToInt64(v_0.AuxInt)
  8841  		x := v_0.Args[0]
  8842  		if !(c >= 48) {
  8843  			break
  8844  		}
  8845  		v.reset(OpPPC64SRDconst)
  8846  		v.AuxInt = int64ToAuxInt(c)
  8847  		v.AddArg(x)
  8848  		return true
  8849  	}
  8850  	// match: (MOVHZreg (SRWconst [c] x))
  8851  	// cond: c>=16
  8852  	// result: (SRWconst [c] x)
  8853  	for {
  8854  		if v_0.Op != OpPPC64SRWconst {
  8855  			break
  8856  		}
  8857  		c := auxIntToInt64(v_0.AuxInt)
  8858  		x := v_0.Args[0]
  8859  		if !(c >= 16) {
  8860  			break
  8861  		}
  8862  		v.reset(OpPPC64SRWconst)
  8863  		v.AuxInt = int64ToAuxInt(c)
  8864  		v.AddArg(x)
  8865  		return true
  8866  	}
  8867  	// match: (MOVHZreg (RLWINM [r] y))
  8868  	// cond: mergePPC64AndRlwinm(0xFFFF,r) != 0
  8869  	// result: (RLWINM [mergePPC64AndRlwinm(0xFFFF,r)] y)
  8870  	for {
  8871  		if v_0.Op != OpPPC64RLWINM {
  8872  			break
  8873  		}
  8874  		r := auxIntToInt64(v_0.AuxInt)
  8875  		y := v_0.Args[0]
  8876  		if !(mergePPC64AndRlwinm(0xFFFF, r) != 0) {
  8877  			break
  8878  		}
  8879  		v.reset(OpPPC64RLWINM)
  8880  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFFFF, r))
  8881  		v.AddArg(y)
  8882  		return true
  8883  	}
  8884  	// match: (MOVHZreg y:(MOVHZreg _))
  8885  	// result: y
  8886  	for {
  8887  		y := v_0
  8888  		if y.Op != OpPPC64MOVHZreg {
  8889  			break
  8890  		}
  8891  		v.copyOf(y)
  8892  		return true
  8893  	}
  8894  	// match: (MOVHZreg y:(MOVBZreg _))
  8895  	// result: y
  8896  	for {
  8897  		y := v_0
  8898  		if y.Op != OpPPC64MOVBZreg {
  8899  			break
  8900  		}
  8901  		v.copyOf(y)
  8902  		return true
  8903  	}
  8904  	// match: (MOVHZreg y:(MOVHBRload _ _))
  8905  	// result: y
  8906  	for {
  8907  		y := v_0
  8908  		if y.Op != OpPPC64MOVHBRload {
  8909  			break
  8910  		}
  8911  		v.copyOf(y)
  8912  		return true
  8913  	}
  8914  	// match: (MOVHZreg y:(MOVHreg x))
  8915  	// result: (MOVHZreg x)
  8916  	for {
  8917  		y := v_0
  8918  		if y.Op != OpPPC64MOVHreg {
  8919  			break
  8920  		}
  8921  		x := y.Args[0]
  8922  		v.reset(OpPPC64MOVHZreg)
  8923  		v.AddArg(x)
  8924  		return true
  8925  	}
  8926  	// match: (MOVHZreg (OR <t> x (MOVWZreg y)))
  8927  	// result: (MOVHZreg (OR <t> x y))
  8928  	for {
  8929  		if v_0.Op != OpPPC64OR {
  8930  			break
  8931  		}
  8932  		t := v_0.Type
  8933  		_ = v_0.Args[1]
  8934  		v_0_0 := v_0.Args[0]
  8935  		v_0_1 := v_0.Args[1]
  8936  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  8937  			x := v_0_0
  8938  			if v_0_1.Op != OpPPC64MOVWZreg {
  8939  				continue
  8940  			}
  8941  			y := v_0_1.Args[0]
  8942  			v.reset(OpPPC64MOVHZreg)
  8943  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  8944  			v0.AddArg2(x, y)
  8945  			v.AddArg(v0)
  8946  			return true
  8947  		}
  8948  		break
  8949  	}
  8950  	// match: (MOVHZreg (XOR <t> x (MOVWZreg y)))
  8951  	// result: (MOVHZreg (XOR <t> x y))
  8952  	for {
  8953  		if v_0.Op != OpPPC64XOR {
  8954  			break
  8955  		}
  8956  		t := v_0.Type
  8957  		_ = v_0.Args[1]
  8958  		v_0_0 := v_0.Args[0]
  8959  		v_0_1 := v_0.Args[1]
  8960  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  8961  			x := v_0_0
  8962  			if v_0_1.Op != OpPPC64MOVWZreg {
  8963  				continue
  8964  			}
  8965  			y := v_0_1.Args[0]
  8966  			v.reset(OpPPC64MOVHZreg)
  8967  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  8968  			v0.AddArg2(x, y)
  8969  			v.AddArg(v0)
  8970  			return true
  8971  		}
  8972  		break
  8973  	}
  8974  	// match: (MOVHZreg (AND <t> x (MOVWZreg y)))
  8975  	// result: (MOVHZreg (AND <t> x y))
  8976  	for {
  8977  		if v_0.Op != OpPPC64AND {
  8978  			break
  8979  		}
  8980  		t := v_0.Type
  8981  		_ = v_0.Args[1]
  8982  		v_0_0 := v_0.Args[0]
  8983  		v_0_1 := v_0.Args[1]
  8984  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  8985  			x := v_0_0
  8986  			if v_0_1.Op != OpPPC64MOVWZreg {
  8987  				continue
  8988  			}
  8989  			y := v_0_1.Args[0]
  8990  			v.reset(OpPPC64MOVHZreg)
  8991  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  8992  			v0.AddArg2(x, y)
  8993  			v.AddArg(v0)
  8994  			return true
  8995  		}
  8996  		break
  8997  	}
  8998  	// match: (MOVHZreg (OR <t> x (MOVHZreg y)))
  8999  	// result: (MOVHZreg (OR <t> x y))
  9000  	for {
  9001  		if v_0.Op != OpPPC64OR {
  9002  			break
  9003  		}
  9004  		t := v_0.Type
  9005  		_ = v_0.Args[1]
  9006  		v_0_0 := v_0.Args[0]
  9007  		v_0_1 := v_0.Args[1]
  9008  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9009  			x := v_0_0
  9010  			if v_0_1.Op != OpPPC64MOVHZreg {
  9011  				continue
  9012  			}
  9013  			y := v_0_1.Args[0]
  9014  			v.reset(OpPPC64MOVHZreg)
  9015  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  9016  			v0.AddArg2(x, y)
  9017  			v.AddArg(v0)
  9018  			return true
  9019  		}
  9020  		break
  9021  	}
  9022  	// match: (MOVHZreg (XOR <t> x (MOVHZreg y)))
  9023  	// result: (MOVHZreg (XOR <t> x y))
  9024  	for {
  9025  		if v_0.Op != OpPPC64XOR {
  9026  			break
  9027  		}
  9028  		t := v_0.Type
  9029  		_ = v_0.Args[1]
  9030  		v_0_0 := v_0.Args[0]
  9031  		v_0_1 := v_0.Args[1]
  9032  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9033  			x := v_0_0
  9034  			if v_0_1.Op != OpPPC64MOVHZreg {
  9035  				continue
  9036  			}
  9037  			y := v_0_1.Args[0]
  9038  			v.reset(OpPPC64MOVHZreg)
  9039  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  9040  			v0.AddArg2(x, y)
  9041  			v.AddArg(v0)
  9042  			return true
  9043  		}
  9044  		break
  9045  	}
  9046  	// match: (MOVHZreg (AND <t> x (MOVHZreg y)))
  9047  	// result: (MOVHZreg (AND <t> x y))
  9048  	for {
  9049  		if v_0.Op != OpPPC64AND {
  9050  			break
  9051  		}
  9052  		t := v_0.Type
  9053  		_ = v_0.Args[1]
  9054  		v_0_0 := v_0.Args[0]
  9055  		v_0_1 := v_0.Args[1]
  9056  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9057  			x := v_0_0
  9058  			if v_0_1.Op != OpPPC64MOVHZreg {
  9059  				continue
  9060  			}
  9061  			y := v_0_1.Args[0]
  9062  			v.reset(OpPPC64MOVHZreg)
  9063  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  9064  			v0.AddArg2(x, y)
  9065  			v.AddArg(v0)
  9066  			return true
  9067  		}
  9068  		break
  9069  	}
  9070  	// match: (MOVHZreg z:(ANDconst [c] (MOVBZload ptr x)))
  9071  	// result: z
  9072  	for {
  9073  		z := v_0
  9074  		if z.Op != OpPPC64ANDconst {
  9075  			break
  9076  		}
  9077  		z_0 := z.Args[0]
  9078  		if z_0.Op != OpPPC64MOVBZload {
  9079  			break
  9080  		}
  9081  		v.copyOf(z)
  9082  		return true
  9083  	}
  9084  	// match: (MOVHZreg z:(AND y (MOVHZload ptr x)))
  9085  	// result: z
  9086  	for {
  9087  		z := v_0
  9088  		if z.Op != OpPPC64AND {
  9089  			break
  9090  		}
  9091  		_ = z.Args[1]
  9092  		z_0 := z.Args[0]
  9093  		z_1 := z.Args[1]
  9094  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
  9095  			if z_1.Op != OpPPC64MOVHZload {
  9096  				continue
  9097  			}
  9098  			v.copyOf(z)
  9099  			return true
  9100  		}
  9101  		break
  9102  	}
  9103  	// match: (MOVHZreg z:(ANDconst [c] (MOVHZload ptr x)))
  9104  	// result: z
  9105  	for {
  9106  		z := v_0
  9107  		if z.Op != OpPPC64ANDconst {
  9108  			break
  9109  		}
  9110  		z_0 := z.Args[0]
  9111  		if z_0.Op != OpPPC64MOVHZload {
  9112  			break
  9113  		}
  9114  		v.copyOf(z)
  9115  		return true
  9116  	}
  9117  	// match: (MOVHZreg x:(MOVBZload _ _))
  9118  	// result: x
  9119  	for {
  9120  		x := v_0
  9121  		if x.Op != OpPPC64MOVBZload {
  9122  			break
  9123  		}
  9124  		v.copyOf(x)
  9125  		return true
  9126  	}
  9127  	// match: (MOVHZreg x:(MOVBZloadidx _ _ _))
  9128  	// result: x
  9129  	for {
  9130  		x := v_0
  9131  		if x.Op != OpPPC64MOVBZloadidx {
  9132  			break
  9133  		}
  9134  		v.copyOf(x)
  9135  		return true
  9136  	}
  9137  	// match: (MOVHZreg x:(MOVHZload _ _))
  9138  	// result: x
  9139  	for {
  9140  		x := v_0
  9141  		if x.Op != OpPPC64MOVHZload {
  9142  			break
  9143  		}
  9144  		v.copyOf(x)
  9145  		return true
  9146  	}
  9147  	// match: (MOVHZreg x:(MOVHZloadidx _ _ _))
  9148  	// result: x
  9149  	for {
  9150  		x := v_0
  9151  		if x.Op != OpPPC64MOVHZloadidx {
  9152  			break
  9153  		}
  9154  		v.copyOf(x)
  9155  		return true
  9156  	}
  9157  	// match: (MOVHZreg x:(Arg <t>))
  9158  	// cond: (is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()
  9159  	// result: x
  9160  	for {
  9161  		x := v_0
  9162  		if x.Op != OpArg {
  9163  			break
  9164  		}
  9165  		t := x.Type
  9166  		if !((is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()) {
  9167  			break
  9168  		}
  9169  		v.copyOf(x)
  9170  		return true
  9171  	}
  9172  	// match: (MOVHZreg (MOVDconst [c]))
  9173  	// result: (MOVDconst [int64(uint16(c))])
  9174  	for {
  9175  		if v_0.Op != OpPPC64MOVDconst {
  9176  			break
  9177  		}
  9178  		c := auxIntToInt64(v_0.AuxInt)
  9179  		v.reset(OpPPC64MOVDconst)
  9180  		v.AuxInt = int64ToAuxInt(int64(uint16(c)))
  9181  		return true
  9182  	}
  9183  	return false
  9184  }
  9185  func rewriteValuePPC64_OpPPC64MOVHload(v *Value) bool {
  9186  	v_1 := v.Args[1]
  9187  	v_0 := v.Args[0]
  9188  	// match: (MOVHload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  9189  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  9190  	// result: (MOVHload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9191  	for {
  9192  		off1 := auxIntToInt32(v.AuxInt)
  9193  		sym1 := auxToSym(v.Aux)
  9194  		p := v_0
  9195  		if p.Op != OpPPC64MOVDaddr {
  9196  			break
  9197  		}
  9198  		off2 := auxIntToInt32(p.AuxInt)
  9199  		sym2 := auxToSym(p.Aux)
  9200  		ptr := p.Args[0]
  9201  		mem := v_1
  9202  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  9203  			break
  9204  		}
  9205  		v.reset(OpPPC64MOVHload)
  9206  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9207  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9208  		v.AddArg2(ptr, mem)
  9209  		return true
  9210  	}
  9211  	// match: (MOVHload [off1] {sym} (ADDconst [off2] x) mem)
  9212  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  9213  	// result: (MOVHload [off1+int32(off2)] {sym} x mem)
  9214  	for {
  9215  		off1 := auxIntToInt32(v.AuxInt)
  9216  		sym := auxToSym(v.Aux)
  9217  		if v_0.Op != OpPPC64ADDconst {
  9218  			break
  9219  		}
  9220  		off2 := auxIntToInt64(v_0.AuxInt)
  9221  		x := v_0.Args[0]
  9222  		mem := v_1
  9223  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  9224  			break
  9225  		}
  9226  		v.reset(OpPPC64MOVHload)
  9227  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9228  		v.Aux = symToAux(sym)
  9229  		v.AddArg2(x, mem)
  9230  		return true
  9231  	}
  9232  	// match: (MOVHload [0] {sym} p:(ADD ptr idx) mem)
  9233  	// cond: sym == nil && p.Uses == 1
  9234  	// result: (MOVHloadidx ptr idx mem)
  9235  	for {
  9236  		if auxIntToInt32(v.AuxInt) != 0 {
  9237  			break
  9238  		}
  9239  		sym := auxToSym(v.Aux)
  9240  		p := v_0
  9241  		if p.Op != OpPPC64ADD {
  9242  			break
  9243  		}
  9244  		idx := p.Args[1]
  9245  		ptr := p.Args[0]
  9246  		mem := v_1
  9247  		if !(sym == nil && p.Uses == 1) {
  9248  			break
  9249  		}
  9250  		v.reset(OpPPC64MOVHloadidx)
  9251  		v.AddArg3(ptr, idx, mem)
  9252  		return true
  9253  	}
  9254  	return false
  9255  }
  9256  func rewriteValuePPC64_OpPPC64MOVHloadidx(v *Value) bool {
  9257  	v_2 := v.Args[2]
  9258  	v_1 := v.Args[1]
  9259  	v_0 := v.Args[0]
  9260  	// match: (MOVHloadidx ptr (MOVDconst [c]) mem)
  9261  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9262  	// result: (MOVHload [int32(c)] ptr mem)
  9263  	for {
  9264  		ptr := v_0
  9265  		if v_1.Op != OpPPC64MOVDconst {
  9266  			break
  9267  		}
  9268  		c := auxIntToInt64(v_1.AuxInt)
  9269  		mem := v_2
  9270  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9271  			break
  9272  		}
  9273  		v.reset(OpPPC64MOVHload)
  9274  		v.AuxInt = int32ToAuxInt(int32(c))
  9275  		v.AddArg2(ptr, mem)
  9276  		return true
  9277  	}
  9278  	// match: (MOVHloadidx (MOVDconst [c]) ptr mem)
  9279  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9280  	// result: (MOVHload [int32(c)] ptr mem)
  9281  	for {
  9282  		if v_0.Op != OpPPC64MOVDconst {
  9283  			break
  9284  		}
  9285  		c := auxIntToInt64(v_0.AuxInt)
  9286  		ptr := v_1
  9287  		mem := v_2
  9288  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9289  			break
  9290  		}
  9291  		v.reset(OpPPC64MOVHload)
  9292  		v.AuxInt = int32ToAuxInt(int32(c))
  9293  		v.AddArg2(ptr, mem)
  9294  		return true
  9295  	}
  9296  	return false
  9297  }
  9298  func rewriteValuePPC64_OpPPC64MOVHreg(v *Value) bool {
  9299  	v_0 := v.Args[0]
  9300  	b := v.Block
  9301  	typ := &b.Func.Config.Types
  9302  	// match: (MOVHreg y:(ANDconst [c] _))
  9303  	// cond: uint64(c) <= 0x7FFF
  9304  	// result: y
  9305  	for {
  9306  		y := v_0
  9307  		if y.Op != OpPPC64ANDconst {
  9308  			break
  9309  		}
  9310  		c := auxIntToInt64(y.AuxInt)
  9311  		if !(uint64(c) <= 0x7FFF) {
  9312  			break
  9313  		}
  9314  		v.copyOf(y)
  9315  		return true
  9316  	}
  9317  	// match: (MOVHreg (SRAWconst [c] (MOVBreg x)))
  9318  	// result: (SRAWconst [c] (MOVBreg x))
  9319  	for {
  9320  		if v_0.Op != OpPPC64SRAWconst {
  9321  			break
  9322  		}
  9323  		c := auxIntToInt64(v_0.AuxInt)
  9324  		v_0_0 := v_0.Args[0]
  9325  		if v_0_0.Op != OpPPC64MOVBreg {
  9326  			break
  9327  		}
  9328  		x := v_0_0.Args[0]
  9329  		v.reset(OpPPC64SRAWconst)
  9330  		v.AuxInt = int64ToAuxInt(c)
  9331  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
  9332  		v0.AddArg(x)
  9333  		v.AddArg(v0)
  9334  		return true
  9335  	}
  9336  	// match: (MOVHreg (SRAWconst [c] (MOVHreg x)))
  9337  	// result: (SRAWconst [c] (MOVHreg x))
  9338  	for {
  9339  		if v_0.Op != OpPPC64SRAWconst {
  9340  			break
  9341  		}
  9342  		c := auxIntToInt64(v_0.AuxInt)
  9343  		v_0_0 := v_0.Args[0]
  9344  		if v_0_0.Op != OpPPC64MOVHreg {
  9345  			break
  9346  		}
  9347  		x := v_0_0.Args[0]
  9348  		v.reset(OpPPC64SRAWconst)
  9349  		v.AuxInt = int64ToAuxInt(c)
  9350  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
  9351  		v0.AddArg(x)
  9352  		v.AddArg(v0)
  9353  		return true
  9354  	}
  9355  	// match: (MOVHreg (SRAWconst [c] x))
  9356  	// cond: x.Type.Size() <= 16
  9357  	// result: (SRAWconst [c] x)
  9358  	for {
  9359  		if v_0.Op != OpPPC64SRAWconst {
  9360  			break
  9361  		}
  9362  		c := auxIntToInt64(v_0.AuxInt)
  9363  		x := v_0.Args[0]
  9364  		if !(x.Type.Size() <= 16) {
  9365  			break
  9366  		}
  9367  		v.reset(OpPPC64SRAWconst)
  9368  		v.AuxInt = int64ToAuxInt(c)
  9369  		v.AddArg(x)
  9370  		return true
  9371  	}
  9372  	// match: (MOVHreg (SRDconst [c] x))
  9373  	// cond: c>48
  9374  	// result: (SRDconst [c] x)
  9375  	for {
  9376  		if v_0.Op != OpPPC64SRDconst {
  9377  			break
  9378  		}
  9379  		c := auxIntToInt64(v_0.AuxInt)
  9380  		x := v_0.Args[0]
  9381  		if !(c > 48) {
  9382  			break
  9383  		}
  9384  		v.reset(OpPPC64SRDconst)
  9385  		v.AuxInt = int64ToAuxInt(c)
  9386  		v.AddArg(x)
  9387  		return true
  9388  	}
  9389  	// match: (MOVHreg (SRDconst [c] x))
  9390  	// cond: c==48
  9391  	// result: (SRADconst [c] x)
  9392  	for {
  9393  		if v_0.Op != OpPPC64SRDconst {
  9394  			break
  9395  		}
  9396  		c := auxIntToInt64(v_0.AuxInt)
  9397  		x := v_0.Args[0]
  9398  		if !(c == 48) {
  9399  			break
  9400  		}
  9401  		v.reset(OpPPC64SRADconst)
  9402  		v.AuxInt = int64ToAuxInt(c)
  9403  		v.AddArg(x)
  9404  		return true
  9405  	}
  9406  	// match: (MOVHreg (SRADconst [c] x))
  9407  	// cond: c>=48
  9408  	// result: (SRADconst [c] x)
  9409  	for {
  9410  		if v_0.Op != OpPPC64SRADconst {
  9411  			break
  9412  		}
  9413  		c := auxIntToInt64(v_0.AuxInt)
  9414  		x := v_0.Args[0]
  9415  		if !(c >= 48) {
  9416  			break
  9417  		}
  9418  		v.reset(OpPPC64SRADconst)
  9419  		v.AuxInt = int64ToAuxInt(c)
  9420  		v.AddArg(x)
  9421  		return true
  9422  	}
  9423  	// match: (MOVHreg (SRWconst [c] x))
  9424  	// cond: c>16
  9425  	// result: (SRWconst [c] x)
  9426  	for {
  9427  		if v_0.Op != OpPPC64SRWconst {
  9428  			break
  9429  		}
  9430  		c := auxIntToInt64(v_0.AuxInt)
  9431  		x := v_0.Args[0]
  9432  		if !(c > 16) {
  9433  			break
  9434  		}
  9435  		v.reset(OpPPC64SRWconst)
  9436  		v.AuxInt = int64ToAuxInt(c)
  9437  		v.AddArg(x)
  9438  		return true
  9439  	}
  9440  	// match: (MOVHreg (SRAWconst [c] x))
  9441  	// cond: c>=16
  9442  	// result: (SRAWconst [c] x)
  9443  	for {
  9444  		if v_0.Op != OpPPC64SRAWconst {
  9445  			break
  9446  		}
  9447  		c := auxIntToInt64(v_0.AuxInt)
  9448  		x := v_0.Args[0]
  9449  		if !(c >= 16) {
  9450  			break
  9451  		}
  9452  		v.reset(OpPPC64SRAWconst)
  9453  		v.AuxInt = int64ToAuxInt(c)
  9454  		v.AddArg(x)
  9455  		return true
  9456  	}
  9457  	// match: (MOVHreg (SRWconst [c] x))
  9458  	// cond: c==16
  9459  	// result: (SRAWconst [c] x)
  9460  	for {
  9461  		if v_0.Op != OpPPC64SRWconst {
  9462  			break
  9463  		}
  9464  		c := auxIntToInt64(v_0.AuxInt)
  9465  		x := v_0.Args[0]
  9466  		if !(c == 16) {
  9467  			break
  9468  		}
  9469  		v.reset(OpPPC64SRAWconst)
  9470  		v.AuxInt = int64ToAuxInt(c)
  9471  		v.AddArg(x)
  9472  		return true
  9473  	}
  9474  	// match: (MOVHreg y:(MOVHreg _))
  9475  	// result: y
  9476  	for {
  9477  		y := v_0
  9478  		if y.Op != OpPPC64MOVHreg {
  9479  			break
  9480  		}
  9481  		v.copyOf(y)
  9482  		return true
  9483  	}
  9484  	// match: (MOVHreg y:(MOVBreg _))
  9485  	// result: y
  9486  	for {
  9487  		y := v_0
  9488  		if y.Op != OpPPC64MOVBreg {
  9489  			break
  9490  		}
  9491  		v.copyOf(y)
  9492  		return true
  9493  	}
  9494  	// match: (MOVHreg y:(MOVHZreg x))
  9495  	// result: (MOVHreg x)
  9496  	for {
  9497  		y := v_0
  9498  		if y.Op != OpPPC64MOVHZreg {
  9499  			break
  9500  		}
  9501  		x := y.Args[0]
  9502  		v.reset(OpPPC64MOVHreg)
  9503  		v.AddArg(x)
  9504  		return true
  9505  	}
  9506  	// match: (MOVHreg x:(MOVHload _ _))
  9507  	// result: x
  9508  	for {
  9509  		x := v_0
  9510  		if x.Op != OpPPC64MOVHload {
  9511  			break
  9512  		}
  9513  		v.copyOf(x)
  9514  		return true
  9515  	}
  9516  	// match: (MOVHreg x:(MOVHloadidx _ _ _))
  9517  	// result: x
  9518  	for {
  9519  		x := v_0
  9520  		if x.Op != OpPPC64MOVHloadidx {
  9521  			break
  9522  		}
  9523  		v.copyOf(x)
  9524  		return true
  9525  	}
  9526  	// match: (MOVHreg x:(Arg <t>))
  9527  	// cond: (is8BitInt(t) || is16BitInt(t)) && t.IsSigned()
  9528  	// result: x
  9529  	for {
  9530  		x := v_0
  9531  		if x.Op != OpArg {
  9532  			break
  9533  		}
  9534  		t := x.Type
  9535  		if !((is8BitInt(t) || is16BitInt(t)) && t.IsSigned()) {
  9536  			break
  9537  		}
  9538  		v.copyOf(x)
  9539  		return true
  9540  	}
  9541  	// match: (MOVHreg (MOVDconst [c]))
  9542  	// result: (MOVDconst [int64(int16(c))])
  9543  	for {
  9544  		if v_0.Op != OpPPC64MOVDconst {
  9545  			break
  9546  		}
  9547  		c := auxIntToInt64(v_0.AuxInt)
  9548  		v.reset(OpPPC64MOVDconst)
  9549  		v.AuxInt = int64ToAuxInt(int64(int16(c)))
  9550  		return true
  9551  	}
  9552  	return false
  9553  }
  9554  func rewriteValuePPC64_OpPPC64MOVHstore(v *Value) bool {
  9555  	v_2 := v.Args[2]
  9556  	v_1 := v.Args[1]
  9557  	v_0 := v.Args[0]
  9558  	b := v.Block
  9559  	// match: (MOVHstore [off1] {sym} (ADDconst [off2] x) val mem)
  9560  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  9561  	// result: (MOVHstore [off1+int32(off2)] {sym} x val mem)
  9562  	for {
  9563  		off1 := auxIntToInt32(v.AuxInt)
  9564  		sym := auxToSym(v.Aux)
  9565  		if v_0.Op != OpPPC64ADDconst {
  9566  			break
  9567  		}
  9568  		off2 := auxIntToInt64(v_0.AuxInt)
  9569  		x := v_0.Args[0]
  9570  		val := v_1
  9571  		mem := v_2
  9572  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  9573  			break
  9574  		}
  9575  		v.reset(OpPPC64MOVHstore)
  9576  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9577  		v.Aux = symToAux(sym)
  9578  		v.AddArg3(x, val, mem)
  9579  		return true
  9580  	}
  9581  	// match: (MOVHstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  9582  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  9583  	// result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  9584  	for {
  9585  		off1 := auxIntToInt32(v.AuxInt)
  9586  		sym1 := auxToSym(v.Aux)
  9587  		p := v_0
  9588  		if p.Op != OpPPC64MOVDaddr {
  9589  			break
  9590  		}
  9591  		off2 := auxIntToInt32(p.AuxInt)
  9592  		sym2 := auxToSym(p.Aux)
  9593  		ptr := p.Args[0]
  9594  		val := v_1
  9595  		mem := v_2
  9596  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  9597  			break
  9598  		}
  9599  		v.reset(OpPPC64MOVHstore)
  9600  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9601  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9602  		v.AddArg3(ptr, val, mem)
  9603  		return true
  9604  	}
  9605  	// match: (MOVHstore [off] {sym} ptr (MOVDconst [0]) mem)
  9606  	// result: (MOVHstorezero [off] {sym} ptr mem)
  9607  	for {
  9608  		off := auxIntToInt32(v.AuxInt)
  9609  		sym := auxToSym(v.Aux)
  9610  		ptr := v_0
  9611  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  9612  			break
  9613  		}
  9614  		mem := v_2
  9615  		v.reset(OpPPC64MOVHstorezero)
  9616  		v.AuxInt = int32ToAuxInt(off)
  9617  		v.Aux = symToAux(sym)
  9618  		v.AddArg2(ptr, mem)
  9619  		return true
  9620  	}
  9621  	// match: (MOVHstore [0] {sym} p:(ADD ptr idx) val mem)
  9622  	// cond: sym == nil && p.Uses == 1
  9623  	// result: (MOVHstoreidx ptr idx val mem)
  9624  	for {
  9625  		if auxIntToInt32(v.AuxInt) != 0 {
  9626  			break
  9627  		}
  9628  		sym := auxToSym(v.Aux)
  9629  		p := v_0
  9630  		if p.Op != OpPPC64ADD {
  9631  			break
  9632  		}
  9633  		idx := p.Args[1]
  9634  		ptr := p.Args[0]
  9635  		val := v_1
  9636  		mem := v_2
  9637  		if !(sym == nil && p.Uses == 1) {
  9638  			break
  9639  		}
  9640  		v.reset(OpPPC64MOVHstoreidx)
  9641  		v.AddArg4(ptr, idx, val, mem)
  9642  		return true
  9643  	}
  9644  	// match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
  9645  	// result: (MOVHstore [off] {sym} ptr x mem)
  9646  	for {
  9647  		off := auxIntToInt32(v.AuxInt)
  9648  		sym := auxToSym(v.Aux)
  9649  		ptr := v_0
  9650  		if v_1.Op != OpPPC64MOVHreg {
  9651  			break
  9652  		}
  9653  		x := v_1.Args[0]
  9654  		mem := v_2
  9655  		v.reset(OpPPC64MOVHstore)
  9656  		v.AuxInt = int32ToAuxInt(off)
  9657  		v.Aux = symToAux(sym)
  9658  		v.AddArg3(ptr, x, mem)
  9659  		return true
  9660  	}
  9661  	// match: (MOVHstore [off] {sym} ptr (MOVHZreg x) mem)
  9662  	// result: (MOVHstore [off] {sym} ptr x mem)
  9663  	for {
  9664  		off := auxIntToInt32(v.AuxInt)
  9665  		sym := auxToSym(v.Aux)
  9666  		ptr := v_0
  9667  		if v_1.Op != OpPPC64MOVHZreg {
  9668  			break
  9669  		}
  9670  		x := v_1.Args[0]
  9671  		mem := v_2
  9672  		v.reset(OpPPC64MOVHstore)
  9673  		v.AuxInt = int32ToAuxInt(off)
  9674  		v.Aux = symToAux(sym)
  9675  		v.AddArg3(ptr, x, mem)
  9676  		return true
  9677  	}
  9678  	// match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
  9679  	// result: (MOVHstore [off] {sym} ptr x mem)
  9680  	for {
  9681  		off := auxIntToInt32(v.AuxInt)
  9682  		sym := auxToSym(v.Aux)
  9683  		ptr := v_0
  9684  		if v_1.Op != OpPPC64MOVWreg {
  9685  			break
  9686  		}
  9687  		x := v_1.Args[0]
  9688  		mem := v_2
  9689  		v.reset(OpPPC64MOVHstore)
  9690  		v.AuxInt = int32ToAuxInt(off)
  9691  		v.Aux = symToAux(sym)
  9692  		v.AddArg3(ptr, x, mem)
  9693  		return true
  9694  	}
  9695  	// match: (MOVHstore [off] {sym} ptr (MOVWZreg x) mem)
  9696  	// result: (MOVHstore [off] {sym} ptr x mem)
  9697  	for {
  9698  		off := auxIntToInt32(v.AuxInt)
  9699  		sym := auxToSym(v.Aux)
  9700  		ptr := v_0
  9701  		if v_1.Op != OpPPC64MOVWZreg {
  9702  			break
  9703  		}
  9704  		x := v_1.Args[0]
  9705  		mem := v_2
  9706  		v.reset(OpPPC64MOVHstore)
  9707  		v.AuxInt = int32ToAuxInt(off)
  9708  		v.Aux = symToAux(sym)
  9709  		v.AddArg3(ptr, x, mem)
  9710  		return true
  9711  	}
  9712  	// match: (MOVHstore [off] {sym} ptr r:(BRH val) mem)
  9713  	// cond: r.Uses == 1
  9714  	// result: (MOVHBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  9715  	for {
  9716  		off := auxIntToInt32(v.AuxInt)
  9717  		sym := auxToSym(v.Aux)
  9718  		ptr := v_0
  9719  		r := v_1
  9720  		if r.Op != OpPPC64BRH {
  9721  			break
  9722  		}
  9723  		val := r.Args[0]
  9724  		mem := v_2
  9725  		if !(r.Uses == 1) {
  9726  			break
  9727  		}
  9728  		v.reset(OpPPC64MOVHBRstore)
  9729  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  9730  		v0.AuxInt = int32ToAuxInt(off)
  9731  		v0.Aux = symToAux(sym)
  9732  		v0.AddArg(ptr)
  9733  		v.AddArg3(v0, val, mem)
  9734  		return true
  9735  	}
  9736  	// match: (MOVHstore [off] {sym} ptr (Bswap16 val) mem)
  9737  	// result: (MOVHBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  9738  	for {
  9739  		off := auxIntToInt32(v.AuxInt)
  9740  		sym := auxToSym(v.Aux)
  9741  		ptr := v_0
  9742  		if v_1.Op != OpBswap16 {
  9743  			break
  9744  		}
  9745  		val := v_1.Args[0]
  9746  		mem := v_2
  9747  		v.reset(OpPPC64MOVHBRstore)
  9748  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  9749  		v0.AuxInt = int32ToAuxInt(off)
  9750  		v0.Aux = symToAux(sym)
  9751  		v0.AddArg(ptr)
  9752  		v.AddArg3(v0, val, mem)
  9753  		return true
  9754  	}
  9755  	return false
  9756  }
  9757  func rewriteValuePPC64_OpPPC64MOVHstoreidx(v *Value) bool {
  9758  	v_3 := v.Args[3]
  9759  	v_2 := v.Args[2]
  9760  	v_1 := v.Args[1]
  9761  	v_0 := v.Args[0]
  9762  	// match: (MOVHstoreidx ptr (MOVDconst [c]) val mem)
  9763  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9764  	// result: (MOVHstore [int32(c)] ptr val mem)
  9765  	for {
  9766  		ptr := v_0
  9767  		if v_1.Op != OpPPC64MOVDconst {
  9768  			break
  9769  		}
  9770  		c := auxIntToInt64(v_1.AuxInt)
  9771  		val := v_2
  9772  		mem := v_3
  9773  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9774  			break
  9775  		}
  9776  		v.reset(OpPPC64MOVHstore)
  9777  		v.AuxInt = int32ToAuxInt(int32(c))
  9778  		v.AddArg3(ptr, val, mem)
  9779  		return true
  9780  	}
  9781  	// match: (MOVHstoreidx (MOVDconst [c]) ptr val mem)
  9782  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9783  	// result: (MOVHstore [int32(c)] ptr val mem)
  9784  	for {
  9785  		if v_0.Op != OpPPC64MOVDconst {
  9786  			break
  9787  		}
  9788  		c := auxIntToInt64(v_0.AuxInt)
  9789  		ptr := v_1
  9790  		val := v_2
  9791  		mem := v_3
  9792  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9793  			break
  9794  		}
  9795  		v.reset(OpPPC64MOVHstore)
  9796  		v.AuxInt = int32ToAuxInt(int32(c))
  9797  		v.AddArg3(ptr, val, mem)
  9798  		return true
  9799  	}
  9800  	// match: (MOVHstoreidx ptr idx (MOVHreg x) mem)
  9801  	// result: (MOVHstoreidx ptr idx x mem)
  9802  	for {
  9803  		ptr := v_0
  9804  		idx := v_1
  9805  		if v_2.Op != OpPPC64MOVHreg {
  9806  			break
  9807  		}
  9808  		x := v_2.Args[0]
  9809  		mem := v_3
  9810  		v.reset(OpPPC64MOVHstoreidx)
  9811  		v.AddArg4(ptr, idx, x, mem)
  9812  		return true
  9813  	}
  9814  	// match: (MOVHstoreidx ptr idx (MOVHZreg x) mem)
  9815  	// result: (MOVHstoreidx ptr idx x mem)
  9816  	for {
  9817  		ptr := v_0
  9818  		idx := v_1
  9819  		if v_2.Op != OpPPC64MOVHZreg {
  9820  			break
  9821  		}
  9822  		x := v_2.Args[0]
  9823  		mem := v_3
  9824  		v.reset(OpPPC64MOVHstoreidx)
  9825  		v.AddArg4(ptr, idx, x, mem)
  9826  		return true
  9827  	}
  9828  	// match: (MOVHstoreidx ptr idx (MOVWreg x) mem)
  9829  	// result: (MOVHstoreidx ptr idx x mem)
  9830  	for {
  9831  		ptr := v_0
  9832  		idx := v_1
  9833  		if v_2.Op != OpPPC64MOVWreg {
  9834  			break
  9835  		}
  9836  		x := v_2.Args[0]
  9837  		mem := v_3
  9838  		v.reset(OpPPC64MOVHstoreidx)
  9839  		v.AddArg4(ptr, idx, x, mem)
  9840  		return true
  9841  	}
  9842  	// match: (MOVHstoreidx ptr idx (MOVWZreg x) mem)
  9843  	// result: (MOVHstoreidx ptr idx x mem)
  9844  	for {
  9845  		ptr := v_0
  9846  		idx := v_1
  9847  		if v_2.Op != OpPPC64MOVWZreg {
  9848  			break
  9849  		}
  9850  		x := v_2.Args[0]
  9851  		mem := v_3
  9852  		v.reset(OpPPC64MOVHstoreidx)
  9853  		v.AddArg4(ptr, idx, x, mem)
  9854  		return true
  9855  	}
  9856  	// match: (MOVHstoreidx ptr idx r:(BRH val) mem)
  9857  	// cond: r.Uses == 1
  9858  	// result: (MOVHBRstoreidx ptr idx val mem)
  9859  	for {
  9860  		ptr := v_0
  9861  		idx := v_1
  9862  		r := v_2
  9863  		if r.Op != OpPPC64BRH {
  9864  			break
  9865  		}
  9866  		val := r.Args[0]
  9867  		mem := v_3
  9868  		if !(r.Uses == 1) {
  9869  			break
  9870  		}
  9871  		v.reset(OpPPC64MOVHBRstoreidx)
  9872  		v.AddArg4(ptr, idx, val, mem)
  9873  		return true
  9874  	}
  9875  	// match: (MOVHstoreidx ptr idx (Bswap16 val) mem)
  9876  	// result: (MOVHBRstoreidx ptr idx val mem)
  9877  	for {
  9878  		ptr := v_0
  9879  		idx := v_1
  9880  		if v_2.Op != OpBswap16 {
  9881  			break
  9882  		}
  9883  		val := v_2.Args[0]
  9884  		mem := v_3
  9885  		v.reset(OpPPC64MOVHBRstoreidx)
  9886  		v.AddArg4(ptr, idx, val, mem)
  9887  		return true
  9888  	}
  9889  	return false
  9890  }
  9891  func rewriteValuePPC64_OpPPC64MOVHstorezero(v *Value) bool {
  9892  	v_1 := v.Args[1]
  9893  	v_0 := v.Args[0]
  9894  	// match: (MOVHstorezero [off1] {sym} (ADDconst [off2] x) mem)
  9895  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
  9896  	// result: (MOVHstorezero [off1+int32(off2)] {sym} x mem)
  9897  	for {
  9898  		off1 := auxIntToInt32(v.AuxInt)
  9899  		sym := auxToSym(v.Aux)
  9900  		if v_0.Op != OpPPC64ADDconst {
  9901  			break
  9902  		}
  9903  		off2 := auxIntToInt64(v_0.AuxInt)
  9904  		x := v_0.Args[0]
  9905  		mem := v_1
  9906  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
  9907  			break
  9908  		}
  9909  		v.reset(OpPPC64MOVHstorezero)
  9910  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9911  		v.Aux = symToAux(sym)
  9912  		v.AddArg2(x, mem)
  9913  		return true
  9914  	}
  9915  	// match: (MOVHstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
  9916  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  9917  	// result: (MOVHstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
  9918  	for {
  9919  		off1 := auxIntToInt32(v.AuxInt)
  9920  		sym1 := auxToSym(v.Aux)
  9921  		p := v_0
  9922  		if p.Op != OpPPC64MOVDaddr {
  9923  			break
  9924  		}
  9925  		off2 := auxIntToInt32(p.AuxInt)
  9926  		sym2 := auxToSym(p.Aux)
  9927  		x := p.Args[0]
  9928  		mem := v_1
  9929  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  9930  			break
  9931  		}
  9932  		v.reset(OpPPC64MOVHstorezero)
  9933  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9934  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9935  		v.AddArg2(x, mem)
  9936  		return true
  9937  	}
  9938  	return false
  9939  }
  9940  func rewriteValuePPC64_OpPPC64MOVWBRstore(v *Value) bool {
  9941  	v_2 := v.Args[2]
  9942  	v_1 := v.Args[1]
  9943  	v_0 := v.Args[0]
  9944  	// match: (MOVWBRstore ptr (MOVWreg x) mem)
  9945  	// result: (MOVWBRstore ptr x mem)
  9946  	for {
  9947  		ptr := v_0
  9948  		if v_1.Op != OpPPC64MOVWreg {
  9949  			break
  9950  		}
  9951  		x := v_1.Args[0]
  9952  		mem := v_2
  9953  		v.reset(OpPPC64MOVWBRstore)
  9954  		v.AddArg3(ptr, x, mem)
  9955  		return true
  9956  	}
  9957  	// match: (MOVWBRstore ptr (MOVWZreg x) mem)
  9958  	// result: (MOVWBRstore ptr x mem)
  9959  	for {
  9960  		ptr := v_0
  9961  		if v_1.Op != OpPPC64MOVWZreg {
  9962  			break
  9963  		}
  9964  		x := v_1.Args[0]
  9965  		mem := v_2
  9966  		v.reset(OpPPC64MOVWBRstore)
  9967  		v.AddArg3(ptr, x, mem)
  9968  		return true
  9969  	}
  9970  	return false
  9971  }
  9972  func rewriteValuePPC64_OpPPC64MOVWZload(v *Value) bool {
  9973  	v_1 := v.Args[1]
  9974  	v_0 := v.Args[0]
  9975  	// match: (MOVWZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  9976  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  9977  	// result: (MOVWZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9978  	for {
  9979  		off1 := auxIntToInt32(v.AuxInt)
  9980  		sym1 := auxToSym(v.Aux)
  9981  		p := v_0
  9982  		if p.Op != OpPPC64MOVDaddr {
  9983  			break
  9984  		}
  9985  		off2 := auxIntToInt32(p.AuxInt)
  9986  		sym2 := auxToSym(p.Aux)
  9987  		ptr := p.Args[0]
  9988  		mem := v_1
  9989  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  9990  			break
  9991  		}
  9992  		v.reset(OpPPC64MOVWZload)
  9993  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9994  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9995  		v.AddArg2(ptr, mem)
  9996  		return true
  9997  	}
  9998  	// match: (MOVWZload [off1] {sym} (ADDconst [off2] x) mem)
  9999  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 10000  	// result: (MOVWZload [off1+int32(off2)] {sym} x mem)
 10001  	for {
 10002  		off1 := auxIntToInt32(v.AuxInt)
 10003  		sym := auxToSym(v.Aux)
 10004  		if v_0.Op != OpPPC64ADDconst {
 10005  			break
 10006  		}
 10007  		off2 := auxIntToInt64(v_0.AuxInt)
 10008  		x := v_0.Args[0]
 10009  		mem := v_1
 10010  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 10011  			break
 10012  		}
 10013  		v.reset(OpPPC64MOVWZload)
 10014  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10015  		v.Aux = symToAux(sym)
 10016  		v.AddArg2(x, mem)
 10017  		return true
 10018  	}
 10019  	// match: (MOVWZload [0] {sym} p:(ADD ptr idx) mem)
 10020  	// cond: sym == nil && p.Uses == 1
 10021  	// result: (MOVWZloadidx ptr idx mem)
 10022  	for {
 10023  		if auxIntToInt32(v.AuxInt) != 0 {
 10024  			break
 10025  		}
 10026  		sym := auxToSym(v.Aux)
 10027  		p := v_0
 10028  		if p.Op != OpPPC64ADD {
 10029  			break
 10030  		}
 10031  		idx := p.Args[1]
 10032  		ptr := p.Args[0]
 10033  		mem := v_1
 10034  		if !(sym == nil && p.Uses == 1) {
 10035  			break
 10036  		}
 10037  		v.reset(OpPPC64MOVWZloadidx)
 10038  		v.AddArg3(ptr, idx, mem)
 10039  		return true
 10040  	}
 10041  	return false
 10042  }
 10043  func rewriteValuePPC64_OpPPC64MOVWZloadidx(v *Value) bool {
 10044  	v_2 := v.Args[2]
 10045  	v_1 := v.Args[1]
 10046  	v_0 := v.Args[0]
 10047  	// match: (MOVWZloadidx ptr (MOVDconst [c]) mem)
 10048  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10049  	// result: (MOVWZload [int32(c)] ptr mem)
 10050  	for {
 10051  		ptr := v_0
 10052  		if v_1.Op != OpPPC64MOVDconst {
 10053  			break
 10054  		}
 10055  		c := auxIntToInt64(v_1.AuxInt)
 10056  		mem := v_2
 10057  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10058  			break
 10059  		}
 10060  		v.reset(OpPPC64MOVWZload)
 10061  		v.AuxInt = int32ToAuxInt(int32(c))
 10062  		v.AddArg2(ptr, mem)
 10063  		return true
 10064  	}
 10065  	// match: (MOVWZloadidx (MOVDconst [c]) ptr mem)
 10066  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10067  	// result: (MOVWZload [int32(c)] ptr mem)
 10068  	for {
 10069  		if v_0.Op != OpPPC64MOVDconst {
 10070  			break
 10071  		}
 10072  		c := auxIntToInt64(v_0.AuxInt)
 10073  		ptr := v_1
 10074  		mem := v_2
 10075  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10076  			break
 10077  		}
 10078  		v.reset(OpPPC64MOVWZload)
 10079  		v.AuxInt = int32ToAuxInt(int32(c))
 10080  		v.AddArg2(ptr, mem)
 10081  		return true
 10082  	}
 10083  	return false
 10084  }
 10085  func rewriteValuePPC64_OpPPC64MOVWZreg(v *Value) bool {
 10086  	v_0 := v.Args[0]
 10087  	b := v.Block
 10088  	typ := &b.Func.Config.Types
 10089  	// match: (MOVWZreg y:(ANDconst [c] _))
 10090  	// cond: uint64(c) <= 0xFFFFFFFF
 10091  	// result: y
 10092  	for {
 10093  		y := v_0
 10094  		if y.Op != OpPPC64ANDconst {
 10095  			break
 10096  		}
 10097  		c := auxIntToInt64(y.AuxInt)
 10098  		if !(uint64(c) <= 0xFFFFFFFF) {
 10099  			break
 10100  		}
 10101  		v.copyOf(y)
 10102  		return true
 10103  	}
 10104  	// match: (MOVWZreg y:(AND (MOVDconst [c]) _))
 10105  	// cond: uint64(c) <= 0xFFFFFFFF
 10106  	// result: y
 10107  	for {
 10108  		y := v_0
 10109  		if y.Op != OpPPC64AND {
 10110  			break
 10111  		}
 10112  		y_0 := y.Args[0]
 10113  		y_1 := y.Args[1]
 10114  		for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
 10115  			if y_0.Op != OpPPC64MOVDconst {
 10116  				continue
 10117  			}
 10118  			c := auxIntToInt64(y_0.AuxInt)
 10119  			if !(uint64(c) <= 0xFFFFFFFF) {
 10120  				continue
 10121  			}
 10122  			v.copyOf(y)
 10123  			return true
 10124  		}
 10125  		break
 10126  	}
 10127  	// match: (MOVWZreg (SRWconst [c] (MOVBZreg x)))
 10128  	// result: (SRWconst [c] (MOVBZreg x))
 10129  	for {
 10130  		if v_0.Op != OpPPC64SRWconst {
 10131  			break
 10132  		}
 10133  		c := auxIntToInt64(v_0.AuxInt)
 10134  		v_0_0 := v_0.Args[0]
 10135  		if v_0_0.Op != OpPPC64MOVBZreg {
 10136  			break
 10137  		}
 10138  		x := v_0_0.Args[0]
 10139  		v.reset(OpPPC64SRWconst)
 10140  		v.AuxInt = int64ToAuxInt(c)
 10141  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 10142  		v0.AddArg(x)
 10143  		v.AddArg(v0)
 10144  		return true
 10145  	}
 10146  	// match: (MOVWZreg (SRWconst [c] (MOVHZreg x)))
 10147  	// result: (SRWconst [c] (MOVHZreg x))
 10148  	for {
 10149  		if v_0.Op != OpPPC64SRWconst {
 10150  			break
 10151  		}
 10152  		c := auxIntToInt64(v_0.AuxInt)
 10153  		v_0_0 := v_0.Args[0]
 10154  		if v_0_0.Op != OpPPC64MOVHZreg {
 10155  			break
 10156  		}
 10157  		x := v_0_0.Args[0]
 10158  		v.reset(OpPPC64SRWconst)
 10159  		v.AuxInt = int64ToAuxInt(c)
 10160  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 10161  		v0.AddArg(x)
 10162  		v.AddArg(v0)
 10163  		return true
 10164  	}
 10165  	// match: (MOVWZreg (SRWconst [c] (MOVWZreg x)))
 10166  	// result: (SRWconst [c] (MOVWZreg x))
 10167  	for {
 10168  		if v_0.Op != OpPPC64SRWconst {
 10169  			break
 10170  		}
 10171  		c := auxIntToInt64(v_0.AuxInt)
 10172  		v_0_0 := v_0.Args[0]
 10173  		if v_0_0.Op != OpPPC64MOVWZreg {
 10174  			break
 10175  		}
 10176  		x := v_0_0.Args[0]
 10177  		v.reset(OpPPC64SRWconst)
 10178  		v.AuxInt = int64ToAuxInt(c)
 10179  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
 10180  		v0.AddArg(x)
 10181  		v.AddArg(v0)
 10182  		return true
 10183  	}
 10184  	// match: (MOVWZreg (SRWconst [c] x))
 10185  	// cond: x.Type.Size() <= 32
 10186  	// result: (SRWconst [c] x)
 10187  	for {
 10188  		if v_0.Op != OpPPC64SRWconst {
 10189  			break
 10190  		}
 10191  		c := auxIntToInt64(v_0.AuxInt)
 10192  		x := v_0.Args[0]
 10193  		if !(x.Type.Size() <= 32) {
 10194  			break
 10195  		}
 10196  		v.reset(OpPPC64SRWconst)
 10197  		v.AuxInt = int64ToAuxInt(c)
 10198  		v.AddArg(x)
 10199  		return true
 10200  	}
 10201  	// match: (MOVWZreg (SRDconst [c] x))
 10202  	// cond: c>=32
 10203  	// result: (SRDconst [c] x)
 10204  	for {
 10205  		if v_0.Op != OpPPC64SRDconst {
 10206  			break
 10207  		}
 10208  		c := auxIntToInt64(v_0.AuxInt)
 10209  		x := v_0.Args[0]
 10210  		if !(c >= 32) {
 10211  			break
 10212  		}
 10213  		v.reset(OpPPC64SRDconst)
 10214  		v.AuxInt = int64ToAuxInt(c)
 10215  		v.AddArg(x)
 10216  		return true
 10217  	}
 10218  	// match: (MOVWZreg (RLWINM [r] y))
 10219  	// cond: mergePPC64MovwzregRlwinm(r) != 0
 10220  	// result: (RLWINM [mergePPC64MovwzregRlwinm(r)] y)
 10221  	for {
 10222  		if v_0.Op != OpPPC64RLWINM {
 10223  			break
 10224  		}
 10225  		r := auxIntToInt64(v_0.AuxInt)
 10226  		y := v_0.Args[0]
 10227  		if !(mergePPC64MovwzregRlwinm(r) != 0) {
 10228  			break
 10229  		}
 10230  		v.reset(OpPPC64RLWINM)
 10231  		v.AuxInt = int64ToAuxInt(mergePPC64MovwzregRlwinm(r))
 10232  		v.AddArg(y)
 10233  		return true
 10234  	}
 10235  	// match: (MOVWZreg w:(SLWconst u))
 10236  	// result: w
 10237  	for {
 10238  		w := v_0
 10239  		if w.Op != OpPPC64SLWconst {
 10240  			break
 10241  		}
 10242  		v.copyOf(w)
 10243  		return true
 10244  	}
 10245  	// match: (MOVWZreg y:(MOVWZreg _))
 10246  	// result: y
 10247  	for {
 10248  		y := v_0
 10249  		if y.Op != OpPPC64MOVWZreg {
 10250  			break
 10251  		}
 10252  		v.copyOf(y)
 10253  		return true
 10254  	}
 10255  	// match: (MOVWZreg y:(MOVHZreg _))
 10256  	// result: y
 10257  	for {
 10258  		y := v_0
 10259  		if y.Op != OpPPC64MOVHZreg {
 10260  			break
 10261  		}
 10262  		v.copyOf(y)
 10263  		return true
 10264  	}
 10265  	// match: (MOVWZreg y:(MOVBZreg _))
 10266  	// result: y
 10267  	for {
 10268  		y := v_0
 10269  		if y.Op != OpPPC64MOVBZreg {
 10270  			break
 10271  		}
 10272  		v.copyOf(y)
 10273  		return true
 10274  	}
 10275  	// match: (MOVWZreg y:(MOVHBRload _ _))
 10276  	// result: y
 10277  	for {
 10278  		y := v_0
 10279  		if y.Op != OpPPC64MOVHBRload {
 10280  			break
 10281  		}
 10282  		v.copyOf(y)
 10283  		return true
 10284  	}
 10285  	// match: (MOVWZreg y:(MOVWBRload _ _))
 10286  	// result: y
 10287  	for {
 10288  		y := v_0
 10289  		if y.Op != OpPPC64MOVWBRload {
 10290  			break
 10291  		}
 10292  		v.copyOf(y)
 10293  		return true
 10294  	}
 10295  	// match: (MOVWZreg y:(MOVWreg x))
 10296  	// result: (MOVWZreg x)
 10297  	for {
 10298  		y := v_0
 10299  		if y.Op != OpPPC64MOVWreg {
 10300  			break
 10301  		}
 10302  		x := y.Args[0]
 10303  		v.reset(OpPPC64MOVWZreg)
 10304  		v.AddArg(x)
 10305  		return true
 10306  	}
 10307  	// match: (MOVWZreg (OR <t> x (MOVWZreg y)))
 10308  	// result: (MOVWZreg (OR <t> x y))
 10309  	for {
 10310  		if v_0.Op != OpPPC64OR {
 10311  			break
 10312  		}
 10313  		t := v_0.Type
 10314  		_ = v_0.Args[1]
 10315  		v_0_0 := v_0.Args[0]
 10316  		v_0_1 := v_0.Args[1]
 10317  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10318  			x := v_0_0
 10319  			if v_0_1.Op != OpPPC64MOVWZreg {
 10320  				continue
 10321  			}
 10322  			y := v_0_1.Args[0]
 10323  			v.reset(OpPPC64MOVWZreg)
 10324  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
 10325  			v0.AddArg2(x, y)
 10326  			v.AddArg(v0)
 10327  			return true
 10328  		}
 10329  		break
 10330  	}
 10331  	// match: (MOVWZreg (XOR <t> x (MOVWZreg y)))
 10332  	// result: (MOVWZreg (XOR <t> x y))
 10333  	for {
 10334  		if v_0.Op != OpPPC64XOR {
 10335  			break
 10336  		}
 10337  		t := v_0.Type
 10338  		_ = v_0.Args[1]
 10339  		v_0_0 := v_0.Args[0]
 10340  		v_0_1 := v_0.Args[1]
 10341  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10342  			x := v_0_0
 10343  			if v_0_1.Op != OpPPC64MOVWZreg {
 10344  				continue
 10345  			}
 10346  			y := v_0_1.Args[0]
 10347  			v.reset(OpPPC64MOVWZreg)
 10348  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
 10349  			v0.AddArg2(x, y)
 10350  			v.AddArg(v0)
 10351  			return true
 10352  		}
 10353  		break
 10354  	}
 10355  	// match: (MOVWZreg (AND <t> x (MOVWZreg y)))
 10356  	// result: (MOVWZreg (AND <t> x y))
 10357  	for {
 10358  		if v_0.Op != OpPPC64AND {
 10359  			break
 10360  		}
 10361  		t := v_0.Type
 10362  		_ = v_0.Args[1]
 10363  		v_0_0 := v_0.Args[0]
 10364  		v_0_1 := v_0.Args[1]
 10365  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10366  			x := v_0_0
 10367  			if v_0_1.Op != OpPPC64MOVWZreg {
 10368  				continue
 10369  			}
 10370  			y := v_0_1.Args[0]
 10371  			v.reset(OpPPC64MOVWZreg)
 10372  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
 10373  			v0.AddArg2(x, y)
 10374  			v.AddArg(v0)
 10375  			return true
 10376  		}
 10377  		break
 10378  	}
 10379  	// match: (MOVWZreg z:(ANDconst [c] (MOVBZload ptr x)))
 10380  	// result: z
 10381  	for {
 10382  		z := v_0
 10383  		if z.Op != OpPPC64ANDconst {
 10384  			break
 10385  		}
 10386  		z_0 := z.Args[0]
 10387  		if z_0.Op != OpPPC64MOVBZload {
 10388  			break
 10389  		}
 10390  		v.copyOf(z)
 10391  		return true
 10392  	}
 10393  	// match: (MOVWZreg z:(AND y (MOVWZload ptr x)))
 10394  	// result: z
 10395  	for {
 10396  		z := v_0
 10397  		if z.Op != OpPPC64AND {
 10398  			break
 10399  		}
 10400  		_ = z.Args[1]
 10401  		z_0 := z.Args[0]
 10402  		z_1 := z.Args[1]
 10403  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 10404  			if z_1.Op != OpPPC64MOVWZload {
 10405  				continue
 10406  			}
 10407  			v.copyOf(z)
 10408  			return true
 10409  		}
 10410  		break
 10411  	}
 10412  	// match: (MOVWZreg z:(ANDconst [c] (MOVHZload ptr x)))
 10413  	// result: z
 10414  	for {
 10415  		z := v_0
 10416  		if z.Op != OpPPC64ANDconst {
 10417  			break
 10418  		}
 10419  		z_0 := z.Args[0]
 10420  		if z_0.Op != OpPPC64MOVHZload {
 10421  			break
 10422  		}
 10423  		v.copyOf(z)
 10424  		return true
 10425  	}
 10426  	// match: (MOVWZreg z:(ANDconst [c] (MOVWZload ptr x)))
 10427  	// result: z
 10428  	for {
 10429  		z := v_0
 10430  		if z.Op != OpPPC64ANDconst {
 10431  			break
 10432  		}
 10433  		z_0 := z.Args[0]
 10434  		if z_0.Op != OpPPC64MOVWZload {
 10435  			break
 10436  		}
 10437  		v.copyOf(z)
 10438  		return true
 10439  	}
 10440  	// match: (MOVWZreg x:(MOVBZload _ _))
 10441  	// result: x
 10442  	for {
 10443  		x := v_0
 10444  		if x.Op != OpPPC64MOVBZload {
 10445  			break
 10446  		}
 10447  		v.copyOf(x)
 10448  		return true
 10449  	}
 10450  	// match: (MOVWZreg x:(MOVBZloadidx _ _ _))
 10451  	// result: x
 10452  	for {
 10453  		x := v_0
 10454  		if x.Op != OpPPC64MOVBZloadidx {
 10455  			break
 10456  		}
 10457  		v.copyOf(x)
 10458  		return true
 10459  	}
 10460  	// match: (MOVWZreg x:(MOVHZload _ _))
 10461  	// result: x
 10462  	for {
 10463  		x := v_0
 10464  		if x.Op != OpPPC64MOVHZload {
 10465  			break
 10466  		}
 10467  		v.copyOf(x)
 10468  		return true
 10469  	}
 10470  	// match: (MOVWZreg x:(MOVHZloadidx _ _ _))
 10471  	// result: x
 10472  	for {
 10473  		x := v_0
 10474  		if x.Op != OpPPC64MOVHZloadidx {
 10475  			break
 10476  		}
 10477  		v.copyOf(x)
 10478  		return true
 10479  	}
 10480  	// match: (MOVWZreg x:(MOVWZload _ _))
 10481  	// result: x
 10482  	for {
 10483  		x := v_0
 10484  		if x.Op != OpPPC64MOVWZload {
 10485  			break
 10486  		}
 10487  		v.copyOf(x)
 10488  		return true
 10489  	}
 10490  	// match: (MOVWZreg x:(MOVWZloadidx _ _ _))
 10491  	// result: x
 10492  	for {
 10493  		x := v_0
 10494  		if x.Op != OpPPC64MOVWZloadidx {
 10495  			break
 10496  		}
 10497  		v.copyOf(x)
 10498  		return true
 10499  	}
 10500  	// match: (MOVWZreg x:(Select0 (LoweredAtomicLoad32 _ _)))
 10501  	// result: x
 10502  	for {
 10503  		x := v_0
 10504  		if x.Op != OpSelect0 {
 10505  			break
 10506  		}
 10507  		x_0 := x.Args[0]
 10508  		if x_0.Op != OpPPC64LoweredAtomicLoad32 {
 10509  			break
 10510  		}
 10511  		v.copyOf(x)
 10512  		return true
 10513  	}
 10514  	// match: (MOVWZreg x:(Arg <t>))
 10515  	// cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()
 10516  	// result: x
 10517  	for {
 10518  		x := v_0
 10519  		if x.Op != OpArg {
 10520  			break
 10521  		}
 10522  		t := x.Type
 10523  		if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()) {
 10524  			break
 10525  		}
 10526  		v.copyOf(x)
 10527  		return true
 10528  	}
 10529  	// match: (MOVWZreg (MOVDconst [c]))
 10530  	// result: (MOVDconst [int64(uint32(c))])
 10531  	for {
 10532  		if v_0.Op != OpPPC64MOVDconst {
 10533  			break
 10534  		}
 10535  		c := auxIntToInt64(v_0.AuxInt)
 10536  		v.reset(OpPPC64MOVDconst)
 10537  		v.AuxInt = int64ToAuxInt(int64(uint32(c)))
 10538  		return true
 10539  	}
 10540  	return false
 10541  }
 10542  func rewriteValuePPC64_OpPPC64MOVWload(v *Value) bool {
 10543  	v_1 := v.Args[1]
 10544  	v_0 := v.Args[0]
 10545  	// match: (MOVWload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
 10546  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10547  	// result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10548  	for {
 10549  		off1 := auxIntToInt32(v.AuxInt)
 10550  		sym1 := auxToSym(v.Aux)
 10551  		p := v_0
 10552  		if p.Op != OpPPC64MOVDaddr {
 10553  			break
 10554  		}
 10555  		off2 := auxIntToInt32(p.AuxInt)
 10556  		sym2 := auxToSym(p.Aux)
 10557  		ptr := p.Args[0]
 10558  		mem := v_1
 10559  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10560  			break
 10561  		}
 10562  		v.reset(OpPPC64MOVWload)
 10563  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10564  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10565  		v.AddArg2(ptr, mem)
 10566  		return true
 10567  	}
 10568  	// match: (MOVWload [off1] {sym} (ADDconst [off2] x) mem)
 10569  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 10570  	// result: (MOVWload [off1+int32(off2)] {sym} x mem)
 10571  	for {
 10572  		off1 := auxIntToInt32(v.AuxInt)
 10573  		sym := auxToSym(v.Aux)
 10574  		if v_0.Op != OpPPC64ADDconst {
 10575  			break
 10576  		}
 10577  		off2 := auxIntToInt64(v_0.AuxInt)
 10578  		x := v_0.Args[0]
 10579  		mem := v_1
 10580  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 10581  			break
 10582  		}
 10583  		v.reset(OpPPC64MOVWload)
 10584  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10585  		v.Aux = symToAux(sym)
 10586  		v.AddArg2(x, mem)
 10587  		return true
 10588  	}
 10589  	// match: (MOVWload [0] {sym} p:(ADD ptr idx) mem)
 10590  	// cond: sym == nil && p.Uses == 1
 10591  	// result: (MOVWloadidx ptr idx mem)
 10592  	for {
 10593  		if auxIntToInt32(v.AuxInt) != 0 {
 10594  			break
 10595  		}
 10596  		sym := auxToSym(v.Aux)
 10597  		p := v_0
 10598  		if p.Op != OpPPC64ADD {
 10599  			break
 10600  		}
 10601  		idx := p.Args[1]
 10602  		ptr := p.Args[0]
 10603  		mem := v_1
 10604  		if !(sym == nil && p.Uses == 1) {
 10605  			break
 10606  		}
 10607  		v.reset(OpPPC64MOVWloadidx)
 10608  		v.AddArg3(ptr, idx, mem)
 10609  		return true
 10610  	}
 10611  	return false
 10612  }
 10613  func rewriteValuePPC64_OpPPC64MOVWloadidx(v *Value) bool {
 10614  	v_2 := v.Args[2]
 10615  	v_1 := v.Args[1]
 10616  	v_0 := v.Args[0]
 10617  	// match: (MOVWloadidx ptr (MOVDconst [c]) mem)
 10618  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10619  	// result: (MOVWload [int32(c)] ptr mem)
 10620  	for {
 10621  		ptr := v_0
 10622  		if v_1.Op != OpPPC64MOVDconst {
 10623  			break
 10624  		}
 10625  		c := auxIntToInt64(v_1.AuxInt)
 10626  		mem := v_2
 10627  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10628  			break
 10629  		}
 10630  		v.reset(OpPPC64MOVWload)
 10631  		v.AuxInt = int32ToAuxInt(int32(c))
 10632  		v.AddArg2(ptr, mem)
 10633  		return true
 10634  	}
 10635  	// match: (MOVWloadidx (MOVDconst [c]) ptr mem)
 10636  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10637  	// result: (MOVWload [int32(c)] ptr mem)
 10638  	for {
 10639  		if v_0.Op != OpPPC64MOVDconst {
 10640  			break
 10641  		}
 10642  		c := auxIntToInt64(v_0.AuxInt)
 10643  		ptr := v_1
 10644  		mem := v_2
 10645  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10646  			break
 10647  		}
 10648  		v.reset(OpPPC64MOVWload)
 10649  		v.AuxInt = int32ToAuxInt(int32(c))
 10650  		v.AddArg2(ptr, mem)
 10651  		return true
 10652  	}
 10653  	return false
 10654  }
 10655  func rewriteValuePPC64_OpPPC64MOVWreg(v *Value) bool {
 10656  	v_0 := v.Args[0]
 10657  	b := v.Block
 10658  	typ := &b.Func.Config.Types
 10659  	// match: (MOVWreg y:(ANDconst [c] _))
 10660  	// cond: uint64(c) <= 0xFFFF
 10661  	// result: y
 10662  	for {
 10663  		y := v_0
 10664  		if y.Op != OpPPC64ANDconst {
 10665  			break
 10666  		}
 10667  		c := auxIntToInt64(y.AuxInt)
 10668  		if !(uint64(c) <= 0xFFFF) {
 10669  			break
 10670  		}
 10671  		v.copyOf(y)
 10672  		return true
 10673  	}
 10674  	// match: (MOVWreg y:(AND (MOVDconst [c]) _))
 10675  	// cond: uint64(c) <= 0x7FFFFFFF
 10676  	// result: y
 10677  	for {
 10678  		y := v_0
 10679  		if y.Op != OpPPC64AND {
 10680  			break
 10681  		}
 10682  		y_0 := y.Args[0]
 10683  		y_1 := y.Args[1]
 10684  		for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
 10685  			if y_0.Op != OpPPC64MOVDconst {
 10686  				continue
 10687  			}
 10688  			c := auxIntToInt64(y_0.AuxInt)
 10689  			if !(uint64(c) <= 0x7FFFFFFF) {
 10690  				continue
 10691  			}
 10692  			v.copyOf(y)
 10693  			return true
 10694  		}
 10695  		break
 10696  	}
 10697  	// match: (MOVWreg (SRAWconst [c] (MOVBreg x)))
 10698  	// result: (SRAWconst [c] (MOVBreg x))
 10699  	for {
 10700  		if v_0.Op != OpPPC64SRAWconst {
 10701  			break
 10702  		}
 10703  		c := auxIntToInt64(v_0.AuxInt)
 10704  		v_0_0 := v_0.Args[0]
 10705  		if v_0_0.Op != OpPPC64MOVBreg {
 10706  			break
 10707  		}
 10708  		x := v_0_0.Args[0]
 10709  		v.reset(OpPPC64SRAWconst)
 10710  		v.AuxInt = int64ToAuxInt(c)
 10711  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 10712  		v0.AddArg(x)
 10713  		v.AddArg(v0)
 10714  		return true
 10715  	}
 10716  	// match: (MOVWreg (SRAWconst [c] (MOVHreg x)))
 10717  	// result: (SRAWconst [c] (MOVHreg x))
 10718  	for {
 10719  		if v_0.Op != OpPPC64SRAWconst {
 10720  			break
 10721  		}
 10722  		c := auxIntToInt64(v_0.AuxInt)
 10723  		v_0_0 := v_0.Args[0]
 10724  		if v_0_0.Op != OpPPC64MOVHreg {
 10725  			break
 10726  		}
 10727  		x := v_0_0.Args[0]
 10728  		v.reset(OpPPC64SRAWconst)
 10729  		v.AuxInt = int64ToAuxInt(c)
 10730  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 10731  		v0.AddArg(x)
 10732  		v.AddArg(v0)
 10733  		return true
 10734  	}
 10735  	// match: (MOVWreg (SRAWconst [c] (MOVWreg x)))
 10736  	// result: (SRAWconst [c] (MOVWreg x))
 10737  	for {
 10738  		if v_0.Op != OpPPC64SRAWconst {
 10739  			break
 10740  		}
 10741  		c := auxIntToInt64(v_0.AuxInt)
 10742  		v_0_0 := v_0.Args[0]
 10743  		if v_0_0.Op != OpPPC64MOVWreg {
 10744  			break
 10745  		}
 10746  		x := v_0_0.Args[0]
 10747  		v.reset(OpPPC64SRAWconst)
 10748  		v.AuxInt = int64ToAuxInt(c)
 10749  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWreg, typ.Int64)
 10750  		v0.AddArg(x)
 10751  		v.AddArg(v0)
 10752  		return true
 10753  	}
 10754  	// match: (MOVWreg (SRAWconst [c] x))
 10755  	// cond: x.Type.Size() <= 32
 10756  	// result: (SRAWconst [c] x)
 10757  	for {
 10758  		if v_0.Op != OpPPC64SRAWconst {
 10759  			break
 10760  		}
 10761  		c := auxIntToInt64(v_0.AuxInt)
 10762  		x := v_0.Args[0]
 10763  		if !(x.Type.Size() <= 32) {
 10764  			break
 10765  		}
 10766  		v.reset(OpPPC64SRAWconst)
 10767  		v.AuxInt = int64ToAuxInt(c)
 10768  		v.AddArg(x)
 10769  		return true
 10770  	}
 10771  	// match: (MOVWreg (SRDconst [c] x))
 10772  	// cond: c>32
 10773  	// result: (SRDconst [c] x)
 10774  	for {
 10775  		if v_0.Op != OpPPC64SRDconst {
 10776  			break
 10777  		}
 10778  		c := auxIntToInt64(v_0.AuxInt)
 10779  		x := v_0.Args[0]
 10780  		if !(c > 32) {
 10781  			break
 10782  		}
 10783  		v.reset(OpPPC64SRDconst)
 10784  		v.AuxInt = int64ToAuxInt(c)
 10785  		v.AddArg(x)
 10786  		return true
 10787  	}
 10788  	// match: (MOVWreg (SRADconst [c] x))
 10789  	// cond: c>=32
 10790  	// result: (SRADconst [c] x)
 10791  	for {
 10792  		if v_0.Op != OpPPC64SRADconst {
 10793  			break
 10794  		}
 10795  		c := auxIntToInt64(v_0.AuxInt)
 10796  		x := v_0.Args[0]
 10797  		if !(c >= 32) {
 10798  			break
 10799  		}
 10800  		v.reset(OpPPC64SRADconst)
 10801  		v.AuxInt = int64ToAuxInt(c)
 10802  		v.AddArg(x)
 10803  		return true
 10804  	}
 10805  	// match: (MOVWreg (SRDconst [c] x))
 10806  	// cond: c==32
 10807  	// result: (SRADconst [c] x)
 10808  	for {
 10809  		if v_0.Op != OpPPC64SRDconst {
 10810  			break
 10811  		}
 10812  		c := auxIntToInt64(v_0.AuxInt)
 10813  		x := v_0.Args[0]
 10814  		if !(c == 32) {
 10815  			break
 10816  		}
 10817  		v.reset(OpPPC64SRADconst)
 10818  		v.AuxInt = int64ToAuxInt(c)
 10819  		v.AddArg(x)
 10820  		return true
 10821  	}
 10822  	// match: (MOVWreg y:(MOVWreg _))
 10823  	// result: y
 10824  	for {
 10825  		y := v_0
 10826  		if y.Op != OpPPC64MOVWreg {
 10827  			break
 10828  		}
 10829  		v.copyOf(y)
 10830  		return true
 10831  	}
 10832  	// match: (MOVWreg y:(MOVHreg _))
 10833  	// result: y
 10834  	for {
 10835  		y := v_0
 10836  		if y.Op != OpPPC64MOVHreg {
 10837  			break
 10838  		}
 10839  		v.copyOf(y)
 10840  		return true
 10841  	}
 10842  	// match: (MOVWreg y:(MOVBreg _))
 10843  	// result: y
 10844  	for {
 10845  		y := v_0
 10846  		if y.Op != OpPPC64MOVBreg {
 10847  			break
 10848  		}
 10849  		v.copyOf(y)
 10850  		return true
 10851  	}
 10852  	// match: (MOVWreg y:(MOVWZreg x))
 10853  	// result: (MOVWreg x)
 10854  	for {
 10855  		y := v_0
 10856  		if y.Op != OpPPC64MOVWZreg {
 10857  			break
 10858  		}
 10859  		x := y.Args[0]
 10860  		v.reset(OpPPC64MOVWreg)
 10861  		v.AddArg(x)
 10862  		return true
 10863  	}
 10864  	// match: (MOVWreg x:(MOVHload _ _))
 10865  	// result: x
 10866  	for {
 10867  		x := v_0
 10868  		if x.Op != OpPPC64MOVHload {
 10869  			break
 10870  		}
 10871  		v.copyOf(x)
 10872  		return true
 10873  	}
 10874  	// match: (MOVWreg x:(MOVHloadidx _ _ _))
 10875  	// result: x
 10876  	for {
 10877  		x := v_0
 10878  		if x.Op != OpPPC64MOVHloadidx {
 10879  			break
 10880  		}
 10881  		v.copyOf(x)
 10882  		return true
 10883  	}
 10884  	// match: (MOVWreg x:(MOVWload _ _))
 10885  	// result: x
 10886  	for {
 10887  		x := v_0
 10888  		if x.Op != OpPPC64MOVWload {
 10889  			break
 10890  		}
 10891  		v.copyOf(x)
 10892  		return true
 10893  	}
 10894  	// match: (MOVWreg x:(MOVWloadidx _ _ _))
 10895  	// result: x
 10896  	for {
 10897  		x := v_0
 10898  		if x.Op != OpPPC64MOVWloadidx {
 10899  			break
 10900  		}
 10901  		v.copyOf(x)
 10902  		return true
 10903  	}
 10904  	// match: (MOVWreg x:(Arg <t>))
 10905  	// cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()
 10906  	// result: x
 10907  	for {
 10908  		x := v_0
 10909  		if x.Op != OpArg {
 10910  			break
 10911  		}
 10912  		t := x.Type
 10913  		if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()) {
 10914  			break
 10915  		}
 10916  		v.copyOf(x)
 10917  		return true
 10918  	}
 10919  	// match: (MOVWreg (MOVDconst [c]))
 10920  	// result: (MOVDconst [int64(int32(c))])
 10921  	for {
 10922  		if v_0.Op != OpPPC64MOVDconst {
 10923  			break
 10924  		}
 10925  		c := auxIntToInt64(v_0.AuxInt)
 10926  		v.reset(OpPPC64MOVDconst)
 10927  		v.AuxInt = int64ToAuxInt(int64(int32(c)))
 10928  		return true
 10929  	}
 10930  	return false
 10931  }
 10932  func rewriteValuePPC64_OpPPC64MOVWstore(v *Value) bool {
 10933  	v_2 := v.Args[2]
 10934  	v_1 := v.Args[1]
 10935  	v_0 := v.Args[0]
 10936  	b := v.Block
 10937  	// match: (MOVWstore [off1] {sym} (ADDconst [off2] x) val mem)
 10938  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 10939  	// result: (MOVWstore [off1+int32(off2)] {sym} x val mem)
 10940  	for {
 10941  		off1 := auxIntToInt32(v.AuxInt)
 10942  		sym := auxToSym(v.Aux)
 10943  		if v_0.Op != OpPPC64ADDconst {
 10944  			break
 10945  		}
 10946  		off2 := auxIntToInt64(v_0.AuxInt)
 10947  		x := v_0.Args[0]
 10948  		val := v_1
 10949  		mem := v_2
 10950  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 10951  			break
 10952  		}
 10953  		v.reset(OpPPC64MOVWstore)
 10954  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10955  		v.Aux = symToAux(sym)
 10956  		v.AddArg3(x, val, mem)
 10957  		return true
 10958  	}
 10959  	// match: (MOVWstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
 10960  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10961  	// result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
 10962  	for {
 10963  		off1 := auxIntToInt32(v.AuxInt)
 10964  		sym1 := auxToSym(v.Aux)
 10965  		p := v_0
 10966  		if p.Op != OpPPC64MOVDaddr {
 10967  			break
 10968  		}
 10969  		off2 := auxIntToInt32(p.AuxInt)
 10970  		sym2 := auxToSym(p.Aux)
 10971  		ptr := p.Args[0]
 10972  		val := v_1
 10973  		mem := v_2
 10974  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10975  			break
 10976  		}
 10977  		v.reset(OpPPC64MOVWstore)
 10978  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10979  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10980  		v.AddArg3(ptr, val, mem)
 10981  		return true
 10982  	}
 10983  	// match: (MOVWstore [off] {sym} ptr (MOVDconst [0]) mem)
 10984  	// result: (MOVWstorezero [off] {sym} ptr mem)
 10985  	for {
 10986  		off := auxIntToInt32(v.AuxInt)
 10987  		sym := auxToSym(v.Aux)
 10988  		ptr := v_0
 10989  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
 10990  			break
 10991  		}
 10992  		mem := v_2
 10993  		v.reset(OpPPC64MOVWstorezero)
 10994  		v.AuxInt = int32ToAuxInt(off)
 10995  		v.Aux = symToAux(sym)
 10996  		v.AddArg2(ptr, mem)
 10997  		return true
 10998  	}
 10999  	// match: (MOVWstore [0] {sym} p:(ADD ptr idx) val mem)
 11000  	// cond: sym == nil && p.Uses == 1
 11001  	// result: (MOVWstoreidx ptr idx val mem)
 11002  	for {
 11003  		if auxIntToInt32(v.AuxInt) != 0 {
 11004  			break
 11005  		}
 11006  		sym := auxToSym(v.Aux)
 11007  		p := v_0
 11008  		if p.Op != OpPPC64ADD {
 11009  			break
 11010  		}
 11011  		idx := p.Args[1]
 11012  		ptr := p.Args[0]
 11013  		val := v_1
 11014  		mem := v_2
 11015  		if !(sym == nil && p.Uses == 1) {
 11016  			break
 11017  		}
 11018  		v.reset(OpPPC64MOVWstoreidx)
 11019  		v.AddArg4(ptr, idx, val, mem)
 11020  		return true
 11021  	}
 11022  	// match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
 11023  	// result: (MOVWstore [off] {sym} ptr x mem)
 11024  	for {
 11025  		off := auxIntToInt32(v.AuxInt)
 11026  		sym := auxToSym(v.Aux)
 11027  		ptr := v_0
 11028  		if v_1.Op != OpPPC64MOVWreg {
 11029  			break
 11030  		}
 11031  		x := v_1.Args[0]
 11032  		mem := v_2
 11033  		v.reset(OpPPC64MOVWstore)
 11034  		v.AuxInt = int32ToAuxInt(off)
 11035  		v.Aux = symToAux(sym)
 11036  		v.AddArg3(ptr, x, mem)
 11037  		return true
 11038  	}
 11039  	// match: (MOVWstore [off] {sym} ptr (MOVWZreg x) mem)
 11040  	// result: (MOVWstore [off] {sym} ptr x mem)
 11041  	for {
 11042  		off := auxIntToInt32(v.AuxInt)
 11043  		sym := auxToSym(v.Aux)
 11044  		ptr := v_0
 11045  		if v_1.Op != OpPPC64MOVWZreg {
 11046  			break
 11047  		}
 11048  		x := v_1.Args[0]
 11049  		mem := v_2
 11050  		v.reset(OpPPC64MOVWstore)
 11051  		v.AuxInt = int32ToAuxInt(off)
 11052  		v.Aux = symToAux(sym)
 11053  		v.AddArg3(ptr, x, mem)
 11054  		return true
 11055  	}
 11056  	// match: (MOVWstore [off] {sym} ptr r:(BRW val) mem)
 11057  	// cond: r.Uses == 1
 11058  	// result: (MOVWBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
 11059  	for {
 11060  		off := auxIntToInt32(v.AuxInt)
 11061  		sym := auxToSym(v.Aux)
 11062  		ptr := v_0
 11063  		r := v_1
 11064  		if r.Op != OpPPC64BRW {
 11065  			break
 11066  		}
 11067  		val := r.Args[0]
 11068  		mem := v_2
 11069  		if !(r.Uses == 1) {
 11070  			break
 11071  		}
 11072  		v.reset(OpPPC64MOVWBRstore)
 11073  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
 11074  		v0.AuxInt = int32ToAuxInt(off)
 11075  		v0.Aux = symToAux(sym)
 11076  		v0.AddArg(ptr)
 11077  		v.AddArg3(v0, val, mem)
 11078  		return true
 11079  	}
 11080  	// match: (MOVWstore [off] {sym} ptr (Bswap32 val) mem)
 11081  	// result: (MOVWBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
 11082  	for {
 11083  		off := auxIntToInt32(v.AuxInt)
 11084  		sym := auxToSym(v.Aux)
 11085  		ptr := v_0
 11086  		if v_1.Op != OpBswap32 {
 11087  			break
 11088  		}
 11089  		val := v_1.Args[0]
 11090  		mem := v_2
 11091  		v.reset(OpPPC64MOVWBRstore)
 11092  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
 11093  		v0.AuxInt = int32ToAuxInt(off)
 11094  		v0.Aux = symToAux(sym)
 11095  		v0.AddArg(ptr)
 11096  		v.AddArg3(v0, val, mem)
 11097  		return true
 11098  	}
 11099  	return false
 11100  }
 11101  func rewriteValuePPC64_OpPPC64MOVWstoreidx(v *Value) bool {
 11102  	v_3 := v.Args[3]
 11103  	v_2 := v.Args[2]
 11104  	v_1 := v.Args[1]
 11105  	v_0 := v.Args[0]
 11106  	// match: (MOVWstoreidx ptr (MOVDconst [c]) val mem)
 11107  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 11108  	// result: (MOVWstore [int32(c)] ptr val mem)
 11109  	for {
 11110  		ptr := v_0
 11111  		if v_1.Op != OpPPC64MOVDconst {
 11112  			break
 11113  		}
 11114  		c := auxIntToInt64(v_1.AuxInt)
 11115  		val := v_2
 11116  		mem := v_3
 11117  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 11118  			break
 11119  		}
 11120  		v.reset(OpPPC64MOVWstore)
 11121  		v.AuxInt = int32ToAuxInt(int32(c))
 11122  		v.AddArg3(ptr, val, mem)
 11123  		return true
 11124  	}
 11125  	// match: (MOVWstoreidx (MOVDconst [c]) ptr val mem)
 11126  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 11127  	// result: (MOVWstore [int32(c)] ptr val mem)
 11128  	for {
 11129  		if v_0.Op != OpPPC64MOVDconst {
 11130  			break
 11131  		}
 11132  		c := auxIntToInt64(v_0.AuxInt)
 11133  		ptr := v_1
 11134  		val := v_2
 11135  		mem := v_3
 11136  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 11137  			break
 11138  		}
 11139  		v.reset(OpPPC64MOVWstore)
 11140  		v.AuxInt = int32ToAuxInt(int32(c))
 11141  		v.AddArg3(ptr, val, mem)
 11142  		return true
 11143  	}
 11144  	// match: (MOVWstoreidx ptr idx (MOVWreg x) mem)
 11145  	// result: (MOVWstoreidx ptr idx x mem)
 11146  	for {
 11147  		ptr := v_0
 11148  		idx := v_1
 11149  		if v_2.Op != OpPPC64MOVWreg {
 11150  			break
 11151  		}
 11152  		x := v_2.Args[0]
 11153  		mem := v_3
 11154  		v.reset(OpPPC64MOVWstoreidx)
 11155  		v.AddArg4(ptr, idx, x, mem)
 11156  		return true
 11157  	}
 11158  	// match: (MOVWstoreidx ptr idx (MOVWZreg x) mem)
 11159  	// result: (MOVWstoreidx ptr idx x mem)
 11160  	for {
 11161  		ptr := v_0
 11162  		idx := v_1
 11163  		if v_2.Op != OpPPC64MOVWZreg {
 11164  			break
 11165  		}
 11166  		x := v_2.Args[0]
 11167  		mem := v_3
 11168  		v.reset(OpPPC64MOVWstoreidx)
 11169  		v.AddArg4(ptr, idx, x, mem)
 11170  		return true
 11171  	}
 11172  	// match: (MOVWstoreidx ptr idx r:(BRW val) mem)
 11173  	// cond: r.Uses == 1
 11174  	// result: (MOVWBRstoreidx ptr idx val mem)
 11175  	for {
 11176  		ptr := v_0
 11177  		idx := v_1
 11178  		r := v_2
 11179  		if r.Op != OpPPC64BRW {
 11180  			break
 11181  		}
 11182  		val := r.Args[0]
 11183  		mem := v_3
 11184  		if !(r.Uses == 1) {
 11185  			break
 11186  		}
 11187  		v.reset(OpPPC64MOVWBRstoreidx)
 11188  		v.AddArg4(ptr, idx, val, mem)
 11189  		return true
 11190  	}
 11191  	// match: (MOVWstoreidx ptr idx (Bswap32 val) mem)
 11192  	// result: (MOVWBRstoreidx ptr idx val mem)
 11193  	for {
 11194  		ptr := v_0
 11195  		idx := v_1
 11196  		if v_2.Op != OpBswap32 {
 11197  			break
 11198  		}
 11199  		val := v_2.Args[0]
 11200  		mem := v_3
 11201  		v.reset(OpPPC64MOVWBRstoreidx)
 11202  		v.AddArg4(ptr, idx, val, mem)
 11203  		return true
 11204  	}
 11205  	return false
 11206  }
 11207  func rewriteValuePPC64_OpPPC64MOVWstorezero(v *Value) bool {
 11208  	v_1 := v.Args[1]
 11209  	v_0 := v.Args[0]
 11210  	// match: (MOVWstorezero [off1] {sym} (ADDconst [off2] x) mem)
 11211  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
 11212  	// result: (MOVWstorezero [off1+int32(off2)] {sym} x mem)
 11213  	for {
 11214  		off1 := auxIntToInt32(v.AuxInt)
 11215  		sym := auxToSym(v.Aux)
 11216  		if v_0.Op != OpPPC64ADDconst {
 11217  			break
 11218  		}
 11219  		off2 := auxIntToInt64(v_0.AuxInt)
 11220  		x := v_0.Args[0]
 11221  		mem := v_1
 11222  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
 11223  			break
 11224  		}
 11225  		v.reset(OpPPC64MOVWstorezero)
 11226  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11227  		v.Aux = symToAux(sym)
 11228  		v.AddArg2(x, mem)
 11229  		return true
 11230  	}
 11231  	// match: (MOVWstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
 11232  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 11233  	// result: (MOVWstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
 11234  	for {
 11235  		off1 := auxIntToInt32(v.AuxInt)
 11236  		sym1 := auxToSym(v.Aux)
 11237  		p := v_0
 11238  		if p.Op != OpPPC64MOVDaddr {
 11239  			break
 11240  		}
 11241  		off2 := auxIntToInt32(p.AuxInt)
 11242  		sym2 := auxToSym(p.Aux)
 11243  		x := p.Args[0]
 11244  		mem := v_1
 11245  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 11246  			break
 11247  		}
 11248  		v.reset(OpPPC64MOVWstorezero)
 11249  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11250  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11251  		v.AddArg2(x, mem)
 11252  		return true
 11253  	}
 11254  	return false
 11255  }
 11256  func rewriteValuePPC64_OpPPC64MTVSRD(v *Value) bool {
 11257  	v_0 := v.Args[0]
 11258  	b := v.Block
 11259  	typ := &b.Func.Config.Types
 11260  	// match: (MTVSRD (MOVDconst [c]))
 11261  	// cond: !math.IsNaN(math.Float64frombits(uint64(c)))
 11262  	// result: (FMOVDconst [math.Float64frombits(uint64(c))])
 11263  	for {
 11264  		if v_0.Op != OpPPC64MOVDconst {
 11265  			break
 11266  		}
 11267  		c := auxIntToInt64(v_0.AuxInt)
 11268  		if !(!math.IsNaN(math.Float64frombits(uint64(c)))) {
 11269  			break
 11270  		}
 11271  		v.reset(OpPPC64FMOVDconst)
 11272  		v.AuxInt = float64ToAuxInt(math.Float64frombits(uint64(c)))
 11273  		return true
 11274  	}
 11275  	// match: (MTVSRD x:(MOVDload [off] {sym} ptr mem))
 11276  	// cond: x.Uses == 1 && clobber(x)
 11277  	// result: @x.Block (FMOVDload [off] {sym} ptr mem)
 11278  	for {
 11279  		x := v_0
 11280  		if x.Op != OpPPC64MOVDload {
 11281  			break
 11282  		}
 11283  		off := auxIntToInt32(x.AuxInt)
 11284  		sym := auxToSym(x.Aux)
 11285  		mem := x.Args[1]
 11286  		ptr := x.Args[0]
 11287  		if !(x.Uses == 1 && clobber(x)) {
 11288  			break
 11289  		}
 11290  		b = x.Block
 11291  		v0 := b.NewValue0(x.Pos, OpPPC64FMOVDload, typ.Float64)
 11292  		v.copyOf(v0)
 11293  		v0.AuxInt = int32ToAuxInt(off)
 11294  		v0.Aux = symToAux(sym)
 11295  		v0.AddArg2(ptr, mem)
 11296  		return true
 11297  	}
 11298  	return false
 11299  }
 11300  func rewriteValuePPC64_OpPPC64MULLD(v *Value) bool {
 11301  	v_1 := v.Args[1]
 11302  	v_0 := v.Args[0]
 11303  	// match: (MULLD x (MOVDconst [c]))
 11304  	// cond: is16Bit(c)
 11305  	// result: (MULLDconst [int32(c)] x)
 11306  	for {
 11307  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11308  			x := v_0
 11309  			if v_1.Op != OpPPC64MOVDconst {
 11310  				continue
 11311  			}
 11312  			c := auxIntToInt64(v_1.AuxInt)
 11313  			if !(is16Bit(c)) {
 11314  				continue
 11315  			}
 11316  			v.reset(OpPPC64MULLDconst)
 11317  			v.AuxInt = int32ToAuxInt(int32(c))
 11318  			v.AddArg(x)
 11319  			return true
 11320  		}
 11321  		break
 11322  	}
 11323  	return false
 11324  }
 11325  func rewriteValuePPC64_OpPPC64MULLW(v *Value) bool {
 11326  	v_1 := v.Args[1]
 11327  	v_0 := v.Args[0]
 11328  	// match: (MULLW x (MOVDconst [c]))
 11329  	// cond: is16Bit(c)
 11330  	// result: (MULLWconst [int32(c)] x)
 11331  	for {
 11332  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11333  			x := v_0
 11334  			if v_1.Op != OpPPC64MOVDconst {
 11335  				continue
 11336  			}
 11337  			c := auxIntToInt64(v_1.AuxInt)
 11338  			if !(is16Bit(c)) {
 11339  				continue
 11340  			}
 11341  			v.reset(OpPPC64MULLWconst)
 11342  			v.AuxInt = int32ToAuxInt(int32(c))
 11343  			v.AddArg(x)
 11344  			return true
 11345  		}
 11346  		break
 11347  	}
 11348  	return false
 11349  }
 11350  func rewriteValuePPC64_OpPPC64NEG(v *Value) bool {
 11351  	v_0 := v.Args[0]
 11352  	// match: (NEG (ADDconst [c] x))
 11353  	// cond: is32Bit(-c)
 11354  	// result: (SUBFCconst [-c] x)
 11355  	for {
 11356  		if v_0.Op != OpPPC64ADDconst {
 11357  			break
 11358  		}
 11359  		c := auxIntToInt64(v_0.AuxInt)
 11360  		x := v_0.Args[0]
 11361  		if !(is32Bit(-c)) {
 11362  			break
 11363  		}
 11364  		v.reset(OpPPC64SUBFCconst)
 11365  		v.AuxInt = int64ToAuxInt(-c)
 11366  		v.AddArg(x)
 11367  		return true
 11368  	}
 11369  	// match: (NEG (SUBFCconst [c] x))
 11370  	// cond: is32Bit(-c)
 11371  	// result: (ADDconst [-c] x)
 11372  	for {
 11373  		if v_0.Op != OpPPC64SUBFCconst {
 11374  			break
 11375  		}
 11376  		c := auxIntToInt64(v_0.AuxInt)
 11377  		x := v_0.Args[0]
 11378  		if !(is32Bit(-c)) {
 11379  			break
 11380  		}
 11381  		v.reset(OpPPC64ADDconst)
 11382  		v.AuxInt = int64ToAuxInt(-c)
 11383  		v.AddArg(x)
 11384  		return true
 11385  	}
 11386  	// match: (NEG (SUB x y))
 11387  	// result: (SUB y x)
 11388  	for {
 11389  		if v_0.Op != OpPPC64SUB {
 11390  			break
 11391  		}
 11392  		y := v_0.Args[1]
 11393  		x := v_0.Args[0]
 11394  		v.reset(OpPPC64SUB)
 11395  		v.AddArg2(y, x)
 11396  		return true
 11397  	}
 11398  	// match: (NEG (NEG x))
 11399  	// result: x
 11400  	for {
 11401  		if v_0.Op != OpPPC64NEG {
 11402  			break
 11403  		}
 11404  		x := v_0.Args[0]
 11405  		v.copyOf(x)
 11406  		return true
 11407  	}
 11408  	return false
 11409  }
 11410  func rewriteValuePPC64_OpPPC64NOR(v *Value) bool {
 11411  	v_1 := v.Args[1]
 11412  	v_0 := v.Args[0]
 11413  	// match: (NOR (MOVDconst [c]) (MOVDconst [d]))
 11414  	// result: (MOVDconst [^(c|d)])
 11415  	for {
 11416  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11417  			if v_0.Op != OpPPC64MOVDconst {
 11418  				continue
 11419  			}
 11420  			c := auxIntToInt64(v_0.AuxInt)
 11421  			if v_1.Op != OpPPC64MOVDconst {
 11422  				continue
 11423  			}
 11424  			d := auxIntToInt64(v_1.AuxInt)
 11425  			v.reset(OpPPC64MOVDconst)
 11426  			v.AuxInt = int64ToAuxInt(^(c | d))
 11427  			return true
 11428  		}
 11429  		break
 11430  	}
 11431  	return false
 11432  }
 11433  func rewriteValuePPC64_OpPPC64NotEqual(v *Value) bool {
 11434  	v_0 := v.Args[0]
 11435  	// match: (NotEqual (FlagEQ))
 11436  	// result: (MOVDconst [0])
 11437  	for {
 11438  		if v_0.Op != OpPPC64FlagEQ {
 11439  			break
 11440  		}
 11441  		v.reset(OpPPC64MOVDconst)
 11442  		v.AuxInt = int64ToAuxInt(0)
 11443  		return true
 11444  	}
 11445  	// match: (NotEqual (FlagLT))
 11446  	// result: (MOVDconst [1])
 11447  	for {
 11448  		if v_0.Op != OpPPC64FlagLT {
 11449  			break
 11450  		}
 11451  		v.reset(OpPPC64MOVDconst)
 11452  		v.AuxInt = int64ToAuxInt(1)
 11453  		return true
 11454  	}
 11455  	// match: (NotEqual (FlagGT))
 11456  	// result: (MOVDconst [1])
 11457  	for {
 11458  		if v_0.Op != OpPPC64FlagGT {
 11459  			break
 11460  		}
 11461  		v.reset(OpPPC64MOVDconst)
 11462  		v.AuxInt = int64ToAuxInt(1)
 11463  		return true
 11464  	}
 11465  	// match: (NotEqual (InvertFlags x))
 11466  	// result: (NotEqual x)
 11467  	for {
 11468  		if v_0.Op != OpPPC64InvertFlags {
 11469  			break
 11470  		}
 11471  		x := v_0.Args[0]
 11472  		v.reset(OpPPC64NotEqual)
 11473  		v.AddArg(x)
 11474  		return true
 11475  	}
 11476  	// match: (NotEqual cmp)
 11477  	// result: (SETBCR [2] cmp)
 11478  	for {
 11479  		cmp := v_0
 11480  		v.reset(OpPPC64SETBCR)
 11481  		v.AuxInt = int32ToAuxInt(2)
 11482  		v.AddArg(cmp)
 11483  		return true
 11484  	}
 11485  }
 11486  func rewriteValuePPC64_OpPPC64OR(v *Value) bool {
 11487  	v_1 := v.Args[1]
 11488  	v_0 := v.Args[0]
 11489  	// match: (OR x (NOR y y))
 11490  	// result: (ORN x y)
 11491  	for {
 11492  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11493  			x := v_0
 11494  			if v_1.Op != OpPPC64NOR {
 11495  				continue
 11496  			}
 11497  			y := v_1.Args[1]
 11498  			if y != v_1.Args[0] {
 11499  				continue
 11500  			}
 11501  			v.reset(OpPPC64ORN)
 11502  			v.AddArg2(x, y)
 11503  			return true
 11504  		}
 11505  		break
 11506  	}
 11507  	// match: (OR (MOVDconst [c]) (MOVDconst [d]))
 11508  	// result: (MOVDconst [c|d])
 11509  	for {
 11510  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11511  			if v_0.Op != OpPPC64MOVDconst {
 11512  				continue
 11513  			}
 11514  			c := auxIntToInt64(v_0.AuxInt)
 11515  			if v_1.Op != OpPPC64MOVDconst {
 11516  				continue
 11517  			}
 11518  			d := auxIntToInt64(v_1.AuxInt)
 11519  			v.reset(OpPPC64MOVDconst)
 11520  			v.AuxInt = int64ToAuxInt(c | d)
 11521  			return true
 11522  		}
 11523  		break
 11524  	}
 11525  	// match: (OR x (MOVDconst [c]))
 11526  	// cond: isU32Bit(c)
 11527  	// result: (ORconst [c] x)
 11528  	for {
 11529  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11530  			x := v_0
 11531  			if v_1.Op != OpPPC64MOVDconst {
 11532  				continue
 11533  			}
 11534  			c := auxIntToInt64(v_1.AuxInt)
 11535  			if !(isU32Bit(c)) {
 11536  				continue
 11537  			}
 11538  			v.reset(OpPPC64ORconst)
 11539  			v.AuxInt = int64ToAuxInt(c)
 11540  			v.AddArg(x)
 11541  			return true
 11542  		}
 11543  		break
 11544  	}
 11545  	return false
 11546  }
 11547  func rewriteValuePPC64_OpPPC64ORN(v *Value) bool {
 11548  	v_1 := v.Args[1]
 11549  	v_0 := v.Args[0]
 11550  	// match: (ORN x (MOVDconst [-1]))
 11551  	// result: x
 11552  	for {
 11553  		x := v_0
 11554  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
 11555  			break
 11556  		}
 11557  		v.copyOf(x)
 11558  		return true
 11559  	}
 11560  	// match: (ORN (MOVDconst [c]) (MOVDconst [d]))
 11561  	// result: (MOVDconst [c|^d])
 11562  	for {
 11563  		if v_0.Op != OpPPC64MOVDconst {
 11564  			break
 11565  		}
 11566  		c := auxIntToInt64(v_0.AuxInt)
 11567  		if v_1.Op != OpPPC64MOVDconst {
 11568  			break
 11569  		}
 11570  		d := auxIntToInt64(v_1.AuxInt)
 11571  		v.reset(OpPPC64MOVDconst)
 11572  		v.AuxInt = int64ToAuxInt(c | ^d)
 11573  		return true
 11574  	}
 11575  	return false
 11576  }
 11577  func rewriteValuePPC64_OpPPC64ORconst(v *Value) bool {
 11578  	v_0 := v.Args[0]
 11579  	// match: (ORconst [c] (ORconst [d] x))
 11580  	// result: (ORconst [c|d] x)
 11581  	for {
 11582  		c := auxIntToInt64(v.AuxInt)
 11583  		if v_0.Op != OpPPC64ORconst {
 11584  			break
 11585  		}
 11586  		d := auxIntToInt64(v_0.AuxInt)
 11587  		x := v_0.Args[0]
 11588  		v.reset(OpPPC64ORconst)
 11589  		v.AuxInt = int64ToAuxInt(c | d)
 11590  		v.AddArg(x)
 11591  		return true
 11592  	}
 11593  	// match: (ORconst [-1] _)
 11594  	// result: (MOVDconst [-1])
 11595  	for {
 11596  		if auxIntToInt64(v.AuxInt) != -1 {
 11597  			break
 11598  		}
 11599  		v.reset(OpPPC64MOVDconst)
 11600  		v.AuxInt = int64ToAuxInt(-1)
 11601  		return true
 11602  	}
 11603  	// match: (ORconst [0] x)
 11604  	// result: x
 11605  	for {
 11606  		if auxIntToInt64(v.AuxInt) != 0 {
 11607  			break
 11608  		}
 11609  		x := v_0
 11610  		v.copyOf(x)
 11611  		return true
 11612  	}
 11613  	return false
 11614  }
 11615  func rewriteValuePPC64_OpPPC64RLWINM(v *Value) bool {
 11616  	v_0 := v.Args[0]
 11617  	// match: (RLWINM [r] (MOVHZreg u))
 11618  	// cond: mergePPC64RlwinmAnd(r,0xFFFF) != 0
 11619  	// result: (RLWINM [mergePPC64RlwinmAnd(r,0xFFFF)] u)
 11620  	for {
 11621  		r := auxIntToInt64(v.AuxInt)
 11622  		if v_0.Op != OpPPC64MOVHZreg {
 11623  			break
 11624  		}
 11625  		u := v_0.Args[0]
 11626  		if !(mergePPC64RlwinmAnd(r, 0xFFFF) != 0) {
 11627  			break
 11628  		}
 11629  		v.reset(OpPPC64RLWINM)
 11630  		v.AuxInt = int64ToAuxInt(mergePPC64RlwinmAnd(r, 0xFFFF))
 11631  		v.AddArg(u)
 11632  		return true
 11633  	}
 11634  	// match: (RLWINM [r] (ANDconst [a] u))
 11635  	// cond: mergePPC64RlwinmAnd(r,uint32(a)) != 0
 11636  	// result: (RLWINM [mergePPC64RlwinmAnd(r,uint32(a))] u)
 11637  	for {
 11638  		r := auxIntToInt64(v.AuxInt)
 11639  		if v_0.Op != OpPPC64ANDconst {
 11640  			break
 11641  		}
 11642  		a := auxIntToInt64(v_0.AuxInt)
 11643  		u := v_0.Args[0]
 11644  		if !(mergePPC64RlwinmAnd(r, uint32(a)) != 0) {
 11645  			break
 11646  		}
 11647  		v.reset(OpPPC64RLWINM)
 11648  		v.AuxInt = int64ToAuxInt(mergePPC64RlwinmAnd(r, uint32(a)))
 11649  		v.AddArg(u)
 11650  		return true
 11651  	}
 11652  	return false
 11653  }
 11654  func rewriteValuePPC64_OpPPC64ROTL(v *Value) bool {
 11655  	v_1 := v.Args[1]
 11656  	v_0 := v.Args[0]
 11657  	// match: (ROTL x (MOVDconst [c]))
 11658  	// result: (ROTLconst x [c&63])
 11659  	for {
 11660  		x := v_0
 11661  		if v_1.Op != OpPPC64MOVDconst {
 11662  			break
 11663  		}
 11664  		c := auxIntToInt64(v_1.AuxInt)
 11665  		v.reset(OpPPC64ROTLconst)
 11666  		v.AuxInt = int64ToAuxInt(c & 63)
 11667  		v.AddArg(x)
 11668  		return true
 11669  	}
 11670  	return false
 11671  }
 11672  func rewriteValuePPC64_OpPPC64ROTLW(v *Value) bool {
 11673  	v_1 := v.Args[1]
 11674  	v_0 := v.Args[0]
 11675  	// match: (ROTLW x (MOVDconst [c]))
 11676  	// result: (ROTLWconst x [c&31])
 11677  	for {
 11678  		x := v_0
 11679  		if v_1.Op != OpPPC64MOVDconst {
 11680  			break
 11681  		}
 11682  		c := auxIntToInt64(v_1.AuxInt)
 11683  		v.reset(OpPPC64ROTLWconst)
 11684  		v.AuxInt = int64ToAuxInt(c & 31)
 11685  		v.AddArg(x)
 11686  		return true
 11687  	}
 11688  	return false
 11689  }
 11690  func rewriteValuePPC64_OpPPC64ROTLWconst(v *Value) bool {
 11691  	v_0 := v.Args[0]
 11692  	// match: (ROTLWconst [r] (AND (MOVDconst [m]) x))
 11693  	// cond: isPPC64WordRotateMask(m)
 11694  	// result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
 11695  	for {
 11696  		r := auxIntToInt64(v.AuxInt)
 11697  		if v_0.Op != OpPPC64AND {
 11698  			break
 11699  		}
 11700  		_ = v_0.Args[1]
 11701  		v_0_0 := v_0.Args[0]
 11702  		v_0_1 := v_0.Args[1]
 11703  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 11704  			if v_0_0.Op != OpPPC64MOVDconst {
 11705  				continue
 11706  			}
 11707  			m := auxIntToInt64(v_0_0.AuxInt)
 11708  			x := v_0_1
 11709  			if !(isPPC64WordRotateMask(m)) {
 11710  				continue
 11711  			}
 11712  			v.reset(OpPPC64RLWINM)
 11713  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
 11714  			v.AddArg(x)
 11715  			return true
 11716  		}
 11717  		break
 11718  	}
 11719  	// match: (ROTLWconst [r] (ANDconst [m] x))
 11720  	// cond: isPPC64WordRotateMask(m)
 11721  	// result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
 11722  	for {
 11723  		r := auxIntToInt64(v.AuxInt)
 11724  		if v_0.Op != OpPPC64ANDconst {
 11725  			break
 11726  		}
 11727  		m := auxIntToInt64(v_0.AuxInt)
 11728  		x := v_0.Args[0]
 11729  		if !(isPPC64WordRotateMask(m)) {
 11730  			break
 11731  		}
 11732  		v.reset(OpPPC64RLWINM)
 11733  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
 11734  		v.AddArg(x)
 11735  		return true
 11736  	}
 11737  	return false
 11738  }
 11739  func rewriteValuePPC64_OpPPC64SETBC(v *Value) bool {
 11740  	v_0 := v.Args[0]
 11741  	b := v.Block
 11742  	typ := &b.Func.Config.Types
 11743  	// match: (SETBC [0] (FlagLT))
 11744  	// result: (MOVDconst [1])
 11745  	for {
 11746  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
 11747  			break
 11748  		}
 11749  		v.reset(OpPPC64MOVDconst)
 11750  		v.AuxInt = int64ToAuxInt(1)
 11751  		return true
 11752  	}
 11753  	// match: (SETBC [0] (FlagGT))
 11754  	// result: (MOVDconst [0])
 11755  	for {
 11756  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
 11757  			break
 11758  		}
 11759  		v.reset(OpPPC64MOVDconst)
 11760  		v.AuxInt = int64ToAuxInt(0)
 11761  		return true
 11762  	}
 11763  	// match: (SETBC [0] (FlagEQ))
 11764  	// result: (MOVDconst [0])
 11765  	for {
 11766  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
 11767  			break
 11768  		}
 11769  		v.reset(OpPPC64MOVDconst)
 11770  		v.AuxInt = int64ToAuxInt(0)
 11771  		return true
 11772  	}
 11773  	// match: (SETBC [1] (FlagGT))
 11774  	// result: (MOVDconst [1])
 11775  	for {
 11776  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
 11777  			break
 11778  		}
 11779  		v.reset(OpPPC64MOVDconst)
 11780  		v.AuxInt = int64ToAuxInt(1)
 11781  		return true
 11782  	}
 11783  	// match: (SETBC [1] (FlagLT))
 11784  	// result: (MOVDconst [0])
 11785  	for {
 11786  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
 11787  			break
 11788  		}
 11789  		v.reset(OpPPC64MOVDconst)
 11790  		v.AuxInt = int64ToAuxInt(0)
 11791  		return true
 11792  	}
 11793  	// match: (SETBC [1] (FlagEQ))
 11794  	// result: (MOVDconst [0])
 11795  	for {
 11796  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
 11797  			break
 11798  		}
 11799  		v.reset(OpPPC64MOVDconst)
 11800  		v.AuxInt = int64ToAuxInt(0)
 11801  		return true
 11802  	}
 11803  	// match: (SETBC [2] (FlagEQ))
 11804  	// result: (MOVDconst [1])
 11805  	for {
 11806  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
 11807  			break
 11808  		}
 11809  		v.reset(OpPPC64MOVDconst)
 11810  		v.AuxInt = int64ToAuxInt(1)
 11811  		return true
 11812  	}
 11813  	// match: (SETBC [2] (FlagLT))
 11814  	// result: (MOVDconst [0])
 11815  	for {
 11816  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
 11817  			break
 11818  		}
 11819  		v.reset(OpPPC64MOVDconst)
 11820  		v.AuxInt = int64ToAuxInt(0)
 11821  		return true
 11822  	}
 11823  	// match: (SETBC [2] (FlagGT))
 11824  	// result: (MOVDconst [0])
 11825  	for {
 11826  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
 11827  			break
 11828  		}
 11829  		v.reset(OpPPC64MOVDconst)
 11830  		v.AuxInt = int64ToAuxInt(0)
 11831  		return true
 11832  	}
 11833  	// match: (SETBC [0] (InvertFlags bool))
 11834  	// result: (SETBC [1] bool)
 11835  	for {
 11836  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
 11837  			break
 11838  		}
 11839  		bool := v_0.Args[0]
 11840  		v.reset(OpPPC64SETBC)
 11841  		v.AuxInt = int32ToAuxInt(1)
 11842  		v.AddArg(bool)
 11843  		return true
 11844  	}
 11845  	// match: (SETBC [1] (InvertFlags bool))
 11846  	// result: (SETBC [0] bool)
 11847  	for {
 11848  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
 11849  			break
 11850  		}
 11851  		bool := v_0.Args[0]
 11852  		v.reset(OpPPC64SETBC)
 11853  		v.AuxInt = int32ToAuxInt(0)
 11854  		v.AddArg(bool)
 11855  		return true
 11856  	}
 11857  	// match: (SETBC [2] (InvertFlags bool))
 11858  	// result: (SETBC [2] bool)
 11859  	for {
 11860  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
 11861  			break
 11862  		}
 11863  		bool := v_0.Args[0]
 11864  		v.reset(OpPPC64SETBC)
 11865  		v.AuxInt = int32ToAuxInt(2)
 11866  		v.AddArg(bool)
 11867  		return true
 11868  	}
 11869  	// match: (SETBC [n] (InvertFlags bool))
 11870  	// result: (SETBCR [n] bool)
 11871  	for {
 11872  		n := auxIntToInt32(v.AuxInt)
 11873  		if v_0.Op != OpPPC64InvertFlags {
 11874  			break
 11875  		}
 11876  		bool := v_0.Args[0]
 11877  		v.reset(OpPPC64SETBCR)
 11878  		v.AuxInt = int32ToAuxInt(n)
 11879  		v.AddArg(bool)
 11880  		return true
 11881  	}
 11882  	// match: (SETBC [2] (CMPconst [0] a:(ANDconst [1] _)))
 11883  	// result: (XORconst [1] a)
 11884  	for {
 11885  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 11886  			break
 11887  		}
 11888  		a := v_0.Args[0]
 11889  		if a.Op != OpPPC64ANDconst || auxIntToInt64(a.AuxInt) != 1 {
 11890  			break
 11891  		}
 11892  		v.reset(OpPPC64XORconst)
 11893  		v.AuxInt = int64ToAuxInt(1)
 11894  		v.AddArg(a)
 11895  		return true
 11896  	}
 11897  	// match: (SETBC [2] (CMPconst [0] a:(AND y z)))
 11898  	// cond: a.Uses == 1
 11899  	// result: (SETBC [2] (Select1 <types.TypeFlags> (ANDCC y z )))
 11900  	for {
 11901  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 11902  			break
 11903  		}
 11904  		a := v_0.Args[0]
 11905  		if a.Op != OpPPC64AND {
 11906  			break
 11907  		}
 11908  		z := a.Args[1]
 11909  		y := a.Args[0]
 11910  		if !(a.Uses == 1) {
 11911  			break
 11912  		}
 11913  		v.reset(OpPPC64SETBC)
 11914  		v.AuxInt = int32ToAuxInt(2)
 11915  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 11916  		v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 11917  		v1.AddArg2(y, z)
 11918  		v0.AddArg(v1)
 11919  		v.AddArg(v0)
 11920  		return true
 11921  	}
 11922  	// match: (SETBC [2] (CMPconst [0] o:(OR y z)))
 11923  	// cond: o.Uses == 1
 11924  	// result: (SETBC [2] (Select1 <types.TypeFlags> (ORCC y z )))
 11925  	for {
 11926  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 11927  			break
 11928  		}
 11929  		o := v_0.Args[0]
 11930  		if o.Op != OpPPC64OR {
 11931  			break
 11932  		}
 11933  		z := o.Args[1]
 11934  		y := o.Args[0]
 11935  		if !(o.Uses == 1) {
 11936  			break
 11937  		}
 11938  		v.reset(OpPPC64SETBC)
 11939  		v.AuxInt = int32ToAuxInt(2)
 11940  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 11941  		v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 11942  		v1.AddArg2(y, z)
 11943  		v0.AddArg(v1)
 11944  		v.AddArg(v0)
 11945  		return true
 11946  	}
 11947  	// match: (SETBC [2] (CMPconst [0] a:(XOR y z)))
 11948  	// cond: a.Uses == 1
 11949  	// result: (SETBC [2] (Select1 <types.TypeFlags> (XORCC y z )))
 11950  	for {
 11951  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 11952  			break
 11953  		}
 11954  		a := v_0.Args[0]
 11955  		if a.Op != OpPPC64XOR {
 11956  			break
 11957  		}
 11958  		z := a.Args[1]
 11959  		y := a.Args[0]
 11960  		if !(a.Uses == 1) {
 11961  			break
 11962  		}
 11963  		v.reset(OpPPC64SETBC)
 11964  		v.AuxInt = int32ToAuxInt(2)
 11965  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 11966  		v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 11967  		v1.AddArg2(y, z)
 11968  		v0.AddArg(v1)
 11969  		v.AddArg(v0)
 11970  		return true
 11971  	}
 11972  	return false
 11973  }
 11974  func rewriteValuePPC64_OpPPC64SETBCR(v *Value) bool {
 11975  	v_0 := v.Args[0]
 11976  	b := v.Block
 11977  	typ := &b.Func.Config.Types
 11978  	// match: (SETBCR [0] (FlagLT))
 11979  	// result: (MOVDconst [0])
 11980  	for {
 11981  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
 11982  			break
 11983  		}
 11984  		v.reset(OpPPC64MOVDconst)
 11985  		v.AuxInt = int64ToAuxInt(0)
 11986  		return true
 11987  	}
 11988  	// match: (SETBCR [0] (FlagGT))
 11989  	// result: (MOVDconst [1])
 11990  	for {
 11991  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
 11992  			break
 11993  		}
 11994  		v.reset(OpPPC64MOVDconst)
 11995  		v.AuxInt = int64ToAuxInt(1)
 11996  		return true
 11997  	}
 11998  	// match: (SETBCR [0] (FlagEQ))
 11999  	// result: (MOVDconst [1])
 12000  	for {
 12001  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
 12002  			break
 12003  		}
 12004  		v.reset(OpPPC64MOVDconst)
 12005  		v.AuxInt = int64ToAuxInt(1)
 12006  		return true
 12007  	}
 12008  	// match: (SETBCR [1] (FlagGT))
 12009  	// result: (MOVDconst [0])
 12010  	for {
 12011  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
 12012  			break
 12013  		}
 12014  		v.reset(OpPPC64MOVDconst)
 12015  		v.AuxInt = int64ToAuxInt(0)
 12016  		return true
 12017  	}
 12018  	// match: (SETBCR [1] (FlagLT))
 12019  	// result: (MOVDconst [1])
 12020  	for {
 12021  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
 12022  			break
 12023  		}
 12024  		v.reset(OpPPC64MOVDconst)
 12025  		v.AuxInt = int64ToAuxInt(1)
 12026  		return true
 12027  	}
 12028  	// match: (SETBCR [1] (FlagEQ))
 12029  	// result: (MOVDconst [1])
 12030  	for {
 12031  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
 12032  			break
 12033  		}
 12034  		v.reset(OpPPC64MOVDconst)
 12035  		v.AuxInt = int64ToAuxInt(1)
 12036  		return true
 12037  	}
 12038  	// match: (SETBCR [2] (FlagEQ))
 12039  	// result: (MOVDconst [0])
 12040  	for {
 12041  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
 12042  			break
 12043  		}
 12044  		v.reset(OpPPC64MOVDconst)
 12045  		v.AuxInt = int64ToAuxInt(0)
 12046  		return true
 12047  	}
 12048  	// match: (SETBCR [2] (FlagLT))
 12049  	// result: (MOVDconst [1])
 12050  	for {
 12051  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
 12052  			break
 12053  		}
 12054  		v.reset(OpPPC64MOVDconst)
 12055  		v.AuxInt = int64ToAuxInt(1)
 12056  		return true
 12057  	}
 12058  	// match: (SETBCR [2] (FlagGT))
 12059  	// result: (MOVDconst [1])
 12060  	for {
 12061  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
 12062  			break
 12063  		}
 12064  		v.reset(OpPPC64MOVDconst)
 12065  		v.AuxInt = int64ToAuxInt(1)
 12066  		return true
 12067  	}
 12068  	// match: (SETBCR [0] (InvertFlags bool))
 12069  	// result: (SETBCR [1] bool)
 12070  	for {
 12071  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
 12072  			break
 12073  		}
 12074  		bool := v_0.Args[0]
 12075  		v.reset(OpPPC64SETBCR)
 12076  		v.AuxInt = int32ToAuxInt(1)
 12077  		v.AddArg(bool)
 12078  		return true
 12079  	}
 12080  	// match: (SETBCR [1] (InvertFlags bool))
 12081  	// result: (SETBCR [0] bool)
 12082  	for {
 12083  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
 12084  			break
 12085  		}
 12086  		bool := v_0.Args[0]
 12087  		v.reset(OpPPC64SETBCR)
 12088  		v.AuxInt = int32ToAuxInt(0)
 12089  		v.AddArg(bool)
 12090  		return true
 12091  	}
 12092  	// match: (SETBCR [2] (InvertFlags bool))
 12093  	// result: (SETBCR [2] bool)
 12094  	for {
 12095  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
 12096  			break
 12097  		}
 12098  		bool := v_0.Args[0]
 12099  		v.reset(OpPPC64SETBCR)
 12100  		v.AuxInt = int32ToAuxInt(2)
 12101  		v.AddArg(bool)
 12102  		return true
 12103  	}
 12104  	// match: (SETBCR [n] (InvertFlags bool))
 12105  	// result: (SETBC [n] bool)
 12106  	for {
 12107  		n := auxIntToInt32(v.AuxInt)
 12108  		if v_0.Op != OpPPC64InvertFlags {
 12109  			break
 12110  		}
 12111  		bool := v_0.Args[0]
 12112  		v.reset(OpPPC64SETBC)
 12113  		v.AuxInt = int32ToAuxInt(n)
 12114  		v.AddArg(bool)
 12115  		return true
 12116  	}
 12117  	// match: (SETBCR [2] (CMPconst [0] a:(ANDconst [1] _)))
 12118  	// result: a
 12119  	for {
 12120  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12121  			break
 12122  		}
 12123  		a := v_0.Args[0]
 12124  		if a.Op != OpPPC64ANDconst || auxIntToInt64(a.AuxInt) != 1 {
 12125  			break
 12126  		}
 12127  		v.copyOf(a)
 12128  		return true
 12129  	}
 12130  	// match: (SETBCR [2] (CMPconst [0] a:(AND y z)))
 12131  	// cond: a.Uses == 1
 12132  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (ANDCC y z )))
 12133  	for {
 12134  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12135  			break
 12136  		}
 12137  		a := v_0.Args[0]
 12138  		if a.Op != OpPPC64AND {
 12139  			break
 12140  		}
 12141  		z := a.Args[1]
 12142  		y := a.Args[0]
 12143  		if !(a.Uses == 1) {
 12144  			break
 12145  		}
 12146  		v.reset(OpPPC64SETBCR)
 12147  		v.AuxInt = int32ToAuxInt(2)
 12148  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12149  		v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 12150  		v1.AddArg2(y, z)
 12151  		v0.AddArg(v1)
 12152  		v.AddArg(v0)
 12153  		return true
 12154  	}
 12155  	// match: (SETBCR [2] (CMPconst [0] o:(OR y z)))
 12156  	// cond: o.Uses == 1
 12157  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (ORCC y z )))
 12158  	for {
 12159  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12160  			break
 12161  		}
 12162  		o := v_0.Args[0]
 12163  		if o.Op != OpPPC64OR {
 12164  			break
 12165  		}
 12166  		z := o.Args[1]
 12167  		y := o.Args[0]
 12168  		if !(o.Uses == 1) {
 12169  			break
 12170  		}
 12171  		v.reset(OpPPC64SETBCR)
 12172  		v.AuxInt = int32ToAuxInt(2)
 12173  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12174  		v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12175  		v1.AddArg2(y, z)
 12176  		v0.AddArg(v1)
 12177  		v.AddArg(v0)
 12178  		return true
 12179  	}
 12180  	// match: (SETBCR [2] (CMPconst [0] a:(XOR y z)))
 12181  	// cond: a.Uses == 1
 12182  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (XORCC y z )))
 12183  	for {
 12184  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12185  			break
 12186  		}
 12187  		a := v_0.Args[0]
 12188  		if a.Op != OpPPC64XOR {
 12189  			break
 12190  		}
 12191  		z := a.Args[1]
 12192  		y := a.Args[0]
 12193  		if !(a.Uses == 1) {
 12194  			break
 12195  		}
 12196  		v.reset(OpPPC64SETBCR)
 12197  		v.AuxInt = int32ToAuxInt(2)
 12198  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12199  		v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12200  		v1.AddArg2(y, z)
 12201  		v0.AddArg(v1)
 12202  		v.AddArg(v0)
 12203  		return true
 12204  	}
 12205  	return false
 12206  }
 12207  func rewriteValuePPC64_OpPPC64SLD(v *Value) bool {
 12208  	v_1 := v.Args[1]
 12209  	v_0 := v.Args[0]
 12210  	// match: (SLD x (MOVDconst [c]))
 12211  	// result: (SLDconst [c&63 | (c>>6&1*63)] x)
 12212  	for {
 12213  		x := v_0
 12214  		if v_1.Op != OpPPC64MOVDconst {
 12215  			break
 12216  		}
 12217  		c := auxIntToInt64(v_1.AuxInt)
 12218  		v.reset(OpPPC64SLDconst)
 12219  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12220  		v.AddArg(x)
 12221  		return true
 12222  	}
 12223  	return false
 12224  }
 12225  func rewriteValuePPC64_OpPPC64SLDconst(v *Value) bool {
 12226  	v_0 := v.Args[0]
 12227  	// match: (SLDconst [l] (SRWconst [r] x))
 12228  	// cond: mergePPC64SldiSrw(l,r) != 0
 12229  	// result: (RLWINM [mergePPC64SldiSrw(l,r)] x)
 12230  	for {
 12231  		l := auxIntToInt64(v.AuxInt)
 12232  		if v_0.Op != OpPPC64SRWconst {
 12233  			break
 12234  		}
 12235  		r := auxIntToInt64(v_0.AuxInt)
 12236  		x := v_0.Args[0]
 12237  		if !(mergePPC64SldiSrw(l, r) != 0) {
 12238  			break
 12239  		}
 12240  		v.reset(OpPPC64RLWINM)
 12241  		v.AuxInt = int64ToAuxInt(mergePPC64SldiSrw(l, r))
 12242  		v.AddArg(x)
 12243  		return true
 12244  	}
 12245  	// match: (SLDconst [s] (RLWINM [r] y))
 12246  	// cond: mergePPC64SldiRlwinm(s,r) != 0
 12247  	// result: (RLWINM [mergePPC64SldiRlwinm(s,r)] y)
 12248  	for {
 12249  		s := auxIntToInt64(v.AuxInt)
 12250  		if v_0.Op != OpPPC64RLWINM {
 12251  			break
 12252  		}
 12253  		r := auxIntToInt64(v_0.AuxInt)
 12254  		y := v_0.Args[0]
 12255  		if !(mergePPC64SldiRlwinm(s, r) != 0) {
 12256  			break
 12257  		}
 12258  		v.reset(OpPPC64RLWINM)
 12259  		v.AuxInt = int64ToAuxInt(mergePPC64SldiRlwinm(s, r))
 12260  		v.AddArg(y)
 12261  		return true
 12262  	}
 12263  	// match: (SLDconst [c] z:(MOVBZreg x))
 12264  	// cond: c < 8 && z.Uses == 1
 12265  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,56,63,64)] x)
 12266  	for {
 12267  		c := auxIntToInt64(v.AuxInt)
 12268  		z := v_0
 12269  		if z.Op != OpPPC64MOVBZreg {
 12270  			break
 12271  		}
 12272  		x := z.Args[0]
 12273  		if !(c < 8 && z.Uses == 1) {
 12274  			break
 12275  		}
 12276  		v.reset(OpPPC64CLRLSLDI)
 12277  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 56, 63, 64))
 12278  		v.AddArg(x)
 12279  		return true
 12280  	}
 12281  	// match: (SLDconst [c] z:(MOVHZreg x))
 12282  	// cond: c < 16 && z.Uses == 1
 12283  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,48,63,64)] x)
 12284  	for {
 12285  		c := auxIntToInt64(v.AuxInt)
 12286  		z := v_0
 12287  		if z.Op != OpPPC64MOVHZreg {
 12288  			break
 12289  		}
 12290  		x := z.Args[0]
 12291  		if !(c < 16 && z.Uses == 1) {
 12292  			break
 12293  		}
 12294  		v.reset(OpPPC64CLRLSLDI)
 12295  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 48, 63, 64))
 12296  		v.AddArg(x)
 12297  		return true
 12298  	}
 12299  	// match: (SLDconst [c] z:(MOVWZreg x))
 12300  	// cond: c < 32 && z.Uses == 1
 12301  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,32,63,64)] x)
 12302  	for {
 12303  		c := auxIntToInt64(v.AuxInt)
 12304  		z := v_0
 12305  		if z.Op != OpPPC64MOVWZreg {
 12306  			break
 12307  		}
 12308  		x := z.Args[0]
 12309  		if !(c < 32 && z.Uses == 1) {
 12310  			break
 12311  		}
 12312  		v.reset(OpPPC64CLRLSLDI)
 12313  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32, 63, 64))
 12314  		v.AddArg(x)
 12315  		return true
 12316  	}
 12317  	// match: (SLDconst [c] z:(ANDconst [d] x))
 12318  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))
 12319  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
 12320  	for {
 12321  		c := auxIntToInt64(v.AuxInt)
 12322  		z := v_0
 12323  		if z.Op != OpPPC64ANDconst {
 12324  			break
 12325  		}
 12326  		d := auxIntToInt64(z.AuxInt)
 12327  		x := z.Args[0]
 12328  		if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
 12329  			break
 12330  		}
 12331  		v.reset(OpPPC64CLRLSLDI)
 12332  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
 12333  		v.AddArg(x)
 12334  		return true
 12335  	}
 12336  	// match: (SLDconst [c] z:(AND (MOVDconst [d]) x))
 12337  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(64-getPPC64ShiftMaskLength(d))
 12338  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
 12339  	for {
 12340  		c := auxIntToInt64(v.AuxInt)
 12341  		z := v_0
 12342  		if z.Op != OpPPC64AND {
 12343  			break
 12344  		}
 12345  		_ = z.Args[1]
 12346  		z_0 := z.Args[0]
 12347  		z_1 := z.Args[1]
 12348  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 12349  			if z_0.Op != OpPPC64MOVDconst {
 12350  				continue
 12351  			}
 12352  			d := auxIntToInt64(z_0.AuxInt)
 12353  			x := z_1
 12354  			if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
 12355  				continue
 12356  			}
 12357  			v.reset(OpPPC64CLRLSLDI)
 12358  			v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
 12359  			v.AddArg(x)
 12360  			return true
 12361  		}
 12362  		break
 12363  	}
 12364  	// match: (SLDconst [c] z:(MOVWreg x))
 12365  	// cond: c < 32 && buildcfg.GOPPC64 >= 9
 12366  	// result: (EXTSWSLconst [c] x)
 12367  	for {
 12368  		c := auxIntToInt64(v.AuxInt)
 12369  		z := v_0
 12370  		if z.Op != OpPPC64MOVWreg {
 12371  			break
 12372  		}
 12373  		x := z.Args[0]
 12374  		if !(c < 32 && buildcfg.GOPPC64 >= 9) {
 12375  			break
 12376  		}
 12377  		v.reset(OpPPC64EXTSWSLconst)
 12378  		v.AuxInt = int64ToAuxInt(c)
 12379  		v.AddArg(x)
 12380  		return true
 12381  	}
 12382  	return false
 12383  }
 12384  func rewriteValuePPC64_OpPPC64SLW(v *Value) bool {
 12385  	v_1 := v.Args[1]
 12386  	v_0 := v.Args[0]
 12387  	// match: (SLW x (MOVDconst [c]))
 12388  	// result: (SLWconst [c&31 | (c>>5&1*31)] x)
 12389  	for {
 12390  		x := v_0
 12391  		if v_1.Op != OpPPC64MOVDconst {
 12392  			break
 12393  		}
 12394  		c := auxIntToInt64(v_1.AuxInt)
 12395  		v.reset(OpPPC64SLWconst)
 12396  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12397  		v.AddArg(x)
 12398  		return true
 12399  	}
 12400  	return false
 12401  }
 12402  func rewriteValuePPC64_OpPPC64SLWconst(v *Value) bool {
 12403  	v_0 := v.Args[0]
 12404  	// match: (SLWconst [s] (MOVWZreg w))
 12405  	// result: (SLWconst [s] w)
 12406  	for {
 12407  		s := auxIntToInt64(v.AuxInt)
 12408  		if v_0.Op != OpPPC64MOVWZreg {
 12409  			break
 12410  		}
 12411  		w := v_0.Args[0]
 12412  		v.reset(OpPPC64SLWconst)
 12413  		v.AuxInt = int64ToAuxInt(s)
 12414  		v.AddArg(w)
 12415  		return true
 12416  	}
 12417  	// match: (SLWconst [c] z:(MOVBZreg x))
 12418  	// cond: z.Uses == 1 && c < 8
 12419  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,24,31,32)] x)
 12420  	for {
 12421  		c := auxIntToInt64(v.AuxInt)
 12422  		z := v_0
 12423  		if z.Op != OpPPC64MOVBZreg {
 12424  			break
 12425  		}
 12426  		x := z.Args[0]
 12427  		if !(z.Uses == 1 && c < 8) {
 12428  			break
 12429  		}
 12430  		v.reset(OpPPC64CLRLSLWI)
 12431  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 24, 31, 32))
 12432  		v.AddArg(x)
 12433  		return true
 12434  	}
 12435  	// match: (SLWconst [c] z:(MOVHZreg x))
 12436  	// cond: z.Uses == 1 && c < 16
 12437  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,16,31,32)] x)
 12438  	for {
 12439  		c := auxIntToInt64(v.AuxInt)
 12440  		z := v_0
 12441  		if z.Op != OpPPC64MOVHZreg {
 12442  			break
 12443  		}
 12444  		x := z.Args[0]
 12445  		if !(z.Uses == 1 && c < 16) {
 12446  			break
 12447  		}
 12448  		v.reset(OpPPC64CLRLSLWI)
 12449  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 16, 31, 32))
 12450  		v.AddArg(x)
 12451  		return true
 12452  	}
 12453  	// match: (SLWconst [c] z:(ANDconst [d] x))
 12454  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
 12455  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
 12456  	for {
 12457  		c := auxIntToInt64(v.AuxInt)
 12458  		z := v_0
 12459  		if z.Op != OpPPC64ANDconst {
 12460  			break
 12461  		}
 12462  		d := auxIntToInt64(z.AuxInt)
 12463  		x := z.Args[0]
 12464  		if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
 12465  			break
 12466  		}
 12467  		v.reset(OpPPC64CLRLSLWI)
 12468  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
 12469  		v.AddArg(x)
 12470  		return true
 12471  	}
 12472  	// match: (SLWconst [c] z:(AND (MOVDconst [d]) x))
 12473  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
 12474  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
 12475  	for {
 12476  		c := auxIntToInt64(v.AuxInt)
 12477  		z := v_0
 12478  		if z.Op != OpPPC64AND {
 12479  			break
 12480  		}
 12481  		_ = z.Args[1]
 12482  		z_0 := z.Args[0]
 12483  		z_1 := z.Args[1]
 12484  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 12485  			if z_0.Op != OpPPC64MOVDconst {
 12486  				continue
 12487  			}
 12488  			d := auxIntToInt64(z_0.AuxInt)
 12489  			x := z_1
 12490  			if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
 12491  				continue
 12492  			}
 12493  			v.reset(OpPPC64CLRLSLWI)
 12494  			v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
 12495  			v.AddArg(x)
 12496  			return true
 12497  		}
 12498  		break
 12499  	}
 12500  	// match: (SLWconst [c] z:(MOVWreg x))
 12501  	// cond: c < 32 && buildcfg.GOPPC64 >= 9
 12502  	// result: (EXTSWSLconst [c] x)
 12503  	for {
 12504  		c := auxIntToInt64(v.AuxInt)
 12505  		z := v_0
 12506  		if z.Op != OpPPC64MOVWreg {
 12507  			break
 12508  		}
 12509  		x := z.Args[0]
 12510  		if !(c < 32 && buildcfg.GOPPC64 >= 9) {
 12511  			break
 12512  		}
 12513  		v.reset(OpPPC64EXTSWSLconst)
 12514  		v.AuxInt = int64ToAuxInt(c)
 12515  		v.AddArg(x)
 12516  		return true
 12517  	}
 12518  	return false
 12519  }
 12520  func rewriteValuePPC64_OpPPC64SRAD(v *Value) bool {
 12521  	v_1 := v.Args[1]
 12522  	v_0 := v.Args[0]
 12523  	// match: (SRAD x (MOVDconst [c]))
 12524  	// result: (SRADconst [c&63 | (c>>6&1*63)] x)
 12525  	for {
 12526  		x := v_0
 12527  		if v_1.Op != OpPPC64MOVDconst {
 12528  			break
 12529  		}
 12530  		c := auxIntToInt64(v_1.AuxInt)
 12531  		v.reset(OpPPC64SRADconst)
 12532  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12533  		v.AddArg(x)
 12534  		return true
 12535  	}
 12536  	return false
 12537  }
 12538  func rewriteValuePPC64_OpPPC64SRAW(v *Value) bool {
 12539  	v_1 := v.Args[1]
 12540  	v_0 := v.Args[0]
 12541  	// match: (SRAW x (MOVDconst [c]))
 12542  	// result: (SRAWconst [c&31 | (c>>5&1*31)] x)
 12543  	for {
 12544  		x := v_0
 12545  		if v_1.Op != OpPPC64MOVDconst {
 12546  			break
 12547  		}
 12548  		c := auxIntToInt64(v_1.AuxInt)
 12549  		v.reset(OpPPC64SRAWconst)
 12550  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12551  		v.AddArg(x)
 12552  		return true
 12553  	}
 12554  	return false
 12555  }
 12556  func rewriteValuePPC64_OpPPC64SRD(v *Value) bool {
 12557  	v_1 := v.Args[1]
 12558  	v_0 := v.Args[0]
 12559  	// match: (SRD x (MOVDconst [c]))
 12560  	// result: (SRDconst [c&63 | (c>>6&1*63)] x)
 12561  	for {
 12562  		x := v_0
 12563  		if v_1.Op != OpPPC64MOVDconst {
 12564  			break
 12565  		}
 12566  		c := auxIntToInt64(v_1.AuxInt)
 12567  		v.reset(OpPPC64SRDconst)
 12568  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12569  		v.AddArg(x)
 12570  		return true
 12571  	}
 12572  	return false
 12573  }
 12574  func rewriteValuePPC64_OpPPC64SRW(v *Value) bool {
 12575  	v_1 := v.Args[1]
 12576  	v_0 := v.Args[0]
 12577  	// match: (SRW x (MOVDconst [c]))
 12578  	// result: (SRWconst [c&31 | (c>>5&1*31)] x)
 12579  	for {
 12580  		x := v_0
 12581  		if v_1.Op != OpPPC64MOVDconst {
 12582  			break
 12583  		}
 12584  		c := auxIntToInt64(v_1.AuxInt)
 12585  		v.reset(OpPPC64SRWconst)
 12586  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12587  		v.AddArg(x)
 12588  		return true
 12589  	}
 12590  	return false
 12591  }
 12592  func rewriteValuePPC64_OpPPC64SRWconst(v *Value) bool {
 12593  	v_0 := v.Args[0]
 12594  	// match: (SRWconst (ANDconst [m] x) [s])
 12595  	// cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
 12596  	// result: (MOVDconst [0])
 12597  	for {
 12598  		s := auxIntToInt64(v.AuxInt)
 12599  		if v_0.Op != OpPPC64ANDconst {
 12600  			break
 12601  		}
 12602  		m := auxIntToInt64(v_0.AuxInt)
 12603  		if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
 12604  			break
 12605  		}
 12606  		v.reset(OpPPC64MOVDconst)
 12607  		v.AuxInt = int64ToAuxInt(0)
 12608  		return true
 12609  	}
 12610  	// match: (SRWconst (ANDconst [m] x) [s])
 12611  	// cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
 12612  	// result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
 12613  	for {
 12614  		s := auxIntToInt64(v.AuxInt)
 12615  		if v_0.Op != OpPPC64ANDconst {
 12616  			break
 12617  		}
 12618  		m := auxIntToInt64(v_0.AuxInt)
 12619  		x := v_0.Args[0]
 12620  		if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
 12621  			break
 12622  		}
 12623  		v.reset(OpPPC64RLWINM)
 12624  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
 12625  		v.AddArg(x)
 12626  		return true
 12627  	}
 12628  	// match: (SRWconst (AND (MOVDconst [m]) x) [s])
 12629  	// cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
 12630  	// result: (MOVDconst [0])
 12631  	for {
 12632  		s := auxIntToInt64(v.AuxInt)
 12633  		if v_0.Op != OpPPC64AND {
 12634  			break
 12635  		}
 12636  		_ = v_0.Args[1]
 12637  		v_0_0 := v_0.Args[0]
 12638  		v_0_1 := v_0.Args[1]
 12639  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 12640  			if v_0_0.Op != OpPPC64MOVDconst {
 12641  				continue
 12642  			}
 12643  			m := auxIntToInt64(v_0_0.AuxInt)
 12644  			if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
 12645  				continue
 12646  			}
 12647  			v.reset(OpPPC64MOVDconst)
 12648  			v.AuxInt = int64ToAuxInt(0)
 12649  			return true
 12650  		}
 12651  		break
 12652  	}
 12653  	// match: (SRWconst (AND (MOVDconst [m]) x) [s])
 12654  	// cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
 12655  	// result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
 12656  	for {
 12657  		s := auxIntToInt64(v.AuxInt)
 12658  		if v_0.Op != OpPPC64AND {
 12659  			break
 12660  		}
 12661  		_ = v_0.Args[1]
 12662  		v_0_0 := v_0.Args[0]
 12663  		v_0_1 := v_0.Args[1]
 12664  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 12665  			if v_0_0.Op != OpPPC64MOVDconst {
 12666  				continue
 12667  			}
 12668  			m := auxIntToInt64(v_0_0.AuxInt)
 12669  			x := v_0_1
 12670  			if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
 12671  				continue
 12672  			}
 12673  			v.reset(OpPPC64RLWINM)
 12674  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
 12675  			v.AddArg(x)
 12676  			return true
 12677  		}
 12678  		break
 12679  	}
 12680  	return false
 12681  }
 12682  func rewriteValuePPC64_OpPPC64SUB(v *Value) bool {
 12683  	v_1 := v.Args[1]
 12684  	v_0 := v.Args[0]
 12685  	// match: (SUB x (MOVDconst [c]))
 12686  	// cond: is32Bit(-c)
 12687  	// result: (ADDconst [-c] x)
 12688  	for {
 12689  		x := v_0
 12690  		if v_1.Op != OpPPC64MOVDconst {
 12691  			break
 12692  		}
 12693  		c := auxIntToInt64(v_1.AuxInt)
 12694  		if !(is32Bit(-c)) {
 12695  			break
 12696  		}
 12697  		v.reset(OpPPC64ADDconst)
 12698  		v.AuxInt = int64ToAuxInt(-c)
 12699  		v.AddArg(x)
 12700  		return true
 12701  	}
 12702  	// match: (SUB (MOVDconst [c]) x)
 12703  	// cond: is32Bit(c)
 12704  	// result: (SUBFCconst [c] x)
 12705  	for {
 12706  		if v_0.Op != OpPPC64MOVDconst {
 12707  			break
 12708  		}
 12709  		c := auxIntToInt64(v_0.AuxInt)
 12710  		x := v_1
 12711  		if !(is32Bit(c)) {
 12712  			break
 12713  		}
 12714  		v.reset(OpPPC64SUBFCconst)
 12715  		v.AuxInt = int64ToAuxInt(c)
 12716  		v.AddArg(x)
 12717  		return true
 12718  	}
 12719  	return false
 12720  }
 12721  func rewriteValuePPC64_OpPPC64SUBE(v *Value) bool {
 12722  	v_2 := v.Args[2]
 12723  	v_1 := v.Args[1]
 12724  	v_0 := v.Args[0]
 12725  	b := v.Block
 12726  	typ := &b.Func.Config.Types
 12727  	// match: (SUBE x y (Select1 <typ.UInt64> (SUBCconst (MOVDconst [0]) [0])))
 12728  	// result: (SUBC x y)
 12729  	for {
 12730  		x := v_0
 12731  		y := v_1
 12732  		if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
 12733  			break
 12734  		}
 12735  		v_2_0 := v_2.Args[0]
 12736  		if v_2_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_2_0.AuxInt) != 0 {
 12737  			break
 12738  		}
 12739  		v_2_0_0 := v_2_0.Args[0]
 12740  		if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
 12741  			break
 12742  		}
 12743  		v.reset(OpPPC64SUBC)
 12744  		v.AddArg2(x, y)
 12745  		return true
 12746  	}
 12747  	return false
 12748  }
 12749  func rewriteValuePPC64_OpPPC64SUBFCconst(v *Value) bool {
 12750  	v_0 := v.Args[0]
 12751  	// match: (SUBFCconst [c] (NEG x))
 12752  	// result: (ADDconst [c] x)
 12753  	for {
 12754  		c := auxIntToInt64(v.AuxInt)
 12755  		if v_0.Op != OpPPC64NEG {
 12756  			break
 12757  		}
 12758  		x := v_0.Args[0]
 12759  		v.reset(OpPPC64ADDconst)
 12760  		v.AuxInt = int64ToAuxInt(c)
 12761  		v.AddArg(x)
 12762  		return true
 12763  	}
 12764  	// match: (SUBFCconst [c] (SUBFCconst [d] x))
 12765  	// cond: is32Bit(c-d)
 12766  	// result: (ADDconst [c-d] x)
 12767  	for {
 12768  		c := auxIntToInt64(v.AuxInt)
 12769  		if v_0.Op != OpPPC64SUBFCconst {
 12770  			break
 12771  		}
 12772  		d := auxIntToInt64(v_0.AuxInt)
 12773  		x := v_0.Args[0]
 12774  		if !(is32Bit(c - d)) {
 12775  			break
 12776  		}
 12777  		v.reset(OpPPC64ADDconst)
 12778  		v.AuxInt = int64ToAuxInt(c - d)
 12779  		v.AddArg(x)
 12780  		return true
 12781  	}
 12782  	// match: (SUBFCconst [0] x)
 12783  	// result: (NEG x)
 12784  	for {
 12785  		if auxIntToInt64(v.AuxInt) != 0 {
 12786  			break
 12787  		}
 12788  		x := v_0
 12789  		v.reset(OpPPC64NEG)
 12790  		v.AddArg(x)
 12791  		return true
 12792  	}
 12793  	return false
 12794  }
 12795  func rewriteValuePPC64_OpPPC64XOR(v *Value) bool {
 12796  	v_1 := v.Args[1]
 12797  	v_0 := v.Args[0]
 12798  	// match: (XOR (MOVDconst [c]) (MOVDconst [d]))
 12799  	// result: (MOVDconst [c^d])
 12800  	for {
 12801  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12802  			if v_0.Op != OpPPC64MOVDconst {
 12803  				continue
 12804  			}
 12805  			c := auxIntToInt64(v_0.AuxInt)
 12806  			if v_1.Op != OpPPC64MOVDconst {
 12807  				continue
 12808  			}
 12809  			d := auxIntToInt64(v_1.AuxInt)
 12810  			v.reset(OpPPC64MOVDconst)
 12811  			v.AuxInt = int64ToAuxInt(c ^ d)
 12812  			return true
 12813  		}
 12814  		break
 12815  	}
 12816  	// match: (XOR x (MOVDconst [c]))
 12817  	// cond: isU32Bit(c)
 12818  	// result: (XORconst [c] x)
 12819  	for {
 12820  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12821  			x := v_0
 12822  			if v_1.Op != OpPPC64MOVDconst {
 12823  				continue
 12824  			}
 12825  			c := auxIntToInt64(v_1.AuxInt)
 12826  			if !(isU32Bit(c)) {
 12827  				continue
 12828  			}
 12829  			v.reset(OpPPC64XORconst)
 12830  			v.AuxInt = int64ToAuxInt(c)
 12831  			v.AddArg(x)
 12832  			return true
 12833  		}
 12834  		break
 12835  	}
 12836  	return false
 12837  }
 12838  func rewriteValuePPC64_OpPPC64XORconst(v *Value) bool {
 12839  	v_0 := v.Args[0]
 12840  	// match: (XORconst [c] (XORconst [d] x))
 12841  	// result: (XORconst [c^d] x)
 12842  	for {
 12843  		c := auxIntToInt64(v.AuxInt)
 12844  		if v_0.Op != OpPPC64XORconst {
 12845  			break
 12846  		}
 12847  		d := auxIntToInt64(v_0.AuxInt)
 12848  		x := v_0.Args[0]
 12849  		v.reset(OpPPC64XORconst)
 12850  		v.AuxInt = int64ToAuxInt(c ^ d)
 12851  		v.AddArg(x)
 12852  		return true
 12853  	}
 12854  	// match: (XORconst [0] x)
 12855  	// result: x
 12856  	for {
 12857  		if auxIntToInt64(v.AuxInt) != 0 {
 12858  			break
 12859  		}
 12860  		x := v_0
 12861  		v.copyOf(x)
 12862  		return true
 12863  	}
 12864  	// match: (XORconst [1] (SETBCR [n] cmp))
 12865  	// result: (SETBC [n] cmp)
 12866  	for {
 12867  		if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBCR {
 12868  			break
 12869  		}
 12870  		n := auxIntToInt32(v_0.AuxInt)
 12871  		cmp := v_0.Args[0]
 12872  		v.reset(OpPPC64SETBC)
 12873  		v.AuxInt = int32ToAuxInt(n)
 12874  		v.AddArg(cmp)
 12875  		return true
 12876  	}
 12877  	// match: (XORconst [1] (SETBC [n] cmp))
 12878  	// result: (SETBCR [n] cmp)
 12879  	for {
 12880  		if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBC {
 12881  			break
 12882  		}
 12883  		n := auxIntToInt32(v_0.AuxInt)
 12884  		cmp := v_0.Args[0]
 12885  		v.reset(OpPPC64SETBCR)
 12886  		v.AuxInt = int32ToAuxInt(n)
 12887  		v.AddArg(cmp)
 12888  		return true
 12889  	}
 12890  	return false
 12891  }
 12892  func rewriteValuePPC64_OpPanicBounds(v *Value) bool {
 12893  	v_2 := v.Args[2]
 12894  	v_1 := v.Args[1]
 12895  	v_0 := v.Args[0]
 12896  	// match: (PanicBounds [kind] x y mem)
 12897  	// cond: boundsABI(kind) == 0
 12898  	// result: (LoweredPanicBoundsA [kind] x y mem)
 12899  	for {
 12900  		kind := auxIntToInt64(v.AuxInt)
 12901  		x := v_0
 12902  		y := v_1
 12903  		mem := v_2
 12904  		if !(boundsABI(kind) == 0) {
 12905  			break
 12906  		}
 12907  		v.reset(OpPPC64LoweredPanicBoundsA)
 12908  		v.AuxInt = int64ToAuxInt(kind)
 12909  		v.AddArg3(x, y, mem)
 12910  		return true
 12911  	}
 12912  	// match: (PanicBounds [kind] x y mem)
 12913  	// cond: boundsABI(kind) == 1
 12914  	// result: (LoweredPanicBoundsB [kind] x y mem)
 12915  	for {
 12916  		kind := auxIntToInt64(v.AuxInt)
 12917  		x := v_0
 12918  		y := v_1
 12919  		mem := v_2
 12920  		if !(boundsABI(kind) == 1) {
 12921  			break
 12922  		}
 12923  		v.reset(OpPPC64LoweredPanicBoundsB)
 12924  		v.AuxInt = int64ToAuxInt(kind)
 12925  		v.AddArg3(x, y, mem)
 12926  		return true
 12927  	}
 12928  	// match: (PanicBounds [kind] x y mem)
 12929  	// cond: boundsABI(kind) == 2
 12930  	// result: (LoweredPanicBoundsC [kind] x y mem)
 12931  	for {
 12932  		kind := auxIntToInt64(v.AuxInt)
 12933  		x := v_0
 12934  		y := v_1
 12935  		mem := v_2
 12936  		if !(boundsABI(kind) == 2) {
 12937  			break
 12938  		}
 12939  		v.reset(OpPPC64LoweredPanicBoundsC)
 12940  		v.AuxInt = int64ToAuxInt(kind)
 12941  		v.AddArg3(x, y, mem)
 12942  		return true
 12943  	}
 12944  	return false
 12945  }
 12946  func rewriteValuePPC64_OpPopCount16(v *Value) bool {
 12947  	v_0 := v.Args[0]
 12948  	b := v.Block
 12949  	typ := &b.Func.Config.Types
 12950  	// match: (PopCount16 x)
 12951  	// result: (POPCNTW (MOVHZreg x))
 12952  	for {
 12953  		x := v_0
 12954  		v.reset(OpPPC64POPCNTW)
 12955  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 12956  		v0.AddArg(x)
 12957  		v.AddArg(v0)
 12958  		return true
 12959  	}
 12960  }
 12961  func rewriteValuePPC64_OpPopCount32(v *Value) bool {
 12962  	v_0 := v.Args[0]
 12963  	b := v.Block
 12964  	typ := &b.Func.Config.Types
 12965  	// match: (PopCount32 x)
 12966  	// result: (POPCNTW (MOVWZreg x))
 12967  	for {
 12968  		x := v_0
 12969  		v.reset(OpPPC64POPCNTW)
 12970  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
 12971  		v0.AddArg(x)
 12972  		v.AddArg(v0)
 12973  		return true
 12974  	}
 12975  }
 12976  func rewriteValuePPC64_OpPopCount8(v *Value) bool {
 12977  	v_0 := v.Args[0]
 12978  	b := v.Block
 12979  	typ := &b.Func.Config.Types
 12980  	// match: (PopCount8 x)
 12981  	// result: (POPCNTB (MOVBZreg x))
 12982  	for {
 12983  		x := v_0
 12984  		v.reset(OpPPC64POPCNTB)
 12985  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 12986  		v0.AddArg(x)
 12987  		v.AddArg(v0)
 12988  		return true
 12989  	}
 12990  }
 12991  func rewriteValuePPC64_OpPrefetchCache(v *Value) bool {
 12992  	v_1 := v.Args[1]
 12993  	v_0 := v.Args[0]
 12994  	// match: (PrefetchCache ptr mem)
 12995  	// result: (DCBT ptr mem [0])
 12996  	for {
 12997  		ptr := v_0
 12998  		mem := v_1
 12999  		v.reset(OpPPC64DCBT)
 13000  		v.AuxInt = int64ToAuxInt(0)
 13001  		v.AddArg2(ptr, mem)
 13002  		return true
 13003  	}
 13004  }
 13005  func rewriteValuePPC64_OpPrefetchCacheStreamed(v *Value) bool {
 13006  	v_1 := v.Args[1]
 13007  	v_0 := v.Args[0]
 13008  	// match: (PrefetchCacheStreamed ptr mem)
 13009  	// result: (DCBT ptr mem [16])
 13010  	for {
 13011  		ptr := v_0
 13012  		mem := v_1
 13013  		v.reset(OpPPC64DCBT)
 13014  		v.AuxInt = int64ToAuxInt(16)
 13015  		v.AddArg2(ptr, mem)
 13016  		return true
 13017  	}
 13018  }
 13019  func rewriteValuePPC64_OpRotateLeft16(v *Value) bool {
 13020  	v_1 := v.Args[1]
 13021  	v_0 := v.Args[0]
 13022  	b := v.Block
 13023  	typ := &b.Func.Config.Types
 13024  	// match: (RotateLeft16 <t> x (MOVDconst [c]))
 13025  	// result: (Or16 (Lsh16x64 <t> x (MOVDconst [c&15])) (Rsh16Ux64 <t> x (MOVDconst [-c&15])))
 13026  	for {
 13027  		t := v.Type
 13028  		x := v_0
 13029  		if v_1.Op != OpPPC64MOVDconst {
 13030  			break
 13031  		}
 13032  		c := auxIntToInt64(v_1.AuxInt)
 13033  		v.reset(OpOr16)
 13034  		v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
 13035  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13036  		v1.AuxInt = int64ToAuxInt(c & 15)
 13037  		v0.AddArg2(x, v1)
 13038  		v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
 13039  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13040  		v3.AuxInt = int64ToAuxInt(-c & 15)
 13041  		v2.AddArg2(x, v3)
 13042  		v.AddArg2(v0, v2)
 13043  		return true
 13044  	}
 13045  	return false
 13046  }
 13047  func rewriteValuePPC64_OpRotateLeft8(v *Value) bool {
 13048  	v_1 := v.Args[1]
 13049  	v_0 := v.Args[0]
 13050  	b := v.Block
 13051  	typ := &b.Func.Config.Types
 13052  	// match: (RotateLeft8 <t> x (MOVDconst [c]))
 13053  	// result: (Or8 (Lsh8x64 <t> x (MOVDconst [c&7])) (Rsh8Ux64 <t> x (MOVDconst [-c&7])))
 13054  	for {
 13055  		t := v.Type
 13056  		x := v_0
 13057  		if v_1.Op != OpPPC64MOVDconst {
 13058  			break
 13059  		}
 13060  		c := auxIntToInt64(v_1.AuxInt)
 13061  		v.reset(OpOr8)
 13062  		v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
 13063  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13064  		v1.AuxInt = int64ToAuxInt(c & 7)
 13065  		v0.AddArg2(x, v1)
 13066  		v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
 13067  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13068  		v3.AuxInt = int64ToAuxInt(-c & 7)
 13069  		v2.AddArg2(x, v3)
 13070  		v.AddArg2(v0, v2)
 13071  		return true
 13072  	}
 13073  	return false
 13074  }
 13075  func rewriteValuePPC64_OpRsh16Ux16(v *Value) bool {
 13076  	v_1 := v.Args[1]
 13077  	v_0 := v.Args[0]
 13078  	b := v.Block
 13079  	typ := &b.Func.Config.Types
 13080  	// match: (Rsh16Ux16 x y)
 13081  	// cond: shiftIsBounded(v)
 13082  	// result: (SRD (MOVHZreg x) y)
 13083  	for {
 13084  		x := v_0
 13085  		y := v_1
 13086  		if !(shiftIsBounded(v)) {
 13087  			break
 13088  		}
 13089  		v.reset(OpPPC64SRD)
 13090  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13091  		v0.AddArg(x)
 13092  		v.AddArg2(v0, y)
 13093  		return true
 13094  	}
 13095  	// match: (Rsh16Ux16 <t> x y)
 13096  	// result: (ISEL [2] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF0] y)))
 13097  	for {
 13098  		t := v.Type
 13099  		x := v_0
 13100  		y := v_1
 13101  		v.reset(OpPPC64ISEL)
 13102  		v.AuxInt = int32ToAuxInt(2)
 13103  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13104  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13105  		v1.AddArg(x)
 13106  		v0.AddArg2(v1, y)
 13107  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13108  		v2.AuxInt = int64ToAuxInt(0)
 13109  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13110  		v3.AuxInt = int64ToAuxInt(0)
 13111  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13112  		v4.AuxInt = int64ToAuxInt(0xFFF0)
 13113  		v4.AddArg(y)
 13114  		v3.AddArg(v4)
 13115  		v.AddArg3(v0, v2, v3)
 13116  		return true
 13117  	}
 13118  }
 13119  func rewriteValuePPC64_OpRsh16Ux32(v *Value) bool {
 13120  	v_1 := v.Args[1]
 13121  	v_0 := v.Args[0]
 13122  	b := v.Block
 13123  	typ := &b.Func.Config.Types
 13124  	// match: (Rsh16Ux32 x y)
 13125  	// cond: shiftIsBounded(v)
 13126  	// result: (SRD (MOVHZreg x) y)
 13127  	for {
 13128  		x := v_0
 13129  		y := v_1
 13130  		if !(shiftIsBounded(v)) {
 13131  			break
 13132  		}
 13133  		v.reset(OpPPC64SRD)
 13134  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13135  		v0.AddArg(x)
 13136  		v.AddArg2(v0, y)
 13137  		return true
 13138  	}
 13139  	// match: (Rsh16Ux32 <t> x y)
 13140  	// result: (ISEL [0] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [16]))
 13141  	for {
 13142  		t := v.Type
 13143  		x := v_0
 13144  		y := v_1
 13145  		v.reset(OpPPC64ISEL)
 13146  		v.AuxInt = int32ToAuxInt(0)
 13147  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13148  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13149  		v1.AddArg(x)
 13150  		v0.AddArg2(v1, y)
 13151  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13152  		v2.AuxInt = int64ToAuxInt(0)
 13153  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13154  		v3.AuxInt = int32ToAuxInt(16)
 13155  		v3.AddArg(y)
 13156  		v.AddArg3(v0, v2, v3)
 13157  		return true
 13158  	}
 13159  }
 13160  func rewriteValuePPC64_OpRsh16Ux64(v *Value) bool {
 13161  	v_1 := v.Args[1]
 13162  	v_0 := v.Args[0]
 13163  	b := v.Block
 13164  	typ := &b.Func.Config.Types
 13165  	// match: (Rsh16Ux64 x (MOVDconst [c]))
 13166  	// cond: uint64(c) < 16
 13167  	// result: (SRWconst (ZeroExt16to32 x) [c])
 13168  	for {
 13169  		x := v_0
 13170  		if v_1.Op != OpPPC64MOVDconst {
 13171  			break
 13172  		}
 13173  		c := auxIntToInt64(v_1.AuxInt)
 13174  		if !(uint64(c) < 16) {
 13175  			break
 13176  		}
 13177  		v.reset(OpPPC64SRWconst)
 13178  		v.AuxInt = int64ToAuxInt(c)
 13179  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 13180  		v0.AddArg(x)
 13181  		v.AddArg(v0)
 13182  		return true
 13183  	}
 13184  	// match: (Rsh16Ux64 x y)
 13185  	// cond: shiftIsBounded(v)
 13186  	// result: (SRD (MOVHZreg x) y)
 13187  	for {
 13188  		x := v_0
 13189  		y := v_1
 13190  		if !(shiftIsBounded(v)) {
 13191  			break
 13192  		}
 13193  		v.reset(OpPPC64SRD)
 13194  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13195  		v0.AddArg(x)
 13196  		v.AddArg2(v0, y)
 13197  		return true
 13198  	}
 13199  	// match: (Rsh16Ux64 <t> x y)
 13200  	// result: (ISEL [0] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [16]))
 13201  	for {
 13202  		t := v.Type
 13203  		x := v_0
 13204  		y := v_1
 13205  		v.reset(OpPPC64ISEL)
 13206  		v.AuxInt = int32ToAuxInt(0)
 13207  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13208  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13209  		v1.AddArg(x)
 13210  		v0.AddArg2(v1, y)
 13211  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13212  		v2.AuxInt = int64ToAuxInt(0)
 13213  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13214  		v3.AuxInt = int64ToAuxInt(16)
 13215  		v3.AddArg(y)
 13216  		v.AddArg3(v0, v2, v3)
 13217  		return true
 13218  	}
 13219  }
 13220  func rewriteValuePPC64_OpRsh16Ux8(v *Value) bool {
 13221  	v_1 := v.Args[1]
 13222  	v_0 := v.Args[0]
 13223  	b := v.Block
 13224  	typ := &b.Func.Config.Types
 13225  	// match: (Rsh16Ux8 x y)
 13226  	// cond: shiftIsBounded(v)
 13227  	// result: (SRD (MOVHZreg x) y)
 13228  	for {
 13229  		x := v_0
 13230  		y := v_1
 13231  		if !(shiftIsBounded(v)) {
 13232  			break
 13233  		}
 13234  		v.reset(OpPPC64SRD)
 13235  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13236  		v0.AddArg(x)
 13237  		v.AddArg2(v0, y)
 13238  		return true
 13239  	}
 13240  	// match: (Rsh16Ux8 <t> x y)
 13241  	// result: (ISEL [2] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F0] y)))
 13242  	for {
 13243  		t := v.Type
 13244  		x := v_0
 13245  		y := v_1
 13246  		v.reset(OpPPC64ISEL)
 13247  		v.AuxInt = int32ToAuxInt(2)
 13248  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13249  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13250  		v1.AddArg(x)
 13251  		v0.AddArg2(v1, y)
 13252  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13253  		v2.AuxInt = int64ToAuxInt(0)
 13254  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13255  		v3.AuxInt = int64ToAuxInt(0)
 13256  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13257  		v4.AuxInt = int64ToAuxInt(0x00F0)
 13258  		v4.AddArg(y)
 13259  		v3.AddArg(v4)
 13260  		v.AddArg3(v0, v2, v3)
 13261  		return true
 13262  	}
 13263  }
 13264  func rewriteValuePPC64_OpRsh16x16(v *Value) bool {
 13265  	v_1 := v.Args[1]
 13266  	v_0 := v.Args[0]
 13267  	b := v.Block
 13268  	typ := &b.Func.Config.Types
 13269  	// match: (Rsh16x16 x y)
 13270  	// cond: shiftIsBounded(v)
 13271  	// result: (SRAD (MOVHreg x) y)
 13272  	for {
 13273  		x := v_0
 13274  		y := v_1
 13275  		if !(shiftIsBounded(v)) {
 13276  			break
 13277  		}
 13278  		v.reset(OpPPC64SRAD)
 13279  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13280  		v0.AddArg(x)
 13281  		v.AddArg2(v0, y)
 13282  		return true
 13283  	}
 13284  	// match: (Rsh16x16 <t> x y)
 13285  	// result: (ISEL [2] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPconst [0] (ANDconst [0xFFF0] y)))
 13286  	for {
 13287  		t := v.Type
 13288  		x := v_0
 13289  		y := v_1
 13290  		v.reset(OpPPC64ISEL)
 13291  		v.AuxInt = int32ToAuxInt(2)
 13292  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13293  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13294  		v1.AddArg(x)
 13295  		v0.AddArg2(v1, y)
 13296  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13297  		v2.AuxInt = int64ToAuxInt(15)
 13298  		v2.AddArg(v1)
 13299  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13300  		v3.AuxInt = int64ToAuxInt(0)
 13301  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13302  		v4.AuxInt = int64ToAuxInt(0xFFF0)
 13303  		v4.AddArg(y)
 13304  		v3.AddArg(v4)
 13305  		v.AddArg3(v0, v2, v3)
 13306  		return true
 13307  	}
 13308  }
 13309  func rewriteValuePPC64_OpRsh16x32(v *Value) bool {
 13310  	v_1 := v.Args[1]
 13311  	v_0 := v.Args[0]
 13312  	b := v.Block
 13313  	typ := &b.Func.Config.Types
 13314  	// match: (Rsh16x32 x y)
 13315  	// cond: shiftIsBounded(v)
 13316  	// result: (SRAD (MOVHreg x) y)
 13317  	for {
 13318  		x := v_0
 13319  		y := v_1
 13320  		if !(shiftIsBounded(v)) {
 13321  			break
 13322  		}
 13323  		v.reset(OpPPC64SRAD)
 13324  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13325  		v0.AddArg(x)
 13326  		v.AddArg2(v0, y)
 13327  		return true
 13328  	}
 13329  	// match: (Rsh16x32 <t> x y)
 13330  	// result: (ISEL [0] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPWUconst y [16]))
 13331  	for {
 13332  		t := v.Type
 13333  		x := v_0
 13334  		y := v_1
 13335  		v.reset(OpPPC64ISEL)
 13336  		v.AuxInt = int32ToAuxInt(0)
 13337  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13338  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13339  		v1.AddArg(x)
 13340  		v0.AddArg2(v1, y)
 13341  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13342  		v2.AuxInt = int64ToAuxInt(15)
 13343  		v2.AddArg(v1)
 13344  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13345  		v3.AuxInt = int32ToAuxInt(16)
 13346  		v3.AddArg(y)
 13347  		v.AddArg3(v0, v2, v3)
 13348  		return true
 13349  	}
 13350  }
 13351  func rewriteValuePPC64_OpRsh16x64(v *Value) bool {
 13352  	v_1 := v.Args[1]
 13353  	v_0 := v.Args[0]
 13354  	b := v.Block
 13355  	typ := &b.Func.Config.Types
 13356  	// match: (Rsh16x64 x (MOVDconst [c]))
 13357  	// cond: uint64(c) >= 16
 13358  	// result: (SRAWconst (SignExt16to32 x) [63])
 13359  	for {
 13360  		x := v_0
 13361  		if v_1.Op != OpPPC64MOVDconst {
 13362  			break
 13363  		}
 13364  		c := auxIntToInt64(v_1.AuxInt)
 13365  		if !(uint64(c) >= 16) {
 13366  			break
 13367  		}
 13368  		v.reset(OpPPC64SRAWconst)
 13369  		v.AuxInt = int64ToAuxInt(63)
 13370  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 13371  		v0.AddArg(x)
 13372  		v.AddArg(v0)
 13373  		return true
 13374  	}
 13375  	// match: (Rsh16x64 x (MOVDconst [c]))
 13376  	// cond: uint64(c) < 16
 13377  	// result: (SRAWconst (SignExt16to32 x) [c])
 13378  	for {
 13379  		x := v_0
 13380  		if v_1.Op != OpPPC64MOVDconst {
 13381  			break
 13382  		}
 13383  		c := auxIntToInt64(v_1.AuxInt)
 13384  		if !(uint64(c) < 16) {
 13385  			break
 13386  		}
 13387  		v.reset(OpPPC64SRAWconst)
 13388  		v.AuxInt = int64ToAuxInt(c)
 13389  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 13390  		v0.AddArg(x)
 13391  		v.AddArg(v0)
 13392  		return true
 13393  	}
 13394  	// match: (Rsh16x64 x y)
 13395  	// cond: shiftIsBounded(v)
 13396  	// result: (SRAD (MOVHreg x) y)
 13397  	for {
 13398  		x := v_0
 13399  		y := v_1
 13400  		if !(shiftIsBounded(v)) {
 13401  			break
 13402  		}
 13403  		v.reset(OpPPC64SRAD)
 13404  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13405  		v0.AddArg(x)
 13406  		v.AddArg2(v0, y)
 13407  		return true
 13408  	}
 13409  	// match: (Rsh16x64 <t> x y)
 13410  	// result: (ISEL [0] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPUconst y [16]))
 13411  	for {
 13412  		t := v.Type
 13413  		x := v_0
 13414  		y := v_1
 13415  		v.reset(OpPPC64ISEL)
 13416  		v.AuxInt = int32ToAuxInt(0)
 13417  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13418  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13419  		v1.AddArg(x)
 13420  		v0.AddArg2(v1, y)
 13421  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13422  		v2.AuxInt = int64ToAuxInt(15)
 13423  		v2.AddArg(v1)
 13424  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13425  		v3.AuxInt = int64ToAuxInt(16)
 13426  		v3.AddArg(y)
 13427  		v.AddArg3(v0, v2, v3)
 13428  		return true
 13429  	}
 13430  }
 13431  func rewriteValuePPC64_OpRsh16x8(v *Value) bool {
 13432  	v_1 := v.Args[1]
 13433  	v_0 := v.Args[0]
 13434  	b := v.Block
 13435  	typ := &b.Func.Config.Types
 13436  	// match: (Rsh16x8 x y)
 13437  	// cond: shiftIsBounded(v)
 13438  	// result: (SRAD (MOVHreg x) y)
 13439  	for {
 13440  		x := v_0
 13441  		y := v_1
 13442  		if !(shiftIsBounded(v)) {
 13443  			break
 13444  		}
 13445  		v.reset(OpPPC64SRAD)
 13446  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13447  		v0.AddArg(x)
 13448  		v.AddArg2(v0, y)
 13449  		return true
 13450  	}
 13451  	// match: (Rsh16x8 <t> x y)
 13452  	// result: (ISEL [2] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPconst [0] (ANDconst [0x00F0] y)))
 13453  	for {
 13454  		t := v.Type
 13455  		x := v_0
 13456  		y := v_1
 13457  		v.reset(OpPPC64ISEL)
 13458  		v.AuxInt = int32ToAuxInt(2)
 13459  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13460  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13461  		v1.AddArg(x)
 13462  		v0.AddArg2(v1, y)
 13463  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13464  		v2.AuxInt = int64ToAuxInt(15)
 13465  		v2.AddArg(v1)
 13466  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13467  		v3.AuxInt = int64ToAuxInt(0)
 13468  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13469  		v4.AuxInt = int64ToAuxInt(0x00F0)
 13470  		v4.AddArg(y)
 13471  		v3.AddArg(v4)
 13472  		v.AddArg3(v0, v2, v3)
 13473  		return true
 13474  	}
 13475  }
 13476  func rewriteValuePPC64_OpRsh32Ux16(v *Value) bool {
 13477  	v_1 := v.Args[1]
 13478  	v_0 := v.Args[0]
 13479  	b := v.Block
 13480  	typ := &b.Func.Config.Types
 13481  	// match: (Rsh32Ux16 x y)
 13482  	// cond: shiftIsBounded(v)
 13483  	// result: (SRW x y)
 13484  	for {
 13485  		x := v_0
 13486  		y := v_1
 13487  		if !(shiftIsBounded(v)) {
 13488  			break
 13489  		}
 13490  		v.reset(OpPPC64SRW)
 13491  		v.AddArg2(x, y)
 13492  		return true
 13493  	}
 13494  	// match: (Rsh32Ux16 <t> x y)
 13495  	// result: (ISEL [2] (SRW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFE0] y)))
 13496  	for {
 13497  		t := v.Type
 13498  		x := v_0
 13499  		y := v_1
 13500  		v.reset(OpPPC64ISEL)
 13501  		v.AuxInt = int32ToAuxInt(2)
 13502  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13503  		v0.AddArg2(x, y)
 13504  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13505  		v1.AuxInt = int64ToAuxInt(0)
 13506  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13507  		v2.AuxInt = int64ToAuxInt(0)
 13508  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13509  		v3.AuxInt = int64ToAuxInt(0xFFE0)
 13510  		v3.AddArg(y)
 13511  		v2.AddArg(v3)
 13512  		v.AddArg3(v0, v1, v2)
 13513  		return true
 13514  	}
 13515  }
 13516  func rewriteValuePPC64_OpRsh32Ux32(v *Value) bool {
 13517  	v_1 := v.Args[1]
 13518  	v_0 := v.Args[0]
 13519  	b := v.Block
 13520  	typ := &b.Func.Config.Types
 13521  	// match: (Rsh32Ux32 x y)
 13522  	// cond: shiftIsBounded(v)
 13523  	// result: (SRW x y)
 13524  	for {
 13525  		x := v_0
 13526  		y := v_1
 13527  		if !(shiftIsBounded(v)) {
 13528  			break
 13529  		}
 13530  		v.reset(OpPPC64SRW)
 13531  		v.AddArg2(x, y)
 13532  		return true
 13533  	}
 13534  	// match: (Rsh32Ux32 <t> x y)
 13535  	// result: (ISEL [0] (SRW <t> x y) (MOVDconst [0]) (CMPWUconst y [32]))
 13536  	for {
 13537  		t := v.Type
 13538  		x := v_0
 13539  		y := v_1
 13540  		v.reset(OpPPC64ISEL)
 13541  		v.AuxInt = int32ToAuxInt(0)
 13542  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13543  		v0.AddArg2(x, y)
 13544  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13545  		v1.AuxInt = int64ToAuxInt(0)
 13546  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13547  		v2.AuxInt = int32ToAuxInt(32)
 13548  		v2.AddArg(y)
 13549  		v.AddArg3(v0, v1, v2)
 13550  		return true
 13551  	}
 13552  }
 13553  func rewriteValuePPC64_OpRsh32Ux64(v *Value) bool {
 13554  	v_1 := v.Args[1]
 13555  	v_0 := v.Args[0]
 13556  	b := v.Block
 13557  	typ := &b.Func.Config.Types
 13558  	// match: (Rsh32Ux64 x (MOVDconst [c]))
 13559  	// cond: uint64(c) < 32
 13560  	// result: (SRWconst x [c])
 13561  	for {
 13562  		x := v_0
 13563  		if v_1.Op != OpPPC64MOVDconst {
 13564  			break
 13565  		}
 13566  		c := auxIntToInt64(v_1.AuxInt)
 13567  		if !(uint64(c) < 32) {
 13568  			break
 13569  		}
 13570  		v.reset(OpPPC64SRWconst)
 13571  		v.AuxInt = int64ToAuxInt(c)
 13572  		v.AddArg(x)
 13573  		return true
 13574  	}
 13575  	// match: (Rsh32Ux64 x y)
 13576  	// cond: shiftIsBounded(v)
 13577  	// result: (SRW x y)
 13578  	for {
 13579  		x := v_0
 13580  		y := v_1
 13581  		if !(shiftIsBounded(v)) {
 13582  			break
 13583  		}
 13584  		v.reset(OpPPC64SRW)
 13585  		v.AddArg2(x, y)
 13586  		return true
 13587  	}
 13588  	// match: (Rsh32Ux64 <t> x y)
 13589  	// result: (ISEL [0] (SRW <t> x y) (MOVDconst [0]) (CMPUconst y [32]))
 13590  	for {
 13591  		t := v.Type
 13592  		x := v_0
 13593  		y := v_1
 13594  		v.reset(OpPPC64ISEL)
 13595  		v.AuxInt = int32ToAuxInt(0)
 13596  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13597  		v0.AddArg2(x, y)
 13598  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13599  		v1.AuxInt = int64ToAuxInt(0)
 13600  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13601  		v2.AuxInt = int64ToAuxInt(32)
 13602  		v2.AddArg(y)
 13603  		v.AddArg3(v0, v1, v2)
 13604  		return true
 13605  	}
 13606  }
 13607  func rewriteValuePPC64_OpRsh32Ux8(v *Value) bool {
 13608  	v_1 := v.Args[1]
 13609  	v_0 := v.Args[0]
 13610  	b := v.Block
 13611  	typ := &b.Func.Config.Types
 13612  	// match: (Rsh32Ux8 x y)
 13613  	// cond: shiftIsBounded(v)
 13614  	// result: (SRW x y)
 13615  	for {
 13616  		x := v_0
 13617  		y := v_1
 13618  		if !(shiftIsBounded(v)) {
 13619  			break
 13620  		}
 13621  		v.reset(OpPPC64SRW)
 13622  		v.AddArg2(x, y)
 13623  		return true
 13624  	}
 13625  	// match: (Rsh32Ux8 <t> x y)
 13626  	// result: (ISEL [2] (SRW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00E0] y)))
 13627  	for {
 13628  		t := v.Type
 13629  		x := v_0
 13630  		y := v_1
 13631  		v.reset(OpPPC64ISEL)
 13632  		v.AuxInt = int32ToAuxInt(2)
 13633  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13634  		v0.AddArg2(x, y)
 13635  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13636  		v1.AuxInt = int64ToAuxInt(0)
 13637  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13638  		v2.AuxInt = int64ToAuxInt(0)
 13639  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13640  		v3.AuxInt = int64ToAuxInt(0x00E0)
 13641  		v3.AddArg(y)
 13642  		v2.AddArg(v3)
 13643  		v.AddArg3(v0, v1, v2)
 13644  		return true
 13645  	}
 13646  }
 13647  func rewriteValuePPC64_OpRsh32x16(v *Value) bool {
 13648  	v_1 := v.Args[1]
 13649  	v_0 := v.Args[0]
 13650  	b := v.Block
 13651  	typ := &b.Func.Config.Types
 13652  	// match: (Rsh32x16 x y)
 13653  	// cond: shiftIsBounded(v)
 13654  	// result: (SRAW x y)
 13655  	for {
 13656  		x := v_0
 13657  		y := v_1
 13658  		if !(shiftIsBounded(v)) {
 13659  			break
 13660  		}
 13661  		v.reset(OpPPC64SRAW)
 13662  		v.AddArg2(x, y)
 13663  		return true
 13664  	}
 13665  	// match: (Rsh32x16 <t> x y)
 13666  	// result: (ISEL [2] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPconst [0] (ANDconst [0xFFE0] y)))
 13667  	for {
 13668  		t := v.Type
 13669  		x := v_0
 13670  		y := v_1
 13671  		v.reset(OpPPC64ISEL)
 13672  		v.AuxInt = int32ToAuxInt(2)
 13673  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 13674  		v0.AddArg2(x, y)
 13675  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 13676  		v1.AuxInt = int64ToAuxInt(31)
 13677  		v1.AddArg(x)
 13678  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13679  		v2.AuxInt = int64ToAuxInt(0)
 13680  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13681  		v3.AuxInt = int64ToAuxInt(0xFFE0)
 13682  		v3.AddArg(y)
 13683  		v2.AddArg(v3)
 13684  		v.AddArg3(v0, v1, v2)
 13685  		return true
 13686  	}
 13687  }
 13688  func rewriteValuePPC64_OpRsh32x32(v *Value) bool {
 13689  	v_1 := v.Args[1]
 13690  	v_0 := v.Args[0]
 13691  	b := v.Block
 13692  	// match: (Rsh32x32 x y)
 13693  	// cond: shiftIsBounded(v)
 13694  	// result: (SRAW x y)
 13695  	for {
 13696  		x := v_0
 13697  		y := v_1
 13698  		if !(shiftIsBounded(v)) {
 13699  			break
 13700  		}
 13701  		v.reset(OpPPC64SRAW)
 13702  		v.AddArg2(x, y)
 13703  		return true
 13704  	}
 13705  	// match: (Rsh32x32 <t> x y)
 13706  	// result: (ISEL [0] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPWUconst y [32]))
 13707  	for {
 13708  		t := v.Type
 13709  		x := v_0
 13710  		y := v_1
 13711  		v.reset(OpPPC64ISEL)
 13712  		v.AuxInt = int32ToAuxInt(0)
 13713  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 13714  		v0.AddArg2(x, y)
 13715  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 13716  		v1.AuxInt = int64ToAuxInt(31)
 13717  		v1.AddArg(x)
 13718  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13719  		v2.AuxInt = int32ToAuxInt(32)
 13720  		v2.AddArg(y)
 13721  		v.AddArg3(v0, v1, v2)
 13722  		return true
 13723  	}
 13724  }
 13725  func rewriteValuePPC64_OpRsh32x64(v *Value) bool {
 13726  	v_1 := v.Args[1]
 13727  	v_0 := v.Args[0]
 13728  	b := v.Block
 13729  	// match: (Rsh32x64 x (MOVDconst [c]))
 13730  	// cond: uint64(c) >= 32
 13731  	// result: (SRAWconst x [63])
 13732  	for {
 13733  		x := v_0
 13734  		if v_1.Op != OpPPC64MOVDconst {
 13735  			break
 13736  		}
 13737  		c := auxIntToInt64(v_1.AuxInt)
 13738  		if !(uint64(c) >= 32) {
 13739  			break
 13740  		}
 13741  		v.reset(OpPPC64SRAWconst)
 13742  		v.AuxInt = int64ToAuxInt(63)
 13743  		v.AddArg(x)
 13744  		return true
 13745  	}
 13746  	// match: (Rsh32x64 x (MOVDconst [c]))
 13747  	// cond: uint64(c) < 32
 13748  	// result: (SRAWconst x [c])
 13749  	for {
 13750  		x := v_0
 13751  		if v_1.Op != OpPPC64MOVDconst {
 13752  			break
 13753  		}
 13754  		c := auxIntToInt64(v_1.AuxInt)
 13755  		if !(uint64(c) < 32) {
 13756  			break
 13757  		}
 13758  		v.reset(OpPPC64SRAWconst)
 13759  		v.AuxInt = int64ToAuxInt(c)
 13760  		v.AddArg(x)
 13761  		return true
 13762  	}
 13763  	// match: (Rsh32x64 x y)
 13764  	// cond: shiftIsBounded(v)
 13765  	// result: (SRAW x y)
 13766  	for {
 13767  		x := v_0
 13768  		y := v_1
 13769  		if !(shiftIsBounded(v)) {
 13770  			break
 13771  		}
 13772  		v.reset(OpPPC64SRAW)
 13773  		v.AddArg2(x, y)
 13774  		return true
 13775  	}
 13776  	// match: (Rsh32x64 <t> x y)
 13777  	// result: (ISEL [0] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPUconst y [32]))
 13778  	for {
 13779  		t := v.Type
 13780  		x := v_0
 13781  		y := v_1
 13782  		v.reset(OpPPC64ISEL)
 13783  		v.AuxInt = int32ToAuxInt(0)
 13784  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 13785  		v0.AddArg2(x, y)
 13786  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 13787  		v1.AuxInt = int64ToAuxInt(31)
 13788  		v1.AddArg(x)
 13789  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13790  		v2.AuxInt = int64ToAuxInt(32)
 13791  		v2.AddArg(y)
 13792  		v.AddArg3(v0, v1, v2)
 13793  		return true
 13794  	}
 13795  }
 13796  func rewriteValuePPC64_OpRsh32x8(v *Value) bool {
 13797  	v_1 := v.Args[1]
 13798  	v_0 := v.Args[0]
 13799  	b := v.Block
 13800  	typ := &b.Func.Config.Types
 13801  	// match: (Rsh32x8 x y)
 13802  	// cond: shiftIsBounded(v)
 13803  	// result: (SRAW x y)
 13804  	for {
 13805  		x := v_0
 13806  		y := v_1
 13807  		if !(shiftIsBounded(v)) {
 13808  			break
 13809  		}
 13810  		v.reset(OpPPC64SRAW)
 13811  		v.AddArg2(x, y)
 13812  		return true
 13813  	}
 13814  	// match: (Rsh32x8 <t> x y)
 13815  	// result: (ISEL [2] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPconst [0] (ANDconst [0x00E0] y)))
 13816  	for {
 13817  		t := v.Type
 13818  		x := v_0
 13819  		y := v_1
 13820  		v.reset(OpPPC64ISEL)
 13821  		v.AuxInt = int32ToAuxInt(2)
 13822  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 13823  		v0.AddArg2(x, y)
 13824  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 13825  		v1.AuxInt = int64ToAuxInt(31)
 13826  		v1.AddArg(x)
 13827  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13828  		v2.AuxInt = int64ToAuxInt(0)
 13829  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13830  		v3.AuxInt = int64ToAuxInt(0x00E0)
 13831  		v3.AddArg(y)
 13832  		v2.AddArg(v3)
 13833  		v.AddArg3(v0, v1, v2)
 13834  		return true
 13835  	}
 13836  }
 13837  func rewriteValuePPC64_OpRsh64Ux16(v *Value) bool {
 13838  	v_1 := v.Args[1]
 13839  	v_0 := v.Args[0]
 13840  	b := v.Block
 13841  	typ := &b.Func.Config.Types
 13842  	// match: (Rsh64Ux16 x y)
 13843  	// cond: shiftIsBounded(v)
 13844  	// result: (SRD x y)
 13845  	for {
 13846  		x := v_0
 13847  		y := v_1
 13848  		if !(shiftIsBounded(v)) {
 13849  			break
 13850  		}
 13851  		v.reset(OpPPC64SRD)
 13852  		v.AddArg2(x, y)
 13853  		return true
 13854  	}
 13855  	// match: (Rsh64Ux16 <t> x y)
 13856  	// result: (ISEL [2] (SRD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFC0] y)))
 13857  	for {
 13858  		t := v.Type
 13859  		x := v_0
 13860  		y := v_1
 13861  		v.reset(OpPPC64ISEL)
 13862  		v.AuxInt = int32ToAuxInt(2)
 13863  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13864  		v0.AddArg2(x, y)
 13865  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13866  		v1.AuxInt = int64ToAuxInt(0)
 13867  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13868  		v2.AuxInt = int64ToAuxInt(0)
 13869  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13870  		v3.AuxInt = int64ToAuxInt(0xFFC0)
 13871  		v3.AddArg(y)
 13872  		v2.AddArg(v3)
 13873  		v.AddArg3(v0, v1, v2)
 13874  		return true
 13875  	}
 13876  }
 13877  func rewriteValuePPC64_OpRsh64Ux32(v *Value) bool {
 13878  	v_1 := v.Args[1]
 13879  	v_0 := v.Args[0]
 13880  	b := v.Block
 13881  	typ := &b.Func.Config.Types
 13882  	// match: (Rsh64Ux32 x y)
 13883  	// cond: shiftIsBounded(v)
 13884  	// result: (SRD x y)
 13885  	for {
 13886  		x := v_0
 13887  		y := v_1
 13888  		if !(shiftIsBounded(v)) {
 13889  			break
 13890  		}
 13891  		v.reset(OpPPC64SRD)
 13892  		v.AddArg2(x, y)
 13893  		return true
 13894  	}
 13895  	// match: (Rsh64Ux32 <t> x y)
 13896  	// result: (ISEL [0] (SRD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
 13897  	for {
 13898  		t := v.Type
 13899  		x := v_0
 13900  		y := v_1
 13901  		v.reset(OpPPC64ISEL)
 13902  		v.AuxInt = int32ToAuxInt(0)
 13903  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13904  		v0.AddArg2(x, y)
 13905  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13906  		v1.AuxInt = int64ToAuxInt(0)
 13907  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13908  		v2.AuxInt = int32ToAuxInt(64)
 13909  		v2.AddArg(y)
 13910  		v.AddArg3(v0, v1, v2)
 13911  		return true
 13912  	}
 13913  }
 13914  func rewriteValuePPC64_OpRsh64Ux64(v *Value) bool {
 13915  	v_1 := v.Args[1]
 13916  	v_0 := v.Args[0]
 13917  	b := v.Block
 13918  	typ := &b.Func.Config.Types
 13919  	// match: (Rsh64Ux64 x (MOVDconst [c]))
 13920  	// cond: uint64(c) < 64
 13921  	// result: (SRDconst x [c])
 13922  	for {
 13923  		x := v_0
 13924  		if v_1.Op != OpPPC64MOVDconst {
 13925  			break
 13926  		}
 13927  		c := auxIntToInt64(v_1.AuxInt)
 13928  		if !(uint64(c) < 64) {
 13929  			break
 13930  		}
 13931  		v.reset(OpPPC64SRDconst)
 13932  		v.AuxInt = int64ToAuxInt(c)
 13933  		v.AddArg(x)
 13934  		return true
 13935  	}
 13936  	// match: (Rsh64Ux64 x y)
 13937  	// cond: shiftIsBounded(v)
 13938  	// result: (SRD x y)
 13939  	for {
 13940  		x := v_0
 13941  		y := v_1
 13942  		if !(shiftIsBounded(v)) {
 13943  			break
 13944  		}
 13945  		v.reset(OpPPC64SRD)
 13946  		v.AddArg2(x, y)
 13947  		return true
 13948  	}
 13949  	// match: (Rsh64Ux64 <t> x y)
 13950  	// result: (ISEL [0] (SRD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
 13951  	for {
 13952  		t := v.Type
 13953  		x := v_0
 13954  		y := v_1
 13955  		v.reset(OpPPC64ISEL)
 13956  		v.AuxInt = int32ToAuxInt(0)
 13957  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13958  		v0.AddArg2(x, y)
 13959  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13960  		v1.AuxInt = int64ToAuxInt(0)
 13961  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13962  		v2.AuxInt = int64ToAuxInt(64)
 13963  		v2.AddArg(y)
 13964  		v.AddArg3(v0, v1, v2)
 13965  		return true
 13966  	}
 13967  }
 13968  func rewriteValuePPC64_OpRsh64Ux8(v *Value) bool {
 13969  	v_1 := v.Args[1]
 13970  	v_0 := v.Args[0]
 13971  	b := v.Block
 13972  	typ := &b.Func.Config.Types
 13973  	// match: (Rsh64Ux8 x y)
 13974  	// cond: shiftIsBounded(v)
 13975  	// result: (SRD x y)
 13976  	for {
 13977  		x := v_0
 13978  		y := v_1
 13979  		if !(shiftIsBounded(v)) {
 13980  			break
 13981  		}
 13982  		v.reset(OpPPC64SRD)
 13983  		v.AddArg2(x, y)
 13984  		return true
 13985  	}
 13986  	// match: (Rsh64Ux8 <t> x y)
 13987  	// result: (ISEL [2] (SRD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00C0] y)))
 13988  	for {
 13989  		t := v.Type
 13990  		x := v_0
 13991  		y := v_1
 13992  		v.reset(OpPPC64ISEL)
 13993  		v.AuxInt = int32ToAuxInt(2)
 13994  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13995  		v0.AddArg2(x, y)
 13996  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13997  		v1.AuxInt = int64ToAuxInt(0)
 13998  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13999  		v2.AuxInt = int64ToAuxInt(0)
 14000  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14001  		v3.AuxInt = int64ToAuxInt(0x00C0)
 14002  		v3.AddArg(y)
 14003  		v2.AddArg(v3)
 14004  		v.AddArg3(v0, v1, v2)
 14005  		return true
 14006  	}
 14007  }
 14008  func rewriteValuePPC64_OpRsh64x16(v *Value) bool {
 14009  	v_1 := v.Args[1]
 14010  	v_0 := v.Args[0]
 14011  	b := v.Block
 14012  	typ := &b.Func.Config.Types
 14013  	// match: (Rsh64x16 x y)
 14014  	// cond: shiftIsBounded(v)
 14015  	// result: (SRAD x y)
 14016  	for {
 14017  		x := v_0
 14018  		y := v_1
 14019  		if !(shiftIsBounded(v)) {
 14020  			break
 14021  		}
 14022  		v.reset(OpPPC64SRAD)
 14023  		v.AddArg2(x, y)
 14024  		return true
 14025  	}
 14026  	// match: (Rsh64x16 <t> x y)
 14027  	// result: (ISEL [2] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPconst [0] (ANDconst [0xFFC0] y)))
 14028  	for {
 14029  		t := v.Type
 14030  		x := v_0
 14031  		y := v_1
 14032  		v.reset(OpPPC64ISEL)
 14033  		v.AuxInt = int32ToAuxInt(2)
 14034  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14035  		v0.AddArg2(x, y)
 14036  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14037  		v1.AuxInt = int64ToAuxInt(63)
 14038  		v1.AddArg(x)
 14039  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14040  		v2.AuxInt = int64ToAuxInt(0)
 14041  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14042  		v3.AuxInt = int64ToAuxInt(0xFFC0)
 14043  		v3.AddArg(y)
 14044  		v2.AddArg(v3)
 14045  		v.AddArg3(v0, v1, v2)
 14046  		return true
 14047  	}
 14048  }
 14049  func rewriteValuePPC64_OpRsh64x32(v *Value) bool {
 14050  	v_1 := v.Args[1]
 14051  	v_0 := v.Args[0]
 14052  	b := v.Block
 14053  	// match: (Rsh64x32 x y)
 14054  	// cond: shiftIsBounded(v)
 14055  	// result: (SRAD x y)
 14056  	for {
 14057  		x := v_0
 14058  		y := v_1
 14059  		if !(shiftIsBounded(v)) {
 14060  			break
 14061  		}
 14062  		v.reset(OpPPC64SRAD)
 14063  		v.AddArg2(x, y)
 14064  		return true
 14065  	}
 14066  	// match: (Rsh64x32 <t> x y)
 14067  	// result: (ISEL [0] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPWUconst y [64]))
 14068  	for {
 14069  		t := v.Type
 14070  		x := v_0
 14071  		y := v_1
 14072  		v.reset(OpPPC64ISEL)
 14073  		v.AuxInt = int32ToAuxInt(0)
 14074  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14075  		v0.AddArg2(x, y)
 14076  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14077  		v1.AuxInt = int64ToAuxInt(63)
 14078  		v1.AddArg(x)
 14079  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14080  		v2.AuxInt = int32ToAuxInt(64)
 14081  		v2.AddArg(y)
 14082  		v.AddArg3(v0, v1, v2)
 14083  		return true
 14084  	}
 14085  }
 14086  func rewriteValuePPC64_OpRsh64x64(v *Value) bool {
 14087  	v_1 := v.Args[1]
 14088  	v_0 := v.Args[0]
 14089  	b := v.Block
 14090  	// match: (Rsh64x64 x (MOVDconst [c]))
 14091  	// cond: uint64(c) >= 64
 14092  	// result: (SRADconst x [63])
 14093  	for {
 14094  		x := v_0
 14095  		if v_1.Op != OpPPC64MOVDconst {
 14096  			break
 14097  		}
 14098  		c := auxIntToInt64(v_1.AuxInt)
 14099  		if !(uint64(c) >= 64) {
 14100  			break
 14101  		}
 14102  		v.reset(OpPPC64SRADconst)
 14103  		v.AuxInt = int64ToAuxInt(63)
 14104  		v.AddArg(x)
 14105  		return true
 14106  	}
 14107  	// match: (Rsh64x64 x (MOVDconst [c]))
 14108  	// cond: uint64(c) < 64
 14109  	// result: (SRADconst x [c])
 14110  	for {
 14111  		x := v_0
 14112  		if v_1.Op != OpPPC64MOVDconst {
 14113  			break
 14114  		}
 14115  		c := auxIntToInt64(v_1.AuxInt)
 14116  		if !(uint64(c) < 64) {
 14117  			break
 14118  		}
 14119  		v.reset(OpPPC64SRADconst)
 14120  		v.AuxInt = int64ToAuxInt(c)
 14121  		v.AddArg(x)
 14122  		return true
 14123  	}
 14124  	// match: (Rsh64x64 x y)
 14125  	// cond: shiftIsBounded(v)
 14126  	// result: (SRAD x y)
 14127  	for {
 14128  		x := v_0
 14129  		y := v_1
 14130  		if !(shiftIsBounded(v)) {
 14131  			break
 14132  		}
 14133  		v.reset(OpPPC64SRAD)
 14134  		v.AddArg2(x, y)
 14135  		return true
 14136  	}
 14137  	// match: (Rsh64x64 <t> x y)
 14138  	// result: (ISEL [0] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPUconst y [64]))
 14139  	for {
 14140  		t := v.Type
 14141  		x := v_0
 14142  		y := v_1
 14143  		v.reset(OpPPC64ISEL)
 14144  		v.AuxInt = int32ToAuxInt(0)
 14145  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14146  		v0.AddArg2(x, y)
 14147  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14148  		v1.AuxInt = int64ToAuxInt(63)
 14149  		v1.AddArg(x)
 14150  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14151  		v2.AuxInt = int64ToAuxInt(64)
 14152  		v2.AddArg(y)
 14153  		v.AddArg3(v0, v1, v2)
 14154  		return true
 14155  	}
 14156  }
 14157  func rewriteValuePPC64_OpRsh64x8(v *Value) bool {
 14158  	v_1 := v.Args[1]
 14159  	v_0 := v.Args[0]
 14160  	b := v.Block
 14161  	typ := &b.Func.Config.Types
 14162  	// match: (Rsh64x8 x y)
 14163  	// cond: shiftIsBounded(v)
 14164  	// result: (SRAD x y)
 14165  	for {
 14166  		x := v_0
 14167  		y := v_1
 14168  		if !(shiftIsBounded(v)) {
 14169  			break
 14170  		}
 14171  		v.reset(OpPPC64SRAD)
 14172  		v.AddArg2(x, y)
 14173  		return true
 14174  	}
 14175  	// match: (Rsh64x8 <t> x y)
 14176  	// result: (ISEL [2] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPconst [0] (ANDconst [0x00C0] y)))
 14177  	for {
 14178  		t := v.Type
 14179  		x := v_0
 14180  		y := v_1
 14181  		v.reset(OpPPC64ISEL)
 14182  		v.AuxInt = int32ToAuxInt(2)
 14183  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14184  		v0.AddArg2(x, y)
 14185  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14186  		v1.AuxInt = int64ToAuxInt(63)
 14187  		v1.AddArg(x)
 14188  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14189  		v2.AuxInt = int64ToAuxInt(0)
 14190  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14191  		v3.AuxInt = int64ToAuxInt(0x00C0)
 14192  		v3.AddArg(y)
 14193  		v2.AddArg(v3)
 14194  		v.AddArg3(v0, v1, v2)
 14195  		return true
 14196  	}
 14197  }
 14198  func rewriteValuePPC64_OpRsh8Ux16(v *Value) bool {
 14199  	v_1 := v.Args[1]
 14200  	v_0 := v.Args[0]
 14201  	b := v.Block
 14202  	typ := &b.Func.Config.Types
 14203  	// match: (Rsh8Ux16 x y)
 14204  	// cond: shiftIsBounded(v)
 14205  	// result: (SRD (MOVBZreg x) y)
 14206  	for {
 14207  		x := v_0
 14208  		y := v_1
 14209  		if !(shiftIsBounded(v)) {
 14210  			break
 14211  		}
 14212  		v.reset(OpPPC64SRD)
 14213  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14214  		v0.AddArg(x)
 14215  		v.AddArg2(v0, y)
 14216  		return true
 14217  	}
 14218  	// match: (Rsh8Ux16 <t> x y)
 14219  	// result: (ISEL [2] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF8] y)))
 14220  	for {
 14221  		t := v.Type
 14222  		x := v_0
 14223  		y := v_1
 14224  		v.reset(OpPPC64ISEL)
 14225  		v.AuxInt = int32ToAuxInt(2)
 14226  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14227  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14228  		v1.AddArg(x)
 14229  		v0.AddArg2(v1, y)
 14230  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14231  		v2.AuxInt = int64ToAuxInt(0)
 14232  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14233  		v3.AuxInt = int64ToAuxInt(0)
 14234  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14235  		v4.AuxInt = int64ToAuxInt(0xFFF8)
 14236  		v4.AddArg(y)
 14237  		v3.AddArg(v4)
 14238  		v.AddArg3(v0, v2, v3)
 14239  		return true
 14240  	}
 14241  }
 14242  func rewriteValuePPC64_OpRsh8Ux32(v *Value) bool {
 14243  	v_1 := v.Args[1]
 14244  	v_0 := v.Args[0]
 14245  	b := v.Block
 14246  	typ := &b.Func.Config.Types
 14247  	// match: (Rsh8Ux32 x y)
 14248  	// cond: shiftIsBounded(v)
 14249  	// result: (SRD (MOVBZreg x) y)
 14250  	for {
 14251  		x := v_0
 14252  		y := v_1
 14253  		if !(shiftIsBounded(v)) {
 14254  			break
 14255  		}
 14256  		v.reset(OpPPC64SRD)
 14257  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14258  		v0.AddArg(x)
 14259  		v.AddArg2(v0, y)
 14260  		return true
 14261  	}
 14262  	// match: (Rsh8Ux32 <t> x y)
 14263  	// result: (ISEL [0] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [8]))
 14264  	for {
 14265  		t := v.Type
 14266  		x := v_0
 14267  		y := v_1
 14268  		v.reset(OpPPC64ISEL)
 14269  		v.AuxInt = int32ToAuxInt(0)
 14270  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14271  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14272  		v1.AddArg(x)
 14273  		v0.AddArg2(v1, y)
 14274  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14275  		v2.AuxInt = int64ToAuxInt(0)
 14276  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14277  		v3.AuxInt = int32ToAuxInt(8)
 14278  		v3.AddArg(y)
 14279  		v.AddArg3(v0, v2, v3)
 14280  		return true
 14281  	}
 14282  }
 14283  func rewriteValuePPC64_OpRsh8Ux64(v *Value) bool {
 14284  	v_1 := v.Args[1]
 14285  	v_0 := v.Args[0]
 14286  	b := v.Block
 14287  	typ := &b.Func.Config.Types
 14288  	// match: (Rsh8Ux64 x (MOVDconst [c]))
 14289  	// cond: uint64(c) < 8
 14290  	// result: (SRWconst (ZeroExt8to32 x) [c])
 14291  	for {
 14292  		x := v_0
 14293  		if v_1.Op != OpPPC64MOVDconst {
 14294  			break
 14295  		}
 14296  		c := auxIntToInt64(v_1.AuxInt)
 14297  		if !(uint64(c) < 8) {
 14298  			break
 14299  		}
 14300  		v.reset(OpPPC64SRWconst)
 14301  		v.AuxInt = int64ToAuxInt(c)
 14302  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 14303  		v0.AddArg(x)
 14304  		v.AddArg(v0)
 14305  		return true
 14306  	}
 14307  	// match: (Rsh8Ux64 x y)
 14308  	// cond: shiftIsBounded(v)
 14309  	// result: (SRD (MOVBZreg x) y)
 14310  	for {
 14311  		x := v_0
 14312  		y := v_1
 14313  		if !(shiftIsBounded(v)) {
 14314  			break
 14315  		}
 14316  		v.reset(OpPPC64SRD)
 14317  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14318  		v0.AddArg(x)
 14319  		v.AddArg2(v0, y)
 14320  		return true
 14321  	}
 14322  	// match: (Rsh8Ux64 <t> x y)
 14323  	// result: (ISEL [0] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [8]))
 14324  	for {
 14325  		t := v.Type
 14326  		x := v_0
 14327  		y := v_1
 14328  		v.reset(OpPPC64ISEL)
 14329  		v.AuxInt = int32ToAuxInt(0)
 14330  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14331  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14332  		v1.AddArg(x)
 14333  		v0.AddArg2(v1, y)
 14334  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14335  		v2.AuxInt = int64ToAuxInt(0)
 14336  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14337  		v3.AuxInt = int64ToAuxInt(8)
 14338  		v3.AddArg(y)
 14339  		v.AddArg3(v0, v2, v3)
 14340  		return true
 14341  	}
 14342  }
 14343  func rewriteValuePPC64_OpRsh8Ux8(v *Value) bool {
 14344  	v_1 := v.Args[1]
 14345  	v_0 := v.Args[0]
 14346  	b := v.Block
 14347  	typ := &b.Func.Config.Types
 14348  	// match: (Rsh8Ux8 x y)
 14349  	// cond: shiftIsBounded(v)
 14350  	// result: (SRD (MOVBZreg x) y)
 14351  	for {
 14352  		x := v_0
 14353  		y := v_1
 14354  		if !(shiftIsBounded(v)) {
 14355  			break
 14356  		}
 14357  		v.reset(OpPPC64SRD)
 14358  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14359  		v0.AddArg(x)
 14360  		v.AddArg2(v0, y)
 14361  		return true
 14362  	}
 14363  	// match: (Rsh8Ux8 <t> x y)
 14364  	// result: (ISEL [2] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F8] y)))
 14365  	for {
 14366  		t := v.Type
 14367  		x := v_0
 14368  		y := v_1
 14369  		v.reset(OpPPC64ISEL)
 14370  		v.AuxInt = int32ToAuxInt(2)
 14371  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14372  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14373  		v1.AddArg(x)
 14374  		v0.AddArg2(v1, y)
 14375  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14376  		v2.AuxInt = int64ToAuxInt(0)
 14377  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14378  		v3.AuxInt = int64ToAuxInt(0)
 14379  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14380  		v4.AuxInt = int64ToAuxInt(0x00F8)
 14381  		v4.AddArg(y)
 14382  		v3.AddArg(v4)
 14383  		v.AddArg3(v0, v2, v3)
 14384  		return true
 14385  	}
 14386  }
 14387  func rewriteValuePPC64_OpRsh8x16(v *Value) bool {
 14388  	v_1 := v.Args[1]
 14389  	v_0 := v.Args[0]
 14390  	b := v.Block
 14391  	typ := &b.Func.Config.Types
 14392  	// match: (Rsh8x16 x y)
 14393  	// cond: shiftIsBounded(v)
 14394  	// result: (SRAD (MOVBreg x) y)
 14395  	for {
 14396  		x := v_0
 14397  		y := v_1
 14398  		if !(shiftIsBounded(v)) {
 14399  			break
 14400  		}
 14401  		v.reset(OpPPC64SRAD)
 14402  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14403  		v0.AddArg(x)
 14404  		v.AddArg2(v0, y)
 14405  		return true
 14406  	}
 14407  	// match: (Rsh8x16 <t> x y)
 14408  	// result: (ISEL [2] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPconst [0] (ANDconst [0xFFF8] y)))
 14409  	for {
 14410  		t := v.Type
 14411  		x := v_0
 14412  		y := v_1
 14413  		v.reset(OpPPC64ISEL)
 14414  		v.AuxInt = int32ToAuxInt(2)
 14415  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14416  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14417  		v1.AddArg(x)
 14418  		v0.AddArg2(v1, y)
 14419  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14420  		v2.AuxInt = int64ToAuxInt(7)
 14421  		v2.AddArg(v1)
 14422  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14423  		v3.AuxInt = int64ToAuxInt(0)
 14424  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14425  		v4.AuxInt = int64ToAuxInt(0xFFF8)
 14426  		v4.AddArg(y)
 14427  		v3.AddArg(v4)
 14428  		v.AddArg3(v0, v2, v3)
 14429  		return true
 14430  	}
 14431  }
 14432  func rewriteValuePPC64_OpRsh8x32(v *Value) bool {
 14433  	v_1 := v.Args[1]
 14434  	v_0 := v.Args[0]
 14435  	b := v.Block
 14436  	typ := &b.Func.Config.Types
 14437  	// match: (Rsh8x32 x y)
 14438  	// cond: shiftIsBounded(v)
 14439  	// result: (SRAD (MOVBreg x) y)
 14440  	for {
 14441  		x := v_0
 14442  		y := v_1
 14443  		if !(shiftIsBounded(v)) {
 14444  			break
 14445  		}
 14446  		v.reset(OpPPC64SRAD)
 14447  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14448  		v0.AddArg(x)
 14449  		v.AddArg2(v0, y)
 14450  		return true
 14451  	}
 14452  	// match: (Rsh8x32 <t> x y)
 14453  	// result: (ISEL [0] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPWUconst y [8]))
 14454  	for {
 14455  		t := v.Type
 14456  		x := v_0
 14457  		y := v_1
 14458  		v.reset(OpPPC64ISEL)
 14459  		v.AuxInt = int32ToAuxInt(0)
 14460  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14461  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14462  		v1.AddArg(x)
 14463  		v0.AddArg2(v1, y)
 14464  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14465  		v2.AuxInt = int64ToAuxInt(7)
 14466  		v2.AddArg(v1)
 14467  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14468  		v3.AuxInt = int32ToAuxInt(8)
 14469  		v3.AddArg(y)
 14470  		v.AddArg3(v0, v2, v3)
 14471  		return true
 14472  	}
 14473  }
 14474  func rewriteValuePPC64_OpRsh8x64(v *Value) bool {
 14475  	v_1 := v.Args[1]
 14476  	v_0 := v.Args[0]
 14477  	b := v.Block
 14478  	typ := &b.Func.Config.Types
 14479  	// match: (Rsh8x64 x (MOVDconst [c]))
 14480  	// cond: uint64(c) >= 8
 14481  	// result: (SRAWconst (SignExt8to32 x) [63])
 14482  	for {
 14483  		x := v_0
 14484  		if v_1.Op != OpPPC64MOVDconst {
 14485  			break
 14486  		}
 14487  		c := auxIntToInt64(v_1.AuxInt)
 14488  		if !(uint64(c) >= 8) {
 14489  			break
 14490  		}
 14491  		v.reset(OpPPC64SRAWconst)
 14492  		v.AuxInt = int64ToAuxInt(63)
 14493  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 14494  		v0.AddArg(x)
 14495  		v.AddArg(v0)
 14496  		return true
 14497  	}
 14498  	// match: (Rsh8x64 x (MOVDconst [c]))
 14499  	// cond: uint64(c) < 8
 14500  	// result: (SRAWconst (SignExt8to32 x) [c])
 14501  	for {
 14502  		x := v_0
 14503  		if v_1.Op != OpPPC64MOVDconst {
 14504  			break
 14505  		}
 14506  		c := auxIntToInt64(v_1.AuxInt)
 14507  		if !(uint64(c) < 8) {
 14508  			break
 14509  		}
 14510  		v.reset(OpPPC64SRAWconst)
 14511  		v.AuxInt = int64ToAuxInt(c)
 14512  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 14513  		v0.AddArg(x)
 14514  		v.AddArg(v0)
 14515  		return true
 14516  	}
 14517  	// match: (Rsh8x64 x y)
 14518  	// cond: shiftIsBounded(v)
 14519  	// result: (SRAD (MOVBreg x) y)
 14520  	for {
 14521  		x := v_0
 14522  		y := v_1
 14523  		if !(shiftIsBounded(v)) {
 14524  			break
 14525  		}
 14526  		v.reset(OpPPC64SRAD)
 14527  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14528  		v0.AddArg(x)
 14529  		v.AddArg2(v0, y)
 14530  		return true
 14531  	}
 14532  	// match: (Rsh8x64 <t> x y)
 14533  	// result: (ISEL [0] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPUconst y [8]))
 14534  	for {
 14535  		t := v.Type
 14536  		x := v_0
 14537  		y := v_1
 14538  		v.reset(OpPPC64ISEL)
 14539  		v.AuxInt = int32ToAuxInt(0)
 14540  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14541  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14542  		v1.AddArg(x)
 14543  		v0.AddArg2(v1, y)
 14544  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14545  		v2.AuxInt = int64ToAuxInt(7)
 14546  		v2.AddArg(v1)
 14547  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14548  		v3.AuxInt = int64ToAuxInt(8)
 14549  		v3.AddArg(y)
 14550  		v.AddArg3(v0, v2, v3)
 14551  		return true
 14552  	}
 14553  }
 14554  func rewriteValuePPC64_OpRsh8x8(v *Value) bool {
 14555  	v_1 := v.Args[1]
 14556  	v_0 := v.Args[0]
 14557  	b := v.Block
 14558  	typ := &b.Func.Config.Types
 14559  	// match: (Rsh8x8 x y)
 14560  	// cond: shiftIsBounded(v)
 14561  	// result: (SRAD (MOVBreg x) y)
 14562  	for {
 14563  		x := v_0
 14564  		y := v_1
 14565  		if !(shiftIsBounded(v)) {
 14566  			break
 14567  		}
 14568  		v.reset(OpPPC64SRAD)
 14569  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14570  		v0.AddArg(x)
 14571  		v.AddArg2(v0, y)
 14572  		return true
 14573  	}
 14574  	// match: (Rsh8x8 <t> x y)
 14575  	// result: (ISEL [2] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPconst [0] (ANDconst [0x00F8] y)))
 14576  	for {
 14577  		t := v.Type
 14578  		x := v_0
 14579  		y := v_1
 14580  		v.reset(OpPPC64ISEL)
 14581  		v.AuxInt = int32ToAuxInt(2)
 14582  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14583  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14584  		v1.AddArg(x)
 14585  		v0.AddArg2(v1, y)
 14586  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14587  		v2.AuxInt = int64ToAuxInt(7)
 14588  		v2.AddArg(v1)
 14589  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14590  		v3.AuxInt = int64ToAuxInt(0)
 14591  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14592  		v4.AuxInt = int64ToAuxInt(0x00F8)
 14593  		v4.AddArg(y)
 14594  		v3.AddArg(v4)
 14595  		v.AddArg3(v0, v2, v3)
 14596  		return true
 14597  	}
 14598  }
 14599  func rewriteValuePPC64_OpSelect0(v *Value) bool {
 14600  	v_0 := v.Args[0]
 14601  	b := v.Block
 14602  	typ := &b.Func.Config.Types
 14603  	// match: (Select0 (Mul64uhilo x y))
 14604  	// result: (MULHDU x y)
 14605  	for {
 14606  		if v_0.Op != OpMul64uhilo {
 14607  			break
 14608  		}
 14609  		y := v_0.Args[1]
 14610  		x := v_0.Args[0]
 14611  		v.reset(OpPPC64MULHDU)
 14612  		v.AddArg2(x, y)
 14613  		return true
 14614  	}
 14615  	// match: (Select0 (Mul64uover x y))
 14616  	// result: (MULLD x y)
 14617  	for {
 14618  		if v_0.Op != OpMul64uover {
 14619  			break
 14620  		}
 14621  		y := v_0.Args[1]
 14622  		x := v_0.Args[0]
 14623  		v.reset(OpPPC64MULLD)
 14624  		v.AddArg2(x, y)
 14625  		return true
 14626  	}
 14627  	// match: (Select0 (Add64carry x y c))
 14628  	// result: (Select0 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1]))))
 14629  	for {
 14630  		if v_0.Op != OpAdd64carry {
 14631  			break
 14632  		}
 14633  		c := v_0.Args[2]
 14634  		x := v_0.Args[0]
 14635  		y := v_0.Args[1]
 14636  		v.reset(OpSelect0)
 14637  		v.Type = typ.UInt64
 14638  		v0 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
 14639  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14640  		v2 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 14641  		v2.AuxInt = int64ToAuxInt(-1)
 14642  		v2.AddArg(c)
 14643  		v1.AddArg(v2)
 14644  		v0.AddArg3(x, y, v1)
 14645  		v.AddArg(v0)
 14646  		return true
 14647  	}
 14648  	// match: (Select0 (Sub64borrow x y c))
 14649  	// result: (Select0 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0]))))
 14650  	for {
 14651  		if v_0.Op != OpSub64borrow {
 14652  			break
 14653  		}
 14654  		c := v_0.Args[2]
 14655  		x := v_0.Args[0]
 14656  		y := v_0.Args[1]
 14657  		v.reset(OpSelect0)
 14658  		v.Type = typ.UInt64
 14659  		v0 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
 14660  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14661  		v2 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 14662  		v2.AuxInt = int64ToAuxInt(0)
 14663  		v2.AddArg(c)
 14664  		v1.AddArg(v2)
 14665  		v0.AddArg3(x, y, v1)
 14666  		v.AddArg(v0)
 14667  		return true
 14668  	}
 14669  	return false
 14670  }
 14671  func rewriteValuePPC64_OpSelect1(v *Value) bool {
 14672  	v_0 := v.Args[0]
 14673  	b := v.Block
 14674  	typ := &b.Func.Config.Types
 14675  	// match: (Select1 (Mul64uhilo x y))
 14676  	// result: (MULLD x y)
 14677  	for {
 14678  		if v_0.Op != OpMul64uhilo {
 14679  			break
 14680  		}
 14681  		y := v_0.Args[1]
 14682  		x := v_0.Args[0]
 14683  		v.reset(OpPPC64MULLD)
 14684  		v.AddArg2(x, y)
 14685  		return true
 14686  	}
 14687  	// match: (Select1 (Mul64uover x y))
 14688  	// result: (SETBCR [2] (CMPconst [0] (MULHDU <x.Type> x y)))
 14689  	for {
 14690  		if v_0.Op != OpMul64uover {
 14691  			break
 14692  		}
 14693  		y := v_0.Args[1]
 14694  		x := v_0.Args[0]
 14695  		v.reset(OpPPC64SETBCR)
 14696  		v.AuxInt = int32ToAuxInt(2)
 14697  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14698  		v0.AuxInt = int64ToAuxInt(0)
 14699  		v1 := b.NewValue0(v.Pos, OpPPC64MULHDU, x.Type)
 14700  		v1.AddArg2(x, y)
 14701  		v0.AddArg(v1)
 14702  		v.AddArg(v0)
 14703  		return true
 14704  	}
 14705  	// match: (Select1 (Add64carry x y c))
 14706  	// result: (ADDZEzero (Select1 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1])))))
 14707  	for {
 14708  		if v_0.Op != OpAdd64carry {
 14709  			break
 14710  		}
 14711  		c := v_0.Args[2]
 14712  		x := v_0.Args[0]
 14713  		y := v_0.Args[1]
 14714  		v.reset(OpPPC64ADDZEzero)
 14715  		v0 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14716  		v1 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
 14717  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14718  		v3 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 14719  		v3.AuxInt = int64ToAuxInt(-1)
 14720  		v3.AddArg(c)
 14721  		v2.AddArg(v3)
 14722  		v1.AddArg3(x, y, v2)
 14723  		v0.AddArg(v1)
 14724  		v.AddArg(v0)
 14725  		return true
 14726  	}
 14727  	// match: (Select1 (ADDCconst n:(ADDZEzero x) [-1]))
 14728  	// cond: n.Uses <= 2
 14729  	// result: x
 14730  	for {
 14731  		if v_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_0.AuxInt) != -1 {
 14732  			break
 14733  		}
 14734  		n := v_0.Args[0]
 14735  		if n.Op != OpPPC64ADDZEzero {
 14736  			break
 14737  		}
 14738  		x := n.Args[0]
 14739  		if !(n.Uses <= 2) {
 14740  			break
 14741  		}
 14742  		v.copyOf(x)
 14743  		return true
 14744  	}
 14745  	// match: (Select1 (Sub64borrow x y c))
 14746  	// result: (NEG (SUBZEzero (Select1 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0]))))))
 14747  	for {
 14748  		if v_0.Op != OpSub64borrow {
 14749  			break
 14750  		}
 14751  		c := v_0.Args[2]
 14752  		x := v_0.Args[0]
 14753  		y := v_0.Args[1]
 14754  		v.reset(OpPPC64NEG)
 14755  		v0 := b.NewValue0(v.Pos, OpPPC64SUBZEzero, typ.UInt64)
 14756  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14757  		v2 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
 14758  		v3 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14759  		v4 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 14760  		v4.AuxInt = int64ToAuxInt(0)
 14761  		v4.AddArg(c)
 14762  		v3.AddArg(v4)
 14763  		v2.AddArg3(x, y, v3)
 14764  		v1.AddArg(v2)
 14765  		v0.AddArg(v1)
 14766  		v.AddArg(v0)
 14767  		return true
 14768  	}
 14769  	// match: (Select1 (SUBCconst n:(NEG (SUBZEzero x)) [0]))
 14770  	// cond: n.Uses <= 2
 14771  	// result: x
 14772  	for {
 14773  		if v_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_0.AuxInt) != 0 {
 14774  			break
 14775  		}
 14776  		n := v_0.Args[0]
 14777  		if n.Op != OpPPC64NEG {
 14778  			break
 14779  		}
 14780  		n_0 := n.Args[0]
 14781  		if n_0.Op != OpPPC64SUBZEzero {
 14782  			break
 14783  		}
 14784  		x := n_0.Args[0]
 14785  		if !(n.Uses <= 2) {
 14786  			break
 14787  		}
 14788  		v.copyOf(x)
 14789  		return true
 14790  	}
 14791  	return false
 14792  }
 14793  func rewriteValuePPC64_OpSelectN(v *Value) bool {
 14794  	v_0 := v.Args[0]
 14795  	b := v.Block
 14796  	config := b.Func.Config
 14797  	// match: (SelectN [0] call:(CALLstatic {sym} s1:(MOVDstore _ (MOVDconst [sz]) s2:(MOVDstore _ src s3:(MOVDstore {t} _ dst mem)))))
 14798  	// 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)
 14799  	// result: (Move [sz] dst src mem)
 14800  	for {
 14801  		if auxIntToInt64(v.AuxInt) != 0 {
 14802  			break
 14803  		}
 14804  		call := v_0
 14805  		if call.Op != OpPPC64CALLstatic || len(call.Args) != 1 {
 14806  			break
 14807  		}
 14808  		sym := auxToCall(call.Aux)
 14809  		s1 := call.Args[0]
 14810  		if s1.Op != OpPPC64MOVDstore {
 14811  			break
 14812  		}
 14813  		_ = s1.Args[2]
 14814  		s1_1 := s1.Args[1]
 14815  		if s1_1.Op != OpPPC64MOVDconst {
 14816  			break
 14817  		}
 14818  		sz := auxIntToInt64(s1_1.AuxInt)
 14819  		s2 := s1.Args[2]
 14820  		if s2.Op != OpPPC64MOVDstore {
 14821  			break
 14822  		}
 14823  		_ = s2.Args[2]
 14824  		src := s2.Args[1]
 14825  		s3 := s2.Args[2]
 14826  		if s3.Op != OpPPC64MOVDstore {
 14827  			break
 14828  		}
 14829  		mem := s3.Args[2]
 14830  		dst := s3.Args[1]
 14831  		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)) {
 14832  			break
 14833  		}
 14834  		v.reset(OpMove)
 14835  		v.AuxInt = int64ToAuxInt(sz)
 14836  		v.AddArg3(dst, src, mem)
 14837  		return true
 14838  	}
 14839  	// match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVDconst [sz]) mem))
 14840  	// cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)
 14841  	// result: (Move [sz] dst src mem)
 14842  	for {
 14843  		if auxIntToInt64(v.AuxInt) != 0 {
 14844  			break
 14845  		}
 14846  		call := v_0
 14847  		if call.Op != OpPPC64CALLstatic || len(call.Args) != 4 {
 14848  			break
 14849  		}
 14850  		sym := auxToCall(call.Aux)
 14851  		mem := call.Args[3]
 14852  		dst := call.Args[0]
 14853  		src := call.Args[1]
 14854  		call_2 := call.Args[2]
 14855  		if call_2.Op != OpPPC64MOVDconst {
 14856  			break
 14857  		}
 14858  		sz := auxIntToInt64(call_2.AuxInt)
 14859  		if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
 14860  			break
 14861  		}
 14862  		v.reset(OpMove)
 14863  		v.AuxInt = int64ToAuxInt(sz)
 14864  		v.AddArg3(dst, src, mem)
 14865  		return true
 14866  	}
 14867  	return false
 14868  }
 14869  func rewriteValuePPC64_OpSlicemask(v *Value) bool {
 14870  	v_0 := v.Args[0]
 14871  	b := v.Block
 14872  	// match: (Slicemask <t> x)
 14873  	// result: (SRADconst (NEG <t> x) [63])
 14874  	for {
 14875  		t := v.Type
 14876  		x := v_0
 14877  		v.reset(OpPPC64SRADconst)
 14878  		v.AuxInt = int64ToAuxInt(63)
 14879  		v0 := b.NewValue0(v.Pos, OpPPC64NEG, t)
 14880  		v0.AddArg(x)
 14881  		v.AddArg(v0)
 14882  		return true
 14883  	}
 14884  }
 14885  func rewriteValuePPC64_OpStore(v *Value) bool {
 14886  	v_2 := v.Args[2]
 14887  	v_1 := v.Args[1]
 14888  	v_0 := v.Args[0]
 14889  	// match: (Store {t} ptr val mem)
 14890  	// cond: t.Size() == 8 && t.IsFloat()
 14891  	// result: (FMOVDstore ptr val mem)
 14892  	for {
 14893  		t := auxToType(v.Aux)
 14894  		ptr := v_0
 14895  		val := v_1
 14896  		mem := v_2
 14897  		if !(t.Size() == 8 && t.IsFloat()) {
 14898  			break
 14899  		}
 14900  		v.reset(OpPPC64FMOVDstore)
 14901  		v.AddArg3(ptr, val, mem)
 14902  		return true
 14903  	}
 14904  	// match: (Store {t} ptr val mem)
 14905  	// cond: t.Size() == 4 && t.IsFloat()
 14906  	// result: (FMOVSstore ptr val mem)
 14907  	for {
 14908  		t := auxToType(v.Aux)
 14909  		ptr := v_0
 14910  		val := v_1
 14911  		mem := v_2
 14912  		if !(t.Size() == 4 && t.IsFloat()) {
 14913  			break
 14914  		}
 14915  		v.reset(OpPPC64FMOVSstore)
 14916  		v.AddArg3(ptr, val, mem)
 14917  		return true
 14918  	}
 14919  	// match: (Store {t} ptr val mem)
 14920  	// cond: t.Size() == 8 && !t.IsFloat()
 14921  	// result: (MOVDstore ptr val mem)
 14922  	for {
 14923  		t := auxToType(v.Aux)
 14924  		ptr := v_0
 14925  		val := v_1
 14926  		mem := v_2
 14927  		if !(t.Size() == 8 && !t.IsFloat()) {
 14928  			break
 14929  		}
 14930  		v.reset(OpPPC64MOVDstore)
 14931  		v.AddArg3(ptr, val, mem)
 14932  		return true
 14933  	}
 14934  	// match: (Store {t} ptr val mem)
 14935  	// cond: t.Size() == 4 && !t.IsFloat()
 14936  	// result: (MOVWstore ptr val mem)
 14937  	for {
 14938  		t := auxToType(v.Aux)
 14939  		ptr := v_0
 14940  		val := v_1
 14941  		mem := v_2
 14942  		if !(t.Size() == 4 && !t.IsFloat()) {
 14943  			break
 14944  		}
 14945  		v.reset(OpPPC64MOVWstore)
 14946  		v.AddArg3(ptr, val, mem)
 14947  		return true
 14948  	}
 14949  	// match: (Store {t} ptr val mem)
 14950  	// cond: t.Size() == 2
 14951  	// result: (MOVHstore ptr val mem)
 14952  	for {
 14953  		t := auxToType(v.Aux)
 14954  		ptr := v_0
 14955  		val := v_1
 14956  		mem := v_2
 14957  		if !(t.Size() == 2) {
 14958  			break
 14959  		}
 14960  		v.reset(OpPPC64MOVHstore)
 14961  		v.AddArg3(ptr, val, mem)
 14962  		return true
 14963  	}
 14964  	// match: (Store {t} ptr val mem)
 14965  	// cond: t.Size() == 1
 14966  	// result: (MOVBstore ptr val mem)
 14967  	for {
 14968  		t := auxToType(v.Aux)
 14969  		ptr := v_0
 14970  		val := v_1
 14971  		mem := v_2
 14972  		if !(t.Size() == 1) {
 14973  			break
 14974  		}
 14975  		v.reset(OpPPC64MOVBstore)
 14976  		v.AddArg3(ptr, val, mem)
 14977  		return true
 14978  	}
 14979  	return false
 14980  }
 14981  func rewriteValuePPC64_OpTrunc16to8(v *Value) bool {
 14982  	v_0 := v.Args[0]
 14983  	// match: (Trunc16to8 <t> x)
 14984  	// cond: t.IsSigned()
 14985  	// result: (MOVBreg x)
 14986  	for {
 14987  		t := v.Type
 14988  		x := v_0
 14989  		if !(t.IsSigned()) {
 14990  			break
 14991  		}
 14992  		v.reset(OpPPC64MOVBreg)
 14993  		v.AddArg(x)
 14994  		return true
 14995  	}
 14996  	// match: (Trunc16to8 x)
 14997  	// result: (MOVBZreg x)
 14998  	for {
 14999  		x := v_0
 15000  		v.reset(OpPPC64MOVBZreg)
 15001  		v.AddArg(x)
 15002  		return true
 15003  	}
 15004  }
 15005  func rewriteValuePPC64_OpTrunc32to16(v *Value) bool {
 15006  	v_0 := v.Args[0]
 15007  	// match: (Trunc32to16 <t> x)
 15008  	// cond: t.IsSigned()
 15009  	// result: (MOVHreg x)
 15010  	for {
 15011  		t := v.Type
 15012  		x := v_0
 15013  		if !(t.IsSigned()) {
 15014  			break
 15015  		}
 15016  		v.reset(OpPPC64MOVHreg)
 15017  		v.AddArg(x)
 15018  		return true
 15019  	}
 15020  	// match: (Trunc32to16 x)
 15021  	// result: (MOVHZreg x)
 15022  	for {
 15023  		x := v_0
 15024  		v.reset(OpPPC64MOVHZreg)
 15025  		v.AddArg(x)
 15026  		return true
 15027  	}
 15028  }
 15029  func rewriteValuePPC64_OpTrunc32to8(v *Value) bool {
 15030  	v_0 := v.Args[0]
 15031  	// match: (Trunc32to8 <t> x)
 15032  	// cond: t.IsSigned()
 15033  	// result: (MOVBreg x)
 15034  	for {
 15035  		t := v.Type
 15036  		x := v_0
 15037  		if !(t.IsSigned()) {
 15038  			break
 15039  		}
 15040  		v.reset(OpPPC64MOVBreg)
 15041  		v.AddArg(x)
 15042  		return true
 15043  	}
 15044  	// match: (Trunc32to8 x)
 15045  	// result: (MOVBZreg x)
 15046  	for {
 15047  		x := v_0
 15048  		v.reset(OpPPC64MOVBZreg)
 15049  		v.AddArg(x)
 15050  		return true
 15051  	}
 15052  }
 15053  func rewriteValuePPC64_OpTrunc64to16(v *Value) bool {
 15054  	v_0 := v.Args[0]
 15055  	// match: (Trunc64to16 <t> x)
 15056  	// cond: t.IsSigned()
 15057  	// result: (MOVHreg x)
 15058  	for {
 15059  		t := v.Type
 15060  		x := v_0
 15061  		if !(t.IsSigned()) {
 15062  			break
 15063  		}
 15064  		v.reset(OpPPC64MOVHreg)
 15065  		v.AddArg(x)
 15066  		return true
 15067  	}
 15068  	// match: (Trunc64to16 x)
 15069  	// result: (MOVHZreg x)
 15070  	for {
 15071  		x := v_0
 15072  		v.reset(OpPPC64MOVHZreg)
 15073  		v.AddArg(x)
 15074  		return true
 15075  	}
 15076  }
 15077  func rewriteValuePPC64_OpTrunc64to32(v *Value) bool {
 15078  	v_0 := v.Args[0]
 15079  	// match: (Trunc64to32 <t> x)
 15080  	// cond: t.IsSigned()
 15081  	// result: (MOVWreg x)
 15082  	for {
 15083  		t := v.Type
 15084  		x := v_0
 15085  		if !(t.IsSigned()) {
 15086  			break
 15087  		}
 15088  		v.reset(OpPPC64MOVWreg)
 15089  		v.AddArg(x)
 15090  		return true
 15091  	}
 15092  	// match: (Trunc64to32 x)
 15093  	// result: (MOVWZreg x)
 15094  	for {
 15095  		x := v_0
 15096  		v.reset(OpPPC64MOVWZreg)
 15097  		v.AddArg(x)
 15098  		return true
 15099  	}
 15100  }
 15101  func rewriteValuePPC64_OpTrunc64to8(v *Value) bool {
 15102  	v_0 := v.Args[0]
 15103  	// match: (Trunc64to8 <t> x)
 15104  	// cond: t.IsSigned()
 15105  	// result: (MOVBreg x)
 15106  	for {
 15107  		t := v.Type
 15108  		x := v_0
 15109  		if !(t.IsSigned()) {
 15110  			break
 15111  		}
 15112  		v.reset(OpPPC64MOVBreg)
 15113  		v.AddArg(x)
 15114  		return true
 15115  	}
 15116  	// match: (Trunc64to8 x)
 15117  	// result: (MOVBZreg x)
 15118  	for {
 15119  		x := v_0
 15120  		v.reset(OpPPC64MOVBZreg)
 15121  		v.AddArg(x)
 15122  		return true
 15123  	}
 15124  }
 15125  func rewriteValuePPC64_OpZero(v *Value) bool {
 15126  	v_1 := v.Args[1]
 15127  	v_0 := v.Args[0]
 15128  	b := v.Block
 15129  	// match: (Zero [0] _ mem)
 15130  	// result: mem
 15131  	for {
 15132  		if auxIntToInt64(v.AuxInt) != 0 {
 15133  			break
 15134  		}
 15135  		mem := v_1
 15136  		v.copyOf(mem)
 15137  		return true
 15138  	}
 15139  	// match: (Zero [1] destptr mem)
 15140  	// result: (MOVBstorezero destptr mem)
 15141  	for {
 15142  		if auxIntToInt64(v.AuxInt) != 1 {
 15143  			break
 15144  		}
 15145  		destptr := v_0
 15146  		mem := v_1
 15147  		v.reset(OpPPC64MOVBstorezero)
 15148  		v.AddArg2(destptr, mem)
 15149  		return true
 15150  	}
 15151  	// match: (Zero [2] destptr mem)
 15152  	// result: (MOVHstorezero destptr mem)
 15153  	for {
 15154  		if auxIntToInt64(v.AuxInt) != 2 {
 15155  			break
 15156  		}
 15157  		destptr := v_0
 15158  		mem := v_1
 15159  		v.reset(OpPPC64MOVHstorezero)
 15160  		v.AddArg2(destptr, mem)
 15161  		return true
 15162  	}
 15163  	// match: (Zero [3] destptr mem)
 15164  	// result: (MOVBstorezero [2] destptr (MOVHstorezero destptr mem))
 15165  	for {
 15166  		if auxIntToInt64(v.AuxInt) != 3 {
 15167  			break
 15168  		}
 15169  		destptr := v_0
 15170  		mem := v_1
 15171  		v.reset(OpPPC64MOVBstorezero)
 15172  		v.AuxInt = int32ToAuxInt(2)
 15173  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
 15174  		v0.AddArg2(destptr, mem)
 15175  		v.AddArg2(destptr, v0)
 15176  		return true
 15177  	}
 15178  	// match: (Zero [4] destptr mem)
 15179  	// result: (MOVWstorezero destptr mem)
 15180  	for {
 15181  		if auxIntToInt64(v.AuxInt) != 4 {
 15182  			break
 15183  		}
 15184  		destptr := v_0
 15185  		mem := v_1
 15186  		v.reset(OpPPC64MOVWstorezero)
 15187  		v.AddArg2(destptr, mem)
 15188  		return true
 15189  	}
 15190  	// match: (Zero [5] destptr mem)
 15191  	// result: (MOVBstorezero [4] destptr (MOVWstorezero destptr mem))
 15192  	for {
 15193  		if auxIntToInt64(v.AuxInt) != 5 {
 15194  			break
 15195  		}
 15196  		destptr := v_0
 15197  		mem := v_1
 15198  		v.reset(OpPPC64MOVBstorezero)
 15199  		v.AuxInt = int32ToAuxInt(4)
 15200  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15201  		v0.AddArg2(destptr, mem)
 15202  		v.AddArg2(destptr, v0)
 15203  		return true
 15204  	}
 15205  	// match: (Zero [6] destptr mem)
 15206  	// result: (MOVHstorezero [4] destptr (MOVWstorezero destptr mem))
 15207  	for {
 15208  		if auxIntToInt64(v.AuxInt) != 6 {
 15209  			break
 15210  		}
 15211  		destptr := v_0
 15212  		mem := v_1
 15213  		v.reset(OpPPC64MOVHstorezero)
 15214  		v.AuxInt = int32ToAuxInt(4)
 15215  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15216  		v0.AddArg2(destptr, mem)
 15217  		v.AddArg2(destptr, v0)
 15218  		return true
 15219  	}
 15220  	// match: (Zero [7] destptr mem)
 15221  	// result: (MOVBstorezero [6] destptr (MOVHstorezero [4] destptr (MOVWstorezero destptr mem)))
 15222  	for {
 15223  		if auxIntToInt64(v.AuxInt) != 7 {
 15224  			break
 15225  		}
 15226  		destptr := v_0
 15227  		mem := v_1
 15228  		v.reset(OpPPC64MOVBstorezero)
 15229  		v.AuxInt = int32ToAuxInt(6)
 15230  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
 15231  		v0.AuxInt = int32ToAuxInt(4)
 15232  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15233  		v1.AddArg2(destptr, mem)
 15234  		v0.AddArg2(destptr, v1)
 15235  		v.AddArg2(destptr, v0)
 15236  		return true
 15237  	}
 15238  	// match: (Zero [8] {t} destptr mem)
 15239  	// result: (MOVDstorezero destptr mem)
 15240  	for {
 15241  		if auxIntToInt64(v.AuxInt) != 8 {
 15242  			break
 15243  		}
 15244  		destptr := v_0
 15245  		mem := v_1
 15246  		v.reset(OpPPC64MOVDstorezero)
 15247  		v.AddArg2(destptr, mem)
 15248  		return true
 15249  	}
 15250  	// match: (Zero [12] {t} destptr mem)
 15251  	// result: (MOVWstorezero [8] destptr (MOVDstorezero [0] destptr mem))
 15252  	for {
 15253  		if auxIntToInt64(v.AuxInt) != 12 {
 15254  			break
 15255  		}
 15256  		destptr := v_0
 15257  		mem := v_1
 15258  		v.reset(OpPPC64MOVWstorezero)
 15259  		v.AuxInt = int32ToAuxInt(8)
 15260  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15261  		v0.AuxInt = int32ToAuxInt(0)
 15262  		v0.AddArg2(destptr, mem)
 15263  		v.AddArg2(destptr, v0)
 15264  		return true
 15265  	}
 15266  	// match: (Zero [16] {t} destptr mem)
 15267  	// result: (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))
 15268  	for {
 15269  		if auxIntToInt64(v.AuxInt) != 16 {
 15270  			break
 15271  		}
 15272  		destptr := v_0
 15273  		mem := v_1
 15274  		v.reset(OpPPC64MOVDstorezero)
 15275  		v.AuxInt = int32ToAuxInt(8)
 15276  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15277  		v0.AuxInt = int32ToAuxInt(0)
 15278  		v0.AddArg2(destptr, mem)
 15279  		v.AddArg2(destptr, v0)
 15280  		return true
 15281  	}
 15282  	// match: (Zero [24] {t} destptr mem)
 15283  	// result: (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem)))
 15284  	for {
 15285  		if auxIntToInt64(v.AuxInt) != 24 {
 15286  			break
 15287  		}
 15288  		destptr := v_0
 15289  		mem := v_1
 15290  		v.reset(OpPPC64MOVDstorezero)
 15291  		v.AuxInt = int32ToAuxInt(16)
 15292  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15293  		v0.AuxInt = int32ToAuxInt(8)
 15294  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15295  		v1.AuxInt = int32ToAuxInt(0)
 15296  		v1.AddArg2(destptr, mem)
 15297  		v0.AddArg2(destptr, v1)
 15298  		v.AddArg2(destptr, v0)
 15299  		return true
 15300  	}
 15301  	// match: (Zero [32] {t} destptr mem)
 15302  	// result: (MOVDstorezero [24] destptr (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))))
 15303  	for {
 15304  		if auxIntToInt64(v.AuxInt) != 32 {
 15305  			break
 15306  		}
 15307  		destptr := v_0
 15308  		mem := v_1
 15309  		v.reset(OpPPC64MOVDstorezero)
 15310  		v.AuxInt = int32ToAuxInt(24)
 15311  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15312  		v0.AuxInt = int32ToAuxInt(16)
 15313  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15314  		v1.AuxInt = int32ToAuxInt(8)
 15315  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15316  		v2.AuxInt = int32ToAuxInt(0)
 15317  		v2.AddArg2(destptr, mem)
 15318  		v1.AddArg2(destptr, v2)
 15319  		v0.AddArg2(destptr, v1)
 15320  		v.AddArg2(destptr, v0)
 15321  		return true
 15322  	}
 15323  	// match: (Zero [s] ptr mem)
 15324  	// cond: buildcfg.GOPPC64 <= 8 && s < 64
 15325  	// result: (LoweredZeroShort [s] ptr mem)
 15326  	for {
 15327  		s := auxIntToInt64(v.AuxInt)
 15328  		ptr := v_0
 15329  		mem := v_1
 15330  		if !(buildcfg.GOPPC64 <= 8 && s < 64) {
 15331  			break
 15332  		}
 15333  		v.reset(OpPPC64LoweredZeroShort)
 15334  		v.AuxInt = int64ToAuxInt(s)
 15335  		v.AddArg2(ptr, mem)
 15336  		return true
 15337  	}
 15338  	// match: (Zero [s] ptr mem)
 15339  	// cond: buildcfg.GOPPC64 <= 8
 15340  	// result: (LoweredZero [s] ptr mem)
 15341  	for {
 15342  		s := auxIntToInt64(v.AuxInt)
 15343  		ptr := v_0
 15344  		mem := v_1
 15345  		if !(buildcfg.GOPPC64 <= 8) {
 15346  			break
 15347  		}
 15348  		v.reset(OpPPC64LoweredZero)
 15349  		v.AuxInt = int64ToAuxInt(s)
 15350  		v.AddArg2(ptr, mem)
 15351  		return true
 15352  	}
 15353  	// match: (Zero [s] ptr mem)
 15354  	// cond: s < 128 && buildcfg.GOPPC64 >= 9
 15355  	// result: (LoweredQuadZeroShort [s] ptr mem)
 15356  	for {
 15357  		s := auxIntToInt64(v.AuxInt)
 15358  		ptr := v_0
 15359  		mem := v_1
 15360  		if !(s < 128 && buildcfg.GOPPC64 >= 9) {
 15361  			break
 15362  		}
 15363  		v.reset(OpPPC64LoweredQuadZeroShort)
 15364  		v.AuxInt = int64ToAuxInt(s)
 15365  		v.AddArg2(ptr, mem)
 15366  		return true
 15367  	}
 15368  	// match: (Zero [s] ptr mem)
 15369  	// cond: buildcfg.GOPPC64 >= 9
 15370  	// result: (LoweredQuadZero [s] ptr mem)
 15371  	for {
 15372  		s := auxIntToInt64(v.AuxInt)
 15373  		ptr := v_0
 15374  		mem := v_1
 15375  		if !(buildcfg.GOPPC64 >= 9) {
 15376  			break
 15377  		}
 15378  		v.reset(OpPPC64LoweredQuadZero)
 15379  		v.AuxInt = int64ToAuxInt(s)
 15380  		v.AddArg2(ptr, mem)
 15381  		return true
 15382  	}
 15383  	return false
 15384  }
 15385  func rewriteBlockPPC64(b *Block) bool {
 15386  	typ := &b.Func.Config.Types
 15387  	switch b.Kind {
 15388  	case BlockPPC64EQ:
 15389  		// match: (EQ (FlagEQ) yes no)
 15390  		// result: (First yes no)
 15391  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15392  			b.Reset(BlockFirst)
 15393  			return true
 15394  		}
 15395  		// match: (EQ (FlagLT) yes no)
 15396  		// result: (First no yes)
 15397  		for b.Controls[0].Op == OpPPC64FlagLT {
 15398  			b.Reset(BlockFirst)
 15399  			b.swapSuccessors()
 15400  			return true
 15401  		}
 15402  		// match: (EQ (FlagGT) yes no)
 15403  		// result: (First no yes)
 15404  		for b.Controls[0].Op == OpPPC64FlagGT {
 15405  			b.Reset(BlockFirst)
 15406  			b.swapSuccessors()
 15407  			return true
 15408  		}
 15409  		// match: (EQ (InvertFlags cmp) yes no)
 15410  		// result: (EQ cmp yes no)
 15411  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15412  			v_0 := b.Controls[0]
 15413  			cmp := v_0.Args[0]
 15414  			b.resetWithControl(BlockPPC64EQ, cmp)
 15415  			return true
 15416  		}
 15417  		// match: (EQ (CMPconst [0] z:(AND x y)) yes no)
 15418  		// cond: z.Uses == 1
 15419  		// result: (EQ (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15420  		for b.Controls[0].Op == OpPPC64CMPconst {
 15421  			v_0 := b.Controls[0]
 15422  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15423  				break
 15424  			}
 15425  			z := v_0.Args[0]
 15426  			if z.Op != OpPPC64AND {
 15427  				break
 15428  			}
 15429  			_ = z.Args[1]
 15430  			z_0 := z.Args[0]
 15431  			z_1 := z.Args[1]
 15432  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15433  				x := z_0
 15434  				y := z_1
 15435  				if !(z.Uses == 1) {
 15436  					continue
 15437  				}
 15438  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15439  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15440  				v1.AddArg2(x, y)
 15441  				v0.AddArg(v1)
 15442  				b.resetWithControl(BlockPPC64EQ, v0)
 15443  				return true
 15444  			}
 15445  			break
 15446  		}
 15447  		// match: (EQ (CMPconst [0] z:(OR x y)) yes no)
 15448  		// cond: z.Uses == 1
 15449  		// result: (EQ (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15450  		for b.Controls[0].Op == OpPPC64CMPconst {
 15451  			v_0 := b.Controls[0]
 15452  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15453  				break
 15454  			}
 15455  			z := v_0.Args[0]
 15456  			if z.Op != OpPPC64OR {
 15457  				break
 15458  			}
 15459  			_ = z.Args[1]
 15460  			z_0 := z.Args[0]
 15461  			z_1 := z.Args[1]
 15462  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15463  				x := z_0
 15464  				y := z_1
 15465  				if !(z.Uses == 1) {
 15466  					continue
 15467  				}
 15468  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15469  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15470  				v1.AddArg2(x, y)
 15471  				v0.AddArg(v1)
 15472  				b.resetWithControl(BlockPPC64EQ, v0)
 15473  				return true
 15474  			}
 15475  			break
 15476  		}
 15477  		// match: (EQ (CMPconst [0] z:(XOR x y)) yes no)
 15478  		// cond: z.Uses == 1
 15479  		// result: (EQ (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15480  		for b.Controls[0].Op == OpPPC64CMPconst {
 15481  			v_0 := b.Controls[0]
 15482  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15483  				break
 15484  			}
 15485  			z := v_0.Args[0]
 15486  			if z.Op != OpPPC64XOR {
 15487  				break
 15488  			}
 15489  			_ = z.Args[1]
 15490  			z_0 := z.Args[0]
 15491  			z_1 := z.Args[1]
 15492  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15493  				x := z_0
 15494  				y := z_1
 15495  				if !(z.Uses == 1) {
 15496  					continue
 15497  				}
 15498  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15499  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15500  				v1.AddArg2(x, y)
 15501  				v0.AddArg(v1)
 15502  				b.resetWithControl(BlockPPC64EQ, v0)
 15503  				return true
 15504  			}
 15505  			break
 15506  		}
 15507  	case BlockPPC64GE:
 15508  		// match: (GE (FlagEQ) yes no)
 15509  		// result: (First yes no)
 15510  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15511  			b.Reset(BlockFirst)
 15512  			return true
 15513  		}
 15514  		// match: (GE (FlagLT) yes no)
 15515  		// result: (First no yes)
 15516  		for b.Controls[0].Op == OpPPC64FlagLT {
 15517  			b.Reset(BlockFirst)
 15518  			b.swapSuccessors()
 15519  			return true
 15520  		}
 15521  		// match: (GE (FlagGT) yes no)
 15522  		// result: (First yes no)
 15523  		for b.Controls[0].Op == OpPPC64FlagGT {
 15524  			b.Reset(BlockFirst)
 15525  			return true
 15526  		}
 15527  		// match: (GE (InvertFlags cmp) yes no)
 15528  		// result: (LE cmp yes no)
 15529  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15530  			v_0 := b.Controls[0]
 15531  			cmp := v_0.Args[0]
 15532  			b.resetWithControl(BlockPPC64LE, cmp)
 15533  			return true
 15534  		}
 15535  		// match: (GE (CMPconst [0] z:(AND x y)) yes no)
 15536  		// cond: z.Uses == 1
 15537  		// result: (GE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15538  		for b.Controls[0].Op == OpPPC64CMPconst {
 15539  			v_0 := b.Controls[0]
 15540  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15541  				break
 15542  			}
 15543  			z := v_0.Args[0]
 15544  			if z.Op != OpPPC64AND {
 15545  				break
 15546  			}
 15547  			_ = z.Args[1]
 15548  			z_0 := z.Args[0]
 15549  			z_1 := z.Args[1]
 15550  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15551  				x := z_0
 15552  				y := z_1
 15553  				if !(z.Uses == 1) {
 15554  					continue
 15555  				}
 15556  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15557  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15558  				v1.AddArg2(x, y)
 15559  				v0.AddArg(v1)
 15560  				b.resetWithControl(BlockPPC64GE, v0)
 15561  				return true
 15562  			}
 15563  			break
 15564  		}
 15565  		// match: (GE (CMPconst [0] z:(OR x y)) yes no)
 15566  		// cond: z.Uses == 1
 15567  		// result: (GE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15568  		for b.Controls[0].Op == OpPPC64CMPconst {
 15569  			v_0 := b.Controls[0]
 15570  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15571  				break
 15572  			}
 15573  			z := v_0.Args[0]
 15574  			if z.Op != OpPPC64OR {
 15575  				break
 15576  			}
 15577  			_ = z.Args[1]
 15578  			z_0 := z.Args[0]
 15579  			z_1 := z.Args[1]
 15580  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15581  				x := z_0
 15582  				y := z_1
 15583  				if !(z.Uses == 1) {
 15584  					continue
 15585  				}
 15586  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15587  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15588  				v1.AddArg2(x, y)
 15589  				v0.AddArg(v1)
 15590  				b.resetWithControl(BlockPPC64GE, v0)
 15591  				return true
 15592  			}
 15593  			break
 15594  		}
 15595  		// match: (GE (CMPconst [0] z:(XOR x y)) yes no)
 15596  		// cond: z.Uses == 1
 15597  		// result: (GE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15598  		for b.Controls[0].Op == OpPPC64CMPconst {
 15599  			v_0 := b.Controls[0]
 15600  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15601  				break
 15602  			}
 15603  			z := v_0.Args[0]
 15604  			if z.Op != OpPPC64XOR {
 15605  				break
 15606  			}
 15607  			_ = z.Args[1]
 15608  			z_0 := z.Args[0]
 15609  			z_1 := z.Args[1]
 15610  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15611  				x := z_0
 15612  				y := z_1
 15613  				if !(z.Uses == 1) {
 15614  					continue
 15615  				}
 15616  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15617  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15618  				v1.AddArg2(x, y)
 15619  				v0.AddArg(v1)
 15620  				b.resetWithControl(BlockPPC64GE, v0)
 15621  				return true
 15622  			}
 15623  			break
 15624  		}
 15625  	case BlockPPC64GT:
 15626  		// match: (GT (FlagEQ) yes no)
 15627  		// result: (First no yes)
 15628  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15629  			b.Reset(BlockFirst)
 15630  			b.swapSuccessors()
 15631  			return true
 15632  		}
 15633  		// match: (GT (FlagLT) yes no)
 15634  		// result: (First no yes)
 15635  		for b.Controls[0].Op == OpPPC64FlagLT {
 15636  			b.Reset(BlockFirst)
 15637  			b.swapSuccessors()
 15638  			return true
 15639  		}
 15640  		// match: (GT (FlagGT) yes no)
 15641  		// result: (First yes no)
 15642  		for b.Controls[0].Op == OpPPC64FlagGT {
 15643  			b.Reset(BlockFirst)
 15644  			return true
 15645  		}
 15646  		// match: (GT (InvertFlags cmp) yes no)
 15647  		// result: (LT cmp yes no)
 15648  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15649  			v_0 := b.Controls[0]
 15650  			cmp := v_0.Args[0]
 15651  			b.resetWithControl(BlockPPC64LT, cmp)
 15652  			return true
 15653  		}
 15654  		// match: (GT (CMPconst [0] z:(AND x y)) yes no)
 15655  		// cond: z.Uses == 1
 15656  		// result: (GT (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15657  		for b.Controls[0].Op == OpPPC64CMPconst {
 15658  			v_0 := b.Controls[0]
 15659  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15660  				break
 15661  			}
 15662  			z := v_0.Args[0]
 15663  			if z.Op != OpPPC64AND {
 15664  				break
 15665  			}
 15666  			_ = z.Args[1]
 15667  			z_0 := z.Args[0]
 15668  			z_1 := z.Args[1]
 15669  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15670  				x := z_0
 15671  				y := z_1
 15672  				if !(z.Uses == 1) {
 15673  					continue
 15674  				}
 15675  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15676  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15677  				v1.AddArg2(x, y)
 15678  				v0.AddArg(v1)
 15679  				b.resetWithControl(BlockPPC64GT, v0)
 15680  				return true
 15681  			}
 15682  			break
 15683  		}
 15684  		// match: (GT (CMPconst [0] z:(OR x y)) yes no)
 15685  		// cond: z.Uses == 1
 15686  		// result: (GT (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15687  		for b.Controls[0].Op == OpPPC64CMPconst {
 15688  			v_0 := b.Controls[0]
 15689  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15690  				break
 15691  			}
 15692  			z := v_0.Args[0]
 15693  			if z.Op != OpPPC64OR {
 15694  				break
 15695  			}
 15696  			_ = z.Args[1]
 15697  			z_0 := z.Args[0]
 15698  			z_1 := z.Args[1]
 15699  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15700  				x := z_0
 15701  				y := z_1
 15702  				if !(z.Uses == 1) {
 15703  					continue
 15704  				}
 15705  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15706  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15707  				v1.AddArg2(x, y)
 15708  				v0.AddArg(v1)
 15709  				b.resetWithControl(BlockPPC64GT, v0)
 15710  				return true
 15711  			}
 15712  			break
 15713  		}
 15714  		// match: (GT (CMPconst [0] z:(XOR x y)) yes no)
 15715  		// cond: z.Uses == 1
 15716  		// result: (GT (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15717  		for b.Controls[0].Op == OpPPC64CMPconst {
 15718  			v_0 := b.Controls[0]
 15719  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15720  				break
 15721  			}
 15722  			z := v_0.Args[0]
 15723  			if z.Op != OpPPC64XOR {
 15724  				break
 15725  			}
 15726  			_ = z.Args[1]
 15727  			z_0 := z.Args[0]
 15728  			z_1 := z.Args[1]
 15729  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15730  				x := z_0
 15731  				y := z_1
 15732  				if !(z.Uses == 1) {
 15733  					continue
 15734  				}
 15735  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15736  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15737  				v1.AddArg2(x, y)
 15738  				v0.AddArg(v1)
 15739  				b.resetWithControl(BlockPPC64GT, v0)
 15740  				return true
 15741  			}
 15742  			break
 15743  		}
 15744  	case BlockIf:
 15745  		// match: (If (Equal cc) yes no)
 15746  		// result: (EQ cc yes no)
 15747  		for b.Controls[0].Op == OpPPC64Equal {
 15748  			v_0 := b.Controls[0]
 15749  			cc := v_0.Args[0]
 15750  			b.resetWithControl(BlockPPC64EQ, cc)
 15751  			return true
 15752  		}
 15753  		// match: (If (NotEqual cc) yes no)
 15754  		// result: (NE cc yes no)
 15755  		for b.Controls[0].Op == OpPPC64NotEqual {
 15756  			v_0 := b.Controls[0]
 15757  			cc := v_0.Args[0]
 15758  			b.resetWithControl(BlockPPC64NE, cc)
 15759  			return true
 15760  		}
 15761  		// match: (If (LessThan cc) yes no)
 15762  		// result: (LT cc yes no)
 15763  		for b.Controls[0].Op == OpPPC64LessThan {
 15764  			v_0 := b.Controls[0]
 15765  			cc := v_0.Args[0]
 15766  			b.resetWithControl(BlockPPC64LT, cc)
 15767  			return true
 15768  		}
 15769  		// match: (If (LessEqual cc) yes no)
 15770  		// result: (LE cc yes no)
 15771  		for b.Controls[0].Op == OpPPC64LessEqual {
 15772  			v_0 := b.Controls[0]
 15773  			cc := v_0.Args[0]
 15774  			b.resetWithControl(BlockPPC64LE, cc)
 15775  			return true
 15776  		}
 15777  		// match: (If (GreaterThan cc) yes no)
 15778  		// result: (GT cc yes no)
 15779  		for b.Controls[0].Op == OpPPC64GreaterThan {
 15780  			v_0 := b.Controls[0]
 15781  			cc := v_0.Args[0]
 15782  			b.resetWithControl(BlockPPC64GT, cc)
 15783  			return true
 15784  		}
 15785  		// match: (If (GreaterEqual cc) yes no)
 15786  		// result: (GE cc yes no)
 15787  		for b.Controls[0].Op == OpPPC64GreaterEqual {
 15788  			v_0 := b.Controls[0]
 15789  			cc := v_0.Args[0]
 15790  			b.resetWithControl(BlockPPC64GE, cc)
 15791  			return true
 15792  		}
 15793  		// match: (If (FLessThan cc) yes no)
 15794  		// result: (FLT cc yes no)
 15795  		for b.Controls[0].Op == OpPPC64FLessThan {
 15796  			v_0 := b.Controls[0]
 15797  			cc := v_0.Args[0]
 15798  			b.resetWithControl(BlockPPC64FLT, cc)
 15799  			return true
 15800  		}
 15801  		// match: (If (FLessEqual cc) yes no)
 15802  		// result: (FLE cc yes no)
 15803  		for b.Controls[0].Op == OpPPC64FLessEqual {
 15804  			v_0 := b.Controls[0]
 15805  			cc := v_0.Args[0]
 15806  			b.resetWithControl(BlockPPC64FLE, cc)
 15807  			return true
 15808  		}
 15809  		// match: (If (FGreaterThan cc) yes no)
 15810  		// result: (FGT cc yes no)
 15811  		for b.Controls[0].Op == OpPPC64FGreaterThan {
 15812  			v_0 := b.Controls[0]
 15813  			cc := v_0.Args[0]
 15814  			b.resetWithControl(BlockPPC64FGT, cc)
 15815  			return true
 15816  		}
 15817  		// match: (If (FGreaterEqual cc) yes no)
 15818  		// result: (FGE cc yes no)
 15819  		for b.Controls[0].Op == OpPPC64FGreaterEqual {
 15820  			v_0 := b.Controls[0]
 15821  			cc := v_0.Args[0]
 15822  			b.resetWithControl(BlockPPC64FGE, cc)
 15823  			return true
 15824  		}
 15825  		// match: (If cond yes no)
 15826  		// result: (NE (CMPconst [0] (ANDconst [1] cond)) yes no)
 15827  		for {
 15828  			cond := b.Controls[0]
 15829  			v0 := b.NewValue0(cond.Pos, OpPPC64CMPconst, types.TypeFlags)
 15830  			v0.AuxInt = int64ToAuxInt(0)
 15831  			v1 := b.NewValue0(cond.Pos, OpPPC64ANDconst, typ.Int)
 15832  			v1.AuxInt = int64ToAuxInt(1)
 15833  			v1.AddArg(cond)
 15834  			v0.AddArg(v1)
 15835  			b.resetWithControl(BlockPPC64NE, v0)
 15836  			return true
 15837  		}
 15838  	case BlockPPC64LE:
 15839  		// match: (LE (FlagEQ) yes no)
 15840  		// result: (First yes no)
 15841  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15842  			b.Reset(BlockFirst)
 15843  			return true
 15844  		}
 15845  		// match: (LE (FlagLT) yes no)
 15846  		// result: (First yes no)
 15847  		for b.Controls[0].Op == OpPPC64FlagLT {
 15848  			b.Reset(BlockFirst)
 15849  			return true
 15850  		}
 15851  		// match: (LE (FlagGT) yes no)
 15852  		// result: (First no yes)
 15853  		for b.Controls[0].Op == OpPPC64FlagGT {
 15854  			b.Reset(BlockFirst)
 15855  			b.swapSuccessors()
 15856  			return true
 15857  		}
 15858  		// match: (LE (InvertFlags cmp) yes no)
 15859  		// result: (GE cmp yes no)
 15860  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15861  			v_0 := b.Controls[0]
 15862  			cmp := v_0.Args[0]
 15863  			b.resetWithControl(BlockPPC64GE, cmp)
 15864  			return true
 15865  		}
 15866  		// match: (LE (CMPconst [0] z:(AND x y)) yes no)
 15867  		// cond: z.Uses == 1
 15868  		// result: (LE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15869  		for b.Controls[0].Op == OpPPC64CMPconst {
 15870  			v_0 := b.Controls[0]
 15871  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15872  				break
 15873  			}
 15874  			z := v_0.Args[0]
 15875  			if z.Op != OpPPC64AND {
 15876  				break
 15877  			}
 15878  			_ = z.Args[1]
 15879  			z_0 := z.Args[0]
 15880  			z_1 := z.Args[1]
 15881  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15882  				x := z_0
 15883  				y := z_1
 15884  				if !(z.Uses == 1) {
 15885  					continue
 15886  				}
 15887  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15888  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15889  				v1.AddArg2(x, y)
 15890  				v0.AddArg(v1)
 15891  				b.resetWithControl(BlockPPC64LE, v0)
 15892  				return true
 15893  			}
 15894  			break
 15895  		}
 15896  		// match: (LE (CMPconst [0] z:(OR x y)) yes no)
 15897  		// cond: z.Uses == 1
 15898  		// result: (LE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15899  		for b.Controls[0].Op == OpPPC64CMPconst {
 15900  			v_0 := b.Controls[0]
 15901  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15902  				break
 15903  			}
 15904  			z := v_0.Args[0]
 15905  			if z.Op != OpPPC64OR {
 15906  				break
 15907  			}
 15908  			_ = z.Args[1]
 15909  			z_0 := z.Args[0]
 15910  			z_1 := z.Args[1]
 15911  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15912  				x := z_0
 15913  				y := z_1
 15914  				if !(z.Uses == 1) {
 15915  					continue
 15916  				}
 15917  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15918  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15919  				v1.AddArg2(x, y)
 15920  				v0.AddArg(v1)
 15921  				b.resetWithControl(BlockPPC64LE, v0)
 15922  				return true
 15923  			}
 15924  			break
 15925  		}
 15926  		// match: (LE (CMPconst [0] z:(XOR x y)) yes no)
 15927  		// cond: z.Uses == 1
 15928  		// result: (LE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15929  		for b.Controls[0].Op == OpPPC64CMPconst {
 15930  			v_0 := b.Controls[0]
 15931  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15932  				break
 15933  			}
 15934  			z := v_0.Args[0]
 15935  			if z.Op != OpPPC64XOR {
 15936  				break
 15937  			}
 15938  			_ = z.Args[1]
 15939  			z_0 := z.Args[0]
 15940  			z_1 := z.Args[1]
 15941  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15942  				x := z_0
 15943  				y := z_1
 15944  				if !(z.Uses == 1) {
 15945  					continue
 15946  				}
 15947  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15948  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15949  				v1.AddArg2(x, y)
 15950  				v0.AddArg(v1)
 15951  				b.resetWithControl(BlockPPC64LE, v0)
 15952  				return true
 15953  			}
 15954  			break
 15955  		}
 15956  	case BlockPPC64LT:
 15957  		// match: (LT (FlagEQ) yes no)
 15958  		// result: (First no yes)
 15959  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15960  			b.Reset(BlockFirst)
 15961  			b.swapSuccessors()
 15962  			return true
 15963  		}
 15964  		// match: (LT (FlagLT) yes no)
 15965  		// result: (First yes no)
 15966  		for b.Controls[0].Op == OpPPC64FlagLT {
 15967  			b.Reset(BlockFirst)
 15968  			return true
 15969  		}
 15970  		// match: (LT (FlagGT) yes no)
 15971  		// result: (First no yes)
 15972  		for b.Controls[0].Op == OpPPC64FlagGT {
 15973  			b.Reset(BlockFirst)
 15974  			b.swapSuccessors()
 15975  			return true
 15976  		}
 15977  		// match: (LT (InvertFlags cmp) yes no)
 15978  		// result: (GT cmp yes no)
 15979  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15980  			v_0 := b.Controls[0]
 15981  			cmp := v_0.Args[0]
 15982  			b.resetWithControl(BlockPPC64GT, cmp)
 15983  			return true
 15984  		}
 15985  		// match: (LT (CMPconst [0] z:(AND x y)) yes no)
 15986  		// cond: z.Uses == 1
 15987  		// result: (LT (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15988  		for b.Controls[0].Op == OpPPC64CMPconst {
 15989  			v_0 := b.Controls[0]
 15990  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15991  				break
 15992  			}
 15993  			z := v_0.Args[0]
 15994  			if z.Op != OpPPC64AND {
 15995  				break
 15996  			}
 15997  			_ = z.Args[1]
 15998  			z_0 := z.Args[0]
 15999  			z_1 := z.Args[1]
 16000  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16001  				x := z_0
 16002  				y := z_1
 16003  				if !(z.Uses == 1) {
 16004  					continue
 16005  				}
 16006  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16007  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16008  				v1.AddArg2(x, y)
 16009  				v0.AddArg(v1)
 16010  				b.resetWithControl(BlockPPC64LT, v0)
 16011  				return true
 16012  			}
 16013  			break
 16014  		}
 16015  		// match: (LT (CMPconst [0] z:(OR x y)) yes no)
 16016  		// cond: z.Uses == 1
 16017  		// result: (LT (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16018  		for b.Controls[0].Op == OpPPC64CMPconst {
 16019  			v_0 := b.Controls[0]
 16020  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16021  				break
 16022  			}
 16023  			z := v_0.Args[0]
 16024  			if z.Op != OpPPC64OR {
 16025  				break
 16026  			}
 16027  			_ = z.Args[1]
 16028  			z_0 := z.Args[0]
 16029  			z_1 := z.Args[1]
 16030  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16031  				x := z_0
 16032  				y := z_1
 16033  				if !(z.Uses == 1) {
 16034  					continue
 16035  				}
 16036  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16037  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16038  				v1.AddArg2(x, y)
 16039  				v0.AddArg(v1)
 16040  				b.resetWithControl(BlockPPC64LT, v0)
 16041  				return true
 16042  			}
 16043  			break
 16044  		}
 16045  		// match: (LT (CMPconst [0] z:(XOR x y)) yes no)
 16046  		// cond: z.Uses == 1
 16047  		// result: (LT (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16048  		for b.Controls[0].Op == OpPPC64CMPconst {
 16049  			v_0 := b.Controls[0]
 16050  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16051  				break
 16052  			}
 16053  			z := v_0.Args[0]
 16054  			if z.Op != OpPPC64XOR {
 16055  				break
 16056  			}
 16057  			_ = z.Args[1]
 16058  			z_0 := z.Args[0]
 16059  			z_1 := z.Args[1]
 16060  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16061  				x := z_0
 16062  				y := z_1
 16063  				if !(z.Uses == 1) {
 16064  					continue
 16065  				}
 16066  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16067  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16068  				v1.AddArg2(x, y)
 16069  				v0.AddArg(v1)
 16070  				b.resetWithControl(BlockPPC64LT, v0)
 16071  				return true
 16072  			}
 16073  			break
 16074  		}
 16075  	case BlockPPC64NE:
 16076  		// match: (NE (CMPconst [0] (ANDconst [1] (Equal cc))) yes no)
 16077  		// result: (EQ cc yes no)
 16078  		for b.Controls[0].Op == OpPPC64CMPconst {
 16079  			v_0 := b.Controls[0]
 16080  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16081  				break
 16082  			}
 16083  			v_0_0 := v_0.Args[0]
 16084  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16085  				break
 16086  			}
 16087  			v_0_0_0 := v_0_0.Args[0]
 16088  			if v_0_0_0.Op != OpPPC64Equal {
 16089  				break
 16090  			}
 16091  			cc := v_0_0_0.Args[0]
 16092  			b.resetWithControl(BlockPPC64EQ, cc)
 16093  			return true
 16094  		}
 16095  		// match: (NE (CMPconst [0] (ANDconst [1] (NotEqual cc))) yes no)
 16096  		// result: (NE cc yes no)
 16097  		for b.Controls[0].Op == OpPPC64CMPconst {
 16098  			v_0 := b.Controls[0]
 16099  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16100  				break
 16101  			}
 16102  			v_0_0 := v_0.Args[0]
 16103  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16104  				break
 16105  			}
 16106  			v_0_0_0 := v_0_0.Args[0]
 16107  			if v_0_0_0.Op != OpPPC64NotEqual {
 16108  				break
 16109  			}
 16110  			cc := v_0_0_0.Args[0]
 16111  			b.resetWithControl(BlockPPC64NE, cc)
 16112  			return true
 16113  		}
 16114  		// match: (NE (CMPconst [0] (ANDconst [1] (LessThan cc))) yes no)
 16115  		// result: (LT cc yes no)
 16116  		for b.Controls[0].Op == OpPPC64CMPconst {
 16117  			v_0 := b.Controls[0]
 16118  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16119  				break
 16120  			}
 16121  			v_0_0 := v_0.Args[0]
 16122  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16123  				break
 16124  			}
 16125  			v_0_0_0 := v_0_0.Args[0]
 16126  			if v_0_0_0.Op != OpPPC64LessThan {
 16127  				break
 16128  			}
 16129  			cc := v_0_0_0.Args[0]
 16130  			b.resetWithControl(BlockPPC64LT, cc)
 16131  			return true
 16132  		}
 16133  		// match: (NE (CMPconst [0] (ANDconst [1] (LessEqual cc))) yes no)
 16134  		// result: (LE cc yes no)
 16135  		for b.Controls[0].Op == OpPPC64CMPconst {
 16136  			v_0 := b.Controls[0]
 16137  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16138  				break
 16139  			}
 16140  			v_0_0 := v_0.Args[0]
 16141  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16142  				break
 16143  			}
 16144  			v_0_0_0 := v_0_0.Args[0]
 16145  			if v_0_0_0.Op != OpPPC64LessEqual {
 16146  				break
 16147  			}
 16148  			cc := v_0_0_0.Args[0]
 16149  			b.resetWithControl(BlockPPC64LE, cc)
 16150  			return true
 16151  		}
 16152  		// match: (NE (CMPconst [0] (ANDconst [1] (GreaterThan cc))) yes no)
 16153  		// result: (GT cc yes no)
 16154  		for b.Controls[0].Op == OpPPC64CMPconst {
 16155  			v_0 := b.Controls[0]
 16156  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16157  				break
 16158  			}
 16159  			v_0_0 := v_0.Args[0]
 16160  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16161  				break
 16162  			}
 16163  			v_0_0_0 := v_0_0.Args[0]
 16164  			if v_0_0_0.Op != OpPPC64GreaterThan {
 16165  				break
 16166  			}
 16167  			cc := v_0_0_0.Args[0]
 16168  			b.resetWithControl(BlockPPC64GT, cc)
 16169  			return true
 16170  		}
 16171  		// match: (NE (CMPconst [0] (ANDconst [1] (GreaterEqual cc))) yes no)
 16172  		// result: (GE cc yes no)
 16173  		for b.Controls[0].Op == OpPPC64CMPconst {
 16174  			v_0 := b.Controls[0]
 16175  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16176  				break
 16177  			}
 16178  			v_0_0 := v_0.Args[0]
 16179  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16180  				break
 16181  			}
 16182  			v_0_0_0 := v_0_0.Args[0]
 16183  			if v_0_0_0.Op != OpPPC64GreaterEqual {
 16184  				break
 16185  			}
 16186  			cc := v_0_0_0.Args[0]
 16187  			b.resetWithControl(BlockPPC64GE, cc)
 16188  			return true
 16189  		}
 16190  		// match: (NE (CMPconst [0] (ANDconst [1] (FLessThan cc))) yes no)
 16191  		// result: (FLT cc yes no)
 16192  		for b.Controls[0].Op == OpPPC64CMPconst {
 16193  			v_0 := b.Controls[0]
 16194  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16195  				break
 16196  			}
 16197  			v_0_0 := v_0.Args[0]
 16198  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16199  				break
 16200  			}
 16201  			v_0_0_0 := v_0_0.Args[0]
 16202  			if v_0_0_0.Op != OpPPC64FLessThan {
 16203  				break
 16204  			}
 16205  			cc := v_0_0_0.Args[0]
 16206  			b.resetWithControl(BlockPPC64FLT, cc)
 16207  			return true
 16208  		}
 16209  		// match: (NE (CMPconst [0] (ANDconst [1] (FLessEqual cc))) yes no)
 16210  		// result: (FLE cc yes no)
 16211  		for b.Controls[0].Op == OpPPC64CMPconst {
 16212  			v_0 := b.Controls[0]
 16213  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16214  				break
 16215  			}
 16216  			v_0_0 := v_0.Args[0]
 16217  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16218  				break
 16219  			}
 16220  			v_0_0_0 := v_0_0.Args[0]
 16221  			if v_0_0_0.Op != OpPPC64FLessEqual {
 16222  				break
 16223  			}
 16224  			cc := v_0_0_0.Args[0]
 16225  			b.resetWithControl(BlockPPC64FLE, cc)
 16226  			return true
 16227  		}
 16228  		// match: (NE (CMPconst [0] (ANDconst [1] (FGreaterThan cc))) yes no)
 16229  		// result: (FGT cc yes no)
 16230  		for b.Controls[0].Op == OpPPC64CMPconst {
 16231  			v_0 := b.Controls[0]
 16232  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16233  				break
 16234  			}
 16235  			v_0_0 := v_0.Args[0]
 16236  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16237  				break
 16238  			}
 16239  			v_0_0_0 := v_0_0.Args[0]
 16240  			if v_0_0_0.Op != OpPPC64FGreaterThan {
 16241  				break
 16242  			}
 16243  			cc := v_0_0_0.Args[0]
 16244  			b.resetWithControl(BlockPPC64FGT, cc)
 16245  			return true
 16246  		}
 16247  		// match: (NE (CMPconst [0] (ANDconst [1] (FGreaterEqual cc))) yes no)
 16248  		// result: (FGE cc yes no)
 16249  		for b.Controls[0].Op == OpPPC64CMPconst {
 16250  			v_0 := b.Controls[0]
 16251  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16252  				break
 16253  			}
 16254  			v_0_0 := v_0.Args[0]
 16255  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16256  				break
 16257  			}
 16258  			v_0_0_0 := v_0_0.Args[0]
 16259  			if v_0_0_0.Op != OpPPC64FGreaterEqual {
 16260  				break
 16261  			}
 16262  			cc := v_0_0_0.Args[0]
 16263  			b.resetWithControl(BlockPPC64FGE, cc)
 16264  			return true
 16265  		}
 16266  		// match: (NE (FlagEQ) yes no)
 16267  		// result: (First no yes)
 16268  		for b.Controls[0].Op == OpPPC64FlagEQ {
 16269  			b.Reset(BlockFirst)
 16270  			b.swapSuccessors()
 16271  			return true
 16272  		}
 16273  		// match: (NE (FlagLT) yes no)
 16274  		// result: (First yes no)
 16275  		for b.Controls[0].Op == OpPPC64FlagLT {
 16276  			b.Reset(BlockFirst)
 16277  			return true
 16278  		}
 16279  		// match: (NE (FlagGT) yes no)
 16280  		// result: (First yes no)
 16281  		for b.Controls[0].Op == OpPPC64FlagGT {
 16282  			b.Reset(BlockFirst)
 16283  			return true
 16284  		}
 16285  		// match: (NE (InvertFlags cmp) yes no)
 16286  		// result: (NE cmp yes no)
 16287  		for b.Controls[0].Op == OpPPC64InvertFlags {
 16288  			v_0 := b.Controls[0]
 16289  			cmp := v_0.Args[0]
 16290  			b.resetWithControl(BlockPPC64NE, cmp)
 16291  			return true
 16292  		}
 16293  		// match: (NE (CMPconst [0] z:(AND x y)) yes no)
 16294  		// cond: z.Uses == 1
 16295  		// result: (NE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 16296  		for b.Controls[0].Op == OpPPC64CMPconst {
 16297  			v_0 := b.Controls[0]
 16298  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16299  				break
 16300  			}
 16301  			z := v_0.Args[0]
 16302  			if z.Op != OpPPC64AND {
 16303  				break
 16304  			}
 16305  			_ = z.Args[1]
 16306  			z_0 := z.Args[0]
 16307  			z_1 := z.Args[1]
 16308  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16309  				x := z_0
 16310  				y := z_1
 16311  				if !(z.Uses == 1) {
 16312  					continue
 16313  				}
 16314  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16315  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16316  				v1.AddArg2(x, y)
 16317  				v0.AddArg(v1)
 16318  				b.resetWithControl(BlockPPC64NE, v0)
 16319  				return true
 16320  			}
 16321  			break
 16322  		}
 16323  		// match: (NE (CMPconst [0] z:(OR x y)) yes no)
 16324  		// cond: z.Uses == 1
 16325  		// result: (NE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16326  		for b.Controls[0].Op == OpPPC64CMPconst {
 16327  			v_0 := b.Controls[0]
 16328  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16329  				break
 16330  			}
 16331  			z := v_0.Args[0]
 16332  			if z.Op != OpPPC64OR {
 16333  				break
 16334  			}
 16335  			_ = z.Args[1]
 16336  			z_0 := z.Args[0]
 16337  			z_1 := z.Args[1]
 16338  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16339  				x := z_0
 16340  				y := z_1
 16341  				if !(z.Uses == 1) {
 16342  					continue
 16343  				}
 16344  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16345  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16346  				v1.AddArg2(x, y)
 16347  				v0.AddArg(v1)
 16348  				b.resetWithControl(BlockPPC64NE, v0)
 16349  				return true
 16350  			}
 16351  			break
 16352  		}
 16353  		// match: (NE (CMPconst [0] z:(XOR x y)) yes no)
 16354  		// cond: z.Uses == 1
 16355  		// result: (NE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16356  		for b.Controls[0].Op == OpPPC64CMPconst {
 16357  			v_0 := b.Controls[0]
 16358  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16359  				break
 16360  			}
 16361  			z := v_0.Args[0]
 16362  			if z.Op != OpPPC64XOR {
 16363  				break
 16364  			}
 16365  			_ = z.Args[1]
 16366  			z_0 := z.Args[0]
 16367  			z_1 := z.Args[1]
 16368  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16369  				x := z_0
 16370  				y := z_1
 16371  				if !(z.Uses == 1) {
 16372  					continue
 16373  				}
 16374  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16375  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16376  				v1.AddArg2(x, y)
 16377  				v0.AddArg(v1)
 16378  				b.resetWithControl(BlockPPC64NE, v0)
 16379  				return true
 16380  			}
 16381  			break
 16382  		}
 16383  	}
 16384  	return false
 16385  }
 16386  

View as plain text