Black Lives Matter. Support the Equal Justice Initiative.

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

Documentation: cmd/compile/internal/ssa

     1  // Code generated from gen/PPC64.rules; DO NOT EDIT.
     2  // generated with: cd gen; go run *.go
     3  
     4  package ssa
     5  
     6  import "math"
     7  import "cmd/internal/objabi"
     8  import "cmd/compile/internal/types"
     9  
    10  func rewriteValuePPC64(v *Value) bool {
    11  	switch v.Op {
    12  	case OpAbs:
    13  		v.Op = OpPPC64FABS
    14  		return true
    15  	case OpAdd16:
    16  		v.Op = OpPPC64ADD
    17  		return true
    18  	case OpAdd32:
    19  		v.Op = OpPPC64ADD
    20  		return true
    21  	case OpAdd32F:
    22  		v.Op = OpPPC64FADDS
    23  		return true
    24  	case OpAdd64:
    25  		v.Op = OpPPC64ADD
    26  		return true
    27  	case OpAdd64F:
    28  		v.Op = OpPPC64FADD
    29  		return true
    30  	case OpAdd64carry:
    31  		v.Op = OpPPC64LoweredAdd64Carry
    32  		return true
    33  	case OpAdd8:
    34  		v.Op = OpPPC64ADD
    35  		return true
    36  	case OpAddPtr:
    37  		v.Op = OpPPC64ADD
    38  		return true
    39  	case OpAddr:
    40  		return rewriteValuePPC64_OpAddr(v)
    41  	case OpAnd16:
    42  		v.Op = OpPPC64AND
    43  		return true
    44  	case OpAnd32:
    45  		v.Op = OpPPC64AND
    46  		return true
    47  	case OpAnd64:
    48  		v.Op = OpPPC64AND
    49  		return true
    50  	case OpAnd8:
    51  		v.Op = OpPPC64AND
    52  		return true
    53  	case OpAndB:
    54  		v.Op = OpPPC64AND
    55  		return true
    56  	case OpAtomicAdd32:
    57  		v.Op = OpPPC64LoweredAtomicAdd32
    58  		return true
    59  	case OpAtomicAdd64:
    60  		v.Op = OpPPC64LoweredAtomicAdd64
    61  		return true
    62  	case OpAtomicAnd32:
    63  		v.Op = OpPPC64LoweredAtomicAnd32
    64  		return true
    65  	case OpAtomicAnd8:
    66  		v.Op = OpPPC64LoweredAtomicAnd8
    67  		return true
    68  	case OpAtomicCompareAndSwap32:
    69  		return rewriteValuePPC64_OpAtomicCompareAndSwap32(v)
    70  	case OpAtomicCompareAndSwap64:
    71  		return rewriteValuePPC64_OpAtomicCompareAndSwap64(v)
    72  	case OpAtomicCompareAndSwapRel32:
    73  		return rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v)
    74  	case OpAtomicExchange32:
    75  		v.Op = OpPPC64LoweredAtomicExchange32
    76  		return true
    77  	case OpAtomicExchange64:
    78  		v.Op = OpPPC64LoweredAtomicExchange64
    79  		return true
    80  	case OpAtomicLoad32:
    81  		return rewriteValuePPC64_OpAtomicLoad32(v)
    82  	case OpAtomicLoad64:
    83  		return rewriteValuePPC64_OpAtomicLoad64(v)
    84  	case OpAtomicLoad8:
    85  		return rewriteValuePPC64_OpAtomicLoad8(v)
    86  	case OpAtomicLoadAcq32:
    87  		return rewriteValuePPC64_OpAtomicLoadAcq32(v)
    88  	case OpAtomicLoadAcq64:
    89  		return rewriteValuePPC64_OpAtomicLoadAcq64(v)
    90  	case OpAtomicLoadPtr:
    91  		return rewriteValuePPC64_OpAtomicLoadPtr(v)
    92  	case OpAtomicOr32:
    93  		v.Op = OpPPC64LoweredAtomicOr32
    94  		return true
    95  	case OpAtomicOr8:
    96  		v.Op = OpPPC64LoweredAtomicOr8
    97  		return true
    98  	case OpAtomicStore32:
    99  		return rewriteValuePPC64_OpAtomicStore32(v)
   100  	case OpAtomicStore64:
   101  		return rewriteValuePPC64_OpAtomicStore64(v)
   102  	case OpAtomicStore8:
   103  		return rewriteValuePPC64_OpAtomicStore8(v)
   104  	case OpAtomicStoreRel32:
   105  		return rewriteValuePPC64_OpAtomicStoreRel32(v)
   106  	case OpAtomicStoreRel64:
   107  		return rewriteValuePPC64_OpAtomicStoreRel64(v)
   108  	case OpAvg64u:
   109  		return rewriteValuePPC64_OpAvg64u(v)
   110  	case OpBitLen32:
   111  		return rewriteValuePPC64_OpBitLen32(v)
   112  	case OpBitLen64:
   113  		return rewriteValuePPC64_OpBitLen64(v)
   114  	case OpCeil:
   115  		v.Op = OpPPC64FCEIL
   116  		return true
   117  	case OpClosureCall:
   118  		v.Op = OpPPC64CALLclosure
   119  		return true
   120  	case OpCom16:
   121  		return rewriteValuePPC64_OpCom16(v)
   122  	case OpCom32:
   123  		return rewriteValuePPC64_OpCom32(v)
   124  	case OpCom64:
   125  		return rewriteValuePPC64_OpCom64(v)
   126  	case OpCom8:
   127  		return rewriteValuePPC64_OpCom8(v)
   128  	case OpCondSelect:
   129  		return rewriteValuePPC64_OpCondSelect(v)
   130  	case OpConst16:
   131  		return rewriteValuePPC64_OpConst16(v)
   132  	case OpConst32:
   133  		return rewriteValuePPC64_OpConst32(v)
   134  	case OpConst32F:
   135  		v.Op = OpPPC64FMOVSconst
   136  		return true
   137  	case OpConst64:
   138  		return rewriteValuePPC64_OpConst64(v)
   139  	case OpConst64F:
   140  		v.Op = OpPPC64FMOVDconst
   141  		return true
   142  	case OpConst8:
   143  		return rewriteValuePPC64_OpConst8(v)
   144  	case OpConstBool:
   145  		return rewriteValuePPC64_OpConstBool(v)
   146  	case OpConstNil:
   147  		return rewriteValuePPC64_OpConstNil(v)
   148  	case OpCopysign:
   149  		return rewriteValuePPC64_OpCopysign(v)
   150  	case OpCtz16:
   151  		return rewriteValuePPC64_OpCtz16(v)
   152  	case OpCtz32:
   153  		return rewriteValuePPC64_OpCtz32(v)
   154  	case OpCtz32NonZero:
   155  		v.Op = OpCtz32
   156  		return true
   157  	case OpCtz64:
   158  		return rewriteValuePPC64_OpCtz64(v)
   159  	case OpCtz64NonZero:
   160  		v.Op = OpCtz64
   161  		return true
   162  	case OpCtz8:
   163  		return rewriteValuePPC64_OpCtz8(v)
   164  	case OpCvt32Fto32:
   165  		return rewriteValuePPC64_OpCvt32Fto32(v)
   166  	case OpCvt32Fto64:
   167  		return rewriteValuePPC64_OpCvt32Fto64(v)
   168  	case OpCvt32Fto64F:
   169  		v.Op = OpCopy
   170  		return true
   171  	case OpCvt32to32F:
   172  		return rewriteValuePPC64_OpCvt32to32F(v)
   173  	case OpCvt32to64F:
   174  		return rewriteValuePPC64_OpCvt32to64F(v)
   175  	case OpCvt64Fto32:
   176  		return rewriteValuePPC64_OpCvt64Fto32(v)
   177  	case OpCvt64Fto32F:
   178  		v.Op = OpPPC64FRSP
   179  		return true
   180  	case OpCvt64Fto64:
   181  		return rewriteValuePPC64_OpCvt64Fto64(v)
   182  	case OpCvt64to32F:
   183  		return rewriteValuePPC64_OpCvt64to32F(v)
   184  	case OpCvt64to64F:
   185  		return rewriteValuePPC64_OpCvt64to64F(v)
   186  	case OpCvtBoolToUint8:
   187  		v.Op = OpCopy
   188  		return true
   189  	case OpDiv16:
   190  		return rewriteValuePPC64_OpDiv16(v)
   191  	case OpDiv16u:
   192  		return rewriteValuePPC64_OpDiv16u(v)
   193  	case OpDiv32:
   194  		return rewriteValuePPC64_OpDiv32(v)
   195  	case OpDiv32F:
   196  		v.Op = OpPPC64FDIVS
   197  		return true
   198  	case OpDiv32u:
   199  		v.Op = OpPPC64DIVWU
   200  		return true
   201  	case OpDiv64:
   202  		return rewriteValuePPC64_OpDiv64(v)
   203  	case OpDiv64F:
   204  		v.Op = OpPPC64FDIV
   205  		return true
   206  	case OpDiv64u:
   207  		v.Op = OpPPC64DIVDU
   208  		return true
   209  	case OpDiv8:
   210  		return rewriteValuePPC64_OpDiv8(v)
   211  	case OpDiv8u:
   212  		return rewriteValuePPC64_OpDiv8u(v)
   213  	case OpEq16:
   214  		return rewriteValuePPC64_OpEq16(v)
   215  	case OpEq32:
   216  		return rewriteValuePPC64_OpEq32(v)
   217  	case OpEq32F:
   218  		return rewriteValuePPC64_OpEq32F(v)
   219  	case OpEq64:
   220  		return rewriteValuePPC64_OpEq64(v)
   221  	case OpEq64F:
   222  		return rewriteValuePPC64_OpEq64F(v)
   223  	case OpEq8:
   224  		return rewriteValuePPC64_OpEq8(v)
   225  	case OpEqB:
   226  		return rewriteValuePPC64_OpEqB(v)
   227  	case OpEqPtr:
   228  		return rewriteValuePPC64_OpEqPtr(v)
   229  	case OpFMA:
   230  		v.Op = OpPPC64FMADD
   231  		return true
   232  	case OpFloor:
   233  		v.Op = OpPPC64FFLOOR
   234  		return true
   235  	case OpGetCallerPC:
   236  		v.Op = OpPPC64LoweredGetCallerPC
   237  		return true
   238  	case OpGetCallerSP:
   239  		v.Op = OpPPC64LoweredGetCallerSP
   240  		return true
   241  	case OpGetClosurePtr:
   242  		v.Op = OpPPC64LoweredGetClosurePtr
   243  		return true
   244  	case OpHmul32:
   245  		v.Op = OpPPC64MULHW
   246  		return true
   247  	case OpHmul32u:
   248  		v.Op = OpPPC64MULHWU
   249  		return true
   250  	case OpHmul64:
   251  		v.Op = OpPPC64MULHD
   252  		return true
   253  	case OpHmul64u:
   254  		v.Op = OpPPC64MULHDU
   255  		return true
   256  	case OpInterCall:
   257  		v.Op = OpPPC64CALLinter
   258  		return true
   259  	case OpIsInBounds:
   260  		return rewriteValuePPC64_OpIsInBounds(v)
   261  	case OpIsNonNil:
   262  		return rewriteValuePPC64_OpIsNonNil(v)
   263  	case OpIsSliceInBounds:
   264  		return rewriteValuePPC64_OpIsSliceInBounds(v)
   265  	case OpLeq16:
   266  		return rewriteValuePPC64_OpLeq16(v)
   267  	case OpLeq16U:
   268  		return rewriteValuePPC64_OpLeq16U(v)
   269  	case OpLeq32:
   270  		return rewriteValuePPC64_OpLeq32(v)
   271  	case OpLeq32F:
   272  		return rewriteValuePPC64_OpLeq32F(v)
   273  	case OpLeq32U:
   274  		return rewriteValuePPC64_OpLeq32U(v)
   275  	case OpLeq64:
   276  		return rewriteValuePPC64_OpLeq64(v)
   277  	case OpLeq64F:
   278  		return rewriteValuePPC64_OpLeq64F(v)
   279  	case OpLeq64U:
   280  		return rewriteValuePPC64_OpLeq64U(v)
   281  	case OpLeq8:
   282  		return rewriteValuePPC64_OpLeq8(v)
   283  	case OpLeq8U:
   284  		return rewriteValuePPC64_OpLeq8U(v)
   285  	case OpLess16:
   286  		return rewriteValuePPC64_OpLess16(v)
   287  	case OpLess16U:
   288  		return rewriteValuePPC64_OpLess16U(v)
   289  	case OpLess32:
   290  		return rewriteValuePPC64_OpLess32(v)
   291  	case OpLess32F:
   292  		return rewriteValuePPC64_OpLess32F(v)
   293  	case OpLess32U:
   294  		return rewriteValuePPC64_OpLess32U(v)
   295  	case OpLess64:
   296  		return rewriteValuePPC64_OpLess64(v)
   297  	case OpLess64F:
   298  		return rewriteValuePPC64_OpLess64F(v)
   299  	case OpLess64U:
   300  		return rewriteValuePPC64_OpLess64U(v)
   301  	case OpLess8:
   302  		return rewriteValuePPC64_OpLess8(v)
   303  	case OpLess8U:
   304  		return rewriteValuePPC64_OpLess8U(v)
   305  	case OpLoad:
   306  		return rewriteValuePPC64_OpLoad(v)
   307  	case OpLocalAddr:
   308  		return rewriteValuePPC64_OpLocalAddr(v)
   309  	case OpLsh16x16:
   310  		return rewriteValuePPC64_OpLsh16x16(v)
   311  	case OpLsh16x32:
   312  		return rewriteValuePPC64_OpLsh16x32(v)
   313  	case OpLsh16x64:
   314  		return rewriteValuePPC64_OpLsh16x64(v)
   315  	case OpLsh16x8:
   316  		return rewriteValuePPC64_OpLsh16x8(v)
   317  	case OpLsh32x16:
   318  		return rewriteValuePPC64_OpLsh32x16(v)
   319  	case OpLsh32x32:
   320  		return rewriteValuePPC64_OpLsh32x32(v)
   321  	case OpLsh32x64:
   322  		return rewriteValuePPC64_OpLsh32x64(v)
   323  	case OpLsh32x8:
   324  		return rewriteValuePPC64_OpLsh32x8(v)
   325  	case OpLsh64x16:
   326  		return rewriteValuePPC64_OpLsh64x16(v)
   327  	case OpLsh64x32:
   328  		return rewriteValuePPC64_OpLsh64x32(v)
   329  	case OpLsh64x64:
   330  		return rewriteValuePPC64_OpLsh64x64(v)
   331  	case OpLsh64x8:
   332  		return rewriteValuePPC64_OpLsh64x8(v)
   333  	case OpLsh8x16:
   334  		return rewriteValuePPC64_OpLsh8x16(v)
   335  	case OpLsh8x32:
   336  		return rewriteValuePPC64_OpLsh8x32(v)
   337  	case OpLsh8x64:
   338  		return rewriteValuePPC64_OpLsh8x64(v)
   339  	case OpLsh8x8:
   340  		return rewriteValuePPC64_OpLsh8x8(v)
   341  	case OpMod16:
   342  		return rewriteValuePPC64_OpMod16(v)
   343  	case OpMod16u:
   344  		return rewriteValuePPC64_OpMod16u(v)
   345  	case OpMod32:
   346  		return rewriteValuePPC64_OpMod32(v)
   347  	case OpMod32u:
   348  		return rewriteValuePPC64_OpMod32u(v)
   349  	case OpMod64:
   350  		return rewriteValuePPC64_OpMod64(v)
   351  	case OpMod64u:
   352  		return rewriteValuePPC64_OpMod64u(v)
   353  	case OpMod8:
   354  		return rewriteValuePPC64_OpMod8(v)
   355  	case OpMod8u:
   356  		return rewriteValuePPC64_OpMod8u(v)
   357  	case OpMove:
   358  		return rewriteValuePPC64_OpMove(v)
   359  	case OpMul16:
   360  		v.Op = OpPPC64MULLW
   361  		return true
   362  	case OpMul32:
   363  		v.Op = OpPPC64MULLW
   364  		return true
   365  	case OpMul32F:
   366  		v.Op = OpPPC64FMULS
   367  		return true
   368  	case OpMul64:
   369  		v.Op = OpPPC64MULLD
   370  		return true
   371  	case OpMul64F:
   372  		v.Op = OpPPC64FMUL
   373  		return true
   374  	case OpMul64uhilo:
   375  		v.Op = OpPPC64LoweredMuluhilo
   376  		return true
   377  	case OpMul8:
   378  		v.Op = OpPPC64MULLW
   379  		return true
   380  	case OpNeg16:
   381  		v.Op = OpPPC64NEG
   382  		return true
   383  	case OpNeg32:
   384  		v.Op = OpPPC64NEG
   385  		return true
   386  	case OpNeg32F:
   387  		v.Op = OpPPC64FNEG
   388  		return true
   389  	case OpNeg64:
   390  		v.Op = OpPPC64NEG
   391  		return true
   392  	case OpNeg64F:
   393  		v.Op = OpPPC64FNEG
   394  		return true
   395  	case OpNeg8:
   396  		v.Op = OpPPC64NEG
   397  		return true
   398  	case OpNeq16:
   399  		return rewriteValuePPC64_OpNeq16(v)
   400  	case OpNeq32:
   401  		return rewriteValuePPC64_OpNeq32(v)
   402  	case OpNeq32F:
   403  		return rewriteValuePPC64_OpNeq32F(v)
   404  	case OpNeq64:
   405  		return rewriteValuePPC64_OpNeq64(v)
   406  	case OpNeq64F:
   407  		return rewriteValuePPC64_OpNeq64F(v)
   408  	case OpNeq8:
   409  		return rewriteValuePPC64_OpNeq8(v)
   410  	case OpNeqB:
   411  		v.Op = OpPPC64XOR
   412  		return true
   413  	case OpNeqPtr:
   414  		return rewriteValuePPC64_OpNeqPtr(v)
   415  	case OpNilCheck:
   416  		v.Op = OpPPC64LoweredNilCheck
   417  		return true
   418  	case OpNot:
   419  		return rewriteValuePPC64_OpNot(v)
   420  	case OpOffPtr:
   421  		return rewriteValuePPC64_OpOffPtr(v)
   422  	case OpOr16:
   423  		v.Op = OpPPC64OR
   424  		return true
   425  	case OpOr32:
   426  		v.Op = OpPPC64OR
   427  		return true
   428  	case OpOr64:
   429  		v.Op = OpPPC64OR
   430  		return true
   431  	case OpOr8:
   432  		v.Op = OpPPC64OR
   433  		return true
   434  	case OpOrB:
   435  		v.Op = OpPPC64OR
   436  		return true
   437  	case OpPPC64ADD:
   438  		return rewriteValuePPC64_OpPPC64ADD(v)
   439  	case OpPPC64ADDconst:
   440  		return rewriteValuePPC64_OpPPC64ADDconst(v)
   441  	case OpPPC64AND:
   442  		return rewriteValuePPC64_OpPPC64AND(v)
   443  	case OpPPC64ANDN:
   444  		return rewriteValuePPC64_OpPPC64ANDN(v)
   445  	case OpPPC64ANDconst:
   446  		return rewriteValuePPC64_OpPPC64ANDconst(v)
   447  	case OpPPC64CLRLSLDI:
   448  		return rewriteValuePPC64_OpPPC64CLRLSLDI(v)
   449  	case OpPPC64CMP:
   450  		return rewriteValuePPC64_OpPPC64CMP(v)
   451  	case OpPPC64CMPU:
   452  		return rewriteValuePPC64_OpPPC64CMPU(v)
   453  	case OpPPC64CMPUconst:
   454  		return rewriteValuePPC64_OpPPC64CMPUconst(v)
   455  	case OpPPC64CMPW:
   456  		return rewriteValuePPC64_OpPPC64CMPW(v)
   457  	case OpPPC64CMPWU:
   458  		return rewriteValuePPC64_OpPPC64CMPWU(v)
   459  	case OpPPC64CMPWUconst:
   460  		return rewriteValuePPC64_OpPPC64CMPWUconst(v)
   461  	case OpPPC64CMPWconst:
   462  		return rewriteValuePPC64_OpPPC64CMPWconst(v)
   463  	case OpPPC64CMPconst:
   464  		return rewriteValuePPC64_OpPPC64CMPconst(v)
   465  	case OpPPC64Equal:
   466  		return rewriteValuePPC64_OpPPC64Equal(v)
   467  	case OpPPC64FABS:
   468  		return rewriteValuePPC64_OpPPC64FABS(v)
   469  	case OpPPC64FADD:
   470  		return rewriteValuePPC64_OpPPC64FADD(v)
   471  	case OpPPC64FADDS:
   472  		return rewriteValuePPC64_OpPPC64FADDS(v)
   473  	case OpPPC64FCEIL:
   474  		return rewriteValuePPC64_OpPPC64FCEIL(v)
   475  	case OpPPC64FFLOOR:
   476  		return rewriteValuePPC64_OpPPC64FFLOOR(v)
   477  	case OpPPC64FGreaterEqual:
   478  		return rewriteValuePPC64_OpPPC64FGreaterEqual(v)
   479  	case OpPPC64FGreaterThan:
   480  		return rewriteValuePPC64_OpPPC64FGreaterThan(v)
   481  	case OpPPC64FLessEqual:
   482  		return rewriteValuePPC64_OpPPC64FLessEqual(v)
   483  	case OpPPC64FLessThan:
   484  		return rewriteValuePPC64_OpPPC64FLessThan(v)
   485  	case OpPPC64FMOVDload:
   486  		return rewriteValuePPC64_OpPPC64FMOVDload(v)
   487  	case OpPPC64FMOVDstore:
   488  		return rewriteValuePPC64_OpPPC64FMOVDstore(v)
   489  	case OpPPC64FMOVSload:
   490  		return rewriteValuePPC64_OpPPC64FMOVSload(v)
   491  	case OpPPC64FMOVSstore:
   492  		return rewriteValuePPC64_OpPPC64FMOVSstore(v)
   493  	case OpPPC64FNEG:
   494  		return rewriteValuePPC64_OpPPC64FNEG(v)
   495  	case OpPPC64FSQRT:
   496  		return rewriteValuePPC64_OpPPC64FSQRT(v)
   497  	case OpPPC64FSUB:
   498  		return rewriteValuePPC64_OpPPC64FSUB(v)
   499  	case OpPPC64FSUBS:
   500  		return rewriteValuePPC64_OpPPC64FSUBS(v)
   501  	case OpPPC64FTRUNC:
   502  		return rewriteValuePPC64_OpPPC64FTRUNC(v)
   503  	case OpPPC64GreaterEqual:
   504  		return rewriteValuePPC64_OpPPC64GreaterEqual(v)
   505  	case OpPPC64GreaterThan:
   506  		return rewriteValuePPC64_OpPPC64GreaterThan(v)
   507  	case OpPPC64ISEL:
   508  		return rewriteValuePPC64_OpPPC64ISEL(v)
   509  	case OpPPC64ISELB:
   510  		return rewriteValuePPC64_OpPPC64ISELB(v)
   511  	case OpPPC64LessEqual:
   512  		return rewriteValuePPC64_OpPPC64LessEqual(v)
   513  	case OpPPC64LessThan:
   514  		return rewriteValuePPC64_OpPPC64LessThan(v)
   515  	case OpPPC64MFVSRD:
   516  		return rewriteValuePPC64_OpPPC64MFVSRD(v)
   517  	case OpPPC64MOVBZload:
   518  		return rewriteValuePPC64_OpPPC64MOVBZload(v)
   519  	case OpPPC64MOVBZloadidx:
   520  		return rewriteValuePPC64_OpPPC64MOVBZloadidx(v)
   521  	case OpPPC64MOVBZreg:
   522  		return rewriteValuePPC64_OpPPC64MOVBZreg(v)
   523  	case OpPPC64MOVBreg:
   524  		return rewriteValuePPC64_OpPPC64MOVBreg(v)
   525  	case OpPPC64MOVBstore:
   526  		return rewriteValuePPC64_OpPPC64MOVBstore(v)
   527  	case OpPPC64MOVBstoreidx:
   528  		return rewriteValuePPC64_OpPPC64MOVBstoreidx(v)
   529  	case OpPPC64MOVBstorezero:
   530  		return rewriteValuePPC64_OpPPC64MOVBstorezero(v)
   531  	case OpPPC64MOVDload:
   532  		return rewriteValuePPC64_OpPPC64MOVDload(v)
   533  	case OpPPC64MOVDloadidx:
   534  		return rewriteValuePPC64_OpPPC64MOVDloadidx(v)
   535  	case OpPPC64MOVDstore:
   536  		return rewriteValuePPC64_OpPPC64MOVDstore(v)
   537  	case OpPPC64MOVDstoreidx:
   538  		return rewriteValuePPC64_OpPPC64MOVDstoreidx(v)
   539  	case OpPPC64MOVDstorezero:
   540  		return rewriteValuePPC64_OpPPC64MOVDstorezero(v)
   541  	case OpPPC64MOVHBRstore:
   542  		return rewriteValuePPC64_OpPPC64MOVHBRstore(v)
   543  	case OpPPC64MOVHZload:
   544  		return rewriteValuePPC64_OpPPC64MOVHZload(v)
   545  	case OpPPC64MOVHZloadidx:
   546  		return rewriteValuePPC64_OpPPC64MOVHZloadidx(v)
   547  	case OpPPC64MOVHZreg:
   548  		return rewriteValuePPC64_OpPPC64MOVHZreg(v)
   549  	case OpPPC64MOVHload:
   550  		return rewriteValuePPC64_OpPPC64MOVHload(v)
   551  	case OpPPC64MOVHloadidx:
   552  		return rewriteValuePPC64_OpPPC64MOVHloadidx(v)
   553  	case OpPPC64MOVHreg:
   554  		return rewriteValuePPC64_OpPPC64MOVHreg(v)
   555  	case OpPPC64MOVHstore:
   556  		return rewriteValuePPC64_OpPPC64MOVHstore(v)
   557  	case OpPPC64MOVHstoreidx:
   558  		return rewriteValuePPC64_OpPPC64MOVHstoreidx(v)
   559  	case OpPPC64MOVHstorezero:
   560  		return rewriteValuePPC64_OpPPC64MOVHstorezero(v)
   561  	case OpPPC64MOVWBRstore:
   562  		return rewriteValuePPC64_OpPPC64MOVWBRstore(v)
   563  	case OpPPC64MOVWZload:
   564  		return rewriteValuePPC64_OpPPC64MOVWZload(v)
   565  	case OpPPC64MOVWZloadidx:
   566  		return rewriteValuePPC64_OpPPC64MOVWZloadidx(v)
   567  	case OpPPC64MOVWZreg:
   568  		return rewriteValuePPC64_OpPPC64MOVWZreg(v)
   569  	case OpPPC64MOVWload:
   570  		return rewriteValuePPC64_OpPPC64MOVWload(v)
   571  	case OpPPC64MOVWloadidx:
   572  		return rewriteValuePPC64_OpPPC64MOVWloadidx(v)
   573  	case OpPPC64MOVWreg:
   574  		return rewriteValuePPC64_OpPPC64MOVWreg(v)
   575  	case OpPPC64MOVWstore:
   576  		return rewriteValuePPC64_OpPPC64MOVWstore(v)
   577  	case OpPPC64MOVWstoreidx:
   578  		return rewriteValuePPC64_OpPPC64MOVWstoreidx(v)
   579  	case OpPPC64MOVWstorezero:
   580  		return rewriteValuePPC64_OpPPC64MOVWstorezero(v)
   581  	case OpPPC64MTVSRD:
   582  		return rewriteValuePPC64_OpPPC64MTVSRD(v)
   583  	case OpPPC64MULLD:
   584  		return rewriteValuePPC64_OpPPC64MULLD(v)
   585  	case OpPPC64MULLW:
   586  		return rewriteValuePPC64_OpPPC64MULLW(v)
   587  	case OpPPC64NEG:
   588  		return rewriteValuePPC64_OpPPC64NEG(v)
   589  	case OpPPC64NOR:
   590  		return rewriteValuePPC64_OpPPC64NOR(v)
   591  	case OpPPC64NotEqual:
   592  		return rewriteValuePPC64_OpPPC64NotEqual(v)
   593  	case OpPPC64OR:
   594  		return rewriteValuePPC64_OpPPC64OR(v)
   595  	case OpPPC64ORN:
   596  		return rewriteValuePPC64_OpPPC64ORN(v)
   597  	case OpPPC64ORconst:
   598  		return rewriteValuePPC64_OpPPC64ORconst(v)
   599  	case OpPPC64ROTL:
   600  		return rewriteValuePPC64_OpPPC64ROTL(v)
   601  	case OpPPC64ROTLW:
   602  		return rewriteValuePPC64_OpPPC64ROTLW(v)
   603  	case OpPPC64ROTLWconst:
   604  		return rewriteValuePPC64_OpPPC64ROTLWconst(v)
   605  	case OpPPC64SLD:
   606  		return rewriteValuePPC64_OpPPC64SLD(v)
   607  	case OpPPC64SLDconst:
   608  		return rewriteValuePPC64_OpPPC64SLDconst(v)
   609  	case OpPPC64SLW:
   610  		return rewriteValuePPC64_OpPPC64SLW(v)
   611  	case OpPPC64SLWconst:
   612  		return rewriteValuePPC64_OpPPC64SLWconst(v)
   613  	case OpPPC64SRAD:
   614  		return rewriteValuePPC64_OpPPC64SRAD(v)
   615  	case OpPPC64SRAW:
   616  		return rewriteValuePPC64_OpPPC64SRAW(v)
   617  	case OpPPC64SRD:
   618  		return rewriteValuePPC64_OpPPC64SRD(v)
   619  	case OpPPC64SRW:
   620  		return rewriteValuePPC64_OpPPC64SRW(v)
   621  	case OpPPC64SRWconst:
   622  		return rewriteValuePPC64_OpPPC64SRWconst(v)
   623  	case OpPPC64SUB:
   624  		return rewriteValuePPC64_OpPPC64SUB(v)
   625  	case OpPPC64SUBFCconst:
   626  		return rewriteValuePPC64_OpPPC64SUBFCconst(v)
   627  	case OpPPC64XOR:
   628  		return rewriteValuePPC64_OpPPC64XOR(v)
   629  	case OpPPC64XORconst:
   630  		return rewriteValuePPC64_OpPPC64XORconst(v)
   631  	case OpPanicBounds:
   632  		return rewriteValuePPC64_OpPanicBounds(v)
   633  	case OpPopCount16:
   634  		return rewriteValuePPC64_OpPopCount16(v)
   635  	case OpPopCount32:
   636  		return rewriteValuePPC64_OpPopCount32(v)
   637  	case OpPopCount64:
   638  		v.Op = OpPPC64POPCNTD
   639  		return true
   640  	case OpPopCount8:
   641  		return rewriteValuePPC64_OpPopCount8(v)
   642  	case OpRotateLeft16:
   643  		return rewriteValuePPC64_OpRotateLeft16(v)
   644  	case OpRotateLeft32:
   645  		return rewriteValuePPC64_OpRotateLeft32(v)
   646  	case OpRotateLeft64:
   647  		return rewriteValuePPC64_OpRotateLeft64(v)
   648  	case OpRotateLeft8:
   649  		return rewriteValuePPC64_OpRotateLeft8(v)
   650  	case OpRound:
   651  		v.Op = OpPPC64FROUND
   652  		return true
   653  	case OpRound32F:
   654  		v.Op = OpPPC64LoweredRound32F
   655  		return true
   656  	case OpRound64F:
   657  		v.Op = OpPPC64LoweredRound64F
   658  		return true
   659  	case OpRsh16Ux16:
   660  		return rewriteValuePPC64_OpRsh16Ux16(v)
   661  	case OpRsh16Ux32:
   662  		return rewriteValuePPC64_OpRsh16Ux32(v)
   663  	case OpRsh16Ux64:
   664  		return rewriteValuePPC64_OpRsh16Ux64(v)
   665  	case OpRsh16Ux8:
   666  		return rewriteValuePPC64_OpRsh16Ux8(v)
   667  	case OpRsh16x16:
   668  		return rewriteValuePPC64_OpRsh16x16(v)
   669  	case OpRsh16x32:
   670  		return rewriteValuePPC64_OpRsh16x32(v)
   671  	case OpRsh16x64:
   672  		return rewriteValuePPC64_OpRsh16x64(v)
   673  	case OpRsh16x8:
   674  		return rewriteValuePPC64_OpRsh16x8(v)
   675  	case OpRsh32Ux16:
   676  		return rewriteValuePPC64_OpRsh32Ux16(v)
   677  	case OpRsh32Ux32:
   678  		return rewriteValuePPC64_OpRsh32Ux32(v)
   679  	case OpRsh32Ux64:
   680  		return rewriteValuePPC64_OpRsh32Ux64(v)
   681  	case OpRsh32Ux8:
   682  		return rewriteValuePPC64_OpRsh32Ux8(v)
   683  	case OpRsh32x16:
   684  		return rewriteValuePPC64_OpRsh32x16(v)
   685  	case OpRsh32x32:
   686  		return rewriteValuePPC64_OpRsh32x32(v)
   687  	case OpRsh32x64:
   688  		return rewriteValuePPC64_OpRsh32x64(v)
   689  	case OpRsh32x8:
   690  		return rewriteValuePPC64_OpRsh32x8(v)
   691  	case OpRsh64Ux16:
   692  		return rewriteValuePPC64_OpRsh64Ux16(v)
   693  	case OpRsh64Ux32:
   694  		return rewriteValuePPC64_OpRsh64Ux32(v)
   695  	case OpRsh64Ux64:
   696  		return rewriteValuePPC64_OpRsh64Ux64(v)
   697  	case OpRsh64Ux8:
   698  		return rewriteValuePPC64_OpRsh64Ux8(v)
   699  	case OpRsh64x16:
   700  		return rewriteValuePPC64_OpRsh64x16(v)
   701  	case OpRsh64x32:
   702  		return rewriteValuePPC64_OpRsh64x32(v)
   703  	case OpRsh64x64:
   704  		return rewriteValuePPC64_OpRsh64x64(v)
   705  	case OpRsh64x8:
   706  		return rewriteValuePPC64_OpRsh64x8(v)
   707  	case OpRsh8Ux16:
   708  		return rewriteValuePPC64_OpRsh8Ux16(v)
   709  	case OpRsh8Ux32:
   710  		return rewriteValuePPC64_OpRsh8Ux32(v)
   711  	case OpRsh8Ux64:
   712  		return rewriteValuePPC64_OpRsh8Ux64(v)
   713  	case OpRsh8Ux8:
   714  		return rewriteValuePPC64_OpRsh8Ux8(v)
   715  	case OpRsh8x16:
   716  		return rewriteValuePPC64_OpRsh8x16(v)
   717  	case OpRsh8x32:
   718  		return rewriteValuePPC64_OpRsh8x32(v)
   719  	case OpRsh8x64:
   720  		return rewriteValuePPC64_OpRsh8x64(v)
   721  	case OpRsh8x8:
   722  		return rewriteValuePPC64_OpRsh8x8(v)
   723  	case OpSignExt16to32:
   724  		v.Op = OpPPC64MOVHreg
   725  		return true
   726  	case OpSignExt16to64:
   727  		v.Op = OpPPC64MOVHreg
   728  		return true
   729  	case OpSignExt32to64:
   730  		v.Op = OpPPC64MOVWreg
   731  		return true
   732  	case OpSignExt8to16:
   733  		v.Op = OpPPC64MOVBreg
   734  		return true
   735  	case OpSignExt8to32:
   736  		v.Op = OpPPC64MOVBreg
   737  		return true
   738  	case OpSignExt8to64:
   739  		v.Op = OpPPC64MOVBreg
   740  		return true
   741  	case OpSlicemask:
   742  		return rewriteValuePPC64_OpSlicemask(v)
   743  	case OpSqrt:
   744  		v.Op = OpPPC64FSQRT
   745  		return true
   746  	case OpStaticCall:
   747  		v.Op = OpPPC64CALLstatic
   748  		return true
   749  	case OpStore:
   750  		return rewriteValuePPC64_OpStore(v)
   751  	case OpSub16:
   752  		v.Op = OpPPC64SUB
   753  		return true
   754  	case OpSub32:
   755  		v.Op = OpPPC64SUB
   756  		return true
   757  	case OpSub32F:
   758  		v.Op = OpPPC64FSUBS
   759  		return true
   760  	case OpSub64:
   761  		v.Op = OpPPC64SUB
   762  		return true
   763  	case OpSub64F:
   764  		v.Op = OpPPC64FSUB
   765  		return true
   766  	case OpSub8:
   767  		v.Op = OpPPC64SUB
   768  		return true
   769  	case OpSubPtr:
   770  		v.Op = OpPPC64SUB
   771  		return true
   772  	case OpTrunc:
   773  		v.Op = OpPPC64FTRUNC
   774  		return true
   775  	case OpTrunc16to8:
   776  		return rewriteValuePPC64_OpTrunc16to8(v)
   777  	case OpTrunc32to16:
   778  		return rewriteValuePPC64_OpTrunc32to16(v)
   779  	case OpTrunc32to8:
   780  		return rewriteValuePPC64_OpTrunc32to8(v)
   781  	case OpTrunc64to16:
   782  		return rewriteValuePPC64_OpTrunc64to16(v)
   783  	case OpTrunc64to32:
   784  		return rewriteValuePPC64_OpTrunc64to32(v)
   785  	case OpTrunc64to8:
   786  		return rewriteValuePPC64_OpTrunc64to8(v)
   787  	case OpWB:
   788  		v.Op = OpPPC64LoweredWB
   789  		return true
   790  	case OpXor16:
   791  		v.Op = OpPPC64XOR
   792  		return true
   793  	case OpXor32:
   794  		v.Op = OpPPC64XOR
   795  		return true
   796  	case OpXor64:
   797  		v.Op = OpPPC64XOR
   798  		return true
   799  	case OpXor8:
   800  		v.Op = OpPPC64XOR
   801  		return true
   802  	case OpZero:
   803  		return rewriteValuePPC64_OpZero(v)
   804  	case OpZeroExt16to32:
   805  		v.Op = OpPPC64MOVHZreg
   806  		return true
   807  	case OpZeroExt16to64:
   808  		v.Op = OpPPC64MOVHZreg
   809  		return true
   810  	case OpZeroExt32to64:
   811  		v.Op = OpPPC64MOVWZreg
   812  		return true
   813  	case OpZeroExt8to16:
   814  		v.Op = OpPPC64MOVBZreg
   815  		return true
   816  	case OpZeroExt8to32:
   817  		v.Op = OpPPC64MOVBZreg
   818  		return true
   819  	case OpZeroExt8to64:
   820  		v.Op = OpPPC64MOVBZreg
   821  		return true
   822  	}
   823  	return false
   824  }
   825  func rewriteValuePPC64_OpAddr(v *Value) bool {
   826  	v_0 := v.Args[0]
   827  	// match: (Addr {sym} base)
   828  	// result: (MOVDaddr {sym} [0] base)
   829  	for {
   830  		sym := auxToSym(v.Aux)
   831  		base := v_0
   832  		v.reset(OpPPC64MOVDaddr)
   833  		v.AuxInt = int32ToAuxInt(0)
   834  		v.Aux = symToAux(sym)
   835  		v.AddArg(base)
   836  		return true
   837  	}
   838  }
   839  func rewriteValuePPC64_OpAtomicCompareAndSwap32(v *Value) bool {
   840  	v_3 := v.Args[3]
   841  	v_2 := v.Args[2]
   842  	v_1 := v.Args[1]
   843  	v_0 := v.Args[0]
   844  	// match: (AtomicCompareAndSwap32 ptr old new_ mem)
   845  	// result: (LoweredAtomicCas32 [1] ptr old new_ mem)
   846  	for {
   847  		ptr := v_0
   848  		old := v_1
   849  		new_ := v_2
   850  		mem := v_3
   851  		v.reset(OpPPC64LoweredAtomicCas32)
   852  		v.AuxInt = int64ToAuxInt(1)
   853  		v.AddArg4(ptr, old, new_, mem)
   854  		return true
   855  	}
   856  }
   857  func rewriteValuePPC64_OpAtomicCompareAndSwap64(v *Value) bool {
   858  	v_3 := v.Args[3]
   859  	v_2 := v.Args[2]
   860  	v_1 := v.Args[1]
   861  	v_0 := v.Args[0]
   862  	// match: (AtomicCompareAndSwap64 ptr old new_ mem)
   863  	// result: (LoweredAtomicCas64 [1] ptr old new_ mem)
   864  	for {
   865  		ptr := v_0
   866  		old := v_1
   867  		new_ := v_2
   868  		mem := v_3
   869  		v.reset(OpPPC64LoweredAtomicCas64)
   870  		v.AuxInt = int64ToAuxInt(1)
   871  		v.AddArg4(ptr, old, new_, mem)
   872  		return true
   873  	}
   874  }
   875  func rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v *Value) bool {
   876  	v_3 := v.Args[3]
   877  	v_2 := v.Args[2]
   878  	v_1 := v.Args[1]
   879  	v_0 := v.Args[0]
   880  	// match: (AtomicCompareAndSwapRel32 ptr old new_ mem)
   881  	// result: (LoweredAtomicCas32 [0] ptr old new_ mem)
   882  	for {
   883  		ptr := v_0
   884  		old := v_1
   885  		new_ := v_2
   886  		mem := v_3
   887  		v.reset(OpPPC64LoweredAtomicCas32)
   888  		v.AuxInt = int64ToAuxInt(0)
   889  		v.AddArg4(ptr, old, new_, mem)
   890  		return true
   891  	}
   892  }
   893  func rewriteValuePPC64_OpAtomicLoad32(v *Value) bool {
   894  	v_1 := v.Args[1]
   895  	v_0 := v.Args[0]
   896  	// match: (AtomicLoad32 ptr mem)
   897  	// result: (LoweredAtomicLoad32 [1] ptr mem)
   898  	for {
   899  		ptr := v_0
   900  		mem := v_1
   901  		v.reset(OpPPC64LoweredAtomicLoad32)
   902  		v.AuxInt = int64ToAuxInt(1)
   903  		v.AddArg2(ptr, mem)
   904  		return true
   905  	}
   906  }
   907  func rewriteValuePPC64_OpAtomicLoad64(v *Value) bool {
   908  	v_1 := v.Args[1]
   909  	v_0 := v.Args[0]
   910  	// match: (AtomicLoad64 ptr mem)
   911  	// result: (LoweredAtomicLoad64 [1] ptr mem)
   912  	for {
   913  		ptr := v_0
   914  		mem := v_1
   915  		v.reset(OpPPC64LoweredAtomicLoad64)
   916  		v.AuxInt = int64ToAuxInt(1)
   917  		v.AddArg2(ptr, mem)
   918  		return true
   919  	}
   920  }
   921  func rewriteValuePPC64_OpAtomicLoad8(v *Value) bool {
   922  	v_1 := v.Args[1]
   923  	v_0 := v.Args[0]
   924  	// match: (AtomicLoad8 ptr mem)
   925  	// result: (LoweredAtomicLoad8 [1] ptr mem)
   926  	for {
   927  		ptr := v_0
   928  		mem := v_1
   929  		v.reset(OpPPC64LoweredAtomicLoad8)
   930  		v.AuxInt = int64ToAuxInt(1)
   931  		v.AddArg2(ptr, mem)
   932  		return true
   933  	}
   934  }
   935  func rewriteValuePPC64_OpAtomicLoadAcq32(v *Value) bool {
   936  	v_1 := v.Args[1]
   937  	v_0 := v.Args[0]
   938  	// match: (AtomicLoadAcq32 ptr mem)
   939  	// result: (LoweredAtomicLoad32 [0] ptr mem)
   940  	for {
   941  		ptr := v_0
   942  		mem := v_1
   943  		v.reset(OpPPC64LoweredAtomicLoad32)
   944  		v.AuxInt = int64ToAuxInt(0)
   945  		v.AddArg2(ptr, mem)
   946  		return true
   947  	}
   948  }
   949  func rewriteValuePPC64_OpAtomicLoadAcq64(v *Value) bool {
   950  	v_1 := v.Args[1]
   951  	v_0 := v.Args[0]
   952  	// match: (AtomicLoadAcq64 ptr mem)
   953  	// result: (LoweredAtomicLoad64 [0] ptr mem)
   954  	for {
   955  		ptr := v_0
   956  		mem := v_1
   957  		v.reset(OpPPC64LoweredAtomicLoad64)
   958  		v.AuxInt = int64ToAuxInt(0)
   959  		v.AddArg2(ptr, mem)
   960  		return true
   961  	}
   962  }
   963  func rewriteValuePPC64_OpAtomicLoadPtr(v *Value) bool {
   964  	v_1 := v.Args[1]
   965  	v_0 := v.Args[0]
   966  	// match: (AtomicLoadPtr ptr mem)
   967  	// result: (LoweredAtomicLoadPtr [1] ptr mem)
   968  	for {
   969  		ptr := v_0
   970  		mem := v_1
   971  		v.reset(OpPPC64LoweredAtomicLoadPtr)
   972  		v.AuxInt = int64ToAuxInt(1)
   973  		v.AddArg2(ptr, mem)
   974  		return true
   975  	}
   976  }
   977  func rewriteValuePPC64_OpAtomicStore32(v *Value) bool {
   978  	v_2 := v.Args[2]
   979  	v_1 := v.Args[1]
   980  	v_0 := v.Args[0]
   981  	// match: (AtomicStore32 ptr val mem)
   982  	// result: (LoweredAtomicStore32 [1] ptr val mem)
   983  	for {
   984  		ptr := v_0
   985  		val := v_1
   986  		mem := v_2
   987  		v.reset(OpPPC64LoweredAtomicStore32)
   988  		v.AuxInt = int64ToAuxInt(1)
   989  		v.AddArg3(ptr, val, mem)
   990  		return true
   991  	}
   992  }
   993  func rewriteValuePPC64_OpAtomicStore64(v *Value) bool {
   994  	v_2 := v.Args[2]
   995  	v_1 := v.Args[1]
   996  	v_0 := v.Args[0]
   997  	// match: (AtomicStore64 ptr val mem)
   998  	// result: (LoweredAtomicStore64 [1] ptr val mem)
   999  	for {
  1000  		ptr := v_0
  1001  		val := v_1
  1002  		mem := v_2
  1003  		v.reset(OpPPC64LoweredAtomicStore64)
  1004  		v.AuxInt = int64ToAuxInt(1)
  1005  		v.AddArg3(ptr, val, mem)
  1006  		return true
  1007  	}
  1008  }
  1009  func rewriteValuePPC64_OpAtomicStore8(v *Value) bool {
  1010  	v_2 := v.Args[2]
  1011  	v_1 := v.Args[1]
  1012  	v_0 := v.Args[0]
  1013  	// match: (AtomicStore8 ptr val mem)
  1014  	// result: (LoweredAtomicStore8 [1] ptr val mem)
  1015  	for {
  1016  		ptr := v_0
  1017  		val := v_1
  1018  		mem := v_2
  1019  		v.reset(OpPPC64LoweredAtomicStore8)
  1020  		v.AuxInt = int64ToAuxInt(1)
  1021  		v.AddArg3(ptr, val, mem)
  1022  		return true
  1023  	}
  1024  }
  1025  func rewriteValuePPC64_OpAtomicStoreRel32(v *Value) bool {
  1026  	v_2 := v.Args[2]
  1027  	v_1 := v.Args[1]
  1028  	v_0 := v.Args[0]
  1029  	// match: (AtomicStoreRel32 ptr val mem)
  1030  	// result: (LoweredAtomicStore32 [0] ptr val mem)
  1031  	for {
  1032  		ptr := v_0
  1033  		val := v_1
  1034  		mem := v_2
  1035  		v.reset(OpPPC64LoweredAtomicStore32)
  1036  		v.AuxInt = int64ToAuxInt(0)
  1037  		v.AddArg3(ptr, val, mem)
  1038  		return true
  1039  	}
  1040  }
  1041  func rewriteValuePPC64_OpAtomicStoreRel64(v *Value) bool {
  1042  	v_2 := v.Args[2]
  1043  	v_1 := v.Args[1]
  1044  	v_0 := v.Args[0]
  1045  	// match: (AtomicStoreRel64 ptr val mem)
  1046  	// result: (LoweredAtomicStore64 [0] ptr val mem)
  1047  	for {
  1048  		ptr := v_0
  1049  		val := v_1
  1050  		mem := v_2
  1051  		v.reset(OpPPC64LoweredAtomicStore64)
  1052  		v.AuxInt = int64ToAuxInt(0)
  1053  		v.AddArg3(ptr, val, mem)
  1054  		return true
  1055  	}
  1056  }
  1057  func rewriteValuePPC64_OpAvg64u(v *Value) bool {
  1058  	v_1 := v.Args[1]
  1059  	v_0 := v.Args[0]
  1060  	b := v.Block
  1061  	// match: (Avg64u <t> x y)
  1062  	// result: (ADD (SRDconst <t> (SUB <t> x y) [1]) y)
  1063  	for {
  1064  		t := v.Type
  1065  		x := v_0
  1066  		y := v_1
  1067  		v.reset(OpPPC64ADD)
  1068  		v0 := b.NewValue0(v.Pos, OpPPC64SRDconst, t)
  1069  		v0.AuxInt = int64ToAuxInt(1)
  1070  		v1 := b.NewValue0(v.Pos, OpPPC64SUB, t)
  1071  		v1.AddArg2(x, y)
  1072  		v0.AddArg(v1)
  1073  		v.AddArg2(v0, y)
  1074  		return true
  1075  	}
  1076  }
  1077  func rewriteValuePPC64_OpBitLen32(v *Value) bool {
  1078  	v_0 := v.Args[0]
  1079  	b := v.Block
  1080  	typ := &b.Func.Config.Types
  1081  	// match: (BitLen32 x)
  1082  	// result: (SUBFCconst [32] (CNTLZW <typ.Int> x))
  1083  	for {
  1084  		x := v_0
  1085  		v.reset(OpPPC64SUBFCconst)
  1086  		v.AuxInt = int64ToAuxInt(32)
  1087  		v0 := b.NewValue0(v.Pos, OpPPC64CNTLZW, typ.Int)
  1088  		v0.AddArg(x)
  1089  		v.AddArg(v0)
  1090  		return true
  1091  	}
  1092  }
  1093  func rewriteValuePPC64_OpBitLen64(v *Value) bool {
  1094  	v_0 := v.Args[0]
  1095  	b := v.Block
  1096  	typ := &b.Func.Config.Types
  1097  	// match: (BitLen64 x)
  1098  	// result: (SUBFCconst [64] (CNTLZD <typ.Int> x))
  1099  	for {
  1100  		x := v_0
  1101  		v.reset(OpPPC64SUBFCconst)
  1102  		v.AuxInt = int64ToAuxInt(64)
  1103  		v0 := b.NewValue0(v.Pos, OpPPC64CNTLZD, typ.Int)
  1104  		v0.AddArg(x)
  1105  		v.AddArg(v0)
  1106  		return true
  1107  	}
  1108  }
  1109  func rewriteValuePPC64_OpCom16(v *Value) bool {
  1110  	v_0 := v.Args[0]
  1111  	// match: (Com16 x)
  1112  	// result: (NOR x x)
  1113  	for {
  1114  		x := v_0
  1115  		v.reset(OpPPC64NOR)
  1116  		v.AddArg2(x, x)
  1117  		return true
  1118  	}
  1119  }
  1120  func rewriteValuePPC64_OpCom32(v *Value) bool {
  1121  	v_0 := v.Args[0]
  1122  	// match: (Com32 x)
  1123  	// result: (NOR x x)
  1124  	for {
  1125  		x := v_0
  1126  		v.reset(OpPPC64NOR)
  1127  		v.AddArg2(x, x)
  1128  		return true
  1129  	}
  1130  }
  1131  func rewriteValuePPC64_OpCom64(v *Value) bool {
  1132  	v_0 := v.Args[0]
  1133  	// match: (Com64 x)
  1134  	// result: (NOR x x)
  1135  	for {
  1136  		x := v_0
  1137  		v.reset(OpPPC64NOR)
  1138  		v.AddArg2(x, x)
  1139  		return true
  1140  	}
  1141  }
  1142  func rewriteValuePPC64_OpCom8(v *Value) bool {
  1143  	v_0 := v.Args[0]
  1144  	// match: (Com8 x)
  1145  	// result: (NOR x x)
  1146  	for {
  1147  		x := v_0
  1148  		v.reset(OpPPC64NOR)
  1149  		v.AddArg2(x, x)
  1150  		return true
  1151  	}
  1152  }
  1153  func rewriteValuePPC64_OpCondSelect(v *Value) bool {
  1154  	v_2 := v.Args[2]
  1155  	v_1 := v.Args[1]
  1156  	v_0 := v.Args[0]
  1157  	b := v.Block
  1158  	// match: (CondSelect x y bool)
  1159  	// cond: flagArg(bool) != nil
  1160  	// result: (ISEL [2] x y bool)
  1161  	for {
  1162  		x := v_0
  1163  		y := v_1
  1164  		bool := v_2
  1165  		if !(flagArg(bool) != nil) {
  1166  			break
  1167  		}
  1168  		v.reset(OpPPC64ISEL)
  1169  		v.AuxInt = int32ToAuxInt(2)
  1170  		v.AddArg3(x, y, bool)
  1171  		return true
  1172  	}
  1173  	// match: (CondSelect x y bool)
  1174  	// cond: flagArg(bool) == nil
  1175  	// result: (ISEL [2] x y (CMPWconst [0] bool))
  1176  	for {
  1177  		x := v_0
  1178  		y := v_1
  1179  		bool := v_2
  1180  		if !(flagArg(bool) == nil) {
  1181  			break
  1182  		}
  1183  		v.reset(OpPPC64ISEL)
  1184  		v.AuxInt = int32ToAuxInt(2)
  1185  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, types.TypeFlags)
  1186  		v0.AuxInt = int32ToAuxInt(0)
  1187  		v0.AddArg(bool)
  1188  		v.AddArg3(x, y, v0)
  1189  		return true
  1190  	}
  1191  	return false
  1192  }
  1193  func rewriteValuePPC64_OpConst16(v *Value) bool {
  1194  	// match: (Const16 [val])
  1195  	// result: (MOVDconst [int64(val)])
  1196  	for {
  1197  		val := auxIntToInt16(v.AuxInt)
  1198  		v.reset(OpPPC64MOVDconst)
  1199  		v.AuxInt = int64ToAuxInt(int64(val))
  1200  		return true
  1201  	}
  1202  }
  1203  func rewriteValuePPC64_OpConst32(v *Value) bool {
  1204  	// match: (Const32 [val])
  1205  	// result: (MOVDconst [int64(val)])
  1206  	for {
  1207  		val := auxIntToInt32(v.AuxInt)
  1208  		v.reset(OpPPC64MOVDconst)
  1209  		v.AuxInt = int64ToAuxInt(int64(val))
  1210  		return true
  1211  	}
  1212  }
  1213  func rewriteValuePPC64_OpConst64(v *Value) bool {
  1214  	// match: (Const64 [val])
  1215  	// result: (MOVDconst [int64(val)])
  1216  	for {
  1217  		val := auxIntToInt64(v.AuxInt)
  1218  		v.reset(OpPPC64MOVDconst)
  1219  		v.AuxInt = int64ToAuxInt(int64(val))
  1220  		return true
  1221  	}
  1222  }
  1223  func rewriteValuePPC64_OpConst8(v *Value) bool {
  1224  	// match: (Const8 [val])
  1225  	// result: (MOVDconst [int64(val)])
  1226  	for {
  1227  		val := auxIntToInt8(v.AuxInt)
  1228  		v.reset(OpPPC64MOVDconst)
  1229  		v.AuxInt = int64ToAuxInt(int64(val))
  1230  		return true
  1231  	}
  1232  }
  1233  func rewriteValuePPC64_OpConstBool(v *Value) bool {
  1234  	// match: (ConstBool [b])
  1235  	// result: (MOVDconst [b2i(b)])
  1236  	for {
  1237  		b := auxIntToBool(v.AuxInt)
  1238  		v.reset(OpPPC64MOVDconst)
  1239  		v.AuxInt = int64ToAuxInt(b2i(b))
  1240  		return true
  1241  	}
  1242  }
  1243  func rewriteValuePPC64_OpConstNil(v *Value) bool {
  1244  	// match: (ConstNil)
  1245  	// result: (MOVDconst [0])
  1246  	for {
  1247  		v.reset(OpPPC64MOVDconst)
  1248  		v.AuxInt = int64ToAuxInt(0)
  1249  		return true
  1250  	}
  1251  }
  1252  func rewriteValuePPC64_OpCopysign(v *Value) bool {
  1253  	v_1 := v.Args[1]
  1254  	v_0 := v.Args[0]
  1255  	// match: (Copysign x y)
  1256  	// result: (FCPSGN y x)
  1257  	for {
  1258  		x := v_0
  1259  		y := v_1
  1260  		v.reset(OpPPC64FCPSGN)
  1261  		v.AddArg2(y, x)
  1262  		return true
  1263  	}
  1264  }
  1265  func rewriteValuePPC64_OpCtz16(v *Value) bool {
  1266  	v_0 := v.Args[0]
  1267  	b := v.Block
  1268  	typ := &b.Func.Config.Types
  1269  	// match: (Ctz16 x)
  1270  	// result: (POPCNTW (MOVHZreg (ANDN <typ.Int16> (ADDconst <typ.Int16> [-1] x) x)))
  1271  	for {
  1272  		x := v_0
  1273  		v.reset(OpPPC64POPCNTW)
  1274  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  1275  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int16)
  1276  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int16)
  1277  		v2.AuxInt = int64ToAuxInt(-1)
  1278  		v2.AddArg(x)
  1279  		v1.AddArg2(v2, x)
  1280  		v0.AddArg(v1)
  1281  		v.AddArg(v0)
  1282  		return true
  1283  	}
  1284  }
  1285  func rewriteValuePPC64_OpCtz32(v *Value) bool {
  1286  	v_0 := v.Args[0]
  1287  	b := v.Block
  1288  	typ := &b.Func.Config.Types
  1289  	// match: (Ctz32 x)
  1290  	// cond: objabi.GOPPC64<=8
  1291  	// result: (POPCNTW (MOVWZreg (ANDN <typ.Int> (ADDconst <typ.Int> [-1] x) x)))
  1292  	for {
  1293  		x := v_0
  1294  		if !(objabi.GOPPC64 <= 8) {
  1295  			break
  1296  		}
  1297  		v.reset(OpPPC64POPCNTW)
  1298  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
  1299  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int)
  1300  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int)
  1301  		v2.AuxInt = int64ToAuxInt(-1)
  1302  		v2.AddArg(x)
  1303  		v1.AddArg2(v2, x)
  1304  		v0.AddArg(v1)
  1305  		v.AddArg(v0)
  1306  		return true
  1307  	}
  1308  	// match: (Ctz32 x)
  1309  	// result: (CNTTZW (MOVWZreg x))
  1310  	for {
  1311  		x := v_0
  1312  		v.reset(OpPPC64CNTTZW)
  1313  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
  1314  		v0.AddArg(x)
  1315  		v.AddArg(v0)
  1316  		return true
  1317  	}
  1318  }
  1319  func rewriteValuePPC64_OpCtz64(v *Value) bool {
  1320  	v_0 := v.Args[0]
  1321  	b := v.Block
  1322  	typ := &b.Func.Config.Types
  1323  	// match: (Ctz64 x)
  1324  	// cond: objabi.GOPPC64<=8
  1325  	// result: (POPCNTD (ANDN <typ.Int64> (ADDconst <typ.Int64> [-1] x) x))
  1326  	for {
  1327  		x := v_0
  1328  		if !(objabi.GOPPC64 <= 8) {
  1329  			break
  1330  		}
  1331  		v.reset(OpPPC64POPCNTD)
  1332  		v0 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int64)
  1333  		v1 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int64)
  1334  		v1.AuxInt = int64ToAuxInt(-1)
  1335  		v1.AddArg(x)
  1336  		v0.AddArg2(v1, x)
  1337  		v.AddArg(v0)
  1338  		return true
  1339  	}
  1340  	// match: (Ctz64 x)
  1341  	// result: (CNTTZD x)
  1342  	for {
  1343  		x := v_0
  1344  		v.reset(OpPPC64CNTTZD)
  1345  		v.AddArg(x)
  1346  		return true
  1347  	}
  1348  }
  1349  func rewriteValuePPC64_OpCtz8(v *Value) bool {
  1350  	v_0 := v.Args[0]
  1351  	b := v.Block
  1352  	typ := &b.Func.Config.Types
  1353  	// match: (Ctz8 x)
  1354  	// result: (POPCNTB (MOVBZreg (ANDN <typ.UInt8> (ADDconst <typ.UInt8> [-1] x) x)))
  1355  	for {
  1356  		x := v_0
  1357  		v.reset(OpPPC64POPCNTB)
  1358  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  1359  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.UInt8)
  1360  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.UInt8)
  1361  		v2.AuxInt = int64ToAuxInt(-1)
  1362  		v2.AddArg(x)
  1363  		v1.AddArg2(v2, x)
  1364  		v0.AddArg(v1)
  1365  		v.AddArg(v0)
  1366  		return true
  1367  	}
  1368  }
  1369  func rewriteValuePPC64_OpCvt32Fto32(v *Value) bool {
  1370  	v_0 := v.Args[0]
  1371  	b := v.Block
  1372  	typ := &b.Func.Config.Types
  1373  	// match: (Cvt32Fto32 x)
  1374  	// result: (MFVSRD (FCTIWZ x))
  1375  	for {
  1376  		x := v_0
  1377  		v.reset(OpPPC64MFVSRD)
  1378  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
  1379  		v0.AddArg(x)
  1380  		v.AddArg(v0)
  1381  		return true
  1382  	}
  1383  }
  1384  func rewriteValuePPC64_OpCvt32Fto64(v *Value) bool {
  1385  	v_0 := v.Args[0]
  1386  	b := v.Block
  1387  	typ := &b.Func.Config.Types
  1388  	// match: (Cvt32Fto64 x)
  1389  	// result: (MFVSRD (FCTIDZ x))
  1390  	for {
  1391  		x := v_0
  1392  		v.reset(OpPPC64MFVSRD)
  1393  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
  1394  		v0.AddArg(x)
  1395  		v.AddArg(v0)
  1396  		return true
  1397  	}
  1398  }
  1399  func rewriteValuePPC64_OpCvt32to32F(v *Value) bool {
  1400  	v_0 := v.Args[0]
  1401  	b := v.Block
  1402  	typ := &b.Func.Config.Types
  1403  	// match: (Cvt32to32F x)
  1404  	// result: (FCFIDS (MTVSRD (SignExt32to64 x)))
  1405  	for {
  1406  		x := v_0
  1407  		v.reset(OpPPC64FCFIDS)
  1408  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1409  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1410  		v1.AddArg(x)
  1411  		v0.AddArg(v1)
  1412  		v.AddArg(v0)
  1413  		return true
  1414  	}
  1415  }
  1416  func rewriteValuePPC64_OpCvt32to64F(v *Value) bool {
  1417  	v_0 := v.Args[0]
  1418  	b := v.Block
  1419  	typ := &b.Func.Config.Types
  1420  	// match: (Cvt32to64F x)
  1421  	// result: (FCFID (MTVSRD (SignExt32to64 x)))
  1422  	for {
  1423  		x := v_0
  1424  		v.reset(OpPPC64FCFID)
  1425  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1426  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1427  		v1.AddArg(x)
  1428  		v0.AddArg(v1)
  1429  		v.AddArg(v0)
  1430  		return true
  1431  	}
  1432  }
  1433  func rewriteValuePPC64_OpCvt64Fto32(v *Value) bool {
  1434  	v_0 := v.Args[0]
  1435  	b := v.Block
  1436  	typ := &b.Func.Config.Types
  1437  	// match: (Cvt64Fto32 x)
  1438  	// result: (MFVSRD (FCTIWZ x))
  1439  	for {
  1440  		x := v_0
  1441  		v.reset(OpPPC64MFVSRD)
  1442  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
  1443  		v0.AddArg(x)
  1444  		v.AddArg(v0)
  1445  		return true
  1446  	}
  1447  }
  1448  func rewriteValuePPC64_OpCvt64Fto64(v *Value) bool {
  1449  	v_0 := v.Args[0]
  1450  	b := v.Block
  1451  	typ := &b.Func.Config.Types
  1452  	// match: (Cvt64Fto64 x)
  1453  	// result: (MFVSRD (FCTIDZ x))
  1454  	for {
  1455  		x := v_0
  1456  		v.reset(OpPPC64MFVSRD)
  1457  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
  1458  		v0.AddArg(x)
  1459  		v.AddArg(v0)
  1460  		return true
  1461  	}
  1462  }
  1463  func rewriteValuePPC64_OpCvt64to32F(v *Value) bool {
  1464  	v_0 := v.Args[0]
  1465  	b := v.Block
  1466  	typ := &b.Func.Config.Types
  1467  	// match: (Cvt64to32F x)
  1468  	// result: (FCFIDS (MTVSRD x))
  1469  	for {
  1470  		x := v_0
  1471  		v.reset(OpPPC64FCFIDS)
  1472  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1473  		v0.AddArg(x)
  1474  		v.AddArg(v0)
  1475  		return true
  1476  	}
  1477  }
  1478  func rewriteValuePPC64_OpCvt64to64F(v *Value) bool {
  1479  	v_0 := v.Args[0]
  1480  	b := v.Block
  1481  	typ := &b.Func.Config.Types
  1482  	// match: (Cvt64to64F x)
  1483  	// result: (FCFID (MTVSRD x))
  1484  	for {
  1485  		x := v_0
  1486  		v.reset(OpPPC64FCFID)
  1487  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1488  		v0.AddArg(x)
  1489  		v.AddArg(v0)
  1490  		return true
  1491  	}
  1492  }
  1493  func rewriteValuePPC64_OpDiv16(v *Value) bool {
  1494  	v_1 := v.Args[1]
  1495  	v_0 := v.Args[0]
  1496  	b := v.Block
  1497  	typ := &b.Func.Config.Types
  1498  	// match: (Div16 [false] x y)
  1499  	// result: (DIVW (SignExt16to32 x) (SignExt16to32 y))
  1500  	for {
  1501  		if auxIntToBool(v.AuxInt) != false {
  1502  			break
  1503  		}
  1504  		x := v_0
  1505  		y := v_1
  1506  		v.reset(OpPPC64DIVW)
  1507  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1508  		v0.AddArg(x)
  1509  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1510  		v1.AddArg(y)
  1511  		v.AddArg2(v0, v1)
  1512  		return true
  1513  	}
  1514  	return false
  1515  }
  1516  func rewriteValuePPC64_OpDiv16u(v *Value) bool {
  1517  	v_1 := v.Args[1]
  1518  	v_0 := v.Args[0]
  1519  	b := v.Block
  1520  	typ := &b.Func.Config.Types
  1521  	// match: (Div16u x y)
  1522  	// result: (DIVWU (ZeroExt16to32 x) (ZeroExt16to32 y))
  1523  	for {
  1524  		x := v_0
  1525  		y := v_1
  1526  		v.reset(OpPPC64DIVWU)
  1527  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1528  		v0.AddArg(x)
  1529  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1530  		v1.AddArg(y)
  1531  		v.AddArg2(v0, v1)
  1532  		return true
  1533  	}
  1534  }
  1535  func rewriteValuePPC64_OpDiv32(v *Value) bool {
  1536  	v_1 := v.Args[1]
  1537  	v_0 := v.Args[0]
  1538  	// match: (Div32 [false] x y)
  1539  	// result: (DIVW x y)
  1540  	for {
  1541  		if auxIntToBool(v.AuxInt) != false {
  1542  			break
  1543  		}
  1544  		x := v_0
  1545  		y := v_1
  1546  		v.reset(OpPPC64DIVW)
  1547  		v.AddArg2(x, y)
  1548  		return true
  1549  	}
  1550  	return false
  1551  }
  1552  func rewriteValuePPC64_OpDiv64(v *Value) bool {
  1553  	v_1 := v.Args[1]
  1554  	v_0 := v.Args[0]
  1555  	// match: (Div64 [false] x y)
  1556  	// result: (DIVD x y)
  1557  	for {
  1558  		if auxIntToBool(v.AuxInt) != false {
  1559  			break
  1560  		}
  1561  		x := v_0
  1562  		y := v_1
  1563  		v.reset(OpPPC64DIVD)
  1564  		v.AddArg2(x, y)
  1565  		return true
  1566  	}
  1567  	return false
  1568  }
  1569  func rewriteValuePPC64_OpDiv8(v *Value) bool {
  1570  	v_1 := v.Args[1]
  1571  	v_0 := v.Args[0]
  1572  	b := v.Block
  1573  	typ := &b.Func.Config.Types
  1574  	// match: (Div8 x y)
  1575  	// result: (DIVW (SignExt8to32 x) (SignExt8to32 y))
  1576  	for {
  1577  		x := v_0
  1578  		y := v_1
  1579  		v.reset(OpPPC64DIVW)
  1580  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1581  		v0.AddArg(x)
  1582  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1583  		v1.AddArg(y)
  1584  		v.AddArg2(v0, v1)
  1585  		return true
  1586  	}
  1587  }
  1588  func rewriteValuePPC64_OpDiv8u(v *Value) bool {
  1589  	v_1 := v.Args[1]
  1590  	v_0 := v.Args[0]
  1591  	b := v.Block
  1592  	typ := &b.Func.Config.Types
  1593  	// match: (Div8u x y)
  1594  	// result: (DIVWU (ZeroExt8to32 x) (ZeroExt8to32 y))
  1595  	for {
  1596  		x := v_0
  1597  		y := v_1
  1598  		v.reset(OpPPC64DIVWU)
  1599  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1600  		v0.AddArg(x)
  1601  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1602  		v1.AddArg(y)
  1603  		v.AddArg2(v0, v1)
  1604  		return true
  1605  	}
  1606  }
  1607  func rewriteValuePPC64_OpEq16(v *Value) bool {
  1608  	v_1 := v.Args[1]
  1609  	v_0 := v.Args[0]
  1610  	b := v.Block
  1611  	typ := &b.Func.Config.Types
  1612  	// match: (Eq16 x y)
  1613  	// cond: isSigned(x.Type) && isSigned(y.Type)
  1614  	// result: (Equal (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  1615  	for {
  1616  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1617  			x := v_0
  1618  			y := v_1
  1619  			if !(isSigned(x.Type) && isSigned(y.Type)) {
  1620  				continue
  1621  			}
  1622  			v.reset(OpPPC64Equal)
  1623  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1624  			v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1625  			v1.AddArg(x)
  1626  			v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1627  			v2.AddArg(y)
  1628  			v0.AddArg2(v1, v2)
  1629  			v.AddArg(v0)
  1630  			return true
  1631  		}
  1632  		break
  1633  	}
  1634  	// match: (Eq16 x y)
  1635  	// result: (Equal (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
  1636  	for {
  1637  		x := v_0
  1638  		y := v_1
  1639  		v.reset(OpPPC64Equal)
  1640  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1641  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1642  		v1.AddArg(x)
  1643  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1644  		v2.AddArg(y)
  1645  		v0.AddArg2(v1, v2)
  1646  		v.AddArg(v0)
  1647  		return true
  1648  	}
  1649  }
  1650  func rewriteValuePPC64_OpEq32(v *Value) bool {
  1651  	v_1 := v.Args[1]
  1652  	v_0 := v.Args[0]
  1653  	b := v.Block
  1654  	// match: (Eq32 x y)
  1655  	// result: (Equal (CMPW x y))
  1656  	for {
  1657  		x := v_0
  1658  		y := v_1
  1659  		v.reset(OpPPC64Equal)
  1660  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1661  		v0.AddArg2(x, y)
  1662  		v.AddArg(v0)
  1663  		return true
  1664  	}
  1665  }
  1666  func rewriteValuePPC64_OpEq32F(v *Value) bool {
  1667  	v_1 := v.Args[1]
  1668  	v_0 := v.Args[0]
  1669  	b := v.Block
  1670  	// match: (Eq32F x y)
  1671  	// result: (Equal (FCMPU x y))
  1672  	for {
  1673  		x := v_0
  1674  		y := v_1
  1675  		v.reset(OpPPC64Equal)
  1676  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  1677  		v0.AddArg2(x, y)
  1678  		v.AddArg(v0)
  1679  		return true
  1680  	}
  1681  }
  1682  func rewriteValuePPC64_OpEq64(v *Value) bool {
  1683  	v_1 := v.Args[1]
  1684  	v_0 := v.Args[0]
  1685  	b := v.Block
  1686  	// match: (Eq64 x y)
  1687  	// result: (Equal (CMP x y))
  1688  	for {
  1689  		x := v_0
  1690  		y := v_1
  1691  		v.reset(OpPPC64Equal)
  1692  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  1693  		v0.AddArg2(x, y)
  1694  		v.AddArg(v0)
  1695  		return true
  1696  	}
  1697  }
  1698  func rewriteValuePPC64_OpEq64F(v *Value) bool {
  1699  	v_1 := v.Args[1]
  1700  	v_0 := v.Args[0]
  1701  	b := v.Block
  1702  	// match: (Eq64F x y)
  1703  	// result: (Equal (FCMPU x y))
  1704  	for {
  1705  		x := v_0
  1706  		y := v_1
  1707  		v.reset(OpPPC64Equal)
  1708  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  1709  		v0.AddArg2(x, y)
  1710  		v.AddArg(v0)
  1711  		return true
  1712  	}
  1713  }
  1714  func rewriteValuePPC64_OpEq8(v *Value) bool {
  1715  	v_1 := v.Args[1]
  1716  	v_0 := v.Args[0]
  1717  	b := v.Block
  1718  	typ := &b.Func.Config.Types
  1719  	// match: (Eq8 x y)
  1720  	// cond: isSigned(x.Type) && isSigned(y.Type)
  1721  	// result: (Equal (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  1722  	for {
  1723  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1724  			x := v_0
  1725  			y := v_1
  1726  			if !(isSigned(x.Type) && isSigned(y.Type)) {
  1727  				continue
  1728  			}
  1729  			v.reset(OpPPC64Equal)
  1730  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1731  			v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1732  			v1.AddArg(x)
  1733  			v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1734  			v2.AddArg(y)
  1735  			v0.AddArg2(v1, v2)
  1736  			v.AddArg(v0)
  1737  			return true
  1738  		}
  1739  		break
  1740  	}
  1741  	// match: (Eq8 x y)
  1742  	// result: (Equal (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
  1743  	for {
  1744  		x := v_0
  1745  		y := v_1
  1746  		v.reset(OpPPC64Equal)
  1747  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1748  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1749  		v1.AddArg(x)
  1750  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1751  		v2.AddArg(y)
  1752  		v0.AddArg2(v1, v2)
  1753  		v.AddArg(v0)
  1754  		return true
  1755  	}
  1756  }
  1757  func rewriteValuePPC64_OpEqB(v *Value) bool {
  1758  	v_1 := v.Args[1]
  1759  	v_0 := v.Args[0]
  1760  	b := v.Block
  1761  	typ := &b.Func.Config.Types
  1762  	// match: (EqB x y)
  1763  	// result: (ANDconst [1] (EQV x y))
  1764  	for {
  1765  		x := v_0
  1766  		y := v_1
  1767  		v.reset(OpPPC64ANDconst)
  1768  		v.AuxInt = int64ToAuxInt(1)
  1769  		v0 := b.NewValue0(v.Pos, OpPPC64EQV, typ.Int64)
  1770  		v0.AddArg2(x, y)
  1771  		v.AddArg(v0)
  1772  		return true
  1773  	}
  1774  }
  1775  func rewriteValuePPC64_OpEqPtr(v *Value) bool {
  1776  	v_1 := v.Args[1]
  1777  	v_0 := v.Args[0]
  1778  	b := v.Block
  1779  	// match: (EqPtr x y)
  1780  	// result: (Equal (CMP x y))
  1781  	for {
  1782  		x := v_0
  1783  		y := v_1
  1784  		v.reset(OpPPC64Equal)
  1785  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  1786  		v0.AddArg2(x, y)
  1787  		v.AddArg(v0)
  1788  		return true
  1789  	}
  1790  }
  1791  func rewriteValuePPC64_OpIsInBounds(v *Value) bool {
  1792  	v_1 := v.Args[1]
  1793  	v_0 := v.Args[0]
  1794  	b := v.Block
  1795  	// match: (IsInBounds idx len)
  1796  	// result: (LessThan (CMPU idx len))
  1797  	for {
  1798  		idx := v_0
  1799  		len := v_1
  1800  		v.reset(OpPPC64LessThan)
  1801  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  1802  		v0.AddArg2(idx, len)
  1803  		v.AddArg(v0)
  1804  		return true
  1805  	}
  1806  }
  1807  func rewriteValuePPC64_OpIsNonNil(v *Value) bool {
  1808  	v_0 := v.Args[0]
  1809  	b := v.Block
  1810  	// match: (IsNonNil ptr)
  1811  	// result: (NotEqual (CMPconst [0] ptr))
  1812  	for {
  1813  		ptr := v_0
  1814  		v.reset(OpPPC64NotEqual)
  1815  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  1816  		v0.AuxInt = int64ToAuxInt(0)
  1817  		v0.AddArg(ptr)
  1818  		v.AddArg(v0)
  1819  		return true
  1820  	}
  1821  }
  1822  func rewriteValuePPC64_OpIsSliceInBounds(v *Value) bool {
  1823  	v_1 := v.Args[1]
  1824  	v_0 := v.Args[0]
  1825  	b := v.Block
  1826  	// match: (IsSliceInBounds idx len)
  1827  	// result: (LessEqual (CMPU idx len))
  1828  	for {
  1829  		idx := v_0
  1830  		len := v_1
  1831  		v.reset(OpPPC64LessEqual)
  1832  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  1833  		v0.AddArg2(idx, len)
  1834  		v.AddArg(v0)
  1835  		return true
  1836  	}
  1837  }
  1838  func rewriteValuePPC64_OpLeq16(v *Value) bool {
  1839  	v_1 := v.Args[1]
  1840  	v_0 := v.Args[0]
  1841  	b := v.Block
  1842  	typ := &b.Func.Config.Types
  1843  	// match: (Leq16 x y)
  1844  	// result: (LessEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  1845  	for {
  1846  		x := v_0
  1847  		y := v_1
  1848  		v.reset(OpPPC64LessEqual)
  1849  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1850  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1851  		v1.AddArg(x)
  1852  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1853  		v2.AddArg(y)
  1854  		v0.AddArg2(v1, v2)
  1855  		v.AddArg(v0)
  1856  		return true
  1857  	}
  1858  }
  1859  func rewriteValuePPC64_OpLeq16U(v *Value) bool {
  1860  	v_1 := v.Args[1]
  1861  	v_0 := v.Args[0]
  1862  	b := v.Block
  1863  	typ := &b.Func.Config.Types
  1864  	// match: (Leq16U x y)
  1865  	// result: (LessEqual (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  1866  	for {
  1867  		x := v_0
  1868  		y := v_1
  1869  		v.reset(OpPPC64LessEqual)
  1870  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  1871  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1872  		v1.AddArg(x)
  1873  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1874  		v2.AddArg(y)
  1875  		v0.AddArg2(v1, v2)
  1876  		v.AddArg(v0)
  1877  		return true
  1878  	}
  1879  }
  1880  func rewriteValuePPC64_OpLeq32(v *Value) bool {
  1881  	v_1 := v.Args[1]
  1882  	v_0 := v.Args[0]
  1883  	b := v.Block
  1884  	// match: (Leq32 x y)
  1885  	// result: (LessEqual (CMPW x y))
  1886  	for {
  1887  		x := v_0
  1888  		y := v_1
  1889  		v.reset(OpPPC64LessEqual)
  1890  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1891  		v0.AddArg2(x, y)
  1892  		v.AddArg(v0)
  1893  		return true
  1894  	}
  1895  }
  1896  func rewriteValuePPC64_OpLeq32F(v *Value) bool {
  1897  	v_1 := v.Args[1]
  1898  	v_0 := v.Args[0]
  1899  	b := v.Block
  1900  	// match: (Leq32F x y)
  1901  	// result: (FLessEqual (FCMPU x y))
  1902  	for {
  1903  		x := v_0
  1904  		y := v_1
  1905  		v.reset(OpPPC64FLessEqual)
  1906  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  1907  		v0.AddArg2(x, y)
  1908  		v.AddArg(v0)
  1909  		return true
  1910  	}
  1911  }
  1912  func rewriteValuePPC64_OpLeq32U(v *Value) bool {
  1913  	v_1 := v.Args[1]
  1914  	v_0 := v.Args[0]
  1915  	b := v.Block
  1916  	// match: (Leq32U x y)
  1917  	// result: (LessEqual (CMPWU x y))
  1918  	for {
  1919  		x := v_0
  1920  		y := v_1
  1921  		v.reset(OpPPC64LessEqual)
  1922  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  1923  		v0.AddArg2(x, y)
  1924  		v.AddArg(v0)
  1925  		return true
  1926  	}
  1927  }
  1928  func rewriteValuePPC64_OpLeq64(v *Value) bool {
  1929  	v_1 := v.Args[1]
  1930  	v_0 := v.Args[0]
  1931  	b := v.Block
  1932  	// match: (Leq64 x y)
  1933  	// result: (LessEqual (CMP x y))
  1934  	for {
  1935  		x := v_0
  1936  		y := v_1
  1937  		v.reset(OpPPC64LessEqual)
  1938  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  1939  		v0.AddArg2(x, y)
  1940  		v.AddArg(v0)
  1941  		return true
  1942  	}
  1943  }
  1944  func rewriteValuePPC64_OpLeq64F(v *Value) bool {
  1945  	v_1 := v.Args[1]
  1946  	v_0 := v.Args[0]
  1947  	b := v.Block
  1948  	// match: (Leq64F x y)
  1949  	// result: (FLessEqual (FCMPU x y))
  1950  	for {
  1951  		x := v_0
  1952  		y := v_1
  1953  		v.reset(OpPPC64FLessEqual)
  1954  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  1955  		v0.AddArg2(x, y)
  1956  		v.AddArg(v0)
  1957  		return true
  1958  	}
  1959  }
  1960  func rewriteValuePPC64_OpLeq64U(v *Value) bool {
  1961  	v_1 := v.Args[1]
  1962  	v_0 := v.Args[0]
  1963  	b := v.Block
  1964  	// match: (Leq64U x y)
  1965  	// result: (LessEqual (CMPU x y))
  1966  	for {
  1967  		x := v_0
  1968  		y := v_1
  1969  		v.reset(OpPPC64LessEqual)
  1970  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  1971  		v0.AddArg2(x, y)
  1972  		v.AddArg(v0)
  1973  		return true
  1974  	}
  1975  }
  1976  func rewriteValuePPC64_OpLeq8(v *Value) bool {
  1977  	v_1 := v.Args[1]
  1978  	v_0 := v.Args[0]
  1979  	b := v.Block
  1980  	typ := &b.Func.Config.Types
  1981  	// match: (Leq8 x y)
  1982  	// result: (LessEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  1983  	for {
  1984  		x := v_0
  1985  		y := v_1
  1986  		v.reset(OpPPC64LessEqual)
  1987  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1988  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1989  		v1.AddArg(x)
  1990  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1991  		v2.AddArg(y)
  1992  		v0.AddArg2(v1, v2)
  1993  		v.AddArg(v0)
  1994  		return true
  1995  	}
  1996  }
  1997  func rewriteValuePPC64_OpLeq8U(v *Value) bool {
  1998  	v_1 := v.Args[1]
  1999  	v_0 := v.Args[0]
  2000  	b := v.Block
  2001  	typ := &b.Func.Config.Types
  2002  	// match: (Leq8U x y)
  2003  	// result: (LessEqual (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2004  	for {
  2005  		x := v_0
  2006  		y := v_1
  2007  		v.reset(OpPPC64LessEqual)
  2008  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2009  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2010  		v1.AddArg(x)
  2011  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2012  		v2.AddArg(y)
  2013  		v0.AddArg2(v1, v2)
  2014  		v.AddArg(v0)
  2015  		return true
  2016  	}
  2017  }
  2018  func rewriteValuePPC64_OpLess16(v *Value) bool {
  2019  	v_1 := v.Args[1]
  2020  	v_0 := v.Args[0]
  2021  	b := v.Block
  2022  	typ := &b.Func.Config.Types
  2023  	// match: (Less16 x y)
  2024  	// result: (LessThan (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  2025  	for {
  2026  		x := v_0
  2027  		y := v_1
  2028  		v.reset(OpPPC64LessThan)
  2029  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2030  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2031  		v1.AddArg(x)
  2032  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2033  		v2.AddArg(y)
  2034  		v0.AddArg2(v1, v2)
  2035  		v.AddArg(v0)
  2036  		return true
  2037  	}
  2038  }
  2039  func rewriteValuePPC64_OpLess16U(v *Value) bool {
  2040  	v_1 := v.Args[1]
  2041  	v_0 := v.Args[0]
  2042  	b := v.Block
  2043  	typ := &b.Func.Config.Types
  2044  	// match: (Less16U x y)
  2045  	// result: (LessThan (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  2046  	for {
  2047  		x := v_0
  2048  		y := v_1
  2049  		v.reset(OpPPC64LessThan)
  2050  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2051  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2052  		v1.AddArg(x)
  2053  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2054  		v2.AddArg(y)
  2055  		v0.AddArg2(v1, v2)
  2056  		v.AddArg(v0)
  2057  		return true
  2058  	}
  2059  }
  2060  func rewriteValuePPC64_OpLess32(v *Value) bool {
  2061  	v_1 := v.Args[1]
  2062  	v_0 := v.Args[0]
  2063  	b := v.Block
  2064  	// match: (Less32 x y)
  2065  	// result: (LessThan (CMPW x y))
  2066  	for {
  2067  		x := v_0
  2068  		y := v_1
  2069  		v.reset(OpPPC64LessThan)
  2070  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2071  		v0.AddArg2(x, y)
  2072  		v.AddArg(v0)
  2073  		return true
  2074  	}
  2075  }
  2076  func rewriteValuePPC64_OpLess32F(v *Value) bool {
  2077  	v_1 := v.Args[1]
  2078  	v_0 := v.Args[0]
  2079  	b := v.Block
  2080  	// match: (Less32F x y)
  2081  	// result: (FLessThan (FCMPU x y))
  2082  	for {
  2083  		x := v_0
  2084  		y := v_1
  2085  		v.reset(OpPPC64FLessThan)
  2086  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2087  		v0.AddArg2(x, y)
  2088  		v.AddArg(v0)
  2089  		return true
  2090  	}
  2091  }
  2092  func rewriteValuePPC64_OpLess32U(v *Value) bool {
  2093  	v_1 := v.Args[1]
  2094  	v_0 := v.Args[0]
  2095  	b := v.Block
  2096  	// match: (Less32U x y)
  2097  	// result: (LessThan (CMPWU x y))
  2098  	for {
  2099  		x := v_0
  2100  		y := v_1
  2101  		v.reset(OpPPC64LessThan)
  2102  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2103  		v0.AddArg2(x, y)
  2104  		v.AddArg(v0)
  2105  		return true
  2106  	}
  2107  }
  2108  func rewriteValuePPC64_OpLess64(v *Value) bool {
  2109  	v_1 := v.Args[1]
  2110  	v_0 := v.Args[0]
  2111  	b := v.Block
  2112  	// match: (Less64 x y)
  2113  	// result: (LessThan (CMP x y))
  2114  	for {
  2115  		x := v_0
  2116  		y := v_1
  2117  		v.reset(OpPPC64LessThan)
  2118  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2119  		v0.AddArg2(x, y)
  2120  		v.AddArg(v0)
  2121  		return true
  2122  	}
  2123  }
  2124  func rewriteValuePPC64_OpLess64F(v *Value) bool {
  2125  	v_1 := v.Args[1]
  2126  	v_0 := v.Args[0]
  2127  	b := v.Block
  2128  	// match: (Less64F x y)
  2129  	// result: (FLessThan (FCMPU x y))
  2130  	for {
  2131  		x := v_0
  2132  		y := v_1
  2133  		v.reset(OpPPC64FLessThan)
  2134  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2135  		v0.AddArg2(x, y)
  2136  		v.AddArg(v0)
  2137  		return true
  2138  	}
  2139  }
  2140  func rewriteValuePPC64_OpLess64U(v *Value) bool {
  2141  	v_1 := v.Args[1]
  2142  	v_0 := v.Args[0]
  2143  	b := v.Block
  2144  	// match: (Less64U x y)
  2145  	// result: (LessThan (CMPU x y))
  2146  	for {
  2147  		x := v_0
  2148  		y := v_1
  2149  		v.reset(OpPPC64LessThan)
  2150  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2151  		v0.AddArg2(x, y)
  2152  		v.AddArg(v0)
  2153  		return true
  2154  	}
  2155  }
  2156  func rewriteValuePPC64_OpLess8(v *Value) bool {
  2157  	v_1 := v.Args[1]
  2158  	v_0 := v.Args[0]
  2159  	b := v.Block
  2160  	typ := &b.Func.Config.Types
  2161  	// match: (Less8 x y)
  2162  	// result: (LessThan (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2163  	for {
  2164  		x := v_0
  2165  		y := v_1
  2166  		v.reset(OpPPC64LessThan)
  2167  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2168  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2169  		v1.AddArg(x)
  2170  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2171  		v2.AddArg(y)
  2172  		v0.AddArg2(v1, v2)
  2173  		v.AddArg(v0)
  2174  		return true
  2175  	}
  2176  }
  2177  func rewriteValuePPC64_OpLess8U(v *Value) bool {
  2178  	v_1 := v.Args[1]
  2179  	v_0 := v.Args[0]
  2180  	b := v.Block
  2181  	typ := &b.Func.Config.Types
  2182  	// match: (Less8U x y)
  2183  	// result: (LessThan (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2184  	for {
  2185  		x := v_0
  2186  		y := v_1
  2187  		v.reset(OpPPC64LessThan)
  2188  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2189  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2190  		v1.AddArg(x)
  2191  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2192  		v2.AddArg(y)
  2193  		v0.AddArg2(v1, v2)
  2194  		v.AddArg(v0)
  2195  		return true
  2196  	}
  2197  }
  2198  func rewriteValuePPC64_OpLoad(v *Value) bool {
  2199  	v_1 := v.Args[1]
  2200  	v_0 := v.Args[0]
  2201  	b := v.Block
  2202  	typ := &b.Func.Config.Types
  2203  	// match: (Load <t> ptr mem)
  2204  	// cond: (is64BitInt(t) || isPtr(t))
  2205  	// result: (MOVDload ptr mem)
  2206  	for {
  2207  		t := v.Type
  2208  		ptr := v_0
  2209  		mem := v_1
  2210  		if !(is64BitInt(t) || isPtr(t)) {
  2211  			break
  2212  		}
  2213  		v.reset(OpPPC64MOVDload)
  2214  		v.AddArg2(ptr, mem)
  2215  		return true
  2216  	}
  2217  	// match: (Load <t> ptr mem)
  2218  	// cond: is32BitInt(t) && isSigned(t)
  2219  	// result: (MOVWload ptr mem)
  2220  	for {
  2221  		t := v.Type
  2222  		ptr := v_0
  2223  		mem := v_1
  2224  		if !(is32BitInt(t) && isSigned(t)) {
  2225  			break
  2226  		}
  2227  		v.reset(OpPPC64MOVWload)
  2228  		v.AddArg2(ptr, mem)
  2229  		return true
  2230  	}
  2231  	// match: (Load <t> ptr mem)
  2232  	// cond: is32BitInt(t) && !isSigned(t)
  2233  	// result: (MOVWZload ptr mem)
  2234  	for {
  2235  		t := v.Type
  2236  		ptr := v_0
  2237  		mem := v_1
  2238  		if !(is32BitInt(t) && !isSigned(t)) {
  2239  			break
  2240  		}
  2241  		v.reset(OpPPC64MOVWZload)
  2242  		v.AddArg2(ptr, mem)
  2243  		return true
  2244  	}
  2245  	// match: (Load <t> ptr mem)
  2246  	// cond: is16BitInt(t) && isSigned(t)
  2247  	// result: (MOVHload ptr mem)
  2248  	for {
  2249  		t := v.Type
  2250  		ptr := v_0
  2251  		mem := v_1
  2252  		if !(is16BitInt(t) && isSigned(t)) {
  2253  			break
  2254  		}
  2255  		v.reset(OpPPC64MOVHload)
  2256  		v.AddArg2(ptr, mem)
  2257  		return true
  2258  	}
  2259  	// match: (Load <t> ptr mem)
  2260  	// cond: is16BitInt(t) && !isSigned(t)
  2261  	// result: (MOVHZload ptr mem)
  2262  	for {
  2263  		t := v.Type
  2264  		ptr := v_0
  2265  		mem := v_1
  2266  		if !(is16BitInt(t) && !isSigned(t)) {
  2267  			break
  2268  		}
  2269  		v.reset(OpPPC64MOVHZload)
  2270  		v.AddArg2(ptr, mem)
  2271  		return true
  2272  	}
  2273  	// match: (Load <t> ptr mem)
  2274  	// cond: t.IsBoolean()
  2275  	// result: (MOVBZload ptr mem)
  2276  	for {
  2277  		t := v.Type
  2278  		ptr := v_0
  2279  		mem := v_1
  2280  		if !(t.IsBoolean()) {
  2281  			break
  2282  		}
  2283  		v.reset(OpPPC64MOVBZload)
  2284  		v.AddArg2(ptr, mem)
  2285  		return true
  2286  	}
  2287  	// match: (Load <t> ptr mem)
  2288  	// cond: is8BitInt(t) && isSigned(t)
  2289  	// result: (MOVBreg (MOVBZload ptr mem))
  2290  	for {
  2291  		t := v.Type
  2292  		ptr := v_0
  2293  		mem := v_1
  2294  		if !(is8BitInt(t) && isSigned(t)) {
  2295  			break
  2296  		}
  2297  		v.reset(OpPPC64MOVBreg)
  2298  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  2299  		v0.AddArg2(ptr, mem)
  2300  		v.AddArg(v0)
  2301  		return true
  2302  	}
  2303  	// match: (Load <t> ptr mem)
  2304  	// cond: is8BitInt(t) && !isSigned(t)
  2305  	// result: (MOVBZload ptr mem)
  2306  	for {
  2307  		t := v.Type
  2308  		ptr := v_0
  2309  		mem := v_1
  2310  		if !(is8BitInt(t) && !isSigned(t)) {
  2311  			break
  2312  		}
  2313  		v.reset(OpPPC64MOVBZload)
  2314  		v.AddArg2(ptr, mem)
  2315  		return true
  2316  	}
  2317  	// match: (Load <t> ptr mem)
  2318  	// cond: is32BitFloat(t)
  2319  	// result: (FMOVSload ptr mem)
  2320  	for {
  2321  		t := v.Type
  2322  		ptr := v_0
  2323  		mem := v_1
  2324  		if !(is32BitFloat(t)) {
  2325  			break
  2326  		}
  2327  		v.reset(OpPPC64FMOVSload)
  2328  		v.AddArg2(ptr, mem)
  2329  		return true
  2330  	}
  2331  	// match: (Load <t> ptr mem)
  2332  	// cond: is64BitFloat(t)
  2333  	// result: (FMOVDload ptr mem)
  2334  	for {
  2335  		t := v.Type
  2336  		ptr := v_0
  2337  		mem := v_1
  2338  		if !(is64BitFloat(t)) {
  2339  			break
  2340  		}
  2341  		v.reset(OpPPC64FMOVDload)
  2342  		v.AddArg2(ptr, mem)
  2343  		return true
  2344  	}
  2345  	return false
  2346  }
  2347  func rewriteValuePPC64_OpLocalAddr(v *Value) bool {
  2348  	v_0 := v.Args[0]
  2349  	// match: (LocalAddr {sym} base _)
  2350  	// result: (MOVDaddr {sym} base)
  2351  	for {
  2352  		sym := auxToSym(v.Aux)
  2353  		base := v_0
  2354  		v.reset(OpPPC64MOVDaddr)
  2355  		v.Aux = symToAux(sym)
  2356  		v.AddArg(base)
  2357  		return true
  2358  	}
  2359  }
  2360  func rewriteValuePPC64_OpLsh16x16(v *Value) bool {
  2361  	v_1 := v.Args[1]
  2362  	v_0 := v.Args[0]
  2363  	b := v.Block
  2364  	typ := &b.Func.Config.Types
  2365  	// match: (Lsh16x16 x y)
  2366  	// cond: shiftIsBounded(v)
  2367  	// result: (SLW x y)
  2368  	for {
  2369  		x := v_0
  2370  		y := v_1
  2371  		if !(shiftIsBounded(v)) {
  2372  			break
  2373  		}
  2374  		v.reset(OpPPC64SLW)
  2375  		v.AddArg2(x, y)
  2376  		return true
  2377  	}
  2378  	// match: (Lsh16x16 x y)
  2379  	// result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [16]))))
  2380  	for {
  2381  		x := v_0
  2382  		y := v_1
  2383  		v.reset(OpPPC64SLW)
  2384  		v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
  2385  		v0.AuxInt = int32ToAuxInt(0)
  2386  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2387  		v1.AuxInt = int64ToAuxInt(-1)
  2388  		v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2389  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2390  		v3.AddArg(y)
  2391  		v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2392  		v4.AuxInt = int64ToAuxInt(16)
  2393  		v2.AddArg2(v3, v4)
  2394  		v0.AddArg3(y, v1, v2)
  2395  		v.AddArg2(x, v0)
  2396  		return true
  2397  	}
  2398  }
  2399  func rewriteValuePPC64_OpLsh16x32(v *Value) bool {
  2400  	v_1 := v.Args[1]
  2401  	v_0 := v.Args[0]
  2402  	b := v.Block
  2403  	typ := &b.Func.Config.Types
  2404  	// match: (Lsh16x32 x (MOVDconst [c]))
  2405  	// cond: uint32(c) < 16
  2406  	// result: (SLWconst x [c&31])
  2407  	for {
  2408  		x := v_0
  2409  		if v_1.Op != OpPPC64MOVDconst {
  2410  			break
  2411  		}
  2412  		c := auxIntToInt64(v_1.AuxInt)
  2413  		if !(uint32(c) < 16) {
  2414  			break
  2415  		}
  2416  		v.reset(OpPPC64SLWconst)
  2417  		v.AuxInt = int64ToAuxInt(c & 31)
  2418  		v.AddArg(x)
  2419  		return true
  2420  	}
  2421  	// match: (Lsh16x32 x y)
  2422  	// cond: shiftIsBounded(v)
  2423  	// result: (SLW x y)
  2424  	for {
  2425  		x := v_0
  2426  		y := v_1
  2427  		if !(shiftIsBounded(v)) {
  2428  			break
  2429  		}
  2430  		v.reset(OpPPC64SLW)
  2431  		v.AddArg2(x, y)
  2432  		return true
  2433  	}
  2434  	// match: (Lsh16x32 x y)
  2435  	// result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [16]))))
  2436  	for {
  2437  		x := v_0
  2438  		y := v_1
  2439  		v.reset(OpPPC64SLW)
  2440  		v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
  2441  		v0.AuxInt = int32ToAuxInt(0)
  2442  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2443  		v1.AuxInt = int64ToAuxInt(-1)
  2444  		v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2445  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2446  		v3.AuxInt = int64ToAuxInt(16)
  2447  		v2.AddArg2(y, v3)
  2448  		v0.AddArg3(y, v1, v2)
  2449  		v.AddArg2(x, v0)
  2450  		return true
  2451  	}
  2452  }
  2453  func rewriteValuePPC64_OpLsh16x64(v *Value) bool {
  2454  	v_1 := v.Args[1]
  2455  	v_0 := v.Args[0]
  2456  	b := v.Block
  2457  	typ := &b.Func.Config.Types
  2458  	// match: (Lsh16x64 _ (MOVDconst [c]))
  2459  	// cond: uint64(c) >= 16
  2460  	// result: (MOVDconst [0])
  2461  	for {
  2462  		if v_1.Op != OpPPC64MOVDconst {
  2463  			break
  2464  		}
  2465  		c := auxIntToInt64(v_1.AuxInt)
  2466  		if !(uint64(c) >= 16) {
  2467  			break
  2468  		}
  2469  		v.reset(OpPPC64MOVDconst)
  2470  		v.AuxInt = int64ToAuxInt(0)
  2471  		return true
  2472  	}
  2473  	// match: (Lsh16x64 x (MOVDconst [c]))
  2474  	// cond: uint64(c) < 16
  2475  	// result: (SLWconst x [c])
  2476  	for {
  2477  		x := v_0
  2478  		if v_1.Op != OpPPC64MOVDconst {
  2479  			break
  2480  		}
  2481  		c := auxIntToInt64(v_1.AuxInt)
  2482  		if !(uint64(c) < 16) {
  2483  			break
  2484  		}
  2485  		v.reset(OpPPC64SLWconst)
  2486  		v.AuxInt = int64ToAuxInt(c)
  2487  		v.AddArg(x)
  2488  		return true
  2489  	}
  2490  	// match: (Lsh16x64 x y)
  2491  	// cond: shiftIsBounded(v)
  2492  	// result: (SLW x y)
  2493  	for {
  2494  		x := v_0
  2495  		y := v_1
  2496  		if !(shiftIsBounded(v)) {
  2497  			break
  2498  		}
  2499  		v.reset(OpPPC64SLW)
  2500  		v.AddArg2(x, y)
  2501  		return true
  2502  	}
  2503  	// match: (Lsh16x64 x y)
  2504  	// result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [16]))))
  2505  	for {
  2506  		x := v_0
  2507  		y := v_1
  2508  		v.reset(OpPPC64SLW)
  2509  		v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
  2510  		v0.AuxInt = int32ToAuxInt(0)
  2511  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2512  		v1.AuxInt = int64ToAuxInt(-1)
  2513  		v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2514  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2515  		v3.AuxInt = int64ToAuxInt(16)
  2516  		v2.AddArg2(y, v3)
  2517  		v0.AddArg3(y, v1, v2)
  2518  		v.AddArg2(x, v0)
  2519  		return true
  2520  	}
  2521  }
  2522  func rewriteValuePPC64_OpLsh16x8(v *Value) bool {
  2523  	v_1 := v.Args[1]
  2524  	v_0 := v.Args[0]
  2525  	b := v.Block
  2526  	typ := &b.Func.Config.Types
  2527  	// match: (Lsh16x8 x y)
  2528  	// cond: shiftIsBounded(v)
  2529  	// result: (SLW x y)
  2530  	for {
  2531  		x := v_0
  2532  		y := v_1
  2533  		if !(shiftIsBounded(v)) {
  2534  			break
  2535  		}
  2536  		v.reset(OpPPC64SLW)
  2537  		v.AddArg2(x, y)
  2538  		return true
  2539  	}
  2540  	// match: (Lsh16x8 x y)
  2541  	// result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [16]))))
  2542  	for {
  2543  		x := v_0
  2544  		y := v_1
  2545  		v.reset(OpPPC64SLW)
  2546  		v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
  2547  		v0.AuxInt = int32ToAuxInt(0)
  2548  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2549  		v1.AuxInt = int64ToAuxInt(-1)
  2550  		v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2551  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  2552  		v3.AddArg(y)
  2553  		v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2554  		v4.AuxInt = int64ToAuxInt(16)
  2555  		v2.AddArg2(v3, v4)
  2556  		v0.AddArg3(y, v1, v2)
  2557  		v.AddArg2(x, v0)
  2558  		return true
  2559  	}
  2560  }
  2561  func rewriteValuePPC64_OpLsh32x16(v *Value) bool {
  2562  	v_1 := v.Args[1]
  2563  	v_0 := v.Args[0]
  2564  	b := v.Block
  2565  	typ := &b.Func.Config.Types
  2566  	// match: (Lsh32x16 x y)
  2567  	// cond: shiftIsBounded(v)
  2568  	// result: (SLW x y)
  2569  	for {
  2570  		x := v_0
  2571  		y := v_1
  2572  		if !(shiftIsBounded(v)) {
  2573  			break
  2574  		}
  2575  		v.reset(OpPPC64SLW)
  2576  		v.AddArg2(x, y)
  2577  		return true
  2578  	}
  2579  	// match: (Lsh32x16 x y)
  2580  	// result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [32]))))
  2581  	for {
  2582  		x := v_0
  2583  		y := v_1
  2584  		v.reset(OpPPC64SLW)
  2585  		v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
  2586  		v0.AuxInt = int32ToAuxInt(0)
  2587  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2588  		v1.AuxInt = int64ToAuxInt(-1)
  2589  		v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2590  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2591  		v3.AddArg(y)
  2592  		v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2593  		v4.AuxInt = int64ToAuxInt(32)
  2594  		v2.AddArg2(v3, v4)
  2595  		v0.AddArg3(y, v1, v2)
  2596  		v.AddArg2(x, v0)
  2597  		return true
  2598  	}
  2599  }
  2600  func rewriteValuePPC64_OpLsh32x32(v *Value) bool {
  2601  	v_1 := v.Args[1]
  2602  	v_0 := v.Args[0]
  2603  	b := v.Block
  2604  	typ := &b.Func.Config.Types
  2605  	// match: (Lsh32x32 x (MOVDconst [c]))
  2606  	// cond: uint32(c) < 32
  2607  	// result: (SLWconst x [c&31])
  2608  	for {
  2609  		x := v_0
  2610  		if v_1.Op != OpPPC64MOVDconst {
  2611  			break
  2612  		}
  2613  		c := auxIntToInt64(v_1.AuxInt)
  2614  		if !(uint32(c) < 32) {
  2615  			break
  2616  		}
  2617  		v.reset(OpPPC64SLWconst)
  2618  		v.AuxInt = int64ToAuxInt(c & 31)
  2619  		v.AddArg(x)
  2620  		return true
  2621  	}
  2622  	// match: (Lsh32x32 x y)
  2623  	// cond: shiftIsBounded(v)
  2624  	// result: (SLW x y)
  2625  	for {
  2626  		x := v_0
  2627  		y := v_1
  2628  		if !(shiftIsBounded(v)) {
  2629  			break
  2630  		}
  2631  		v.reset(OpPPC64SLW)
  2632  		v.AddArg2(x, y)
  2633  		return true
  2634  	}
  2635  	// match: (Lsh32x32 x y)
  2636  	// result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [32]))))
  2637  	for {
  2638  		x := v_0
  2639  		y := v_1
  2640  		v.reset(OpPPC64SLW)
  2641  		v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
  2642  		v0.AuxInt = int32ToAuxInt(0)
  2643  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2644  		v1.AuxInt = int64ToAuxInt(-1)
  2645  		v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2646  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2647  		v3.AuxInt = int64ToAuxInt(32)
  2648  		v2.AddArg2(y, v3)
  2649  		v0.AddArg3(y, v1, v2)
  2650  		v.AddArg2(x, v0)
  2651  		return true
  2652  	}
  2653  }
  2654  func rewriteValuePPC64_OpLsh32x64(v *Value) bool {
  2655  	v_1 := v.Args[1]
  2656  	v_0 := v.Args[0]
  2657  	b := v.Block
  2658  	typ := &b.Func.Config.Types
  2659  	// match: (Lsh32x64 _ (MOVDconst [c]))
  2660  	// cond: uint64(c) >= 32
  2661  	// result: (MOVDconst [0])
  2662  	for {
  2663  		if v_1.Op != OpPPC64MOVDconst {
  2664  			break
  2665  		}
  2666  		c := auxIntToInt64(v_1.AuxInt)
  2667  		if !(uint64(c) >= 32) {
  2668  			break
  2669  		}
  2670  		v.reset(OpPPC64MOVDconst)
  2671  		v.AuxInt = int64ToAuxInt(0)
  2672  		return true
  2673  	}
  2674  	// match: (Lsh32x64 x (MOVDconst [c]))
  2675  	// cond: uint64(c) < 32
  2676  	// result: (SLWconst x [c])
  2677  	for {
  2678  		x := v_0
  2679  		if v_1.Op != OpPPC64MOVDconst {
  2680  			break
  2681  		}
  2682  		c := auxIntToInt64(v_1.AuxInt)
  2683  		if !(uint64(c) < 32) {
  2684  			break
  2685  		}
  2686  		v.reset(OpPPC64SLWconst)
  2687  		v.AuxInt = int64ToAuxInt(c)
  2688  		v.AddArg(x)
  2689  		return true
  2690  	}
  2691  	// match: (Lsh32x64 x y)
  2692  	// cond: shiftIsBounded(v)
  2693  	// result: (SLW x y)
  2694  	for {
  2695  		x := v_0
  2696  		y := v_1
  2697  		if !(shiftIsBounded(v)) {
  2698  			break
  2699  		}
  2700  		v.reset(OpPPC64SLW)
  2701  		v.AddArg2(x, y)
  2702  		return true
  2703  	}
  2704  	// match: (Lsh32x64 x (AND y (MOVDconst [31])))
  2705  	// result: (SLW x (ANDconst <typ.Int32> [31] y))
  2706  	for {
  2707  		x := v_0
  2708  		if v_1.Op != OpPPC64AND {
  2709  			break
  2710  		}
  2711  		_ = v_1.Args[1]
  2712  		v_1_0 := v_1.Args[0]
  2713  		v_1_1 := v_1.Args[1]
  2714  		for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
  2715  			y := v_1_0
  2716  			if v_1_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1.AuxInt) != 31 {
  2717  				continue
  2718  			}
  2719  			v.reset(OpPPC64SLW)
  2720  			v0 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int32)
  2721  			v0.AuxInt = int64ToAuxInt(31)
  2722  			v0.AddArg(y)
  2723  			v.AddArg2(x, v0)
  2724  			return true
  2725  		}
  2726  		break
  2727  	}
  2728  	// match: (Lsh32x64 x (ANDconst <typ.Int32> [31] y))
  2729  	// result: (SLW x (ANDconst <typ.Int32> [31] y))
  2730  	for {
  2731  		x := v_0
  2732  		if v_1.Op != OpPPC64ANDconst || v_1.Type != typ.Int32 || auxIntToInt64(v_1.AuxInt) != 31 {
  2733  			break
  2734  		}
  2735  		y := v_1.Args[0]
  2736  		v.reset(OpPPC64SLW)
  2737  		v0 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int32)
  2738  		v0.AuxInt = int64ToAuxInt(31)
  2739  		v0.AddArg(y)
  2740  		v.AddArg2(x, v0)
  2741  		return true
  2742  	}
  2743  	// match: (Lsh32x64 x y)
  2744  	// result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [32]))))
  2745  	for {
  2746  		x := v_0
  2747  		y := v_1
  2748  		v.reset(OpPPC64SLW)
  2749  		v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
  2750  		v0.AuxInt = int32ToAuxInt(0)
  2751  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2752  		v1.AuxInt = int64ToAuxInt(-1)
  2753  		v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2754  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2755  		v3.AuxInt = int64ToAuxInt(32)
  2756  		v2.AddArg2(y, v3)
  2757  		v0.AddArg3(y, v1, v2)
  2758  		v.AddArg2(x, v0)
  2759  		return true
  2760  	}
  2761  }
  2762  func rewriteValuePPC64_OpLsh32x8(v *Value) bool {
  2763  	v_1 := v.Args[1]
  2764  	v_0 := v.Args[0]
  2765  	b := v.Block
  2766  	typ := &b.Func.Config.Types
  2767  	// match: (Lsh32x8 x y)
  2768  	// cond: shiftIsBounded(v)
  2769  	// result: (SLW x y)
  2770  	for {
  2771  		x := v_0
  2772  		y := v_1
  2773  		if !(shiftIsBounded(v)) {
  2774  			break
  2775  		}
  2776  		v.reset(OpPPC64SLW)
  2777  		v.AddArg2(x, y)
  2778  		return true
  2779  	}
  2780  	// match: (Lsh32x8 x y)
  2781  	// result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [32]))))
  2782  	for {
  2783  		x := v_0
  2784  		y := v_1
  2785  		v.reset(OpPPC64SLW)
  2786  		v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
  2787  		v0.AuxInt = int32ToAuxInt(0)
  2788  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2789  		v1.AuxInt = int64ToAuxInt(-1)
  2790  		v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2791  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  2792  		v3.AddArg(y)
  2793  		v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2794  		v4.AuxInt = int64ToAuxInt(32)
  2795  		v2.AddArg2(v3, v4)
  2796  		v0.AddArg3(y, v1, v2)
  2797  		v.AddArg2(x, v0)
  2798  		return true
  2799  	}
  2800  }
  2801  func rewriteValuePPC64_OpLsh64x16(v *Value) bool {
  2802  	v_1 := v.Args[1]
  2803  	v_0 := v.Args[0]
  2804  	b := v.Block
  2805  	typ := &b.Func.Config.Types
  2806  	// match: (Lsh64x16 x y)
  2807  	// cond: shiftIsBounded(v)
  2808  	// result: (SLD x y)
  2809  	for {
  2810  		x := v_0
  2811  		y := v_1
  2812  		if !(shiftIsBounded(v)) {
  2813  			break
  2814  		}
  2815  		v.reset(OpPPC64SLD)
  2816  		v.AddArg2(x, y)
  2817  		return true
  2818  	}
  2819  	// match: (Lsh64x16 x y)
  2820  	// result: (SLD x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [64]))))
  2821  	for {
  2822  		x := v_0
  2823  		y := v_1
  2824  		v.reset(OpPPC64SLD)
  2825  		v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
  2826  		v0.AuxInt = int32ToAuxInt(0)
  2827  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2828  		v1.AuxInt = int64ToAuxInt(-1)
  2829  		v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2830  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  2831  		v3.AddArg(y)
  2832  		v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2833  		v4.AuxInt = int64ToAuxInt(64)
  2834  		v2.AddArg2(v3, v4)
  2835  		v0.AddArg3(y, v1, v2)
  2836  		v.AddArg2(x, v0)
  2837  		return true
  2838  	}
  2839  }
  2840  func rewriteValuePPC64_OpLsh64x32(v *Value) bool {
  2841  	v_1 := v.Args[1]
  2842  	v_0 := v.Args[0]
  2843  	b := v.Block
  2844  	typ := &b.Func.Config.Types
  2845  	// match: (Lsh64x32 x (MOVDconst [c]))
  2846  	// cond: uint32(c) < 64
  2847  	// result: (SLDconst x [c&63])
  2848  	for {
  2849  		x := v_0
  2850  		if v_1.Op != OpPPC64MOVDconst {
  2851  			break
  2852  		}
  2853  		c := auxIntToInt64(v_1.AuxInt)
  2854  		if !(uint32(c) < 64) {
  2855  			break
  2856  		}
  2857  		v.reset(OpPPC64SLDconst)
  2858  		v.AuxInt = int64ToAuxInt(c & 63)
  2859  		v.AddArg(x)
  2860  		return true
  2861  	}
  2862  	// match: (Lsh64x32 x y)
  2863  	// cond: shiftIsBounded(v)
  2864  	// result: (SLD x y)
  2865  	for {
  2866  		x := v_0
  2867  		y := v_1
  2868  		if !(shiftIsBounded(v)) {
  2869  			break
  2870  		}
  2871  		v.reset(OpPPC64SLD)
  2872  		v.AddArg2(x, y)
  2873  		return true
  2874  	}
  2875  	// match: (Lsh64x32 x y)
  2876  	// result: (SLD x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [64]))))
  2877  	for {
  2878  		x := v_0
  2879  		y := v_1
  2880  		v.reset(OpPPC64SLD)
  2881  		v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
  2882  		v0.AuxInt = int32ToAuxInt(0)
  2883  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2884  		v1.AuxInt = int64ToAuxInt(-1)
  2885  		v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2886  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2887  		v3.AuxInt = int64ToAuxInt(64)
  2888  		v2.AddArg2(y, v3)
  2889  		v0.AddArg3(y, v1, v2)
  2890  		v.AddArg2(x, v0)
  2891  		return true
  2892  	}
  2893  }
  2894  func rewriteValuePPC64_OpLsh64x64(v *Value) bool {
  2895  	v_1 := v.Args[1]
  2896  	v_0 := v.Args[0]
  2897  	b := v.Block
  2898  	typ := &b.Func.Config.Types
  2899  	// match: (Lsh64x64 _ (MOVDconst [c]))
  2900  	// cond: uint64(c) >= 64
  2901  	// result: (MOVDconst [0])
  2902  	for {
  2903  		if v_1.Op != OpPPC64MOVDconst {
  2904  			break
  2905  		}
  2906  		c := auxIntToInt64(v_1.AuxInt)
  2907  		if !(uint64(c) >= 64) {
  2908  			break
  2909  		}
  2910  		v.reset(OpPPC64MOVDconst)
  2911  		v.AuxInt = int64ToAuxInt(0)
  2912  		return true
  2913  	}
  2914  	// match: (Lsh64x64 x (MOVDconst [c]))
  2915  	// cond: uint64(c) < 64
  2916  	// result: (SLDconst x [c])
  2917  	for {
  2918  		x := v_0
  2919  		if v_1.Op != OpPPC64MOVDconst {
  2920  			break
  2921  		}
  2922  		c := auxIntToInt64(v_1.AuxInt)
  2923  		if !(uint64(c) < 64) {
  2924  			break
  2925  		}
  2926  		v.reset(OpPPC64SLDconst)
  2927  		v.AuxInt = int64ToAuxInt(c)
  2928  		v.AddArg(x)
  2929  		return true
  2930  	}
  2931  	// match: (Lsh64x64 x y)
  2932  	// cond: shiftIsBounded(v)
  2933  	// result: (SLD x y)
  2934  	for {
  2935  		x := v_0
  2936  		y := v_1
  2937  		if !(shiftIsBounded(v)) {
  2938  			break
  2939  		}
  2940  		v.reset(OpPPC64SLD)
  2941  		v.AddArg2(x, y)
  2942  		return true
  2943  	}
  2944  	// match: (Lsh64x64 x (AND y (MOVDconst [63])))
  2945  	// result: (SLD x (ANDconst <typ.Int64> [63] y))
  2946  	for {
  2947  		x := v_0
  2948  		if v_1.Op != OpPPC64AND {
  2949  			break
  2950  		}
  2951  		_ = v_1.Args[1]
  2952  		v_1_0 := v_1.Args[0]
  2953  		v_1_1 := v_1.Args[1]
  2954  		for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
  2955  			y := v_1_0
  2956  			if v_1_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1.AuxInt) != 63 {
  2957  				continue
  2958  			}
  2959  			v.reset(OpPPC64SLD)
  2960  			v0 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int64)
  2961  			v0.AuxInt = int64ToAuxInt(63)
  2962  			v0.AddArg(y)
  2963  			v.AddArg2(x, v0)
  2964  			return true
  2965  		}
  2966  		break
  2967  	}
  2968  	// match: (Lsh64x64 x (ANDconst <typ.Int64> [63] y))
  2969  	// result: (SLD x (ANDconst <typ.Int64> [63] y))
  2970  	for {
  2971  		x := v_0
  2972  		if v_1.Op != OpPPC64ANDconst || v_1.Type != typ.Int64 || auxIntToInt64(v_1.AuxInt) != 63 {
  2973  			break
  2974  		}
  2975  		y := v_1.Args[0]
  2976  		v.reset(OpPPC64SLD)
  2977  		v0 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int64)
  2978  		v0.AuxInt = int64ToAuxInt(63)
  2979  		v0.AddArg(y)
  2980  		v.AddArg2(x, v0)
  2981  		return true
  2982  	}
  2983  	// match: (Lsh64x64 x y)
  2984  	// result: (SLD x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [64]))))
  2985  	for {
  2986  		x := v_0
  2987  		y := v_1
  2988  		v.reset(OpPPC64SLD)
  2989  		v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
  2990  		v0.AuxInt = int32ToAuxInt(0)
  2991  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2992  		v1.AuxInt = int64ToAuxInt(-1)
  2993  		v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2994  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2995  		v3.AuxInt = int64ToAuxInt(64)
  2996  		v2.AddArg2(y, v3)
  2997  		v0.AddArg3(y, v1, v2)
  2998  		v.AddArg2(x, v0)
  2999  		return true
  3000  	}
  3001  }
  3002  func rewriteValuePPC64_OpLsh64x8(v *Value) bool {
  3003  	v_1 := v.Args[1]
  3004  	v_0 := v.Args[0]
  3005  	b := v.Block
  3006  	typ := &b.Func.Config.Types
  3007  	// match: (Lsh64x8 x y)
  3008  	// cond: shiftIsBounded(v)
  3009  	// result: (SLD x y)
  3010  	for {
  3011  		x := v_0
  3012  		y := v_1
  3013  		if !(shiftIsBounded(v)) {
  3014  			break
  3015  		}
  3016  		v.reset(OpPPC64SLD)
  3017  		v.AddArg2(x, y)
  3018  		return true
  3019  	}
  3020  	// match: (Lsh64x8 x y)
  3021  	// result: (SLD x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [64]))))
  3022  	for {
  3023  		x := v_0
  3024  		y := v_1
  3025  		v.reset(OpPPC64SLD)
  3026  		v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
  3027  		v0.AuxInt = int32ToAuxInt(0)
  3028  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3029  		v1.AuxInt = int64ToAuxInt(-1)
  3030  		v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  3031  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  3032  		v3.AddArg(y)
  3033  		v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3034  		v4.AuxInt = int64ToAuxInt(64)
  3035  		v2.AddArg2(v3, v4)
  3036  		v0.AddArg3(y, v1, v2)
  3037  		v.AddArg2(x, v0)
  3038  		return true
  3039  	}
  3040  }
  3041  func rewriteValuePPC64_OpLsh8x16(v *Value) bool {
  3042  	v_1 := v.Args[1]
  3043  	v_0 := v.Args[0]
  3044  	b := v.Block
  3045  	typ := &b.Func.Config.Types
  3046  	// match: (Lsh8x16 x y)
  3047  	// cond: shiftIsBounded(v)
  3048  	// result: (SLW x y)
  3049  	for {
  3050  		x := v_0
  3051  		y := v_1
  3052  		if !(shiftIsBounded(v)) {
  3053  			break
  3054  		}
  3055  		v.reset(OpPPC64SLW)
  3056  		v.AddArg2(x, y)
  3057  		return true
  3058  	}
  3059  	// match: (Lsh8x16 x y)
  3060  	// result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt16to64 y) (MOVDconst [8]))))
  3061  	for {
  3062  		x := v_0
  3063  		y := v_1
  3064  		v.reset(OpPPC64SLW)
  3065  		v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
  3066  		v0.AuxInt = int32ToAuxInt(0)
  3067  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3068  		v1.AuxInt = int64ToAuxInt(-1)
  3069  		v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  3070  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  3071  		v3.AddArg(y)
  3072  		v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3073  		v4.AuxInt = int64ToAuxInt(8)
  3074  		v2.AddArg2(v3, v4)
  3075  		v0.AddArg3(y, v1, v2)
  3076  		v.AddArg2(x, v0)
  3077  		return true
  3078  	}
  3079  }
  3080  func rewriteValuePPC64_OpLsh8x32(v *Value) bool {
  3081  	v_1 := v.Args[1]
  3082  	v_0 := v.Args[0]
  3083  	b := v.Block
  3084  	typ := &b.Func.Config.Types
  3085  	// match: (Lsh8x32 x (MOVDconst [c]))
  3086  	// cond: uint32(c) < 8
  3087  	// result: (SLWconst x [c&7])
  3088  	for {
  3089  		x := v_0
  3090  		if v_1.Op != OpPPC64MOVDconst {
  3091  			break
  3092  		}
  3093  		c := auxIntToInt64(v_1.AuxInt)
  3094  		if !(uint32(c) < 8) {
  3095  			break
  3096  		}
  3097  		v.reset(OpPPC64SLWconst)
  3098  		v.AuxInt = int64ToAuxInt(c & 7)
  3099  		v.AddArg(x)
  3100  		return true
  3101  	}
  3102  	// match: (Lsh8x32 x y)
  3103  	// cond: shiftIsBounded(v)
  3104  	// result: (SLW x y)
  3105  	for {
  3106  		x := v_0
  3107  		y := v_1
  3108  		if !(shiftIsBounded(v)) {
  3109  			break
  3110  		}
  3111  		v.reset(OpPPC64SLW)
  3112  		v.AddArg2(x, y)
  3113  		return true
  3114  	}
  3115  	// match: (Lsh8x32 x y)
  3116  	// result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [8]))))
  3117  	for {
  3118  		x := v_0
  3119  		y := v_1
  3120  		v.reset(OpPPC64SLW)
  3121  		v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
  3122  		v0.AuxInt = int32ToAuxInt(0)
  3123  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3124  		v1.AuxInt = int64ToAuxInt(-1)
  3125  		v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  3126  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3127  		v3.AuxInt = int64ToAuxInt(8)
  3128  		v2.AddArg2(y, v3)
  3129  		v0.AddArg3(y, v1, v2)
  3130  		v.AddArg2(x, v0)
  3131  		return true
  3132  	}
  3133  }
  3134  func rewriteValuePPC64_OpLsh8x64(v *Value) bool {
  3135  	v_1 := v.Args[1]
  3136  	v_0 := v.Args[0]
  3137  	b := v.Block
  3138  	typ := &b.Func.Config.Types
  3139  	// match: (Lsh8x64 _ (MOVDconst [c]))
  3140  	// cond: uint64(c) >= 8
  3141  	// result: (MOVDconst [0])
  3142  	for {
  3143  		if v_1.Op != OpPPC64MOVDconst {
  3144  			break
  3145  		}
  3146  		c := auxIntToInt64(v_1.AuxInt)
  3147  		if !(uint64(c) >= 8) {
  3148  			break
  3149  		}
  3150  		v.reset(OpPPC64MOVDconst)
  3151  		v.AuxInt = int64ToAuxInt(0)
  3152  		return true
  3153  	}
  3154  	// match: (Lsh8x64 x (MOVDconst [c]))
  3155  	// cond: uint64(c) < 8
  3156  	// result: (SLWconst x [c])
  3157  	for {
  3158  		x := v_0
  3159  		if v_1.Op != OpPPC64MOVDconst {
  3160  			break
  3161  		}
  3162  		c := auxIntToInt64(v_1.AuxInt)
  3163  		if !(uint64(c) < 8) {
  3164  			break
  3165  		}
  3166  		v.reset(OpPPC64SLWconst)
  3167  		v.AuxInt = int64ToAuxInt(c)
  3168  		v.AddArg(x)
  3169  		return true
  3170  	}
  3171  	// match: (Lsh8x64 x y)
  3172  	// cond: shiftIsBounded(v)
  3173  	// result: (SLW x y)
  3174  	for {
  3175  		x := v_0
  3176  		y := v_1
  3177  		if !(shiftIsBounded(v)) {
  3178  			break
  3179  		}
  3180  		v.reset(OpPPC64SLW)
  3181  		v.AddArg2(x, y)
  3182  		return true
  3183  	}
  3184  	// match: (Lsh8x64 x y)
  3185  	// result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU y (MOVDconst [8]))))
  3186  	for {
  3187  		x := v_0
  3188  		y := v_1
  3189  		v.reset(OpPPC64SLW)
  3190  		v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
  3191  		v0.AuxInt = int32ToAuxInt(0)
  3192  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3193  		v1.AuxInt = int64ToAuxInt(-1)
  3194  		v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  3195  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3196  		v3.AuxInt = int64ToAuxInt(8)
  3197  		v2.AddArg2(y, v3)
  3198  		v0.AddArg3(y, v1, v2)
  3199  		v.AddArg2(x, v0)
  3200  		return true
  3201  	}
  3202  }
  3203  func rewriteValuePPC64_OpLsh8x8(v *Value) bool {
  3204  	v_1 := v.Args[1]
  3205  	v_0 := v.Args[0]
  3206  	b := v.Block
  3207  	typ := &b.Func.Config.Types
  3208  	// match: (Lsh8x8 x y)
  3209  	// cond: shiftIsBounded(v)
  3210  	// result: (SLW x y)
  3211  	for {
  3212  		x := v_0
  3213  		y := v_1
  3214  		if !(shiftIsBounded(v)) {
  3215  			break
  3216  		}
  3217  		v.reset(OpPPC64SLW)
  3218  		v.AddArg2(x, y)
  3219  		return true
  3220  	}
  3221  	// match: (Lsh8x8 x y)
  3222  	// result: (SLW x (ISEL [0] y (MOVDconst [-1]) (CMPU (ZeroExt8to64 y) (MOVDconst [8]))))
  3223  	for {
  3224  		x := v_0
  3225  		y := v_1
  3226  		v.reset(OpPPC64SLW)
  3227  		v0 := b.NewValue0(v.Pos, OpPPC64ISEL, typ.Int32)
  3228  		v0.AuxInt = int32ToAuxInt(0)
  3229  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3230  		v1.AuxInt = int64ToAuxInt(-1)
  3231  		v2 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  3232  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  3233  		v3.AddArg(y)
  3234  		v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3235  		v4.AuxInt = int64ToAuxInt(8)
  3236  		v2.AddArg2(v3, v4)
  3237  		v0.AddArg3(y, v1, v2)
  3238  		v.AddArg2(x, v0)
  3239  		return true
  3240  	}
  3241  }
  3242  func rewriteValuePPC64_OpMod16(v *Value) bool {
  3243  	v_1 := v.Args[1]
  3244  	v_0 := v.Args[0]
  3245  	b := v.Block
  3246  	typ := &b.Func.Config.Types
  3247  	// match: (Mod16 x y)
  3248  	// result: (Mod32 (SignExt16to32 x) (SignExt16to32 y))
  3249  	for {
  3250  		x := v_0
  3251  		y := v_1
  3252  		v.reset(OpMod32)
  3253  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3254  		v0.AddArg(x)
  3255  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3256  		v1.AddArg(y)
  3257  		v.AddArg2(v0, v1)
  3258  		return true
  3259  	}
  3260  }
  3261  func rewriteValuePPC64_OpMod16u(v *Value) bool {
  3262  	v_1 := v.Args[1]
  3263  	v_0 := v.Args[0]
  3264  	b := v.Block
  3265  	typ := &b.Func.Config.Types
  3266  	// match: (Mod16u x y)
  3267  	// result: (Mod32u (ZeroExt16to32 x) (ZeroExt16to32 y))
  3268  	for {
  3269  		x := v_0
  3270  		y := v_1
  3271  		v.reset(OpMod32u)
  3272  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3273  		v0.AddArg(x)
  3274  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3275  		v1.AddArg(y)
  3276  		v.AddArg2(v0, v1)
  3277  		return true
  3278  	}
  3279  }
  3280  func rewriteValuePPC64_OpMod32(v *Value) bool {
  3281  	v_1 := v.Args[1]
  3282  	v_0 := v.Args[0]
  3283  	b := v.Block
  3284  	typ := &b.Func.Config.Types
  3285  	// match: (Mod32 x y)
  3286  	// cond: objabi.GOPPC64 >= 9
  3287  	// result: (MODSW x y)
  3288  	for {
  3289  		x := v_0
  3290  		y := v_1
  3291  		if !(objabi.GOPPC64 >= 9) {
  3292  			break
  3293  		}
  3294  		v.reset(OpPPC64MODSW)
  3295  		v.AddArg2(x, y)
  3296  		return true
  3297  	}
  3298  	// match: (Mod32 x y)
  3299  	// cond: objabi.GOPPC64 <= 8
  3300  	// result: (SUB x (MULLW y (DIVW x y)))
  3301  	for {
  3302  		x := v_0
  3303  		y := v_1
  3304  		if !(objabi.GOPPC64 <= 8) {
  3305  			break
  3306  		}
  3307  		v.reset(OpPPC64SUB)
  3308  		v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
  3309  		v1 := b.NewValue0(v.Pos, OpPPC64DIVW, typ.Int32)
  3310  		v1.AddArg2(x, y)
  3311  		v0.AddArg2(y, v1)
  3312  		v.AddArg2(x, v0)
  3313  		return true
  3314  	}
  3315  	return false
  3316  }
  3317  func rewriteValuePPC64_OpMod32u(v *Value) bool {
  3318  	v_1 := v.Args[1]
  3319  	v_0 := v.Args[0]
  3320  	b := v.Block
  3321  	typ := &b.Func.Config.Types
  3322  	// match: (Mod32u x y)
  3323  	// cond: objabi.GOPPC64 >= 9
  3324  	// result: (MODUW x y)
  3325  	for {
  3326  		x := v_0
  3327  		y := v_1
  3328  		if !(objabi.GOPPC64 >= 9) {
  3329  			break
  3330  		}
  3331  		v.reset(OpPPC64MODUW)
  3332  		v.AddArg2(x, y)
  3333  		return true
  3334  	}
  3335  	// match: (Mod32u x y)
  3336  	// cond: objabi.GOPPC64 <= 8
  3337  	// result: (SUB x (MULLW y (DIVWU x y)))
  3338  	for {
  3339  		x := v_0
  3340  		y := v_1
  3341  		if !(objabi.GOPPC64 <= 8) {
  3342  			break
  3343  		}
  3344  		v.reset(OpPPC64SUB)
  3345  		v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
  3346  		v1 := b.NewValue0(v.Pos, OpPPC64DIVWU, typ.Int32)
  3347  		v1.AddArg2(x, y)
  3348  		v0.AddArg2(y, v1)
  3349  		v.AddArg2(x, v0)
  3350  		return true
  3351  	}
  3352  	return false
  3353  }
  3354  func rewriteValuePPC64_OpMod64(v *Value) bool {
  3355  	v_1 := v.Args[1]
  3356  	v_0 := v.Args[0]
  3357  	b := v.Block
  3358  	typ := &b.Func.Config.Types
  3359  	// match: (Mod64 x y)
  3360  	// cond: objabi.GOPPC64 >=9
  3361  	// result: (MODSD x y)
  3362  	for {
  3363  		x := v_0
  3364  		y := v_1
  3365  		if !(objabi.GOPPC64 >= 9) {
  3366  			break
  3367  		}
  3368  		v.reset(OpPPC64MODSD)
  3369  		v.AddArg2(x, y)
  3370  		return true
  3371  	}
  3372  	// match: (Mod64 x y)
  3373  	// cond: objabi.GOPPC64 <=8
  3374  	// result: (SUB x (MULLD y (DIVD x y)))
  3375  	for {
  3376  		x := v_0
  3377  		y := v_1
  3378  		if !(objabi.GOPPC64 <= 8) {
  3379  			break
  3380  		}
  3381  		v.reset(OpPPC64SUB)
  3382  		v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
  3383  		v1 := b.NewValue0(v.Pos, OpPPC64DIVD, typ.Int64)
  3384  		v1.AddArg2(x, y)
  3385  		v0.AddArg2(y, v1)
  3386  		v.AddArg2(x, v0)
  3387  		return true
  3388  	}
  3389  	return false
  3390  }
  3391  func rewriteValuePPC64_OpMod64u(v *Value) bool {
  3392  	v_1 := v.Args[1]
  3393  	v_0 := v.Args[0]
  3394  	b := v.Block
  3395  	typ := &b.Func.Config.Types
  3396  	// match: (Mod64u x y)
  3397  	// cond: objabi.GOPPC64 >= 9
  3398  	// result: (MODUD x y)
  3399  	for {
  3400  		x := v_0
  3401  		y := v_1
  3402  		if !(objabi.GOPPC64 >= 9) {
  3403  			break
  3404  		}
  3405  		v.reset(OpPPC64MODUD)
  3406  		v.AddArg2(x, y)
  3407  		return true
  3408  	}
  3409  	// match: (Mod64u x y)
  3410  	// cond: objabi.GOPPC64 <= 8
  3411  	// result: (SUB x (MULLD y (DIVDU x y)))
  3412  	for {
  3413  		x := v_0
  3414  		y := v_1
  3415  		if !(objabi.GOPPC64 <= 8) {
  3416  			break
  3417  		}
  3418  		v.reset(OpPPC64SUB)
  3419  		v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
  3420  		v1 := b.NewValue0(v.Pos, OpPPC64DIVDU, typ.Int64)
  3421  		v1.AddArg2(x, y)
  3422  		v0.AddArg2(y, v1)
  3423  		v.AddArg2(x, v0)
  3424  		return true
  3425  	}
  3426  	return false
  3427  }
  3428  func rewriteValuePPC64_OpMod8(v *Value) bool {
  3429  	v_1 := v.Args[1]
  3430  	v_0 := v.Args[0]
  3431  	b := v.Block
  3432  	typ := &b.Func.Config.Types
  3433  	// match: (Mod8 x y)
  3434  	// result: (Mod32 (SignExt8to32 x) (SignExt8to32 y))
  3435  	for {
  3436  		x := v_0
  3437  		y := v_1
  3438  		v.reset(OpMod32)
  3439  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3440  		v0.AddArg(x)
  3441  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3442  		v1.AddArg(y)
  3443  		v.AddArg2(v0, v1)
  3444  		return true
  3445  	}
  3446  }
  3447  func rewriteValuePPC64_OpMod8u(v *Value) bool {
  3448  	v_1 := v.Args[1]
  3449  	v_0 := v.Args[0]
  3450  	b := v.Block
  3451  	typ := &b.Func.Config.Types
  3452  	// match: (Mod8u x y)
  3453  	// result: (Mod32u (ZeroExt8to32 x) (ZeroExt8to32 y))
  3454  	for {
  3455  		x := v_0
  3456  		y := v_1
  3457  		v.reset(OpMod32u)
  3458  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3459  		v0.AddArg(x)
  3460  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3461  		v1.AddArg(y)
  3462  		v.AddArg2(v0, v1)
  3463  		return true
  3464  	}
  3465  }
  3466  func rewriteValuePPC64_OpMove(v *Value) bool {
  3467  	v_2 := v.Args[2]
  3468  	v_1 := v.Args[1]
  3469  	v_0 := v.Args[0]
  3470  	b := v.Block
  3471  	typ := &b.Func.Config.Types
  3472  	// match: (Move [0] _ _ mem)
  3473  	// result: mem
  3474  	for {
  3475  		if auxIntToInt64(v.AuxInt) != 0 {
  3476  			break
  3477  		}
  3478  		mem := v_2
  3479  		v.copyOf(mem)
  3480  		return true
  3481  	}
  3482  	// match: (Move [1] dst src mem)
  3483  	// result: (MOVBstore dst (MOVBZload src mem) mem)
  3484  	for {
  3485  		if auxIntToInt64(v.AuxInt) != 1 {
  3486  			break
  3487  		}
  3488  		dst := v_0
  3489  		src := v_1
  3490  		mem := v_2
  3491  		v.reset(OpPPC64MOVBstore)
  3492  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3493  		v0.AddArg2(src, mem)
  3494  		v.AddArg3(dst, v0, mem)
  3495  		return true
  3496  	}
  3497  	// match: (Move [2] dst src mem)
  3498  	// result: (MOVHstore dst (MOVHZload src mem) mem)
  3499  	for {
  3500  		if auxIntToInt64(v.AuxInt) != 2 {
  3501  			break
  3502  		}
  3503  		dst := v_0
  3504  		src := v_1
  3505  		mem := v_2
  3506  		v.reset(OpPPC64MOVHstore)
  3507  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3508  		v0.AddArg2(src, mem)
  3509  		v.AddArg3(dst, v0, mem)
  3510  		return true
  3511  	}
  3512  	// match: (Move [4] dst src mem)
  3513  	// result: (MOVWstore dst (MOVWZload src mem) mem)
  3514  	for {
  3515  		if auxIntToInt64(v.AuxInt) != 4 {
  3516  			break
  3517  		}
  3518  		dst := v_0
  3519  		src := v_1
  3520  		mem := v_2
  3521  		v.reset(OpPPC64MOVWstore)
  3522  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3523  		v0.AddArg2(src, mem)
  3524  		v.AddArg3(dst, v0, mem)
  3525  		return true
  3526  	}
  3527  	// match: (Move [8] {t} dst src mem)
  3528  	// cond: t.Alignment()%4 == 0
  3529  	// result: (MOVDstore dst (MOVDload src mem) mem)
  3530  	for {
  3531  		if auxIntToInt64(v.AuxInt) != 8 {
  3532  			break
  3533  		}
  3534  		t := auxToType(v.Aux)
  3535  		dst := v_0
  3536  		src := v_1
  3537  		mem := v_2
  3538  		if !(t.Alignment()%4 == 0) {
  3539  			break
  3540  		}
  3541  		v.reset(OpPPC64MOVDstore)
  3542  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, typ.Int64)
  3543  		v0.AddArg2(src, mem)
  3544  		v.AddArg3(dst, v0, mem)
  3545  		return true
  3546  	}
  3547  	// match: (Move [8] dst src mem)
  3548  	// result: (MOVWstore [4] dst (MOVWZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
  3549  	for {
  3550  		if auxIntToInt64(v.AuxInt) != 8 {
  3551  			break
  3552  		}
  3553  		dst := v_0
  3554  		src := v_1
  3555  		mem := v_2
  3556  		v.reset(OpPPC64MOVWstore)
  3557  		v.AuxInt = int32ToAuxInt(4)
  3558  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3559  		v0.AuxInt = int32ToAuxInt(4)
  3560  		v0.AddArg2(src, mem)
  3561  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3562  		v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3563  		v2.AddArg2(src, mem)
  3564  		v1.AddArg3(dst, v2, mem)
  3565  		v.AddArg3(dst, v0, v1)
  3566  		return true
  3567  	}
  3568  	// match: (Move [3] dst src mem)
  3569  	// result: (MOVBstore [2] dst (MOVBZload [2] src mem) (MOVHstore dst (MOVHload src mem) mem))
  3570  	for {
  3571  		if auxIntToInt64(v.AuxInt) != 3 {
  3572  			break
  3573  		}
  3574  		dst := v_0
  3575  		src := v_1
  3576  		mem := v_2
  3577  		v.reset(OpPPC64MOVBstore)
  3578  		v.AuxInt = int32ToAuxInt(2)
  3579  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3580  		v0.AuxInt = int32ToAuxInt(2)
  3581  		v0.AddArg2(src, mem)
  3582  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
  3583  		v2 := b.NewValue0(v.Pos, OpPPC64MOVHload, typ.Int16)
  3584  		v2.AddArg2(src, mem)
  3585  		v1.AddArg3(dst, v2, mem)
  3586  		v.AddArg3(dst, v0, v1)
  3587  		return true
  3588  	}
  3589  	// match: (Move [5] dst src mem)
  3590  	// result: (MOVBstore [4] dst (MOVBZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
  3591  	for {
  3592  		if auxIntToInt64(v.AuxInt) != 5 {
  3593  			break
  3594  		}
  3595  		dst := v_0
  3596  		src := v_1
  3597  		mem := v_2
  3598  		v.reset(OpPPC64MOVBstore)
  3599  		v.AuxInt = int32ToAuxInt(4)
  3600  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3601  		v0.AuxInt = int32ToAuxInt(4)
  3602  		v0.AddArg2(src, mem)
  3603  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3604  		v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3605  		v2.AddArg2(src, mem)
  3606  		v1.AddArg3(dst, v2, mem)
  3607  		v.AddArg3(dst, v0, v1)
  3608  		return true
  3609  	}
  3610  	// match: (Move [6] dst src mem)
  3611  	// result: (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
  3612  	for {
  3613  		if auxIntToInt64(v.AuxInt) != 6 {
  3614  			break
  3615  		}
  3616  		dst := v_0
  3617  		src := v_1
  3618  		mem := v_2
  3619  		v.reset(OpPPC64MOVHstore)
  3620  		v.AuxInt = int32ToAuxInt(4)
  3621  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3622  		v0.AuxInt = int32ToAuxInt(4)
  3623  		v0.AddArg2(src, mem)
  3624  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3625  		v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3626  		v2.AddArg2(src, mem)
  3627  		v1.AddArg3(dst, v2, mem)
  3628  		v.AddArg3(dst, v0, v1)
  3629  		return true
  3630  	}
  3631  	// match: (Move [7] dst src mem)
  3632  	// result: (MOVBstore [6] dst (MOVBZload [6] src mem) (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem)))
  3633  	for {
  3634  		if auxIntToInt64(v.AuxInt) != 7 {
  3635  			break
  3636  		}
  3637  		dst := v_0
  3638  		src := v_1
  3639  		mem := v_2
  3640  		v.reset(OpPPC64MOVBstore)
  3641  		v.AuxInt = int32ToAuxInt(6)
  3642  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3643  		v0.AuxInt = int32ToAuxInt(6)
  3644  		v0.AddArg2(src, mem)
  3645  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
  3646  		v1.AuxInt = int32ToAuxInt(4)
  3647  		v2 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3648  		v2.AuxInt = int32ToAuxInt(4)
  3649  		v2.AddArg2(src, mem)
  3650  		v3 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3651  		v4 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3652  		v4.AddArg2(src, mem)
  3653  		v3.AddArg3(dst, v4, mem)
  3654  		v1.AddArg3(dst, v2, v3)
  3655  		v.AddArg3(dst, v0, v1)
  3656  		return true
  3657  	}
  3658  	// match: (Move [s] dst src mem)
  3659  	// cond: s > 8 && objabi.GOPPC64 <= 8 && logLargeCopy(v, s)
  3660  	// result: (LoweredMove [s] dst src mem)
  3661  	for {
  3662  		s := auxIntToInt64(v.AuxInt)
  3663  		dst := v_0
  3664  		src := v_1
  3665  		mem := v_2
  3666  		if !(s > 8 && objabi.GOPPC64 <= 8 && logLargeCopy(v, s)) {
  3667  			break
  3668  		}
  3669  		v.reset(OpPPC64LoweredMove)
  3670  		v.AuxInt = int64ToAuxInt(s)
  3671  		v.AddArg3(dst, src, mem)
  3672  		return true
  3673  	}
  3674  	// match: (Move [s] dst src mem)
  3675  	// cond: s > 8 && s <= 64 && objabi.GOPPC64 >= 9
  3676  	// result: (LoweredQuadMoveShort [s] dst src mem)
  3677  	for {
  3678  		s := auxIntToInt64(v.AuxInt)
  3679  		dst := v_0
  3680  		src := v_1
  3681  		mem := v_2
  3682  		if !(s > 8 && s <= 64 && objabi.GOPPC64 >= 9) {
  3683  			break
  3684  		}
  3685  		v.reset(OpPPC64LoweredQuadMoveShort)
  3686  		v.AuxInt = int64ToAuxInt(s)
  3687  		v.AddArg3(dst, src, mem)
  3688  		return true
  3689  	}
  3690  	// match: (Move [s] dst src mem)
  3691  	// cond: s > 8 && objabi.GOPPC64 >= 9 && logLargeCopy(v, s)
  3692  	// result: (LoweredQuadMove [s] dst src mem)
  3693  	for {
  3694  		s := auxIntToInt64(v.AuxInt)
  3695  		dst := v_0
  3696  		src := v_1
  3697  		mem := v_2
  3698  		if !(s > 8 && objabi.GOPPC64 >= 9 && logLargeCopy(v, s)) {
  3699  			break
  3700  		}
  3701  		v.reset(OpPPC64LoweredQuadMove)
  3702  		v.AuxInt = int64ToAuxInt(s)
  3703  		v.AddArg3(dst, src, mem)
  3704  		return true
  3705  	}
  3706  	return false
  3707  }
  3708  func rewriteValuePPC64_OpNeq16(v *Value) bool {
  3709  	v_1 := v.Args[1]
  3710  	v_0 := v.Args[0]
  3711  	b := v.Block
  3712  	typ := &b.Func.Config.Types
  3713  	// match: (Neq16 x y)
  3714  	// cond: isSigned(x.Type) && isSigned(y.Type)
  3715  	// result: (NotEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  3716  	for {
  3717  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  3718  			x := v_0
  3719  			y := v_1
  3720  			if !(isSigned(x.Type) && isSigned(y.Type)) {
  3721  				continue
  3722  			}
  3723  			v.reset(OpPPC64NotEqual)
  3724  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3725  			v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3726  			v1.AddArg(x)
  3727  			v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3728  			v2.AddArg(y)
  3729  			v0.AddArg2(v1, v2)
  3730  			v.AddArg(v0)
  3731  			return true
  3732  		}
  3733  		break
  3734  	}
  3735  	// match: (Neq16 x y)
  3736  	// result: (NotEqual (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
  3737  	for {
  3738  		x := v_0
  3739  		y := v_1
  3740  		v.reset(OpPPC64NotEqual)
  3741  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3742  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3743  		v1.AddArg(x)
  3744  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3745  		v2.AddArg(y)
  3746  		v0.AddArg2(v1, v2)
  3747  		v.AddArg(v0)
  3748  		return true
  3749  	}
  3750  }
  3751  func rewriteValuePPC64_OpNeq32(v *Value) bool {
  3752  	v_1 := v.Args[1]
  3753  	v_0 := v.Args[0]
  3754  	b := v.Block
  3755  	// match: (Neq32 x y)
  3756  	// result: (NotEqual (CMPW x y))
  3757  	for {
  3758  		x := v_0
  3759  		y := v_1
  3760  		v.reset(OpPPC64NotEqual)
  3761  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3762  		v0.AddArg2(x, y)
  3763  		v.AddArg(v0)
  3764  		return true
  3765  	}
  3766  }
  3767  func rewriteValuePPC64_OpNeq32F(v *Value) bool {
  3768  	v_1 := v.Args[1]
  3769  	v_0 := v.Args[0]
  3770  	b := v.Block
  3771  	// match: (Neq32F x y)
  3772  	// result: (NotEqual (FCMPU x y))
  3773  	for {
  3774  		x := v_0
  3775  		y := v_1
  3776  		v.reset(OpPPC64NotEqual)
  3777  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  3778  		v0.AddArg2(x, y)
  3779  		v.AddArg(v0)
  3780  		return true
  3781  	}
  3782  }
  3783  func rewriteValuePPC64_OpNeq64(v *Value) bool {
  3784  	v_1 := v.Args[1]
  3785  	v_0 := v.Args[0]
  3786  	b := v.Block
  3787  	// match: (Neq64 x y)
  3788  	// result: (NotEqual (CMP x y))
  3789  	for {
  3790  		x := v_0
  3791  		y := v_1
  3792  		v.reset(OpPPC64NotEqual)
  3793  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  3794  		v0.AddArg2(x, y)
  3795  		v.AddArg(v0)
  3796  		return true
  3797  	}
  3798  }
  3799  func rewriteValuePPC64_OpNeq64F(v *Value) bool {
  3800  	v_1 := v.Args[1]
  3801  	v_0 := v.Args[0]
  3802  	b := v.Block
  3803  	// match: (Neq64F x y)
  3804  	// result: (NotEqual (FCMPU x y))
  3805  	for {
  3806  		x := v_0
  3807  		y := v_1
  3808  		v.reset(OpPPC64NotEqual)
  3809  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  3810  		v0.AddArg2(x, y)
  3811  		v.AddArg(v0)
  3812  		return true
  3813  	}
  3814  }
  3815  func rewriteValuePPC64_OpNeq8(v *Value) bool {
  3816  	v_1 := v.Args[1]
  3817  	v_0 := v.Args[0]
  3818  	b := v.Block
  3819  	typ := &b.Func.Config.Types
  3820  	// match: (Neq8 x y)
  3821  	// cond: isSigned(x.Type) && isSigned(y.Type)
  3822  	// result: (NotEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  3823  	for {
  3824  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  3825  			x := v_0
  3826  			y := v_1
  3827  			if !(isSigned(x.Type) && isSigned(y.Type)) {
  3828  				continue
  3829  			}
  3830  			v.reset(OpPPC64NotEqual)
  3831  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3832  			v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3833  			v1.AddArg(x)
  3834  			v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3835  			v2.AddArg(y)
  3836  			v0.AddArg2(v1, v2)
  3837  			v.AddArg(v0)
  3838  			return true
  3839  		}
  3840  		break
  3841  	}
  3842  	// match: (Neq8 x y)
  3843  	// result: (NotEqual (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
  3844  	for {
  3845  		x := v_0
  3846  		y := v_1
  3847  		v.reset(OpPPC64NotEqual)
  3848  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3849  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3850  		v1.AddArg(x)
  3851  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3852  		v2.AddArg(y)
  3853  		v0.AddArg2(v1, v2)
  3854  		v.AddArg(v0)
  3855  		return true
  3856  	}
  3857  }
  3858  func rewriteValuePPC64_OpNeqPtr(v *Value) bool {
  3859  	v_1 := v.Args[1]
  3860  	v_0 := v.Args[0]
  3861  	b := v.Block
  3862  	// match: (NeqPtr x y)
  3863  	// result: (NotEqual (CMP x y))
  3864  	for {
  3865  		x := v_0
  3866  		y := v_1
  3867  		v.reset(OpPPC64NotEqual)
  3868  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  3869  		v0.AddArg2(x, y)
  3870  		v.AddArg(v0)
  3871  		return true
  3872  	}
  3873  }
  3874  func rewriteValuePPC64_OpNot(v *Value) bool {
  3875  	v_0 := v.Args[0]
  3876  	// match: (Not x)
  3877  	// result: (XORconst [1] x)
  3878  	for {
  3879  		x := v_0
  3880  		v.reset(OpPPC64XORconst)
  3881  		v.AuxInt = int64ToAuxInt(1)
  3882  		v.AddArg(x)
  3883  		return true
  3884  	}
  3885  }
  3886  func rewriteValuePPC64_OpOffPtr(v *Value) bool {
  3887  	v_0 := v.Args[0]
  3888  	b := v.Block
  3889  	typ := &b.Func.Config.Types
  3890  	// match: (OffPtr [off] ptr)
  3891  	// result: (ADD (MOVDconst <typ.Int64> [off]) ptr)
  3892  	for {
  3893  		off := auxIntToInt64(v.AuxInt)
  3894  		ptr := v_0
  3895  		v.reset(OpPPC64ADD)
  3896  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3897  		v0.AuxInt = int64ToAuxInt(off)
  3898  		v.AddArg2(v0, ptr)
  3899  		return true
  3900  	}
  3901  }
  3902  func rewriteValuePPC64_OpPPC64ADD(v *Value) bool {
  3903  	v_1 := v.Args[1]
  3904  	v_0 := v.Args[0]
  3905  	b := v.Block
  3906  	typ := &b.Func.Config.Types
  3907  	// match: (ADD l:(MULLD x y) z)
  3908  	// cond: objabi.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)
  3909  	// result: (MADDLD x y z)
  3910  	for {
  3911  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  3912  			l := v_0
  3913  			if l.Op != OpPPC64MULLD {
  3914  				continue
  3915  			}
  3916  			y := l.Args[1]
  3917  			x := l.Args[0]
  3918  			z := v_1
  3919  			if !(objabi.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
  3920  				continue
  3921  			}
  3922  			v.reset(OpPPC64MADDLD)
  3923  			v.AddArg3(x, y, z)
  3924  			return true
  3925  		}
  3926  		break
  3927  	}
  3928  	// match: (ADD (SLDconst x [c]) (SRDconst x [d]))
  3929  	// cond: d == 64-c
  3930  	// result: (ROTLconst [c] x)
  3931  	for {
  3932  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  3933  			if v_0.Op != OpPPC64SLDconst {
  3934  				continue
  3935  			}
  3936  			c := auxIntToInt64(v_0.AuxInt)
  3937  			x := v_0.Args[0]
  3938  			if v_1.Op != OpPPC64SRDconst {
  3939  				continue
  3940  			}
  3941  			d := auxIntToInt64(v_1.AuxInt)
  3942  			if x != v_1.Args[0] || !(d == 64-c) {
  3943  				continue
  3944  			}
  3945  			v.reset(OpPPC64ROTLconst)
  3946  			v.AuxInt = int64ToAuxInt(c)
  3947  			v.AddArg(x)
  3948  			return true
  3949  		}
  3950  		break
  3951  	}
  3952  	// match: (ADD (SLWconst x [c]) (SRWconst x [d]))
  3953  	// cond: d == 32-c
  3954  	// result: (ROTLWconst [c] x)
  3955  	for {
  3956  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  3957  			if v_0.Op != OpPPC64SLWconst {
  3958  				continue
  3959  			}
  3960  			c := auxIntToInt64(v_0.AuxInt)
  3961  			x := v_0.Args[0]
  3962  			if v_1.Op != OpPPC64SRWconst {
  3963  				continue
  3964  			}
  3965  			d := auxIntToInt64(v_1.AuxInt)
  3966  			if x != v_1.Args[0] || !(d == 32-c) {
  3967  				continue
  3968  			}
  3969  			v.reset(OpPPC64ROTLWconst)
  3970  			v.AuxInt = int64ToAuxInt(c)
  3971  			v.AddArg(x)
  3972  			return true
  3973  		}
  3974  		break
  3975  	}
  3976  	// match: (ADD (SLD x (ANDconst <typ.Int64> [63] y)) (SRD x (SUB <typ.UInt> (MOVDconst [64]) (ANDconst <typ.UInt> [63] y))))
  3977  	// result: (ROTL x y)
  3978  	for {
  3979  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  3980  			if v_0.Op != OpPPC64SLD {
  3981  				continue
  3982  			}
  3983  			_ = v_0.Args[1]
  3984  			x := v_0.Args[0]
  3985  			v_0_1 := v_0.Args[1]
  3986  			if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int64 || auxIntToInt64(v_0_1.AuxInt) != 63 {
  3987  				continue
  3988  			}
  3989  			y := v_0_1.Args[0]
  3990  			if v_1.Op != OpPPC64SRD {
  3991  				continue
  3992  			}
  3993  			_ = v_1.Args[1]
  3994  			if x != v_1.Args[0] {
  3995  				continue
  3996  			}
  3997  			v_1_1 := v_1.Args[1]
  3998  			if v_1_1.Op != OpPPC64SUB || v_1_1.Type != typ.UInt {
  3999  				continue
  4000  			}
  4001  			_ = v_1_1.Args[1]
  4002  			v_1_1_0 := v_1_1.Args[0]
  4003  			if v_1_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1_0.AuxInt) != 64 {
  4004  				continue
  4005  			}
  4006  			v_1_1_1 := v_1_1.Args[1]
  4007  			if v_1_1_1.Op != OpPPC64ANDconst || v_1_1_1.Type != typ.UInt || auxIntToInt64(v_1_1_1.AuxInt) != 63 || y != v_1_1_1.Args[0] {
  4008  				continue
  4009  			}
  4010  			v.reset(OpPPC64ROTL)
  4011  			v.AddArg2(x, y)
  4012  			return true
  4013  		}
  4014  		break
  4015  	}
  4016  	// match: (ADD (SLD x (ANDconst <typ.Int64> [63] y)) (SRD x (SUBFCconst <typ.UInt> [64] (ANDconst <typ.UInt> [63] y))))
  4017  	// result: (ROTL x y)
  4018  	for {
  4019  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4020  			if v_0.Op != OpPPC64SLD {
  4021  				continue
  4022  			}
  4023  			_ = v_0.Args[1]
  4024  			x := v_0.Args[0]
  4025  			v_0_1 := v_0.Args[1]
  4026  			if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int64 || auxIntToInt64(v_0_1.AuxInt) != 63 {
  4027  				continue
  4028  			}
  4029  			y := v_0_1.Args[0]
  4030  			if v_1.Op != OpPPC64SRD {
  4031  				continue
  4032  			}
  4033  			_ = v_1.Args[1]
  4034  			if x != v_1.Args[0] {
  4035  				continue
  4036  			}
  4037  			v_1_1 := v_1.Args[1]
  4038  			if v_1_1.Op != OpPPC64SUBFCconst || v_1_1.Type != typ.UInt || auxIntToInt64(v_1_1.AuxInt) != 64 {
  4039  				continue
  4040  			}
  4041  			v_1_1_0 := v_1_1.Args[0]
  4042  			if v_1_1_0.Op != OpPPC64ANDconst || v_1_1_0.Type != typ.UInt || auxIntToInt64(v_1_1_0.AuxInt) != 63 || y != v_1_1_0.Args[0] {
  4043  				continue
  4044  			}
  4045  			v.reset(OpPPC64ROTL)
  4046  			v.AddArg2(x, y)
  4047  			return true
  4048  		}
  4049  		break
  4050  	}
  4051  	// match: (ADD (SLW x (ANDconst <typ.Int32> [31] y)) (SRW x (SUBFCconst <typ.UInt> [32] (ANDconst <typ.UInt> [31] y))))
  4052  	// result: (ROTLW x y)
  4053  	for {
  4054  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4055  			if v_0.Op != OpPPC64SLW {
  4056  				continue
  4057  			}
  4058  			_ = v_0.Args[1]
  4059  			x := v_0.Args[0]
  4060  			v_0_1 := v_0.Args[1]
  4061  			if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int32 || auxIntToInt64(v_0_1.AuxInt) != 31 {
  4062  				continue
  4063  			}
  4064  			y := v_0_1.Args[0]
  4065  			if v_1.Op != OpPPC64SRW {
  4066  				continue
  4067  			}
  4068  			_ = v_1.Args[1]
  4069  			if x != v_1.Args[0] {
  4070  				continue
  4071  			}
  4072  			v_1_1 := v_1.Args[1]
  4073  			if v_1_1.Op != OpPPC64SUBFCconst || v_1_1.Type != typ.UInt || auxIntToInt64(v_1_1.AuxInt) != 32 {
  4074  				continue
  4075  			}
  4076  			v_1_1_0 := v_1_1.Args[0]
  4077  			if v_1_1_0.Op != OpPPC64ANDconst || v_1_1_0.Type != typ.UInt || auxIntToInt64(v_1_1_0.AuxInt) != 31 || y != v_1_1_0.Args[0] {
  4078  				continue
  4079  			}
  4080  			v.reset(OpPPC64ROTLW)
  4081  			v.AddArg2(x, y)
  4082  			return true
  4083  		}
  4084  		break
  4085  	}
  4086  	// match: (ADD (SLW x (ANDconst <typ.Int32> [31] y)) (SRW x (SUB <typ.UInt> (MOVDconst [32]) (ANDconst <typ.UInt> [31] y))))
  4087  	// result: (ROTLW x y)
  4088  	for {
  4089  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4090  			if v_0.Op != OpPPC64SLW {
  4091  				continue
  4092  			}
  4093  			_ = v_0.Args[1]
  4094  			x := v_0.Args[0]
  4095  			v_0_1 := v_0.Args[1]
  4096  			if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int32 || auxIntToInt64(v_0_1.AuxInt) != 31 {
  4097  				continue
  4098  			}
  4099  			y := v_0_1.Args[0]
  4100  			if v_1.Op != OpPPC64SRW {
  4101  				continue
  4102  			}
  4103  			_ = v_1.Args[1]
  4104  			if x != v_1.Args[0] {
  4105  				continue
  4106  			}
  4107  			v_1_1 := v_1.Args[1]
  4108  			if v_1_1.Op != OpPPC64SUB || v_1_1.Type != typ.UInt {
  4109  				continue
  4110  			}
  4111  			_ = v_1_1.Args[1]
  4112  			v_1_1_0 := v_1_1.Args[0]
  4113  			if v_1_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1_0.AuxInt) != 32 {
  4114  				continue
  4115  			}
  4116  			v_1_1_1 := v_1_1.Args[1]
  4117  			if v_1_1_1.Op != OpPPC64ANDconst || v_1_1_1.Type != typ.UInt || auxIntToInt64(v_1_1_1.AuxInt) != 31 || y != v_1_1_1.Args[0] {
  4118  				continue
  4119  			}
  4120  			v.reset(OpPPC64ROTLW)
  4121  			v.AddArg2(x, y)
  4122  			return true
  4123  		}
  4124  		break
  4125  	}
  4126  	// match: (ADD x (MOVDconst [c]))
  4127  	// cond: is32Bit(c)
  4128  	// result: (ADDconst [c] x)
  4129  	for {
  4130  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4131  			x := v_0
  4132  			if v_1.Op != OpPPC64MOVDconst {
  4133  				continue
  4134  			}
  4135  			c := auxIntToInt64(v_1.AuxInt)
  4136  			if !(is32Bit(c)) {
  4137  				continue
  4138  			}
  4139  			v.reset(OpPPC64ADDconst)
  4140  			v.AuxInt = int64ToAuxInt(c)
  4141  			v.AddArg(x)
  4142  			return true
  4143  		}
  4144  		break
  4145  	}
  4146  	return false
  4147  }
  4148  func rewriteValuePPC64_OpPPC64ADDconst(v *Value) bool {
  4149  	v_0 := v.Args[0]
  4150  	// match: (ADDconst [c] (ADDconst [d] x))
  4151  	// cond: is32Bit(c+d)
  4152  	// result: (ADDconst [c+d] x)
  4153  	for {
  4154  		c := auxIntToInt64(v.AuxInt)
  4155  		if v_0.Op != OpPPC64ADDconst {
  4156  			break
  4157  		}
  4158  		d := auxIntToInt64(v_0.AuxInt)
  4159  		x := v_0.Args[0]
  4160  		if !(is32Bit(c + d)) {
  4161  			break
  4162  		}
  4163  		v.reset(OpPPC64ADDconst)
  4164  		v.AuxInt = int64ToAuxInt(c + d)
  4165  		v.AddArg(x)
  4166  		return true
  4167  	}
  4168  	// match: (ADDconst [0] x)
  4169  	// result: x
  4170  	for {
  4171  		if auxIntToInt64(v.AuxInt) != 0 {
  4172  			break
  4173  		}
  4174  		x := v_0
  4175  		v.copyOf(x)
  4176  		return true
  4177  	}
  4178  	// match: (ADDconst [c] (MOVDaddr [d] {sym} x))
  4179  	// cond: is32Bit(c+int64(d))
  4180  	// result: (MOVDaddr [int32(c+int64(d))] {sym} x)
  4181  	for {
  4182  		c := auxIntToInt64(v.AuxInt)
  4183  		if v_0.Op != OpPPC64MOVDaddr {
  4184  			break
  4185  		}
  4186  		d := auxIntToInt32(v_0.AuxInt)
  4187  		sym := auxToSym(v_0.Aux)
  4188  		x := v_0.Args[0]
  4189  		if !(is32Bit(c + int64(d))) {
  4190  			break
  4191  		}
  4192  		v.reset(OpPPC64MOVDaddr)
  4193  		v.AuxInt = int32ToAuxInt(int32(c + int64(d)))
  4194  		v.Aux = symToAux(sym)
  4195  		v.AddArg(x)
  4196  		return true
  4197  	}
  4198  	// match: (ADDconst [c] x:(SP))
  4199  	// cond: is32Bit(c)
  4200  	// result: (MOVDaddr [int32(c)] x)
  4201  	for {
  4202  		c := auxIntToInt64(v.AuxInt)
  4203  		x := v_0
  4204  		if x.Op != OpSP || !(is32Bit(c)) {
  4205  			break
  4206  		}
  4207  		v.reset(OpPPC64MOVDaddr)
  4208  		v.AuxInt = int32ToAuxInt(int32(c))
  4209  		v.AddArg(x)
  4210  		return true
  4211  	}
  4212  	// match: (ADDconst [c] (SUBFCconst [d] x))
  4213  	// cond: is32Bit(c+d)
  4214  	// result: (SUBFCconst [c+d] x)
  4215  	for {
  4216  		c := auxIntToInt64(v.AuxInt)
  4217  		if v_0.Op != OpPPC64SUBFCconst {
  4218  			break
  4219  		}
  4220  		d := auxIntToInt64(v_0.AuxInt)
  4221  		x := v_0.Args[0]
  4222  		if !(is32Bit(c + d)) {
  4223  			break
  4224  		}
  4225  		v.reset(OpPPC64SUBFCconst)
  4226  		v.AuxInt = int64ToAuxInt(c + d)
  4227  		v.AddArg(x)
  4228  		return true
  4229  	}
  4230  	return false
  4231  }
  4232  func rewriteValuePPC64_OpPPC64AND(v *Value) bool {
  4233  	v_1 := v.Args[1]
  4234  	v_0 := v.Args[0]
  4235  	// match: (AND (MOVDconst [m]) (ROTLWconst [r] x))
  4236  	// cond: isPPC64WordRotateMask(m)
  4237  	// result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
  4238  	for {
  4239  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4240  			if v_0.Op != OpPPC64MOVDconst {
  4241  				continue
  4242  			}
  4243  			m := auxIntToInt64(v_0.AuxInt)
  4244  			if v_1.Op != OpPPC64ROTLWconst {
  4245  				continue
  4246  			}
  4247  			r := auxIntToInt64(v_1.AuxInt)
  4248  			x := v_1.Args[0]
  4249  			if !(isPPC64WordRotateMask(m)) {
  4250  				continue
  4251  			}
  4252  			v.reset(OpPPC64RLWINM)
  4253  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
  4254  			v.AddArg(x)
  4255  			return true
  4256  		}
  4257  		break
  4258  	}
  4259  	// match: (AND (MOVDconst [m]) (ROTLW x r))
  4260  	// cond: isPPC64WordRotateMask(m)
  4261  	// result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
  4262  	for {
  4263  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4264  			if v_0.Op != OpPPC64MOVDconst {
  4265  				continue
  4266  			}
  4267  			m := auxIntToInt64(v_0.AuxInt)
  4268  			if v_1.Op != OpPPC64ROTLW {
  4269  				continue
  4270  			}
  4271  			r := v_1.Args[1]
  4272  			x := v_1.Args[0]
  4273  			if !(isPPC64WordRotateMask(m)) {
  4274  				continue
  4275  			}
  4276  			v.reset(OpPPC64RLWNM)
  4277  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
  4278  			v.AddArg2(x, r)
  4279  			return true
  4280  		}
  4281  		break
  4282  	}
  4283  	// match: (AND (MOVDconst [m]) (SRWconst x [s]))
  4284  	// cond: mergePPC64RShiftMask(m,s,32) == 0
  4285  	// result: (MOVDconst [0])
  4286  	for {
  4287  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4288  			if v_0.Op != OpPPC64MOVDconst {
  4289  				continue
  4290  			}
  4291  			m := auxIntToInt64(v_0.AuxInt)
  4292  			if v_1.Op != OpPPC64SRWconst {
  4293  				continue
  4294  			}
  4295  			s := auxIntToInt64(v_1.AuxInt)
  4296  			if !(mergePPC64RShiftMask(m, s, 32) == 0) {
  4297  				continue
  4298  			}
  4299  			v.reset(OpPPC64MOVDconst)
  4300  			v.AuxInt = int64ToAuxInt(0)
  4301  			return true
  4302  		}
  4303  		break
  4304  	}
  4305  	// match: (AND (MOVDconst [m]) (SRWconst x [s]))
  4306  	// cond: mergePPC64AndSrwi(m,s) != 0
  4307  	// result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
  4308  	for {
  4309  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4310  			if v_0.Op != OpPPC64MOVDconst {
  4311  				continue
  4312  			}
  4313  			m := auxIntToInt64(v_0.AuxInt)
  4314  			if v_1.Op != OpPPC64SRWconst {
  4315  				continue
  4316  			}
  4317  			s := auxIntToInt64(v_1.AuxInt)
  4318  			x := v_1.Args[0]
  4319  			if !(mergePPC64AndSrwi(m, s) != 0) {
  4320  				continue
  4321  			}
  4322  			v.reset(OpPPC64RLWINM)
  4323  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
  4324  			v.AddArg(x)
  4325  			return true
  4326  		}
  4327  		break
  4328  	}
  4329  	// match: (AND x (NOR y y))
  4330  	// result: (ANDN x y)
  4331  	for {
  4332  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4333  			x := v_0
  4334  			if v_1.Op != OpPPC64NOR {
  4335  				continue
  4336  			}
  4337  			y := v_1.Args[1]
  4338  			if y != v_1.Args[0] {
  4339  				continue
  4340  			}
  4341  			v.reset(OpPPC64ANDN)
  4342  			v.AddArg2(x, y)
  4343  			return true
  4344  		}
  4345  		break
  4346  	}
  4347  	// match: (AND (MOVDconst [c]) (MOVDconst [d]))
  4348  	// result: (MOVDconst [c&d])
  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  			c := auxIntToInt64(v_0.AuxInt)
  4355  			if v_1.Op != OpPPC64MOVDconst {
  4356  				continue
  4357  			}
  4358  			d := auxIntToInt64(v_1.AuxInt)
  4359  			v.reset(OpPPC64MOVDconst)
  4360  			v.AuxInt = int64ToAuxInt(c & d)
  4361  			return true
  4362  		}
  4363  		break
  4364  	}
  4365  	// match: (AND x (MOVDconst [c]))
  4366  	// cond: isU16Bit(c)
  4367  	// result: (ANDconst [c] x)
  4368  	for {
  4369  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4370  			x := v_0
  4371  			if v_1.Op != OpPPC64MOVDconst {
  4372  				continue
  4373  			}
  4374  			c := auxIntToInt64(v_1.AuxInt)
  4375  			if !(isU16Bit(c)) {
  4376  				continue
  4377  			}
  4378  			v.reset(OpPPC64ANDconst)
  4379  			v.AuxInt = int64ToAuxInt(c)
  4380  			v.AddArg(x)
  4381  			return true
  4382  		}
  4383  		break
  4384  	}
  4385  	// match: (AND (MOVDconst [c]) y:(MOVWZreg _))
  4386  	// cond: c&0xFFFFFFFF == 0xFFFFFFFF
  4387  	// result: y
  4388  	for {
  4389  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4390  			if v_0.Op != OpPPC64MOVDconst {
  4391  				continue
  4392  			}
  4393  			c := auxIntToInt64(v_0.AuxInt)
  4394  			y := v_1
  4395  			if y.Op != OpPPC64MOVWZreg || !(c&0xFFFFFFFF == 0xFFFFFFFF) {
  4396  				continue
  4397  			}
  4398  			v.copyOf(y)
  4399  			return true
  4400  		}
  4401  		break
  4402  	}
  4403  	// match: (AND (MOVDconst [0xFFFFFFFF]) y:(MOVWreg x))
  4404  	// result: (MOVWZreg x)
  4405  	for {
  4406  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4407  			if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0xFFFFFFFF {
  4408  				continue
  4409  			}
  4410  			y := v_1
  4411  			if y.Op != OpPPC64MOVWreg {
  4412  				continue
  4413  			}
  4414  			x := y.Args[0]
  4415  			v.reset(OpPPC64MOVWZreg)
  4416  			v.AddArg(x)
  4417  			return true
  4418  		}
  4419  		break
  4420  	}
  4421  	// match: (AND (MOVDconst [c]) x:(MOVBZload _ _))
  4422  	// result: (ANDconst [c&0xFF] x)
  4423  	for {
  4424  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4425  			if v_0.Op != OpPPC64MOVDconst {
  4426  				continue
  4427  			}
  4428  			c := auxIntToInt64(v_0.AuxInt)
  4429  			x := v_1
  4430  			if x.Op != OpPPC64MOVBZload {
  4431  				continue
  4432  			}
  4433  			v.reset(OpPPC64ANDconst)
  4434  			v.AuxInt = int64ToAuxInt(c & 0xFF)
  4435  			v.AddArg(x)
  4436  			return true
  4437  		}
  4438  		break
  4439  	}
  4440  	return false
  4441  }
  4442  func rewriteValuePPC64_OpPPC64ANDN(v *Value) bool {
  4443  	v_1 := v.Args[1]
  4444  	v_0 := v.Args[0]
  4445  	// match: (ANDN (MOVDconst [c]) (MOVDconst [d]))
  4446  	// result: (MOVDconst [c&^d])
  4447  	for {
  4448  		if v_0.Op != OpPPC64MOVDconst {
  4449  			break
  4450  		}
  4451  		c := auxIntToInt64(v_0.AuxInt)
  4452  		if v_1.Op != OpPPC64MOVDconst {
  4453  			break
  4454  		}
  4455  		d := auxIntToInt64(v_1.AuxInt)
  4456  		v.reset(OpPPC64MOVDconst)
  4457  		v.AuxInt = int64ToAuxInt(c &^ d)
  4458  		return true
  4459  	}
  4460  	return false
  4461  }
  4462  func rewriteValuePPC64_OpPPC64ANDconst(v *Value) bool {
  4463  	v_0 := v.Args[0]
  4464  	// match: (ANDconst [m] (ROTLWconst [r] x))
  4465  	// cond: isPPC64WordRotateMask(m)
  4466  	// result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
  4467  	for {
  4468  		m := auxIntToInt64(v.AuxInt)
  4469  		if v_0.Op != OpPPC64ROTLWconst {
  4470  			break
  4471  		}
  4472  		r := auxIntToInt64(v_0.AuxInt)
  4473  		x := v_0.Args[0]
  4474  		if !(isPPC64WordRotateMask(m)) {
  4475  			break
  4476  		}
  4477  		v.reset(OpPPC64RLWINM)
  4478  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
  4479  		v.AddArg(x)
  4480  		return true
  4481  	}
  4482  	// match: (ANDconst [m] (ROTLW x r))
  4483  	// cond: isPPC64WordRotateMask(m)
  4484  	// result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
  4485  	for {
  4486  		m := auxIntToInt64(v.AuxInt)
  4487  		if v_0.Op != OpPPC64ROTLW {
  4488  			break
  4489  		}
  4490  		r := v_0.Args[1]
  4491  		x := v_0.Args[0]
  4492  		if !(isPPC64WordRotateMask(m)) {
  4493  			break
  4494  		}
  4495  		v.reset(OpPPC64RLWNM)
  4496  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
  4497  		v.AddArg2(x, r)
  4498  		return true
  4499  	}
  4500  	// match: (ANDconst [m] (SRWconst x [s]))
  4501  	// cond: mergePPC64RShiftMask(m,s,32) == 0
  4502  	// result: (MOVDconst [0])
  4503  	for {
  4504  		m := auxIntToInt64(v.AuxInt)
  4505  		if v_0.Op != OpPPC64SRWconst {
  4506  			break
  4507  		}
  4508  		s := auxIntToInt64(v_0.AuxInt)
  4509  		if !(mergePPC64RShiftMask(m, s, 32) == 0) {
  4510  			break
  4511  		}
  4512  		v.reset(OpPPC64MOVDconst)
  4513  		v.AuxInt = int64ToAuxInt(0)
  4514  		return true
  4515  	}
  4516  	// match: (ANDconst [m] (SRWconst x [s]))
  4517  	// cond: mergePPC64AndSrwi(m,s) != 0
  4518  	// result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
  4519  	for {
  4520  		m := auxIntToInt64(v.AuxInt)
  4521  		if v_0.Op != OpPPC64SRWconst {
  4522  			break
  4523  		}
  4524  		s := auxIntToInt64(v_0.AuxInt)
  4525  		x := v_0.Args[0]
  4526  		if !(mergePPC64AndSrwi(m, s) != 0) {
  4527  			break
  4528  		}
  4529  		v.reset(OpPPC64RLWINM)
  4530  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
  4531  		v.AddArg(x)
  4532  		return true
  4533  	}
  4534  	// match: (ANDconst [c] (ANDconst [d] x))
  4535  	// result: (ANDconst [c&d] x)
  4536  	for {
  4537  		c := auxIntToInt64(v.AuxInt)
  4538  		if v_0.Op != OpPPC64ANDconst {
  4539  			break
  4540  		}
  4541  		d := auxIntToInt64(v_0.AuxInt)
  4542  		x := v_0.Args[0]
  4543  		v.reset(OpPPC64ANDconst)
  4544  		v.AuxInt = int64ToAuxInt(c & d)
  4545  		v.AddArg(x)
  4546  		return true
  4547  	}
  4548  	// match: (ANDconst [-1] x)
  4549  	// result: x
  4550  	for {
  4551  		if auxIntToInt64(v.AuxInt) != -1 {
  4552  			break
  4553  		}
  4554  		x := v_0
  4555  		v.copyOf(x)
  4556  		return true
  4557  	}
  4558  	// match: (ANDconst [0] _)
  4559  	// result: (MOVDconst [0])
  4560  	for {
  4561  		if auxIntToInt64(v.AuxInt) != 0 {
  4562  			break
  4563  		}
  4564  		v.reset(OpPPC64MOVDconst)
  4565  		v.AuxInt = int64ToAuxInt(0)
  4566  		return true
  4567  	}
  4568  	// match: (ANDconst [c] y:(MOVBZreg _))
  4569  	// cond: c&0xFF == 0xFF
  4570  	// result: y
  4571  	for {
  4572  		c := auxIntToInt64(v.AuxInt)
  4573  		y := v_0
  4574  		if y.Op != OpPPC64MOVBZreg || !(c&0xFF == 0xFF) {
  4575  			break
  4576  		}
  4577  		v.copyOf(y)
  4578  		return true
  4579  	}
  4580  	// match: (ANDconst [0xFF] y:(MOVBreg _))
  4581  	// result: y
  4582  	for {
  4583  		if auxIntToInt64(v.AuxInt) != 0xFF {
  4584  			break
  4585  		}
  4586  		y := v_0
  4587  		if y.Op != OpPPC64MOVBreg {
  4588  			break
  4589  		}
  4590  		v.copyOf(y)
  4591  		return true
  4592  	}
  4593  	// match: (ANDconst [c] y:(MOVHZreg _))
  4594  	// cond: c&0xFFFF == 0xFFFF
  4595  	// result: y
  4596  	for {
  4597  		c := auxIntToInt64(v.AuxInt)
  4598  		y := v_0
  4599  		if y.Op != OpPPC64MOVHZreg || !(c&0xFFFF == 0xFFFF) {
  4600  			break
  4601  		}
  4602  		v.copyOf(y)
  4603  		return true
  4604  	}
  4605  	// match: (ANDconst [0xFFFF] y:(MOVHreg _))
  4606  	// result: y
  4607  	for {
  4608  		if auxIntToInt64(v.AuxInt) != 0xFFFF {
  4609  			break
  4610  		}
  4611  		y := v_0
  4612  		if y.Op != OpPPC64MOVHreg {
  4613  			break
  4614  		}
  4615  		v.copyOf(y)
  4616  		return true
  4617  	}
  4618  	// match: (ANDconst [c] (MOVBreg x))
  4619  	// result: (ANDconst [c&0xFF] x)
  4620  	for {
  4621  		c := auxIntToInt64(v.AuxInt)
  4622  		if v_0.Op != OpPPC64MOVBreg {
  4623  			break
  4624  		}
  4625  		x := v_0.Args[0]
  4626  		v.reset(OpPPC64ANDconst)
  4627  		v.AuxInt = int64ToAuxInt(c & 0xFF)
  4628  		v.AddArg(x)
  4629  		return true
  4630  	}
  4631  	// match: (ANDconst [c] (MOVBZreg x))
  4632  	// result: (ANDconst [c&0xFF] x)
  4633  	for {
  4634  		c := auxIntToInt64(v.AuxInt)
  4635  		if v_0.Op != OpPPC64MOVBZreg {
  4636  			break
  4637  		}
  4638  		x := v_0.Args[0]
  4639  		v.reset(OpPPC64ANDconst)
  4640  		v.AuxInt = int64ToAuxInt(c & 0xFF)
  4641  		v.AddArg(x)
  4642  		return true
  4643  	}
  4644  	// match: (ANDconst [c] (MOVHreg x))
  4645  	// result: (ANDconst [c&0xFFFF] x)
  4646  	for {
  4647  		c := auxIntToInt64(v.AuxInt)
  4648  		if v_0.Op != OpPPC64MOVHreg {
  4649  			break
  4650  		}
  4651  		x := v_0.Args[0]
  4652  		v.reset(OpPPC64ANDconst)
  4653  		v.AuxInt = int64ToAuxInt(c & 0xFFFF)
  4654  		v.AddArg(x)
  4655  		return true
  4656  	}
  4657  	// match: (ANDconst [c] (MOVHZreg x))
  4658  	// result: (ANDconst [c&0xFFFF] x)
  4659  	for {
  4660  		c := auxIntToInt64(v.AuxInt)
  4661  		if v_0.Op != OpPPC64MOVHZreg {
  4662  			break
  4663  		}
  4664  		x := v_0.Args[0]
  4665  		v.reset(OpPPC64ANDconst)
  4666  		v.AuxInt = int64ToAuxInt(c & 0xFFFF)
  4667  		v.AddArg(x)
  4668  		return true
  4669  	}
  4670  	// match: (ANDconst [c] (MOVWreg x))
  4671  	// result: (ANDconst [c&0xFFFFFFFF] x)
  4672  	for {
  4673  		c := auxIntToInt64(v.AuxInt)
  4674  		if v_0.Op != OpPPC64MOVWreg {
  4675  			break
  4676  		}
  4677  		x := v_0.Args[0]
  4678  		v.reset(OpPPC64ANDconst)
  4679  		v.AuxInt = int64ToAuxInt(c & 0xFFFFFFFF)
  4680  		v.AddArg(x)
  4681  		return true
  4682  	}
  4683  	// match: (ANDconst [c] (MOVWZreg x))
  4684  	// result: (ANDconst [c&0xFFFFFFFF] x)
  4685  	for {
  4686  		c := auxIntToInt64(v.AuxInt)
  4687  		if v_0.Op != OpPPC64MOVWZreg {
  4688  			break
  4689  		}
  4690  		x := v_0.Args[0]
  4691  		v.reset(OpPPC64ANDconst)
  4692  		v.AuxInt = int64ToAuxInt(c & 0xFFFFFFFF)
  4693  		v.AddArg(x)
  4694  		return true
  4695  	}
  4696  	return false
  4697  }
  4698  func rewriteValuePPC64_OpPPC64CLRLSLDI(v *Value) bool {
  4699  	v_0 := v.Args[0]
  4700  	// match: (CLRLSLDI [c] (SRWconst [s] x))
  4701  	// cond: mergePPC64ClrlsldiSrw(int64(c),s) != 0
  4702  	// result: (RLWINM [mergePPC64ClrlsldiSrw(int64(c),s)] x)
  4703  	for {
  4704  		c := auxIntToInt32(v.AuxInt)
  4705  		if v_0.Op != OpPPC64SRWconst {
  4706  			break
  4707  		}
  4708  		s := auxIntToInt64(v_0.AuxInt)
  4709  		x := v_0.Args[0]
  4710  		if !(mergePPC64ClrlsldiSrw(int64(c), s) != 0) {
  4711  			break
  4712  		}
  4713  		v.reset(OpPPC64RLWINM)
  4714  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrw(int64(c), s))
  4715  		v.AddArg(x)
  4716  		return true
  4717  	}
  4718  	// match: (CLRLSLDI [c] i:(RLWINM [s] x))
  4719  	// cond: mergePPC64ClrlsldiRlwinm(c,s) != 0
  4720  	// result: (RLWINM [mergePPC64ClrlsldiRlwinm(c,s)] x)
  4721  	for {
  4722  		c := auxIntToInt32(v.AuxInt)
  4723  		i := v_0
  4724  		if i.Op != OpPPC64RLWINM {
  4725  			break
  4726  		}
  4727  		s := auxIntToInt64(i.AuxInt)
  4728  		x := i.Args[0]
  4729  		if !(mergePPC64ClrlsldiRlwinm(c, s) != 0) {
  4730  			break
  4731  		}
  4732  		v.reset(OpPPC64RLWINM)
  4733  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiRlwinm(c, s))
  4734  		v.AddArg(x)
  4735  		return true
  4736  	}
  4737  	return false
  4738  }
  4739  func rewriteValuePPC64_OpPPC64CMP(v *Value) bool {
  4740  	v_1 := v.Args[1]
  4741  	v_0 := v.Args[0]
  4742  	b := v.Block
  4743  	// match: (CMP x (MOVDconst [c]))
  4744  	// cond: is16Bit(c)
  4745  	// result: (CMPconst x [c])
  4746  	for {
  4747  		x := v_0
  4748  		if v_1.Op != OpPPC64MOVDconst {
  4749  			break
  4750  		}
  4751  		c := auxIntToInt64(v_1.AuxInt)
  4752  		if !(is16Bit(c)) {
  4753  			break
  4754  		}
  4755  		v.reset(OpPPC64CMPconst)
  4756  		v.AuxInt = int64ToAuxInt(c)
  4757  		v.AddArg(x)
  4758  		return true
  4759  	}
  4760  	// match: (CMP (MOVDconst [c]) y)
  4761  	// cond: is16Bit(c)
  4762  	// result: (InvertFlags (CMPconst y [c]))
  4763  	for {
  4764  		if v_0.Op != OpPPC64MOVDconst {
  4765  			break
  4766  		}
  4767  		c := auxIntToInt64(v_0.AuxInt)
  4768  		y := v_1
  4769  		if !(is16Bit(c)) {
  4770  			break
  4771  		}
  4772  		v.reset(OpPPC64InvertFlags)
  4773  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  4774  		v0.AuxInt = int64ToAuxInt(c)
  4775  		v0.AddArg(y)
  4776  		v.AddArg(v0)
  4777  		return true
  4778  	}
  4779  	// match: (CMP x y)
  4780  	// cond: x.ID > y.ID
  4781  	// result: (InvertFlags (CMP y x))
  4782  	for {
  4783  		x := v_0
  4784  		y := v_1
  4785  		if !(x.ID > y.ID) {
  4786  			break
  4787  		}
  4788  		v.reset(OpPPC64InvertFlags)
  4789  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  4790  		v0.AddArg2(y, x)
  4791  		v.AddArg(v0)
  4792  		return true
  4793  	}
  4794  	return false
  4795  }
  4796  func rewriteValuePPC64_OpPPC64CMPU(v *Value) bool {
  4797  	v_1 := v.Args[1]
  4798  	v_0 := v.Args[0]
  4799  	b := v.Block
  4800  	// match: (CMPU x (MOVDconst [c]))
  4801  	// cond: isU16Bit(c)
  4802  	// result: (CMPUconst x [c])
  4803  	for {
  4804  		x := v_0
  4805  		if v_1.Op != OpPPC64MOVDconst {
  4806  			break
  4807  		}
  4808  		c := auxIntToInt64(v_1.AuxInt)
  4809  		if !(isU16Bit(c)) {
  4810  			break
  4811  		}
  4812  		v.reset(OpPPC64CMPUconst)
  4813  		v.AuxInt = int64ToAuxInt(c)
  4814  		v.AddArg(x)
  4815  		return true
  4816  	}
  4817  	// match: (CMPU (MOVDconst [c]) y)
  4818  	// cond: isU16Bit(c)
  4819  	// result: (InvertFlags (CMPUconst y [c]))
  4820  	for {
  4821  		if v_0.Op != OpPPC64MOVDconst {
  4822  			break
  4823  		}
  4824  		c := auxIntToInt64(v_0.AuxInt)
  4825  		y := v_1
  4826  		if !(isU16Bit(c)) {
  4827  			break
  4828  		}
  4829  		v.reset(OpPPC64InvertFlags)
  4830  		v0 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  4831  		v0.AuxInt = int64ToAuxInt(c)
  4832  		v0.AddArg(y)
  4833  		v.AddArg(v0)
  4834  		return true
  4835  	}
  4836  	// match: (CMPU x y)
  4837  	// cond: x.ID > y.ID
  4838  	// result: (InvertFlags (CMPU y x))
  4839  	for {
  4840  		x := v_0
  4841  		y := v_1
  4842  		if !(x.ID > y.ID) {
  4843  			break
  4844  		}
  4845  		v.reset(OpPPC64InvertFlags)
  4846  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  4847  		v0.AddArg2(y, x)
  4848  		v.AddArg(v0)
  4849  		return true
  4850  	}
  4851  	return false
  4852  }
  4853  func rewriteValuePPC64_OpPPC64CMPUconst(v *Value) bool {
  4854  	v_0 := v.Args[0]
  4855  	// match: (CMPUconst (MOVDconst [x]) [y])
  4856  	// cond: x==y
  4857  	// result: (FlagEQ)
  4858  	for {
  4859  		y := auxIntToInt64(v.AuxInt)
  4860  		if v_0.Op != OpPPC64MOVDconst {
  4861  			break
  4862  		}
  4863  		x := auxIntToInt64(v_0.AuxInt)
  4864  		if !(x == y) {
  4865  			break
  4866  		}
  4867  		v.reset(OpPPC64FlagEQ)
  4868  		return true
  4869  	}
  4870  	// match: (CMPUconst (MOVDconst [x]) [y])
  4871  	// cond: uint64(x)<uint64(y)
  4872  	// result: (FlagLT)
  4873  	for {
  4874  		y := auxIntToInt64(v.AuxInt)
  4875  		if v_0.Op != OpPPC64MOVDconst {
  4876  			break
  4877  		}
  4878  		x := auxIntToInt64(v_0.AuxInt)
  4879  		if !(uint64(x) < uint64(y)) {
  4880  			break
  4881  		}
  4882  		v.reset(OpPPC64FlagLT)
  4883  		return true
  4884  	}
  4885  	// match: (CMPUconst (MOVDconst [x]) [y])
  4886  	// cond: uint64(x)>uint64(y)
  4887  	// result: (FlagGT)
  4888  	for {
  4889  		y := auxIntToInt64(v.AuxInt)
  4890  		if v_0.Op != OpPPC64MOVDconst {
  4891  			break
  4892  		}
  4893  		x := auxIntToInt64(v_0.AuxInt)
  4894  		if !(uint64(x) > uint64(y)) {
  4895  			break
  4896  		}
  4897  		v.reset(OpPPC64FlagGT)
  4898  		return true
  4899  	}
  4900  	return false
  4901  }
  4902  func rewriteValuePPC64_OpPPC64CMPW(v *Value) bool {
  4903  	v_1 := v.Args[1]
  4904  	v_0 := v.Args[0]
  4905  	b := v.Block
  4906  	// match: (CMPW x (MOVWreg y))
  4907  	// result: (CMPW x y)
  4908  	for {
  4909  		x := v_0
  4910  		if v_1.Op != OpPPC64MOVWreg {
  4911  			break
  4912  		}
  4913  		y := v_1.Args[0]
  4914  		v.reset(OpPPC64CMPW)
  4915  		v.AddArg2(x, y)
  4916  		return true
  4917  	}
  4918  	// match: (CMPW (MOVWreg x) y)
  4919  	// result: (CMPW x y)
  4920  	for {
  4921  		if v_0.Op != OpPPC64MOVWreg {
  4922  			break
  4923  		}
  4924  		x := v_0.Args[0]
  4925  		y := v_1
  4926  		v.reset(OpPPC64CMPW)
  4927  		v.AddArg2(x, y)
  4928  		return true
  4929  	}
  4930  	// match: (CMPW x (MOVDconst [c]))
  4931  	// cond: is16Bit(c)
  4932  	// result: (CMPWconst x [int32(c)])
  4933  	for {
  4934  		x := v_0
  4935  		if v_1.Op != OpPPC64MOVDconst {
  4936  			break
  4937  		}
  4938  		c := auxIntToInt64(v_1.AuxInt)
  4939  		if !(is16Bit(c)) {
  4940  			break
  4941  		}
  4942  		v.reset(OpPPC64CMPWconst)
  4943  		v.AuxInt = int32ToAuxInt(int32(c))
  4944  		v.AddArg(x)
  4945  		return true
  4946  	}
  4947  	// match: (CMPW (MOVDconst [c]) y)
  4948  	// cond: is16Bit(c)
  4949  	// result: (InvertFlags (CMPWconst y [int32(c)]))
  4950  	for {
  4951  		if v_0.Op != OpPPC64MOVDconst {
  4952  			break
  4953  		}
  4954  		c := auxIntToInt64(v_0.AuxInt)
  4955  		y := v_1
  4956  		if !(is16Bit(c)) {
  4957  			break
  4958  		}
  4959  		v.reset(OpPPC64InvertFlags)
  4960  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, types.TypeFlags)
  4961  		v0.AuxInt = int32ToAuxInt(int32(c))
  4962  		v0.AddArg(y)
  4963  		v.AddArg(v0)
  4964  		return true
  4965  	}
  4966  	// match: (CMPW x y)
  4967  	// cond: x.ID > y.ID
  4968  	// result: (InvertFlags (CMPW y x))
  4969  	for {
  4970  		x := v_0
  4971  		y := v_1
  4972  		if !(x.ID > y.ID) {
  4973  			break
  4974  		}
  4975  		v.reset(OpPPC64InvertFlags)
  4976  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  4977  		v0.AddArg2(y, x)
  4978  		v.AddArg(v0)
  4979  		return true
  4980  	}
  4981  	return false
  4982  }
  4983  func rewriteValuePPC64_OpPPC64CMPWU(v *Value) bool {
  4984  	v_1 := v.Args[1]
  4985  	v_0 := v.Args[0]
  4986  	b := v.Block
  4987  	// match: (CMPWU x (MOVWZreg y))
  4988  	// result: (CMPWU x y)
  4989  	for {
  4990  		x := v_0
  4991  		if v_1.Op != OpPPC64MOVWZreg {
  4992  			break
  4993  		}
  4994  		y := v_1.Args[0]
  4995  		v.reset(OpPPC64CMPWU)
  4996  		v.AddArg2(x, y)
  4997  		return true
  4998  	}
  4999  	// match: (CMPWU (MOVWZreg x) y)
  5000  	// result: (CMPWU x y)
  5001  	for {
  5002  		if v_0.Op != OpPPC64MOVWZreg {
  5003  			break
  5004  		}
  5005  		x := v_0.Args[0]
  5006  		y := v_1
  5007  		v.reset(OpPPC64CMPWU)
  5008  		v.AddArg2(x, y)
  5009  		return true
  5010  	}
  5011  	// match: (CMPWU x (MOVDconst [c]))
  5012  	// cond: isU16Bit(c)
  5013  	// result: (CMPWUconst x [int32(c)])
  5014  	for {
  5015  		x := v_0
  5016  		if v_1.Op != OpPPC64MOVDconst {
  5017  			break
  5018  		}
  5019  		c := auxIntToInt64(v_1.AuxInt)
  5020  		if !(isU16Bit(c)) {
  5021  			break
  5022  		}
  5023  		v.reset(OpPPC64CMPWUconst)
  5024  		v.AuxInt = int32ToAuxInt(int32(c))
  5025  		v.AddArg(x)
  5026  		return true
  5027  	}
  5028  	// match: (CMPWU (MOVDconst [c]) y)
  5029  	// cond: isU16Bit(c)
  5030  	// result: (InvertFlags (CMPWUconst y [int32(c)]))
  5031  	for {
  5032  		if v_0.Op != OpPPC64MOVDconst {
  5033  			break
  5034  		}
  5035  		c := auxIntToInt64(v_0.AuxInt)
  5036  		y := v_1
  5037  		if !(isU16Bit(c)) {
  5038  			break
  5039  		}
  5040  		v.reset(OpPPC64InvertFlags)
  5041  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  5042  		v0.AuxInt = int32ToAuxInt(int32(c))
  5043  		v0.AddArg(y)
  5044  		v.AddArg(v0)
  5045  		return true
  5046  	}
  5047  	// match: (CMPWU x y)
  5048  	// cond: x.ID > y.ID
  5049  	// result: (InvertFlags (CMPWU y x))
  5050  	for {
  5051  		x := v_0
  5052  		y := v_1
  5053  		if !(x.ID > y.ID) {
  5054  			break
  5055  		}
  5056  		v.reset(OpPPC64InvertFlags)
  5057  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  5058  		v0.AddArg2(y, x)
  5059  		v.AddArg(v0)
  5060  		return true
  5061  	}
  5062  	return false
  5063  }
  5064  func rewriteValuePPC64_OpPPC64CMPWUconst(v *Value) bool {
  5065  	v_0 := v.Args[0]
  5066  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5067  	// cond: int32(x)==int32(y)
  5068  	// result: (FlagEQ)
  5069  	for {
  5070  		y := auxIntToInt32(v.AuxInt)
  5071  		if v_0.Op != OpPPC64MOVDconst {
  5072  			break
  5073  		}
  5074  		x := auxIntToInt64(v_0.AuxInt)
  5075  		if !(int32(x) == int32(y)) {
  5076  			break
  5077  		}
  5078  		v.reset(OpPPC64FlagEQ)
  5079  		return true
  5080  	}
  5081  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5082  	// cond: uint32(x)<uint32(y)
  5083  	// result: (FlagLT)
  5084  	for {
  5085  		y := auxIntToInt32(v.AuxInt)
  5086  		if v_0.Op != OpPPC64MOVDconst {
  5087  			break
  5088  		}
  5089  		x := auxIntToInt64(v_0.AuxInt)
  5090  		if !(uint32(x) < uint32(y)) {
  5091  			break
  5092  		}
  5093  		v.reset(OpPPC64FlagLT)
  5094  		return true
  5095  	}
  5096  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5097  	// cond: uint32(x)>uint32(y)
  5098  	// result: (FlagGT)
  5099  	for {
  5100  		y := auxIntToInt32(v.AuxInt)
  5101  		if v_0.Op != OpPPC64MOVDconst {
  5102  			break
  5103  		}
  5104  		x := auxIntToInt64(v_0.AuxInt)
  5105  		if !(uint32(x) > uint32(y)) {
  5106  			break
  5107  		}
  5108  		v.reset(OpPPC64FlagGT)
  5109  		return true
  5110  	}
  5111  	return false
  5112  }
  5113  func rewriteValuePPC64_OpPPC64CMPWconst(v *Value) bool {
  5114  	v_0 := v.Args[0]
  5115  	// match: (CMPWconst (MOVDconst [x]) [y])
  5116  	// cond: int32(x)==int32(y)
  5117  	// result: (FlagEQ)
  5118  	for {
  5119  		y := auxIntToInt32(v.AuxInt)
  5120  		if v_0.Op != OpPPC64MOVDconst {
  5121  			break
  5122  		}
  5123  		x := auxIntToInt64(v_0.AuxInt)
  5124  		if !(int32(x) == int32(y)) {
  5125  			break
  5126  		}
  5127  		v.reset(OpPPC64FlagEQ)
  5128  		return true
  5129  	}
  5130  	// match: (CMPWconst (MOVDconst [x]) [y])
  5131  	// cond: int32(x)<int32(y)
  5132  	// result: (FlagLT)
  5133  	for {
  5134  		y := auxIntToInt32(v.AuxInt)
  5135  		if v_0.Op != OpPPC64MOVDconst {
  5136  			break
  5137  		}
  5138  		x := auxIntToInt64(v_0.AuxInt)
  5139  		if !(int32(x) < int32(y)) {
  5140  			break
  5141  		}
  5142  		v.reset(OpPPC64FlagLT)
  5143  		return true
  5144  	}
  5145  	// match: (CMPWconst (MOVDconst [x]) [y])
  5146  	// cond: int32(x)>int32(y)
  5147  	// result: (FlagGT)
  5148  	for {
  5149  		y := auxIntToInt32(v.AuxInt)
  5150  		if v_0.Op != OpPPC64MOVDconst {
  5151  			break
  5152  		}
  5153  		x := auxIntToInt64(v_0.AuxInt)
  5154  		if !(int32(x) > int32(y)) {
  5155  			break
  5156  		}
  5157  		v.reset(OpPPC64FlagGT)
  5158  		return true
  5159  	}
  5160  	return false
  5161  }
  5162  func rewriteValuePPC64_OpPPC64CMPconst(v *Value) bool {
  5163  	v_0 := v.Args[0]
  5164  	// match: (CMPconst (MOVDconst [x]) [y])
  5165  	// cond: x==y
  5166  	// result: (FlagEQ)
  5167  	for {
  5168  		y := auxIntToInt64(v.AuxInt)
  5169  		if v_0.Op != OpPPC64MOVDconst {
  5170  			break
  5171  		}
  5172  		x := auxIntToInt64(v_0.AuxInt)
  5173  		if !(x == y) {
  5174  			break
  5175  		}
  5176  		v.reset(OpPPC64FlagEQ)
  5177  		return true
  5178  	}
  5179  	// match: (CMPconst (MOVDconst [x]) [y])
  5180  	// cond: x<y
  5181  	// result: (FlagLT)
  5182  	for {
  5183  		y := auxIntToInt64(v.AuxInt)
  5184  		if v_0.Op != OpPPC64MOVDconst {
  5185  			break
  5186  		}
  5187  		x := auxIntToInt64(v_0.AuxInt)
  5188  		if !(x < y) {
  5189  			break
  5190  		}
  5191  		v.reset(OpPPC64FlagLT)
  5192  		return true
  5193  	}
  5194  	// match: (CMPconst (MOVDconst [x]) [y])
  5195  	// cond: x>y
  5196  	// result: (FlagGT)
  5197  	for {
  5198  		y := auxIntToInt64(v.AuxInt)
  5199  		if v_0.Op != OpPPC64MOVDconst {
  5200  			break
  5201  		}
  5202  		x := auxIntToInt64(v_0.AuxInt)
  5203  		if !(x > y) {
  5204  			break
  5205  		}
  5206  		v.reset(OpPPC64FlagGT)
  5207  		return true
  5208  	}
  5209  	return false
  5210  }
  5211  func rewriteValuePPC64_OpPPC64Equal(v *Value) bool {
  5212  	v_0 := v.Args[0]
  5213  	b := v.Block
  5214  	typ := &b.Func.Config.Types
  5215  	// match: (Equal (FlagEQ))
  5216  	// result: (MOVDconst [1])
  5217  	for {
  5218  		if v_0.Op != OpPPC64FlagEQ {
  5219  			break
  5220  		}
  5221  		v.reset(OpPPC64MOVDconst)
  5222  		v.AuxInt = int64ToAuxInt(1)
  5223  		return true
  5224  	}
  5225  	// match: (Equal (FlagLT))
  5226  	// result: (MOVDconst [0])
  5227  	for {
  5228  		if v_0.Op != OpPPC64FlagLT {
  5229  			break
  5230  		}
  5231  		v.reset(OpPPC64MOVDconst)
  5232  		v.AuxInt = int64ToAuxInt(0)
  5233  		return true
  5234  	}
  5235  	// match: (Equal (FlagGT))
  5236  	// result: (MOVDconst [0])
  5237  	for {
  5238  		if v_0.Op != OpPPC64FlagGT {
  5239  			break
  5240  		}
  5241  		v.reset(OpPPC64MOVDconst)
  5242  		v.AuxInt = int64ToAuxInt(0)
  5243  		return true
  5244  	}
  5245  	// match: (Equal (InvertFlags x))
  5246  	// result: (Equal x)
  5247  	for {
  5248  		if v_0.Op != OpPPC64InvertFlags {
  5249  			break
  5250  		}
  5251  		x := v_0.Args[0]
  5252  		v.reset(OpPPC64Equal)
  5253  		v.AddArg(x)
  5254  		return true
  5255  	}
  5256  	// match: (Equal cmp)
  5257  	// result: (ISELB [2] (MOVDconst [1]) cmp)
  5258  	for {
  5259  		cmp := v_0
  5260  		v.reset(OpPPC64ISELB)
  5261  		v.AuxInt = int32ToAuxInt(2)
  5262  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  5263  		v0.AuxInt = int64ToAuxInt(1)
  5264  		v.AddArg2(v0, cmp)
  5265  		return true
  5266  	}
  5267  }
  5268  func rewriteValuePPC64_OpPPC64FABS(v *Value) bool {
  5269  	v_0 := v.Args[0]
  5270  	// match: (FABS (FMOVDconst [x]))
  5271  	// result: (FMOVDconst [math.Abs(x)])
  5272  	for {
  5273  		if v_0.Op != OpPPC64FMOVDconst {
  5274  			break
  5275  		}
  5276  		x := auxIntToFloat64(v_0.AuxInt)
  5277  		v.reset(OpPPC64FMOVDconst)
  5278  		v.AuxInt = float64ToAuxInt(math.Abs(x))
  5279  		return true
  5280  	}
  5281  	return false
  5282  }
  5283  func rewriteValuePPC64_OpPPC64FADD(v *Value) bool {
  5284  	v_1 := v.Args[1]
  5285  	v_0 := v.Args[0]
  5286  	// match: (FADD (FMUL x y) z)
  5287  	// result: (FMADD x y z)
  5288  	for {
  5289  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5290  			if v_0.Op != OpPPC64FMUL {
  5291  				continue
  5292  			}
  5293  			y := v_0.Args[1]
  5294  			x := v_0.Args[0]
  5295  			z := v_1
  5296  			v.reset(OpPPC64FMADD)
  5297  			v.AddArg3(x, y, z)
  5298  			return true
  5299  		}
  5300  		break
  5301  	}
  5302  	return false
  5303  }
  5304  func rewriteValuePPC64_OpPPC64FADDS(v *Value) bool {
  5305  	v_1 := v.Args[1]
  5306  	v_0 := v.Args[0]
  5307  	// match: (FADDS (FMULS x y) z)
  5308  	// result: (FMADDS x y z)
  5309  	for {
  5310  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5311  			if v_0.Op != OpPPC64FMULS {
  5312  				continue
  5313  			}
  5314  			y := v_0.Args[1]
  5315  			x := v_0.Args[0]
  5316  			z := v_1
  5317  			v.reset(OpPPC64FMADDS)
  5318  			v.AddArg3(x, y, z)
  5319  			return true
  5320  		}
  5321  		break
  5322  	}
  5323  	return false
  5324  }
  5325  func rewriteValuePPC64_OpPPC64FCEIL(v *Value) bool {
  5326  	v_0 := v.Args[0]
  5327  	// match: (FCEIL (FMOVDconst [x]))
  5328  	// result: (FMOVDconst [math.Ceil(x)])
  5329  	for {
  5330  		if v_0.Op != OpPPC64FMOVDconst {
  5331  			break
  5332  		}
  5333  		x := auxIntToFloat64(v_0.AuxInt)
  5334  		v.reset(OpPPC64FMOVDconst)
  5335  		v.AuxInt = float64ToAuxInt(math.Ceil(x))
  5336  		return true
  5337  	}
  5338  	return false
  5339  }
  5340  func rewriteValuePPC64_OpPPC64FFLOOR(v *Value) bool {
  5341  	v_0 := v.Args[0]
  5342  	// match: (FFLOOR (FMOVDconst [x]))
  5343  	// result: (FMOVDconst [math.Floor(x)])
  5344  	for {
  5345  		if v_0.Op != OpPPC64FMOVDconst {
  5346  			break
  5347  		}
  5348  		x := auxIntToFloat64(v_0.AuxInt)
  5349  		v.reset(OpPPC64FMOVDconst)
  5350  		v.AuxInt = float64ToAuxInt(math.Floor(x))
  5351  		return true
  5352  	}
  5353  	return false
  5354  }
  5355  func rewriteValuePPC64_OpPPC64FGreaterEqual(v *Value) bool {
  5356  	v_0 := v.Args[0]
  5357  	b := v.Block
  5358  	typ := &b.Func.Config.Types
  5359  	// match: (FGreaterEqual cmp)
  5360  	// result: (ISEL [2] (MOVDconst [1]) (ISELB [1] (MOVDconst [1]) cmp) cmp)
  5361  	for {
  5362  		cmp := v_0
  5363  		v.reset(OpPPC64ISEL)
  5364  		v.AuxInt = int32ToAuxInt(2)
  5365  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  5366  		v0.AuxInt = int64ToAuxInt(1)
  5367  		v1 := b.NewValue0(v.Pos, OpPPC64ISELB, typ.Int32)
  5368  		v1.AuxInt = int32ToAuxInt(1)
  5369  		v1.AddArg2(v0, cmp)
  5370  		v.AddArg3(v0, v1, cmp)
  5371  		return true
  5372  	}
  5373  }
  5374  func rewriteValuePPC64_OpPPC64FGreaterThan(v *Value) bool {
  5375  	v_0 := v.Args[0]
  5376  	b := v.Block
  5377  	typ := &b.Func.Config.Types
  5378  	// match: (FGreaterThan cmp)
  5379  	// result: (ISELB [1] (MOVDconst [1]) cmp)
  5380  	for {
  5381  		cmp := v_0
  5382  		v.reset(OpPPC64ISELB)
  5383  		v.AuxInt = int32ToAuxInt(1)
  5384  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  5385  		v0.AuxInt = int64ToAuxInt(1)
  5386  		v.AddArg2(v0, cmp)
  5387  		return true
  5388  	}
  5389  }
  5390  func rewriteValuePPC64_OpPPC64FLessEqual(v *Value) bool {
  5391  	v_0 := v.Args[0]
  5392  	b := v.Block
  5393  	typ := &b.Func.Config.Types
  5394  	// match: (FLessEqual cmp)
  5395  	// result: (ISEL [2] (MOVDconst [1]) (ISELB [0] (MOVDconst [1]) cmp) cmp)
  5396  	for {
  5397  		cmp := v_0
  5398  		v.reset(OpPPC64ISEL)
  5399  		v.AuxInt = int32ToAuxInt(2)
  5400  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  5401  		v0.AuxInt = int64ToAuxInt(1)
  5402  		v1 := b.NewValue0(v.Pos, OpPPC64ISELB, typ.Int32)
  5403  		v1.AuxInt = int32ToAuxInt(0)
  5404  		v1.AddArg2(v0, cmp)
  5405  		v.AddArg3(v0, v1, cmp)
  5406  		return true
  5407  	}
  5408  }
  5409  func rewriteValuePPC64_OpPPC64FLessThan(v *Value) bool {
  5410  	v_0 := v.Args[0]
  5411  	b := v.Block
  5412  	typ := &b.Func.Config.Types
  5413  	// match: (FLessThan cmp)
  5414  	// result: (ISELB [0] (MOVDconst [1]) cmp)
  5415  	for {
  5416  		cmp := v_0
  5417  		v.reset(OpPPC64ISELB)
  5418  		v.AuxInt = int32ToAuxInt(0)
  5419  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  5420  		v0.AuxInt = int64ToAuxInt(1)
  5421  		v.AddArg2(v0, cmp)
  5422  		return true
  5423  	}
  5424  }
  5425  func rewriteValuePPC64_OpPPC64FMOVDload(v *Value) bool {
  5426  	v_1 := v.Args[1]
  5427  	v_0 := v.Args[0]
  5428  	// match: (FMOVDload [off] {sym} ptr (MOVDstore [off] {sym} ptr x _))
  5429  	// result: (MTVSRD x)
  5430  	for {
  5431  		off := auxIntToInt32(v.AuxInt)
  5432  		sym := auxToSym(v.Aux)
  5433  		ptr := v_0
  5434  		if v_1.Op != OpPPC64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5435  			break
  5436  		}
  5437  		x := v_1.Args[1]
  5438  		if ptr != v_1.Args[0] {
  5439  			break
  5440  		}
  5441  		v.reset(OpPPC64MTVSRD)
  5442  		v.AddArg(x)
  5443  		return true
  5444  	}
  5445  	// match: (FMOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  5446  	// cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
  5447  	// result: (FMOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  5448  	for {
  5449  		off1 := auxIntToInt32(v.AuxInt)
  5450  		sym1 := auxToSym(v.Aux)
  5451  		p := v_0
  5452  		if p.Op != OpPPC64MOVDaddr {
  5453  			break
  5454  		}
  5455  		off2 := auxIntToInt32(p.AuxInt)
  5456  		sym2 := auxToSym(p.Aux)
  5457  		ptr := p.Args[0]
  5458  		mem := v_1
  5459  		if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
  5460  			break
  5461  		}
  5462  		v.reset(OpPPC64FMOVDload)
  5463  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5464  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5465  		v.AddArg2(ptr, mem)
  5466  		return true
  5467  	}
  5468  	// match: (FMOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
  5469  	// cond: is16Bit(int64(off1)+off2)
  5470  	// result: (FMOVDload [off1+int32(off2)] {sym} ptr mem)
  5471  	for {
  5472  		off1 := auxIntToInt32(v.AuxInt)
  5473  		sym := auxToSym(v.Aux)
  5474  		if v_0.Op != OpPPC64ADDconst {
  5475  			break
  5476  		}
  5477  		off2 := auxIntToInt64(v_0.AuxInt)
  5478  		ptr := v_0.Args[0]
  5479  		mem := v_1
  5480  		if !(is16Bit(int64(off1) + off2)) {
  5481  			break
  5482  		}
  5483  		v.reset(OpPPC64FMOVDload)
  5484  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5485  		v.Aux = symToAux(sym)
  5486  		v.AddArg2(ptr, mem)
  5487  		return true
  5488  	}
  5489  	return false
  5490  }
  5491  func rewriteValuePPC64_OpPPC64FMOVDstore(v *Value) bool {
  5492  	v_2 := v.Args[2]
  5493  	v_1 := v.Args[1]
  5494  	v_0 := v.Args[0]
  5495  	// match: (FMOVDstore [off] {sym} ptr (MTVSRD x) mem)
  5496  	// result: (MOVDstore [off] {sym} ptr x mem)
  5497  	for {
  5498  		off := auxIntToInt32(v.AuxInt)
  5499  		sym := auxToSym(v.Aux)
  5500  		ptr := v_0
  5501  		if v_1.Op != OpPPC64MTVSRD {
  5502  			break
  5503  		}
  5504  		x := v_1.Args[0]
  5505  		mem := v_2
  5506  		v.reset(OpPPC64MOVDstore)
  5507  		v.AuxInt = int32ToAuxInt(off)
  5508  		v.Aux = symToAux(sym)
  5509  		v.AddArg3(ptr, x, mem)
  5510  		return true
  5511  	}
  5512  	// match: (FMOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  5513  	// cond: is16Bit(int64(off1)+off2)
  5514  	// result: (FMOVDstore [off1+int32(off2)] {sym} ptr val mem)
  5515  	for {
  5516  		off1 := auxIntToInt32(v.AuxInt)
  5517  		sym := auxToSym(v.Aux)
  5518  		if v_0.Op != OpPPC64ADDconst {
  5519  			break
  5520  		}
  5521  		off2 := auxIntToInt64(v_0.AuxInt)
  5522  		ptr := v_0.Args[0]
  5523  		val := v_1
  5524  		mem := v_2
  5525  		if !(is16Bit(int64(off1) + off2)) {
  5526  			break
  5527  		}
  5528  		v.reset(OpPPC64FMOVDstore)
  5529  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5530  		v.Aux = symToAux(sym)
  5531  		v.AddArg3(ptr, val, mem)
  5532  		return true
  5533  	}
  5534  	// match: (FMOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  5535  	// cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
  5536  	// result: (FMOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  5537  	for {
  5538  		off1 := auxIntToInt32(v.AuxInt)
  5539  		sym1 := auxToSym(v.Aux)
  5540  		p := v_0
  5541  		if p.Op != OpPPC64MOVDaddr {
  5542  			break
  5543  		}
  5544  		off2 := auxIntToInt32(p.AuxInt)
  5545  		sym2 := auxToSym(p.Aux)
  5546  		ptr := p.Args[0]
  5547  		val := v_1
  5548  		mem := v_2
  5549  		if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
  5550  			break
  5551  		}
  5552  		v.reset(OpPPC64FMOVDstore)
  5553  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5554  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5555  		v.AddArg3(ptr, val, mem)
  5556  		return true
  5557  	}
  5558  	return false
  5559  }
  5560  func rewriteValuePPC64_OpPPC64FMOVSload(v *Value) bool {
  5561  	v_1 := v.Args[1]
  5562  	v_0 := v.Args[0]
  5563  	// match: (FMOVSload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  5564  	// cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
  5565  	// result: (FMOVSload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  5566  	for {
  5567  		off1 := auxIntToInt32(v.AuxInt)
  5568  		sym1 := auxToSym(v.Aux)
  5569  		p := v_0
  5570  		if p.Op != OpPPC64MOVDaddr {
  5571  			break
  5572  		}
  5573  		off2 := auxIntToInt32(p.AuxInt)
  5574  		sym2 := auxToSym(p.Aux)
  5575  		ptr := p.Args[0]
  5576  		mem := v_1
  5577  		if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
  5578  			break
  5579  		}
  5580  		v.reset(OpPPC64FMOVSload)
  5581  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5582  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5583  		v.AddArg2(ptr, mem)
  5584  		return true
  5585  	}
  5586  	// match: (FMOVSload [off1] {sym} (ADDconst [off2] ptr) mem)
  5587  	// cond: is16Bit(int64(off1)+off2)
  5588  	// result: (FMOVSload [off1+int32(off2)] {sym} ptr mem)
  5589  	for {
  5590  		off1 := auxIntToInt32(v.AuxInt)
  5591  		sym := auxToSym(v.Aux)
  5592  		if v_0.Op != OpPPC64ADDconst {
  5593  			break
  5594  		}
  5595  		off2 := auxIntToInt64(v_0.AuxInt)
  5596  		ptr := v_0.Args[0]
  5597  		mem := v_1
  5598  		if !(is16Bit(int64(off1) + off2)) {
  5599  			break
  5600  		}
  5601  		v.reset(OpPPC64FMOVSload)
  5602  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5603  		v.Aux = symToAux(sym)
  5604  		v.AddArg2(ptr, mem)
  5605  		return true
  5606  	}
  5607  	return false
  5608  }
  5609  func rewriteValuePPC64_OpPPC64FMOVSstore(v *Value) bool {
  5610  	v_2 := v.Args[2]
  5611  	v_1 := v.Args[1]
  5612  	v_0 := v.Args[0]
  5613  	// match: (FMOVSstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  5614  	// cond: is16Bit(int64(off1)+off2)
  5615  	// result: (FMOVSstore [off1+int32(off2)] {sym} ptr val mem)
  5616  	for {
  5617  		off1 := auxIntToInt32(v.AuxInt)
  5618  		sym := auxToSym(v.Aux)
  5619  		if v_0.Op != OpPPC64ADDconst {
  5620  			break
  5621  		}
  5622  		off2 := auxIntToInt64(v_0.AuxInt)
  5623  		ptr := v_0.Args[0]
  5624  		val := v_1
  5625  		mem := v_2
  5626  		if !(is16Bit(int64(off1) + off2)) {
  5627  			break
  5628  		}
  5629  		v.reset(OpPPC64FMOVSstore)
  5630  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5631  		v.Aux = symToAux(sym)
  5632  		v.AddArg3(ptr, val, mem)
  5633  		return true
  5634  	}
  5635  	// match: (FMOVSstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  5636  	// cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
  5637  	// result: (FMOVSstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  5638  	for {
  5639  		off1 := auxIntToInt32(v.AuxInt)
  5640  		sym1 := auxToSym(v.Aux)
  5641  		p := v_0
  5642  		if p.Op != OpPPC64MOVDaddr {
  5643  			break
  5644  		}
  5645  		off2 := auxIntToInt32(p.AuxInt)
  5646  		sym2 := auxToSym(p.Aux)
  5647  		ptr := p.Args[0]
  5648  		val := v_1
  5649  		mem := v_2
  5650  		if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
  5651  			break
  5652  		}
  5653  		v.reset(OpPPC64FMOVSstore)
  5654  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5655  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5656  		v.AddArg3(ptr, val, mem)
  5657  		return true
  5658  	}
  5659  	return false
  5660  }
  5661  func rewriteValuePPC64_OpPPC64FNEG(v *Value) bool {
  5662  	v_0 := v.Args[0]
  5663  	// match: (FNEG (FABS x))
  5664  	// result: (FNABS x)
  5665  	for {
  5666  		if v_0.Op != OpPPC64FABS {
  5667  			break
  5668  		}
  5669  		x := v_0.Args[0]
  5670  		v.reset(OpPPC64FNABS)
  5671  		v.AddArg(x)
  5672  		return true
  5673  	}
  5674  	// match: (FNEG (FNABS x))
  5675  	// result: (FABS x)
  5676  	for {
  5677  		if v_0.Op != OpPPC64FNABS {
  5678  			break
  5679  		}
  5680  		x := v_0.Args[0]
  5681  		v.reset(OpPPC64FABS)
  5682  		v.AddArg(x)
  5683  		return true
  5684  	}
  5685  	return false
  5686  }
  5687  func rewriteValuePPC64_OpPPC64FSQRT(v *Value) bool {
  5688  	v_0 := v.Args[0]
  5689  	// match: (FSQRT (FMOVDconst [x]))
  5690  	// cond: x >= 0
  5691  	// result: (FMOVDconst [math.Sqrt(x)])
  5692  	for {
  5693  		if v_0.Op != OpPPC64FMOVDconst {
  5694  			break
  5695  		}
  5696  		x := auxIntToFloat64(v_0.AuxInt)
  5697  		if !(x >= 0) {
  5698  			break
  5699  		}
  5700  		v.reset(OpPPC64FMOVDconst)
  5701  		v.AuxInt = float64ToAuxInt(math.Sqrt(x))
  5702  		return true
  5703  	}
  5704  	return false
  5705  }
  5706  func rewriteValuePPC64_OpPPC64FSUB(v *Value) bool {
  5707  	v_1 := v.Args[1]
  5708  	v_0 := v.Args[0]
  5709  	// match: (FSUB (FMUL x y) z)
  5710  	// result: (FMSUB x y z)
  5711  	for {
  5712  		if v_0.Op != OpPPC64FMUL {
  5713  			break
  5714  		}
  5715  		y := v_0.Args[1]
  5716  		x := v_0.Args[0]
  5717  		z := v_1
  5718  		v.reset(OpPPC64FMSUB)
  5719  		v.AddArg3(x, y, z)
  5720  		return true
  5721  	}
  5722  	return false
  5723  }
  5724  func rewriteValuePPC64_OpPPC64FSUBS(v *Value) bool {
  5725  	v_1 := v.Args[1]
  5726  	v_0 := v.Args[0]
  5727  	// match: (FSUBS (FMULS x y) z)
  5728  	// result: (FMSUBS x y z)
  5729  	for {
  5730  		if v_0.Op != OpPPC64FMULS {
  5731  			break
  5732  		}
  5733  		y := v_0.Args[1]
  5734  		x := v_0.Args[0]
  5735  		z := v_1
  5736  		v.reset(OpPPC64FMSUBS)
  5737  		v.AddArg3(x, y, z)
  5738  		return true
  5739  	}
  5740  	return false
  5741  }
  5742  func rewriteValuePPC64_OpPPC64FTRUNC(v *Value) bool {
  5743  	v_0 := v.Args[0]
  5744  	// match: (FTRUNC (FMOVDconst [x]))
  5745  	// result: (FMOVDconst [math.Trunc(x)])
  5746  	for {
  5747  		if v_0.Op != OpPPC64FMOVDconst {
  5748  			break
  5749  		}
  5750  		x := auxIntToFloat64(v_0.AuxInt)
  5751  		v.reset(OpPPC64FMOVDconst)
  5752  		v.AuxInt = float64ToAuxInt(math.Trunc(x))
  5753  		return true
  5754  	}
  5755  	return false
  5756  }
  5757  func rewriteValuePPC64_OpPPC64GreaterEqual(v *Value) bool {
  5758  	v_0 := v.Args[0]
  5759  	b := v.Block
  5760  	typ := &b.Func.Config.Types
  5761  	// match: (GreaterEqual (FlagEQ))
  5762  	// result: (MOVDconst [1])
  5763  	for {
  5764  		if v_0.Op != OpPPC64FlagEQ {
  5765  			break
  5766  		}
  5767  		v.reset(OpPPC64MOVDconst)
  5768  		v.AuxInt = int64ToAuxInt(1)
  5769  		return true
  5770  	}
  5771  	// match: (GreaterEqual (FlagLT))
  5772  	// result: (MOVDconst [0])
  5773  	for {
  5774  		if v_0.Op != OpPPC64FlagLT {
  5775  			break
  5776  		}
  5777  		v.reset(OpPPC64MOVDconst)
  5778  		v.AuxInt = int64ToAuxInt(0)
  5779  		return true
  5780  	}
  5781  	// match: (GreaterEqual (FlagGT))
  5782  	// result: (MOVDconst [1])
  5783  	for {
  5784  		if v_0.Op != OpPPC64FlagGT {
  5785  			break
  5786  		}
  5787  		v.reset(OpPPC64MOVDconst)
  5788  		v.AuxInt = int64ToAuxInt(1)
  5789  		return true
  5790  	}
  5791  	// match: (GreaterEqual (InvertFlags x))
  5792  	// result: (LessEqual x)
  5793  	for {
  5794  		if v_0.Op != OpPPC64InvertFlags {
  5795  			break
  5796  		}
  5797  		x := v_0.Args[0]
  5798  		v.reset(OpPPC64LessEqual)
  5799  		v.AddArg(x)
  5800  		return true
  5801  	}
  5802  	// match: (GreaterEqual cmp)
  5803  	// result: (ISELB [4] (MOVDconst [1]) cmp)
  5804  	for {
  5805  		cmp := v_0
  5806  		v.reset(OpPPC64ISELB)
  5807  		v.AuxInt = int32ToAuxInt(4)
  5808  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  5809  		v0.AuxInt = int64ToAuxInt(1)
  5810  		v.AddArg2(v0, cmp)
  5811  		return true
  5812  	}
  5813  }
  5814  func rewriteValuePPC64_OpPPC64GreaterThan(v *Value) bool {
  5815  	v_0 := v.Args[0]
  5816  	b := v.Block
  5817  	typ := &b.Func.Config.Types
  5818  	// match: (GreaterThan (FlagEQ))
  5819  	// result: (MOVDconst [0])
  5820  	for {
  5821  		if v_0.Op != OpPPC64FlagEQ {
  5822  			break
  5823  		}
  5824  		v.reset(OpPPC64MOVDconst)
  5825  		v.AuxInt = int64ToAuxInt(0)
  5826  		return true
  5827  	}
  5828  	// match: (GreaterThan (FlagLT))
  5829  	// result: (MOVDconst [0])
  5830  	for {
  5831  		if v_0.Op != OpPPC64FlagLT {
  5832  			break
  5833  		}
  5834  		v.reset(OpPPC64MOVDconst)
  5835  		v.AuxInt = int64ToAuxInt(0)
  5836  		return true
  5837  	}
  5838  	// match: (GreaterThan (FlagGT))
  5839  	// result: (MOVDconst [1])
  5840  	for {
  5841  		if v_0.Op != OpPPC64FlagGT {
  5842  			break
  5843  		}
  5844  		v.reset(OpPPC64MOVDconst)
  5845  		v.AuxInt = int64ToAuxInt(1)
  5846  		return true
  5847  	}
  5848  	// match: (GreaterThan (InvertFlags x))
  5849  	// result: (LessThan x)
  5850  	for {
  5851  		if v_0.Op != OpPPC64InvertFlags {
  5852  			break
  5853  		}
  5854  		x := v_0.Args[0]
  5855  		v.reset(OpPPC64LessThan)
  5856  		v.AddArg(x)
  5857  		return true
  5858  	}
  5859  	// match: (GreaterThan cmp)
  5860  	// result: (ISELB [1] (MOVDconst [1]) cmp)
  5861  	for {
  5862  		cmp := v_0
  5863  		v.reset(OpPPC64ISELB)
  5864  		v.AuxInt = int32ToAuxInt(1)
  5865  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  5866  		v0.AuxInt = int64ToAuxInt(1)
  5867  		v.AddArg2(v0, cmp)
  5868  		return true
  5869  	}
  5870  }
  5871  func rewriteValuePPC64_OpPPC64ISEL(v *Value) bool {
  5872  	v_2 := v.Args[2]
  5873  	v_1 := v.Args[1]
  5874  	v_0 := v.Args[0]
  5875  	// match: (ISEL [0] (ANDconst [d] y) (MOVDconst [-1]) (CMPU (ANDconst [d] y) (MOVDconst [c])))
  5876  	// cond: c >= d
  5877  	// result: (ANDconst [d] y)
  5878  	for {
  5879  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64ANDconst {
  5880  			break
  5881  		}
  5882  		d := auxIntToInt64(v_0.AuxInt)
  5883  		y := v_0.Args[0]
  5884  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 || v_2.Op != OpPPC64CMPU {
  5885  			break
  5886  		}
  5887  		_ = v_2.Args[1]
  5888  		v_2_0 := v_2.Args[0]
  5889  		if v_2_0.Op != OpPPC64ANDconst || auxIntToInt64(v_2_0.AuxInt) != d || y != v_2_0.Args[0] {
  5890  			break
  5891  		}
  5892  		v_2_1 := v_2.Args[1]
  5893  		if v_2_1.Op != OpPPC64MOVDconst {
  5894  			break
  5895  		}
  5896  		c := auxIntToInt64(v_2_1.AuxInt)
  5897  		if !(c >= d) {
  5898  			break
  5899  		}
  5900  		v.reset(OpPPC64ANDconst)
  5901  		v.AuxInt = int64ToAuxInt(d)
  5902  		v.AddArg(y)
  5903  		return true
  5904  	}
  5905  	// match: (ISEL [0] (ANDconst [d] y) (MOVDconst [-1]) (CMPUconst [c] (ANDconst [d] y)))
  5906  	// cond: c >= d
  5907  	// result: (ANDconst [d] y)
  5908  	for {
  5909  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64ANDconst {
  5910  			break
  5911  		}
  5912  		d := auxIntToInt64(v_0.AuxInt)
  5913  		y := v_0.Args[0]
  5914  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 || v_2.Op != OpPPC64CMPUconst {
  5915  			break
  5916  		}
  5917  		c := auxIntToInt64(v_2.AuxInt)
  5918  		v_2_0 := v_2.Args[0]
  5919  		if v_2_0.Op != OpPPC64ANDconst || auxIntToInt64(v_2_0.AuxInt) != d || y != v_2_0.Args[0] || !(c >= d) {
  5920  			break
  5921  		}
  5922  		v.reset(OpPPC64ANDconst)
  5923  		v.AuxInt = int64ToAuxInt(d)
  5924  		v.AddArg(y)
  5925  		return true
  5926  	}
  5927  	// match: (ISEL [2] x _ (FlagEQ))
  5928  	// result: x
  5929  	for {
  5930  		if auxIntToInt32(v.AuxInt) != 2 {
  5931  			break
  5932  		}
  5933  		x := v_0
  5934  		if v_2.Op != OpPPC64FlagEQ {
  5935  			break
  5936  		}
  5937  		v.copyOf(x)
  5938  		return true
  5939  	}
  5940  	// match: (ISEL [2] _ y (FlagLT))
  5941  	// result: y
  5942  	for {
  5943  		if auxIntToInt32(v.AuxInt) != 2 {
  5944  			break
  5945  		}
  5946  		y := v_1
  5947  		if v_2.Op != OpPPC64FlagLT {
  5948  			break
  5949  		}
  5950  		v.copyOf(y)
  5951  		return true
  5952  	}
  5953  	// match: (ISEL [2] _ y (FlagGT))
  5954  	// result: y
  5955  	for {
  5956  		if auxIntToInt32(v.AuxInt) != 2 {
  5957  			break
  5958  		}
  5959  		y := v_1
  5960  		if v_2.Op != OpPPC64FlagGT {
  5961  			break
  5962  		}
  5963  		v.copyOf(y)
  5964  		return true
  5965  	}
  5966  	// match: (ISEL [6] _ y (FlagEQ))
  5967  	// result: y
  5968  	for {
  5969  		if auxIntToInt32(v.AuxInt) != 6 {
  5970  			break
  5971  		}
  5972  		y := v_1
  5973  		if v_2.Op != OpPPC64FlagEQ {
  5974  			break
  5975  		}
  5976  		v.copyOf(y)
  5977  		return true
  5978  	}
  5979  	// match: (ISEL [6] x _ (FlagLT))
  5980  	// result: x
  5981  	for {
  5982  		if auxIntToInt32(v.AuxInt) != 6 {
  5983  			break
  5984  		}
  5985  		x := v_0
  5986  		if v_2.Op != OpPPC64FlagLT {
  5987  			break
  5988  		}
  5989  		v.copyOf(x)
  5990  		return true
  5991  	}
  5992  	// match: (ISEL [6] x _ (FlagGT))
  5993  	// result: x
  5994  	for {
  5995  		if auxIntToInt32(v.AuxInt) != 6 {
  5996  			break
  5997  		}
  5998  		x := v_0
  5999  		if v_2.Op != OpPPC64FlagGT {
  6000  			break
  6001  		}
  6002  		v.copyOf(x)
  6003  		return true
  6004  	}
  6005  	// match: (ISEL [0] _ y (FlagEQ))
  6006  	// result: y
  6007  	for {
  6008  		if auxIntToInt32(v.AuxInt) != 0 {
  6009  			break
  6010  		}
  6011  		y := v_1
  6012  		if v_2.Op != OpPPC64FlagEQ {
  6013  			break
  6014  		}
  6015  		v.copyOf(y)
  6016  		return true
  6017  	}
  6018  	// match: (ISEL [0] _ y (FlagGT))
  6019  	// result: y
  6020  	for {
  6021  		if auxIntToInt32(v.AuxInt) != 0 {
  6022  			break
  6023  		}
  6024  		y := v_1
  6025  		if v_2.Op != OpPPC64FlagGT {
  6026  			break
  6027  		}
  6028  		v.copyOf(y)
  6029  		return true
  6030  	}
  6031  	// match: (ISEL [0] x _ (FlagLT))
  6032  	// result: x
  6033  	for {
  6034  		if auxIntToInt32(v.AuxInt) != 0 {
  6035  			break
  6036  		}
  6037  		x := v_0
  6038  		if v_2.Op != OpPPC64FlagLT {
  6039  			break
  6040  		}
  6041  		v.copyOf(x)
  6042  		return true
  6043  	}
  6044  	// match: (ISEL [5] _ x (FlagEQ))
  6045  	// result: x
  6046  	for {
  6047  		if auxIntToInt32(v.AuxInt) != 5 {
  6048  			break
  6049  		}
  6050  		x := v_1
  6051  		if v_2.Op != OpPPC64FlagEQ {
  6052  			break
  6053  		}
  6054  		v.copyOf(x)
  6055  		return true
  6056  	}
  6057  	// match: (ISEL [5] _ x (FlagLT))
  6058  	// result: x
  6059  	for {
  6060  		if auxIntToInt32(v.AuxInt) != 5 {
  6061  			break
  6062  		}
  6063  		x := v_1
  6064  		if v_2.Op != OpPPC64FlagLT {
  6065  			break
  6066  		}
  6067  		v.copyOf(x)
  6068  		return true
  6069  	}
  6070  	// match: (ISEL [5] y _ (FlagGT))
  6071  	// result: y
  6072  	for {
  6073  		if auxIntToInt32(v.AuxInt) != 5 {
  6074  			break
  6075  		}
  6076  		y := v_0
  6077  		if v_2.Op != OpPPC64FlagGT {
  6078  			break
  6079  		}
  6080  		v.copyOf(y)
  6081  		return true
  6082  	}
  6083  	// match: (ISEL [1] _ y (FlagEQ))
  6084  	// result: y
  6085  	for {
  6086  		if auxIntToInt32(v.AuxInt) != 1 {
  6087  			break
  6088  		}
  6089  		y := v_1
  6090  		if v_2.Op != OpPPC64FlagEQ {
  6091  			break
  6092  		}
  6093  		v.copyOf(y)
  6094  		return true
  6095  	}
  6096  	// match: (ISEL [1] _ y (FlagLT))
  6097  	// result: y
  6098  	for {
  6099  		if auxIntToInt32(v.AuxInt) != 1 {
  6100  			break
  6101  		}
  6102  		y := v_1
  6103  		if v_2.Op != OpPPC64FlagLT {
  6104  			break
  6105  		}
  6106  		v.copyOf(y)
  6107  		return true
  6108  	}
  6109  	// match: (ISEL [1] x _ (FlagGT))
  6110  	// result: x
  6111  	for {
  6112  		if auxIntToInt32(v.AuxInt) != 1 {
  6113  			break
  6114  		}
  6115  		x := v_0
  6116  		if v_2.Op != OpPPC64FlagGT {
  6117  			break
  6118  		}
  6119  		v.copyOf(x)
  6120  		return true
  6121  	}
  6122  	// match: (ISEL [4] x _ (FlagEQ))
  6123  	// result: x
  6124  	for {
  6125  		if auxIntToInt32(v.AuxInt) != 4 {
  6126  			break
  6127  		}
  6128  		x := v_0
  6129  		if v_2.Op != OpPPC64FlagEQ {
  6130  			break
  6131  		}
  6132  		v.copyOf(x)
  6133  		return true
  6134  	}
  6135  	// match: (ISEL [4] x _ (FlagGT))
  6136  	// result: x
  6137  	for {
  6138  		if auxIntToInt32(v.AuxInt) != 4 {
  6139  			break
  6140  		}
  6141  		x := v_0
  6142  		if v_2.Op != OpPPC64FlagGT {
  6143  			break
  6144  		}
  6145  		v.copyOf(x)
  6146  		return true
  6147  	}
  6148  	// match: (ISEL [4] _ y (FlagLT))
  6149  	// result: y
  6150  	for {
  6151  		if auxIntToInt32(v.AuxInt) != 4 {
  6152  			break
  6153  		}
  6154  		y := v_1
  6155  		if v_2.Op != OpPPC64FlagLT {
  6156  			break
  6157  		}
  6158  		v.copyOf(y)
  6159  		return true
  6160  	}
  6161  	// match: (ISEL [n] x y (InvertFlags bool))
  6162  	// cond: n%4 == 0
  6163  	// result: (ISEL [n+1] x y bool)
  6164  	for {
  6165  		n := auxIntToInt32(v.AuxInt)
  6166  		x := v_0
  6167  		y := v_1
  6168  		if v_2.Op != OpPPC64InvertFlags {
  6169  			break
  6170  		}
  6171  		bool := v_2.Args[0]
  6172  		if !(n%4 == 0) {
  6173  			break
  6174  		}
  6175  		v.reset(OpPPC64ISEL)
  6176  		v.AuxInt = int32ToAuxInt(n + 1)
  6177  		v.AddArg3(x, y, bool)
  6178  		return true
  6179  	}
  6180  	// match: (ISEL [n] x y (InvertFlags bool))
  6181  	// cond: n%4 == 1
  6182  	// result: (ISEL [n-1] x y bool)
  6183  	for {
  6184  		n := auxIntToInt32(v.AuxInt)
  6185  		x := v_0
  6186  		y := v_1
  6187  		if v_2.Op != OpPPC64InvertFlags {
  6188  			break
  6189  		}
  6190  		bool := v_2.Args[0]
  6191  		if !(n%4 == 1) {
  6192  			break
  6193  		}
  6194  		v.reset(OpPPC64ISEL)
  6195  		v.AuxInt = int32ToAuxInt(n - 1)
  6196  		v.AddArg3(x, y, bool)
  6197  		return true
  6198  	}
  6199  	// match: (ISEL [n] x y (InvertFlags bool))
  6200  	// cond: n%4 == 2
  6201  	// result: (ISEL [n] x y bool)
  6202  	for {
  6203  		n := auxIntToInt32(v.AuxInt)
  6204  		x := v_0
  6205  		y := v_1
  6206  		if v_2.Op != OpPPC64InvertFlags {
  6207  			break
  6208  		}
  6209  		bool := v_2.Args[0]
  6210  		if !(n%4 == 2) {
  6211  			break
  6212  		}
  6213  		v.reset(OpPPC64ISEL)
  6214  		v.AuxInt = int32ToAuxInt(n)
  6215  		v.AddArg3(x, y, bool)
  6216  		return true
  6217  	}
  6218  	return false
  6219  }
  6220  func rewriteValuePPC64_OpPPC64ISELB(v *Value) bool {
  6221  	v_1 := v.Args[1]
  6222  	v_0 := v.Args[0]
  6223  	b := v.Block
  6224  	typ := &b.Func.Config.Types
  6225  	// match: (ISELB [0] _ (FlagLT))
  6226  	// result: (MOVDconst [1])
  6227  	for {
  6228  		if auxIntToInt32(v.AuxInt) != 0 || v_1.Op != OpPPC64FlagLT {
  6229  			break
  6230  		}
  6231  		v.reset(OpPPC64MOVDconst)
  6232  		v.AuxInt = int64ToAuxInt(1)
  6233  		return true
  6234  	}
  6235  	// match: (ISELB [0] _ (FlagGT))
  6236  	// result: (MOVDconst [0])
  6237  	for {
  6238  		if auxIntToInt32(v.AuxInt) != 0 || v_1.Op != OpPPC64FlagGT {
  6239  			break
  6240  		}
  6241  		v.reset(OpPPC64MOVDconst)
  6242  		v.AuxInt = int64ToAuxInt(0)
  6243  		return true
  6244  	}
  6245  	// match: (ISELB [0] _ (FlagEQ))
  6246  	// result: (MOVDconst [0])
  6247  	for {
  6248  		if auxIntToInt32(v.AuxInt) != 0 || v_1.Op != OpPPC64FlagEQ {
  6249  			break
  6250  		}
  6251  		v.reset(OpPPC64MOVDconst)
  6252  		v.AuxInt = int64ToAuxInt(0)
  6253  		return true
  6254  	}
  6255  	// match: (ISELB [1] _ (FlagGT))
  6256  	// result: (MOVDconst [1])
  6257  	for {
  6258  		if auxIntToInt32(v.AuxInt) != 1 || v_1.Op != OpPPC64FlagGT {
  6259  			break
  6260  		}
  6261  		v.reset(OpPPC64MOVDconst)
  6262  		v.AuxInt = int64ToAuxInt(1)
  6263  		return true
  6264  	}
  6265  	// match: (ISELB [1] _ (FlagLT))
  6266  	// result: (MOVDconst [0])
  6267  	for {
  6268  		if auxIntToInt32(v.AuxInt) != 1 || v_1.Op != OpPPC64FlagLT {
  6269  			break
  6270  		}
  6271  		v.reset(OpPPC64MOVDconst)
  6272  		v.AuxInt = int64ToAuxInt(0)
  6273  		return true
  6274  	}
  6275  	// match: (ISELB [1] _ (FlagEQ))
  6276  	// result: (MOVDconst [0])
  6277  	for {
  6278  		if auxIntToInt32(v.AuxInt) != 1 || v_1.Op != OpPPC64FlagEQ {
  6279  			break
  6280  		}
  6281  		v.reset(OpPPC64MOVDconst)
  6282  		v.AuxInt = int64ToAuxInt(0)
  6283  		return true
  6284  	}
  6285  	// match: (ISELB [2] _ (FlagEQ))
  6286  	// result: (MOVDconst [1])
  6287  	for {
  6288  		if auxIntToInt32(v.AuxInt) != 2 || v_1.Op != OpPPC64FlagEQ {
  6289  			break
  6290  		}
  6291  		v.reset(OpPPC64MOVDconst)
  6292  		v.AuxInt = int64ToAuxInt(1)
  6293  		return true
  6294  	}
  6295  	// match: (ISELB [2] _ (FlagLT))
  6296  	// result: (MOVDconst [0])
  6297  	for {
  6298  		if auxIntToInt32(v.AuxInt) != 2 || v_1.Op != OpPPC64FlagLT {
  6299  			break
  6300  		}
  6301  		v.reset(OpPPC64MOVDconst)
  6302  		v.AuxInt = int64ToAuxInt(0)
  6303  		return true
  6304  	}
  6305  	// match: (ISELB [2] _ (FlagGT))
  6306  	// result: (MOVDconst [0])
  6307  	for {
  6308  		if auxIntToInt32(v.AuxInt) != 2 || v_1.Op != OpPPC64FlagGT {
  6309  			break
  6310  		}
  6311  		v.reset(OpPPC64MOVDconst)
  6312  		v.AuxInt = int64ToAuxInt(0)
  6313  		return true
  6314  	}
  6315  	// match: (ISELB [4] _ (FlagLT))
  6316  	// result: (MOVDconst [0])
  6317  	for {
  6318  		if auxIntToInt32(v.AuxInt) != 4 || v_1.Op != OpPPC64FlagLT {
  6319  			break
  6320  		}
  6321  		v.reset(OpPPC64MOVDconst)
  6322  		v.AuxInt = int64ToAuxInt(0)
  6323  		return true
  6324  	}
  6325  	// match: (ISELB [4] _ (FlagGT))
  6326  	// result: (MOVDconst [1])
  6327  	for {
  6328  		if auxIntToInt32(v.AuxInt) != 4 || v_1.Op != OpPPC64FlagGT {
  6329  			break
  6330  		}
  6331  		v.reset(OpPPC64MOVDconst)
  6332  		v.AuxInt = int64ToAuxInt(1)
  6333  		return true
  6334  	}
  6335  	// match: (ISELB [4] _ (FlagEQ))
  6336  	// result: (MOVDconst [1])
  6337  	for {
  6338  		if auxIntToInt32(v.AuxInt) != 4 || v_1.Op != OpPPC64FlagEQ {
  6339  			break
  6340  		}
  6341  		v.reset(OpPPC64MOVDconst)
  6342  		v.AuxInt = int64ToAuxInt(1)
  6343  		return true
  6344  	}
  6345  	// match: (ISELB [5] _ (FlagGT))
  6346  	// result: (MOVDconst [0])
  6347  	for {
  6348  		if auxIntToInt32(v.AuxInt) != 5 || v_1.Op != OpPPC64FlagGT {
  6349  			break
  6350  		}
  6351  		v.reset(OpPPC64MOVDconst)
  6352  		v.AuxInt = int64ToAuxInt(0)
  6353  		return true
  6354  	}
  6355  	// match: (ISELB [5] _ (FlagLT))
  6356  	// result: (MOVDconst [1])
  6357  	for {
  6358  		if auxIntToInt32(v.AuxInt) != 5 || v_1.Op != OpPPC64FlagLT {
  6359  			break
  6360  		}
  6361  		v.reset(OpPPC64MOVDconst)
  6362  		v.AuxInt = int64ToAuxInt(1)
  6363  		return true
  6364  	}
  6365  	// match: (ISELB [5] _ (FlagEQ))
  6366  	// result: (MOVDconst [1])
  6367  	for {
  6368  		if auxIntToInt32(v.AuxInt) != 5 || v_1.Op != OpPPC64FlagEQ {
  6369  			break
  6370  		}
  6371  		v.reset(OpPPC64MOVDconst)
  6372  		v.AuxInt = int64ToAuxInt(1)
  6373  		return true
  6374  	}
  6375  	// match: (ISELB [6] _ (FlagEQ))
  6376  	// result: (MOVDconst [0])
  6377  	for {
  6378  		if auxIntToInt32(v.AuxInt) != 6 || v_1.Op != OpPPC64FlagEQ {
  6379  			break
  6380  		}
  6381  		v.reset(OpPPC64MOVDconst)
  6382  		v.AuxInt = int64ToAuxInt(0)
  6383  		return true
  6384  	}
  6385  	// match: (ISELB [6] _ (FlagLT))
  6386  	// result: (MOVDconst [1])
  6387  	for {
  6388  		if auxIntToInt32(v.AuxInt) != 6 || v_1.Op != OpPPC64FlagLT {
  6389  			break
  6390  		}
  6391  		v.reset(OpPPC64MOVDconst)
  6392  		v.AuxInt = int64ToAuxInt(1)
  6393  		return true
  6394  	}
  6395  	// match: (ISELB [6] _ (FlagGT))
  6396  	// result: (MOVDconst [1])
  6397  	for {
  6398  		if auxIntToInt32(v.AuxInt) != 6 || v_1.Op != OpPPC64FlagGT {
  6399  			break
  6400  		}
  6401  		v.reset(OpPPC64MOVDconst)
  6402  		v.AuxInt = int64ToAuxInt(1)
  6403  		return true
  6404  	}
  6405  	// match: (ISELB [n] (MOVDconst [1]) (InvertFlags bool))
  6406  	// cond: n%4 == 0
  6407  	// result: (ISELB [n+1] (MOVDconst [1]) bool)
  6408  	for {
  6409  		n := auxIntToInt32(v.AuxInt)
  6410  		if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 || v_1.Op != OpPPC64InvertFlags {
  6411  			break
  6412  		}
  6413  		bool := v_1.Args[0]
  6414  		if !(n%4 == 0) {
  6415  			break
  6416  		}
  6417  		v.reset(OpPPC64ISELB)
  6418  		v.AuxInt = int32ToAuxInt(n + 1)
  6419  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  6420  		v0.AuxInt = int64ToAuxInt(1)
  6421  		v.AddArg2(v0, bool)
  6422  		return true
  6423  	}
  6424  	// match: (ISELB [n] (MOVDconst [1]) (InvertFlags bool))
  6425  	// cond: n%4 == 1
  6426  	// result: (ISELB [n-1] (MOVDconst [1]) bool)
  6427  	for {
  6428  		n := auxIntToInt32(v.AuxInt)
  6429  		if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 || v_1.Op != OpPPC64InvertFlags {
  6430  			break
  6431  		}
  6432  		bool := v_1.Args[0]
  6433  		if !(n%4 == 1) {
  6434  			break
  6435  		}
  6436  		v.reset(OpPPC64ISELB)
  6437  		v.AuxInt = int32ToAuxInt(n - 1)
  6438  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  6439  		v0.AuxInt = int64ToAuxInt(1)
  6440  		v.AddArg2(v0, bool)
  6441  		return true
  6442  	}
  6443  	// match: (ISELB [n] (MOVDconst [1]) (InvertFlags bool))
  6444  	// cond: n%4 == 2
  6445  	// result: (ISELB [n] (MOVDconst [1]) bool)
  6446  	for {
  6447  		n := auxIntToInt32(v.AuxInt)
  6448  		if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 || v_1.Op != OpPPC64InvertFlags {
  6449  			break
  6450  		}
  6451  		bool := v_1.Args[0]
  6452  		if !(n%4 == 2) {
  6453  			break
  6454  		}
  6455  		v.reset(OpPPC64ISELB)
  6456  		v.AuxInt = int32ToAuxInt(n)
  6457  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  6458  		v0.AuxInt = int64ToAuxInt(1)
  6459  		v.AddArg2(v0, bool)
  6460  		return true
  6461  	}
  6462  	return false
  6463  }
  6464  func rewriteValuePPC64_OpPPC64LessEqual(v *Value) bool {
  6465  	v_0 := v.Args[0]
  6466  	b := v.Block
  6467  	typ := &b.Func.Config.Types
  6468  	// match: (LessEqual (FlagEQ))
  6469  	// result: (MOVDconst [1])
  6470  	for {
  6471  		if v_0.Op != OpPPC64FlagEQ {
  6472  			break
  6473  		}
  6474  		v.reset(OpPPC64MOVDconst)
  6475  		v.AuxInt = int64ToAuxInt(1)
  6476  		return true
  6477  	}
  6478  	// match: (LessEqual (FlagLT))
  6479  	// result: (MOVDconst [1])
  6480  	for {
  6481  		if v_0.Op != OpPPC64FlagLT {
  6482  			break
  6483  		}
  6484  		v.reset(OpPPC64MOVDconst)
  6485  		v.AuxInt = int64ToAuxInt(1)
  6486  		return true
  6487  	}
  6488  	// match: (LessEqual (FlagGT))
  6489  	// result: (MOVDconst [0])
  6490  	for {
  6491  		if v_0.Op != OpPPC64FlagGT {
  6492  			break
  6493  		}
  6494  		v.reset(OpPPC64MOVDconst)
  6495  		v.AuxInt = int64ToAuxInt(0)
  6496  		return true
  6497  	}
  6498  	// match: (LessEqual (InvertFlags x))
  6499  	// result: (GreaterEqual x)
  6500  	for {
  6501  		if v_0.Op != OpPPC64InvertFlags {
  6502  			break
  6503  		}
  6504  		x := v_0.Args[0]
  6505  		v.reset(OpPPC64GreaterEqual)
  6506  		v.AddArg(x)
  6507  		return true
  6508  	}
  6509  	// match: (LessEqual cmp)
  6510  	// result: (ISELB [5] (MOVDconst [1]) cmp)
  6511  	for {
  6512  		cmp := v_0
  6513  		v.reset(OpPPC64ISELB)
  6514  		v.AuxInt = int32ToAuxInt(5)
  6515  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  6516  		v0.AuxInt = int64ToAuxInt(1)
  6517  		v.AddArg2(v0, cmp)
  6518  		return true
  6519  	}
  6520  }
  6521  func rewriteValuePPC64_OpPPC64LessThan(v *Value) bool {
  6522  	v_0 := v.Args[0]
  6523  	b := v.Block
  6524  	typ := &b.Func.Config.Types
  6525  	// match: (LessThan (FlagEQ))
  6526  	// result: (MOVDconst [0])
  6527  	for {
  6528  		if v_0.Op != OpPPC64FlagEQ {
  6529  			break
  6530  		}
  6531  		v.reset(OpPPC64MOVDconst)
  6532  		v.AuxInt = int64ToAuxInt(0)
  6533  		return true
  6534  	}
  6535  	// match: (LessThan (FlagLT))
  6536  	// result: (MOVDconst [1])
  6537  	for {
  6538  		if v_0.Op != OpPPC64FlagLT {
  6539  			break
  6540  		}
  6541  		v.reset(OpPPC64MOVDconst)
  6542  		v.AuxInt = int64ToAuxInt(1)
  6543  		return true
  6544  	}
  6545  	// match: (LessThan (FlagGT))
  6546  	// result: (MOVDconst [0])
  6547  	for {
  6548  		if v_0.Op != OpPPC64FlagGT {
  6549  			break
  6550  		}
  6551  		v.reset(OpPPC64MOVDconst)
  6552  		v.AuxInt = int64ToAuxInt(0)
  6553  		return true
  6554  	}
  6555  	// match: (LessThan (InvertFlags x))
  6556  	// result: (GreaterThan x)
  6557  	for {
  6558  		if v_0.Op != OpPPC64InvertFlags {
  6559  			break
  6560  		}
  6561  		x := v_0.Args[0]
  6562  		v.reset(OpPPC64GreaterThan)
  6563  		v.AddArg(x)
  6564  		return true
  6565  	}
  6566  	// match: (LessThan cmp)
  6567  	// result: (ISELB [0] (MOVDconst [1]) cmp)
  6568  	for {
  6569  		cmp := v_0
  6570  		v.reset(OpPPC64ISELB)
  6571  		v.AuxInt = int32ToAuxInt(0)
  6572  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  6573  		v0.AuxInt = int64ToAuxInt(1)
  6574  		v.AddArg2(v0, cmp)
  6575  		return true
  6576  	}
  6577  }
  6578  func rewriteValuePPC64_OpPPC64MFVSRD(v *Value) bool {
  6579  	v_0 := v.Args[0]
  6580  	b := v.Block
  6581  	typ := &b.Func.Config.Types
  6582  	// match: (MFVSRD (FMOVDconst [c]))
  6583  	// result: (MOVDconst [int64(math.Float64bits(c))])
  6584  	for {
  6585  		if v_0.Op != OpPPC64FMOVDconst {
  6586  			break
  6587  		}
  6588  		c := auxIntToFloat64(v_0.AuxInt)
  6589  		v.reset(OpPPC64MOVDconst)
  6590  		v.AuxInt = int64ToAuxInt(int64(math.Float64bits(c)))
  6591  		return true
  6592  	}
  6593  	// match: (MFVSRD x:(FMOVDload [off] {sym} ptr mem))
  6594  	// cond: x.Uses == 1 && clobber(x)
  6595  	// result: @x.Block (MOVDload [off] {sym} ptr mem)
  6596  	for {
  6597  		x := v_0
  6598  		if x.Op != OpPPC64FMOVDload {
  6599  			break
  6600  		}
  6601  		off := auxIntToInt32(x.AuxInt)
  6602  		sym := auxToSym(x.Aux)
  6603  		mem := x.Args[1]
  6604  		ptr := x.Args[0]
  6605  		if !(x.Uses == 1 && clobber(x)) {
  6606  			break
  6607  		}
  6608  		b = x.Block
  6609  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDload, typ.Int64)
  6610  		v.copyOf(v0)
  6611  		v0.AuxInt = int32ToAuxInt(off)
  6612  		v0.Aux = symToAux(sym)
  6613  		v0.AddArg2(ptr, mem)
  6614  		return true
  6615  	}
  6616  	return false
  6617  }
  6618  func rewriteValuePPC64_OpPPC64MOVBZload(v *Value) bool {
  6619  	v_1 := v.Args[1]
  6620  	v_0 := v.Args[0]
  6621  	// match: (MOVBZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  6622  	// cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
  6623  	// result: (MOVBZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  6624  	for {
  6625  		off1 := auxIntToInt32(v.AuxInt)
  6626  		sym1 := auxToSym(v.Aux)
  6627  		p := v_0
  6628  		if p.Op != OpPPC64MOVDaddr {
  6629  			break
  6630  		}
  6631  		off2 := auxIntToInt32(p.AuxInt)
  6632  		sym2 := auxToSym(p.Aux)
  6633  		ptr := p.Args[0]
  6634  		mem := v_1
  6635  		if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
  6636  			break
  6637  		}
  6638  		v.reset(OpPPC64MOVBZload)
  6639  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6640  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6641  		v.AddArg2(ptr, mem)
  6642  		return true
  6643  	}
  6644  	// match: (MOVBZload [off1] {sym} (ADDconst [off2] x) mem)
  6645  	// cond: is16Bit(int64(off1)+off2)
  6646  	// result: (MOVBZload [off1+int32(off2)] {sym} x mem)
  6647  	for {
  6648  		off1 := auxIntToInt32(v.AuxInt)
  6649  		sym := auxToSym(v.Aux)
  6650  		if v_0.Op != OpPPC64ADDconst {
  6651  			break
  6652  		}
  6653  		off2 := auxIntToInt64(v_0.AuxInt)
  6654  		x := v_0.Args[0]
  6655  		mem := v_1
  6656  		if !(is16Bit(int64(off1) + off2)) {
  6657  			break
  6658  		}
  6659  		v.reset(OpPPC64MOVBZload)
  6660  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6661  		v.Aux = symToAux(sym)
  6662  		v.AddArg2(x, mem)
  6663  		return true
  6664  	}
  6665  	// match: (MOVBZload [0] {sym} p:(ADD ptr idx) mem)
  6666  	// cond: sym == nil && p.Uses == 1
  6667  	// result: (MOVBZloadidx ptr idx mem)
  6668  	for {
  6669  		if auxIntToInt32(v.AuxInt) != 0 {
  6670  			break
  6671  		}
  6672  		sym := auxToSym(v.Aux)
  6673  		p := v_0
  6674  		if p.Op != OpPPC64ADD {
  6675  			break
  6676  		}
  6677  		idx := p.Args[1]
  6678  		ptr := p.Args[0]
  6679  		mem := v_1
  6680  		if !(sym == nil && p.Uses == 1) {
  6681  			break
  6682  		}
  6683  		v.reset(OpPPC64MOVBZloadidx)
  6684  		v.AddArg3(ptr, idx, mem)
  6685  		return true
  6686  	}
  6687  	return false
  6688  }
  6689  func rewriteValuePPC64_OpPPC64MOVBZloadidx(v *Value) bool {
  6690  	v_2 := v.Args[2]
  6691  	v_1 := v.Args[1]
  6692  	v_0 := v.Args[0]
  6693  	// match: (MOVBZloadidx ptr (MOVDconst [c]) mem)
  6694  	// cond: is16Bit(c)
  6695  	// result: (MOVBZload [int32(c)] ptr mem)
  6696  	for {
  6697  		ptr := v_0
  6698  		if v_1.Op != OpPPC64MOVDconst {
  6699  			break
  6700  		}
  6701  		c := auxIntToInt64(v_1.AuxInt)
  6702  		mem := v_2
  6703  		if !(is16Bit(c)) {
  6704  			break
  6705  		}
  6706  		v.reset(OpPPC64MOVBZload)
  6707  		v.AuxInt = int32ToAuxInt(int32(c))
  6708  		v.AddArg2(ptr, mem)
  6709  		return true
  6710  	}
  6711  	// match: (MOVBZloadidx (MOVDconst [c]) ptr mem)
  6712  	// cond: is16Bit(c)
  6713  	// result: (MOVBZload [int32(c)] ptr mem)
  6714  	for {
  6715  		if v_0.Op != OpPPC64MOVDconst {
  6716  			break
  6717  		}
  6718  		c := auxIntToInt64(v_0.AuxInt)
  6719  		ptr := v_1
  6720  		mem := v_2
  6721  		if !(is16Bit(c)) {
  6722  			break
  6723  		}
  6724  		v.reset(OpPPC64MOVBZload)
  6725  		v.AuxInt = int32ToAuxInt(int32(c))
  6726  		v.AddArg2(ptr, mem)
  6727  		return true
  6728  	}
  6729  	return false
  6730  }
  6731  func rewriteValuePPC64_OpPPC64MOVBZreg(v *Value) bool {
  6732  	v_0 := v.Args[0]
  6733  	b := v.Block
  6734  	typ := &b.Func.Config.Types
  6735  	// match: (MOVBZreg y:(ANDconst [c] _))
  6736  	// cond: uint64(c) <= 0xFF
  6737  	// result: y
  6738  	for {
  6739  		y := v_0
  6740  		if y.Op != OpPPC64ANDconst {
  6741  			break
  6742  		}
  6743  		c := auxIntToInt64(y.AuxInt)
  6744  		if !(uint64(c) <= 0xFF) {
  6745  			break
  6746  		}
  6747  		v.copyOf(y)
  6748  		return true
  6749  	}
  6750  	// match: (MOVBZreg (SRWconst [c] (MOVBZreg x)))
  6751  	// result: (SRWconst [c] (MOVBZreg x))
  6752  	for {
  6753  		if v_0.Op != OpPPC64SRWconst {
  6754  			break
  6755  		}
  6756  		c := auxIntToInt64(v_0.AuxInt)
  6757  		v_0_0 := v_0.Args[0]
  6758  		if v_0_0.Op != OpPPC64MOVBZreg {
  6759  			break
  6760  		}
  6761  		x := v_0_0.Args[0]
  6762  		v.reset(OpPPC64SRWconst)
  6763  		v.AuxInt = int64ToAuxInt(c)
  6764  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  6765  		v0.AddArg(x)
  6766  		v.AddArg(v0)
  6767  		return true
  6768  	}
  6769  	// match: (MOVBZreg (SRWconst [c] x))
  6770  	// cond: sizeof(x.Type) == 8
  6771  	// result: (SRWconst [c] x)
  6772  	for {
  6773  		if v_0.Op != OpPPC64SRWconst {
  6774  			break
  6775  		}
  6776  		c := auxIntToInt64(v_0.AuxInt)
  6777  		x := v_0.Args[0]
  6778  		if !(sizeof(x.Type) == 8) {
  6779  			break
  6780  		}
  6781  		v.reset(OpPPC64SRWconst)
  6782  		v.AuxInt = int64ToAuxInt(c)
  6783  		v.AddArg(x)
  6784  		return true
  6785  	}
  6786  	// match: (MOVBZreg (SRDconst [c] x))
  6787  	// cond: c>=56
  6788  	// result: (SRDconst [c] x)
  6789  	for {
  6790  		if v_0.Op != OpPPC64SRDconst {
  6791  			break
  6792  		}
  6793  		c := auxIntToInt64(v_0.AuxInt)
  6794  		x := v_0.Args[0]
  6795  		if !(c >= 56) {
  6796  			break
  6797  		}
  6798  		v.reset(OpPPC64SRDconst)
  6799  		v.AuxInt = int64ToAuxInt(c)
  6800  		v.AddArg(x)
  6801  		return true
  6802  	}
  6803  	// match: (MOVBZreg (SRWconst [c] x))
  6804  	// cond: c>=24
  6805  	// result: (SRWconst [c] x)
  6806  	for {
  6807  		if v_0.Op != OpPPC64SRWconst {
  6808  			break
  6809  		}
  6810  		c := auxIntToInt64(v_0.AuxInt)
  6811  		x := v_0.Args[0]
  6812  		if !(c >= 24) {
  6813  			break
  6814  		}
  6815  		v.reset(OpPPC64SRWconst)
  6816  		v.AuxInt = int64ToAuxInt(c)
  6817  		v.AddArg(x)
  6818  		return true
  6819  	}
  6820  	// match: (MOVBZreg y:(MOVBZreg _))
  6821  	// result: y
  6822  	for {
  6823  		y := v_0
  6824  		if y.Op != OpPPC64MOVBZreg {
  6825  			break
  6826  		}
  6827  		v.copyOf(y)
  6828  		return true
  6829  	}
  6830  	// match: (MOVBZreg (MOVBreg x))
  6831  	// result: (MOVBZreg x)
  6832  	for {
  6833  		if v_0.Op != OpPPC64MOVBreg {
  6834  			break
  6835  		}
  6836  		x := v_0.Args[0]
  6837  		v.reset(OpPPC64MOVBZreg)
  6838  		v.AddArg(x)
  6839  		return true
  6840  	}
  6841  	// match: (MOVBZreg (OR <t> x (MOVWZreg y)))
  6842  	// result: (MOVBZreg (OR <t> x y))
  6843  	for {
  6844  		if v_0.Op != OpPPC64OR {
  6845  			break
  6846  		}
  6847  		t := v_0.Type
  6848  		_ = v_0.Args[1]
  6849  		v_0_0 := v_0.Args[0]
  6850  		v_0_1 := v_0.Args[1]
  6851  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6852  			x := v_0_0
  6853  			if v_0_1.Op != OpPPC64MOVWZreg {
  6854  				continue
  6855  			}
  6856  			y := v_0_1.Args[0]
  6857  			v.reset(OpPPC64MOVBZreg)
  6858  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  6859  			v0.AddArg2(x, y)
  6860  			v.AddArg(v0)
  6861  			return true
  6862  		}
  6863  		break
  6864  	}
  6865  	// match: (MOVBZreg (XOR <t> x (MOVWZreg y)))
  6866  	// result: (MOVBZreg (XOR <t> x y))
  6867  	for {
  6868  		if v_0.Op != OpPPC64XOR {
  6869  			break
  6870  		}
  6871  		t := v_0.Type
  6872  		_ = v_0.Args[1]
  6873  		v_0_0 := v_0.Args[0]
  6874  		v_0_1 := v_0.Args[1]
  6875  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6876  			x := v_0_0
  6877  			if v_0_1.Op != OpPPC64MOVWZreg {
  6878  				continue
  6879  			}
  6880  			y := v_0_1.Args[0]
  6881  			v.reset(OpPPC64MOVBZreg)
  6882  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  6883  			v0.AddArg2(x, y)
  6884  			v.AddArg(v0)
  6885  			return true
  6886  		}
  6887  		break
  6888  	}
  6889  	// match: (MOVBZreg (AND <t> x (MOVWZreg y)))
  6890  	// result: (MOVBZreg (AND <t> x y))
  6891  	for {
  6892  		if v_0.Op != OpPPC64AND {
  6893  			break
  6894  		}
  6895  		t := v_0.Type
  6896  		_ = v_0.Args[1]
  6897  		v_0_0 := v_0.Args[0]
  6898  		v_0_1 := v_0.Args[1]
  6899  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6900  			x := v_0_0
  6901  			if v_0_1.Op != OpPPC64MOVWZreg {
  6902  				continue
  6903  			}
  6904  			y := v_0_1.Args[0]
  6905  			v.reset(OpPPC64MOVBZreg)
  6906  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  6907  			v0.AddArg2(x, y)
  6908  			v.AddArg(v0)
  6909  			return true
  6910  		}
  6911  		break
  6912  	}
  6913  	// match: (MOVBZreg (OR <t> x (MOVHZreg y)))
  6914  	// result: (MOVBZreg (OR <t> x y))
  6915  	for {
  6916  		if v_0.Op != OpPPC64OR {
  6917  			break
  6918  		}
  6919  		t := v_0.Type
  6920  		_ = v_0.Args[1]
  6921  		v_0_0 := v_0.Args[0]
  6922  		v_0_1 := v_0.Args[1]
  6923  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6924  			x := v_0_0
  6925  			if v_0_1.Op != OpPPC64MOVHZreg {
  6926  				continue
  6927  			}
  6928  			y := v_0_1.Args[0]
  6929  			v.reset(OpPPC64MOVBZreg)
  6930  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  6931  			v0.AddArg2(x, y)
  6932  			v.AddArg(v0)
  6933  			return true
  6934  		}
  6935  		break
  6936  	}
  6937  	// match: (MOVBZreg (XOR <t> x (MOVHZreg y)))
  6938  	// result: (MOVBZreg (XOR <t> x y))
  6939  	for {
  6940  		if v_0.Op != OpPPC64XOR {
  6941  			break
  6942  		}
  6943  		t := v_0.Type
  6944  		_ = v_0.Args[1]
  6945  		v_0_0 := v_0.Args[0]
  6946  		v_0_1 := v_0.Args[1]
  6947  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6948  			x := v_0_0
  6949  			if v_0_1.Op != OpPPC64MOVHZreg {
  6950  				continue
  6951  			}
  6952  			y := v_0_1.Args[0]
  6953  			v.reset(OpPPC64MOVBZreg)
  6954  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  6955  			v0.AddArg2(x, y)
  6956  			v.AddArg(v0)
  6957  			return true
  6958  		}
  6959  		break
  6960  	}
  6961  	// match: (MOVBZreg (AND <t> x (MOVHZreg y)))
  6962  	// result: (MOVBZreg (AND <t> x y))
  6963  	for {
  6964  		if v_0.Op != OpPPC64AND {
  6965  			break
  6966  		}
  6967  		t := v_0.Type
  6968  		_ = v_0.Args[1]
  6969  		v_0_0 := v_0.Args[0]
  6970  		v_0_1 := v_0.Args[1]
  6971  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6972  			x := v_0_0
  6973  			if v_0_1.Op != OpPPC64MOVHZreg {
  6974  				continue
  6975  			}
  6976  			y := v_0_1.Args[0]
  6977  			v.reset(OpPPC64MOVBZreg)
  6978  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  6979  			v0.AddArg2(x, y)
  6980  			v.AddArg(v0)
  6981  			return true
  6982  		}
  6983  		break
  6984  	}
  6985  	// match: (MOVBZreg (OR <t> x (MOVBZreg y)))
  6986  	// result: (MOVBZreg (OR <t> x y))
  6987  	for {
  6988  		if v_0.Op != OpPPC64OR {
  6989  			break
  6990  		}
  6991  		t := v_0.Type
  6992  		_ = v_0.Args[1]
  6993  		v_0_0 := v_0.Args[0]
  6994  		v_0_1 := v_0.Args[1]
  6995  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6996  			x := v_0_0
  6997  			if v_0_1.Op != OpPPC64MOVBZreg {
  6998  				continue
  6999  			}
  7000  			y := v_0_1.Args[0]
  7001  			v.reset(OpPPC64MOVBZreg)
  7002  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  7003  			v0.AddArg2(x, y)
  7004  			v.AddArg(v0)
  7005  			return true
  7006  		}
  7007  		break
  7008  	}
  7009  	// match: (MOVBZreg (XOR <t> x (MOVBZreg y)))
  7010  	// result: (MOVBZreg (XOR <t> x y))
  7011  	for {
  7012  		if v_0.Op != OpPPC64XOR {
  7013  			break
  7014  		}
  7015  		t := v_0.Type
  7016  		_ = v_0.Args[1]
  7017  		v_0_0 := v_0.Args[0]
  7018  		v_0_1 := v_0.Args[1]
  7019  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7020  			x := v_0_0
  7021  			if v_0_1.Op != OpPPC64MOVBZreg {
  7022  				continue
  7023  			}
  7024  			y := v_0_1.Args[0]
  7025  			v.reset(OpPPC64MOVBZreg)
  7026  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  7027  			v0.AddArg2(x, y)
  7028  			v.AddArg(v0)
  7029  			return true
  7030  		}
  7031  		break
  7032  	}
  7033  	// match: (MOVBZreg (AND <t> x (MOVBZreg y)))
  7034  	// result: (MOVBZreg (AND <t> x y))
  7035  	for {
  7036  		if v_0.Op != OpPPC64AND {
  7037  			break
  7038  		}
  7039  		t := v_0.Type
  7040  		_ = v_0.Args[1]
  7041  		v_0_0 := v_0.Args[0]
  7042  		v_0_1 := v_0.Args[1]
  7043  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7044  			x := v_0_0
  7045  			if v_0_1.Op != OpPPC64MOVBZreg {
  7046  				continue
  7047  			}
  7048  			y := v_0_1.Args[0]
  7049  			v.reset(OpPPC64MOVBZreg)
  7050  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  7051  			v0.AddArg2(x, y)
  7052  			v.AddArg(v0)
  7053  			return true
  7054  		}
  7055  		break
  7056  	}
  7057  	// match: (MOVBZreg z:(ANDconst [c] (MOVBZload ptr x)))
  7058  	// result: z
  7059  	for {
  7060  		z := v_0
  7061  		if z.Op != OpPPC64ANDconst {
  7062  			break
  7063  		}
  7064  		z_0 := z.Args[0]
  7065  		if z_0.Op != OpPPC64MOVBZload {
  7066  			break
  7067  		}
  7068  		v.copyOf(z)
  7069  		return true
  7070  	}
  7071  	// match: (MOVBZreg z:(AND y (MOVBZload ptr x)))
  7072  	// result: z
  7073  	for {
  7074  		z := v_0
  7075  		if z.Op != OpPPC64AND {
  7076  			break
  7077  		}
  7078  		_ = z.Args[1]
  7079  		z_0 := z.Args[0]
  7080  		z_1 := z.Args[1]
  7081  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
  7082  			if z_1.Op != OpPPC64MOVBZload {
  7083  				continue
  7084  			}
  7085  			v.copyOf(z)
  7086  			return true
  7087  		}
  7088  		break
  7089  	}
  7090  	// match: (MOVBZreg x:(MOVBZload _ _))
  7091  	// result: x
  7092  	for {
  7093  		x := v_0
  7094  		if x.Op != OpPPC64MOVBZload {
  7095  			break
  7096  		}
  7097  		v.copyOf(x)
  7098  		return true
  7099  	}
  7100  	// match: (MOVBZreg x:(MOVBZloadidx _ _ _))
  7101  	// result: x
  7102  	for {
  7103  		x := v_0
  7104  		if x.Op != OpPPC64MOVBZloadidx {
  7105  			break
  7106  		}
  7107  		v.copyOf(x)
  7108  		return true
  7109  	}
  7110  	// match: (MOVBZreg x:(Arg <t>))
  7111  	// cond: is8BitInt(t) && !isSigned(t)
  7112  	// result: x
  7113  	for {
  7114  		x := v_0
  7115  		if x.Op != OpArg {
  7116  			break
  7117  		}
  7118  		t := x.Type
  7119  		if !(is8BitInt(t) && !isSigned(t)) {
  7120  			break
  7121  		}
  7122  		v.copyOf(x)
  7123  		return true
  7124  	}
  7125  	// match: (MOVBZreg (MOVDconst [c]))
  7126  	// result: (MOVDconst [int64(uint8(c))])
  7127  	for {
  7128  		if v_0.Op != OpPPC64MOVDconst {
  7129  			break
  7130  		}
  7131  		c := auxIntToInt64(v_0.AuxInt)
  7132  		v.reset(OpPPC64MOVDconst)
  7133  		v.AuxInt = int64ToAuxInt(int64(uint8(c)))
  7134  		return true
  7135  	}
  7136  	return false
  7137  }
  7138  func rewriteValuePPC64_OpPPC64MOVBreg(v *Value) bool {
  7139  	v_0 := v.Args[0]
  7140  	b := v.Block
  7141  	typ := &b.Func.Config.Types
  7142  	// match: (MOVBreg y:(ANDconst [c] _))
  7143  	// cond: uint64(c) <= 0x7F
  7144  	// result: y
  7145  	for {
  7146  		y := v_0
  7147  		if y.Op != OpPPC64ANDconst {
  7148  			break
  7149  		}
  7150  		c := auxIntToInt64(y.AuxInt)
  7151  		if !(uint64(c) <= 0x7F) {
  7152  			break
  7153  		}
  7154  		v.copyOf(y)
  7155  		return true
  7156  	}
  7157  	// match: (MOVBreg (SRAWconst [c] (MOVBreg x)))
  7158  	// result: (SRAWconst [c] (MOVBreg x))
  7159  	for {
  7160  		if v_0.Op != OpPPC64SRAWconst {
  7161  			break
  7162  		}
  7163  		c := auxIntToInt64(v_0.AuxInt)
  7164  		v_0_0 := v_0.Args[0]
  7165  		if v_0_0.Op != OpPPC64MOVBreg {
  7166  			break
  7167  		}
  7168  		x := v_0_0.Args[0]
  7169  		v.reset(OpPPC64SRAWconst)
  7170  		v.AuxInt = int64ToAuxInt(c)
  7171  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
  7172  		v0.AddArg(x)
  7173  		v.AddArg(v0)
  7174  		return true
  7175  	}
  7176  	// match: (MOVBreg (SRAWconst [c] x))
  7177  	// cond: sizeof(x.Type) == 8
  7178  	// result: (SRAWconst [c] x)
  7179  	for {
  7180  		if v_0.Op != OpPPC64SRAWconst {
  7181  			break
  7182  		}
  7183  		c := auxIntToInt64(v_0.AuxInt)
  7184  		x := v_0.Args[0]
  7185  		if !(sizeof(x.Type) == 8) {
  7186  			break
  7187  		}
  7188  		v.reset(OpPPC64SRAWconst)
  7189  		v.AuxInt = int64ToAuxInt(c)
  7190  		v.AddArg(x)
  7191  		return true
  7192  	}
  7193  	// match: (MOVBreg (SRDconst [c] x))
  7194  	// cond: c>56
  7195  	// result: (SRDconst [c] x)
  7196  	for {
  7197  		if v_0.Op != OpPPC64SRDconst {
  7198  			break
  7199  		}
  7200  		c := auxIntToInt64(v_0.AuxInt)
  7201  		x := v_0.Args[0]
  7202  		if !(c > 56) {
  7203  			break
  7204  		}
  7205  		v.reset(OpPPC64SRDconst)
  7206  		v.AuxInt = int64ToAuxInt(c)
  7207  		v.AddArg(x)
  7208  		return true
  7209  	}
  7210  	// match: (MOVBreg (SRDconst [c] x))
  7211  	// cond: c==56
  7212  	// result: (SRADconst [c] x)
  7213  	for {
  7214  		if v_0.Op != OpPPC64SRDconst {
  7215  			break
  7216  		}
  7217  		c := auxIntToInt64(v_0.AuxInt)
  7218  		x := v_0.Args[0]
  7219  		if !(c == 56) {
  7220  			break
  7221  		}
  7222  		v.reset(OpPPC64SRADconst)
  7223  		v.AuxInt = int64ToAuxInt(c)
  7224  		v.AddArg(x)
  7225  		return true
  7226  	}
  7227  	// match: (MOVBreg (SRADconst [c] x))
  7228  	// cond: c>=56
  7229  	// result: (SRADconst [c] x)
  7230  	for {
  7231  		if v_0.Op != OpPPC64SRADconst {
  7232  			break
  7233  		}
  7234  		c := auxIntToInt64(v_0.AuxInt)
  7235  		x := v_0.Args[0]
  7236  		if !(c >= 56) {
  7237  			break
  7238  		}
  7239  		v.reset(OpPPC64SRADconst)
  7240  		v.AuxInt = int64ToAuxInt(c)
  7241  		v.AddArg(x)
  7242  		return true
  7243  	}
  7244  	// match: (MOVBreg (SRWconst [c] x))
  7245  	// cond: c>24
  7246  	// result: (SRWconst [c] x)
  7247  	for {
  7248  		if v_0.Op != OpPPC64SRWconst {
  7249  			break
  7250  		}
  7251  		c := auxIntToInt64(v_0.AuxInt)
  7252  		x := v_0.Args[0]
  7253  		if !(c > 24) {
  7254  			break
  7255  		}
  7256  		v.reset(OpPPC64SRWconst)
  7257  		v.AuxInt = int64ToAuxInt(c)
  7258  		v.AddArg(x)
  7259  		return true
  7260  	}
  7261  	// match: (MOVBreg (SRWconst [c] x))
  7262  	// cond: c==24
  7263  	// result: (SRAWconst [c] x)
  7264  	for {
  7265  		if v_0.Op != OpPPC64SRWconst {
  7266  			break
  7267  		}
  7268  		c := auxIntToInt64(v_0.AuxInt)
  7269  		x := v_0.Args[0]
  7270  		if !(c == 24) {
  7271  			break
  7272  		}
  7273  		v.reset(OpPPC64SRAWconst)
  7274  		v.AuxInt = int64ToAuxInt(c)
  7275  		v.AddArg(x)
  7276  		return true
  7277  	}
  7278  	// match: (MOVBreg (SRAWconst [c] x))
  7279  	// cond: c>=24
  7280  	// result: (SRAWconst [c] x)
  7281  	for {
  7282  		if v_0.Op != OpPPC64SRAWconst {
  7283  			break
  7284  		}
  7285  		c := auxIntToInt64(v_0.AuxInt)
  7286  		x := v_0.Args[0]
  7287  		if !(c >= 24) {
  7288  			break
  7289  		}
  7290  		v.reset(OpPPC64SRAWconst)
  7291  		v.AuxInt = int64ToAuxInt(c)
  7292  		v.AddArg(x)
  7293  		return true
  7294  	}
  7295  	// match: (MOVBreg y:(MOVBreg _))
  7296  	// result: y
  7297  	for {
  7298  		y := v_0
  7299  		if y.Op != OpPPC64MOVBreg {
  7300  			break
  7301  		}
  7302  		v.copyOf(y)
  7303  		return true
  7304  	}
  7305  	// match: (MOVBreg (MOVBZreg x))
  7306  	// result: (MOVBreg x)
  7307  	for {
  7308  		if v_0.Op != OpPPC64MOVBZreg {
  7309  			break
  7310  		}
  7311  		x := v_0.Args[0]
  7312  		v.reset(OpPPC64MOVBreg)
  7313  		v.AddArg(x)
  7314  		return true
  7315  	}
  7316  	// match: (MOVBreg x:(Arg <t>))
  7317  	// cond: is8BitInt(t) && isSigned(t)
  7318  	// result: x
  7319  	for {
  7320  		x := v_0
  7321  		if x.Op != OpArg {
  7322  			break
  7323  		}
  7324  		t := x.Type
  7325  		if !(is8BitInt(t) && isSigned(t)) {
  7326  			break
  7327  		}
  7328  		v.copyOf(x)
  7329  		return true
  7330  	}
  7331  	// match: (MOVBreg (MOVDconst [c]))
  7332  	// result: (MOVDconst [int64(int8(c))])
  7333  	for {
  7334  		if v_0.Op != OpPPC64MOVDconst {
  7335  			break
  7336  		}
  7337  		c := auxIntToInt64(v_0.AuxInt)
  7338  		v.reset(OpPPC64MOVDconst)
  7339  		v.AuxInt = int64ToAuxInt(int64(int8(c)))
  7340  		return true
  7341  	}
  7342  	return false
  7343  }
  7344  func rewriteValuePPC64_OpPPC64MOVBstore(v *Value) bool {
  7345  	v_2 := v.Args[2]
  7346  	v_1 := v.Args[1]
  7347  	v_0 := v.Args[0]
  7348  	b := v.Block
  7349  	config := b.Func.Config
  7350  	typ := &b.Func.Config.Types
  7351  	// match: (MOVBstore [off1] {sym} (ADDconst [off2] x) val mem)
  7352  	// cond: is16Bit(int64(off1)+off2)
  7353  	// result: (MOVBstore [off1+int32(off2)] {sym} x val mem)
  7354  	for {
  7355  		off1 := auxIntToInt32(v.AuxInt)
  7356  		sym := auxToSym(v.Aux)
  7357  		if v_0.Op != OpPPC64ADDconst {
  7358  			break
  7359  		}
  7360  		off2 := auxIntToInt64(v_0.AuxInt)
  7361  		x := v_0.Args[0]
  7362  		val := v_1
  7363  		mem := v_2
  7364  		if !(is16Bit(int64(off1) + off2)) {
  7365  			break
  7366  		}
  7367  		v.reset(OpPPC64MOVBstore)
  7368  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  7369  		v.Aux = symToAux(sym)
  7370  		v.AddArg3(x, val, mem)
  7371  		return true
  7372  	}
  7373  	// match: (MOVBstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  7374  	// cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
  7375  	// result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  7376  	for {
  7377  		off1 := auxIntToInt32(v.AuxInt)
  7378  		sym1 := auxToSym(v.Aux)
  7379  		p := v_0
  7380  		if p.Op != OpPPC64MOVDaddr {
  7381  			break
  7382  		}
  7383  		off2 := auxIntToInt32(p.AuxInt)
  7384  		sym2 := auxToSym(p.Aux)
  7385  		ptr := p.Args[0]
  7386  		val := v_1
  7387  		mem := v_2
  7388  		if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
  7389  			break
  7390  		}
  7391  		v.reset(OpPPC64MOVBstore)
  7392  		v.AuxInt = int32ToAuxInt(off1 + off2)
  7393  		v.Aux = symToAux(mergeSym(sym1, sym2))
  7394  		v.AddArg3(ptr, val, mem)
  7395  		return true
  7396  	}
  7397  	// match: (MOVBstore [off] {sym} ptr (MOVDconst [0]) mem)
  7398  	// result: (MOVBstorezero [off] {sym} ptr mem)
  7399  	for {
  7400  		off := auxIntToInt32(v.AuxInt)
  7401  		sym := auxToSym(v.Aux)
  7402  		ptr := v_0
  7403  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  7404  			break
  7405  		}
  7406  		mem := v_2
  7407  		v.reset(OpPPC64MOVBstorezero)
  7408  		v.AuxInt = int32ToAuxInt(off)
  7409  		v.Aux = symToAux(sym)
  7410  		v.AddArg2(ptr, mem)
  7411  		return true
  7412  	}
  7413  	// match: (MOVBstore [0] {sym} p:(ADD ptr idx) val mem)
  7414  	// cond: sym == nil && p.Uses == 1
  7415  	// result: (MOVBstoreidx ptr idx val mem)
  7416  	for {
  7417  		if auxIntToInt32(v.AuxInt) != 0 {
  7418  			break
  7419  		}
  7420  		sym := auxToSym(v.Aux)
  7421  		p := v_0
  7422  		if p.Op != OpPPC64ADD {
  7423  			break
  7424  		}
  7425  		idx := p.Args[1]
  7426  		ptr := p.Args[0]
  7427  		val := v_1
  7428  		mem := v_2
  7429  		if !(sym == nil && p.Uses == 1) {
  7430  			break
  7431  		}
  7432  		v.reset(OpPPC64MOVBstoreidx)
  7433  		v.AddArg4(ptr, idx, val, mem)
  7434  		return true
  7435  	}
  7436  	// match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
  7437  	// result: (MOVBstore [off] {sym} ptr x mem)
  7438  	for {
  7439  		off := auxIntToInt32(v.AuxInt)
  7440  		sym := auxToSym(v.Aux)
  7441  		ptr := v_0
  7442  		if v_1.Op != OpPPC64MOVBreg {
  7443  			break
  7444  		}
  7445  		x := v_1.Args[0]
  7446  		mem := v_2
  7447  		v.reset(OpPPC64MOVBstore)
  7448  		v.AuxInt = int32ToAuxInt(off)
  7449  		v.Aux = symToAux(sym)
  7450  		v.AddArg3(ptr, x, mem)
  7451  		return true
  7452  	}
  7453  	// match: (MOVBstore [off] {sym} ptr (MOVBZreg x) mem)
  7454  	// result: (MOVBstore [off] {sym} ptr x mem)
  7455  	for {
  7456  		off := auxIntToInt32(v.AuxInt)
  7457  		sym := auxToSym(v.Aux)
  7458  		ptr := v_0
  7459  		if v_1.Op != OpPPC64MOVBZreg {
  7460  			break
  7461  		}
  7462  		x := v_1.Args[0]
  7463  		mem := v_2
  7464  		v.reset(OpPPC64MOVBstore)
  7465  		v.AuxInt = int32ToAuxInt(off)
  7466  		v.Aux = symToAux(sym)
  7467  		v.AddArg3(ptr, x, mem)
  7468  		return true
  7469  	}
  7470  	// match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
  7471  	// result: (MOVBstore [off] {sym} ptr x mem)
  7472  	for {
  7473  		off := auxIntToInt32(v.AuxInt)
  7474  		sym := auxToSym(v.Aux)
  7475  		ptr := v_0
  7476  		if v_1.Op != OpPPC64MOVHreg {
  7477  			break
  7478  		}
  7479  		x := v_1.Args[0]
  7480  		mem := v_2
  7481  		v.reset(OpPPC64MOVBstore)
  7482  		v.AuxInt = int32ToAuxInt(off)
  7483  		v.Aux = symToAux(sym)
  7484  		v.AddArg3(ptr, x, mem)
  7485  		return true
  7486  	}
  7487  	// match: (MOVBstore [off] {sym} ptr (MOVHZreg x) mem)
  7488  	// result: (MOVBstore [off] {sym} ptr x mem)
  7489  	for {
  7490  		off := auxIntToInt32(v.AuxInt)
  7491  		sym := auxToSym(v.Aux)
  7492  		ptr := v_0
  7493  		if v_1.Op != OpPPC64MOVHZreg {
  7494  			break
  7495  		}
  7496  		x := v_1.Args[0]
  7497  		mem := v_2
  7498  		v.reset(OpPPC64MOVBstore)
  7499  		v.AuxInt = int32ToAuxInt(off)
  7500  		v.Aux = symToAux(sym)
  7501  		v.AddArg3(ptr, x, mem)
  7502  		return true
  7503  	}
  7504  	// match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
  7505  	// result: (MOVBstore [off] {sym} ptr x mem)
  7506  	for {
  7507  		off := auxIntToInt32(v.AuxInt)
  7508  		sym := auxToSym(v.Aux)
  7509  		ptr := v_0
  7510  		if v_1.Op != OpPPC64MOVWreg {
  7511  			break
  7512  		}
  7513  		x := v_1.Args[0]
  7514  		mem := v_2
  7515  		v.reset(OpPPC64MOVBstore)
  7516  		v.AuxInt = int32ToAuxInt(off)
  7517  		v.Aux = symToAux(sym)
  7518  		v.AddArg3(ptr, x, mem)
  7519  		return true
  7520  	}
  7521  	// match: (MOVBstore [off] {sym} ptr (MOVWZreg x) mem)
  7522  	// result: (MOVBstore [off] {sym} ptr x mem)
  7523  	for {
  7524  		off := auxIntToInt32(v.AuxInt)
  7525  		sym := auxToSym(v.Aux)
  7526  		ptr := v_0
  7527  		if v_1.Op != OpPPC64MOVWZreg {
  7528  			break
  7529  		}
  7530  		x := v_1.Args[0]
  7531  		mem := v_2
  7532  		v.reset(OpPPC64MOVBstore)
  7533  		v.AuxInt = int32ToAuxInt(off)
  7534  		v.Aux = symToAux(sym)
  7535  		v.AddArg3(ptr, x, mem)
  7536  		return true
  7537  	}
  7538  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHreg x) [c]) mem)
  7539  	// cond: c <= 8
  7540  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7541  	for {
  7542  		off := auxIntToInt32(v.AuxInt)
  7543  		sym := auxToSym(v.Aux)
  7544  		ptr := v_0
  7545  		if v_1.Op != OpPPC64SRWconst {
  7546  			break
  7547  		}
  7548  		c := auxIntToInt64(v_1.AuxInt)
  7549  		v_1_0 := v_1.Args[0]
  7550  		if v_1_0.Op != OpPPC64MOVHreg {
  7551  			break
  7552  		}
  7553  		x := v_1_0.Args[0]
  7554  		mem := v_2
  7555  		if !(c <= 8) {
  7556  			break
  7557  		}
  7558  		v.reset(OpPPC64MOVBstore)
  7559  		v.AuxInt = int32ToAuxInt(off)
  7560  		v.Aux = symToAux(sym)
  7561  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7562  		v0.AuxInt = int64ToAuxInt(c)
  7563  		v0.AddArg(x)
  7564  		v.AddArg3(ptr, v0, mem)
  7565  		return true
  7566  	}
  7567  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHZreg x) [c]) mem)
  7568  	// cond: c <= 8
  7569  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7570  	for {
  7571  		off := auxIntToInt32(v.AuxInt)
  7572  		sym := auxToSym(v.Aux)
  7573  		ptr := v_0
  7574  		if v_1.Op != OpPPC64SRWconst {
  7575  			break
  7576  		}
  7577  		c := auxIntToInt64(v_1.AuxInt)
  7578  		v_1_0 := v_1.Args[0]
  7579  		if v_1_0.Op != OpPPC64MOVHZreg {
  7580  			break
  7581  		}
  7582  		x := v_1_0.Args[0]
  7583  		mem := v_2
  7584  		if !(c <= 8) {
  7585  			break
  7586  		}
  7587  		v.reset(OpPPC64MOVBstore)
  7588  		v.AuxInt = int32ToAuxInt(off)
  7589  		v.Aux = symToAux(sym)
  7590  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7591  		v0.AuxInt = int64ToAuxInt(c)
  7592  		v0.AddArg(x)
  7593  		v.AddArg3(ptr, v0, mem)
  7594  		return true
  7595  	}
  7596  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWreg x) [c]) mem)
  7597  	// cond: c <= 24
  7598  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7599  	for {
  7600  		off := auxIntToInt32(v.AuxInt)
  7601  		sym := auxToSym(v.Aux)
  7602  		ptr := v_0
  7603  		if v_1.Op != OpPPC64SRWconst {
  7604  			break
  7605  		}
  7606  		c := auxIntToInt64(v_1.AuxInt)
  7607  		v_1_0 := v_1.Args[0]
  7608  		if v_1_0.Op != OpPPC64MOVWreg {
  7609  			break
  7610  		}
  7611  		x := v_1_0.Args[0]
  7612  		mem := v_2
  7613  		if !(c <= 24) {
  7614  			break
  7615  		}
  7616  		v.reset(OpPPC64MOVBstore)
  7617  		v.AuxInt = int32ToAuxInt(off)
  7618  		v.Aux = symToAux(sym)
  7619  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7620  		v0.AuxInt = int64ToAuxInt(c)
  7621  		v0.AddArg(x)
  7622  		v.AddArg3(ptr, v0, mem)
  7623  		return true
  7624  	}
  7625  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWZreg x) [c]) mem)
  7626  	// cond: c <= 24
  7627  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7628  	for {
  7629  		off := auxIntToInt32(v.AuxInt)
  7630  		sym := auxToSym(v.Aux)
  7631  		ptr := v_0
  7632  		if v_1.Op != OpPPC64SRWconst {
  7633  			break
  7634  		}
  7635  		c := auxIntToInt64(v_1.AuxInt)
  7636  		v_1_0 := v_1.Args[0]
  7637  		if v_1_0.Op != OpPPC64MOVWZreg {
  7638  			break
  7639  		}
  7640  		x := v_1_0.Args[0]
  7641  		mem := v_2
  7642  		if !(c <= 24) {
  7643  			break
  7644  		}
  7645  		v.reset(OpPPC64MOVBstore)
  7646  		v.AuxInt = int32ToAuxInt(off)
  7647  		v.Aux = symToAux(sym)
  7648  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7649  		v0.AuxInt = int64ToAuxInt(c)
  7650  		v0.AddArg(x)
  7651  		v.AddArg3(ptr, v0, mem)
  7652  		return true
  7653  	}
  7654  	// match: (MOVBstore [i1] {s} p (SRWconst w [24]) x0:(MOVBstore [i0] {s} p (SRWconst w [16]) mem))
  7655  	// cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)
  7656  	// result: (MOVHstore [i0] {s} p (SRWconst <typ.UInt16> w [16]) mem)
  7657  	for {
  7658  		i1 := auxIntToInt32(v.AuxInt)
  7659  		s := auxToSym(v.Aux)
  7660  		p := v_0
  7661  		if v_1.Op != OpPPC64SRWconst || auxIntToInt64(v_1.AuxInt) != 24 {
  7662  			break
  7663  		}
  7664  		w := v_1.Args[0]
  7665  		x0 := v_2
  7666  		if x0.Op != OpPPC64MOVBstore {
  7667  			break
  7668  		}
  7669  		i0 := auxIntToInt32(x0.AuxInt)
  7670  		if auxToSym(x0.Aux) != s {
  7671  			break
  7672  		}
  7673  		mem := x0.Args[2]
  7674  		if p != x0.Args[0] {
  7675  			break
  7676  		}
  7677  		x0_1 := x0.Args[1]
  7678  		if x0_1.Op != OpPPC64SRWconst || auxIntToInt64(x0_1.AuxInt) != 16 || w != x0_1.Args[0] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)) {
  7679  			break
  7680  		}
  7681  		v.reset(OpPPC64MOVHstore)
  7682  		v.AuxInt = int32ToAuxInt(i0)
  7683  		v.Aux = symToAux(s)
  7684  		v0 := b.NewValue0(x0.Pos, OpPPC64SRWconst, typ.UInt16)
  7685  		v0.AuxInt = int64ToAuxInt(16)
  7686  		v0.AddArg(w)
  7687  		v.AddArg3(p, v0, mem)
  7688  		return true
  7689  	}
  7690  	// match: (MOVBstore [i1] {s} p (SRDconst w [24]) x0:(MOVBstore [i0] {s} p (SRDconst w [16]) mem))
  7691  	// cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)
  7692  	// result: (MOVHstore [i0] {s} p (SRWconst <typ.UInt16> w [16]) mem)
  7693  	for {
  7694  		i1 := auxIntToInt32(v.AuxInt)
  7695  		s := auxToSym(v.Aux)
  7696  		p := v_0
  7697  		if v_1.Op != OpPPC64SRDconst || auxIntToInt64(v_1.AuxInt) != 24 {
  7698  			break
  7699  		}
  7700  		w := v_1.Args[0]
  7701  		x0 := v_2
  7702  		if x0.Op != OpPPC64MOVBstore {
  7703  			break
  7704  		}
  7705  		i0 := auxIntToInt32(x0.AuxInt)
  7706  		if auxToSym(x0.Aux) != s {
  7707  			break
  7708  		}
  7709  		mem := x0.Args[2]
  7710  		if p != x0.Args[0] {
  7711  			break
  7712  		}
  7713  		x0_1 := x0.Args[1]
  7714  		if x0_1.Op != OpPPC64SRDconst || auxIntToInt64(x0_1.AuxInt) != 16 || w != x0_1.Args[0] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)) {
  7715  			break
  7716  		}
  7717  		v.reset(OpPPC64MOVHstore)
  7718  		v.AuxInt = int32ToAuxInt(i0)
  7719  		v.Aux = symToAux(s)
  7720  		v0 := b.NewValue0(x0.Pos, OpPPC64SRWconst, typ.UInt16)
  7721  		v0.AuxInt = int64ToAuxInt(16)
  7722  		v0.AddArg(w)
  7723  		v.AddArg3(p, v0, mem)
  7724  		return true
  7725  	}
  7726  	// match: (MOVBstore [i1] {s} p (SRWconst w [8]) x0:(MOVBstore [i0] {s} p w mem))
  7727  	// cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)
  7728  	// result: (MOVHstore [i0] {s} p w mem)
  7729  	for {
  7730  		i1 := auxIntToInt32(v.AuxInt)
  7731  		s := auxToSym(v.Aux)
  7732  		p := v_0
  7733  		if v_1.Op != OpPPC64SRWconst || auxIntToInt64(v_1.AuxInt) != 8 {
  7734  			break
  7735  		}
  7736  		w := v_1.Args[0]
  7737  		x0 := v_2
  7738  		if x0.Op != OpPPC64MOVBstore {
  7739  			break
  7740  		}
  7741  		i0 := auxIntToInt32(x0.AuxInt)
  7742  		if auxToSym(x0.Aux) != s {
  7743  			break
  7744  		}
  7745  		mem := x0.Args[2]
  7746  		if p != x0.Args[0] || w != x0.Args[1] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)) {
  7747  			break
  7748  		}
  7749  		v.reset(OpPPC64MOVHstore)
  7750  		v.AuxInt = int32ToAuxInt(i0)
  7751  		v.Aux = symToAux(s)
  7752  		v.AddArg3(p, w, mem)
  7753  		return true
  7754  	}
  7755  	// match: (MOVBstore [i1] {s} p (SRDconst w [8]) x0:(MOVBstore [i0] {s} p w mem))
  7756  	// cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)
  7757  	// result: (MOVHstore [i0] {s} p w mem)
  7758  	for {
  7759  		i1 := auxIntToInt32(v.AuxInt)
  7760  		s := auxToSym(v.Aux)
  7761  		p := v_0
  7762  		if v_1.Op != OpPPC64SRDconst || auxIntToInt64(v_1.AuxInt) != 8 {
  7763  			break
  7764  		}
  7765  		w := v_1.Args[0]
  7766  		x0 := v_2
  7767  		if x0.Op != OpPPC64MOVBstore {
  7768  			break
  7769  		}
  7770  		i0 := auxIntToInt32(x0.AuxInt)
  7771  		if auxToSym(x0.Aux) != s {
  7772  			break
  7773  		}
  7774  		mem := x0.Args[2]
  7775  		if p != x0.Args[0] || w != x0.Args[1] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)) {
  7776  			break
  7777  		}
  7778  		v.reset(OpPPC64MOVHstore)
  7779  		v.AuxInt = int32ToAuxInt(i0)
  7780  		v.Aux = symToAux(s)
  7781  		v.AddArg3(p, w, mem)
  7782  		return true
  7783  	}
  7784  	// match: (MOVBstore [i3] {s} p w x0:(MOVBstore [i2] {s} p (SRWconst w [8]) x1:(MOVBstore [i1] {s} p (SRWconst w [16]) x2:(MOVBstore [i0] {s} p (SRWconst w [24]) mem))))
  7785  	// cond: !config.BigEndian && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && clobber(x0, x1, x2)
  7786  	// result: (MOVWBRstore (MOVDaddr <typ.Uintptr> [i0] {s} p) w mem)
  7787  	for {
  7788  		i3 := auxIntToInt32(v.AuxInt)
  7789  		s := auxToSym(v.Aux)
  7790  		p := v_0
  7791  		w := v_1
  7792  		x0 := v_2
  7793  		if x0.Op != OpPPC64MOVBstore {
  7794  			break
  7795  		}
  7796  		i2 := auxIntToInt32(x0.AuxInt)
  7797  		if auxToSym(x0.Aux) != s {
  7798  			break
  7799  		}
  7800  		_ = x0.Args[2]
  7801  		if p != x0.Args[0] {
  7802  			break
  7803  		}
  7804  		x0_1 := x0.Args[1]
  7805  		if x0_1.Op != OpPPC64SRWconst || auxIntToInt64(x0_1.AuxInt) != 8 || w != x0_1.Args[0] {
  7806  			break
  7807  		}
  7808  		x1 := x0.Args[2]
  7809  		if x1.Op != OpPPC64MOVBstore {
  7810  			break
  7811  		}
  7812  		i1 := auxIntToInt32(x1.AuxInt)
  7813  		if auxToSym(x1.Aux) != s {
  7814  			break
  7815  		}
  7816  		_ = x1.Args[2]
  7817  		if p != x1.Args[0] {
  7818  			break
  7819  		}
  7820  		x1_1 := x1.Args[1]
  7821  		if x1_1.Op != OpPPC64SRWconst || auxIntToInt64(x1_1.AuxInt) != 16 || w != x1_1.Args[0] {
  7822  			break
  7823  		}
  7824  		x2 := x1.Args[2]
  7825  		if x2.Op != OpPPC64MOVBstore {
  7826  			break
  7827  		}
  7828  		i0 := auxIntToInt32(x2.AuxInt)
  7829  		if auxToSym(x2.Aux) != s {
  7830  			break
  7831  		}
  7832  		mem := x2.Args[2]
  7833  		if p != x2.Args[0] {
  7834  			break
  7835  		}
  7836  		x2_1 := x2.Args[1]
  7837  		if x2_1.Op != OpPPC64SRWconst || auxIntToInt64(x2_1.AuxInt) != 24 || w != x2_1.Args[0] || !(!config.BigEndian && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && clobber(x0, x1, x2)) {
  7838  			break
  7839  		}
  7840  		v.reset(OpPPC64MOVWBRstore)
  7841  		v0 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr)
  7842  		v0.AuxInt = int32ToAuxInt(i0)
  7843  		v0.Aux = symToAux(s)
  7844  		v0.AddArg(p)
  7845  		v.AddArg3(v0, w, mem)
  7846  		return true
  7847  	}
  7848  	// match: (MOVBstore [i1] {s} p w x0:(MOVBstore [i0] {s} p (SRWconst w [8]) mem))
  7849  	// cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)
  7850  	// result: (MOVHBRstore (MOVDaddr <typ.Uintptr> [i0] {s} p) w mem)
  7851  	for {
  7852  		i1 := auxIntToInt32(v.AuxInt)
  7853  		s := auxToSym(v.Aux)
  7854  		p := v_0
  7855  		w := v_1
  7856  		x0 := v_2
  7857  		if x0.Op != OpPPC64MOVBstore {
  7858  			break
  7859  		}
  7860  		i0 := auxIntToInt32(x0.AuxInt)
  7861  		if auxToSym(x0.Aux) != s {
  7862  			break
  7863  		}
  7864  		mem := x0.Args[2]
  7865  		if p != x0.Args[0] {
  7866  			break
  7867  		}
  7868  		x0_1 := x0.Args[1]
  7869  		if x0_1.Op != OpPPC64SRWconst || auxIntToInt64(x0_1.AuxInt) != 8 || w != x0_1.Args[0] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+1 && clobber(x0)) {
  7870  			break
  7871  		}
  7872  		v.reset(OpPPC64MOVHBRstore)
  7873  		v0 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr)
  7874  		v0.AuxInt = int32ToAuxInt(i0)
  7875  		v0.Aux = symToAux(s)
  7876  		v0.AddArg(p)
  7877  		v.AddArg3(v0, w, mem)
  7878  		return true
  7879  	}
  7880  	// match: (MOVBstore [i7] {s} p (SRDconst w [56]) x0:(MOVBstore [i6] {s} p (SRDconst w [48]) x1:(MOVBstore [i5] {s} p (SRDconst w [40]) x2:(MOVBstore [i4] {s} p (SRDconst w [32]) x3:(MOVWstore [i0] {s} p w mem)))))
  7881  	// cond: !config.BigEndian && i0%4 == 0 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && clobber(x0, x1, x2, x3)
  7882  	// result: (MOVDstore [i0] {s} p w mem)
  7883  	for {
  7884  		i7 := auxIntToInt32(v.AuxInt)
  7885  		s := auxToSym(v.Aux)
  7886  		p := v_0
  7887  		if v_1.Op != OpPPC64SRDconst || auxIntToInt64(v_1.AuxInt) != 56 {
  7888  			break
  7889  		}
  7890  		w := v_1.Args[0]
  7891  		x0 := v_2
  7892  		if x0.Op != OpPPC64MOVBstore {
  7893  			break
  7894  		}
  7895  		i6 := auxIntToInt32(x0.AuxInt)
  7896  		if auxToSym(x0.Aux) != s {
  7897  			break
  7898  		}
  7899  		_ = x0.Args[2]
  7900  		if p != x0.Args[0] {
  7901  			break
  7902  		}
  7903  		x0_1 := x0.Args[1]
  7904  		if x0_1.Op != OpPPC64SRDconst || auxIntToInt64(x0_1.AuxInt) != 48 || w != x0_1.Args[0] {
  7905  			break
  7906  		}
  7907  		x1 := x0.Args[2]
  7908  		if x1.Op != OpPPC64MOVBstore {
  7909  			break
  7910  		}
  7911  		i5 := auxIntToInt32(x1.AuxInt)
  7912  		if auxToSym(x1.Aux) != s {
  7913  			break
  7914  		}
  7915  		_ = x1.Args[2]
  7916  		if p != x1.Args[0] {
  7917  			break
  7918  		}
  7919  		x1_1 := x1.Args[1]
  7920  		if x1_1.Op != OpPPC64SRDconst || auxIntToInt64(x1_1.AuxInt) != 40 || w != x1_1.Args[0] {
  7921  			break
  7922  		}
  7923  		x2 := x1.Args[2]
  7924  		if x2.Op != OpPPC64MOVBstore {
  7925  			break
  7926  		}
  7927  		i4 := auxIntToInt32(x2.AuxInt)
  7928  		if auxToSym(x2.Aux) != s {
  7929  			break
  7930  		}
  7931  		_ = x2.Args[2]
  7932  		if p != x2.Args[0] {
  7933  			break
  7934  		}
  7935  		x2_1 := x2.Args[1]
  7936  		if x2_1.Op != OpPPC64SRDconst || auxIntToInt64(x2_1.AuxInt) != 32 || w != x2_1.Args[0] {
  7937  			break
  7938  		}
  7939  		x3 := x2.Args[2]
  7940  		if x3.Op != OpPPC64MOVWstore {
  7941  			break
  7942  		}
  7943  		i0 := auxIntToInt32(x3.AuxInt)
  7944  		if auxToSym(x3.Aux) != s {
  7945  			break
  7946  		}
  7947  		mem := x3.Args[2]
  7948  		if p != x3.Args[0] || w != x3.Args[1] || !(!config.BigEndian && i0%4 == 0 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && clobber(x0, x1, x2, x3)) {
  7949  			break
  7950  		}
  7951  		v.reset(OpPPC64MOVDstore)
  7952  		v.AuxInt = int32ToAuxInt(i0)
  7953  		v.Aux = symToAux(s)
  7954  		v.AddArg3(p, w, mem)
  7955  		return true
  7956  	}
  7957  	// match: (MOVBstore [i7] {s} p w x0:(MOVBstore [i6] {s} p (SRDconst w [8]) x1:(MOVBstore [i5] {s} p (SRDconst w [16]) x2:(MOVBstore [i4] {s} p (SRDconst w [24]) x3:(MOVBstore [i3] {s} p (SRDconst w [32]) x4:(MOVBstore [i2] {s} p (SRDconst w [40]) x5:(MOVBstore [i1] {s} p (SRDconst w [48]) x6:(MOVBstore [i0] {s} p (SRDconst w [56]) mem))))))))
  7958  	// cond: !config.BigEndian && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && clobber(x0, x1, x2, x3, x4, x5, x6)
  7959  	// result: (MOVDBRstore (MOVDaddr <typ.Uintptr> [i0] {s} p) w mem)
  7960  	for {
  7961  		i7 := auxIntToInt32(v.AuxInt)
  7962  		s := auxToSym(v.Aux)
  7963  		p := v_0
  7964  		w := v_1
  7965  		x0 := v_2
  7966  		if x0.Op != OpPPC64MOVBstore {
  7967  			break
  7968  		}
  7969  		i6 := auxIntToInt32(x0.AuxInt)
  7970  		if auxToSym(x0.Aux) != s {
  7971  			break
  7972  		}
  7973  		_ = x0.Args[2]
  7974  		if p != x0.Args[0] {
  7975  			break
  7976  		}
  7977  		x0_1 := x0.Args[1]
  7978  		if x0_1.Op != OpPPC64SRDconst || auxIntToInt64(x0_1.AuxInt) != 8 || w != x0_1.Args[0] {
  7979  			break
  7980  		}
  7981  		x1 := x0.Args[2]
  7982  		if x1.Op != OpPPC64MOVBstore {
  7983  			break
  7984  		}
  7985  		i5 := auxIntToInt32(x1.AuxInt)
  7986  		if auxToSym(x1.Aux) != s {
  7987  			break
  7988  		}
  7989  		_ = x1.Args[2]
  7990  		if p != x1.Args[0] {
  7991  			break
  7992  		}
  7993  		x1_1 := x1.Args[1]
  7994  		if x1_1.Op != OpPPC64SRDconst || auxIntToInt64(x1_1.AuxInt) != 16 || w != x1_1.Args[0] {
  7995  			break
  7996  		}
  7997  		x2 := x1.Args[2]
  7998  		if x2.Op != OpPPC64MOVBstore {
  7999  			break
  8000  		}
  8001  		i4 := auxIntToInt32(x2.AuxInt)
  8002  		if auxToSym(x2.Aux) != s {
  8003  			break
  8004  		}
  8005  		_ = x2.Args[2]
  8006  		if p != x2.Args[0] {
  8007  			break
  8008  		}
  8009  		x2_1 := x2.Args[1]
  8010  		if x2_1.Op != OpPPC64SRDconst || auxIntToInt64(x2_1.AuxInt) != 24 || w != x2_1.Args[0] {
  8011  			break
  8012  		}
  8013  		x3 := x2.Args[2]
  8014  		if x3.Op != OpPPC64MOVBstore {
  8015  			break
  8016  		}
  8017  		i3 := auxIntToInt32(x3.AuxInt)
  8018  		if auxToSym(x3.Aux) != s {
  8019  			break
  8020  		}
  8021  		_ = x3.Args[2]
  8022  		if p != x3.Args[0] {
  8023  			break
  8024  		}
  8025  		x3_1 := x3.Args[1]
  8026  		if x3_1.Op != OpPPC64SRDconst || auxIntToInt64(x3_1.AuxInt) != 32 || w != x3_1.Args[0] {
  8027  			break
  8028  		}
  8029  		x4 := x3.Args[2]
  8030  		if x4.Op != OpPPC64MOVBstore {
  8031  			break
  8032  		}
  8033  		i2 := auxIntToInt32(x4.AuxInt)
  8034  		if auxToSym(x4.Aux) != s {
  8035  			break
  8036  		}
  8037  		_ = x4.Args[2]
  8038  		if p != x4.Args[0] {
  8039  			break
  8040  		}
  8041  		x4_1 := x4.Args[1]
  8042  		if x4_1.Op != OpPPC64SRDconst || auxIntToInt64(x4_1.AuxInt) != 40 || w != x4_1.Args[0] {
  8043  			break
  8044  		}
  8045  		x5 := x4.Args[2]
  8046  		if x5.Op != OpPPC64MOVBstore {
  8047  			break
  8048  		}
  8049  		i1 := auxIntToInt32(x5.AuxInt)
  8050  		if auxToSym(x5.Aux) != s {
  8051  			break
  8052  		}
  8053  		_ = x5.Args[2]
  8054  		if p != x5.Args[0] {
  8055  			break
  8056  		}
  8057  		x5_1 := x5.Args[1]
  8058  		if x5_1.Op != OpPPC64SRDconst || auxIntToInt64(x5_1.AuxInt) != 48 || w != x5_1.Args[0] {
  8059  			break
  8060  		}
  8061  		x6 := x5.Args[2]
  8062  		if x6.Op != OpPPC64MOVBstore {
  8063  			break
  8064  		}
  8065  		i0 := auxIntToInt32(x6.AuxInt)
  8066  		if auxToSym(x6.Aux) != s {
  8067  			break
  8068  		}
  8069  		mem := x6.Args[2]
  8070  		if p != x6.Args[0] {
  8071  			break
  8072  		}
  8073  		x6_1 := x6.Args[1]
  8074  		if x6_1.Op != OpPPC64SRDconst || auxIntToInt64(x6_1.AuxInt) != 56 || w != x6_1.Args[0] || !(!config.BigEndian && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && clobber(x0, x1, x2, x3, x4, x5, x6)) {
  8075  			break
  8076  		}
  8077  		v.reset(OpPPC64MOVDBRstore)
  8078  		v0 := b.NewValue0(x6.Pos, OpPPC64MOVDaddr, typ.Uintptr)
  8079  		v0.AuxInt = int32ToAuxInt(i0)
  8080  		v0.Aux = symToAux(s)
  8081  		v0.AddArg(p)
  8082  		v.AddArg3(v0, w, mem)
  8083  		return true
  8084  	}
  8085  	return false
  8086  }
  8087  func rewriteValuePPC64_OpPPC64MOVBstoreidx(v *Value) bool {
  8088  	v_3 := v.Args[3]
  8089  	v_2 := v.Args[2]
  8090  	v_1 := v.Args[1]
  8091  	v_0 := v.Args[0]
  8092  	b := v.Block
  8093  	typ := &b.Func.Config.Types
  8094  	// match: (MOVBstoreidx ptr (MOVDconst [c]) val mem)
  8095  	// cond: is16Bit(c)
  8096  	// result: (MOVBstore [int32(c)] ptr val mem)
  8097  	for {
  8098  		ptr := v_0
  8099  		if v_1.Op != OpPPC64MOVDconst {
  8100  			break
  8101  		}
  8102  		c := auxIntToInt64(v_1.AuxInt)
  8103  		val := v_2
  8104  		mem := v_3
  8105  		if !(is16Bit(c)) {
  8106  			break
  8107  		}
  8108  		v.reset(OpPPC64MOVBstore)
  8109  		v.AuxInt = int32ToAuxInt(int32(c))
  8110  		v.AddArg3(ptr, val, mem)
  8111  		return true
  8112  	}
  8113  	// match: (MOVBstoreidx (MOVDconst [c]) ptr val mem)
  8114  	// cond: is16Bit(c)
  8115  	// result: (MOVBstore [int32(c)] ptr val mem)
  8116  	for {
  8117  		if v_0.Op != OpPPC64MOVDconst {
  8118  			break
  8119  		}
  8120  		c := auxIntToInt64(v_0.AuxInt)
  8121  		ptr := v_1
  8122  		val := v_2
  8123  		mem := v_3
  8124  		if !(is16Bit(c)) {
  8125  			break
  8126  		}
  8127  		v.reset(OpPPC64MOVBstore)
  8128  		v.AuxInt = int32ToAuxInt(int32(c))
  8129  		v.AddArg3(ptr, val, mem)
  8130  		return true
  8131  	}
  8132  	// match: (MOVBstoreidx ptr idx (MOVBreg x) mem)
  8133  	// result: (MOVBstoreidx ptr idx x mem)
  8134  	for {
  8135  		ptr := v_0
  8136  		idx := v_1
  8137  		if v_2.Op != OpPPC64MOVBreg {
  8138  			break
  8139  		}
  8140  		x := v_2.Args[0]
  8141  		mem := v_3
  8142  		v.reset(OpPPC64MOVBstoreidx)
  8143  		v.AddArg4(ptr, idx, x, mem)
  8144  		return true
  8145  	}
  8146  	// match: (MOVBstoreidx ptr idx (MOVBZreg x) mem)
  8147  	// result: (MOVBstoreidx ptr idx x mem)
  8148  	for {
  8149  		ptr := v_0
  8150  		idx := v_1
  8151  		if v_2.Op != OpPPC64MOVBZreg {
  8152  			break
  8153  		}
  8154  		x := v_2.Args[0]
  8155  		mem := v_3
  8156  		v.reset(OpPPC64MOVBstoreidx)
  8157  		v.AddArg4(ptr, idx, x, mem)
  8158  		return true
  8159  	}
  8160  	// match: (MOVBstoreidx ptr idx (MOVHreg x) mem)
  8161  	// result: (MOVBstoreidx ptr idx x mem)
  8162  	for {
  8163  		ptr := v_0
  8164  		idx := v_1
  8165  		if v_2.Op != OpPPC64MOVHreg {
  8166  			break
  8167  		}
  8168  		x := v_2.Args[0]
  8169  		mem := v_3
  8170  		v.reset(OpPPC64MOVBstoreidx)
  8171  		v.AddArg4(ptr, idx, x, mem)
  8172  		return true
  8173  	}
  8174  	// match: (MOVBstoreidx ptr idx (MOVHZreg x) mem)
  8175  	// result: (MOVBstoreidx ptr idx x mem)
  8176  	for {
  8177  		ptr := v_0
  8178  		idx := v_1
  8179  		if v_2.Op != OpPPC64MOVHZreg {
  8180  			break
  8181  		}
  8182  		x := v_2.Args[0]
  8183  		mem := v_3
  8184  		v.reset(OpPPC64MOVBstoreidx)
  8185  		v.AddArg4(ptr, idx, x, mem)
  8186  		return true
  8187  	}
  8188  	// match: (MOVBstoreidx ptr idx (MOVWreg x) mem)
  8189  	// result: (MOVBstoreidx ptr idx x mem)
  8190  	for {
  8191  		ptr := v_0
  8192  		idx := v_1
  8193  		if v_2.Op != OpPPC64MOVWreg {
  8194  			break
  8195  		}
  8196  		x := v_2.Args[0]
  8197  		mem := v_3
  8198  		v.reset(OpPPC64MOVBstoreidx)
  8199  		v.AddArg4(ptr, idx, x, mem)
  8200  		return true
  8201  	}
  8202  	// match: (MOVBstoreidx ptr idx (MOVWZreg x) mem)
  8203  	// result: (MOVBstoreidx ptr idx x mem)
  8204  	for {
  8205  		ptr := v_0
  8206  		idx := v_1
  8207  		if v_2.Op != OpPPC64MOVWZreg {
  8208  			break
  8209  		}
  8210  		x := v_2.Args[0]
  8211  		mem := v_3
  8212  		v.reset(OpPPC64MOVBstoreidx)
  8213  		v.AddArg4(ptr, idx, x, mem)
  8214  		return true
  8215  	}
  8216  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVHreg x) [c]) mem)
  8217  	// cond: c <= 8
  8218  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8219  	for {
  8220  		ptr := v_0
  8221  		idx := v_1
  8222  		if v_2.Op != OpPPC64SRWconst {
  8223  			break
  8224  		}
  8225  		c := auxIntToInt64(v_2.AuxInt)
  8226  		v_2_0 := v_2.Args[0]
  8227  		if v_2_0.Op != OpPPC64MOVHreg {
  8228  			break
  8229  		}
  8230  		x := v_2_0.Args[0]
  8231  		mem := v_3
  8232  		if !(c <= 8) {
  8233  			break
  8234  		}
  8235  		v.reset(OpPPC64MOVBstoreidx)
  8236  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8237  		v0.AuxInt = int64ToAuxInt(c)
  8238  		v0.AddArg(x)
  8239  		v.AddArg4(ptr, idx, v0, mem)
  8240  		return true
  8241  	}
  8242  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVHZreg x) [c]) mem)
  8243  	// cond: c <= 8
  8244  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8245  	for {
  8246  		ptr := v_0
  8247  		idx := v_1
  8248  		if v_2.Op != OpPPC64SRWconst {
  8249  			break
  8250  		}
  8251  		c := auxIntToInt64(v_2.AuxInt)
  8252  		v_2_0 := v_2.Args[0]
  8253  		if v_2_0.Op != OpPPC64MOVHZreg {
  8254  			break
  8255  		}
  8256  		x := v_2_0.Args[0]
  8257  		mem := v_3
  8258  		if !(c <= 8) {
  8259  			break
  8260  		}
  8261  		v.reset(OpPPC64MOVBstoreidx)
  8262  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8263  		v0.AuxInt = int64ToAuxInt(c)
  8264  		v0.AddArg(x)
  8265  		v.AddArg4(ptr, idx, v0, mem)
  8266  		return true
  8267  	}
  8268  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVWreg x) [c]) mem)
  8269  	// cond: c <= 24
  8270  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8271  	for {
  8272  		ptr := v_0
  8273  		idx := v_1
  8274  		if v_2.Op != OpPPC64SRWconst {
  8275  			break
  8276  		}
  8277  		c := auxIntToInt64(v_2.AuxInt)
  8278  		v_2_0 := v_2.Args[0]
  8279  		if v_2_0.Op != OpPPC64MOVWreg {
  8280  			break
  8281  		}
  8282  		x := v_2_0.Args[0]
  8283  		mem := v_3
  8284  		if !(c <= 24) {
  8285  			break
  8286  		}
  8287  		v.reset(OpPPC64MOVBstoreidx)
  8288  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8289  		v0.AuxInt = int64ToAuxInt(c)
  8290  		v0.AddArg(x)
  8291  		v.AddArg4(ptr, idx, v0, mem)
  8292  		return true
  8293  	}
  8294  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVWZreg x) [c]) mem)
  8295  	// cond: c <= 24
  8296  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8297  	for {
  8298  		ptr := v_0
  8299  		idx := v_1
  8300  		if v_2.Op != OpPPC64SRWconst {
  8301  			break
  8302  		}
  8303  		c := auxIntToInt64(v_2.AuxInt)
  8304  		v_2_0 := v_2.Args[0]
  8305  		if v_2_0.Op != OpPPC64MOVWZreg {
  8306  			break
  8307  		}
  8308  		x := v_2_0.Args[0]
  8309  		mem := v_3
  8310  		if !(c <= 24) {
  8311  			break
  8312  		}
  8313  		v.reset(OpPPC64MOVBstoreidx)
  8314  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8315  		v0.AuxInt = int64ToAuxInt(c)
  8316  		v0.AddArg(x)
  8317  		v.AddArg4(ptr, idx, v0, mem)
  8318  		return true
  8319  	}
  8320  	return false
  8321  }
  8322  func rewriteValuePPC64_OpPPC64MOVBstorezero(v *Value) bool {
  8323  	v_1 := v.Args[1]
  8324  	v_0 := v.Args[0]
  8325  	// match: (MOVBstorezero [off1] {sym} (ADDconst [off2] x) mem)
  8326  	// cond: is16Bit(int64(off1)+off2)
  8327  	// result: (MOVBstorezero [off1+int32(off2)] {sym} x mem)
  8328  	for {
  8329  		off1 := auxIntToInt32(v.AuxInt)
  8330  		sym := auxToSym(v.Aux)
  8331  		if v_0.Op != OpPPC64ADDconst {
  8332  			break
  8333  		}
  8334  		off2 := auxIntToInt64(v_0.AuxInt)
  8335  		x := v_0.Args[0]
  8336  		mem := v_1
  8337  		if !(is16Bit(int64(off1) + off2)) {
  8338  			break
  8339  		}
  8340  		v.reset(OpPPC64MOVBstorezero)
  8341  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8342  		v.Aux = symToAux(sym)
  8343  		v.AddArg2(x, mem)
  8344  		return true
  8345  	}
  8346  	// match: (MOVBstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
  8347  	// cond: canMergeSym(sym1,sym2) && (x.Op != OpSB || p.Uses == 1)
  8348  	// result: (MOVBstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
  8349  	for {
  8350  		off1 := auxIntToInt32(v.AuxInt)
  8351  		sym1 := auxToSym(v.Aux)
  8352  		p := v_0
  8353  		if p.Op != OpPPC64MOVDaddr {
  8354  			break
  8355  		}
  8356  		off2 := auxIntToInt32(p.AuxInt)
  8357  		sym2 := auxToSym(p.Aux)
  8358  		x := p.Args[0]
  8359  		mem := v_1
  8360  		if !(canMergeSym(sym1, sym2) && (x.Op != OpSB || p.Uses == 1)) {
  8361  			break
  8362  		}
  8363  		v.reset(OpPPC64MOVBstorezero)
  8364  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8365  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8366  		v.AddArg2(x, mem)
  8367  		return true
  8368  	}
  8369  	return false
  8370  }
  8371  func rewriteValuePPC64_OpPPC64MOVDload(v *Value) bool {
  8372  	v_1 := v.Args[1]
  8373  	v_0 := v.Args[0]
  8374  	// match: (MOVDload [off] {sym} ptr (FMOVDstore [off] {sym} ptr x _))
  8375  	// result: (MFVSRD x)
  8376  	for {
  8377  		off := auxIntToInt32(v.AuxInt)
  8378  		sym := auxToSym(v.Aux)
  8379  		ptr := v_0
  8380  		if v_1.Op != OpPPC64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  8381  			break
  8382  		}
  8383  		x := v_1.Args[1]
  8384  		if ptr != v_1.Args[0] {
  8385  			break
  8386  		}
  8387  		v.reset(OpPPC64MFVSRD)
  8388  		v.AddArg(x)
  8389  		return true
  8390  	}
  8391  	// match: (MOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  8392  	// cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) && (off1+off2)%4 == 0
  8393  	// result: (MOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8394  	for {
  8395  		off1 := auxIntToInt32(v.AuxInt)
  8396  		sym1 := auxToSym(v.Aux)
  8397  		p := v_0
  8398  		if p.Op != OpPPC64MOVDaddr {
  8399  			break
  8400  		}
  8401  		off2 := auxIntToInt32(p.AuxInt)
  8402  		sym2 := auxToSym(p.Aux)
  8403  		ptr := p.Args[0]
  8404  		mem := v_1
  8405  		if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) && (off1+off2)%4 == 0) {
  8406  			break
  8407  		}
  8408  		v.reset(OpPPC64MOVDload)
  8409  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8410  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8411  		v.AddArg2(ptr, mem)
  8412  		return true
  8413  	}
  8414  	// match: (MOVDload [off1] {sym} (ADDconst [off2] x) mem)
  8415  	// cond: is16Bit(int64(off1)+off2) && (int64(off1)+off2)%4 == 0
  8416  	// result: (MOVDload [off1+int32(off2)] {sym} x mem)
  8417  	for {
  8418  		off1 := auxIntToInt32(v.AuxInt)
  8419  		sym := auxToSym(v.Aux)
  8420  		if v_0.Op != OpPPC64ADDconst {
  8421  			break
  8422  		}
  8423  		off2 := auxIntToInt64(v_0.AuxInt)
  8424  		x := v_0.Args[0]
  8425  		mem := v_1
  8426  		if !(is16Bit(int64(off1)+off2) && (int64(off1)+off2)%4 == 0) {
  8427  			break
  8428  		}
  8429  		v.reset(OpPPC64MOVDload)
  8430  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8431  		v.Aux = symToAux(sym)
  8432  		v.AddArg2(x, mem)
  8433  		return true
  8434  	}
  8435  	// match: (MOVDload [0] {sym} p:(ADD ptr idx) mem)
  8436  	// cond: sym == nil && p.Uses == 1
  8437  	// result: (MOVDloadidx ptr idx mem)
  8438  	for {
  8439  		if auxIntToInt32(v.AuxInt) != 0 {
  8440  			break
  8441  		}
  8442  		sym := auxToSym(v.Aux)
  8443  		p := v_0
  8444  		if p.Op != OpPPC64ADD {
  8445  			break
  8446  		}
  8447  		idx := p.Args[1]
  8448  		ptr := p.Args[0]
  8449  		mem := v_1
  8450  		if !(sym == nil && p.Uses == 1) {
  8451  			break
  8452  		}
  8453  		v.reset(OpPPC64MOVDloadidx)
  8454  		v.AddArg3(ptr, idx, mem)
  8455  		return true
  8456  	}
  8457  	return false
  8458  }
  8459  func rewriteValuePPC64_OpPPC64MOVDloadidx(v *Value) bool {
  8460  	v_2 := v.Args[2]
  8461  	v_1 := v.Args[1]
  8462  	v_0 := v.Args[0]
  8463  	// match: (MOVDloadidx ptr (MOVDconst [c]) mem)
  8464  	// cond: is16Bit(c) && c%4 == 0
  8465  	// result: (MOVDload [int32(c)] ptr mem)
  8466  	for {
  8467  		ptr := v_0
  8468  		if v_1.Op != OpPPC64MOVDconst {
  8469  			break
  8470  		}
  8471  		c := auxIntToInt64(v_1.AuxInt)
  8472  		mem := v_2
  8473  		if !(is16Bit(c) && c%4 == 0) {
  8474  			break
  8475  		}
  8476  		v.reset(OpPPC64MOVDload)
  8477  		v.AuxInt = int32ToAuxInt(int32(c))
  8478  		v.AddArg2(ptr, mem)
  8479  		return true
  8480  	}
  8481  	// match: (MOVDloadidx (MOVDconst [c]) ptr mem)
  8482  	// cond: is16Bit(c) && c%4 == 0
  8483  	// result: (MOVDload [int32(c)] ptr mem)
  8484  	for {
  8485  		if v_0.Op != OpPPC64MOVDconst {
  8486  			break
  8487  		}
  8488  		c := auxIntToInt64(v_0.AuxInt)
  8489  		ptr := v_1
  8490  		mem := v_2
  8491  		if !(is16Bit(c) && c%4 == 0) {
  8492  			break
  8493  		}
  8494  		v.reset(OpPPC64MOVDload)
  8495  		v.AuxInt = int32ToAuxInt(int32(c))
  8496  		v.AddArg2(ptr, mem)
  8497  		return true
  8498  	}
  8499  	return false
  8500  }
  8501  func rewriteValuePPC64_OpPPC64MOVDstore(v *Value) bool {
  8502  	v_2 := v.Args[2]
  8503  	v_1 := v.Args[1]
  8504  	v_0 := v.Args[0]
  8505  	// match: (MOVDstore [off] {sym} ptr (MFVSRD x) mem)
  8506  	// result: (FMOVDstore [off] {sym} ptr x mem)
  8507  	for {
  8508  		off := auxIntToInt32(v.AuxInt)
  8509  		sym := auxToSym(v.Aux)
  8510  		ptr := v_0
  8511  		if v_1.Op != OpPPC64MFVSRD {
  8512  			break
  8513  		}
  8514  		x := v_1.Args[0]
  8515  		mem := v_2
  8516  		v.reset(OpPPC64FMOVDstore)
  8517  		v.AuxInt = int32ToAuxInt(off)
  8518  		v.Aux = symToAux(sym)
  8519  		v.AddArg3(ptr, x, mem)
  8520  		return true
  8521  	}
  8522  	// match: (MOVDstore [off1] {sym} (ADDconst [off2] x) val mem)
  8523  	// cond: is16Bit(int64(off1)+off2) && (int64(off1)+off2)%4 == 0
  8524  	// result: (MOVDstore [off1+int32(off2)] {sym} x val mem)
  8525  	for {
  8526  		off1 := auxIntToInt32(v.AuxInt)
  8527  		sym := auxToSym(v.Aux)
  8528  		if v_0.Op != OpPPC64ADDconst {
  8529  			break
  8530  		}
  8531  		off2 := auxIntToInt64(v_0.AuxInt)
  8532  		x := v_0.Args[0]
  8533  		val := v_1
  8534  		mem := v_2
  8535  		if !(is16Bit(int64(off1)+off2) && (int64(off1)+off2)%4 == 0) {
  8536  			break
  8537  		}
  8538  		v.reset(OpPPC64MOVDstore)
  8539  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8540  		v.Aux = symToAux(sym)
  8541  		v.AddArg3(x, val, mem)
  8542  		return true
  8543  	}
  8544  	// match: (MOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  8545  	// cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) && (off1+off2)%4 == 0
  8546  	// result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  8547  	for {
  8548  		off1 := auxIntToInt32(v.AuxInt)
  8549  		sym1 := auxToSym(v.Aux)
  8550  		p := v_0
  8551  		if p.Op != OpPPC64MOVDaddr {
  8552  			break
  8553  		}
  8554  		off2 := auxIntToInt32(p.AuxInt)
  8555  		sym2 := auxToSym(p.Aux)
  8556  		ptr := p.Args[0]
  8557  		val := v_1
  8558  		mem := v_2
  8559  		if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) && (off1+off2)%4 == 0) {
  8560  			break
  8561  		}
  8562  		v.reset(OpPPC64MOVDstore)
  8563  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8564  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8565  		v.AddArg3(ptr, val, mem)
  8566  		return true
  8567  	}
  8568  	// match: (MOVDstore [off] {sym} ptr (MOVDconst [0]) mem)
  8569  	// result: (MOVDstorezero [off] {sym} ptr mem)
  8570  	for {
  8571  		off := auxIntToInt32(v.AuxInt)
  8572  		sym := auxToSym(v.Aux)
  8573  		ptr := v_0
  8574  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  8575  			break
  8576  		}
  8577  		mem := v_2
  8578  		v.reset(OpPPC64MOVDstorezero)
  8579  		v.AuxInt = int32ToAuxInt(off)
  8580  		v.Aux = symToAux(sym)
  8581  		v.AddArg2(ptr, mem)
  8582  		return true
  8583  	}
  8584  	// match: (MOVDstore [0] {sym} p:(ADD ptr idx) val mem)
  8585  	// cond: sym == nil && p.Uses == 1
  8586  	// result: (MOVDstoreidx ptr idx val mem)
  8587  	for {
  8588  		if auxIntToInt32(v.AuxInt) != 0 {
  8589  			break
  8590  		}
  8591  		sym := auxToSym(v.Aux)
  8592  		p := v_0
  8593  		if p.Op != OpPPC64ADD {
  8594  			break
  8595  		}
  8596  		idx := p.Args[1]
  8597  		ptr := p.Args[0]
  8598  		val := v_1
  8599  		mem := v_2
  8600  		if !(sym == nil && p.Uses == 1) {
  8601  			break
  8602  		}
  8603  		v.reset(OpPPC64MOVDstoreidx)
  8604  		v.AddArg4(ptr, idx, val, mem)
  8605  		return true
  8606  	}
  8607  	return false
  8608  }
  8609  func rewriteValuePPC64_OpPPC64MOVDstoreidx(v *Value) bool {
  8610  	v_3 := v.Args[3]
  8611  	v_2 := v.Args[2]
  8612  	v_1 := v.Args[1]
  8613  	v_0 := v.Args[0]
  8614  	// match: (MOVDstoreidx ptr (MOVDconst [c]) val mem)
  8615  	// cond: is16Bit(c) && c%4 == 0
  8616  	// result: (MOVDstore [int32(c)] ptr val mem)
  8617  	for {
  8618  		ptr := v_0
  8619  		if v_1.Op != OpPPC64MOVDconst {
  8620  			break
  8621  		}
  8622  		c := auxIntToInt64(v_1.AuxInt)
  8623  		val := v_2
  8624  		mem := v_3
  8625  		if !(is16Bit(c) && c%4 == 0) {
  8626  			break
  8627  		}
  8628  		v.reset(OpPPC64MOVDstore)
  8629  		v.AuxInt = int32ToAuxInt(int32(c))
  8630  		v.AddArg3(ptr, val, mem)
  8631  		return true
  8632  	}
  8633  	// match: (MOVDstoreidx (MOVDconst [c]) ptr val mem)
  8634  	// cond: is16Bit(c) && c%4 == 0
  8635  	// result: (MOVDstore [int32(c)] ptr val mem)
  8636  	for {
  8637  		if v_0.Op != OpPPC64MOVDconst {
  8638  			break
  8639  		}
  8640  		c := auxIntToInt64(v_0.AuxInt)
  8641  		ptr := v_1
  8642  		val := v_2
  8643  		mem := v_3
  8644  		if !(is16Bit(c) && c%4 == 0) {
  8645  			break
  8646  		}
  8647  		v.reset(OpPPC64MOVDstore)
  8648  		v.AuxInt = int32ToAuxInt(int32(c))
  8649  		v.AddArg3(ptr, val, mem)
  8650  		return true
  8651  	}
  8652  	return false
  8653  }
  8654  func rewriteValuePPC64_OpPPC64MOVDstorezero(v *Value) bool {
  8655  	v_1 := v.Args[1]
  8656  	v_0 := v.Args[0]
  8657  	// match: (MOVDstorezero [off1] {sym} (ADDconst [off2] x) mem)
  8658  	// cond: is16Bit(int64(off1)+off2) && (int64(off1)+off2)%4 == 0
  8659  	// result: (MOVDstorezero [off1+int32(off2)] {sym} x mem)
  8660  	for {
  8661  		off1 := auxIntToInt32(v.AuxInt)
  8662  		sym := auxToSym(v.Aux)
  8663  		if v_0.Op != OpPPC64ADDconst {
  8664  			break
  8665  		}
  8666  		off2 := auxIntToInt64(v_0.AuxInt)
  8667  		x := v_0.Args[0]
  8668  		mem := v_1
  8669  		if !(is16Bit(int64(off1)+off2) && (int64(off1)+off2)%4 == 0) {
  8670  			break
  8671  		}
  8672  		v.reset(OpPPC64MOVDstorezero)
  8673  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8674  		v.Aux = symToAux(sym)
  8675  		v.AddArg2(x, mem)
  8676  		return true
  8677  	}
  8678  	// match: (MOVDstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
  8679  	// cond: canMergeSym(sym1,sym2) && (x.Op != OpSB || p.Uses == 1) && (off1+off2)%4 == 0
  8680  	// result: (MOVDstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
  8681  	for {
  8682  		off1 := auxIntToInt32(v.AuxInt)
  8683  		sym1 := auxToSym(v.Aux)
  8684  		p := v_0
  8685  		if p.Op != OpPPC64MOVDaddr {
  8686  			break
  8687  		}
  8688  		off2 := auxIntToInt32(p.AuxInt)
  8689  		sym2 := auxToSym(p.Aux)
  8690  		x := p.Args[0]
  8691  		mem := v_1
  8692  		if !(canMergeSym(sym1, sym2) && (x.Op != OpSB || p.Uses == 1) && (off1+off2)%4 == 0) {
  8693  			break
  8694  		}
  8695  		v.reset(OpPPC64MOVDstorezero)
  8696  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8697  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8698  		v.AddArg2(x, mem)
  8699  		return true
  8700  	}
  8701  	return false
  8702  }
  8703  func rewriteValuePPC64_OpPPC64MOVHBRstore(v *Value) bool {
  8704  	v_2 := v.Args[2]
  8705  	v_1 := v.Args[1]
  8706  	v_0 := v.Args[0]
  8707  	// match: (MOVHBRstore {sym} ptr (MOVHreg x) mem)
  8708  	// result: (MOVHBRstore {sym} ptr x mem)
  8709  	for {
  8710  		sym := auxToSym(v.Aux)
  8711  		ptr := v_0
  8712  		if v_1.Op != OpPPC64MOVHreg {
  8713  			break
  8714  		}
  8715  		x := v_1.Args[0]
  8716  		mem := v_2
  8717  		v.reset(OpPPC64MOVHBRstore)
  8718  		v.Aux = symToAux(sym)
  8719  		v.AddArg3(ptr, x, mem)
  8720  		return true
  8721  	}
  8722  	// match: (MOVHBRstore {sym} ptr (MOVHZreg x) mem)
  8723  	// result: (MOVHBRstore {sym} ptr x mem)
  8724  	for {
  8725  		sym := auxToSym(v.Aux)
  8726  		ptr := v_0
  8727  		if v_1.Op != OpPPC64MOVHZreg {
  8728  			break
  8729  		}
  8730  		x := v_1.Args[0]
  8731  		mem := v_2
  8732  		v.reset(OpPPC64MOVHBRstore)
  8733  		v.Aux = symToAux(sym)
  8734  		v.AddArg3(ptr, x, mem)
  8735  		return true
  8736  	}
  8737  	// match: (MOVHBRstore {sym} ptr (MOVWreg x) mem)
  8738  	// result: (MOVHBRstore {sym} ptr x mem)
  8739  	for {
  8740  		sym := auxToSym(v.Aux)
  8741  		ptr := v_0
  8742  		if v_1.Op != OpPPC64MOVWreg {
  8743  			break
  8744  		}
  8745  		x := v_1.Args[0]
  8746  		mem := v_2
  8747  		v.reset(OpPPC64MOVHBRstore)
  8748  		v.Aux = symToAux(sym)
  8749  		v.AddArg3(ptr, x, mem)
  8750  		return true
  8751  	}
  8752  	// match: (MOVHBRstore {sym} ptr (MOVWZreg x) mem)
  8753  	// result: (MOVHBRstore {sym} ptr x mem)
  8754  	for {
  8755  		sym := auxToSym(v.Aux)
  8756  		ptr := v_0
  8757  		if v_1.Op != OpPPC64MOVWZreg {
  8758  			break
  8759  		}
  8760  		x := v_1.Args[0]
  8761  		mem := v_2
  8762  		v.reset(OpPPC64MOVHBRstore)
  8763  		v.Aux = symToAux(sym)
  8764  		v.AddArg3(ptr, x, mem)
  8765  		return true
  8766  	}
  8767  	return false
  8768  }
  8769  func rewriteValuePPC64_OpPPC64MOVHZload(v *Value) bool {
  8770  	v_1 := v.Args[1]
  8771  	v_0 := v.Args[0]
  8772  	// match: (MOVHZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  8773  	// cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
  8774  	// result: (MOVHZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8775  	for {
  8776  		off1 := auxIntToInt32(v.AuxInt)
  8777  		sym1 := auxToSym(v.Aux)
  8778  		p := v_0
  8779  		if p.Op != OpPPC64MOVDaddr {
  8780  			break
  8781  		}
  8782  		off2 := auxIntToInt32(p.AuxInt)
  8783  		sym2 := auxToSym(p.Aux)
  8784  		ptr := p.Args[0]
  8785  		mem := v_1
  8786  		if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
  8787  			break
  8788  		}
  8789  		v.reset(OpPPC64MOVHZload)
  8790  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8791  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8792  		v.AddArg2(ptr, mem)
  8793  		return true
  8794  	}
  8795  	// match: (MOVHZload [off1] {sym} (ADDconst [off2] x) mem)
  8796  	// cond: is16Bit(int64(off1)+off2)
  8797  	// result: (MOVHZload [off1+int32(off2)] {sym} x mem)
  8798  	for {
  8799  		off1 := auxIntToInt32(v.AuxInt)
  8800  		sym := auxToSym(v.Aux)
  8801  		if v_0.Op != OpPPC64ADDconst {
  8802  			break
  8803  		}
  8804  		off2 := auxIntToInt64(v_0.AuxInt)
  8805  		x := v_0.Args[0]
  8806  		mem := v_1
  8807  		if !(is16Bit(int64(off1) + off2)) {
  8808  			break
  8809  		}
  8810  		v.reset(OpPPC64MOVHZload)
  8811  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8812  		v.Aux = symToAux(sym)
  8813  		v.AddArg2(x, mem)
  8814  		return true
  8815  	}
  8816  	// match: (MOVHZload [0] {sym} p:(ADD ptr idx) mem)
  8817  	// cond: sym == nil && p.Uses == 1
  8818  	// result: (MOVHZloadidx ptr idx mem)
  8819  	for {
  8820  		if auxIntToInt32(v.AuxInt) != 0 {
  8821  			break
  8822  		}
  8823  		sym := auxToSym(v.Aux)
  8824  		p := v_0
  8825  		if p.Op != OpPPC64ADD {
  8826  			break
  8827  		}
  8828  		idx := p.Args[1]
  8829  		ptr := p.Args[0]
  8830  		mem := v_1
  8831  		if !(sym == nil && p.Uses == 1) {
  8832  			break
  8833  		}
  8834  		v.reset(OpPPC64MOVHZloadidx)
  8835  		v.AddArg3(ptr, idx, mem)
  8836  		return true
  8837  	}
  8838  	return false
  8839  }
  8840  func rewriteValuePPC64_OpPPC64MOVHZloadidx(v *Value) bool {
  8841  	v_2 := v.Args[2]
  8842  	v_1 := v.Args[1]
  8843  	v_0 := v.Args[0]
  8844  	// match: (MOVHZloadidx ptr (MOVDconst [c]) mem)
  8845  	// cond: is16Bit(c)
  8846  	// result: (MOVHZload [int32(c)] ptr mem)
  8847  	for {
  8848  		ptr := v_0
  8849  		if v_1.Op != OpPPC64MOVDconst {
  8850  			break
  8851  		}
  8852  		c := auxIntToInt64(v_1.AuxInt)
  8853  		mem := v_2
  8854  		if !(is16Bit(c)) {
  8855  			break
  8856  		}
  8857  		v.reset(OpPPC64MOVHZload)
  8858  		v.AuxInt = int32ToAuxInt(int32(c))
  8859  		v.AddArg2(ptr, mem)
  8860  		return true
  8861  	}
  8862  	// match: (MOVHZloadidx (MOVDconst [c]) ptr mem)
  8863  	// cond: is16Bit(c)
  8864  	// result: (MOVHZload [int32(c)] ptr mem)
  8865  	for {
  8866  		if v_0.Op != OpPPC64MOVDconst {
  8867  			break
  8868  		}
  8869  		c := auxIntToInt64(v_0.AuxInt)
  8870  		ptr := v_1
  8871  		mem := v_2
  8872  		if !(is16Bit(c)) {
  8873  			break
  8874  		}
  8875  		v.reset(OpPPC64MOVHZload)
  8876  		v.AuxInt = int32ToAuxInt(int32(c))
  8877  		v.AddArg2(ptr, mem)
  8878  		return true
  8879  	}
  8880  	return false
  8881  }
  8882  func rewriteValuePPC64_OpPPC64MOVHZreg(v *Value) bool {
  8883  	v_0 := v.Args[0]
  8884  	b := v.Block
  8885  	typ := &b.Func.Config.Types
  8886  	// match: (MOVHZreg y:(ANDconst [c] _))
  8887  	// cond: uint64(c) <= 0xFFFF
  8888  	// result: y
  8889  	for {
  8890  		y := v_0
  8891  		if y.Op != OpPPC64ANDconst {
  8892  			break
  8893  		}
  8894  		c := auxIntToInt64(y.AuxInt)
  8895  		if !(uint64(c) <= 0xFFFF) {
  8896  			break
  8897  		}
  8898  		v.copyOf(y)
  8899  		return true
  8900  	}
  8901  	// match: (MOVHZreg (SRWconst [c] (MOVBZreg x)))
  8902  	// result: (SRWconst [c] (MOVBZreg x))
  8903  	for {
  8904  		if v_0.Op != OpPPC64SRWconst {
  8905  			break
  8906  		}
  8907  		c := auxIntToInt64(v_0.AuxInt)
  8908  		v_0_0 := v_0.Args[0]
  8909  		if v_0_0.Op != OpPPC64MOVBZreg {
  8910  			break
  8911  		}
  8912  		x := v_0_0.Args[0]
  8913  		v.reset(OpPPC64SRWconst)
  8914  		v.AuxInt = int64ToAuxInt(c)
  8915  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  8916  		v0.AddArg(x)
  8917  		v.AddArg(v0)
  8918  		return true
  8919  	}
  8920  	// match: (MOVHZreg (SRWconst [c] (MOVHZreg x)))
  8921  	// result: (SRWconst [c] (MOVHZreg x))
  8922  	for {
  8923  		if v_0.Op != OpPPC64SRWconst {
  8924  			break
  8925  		}
  8926  		c := auxIntToInt64(v_0.AuxInt)
  8927  		v_0_0 := v_0.Args[0]
  8928  		if v_0_0.Op != OpPPC64MOVHZreg {
  8929  			break
  8930  		}
  8931  		x := v_0_0.Args[0]
  8932  		v.reset(OpPPC64SRWconst)
  8933  		v.AuxInt = int64ToAuxInt(c)
  8934  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  8935  		v0.AddArg(x)
  8936  		v.AddArg(v0)
  8937  		return true
  8938  	}
  8939  	// match: (MOVHZreg (SRWconst [c] x))
  8940  	// cond: sizeof(x.Type) <= 16
  8941  	// result: (SRWconst [c] x)
  8942  	for {
  8943  		if v_0.Op != OpPPC64SRWconst {
  8944  			break
  8945  		}
  8946  		c := auxIntToInt64(v_0.AuxInt)
  8947  		x := v_0.Args[0]
  8948  		if !(sizeof(x.Type) <= 16) {
  8949  			break
  8950  		}
  8951  		v.reset(OpPPC64SRWconst)
  8952  		v.AuxInt = int64ToAuxInt(c)
  8953  		v.AddArg(x)
  8954  		return true
  8955  	}
  8956  	// match: (MOVHZreg (SRDconst [c] x))
  8957  	// cond: c>=48
  8958  	// result: (SRDconst [c] x)
  8959  	for {
  8960  		if v_0.Op != OpPPC64SRDconst {
  8961  			break
  8962  		}
  8963  		c := auxIntToInt64(v_0.AuxInt)
  8964  		x := v_0.Args[0]
  8965  		if !(c >= 48) {
  8966  			break
  8967  		}
  8968  		v.reset(OpPPC64SRDconst)
  8969  		v.AuxInt = int64ToAuxInt(c)
  8970  		v.AddArg(x)
  8971  		return true
  8972  	}
  8973  	// match: (MOVHZreg (SRWconst [c] x))
  8974  	// cond: c>=16
  8975  	// result: (SRWconst [c] x)
  8976  	for {
  8977  		if v_0.Op != OpPPC64SRWconst {
  8978  			break
  8979  		}
  8980  		c := auxIntToInt64(v_0.AuxInt)
  8981  		x := v_0.Args[0]
  8982  		if !(c >= 16) {
  8983  			break
  8984  		}
  8985  		v.reset(OpPPC64SRWconst)
  8986  		v.AuxInt = int64ToAuxInt(c)
  8987  		v.AddArg(x)
  8988  		return true
  8989  	}
  8990  	// match: (MOVHZreg y:(MOVHZreg _))
  8991  	// result: y
  8992  	for {
  8993  		y := v_0
  8994  		if y.Op != OpPPC64MOVHZreg {
  8995  			break
  8996  		}
  8997  		v.copyOf(y)
  8998  		return true
  8999  	}
  9000  	// match: (MOVHZreg y:(MOVBZreg _))
  9001  	// result: y
  9002  	for {
  9003  		y := v_0
  9004  		if y.Op != OpPPC64MOVBZreg {
  9005  			break
  9006  		}
  9007  		v.copyOf(y)
  9008  		return true
  9009  	}
  9010  	// match: (MOVHZreg y:(MOVHBRload _ _))
  9011  	// result: y
  9012  	for {
  9013  		y := v_0
  9014  		if y.Op != OpPPC64MOVHBRload {
  9015  			break
  9016  		}
  9017  		v.copyOf(y)
  9018  		return true
  9019  	}
  9020  	// match: (MOVHZreg y:(MOVHreg x))
  9021  	// result: (MOVHZreg x)
  9022  	for {
  9023  		y := v_0
  9024  		if y.Op != OpPPC64MOVHreg {
  9025  			break
  9026  		}
  9027  		x := y.Args[0]
  9028  		v.reset(OpPPC64MOVHZreg)
  9029  		v.AddArg(x)
  9030  		return true
  9031  	}
  9032  	// match: (MOVHZreg (OR <t> x (MOVWZreg y)))
  9033  	// result: (MOVHZreg (OR <t> x y))
  9034  	for {
  9035  		if v_0.Op != OpPPC64OR {
  9036  			break
  9037  		}
  9038  		t := v_0.Type
  9039  		_ = v_0.Args[1]
  9040  		v_0_0 := v_0.Args[0]
  9041  		v_0_1 := v_0.Args[1]
  9042  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9043  			x := v_0_0
  9044  			if v_0_1.Op != OpPPC64MOVWZreg {
  9045  				continue
  9046  			}
  9047  			y := v_0_1.Args[0]
  9048  			v.reset(OpPPC64MOVHZreg)
  9049  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  9050  			v0.AddArg2(x, y)
  9051  			v.AddArg(v0)
  9052  			return true
  9053  		}
  9054  		break
  9055  	}
  9056  	// match: (MOVHZreg (XOR <t> x (MOVWZreg y)))
  9057  	// result: (MOVHZreg (XOR <t> x y))
  9058  	for {
  9059  		if v_0.Op != OpPPC64XOR {
  9060  			break
  9061  		}
  9062  		t := v_0.Type
  9063  		_ = v_0.Args[1]
  9064  		v_0_0 := v_0.Args[0]
  9065  		v_0_1 := v_0.Args[1]
  9066  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9067  			x := v_0_0
  9068  			if v_0_1.Op != OpPPC64MOVWZreg {
  9069  				continue
  9070  			}
  9071  			y := v_0_1.Args[0]
  9072  			v.reset(OpPPC64MOVHZreg)
  9073  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  9074  			v0.AddArg2(x, y)
  9075  			v.AddArg(v0)
  9076  			return true
  9077  		}
  9078  		break
  9079  	}
  9080  	// match: (MOVHZreg (AND <t> x (MOVWZreg y)))
  9081  	// result: (MOVHZreg (AND <t> x y))
  9082  	for {
  9083  		if v_0.Op != OpPPC64AND {
  9084  			break
  9085  		}
  9086  		t := v_0.Type
  9087  		_ = v_0.Args[1]
  9088  		v_0_0 := v_0.Args[0]
  9089  		v_0_1 := v_0.Args[1]
  9090  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9091  			x := v_0_0
  9092  			if v_0_1.Op != OpPPC64MOVWZreg {
  9093  				continue
  9094  			}
  9095  			y := v_0_1.Args[0]
  9096  			v.reset(OpPPC64MOVHZreg)
  9097  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  9098  			v0.AddArg2(x, y)
  9099  			v.AddArg(v0)
  9100  			return true
  9101  		}
  9102  		break
  9103  	}
  9104  	// match: (MOVHZreg (OR <t> x (MOVHZreg y)))
  9105  	// result: (MOVHZreg (OR <t> x y))
  9106  	for {
  9107  		if v_0.Op != OpPPC64OR {
  9108  			break
  9109  		}
  9110  		t := v_0.Type
  9111  		_ = v_0.Args[1]
  9112  		v_0_0 := v_0.Args[0]
  9113  		v_0_1 := v_0.Args[1]
  9114  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9115  			x := v_0_0
  9116  			if v_0_1.Op != OpPPC64MOVHZreg {
  9117  				continue
  9118  			}
  9119  			y := v_0_1.Args[0]
  9120  			v.reset(OpPPC64MOVHZreg)
  9121  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  9122  			v0.AddArg2(x, y)
  9123  			v.AddArg(v0)
  9124  			return true
  9125  		}
  9126  		break
  9127  	}
  9128  	// match: (MOVHZreg (XOR <t> x (MOVHZreg y)))
  9129  	// result: (MOVHZreg (XOR <t> x y))
  9130  	for {
  9131  		if v_0.Op != OpPPC64XOR {
  9132  			break
  9133  		}
  9134  		t := v_0.Type
  9135  		_ = v_0.Args[1]
  9136  		v_0_0 := v_0.Args[0]
  9137  		v_0_1 := v_0.Args[1]
  9138  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9139  			x := v_0_0
  9140  			if v_0_1.Op != OpPPC64MOVHZreg {
  9141  				continue
  9142  			}
  9143  			y := v_0_1.Args[0]
  9144  			v.reset(OpPPC64MOVHZreg)
  9145  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  9146  			v0.AddArg2(x, y)
  9147  			v.AddArg(v0)
  9148  			return true
  9149  		}
  9150  		break
  9151  	}
  9152  	// match: (MOVHZreg (AND <t> x (MOVHZreg y)))
  9153  	// result: (MOVHZreg (AND <t> x y))
  9154  	for {
  9155  		if v_0.Op != OpPPC64AND {
  9156  			break
  9157  		}
  9158  		t := v_0.Type
  9159  		_ = v_0.Args[1]
  9160  		v_0_0 := v_0.Args[0]
  9161  		v_0_1 := v_0.Args[1]
  9162  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9163  			x := v_0_0
  9164  			if v_0_1.Op != OpPPC64MOVHZreg {
  9165  				continue
  9166  			}
  9167  			y := v_0_1.Args[0]
  9168  			v.reset(OpPPC64MOVHZreg)
  9169  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  9170  			v0.AddArg2(x, y)
  9171  			v.AddArg(v0)
  9172  			return true
  9173  		}
  9174  		break
  9175  	}
  9176  	// match: (MOVHZreg z:(ANDconst [c] (MOVBZload ptr x)))
  9177  	// result: z
  9178  	for {
  9179  		z := v_0
  9180  		if z.Op != OpPPC64ANDconst {
  9181  			break
  9182  		}
  9183  		z_0 := z.Args[0]
  9184  		if z_0.Op != OpPPC64MOVBZload {
  9185  			break
  9186  		}
  9187  		v.copyOf(z)
  9188  		return true
  9189  	}
  9190  	// match: (MOVHZreg z:(ANDconst [c] (MOVHZload ptr x)))
  9191  	// result: z
  9192  	for {
  9193  		z := v_0
  9194  		if z.Op != OpPPC64ANDconst {
  9195  			break
  9196  		}
  9197  		z_0 := z.Args[0]
  9198  		if z_0.Op != OpPPC64MOVHZload {
  9199  			break
  9200  		}
  9201  		v.copyOf(z)
  9202  		return true
  9203  	}
  9204  	// match: (MOVHZreg z:(AND y (MOVHZload ptr x)))
  9205  	// result: z
  9206  	for {
  9207  		z := v_0
  9208  		if z.Op != OpPPC64AND {
  9209  			break
  9210  		}
  9211  		_ = z.Args[1]
  9212  		z_0 := z.Args[0]
  9213  		z_1 := z.Args[1]
  9214  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
  9215  			if z_1.Op != OpPPC64MOVHZload {
  9216  				continue
  9217  			}
  9218  			v.copyOf(z)
  9219  			return true
  9220  		}
  9221  		break
  9222  	}
  9223  	// match: (MOVHZreg x:(MOVBZload _ _))
  9224  	// result: x
  9225  	for {
  9226  		x := v_0
  9227  		if x.Op != OpPPC64MOVBZload {
  9228  			break
  9229  		}
  9230  		v.copyOf(x)
  9231  		return true
  9232  	}
  9233  	// match: (MOVHZreg x:(MOVBZloadidx _ _ _))
  9234  	// result: x
  9235  	for {
  9236  		x := v_0
  9237  		if x.Op != OpPPC64MOVBZloadidx {
  9238  			break
  9239  		}
  9240  		v.copyOf(x)
  9241  		return true
  9242  	}
  9243  	// match: (MOVHZreg x:(MOVHZload _ _))
  9244  	// result: x
  9245  	for {
  9246  		x := v_0
  9247  		if x.Op != OpPPC64MOVHZload {
  9248  			break
  9249  		}
  9250  		v.copyOf(x)
  9251  		return true
  9252  	}
  9253  	// match: (MOVHZreg x:(MOVHZloadidx _ _ _))
  9254  	// result: x
  9255  	for {
  9256  		x := v_0
  9257  		if x.Op != OpPPC64MOVHZloadidx {
  9258  			break
  9259  		}
  9260  		v.copyOf(x)
  9261  		return true
  9262  	}
  9263  	// match: (MOVHZreg x:(Arg <t>))
  9264  	// cond: (is8BitInt(t) || is16BitInt(t)) && !isSigned(t)
  9265  	// result: x
  9266  	for {
  9267  		x := v_0
  9268  		if x.Op != OpArg {
  9269  			break
  9270  		}
  9271  		t := x.Type
  9272  		if !((is8BitInt(t) || is16BitInt(t)) && !isSigned(t)) {
  9273  			break
  9274  		}
  9275  		v.copyOf(x)
  9276  		return true
  9277  	}
  9278  	// match: (MOVHZreg (MOVDconst [c]))
  9279  	// result: (MOVDconst [int64(uint16(c))])
  9280  	for {
  9281  		if v_0.Op != OpPPC64MOVDconst {
  9282  			break
  9283  		}
  9284  		c := auxIntToInt64(v_0.AuxInt)
  9285  		v.reset(OpPPC64MOVDconst)
  9286  		v.AuxInt = int64ToAuxInt(int64(uint16(c)))
  9287  		return true
  9288  	}
  9289  	return false
  9290  }
  9291  func rewriteValuePPC64_OpPPC64MOVHload(v *Value) bool {
  9292  	v_1 := v.Args[1]
  9293  	v_0 := v.Args[0]
  9294  	// match: (MOVHload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  9295  	// cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
  9296  	// result: (MOVHload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9297  	for {
  9298  		off1 := auxIntToInt32(v.AuxInt)
  9299  		sym1 := auxToSym(v.Aux)
  9300  		p := v_0
  9301  		if p.Op != OpPPC64MOVDaddr {
  9302  			break
  9303  		}
  9304  		off2 := auxIntToInt32(p.AuxInt)
  9305  		sym2 := auxToSym(p.Aux)
  9306  		ptr := p.Args[0]
  9307  		mem := v_1
  9308  		if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
  9309  			break
  9310  		}
  9311  		v.reset(OpPPC64MOVHload)
  9312  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9313  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9314  		v.AddArg2(ptr, mem)
  9315  		return true
  9316  	}
  9317  	// match: (MOVHload [off1] {sym} (ADDconst [off2] x) mem)
  9318  	// cond: is16Bit(int64(off1)+off2)
  9319  	// result: (MOVHload [off1+int32(off2)] {sym} x mem)
  9320  	for {
  9321  		off1 := auxIntToInt32(v.AuxInt)
  9322  		sym := auxToSym(v.Aux)
  9323  		if v_0.Op != OpPPC64ADDconst {
  9324  			break
  9325  		}
  9326  		off2 := auxIntToInt64(v_0.AuxInt)
  9327  		x := v_0.Args[0]
  9328  		mem := v_1
  9329  		if !(is16Bit(int64(off1) + off2)) {
  9330  			break
  9331  		}
  9332  		v.reset(OpPPC64MOVHload)
  9333  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9334  		v.Aux = symToAux(sym)
  9335  		v.AddArg2(x, mem)
  9336  		return true
  9337  	}
  9338  	// match: (MOVHload [0] {sym} p:(ADD ptr idx) mem)
  9339  	// cond: sym == nil && p.Uses == 1
  9340  	// result: (MOVHloadidx ptr idx mem)
  9341  	for {
  9342  		if auxIntToInt32(v.AuxInt) != 0 {
  9343  			break
  9344  		}
  9345  		sym := auxToSym(v.Aux)
  9346  		p := v_0
  9347  		if p.Op != OpPPC64ADD {
  9348  			break
  9349  		}
  9350  		idx := p.Args[1]
  9351  		ptr := p.Args[0]
  9352  		mem := v_1
  9353  		if !(sym == nil && p.Uses == 1) {
  9354  			break
  9355  		}
  9356  		v.reset(OpPPC64MOVHloadidx)
  9357  		v.AddArg3(ptr, idx, mem)
  9358  		return true
  9359  	}
  9360  	return false
  9361  }
  9362  func rewriteValuePPC64_OpPPC64MOVHloadidx(v *Value) bool {
  9363  	v_2 := v.Args[2]
  9364  	v_1 := v.Args[1]
  9365  	v_0 := v.Args[0]
  9366  	// match: (MOVHloadidx ptr (MOVDconst [c]) mem)
  9367  	// cond: is16Bit(c)
  9368  	// result: (MOVHload [int32(c)] ptr mem)
  9369  	for {
  9370  		ptr := v_0
  9371  		if v_1.Op != OpPPC64MOVDconst {
  9372  			break
  9373  		}
  9374  		c := auxIntToInt64(v_1.AuxInt)
  9375  		mem := v_2
  9376  		if !(is16Bit(c)) {
  9377  			break
  9378  		}
  9379  		v.reset(OpPPC64MOVHload)
  9380  		v.AuxInt = int32ToAuxInt(int32(c))
  9381  		v.AddArg2(ptr, mem)
  9382  		return true
  9383  	}
  9384  	// match: (MOVHloadidx (MOVDconst [c]) ptr mem)
  9385  	// cond: is16Bit(c)
  9386  	// result: (MOVHload [int32(c)] ptr mem)
  9387  	for {
  9388  		if v_0.Op != OpPPC64MOVDconst {
  9389  			break
  9390  		}
  9391  		c := auxIntToInt64(v_0.AuxInt)
  9392  		ptr := v_1
  9393  		mem := v_2
  9394  		if !(is16Bit(c)) {
  9395  			break
  9396  		}
  9397  		v.reset(OpPPC64MOVHload)
  9398  		v.AuxInt = int32ToAuxInt(int32(c))
  9399  		v.AddArg2(ptr, mem)
  9400  		return true
  9401  	}
  9402  	return false
  9403  }
  9404  func rewriteValuePPC64_OpPPC64MOVHreg(v *Value) bool {
  9405  	v_0 := v.Args[0]
  9406  	b := v.Block
  9407  	typ := &b.Func.Config.Types
  9408  	// match: (MOVHreg y:(ANDconst [c] _))
  9409  	// cond: uint64(c) <= 0x7FFF
  9410  	// result: y
  9411  	for {
  9412  		y := v_0
  9413  		if y.Op != OpPPC64ANDconst {
  9414  			break
  9415  		}
  9416  		c := auxIntToInt64(y.AuxInt)
  9417  		if !(uint64(c) <= 0x7FFF) {
  9418  			break
  9419  		}
  9420  		v.copyOf(y)
  9421  		return true
  9422  	}
  9423  	// match: (MOVHreg (SRAWconst [c] (MOVBreg x)))
  9424  	// result: (SRAWconst [c] (MOVBreg x))
  9425  	for {
  9426  		if v_0.Op != OpPPC64SRAWconst {
  9427  			break
  9428  		}
  9429  		c := auxIntToInt64(v_0.AuxInt)
  9430  		v_0_0 := v_0.Args[0]
  9431  		if v_0_0.Op != OpPPC64MOVBreg {
  9432  			break
  9433  		}
  9434  		x := v_0_0.Args[0]
  9435  		v.reset(OpPPC64SRAWconst)
  9436  		v.AuxInt = int64ToAuxInt(c)
  9437  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
  9438  		v0.AddArg(x)
  9439  		v.AddArg(v0)
  9440  		return true
  9441  	}
  9442  	// match: (MOVHreg (SRAWconst [c] (MOVHreg x)))
  9443  	// result: (SRAWconst [c] (MOVHreg x))
  9444  	for {
  9445  		if v_0.Op != OpPPC64SRAWconst {
  9446  			break
  9447  		}
  9448  		c := auxIntToInt64(v_0.AuxInt)
  9449  		v_0_0 := v_0.Args[0]
  9450  		if v_0_0.Op != OpPPC64MOVHreg {
  9451  			break
  9452  		}
  9453  		x := v_0_0.Args[0]
  9454  		v.reset(OpPPC64SRAWconst)
  9455  		v.AuxInt = int64ToAuxInt(c)
  9456  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
  9457  		v0.AddArg(x)
  9458  		v.AddArg(v0)
  9459  		return true
  9460  	}
  9461  	// match: (MOVHreg (SRAWconst [c] x))
  9462  	// cond: sizeof(x.Type) <= 16
  9463  	// result: (SRAWconst [c] x)
  9464  	for {
  9465  		if v_0.Op != OpPPC64SRAWconst {
  9466  			break
  9467  		}
  9468  		c := auxIntToInt64(v_0.AuxInt)
  9469  		x := v_0.Args[0]
  9470  		if !(sizeof(x.Type) <= 16) {
  9471  			break
  9472  		}
  9473  		v.reset(OpPPC64SRAWconst)
  9474  		v.AuxInt = int64ToAuxInt(c)
  9475  		v.AddArg(x)
  9476  		return true
  9477  	}
  9478  	// match: (MOVHreg (SRDconst [c] x))
  9479  	// cond: c>48
  9480  	// result: (SRDconst [c] x)
  9481  	for {
  9482  		if v_0.Op != OpPPC64SRDconst {
  9483  			break
  9484  		}
  9485  		c := auxIntToInt64(v_0.AuxInt)
  9486  		x := v_0.Args[0]
  9487  		if !(c > 48) {
  9488  			break
  9489  		}
  9490  		v.reset(OpPPC64SRDconst)
  9491  		v.AuxInt = int64ToAuxInt(c)
  9492  		v.AddArg(x)
  9493  		return true
  9494  	}
  9495  	// match: (MOVHreg (SRDconst [c] x))
  9496  	// cond: c==48
  9497  	// result: (SRADconst [c] x)
  9498  	for {
  9499  		if v_0.Op != OpPPC64SRDconst {
  9500  			break
  9501  		}
  9502  		c := auxIntToInt64(v_0.AuxInt)
  9503  		x := v_0.Args[0]
  9504  		if !(c == 48) {
  9505  			break
  9506  		}
  9507  		v.reset(OpPPC64SRADconst)
  9508  		v.AuxInt = int64ToAuxInt(c)
  9509  		v.AddArg(x)
  9510  		return true
  9511  	}
  9512  	// match: (MOVHreg (SRADconst [c] x))
  9513  	// cond: c>=48
  9514  	// result: (SRADconst [c] x)
  9515  	for {
  9516  		if v_0.Op != OpPPC64SRADconst {
  9517  			break
  9518  		}
  9519  		c := auxIntToInt64(v_0.AuxInt)
  9520  		x := v_0.Args[0]
  9521  		if !(c >= 48) {
  9522  			break
  9523  		}
  9524  		v.reset(OpPPC64SRADconst)
  9525  		v.AuxInt = int64ToAuxInt(c)
  9526  		v.AddArg(x)
  9527  		return true
  9528  	}
  9529  	// match: (MOVHreg (SRWconst [c] x))
  9530  	// cond: c>16
  9531  	// result: (SRWconst [c] x)
  9532  	for {
  9533  		if v_0.Op != OpPPC64SRWconst {
  9534  			break
  9535  		}
  9536  		c := auxIntToInt64(v_0.AuxInt)
  9537  		x := v_0.Args[0]
  9538  		if !(c > 16) {
  9539  			break
  9540  		}
  9541  		v.reset(OpPPC64SRWconst)
  9542  		v.AuxInt = int64ToAuxInt(c)
  9543  		v.AddArg(x)
  9544  		return true
  9545  	}
  9546  	// match: (MOVHreg (SRAWconst [c] x))
  9547  	// cond: c>=16
  9548  	// result: (SRAWconst [c] x)
  9549  	for {
  9550  		if v_0.Op != OpPPC64SRAWconst {
  9551  			break
  9552  		}
  9553  		c := auxIntToInt64(v_0.AuxInt)
  9554  		x := v_0.Args[0]
  9555  		if !(c >= 16) {
  9556  			break
  9557  		}
  9558  		v.reset(OpPPC64SRAWconst)
  9559  		v.AuxInt = int64ToAuxInt(c)
  9560  		v.AddArg(x)
  9561  		return true
  9562  	}
  9563  	// match: (MOVHreg (SRWconst [c] x))
  9564  	// cond: c==16
  9565  	// result: (SRAWconst [c] x)
  9566  	for {
  9567  		if v_0.Op != OpPPC64SRWconst {
  9568  			break
  9569  		}
  9570  		c := auxIntToInt64(v_0.AuxInt)
  9571  		x := v_0.Args[0]
  9572  		if !(c == 16) {
  9573  			break
  9574  		}
  9575  		v.reset(OpPPC64SRAWconst)
  9576  		v.AuxInt = int64ToAuxInt(c)
  9577  		v.AddArg(x)
  9578  		return true
  9579  	}
  9580  	// match: (MOVHreg y:(MOVHreg _))
  9581  	// result: y
  9582  	for {
  9583  		y := v_0
  9584  		if y.Op != OpPPC64MOVHreg {
  9585  			break
  9586  		}
  9587  		v.copyOf(y)
  9588  		return true
  9589  	}
  9590  	// match: (MOVHreg y:(MOVBreg _))
  9591  	// result: y
  9592  	for {
  9593  		y := v_0
  9594  		if y.Op != OpPPC64MOVBreg {
  9595  			break
  9596  		}
  9597  		v.copyOf(y)
  9598  		return true
  9599  	}
  9600  	// match: (MOVHreg y:(MOVHZreg x))
  9601  	// result: (MOVHreg x)
  9602  	for {
  9603  		y := v_0
  9604  		if y.Op != OpPPC64MOVHZreg {
  9605  			break
  9606  		}
  9607  		x := y.Args[0]
  9608  		v.reset(OpPPC64MOVHreg)
  9609  		v.AddArg(x)
  9610  		return true
  9611  	}
  9612  	// match: (MOVHreg x:(MOVHload _ _))
  9613  	// result: x
  9614  	for {
  9615  		x := v_0
  9616  		if x.Op != OpPPC64MOVHload {
  9617  			break
  9618  		}
  9619  		v.copyOf(x)
  9620  		return true
  9621  	}
  9622  	// match: (MOVHreg x:(MOVHloadidx _ _ _))
  9623  	// result: x
  9624  	for {
  9625  		x := v_0
  9626  		if x.Op != OpPPC64MOVHloadidx {
  9627  			break
  9628  		}
  9629  		v.copyOf(x)
  9630  		return true
  9631  	}
  9632  	// match: (MOVHreg x:(Arg <t>))
  9633  	// cond: (is8BitInt(t) || is16BitInt(t)) && isSigned(t)
  9634  	// result: x
  9635  	for {
  9636  		x := v_0
  9637  		if x.Op != OpArg {
  9638  			break
  9639  		}
  9640  		t := x.Type
  9641  		if !((is8BitInt(t) || is16BitInt(t)) && isSigned(t)) {
  9642  			break
  9643  		}
  9644  		v.copyOf(x)
  9645  		return true
  9646  	}
  9647  	// match: (MOVHreg (MOVDconst [c]))
  9648  	// result: (MOVDconst [int64(int16(c))])
  9649  	for {
  9650  		if v_0.Op != OpPPC64MOVDconst {
  9651  			break
  9652  		}
  9653  		c := auxIntToInt64(v_0.AuxInt)
  9654  		v.reset(OpPPC64MOVDconst)
  9655  		v.AuxInt = int64ToAuxInt(int64(int16(c)))
  9656  		return true
  9657  	}
  9658  	return false
  9659  }
  9660  func rewriteValuePPC64_OpPPC64MOVHstore(v *Value) bool {
  9661  	v_2 := v.Args[2]
  9662  	v_1 := v.Args[1]
  9663  	v_0 := v.Args[0]
  9664  	b := v.Block
  9665  	config := b.Func.Config
  9666  	// match: (MOVHstore [off1] {sym} (ADDconst [off2] x) val mem)
  9667  	// cond: is16Bit(int64(off1)+off2)
  9668  	// result: (MOVHstore [off1+int32(off2)] {sym} x val mem)
  9669  	for {
  9670  		off1 := auxIntToInt32(v.AuxInt)
  9671  		sym := auxToSym(v.Aux)
  9672  		if v_0.Op != OpPPC64ADDconst {
  9673  			break
  9674  		}
  9675  		off2 := auxIntToInt64(v_0.AuxInt)
  9676  		x := v_0.Args[0]
  9677  		val := v_1
  9678  		mem := v_2
  9679  		if !(is16Bit(int64(off1) + off2)) {
  9680  			break
  9681  		}
  9682  		v.reset(OpPPC64MOVHstore)
  9683  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9684  		v.Aux = symToAux(sym)
  9685  		v.AddArg3(x, val, mem)
  9686  		return true
  9687  	}
  9688  	// match: (MOVHstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  9689  	// cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
  9690  	// result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  9691  	for {
  9692  		off1 := auxIntToInt32(v.AuxInt)
  9693  		sym1 := auxToSym(v.Aux)
  9694  		p := v_0
  9695  		if p.Op != OpPPC64MOVDaddr {
  9696  			break
  9697  		}
  9698  		off2 := auxIntToInt32(p.AuxInt)
  9699  		sym2 := auxToSym(p.Aux)
  9700  		ptr := p.Args[0]
  9701  		val := v_1
  9702  		mem := v_2
  9703  		if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
  9704  			break
  9705  		}
  9706  		v.reset(OpPPC64MOVHstore)
  9707  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9708  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9709  		v.AddArg3(ptr, val, mem)
  9710  		return true
  9711  	}
  9712  	// match: (MOVHstore [off] {sym} ptr (MOVDconst [0]) mem)
  9713  	// result: (MOVHstorezero [off] {sym} ptr mem)
  9714  	for {
  9715  		off := auxIntToInt32(v.AuxInt)
  9716  		sym := auxToSym(v.Aux)
  9717  		ptr := v_0
  9718  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  9719  			break
  9720  		}
  9721  		mem := v_2
  9722  		v.reset(OpPPC64MOVHstorezero)
  9723  		v.AuxInt = int32ToAuxInt(off)
  9724  		v.Aux = symToAux(sym)
  9725  		v.AddArg2(ptr, mem)
  9726  		return true
  9727  	}
  9728  	// match: (MOVHstore [0] {sym} p:(ADD ptr idx) val mem)
  9729  	// cond: sym == nil && p.Uses == 1
  9730  	// result: (MOVHstoreidx ptr idx val mem)
  9731  	for {
  9732  		if auxIntToInt32(v.AuxInt) != 0 {
  9733  			break
  9734  		}
  9735  		sym := auxToSym(v.Aux)
  9736  		p := v_0
  9737  		if p.Op != OpPPC64ADD {
  9738  			break
  9739  		}
  9740  		idx := p.Args[1]
  9741  		ptr := p.Args[0]
  9742  		val := v_1
  9743  		mem := v_2
  9744  		if !(sym == nil && p.Uses == 1) {
  9745  			break
  9746  		}
  9747  		v.reset(OpPPC64MOVHstoreidx)
  9748  		v.AddArg4(ptr, idx, val, mem)
  9749  		return true
  9750  	}
  9751  	// match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
  9752  	// result: (MOVHstore [off] {sym} ptr x mem)
  9753  	for {
  9754  		off := auxIntToInt32(v.AuxInt)
  9755  		sym := auxToSym(v.Aux)
  9756  		ptr := v_0
  9757  		if v_1.Op != OpPPC64MOVHreg {
  9758  			break
  9759  		}
  9760  		x := v_1.Args[0]
  9761  		mem := v_2
  9762  		v.reset(OpPPC64MOVHstore)
  9763  		v.AuxInt = int32ToAuxInt(off)
  9764  		v.Aux = symToAux(sym)
  9765  		v.AddArg3(ptr, x, mem)
  9766  		return true
  9767  	}
  9768  	// match: (MOVHstore [off] {sym} ptr (MOVHZreg x) mem)
  9769  	// result: (MOVHstore [off] {sym} ptr x mem)
  9770  	for {
  9771  		off := auxIntToInt32(v.AuxInt)
  9772  		sym := auxToSym(v.Aux)
  9773  		ptr := v_0
  9774  		if v_1.Op != OpPPC64MOVHZreg {
  9775  			break
  9776  		}
  9777  		x := v_1.Args[0]
  9778  		mem := v_2
  9779  		v.reset(OpPPC64MOVHstore)
  9780  		v.AuxInt = int32ToAuxInt(off)
  9781  		v.Aux = symToAux(sym)
  9782  		v.AddArg3(ptr, x, mem)
  9783  		return true
  9784  	}
  9785  	// match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
  9786  	// result: (MOVHstore [off] {sym} ptr x mem)
  9787  	for {
  9788  		off := auxIntToInt32(v.AuxInt)
  9789  		sym := auxToSym(v.Aux)
  9790  		ptr := v_0
  9791  		if v_1.Op != OpPPC64MOVWreg {
  9792  			break
  9793  		}
  9794  		x := v_1.Args[0]
  9795  		mem := v_2
  9796  		v.reset(OpPPC64MOVHstore)
  9797  		v.AuxInt = int32ToAuxInt(off)
  9798  		v.Aux = symToAux(sym)
  9799  		v.AddArg3(ptr, x, mem)
  9800  		return true
  9801  	}
  9802  	// match: (MOVHstore [off] {sym} ptr (MOVWZreg x) mem)
  9803  	// result: (MOVHstore [off] {sym} ptr x mem)
  9804  	for {
  9805  		off := auxIntToInt32(v.AuxInt)
  9806  		sym := auxToSym(v.Aux)
  9807  		ptr := v_0
  9808  		if v_1.Op != OpPPC64MOVWZreg {
  9809  			break
  9810  		}
  9811  		x := v_1.Args[0]
  9812  		mem := v_2
  9813  		v.reset(OpPPC64MOVHstore)
  9814  		v.AuxInt = int32ToAuxInt(off)
  9815  		v.Aux = symToAux(sym)
  9816  		v.AddArg3(ptr, x, mem)
  9817  		return true
  9818  	}
  9819  	// match: (MOVHstore [i1] {s} p (SRWconst w [16]) x0:(MOVHstore [i0] {s} p w mem))
  9820  	// cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+2 && clobber(x0)
  9821  	// result: (MOVWstore [i0] {s} p w mem)
  9822  	for {
  9823  		i1 := auxIntToInt32(v.AuxInt)
  9824  		s := auxToSym(v.Aux)
  9825  		p := v_0
  9826  		if v_1.Op != OpPPC64SRWconst || auxIntToInt64(v_1.AuxInt) != 16 {
  9827  			break
  9828  		}
  9829  		w := v_1.Args[0]
  9830  		x0 := v_2
  9831  		if x0.Op != OpPPC64MOVHstore {
  9832  			break
  9833  		}
  9834  		i0 := auxIntToInt32(x0.AuxInt)
  9835  		if auxToSym(x0.Aux) != s {
  9836  			break
  9837  		}
  9838  		mem := x0.Args[2]
  9839  		if p != x0.Args[0] || w != x0.Args[1] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+2 && clobber(x0)) {
  9840  			break
  9841  		}
  9842  		v.reset(OpPPC64MOVWstore)
  9843  		v.AuxInt = int32ToAuxInt(i0)
  9844  		v.Aux = symToAux(s)
  9845  		v.AddArg3(p, w, mem)
  9846  		return true
  9847  	}
  9848  	// match: (MOVHstore [i1] {s} p (SRDconst w [16]) x0:(MOVHstore [i0] {s} p w mem))
  9849  	// cond: !config.BigEndian && x0.Uses == 1 && i1 == i0+2 && clobber(x0)
  9850  	// result: (MOVWstore [i0] {s} p w mem)
  9851  	for {
  9852  		i1 := auxIntToInt32(v.AuxInt)
  9853  		s := auxToSym(v.Aux)
  9854  		p := v_0
  9855  		if v_1.Op != OpPPC64SRDconst || auxIntToInt64(v_1.AuxInt) != 16 {
  9856  			break
  9857  		}
  9858  		w := v_1.Args[0]
  9859  		x0 := v_2
  9860  		if x0.Op != OpPPC64MOVHstore {
  9861  			break
  9862  		}
  9863  		i0 := auxIntToInt32(x0.AuxInt)
  9864  		if auxToSym(x0.Aux) != s {
  9865  			break
  9866  		}
  9867  		mem := x0.Args[2]
  9868  		if p != x0.Args[0] || w != x0.Args[1] || !(!config.BigEndian && x0.Uses == 1 && i1 == i0+2 && clobber(x0)) {
  9869  			break
  9870  		}
  9871  		v.reset(OpPPC64MOVWstore)
  9872  		v.AuxInt = int32ToAuxInt(i0)
  9873  		v.Aux = symToAux(s)
  9874  		v.AddArg3(p, w, mem)
  9875  		return true
  9876  	}
  9877  	return false
  9878  }
  9879  func rewriteValuePPC64_OpPPC64MOVHstoreidx(v *Value) bool {
  9880  	v_3 := v.Args[3]
  9881  	v_2 := v.Args[2]
  9882  	v_1 := v.Args[1]
  9883  	v_0 := v.Args[0]
  9884  	// match: (MOVHstoreidx ptr (MOVDconst [c]) val mem)
  9885  	// cond: is16Bit(c)
  9886  	// result: (MOVHstore [int32(c)] ptr val mem)
  9887  	for {
  9888  		ptr := v_0
  9889  		if v_1.Op != OpPPC64MOVDconst {
  9890  			break
  9891  		}
  9892  		c := auxIntToInt64(v_1.AuxInt)
  9893  		val := v_2
  9894  		mem := v_3
  9895  		if !(is16Bit(c)) {
  9896  			break
  9897  		}
  9898  		v.reset(OpPPC64MOVHstore)
  9899  		v.AuxInt = int32ToAuxInt(int32(c))
  9900  		v.AddArg3(ptr, val, mem)
  9901  		return true
  9902  	}
  9903  	// match: (MOVHstoreidx (MOVDconst [c]) ptr val mem)
  9904  	// cond: is16Bit(c)
  9905  	// result: (MOVHstore [int32(c)] ptr val mem)
  9906  	for {
  9907  		if v_0.Op != OpPPC64MOVDconst {
  9908  			break
  9909  		}
  9910  		c := auxIntToInt64(v_0.AuxInt)
  9911  		ptr := v_1
  9912  		val := v_2
  9913  		mem := v_3
  9914  		if !(is16Bit(c)) {
  9915  			break
  9916  		}
  9917  		v.reset(OpPPC64MOVHstore)
  9918  		v.AuxInt = int32ToAuxInt(int32(c))
  9919  		v.AddArg3(ptr, val, mem)
  9920  		return true
  9921  	}
  9922  	// match: (MOVHstoreidx ptr idx (MOVHreg x) mem)
  9923  	// result: (MOVHstoreidx ptr idx x mem)
  9924  	for {
  9925  		ptr := v_0
  9926  		idx := v_1
  9927  		if v_2.Op != OpPPC64MOVHreg {
  9928  			break
  9929  		}
  9930  		x := v_2.Args[0]
  9931  		mem := v_3
  9932  		v.reset(OpPPC64MOVHstoreidx)
  9933  		v.AddArg4(ptr, idx, x, mem)
  9934  		return true
  9935  	}
  9936  	// match: (MOVHstoreidx ptr idx (MOVHZreg x) mem)
  9937  	// result: (MOVHstoreidx ptr idx x mem)
  9938  	for {
  9939  		ptr := v_0
  9940  		idx := v_1
  9941  		if v_2.Op != OpPPC64MOVHZreg {
  9942  			break
  9943  		}
  9944  		x := v_2.Args[0]
  9945  		mem := v_3
  9946  		v.reset(OpPPC64MOVHstoreidx)
  9947  		v.AddArg4(ptr, idx, x, mem)
  9948  		return true
  9949  	}
  9950  	// match: (MOVHstoreidx ptr idx (MOVWreg x) mem)
  9951  	// result: (MOVHstoreidx ptr idx x mem)
  9952  	for {
  9953  		ptr := v_0
  9954  		idx := v_1
  9955  		if v_2.Op != OpPPC64MOVWreg {
  9956  			break
  9957  		}
  9958  		x := v_2.Args[0]
  9959  		mem := v_3
  9960  		v.reset(OpPPC64MOVHstoreidx)
  9961  		v.AddArg4(ptr, idx, x, mem)
  9962  		return true
  9963  	}
  9964  	// match: (MOVHstoreidx ptr idx (MOVWZreg x) mem)
  9965  	// result: (MOVHstoreidx ptr idx x mem)
  9966  	for {
  9967  		ptr := v_0
  9968  		idx := v_1
  9969  		if v_2.Op != OpPPC64MOVWZreg {
  9970  			break
  9971  		}
  9972  		x := v_2.Args[0]
  9973  		mem := v_3
  9974  		v.reset(OpPPC64MOVHstoreidx)
  9975  		v.AddArg4(ptr, idx, x, mem)
  9976  		return true
  9977  	}
  9978  	return false
  9979  }
  9980  func rewriteValuePPC64_OpPPC64MOVHstorezero(v *Value) bool {
  9981  	v_1 := v.Args[1]
  9982  	v_0 := v.Args[0]
  9983  	// match: (MOVHstorezero [off1] {sym} (ADDconst [off2] x) mem)
  9984  	// cond: is16Bit(int64(off1)+off2)
  9985  	// result: (MOVHstorezero [off1+int32(off2)] {sym} x mem)
  9986  	for {
  9987  		off1 := auxIntToInt32(v.AuxInt)
  9988  		sym := auxToSym(v.Aux)
  9989  		if v_0.Op != OpPPC64ADDconst {
  9990  			break
  9991  		}
  9992  		off2 := auxIntToInt64(v_0.AuxInt)
  9993  		x := v_0.Args[0]
  9994  		mem := v_1
  9995  		if !(is16Bit(int64(off1) + off2)) {
  9996  			break
  9997  		}
  9998  		v.reset(OpPPC64MOVHstorezero)
  9999  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10000  		v.Aux = symToAux(sym)
 10001  		v.AddArg2(x, mem)
 10002  		return true
 10003  	}
 10004  	// match: (MOVHstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
 10005  	// cond: canMergeSym(sym1,sym2) && (x.Op != OpSB || p.Uses == 1)
 10006  	// result: (MOVHstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
 10007  	for {
 10008  		off1 := auxIntToInt32(v.AuxInt)
 10009  		sym1 := auxToSym(v.Aux)
 10010  		p := v_0
 10011  		if p.Op != OpPPC64MOVDaddr {
 10012  			break
 10013  		}
 10014  		off2 := auxIntToInt32(p.AuxInt)
 10015  		sym2 := auxToSym(p.Aux)
 10016  		x := p.Args[0]
 10017  		mem := v_1
 10018  		if !(canMergeSym(sym1, sym2) && (x.Op != OpSB || p.Uses == 1)) {
 10019  			break
 10020  		}
 10021  		v.reset(OpPPC64MOVHstorezero)
 10022  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10023  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10024  		v.AddArg2(x, mem)
 10025  		return true
 10026  	}
 10027  	return false
 10028  }
 10029  func rewriteValuePPC64_OpPPC64MOVWBRstore(v *Value) bool {
 10030  	v_2 := v.Args[2]
 10031  	v_1 := v.Args[1]
 10032  	v_0 := v.Args[0]
 10033  	// match: (MOVWBRstore {sym} ptr (MOVWreg x) mem)
 10034  	// result: (MOVWBRstore {sym} ptr x mem)
 10035  	for {
 10036  		sym := auxToSym(v.Aux)
 10037  		ptr := v_0
 10038  		if v_1.Op != OpPPC64MOVWreg {
 10039  			break
 10040  		}
 10041  		x := v_1.Args[0]
 10042  		mem := v_2
 10043  		v.reset(OpPPC64MOVWBRstore)
 10044  		v.Aux = symToAux(sym)
 10045  		v.AddArg3(ptr, x, mem)
 10046  		return true
 10047  	}
 10048  	// match: (MOVWBRstore {sym} ptr (MOVWZreg x) mem)
 10049  	// result: (MOVWBRstore {sym} ptr x mem)
 10050  	for {
 10051  		sym := auxToSym(v.Aux)
 10052  		ptr := v_0
 10053  		if v_1.Op != OpPPC64MOVWZreg {
 10054  			break
 10055  		}
 10056  		x := v_1.Args[0]
 10057  		mem := v_2
 10058  		v.reset(OpPPC64MOVWBRstore)
 10059  		v.Aux = symToAux(sym)
 10060  		v.AddArg3(ptr, x, mem)
 10061  		return true
 10062  	}
 10063  	return false
 10064  }
 10065  func rewriteValuePPC64_OpPPC64MOVWZload(v *Value) bool {
 10066  	v_1 := v.Args[1]
 10067  	v_0 := v.Args[0]
 10068  	// match: (MOVWZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
 10069  	// cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
 10070  	// result: (MOVWZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10071  	for {
 10072  		off1 := auxIntToInt32(v.AuxInt)
 10073  		sym1 := auxToSym(v.Aux)
 10074  		p := v_0
 10075  		if p.Op != OpPPC64MOVDaddr {
 10076  			break
 10077  		}
 10078  		off2 := auxIntToInt32(p.AuxInt)
 10079  		sym2 := auxToSym(p.Aux)
 10080  		ptr := p.Args[0]
 10081  		mem := v_1
 10082  		if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
 10083  			break
 10084  		}
 10085  		v.reset(OpPPC64MOVWZload)
 10086  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10087  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10088  		v.AddArg2(ptr, mem)
 10089  		return true
 10090  	}
 10091  	// match: (MOVWZload [off1] {sym} (ADDconst [off2] x) mem)
 10092  	// cond: is16Bit(int64(off1)+off2)
 10093  	// result: (MOVWZload [off1+int32(off2)] {sym} x mem)
 10094  	for {
 10095  		off1 := auxIntToInt32(v.AuxInt)
 10096  		sym := auxToSym(v.Aux)
 10097  		if v_0.Op != OpPPC64ADDconst {
 10098  			break
 10099  		}
 10100  		off2 := auxIntToInt64(v_0.AuxInt)
 10101  		x := v_0.Args[0]
 10102  		mem := v_1
 10103  		if !(is16Bit(int64(off1) + off2)) {
 10104  			break
 10105  		}
 10106  		v.reset(OpPPC64MOVWZload)
 10107  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10108  		v.Aux = symToAux(sym)
 10109  		v.AddArg2(x, mem)
 10110  		return true
 10111  	}
 10112  	// match: (MOVWZload [0] {sym} p:(ADD ptr idx) mem)
 10113  	// cond: sym == nil && p.Uses == 1
 10114  	// result: (MOVWZloadidx ptr idx mem)
 10115  	for {
 10116  		if auxIntToInt32(v.AuxInt) != 0 {
 10117  			break
 10118  		}
 10119  		sym := auxToSym(v.Aux)
 10120  		p := v_0
 10121  		if p.Op != OpPPC64ADD {
 10122  			break
 10123  		}
 10124  		idx := p.Args[1]
 10125  		ptr := p.Args[0]
 10126  		mem := v_1
 10127  		if !(sym == nil && p.Uses == 1) {
 10128  			break
 10129  		}
 10130  		v.reset(OpPPC64MOVWZloadidx)
 10131  		v.AddArg3(ptr, idx, mem)
 10132  		return true
 10133  	}
 10134  	return false
 10135  }
 10136  func rewriteValuePPC64_OpPPC64MOVWZloadidx(v *Value) bool {
 10137  	v_2 := v.Args[2]
 10138  	v_1 := v.Args[1]
 10139  	v_0 := v.Args[0]
 10140  	// match: (MOVWZloadidx ptr (MOVDconst [c]) mem)
 10141  	// cond: is16Bit(c)
 10142  	// result: (MOVWZload [int32(c)] ptr mem)
 10143  	for {
 10144  		ptr := v_0
 10145  		if v_1.Op != OpPPC64MOVDconst {
 10146  			break
 10147  		}
 10148  		c := auxIntToInt64(v_1.AuxInt)
 10149  		mem := v_2
 10150  		if !(is16Bit(c)) {
 10151  			break
 10152  		}
 10153  		v.reset(OpPPC64MOVWZload)
 10154  		v.AuxInt = int32ToAuxInt(int32(c))
 10155  		v.AddArg2(ptr, mem)
 10156  		return true
 10157  	}
 10158  	// match: (MOVWZloadidx (MOVDconst [c]) ptr mem)
 10159  	// cond: is16Bit(c)
 10160  	// result: (MOVWZload [int32(c)] ptr mem)
 10161  	for {
 10162  		if v_0.Op != OpPPC64MOVDconst {
 10163  			break
 10164  		}
 10165  		c := auxIntToInt64(v_0.AuxInt)
 10166  		ptr := v_1
 10167  		mem := v_2
 10168  		if !(is16Bit(c)) {
 10169  			break
 10170  		}
 10171  		v.reset(OpPPC64MOVWZload)
 10172  		v.AuxInt = int32ToAuxInt(int32(c))
 10173  		v.AddArg2(ptr, mem)
 10174  		return true
 10175  	}
 10176  	return false
 10177  }
 10178  func rewriteValuePPC64_OpPPC64MOVWZreg(v *Value) bool {
 10179  	v_0 := v.Args[0]
 10180  	b := v.Block
 10181  	typ := &b.Func.Config.Types
 10182  	// match: (MOVWZreg y:(ANDconst [c] _))
 10183  	// cond: uint64(c) <= 0xFFFFFFFF
 10184  	// result: y
 10185  	for {
 10186  		y := v_0
 10187  		if y.Op != OpPPC64ANDconst {
 10188  			break
 10189  		}
 10190  		c := auxIntToInt64(y.AuxInt)
 10191  		if !(uint64(c) <= 0xFFFFFFFF) {
 10192  			break
 10193  		}
 10194  		v.copyOf(y)
 10195  		return true
 10196  	}
 10197  	// match: (MOVWZreg y:(AND (MOVDconst [c]) _))
 10198  	// cond: uint64(c) <= 0xFFFFFFFF
 10199  	// result: y
 10200  	for {
 10201  		y := v_0
 10202  		if y.Op != OpPPC64AND {
 10203  			break
 10204  		}
 10205  		y_0 := y.Args[0]
 10206  		y_1 := y.Args[1]
 10207  		for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
 10208  			if y_0.Op != OpPPC64MOVDconst {
 10209  				continue
 10210  			}
 10211  			c := auxIntToInt64(y_0.AuxInt)
 10212  			if !(uint64(c) <= 0xFFFFFFFF) {
 10213  				continue
 10214  			}
 10215  			v.copyOf(y)
 10216  			return true
 10217  		}
 10218  		break
 10219  	}
 10220  	// match: (MOVWZreg (SRWconst [c] (MOVBZreg x)))
 10221  	// result: (SRWconst [c] (MOVBZreg x))
 10222  	for {
 10223  		if v_0.Op != OpPPC64SRWconst {
 10224  			break
 10225  		}
 10226  		c := auxIntToInt64(v_0.AuxInt)
 10227  		v_0_0 := v_0.Args[0]
 10228  		if v_0_0.Op != OpPPC64MOVBZreg {
 10229  			break
 10230  		}
 10231  		x := v_0_0.Args[0]
 10232  		v.reset(OpPPC64SRWconst)
 10233  		v.AuxInt = int64ToAuxInt(c)
 10234  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 10235  		v0.AddArg(x)
 10236  		v.AddArg(v0)
 10237  		return true
 10238  	}
 10239  	// match: (MOVWZreg (SRWconst [c] (MOVHZreg x)))
 10240  	// result: (SRWconst [c] (MOVHZreg x))
 10241  	for {
 10242  		if v_0.Op != OpPPC64SRWconst {
 10243  			break
 10244  		}
 10245  		c := auxIntToInt64(v_0.AuxInt)
 10246  		v_0_0 := v_0.Args[0]
 10247  		if v_0_0.Op != OpPPC64MOVHZreg {
 10248  			break
 10249  		}
 10250  		x := v_0_0.Args[0]
 10251  		v.reset(OpPPC64SRWconst)
 10252  		v.AuxInt = int64ToAuxInt(c)
 10253  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 10254  		v0.AddArg(x)
 10255  		v.AddArg(v0)
 10256  		return true
 10257  	}
 10258  	// match: (MOVWZreg (SRWconst [c] (MOVWZreg x)))
 10259  	// result: (SRWconst [c] (MOVWZreg x))
 10260  	for {
 10261  		if v_0.Op != OpPPC64SRWconst {
 10262  			break
 10263  		}
 10264  		c := auxIntToInt64(v_0.AuxInt)
 10265  		v_0_0 := v_0.Args[0]
 10266  		if v_0_0.Op != OpPPC64MOVWZreg {
 10267  			break
 10268  		}
 10269  		x := v_0_0.Args[0]
 10270  		v.reset(OpPPC64SRWconst)
 10271  		v.AuxInt = int64ToAuxInt(c)
 10272  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
 10273  		v0.AddArg(x)
 10274  		v.AddArg(v0)
 10275  		return true
 10276  	}
 10277  	// match: (MOVWZreg (SRWconst [c] x))
 10278  	// cond: sizeof(x.Type) <= 32
 10279  	// result: (SRWconst [c] x)
 10280  	for {
 10281  		if v_0.Op != OpPPC64SRWconst {
 10282  			break
 10283  		}
 10284  		c := auxIntToInt64(v_0.AuxInt)
 10285  		x := v_0.Args[0]
 10286  		if !(sizeof(x.Type) <= 32) {
 10287  			break
 10288  		}
 10289  		v.reset(OpPPC64SRWconst)
 10290  		v.AuxInt = int64ToAuxInt(c)
 10291  		v.AddArg(x)
 10292  		return true
 10293  	}
 10294  	// match: (MOVWZreg (SRDconst [c] x))
 10295  	// cond: c>=32
 10296  	// result: (SRDconst [c] x)
 10297  	for {
 10298  		if v_0.Op != OpPPC64SRDconst {
 10299  			break
 10300  		}
 10301  		c := auxIntToInt64(v_0.AuxInt)
 10302  		x := v_0.Args[0]
 10303  		if !(c >= 32) {
 10304  			break
 10305  		}
 10306  		v.reset(OpPPC64SRDconst)
 10307  		v.AuxInt = int64ToAuxInt(c)
 10308  		v.AddArg(x)
 10309  		return true
 10310  	}
 10311  	// match: (MOVWZreg y:(MOVWZreg _))
 10312  	// result: y
 10313  	for {
 10314  		y := v_0
 10315  		if y.Op != OpPPC64MOVWZreg {
 10316  			break
 10317  		}
 10318  		v.copyOf(y)
 10319  		return true
 10320  	}
 10321  	// match: (MOVWZreg y:(MOVHZreg _))
 10322  	// result: y
 10323  	for {
 10324  		y := v_0
 10325  		if y.Op != OpPPC64MOVHZreg {
 10326  			break
 10327  		}
 10328  		v.copyOf(y)
 10329  		return true
 10330  	}
 10331  	// match: (MOVWZreg y:(MOVBZreg _))
 10332  	// result: y
 10333  	for {
 10334  		y := v_0
 10335  		if y.Op != OpPPC64MOVBZreg {
 10336  			break
 10337  		}
 10338  		v.copyOf(y)
 10339  		return true
 10340  	}
 10341  	// match: (MOVWZreg y:(MOVHBRload _ _))
 10342  	// result: y
 10343  	for {
 10344  		y := v_0
 10345  		if y.Op != OpPPC64MOVHBRload {
 10346  			break
 10347  		}
 10348  		v.copyOf(y)
 10349  		return true
 10350  	}
 10351  	// match: (MOVWZreg y:(MOVWBRload _ _))
 10352  	// result: y
 10353  	for {
 10354  		y := v_0
 10355  		if y.Op != OpPPC64MOVWBRload {
 10356  			break
 10357  		}
 10358  		v.copyOf(y)
 10359  		return true
 10360  	}
 10361  	// match: (MOVWZreg y:(MOVWreg x))
 10362  	// result: (MOVWZreg x)
 10363  	for {
 10364  		y := v_0
 10365  		if y.Op != OpPPC64MOVWreg {
 10366  			break
 10367  		}
 10368  		x := y.Args[0]
 10369  		v.reset(OpPPC64MOVWZreg)
 10370  		v.AddArg(x)
 10371  		return true
 10372  	}
 10373  	// match: (MOVWZreg (OR <t> x (MOVWZreg y)))
 10374  	// result: (MOVWZreg (OR <t> x y))
 10375  	for {
 10376  		if v_0.Op != OpPPC64OR {
 10377  			break
 10378  		}
 10379  		t := v_0.Type
 10380  		_ = v_0.Args[1]
 10381  		v_0_0 := v_0.Args[0]
 10382  		v_0_1 := v_0.Args[1]
 10383  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10384  			x := v_0_0
 10385  			if v_0_1.Op != OpPPC64MOVWZreg {
 10386  				continue
 10387  			}
 10388  			y := v_0_1.Args[0]
 10389  			v.reset(OpPPC64MOVWZreg)
 10390  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
 10391  			v0.AddArg2(x, y)
 10392  			v.AddArg(v0)
 10393  			return true
 10394  		}
 10395  		break
 10396  	}
 10397  	// match: (MOVWZreg (XOR <t> x (MOVWZreg y)))
 10398  	// result: (MOVWZreg (XOR <t> x y))
 10399  	for {
 10400  		if v_0.Op != OpPPC64XOR {
 10401  			break
 10402  		}
 10403  		t := v_0.Type
 10404  		_ = v_0.Args[1]
 10405  		v_0_0 := v_0.Args[0]
 10406  		v_0_1 := v_0.Args[1]
 10407  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10408  			x := v_0_0
 10409  			if v_0_1.Op != OpPPC64MOVWZreg {
 10410  				continue
 10411  			}
 10412  			y := v_0_1.Args[0]
 10413  			v.reset(OpPPC64MOVWZreg)
 10414  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
 10415  			v0.AddArg2(x, y)
 10416  			v.AddArg(v0)
 10417  			return true
 10418  		}
 10419  		break
 10420  	}
 10421  	// match: (MOVWZreg (AND <t> x (MOVWZreg y)))
 10422  	// result: (MOVWZreg (AND <t> x y))
 10423  	for {
 10424  		if v_0.Op != OpPPC64AND {
 10425  			break
 10426  		}
 10427  		t := v_0.Type
 10428  		_ = v_0.Args[1]
 10429  		v_0_0 := v_0.Args[0]
 10430  		v_0_1 := v_0.Args[1]
 10431  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10432  			x := v_0_0
 10433  			if v_0_1.Op != OpPPC64MOVWZreg {
 10434  				continue
 10435  			}
 10436  			y := v_0_1.Args[0]
 10437  			v.reset(OpPPC64MOVWZreg)
 10438  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
 10439  			v0.AddArg2(x, y)
 10440  			v.AddArg(v0)
 10441  			return true
 10442  		}
 10443  		break
 10444  	}
 10445  	// match: (MOVWZreg z:(ANDconst [c] (MOVBZload ptr x)))
 10446  	// result: z
 10447  	for {
 10448  		z := v_0
 10449  		if z.Op != OpPPC64ANDconst {
 10450  			break
 10451  		}
 10452  		z_0 := z.Args[0]
 10453  		if z_0.Op != OpPPC64MOVBZload {
 10454  			break
 10455  		}
 10456  		v.copyOf(z)
 10457  		return true
 10458  	}
 10459  	// match: (MOVWZreg z:(ANDconst [c] (MOVHZload ptr x)))
 10460  	// result: z
 10461  	for {
 10462  		z := v_0
 10463  		if z.Op != OpPPC64ANDconst {
 10464  			break
 10465  		}
 10466  		z_0 := z.Args[0]
 10467  		if z_0.Op != OpPPC64MOVHZload {
 10468  			break
 10469  		}
 10470  		v.copyOf(z)
 10471  		return true
 10472  	}
 10473  	// match: (MOVWZreg z:(ANDconst [c] (MOVWZload ptr x)))
 10474  	// result: z
 10475  	for {
 10476  		z := v_0
 10477  		if z.Op != OpPPC64ANDconst {
 10478  			break
 10479  		}
 10480  		z_0 := z.Args[0]
 10481  		if z_0.Op != OpPPC64MOVWZload {
 10482  			break
 10483  		}
 10484  		v.copyOf(z)
 10485  		return true
 10486  	}
 10487  	// match: (MOVWZreg z:(AND y (MOVWZload ptr x)))
 10488  	// result: z
 10489  	for {
 10490  		z := v_0
 10491  		if z.Op != OpPPC64AND {
 10492  			break
 10493  		}
 10494  		_ = z.Args[1]
 10495  		z_0 := z.Args[0]
 10496  		z_1 := z.Args[1]
 10497  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 10498  			if z_1.Op != OpPPC64MOVWZload {
 10499  				continue
 10500  			}
 10501  			v.copyOf(z)
 10502  			return true
 10503  		}
 10504  		break
 10505  	}
 10506  	// match: (MOVWZreg x:(MOVBZload _ _))
 10507  	// result: x
 10508  	for {
 10509  		x := v_0
 10510  		if x.Op != OpPPC64MOVBZload {
 10511  			break
 10512  		}
 10513  		v.copyOf(x)
 10514  		return true
 10515  	}
 10516  	// match: (MOVWZreg x:(MOVBZloadidx _ _ _))
 10517  	// result: x
 10518  	for {
 10519  		x := v_0
 10520  		if x.Op != OpPPC64MOVBZloadidx {
 10521  			break
 10522  		}
 10523  		v.copyOf(x)
 10524  		return true
 10525  	}
 10526  	// match: (MOVWZreg x:(MOVHZload _ _))
 10527  	// result: x
 10528  	for {
 10529  		x := v_0
 10530  		if x.Op != OpPPC64MOVHZload {
 10531  			break
 10532  		}
 10533  		v.copyOf(x)
 10534  		return true
 10535  	}
 10536  	// match: (MOVWZreg x:(MOVHZloadidx _ _ _))
 10537  	// result: x
 10538  	for {
 10539  		x := v_0
 10540  		if x.Op != OpPPC64MOVHZloadidx {
 10541  			break
 10542  		}
 10543  		v.copyOf(x)
 10544  		return true
 10545  	}
 10546  	// match: (MOVWZreg x:(MOVWZload _ _))
 10547  	// result: x
 10548  	for {
 10549  		x := v_0
 10550  		if x.Op != OpPPC64MOVWZload {
 10551  			break
 10552  		}
 10553  		v.copyOf(x)
 10554  		return true
 10555  	}
 10556  	// match: (MOVWZreg x:(MOVWZloadidx _ _ _))
 10557  	// result: x
 10558  	for {
 10559  		x := v_0
 10560  		if x.Op != OpPPC64MOVWZloadidx {
 10561  			break
 10562  		}
 10563  		v.copyOf(x)
 10564  		return true
 10565  	}
 10566  	// match: (MOVWZreg x:(Arg <t>))
 10567  	// cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !isSigned(t)
 10568  	// result: x
 10569  	for {
 10570  		x := v_0
 10571  		if x.Op != OpArg {
 10572  			break
 10573  		}
 10574  		t := x.Type
 10575  		if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !isSigned(t)) {
 10576  			break
 10577  		}
 10578  		v.copyOf(x)
 10579  		return true
 10580  	}
 10581  	// match: (MOVWZreg (MOVDconst [c]))
 10582  	// result: (MOVDconst [int64(uint32(c))])
 10583  	for {
 10584  		if v_0.Op != OpPPC64MOVDconst {
 10585  			break
 10586  		}
 10587  		c := auxIntToInt64(v_0.AuxInt)
 10588  		v.reset(OpPPC64MOVDconst)
 10589  		v.AuxInt = int64ToAuxInt(int64(uint32(c)))
 10590  		return true
 10591  	}
 10592  	return false
 10593  }
 10594  func rewriteValuePPC64_OpPPC64MOVWload(v *Value) bool {
 10595  	v_1 := v.Args[1]
 10596  	v_0 := v.Args[0]
 10597  	// match: (MOVWload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
 10598  	// cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) && (off1+off2)%4 == 0
 10599  	// result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10600  	for {
 10601  		off1 := auxIntToInt32(v.AuxInt)
 10602  		sym1 := auxToSym(v.Aux)
 10603  		p := v_0
 10604  		if p.Op != OpPPC64MOVDaddr {
 10605  			break
 10606  		}
 10607  		off2 := auxIntToInt32(p.AuxInt)
 10608  		sym2 := auxToSym(p.Aux)
 10609  		ptr := p.Args[0]
 10610  		mem := v_1
 10611  		if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1) && (off1+off2)%4 == 0) {
 10612  			break
 10613  		}
 10614  		v.reset(OpPPC64MOVWload)
 10615  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10616  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10617  		v.AddArg2(ptr, mem)
 10618  		return true
 10619  	}
 10620  	// match: (MOVWload [off1] {sym} (ADDconst [off2] x) mem)
 10621  	// cond: is16Bit(int64(off1)+off2) && (int64(off1)+off2)%4 == 0
 10622  	// result: (MOVWload [off1+int32(off2)] {sym} x mem)
 10623  	for {
 10624  		off1 := auxIntToInt32(v.AuxInt)
 10625  		sym := auxToSym(v.Aux)
 10626  		if v_0.Op != OpPPC64ADDconst {
 10627  			break
 10628  		}
 10629  		off2 := auxIntToInt64(v_0.AuxInt)
 10630  		x := v_0.Args[0]
 10631  		mem := v_1
 10632  		if !(is16Bit(int64(off1)+off2) && (int64(off1)+off2)%4 == 0) {
 10633  			break
 10634  		}
 10635  		v.reset(OpPPC64MOVWload)
 10636  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10637  		v.Aux = symToAux(sym)
 10638  		v.AddArg2(x, mem)
 10639  		return true
 10640  	}
 10641  	// match: (MOVWload [0] {sym} p:(ADD ptr idx) mem)
 10642  	// cond: sym == nil && p.Uses == 1
 10643  	// result: (MOVWloadidx ptr idx mem)
 10644  	for {
 10645  		if auxIntToInt32(v.AuxInt) != 0 {
 10646  			break
 10647  		}
 10648  		sym := auxToSym(v.Aux)
 10649  		p := v_0
 10650  		if p.Op != OpPPC64ADD {
 10651  			break
 10652  		}
 10653  		idx := p.Args[1]
 10654  		ptr := p.Args[0]
 10655  		mem := v_1
 10656  		if !(sym == nil && p.Uses == 1) {
 10657  			break
 10658  		}
 10659  		v.reset(OpPPC64MOVWloadidx)
 10660  		v.AddArg3(ptr, idx, mem)
 10661  		return true
 10662  	}
 10663  	return false
 10664  }
 10665  func rewriteValuePPC64_OpPPC64MOVWloadidx(v *Value) bool {
 10666  	v_2 := v.Args[2]
 10667  	v_1 := v.Args[1]
 10668  	v_0 := v.Args[0]
 10669  	// match: (MOVWloadidx ptr (MOVDconst [c]) mem)
 10670  	// cond: is16Bit(c) && c%4 == 0
 10671  	// result: (MOVWload [int32(c)] ptr mem)
 10672  	for {
 10673  		ptr := v_0
 10674  		if v_1.Op != OpPPC64MOVDconst {
 10675  			break
 10676  		}
 10677  		c := auxIntToInt64(v_1.AuxInt)
 10678  		mem := v_2
 10679  		if !(is16Bit(c) && c%4 == 0) {
 10680  			break
 10681  		}
 10682  		v.reset(OpPPC64MOVWload)
 10683  		v.AuxInt = int32ToAuxInt(int32(c))
 10684  		v.AddArg2(ptr, mem)
 10685  		return true
 10686  	}
 10687  	// match: (MOVWloadidx (MOVDconst [c]) ptr mem)
 10688  	// cond: is16Bit(c) && c%4 == 0
 10689  	// result: (MOVWload [int32(c)] ptr mem)
 10690  	for {
 10691  		if v_0.Op != OpPPC64MOVDconst {
 10692  			break
 10693  		}
 10694  		c := auxIntToInt64(v_0.AuxInt)
 10695  		ptr := v_1
 10696  		mem := v_2
 10697  		if !(is16Bit(c) && c%4 == 0) {
 10698  			break
 10699  		}
 10700  		v.reset(OpPPC64MOVWload)
 10701  		v.AuxInt = int32ToAuxInt(int32(c))
 10702  		v.AddArg2(ptr, mem)
 10703  		return true
 10704  	}
 10705  	return false
 10706  }
 10707  func rewriteValuePPC64_OpPPC64MOVWreg(v *Value) bool {
 10708  	v_0 := v.Args[0]
 10709  	b := v.Block
 10710  	typ := &b.Func.Config.Types
 10711  	// match: (MOVWreg y:(ANDconst [c] _))
 10712  	// cond: uint64(c) <= 0xFFFF
 10713  	// result: y
 10714  	for {
 10715  		y := v_0
 10716  		if y.Op != OpPPC64ANDconst {
 10717  			break
 10718  		}
 10719  		c := auxIntToInt64(y.AuxInt)
 10720  		if !(uint64(c) <= 0xFFFF) {
 10721  			break
 10722  		}
 10723  		v.copyOf(y)
 10724  		return true
 10725  	}
 10726  	// match: (MOVWreg y:(AND (MOVDconst [c]) _))
 10727  	// cond: uint64(c) <= 0x7FFFFFFF
 10728  	// result: y
 10729  	for {
 10730  		y := v_0
 10731  		if y.Op != OpPPC64AND {
 10732  			break
 10733  		}
 10734  		y_0 := y.Args[0]
 10735  		y_1 := y.Args[1]
 10736  		for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
 10737  			if y_0.Op != OpPPC64MOVDconst {
 10738  				continue
 10739  			}
 10740  			c := auxIntToInt64(y_0.AuxInt)
 10741  			if !(uint64(c) <= 0x7FFFFFFF) {
 10742  				continue
 10743  			}
 10744  			v.copyOf(y)
 10745  			return true
 10746  		}
 10747  		break
 10748  	}
 10749  	// match: (MOVWreg (SRAWconst [c] (MOVBreg x)))
 10750  	// result: (SRAWconst [c] (MOVBreg x))
 10751  	for {
 10752  		if v_0.Op != OpPPC64SRAWconst {
 10753  			break
 10754  		}
 10755  		c := auxIntToInt64(v_0.AuxInt)
 10756  		v_0_0 := v_0.Args[0]
 10757  		if v_0_0.Op != OpPPC64MOVBreg {
 10758  			break
 10759  		}
 10760  		x := v_0_0.Args[0]
 10761  		v.reset(OpPPC64SRAWconst)
 10762  		v.AuxInt = int64ToAuxInt(c)
 10763  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 10764  		v0.AddArg(x)
 10765  		v.AddArg(v0)
 10766  		return true
 10767  	}
 10768  	// match: (MOVWreg (SRAWconst [c] (MOVHreg x)))
 10769  	// result: (SRAWconst [c] (MOVHreg x))
 10770  	for {
 10771  		if v_0.Op != OpPPC64SRAWconst {
 10772  			break
 10773  		}
 10774  		c := auxIntToInt64(v_0.AuxInt)
 10775  		v_0_0 := v_0.Args[0]
 10776  		if v_0_0.Op != OpPPC64MOVHreg {
 10777  			break
 10778  		}
 10779  		x := v_0_0.Args[0]
 10780  		v.reset(OpPPC64SRAWconst)
 10781  		v.AuxInt = int64ToAuxInt(c)
 10782  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 10783  		v0.AddArg(x)
 10784  		v.AddArg(v0)
 10785  		return true
 10786  	}
 10787  	// match: (MOVWreg (SRAWconst [c] (MOVWreg x)))
 10788  	// result: (SRAWconst [c] (MOVWreg x))
 10789  	for {
 10790  		if v_0.Op != OpPPC64SRAWconst {
 10791  			break
 10792  		}
 10793  		c := auxIntToInt64(v_0.AuxInt)
 10794  		v_0_0 := v_0.Args[0]
 10795  		if v_0_0.Op != OpPPC64MOVWreg {
 10796  			break
 10797  		}
 10798  		x := v_0_0.Args[0]
 10799  		v.reset(OpPPC64SRAWconst)
 10800  		v.AuxInt = int64ToAuxInt(c)
 10801  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWreg, typ.Int64)
 10802  		v0.AddArg(x)
 10803  		v.AddArg(v0)
 10804  		return true
 10805  	}
 10806  	// match: (MOVWreg (SRAWconst [c] x))
 10807  	// cond: sizeof(x.Type) <= 32
 10808  	// result: (SRAWconst [c] x)
 10809  	for {
 10810  		if v_0.Op != OpPPC64SRAWconst {
 10811  			break
 10812  		}
 10813  		c := auxIntToInt64(v_0.AuxInt)
 10814  		x := v_0.Args[0]
 10815  		if !(sizeof(x.Type) <= 32) {
 10816  			break
 10817  		}
 10818  		v.reset(OpPPC64SRAWconst)
 10819  		v.AuxInt = int64ToAuxInt(c)
 10820  		v.AddArg(x)
 10821  		return true
 10822  	}
 10823  	// match: (MOVWreg (SRDconst [c] x))
 10824  	// cond: c>32
 10825  	// result: (SRDconst [c] x)
 10826  	for {
 10827  		if v_0.Op != OpPPC64SRDconst {
 10828  			break
 10829  		}
 10830  		c := auxIntToInt64(v_0.AuxInt)
 10831  		x := v_0.Args[0]
 10832  		if !(c > 32) {
 10833  			break
 10834  		}
 10835  		v.reset(OpPPC64SRDconst)
 10836  		v.AuxInt = int64ToAuxInt(c)
 10837  		v.AddArg(x)
 10838  		return true
 10839  	}
 10840  	// match: (MOVWreg (SRADconst [c] x))
 10841  	// cond: c>=32
 10842  	// result: (SRADconst [c] x)
 10843  	for {
 10844  		if v_0.Op != OpPPC64SRADconst {
 10845  			break
 10846  		}
 10847  		c := auxIntToInt64(v_0.AuxInt)
 10848  		x := v_0.Args[0]
 10849  		if !(c >= 32) {
 10850  			break
 10851  		}
 10852  		v.reset(OpPPC64SRADconst)
 10853  		v.AuxInt = int64ToAuxInt(c)
 10854  		v.AddArg(x)
 10855  		return true
 10856  	}
 10857  	// match: (MOVWreg (SRDconst [c] x))
 10858  	// cond: c==32
 10859  	// result: (SRADconst [c] x)
 10860  	for {
 10861  		if v_0.Op != OpPPC64SRDconst {
 10862  			break
 10863  		}
 10864  		c := auxIntToInt64(v_0.AuxInt)
 10865  		x := v_0.Args[0]
 10866  		if !(c == 32) {
 10867  			break
 10868  		}
 10869  		v.reset(OpPPC64SRADconst)
 10870  		v.AuxInt = int64ToAuxInt(c)
 10871  		v.AddArg(x)
 10872  		return true
 10873  	}
 10874  	// match: (MOVWreg y:(MOVWreg _))
 10875  	// result: y
 10876  	for {
 10877  		y := v_0
 10878  		if y.Op != OpPPC64MOVWreg {
 10879  			break
 10880  		}
 10881  		v.copyOf(y)
 10882  		return true
 10883  	}
 10884  	// match: (MOVWreg y:(MOVHreg _))
 10885  	// result: y
 10886  	for {
 10887  		y := v_0
 10888  		if y.Op != OpPPC64MOVHreg {
 10889  			break
 10890  		}
 10891  		v.copyOf(y)
 10892  		return true
 10893  	}
 10894  	// match: (MOVWreg y:(MOVBreg _))
 10895  	// result: y
 10896  	for {
 10897  		y := v_0
 10898  		if y.Op != OpPPC64MOVBreg {
 10899  			break
 10900  		}
 10901  		v.copyOf(y)
 10902  		return true
 10903  	}
 10904  	// match: (MOVWreg y:(MOVWZreg x))
 10905  	// result: (MOVWreg x)
 10906  	for {
 10907  		y := v_0
 10908  		if y.Op != OpPPC64MOVWZreg {
 10909  			break
 10910  		}
 10911  		x := y.Args[0]
 10912  		v.reset(OpPPC64MOVWreg)
 10913  		v.AddArg(x)
 10914  		return true
 10915  	}
 10916  	// match: (MOVWreg x:(MOVHload _ _))
 10917  	// result: x
 10918  	for {
 10919  		x := v_0
 10920  		if x.Op != OpPPC64MOVHload {
 10921  			break
 10922  		}
 10923  		v.copyOf(x)
 10924  		return true
 10925  	}
 10926  	// match: (MOVWreg x:(MOVHloadidx _ _ _))
 10927  	// result: x
 10928  	for {
 10929  		x := v_0
 10930  		if x.Op != OpPPC64MOVHloadidx {
 10931  			break
 10932  		}
 10933  		v.copyOf(x)
 10934  		return true
 10935  	}
 10936  	// match: (MOVWreg x:(MOVWload _ _))
 10937  	// result: x
 10938  	for {
 10939  		x := v_0
 10940  		if x.Op != OpPPC64MOVWload {
 10941  			break
 10942  		}
 10943  		v.copyOf(x)
 10944  		return true
 10945  	}
 10946  	// match: (MOVWreg x:(MOVWloadidx _ _ _))
 10947  	// result: x
 10948  	for {
 10949  		x := v_0
 10950  		if x.Op != OpPPC64MOVWloadidx {
 10951  			break
 10952  		}
 10953  		v.copyOf(x)
 10954  		return true
 10955  	}
 10956  	// match: (MOVWreg x:(Arg <t>))
 10957  	// cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && isSigned(t)
 10958  	// result: x
 10959  	for {
 10960  		x := v_0
 10961  		if x.Op != OpArg {
 10962  			break
 10963  		}
 10964  		t := x.Type
 10965  		if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && isSigned(t)) {
 10966  			break
 10967  		}
 10968  		v.copyOf(x)
 10969  		return true
 10970  	}
 10971  	// match: (MOVWreg (MOVDconst [c]))
 10972  	// result: (MOVDconst [int64(int32(c))])
 10973  	for {
 10974  		if v_0.Op != OpPPC64MOVDconst {
 10975  			break
 10976  		}
 10977  		c := auxIntToInt64(v_0.AuxInt)
 10978  		v.reset(OpPPC64MOVDconst)
 10979  		v.AuxInt = int64ToAuxInt(int64(int32(c)))
 10980  		return true
 10981  	}
 10982  	return false
 10983  }
 10984  func rewriteValuePPC64_OpPPC64MOVWstore(v *Value) bool {
 10985  	v_2 := v.Args[2]
 10986  	v_1 := v.Args[1]
 10987  	v_0 := v.Args[0]
 10988  	// match: (MOVWstore [off1] {sym} (ADDconst [off2] x) val mem)
 10989  	// cond: is16Bit(int64(off1)+off2)
 10990  	// result: (MOVWstore [off1+int32(off2)] {sym} x val mem)
 10991  	for {
 10992  		off1 := auxIntToInt32(v.AuxInt)
 10993  		sym := auxToSym(v.Aux)
 10994  		if v_0.Op != OpPPC64ADDconst {
 10995  			break
 10996  		}
 10997  		off2 := auxIntToInt64(v_0.AuxInt)
 10998  		x := v_0.Args[0]
 10999  		val := v_1
 11000  		mem := v_2
 11001  		if !(is16Bit(int64(off1) + off2)) {
 11002  			break
 11003  		}
 11004  		v.reset(OpPPC64MOVWstore)
 11005  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11006  		v.Aux = symToAux(sym)
 11007  		v.AddArg3(x, val, mem)
 11008  		return true
 11009  	}
 11010  	// match: (MOVWstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
 11011  	// cond: canMergeSym(sym1,sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)
 11012  	// result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
 11013  	for {
 11014  		off1 := auxIntToInt32(v.AuxInt)
 11015  		sym1 := auxToSym(v.Aux)
 11016  		p := v_0
 11017  		if p.Op != OpPPC64MOVDaddr {
 11018  			break
 11019  		}
 11020  		off2 := auxIntToInt32(p.AuxInt)
 11021  		sym2 := auxToSym(p.Aux)
 11022  		ptr := p.Args[0]
 11023  		val := v_1
 11024  		mem := v_2
 11025  		if !(canMergeSym(sym1, sym2) && is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) {
 11026  			break
 11027  		}
 11028  		v.reset(OpPPC64MOVWstore)
 11029  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11030  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11031  		v.AddArg3(ptr, val, mem)
 11032  		return true
 11033  	}
 11034  	// match: (MOVWstore [off] {sym} ptr (MOVDconst [0]) mem)
 11035  	// result: (MOVWstorezero [off] {sym} ptr mem)
 11036  	for {
 11037  		off := auxIntToInt32(v.AuxInt)
 11038  		sym := auxToSym(v.Aux)
 11039  		ptr := v_0
 11040  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
 11041  			break
 11042  		}
 11043  		mem := v_2
 11044  		v.reset(OpPPC64MOVWstorezero)
 11045  		v.AuxInt = int32ToAuxInt(off)
 11046  		v.Aux = symToAux(sym)
 11047  		v.AddArg2(ptr, mem)
 11048  		return true
 11049  	}
 11050  	// match: (MOVWstore [0] {sym} p:(ADD ptr idx) val mem)
 11051  	// cond: sym == nil && p.Uses == 1
 11052  	// result: (MOVWstoreidx ptr idx val mem)
 11053  	for {
 11054  		if auxIntToInt32(v.AuxInt) != 0 {
 11055  			break
 11056  		}
 11057  		sym := auxToSym(v.Aux)
 11058  		p := v_0
 11059  		if p.Op != OpPPC64ADD {
 11060  			break
 11061  		}
 11062  		idx := p.Args[1]
 11063  		ptr := p.Args[0]
 11064  		val := v_1
 11065  		mem := v_2
 11066  		if !(sym == nil && p.Uses == 1) {
 11067  			break
 11068  		}
 11069  		v.reset(OpPPC64MOVWstoreidx)
 11070  		v.AddArg4(ptr, idx, val, mem)
 11071  		return true
 11072  	}
 11073  	// match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
 11074  	// result: (MOVWstore [off] {sym} ptr x mem)
 11075  	for {
 11076  		off := auxIntToInt32(v.AuxInt)
 11077  		sym := auxToSym(v.Aux)
 11078  		ptr := v_0
 11079  		if v_1.Op != OpPPC64MOVWreg {
 11080  			break
 11081  		}
 11082  		x := v_1.Args[0]
 11083  		mem := v_2
 11084  		v.reset(OpPPC64MOVWstore)
 11085  		v.AuxInt = int32ToAuxInt(off)
 11086  		v.Aux = symToAux(sym)
 11087  		v.AddArg3(ptr, x, mem)
 11088  		return true
 11089  	}
 11090  	// match: (MOVWstore [off] {sym} ptr (MOVWZreg x) mem)
 11091  	// result: (MOVWstore [off] {sym} ptr x mem)
 11092  	for {
 11093  		off := auxIntToInt32(v.AuxInt)
 11094  		sym := auxToSym(v.Aux)
 11095  		ptr := v_0
 11096  		if v_1.Op != OpPPC64MOVWZreg {
 11097  			break
 11098  		}
 11099  		x := v_1.Args[0]
 11100  		mem := v_2
 11101  		v.reset(OpPPC64MOVWstore)
 11102  		v.AuxInt = int32ToAuxInt(off)
 11103  		v.Aux = symToAux(sym)
 11104  		v.AddArg3(ptr, x, mem)
 11105  		return true
 11106  	}
 11107  	return false
 11108  }
 11109  func rewriteValuePPC64_OpPPC64MOVWstoreidx(v *Value) bool {
 11110  	v_3 := v.Args[3]
 11111  	v_2 := v.Args[2]
 11112  	v_1 := v.Args[1]
 11113  	v_0 := v.Args[0]
 11114  	// match: (MOVWstoreidx ptr (MOVDconst [c]) val mem)
 11115  	// cond: is16Bit(c)
 11116  	// result: (MOVWstore [int32(c)] ptr val mem)
 11117  	for {
 11118  		ptr := v_0
 11119  		if v_1.Op != OpPPC64MOVDconst {
 11120  			break
 11121  		}
 11122  		c := auxIntToInt64(v_1.AuxInt)
 11123  		val := v_2
 11124  		mem := v_3
 11125  		if !(is16Bit(c)) {
 11126  			break
 11127  		}
 11128  		v.reset(OpPPC64MOVWstore)
 11129  		v.AuxInt = int32ToAuxInt(int32(c))
 11130  		v.AddArg3(ptr, val, mem)
 11131  		return true
 11132  	}
 11133  	// match: (MOVWstoreidx (MOVDconst [c]) ptr val mem)
 11134  	// cond: is16Bit(c)
 11135  	// result: (MOVWstore [int32(c)] ptr val mem)
 11136  	for {
 11137  		if v_0.Op != OpPPC64MOVDconst {
 11138  			break
 11139  		}
 11140  		c := auxIntToInt64(v_0.AuxInt)
 11141  		ptr := v_1
 11142  		val := v_2
 11143  		mem := v_3
 11144  		if !(is16Bit(c)) {
 11145  			break
 11146  		}
 11147  		v.reset(OpPPC64MOVWstore)
 11148  		v.AuxInt = int32ToAuxInt(int32(c))
 11149  		v.AddArg3(ptr, val, mem)
 11150  		return true
 11151  	}
 11152  	// match: (MOVWstoreidx ptr idx (MOVWreg x) mem)
 11153  	// result: (MOVWstoreidx ptr idx x mem)
 11154  	for {
 11155  		ptr := v_0
 11156  		idx := v_1
 11157  		if v_2.Op != OpPPC64MOVWreg {
 11158  			break
 11159  		}
 11160  		x := v_2.Args[0]
 11161  		mem := v_3
 11162  		v.reset(OpPPC64MOVWstoreidx)
 11163  		v.AddArg4(ptr, idx, x, mem)
 11164  		return true
 11165  	}
 11166  	// match: (MOVWstoreidx ptr idx (MOVWZreg x) mem)
 11167  	// result: (MOVWstoreidx ptr idx x mem)
 11168  	for {
 11169  		ptr := v_0
 11170  		idx := v_1
 11171  		if v_2.Op != OpPPC64MOVWZreg {
 11172  			break
 11173  		}
 11174  		x := v_2.Args[0]
 11175  		mem := v_3
 11176  		v.reset(OpPPC64MOVWstoreidx)
 11177  		v.AddArg4(ptr, idx, x, mem)
 11178  		return true
 11179  	}
 11180  	return false
 11181  }
 11182  func rewriteValuePPC64_OpPPC64MOVWstorezero(v *Value) bool {
 11183  	v_1 := v.Args[1]
 11184  	v_0 := v.Args[0]
 11185  	// match: (MOVWstorezero [off1] {sym} (ADDconst [off2] x) mem)
 11186  	// cond: is16Bit(int64(off1)+off2)
 11187  	// result: (MOVWstorezero [off1+int32(off2)] {sym} x mem)
 11188  	for {
 11189  		off1 := auxIntToInt32(v.AuxInt)
 11190  		sym := auxToSym(v.Aux)
 11191  		if v_0.Op != OpPPC64ADDconst {
 11192  			break
 11193  		}
 11194  		off2 := auxIntToInt64(v_0.AuxInt)
 11195  		x := v_0.Args[0]
 11196  		mem := v_1
 11197  		if !(is16Bit(int64(off1) + off2)) {
 11198  			break
 11199  		}
 11200  		v.reset(OpPPC64MOVWstorezero)
 11201  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11202  		v.Aux = symToAux(sym)
 11203  		v.AddArg2(x, mem)
 11204  		return true
 11205  	}
 11206  	// match: (MOVWstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
 11207  	// cond: canMergeSym(sym1,sym2) && (x.Op != OpSB || p.Uses == 1)
 11208  	// result: (MOVWstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
 11209  	for {
 11210  		off1 := auxIntToInt32(v.AuxInt)
 11211  		sym1 := auxToSym(v.Aux)
 11212  		p := v_0
 11213  		if p.Op != OpPPC64MOVDaddr {
 11214  			break
 11215  		}
 11216  		off2 := auxIntToInt32(p.AuxInt)
 11217  		sym2 := auxToSym(p.Aux)
 11218  		x := p.Args[0]
 11219  		mem := v_1
 11220  		if !(canMergeSym(sym1, sym2) && (x.Op != OpSB || p.Uses == 1)) {
 11221  			break
 11222  		}
 11223  		v.reset(OpPPC64MOVWstorezero)
 11224  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11225  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11226  		v.AddArg2(x, mem)
 11227  		return true
 11228  	}
 11229  	return false
 11230  }
 11231  func rewriteValuePPC64_OpPPC64MTVSRD(v *Value) bool {
 11232  	v_0 := v.Args[0]
 11233  	b := v.Block
 11234  	typ := &b.Func.Config.Types
 11235  	// match: (MTVSRD (MOVDconst [c]))
 11236  	// cond: !math.IsNaN(math.Float64frombits(uint64(c)))
 11237  	// result: (FMOVDconst [math.Float64frombits(uint64(c))])
 11238  	for {
 11239  		if v_0.Op != OpPPC64MOVDconst {
 11240  			break
 11241  		}
 11242  		c := auxIntToInt64(v_0.AuxInt)
 11243  		if !(!math.IsNaN(math.Float64frombits(uint64(c)))) {
 11244  			break
 11245  		}
 11246  		v.reset(OpPPC64FMOVDconst)
 11247  		v.AuxInt = float64ToAuxInt(math.Float64frombits(uint64(c)))
 11248  		return true
 11249  	}
 11250  	// match: (MTVSRD x:(MOVDload [off] {sym} ptr mem))
 11251  	// cond: x.Uses == 1 && clobber(x)
 11252  	// result: @x.Block (FMOVDload [off] {sym} ptr mem)
 11253  	for {
 11254  		x := v_0
 11255  		if x.Op != OpPPC64MOVDload {
 11256  			break
 11257  		}
 11258  		off := auxIntToInt32(x.AuxInt)
 11259  		sym := auxToSym(x.Aux)
 11260  		mem := x.Args[1]
 11261  		ptr := x.Args[0]
 11262  		if !(x.Uses == 1 && clobber(x)) {
 11263  			break
 11264  		}
 11265  		b = x.Block
 11266  		v0 := b.NewValue0(x.Pos, OpPPC64FMOVDload, typ.Float64)
 11267  		v.copyOf(v0)
 11268  		v0.AuxInt = int32ToAuxInt(off)
 11269  		v0.Aux = symToAux(sym)
 11270  		v0.AddArg2(ptr, mem)
 11271  		return true
 11272  	}
 11273  	return false
 11274  }
 11275  func rewriteValuePPC64_OpPPC64MULLD(v *Value) bool {
 11276  	v_1 := v.Args[1]
 11277  	v_0 := v.Args[0]
 11278  	// match: (MULLD x (MOVDconst [c]))
 11279  	// cond: is16Bit(c)
 11280  	// result: (MULLDconst [int32(c)] x)
 11281  	for {
 11282  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11283  			x := v_0
 11284  			if v_1.Op != OpPPC64MOVDconst {
 11285  				continue
 11286  			}
 11287  			c := auxIntToInt64(v_1.AuxInt)
 11288  			if !(is16Bit(c)) {
 11289  				continue
 11290  			}
 11291  			v.reset(OpPPC64MULLDconst)
 11292  			v.AuxInt = int32ToAuxInt(int32(c))
 11293  			v.AddArg(x)
 11294  			return true
 11295  		}
 11296  		break
 11297  	}
 11298  	return false
 11299  }
 11300  func rewriteValuePPC64_OpPPC64MULLW(v *Value) bool {
 11301  	v_1 := v.Args[1]
 11302  	v_0 := v.Args[0]
 11303  	// match: (MULLW x (MOVDconst [c]))
 11304  	// cond: is16Bit(c)
 11305  	// result: (MULLWconst [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(OpPPC64MULLWconst)
 11317  			v.AuxInt = int32ToAuxInt(int32(c))
 11318  			v.AddArg(x)
 11319  			return true
 11320  		}
 11321  		break
 11322  	}
 11323  	return false
 11324  }
 11325  func rewriteValuePPC64_OpPPC64NEG(v *Value) bool {
 11326  	v_0 := v.Args[0]
 11327  	// match: (NEG (ADDconst [c] x))
 11328  	// cond: is32Bit(-c)
 11329  	// result: (SUBFCconst [-c] x)
 11330  	for {
 11331  		if v_0.Op != OpPPC64ADDconst {
 11332  			break
 11333  		}
 11334  		c := auxIntToInt64(v_0.AuxInt)
 11335  		x := v_0.Args[0]
 11336  		if !(is32Bit(-c)) {
 11337  			break
 11338  		}
 11339  		v.reset(OpPPC64SUBFCconst)
 11340  		v.AuxInt = int64ToAuxInt(-c)
 11341  		v.AddArg(x)
 11342  		return true
 11343  	}
 11344  	// match: (NEG (SUBFCconst [c] x))
 11345  	// cond: is32Bit(-c)
 11346  	// result: (ADDconst [-c] x)
 11347  	for {
 11348  		if v_0.Op != OpPPC64SUBFCconst {
 11349  			break
 11350  		}
 11351  		c := auxIntToInt64(v_0.AuxInt)
 11352  		x := v_0.Args[0]
 11353  		if !(is32Bit(-c)) {
 11354  			break
 11355  		}
 11356  		v.reset(OpPPC64ADDconst)
 11357  		v.AuxInt = int64ToAuxInt(-c)
 11358  		v.AddArg(x)
 11359  		return true
 11360  	}
 11361  	return false
 11362  }
 11363  func rewriteValuePPC64_OpPPC64NOR(v *Value) bool {
 11364  	v_1 := v.Args[1]
 11365  	v_0 := v.Args[0]
 11366  	// match: (NOR (MOVDconst [c]) (MOVDconst [d]))
 11367  	// result: (MOVDconst [^(c|d)])
 11368  	for {
 11369  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11370  			if v_0.Op != OpPPC64MOVDconst {
 11371  				continue
 11372  			}
 11373  			c := auxIntToInt64(v_0.AuxInt)
 11374  			if v_1.Op != OpPPC64MOVDconst {
 11375  				continue
 11376  			}
 11377  			d := auxIntToInt64(v_1.AuxInt)
 11378  			v.reset(OpPPC64MOVDconst)
 11379  			v.AuxInt = int64ToAuxInt(^(c | d))
 11380  			return true
 11381  		}
 11382  		break
 11383  	}
 11384  	return false
 11385  }
 11386  func rewriteValuePPC64_OpPPC64NotEqual(v *Value) bool {
 11387  	v_0 := v.Args[0]
 11388  	b := v.Block
 11389  	typ := &b.Func.Config.Types
 11390  	// match: (NotEqual (FlagEQ))
 11391  	// result: (MOVDconst [0])
 11392  	for {
 11393  		if v_0.Op != OpPPC64FlagEQ {
 11394  			break
 11395  		}
 11396  		v.reset(OpPPC64MOVDconst)
 11397  		v.AuxInt = int64ToAuxInt(0)
 11398  		return true
 11399  	}
 11400  	// match: (NotEqual (FlagLT))
 11401  	// result: (MOVDconst [1])
 11402  	for {
 11403  		if v_0.Op != OpPPC64FlagLT {
 11404  			break
 11405  		}
 11406  		v.reset(OpPPC64MOVDconst)
 11407  		v.AuxInt = int64ToAuxInt(1)
 11408  		return true
 11409  	}
 11410  	// match: (NotEqual (FlagGT))
 11411  	// result: (MOVDconst [1])
 11412  	for {
 11413  		if v_0.Op != OpPPC64FlagGT {
 11414  			break
 11415  		}
 11416  		v.reset(OpPPC64MOVDconst)
 11417  		v.AuxInt = int64ToAuxInt(1)
 11418  		return true
 11419  	}
 11420  	// match: (NotEqual (InvertFlags x))
 11421  	// result: (NotEqual x)
 11422  	for {
 11423  		if v_0.Op != OpPPC64InvertFlags {
 11424  			break
 11425  		}
 11426  		x := v_0.Args[0]
 11427  		v.reset(OpPPC64NotEqual)
 11428  		v.AddArg(x)
 11429  		return true
 11430  	}
 11431  	// match: (NotEqual cmp)
 11432  	// result: (ISELB [6] (MOVDconst [1]) cmp)
 11433  	for {
 11434  		cmp := v_0
 11435  		v.reset(OpPPC64ISELB)
 11436  		v.AuxInt = int32ToAuxInt(6)
 11437  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 11438  		v0.AuxInt = int64ToAuxInt(1)
 11439  		v.AddArg2(v0, cmp)
 11440  		return true
 11441  	}
 11442  }
 11443  func rewriteValuePPC64_OpPPC64OR(v *Value) bool {
 11444  	v_1 := v.Args[1]
 11445  	v_0 := v.Args[0]
 11446  	b := v.Block
 11447  	config := b.Func.Config
 11448  	typ := &b.Func.Config.Types
 11449  	// match: ( OR (SLDconst x [c]) (SRDconst x [d]))
 11450  	// cond: d == 64-c
 11451  	// result: (ROTLconst [c] x)
 11452  	for {
 11453  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11454  			if v_0.Op != OpPPC64SLDconst {
 11455  				continue
 11456  			}
 11457  			c := auxIntToInt64(v_0.AuxInt)
 11458  			x := v_0.Args[0]
 11459  			if v_1.Op != OpPPC64SRDconst {
 11460  				continue
 11461  			}
 11462  			d := auxIntToInt64(v_1.AuxInt)
 11463  			if x != v_1.Args[0] || !(d == 64-c) {
 11464  				continue
 11465  			}
 11466  			v.reset(OpPPC64ROTLconst)
 11467  			v.AuxInt = int64ToAuxInt(c)
 11468  			v.AddArg(x)
 11469  			return true
 11470  		}
 11471  		break
 11472  	}
 11473  	// match: ( OR (SLWconst x [c]) (SRWconst x [d]))
 11474  	// cond: d == 32-c
 11475  	// result: (ROTLWconst [c] x)
 11476  	for {
 11477  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11478  			if v_0.Op != OpPPC64SLWconst {
 11479  				continue
 11480  			}
 11481  			c := auxIntToInt64(v_0.AuxInt)
 11482  			x := v_0.Args[0]
 11483  			if v_1.Op != OpPPC64SRWconst {
 11484  				continue
 11485  			}
 11486  			d := auxIntToInt64(v_1.AuxInt)
 11487  			if x != v_1.Args[0] || !(d == 32-c) {
 11488  				continue
 11489  			}
 11490  			v.reset(OpPPC64ROTLWconst)
 11491  			v.AuxInt = int64ToAuxInt(c)
 11492  			v.AddArg(x)
 11493  			return true
 11494  		}
 11495  		break
 11496  	}
 11497  	// match: ( OR (SLD x (ANDconst <typ.Int64> [63] y)) (SRD x (SUB <typ.UInt> (MOVDconst [64]) (ANDconst <typ.UInt> [63] y))))
 11498  	// result: (ROTL x y)
 11499  	for {
 11500  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11501  			if v_0.Op != OpPPC64SLD {
 11502  				continue
 11503  			}
 11504  			_ = v_0.Args[1]
 11505  			x := v_0.Args[0]
 11506  			v_0_1 := v_0.Args[1]
 11507  			if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int64 || auxIntToInt64(v_0_1.AuxInt) != 63 {
 11508  				continue
 11509  			}
 11510  			y := v_0_1.Args[0]
 11511  			if v_1.Op != OpPPC64SRD {
 11512  				continue
 11513  			}
 11514  			_ = v_1.Args[1]
 11515  			if x != v_1.Args[0] {
 11516  				continue
 11517  			}
 11518  			v_1_1 := v_1.Args[1]
 11519  			if v_1_1.Op != OpPPC64SUB || v_1_1.Type != typ.UInt {
 11520  				continue
 11521  			}
 11522  			_ = v_1_1.Args[1]
 11523  			v_1_1_0 := v_1_1.Args[0]
 11524  			if v_1_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1_0.AuxInt) != 64 {
 11525  				continue
 11526  			}
 11527  			v_1_1_1 := v_1_1.Args[1]
 11528  			if v_1_1_1.Op != OpPPC64ANDconst || v_1_1_1.Type != typ.UInt || auxIntToInt64(v_1_1_1.AuxInt) != 63 || y != v_1_1_1.Args[0] {
 11529  				continue
 11530  			}
 11531  			v.reset(OpPPC64ROTL)
 11532  			v.AddArg2(x, y)
 11533  			return true
 11534  		}
 11535  		break
 11536  	}
 11537  	// match: ( OR (SLD x (ANDconst <typ.Int64> [63] y)) (SRD x (SUBFCconst <typ.UInt> [64] (ANDconst <typ.UInt> [63] y))))
 11538  	// result: (ROTL x y)
 11539  	for {
 11540  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11541  			if v_0.Op != OpPPC64SLD {
 11542  				continue
 11543  			}
 11544  			_ = v_0.Args[1]
 11545  			x := v_0.Args[0]
 11546  			v_0_1 := v_0.Args[1]
 11547  			if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int64 || auxIntToInt64(v_0_1.AuxInt) != 63 {
 11548  				continue
 11549  			}
 11550  			y := v_0_1.Args[0]
 11551  			if v_1.Op != OpPPC64SRD {
 11552  				continue
 11553  			}
 11554  			_ = v_1.Args[1]
 11555  			if x != v_1.Args[0] {
 11556  				continue
 11557  			}
 11558  			v_1_1 := v_1.Args[1]
 11559  			if v_1_1.Op != OpPPC64SUBFCconst || v_1_1.Type != typ.UInt || auxIntToInt64(v_1_1.AuxInt) != 64 {
 11560  				continue
 11561  			}
 11562  			v_1_1_0 := v_1_1.Args[0]
 11563  			if v_1_1_0.Op != OpPPC64ANDconst || v_1_1_0.Type != typ.UInt || auxIntToInt64(v_1_1_0.AuxInt) != 63 || y != v_1_1_0.Args[0] {
 11564  				continue
 11565  			}
 11566  			v.reset(OpPPC64ROTL)
 11567  			v.AddArg2(x, y)
 11568  			return true
 11569  		}
 11570  		break
 11571  	}
 11572  	// match: ( OR (SLW x (ANDconst <typ.Int32> [31] y)) (SRW x (SUBFCconst <typ.UInt> [32] (ANDconst <typ.UInt> [31] y))))
 11573  	// result: (ROTLW x y)
 11574  	for {
 11575  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11576  			if v_0.Op != OpPPC64SLW {
 11577  				continue
 11578  			}
 11579  			_ = v_0.Args[1]
 11580  			x := v_0.Args[0]
 11581  			v_0_1 := v_0.Args[1]
 11582  			if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int32 || auxIntToInt64(v_0_1.AuxInt) != 31 {
 11583  				continue
 11584  			}
 11585  			y := v_0_1.Args[0]
 11586  			if v_1.Op != OpPPC64SRW {
 11587  				continue
 11588  			}
 11589  			_ = v_1.Args[1]
 11590  			if x != v_1.Args[0] {
 11591  				continue
 11592  			}
 11593  			v_1_1 := v_1.Args[1]
 11594  			if v_1_1.Op != OpPPC64SUBFCconst || v_1_1.Type != typ.UInt || auxIntToInt64(v_1_1.AuxInt) != 32 {
 11595  				continue
 11596  			}
 11597  			v_1_1_0 := v_1_1.Args[0]
 11598  			if v_1_1_0.Op != OpPPC64ANDconst || v_1_1_0.Type != typ.UInt || auxIntToInt64(v_1_1_0.AuxInt) != 31 || y != v_1_1_0.Args[0] {
 11599  				continue
 11600  			}
 11601  			v.reset(OpPPC64ROTLW)
 11602  			v.AddArg2(x, y)
 11603  			return true
 11604  		}
 11605  		break
 11606  	}
 11607  	// match: ( OR (SLW x (ANDconst <typ.Int32> [31] y)) (SRW x (SUB <typ.UInt> (MOVDconst [32]) (ANDconst <typ.UInt> [31] y))))
 11608  	// result: (ROTLW x y)
 11609  	for {
 11610  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11611  			if v_0.Op != OpPPC64SLW {
 11612  				continue
 11613  			}
 11614  			_ = v_0.Args[1]
 11615  			x := v_0.Args[0]
 11616  			v_0_1 := v_0.Args[1]
 11617  			if v_0_1.Op != OpPPC64ANDconst || v_0_1.Type != typ.Int32 || auxIntToInt64(v_0_1.AuxInt) != 31 {
 11618  				continue
 11619  			}
 11620  			y := v_0_1.Args[0]
 11621  			if v_1.Op != OpPPC64SRW {
 11622  				continue
 11623  			}
 11624  			_ = v_1.Args[1]
 11625  			if x != v_1.Args[0] {
 11626  				continue
 11627  			}
 11628  			v_1_1 := v_1.Args[1]
 11629  			if v_1_1.Op != OpPPC64SUB || v_1_1.Type != typ.UInt {
 11630  				continue
 11631  			}
 11632  			_ = v_1_1.Args[1]
 11633  			v_1_1_0 := v_1_1.Args[0]
 11634  			if v_1_1_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_1_1_0.AuxInt) != 32 {
 11635  				continue
 11636  			}
 11637  			v_1_1_1 := v_1_1.Args[1]
 11638  			if v_1_1_1.Op != OpPPC64ANDconst || v_1_1_1.Type != typ.UInt || auxIntToInt64(v_1_1_1.AuxInt) != 31 || y != v_1_1_1.Args[0] {
 11639  				continue
 11640  			}
 11641  			v.reset(OpPPC64ROTLW)
 11642  			v.AddArg2(x, y)
 11643  			return true
 11644  		}
 11645  		break
 11646  	}
 11647  	// match: (OR (MOVDconst [c]) (MOVDconst [d]))
 11648  	// result: (MOVDconst [c|d])
 11649  	for {
 11650  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11651  			if v_0.Op != OpPPC64MOVDconst {
 11652  				continue
 11653  			}
 11654  			c := auxIntToInt64(v_0.AuxInt)
 11655  			if v_1.Op != OpPPC64MOVDconst {
 11656  				continue
 11657  			}
 11658  			d := auxIntToInt64(v_1.AuxInt)
 11659  			v.reset(OpPPC64MOVDconst)
 11660  			v.AuxInt = int64ToAuxInt(c | d)
 11661  			return true
 11662  		}
 11663  		break
 11664  	}
 11665  	// match: (OR x (MOVDconst [c]))
 11666  	// cond: isU32Bit(c)
 11667  	// result: (ORconst [c] x)
 11668  	for {
 11669  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11670  			x := v_0
 11671  			if v_1.Op != OpPPC64MOVDconst {
 11672  				continue
 11673  			}
 11674  			c := auxIntToInt64(v_1.AuxInt)
 11675  			if !(isU32Bit(c)) {
 11676  				continue
 11677  			}
 11678  			v.reset(OpPPC64ORconst)
 11679  			v.AuxInt = int64ToAuxInt(c)
 11680  			v.AddArg(x)
 11681  			return true
 11682  		}
 11683  		break
 11684  	}
 11685  	// match: (OR <t> x0:(MOVBZload [i0] {s} p mem) o1:(SLWconst x1:(MOVBZload [i1] {s} p mem) [8]))
 11686  	// cond: !config.BigEndian && i1 == i0+1 && x0.Uses ==1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)
 11687  	// result: @mergePoint(b,x0,x1) (MOVHZload <t> {s} [i0] p mem)
 11688  	for {
 11689  		t := v.Type
 11690  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11691  			x0 := v_0
 11692  			if x0.Op != OpPPC64MOVBZload {
 11693  				continue
 11694  			}
 11695  			i0 := auxIntToInt32(x0.AuxInt)
 11696  			s := auxToSym(x0.Aux)
 11697  			mem := x0.Args[1]
 11698  			p := x0.Args[0]
 11699  			o1 := v_1
 11700  			if o1.Op != OpPPC64SLWconst || auxIntToInt64(o1.AuxInt) != 8 {
 11701  				continue
 11702  			}
 11703  			x1 := o1.Args[0]
 11704  			if x1.Op != OpPPC64MOVBZload {
 11705  				continue
 11706  			}
 11707  			i1 := auxIntToInt32(x1.AuxInt)
 11708  			if auxToSym(x1.Aux) != s {
 11709  				continue
 11710  			}
 11711  			_ = x1.Args[1]
 11712  			if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && x0.Uses == 1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)) {
 11713  				continue
 11714  			}
 11715  			b = mergePoint(b, x0, x1)
 11716  			v0 := b.NewValue0(x1.Pos, OpPPC64MOVHZload, t)
 11717  			v.copyOf(v0)
 11718  			v0.AuxInt = int32ToAuxInt(i0)
 11719  			v0.Aux = symToAux(s)
 11720  			v0.AddArg2(p, mem)
 11721  			return true
 11722  		}
 11723  		break
 11724  	}
 11725  	// match: (OR <t> x0:(MOVBZload [i0] {s} p mem) o1:(SLDconst x1:(MOVBZload [i1] {s} p mem) [8]))
 11726  	// cond: !config.BigEndian && i1 == i0+1 && x0.Uses ==1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)
 11727  	// result: @mergePoint(b,x0,x1) (MOVHZload <t> {s} [i0] p mem)
 11728  	for {
 11729  		t := v.Type
 11730  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11731  			x0 := v_0
 11732  			if x0.Op != OpPPC64MOVBZload {
 11733  				continue
 11734  			}
 11735  			i0 := auxIntToInt32(x0.AuxInt)
 11736  			s := auxToSym(x0.Aux)
 11737  			mem := x0.Args[1]
 11738  			p := x0.Args[0]
 11739  			o1 := v_1
 11740  			if o1.Op != OpPPC64SLDconst || auxIntToInt64(o1.AuxInt) != 8 {
 11741  				continue
 11742  			}
 11743  			x1 := o1.Args[0]
 11744  			if x1.Op != OpPPC64MOVBZload {
 11745  				continue
 11746  			}
 11747  			i1 := auxIntToInt32(x1.AuxInt)
 11748  			if auxToSym(x1.Aux) != s {
 11749  				continue
 11750  			}
 11751  			_ = x1.Args[1]
 11752  			if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && x0.Uses == 1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)) {
 11753  				continue
 11754  			}
 11755  			b = mergePoint(b, x0, x1)
 11756  			v0 := b.NewValue0(x1.Pos, OpPPC64MOVHZload, t)
 11757  			v.copyOf(v0)
 11758  			v0.AuxInt = int32ToAuxInt(i0)
 11759  			v0.Aux = symToAux(s)
 11760  			v0.AddArg2(p, mem)
 11761  			return true
 11762  		}
 11763  		break
 11764  	}
 11765  	// match: (OR <t> x0:(MOVBZload [i1] {s} p mem) o1:(SLWconst x1:(MOVBZload [i0] {s} p mem) [8]))
 11766  	// cond: !config.BigEndian && i1 == i0+1 && x0.Uses ==1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)
 11767  	// result: @mergePoint(b,x0,x1) (MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
 11768  	for {
 11769  		t := v.Type
 11770  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11771  			x0 := v_0
 11772  			if x0.Op != OpPPC64MOVBZload {
 11773  				continue
 11774  			}
 11775  			i1 := auxIntToInt32(x0.AuxInt)
 11776  			s := auxToSym(x0.Aux)
 11777  			mem := x0.Args[1]
 11778  			p := x0.Args[0]
 11779  			o1 := v_1
 11780  			if o1.Op != OpPPC64SLWconst || auxIntToInt64(o1.AuxInt) != 8 {
 11781  				continue
 11782  			}
 11783  			x1 := o1.Args[0]
 11784  			if x1.Op != OpPPC64MOVBZload {
 11785  				continue
 11786  			}
 11787  			i0 := auxIntToInt32(x1.AuxInt)
 11788  			if auxToSym(x1.Aux) != s {
 11789  				continue
 11790  			}
 11791  			_ = x1.Args[1]
 11792  			if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && x0.Uses == 1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)) {
 11793  				continue
 11794  			}
 11795  			b = mergePoint(b, x0, x1)
 11796  			v0 := b.NewValue0(x1.Pos, OpPPC64MOVHBRload, t)
 11797  			v.copyOf(v0)
 11798  			v1 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr)
 11799  			v1.AuxInt = int32ToAuxInt(i0)
 11800  			v1.Aux = symToAux(s)
 11801  			v1.AddArg(p)
 11802  			v0.AddArg2(v1, mem)
 11803  			return true
 11804  		}
 11805  		break
 11806  	}
 11807  	// match: (OR <t> x0:(MOVBZload [i1] {s} p mem) o1:(SLDconst x1:(MOVBZload [i0] {s} p mem) [8]))
 11808  	// cond: !config.BigEndian && i1 == i0+1 && x0.Uses ==1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)
 11809  	// result: @mergePoint(b,x0,x1) (MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
 11810  	for {
 11811  		t := v.Type
 11812  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11813  			x0 := v_0
 11814  			if x0.Op != OpPPC64MOVBZload {
 11815  				continue
 11816  			}
 11817  			i1 := auxIntToInt32(x0.AuxInt)
 11818  			s := auxToSym(x0.Aux)
 11819  			mem := x0.Args[1]
 11820  			p := x0.Args[0]
 11821  			o1 := v_1
 11822  			if o1.Op != OpPPC64SLDconst || auxIntToInt64(o1.AuxInt) != 8 {
 11823  				continue
 11824  			}
 11825  			x1 := o1.Args[0]
 11826  			if x1.Op != OpPPC64MOVBZload {
 11827  				continue
 11828  			}
 11829  			i0 := auxIntToInt32(x1.AuxInt)
 11830  			if auxToSym(x1.Aux) != s {
 11831  				continue
 11832  			}
 11833  			_ = x1.Args[1]
 11834  			if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && x0.Uses == 1 && x1.Uses == 1 && o1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, o1)) {
 11835  				continue
 11836  			}
 11837  			b = mergePoint(b, x0, x1)
 11838  			v0 := b.NewValue0(x1.Pos, OpPPC64MOVHBRload, t)
 11839  			v.copyOf(v0)
 11840  			v1 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr)
 11841  			v1.AuxInt = int32ToAuxInt(i0)
 11842  			v1.Aux = symToAux(s)
 11843  			v1.AddArg(p)
 11844  			v0.AddArg2(v1, mem)
 11845  			return true
 11846  		}
 11847  		break
 11848  	}
 11849  	// match: (OR <t> s0:(SLWconst x0:(MOVBZload [i1] {s} p mem) [n1]) s1:(SLWconst x1:(MOVBZload [i0] {s} p mem) [n2]))
 11850  	// cond: !config.BigEndian && i1 == i0+1 && n1%8 == 0 && n2 == n1+8 && x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, s0, s1)
 11851  	// result: @mergePoint(b,x0,x1) (SLDconst <t> (MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [n1])
 11852  	for {
 11853  		t := v.Type
 11854  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11855  			s0 := v_0
 11856  			if s0.Op != OpPPC64SLWconst {
 11857  				continue
 11858  			}
 11859  			n1 := auxIntToInt64(s0.AuxInt)
 11860  			x0 := s0.Args[0]
 11861  			if x0.Op != OpPPC64MOVBZload {
 11862  				continue
 11863  			}
 11864  			i1 := auxIntToInt32(x0.AuxInt)
 11865  			s := auxToSym(x0.Aux)
 11866  			mem := x0.Args[1]
 11867  			p := x0.Args[0]
 11868  			s1 := v_1
 11869  			if s1.Op != OpPPC64SLWconst {
 11870  				continue
 11871  			}
 11872  			n2 := auxIntToInt64(s1.AuxInt)
 11873  			x1 := s1.Args[0]
 11874  			if x1.Op != OpPPC64MOVBZload {
 11875  				continue
 11876  			}
 11877  			i0 := auxIntToInt32(x1.AuxInt)
 11878  			if auxToSym(x1.Aux) != s {
 11879  				continue
 11880  			}
 11881  			_ = x1.Args[1]
 11882  			if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && n1%8 == 0 && n2 == n1+8 && x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, s0, s1)) {
 11883  				continue
 11884  			}
 11885  			b = mergePoint(b, x0, x1)
 11886  			v0 := b.NewValue0(x1.Pos, OpPPC64SLDconst, t)
 11887  			v.copyOf(v0)
 11888  			v0.AuxInt = int64ToAuxInt(n1)
 11889  			v1 := b.NewValue0(x1.Pos, OpPPC64MOVHBRload, t)
 11890  			v2 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr)
 11891  			v2.AuxInt = int32ToAuxInt(i0)
 11892  			v2.Aux = symToAux(s)
 11893  			v2.AddArg(p)
 11894  			v1.AddArg2(v2, mem)
 11895  			v0.AddArg(v1)
 11896  			return true
 11897  		}
 11898  		break
 11899  	}
 11900  	// match: (OR <t> s0:(SLDconst x0:(MOVBZload [i1] {s} p mem) [n1]) s1:(SLDconst x1:(MOVBZload [i0] {s} p mem) [n2]))
 11901  	// cond: !config.BigEndian && i1 == i0+1 && n1%8 == 0 && n2 == n1+8 && x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, s0, s1)
 11902  	// result: @mergePoint(b,x0,x1) (SLDconst <t> (MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [n1])
 11903  	for {
 11904  		t := v.Type
 11905  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11906  			s0 := v_0
 11907  			if s0.Op != OpPPC64SLDconst {
 11908  				continue
 11909  			}
 11910  			n1 := auxIntToInt64(s0.AuxInt)
 11911  			x0 := s0.Args[0]
 11912  			if x0.Op != OpPPC64MOVBZload {
 11913  				continue
 11914  			}
 11915  			i1 := auxIntToInt32(x0.AuxInt)
 11916  			s := auxToSym(x0.Aux)
 11917  			mem := x0.Args[1]
 11918  			p := x0.Args[0]
 11919  			s1 := v_1
 11920  			if s1.Op != OpPPC64SLDconst {
 11921  				continue
 11922  			}
 11923  			n2 := auxIntToInt64(s1.AuxInt)
 11924  			x1 := s1.Args[0]
 11925  			if x1.Op != OpPPC64MOVBZload {
 11926  				continue
 11927  			}
 11928  			i0 := auxIntToInt32(x1.AuxInt)
 11929  			if auxToSym(x1.Aux) != s {
 11930  				continue
 11931  			}
 11932  			_ = x1.Args[1]
 11933  			if p != x1.Args[0] || mem != x1.Args[1] || !(!config.BigEndian && i1 == i0+1 && n1%8 == 0 && n2 == n1+8 && x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, s0, s1)) {
 11934  				continue
 11935  			}
 11936  			b = mergePoint(b, x0, x1)
 11937  			v0 := b.NewValue0(x1.Pos, OpPPC64SLDconst, t)
 11938  			v.copyOf(v0)
 11939  			v0.AuxInt = int64ToAuxInt(n1)
 11940  			v1 := b.NewValue0(x1.Pos, OpPPC64MOVHBRload, t)
 11941  			v2 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr)
 11942  			v2.AuxInt = int32ToAuxInt(i0)
 11943  			v2.Aux = symToAux(s)
 11944  			v2.AddArg(p)
 11945  			v1.AddArg2(v2, mem)
 11946  			v0.AddArg(v1)
 11947  			return true
 11948  		}
 11949  		break
 11950  	}
 11951  	// match: (OR <t> s1:(SLWconst x2:(MOVBZload [i3] {s} p mem) [24]) o0:(OR <t> s0:(SLWconst x1:(MOVBZload [i2] {s} p mem) [16]) x0:(MOVHZload [i0] {s} p mem)))
 11952  	// cond: !config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses ==1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)
 11953  	// result: @mergePoint(b,x0,x1,x2) (MOVWZload <t> {s} [i0] p mem)
 11954  	for {
 11955  		t := v.Type
 11956  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11957  			s1 := v_0
 11958  			if s1.Op != OpPPC64SLWconst || auxIntToInt64(s1.AuxInt) != 24 {
 11959  				continue
 11960  			}
 11961  			x2 := s1.Args[0]
 11962  			if x2.Op != OpPPC64MOVBZload {
 11963  				continue
 11964  			}
 11965  			i3 := auxIntToInt32(x2.AuxInt)
 11966  			s := auxToSym(x2.Aux)
 11967  			mem := x2.Args[1]
 11968  			p := x2.Args[0]
 11969  			o0 := v_1
 11970  			if o0.Op != OpPPC64OR || o0.Type != t {
 11971  				continue
 11972  			}
 11973  			_ = o0.Args[1]
 11974  			o0_0 := o0.Args[0]
 11975  			o0_1 := o0.Args[1]
 11976  			for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
 11977  				s0 := o0_0
 11978  				if s0.Op != OpPPC64SLWconst || auxIntToInt64(s0.AuxInt) != 16 {
 11979  					continue
 11980  				}
 11981  				x1 := s0.Args[0]
 11982  				if x1.Op != OpPPC64MOVBZload {
 11983  					continue
 11984  				}
 11985  				i2 := auxIntToInt32(x1.AuxInt)
 11986  				if auxToSym(x1.Aux) != s {
 11987  					continue
 11988  				}
 11989  				_ = x1.Args[1]
 11990  				if p != x1.Args[0] || mem != x1.Args[1] {
 11991  					continue
 11992  				}
 11993  				x0 := o0_1
 11994  				if x0.Op != OpPPC64MOVHZload {
 11995  					continue
 11996  				}
 11997  				i0 := auxIntToInt32(x0.AuxInt)
 11998  				if auxToSym(x0.Aux) != s {
 11999  					continue
 12000  				}
 12001  				_ = x0.Args[1]
 12002  				if p != x0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) {
 12003  					continue
 12004  				}
 12005  				b = mergePoint(b, x0, x1, x2)
 12006  				v0 := b.NewValue0(x0.Pos, OpPPC64MOVWZload, t)
 12007  				v.copyOf(v0)
 12008  				v0.AuxInt = int32ToAuxInt(i0)
 12009  				v0.Aux = symToAux(s)
 12010  				v0.AddArg2(p, mem)
 12011  				return true
 12012  			}
 12013  		}
 12014  		break
 12015  	}
 12016  	// match: (OR <t> s1:(SLDconst x2:(MOVBZload [i3] {s} p mem) [24]) o0:(OR <t> s0:(SLDconst x1:(MOVBZload [i2] {s} p mem) [16]) x0:(MOVHZload [i0] {s} p mem)))
 12017  	// cond: !config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses ==1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)
 12018  	// result: @mergePoint(b,x0,x1,x2) (MOVWZload <t> {s} [i0] p mem)
 12019  	for {
 12020  		t := v.Type
 12021  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12022  			s1 := v_0
 12023  			if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 24 {
 12024  				continue
 12025  			}
 12026  			x2 := s1.Args[0]
 12027  			if x2.Op != OpPPC64MOVBZload {
 12028  				continue
 12029  			}
 12030  			i3 := auxIntToInt32(x2.AuxInt)
 12031  			s := auxToSym(x2.Aux)
 12032  			mem := x2.Args[1]
 12033  			p := x2.Args[0]
 12034  			o0 := v_1
 12035  			if o0.Op != OpPPC64OR || o0.Type != t {
 12036  				continue
 12037  			}
 12038  			_ = o0.Args[1]
 12039  			o0_0 := o0.Args[0]
 12040  			o0_1 := o0.Args[1]
 12041  			for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
 12042  				s0 := o0_0
 12043  				if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 16 {
 12044  					continue
 12045  				}
 12046  				x1 := s0.Args[0]
 12047  				if x1.Op != OpPPC64MOVBZload {
 12048  					continue
 12049  				}
 12050  				i2 := auxIntToInt32(x1.AuxInt)
 12051  				if auxToSym(x1.Aux) != s {
 12052  					continue
 12053  				}
 12054  				_ = x1.Args[1]
 12055  				if p != x1.Args[0] || mem != x1.Args[1] {
 12056  					continue
 12057  				}
 12058  				x0 := o0_1
 12059  				if x0.Op != OpPPC64MOVHZload {
 12060  					continue
 12061  				}
 12062  				i0 := auxIntToInt32(x0.AuxInt)
 12063  				if auxToSym(x0.Aux) != s {
 12064  					continue
 12065  				}
 12066  				_ = x0.Args[1]
 12067  				if p != x0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) {
 12068  					continue
 12069  				}
 12070  				b = mergePoint(b, x0, x1, x2)
 12071  				v0 := b.NewValue0(x0.Pos, OpPPC64MOVWZload, t)
 12072  				v.copyOf(v0)
 12073  				v0.AuxInt = int32ToAuxInt(i0)
 12074  				v0.Aux = symToAux(s)
 12075  				v0.AddArg2(p, mem)
 12076  				return true
 12077  			}
 12078  		}
 12079  		break
 12080  	}
 12081  	// match: (OR <t> s1:(SLWconst x2:(MOVBZload [i0] {s} p mem) [24]) o0:(OR <t> s0:(SLWconst x1:(MOVBZload [i1] {s} p mem) [16]) x0:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i2] {s} p) mem)))
 12082  	// cond: !config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)
 12083  	// result: @mergePoint(b,x0,x1,x2) (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
 12084  	for {
 12085  		t := v.Type
 12086  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12087  			s1 := v_0
 12088  			if s1.Op != OpPPC64SLWconst || auxIntToInt64(s1.AuxInt) != 24 {
 12089  				continue
 12090  			}
 12091  			x2 := s1.Args[0]
 12092  			if x2.Op != OpPPC64MOVBZload {
 12093  				continue
 12094  			}
 12095  			i0 := auxIntToInt32(x2.AuxInt)
 12096  			s := auxToSym(x2.Aux)
 12097  			mem := x2.Args[1]
 12098  			p := x2.Args[0]
 12099  			o0 := v_1
 12100  			if o0.Op != OpPPC64OR || o0.Type != t {
 12101  				continue
 12102  			}
 12103  			_ = o0.Args[1]
 12104  			o0_0 := o0.Args[0]
 12105  			o0_1 := o0.Args[1]
 12106  			for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
 12107  				s0 := o0_0
 12108  				if s0.Op != OpPPC64SLWconst || auxIntToInt64(s0.AuxInt) != 16 {
 12109  					continue
 12110  				}
 12111  				x1 := s0.Args[0]
 12112  				if x1.Op != OpPPC64MOVBZload {
 12113  					continue
 12114  				}
 12115  				i1 := auxIntToInt32(x1.AuxInt)
 12116  				if auxToSym(x1.Aux) != s {
 12117  					continue
 12118  				}
 12119  				_ = x1.Args[1]
 12120  				if p != x1.Args[0] || mem != x1.Args[1] {
 12121  					continue
 12122  				}
 12123  				x0 := o0_1
 12124  				if x0.Op != OpPPC64MOVHBRload || x0.Type != t {
 12125  					continue
 12126  				}
 12127  				_ = x0.Args[1]
 12128  				x0_0 := x0.Args[0]
 12129  				if x0_0.Op != OpPPC64MOVDaddr || x0_0.Type != typ.Uintptr {
 12130  					continue
 12131  				}
 12132  				i2 := auxIntToInt32(x0_0.AuxInt)
 12133  				if auxToSym(x0_0.Aux) != s || p != x0_0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) {
 12134  					continue
 12135  				}
 12136  				b = mergePoint(b, x0, x1, x2)
 12137  				v0 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t)
 12138  				v.copyOf(v0)
 12139  				v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr)
 12140  				v1.AuxInt = int32ToAuxInt(i0)
 12141  				v1.Aux = symToAux(s)
 12142  				v1.AddArg(p)
 12143  				v0.AddArg2(v1, mem)
 12144  				return true
 12145  			}
 12146  		}
 12147  		break
 12148  	}
 12149  	// match: (OR <t> s1:(SLDconst x2:(MOVBZload [i0] {s} p mem) [24]) o0:(OR <t> s0:(SLDconst x1:(MOVBZload [i1] {s} p mem) [16]) x0:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i2] {s} p) mem)))
 12150  	// cond: !config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)
 12151  	// result: @mergePoint(b,x0,x1,x2) (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
 12152  	for {
 12153  		t := v.Type
 12154  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12155  			s1 := v_0
 12156  			if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 24 {
 12157  				continue
 12158  			}
 12159  			x2 := s1.Args[0]
 12160  			if x2.Op != OpPPC64MOVBZload {
 12161  				continue
 12162  			}
 12163  			i0 := auxIntToInt32(x2.AuxInt)
 12164  			s := auxToSym(x2.Aux)
 12165  			mem := x2.Args[1]
 12166  			p := x2.Args[0]
 12167  			o0 := v_1
 12168  			if o0.Op != OpPPC64OR || o0.Type != t {
 12169  				continue
 12170  			}
 12171  			_ = o0.Args[1]
 12172  			o0_0 := o0.Args[0]
 12173  			o0_1 := o0.Args[1]
 12174  			for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
 12175  				s0 := o0_0
 12176  				if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 16 {
 12177  					continue
 12178  				}
 12179  				x1 := s0.Args[0]
 12180  				if x1.Op != OpPPC64MOVBZload {
 12181  					continue
 12182  				}
 12183  				i1 := auxIntToInt32(x1.AuxInt)
 12184  				if auxToSym(x1.Aux) != s {
 12185  					continue
 12186  				}
 12187  				_ = x1.Args[1]
 12188  				if p != x1.Args[0] || mem != x1.Args[1] {
 12189  					continue
 12190  				}
 12191  				x0 := o0_1
 12192  				if x0.Op != OpPPC64MOVHBRload || x0.Type != t {
 12193  					continue
 12194  				}
 12195  				_ = x0.Args[1]
 12196  				x0_0 := x0.Args[0]
 12197  				if x0_0.Op != OpPPC64MOVDaddr || x0_0.Type != typ.Uintptr {
 12198  					continue
 12199  				}
 12200  				i2 := auxIntToInt32(x0_0.AuxInt)
 12201  				if auxToSym(x0_0.Aux) != s || p != x0_0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) {
 12202  					continue
 12203  				}
 12204  				b = mergePoint(b, x0, x1, x2)
 12205  				v0 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t)
 12206  				v.copyOf(v0)
 12207  				v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr)
 12208  				v1.AuxInt = int32ToAuxInt(i0)
 12209  				v1.Aux = symToAux(s)
 12210  				v1.AddArg(p)
 12211  				v0.AddArg2(v1, mem)
 12212  				return true
 12213  			}
 12214  		}
 12215  		break
 12216  	}
 12217  	// match: (OR <t> x0:(MOVBZload [i3] {s} p mem) o0:(OR <t> s0:(SLWconst x1:(MOVBZload [i2] {s} p mem) [8]) s1:(SLWconst x2:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [16])))
 12218  	// cond: !config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)
 12219  	// result: @mergePoint(b,x0,x1,x2) (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
 12220  	for {
 12221  		t := v.Type
 12222  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12223  			x0 := v_0
 12224  			if x0.Op != OpPPC64MOVBZload {
 12225  				continue
 12226  			}
 12227  			i3 := auxIntToInt32(x0.AuxInt)
 12228  			s := auxToSym(x0.Aux)
 12229  			mem := x0.Args[1]
 12230  			p := x0.Args[0]
 12231  			o0 := v_1
 12232  			if o0.Op != OpPPC64OR || o0.Type != t {
 12233  				continue
 12234  			}
 12235  			_ = o0.Args[1]
 12236  			o0_0 := o0.Args[0]
 12237  			o0_1 := o0.Args[1]
 12238  			for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
 12239  				s0 := o0_0
 12240  				if s0.Op != OpPPC64SLWconst || auxIntToInt64(s0.AuxInt) != 8 {
 12241  					continue
 12242  				}
 12243  				x1 := s0.Args[0]
 12244  				if x1.Op != OpPPC64MOVBZload {
 12245  					continue
 12246  				}
 12247  				i2 := auxIntToInt32(x1.AuxInt)
 12248  				if auxToSym(x1.Aux) != s {
 12249  					continue
 12250  				}
 12251  				_ = x1.Args[1]
 12252  				if p != x1.Args[0] || mem != x1.Args[1] {
 12253  					continue
 12254  				}
 12255  				s1 := o0_1
 12256  				if s1.Op != OpPPC64SLWconst || auxIntToInt64(s1.AuxInt) != 16 {
 12257  					continue
 12258  				}
 12259  				x2 := s1.Args[0]
 12260  				if x2.Op != OpPPC64MOVHBRload || x2.Type != t {
 12261  					continue
 12262  				}
 12263  				_ = x2.Args[1]
 12264  				x2_0 := x2.Args[0]
 12265  				if x2_0.Op != OpPPC64MOVDaddr || x2_0.Type != typ.Uintptr {
 12266  					continue
 12267  				}
 12268  				i0 := auxIntToInt32(x2_0.AuxInt)
 12269  				if auxToSym(x2_0.Aux) != s || p != x2_0.Args[0] || mem != x2.Args[1] || !(!config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) {
 12270  					continue
 12271  				}
 12272  				b = mergePoint(b, x0, x1, x2)
 12273  				v0 := b.NewValue0(x2.Pos, OpPPC64MOVWBRload, t)
 12274  				v.copyOf(v0)
 12275  				v1 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr)
 12276  				v1.AuxInt = int32ToAuxInt(i0)
 12277  				v1.Aux = symToAux(s)
 12278  				v1.AddArg(p)
 12279  				v0.AddArg2(v1, mem)
 12280  				return true
 12281  			}
 12282  		}
 12283  		break
 12284  	}
 12285  	// match: (OR <t> x0:(MOVBZload [i3] {s} p mem) o0:(OR <t> s0:(SLDconst x1:(MOVBZload [i2] {s} p mem) [8]) s1:(SLDconst x2:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [16])))
 12286  	// cond: !config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)
 12287  	// result: @mergePoint(b,x0,x1,x2) (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
 12288  	for {
 12289  		t := v.Type
 12290  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12291  			x0 := v_0
 12292  			if x0.Op != OpPPC64MOVBZload {
 12293  				continue
 12294  			}
 12295  			i3 := auxIntToInt32(x0.AuxInt)
 12296  			s := auxToSym(x0.Aux)
 12297  			mem := x0.Args[1]
 12298  			p := x0.Args[0]
 12299  			o0 := v_1
 12300  			if o0.Op != OpPPC64OR || o0.Type != t {
 12301  				continue
 12302  			}
 12303  			_ = o0.Args[1]
 12304  			o0_0 := o0.Args[0]
 12305  			o0_1 := o0.Args[1]
 12306  			for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
 12307  				s0 := o0_0
 12308  				if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 8 {
 12309  					continue
 12310  				}
 12311  				x1 := s0.Args[0]
 12312  				if x1.Op != OpPPC64MOVBZload {
 12313  					continue
 12314  				}
 12315  				i2 := auxIntToInt32(x1.AuxInt)
 12316  				if auxToSym(x1.Aux) != s {
 12317  					continue
 12318  				}
 12319  				_ = x1.Args[1]
 12320  				if p != x1.Args[0] || mem != x1.Args[1] {
 12321  					continue
 12322  				}
 12323  				s1 := o0_1
 12324  				if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 16 {
 12325  					continue
 12326  				}
 12327  				x2 := s1.Args[0]
 12328  				if x2.Op != OpPPC64MOVHBRload || x2.Type != t {
 12329  					continue
 12330  				}
 12331  				_ = x2.Args[1]
 12332  				x2_0 := x2.Args[0]
 12333  				if x2_0.Op != OpPPC64MOVDaddr || x2_0.Type != typ.Uintptr {
 12334  					continue
 12335  				}
 12336  				i0 := auxIntToInt32(x2_0.AuxInt)
 12337  				if auxToSym(x2_0.Aux) != s || p != x2_0.Args[0] || mem != x2.Args[1] || !(!config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) {
 12338  					continue
 12339  				}
 12340  				b = mergePoint(b, x0, x1, x2)
 12341  				v0 := b.NewValue0(x2.Pos, OpPPC64MOVWBRload, t)
 12342  				v.copyOf(v0)
 12343  				v1 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr)
 12344  				v1.AuxInt = int32ToAuxInt(i0)
 12345  				v1.Aux = symToAux(s)
 12346  				v1.AddArg(p)
 12347  				v0.AddArg2(v1, mem)
 12348  				return true
 12349  			}
 12350  		}
 12351  		break
 12352  	}
 12353  	// match: (OR <t> s2:(SLDconst x2:(MOVBZload [i3] {s} p mem) [32]) o0:(OR <t> s1:(SLDconst x1:(MOVBZload [i2] {s} p mem) [40]) s0:(SLDconst x0:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [48])))
 12354  	// cond: !config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, s2, o0)
 12355  	// result: @mergePoint(b,x0,x1,x2) (SLDconst <t> (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [32])
 12356  	for {
 12357  		t := v.Type
 12358  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12359  			s2 := v_0
 12360  			if s2.Op != OpPPC64SLDconst || auxIntToInt64(s2.AuxInt) != 32 {
 12361  				continue
 12362  			}
 12363  			x2 := s2.Args[0]
 12364  			if x2.Op != OpPPC64MOVBZload {
 12365  				continue
 12366  			}
 12367  			i3 := auxIntToInt32(x2.AuxInt)
 12368  			s := auxToSym(x2.Aux)
 12369  			mem := x2.Args[1]
 12370  			p := x2.Args[0]
 12371  			o0 := v_1
 12372  			if o0.Op != OpPPC64OR || o0.Type != t {
 12373  				continue
 12374  			}
 12375  			_ = o0.Args[1]
 12376  			o0_0 := o0.Args[0]
 12377  			o0_1 := o0.Args[1]
 12378  			for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
 12379  				s1 := o0_0
 12380  				if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 40 {
 12381  					continue
 12382  				}
 12383  				x1 := s1.Args[0]
 12384  				if x1.Op != OpPPC64MOVBZload {
 12385  					continue
 12386  				}
 12387  				i2 := auxIntToInt32(x1.AuxInt)
 12388  				if auxToSym(x1.Aux) != s {
 12389  					continue
 12390  				}
 12391  				_ = x1.Args[1]
 12392  				if p != x1.Args[0] || mem != x1.Args[1] {
 12393  					continue
 12394  				}
 12395  				s0 := o0_1
 12396  				if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 48 {
 12397  					continue
 12398  				}
 12399  				x0 := s0.Args[0]
 12400  				if x0.Op != OpPPC64MOVHBRload || x0.Type != t {
 12401  					continue
 12402  				}
 12403  				_ = x0.Args[1]
 12404  				x0_0 := x0.Args[0]
 12405  				if x0_0.Op != OpPPC64MOVDaddr || x0_0.Type != typ.Uintptr {
 12406  					continue
 12407  				}
 12408  				i0 := auxIntToInt32(x0_0.AuxInt)
 12409  				if auxToSym(x0_0.Aux) != s || p != x0_0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, s2, o0)) {
 12410  					continue
 12411  				}
 12412  				b = mergePoint(b, x0, x1, x2)
 12413  				v0 := b.NewValue0(x0.Pos, OpPPC64SLDconst, t)
 12414  				v.copyOf(v0)
 12415  				v0.AuxInt = int64ToAuxInt(32)
 12416  				v1 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t)
 12417  				v2 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr)
 12418  				v2.AuxInt = int32ToAuxInt(i0)
 12419  				v2.Aux = symToAux(s)
 12420  				v2.AddArg(p)
 12421  				v1.AddArg2(v2, mem)
 12422  				v0.AddArg(v1)
 12423  				return true
 12424  			}
 12425  		}
 12426  		break
 12427  	}
 12428  	// match: (OR <t> s2:(SLDconst x2:(MOVBZload [i0] {s} p mem) [56]) o0:(OR <t> s1:(SLDconst x1:(MOVBZload [i1] {s} p mem) [48]) s0:(SLDconst x0:(MOVHBRload <t> (MOVDaddr <typ.Uintptr> [i2] {s} p) mem) [32])))
 12429  	// cond: !config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, s2, o0)
 12430  	// result: @mergePoint(b,x0,x1,x2) (SLDconst <t> (MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [32])
 12431  	for {
 12432  		t := v.Type
 12433  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12434  			s2 := v_0
 12435  			if s2.Op != OpPPC64SLDconst || auxIntToInt64(s2.AuxInt) != 56 {
 12436  				continue
 12437  			}
 12438  			x2 := s2.Args[0]
 12439  			if x2.Op != OpPPC64MOVBZload {
 12440  				continue
 12441  			}
 12442  			i0 := auxIntToInt32(x2.AuxInt)
 12443  			s := auxToSym(x2.Aux)
 12444  			mem := x2.Args[1]
 12445  			p := x2.Args[0]
 12446  			o0 := v_1
 12447  			if o0.Op != OpPPC64OR || o0.Type != t {
 12448  				continue
 12449  			}
 12450  			_ = o0.Args[1]
 12451  			o0_0 := o0.Args[0]
 12452  			o0_1 := o0.Args[1]
 12453  			for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
 12454  				s1 := o0_0
 12455  				if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 48 {
 12456  					continue
 12457  				}
 12458  				x1 := s1.Args[0]
 12459  				if x1.Op != OpPPC64MOVBZload {
 12460  					continue
 12461  				}
 12462  				i1 := auxIntToInt32(x1.AuxInt)
 12463  				if auxToSym(x1.Aux) != s {
 12464  					continue
 12465  				}
 12466  				_ = x1.Args[1]
 12467  				if p != x1.Args[0] || mem != x1.Args[1] {
 12468  					continue
 12469  				}
 12470  				s0 := o0_1
 12471  				if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 32 {
 12472  					continue
 12473  				}
 12474  				x0 := s0.Args[0]
 12475  				if x0.Op != OpPPC64MOVHBRload || x0.Type != t {
 12476  					continue
 12477  				}
 12478  				_ = x0.Args[1]
 12479  				x0_0 := x0.Args[0]
 12480  				if x0_0.Op != OpPPC64MOVDaddr || x0_0.Type != typ.Uintptr {
 12481  					continue
 12482  				}
 12483  				i2 := auxIntToInt32(x0_0.AuxInt)
 12484  				if auxToSym(x0_0.Aux) != s || p != x0_0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i1 == i0+1 && i2 == i0+2 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && o0.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, s2, o0)) {
 12485  					continue
 12486  				}
 12487  				b = mergePoint(b, x0, x1, x2)
 12488  				v0 := b.NewValue0(x0.Pos, OpPPC64SLDconst, t)
 12489  				v.copyOf(v0)
 12490  				v0.AuxInt = int64ToAuxInt(32)
 12491  				v1 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t)
 12492  				v2 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr)
 12493  				v2.AuxInt = int32ToAuxInt(i0)
 12494  				v2.Aux = symToAux(s)
 12495  				v2.AddArg(p)
 12496  				v1.AddArg2(v2, mem)
 12497  				v0.AddArg(v1)
 12498  				return true
 12499  			}
 12500  		}
 12501  		break
 12502  	}
 12503  	// match: (OR <t> s6:(SLDconst x7:(MOVBZload [i7] {s} p mem) [56]) o5:(OR <t> s5:(SLDconst x6:(MOVBZload [i6] {s} p mem) [48]) o4:(OR <t> s4:(SLDconst x5:(MOVBZload [i5] {s} p mem) [40]) o3:(OR <t> s3:(SLDconst x4:(MOVBZload [i4] {s} p mem) [32]) x0:(MOVWZload {s} [i0] p mem)))))
 12504  	// cond: !config.BigEndian && i0%4 == 0 && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x0.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses ==1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s3.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x0, x4, x5, x6, x7) != nil && clobber(x0, x4, x5, x6, x7, s3, s4, s5, s6, o3, o4, o5)
 12505  	// result: @mergePoint(b,x0,x4,x5,x6,x7) (MOVDload <t> {s} [i0] p mem)
 12506  	for {
 12507  		t := v.Type
 12508  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12509  			s6 := v_0
 12510  			if s6.Op != OpPPC64SLDconst || auxIntToInt64(s6.AuxInt) != 56 {
 12511  				continue
 12512  			}
 12513  			x7 := s6.Args[0]
 12514  			if x7.Op != OpPPC64MOVBZload {
 12515  				continue
 12516  			}
 12517  			i7 := auxIntToInt32(x7.AuxInt)
 12518  			s := auxToSym(x7.Aux)
 12519  			mem := x7.Args[1]
 12520  			p := x7.Args[0]
 12521  			o5 := v_1
 12522  			if o5.Op != OpPPC64OR || o5.Type != t {
 12523  				continue
 12524  			}
 12525  			_ = o5.Args[1]
 12526  			o5_0 := o5.Args[0]
 12527  			o5_1 := o5.Args[1]
 12528  			for _i1 := 0; _i1 <= 1; _i1, o5_0, o5_1 = _i1+1, o5_1, o5_0 {
 12529  				s5 := o5_0
 12530  				if s5.Op != OpPPC64SLDconst || auxIntToInt64(s5.AuxInt) != 48 {
 12531  					continue
 12532  				}
 12533  				x6 := s5.Args[0]
 12534  				if x6.Op != OpPPC64MOVBZload {
 12535  					continue
 12536  				}
 12537  				i6 := auxIntToInt32(x6.AuxInt)
 12538  				if auxToSym(x6.Aux) != s {
 12539  					continue
 12540  				}
 12541  				_ = x6.Args[1]
 12542  				if p != x6.Args[0] || mem != x6.Args[1] {
 12543  					continue
 12544  				}
 12545  				o4 := o5_1
 12546  				if o4.Op != OpPPC64OR || o4.Type != t {
 12547  					continue
 12548  				}
 12549  				_ = o4.Args[1]
 12550  				o4_0 := o4.Args[0]
 12551  				o4_1 := o4.Args[1]
 12552  				for _i2 := 0; _i2 <= 1; _i2, o4_0, o4_1 = _i2+1, o4_1, o4_0 {
 12553  					s4 := o4_0
 12554  					if s4.Op != OpPPC64SLDconst || auxIntToInt64(s4.AuxInt) != 40 {
 12555  						continue
 12556  					}
 12557  					x5 := s4.Args[0]
 12558  					if x5.Op != OpPPC64MOVBZload {
 12559  						continue
 12560  					}
 12561  					i5 := auxIntToInt32(x5.AuxInt)
 12562  					if auxToSym(x5.Aux) != s {
 12563  						continue
 12564  					}
 12565  					_ = x5.Args[1]
 12566  					if p != x5.Args[0] || mem != x5.Args[1] {
 12567  						continue
 12568  					}
 12569  					o3 := o4_1
 12570  					if o3.Op != OpPPC64OR || o3.Type != t {
 12571  						continue
 12572  					}
 12573  					_ = o3.Args[1]
 12574  					o3_0 := o3.Args[0]
 12575  					o3_1 := o3.Args[1]
 12576  					for _i3 := 0; _i3 <= 1; _i3, o3_0, o3_1 = _i3+1, o3_1, o3_0 {
 12577  						s3 := o3_0
 12578  						if s3.Op != OpPPC64SLDconst || auxIntToInt64(s3.AuxInt) != 32 {
 12579  							continue
 12580  						}
 12581  						x4 := s3.Args[0]
 12582  						if x4.Op != OpPPC64MOVBZload {
 12583  							continue
 12584  						}
 12585  						i4 := auxIntToInt32(x4.AuxInt)
 12586  						if auxToSym(x4.Aux) != s {
 12587  							continue
 12588  						}
 12589  						_ = x4.Args[1]
 12590  						if p != x4.Args[0] || mem != x4.Args[1] {
 12591  							continue
 12592  						}
 12593  						x0 := o3_1
 12594  						if x0.Op != OpPPC64MOVWZload {
 12595  							continue
 12596  						}
 12597  						i0 := auxIntToInt32(x0.AuxInt)
 12598  						if auxToSym(x0.Aux) != s {
 12599  							continue
 12600  						}
 12601  						_ = x0.Args[1]
 12602  						if p != x0.Args[0] || mem != x0.Args[1] || !(!config.BigEndian && i0%4 == 0 && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x0.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s3.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x0, x4, x5, x6, x7) != nil && clobber(x0, x4, x5, x6, x7, s3, s4, s5, s6, o3, o4, o5)) {
 12603  							continue
 12604  						}
 12605  						b = mergePoint(b, x0, x4, x5, x6, x7)
 12606  						v0 := b.NewValue0(x0.Pos, OpPPC64MOVDload, t)
 12607  						v.copyOf(v0)
 12608  						v0.AuxInt = int32ToAuxInt(i0)
 12609  						v0.Aux = symToAux(s)
 12610  						v0.AddArg2(p, mem)
 12611  						return true
 12612  					}
 12613  				}
 12614  			}
 12615  		}
 12616  		break
 12617  	}
 12618  	// match: (OR <t> s0:(SLDconst x0:(MOVBZload [i0] {s} p mem) [56]) o0:(OR <t> s1:(SLDconst x1:(MOVBZload [i1] {s} p mem) [48]) o1:(OR <t> s2:(SLDconst x2:(MOVBZload [i2] {s} p mem) [40]) o2:(OR <t> s3:(SLDconst x3:(MOVBZload [i3] {s} p mem) [32]) x4:(MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i4] p) mem)))))
 12619  	// cond: !config.BigEndian && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && i4 == i0+4 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && x4.Uses == 1 && o0.Uses == 1 && o1.Uses == 1 && o2.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && mergePoint(b, x0, x1, x2, x3, x4) != nil && clobber(x0, x1, x2, x3, x4, o0, o1, o2, s0, s1, s2, s3)
 12620  	// result: @mergePoint(b,x0,x1,x2,x3,x4) (MOVDBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
 12621  	for {
 12622  		t := v.Type
 12623  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12624  			s0 := v_0
 12625  			if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 56 {
 12626  				continue
 12627  			}
 12628  			x0 := s0.Args[0]
 12629  			if x0.Op != OpPPC64MOVBZload {
 12630  				continue
 12631  			}
 12632  			i0 := auxIntToInt32(x0.AuxInt)
 12633  			s := auxToSym(x0.Aux)
 12634  			mem := x0.Args[1]
 12635  			p := x0.Args[0]
 12636  			o0 := v_1
 12637  			if o0.Op != OpPPC64OR || o0.Type != t {
 12638  				continue
 12639  			}
 12640  			_ = o0.Args[1]
 12641  			o0_0 := o0.Args[0]
 12642  			o0_1 := o0.Args[1]
 12643  			for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
 12644  				s1 := o0_0
 12645  				if s1.Op != OpPPC64SLDconst || auxIntToInt64(s1.AuxInt) != 48 {
 12646  					continue
 12647  				}
 12648  				x1 := s1.Args[0]
 12649  				if x1.Op != OpPPC64MOVBZload {
 12650  					continue
 12651  				}
 12652  				i1 := auxIntToInt32(x1.AuxInt)
 12653  				if auxToSym(x1.Aux) != s {
 12654  					continue
 12655  				}
 12656  				_ = x1.Args[1]
 12657  				if p != x1.Args[0] || mem != x1.Args[1] {
 12658  					continue
 12659  				}
 12660  				o1 := o0_1
 12661  				if o1.Op != OpPPC64OR || o1.Type != t {
 12662  					continue
 12663  				}
 12664  				_ = o1.Args[1]
 12665  				o1_0 := o1.Args[0]
 12666  				o1_1 := o1.Args[1]
 12667  				for _i2 := 0; _i2 <= 1; _i2, o1_0, o1_1 = _i2+1, o1_1, o1_0 {
 12668  					s2 := o1_0
 12669  					if s2.Op != OpPPC64SLDconst || auxIntToInt64(s2.AuxInt) != 40 {
 12670  						continue
 12671  					}
 12672  					x2 := s2.Args[0]
 12673  					if x2.Op != OpPPC64MOVBZload {
 12674  						continue
 12675  					}
 12676  					i2 := auxIntToInt32(x2.AuxInt)
 12677  					if auxToSym(x2.Aux) != s {
 12678  						continue
 12679  					}
 12680  					_ = x2.Args[1]
 12681  					if p != x2.Args[0] || mem != x2.Args[1] {
 12682  						continue
 12683  					}
 12684  					o2 := o1_1
 12685  					if o2.Op != OpPPC64OR || o2.Type != t {
 12686  						continue
 12687  					}
 12688  					_ = o2.Args[1]
 12689  					o2_0 := o2.Args[0]
 12690  					o2_1 := o2.Args[1]
 12691  					for _i3 := 0; _i3 <= 1; _i3, o2_0, o2_1 = _i3+1, o2_1, o2_0 {
 12692  						s3 := o2_0
 12693  						if s3.Op != OpPPC64SLDconst || auxIntToInt64(s3.AuxInt) != 32 {
 12694  							continue
 12695  						}
 12696  						x3 := s3.Args[0]
 12697  						if x3.Op != OpPPC64MOVBZload {
 12698  							continue
 12699  						}
 12700  						i3 := auxIntToInt32(x3.AuxInt)
 12701  						if auxToSym(x3.Aux) != s {
 12702  							continue
 12703  						}
 12704  						_ = x3.Args[1]
 12705  						if p != x3.Args[0] || mem != x3.Args[1] {
 12706  							continue
 12707  						}
 12708  						x4 := o2_1
 12709  						if x4.Op != OpPPC64MOVWBRload || x4.Type != t {
 12710  							continue
 12711  						}
 12712  						_ = x4.Args[1]
 12713  						x4_0 := x4.Args[0]
 12714  						if x4_0.Op != OpPPC64MOVDaddr || x4_0.Type != typ.Uintptr {
 12715  							continue
 12716  						}
 12717  						i4 := auxIntToInt32(x4_0.AuxInt)
 12718  						if p != x4_0.Args[0] || mem != x4.Args[1] || !(!config.BigEndian && i1 == i0+1 && i2 == i0+2 && i3 == i0+3 && i4 == i0+4 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && x3.Uses == 1 && x4.Uses == 1 && o0.Uses == 1 && o1.Uses == 1 && o2.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && mergePoint(b, x0, x1, x2, x3, x4) != nil && clobber(x0, x1, x2, x3, x4, o0, o1, o2, s0, s1, s2, s3)) {
 12719  							continue
 12720  						}
 12721  						b = mergePoint(b, x0, x1, x2, x3, x4)
 12722  						v0 := b.NewValue0(x4.Pos, OpPPC64MOVDBRload, t)
 12723  						v.copyOf(v0)
 12724  						v1 := b.NewValue0(x4.Pos, OpPPC64MOVDaddr, typ.Uintptr)
 12725  						v1.AuxInt = int32ToAuxInt(i0)
 12726  						v1.Aux = symToAux(s)
 12727  						v1.AddArg(p)
 12728  						v0.AddArg2(v1, mem)
 12729  						return true
 12730  					}
 12731  				}
 12732  			}
 12733  		}
 12734  		break
 12735  	}
 12736  	// match: (OR <t> x7:(MOVBZload [i7] {s} p mem) o5:(OR <t> s6:(SLDconst x6:(MOVBZload [i6] {s} p mem) [8]) o4:(OR <t> s5:(SLDconst x5:(MOVBZload [i5] {s} p mem) [16]) o3:(OR <t> s4:(SLDconst x4:(MOVBZload [i4] {s} p mem) [24]) s0:(SLWconst x3:(MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [32])))))
 12737  	// cond: !config.BigEndian && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s0.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x3, x4, x5, x6, x7) != nil && clobber(x3, x4, x5, x6, x7, o3, o4, o5, s0, s4, s5, s6)
 12738  	// result: @mergePoint(b,x3,x4,x5,x6,x7) (MOVDBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
 12739  	for {
 12740  		t := v.Type
 12741  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12742  			x7 := v_0
 12743  			if x7.Op != OpPPC64MOVBZload {
 12744  				continue
 12745  			}
 12746  			i7 := auxIntToInt32(x7.AuxInt)
 12747  			s := auxToSym(x7.Aux)
 12748  			mem := x7.Args[1]
 12749  			p := x7.Args[0]
 12750  			o5 := v_1
 12751  			if o5.Op != OpPPC64OR || o5.Type != t {
 12752  				continue
 12753  			}
 12754  			_ = o5.Args[1]
 12755  			o5_0 := o5.Args[0]
 12756  			o5_1 := o5.Args[1]
 12757  			for _i1 := 0; _i1 <= 1; _i1, o5_0, o5_1 = _i1+1, o5_1, o5_0 {
 12758  				s6 := o5_0
 12759  				if s6.Op != OpPPC64SLDconst || auxIntToInt64(s6.AuxInt) != 8 {
 12760  					continue
 12761  				}
 12762  				x6 := s6.Args[0]
 12763  				if x6.Op != OpPPC64MOVBZload {
 12764  					continue
 12765  				}
 12766  				i6 := auxIntToInt32(x6.AuxInt)
 12767  				if auxToSym(x6.Aux) != s {
 12768  					continue
 12769  				}
 12770  				_ = x6.Args[1]
 12771  				if p != x6.Args[0] || mem != x6.Args[1] {
 12772  					continue
 12773  				}
 12774  				o4 := o5_1
 12775  				if o4.Op != OpPPC64OR || o4.Type != t {
 12776  					continue
 12777  				}
 12778  				_ = o4.Args[1]
 12779  				o4_0 := o4.Args[0]
 12780  				o4_1 := o4.Args[1]
 12781  				for _i2 := 0; _i2 <= 1; _i2, o4_0, o4_1 = _i2+1, o4_1, o4_0 {
 12782  					s5 := o4_0
 12783  					if s5.Op != OpPPC64SLDconst || auxIntToInt64(s5.AuxInt) != 16 {
 12784  						continue
 12785  					}
 12786  					x5 := s5.Args[0]
 12787  					if x5.Op != OpPPC64MOVBZload {
 12788  						continue
 12789  					}
 12790  					i5 := auxIntToInt32(x5.AuxInt)
 12791  					if auxToSym(x5.Aux) != s {
 12792  						continue
 12793  					}
 12794  					_ = x5.Args[1]
 12795  					if p != x5.Args[0] || mem != x5.Args[1] {
 12796  						continue
 12797  					}
 12798  					o3 := o4_1
 12799  					if o3.Op != OpPPC64OR || o3.Type != t {
 12800  						continue
 12801  					}
 12802  					_ = o3.Args[1]
 12803  					o3_0 := o3.Args[0]
 12804  					o3_1 := o3.Args[1]
 12805  					for _i3 := 0; _i3 <= 1; _i3, o3_0, o3_1 = _i3+1, o3_1, o3_0 {
 12806  						s4 := o3_0
 12807  						if s4.Op != OpPPC64SLDconst || auxIntToInt64(s4.AuxInt) != 24 {
 12808  							continue
 12809  						}
 12810  						x4 := s4.Args[0]
 12811  						if x4.Op != OpPPC64MOVBZload {
 12812  							continue
 12813  						}
 12814  						i4 := auxIntToInt32(x4.AuxInt)
 12815  						if auxToSym(x4.Aux) != s {
 12816  							continue
 12817  						}
 12818  						_ = x4.Args[1]
 12819  						if p != x4.Args[0] || mem != x4.Args[1] {
 12820  							continue
 12821  						}
 12822  						s0 := o3_1
 12823  						if s0.Op != OpPPC64SLWconst || auxIntToInt64(s0.AuxInt) != 32 {
 12824  							continue
 12825  						}
 12826  						x3 := s0.Args[0]
 12827  						if x3.Op != OpPPC64MOVWBRload || x3.Type != t {
 12828  							continue
 12829  						}
 12830  						_ = x3.Args[1]
 12831  						x3_0 := x3.Args[0]
 12832  						if x3_0.Op != OpPPC64MOVDaddr || x3_0.Type != typ.Uintptr {
 12833  							continue
 12834  						}
 12835  						i0 := auxIntToInt32(x3_0.AuxInt)
 12836  						if auxToSym(x3_0.Aux) != s || p != x3_0.Args[0] || mem != x3.Args[1] || !(!config.BigEndian && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s0.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x3, x4, x5, x6, x7) != nil && clobber(x3, x4, x5, x6, x7, o3, o4, o5, s0, s4, s5, s6)) {
 12837  							continue
 12838  						}
 12839  						b = mergePoint(b, x3, x4, x5, x6, x7)
 12840  						v0 := b.NewValue0(x3.Pos, OpPPC64MOVDBRload, t)
 12841  						v.copyOf(v0)
 12842  						v1 := b.NewValue0(x3.Pos, OpPPC64MOVDaddr, typ.Uintptr)
 12843  						v1.AuxInt = int32ToAuxInt(i0)
 12844  						v1.Aux = symToAux(s)
 12845  						v1.AddArg(p)
 12846  						v0.AddArg2(v1, mem)
 12847  						return true
 12848  					}
 12849  				}
 12850  			}
 12851  		}
 12852  		break
 12853  	}
 12854  	// match: (OR <t> x7:(MOVBZload [i7] {s} p mem) o5:(OR <t> s6:(SLDconst x6:(MOVBZload [i6] {s} p mem) [8]) o4:(OR <t> s5:(SLDconst x5:(MOVBZload [i5] {s} p mem) [16]) o3:(OR <t> s4:(SLDconst x4:(MOVBZload [i4] {s} p mem) [24]) s0:(SLDconst x3:(MOVWBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem) [32])))))
 12855  	// cond: !config.BigEndian && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s0.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x3, x4, x5, x6, x7) != nil && clobber(x3, x4, x5, x6, x7, o3, o4, o5, s0, s4, s5, s6)
 12856  	// result: @mergePoint(b,x3,x4,x5,x6,x7) (MOVDBRload <t> (MOVDaddr <typ.Uintptr> [i0] {s} p) mem)
 12857  	for {
 12858  		t := v.Type
 12859  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12860  			x7 := v_0
 12861  			if x7.Op != OpPPC64MOVBZload {
 12862  				continue
 12863  			}
 12864  			i7 := auxIntToInt32(x7.AuxInt)
 12865  			s := auxToSym(x7.Aux)
 12866  			mem := x7.Args[1]
 12867  			p := x7.Args[0]
 12868  			o5 := v_1
 12869  			if o5.Op != OpPPC64OR || o5.Type != t {
 12870  				continue
 12871  			}
 12872  			_ = o5.Args[1]
 12873  			o5_0 := o5.Args[0]
 12874  			o5_1 := o5.Args[1]
 12875  			for _i1 := 0; _i1 <= 1; _i1, o5_0, o5_1 = _i1+1, o5_1, o5_0 {
 12876  				s6 := o5_0
 12877  				if s6.Op != OpPPC64SLDconst || auxIntToInt64(s6.AuxInt) != 8 {
 12878  					continue
 12879  				}
 12880  				x6 := s6.Args[0]
 12881  				if x6.Op != OpPPC64MOVBZload {
 12882  					continue
 12883  				}
 12884  				i6 := auxIntToInt32(x6.AuxInt)
 12885  				if auxToSym(x6.Aux) != s {
 12886  					continue
 12887  				}
 12888  				_ = x6.Args[1]
 12889  				if p != x6.Args[0] || mem != x6.Args[1] {
 12890  					continue
 12891  				}
 12892  				o4 := o5_1
 12893  				if o4.Op != OpPPC64OR || o4.Type != t {
 12894  					continue
 12895  				}
 12896  				_ = o4.Args[1]
 12897  				o4_0 := o4.Args[0]
 12898  				o4_1 := o4.Args[1]
 12899  				for _i2 := 0; _i2 <= 1; _i2, o4_0, o4_1 = _i2+1, o4_1, o4_0 {
 12900  					s5 := o4_0
 12901  					if s5.Op != OpPPC64SLDconst || auxIntToInt64(s5.AuxInt) != 16 {
 12902  						continue
 12903  					}
 12904  					x5 := s5.Args[0]
 12905  					if x5.Op != OpPPC64MOVBZload {
 12906  						continue
 12907  					}
 12908  					i5 := auxIntToInt32(x5.AuxInt)
 12909  					if auxToSym(x5.Aux) != s {
 12910  						continue
 12911  					}
 12912  					_ = x5.Args[1]
 12913  					if p != x5.Args[0] || mem != x5.Args[1] {
 12914  						continue
 12915  					}
 12916  					o3 := o4_1
 12917  					if o3.Op != OpPPC64OR || o3.Type != t {
 12918  						continue
 12919  					}
 12920  					_ = o3.Args[1]
 12921  					o3_0 := o3.Args[0]
 12922  					o3_1 := o3.Args[1]
 12923  					for _i3 := 0; _i3 <= 1; _i3, o3_0, o3_1 = _i3+1, o3_1, o3_0 {
 12924  						s4 := o3_0
 12925  						if s4.Op != OpPPC64SLDconst || auxIntToInt64(s4.AuxInt) != 24 {
 12926  							continue
 12927  						}
 12928  						x4 := s4.Args[0]
 12929  						if x4.Op != OpPPC64MOVBZload {
 12930  							continue
 12931  						}
 12932  						i4 := auxIntToInt32(x4.AuxInt)
 12933  						if auxToSym(x4.Aux) != s {
 12934  							continue
 12935  						}
 12936  						_ = x4.Args[1]
 12937  						if p != x4.Args[0] || mem != x4.Args[1] {
 12938  							continue
 12939  						}
 12940  						s0 := o3_1
 12941  						if s0.Op != OpPPC64SLDconst || auxIntToInt64(s0.AuxInt) != 32 {
 12942  							continue
 12943  						}
 12944  						x3 := s0.Args[0]
 12945  						if x3.Op != OpPPC64MOVWBRload || x3.Type != t {
 12946  							continue
 12947  						}
 12948  						_ = x3.Args[1]
 12949  						x3_0 := x3.Args[0]
 12950  						if x3_0.Op != OpPPC64MOVDaddr || x3_0.Type != typ.Uintptr {
 12951  							continue
 12952  						}
 12953  						i0 := auxIntToInt32(x3_0.AuxInt)
 12954  						if auxToSym(x3_0.Aux) != s || p != x3_0.Args[0] || mem != x3.Args[1] || !(!config.BigEndian && i4 == i0+4 && i5 == i0+5 && i6 == i0+6 && i7 == i0+7 && x3.Uses == 1 && x4.Uses == 1 && x5.Uses == 1 && x6.Uses == 1 && x7.Uses == 1 && o3.Uses == 1 && o4.Uses == 1 && o5.Uses == 1 && s0.Uses == 1 && s4.Uses == 1 && s5.Uses == 1 && s6.Uses == 1 && mergePoint(b, x3, x4, x5, x6, x7) != nil && clobber(x3, x4, x5, x6, x7, o3, o4, o5, s0, s4, s5, s6)) {
 12955  							continue
 12956  						}
 12957  						b = mergePoint(b, x3, x4, x5, x6, x7)
 12958  						v0 := b.NewValue0(x3.Pos, OpPPC64MOVDBRload, t)
 12959  						v.copyOf(v0)
 12960  						v1 := b.NewValue0(x3.Pos, OpPPC64MOVDaddr, typ.Uintptr)
 12961  						v1.AuxInt = int32ToAuxInt(i0)
 12962  						v1.Aux = symToAux(s)
 12963  						v1.AddArg(p)
 12964  						v0.AddArg2(v1, mem)
 12965  						return true
 12966  					}
 12967  				}
 12968  			}
 12969  		}
 12970  		break
 12971  	}
 12972  	return false
 12973  }
 12974  func rewriteValuePPC64_OpPPC64ORN(v *Value) bool {
 12975  	v_1 := v.Args[1]
 12976  	v_0 := v.Args[0]
 12977  	// match: (ORN x (MOVDconst [-1]))
 12978  	// result: x
 12979  	for {
 12980  		x := v_0
 12981  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
 12982  			break
 12983  		}
 12984  		v.copyOf(x)
 12985  		return true
 12986  	}
 12987  	// match: (ORN (MOVDconst [c]) (MOVDconst [d]))
 12988  	// result: (MOVDconst [c|^d])
 12989  	for {
 12990  		if v_0.Op != OpPPC64MOVDconst {
 12991  			break
 12992  		}
 12993  		c := auxIntToInt64(v_0.AuxInt)
 12994  		if v_1.Op != OpPPC64MOVDconst {
 12995  			break
 1