]> Cypherpunks.ru repositories - gostls13.git/blob - src/cmd/compile/internal/ssa/rewritegeneric.go
cmd/compile: optimize s==s for strings
[gostls13.git] / src / cmd / compile / internal / ssa / rewritegeneric.go
1 // Code generated from _gen/generic.rules using 'go generate'; DO NOT EDIT.
2
3 package ssa
4
5 import "math"
6 import "cmd/internal/obj"
7 import "cmd/compile/internal/types"
8 import "cmd/compile/internal/ir"
9
10 func rewriteValuegeneric(v *Value) bool {
11         switch v.Op {
12         case OpAdd16:
13                 return rewriteValuegeneric_OpAdd16(v)
14         case OpAdd32:
15                 return rewriteValuegeneric_OpAdd32(v)
16         case OpAdd32F:
17                 return rewriteValuegeneric_OpAdd32F(v)
18         case OpAdd64:
19                 return rewriteValuegeneric_OpAdd64(v)
20         case OpAdd64F:
21                 return rewriteValuegeneric_OpAdd64F(v)
22         case OpAdd8:
23                 return rewriteValuegeneric_OpAdd8(v)
24         case OpAddPtr:
25                 return rewriteValuegeneric_OpAddPtr(v)
26         case OpAnd16:
27                 return rewriteValuegeneric_OpAnd16(v)
28         case OpAnd32:
29                 return rewriteValuegeneric_OpAnd32(v)
30         case OpAnd64:
31                 return rewriteValuegeneric_OpAnd64(v)
32         case OpAnd8:
33                 return rewriteValuegeneric_OpAnd8(v)
34         case OpAndB:
35                 return rewriteValuegeneric_OpAndB(v)
36         case OpArraySelect:
37                 return rewriteValuegeneric_OpArraySelect(v)
38         case OpCeil:
39                 return rewriteValuegeneric_OpCeil(v)
40         case OpCom16:
41                 return rewriteValuegeneric_OpCom16(v)
42         case OpCom32:
43                 return rewriteValuegeneric_OpCom32(v)
44         case OpCom64:
45                 return rewriteValuegeneric_OpCom64(v)
46         case OpCom8:
47                 return rewriteValuegeneric_OpCom8(v)
48         case OpConstInterface:
49                 return rewriteValuegeneric_OpConstInterface(v)
50         case OpConstSlice:
51                 return rewriteValuegeneric_OpConstSlice(v)
52         case OpConstString:
53                 return rewriteValuegeneric_OpConstString(v)
54         case OpConvert:
55                 return rewriteValuegeneric_OpConvert(v)
56         case OpCtz16:
57                 return rewriteValuegeneric_OpCtz16(v)
58         case OpCtz32:
59                 return rewriteValuegeneric_OpCtz32(v)
60         case OpCtz64:
61                 return rewriteValuegeneric_OpCtz64(v)
62         case OpCtz8:
63                 return rewriteValuegeneric_OpCtz8(v)
64         case OpCvt32Fto32:
65                 return rewriteValuegeneric_OpCvt32Fto32(v)
66         case OpCvt32Fto64:
67                 return rewriteValuegeneric_OpCvt32Fto64(v)
68         case OpCvt32Fto64F:
69                 return rewriteValuegeneric_OpCvt32Fto64F(v)
70         case OpCvt32to32F:
71                 return rewriteValuegeneric_OpCvt32to32F(v)
72         case OpCvt32to64F:
73                 return rewriteValuegeneric_OpCvt32to64F(v)
74         case OpCvt64Fto32:
75                 return rewriteValuegeneric_OpCvt64Fto32(v)
76         case OpCvt64Fto32F:
77                 return rewriteValuegeneric_OpCvt64Fto32F(v)
78         case OpCvt64Fto64:
79                 return rewriteValuegeneric_OpCvt64Fto64(v)
80         case OpCvt64to32F:
81                 return rewriteValuegeneric_OpCvt64to32F(v)
82         case OpCvt64to64F:
83                 return rewriteValuegeneric_OpCvt64to64F(v)
84         case OpCvtBoolToUint8:
85                 return rewriteValuegeneric_OpCvtBoolToUint8(v)
86         case OpDiv16:
87                 return rewriteValuegeneric_OpDiv16(v)
88         case OpDiv16u:
89                 return rewriteValuegeneric_OpDiv16u(v)
90         case OpDiv32:
91                 return rewriteValuegeneric_OpDiv32(v)
92         case OpDiv32F:
93                 return rewriteValuegeneric_OpDiv32F(v)
94         case OpDiv32u:
95                 return rewriteValuegeneric_OpDiv32u(v)
96         case OpDiv64:
97                 return rewriteValuegeneric_OpDiv64(v)
98         case OpDiv64F:
99                 return rewriteValuegeneric_OpDiv64F(v)
100         case OpDiv64u:
101                 return rewriteValuegeneric_OpDiv64u(v)
102         case OpDiv8:
103                 return rewriteValuegeneric_OpDiv8(v)
104         case OpDiv8u:
105                 return rewriteValuegeneric_OpDiv8u(v)
106         case OpEq16:
107                 return rewriteValuegeneric_OpEq16(v)
108         case OpEq32:
109                 return rewriteValuegeneric_OpEq32(v)
110         case OpEq32F:
111                 return rewriteValuegeneric_OpEq32F(v)
112         case OpEq64:
113                 return rewriteValuegeneric_OpEq64(v)
114         case OpEq64F:
115                 return rewriteValuegeneric_OpEq64F(v)
116         case OpEq8:
117                 return rewriteValuegeneric_OpEq8(v)
118         case OpEqB:
119                 return rewriteValuegeneric_OpEqB(v)
120         case OpEqInter:
121                 return rewriteValuegeneric_OpEqInter(v)
122         case OpEqPtr:
123                 return rewriteValuegeneric_OpEqPtr(v)
124         case OpEqSlice:
125                 return rewriteValuegeneric_OpEqSlice(v)
126         case OpFloor:
127                 return rewriteValuegeneric_OpFloor(v)
128         case OpIMake:
129                 return rewriteValuegeneric_OpIMake(v)
130         case OpInterLECall:
131                 return rewriteValuegeneric_OpInterLECall(v)
132         case OpIsInBounds:
133                 return rewriteValuegeneric_OpIsInBounds(v)
134         case OpIsNonNil:
135                 return rewriteValuegeneric_OpIsNonNil(v)
136         case OpIsSliceInBounds:
137                 return rewriteValuegeneric_OpIsSliceInBounds(v)
138         case OpLeq16:
139                 return rewriteValuegeneric_OpLeq16(v)
140         case OpLeq16U:
141                 return rewriteValuegeneric_OpLeq16U(v)
142         case OpLeq32:
143                 return rewriteValuegeneric_OpLeq32(v)
144         case OpLeq32F:
145                 return rewriteValuegeneric_OpLeq32F(v)
146         case OpLeq32U:
147                 return rewriteValuegeneric_OpLeq32U(v)
148         case OpLeq64:
149                 return rewriteValuegeneric_OpLeq64(v)
150         case OpLeq64F:
151                 return rewriteValuegeneric_OpLeq64F(v)
152         case OpLeq64U:
153                 return rewriteValuegeneric_OpLeq64U(v)
154         case OpLeq8:
155                 return rewriteValuegeneric_OpLeq8(v)
156         case OpLeq8U:
157                 return rewriteValuegeneric_OpLeq8U(v)
158         case OpLess16:
159                 return rewriteValuegeneric_OpLess16(v)
160         case OpLess16U:
161                 return rewriteValuegeneric_OpLess16U(v)
162         case OpLess32:
163                 return rewriteValuegeneric_OpLess32(v)
164         case OpLess32F:
165                 return rewriteValuegeneric_OpLess32F(v)
166         case OpLess32U:
167                 return rewriteValuegeneric_OpLess32U(v)
168         case OpLess64:
169                 return rewriteValuegeneric_OpLess64(v)
170         case OpLess64F:
171                 return rewriteValuegeneric_OpLess64F(v)
172         case OpLess64U:
173                 return rewriteValuegeneric_OpLess64U(v)
174         case OpLess8:
175                 return rewriteValuegeneric_OpLess8(v)
176         case OpLess8U:
177                 return rewriteValuegeneric_OpLess8U(v)
178         case OpLoad:
179                 return rewriteValuegeneric_OpLoad(v)
180         case OpLsh16x16:
181                 return rewriteValuegeneric_OpLsh16x16(v)
182         case OpLsh16x32:
183                 return rewriteValuegeneric_OpLsh16x32(v)
184         case OpLsh16x64:
185                 return rewriteValuegeneric_OpLsh16x64(v)
186         case OpLsh16x8:
187                 return rewriteValuegeneric_OpLsh16x8(v)
188         case OpLsh32x16:
189                 return rewriteValuegeneric_OpLsh32x16(v)
190         case OpLsh32x32:
191                 return rewriteValuegeneric_OpLsh32x32(v)
192         case OpLsh32x64:
193                 return rewriteValuegeneric_OpLsh32x64(v)
194         case OpLsh32x8:
195                 return rewriteValuegeneric_OpLsh32x8(v)
196         case OpLsh64x16:
197                 return rewriteValuegeneric_OpLsh64x16(v)
198         case OpLsh64x32:
199                 return rewriteValuegeneric_OpLsh64x32(v)
200         case OpLsh64x64:
201                 return rewriteValuegeneric_OpLsh64x64(v)
202         case OpLsh64x8:
203                 return rewriteValuegeneric_OpLsh64x8(v)
204         case OpLsh8x16:
205                 return rewriteValuegeneric_OpLsh8x16(v)
206         case OpLsh8x32:
207                 return rewriteValuegeneric_OpLsh8x32(v)
208         case OpLsh8x64:
209                 return rewriteValuegeneric_OpLsh8x64(v)
210         case OpLsh8x8:
211                 return rewriteValuegeneric_OpLsh8x8(v)
212         case OpMod16:
213                 return rewriteValuegeneric_OpMod16(v)
214         case OpMod16u:
215                 return rewriteValuegeneric_OpMod16u(v)
216         case OpMod32:
217                 return rewriteValuegeneric_OpMod32(v)
218         case OpMod32u:
219                 return rewriteValuegeneric_OpMod32u(v)
220         case OpMod64:
221                 return rewriteValuegeneric_OpMod64(v)
222         case OpMod64u:
223                 return rewriteValuegeneric_OpMod64u(v)
224         case OpMod8:
225                 return rewriteValuegeneric_OpMod8(v)
226         case OpMod8u:
227                 return rewriteValuegeneric_OpMod8u(v)
228         case OpMove:
229                 return rewriteValuegeneric_OpMove(v)
230         case OpMul16:
231                 return rewriteValuegeneric_OpMul16(v)
232         case OpMul32:
233                 return rewriteValuegeneric_OpMul32(v)
234         case OpMul32F:
235                 return rewriteValuegeneric_OpMul32F(v)
236         case OpMul64:
237                 return rewriteValuegeneric_OpMul64(v)
238         case OpMul64F:
239                 return rewriteValuegeneric_OpMul64F(v)
240         case OpMul8:
241                 return rewriteValuegeneric_OpMul8(v)
242         case OpNeg16:
243                 return rewriteValuegeneric_OpNeg16(v)
244         case OpNeg32:
245                 return rewriteValuegeneric_OpNeg32(v)
246         case OpNeg32F:
247                 return rewriteValuegeneric_OpNeg32F(v)
248         case OpNeg64:
249                 return rewriteValuegeneric_OpNeg64(v)
250         case OpNeg64F:
251                 return rewriteValuegeneric_OpNeg64F(v)
252         case OpNeg8:
253                 return rewriteValuegeneric_OpNeg8(v)
254         case OpNeq16:
255                 return rewriteValuegeneric_OpNeq16(v)
256         case OpNeq32:
257                 return rewriteValuegeneric_OpNeq32(v)
258         case OpNeq32F:
259                 return rewriteValuegeneric_OpNeq32F(v)
260         case OpNeq64:
261                 return rewriteValuegeneric_OpNeq64(v)
262         case OpNeq64F:
263                 return rewriteValuegeneric_OpNeq64F(v)
264         case OpNeq8:
265                 return rewriteValuegeneric_OpNeq8(v)
266         case OpNeqB:
267                 return rewriteValuegeneric_OpNeqB(v)
268         case OpNeqInter:
269                 return rewriteValuegeneric_OpNeqInter(v)
270         case OpNeqPtr:
271                 return rewriteValuegeneric_OpNeqPtr(v)
272         case OpNeqSlice:
273                 return rewriteValuegeneric_OpNeqSlice(v)
274         case OpNilCheck:
275                 return rewriteValuegeneric_OpNilCheck(v)
276         case OpNot:
277                 return rewriteValuegeneric_OpNot(v)
278         case OpOffPtr:
279                 return rewriteValuegeneric_OpOffPtr(v)
280         case OpOr16:
281                 return rewriteValuegeneric_OpOr16(v)
282         case OpOr32:
283                 return rewriteValuegeneric_OpOr32(v)
284         case OpOr64:
285                 return rewriteValuegeneric_OpOr64(v)
286         case OpOr8:
287                 return rewriteValuegeneric_OpOr8(v)
288         case OpOrB:
289                 return rewriteValuegeneric_OpOrB(v)
290         case OpPhi:
291                 return rewriteValuegeneric_OpPhi(v)
292         case OpPtrIndex:
293                 return rewriteValuegeneric_OpPtrIndex(v)
294         case OpRotateLeft16:
295                 return rewriteValuegeneric_OpRotateLeft16(v)
296         case OpRotateLeft32:
297                 return rewriteValuegeneric_OpRotateLeft32(v)
298         case OpRotateLeft64:
299                 return rewriteValuegeneric_OpRotateLeft64(v)
300         case OpRotateLeft8:
301                 return rewriteValuegeneric_OpRotateLeft8(v)
302         case OpRound32F:
303                 return rewriteValuegeneric_OpRound32F(v)
304         case OpRound64F:
305                 return rewriteValuegeneric_OpRound64F(v)
306         case OpRoundToEven:
307                 return rewriteValuegeneric_OpRoundToEven(v)
308         case OpRsh16Ux16:
309                 return rewriteValuegeneric_OpRsh16Ux16(v)
310         case OpRsh16Ux32:
311                 return rewriteValuegeneric_OpRsh16Ux32(v)
312         case OpRsh16Ux64:
313                 return rewriteValuegeneric_OpRsh16Ux64(v)
314         case OpRsh16Ux8:
315                 return rewriteValuegeneric_OpRsh16Ux8(v)
316         case OpRsh16x16:
317                 return rewriteValuegeneric_OpRsh16x16(v)
318         case OpRsh16x32:
319                 return rewriteValuegeneric_OpRsh16x32(v)
320         case OpRsh16x64:
321                 return rewriteValuegeneric_OpRsh16x64(v)
322         case OpRsh16x8:
323                 return rewriteValuegeneric_OpRsh16x8(v)
324         case OpRsh32Ux16:
325                 return rewriteValuegeneric_OpRsh32Ux16(v)
326         case OpRsh32Ux32:
327                 return rewriteValuegeneric_OpRsh32Ux32(v)
328         case OpRsh32Ux64:
329                 return rewriteValuegeneric_OpRsh32Ux64(v)
330         case OpRsh32Ux8:
331                 return rewriteValuegeneric_OpRsh32Ux8(v)
332         case OpRsh32x16:
333                 return rewriteValuegeneric_OpRsh32x16(v)
334         case OpRsh32x32:
335                 return rewriteValuegeneric_OpRsh32x32(v)
336         case OpRsh32x64:
337                 return rewriteValuegeneric_OpRsh32x64(v)
338         case OpRsh32x8:
339                 return rewriteValuegeneric_OpRsh32x8(v)
340         case OpRsh64Ux16:
341                 return rewriteValuegeneric_OpRsh64Ux16(v)
342         case OpRsh64Ux32:
343                 return rewriteValuegeneric_OpRsh64Ux32(v)
344         case OpRsh64Ux64:
345                 return rewriteValuegeneric_OpRsh64Ux64(v)
346         case OpRsh64Ux8:
347                 return rewriteValuegeneric_OpRsh64Ux8(v)
348         case OpRsh64x16:
349                 return rewriteValuegeneric_OpRsh64x16(v)
350         case OpRsh64x32:
351                 return rewriteValuegeneric_OpRsh64x32(v)
352         case OpRsh64x64:
353                 return rewriteValuegeneric_OpRsh64x64(v)
354         case OpRsh64x8:
355                 return rewriteValuegeneric_OpRsh64x8(v)
356         case OpRsh8Ux16:
357                 return rewriteValuegeneric_OpRsh8Ux16(v)
358         case OpRsh8Ux32:
359                 return rewriteValuegeneric_OpRsh8Ux32(v)
360         case OpRsh8Ux64:
361                 return rewriteValuegeneric_OpRsh8Ux64(v)
362         case OpRsh8Ux8:
363                 return rewriteValuegeneric_OpRsh8Ux8(v)
364         case OpRsh8x16:
365                 return rewriteValuegeneric_OpRsh8x16(v)
366         case OpRsh8x32:
367                 return rewriteValuegeneric_OpRsh8x32(v)
368         case OpRsh8x64:
369                 return rewriteValuegeneric_OpRsh8x64(v)
370         case OpRsh8x8:
371                 return rewriteValuegeneric_OpRsh8x8(v)
372         case OpSelect0:
373                 return rewriteValuegeneric_OpSelect0(v)
374         case OpSelect1:
375                 return rewriteValuegeneric_OpSelect1(v)
376         case OpSelectN:
377                 return rewriteValuegeneric_OpSelectN(v)
378         case OpSignExt16to32:
379                 return rewriteValuegeneric_OpSignExt16to32(v)
380         case OpSignExt16to64:
381                 return rewriteValuegeneric_OpSignExt16to64(v)
382         case OpSignExt32to64:
383                 return rewriteValuegeneric_OpSignExt32to64(v)
384         case OpSignExt8to16:
385                 return rewriteValuegeneric_OpSignExt8to16(v)
386         case OpSignExt8to32:
387                 return rewriteValuegeneric_OpSignExt8to32(v)
388         case OpSignExt8to64:
389                 return rewriteValuegeneric_OpSignExt8to64(v)
390         case OpSliceCap:
391                 return rewriteValuegeneric_OpSliceCap(v)
392         case OpSliceLen:
393                 return rewriteValuegeneric_OpSliceLen(v)
394         case OpSlicePtr:
395                 return rewriteValuegeneric_OpSlicePtr(v)
396         case OpSlicemask:
397                 return rewriteValuegeneric_OpSlicemask(v)
398         case OpSqrt:
399                 return rewriteValuegeneric_OpSqrt(v)
400         case OpStaticCall:
401                 return rewriteValuegeneric_OpStaticCall(v)
402         case OpStaticLECall:
403                 return rewriteValuegeneric_OpStaticLECall(v)
404         case OpStore:
405                 return rewriteValuegeneric_OpStore(v)
406         case OpStringLen:
407                 return rewriteValuegeneric_OpStringLen(v)
408         case OpStringPtr:
409                 return rewriteValuegeneric_OpStringPtr(v)
410         case OpStructSelect:
411                 return rewriteValuegeneric_OpStructSelect(v)
412         case OpSub16:
413                 return rewriteValuegeneric_OpSub16(v)
414         case OpSub32:
415                 return rewriteValuegeneric_OpSub32(v)
416         case OpSub32F:
417                 return rewriteValuegeneric_OpSub32F(v)
418         case OpSub64:
419                 return rewriteValuegeneric_OpSub64(v)
420         case OpSub64F:
421                 return rewriteValuegeneric_OpSub64F(v)
422         case OpSub8:
423                 return rewriteValuegeneric_OpSub8(v)
424         case OpTrunc:
425                 return rewriteValuegeneric_OpTrunc(v)
426         case OpTrunc16to8:
427                 return rewriteValuegeneric_OpTrunc16to8(v)
428         case OpTrunc32to16:
429                 return rewriteValuegeneric_OpTrunc32to16(v)
430         case OpTrunc32to8:
431                 return rewriteValuegeneric_OpTrunc32to8(v)
432         case OpTrunc64to16:
433                 return rewriteValuegeneric_OpTrunc64to16(v)
434         case OpTrunc64to32:
435                 return rewriteValuegeneric_OpTrunc64to32(v)
436         case OpTrunc64to8:
437                 return rewriteValuegeneric_OpTrunc64to8(v)
438         case OpXor16:
439                 return rewriteValuegeneric_OpXor16(v)
440         case OpXor32:
441                 return rewriteValuegeneric_OpXor32(v)
442         case OpXor64:
443                 return rewriteValuegeneric_OpXor64(v)
444         case OpXor8:
445                 return rewriteValuegeneric_OpXor8(v)
446         case OpZero:
447                 return rewriteValuegeneric_OpZero(v)
448         case OpZeroExt16to32:
449                 return rewriteValuegeneric_OpZeroExt16to32(v)
450         case OpZeroExt16to64:
451                 return rewriteValuegeneric_OpZeroExt16to64(v)
452         case OpZeroExt32to64:
453                 return rewriteValuegeneric_OpZeroExt32to64(v)
454         case OpZeroExt8to16:
455                 return rewriteValuegeneric_OpZeroExt8to16(v)
456         case OpZeroExt8to32:
457                 return rewriteValuegeneric_OpZeroExt8to32(v)
458         case OpZeroExt8to64:
459                 return rewriteValuegeneric_OpZeroExt8to64(v)
460         }
461         return false
462 }
463 func rewriteValuegeneric_OpAdd16(v *Value) bool {
464         v_1 := v.Args[1]
465         v_0 := v.Args[0]
466         b := v.Block
467         config := b.Func.Config
468         // match: (Add16 (Const16 [c]) (Const16 [d]))
469         // result: (Const16 [c+d])
470         for {
471                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
472                         if v_0.Op != OpConst16 {
473                                 continue
474                         }
475                         c := auxIntToInt16(v_0.AuxInt)
476                         if v_1.Op != OpConst16 {
477                                 continue
478                         }
479                         d := auxIntToInt16(v_1.AuxInt)
480                         v.reset(OpConst16)
481                         v.AuxInt = int16ToAuxInt(c + d)
482                         return true
483                 }
484                 break
485         }
486         // match: (Add16 <t> (Mul16 x y) (Mul16 x z))
487         // result: (Mul16 x (Add16 <t> y z))
488         for {
489                 t := v.Type
490                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
491                         if v_0.Op != OpMul16 {
492                                 continue
493                         }
494                         _ = v_0.Args[1]
495                         v_0_0 := v_0.Args[0]
496                         v_0_1 := v_0.Args[1]
497                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
498                                 x := v_0_0
499                                 y := v_0_1
500                                 if v_1.Op != OpMul16 {
501                                         continue
502                                 }
503                                 _ = v_1.Args[1]
504                                 v_1_0 := v_1.Args[0]
505                                 v_1_1 := v_1.Args[1]
506                                 for _i2 := 0; _i2 <= 1; _i2, v_1_0, v_1_1 = _i2+1, v_1_1, v_1_0 {
507                                         if x != v_1_0 {
508                                                 continue
509                                         }
510                                         z := v_1_1
511                                         v.reset(OpMul16)
512                                         v0 := b.NewValue0(v.Pos, OpAdd16, t)
513                                         v0.AddArg2(y, z)
514                                         v.AddArg2(x, v0)
515                                         return true
516                                 }
517                         }
518                 }
519                 break
520         }
521         // match: (Add16 (Const16 [0]) x)
522         // result: x
523         for {
524                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
525                         if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
526                                 continue
527                         }
528                         x := v_1
529                         v.copyOf(x)
530                         return true
531                 }
532                 break
533         }
534         // match: (Add16 x (Neg16 y))
535         // result: (Sub16 x y)
536         for {
537                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
538                         x := v_0
539                         if v_1.Op != OpNeg16 {
540                                 continue
541                         }
542                         y := v_1.Args[0]
543                         v.reset(OpSub16)
544                         v.AddArg2(x, y)
545                         return true
546                 }
547                 break
548         }
549         // match: (Add16 (Com16 x) x)
550         // result: (Const16 [-1])
551         for {
552                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
553                         if v_0.Op != OpCom16 {
554                                 continue
555                         }
556                         x := v_0.Args[0]
557                         if x != v_1 {
558                                 continue
559                         }
560                         v.reset(OpConst16)
561                         v.AuxInt = int16ToAuxInt(-1)
562                         return true
563                 }
564                 break
565         }
566         // match: (Add16 (Sub16 x t) (Add16 t y))
567         // result: (Add16 x y)
568         for {
569                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
570                         if v_0.Op != OpSub16 {
571                                 continue
572                         }
573                         t := v_0.Args[1]
574                         x := v_0.Args[0]
575                         if v_1.Op != OpAdd16 {
576                                 continue
577                         }
578                         _ = v_1.Args[1]
579                         v_1_0 := v_1.Args[0]
580                         v_1_1 := v_1.Args[1]
581                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
582                                 if t != v_1_0 {
583                                         continue
584                                 }
585                                 y := v_1_1
586                                 v.reset(OpAdd16)
587                                 v.AddArg2(x, y)
588                                 return true
589                         }
590                 }
591                 break
592         }
593         // match: (Add16 (Const16 [1]) (Com16 x))
594         // result: (Neg16 x)
595         for {
596                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
597                         if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 1 || v_1.Op != OpCom16 {
598                                 continue
599                         }
600                         x := v_1.Args[0]
601                         v.reset(OpNeg16)
602                         v.AddArg(x)
603                         return true
604                 }
605                 break
606         }
607         // match: (Add16 x (Sub16 y x))
608         // result: y
609         for {
610                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
611                         x := v_0
612                         if v_1.Op != OpSub16 {
613                                 continue
614                         }
615                         _ = v_1.Args[1]
616                         y := v_1.Args[0]
617                         if x != v_1.Args[1] {
618                                 continue
619                         }
620                         v.copyOf(y)
621                         return true
622                 }
623                 break
624         }
625         // match: (Add16 x (Add16 y (Sub16 z x)))
626         // result: (Add16 y z)
627         for {
628                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
629                         x := v_0
630                         if v_1.Op != OpAdd16 {
631                                 continue
632                         }
633                         _ = v_1.Args[1]
634                         v_1_0 := v_1.Args[0]
635                         v_1_1 := v_1.Args[1]
636                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
637                                 y := v_1_0
638                                 if v_1_1.Op != OpSub16 {
639                                         continue
640                                 }
641                                 _ = v_1_1.Args[1]
642                                 z := v_1_1.Args[0]
643                                 if x != v_1_1.Args[1] {
644                                         continue
645                                 }
646                                 v.reset(OpAdd16)
647                                 v.AddArg2(y, z)
648                                 return true
649                         }
650                 }
651                 break
652         }
653         // match: (Add16 (Add16 i:(Const16 <t>) z) x)
654         // cond: (z.Op != OpConst16 && x.Op != OpConst16)
655         // result: (Add16 i (Add16 <t> z x))
656         for {
657                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
658                         if v_0.Op != OpAdd16 {
659                                 continue
660                         }
661                         _ = v_0.Args[1]
662                         v_0_0 := v_0.Args[0]
663                         v_0_1 := v_0.Args[1]
664                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
665                                 i := v_0_0
666                                 if i.Op != OpConst16 {
667                                         continue
668                                 }
669                                 t := i.Type
670                                 z := v_0_1
671                                 x := v_1
672                                 if !(z.Op != OpConst16 && x.Op != OpConst16) {
673                                         continue
674                                 }
675                                 v.reset(OpAdd16)
676                                 v0 := b.NewValue0(v.Pos, OpAdd16, t)
677                                 v0.AddArg2(z, x)
678                                 v.AddArg2(i, v0)
679                                 return true
680                         }
681                 }
682                 break
683         }
684         // match: (Add16 (Sub16 i:(Const16 <t>) z) x)
685         // cond: (z.Op != OpConst16 && x.Op != OpConst16)
686         // result: (Add16 i (Sub16 <t> x z))
687         for {
688                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
689                         if v_0.Op != OpSub16 {
690                                 continue
691                         }
692                         z := v_0.Args[1]
693                         i := v_0.Args[0]
694                         if i.Op != OpConst16 {
695                                 continue
696                         }
697                         t := i.Type
698                         x := v_1
699                         if !(z.Op != OpConst16 && x.Op != OpConst16) {
700                                 continue
701                         }
702                         v.reset(OpAdd16)
703                         v0 := b.NewValue0(v.Pos, OpSub16, t)
704                         v0.AddArg2(x, z)
705                         v.AddArg2(i, v0)
706                         return true
707                 }
708                 break
709         }
710         // match: (Add16 (Const16 <t> [c]) (Add16 (Const16 <t> [d]) x))
711         // result: (Add16 (Const16 <t> [c+d]) x)
712         for {
713                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
714                         if v_0.Op != OpConst16 {
715                                 continue
716                         }
717                         t := v_0.Type
718                         c := auxIntToInt16(v_0.AuxInt)
719                         if v_1.Op != OpAdd16 {
720                                 continue
721                         }
722                         _ = v_1.Args[1]
723                         v_1_0 := v_1.Args[0]
724                         v_1_1 := v_1.Args[1]
725                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
726                                 if v_1_0.Op != OpConst16 || v_1_0.Type != t {
727                                         continue
728                                 }
729                                 d := auxIntToInt16(v_1_0.AuxInt)
730                                 x := v_1_1
731                                 v.reset(OpAdd16)
732                                 v0 := b.NewValue0(v.Pos, OpConst16, t)
733                                 v0.AuxInt = int16ToAuxInt(c + d)
734                                 v.AddArg2(v0, x)
735                                 return true
736                         }
737                 }
738                 break
739         }
740         // match: (Add16 (Const16 <t> [c]) (Sub16 (Const16 <t> [d]) x))
741         // result: (Sub16 (Const16 <t> [c+d]) x)
742         for {
743                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
744                         if v_0.Op != OpConst16 {
745                                 continue
746                         }
747                         t := v_0.Type
748                         c := auxIntToInt16(v_0.AuxInt)
749                         if v_1.Op != OpSub16 {
750                                 continue
751                         }
752                         x := v_1.Args[1]
753                         v_1_0 := v_1.Args[0]
754                         if v_1_0.Op != OpConst16 || v_1_0.Type != t {
755                                 continue
756                         }
757                         d := auxIntToInt16(v_1_0.AuxInt)
758                         v.reset(OpSub16)
759                         v0 := b.NewValue0(v.Pos, OpConst16, t)
760                         v0.AuxInt = int16ToAuxInt(c + d)
761                         v.AddArg2(v0, x)
762                         return true
763                 }
764                 break
765         }
766         // match: (Add16 (Lsh16x64 x z:(Const64 <t> [c])) (Rsh16Ux64 x (Const64 [d])))
767         // cond: c < 16 && d == 16-c && canRotate(config, 16)
768         // result: (RotateLeft16 x z)
769         for {
770                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
771                         if v_0.Op != OpLsh16x64 {
772                                 continue
773                         }
774                         _ = v_0.Args[1]
775                         x := v_0.Args[0]
776                         z := v_0.Args[1]
777                         if z.Op != OpConst64 {
778                                 continue
779                         }
780                         c := auxIntToInt64(z.AuxInt)
781                         if v_1.Op != OpRsh16Ux64 {
782                                 continue
783                         }
784                         _ = v_1.Args[1]
785                         if x != v_1.Args[0] {
786                                 continue
787                         }
788                         v_1_1 := v_1.Args[1]
789                         if v_1_1.Op != OpConst64 {
790                                 continue
791                         }
792                         d := auxIntToInt64(v_1_1.AuxInt)
793                         if !(c < 16 && d == 16-c && canRotate(config, 16)) {
794                                 continue
795                         }
796                         v.reset(OpRotateLeft16)
797                         v.AddArg2(x, z)
798                         return true
799                 }
800                 break
801         }
802         // match: (Add16 left:(Lsh16x64 x y) right:(Rsh16Ux64 x (Sub64 (Const64 [16]) y)))
803         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
804         // result: (RotateLeft16 x y)
805         for {
806                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
807                         left := v_0
808                         if left.Op != OpLsh16x64 {
809                                 continue
810                         }
811                         y := left.Args[1]
812                         x := left.Args[0]
813                         right := v_1
814                         if right.Op != OpRsh16Ux64 {
815                                 continue
816                         }
817                         _ = right.Args[1]
818                         if x != right.Args[0] {
819                                 continue
820                         }
821                         right_1 := right.Args[1]
822                         if right_1.Op != OpSub64 {
823                                 continue
824                         }
825                         _ = right_1.Args[1]
826                         right_1_0 := right_1.Args[0]
827                         if right_1_0.Op != OpConst64 || auxIntToInt64(right_1_0.AuxInt) != 16 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
828                                 continue
829                         }
830                         v.reset(OpRotateLeft16)
831                         v.AddArg2(x, y)
832                         return true
833                 }
834                 break
835         }
836         // match: (Add16 left:(Lsh16x32 x y) right:(Rsh16Ux32 x (Sub32 (Const32 [16]) y)))
837         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
838         // result: (RotateLeft16 x y)
839         for {
840                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
841                         left := v_0
842                         if left.Op != OpLsh16x32 {
843                                 continue
844                         }
845                         y := left.Args[1]
846                         x := left.Args[0]
847                         right := v_1
848                         if right.Op != OpRsh16Ux32 {
849                                 continue
850                         }
851                         _ = right.Args[1]
852                         if x != right.Args[0] {
853                                 continue
854                         }
855                         right_1 := right.Args[1]
856                         if right_1.Op != OpSub32 {
857                                 continue
858                         }
859                         _ = right_1.Args[1]
860                         right_1_0 := right_1.Args[0]
861                         if right_1_0.Op != OpConst32 || auxIntToInt32(right_1_0.AuxInt) != 16 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
862                                 continue
863                         }
864                         v.reset(OpRotateLeft16)
865                         v.AddArg2(x, y)
866                         return true
867                 }
868                 break
869         }
870         // match: (Add16 left:(Lsh16x16 x y) right:(Rsh16Ux16 x (Sub16 (Const16 [16]) y)))
871         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
872         // result: (RotateLeft16 x y)
873         for {
874                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
875                         left := v_0
876                         if left.Op != OpLsh16x16 {
877                                 continue
878                         }
879                         y := left.Args[1]
880                         x := left.Args[0]
881                         right := v_1
882                         if right.Op != OpRsh16Ux16 {
883                                 continue
884                         }
885                         _ = right.Args[1]
886                         if x != right.Args[0] {
887                                 continue
888                         }
889                         right_1 := right.Args[1]
890                         if right_1.Op != OpSub16 {
891                                 continue
892                         }
893                         _ = right_1.Args[1]
894                         right_1_0 := right_1.Args[0]
895                         if right_1_0.Op != OpConst16 || auxIntToInt16(right_1_0.AuxInt) != 16 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
896                                 continue
897                         }
898                         v.reset(OpRotateLeft16)
899                         v.AddArg2(x, y)
900                         return true
901                 }
902                 break
903         }
904         // match: (Add16 left:(Lsh16x8 x y) right:(Rsh16Ux8 x (Sub8 (Const8 [16]) y)))
905         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
906         // result: (RotateLeft16 x y)
907         for {
908                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
909                         left := v_0
910                         if left.Op != OpLsh16x8 {
911                                 continue
912                         }
913                         y := left.Args[1]
914                         x := left.Args[0]
915                         right := v_1
916                         if right.Op != OpRsh16Ux8 {
917                                 continue
918                         }
919                         _ = right.Args[1]
920                         if x != right.Args[0] {
921                                 continue
922                         }
923                         right_1 := right.Args[1]
924                         if right_1.Op != OpSub8 {
925                                 continue
926                         }
927                         _ = right_1.Args[1]
928                         right_1_0 := right_1.Args[0]
929                         if right_1_0.Op != OpConst8 || auxIntToInt8(right_1_0.AuxInt) != 16 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
930                                 continue
931                         }
932                         v.reset(OpRotateLeft16)
933                         v.AddArg2(x, y)
934                         return true
935                 }
936                 break
937         }
938         // match: (Add16 right:(Rsh16Ux64 x y) left:(Lsh16x64 x z:(Sub64 (Const64 [16]) y)))
939         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
940         // result: (RotateLeft16 x z)
941         for {
942                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
943                         right := v_0
944                         if right.Op != OpRsh16Ux64 {
945                                 continue
946                         }
947                         y := right.Args[1]
948                         x := right.Args[0]
949                         left := v_1
950                         if left.Op != OpLsh16x64 {
951                                 continue
952                         }
953                         _ = left.Args[1]
954                         if x != left.Args[0] {
955                                 continue
956                         }
957                         z := left.Args[1]
958                         if z.Op != OpSub64 {
959                                 continue
960                         }
961                         _ = z.Args[1]
962                         z_0 := z.Args[0]
963                         if z_0.Op != OpConst64 || auxIntToInt64(z_0.AuxInt) != 16 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
964                                 continue
965                         }
966                         v.reset(OpRotateLeft16)
967                         v.AddArg2(x, z)
968                         return true
969                 }
970                 break
971         }
972         // match: (Add16 right:(Rsh16Ux32 x y) left:(Lsh16x32 x z:(Sub32 (Const32 [16]) y)))
973         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
974         // result: (RotateLeft16 x z)
975         for {
976                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
977                         right := v_0
978                         if right.Op != OpRsh16Ux32 {
979                                 continue
980                         }
981                         y := right.Args[1]
982                         x := right.Args[0]
983                         left := v_1
984                         if left.Op != OpLsh16x32 {
985                                 continue
986                         }
987                         _ = left.Args[1]
988                         if x != left.Args[0] {
989                                 continue
990                         }
991                         z := left.Args[1]
992                         if z.Op != OpSub32 {
993                                 continue
994                         }
995                         _ = z.Args[1]
996                         z_0 := z.Args[0]
997                         if z_0.Op != OpConst32 || auxIntToInt32(z_0.AuxInt) != 16 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
998                                 continue
999                         }
1000                         v.reset(OpRotateLeft16)
1001                         v.AddArg2(x, z)
1002                         return true
1003                 }
1004                 break
1005         }
1006         // match: (Add16 right:(Rsh16Ux16 x y) left:(Lsh16x16 x z:(Sub16 (Const16 [16]) y)))
1007         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
1008         // result: (RotateLeft16 x z)
1009         for {
1010                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1011                         right := v_0
1012                         if right.Op != OpRsh16Ux16 {
1013                                 continue
1014                         }
1015                         y := right.Args[1]
1016                         x := right.Args[0]
1017                         left := v_1
1018                         if left.Op != OpLsh16x16 {
1019                                 continue
1020                         }
1021                         _ = left.Args[1]
1022                         if x != left.Args[0] {
1023                                 continue
1024                         }
1025                         z := left.Args[1]
1026                         if z.Op != OpSub16 {
1027                                 continue
1028                         }
1029                         _ = z.Args[1]
1030                         z_0 := z.Args[0]
1031                         if z_0.Op != OpConst16 || auxIntToInt16(z_0.AuxInt) != 16 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
1032                                 continue
1033                         }
1034                         v.reset(OpRotateLeft16)
1035                         v.AddArg2(x, z)
1036                         return true
1037                 }
1038                 break
1039         }
1040         // match: (Add16 right:(Rsh16Ux8 x y) left:(Lsh16x8 x z:(Sub8 (Const8 [16]) y)))
1041         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
1042         // result: (RotateLeft16 x z)
1043         for {
1044                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1045                         right := v_0
1046                         if right.Op != OpRsh16Ux8 {
1047                                 continue
1048                         }
1049                         y := right.Args[1]
1050                         x := right.Args[0]
1051                         left := v_1
1052                         if left.Op != OpLsh16x8 {
1053                                 continue
1054                         }
1055                         _ = left.Args[1]
1056                         if x != left.Args[0] {
1057                                 continue
1058                         }
1059                         z := left.Args[1]
1060                         if z.Op != OpSub8 {
1061                                 continue
1062                         }
1063                         _ = z.Args[1]
1064                         z_0 := z.Args[0]
1065                         if z_0.Op != OpConst8 || auxIntToInt8(z_0.AuxInt) != 16 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
1066                                 continue
1067                         }
1068                         v.reset(OpRotateLeft16)
1069                         v.AddArg2(x, z)
1070                         return true
1071                 }
1072                 break
1073         }
1074         return false
1075 }
1076 func rewriteValuegeneric_OpAdd32(v *Value) bool {
1077         v_1 := v.Args[1]
1078         v_0 := v.Args[0]
1079         b := v.Block
1080         config := b.Func.Config
1081         // match: (Add32 (Const32 [c]) (Const32 [d]))
1082         // result: (Const32 [c+d])
1083         for {
1084                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1085                         if v_0.Op != OpConst32 {
1086                                 continue
1087                         }
1088                         c := auxIntToInt32(v_0.AuxInt)
1089                         if v_1.Op != OpConst32 {
1090                                 continue
1091                         }
1092                         d := auxIntToInt32(v_1.AuxInt)
1093                         v.reset(OpConst32)
1094                         v.AuxInt = int32ToAuxInt(c + d)
1095                         return true
1096                 }
1097                 break
1098         }
1099         // match: (Add32 <t> (Mul32 x y) (Mul32 x z))
1100         // result: (Mul32 x (Add32 <t> y z))
1101         for {
1102                 t := v.Type
1103                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1104                         if v_0.Op != OpMul32 {
1105                                 continue
1106                         }
1107                         _ = v_0.Args[1]
1108                         v_0_0 := v_0.Args[0]
1109                         v_0_1 := v_0.Args[1]
1110                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
1111                                 x := v_0_0
1112                                 y := v_0_1
1113                                 if v_1.Op != OpMul32 {
1114                                         continue
1115                                 }
1116                                 _ = v_1.Args[1]
1117                                 v_1_0 := v_1.Args[0]
1118                                 v_1_1 := v_1.Args[1]
1119                                 for _i2 := 0; _i2 <= 1; _i2, v_1_0, v_1_1 = _i2+1, v_1_1, v_1_0 {
1120                                         if x != v_1_0 {
1121                                                 continue
1122                                         }
1123                                         z := v_1_1
1124                                         v.reset(OpMul32)
1125                                         v0 := b.NewValue0(v.Pos, OpAdd32, t)
1126                                         v0.AddArg2(y, z)
1127                                         v.AddArg2(x, v0)
1128                                         return true
1129                                 }
1130                         }
1131                 }
1132                 break
1133         }
1134         // match: (Add32 (Const32 [0]) x)
1135         // result: x
1136         for {
1137                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1138                         if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
1139                                 continue
1140                         }
1141                         x := v_1
1142                         v.copyOf(x)
1143                         return true
1144                 }
1145                 break
1146         }
1147         // match: (Add32 x (Neg32 y))
1148         // result: (Sub32 x y)
1149         for {
1150                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1151                         x := v_0
1152                         if v_1.Op != OpNeg32 {
1153                                 continue
1154                         }
1155                         y := v_1.Args[0]
1156                         v.reset(OpSub32)
1157                         v.AddArg2(x, y)
1158                         return true
1159                 }
1160                 break
1161         }
1162         // match: (Add32 (Com32 x) x)
1163         // result: (Const32 [-1])
1164         for {
1165                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1166                         if v_0.Op != OpCom32 {
1167                                 continue
1168                         }
1169                         x := v_0.Args[0]
1170                         if x != v_1 {
1171                                 continue
1172                         }
1173                         v.reset(OpConst32)
1174                         v.AuxInt = int32ToAuxInt(-1)
1175                         return true
1176                 }
1177                 break
1178         }
1179         // match: (Add32 (Sub32 x t) (Add32 t y))
1180         // result: (Add32 x y)
1181         for {
1182                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1183                         if v_0.Op != OpSub32 {
1184                                 continue
1185                         }
1186                         t := v_0.Args[1]
1187                         x := v_0.Args[0]
1188                         if v_1.Op != OpAdd32 {
1189                                 continue
1190                         }
1191                         _ = v_1.Args[1]
1192                         v_1_0 := v_1.Args[0]
1193                         v_1_1 := v_1.Args[1]
1194                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
1195                                 if t != v_1_0 {
1196                                         continue
1197                                 }
1198                                 y := v_1_1
1199                                 v.reset(OpAdd32)
1200                                 v.AddArg2(x, y)
1201                                 return true
1202                         }
1203                 }
1204                 break
1205         }
1206         // match: (Add32 (Const32 [1]) (Com32 x))
1207         // result: (Neg32 x)
1208         for {
1209                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1210                         if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 1 || v_1.Op != OpCom32 {
1211                                 continue
1212                         }
1213                         x := v_1.Args[0]
1214                         v.reset(OpNeg32)
1215                         v.AddArg(x)
1216                         return true
1217                 }
1218                 break
1219         }
1220         // match: (Add32 x (Sub32 y x))
1221         // result: y
1222         for {
1223                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1224                         x := v_0
1225                         if v_1.Op != OpSub32 {
1226                                 continue
1227                         }
1228                         _ = v_1.Args[1]
1229                         y := v_1.Args[0]
1230                         if x != v_1.Args[1] {
1231                                 continue
1232                         }
1233                         v.copyOf(y)
1234                         return true
1235                 }
1236                 break
1237         }
1238         // match: (Add32 x (Add32 y (Sub32 z x)))
1239         // result: (Add32 y z)
1240         for {
1241                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1242                         x := v_0
1243                         if v_1.Op != OpAdd32 {
1244                                 continue
1245                         }
1246                         _ = v_1.Args[1]
1247                         v_1_0 := v_1.Args[0]
1248                         v_1_1 := v_1.Args[1]
1249                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
1250                                 y := v_1_0
1251                                 if v_1_1.Op != OpSub32 {
1252                                         continue
1253                                 }
1254                                 _ = v_1_1.Args[1]
1255                                 z := v_1_1.Args[0]
1256                                 if x != v_1_1.Args[1] {
1257                                         continue
1258                                 }
1259                                 v.reset(OpAdd32)
1260                                 v.AddArg2(y, z)
1261                                 return true
1262                         }
1263                 }
1264                 break
1265         }
1266         // match: (Add32 (Add32 i:(Const32 <t>) z) x)
1267         // cond: (z.Op != OpConst32 && x.Op != OpConst32)
1268         // result: (Add32 i (Add32 <t> z x))
1269         for {
1270                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1271                         if v_0.Op != OpAdd32 {
1272                                 continue
1273                         }
1274                         _ = v_0.Args[1]
1275                         v_0_0 := v_0.Args[0]
1276                         v_0_1 := v_0.Args[1]
1277                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
1278                                 i := v_0_0
1279                                 if i.Op != OpConst32 {
1280                                         continue
1281                                 }
1282                                 t := i.Type
1283                                 z := v_0_1
1284                                 x := v_1
1285                                 if !(z.Op != OpConst32 && x.Op != OpConst32) {
1286                                         continue
1287                                 }
1288                                 v.reset(OpAdd32)
1289                                 v0 := b.NewValue0(v.Pos, OpAdd32, t)
1290                                 v0.AddArg2(z, x)
1291                                 v.AddArg2(i, v0)
1292                                 return true
1293                         }
1294                 }
1295                 break
1296         }
1297         // match: (Add32 (Sub32 i:(Const32 <t>) z) x)
1298         // cond: (z.Op != OpConst32 && x.Op != OpConst32)
1299         // result: (Add32 i (Sub32 <t> x z))
1300         for {
1301                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1302                         if v_0.Op != OpSub32 {
1303                                 continue
1304                         }
1305                         z := v_0.Args[1]
1306                         i := v_0.Args[0]
1307                         if i.Op != OpConst32 {
1308                                 continue
1309                         }
1310                         t := i.Type
1311                         x := v_1
1312                         if !(z.Op != OpConst32 && x.Op != OpConst32) {
1313                                 continue
1314                         }
1315                         v.reset(OpAdd32)
1316                         v0 := b.NewValue0(v.Pos, OpSub32, t)
1317                         v0.AddArg2(x, z)
1318                         v.AddArg2(i, v0)
1319                         return true
1320                 }
1321                 break
1322         }
1323         // match: (Add32 (Const32 <t> [c]) (Add32 (Const32 <t> [d]) x))
1324         // result: (Add32 (Const32 <t> [c+d]) x)
1325         for {
1326                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1327                         if v_0.Op != OpConst32 {
1328                                 continue
1329                         }
1330                         t := v_0.Type
1331                         c := auxIntToInt32(v_0.AuxInt)
1332                         if v_1.Op != OpAdd32 {
1333                                 continue
1334                         }
1335                         _ = v_1.Args[1]
1336                         v_1_0 := v_1.Args[0]
1337                         v_1_1 := v_1.Args[1]
1338                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
1339                                 if v_1_0.Op != OpConst32 || v_1_0.Type != t {
1340                                         continue
1341                                 }
1342                                 d := auxIntToInt32(v_1_0.AuxInt)
1343                                 x := v_1_1
1344                                 v.reset(OpAdd32)
1345                                 v0 := b.NewValue0(v.Pos, OpConst32, t)
1346                                 v0.AuxInt = int32ToAuxInt(c + d)
1347                                 v.AddArg2(v0, x)
1348                                 return true
1349                         }
1350                 }
1351                 break
1352         }
1353         // match: (Add32 (Const32 <t> [c]) (Sub32 (Const32 <t> [d]) x))
1354         // result: (Sub32 (Const32 <t> [c+d]) x)
1355         for {
1356                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1357                         if v_0.Op != OpConst32 {
1358                                 continue
1359                         }
1360                         t := v_0.Type
1361                         c := auxIntToInt32(v_0.AuxInt)
1362                         if v_1.Op != OpSub32 {
1363                                 continue
1364                         }
1365                         x := v_1.Args[1]
1366                         v_1_0 := v_1.Args[0]
1367                         if v_1_0.Op != OpConst32 || v_1_0.Type != t {
1368                                 continue
1369                         }
1370                         d := auxIntToInt32(v_1_0.AuxInt)
1371                         v.reset(OpSub32)
1372                         v0 := b.NewValue0(v.Pos, OpConst32, t)
1373                         v0.AuxInt = int32ToAuxInt(c + d)
1374                         v.AddArg2(v0, x)
1375                         return true
1376                 }
1377                 break
1378         }
1379         // match: (Add32 (Lsh32x64 x z:(Const64 <t> [c])) (Rsh32Ux64 x (Const64 [d])))
1380         // cond: c < 32 && d == 32-c && canRotate(config, 32)
1381         // result: (RotateLeft32 x z)
1382         for {
1383                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1384                         if v_0.Op != OpLsh32x64 {
1385                                 continue
1386                         }
1387                         _ = v_0.Args[1]
1388                         x := v_0.Args[0]
1389                         z := v_0.Args[1]
1390                         if z.Op != OpConst64 {
1391                                 continue
1392                         }
1393                         c := auxIntToInt64(z.AuxInt)
1394                         if v_1.Op != OpRsh32Ux64 {
1395                                 continue
1396                         }
1397                         _ = v_1.Args[1]
1398                         if x != v_1.Args[0] {
1399                                 continue
1400                         }
1401                         v_1_1 := v_1.Args[1]
1402                         if v_1_1.Op != OpConst64 {
1403                                 continue
1404                         }
1405                         d := auxIntToInt64(v_1_1.AuxInt)
1406                         if !(c < 32 && d == 32-c && canRotate(config, 32)) {
1407                                 continue
1408                         }
1409                         v.reset(OpRotateLeft32)
1410                         v.AddArg2(x, z)
1411                         return true
1412                 }
1413                 break
1414         }
1415         // match: (Add32 left:(Lsh32x64 x y) right:(Rsh32Ux64 x (Sub64 (Const64 [32]) y)))
1416         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
1417         // result: (RotateLeft32 x y)
1418         for {
1419                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1420                         left := v_0
1421                         if left.Op != OpLsh32x64 {
1422                                 continue
1423                         }
1424                         y := left.Args[1]
1425                         x := left.Args[0]
1426                         right := v_1
1427                         if right.Op != OpRsh32Ux64 {
1428                                 continue
1429                         }
1430                         _ = right.Args[1]
1431                         if x != right.Args[0] {
1432                                 continue
1433                         }
1434                         right_1 := right.Args[1]
1435                         if right_1.Op != OpSub64 {
1436                                 continue
1437                         }
1438                         _ = right_1.Args[1]
1439                         right_1_0 := right_1.Args[0]
1440                         if right_1_0.Op != OpConst64 || auxIntToInt64(right_1_0.AuxInt) != 32 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
1441                                 continue
1442                         }
1443                         v.reset(OpRotateLeft32)
1444                         v.AddArg2(x, y)
1445                         return true
1446                 }
1447                 break
1448         }
1449         // match: (Add32 left:(Lsh32x32 x y) right:(Rsh32Ux32 x (Sub32 (Const32 [32]) y)))
1450         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
1451         // result: (RotateLeft32 x y)
1452         for {
1453                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1454                         left := v_0
1455                         if left.Op != OpLsh32x32 {
1456                                 continue
1457                         }
1458                         y := left.Args[1]
1459                         x := left.Args[0]
1460                         right := v_1
1461                         if right.Op != OpRsh32Ux32 {
1462                                 continue
1463                         }
1464                         _ = right.Args[1]
1465                         if x != right.Args[0] {
1466                                 continue
1467                         }
1468                         right_1 := right.Args[1]
1469                         if right_1.Op != OpSub32 {
1470                                 continue
1471                         }
1472                         _ = right_1.Args[1]
1473                         right_1_0 := right_1.Args[0]
1474                         if right_1_0.Op != OpConst32 || auxIntToInt32(right_1_0.AuxInt) != 32 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
1475                                 continue
1476                         }
1477                         v.reset(OpRotateLeft32)
1478                         v.AddArg2(x, y)
1479                         return true
1480                 }
1481                 break
1482         }
1483         // match: (Add32 left:(Lsh32x16 x y) right:(Rsh32Ux16 x (Sub16 (Const16 [32]) y)))
1484         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
1485         // result: (RotateLeft32 x y)
1486         for {
1487                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1488                         left := v_0
1489                         if left.Op != OpLsh32x16 {
1490                                 continue
1491                         }
1492                         y := left.Args[1]
1493                         x := left.Args[0]
1494                         right := v_1
1495                         if right.Op != OpRsh32Ux16 {
1496                                 continue
1497                         }
1498                         _ = right.Args[1]
1499                         if x != right.Args[0] {
1500                                 continue
1501                         }
1502                         right_1 := right.Args[1]
1503                         if right_1.Op != OpSub16 {
1504                                 continue
1505                         }
1506                         _ = right_1.Args[1]
1507                         right_1_0 := right_1.Args[0]
1508                         if right_1_0.Op != OpConst16 || auxIntToInt16(right_1_0.AuxInt) != 32 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
1509                                 continue
1510                         }
1511                         v.reset(OpRotateLeft32)
1512                         v.AddArg2(x, y)
1513                         return true
1514                 }
1515                 break
1516         }
1517         // match: (Add32 left:(Lsh32x8 x y) right:(Rsh32Ux8 x (Sub8 (Const8 [32]) y)))
1518         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
1519         // result: (RotateLeft32 x y)
1520         for {
1521                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1522                         left := v_0
1523                         if left.Op != OpLsh32x8 {
1524                                 continue
1525                         }
1526                         y := left.Args[1]
1527                         x := left.Args[0]
1528                         right := v_1
1529                         if right.Op != OpRsh32Ux8 {
1530                                 continue
1531                         }
1532                         _ = right.Args[1]
1533                         if x != right.Args[0] {
1534                                 continue
1535                         }
1536                         right_1 := right.Args[1]
1537                         if right_1.Op != OpSub8 {
1538                                 continue
1539                         }
1540                         _ = right_1.Args[1]
1541                         right_1_0 := right_1.Args[0]
1542                         if right_1_0.Op != OpConst8 || auxIntToInt8(right_1_0.AuxInt) != 32 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
1543                                 continue
1544                         }
1545                         v.reset(OpRotateLeft32)
1546                         v.AddArg2(x, y)
1547                         return true
1548                 }
1549                 break
1550         }
1551         // match: (Add32 right:(Rsh32Ux64 x y) left:(Lsh32x64 x z:(Sub64 (Const64 [32]) y)))
1552         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
1553         // result: (RotateLeft32 x z)
1554         for {
1555                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1556                         right := v_0
1557                         if right.Op != OpRsh32Ux64 {
1558                                 continue
1559                         }
1560                         y := right.Args[1]
1561                         x := right.Args[0]
1562                         left := v_1
1563                         if left.Op != OpLsh32x64 {
1564                                 continue
1565                         }
1566                         _ = left.Args[1]
1567                         if x != left.Args[0] {
1568                                 continue
1569                         }
1570                         z := left.Args[1]
1571                         if z.Op != OpSub64 {
1572                                 continue
1573                         }
1574                         _ = z.Args[1]
1575                         z_0 := z.Args[0]
1576                         if z_0.Op != OpConst64 || auxIntToInt64(z_0.AuxInt) != 32 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
1577                                 continue
1578                         }
1579                         v.reset(OpRotateLeft32)
1580                         v.AddArg2(x, z)
1581                         return true
1582                 }
1583                 break
1584         }
1585         // match: (Add32 right:(Rsh32Ux32 x y) left:(Lsh32x32 x z:(Sub32 (Const32 [32]) y)))
1586         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
1587         // result: (RotateLeft32 x z)
1588         for {
1589                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1590                         right := v_0
1591                         if right.Op != OpRsh32Ux32 {
1592                                 continue
1593                         }
1594                         y := right.Args[1]
1595                         x := right.Args[0]
1596                         left := v_1
1597                         if left.Op != OpLsh32x32 {
1598                                 continue
1599                         }
1600                         _ = left.Args[1]
1601                         if x != left.Args[0] {
1602                                 continue
1603                         }
1604                         z := left.Args[1]
1605                         if z.Op != OpSub32 {
1606                                 continue
1607                         }
1608                         _ = z.Args[1]
1609                         z_0 := z.Args[0]
1610                         if z_0.Op != OpConst32 || auxIntToInt32(z_0.AuxInt) != 32 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
1611                                 continue
1612                         }
1613                         v.reset(OpRotateLeft32)
1614                         v.AddArg2(x, z)
1615                         return true
1616                 }
1617                 break
1618         }
1619         // match: (Add32 right:(Rsh32Ux16 x y) left:(Lsh32x16 x z:(Sub16 (Const16 [32]) y)))
1620         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
1621         // result: (RotateLeft32 x z)
1622         for {
1623                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1624                         right := v_0
1625                         if right.Op != OpRsh32Ux16 {
1626                                 continue
1627                         }
1628                         y := right.Args[1]
1629                         x := right.Args[0]
1630                         left := v_1
1631                         if left.Op != OpLsh32x16 {
1632                                 continue
1633                         }
1634                         _ = left.Args[1]
1635                         if x != left.Args[0] {
1636                                 continue
1637                         }
1638                         z := left.Args[1]
1639                         if z.Op != OpSub16 {
1640                                 continue
1641                         }
1642                         _ = z.Args[1]
1643                         z_0 := z.Args[0]
1644                         if z_0.Op != OpConst16 || auxIntToInt16(z_0.AuxInt) != 32 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
1645                                 continue
1646                         }
1647                         v.reset(OpRotateLeft32)
1648                         v.AddArg2(x, z)
1649                         return true
1650                 }
1651                 break
1652         }
1653         // match: (Add32 right:(Rsh32Ux8 x y) left:(Lsh32x8 x z:(Sub8 (Const8 [32]) y)))
1654         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
1655         // result: (RotateLeft32 x z)
1656         for {
1657                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1658                         right := v_0
1659                         if right.Op != OpRsh32Ux8 {
1660                                 continue
1661                         }
1662                         y := right.Args[1]
1663                         x := right.Args[0]
1664                         left := v_1
1665                         if left.Op != OpLsh32x8 {
1666                                 continue
1667                         }
1668                         _ = left.Args[1]
1669                         if x != left.Args[0] {
1670                                 continue
1671                         }
1672                         z := left.Args[1]
1673                         if z.Op != OpSub8 {
1674                                 continue
1675                         }
1676                         _ = z.Args[1]
1677                         z_0 := z.Args[0]
1678                         if z_0.Op != OpConst8 || auxIntToInt8(z_0.AuxInt) != 32 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
1679                                 continue
1680                         }
1681                         v.reset(OpRotateLeft32)
1682                         v.AddArg2(x, z)
1683                         return true
1684                 }
1685                 break
1686         }
1687         return false
1688 }
1689 func rewriteValuegeneric_OpAdd32F(v *Value) bool {
1690         v_1 := v.Args[1]
1691         v_0 := v.Args[0]
1692         // match: (Add32F (Const32F [c]) (Const32F [d]))
1693         // cond: c+d == c+d
1694         // result: (Const32F [c+d])
1695         for {
1696                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1697                         if v_0.Op != OpConst32F {
1698                                 continue
1699                         }
1700                         c := auxIntToFloat32(v_0.AuxInt)
1701                         if v_1.Op != OpConst32F {
1702                                 continue
1703                         }
1704                         d := auxIntToFloat32(v_1.AuxInt)
1705                         if !(c+d == c+d) {
1706                                 continue
1707                         }
1708                         v.reset(OpConst32F)
1709                         v.AuxInt = float32ToAuxInt(c + d)
1710                         return true
1711                 }
1712                 break
1713         }
1714         return false
1715 }
1716 func rewriteValuegeneric_OpAdd64(v *Value) bool {
1717         v_1 := v.Args[1]
1718         v_0 := v.Args[0]
1719         b := v.Block
1720         config := b.Func.Config
1721         // match: (Add64 (Const64 [c]) (Const64 [d]))
1722         // result: (Const64 [c+d])
1723         for {
1724                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1725                         if v_0.Op != OpConst64 {
1726                                 continue
1727                         }
1728                         c := auxIntToInt64(v_0.AuxInt)
1729                         if v_1.Op != OpConst64 {
1730                                 continue
1731                         }
1732                         d := auxIntToInt64(v_1.AuxInt)
1733                         v.reset(OpConst64)
1734                         v.AuxInt = int64ToAuxInt(c + d)
1735                         return true
1736                 }
1737                 break
1738         }
1739         // match: (Add64 <t> (Mul64 x y) (Mul64 x z))
1740         // result: (Mul64 x (Add64 <t> y z))
1741         for {
1742                 t := v.Type
1743                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1744                         if v_0.Op != OpMul64 {
1745                                 continue
1746                         }
1747                         _ = v_0.Args[1]
1748                         v_0_0 := v_0.Args[0]
1749                         v_0_1 := v_0.Args[1]
1750                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
1751                                 x := v_0_0
1752                                 y := v_0_1
1753                                 if v_1.Op != OpMul64 {
1754                                         continue
1755                                 }
1756                                 _ = v_1.Args[1]
1757                                 v_1_0 := v_1.Args[0]
1758                                 v_1_1 := v_1.Args[1]
1759                                 for _i2 := 0; _i2 <= 1; _i2, v_1_0, v_1_1 = _i2+1, v_1_1, v_1_0 {
1760                                         if x != v_1_0 {
1761                                                 continue
1762                                         }
1763                                         z := v_1_1
1764                                         v.reset(OpMul64)
1765                                         v0 := b.NewValue0(v.Pos, OpAdd64, t)
1766                                         v0.AddArg2(y, z)
1767                                         v.AddArg2(x, v0)
1768                                         return true
1769                                 }
1770                         }
1771                 }
1772                 break
1773         }
1774         // match: (Add64 (Const64 [0]) x)
1775         // result: x
1776         for {
1777                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1778                         if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
1779                                 continue
1780                         }
1781                         x := v_1
1782                         v.copyOf(x)
1783                         return true
1784                 }
1785                 break
1786         }
1787         // match: (Add64 x (Neg64 y))
1788         // result: (Sub64 x y)
1789         for {
1790                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1791                         x := v_0
1792                         if v_1.Op != OpNeg64 {
1793                                 continue
1794                         }
1795                         y := v_1.Args[0]
1796                         v.reset(OpSub64)
1797                         v.AddArg2(x, y)
1798                         return true
1799                 }
1800                 break
1801         }
1802         // match: (Add64 (Com64 x) x)
1803         // result: (Const64 [-1])
1804         for {
1805                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1806                         if v_0.Op != OpCom64 {
1807                                 continue
1808                         }
1809                         x := v_0.Args[0]
1810                         if x != v_1 {
1811                                 continue
1812                         }
1813                         v.reset(OpConst64)
1814                         v.AuxInt = int64ToAuxInt(-1)
1815                         return true
1816                 }
1817                 break
1818         }
1819         // match: (Add64 (Sub64 x t) (Add64 t y))
1820         // result: (Add64 x y)
1821         for {
1822                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1823                         if v_0.Op != OpSub64 {
1824                                 continue
1825                         }
1826                         t := v_0.Args[1]
1827                         x := v_0.Args[0]
1828                         if v_1.Op != OpAdd64 {
1829                                 continue
1830                         }
1831                         _ = v_1.Args[1]
1832                         v_1_0 := v_1.Args[0]
1833                         v_1_1 := v_1.Args[1]
1834                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
1835                                 if t != v_1_0 {
1836                                         continue
1837                                 }
1838                                 y := v_1_1
1839                                 v.reset(OpAdd64)
1840                                 v.AddArg2(x, y)
1841                                 return true
1842                         }
1843                 }
1844                 break
1845         }
1846         // match: (Add64 (Const64 [1]) (Com64 x))
1847         // result: (Neg64 x)
1848         for {
1849                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1850                         if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 1 || v_1.Op != OpCom64 {
1851                                 continue
1852                         }
1853                         x := v_1.Args[0]
1854                         v.reset(OpNeg64)
1855                         v.AddArg(x)
1856                         return true
1857                 }
1858                 break
1859         }
1860         // match: (Add64 x (Sub64 y x))
1861         // result: y
1862         for {
1863                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1864                         x := v_0
1865                         if v_1.Op != OpSub64 {
1866                                 continue
1867                         }
1868                         _ = v_1.Args[1]
1869                         y := v_1.Args[0]
1870                         if x != v_1.Args[1] {
1871                                 continue
1872                         }
1873                         v.copyOf(y)
1874                         return true
1875                 }
1876                 break
1877         }
1878         // match: (Add64 x (Add64 y (Sub64 z x)))
1879         // result: (Add64 y z)
1880         for {
1881                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1882                         x := v_0
1883                         if v_1.Op != OpAdd64 {
1884                                 continue
1885                         }
1886                         _ = v_1.Args[1]
1887                         v_1_0 := v_1.Args[0]
1888                         v_1_1 := v_1.Args[1]
1889                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
1890                                 y := v_1_0
1891                                 if v_1_1.Op != OpSub64 {
1892                                         continue
1893                                 }
1894                                 _ = v_1_1.Args[1]
1895                                 z := v_1_1.Args[0]
1896                                 if x != v_1_1.Args[1] {
1897                                         continue
1898                                 }
1899                                 v.reset(OpAdd64)
1900                                 v.AddArg2(y, z)
1901                                 return true
1902                         }
1903                 }
1904                 break
1905         }
1906         // match: (Add64 (Add64 i:(Const64 <t>) z) x)
1907         // cond: (z.Op != OpConst64 && x.Op != OpConst64)
1908         // result: (Add64 i (Add64 <t> z x))
1909         for {
1910                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1911                         if v_0.Op != OpAdd64 {
1912                                 continue
1913                         }
1914                         _ = v_0.Args[1]
1915                         v_0_0 := v_0.Args[0]
1916                         v_0_1 := v_0.Args[1]
1917                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
1918                                 i := v_0_0
1919                                 if i.Op != OpConst64 {
1920                                         continue
1921                                 }
1922                                 t := i.Type
1923                                 z := v_0_1
1924                                 x := v_1
1925                                 if !(z.Op != OpConst64 && x.Op != OpConst64) {
1926                                         continue
1927                                 }
1928                                 v.reset(OpAdd64)
1929                                 v0 := b.NewValue0(v.Pos, OpAdd64, t)
1930                                 v0.AddArg2(z, x)
1931                                 v.AddArg2(i, v0)
1932                                 return true
1933                         }
1934                 }
1935                 break
1936         }
1937         // match: (Add64 (Sub64 i:(Const64 <t>) z) x)
1938         // cond: (z.Op != OpConst64 && x.Op != OpConst64)
1939         // result: (Add64 i (Sub64 <t> x z))
1940         for {
1941                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1942                         if v_0.Op != OpSub64 {
1943                                 continue
1944                         }
1945                         z := v_0.Args[1]
1946                         i := v_0.Args[0]
1947                         if i.Op != OpConst64 {
1948                                 continue
1949                         }
1950                         t := i.Type
1951                         x := v_1
1952                         if !(z.Op != OpConst64 && x.Op != OpConst64) {
1953                                 continue
1954                         }
1955                         v.reset(OpAdd64)
1956                         v0 := b.NewValue0(v.Pos, OpSub64, t)
1957                         v0.AddArg2(x, z)
1958                         v.AddArg2(i, v0)
1959                         return true
1960                 }
1961                 break
1962         }
1963         // match: (Add64 (Const64 <t> [c]) (Add64 (Const64 <t> [d]) x))
1964         // result: (Add64 (Const64 <t> [c+d]) x)
1965         for {
1966                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1967                         if v_0.Op != OpConst64 {
1968                                 continue
1969                         }
1970                         t := v_0.Type
1971                         c := auxIntToInt64(v_0.AuxInt)
1972                         if v_1.Op != OpAdd64 {
1973                                 continue
1974                         }
1975                         _ = v_1.Args[1]
1976                         v_1_0 := v_1.Args[0]
1977                         v_1_1 := v_1.Args[1]
1978                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
1979                                 if v_1_0.Op != OpConst64 || v_1_0.Type != t {
1980                                         continue
1981                                 }
1982                                 d := auxIntToInt64(v_1_0.AuxInt)
1983                                 x := v_1_1
1984                                 v.reset(OpAdd64)
1985                                 v0 := b.NewValue0(v.Pos, OpConst64, t)
1986                                 v0.AuxInt = int64ToAuxInt(c + d)
1987                                 v.AddArg2(v0, x)
1988                                 return true
1989                         }
1990                 }
1991                 break
1992         }
1993         // match: (Add64 (Const64 <t> [c]) (Sub64 (Const64 <t> [d]) x))
1994         // result: (Sub64 (Const64 <t> [c+d]) x)
1995         for {
1996                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1997                         if v_0.Op != OpConst64 {
1998                                 continue
1999                         }
2000                         t := v_0.Type
2001                         c := auxIntToInt64(v_0.AuxInt)
2002                         if v_1.Op != OpSub64 {
2003                                 continue
2004                         }
2005                         x := v_1.Args[1]
2006                         v_1_0 := v_1.Args[0]
2007                         if v_1_0.Op != OpConst64 || v_1_0.Type != t {
2008                                 continue
2009                         }
2010                         d := auxIntToInt64(v_1_0.AuxInt)
2011                         v.reset(OpSub64)
2012                         v0 := b.NewValue0(v.Pos, OpConst64, t)
2013                         v0.AuxInt = int64ToAuxInt(c + d)
2014                         v.AddArg2(v0, x)
2015                         return true
2016                 }
2017                 break
2018         }
2019         // match: (Add64 (Lsh64x64 x z:(Const64 <t> [c])) (Rsh64Ux64 x (Const64 [d])))
2020         // cond: c < 64 && d == 64-c && canRotate(config, 64)
2021         // result: (RotateLeft64 x z)
2022         for {
2023                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2024                         if v_0.Op != OpLsh64x64 {
2025                                 continue
2026                         }
2027                         _ = v_0.Args[1]
2028                         x := v_0.Args[0]
2029                         z := v_0.Args[1]
2030                         if z.Op != OpConst64 {
2031                                 continue
2032                         }
2033                         c := auxIntToInt64(z.AuxInt)
2034                         if v_1.Op != OpRsh64Ux64 {
2035                                 continue
2036                         }
2037                         _ = v_1.Args[1]
2038                         if x != v_1.Args[0] {
2039                                 continue
2040                         }
2041                         v_1_1 := v_1.Args[1]
2042                         if v_1_1.Op != OpConst64 {
2043                                 continue
2044                         }
2045                         d := auxIntToInt64(v_1_1.AuxInt)
2046                         if !(c < 64 && d == 64-c && canRotate(config, 64)) {
2047                                 continue
2048                         }
2049                         v.reset(OpRotateLeft64)
2050                         v.AddArg2(x, z)
2051                         return true
2052                 }
2053                 break
2054         }
2055         // match: (Add64 left:(Lsh64x64 x y) right:(Rsh64Ux64 x (Sub64 (Const64 [64]) y)))
2056         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
2057         // result: (RotateLeft64 x y)
2058         for {
2059                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2060                         left := v_0
2061                         if left.Op != OpLsh64x64 {
2062                                 continue
2063                         }
2064                         y := left.Args[1]
2065                         x := left.Args[0]
2066                         right := v_1
2067                         if right.Op != OpRsh64Ux64 {
2068                                 continue
2069                         }
2070                         _ = right.Args[1]
2071                         if x != right.Args[0] {
2072                                 continue
2073                         }
2074                         right_1 := right.Args[1]
2075                         if right_1.Op != OpSub64 {
2076                                 continue
2077                         }
2078                         _ = right_1.Args[1]
2079                         right_1_0 := right_1.Args[0]
2080                         if right_1_0.Op != OpConst64 || auxIntToInt64(right_1_0.AuxInt) != 64 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
2081                                 continue
2082                         }
2083                         v.reset(OpRotateLeft64)
2084                         v.AddArg2(x, y)
2085                         return true
2086                 }
2087                 break
2088         }
2089         // match: (Add64 left:(Lsh64x32 x y) right:(Rsh64Ux32 x (Sub32 (Const32 [64]) y)))
2090         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
2091         // result: (RotateLeft64 x y)
2092         for {
2093                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2094                         left := v_0
2095                         if left.Op != OpLsh64x32 {
2096                                 continue
2097                         }
2098                         y := left.Args[1]
2099                         x := left.Args[0]
2100                         right := v_1
2101                         if right.Op != OpRsh64Ux32 {
2102                                 continue
2103                         }
2104                         _ = right.Args[1]
2105                         if x != right.Args[0] {
2106                                 continue
2107                         }
2108                         right_1 := right.Args[1]
2109                         if right_1.Op != OpSub32 {
2110                                 continue
2111                         }
2112                         _ = right_1.Args[1]
2113                         right_1_0 := right_1.Args[0]
2114                         if right_1_0.Op != OpConst32 || auxIntToInt32(right_1_0.AuxInt) != 64 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
2115                                 continue
2116                         }
2117                         v.reset(OpRotateLeft64)
2118                         v.AddArg2(x, y)
2119                         return true
2120                 }
2121                 break
2122         }
2123         // match: (Add64 left:(Lsh64x16 x y) right:(Rsh64Ux16 x (Sub16 (Const16 [64]) y)))
2124         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
2125         // result: (RotateLeft64 x y)
2126         for {
2127                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2128                         left := v_0
2129                         if left.Op != OpLsh64x16 {
2130                                 continue
2131                         }
2132                         y := left.Args[1]
2133                         x := left.Args[0]
2134                         right := v_1
2135                         if right.Op != OpRsh64Ux16 {
2136                                 continue
2137                         }
2138                         _ = right.Args[1]
2139                         if x != right.Args[0] {
2140                                 continue
2141                         }
2142                         right_1 := right.Args[1]
2143                         if right_1.Op != OpSub16 {
2144                                 continue
2145                         }
2146                         _ = right_1.Args[1]
2147                         right_1_0 := right_1.Args[0]
2148                         if right_1_0.Op != OpConst16 || auxIntToInt16(right_1_0.AuxInt) != 64 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
2149                                 continue
2150                         }
2151                         v.reset(OpRotateLeft64)
2152                         v.AddArg2(x, y)
2153                         return true
2154                 }
2155                 break
2156         }
2157         // match: (Add64 left:(Lsh64x8 x y) right:(Rsh64Ux8 x (Sub8 (Const8 [64]) y)))
2158         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
2159         // result: (RotateLeft64 x y)
2160         for {
2161                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2162                         left := v_0
2163                         if left.Op != OpLsh64x8 {
2164                                 continue
2165                         }
2166                         y := left.Args[1]
2167                         x := left.Args[0]
2168                         right := v_1
2169                         if right.Op != OpRsh64Ux8 {
2170                                 continue
2171                         }
2172                         _ = right.Args[1]
2173                         if x != right.Args[0] {
2174                                 continue
2175                         }
2176                         right_1 := right.Args[1]
2177                         if right_1.Op != OpSub8 {
2178                                 continue
2179                         }
2180                         _ = right_1.Args[1]
2181                         right_1_0 := right_1.Args[0]
2182                         if right_1_0.Op != OpConst8 || auxIntToInt8(right_1_0.AuxInt) != 64 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
2183                                 continue
2184                         }
2185                         v.reset(OpRotateLeft64)
2186                         v.AddArg2(x, y)
2187                         return true
2188                 }
2189                 break
2190         }
2191         // match: (Add64 right:(Rsh64Ux64 x y) left:(Lsh64x64 x z:(Sub64 (Const64 [64]) y)))
2192         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
2193         // result: (RotateLeft64 x z)
2194         for {
2195                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2196                         right := v_0
2197                         if right.Op != OpRsh64Ux64 {
2198                                 continue
2199                         }
2200                         y := right.Args[1]
2201                         x := right.Args[0]
2202                         left := v_1
2203                         if left.Op != OpLsh64x64 {
2204                                 continue
2205                         }
2206                         _ = left.Args[1]
2207                         if x != left.Args[0] {
2208                                 continue
2209                         }
2210                         z := left.Args[1]
2211                         if z.Op != OpSub64 {
2212                                 continue
2213                         }
2214                         _ = z.Args[1]
2215                         z_0 := z.Args[0]
2216                         if z_0.Op != OpConst64 || auxIntToInt64(z_0.AuxInt) != 64 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
2217                                 continue
2218                         }
2219                         v.reset(OpRotateLeft64)
2220                         v.AddArg2(x, z)
2221                         return true
2222                 }
2223                 break
2224         }
2225         // match: (Add64 right:(Rsh64Ux32 x y) left:(Lsh64x32 x z:(Sub32 (Const32 [64]) y)))
2226         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
2227         // result: (RotateLeft64 x z)
2228         for {
2229                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2230                         right := v_0
2231                         if right.Op != OpRsh64Ux32 {
2232                                 continue
2233                         }
2234                         y := right.Args[1]
2235                         x := right.Args[0]
2236                         left := v_1
2237                         if left.Op != OpLsh64x32 {
2238                                 continue
2239                         }
2240                         _ = left.Args[1]
2241                         if x != left.Args[0] {
2242                                 continue
2243                         }
2244                         z := left.Args[1]
2245                         if z.Op != OpSub32 {
2246                                 continue
2247                         }
2248                         _ = z.Args[1]
2249                         z_0 := z.Args[0]
2250                         if z_0.Op != OpConst32 || auxIntToInt32(z_0.AuxInt) != 64 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
2251                                 continue
2252                         }
2253                         v.reset(OpRotateLeft64)
2254                         v.AddArg2(x, z)
2255                         return true
2256                 }
2257                 break
2258         }
2259         // match: (Add64 right:(Rsh64Ux16 x y) left:(Lsh64x16 x z:(Sub16 (Const16 [64]) y)))
2260         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
2261         // result: (RotateLeft64 x z)
2262         for {
2263                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2264                         right := v_0
2265                         if right.Op != OpRsh64Ux16 {
2266                                 continue
2267                         }
2268                         y := right.Args[1]
2269                         x := right.Args[0]
2270                         left := v_1
2271                         if left.Op != OpLsh64x16 {
2272                                 continue
2273                         }
2274                         _ = left.Args[1]
2275                         if x != left.Args[0] {
2276                                 continue
2277                         }
2278                         z := left.Args[1]
2279                         if z.Op != OpSub16 {
2280                                 continue
2281                         }
2282                         _ = z.Args[1]
2283                         z_0 := z.Args[0]
2284                         if z_0.Op != OpConst16 || auxIntToInt16(z_0.AuxInt) != 64 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
2285                                 continue
2286                         }
2287                         v.reset(OpRotateLeft64)
2288                         v.AddArg2(x, z)
2289                         return true
2290                 }
2291                 break
2292         }
2293         // match: (Add64 right:(Rsh64Ux8 x y) left:(Lsh64x8 x z:(Sub8 (Const8 [64]) y)))
2294         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
2295         // result: (RotateLeft64 x z)
2296         for {
2297                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2298                         right := v_0
2299                         if right.Op != OpRsh64Ux8 {
2300                                 continue
2301                         }
2302                         y := right.Args[1]
2303                         x := right.Args[0]
2304                         left := v_1
2305                         if left.Op != OpLsh64x8 {
2306                                 continue
2307                         }
2308                         _ = left.Args[1]
2309                         if x != left.Args[0] {
2310                                 continue
2311                         }
2312                         z := left.Args[1]
2313                         if z.Op != OpSub8 {
2314                                 continue
2315                         }
2316                         _ = z.Args[1]
2317                         z_0 := z.Args[0]
2318                         if z_0.Op != OpConst8 || auxIntToInt8(z_0.AuxInt) != 64 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
2319                                 continue
2320                         }
2321                         v.reset(OpRotateLeft64)
2322                         v.AddArg2(x, z)
2323                         return true
2324                 }
2325                 break
2326         }
2327         return false
2328 }
2329 func rewriteValuegeneric_OpAdd64F(v *Value) bool {
2330         v_1 := v.Args[1]
2331         v_0 := v.Args[0]
2332         // match: (Add64F (Const64F [c]) (Const64F [d]))
2333         // cond: c+d == c+d
2334         // result: (Const64F [c+d])
2335         for {
2336                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2337                         if v_0.Op != OpConst64F {
2338                                 continue
2339                         }
2340                         c := auxIntToFloat64(v_0.AuxInt)
2341                         if v_1.Op != OpConst64F {
2342                                 continue
2343                         }
2344                         d := auxIntToFloat64(v_1.AuxInt)
2345                         if !(c+d == c+d) {
2346                                 continue
2347                         }
2348                         v.reset(OpConst64F)
2349                         v.AuxInt = float64ToAuxInt(c + d)
2350                         return true
2351                 }
2352                 break
2353         }
2354         return false
2355 }
2356 func rewriteValuegeneric_OpAdd8(v *Value) bool {
2357         v_1 := v.Args[1]
2358         v_0 := v.Args[0]
2359         b := v.Block
2360         config := b.Func.Config
2361         // match: (Add8 (Const8 [c]) (Const8 [d]))
2362         // result: (Const8 [c+d])
2363         for {
2364                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2365                         if v_0.Op != OpConst8 {
2366                                 continue
2367                         }
2368                         c := auxIntToInt8(v_0.AuxInt)
2369                         if v_1.Op != OpConst8 {
2370                                 continue
2371                         }
2372                         d := auxIntToInt8(v_1.AuxInt)
2373                         v.reset(OpConst8)
2374                         v.AuxInt = int8ToAuxInt(c + d)
2375                         return true
2376                 }
2377                 break
2378         }
2379         // match: (Add8 <t> (Mul8 x y) (Mul8 x z))
2380         // result: (Mul8 x (Add8 <t> y z))
2381         for {
2382                 t := v.Type
2383                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2384                         if v_0.Op != OpMul8 {
2385                                 continue
2386                         }
2387                         _ = v_0.Args[1]
2388                         v_0_0 := v_0.Args[0]
2389                         v_0_1 := v_0.Args[1]
2390                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
2391                                 x := v_0_0
2392                                 y := v_0_1
2393                                 if v_1.Op != OpMul8 {
2394                                         continue
2395                                 }
2396                                 _ = v_1.Args[1]
2397                                 v_1_0 := v_1.Args[0]
2398                                 v_1_1 := v_1.Args[1]
2399                                 for _i2 := 0; _i2 <= 1; _i2, v_1_0, v_1_1 = _i2+1, v_1_1, v_1_0 {
2400                                         if x != v_1_0 {
2401                                                 continue
2402                                         }
2403                                         z := v_1_1
2404                                         v.reset(OpMul8)
2405                                         v0 := b.NewValue0(v.Pos, OpAdd8, t)
2406                                         v0.AddArg2(y, z)
2407                                         v.AddArg2(x, v0)
2408                                         return true
2409                                 }
2410                         }
2411                 }
2412                 break
2413         }
2414         // match: (Add8 (Const8 [0]) x)
2415         // result: x
2416         for {
2417                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2418                         if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
2419                                 continue
2420                         }
2421                         x := v_1
2422                         v.copyOf(x)
2423                         return true
2424                 }
2425                 break
2426         }
2427         // match: (Add8 x (Neg8 y))
2428         // result: (Sub8 x y)
2429         for {
2430                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2431                         x := v_0
2432                         if v_1.Op != OpNeg8 {
2433                                 continue
2434                         }
2435                         y := v_1.Args[0]
2436                         v.reset(OpSub8)
2437                         v.AddArg2(x, y)
2438                         return true
2439                 }
2440                 break
2441         }
2442         // match: (Add8 (Com8 x) x)
2443         // result: (Const8 [-1])
2444         for {
2445                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2446                         if v_0.Op != OpCom8 {
2447                                 continue
2448                         }
2449                         x := v_0.Args[0]
2450                         if x != v_1 {
2451                                 continue
2452                         }
2453                         v.reset(OpConst8)
2454                         v.AuxInt = int8ToAuxInt(-1)
2455                         return true
2456                 }
2457                 break
2458         }
2459         // match: (Add8 (Sub8 x t) (Add8 t y))
2460         // result: (Add8 x y)
2461         for {
2462                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2463                         if v_0.Op != OpSub8 {
2464                                 continue
2465                         }
2466                         t := v_0.Args[1]
2467                         x := v_0.Args[0]
2468                         if v_1.Op != OpAdd8 {
2469                                 continue
2470                         }
2471                         _ = v_1.Args[1]
2472                         v_1_0 := v_1.Args[0]
2473                         v_1_1 := v_1.Args[1]
2474                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
2475                                 if t != v_1_0 {
2476                                         continue
2477                                 }
2478                                 y := v_1_1
2479                                 v.reset(OpAdd8)
2480                                 v.AddArg2(x, y)
2481                                 return true
2482                         }
2483                 }
2484                 break
2485         }
2486         // match: (Add8 (Const8 [1]) (Com8 x))
2487         // result: (Neg8 x)
2488         for {
2489                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2490                         if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 1 || v_1.Op != OpCom8 {
2491                                 continue
2492                         }
2493                         x := v_1.Args[0]
2494                         v.reset(OpNeg8)
2495                         v.AddArg(x)
2496                         return true
2497                 }
2498                 break
2499         }
2500         // match: (Add8 x (Sub8 y x))
2501         // result: y
2502         for {
2503                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2504                         x := v_0
2505                         if v_1.Op != OpSub8 {
2506                                 continue
2507                         }
2508                         _ = v_1.Args[1]
2509                         y := v_1.Args[0]
2510                         if x != v_1.Args[1] {
2511                                 continue
2512                         }
2513                         v.copyOf(y)
2514                         return true
2515                 }
2516                 break
2517         }
2518         // match: (Add8 x (Add8 y (Sub8 z x)))
2519         // result: (Add8 y z)
2520         for {
2521                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2522                         x := v_0
2523                         if v_1.Op != OpAdd8 {
2524                                 continue
2525                         }
2526                         _ = v_1.Args[1]
2527                         v_1_0 := v_1.Args[0]
2528                         v_1_1 := v_1.Args[1]
2529                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
2530                                 y := v_1_0
2531                                 if v_1_1.Op != OpSub8 {
2532                                         continue
2533                                 }
2534                                 _ = v_1_1.Args[1]
2535                                 z := v_1_1.Args[0]
2536                                 if x != v_1_1.Args[1] {
2537                                         continue
2538                                 }
2539                                 v.reset(OpAdd8)
2540                                 v.AddArg2(y, z)
2541                                 return true
2542                         }
2543                 }
2544                 break
2545         }
2546         // match: (Add8 (Add8 i:(Const8 <t>) z) x)
2547         // cond: (z.Op != OpConst8 && x.Op != OpConst8)
2548         // result: (Add8 i (Add8 <t> z x))
2549         for {
2550                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2551                         if v_0.Op != OpAdd8 {
2552                                 continue
2553                         }
2554                         _ = v_0.Args[1]
2555                         v_0_0 := v_0.Args[0]
2556                         v_0_1 := v_0.Args[1]
2557                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
2558                                 i := v_0_0
2559                                 if i.Op != OpConst8 {
2560                                         continue
2561                                 }
2562                                 t := i.Type
2563                                 z := v_0_1
2564                                 x := v_1
2565                                 if !(z.Op != OpConst8 && x.Op != OpConst8) {
2566                                         continue
2567                                 }
2568                                 v.reset(OpAdd8)
2569                                 v0 := b.NewValue0(v.Pos, OpAdd8, t)
2570                                 v0.AddArg2(z, x)
2571                                 v.AddArg2(i, v0)
2572                                 return true
2573                         }
2574                 }
2575                 break
2576         }
2577         // match: (Add8 (Sub8 i:(Const8 <t>) z) x)
2578         // cond: (z.Op != OpConst8 && x.Op != OpConst8)
2579         // result: (Add8 i (Sub8 <t> x z))
2580         for {
2581                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2582                         if v_0.Op != OpSub8 {
2583                                 continue
2584                         }
2585                         z := v_0.Args[1]
2586                         i := v_0.Args[0]
2587                         if i.Op != OpConst8 {
2588                                 continue
2589                         }
2590                         t := i.Type
2591                         x := v_1
2592                         if !(z.Op != OpConst8 && x.Op != OpConst8) {
2593                                 continue
2594                         }
2595                         v.reset(OpAdd8)
2596                         v0 := b.NewValue0(v.Pos, OpSub8, t)
2597                         v0.AddArg2(x, z)
2598                         v.AddArg2(i, v0)
2599                         return true
2600                 }
2601                 break
2602         }
2603         // match: (Add8 (Const8 <t> [c]) (Add8 (Const8 <t> [d]) x))
2604         // result: (Add8 (Const8 <t> [c+d]) x)
2605         for {
2606                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2607                         if v_0.Op != OpConst8 {
2608                                 continue
2609                         }
2610                         t := v_0.Type
2611                         c := auxIntToInt8(v_0.AuxInt)
2612                         if v_1.Op != OpAdd8 {
2613                                 continue
2614                         }
2615                         _ = v_1.Args[1]
2616                         v_1_0 := v_1.Args[0]
2617                         v_1_1 := v_1.Args[1]
2618                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
2619                                 if v_1_0.Op != OpConst8 || v_1_0.Type != t {
2620                                         continue
2621                                 }
2622                                 d := auxIntToInt8(v_1_0.AuxInt)
2623                                 x := v_1_1
2624                                 v.reset(OpAdd8)
2625                                 v0 := b.NewValue0(v.Pos, OpConst8, t)
2626                                 v0.AuxInt = int8ToAuxInt(c + d)
2627                                 v.AddArg2(v0, x)
2628                                 return true
2629                         }
2630                 }
2631                 break
2632         }
2633         // match: (Add8 (Const8 <t> [c]) (Sub8 (Const8 <t> [d]) x))
2634         // result: (Sub8 (Const8 <t> [c+d]) x)
2635         for {
2636                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2637                         if v_0.Op != OpConst8 {
2638                                 continue
2639                         }
2640                         t := v_0.Type
2641                         c := auxIntToInt8(v_0.AuxInt)
2642                         if v_1.Op != OpSub8 {
2643                                 continue
2644                         }
2645                         x := v_1.Args[1]
2646                         v_1_0 := v_1.Args[0]
2647                         if v_1_0.Op != OpConst8 || v_1_0.Type != t {
2648                                 continue
2649                         }
2650                         d := auxIntToInt8(v_1_0.AuxInt)
2651                         v.reset(OpSub8)
2652                         v0 := b.NewValue0(v.Pos, OpConst8, t)
2653                         v0.AuxInt = int8ToAuxInt(c + d)
2654                         v.AddArg2(v0, x)
2655                         return true
2656                 }
2657                 break
2658         }
2659         // match: (Add8 (Lsh8x64 x z:(Const64 <t> [c])) (Rsh8Ux64 x (Const64 [d])))
2660         // cond: c < 8 && d == 8-c && canRotate(config, 8)
2661         // result: (RotateLeft8 x z)
2662         for {
2663                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2664                         if v_0.Op != OpLsh8x64 {
2665                                 continue
2666                         }
2667                         _ = v_0.Args[1]
2668                         x := v_0.Args[0]
2669                         z := v_0.Args[1]
2670                         if z.Op != OpConst64 {
2671                                 continue
2672                         }
2673                         c := auxIntToInt64(z.AuxInt)
2674                         if v_1.Op != OpRsh8Ux64 {
2675                                 continue
2676                         }
2677                         _ = v_1.Args[1]
2678                         if x != v_1.Args[0] {
2679                                 continue
2680                         }
2681                         v_1_1 := v_1.Args[1]
2682                         if v_1_1.Op != OpConst64 {
2683                                 continue
2684                         }
2685                         d := auxIntToInt64(v_1_1.AuxInt)
2686                         if !(c < 8 && d == 8-c && canRotate(config, 8)) {
2687                                 continue
2688                         }
2689                         v.reset(OpRotateLeft8)
2690                         v.AddArg2(x, z)
2691                         return true
2692                 }
2693                 break
2694         }
2695         // match: (Add8 left:(Lsh8x64 x y) right:(Rsh8Ux64 x (Sub64 (Const64 [8]) y)))
2696         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
2697         // result: (RotateLeft8 x y)
2698         for {
2699                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2700                         left := v_0
2701                         if left.Op != OpLsh8x64 {
2702                                 continue
2703                         }
2704                         y := left.Args[1]
2705                         x := left.Args[0]
2706                         right := v_1
2707                         if right.Op != OpRsh8Ux64 {
2708                                 continue
2709                         }
2710                         _ = right.Args[1]
2711                         if x != right.Args[0] {
2712                                 continue
2713                         }
2714                         right_1 := right.Args[1]
2715                         if right_1.Op != OpSub64 {
2716                                 continue
2717                         }
2718                         _ = right_1.Args[1]
2719                         right_1_0 := right_1.Args[0]
2720                         if right_1_0.Op != OpConst64 || auxIntToInt64(right_1_0.AuxInt) != 8 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
2721                                 continue
2722                         }
2723                         v.reset(OpRotateLeft8)
2724                         v.AddArg2(x, y)
2725                         return true
2726                 }
2727                 break
2728         }
2729         // match: (Add8 left:(Lsh8x32 x y) right:(Rsh8Ux32 x (Sub32 (Const32 [8]) y)))
2730         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
2731         // result: (RotateLeft8 x y)
2732         for {
2733                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2734                         left := v_0
2735                         if left.Op != OpLsh8x32 {
2736                                 continue
2737                         }
2738                         y := left.Args[1]
2739                         x := left.Args[0]
2740                         right := v_1
2741                         if right.Op != OpRsh8Ux32 {
2742                                 continue
2743                         }
2744                         _ = right.Args[1]
2745                         if x != right.Args[0] {
2746                                 continue
2747                         }
2748                         right_1 := right.Args[1]
2749                         if right_1.Op != OpSub32 {
2750                                 continue
2751                         }
2752                         _ = right_1.Args[1]
2753                         right_1_0 := right_1.Args[0]
2754                         if right_1_0.Op != OpConst32 || auxIntToInt32(right_1_0.AuxInt) != 8 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
2755                                 continue
2756                         }
2757                         v.reset(OpRotateLeft8)
2758                         v.AddArg2(x, y)
2759                         return true
2760                 }
2761                 break
2762         }
2763         // match: (Add8 left:(Lsh8x16 x y) right:(Rsh8Ux16 x (Sub16 (Const16 [8]) y)))
2764         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
2765         // result: (RotateLeft8 x y)
2766         for {
2767                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2768                         left := v_0
2769                         if left.Op != OpLsh8x16 {
2770                                 continue
2771                         }
2772                         y := left.Args[1]
2773                         x := left.Args[0]
2774                         right := v_1
2775                         if right.Op != OpRsh8Ux16 {
2776                                 continue
2777                         }
2778                         _ = right.Args[1]
2779                         if x != right.Args[0] {
2780                                 continue
2781                         }
2782                         right_1 := right.Args[1]
2783                         if right_1.Op != OpSub16 {
2784                                 continue
2785                         }
2786                         _ = right_1.Args[1]
2787                         right_1_0 := right_1.Args[0]
2788                         if right_1_0.Op != OpConst16 || auxIntToInt16(right_1_0.AuxInt) != 8 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
2789                                 continue
2790                         }
2791                         v.reset(OpRotateLeft8)
2792                         v.AddArg2(x, y)
2793                         return true
2794                 }
2795                 break
2796         }
2797         // match: (Add8 left:(Lsh8x8 x y) right:(Rsh8Ux8 x (Sub8 (Const8 [8]) y)))
2798         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
2799         // result: (RotateLeft8 x y)
2800         for {
2801                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2802                         left := v_0
2803                         if left.Op != OpLsh8x8 {
2804                                 continue
2805                         }
2806                         y := left.Args[1]
2807                         x := left.Args[0]
2808                         right := v_1
2809                         if right.Op != OpRsh8Ux8 {
2810                                 continue
2811                         }
2812                         _ = right.Args[1]
2813                         if x != right.Args[0] {
2814                                 continue
2815                         }
2816                         right_1 := right.Args[1]
2817                         if right_1.Op != OpSub8 {
2818                                 continue
2819                         }
2820                         _ = right_1.Args[1]
2821                         right_1_0 := right_1.Args[0]
2822                         if right_1_0.Op != OpConst8 || auxIntToInt8(right_1_0.AuxInt) != 8 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
2823                                 continue
2824                         }
2825                         v.reset(OpRotateLeft8)
2826                         v.AddArg2(x, y)
2827                         return true
2828                 }
2829                 break
2830         }
2831         // match: (Add8 right:(Rsh8Ux64 x y) left:(Lsh8x64 x z:(Sub64 (Const64 [8]) y)))
2832         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
2833         // result: (RotateLeft8 x z)
2834         for {
2835                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2836                         right := v_0
2837                         if right.Op != OpRsh8Ux64 {
2838                                 continue
2839                         }
2840                         y := right.Args[1]
2841                         x := right.Args[0]
2842                         left := v_1
2843                         if left.Op != OpLsh8x64 {
2844                                 continue
2845                         }
2846                         _ = left.Args[1]
2847                         if x != left.Args[0] {
2848                                 continue
2849                         }
2850                         z := left.Args[1]
2851                         if z.Op != OpSub64 {
2852                                 continue
2853                         }
2854                         _ = z.Args[1]
2855                         z_0 := z.Args[0]
2856                         if z_0.Op != OpConst64 || auxIntToInt64(z_0.AuxInt) != 8 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
2857                                 continue
2858                         }
2859                         v.reset(OpRotateLeft8)
2860                         v.AddArg2(x, z)
2861                         return true
2862                 }
2863                 break
2864         }
2865         // match: (Add8 right:(Rsh8Ux32 x y) left:(Lsh8x32 x z:(Sub32 (Const32 [8]) y)))
2866         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
2867         // result: (RotateLeft8 x z)
2868         for {
2869                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2870                         right := v_0
2871                         if right.Op != OpRsh8Ux32 {
2872                                 continue
2873                         }
2874                         y := right.Args[1]
2875                         x := right.Args[0]
2876                         left := v_1
2877                         if left.Op != OpLsh8x32 {
2878                                 continue
2879                         }
2880                         _ = left.Args[1]
2881                         if x != left.Args[0] {
2882                                 continue
2883                         }
2884                         z := left.Args[1]
2885                         if z.Op != OpSub32 {
2886                                 continue
2887                         }
2888                         _ = z.Args[1]
2889                         z_0 := z.Args[0]
2890                         if z_0.Op != OpConst32 || auxIntToInt32(z_0.AuxInt) != 8 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
2891                                 continue
2892                         }
2893                         v.reset(OpRotateLeft8)
2894                         v.AddArg2(x, z)
2895                         return true
2896                 }
2897                 break
2898         }
2899         // match: (Add8 right:(Rsh8Ux16 x y) left:(Lsh8x16 x z:(Sub16 (Const16 [8]) y)))
2900         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
2901         // result: (RotateLeft8 x z)
2902         for {
2903                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2904                         right := v_0
2905                         if right.Op != OpRsh8Ux16 {
2906                                 continue
2907                         }
2908                         y := right.Args[1]
2909                         x := right.Args[0]
2910                         left := v_1
2911                         if left.Op != OpLsh8x16 {
2912                                 continue
2913                         }
2914                         _ = left.Args[1]
2915                         if x != left.Args[0] {
2916                                 continue
2917                         }
2918                         z := left.Args[1]
2919                         if z.Op != OpSub16 {
2920                                 continue
2921                         }
2922                         _ = z.Args[1]
2923                         z_0 := z.Args[0]
2924                         if z_0.Op != OpConst16 || auxIntToInt16(z_0.AuxInt) != 8 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
2925                                 continue
2926                         }
2927                         v.reset(OpRotateLeft8)
2928                         v.AddArg2(x, z)
2929                         return true
2930                 }
2931                 break
2932         }
2933         // match: (Add8 right:(Rsh8Ux8 x y) left:(Lsh8x8 x z:(Sub8 (Const8 [8]) y)))
2934         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
2935         // result: (RotateLeft8 x z)
2936         for {
2937                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2938                         right := v_0
2939                         if right.Op != OpRsh8Ux8 {
2940                                 continue
2941                         }
2942                         y := right.Args[1]
2943                         x := right.Args[0]
2944                         left := v_1
2945                         if left.Op != OpLsh8x8 {
2946                                 continue
2947                         }
2948                         _ = left.Args[1]
2949                         if x != left.Args[0] {
2950                                 continue
2951                         }
2952                         z := left.Args[1]
2953                         if z.Op != OpSub8 {
2954                                 continue
2955                         }
2956                         _ = z.Args[1]
2957                         z_0 := z.Args[0]
2958                         if z_0.Op != OpConst8 || auxIntToInt8(z_0.AuxInt) != 8 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
2959                                 continue
2960                         }
2961                         v.reset(OpRotateLeft8)
2962                         v.AddArg2(x, z)
2963                         return true
2964                 }
2965                 break
2966         }
2967         return false
2968 }
2969 func rewriteValuegeneric_OpAddPtr(v *Value) bool {
2970         v_1 := v.Args[1]
2971         v_0 := v.Args[0]
2972         // match: (AddPtr <t> x (Const64 [c]))
2973         // result: (OffPtr <t> x [c])
2974         for {
2975                 t := v.Type
2976                 x := v_0
2977                 if v_1.Op != OpConst64 {
2978                         break
2979                 }
2980                 c := auxIntToInt64(v_1.AuxInt)
2981                 v.reset(OpOffPtr)
2982                 v.Type = t
2983                 v.AuxInt = int64ToAuxInt(c)
2984                 v.AddArg(x)
2985                 return true
2986         }
2987         // match: (AddPtr <t> x (Const32 [c]))
2988         // result: (OffPtr <t> x [int64(c)])
2989         for {
2990                 t := v.Type
2991                 x := v_0
2992                 if v_1.Op != OpConst32 {
2993                         break
2994                 }
2995                 c := auxIntToInt32(v_1.AuxInt)
2996                 v.reset(OpOffPtr)
2997                 v.Type = t
2998                 v.AuxInt = int64ToAuxInt(int64(c))
2999                 v.AddArg(x)
3000                 return true
3001         }
3002         return false
3003 }
3004 func rewriteValuegeneric_OpAnd16(v *Value) bool {
3005         v_1 := v.Args[1]
3006         v_0 := v.Args[0]
3007         b := v.Block
3008         // match: (And16 (Const16 [c]) (Const16 [d]))
3009         // result: (Const16 [c&d])
3010         for {
3011                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3012                         if v_0.Op != OpConst16 {
3013                                 continue
3014                         }
3015                         c := auxIntToInt16(v_0.AuxInt)
3016                         if v_1.Op != OpConst16 {
3017                                 continue
3018                         }
3019                         d := auxIntToInt16(v_1.AuxInt)
3020                         v.reset(OpConst16)
3021                         v.AuxInt = int16ToAuxInt(c & d)
3022                         return true
3023                 }
3024                 break
3025         }
3026         // match: (And16 <t> (Com16 x) (Com16 y))
3027         // result: (Com16 (Or16 <t> x y))
3028         for {
3029                 t := v.Type
3030                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3031                         if v_0.Op != OpCom16 {
3032                                 continue
3033                         }
3034                         x := v_0.Args[0]
3035                         if v_1.Op != OpCom16 {
3036                                 continue
3037                         }
3038                         y := v_1.Args[0]
3039                         v.reset(OpCom16)
3040                         v0 := b.NewValue0(v.Pos, OpOr16, t)
3041                         v0.AddArg2(x, y)
3042                         v.AddArg(v0)
3043                         return true
3044                 }
3045                 break
3046         }
3047         // match: (And16 (Const16 [m]) (Rsh16Ux64 _ (Const64 [c])))
3048         // cond: c >= int64(16-ntz16(m))
3049         // result: (Const16 [0])
3050         for {
3051                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3052                         if v_0.Op != OpConst16 {
3053                                 continue
3054                         }
3055                         m := auxIntToInt16(v_0.AuxInt)
3056                         if v_1.Op != OpRsh16Ux64 {
3057                                 continue
3058                         }
3059                         _ = v_1.Args[1]
3060                         v_1_1 := v_1.Args[1]
3061                         if v_1_1.Op != OpConst64 {
3062                                 continue
3063                         }
3064                         c := auxIntToInt64(v_1_1.AuxInt)
3065                         if !(c >= int64(16-ntz16(m))) {
3066                                 continue
3067                         }
3068                         v.reset(OpConst16)
3069                         v.AuxInt = int16ToAuxInt(0)
3070                         return true
3071                 }
3072                 break
3073         }
3074         // match: (And16 (Const16 [m]) (Lsh16x64 _ (Const64 [c])))
3075         // cond: c >= int64(16-nlz16(m))
3076         // result: (Const16 [0])
3077         for {
3078                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3079                         if v_0.Op != OpConst16 {
3080                                 continue
3081                         }
3082                         m := auxIntToInt16(v_0.AuxInt)
3083                         if v_1.Op != OpLsh16x64 {
3084                                 continue
3085                         }
3086                         _ = v_1.Args[1]
3087                         v_1_1 := v_1.Args[1]
3088                         if v_1_1.Op != OpConst64 {
3089                                 continue
3090                         }
3091                         c := auxIntToInt64(v_1_1.AuxInt)
3092                         if !(c >= int64(16-nlz16(m))) {
3093                                 continue
3094                         }
3095                         v.reset(OpConst16)
3096                         v.AuxInt = int16ToAuxInt(0)
3097                         return true
3098                 }
3099                 break
3100         }
3101         // match: (And16 x x)
3102         // result: x
3103         for {
3104                 x := v_0
3105                 if x != v_1 {
3106                         break
3107                 }
3108                 v.copyOf(x)
3109                 return true
3110         }
3111         // match: (And16 (Const16 [-1]) x)
3112         // result: x
3113         for {
3114                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3115                         if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != -1 {
3116                                 continue
3117                         }
3118                         x := v_1
3119                         v.copyOf(x)
3120                         return true
3121                 }
3122                 break
3123         }
3124         // match: (And16 (Const16 [0]) _)
3125         // result: (Const16 [0])
3126         for {
3127                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3128                         if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
3129                                 continue
3130                         }
3131                         v.reset(OpConst16)
3132                         v.AuxInt = int16ToAuxInt(0)
3133                         return true
3134                 }
3135                 break
3136         }
3137         // match: (And16 (Com16 x) x)
3138         // result: (Const16 [0])
3139         for {
3140                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3141                         if v_0.Op != OpCom16 {
3142                                 continue
3143                         }
3144                         x := v_0.Args[0]
3145                         if x != v_1 {
3146                                 continue
3147                         }
3148                         v.reset(OpConst16)
3149                         v.AuxInt = int16ToAuxInt(0)
3150                         return true
3151                 }
3152                 break
3153         }
3154         // match: (And16 x (And16 x y))
3155         // result: (And16 x y)
3156         for {
3157                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3158                         x := v_0
3159                         if v_1.Op != OpAnd16 {
3160                                 continue
3161                         }
3162                         _ = v_1.Args[1]
3163                         v_1_0 := v_1.Args[0]
3164                         v_1_1 := v_1.Args[1]
3165                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
3166                                 if x != v_1_0 {
3167                                         continue
3168                                 }
3169                                 y := v_1_1
3170                                 v.reset(OpAnd16)
3171                                 v.AddArg2(x, y)
3172                                 return true
3173                         }
3174                 }
3175                 break
3176         }
3177         // match: (And16 (And16 i:(Const16 <t>) z) x)
3178         // cond: (z.Op != OpConst16 && x.Op != OpConst16)
3179         // result: (And16 i (And16 <t> z x))
3180         for {
3181                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3182                         if v_0.Op != OpAnd16 {
3183                                 continue
3184                         }
3185                         _ = v_0.Args[1]
3186                         v_0_0 := v_0.Args[0]
3187                         v_0_1 := v_0.Args[1]
3188                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
3189                                 i := v_0_0
3190                                 if i.Op != OpConst16 {
3191                                         continue
3192                                 }
3193                                 t := i.Type
3194                                 z := v_0_1
3195                                 x := v_1
3196                                 if !(z.Op != OpConst16 && x.Op != OpConst16) {
3197                                         continue
3198                                 }
3199                                 v.reset(OpAnd16)
3200                                 v0 := b.NewValue0(v.Pos, OpAnd16, t)
3201                                 v0.AddArg2(z, x)
3202                                 v.AddArg2(i, v0)
3203                                 return true
3204                         }
3205                 }
3206                 break
3207         }
3208         // match: (And16 (Const16 <t> [c]) (And16 (Const16 <t> [d]) x))
3209         // result: (And16 (Const16 <t> [c&d]) x)
3210         for {
3211                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3212                         if v_0.Op != OpConst16 {
3213                                 continue
3214                         }
3215                         t := v_0.Type
3216                         c := auxIntToInt16(v_0.AuxInt)
3217                         if v_1.Op != OpAnd16 {
3218                                 continue
3219                         }
3220                         _ = v_1.Args[1]
3221                         v_1_0 := v_1.Args[0]
3222                         v_1_1 := v_1.Args[1]
3223                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
3224                                 if v_1_0.Op != OpConst16 || v_1_0.Type != t {
3225                                         continue
3226                                 }
3227                                 d := auxIntToInt16(v_1_0.AuxInt)
3228                                 x := v_1_1
3229                                 v.reset(OpAnd16)
3230                                 v0 := b.NewValue0(v.Pos, OpConst16, t)
3231                                 v0.AuxInt = int16ToAuxInt(c & d)
3232                                 v.AddArg2(v0, x)
3233                                 return true
3234                         }
3235                 }
3236                 break
3237         }
3238         return false
3239 }
3240 func rewriteValuegeneric_OpAnd32(v *Value) bool {
3241         v_1 := v.Args[1]
3242         v_0 := v.Args[0]
3243         b := v.Block
3244         // match: (And32 (Const32 [c]) (Const32 [d]))
3245         // result: (Const32 [c&d])
3246         for {
3247                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3248                         if v_0.Op != OpConst32 {
3249                                 continue
3250                         }
3251                         c := auxIntToInt32(v_0.AuxInt)
3252                         if v_1.Op != OpConst32 {
3253                                 continue
3254                         }
3255                         d := auxIntToInt32(v_1.AuxInt)
3256                         v.reset(OpConst32)
3257                         v.AuxInt = int32ToAuxInt(c & d)
3258                         return true
3259                 }
3260                 break
3261         }
3262         // match: (And32 <t> (Com32 x) (Com32 y))
3263         // result: (Com32 (Or32 <t> x y))
3264         for {
3265                 t := v.Type
3266                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3267                         if v_0.Op != OpCom32 {
3268                                 continue
3269                         }
3270                         x := v_0.Args[0]
3271                         if v_1.Op != OpCom32 {
3272                                 continue
3273                         }
3274                         y := v_1.Args[0]
3275                         v.reset(OpCom32)
3276                         v0 := b.NewValue0(v.Pos, OpOr32, t)
3277                         v0.AddArg2(x, y)
3278                         v.AddArg(v0)
3279                         return true
3280                 }
3281                 break
3282         }
3283         // match: (And32 (Const32 [m]) (Rsh32Ux64 _ (Const64 [c])))
3284         // cond: c >= int64(32-ntz32(m))
3285         // result: (Const32 [0])
3286         for {
3287                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3288                         if v_0.Op != OpConst32 {
3289                                 continue
3290                         }
3291                         m := auxIntToInt32(v_0.AuxInt)
3292                         if v_1.Op != OpRsh32Ux64 {
3293                                 continue
3294                         }
3295                         _ = v_1.Args[1]
3296                         v_1_1 := v_1.Args[1]
3297                         if v_1_1.Op != OpConst64 {
3298                                 continue
3299                         }
3300                         c := auxIntToInt64(v_1_1.AuxInt)
3301                         if !(c >= int64(32-ntz32(m))) {
3302                                 continue
3303                         }
3304                         v.reset(OpConst32)
3305                         v.AuxInt = int32ToAuxInt(0)
3306                         return true
3307                 }
3308                 break
3309         }
3310         // match: (And32 (Const32 [m]) (Lsh32x64 _ (Const64 [c])))
3311         // cond: c >= int64(32-nlz32(m))
3312         // result: (Const32 [0])
3313         for {
3314                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3315                         if v_0.Op != OpConst32 {
3316                                 continue
3317                         }
3318                         m := auxIntToInt32(v_0.AuxInt)
3319                         if v_1.Op != OpLsh32x64 {
3320                                 continue
3321                         }
3322                         _ = v_1.Args[1]
3323                         v_1_1 := v_1.Args[1]
3324                         if v_1_1.Op != OpConst64 {
3325                                 continue
3326                         }
3327                         c := auxIntToInt64(v_1_1.AuxInt)
3328                         if !(c >= int64(32-nlz32(m))) {
3329                                 continue
3330                         }
3331                         v.reset(OpConst32)
3332                         v.AuxInt = int32ToAuxInt(0)
3333                         return true
3334                 }
3335                 break
3336         }
3337         // match: (And32 x x)
3338         // result: x
3339         for {
3340                 x := v_0
3341                 if x != v_1 {
3342                         break
3343                 }
3344                 v.copyOf(x)
3345                 return true
3346         }
3347         // match: (And32 (Const32 [-1]) x)
3348         // result: x
3349         for {
3350                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3351                         if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != -1 {
3352                                 continue
3353                         }
3354                         x := v_1
3355                         v.copyOf(x)
3356                         return true
3357                 }
3358                 break
3359         }
3360         // match: (And32 (Const32 [0]) _)
3361         // result: (Const32 [0])
3362         for {
3363                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3364                         if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
3365                                 continue
3366                         }
3367                         v.reset(OpConst32)
3368                         v.AuxInt = int32ToAuxInt(0)
3369                         return true
3370                 }
3371                 break
3372         }
3373         // match: (And32 (Com32 x) x)
3374         // result: (Const32 [0])
3375         for {
3376                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3377                         if v_0.Op != OpCom32 {
3378                                 continue
3379                         }
3380                         x := v_0.Args[0]
3381                         if x != v_1 {
3382                                 continue
3383                         }
3384                         v.reset(OpConst32)
3385                         v.AuxInt = int32ToAuxInt(0)
3386                         return true
3387                 }
3388                 break
3389         }
3390         // match: (And32 x (And32 x y))
3391         // result: (And32 x y)
3392         for {
3393                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3394                         x := v_0
3395                         if v_1.Op != OpAnd32 {
3396                                 continue
3397                         }
3398                         _ = v_1.Args[1]
3399                         v_1_0 := v_1.Args[0]
3400                         v_1_1 := v_1.Args[1]
3401                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
3402                                 if x != v_1_0 {
3403                                         continue
3404                                 }
3405                                 y := v_1_1
3406                                 v.reset(OpAnd32)
3407                                 v.AddArg2(x, y)
3408                                 return true
3409                         }
3410                 }
3411                 break
3412         }
3413         // match: (And32 (And32 i:(Const32 <t>) z) x)
3414         // cond: (z.Op != OpConst32 && x.Op != OpConst32)
3415         // result: (And32 i (And32 <t> z x))
3416         for {
3417                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3418                         if v_0.Op != OpAnd32 {
3419                                 continue
3420                         }
3421                         _ = v_0.Args[1]
3422                         v_0_0 := v_0.Args[0]
3423                         v_0_1 := v_0.Args[1]
3424                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
3425                                 i := v_0_0
3426                                 if i.Op != OpConst32 {
3427                                         continue
3428                                 }
3429                                 t := i.Type
3430                                 z := v_0_1
3431                                 x := v_1
3432                                 if !(z.Op != OpConst32 && x.Op != OpConst32) {
3433                                         continue
3434                                 }
3435                                 v.reset(OpAnd32)
3436                                 v0 := b.NewValue0(v.Pos, OpAnd32, t)
3437                                 v0.AddArg2(z, x)
3438                                 v.AddArg2(i, v0)
3439                                 return true
3440                         }
3441                 }
3442                 break
3443         }
3444         // match: (And32 (Const32 <t> [c]) (And32 (Const32 <t> [d]) x))
3445         // result: (And32 (Const32 <t> [c&d]) x)
3446         for {
3447                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3448                         if v_0.Op != OpConst32 {
3449                                 continue
3450                         }
3451                         t := v_0.Type
3452                         c := auxIntToInt32(v_0.AuxInt)
3453                         if v_1.Op != OpAnd32 {
3454                                 continue
3455                         }
3456                         _ = v_1.Args[1]
3457                         v_1_0 := v_1.Args[0]
3458                         v_1_1 := v_1.Args[1]
3459                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
3460                                 if v_1_0.Op != OpConst32 || v_1_0.Type != t {
3461                                         continue
3462                                 }
3463                                 d := auxIntToInt32(v_1_0.AuxInt)
3464                                 x := v_1_1
3465                                 v.reset(OpAnd32)
3466                                 v0 := b.NewValue0(v.Pos, OpConst32, t)
3467                                 v0.AuxInt = int32ToAuxInt(c & d)
3468                                 v.AddArg2(v0, x)
3469                                 return true
3470                         }
3471                 }
3472                 break
3473         }
3474         return false
3475 }
3476 func rewriteValuegeneric_OpAnd64(v *Value) bool {
3477         v_1 := v.Args[1]
3478         v_0 := v.Args[0]
3479         b := v.Block
3480         // match: (And64 (Const64 [c]) (Const64 [d]))
3481         // result: (Const64 [c&d])
3482         for {
3483                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3484                         if v_0.Op != OpConst64 {
3485                                 continue
3486                         }
3487                         c := auxIntToInt64(v_0.AuxInt)
3488                         if v_1.Op != OpConst64 {
3489                                 continue
3490                         }
3491                         d := auxIntToInt64(v_1.AuxInt)
3492                         v.reset(OpConst64)
3493                         v.AuxInt = int64ToAuxInt(c & d)
3494                         return true
3495                 }
3496                 break
3497         }
3498         // match: (And64 <t> (Com64 x) (Com64 y))
3499         // result: (Com64 (Or64 <t> x y))
3500         for {
3501                 t := v.Type
3502                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3503                         if v_0.Op != OpCom64 {
3504                                 continue
3505                         }
3506                         x := v_0.Args[0]
3507                         if v_1.Op != OpCom64 {
3508                                 continue
3509                         }
3510                         y := v_1.Args[0]
3511                         v.reset(OpCom64)
3512                         v0 := b.NewValue0(v.Pos, OpOr64, t)
3513                         v0.AddArg2(x, y)
3514                         v.AddArg(v0)
3515                         return true
3516                 }
3517                 break
3518         }
3519         // match: (And64 (Const64 [m]) (Rsh64Ux64 _ (Const64 [c])))
3520         // cond: c >= int64(64-ntz64(m))
3521         // result: (Const64 [0])
3522         for {
3523                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3524                         if v_0.Op != OpConst64 {
3525                                 continue
3526                         }
3527                         m := auxIntToInt64(v_0.AuxInt)
3528                         if v_1.Op != OpRsh64Ux64 {
3529                                 continue
3530                         }
3531                         _ = v_1.Args[1]
3532                         v_1_1 := v_1.Args[1]
3533                         if v_1_1.Op != OpConst64 {
3534                                 continue
3535                         }
3536                         c := auxIntToInt64(v_1_1.AuxInt)
3537                         if !(c >= int64(64-ntz64(m))) {
3538                                 continue
3539                         }
3540                         v.reset(OpConst64)
3541                         v.AuxInt = int64ToAuxInt(0)
3542                         return true
3543                 }
3544                 break
3545         }
3546         // match: (And64 (Const64 [m]) (Lsh64x64 _ (Const64 [c])))
3547         // cond: c >= int64(64-nlz64(m))
3548         // result: (Const64 [0])
3549         for {
3550                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3551                         if v_0.Op != OpConst64 {
3552                                 continue
3553                         }
3554                         m := auxIntToInt64(v_0.AuxInt)
3555                         if v_1.Op != OpLsh64x64 {
3556                                 continue
3557                         }
3558                         _ = v_1.Args[1]
3559                         v_1_1 := v_1.Args[1]
3560                         if v_1_1.Op != OpConst64 {
3561                                 continue
3562                         }
3563                         c := auxIntToInt64(v_1_1.AuxInt)
3564                         if !(c >= int64(64-nlz64(m))) {
3565                                 continue
3566                         }
3567                         v.reset(OpConst64)
3568                         v.AuxInt = int64ToAuxInt(0)
3569                         return true
3570                 }
3571                 break
3572         }
3573         // match: (And64 x x)
3574         // result: x
3575         for {
3576                 x := v_0
3577                 if x != v_1 {
3578                         break
3579                 }
3580                 v.copyOf(x)
3581                 return true
3582         }
3583         // match: (And64 (Const64 [-1]) x)
3584         // result: x
3585         for {
3586                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3587                         if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != -1 {
3588                                 continue
3589                         }
3590                         x := v_1
3591                         v.copyOf(x)
3592                         return true
3593                 }
3594                 break
3595         }
3596         // match: (And64 (Const64 [0]) _)
3597         // result: (Const64 [0])
3598         for {
3599                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3600                         if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
3601                                 continue
3602                         }
3603                         v.reset(OpConst64)
3604                         v.AuxInt = int64ToAuxInt(0)
3605                         return true
3606                 }
3607                 break
3608         }
3609         // match: (And64 (Com64 x) x)
3610         // result: (Const64 [0])
3611         for {
3612                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3613                         if v_0.Op != OpCom64 {
3614                                 continue
3615                         }
3616                         x := v_0.Args[0]
3617                         if x != v_1 {
3618                                 continue
3619                         }
3620                         v.reset(OpConst64)
3621                         v.AuxInt = int64ToAuxInt(0)
3622                         return true
3623                 }
3624                 break
3625         }
3626         // match: (And64 x (And64 x y))
3627         // result: (And64 x y)
3628         for {
3629                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3630                         x := v_0
3631                         if v_1.Op != OpAnd64 {
3632                                 continue
3633                         }
3634                         _ = v_1.Args[1]
3635                         v_1_0 := v_1.Args[0]
3636                         v_1_1 := v_1.Args[1]
3637                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
3638                                 if x != v_1_0 {
3639                                         continue
3640                                 }
3641                                 y := v_1_1
3642                                 v.reset(OpAnd64)
3643                                 v.AddArg2(x, y)
3644                                 return true
3645                         }
3646                 }
3647                 break
3648         }
3649         // match: (And64 (And64 i:(Const64 <t>) z) x)
3650         // cond: (z.Op != OpConst64 && x.Op != OpConst64)
3651         // result: (And64 i (And64 <t> z x))
3652         for {
3653                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3654                         if v_0.Op != OpAnd64 {
3655                                 continue
3656                         }
3657                         _ = v_0.Args[1]
3658                         v_0_0 := v_0.Args[0]
3659                         v_0_1 := v_0.Args[1]
3660                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
3661                                 i := v_0_0
3662                                 if i.Op != OpConst64 {
3663                                         continue
3664                                 }
3665                                 t := i.Type
3666                                 z := v_0_1
3667                                 x := v_1
3668                                 if !(z.Op != OpConst64 && x.Op != OpConst64) {
3669                                         continue
3670                                 }
3671                                 v.reset(OpAnd64)
3672                                 v0 := b.NewValue0(v.Pos, OpAnd64, t)
3673                                 v0.AddArg2(z, x)
3674                                 v.AddArg2(i, v0)
3675                                 return true
3676                         }
3677                 }
3678                 break
3679         }
3680         // match: (And64 (Const64 <t> [c]) (And64 (Const64 <t> [d]) x))
3681         // result: (And64 (Const64 <t> [c&d]) x)
3682         for {
3683                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3684                         if v_0.Op != OpConst64 {
3685                                 continue
3686                         }
3687                         t := v_0.Type
3688                         c := auxIntToInt64(v_0.AuxInt)
3689                         if v_1.Op != OpAnd64 {
3690                                 continue
3691                         }
3692                         _ = v_1.Args[1]
3693                         v_1_0 := v_1.Args[0]
3694                         v_1_1 := v_1.Args[1]
3695                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
3696                                 if v_1_0.Op != OpConst64 || v_1_0.Type != t {
3697                                         continue
3698                                 }
3699                                 d := auxIntToInt64(v_1_0.AuxInt)
3700                                 x := v_1_1
3701                                 v.reset(OpAnd64)
3702                                 v0 := b.NewValue0(v.Pos, OpConst64, t)
3703                                 v0.AuxInt = int64ToAuxInt(c & d)
3704                                 v.AddArg2(v0, x)
3705                                 return true
3706                         }
3707                 }
3708                 break
3709         }
3710         return false
3711 }
3712 func rewriteValuegeneric_OpAnd8(v *Value) bool {
3713         v_1 := v.Args[1]
3714         v_0 := v.Args[0]
3715         b := v.Block
3716         // match: (And8 (Const8 [c]) (Const8 [d]))
3717         // result: (Const8 [c&d])
3718         for {
3719                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3720                         if v_0.Op != OpConst8 {
3721                                 continue
3722                         }
3723                         c := auxIntToInt8(v_0.AuxInt)
3724                         if v_1.Op != OpConst8 {
3725                                 continue
3726                         }
3727                         d := auxIntToInt8(v_1.AuxInt)
3728                         v.reset(OpConst8)
3729                         v.AuxInt = int8ToAuxInt(c & d)
3730                         return true
3731                 }
3732                 break
3733         }
3734         // match: (And8 <t> (Com8 x) (Com8 y))
3735         // result: (Com8 (Or8 <t> x y))
3736         for {
3737                 t := v.Type
3738                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3739                         if v_0.Op != OpCom8 {
3740                                 continue
3741                         }
3742                         x := v_0.Args[0]
3743                         if v_1.Op != OpCom8 {
3744                                 continue
3745                         }
3746                         y := v_1.Args[0]
3747                         v.reset(OpCom8)
3748                         v0 := b.NewValue0(v.Pos, OpOr8, t)
3749                         v0.AddArg2(x, y)
3750                         v.AddArg(v0)
3751                         return true
3752                 }
3753                 break
3754         }
3755         // match: (And8 (Const8 [m]) (Rsh8Ux64 _ (Const64 [c])))
3756         // cond: c >= int64(8-ntz8(m))
3757         // result: (Const8 [0])
3758         for {
3759                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3760                         if v_0.Op != OpConst8 {
3761                                 continue
3762                         }
3763                         m := auxIntToInt8(v_0.AuxInt)
3764                         if v_1.Op != OpRsh8Ux64 {
3765                                 continue
3766                         }
3767                         _ = v_1.Args[1]
3768                         v_1_1 := v_1.Args[1]
3769                         if v_1_1.Op != OpConst64 {
3770                                 continue
3771                         }
3772                         c := auxIntToInt64(v_1_1.AuxInt)
3773                         if !(c >= int64(8-ntz8(m))) {
3774                                 continue
3775                         }
3776                         v.reset(OpConst8)
3777                         v.AuxInt = int8ToAuxInt(0)
3778                         return true
3779                 }
3780                 break
3781         }
3782         // match: (And8 (Const8 [m]) (Lsh8x64 _ (Const64 [c])))
3783         // cond: c >= int64(8-nlz8(m))
3784         // result: (Const8 [0])
3785         for {
3786                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3787                         if v_0.Op != OpConst8 {
3788                                 continue
3789                         }
3790                         m := auxIntToInt8(v_0.AuxInt)
3791                         if v_1.Op != OpLsh8x64 {
3792                                 continue
3793                         }
3794                         _ = v_1.Args[1]
3795                         v_1_1 := v_1.Args[1]
3796                         if v_1_1.Op != OpConst64 {
3797                                 continue
3798                         }
3799                         c := auxIntToInt64(v_1_1.AuxInt)
3800                         if !(c >= int64(8-nlz8(m))) {
3801                                 continue
3802                         }
3803                         v.reset(OpConst8)
3804                         v.AuxInt = int8ToAuxInt(0)
3805                         return true
3806                 }
3807                 break
3808         }
3809         // match: (And8 x x)
3810         // result: x
3811         for {
3812                 x := v_0
3813                 if x != v_1 {
3814                         break
3815                 }
3816                 v.copyOf(x)
3817                 return true
3818         }
3819         // match: (And8 (Const8 [-1]) x)
3820         // result: x
3821         for {
3822                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3823                         if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != -1 {
3824                                 continue
3825                         }
3826                         x := v_1
3827                         v.copyOf(x)
3828                         return true
3829                 }
3830                 break
3831         }
3832         // match: (And8 (Const8 [0]) _)
3833         // result: (Const8 [0])
3834         for {
3835                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3836                         if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
3837                                 continue
3838                         }
3839                         v.reset(OpConst8)
3840                         v.AuxInt = int8ToAuxInt(0)
3841                         return true
3842                 }
3843                 break
3844         }
3845         // match: (And8 (Com8 x) x)
3846         // result: (Const8 [0])
3847         for {
3848                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3849                         if v_0.Op != OpCom8 {
3850                                 continue
3851                         }
3852                         x := v_0.Args[0]
3853                         if x != v_1 {
3854                                 continue
3855                         }
3856                         v.reset(OpConst8)
3857                         v.AuxInt = int8ToAuxInt(0)
3858                         return true
3859                 }
3860                 break
3861         }
3862         // match: (And8 x (And8 x y))
3863         // result: (And8 x y)
3864         for {
3865                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3866                         x := v_0
3867                         if v_1.Op != OpAnd8 {
3868                                 continue
3869                         }
3870                         _ = v_1.Args[1]
3871                         v_1_0 := v_1.Args[0]
3872                         v_1_1 := v_1.Args[1]
3873                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
3874                                 if x != v_1_0 {
3875                                         continue
3876                                 }
3877                                 y := v_1_1
3878                                 v.reset(OpAnd8)
3879                                 v.AddArg2(x, y)
3880                                 return true
3881                         }
3882                 }
3883                 break
3884         }
3885         // match: (And8 (And8 i:(Const8 <t>) z) x)
3886         // cond: (z.Op != OpConst8 && x.Op != OpConst8)
3887         // result: (And8 i (And8 <t> z x))
3888         for {
3889                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3890                         if v_0.Op != OpAnd8 {
3891                                 continue
3892                         }
3893                         _ = v_0.Args[1]
3894                         v_0_0 := v_0.Args[0]
3895                         v_0_1 := v_0.Args[1]
3896                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
3897                                 i := v_0_0
3898                                 if i.Op != OpConst8 {
3899                                         continue
3900                                 }
3901                                 t := i.Type
3902                                 z := v_0_1
3903                                 x := v_1
3904                                 if !(z.Op != OpConst8 && x.Op != OpConst8) {
3905                                         continue
3906                                 }
3907                                 v.reset(OpAnd8)
3908                                 v0 := b.NewValue0(v.Pos, OpAnd8, t)
3909                                 v0.AddArg2(z, x)
3910                                 v.AddArg2(i, v0)
3911                                 return true
3912                         }
3913                 }
3914                 break
3915         }
3916         // match: (And8 (Const8 <t> [c]) (And8 (Const8 <t> [d]) x))
3917         // result: (And8 (Const8 <t> [c&d]) x)
3918         for {
3919                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3920                         if v_0.Op != OpConst8 {
3921                                 continue
3922                         }
3923                         t := v_0.Type
3924                         c := auxIntToInt8(v_0.AuxInt)
3925                         if v_1.Op != OpAnd8 {
3926                                 continue
3927                         }
3928                         _ = v_1.Args[1]
3929                         v_1_0 := v_1.Args[0]
3930                         v_1_1 := v_1.Args[1]
3931                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
3932                                 if v_1_0.Op != OpConst8 || v_1_0.Type != t {
3933                                         continue
3934                                 }
3935                                 d := auxIntToInt8(v_1_0.AuxInt)
3936                                 x := v_1_1
3937                                 v.reset(OpAnd8)
3938                                 v0 := b.NewValue0(v.Pos, OpConst8, t)
3939                                 v0.AuxInt = int8ToAuxInt(c & d)
3940                                 v.AddArg2(v0, x)
3941                                 return true
3942                         }
3943                 }
3944                 break
3945         }
3946         return false
3947 }
3948 func rewriteValuegeneric_OpAndB(v *Value) bool {
3949         v_1 := v.Args[1]
3950         v_0 := v.Args[0]
3951         b := v.Block
3952         // match: (AndB (Leq64 (Const64 [c]) x) (Less64 x (Const64 [d])))
3953         // cond: d >= c
3954         // result: (Less64U (Sub64 <x.Type> x (Const64 <x.Type> [c])) (Const64 <x.Type> [d-c]))
3955         for {
3956                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3957                         if v_0.Op != OpLeq64 {
3958                                 continue
3959                         }
3960                         x := v_0.Args[1]
3961                         v_0_0 := v_0.Args[0]
3962                         if v_0_0.Op != OpConst64 {
3963                                 continue
3964                         }
3965                         c := auxIntToInt64(v_0_0.AuxInt)
3966                         if v_1.Op != OpLess64 {
3967                                 continue
3968                         }
3969                         _ = v_1.Args[1]
3970                         if x != v_1.Args[0] {
3971                                 continue
3972                         }
3973                         v_1_1 := v_1.Args[1]
3974                         if v_1_1.Op != OpConst64 {
3975                                 continue
3976                         }
3977                         d := auxIntToInt64(v_1_1.AuxInt)
3978                         if !(d >= c) {
3979                                 continue
3980                         }
3981                         v.reset(OpLess64U)
3982                         v0 := b.NewValue0(v.Pos, OpSub64, x.Type)
3983                         v1 := b.NewValue0(v.Pos, OpConst64, x.Type)
3984                         v1.AuxInt = int64ToAuxInt(c)
3985                         v0.AddArg2(x, v1)
3986                         v2 := b.NewValue0(v.Pos, OpConst64, x.Type)
3987                         v2.AuxInt = int64ToAuxInt(d - c)
3988                         v.AddArg2(v0, v2)
3989                         return true
3990                 }
3991                 break
3992         }
3993         // match: (AndB (Leq64 (Const64 [c]) x) (Leq64 x (Const64 [d])))
3994         // cond: d >= c
3995         // result: (Leq64U (Sub64 <x.Type> x (Const64 <x.Type> [c])) (Const64 <x.Type> [d-c]))
3996         for {
3997                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3998                         if v_0.Op != OpLeq64 {
3999                                 continue
4000                         }
4001                         x := v_0.Args[1]
4002                         v_0_0 := v_0.Args[0]
4003                         if v_0_0.Op != OpConst64 {
4004                                 continue
4005                         }
4006                         c := auxIntToInt64(v_0_0.AuxInt)
4007                         if v_1.Op != OpLeq64 {
4008                                 continue
4009                         }
4010                         _ = v_1.Args[1]
4011                         if x != v_1.Args[0] {
4012                                 continue
4013                         }
4014                         v_1_1 := v_1.Args[1]
4015                         if v_1_1.Op != OpConst64 {
4016                                 continue
4017                         }
4018                         d := auxIntToInt64(v_1_1.AuxInt)
4019                         if !(d >= c) {
4020                                 continue
4021                         }
4022                         v.reset(OpLeq64U)
4023                         v0 := b.NewValue0(v.Pos, OpSub64, x.Type)
4024                         v1 := b.NewValue0(v.Pos, OpConst64, x.Type)
4025                         v1.AuxInt = int64ToAuxInt(c)
4026                         v0.AddArg2(x, v1)
4027                         v2 := b.NewValue0(v.Pos, OpConst64, x.Type)
4028                         v2.AuxInt = int64ToAuxInt(d - c)
4029                         v.AddArg2(v0, v2)
4030                         return true
4031                 }
4032                 break
4033         }
4034         // match: (AndB (Leq32 (Const32 [c]) x) (Less32 x (Const32 [d])))
4035         // cond: d >= c
4036         // result: (Less32U (Sub32 <x.Type> x (Const32 <x.Type> [c])) (Const32 <x.Type> [d-c]))
4037         for {
4038                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4039                         if v_0.Op != OpLeq32 {
4040                                 continue
4041                         }
4042                         x := v_0.Args[1]
4043                         v_0_0 := v_0.Args[0]
4044                         if v_0_0.Op != OpConst32 {
4045                                 continue
4046                         }
4047                         c := auxIntToInt32(v_0_0.AuxInt)
4048                         if v_1.Op != OpLess32 {
4049                                 continue
4050                         }
4051                         _ = v_1.Args[1]
4052                         if x != v_1.Args[0] {
4053                                 continue
4054                         }
4055                         v_1_1 := v_1.Args[1]
4056                         if v_1_1.Op != OpConst32 {
4057                                 continue
4058                         }
4059                         d := auxIntToInt32(v_1_1.AuxInt)
4060                         if !(d >= c) {
4061                                 continue
4062                         }
4063                         v.reset(OpLess32U)
4064                         v0 := b.NewValue0(v.Pos, OpSub32, x.Type)
4065                         v1 := b.NewValue0(v.Pos, OpConst32, x.Type)
4066                         v1.AuxInt = int32ToAuxInt(c)
4067                         v0.AddArg2(x, v1)
4068                         v2 := b.NewValue0(v.Pos, OpConst32, x.Type)
4069                         v2.AuxInt = int32ToAuxInt(d - c)
4070                         v.AddArg2(v0, v2)
4071                         return true
4072                 }
4073                 break
4074         }
4075         // match: (AndB (Leq32 (Const32 [c]) x) (Leq32 x (Const32 [d])))
4076         // cond: d >= c
4077         // result: (Leq32U (Sub32 <x.Type> x (Const32 <x.Type> [c])) (Const32 <x.Type> [d-c]))
4078         for {
4079                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4080                         if v_0.Op != OpLeq32 {
4081                                 continue
4082                         }
4083                         x := v_0.Args[1]
4084                         v_0_0 := v_0.Args[0]
4085                         if v_0_0.Op != OpConst32 {
4086                                 continue
4087                         }
4088                         c := auxIntToInt32(v_0_0.AuxInt)
4089                         if v_1.Op != OpLeq32 {
4090                                 continue
4091                         }
4092                         _ = v_1.Args[1]
4093                         if x != v_1.Args[0] {
4094                                 continue
4095                         }
4096                         v_1_1 := v_1.Args[1]
4097                         if v_1_1.Op != OpConst32 {
4098                                 continue
4099                         }
4100                         d := auxIntToInt32(v_1_1.AuxInt)
4101                         if !(d >= c) {
4102                                 continue
4103                         }
4104                         v.reset(OpLeq32U)
4105                         v0 := b.NewValue0(v.Pos, OpSub32, x.Type)
4106                         v1 := b.NewValue0(v.Pos, OpConst32, x.Type)
4107                         v1.AuxInt = int32ToAuxInt(c)
4108                         v0.AddArg2(x, v1)
4109                         v2 := b.NewValue0(v.Pos, OpConst32, x.Type)
4110                         v2.AuxInt = int32ToAuxInt(d - c)
4111                         v.AddArg2(v0, v2)
4112                         return true
4113                 }
4114                 break
4115         }
4116         // match: (AndB (Leq16 (Const16 [c]) x) (Less16 x (Const16 [d])))
4117         // cond: d >= c
4118         // result: (Less16U (Sub16 <x.Type> x (Const16 <x.Type> [c])) (Const16 <x.Type> [d-c]))
4119         for {
4120                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4121                         if v_0.Op != OpLeq16 {
4122                                 continue
4123                         }
4124                         x := v_0.Args[1]
4125                         v_0_0 := v_0.Args[0]
4126                         if v_0_0.Op != OpConst16 {
4127                                 continue
4128                         }
4129                         c := auxIntToInt16(v_0_0.AuxInt)
4130                         if v_1.Op != OpLess16 {
4131                                 continue
4132                         }
4133                         _ = v_1.Args[1]
4134                         if x != v_1.Args[0] {
4135                                 continue
4136                         }
4137                         v_1_1 := v_1.Args[1]
4138                         if v_1_1.Op != OpConst16 {
4139                                 continue
4140                         }
4141                         d := auxIntToInt16(v_1_1.AuxInt)
4142                         if !(d >= c) {
4143                                 continue
4144                         }
4145                         v.reset(OpLess16U)
4146                         v0 := b.NewValue0(v.Pos, OpSub16, x.Type)
4147                         v1 := b.NewValue0(v.Pos, OpConst16, x.Type)
4148                         v1.AuxInt = int16ToAuxInt(c)
4149                         v0.AddArg2(x, v1)
4150                         v2 := b.NewValue0(v.Pos, OpConst16, x.Type)
4151                         v2.AuxInt = int16ToAuxInt(d - c)
4152                         v.AddArg2(v0, v2)
4153                         return true
4154                 }
4155                 break
4156         }
4157         // match: (AndB (Leq16 (Const16 [c]) x) (Leq16 x (Const16 [d])))
4158         // cond: d >= c
4159         // result: (Leq16U (Sub16 <x.Type> x (Const16 <x.Type> [c])) (Const16 <x.Type> [d-c]))
4160         for {
4161                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4162                         if v_0.Op != OpLeq16 {
4163                                 continue
4164                         }
4165                         x := v_0.Args[1]
4166                         v_0_0 := v_0.Args[0]
4167                         if v_0_0.Op != OpConst16 {
4168                                 continue
4169                         }
4170                         c := auxIntToInt16(v_0_0.AuxInt)
4171                         if v_1.Op != OpLeq16 {
4172                                 continue
4173                         }
4174                         _ = v_1.Args[1]
4175                         if x != v_1.Args[0] {
4176                                 continue
4177                         }
4178                         v_1_1 := v_1.Args[1]
4179                         if v_1_1.Op != OpConst16 {
4180                                 continue
4181                         }
4182                         d := auxIntToInt16(v_1_1.AuxInt)
4183                         if !(d >= c) {
4184                                 continue
4185                         }
4186                         v.reset(OpLeq16U)
4187                         v0 := b.NewValue0(v.Pos, OpSub16, x.Type)
4188                         v1 := b.NewValue0(v.Pos, OpConst16, x.Type)
4189                         v1.AuxInt = int16ToAuxInt(c)
4190                         v0.AddArg2(x, v1)
4191                         v2 := b.NewValue0(v.Pos, OpConst16, x.Type)
4192                         v2.AuxInt = int16ToAuxInt(d - c)
4193                         v.AddArg2(v0, v2)
4194                         return true
4195                 }
4196                 break
4197         }
4198         // match: (AndB (Leq8 (Const8 [c]) x) (Less8 x (Const8 [d])))
4199         // cond: d >= c
4200         // result: (Less8U (Sub8 <x.Type> x (Const8 <x.Type> [c])) (Const8 <x.Type> [d-c]))
4201         for {
4202                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4203                         if v_0.Op != OpLeq8 {
4204                                 continue
4205                         }
4206                         x := v_0.Args[1]
4207                         v_0_0 := v_0.Args[0]
4208                         if v_0_0.Op != OpConst8 {
4209                                 continue
4210                         }
4211                         c := auxIntToInt8(v_0_0.AuxInt)
4212                         if v_1.Op != OpLess8 {
4213                                 continue
4214                         }
4215                         _ = v_1.Args[1]
4216                         if x != v_1.Args[0] {
4217                                 continue
4218                         }
4219                         v_1_1 := v_1.Args[1]
4220                         if v_1_1.Op != OpConst8 {
4221                                 continue
4222                         }
4223                         d := auxIntToInt8(v_1_1.AuxInt)
4224                         if !(d >= c) {
4225                                 continue
4226                         }
4227                         v.reset(OpLess8U)
4228                         v0 := b.NewValue0(v.Pos, OpSub8, x.Type)
4229                         v1 := b.NewValue0(v.Pos, OpConst8, x.Type)
4230                         v1.AuxInt = int8ToAuxInt(c)
4231                         v0.AddArg2(x, v1)
4232                         v2 := b.NewValue0(v.Pos, OpConst8, x.Type)
4233                         v2.AuxInt = int8ToAuxInt(d - c)
4234                         v.AddArg2(v0, v2)
4235                         return true
4236                 }
4237                 break
4238         }
4239         // match: (AndB (Leq8 (Const8 [c]) x) (Leq8 x (Const8 [d])))
4240         // cond: d >= c
4241         // result: (Leq8U (Sub8 <x.Type> x (Const8 <x.Type> [c])) (Const8 <x.Type> [d-c]))
4242         for {
4243                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4244                         if v_0.Op != OpLeq8 {
4245                                 continue
4246                         }
4247                         x := v_0.Args[1]
4248                         v_0_0 := v_0.Args[0]
4249                         if v_0_0.Op != OpConst8 {
4250                                 continue
4251                         }
4252                         c := auxIntToInt8(v_0_0.AuxInt)
4253                         if v_1.Op != OpLeq8 {
4254                                 continue
4255                         }
4256                         _ = v_1.Args[1]
4257                         if x != v_1.Args[0] {
4258                                 continue
4259                         }
4260                         v_1_1 := v_1.Args[1]
4261                         if v_1_1.Op != OpConst8 {
4262                                 continue
4263                         }
4264                         d := auxIntToInt8(v_1_1.AuxInt)
4265                         if !(d >= c) {
4266                                 continue
4267                         }
4268                         v.reset(OpLeq8U)
4269                         v0 := b.NewValue0(v.Pos, OpSub8, x.Type)
4270                         v1 := b.NewValue0(v.Pos, OpConst8, x.Type)
4271                         v1.AuxInt = int8ToAuxInt(c)
4272                         v0.AddArg2(x, v1)
4273                         v2 := b.NewValue0(v.Pos, OpConst8, x.Type)
4274                         v2.AuxInt = int8ToAuxInt(d - c)
4275                         v.AddArg2(v0, v2)
4276                         return true
4277                 }
4278                 break
4279         }
4280         // match: (AndB (Less64 (Const64 [c]) x) (Less64 x (Const64 [d])))
4281         // cond: d >= c+1 && c+1 > c
4282         // result: (Less64U (Sub64 <x.Type> x (Const64 <x.Type> [c+1])) (Const64 <x.Type> [d-c-1]))
4283         for {
4284                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4285                         if v_0.Op != OpLess64 {
4286                                 continue
4287                         }
4288                         x := v_0.Args[1]
4289                         v_0_0 := v_0.Args[0]
4290                         if v_0_0.Op != OpConst64 {
4291                                 continue
4292                         }
4293                         c := auxIntToInt64(v_0_0.AuxInt)
4294                         if v_1.Op != OpLess64 {
4295                                 continue
4296                         }
4297                         _ = v_1.Args[1]
4298                         if x != v_1.Args[0] {
4299                                 continue
4300                         }
4301                         v_1_1 := v_1.Args[1]
4302                         if v_1_1.Op != OpConst64 {
4303                                 continue
4304                         }
4305                         d := auxIntToInt64(v_1_1.AuxInt)
4306                         if !(d >= c+1 && c+1 > c) {
4307                                 continue
4308                         }
4309                         v.reset(OpLess64U)
4310                         v0 := b.NewValue0(v.Pos, OpSub64, x.Type)
4311                         v1 := b.NewValue0(v.Pos, OpConst64, x.Type)
4312                         v1.AuxInt = int64ToAuxInt(c + 1)
4313                         v0.AddArg2(x, v1)
4314                         v2 := b.NewValue0(v.Pos, OpConst64, x.Type)
4315                         v2.AuxInt = int64ToAuxInt(d - c - 1)
4316                         v.AddArg2(v0, v2)
4317                         return true
4318                 }
4319                 break
4320         }
4321         // match: (AndB (Less64 (Const64 [c]) x) (Leq64 x (Const64 [d])))
4322         // cond: d >= c+1 && c+1 > c
4323         // result: (Leq64U (Sub64 <x.Type> x (Const64 <x.Type> [c+1])) (Const64 <x.Type> [d-c-1]))
4324         for {
4325                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4326                         if v_0.Op != OpLess64 {
4327                                 continue
4328                         }
4329                         x := v_0.Args[1]
4330                         v_0_0 := v_0.Args[0]
4331                         if v_0_0.Op != OpConst64 {
4332                                 continue
4333                         }
4334                         c := auxIntToInt64(v_0_0.AuxInt)
4335                         if v_1.Op != OpLeq64 {
4336                                 continue
4337                         }
4338                         _ = v_1.Args[1]
4339                         if x != v_1.Args[0] {
4340                                 continue
4341                         }
4342                         v_1_1 := v_1.Args[1]
4343                         if v_1_1.Op != OpConst64 {
4344                                 continue
4345                         }
4346                         d := auxIntToInt64(v_1_1.AuxInt)
4347                         if !(d >= c+1 && c+1 > c) {
4348                                 continue
4349                         }
4350                         v.reset(OpLeq64U)
4351                         v0 := b.NewValue0(v.Pos, OpSub64, x.Type)
4352                         v1 := b.NewValue0(v.Pos, OpConst64, x.Type)
4353                         v1.AuxInt = int64ToAuxInt(c + 1)
4354                         v0.AddArg2(x, v1)
4355                         v2 := b.NewValue0(v.Pos, OpConst64, x.Type)
4356                         v2.AuxInt = int64ToAuxInt(d - c - 1)
4357                         v.AddArg2(v0, v2)
4358                         return true
4359                 }
4360                 break
4361         }
4362         // match: (AndB (Less32 (Const32 [c]) x) (Less32 x (Const32 [d])))
4363         // cond: d >= c+1 && c+1 > c
4364         // result: (Less32U (Sub32 <x.Type> x (Const32 <x.Type> [c+1])) (Const32 <x.Type> [d-c-1]))
4365         for {
4366                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4367                         if v_0.Op != OpLess32 {
4368                                 continue
4369                         }
4370                         x := v_0.Args[1]
4371                         v_0_0 := v_0.Args[0]
4372                         if v_0_0.Op != OpConst32 {
4373                                 continue
4374                         }
4375                         c := auxIntToInt32(v_0_0.AuxInt)
4376                         if v_1.Op != OpLess32 {
4377                                 continue
4378                         }
4379                         _ = v_1.Args[1]
4380                         if x != v_1.Args[0] {
4381                                 continue
4382                         }
4383                         v_1_1 := v_1.Args[1]
4384                         if v_1_1.Op != OpConst32 {
4385                                 continue
4386                         }
4387                         d := auxIntToInt32(v_1_1.AuxInt)
4388                         if !(d >= c+1 && c+1 > c) {
4389                                 continue
4390                         }
4391                         v.reset(OpLess32U)
4392                         v0 := b.NewValue0(v.Pos, OpSub32, x.Type)
4393                         v1 := b.NewValue0(v.Pos, OpConst32, x.Type)
4394                         v1.AuxInt = int32ToAuxInt(c + 1)
4395                         v0.AddArg2(x, v1)
4396                         v2 := b.NewValue0(v.Pos, OpConst32, x.Type)
4397                         v2.AuxInt = int32ToAuxInt(d - c - 1)
4398                         v.AddArg2(v0, v2)
4399                         return true
4400                 }
4401                 break
4402         }
4403         // match: (AndB (Less32 (Const32 [c]) x) (Leq32 x (Const32 [d])))
4404         // cond: d >= c+1 && c+1 > c
4405         // result: (Leq32U (Sub32 <x.Type> x (Const32 <x.Type> [c+1])) (Const32 <x.Type> [d-c-1]))
4406         for {
4407                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4408                         if v_0.Op != OpLess32 {
4409                                 continue
4410                         }
4411                         x := v_0.Args[1]
4412                         v_0_0 := v_0.Args[0]
4413                         if v_0_0.Op != OpConst32 {
4414                                 continue
4415                         }
4416                         c := auxIntToInt32(v_0_0.AuxInt)
4417                         if v_1.Op != OpLeq32 {
4418                                 continue
4419                         }
4420                         _ = v_1.Args[1]
4421                         if x != v_1.Args[0] {
4422                                 continue
4423                         }
4424                         v_1_1 := v_1.Args[1]
4425                         if v_1_1.Op != OpConst32 {
4426                                 continue
4427                         }
4428                         d := auxIntToInt32(v_1_1.AuxInt)
4429                         if !(d >= c+1 && c+1 > c) {
4430                                 continue
4431                         }
4432                         v.reset(OpLeq32U)
4433                         v0 := b.NewValue0(v.Pos, OpSub32, x.Type)
4434                         v1 := b.NewValue0(v.Pos, OpConst32, x.Type)
4435                         v1.AuxInt = int32ToAuxInt(c + 1)
4436                         v0.AddArg2(x, v1)
4437                         v2 := b.NewValue0(v.Pos, OpConst32, x.Type)
4438                         v2.AuxInt = int32ToAuxInt(d - c - 1)
4439                         v.AddArg2(v0, v2)
4440                         return true
4441                 }
4442                 break
4443         }
4444         // match: (AndB (Less16 (Const16 [c]) x) (Less16 x (Const16 [d])))
4445         // cond: d >= c+1 && c+1 > c
4446         // result: (Less16U (Sub16 <x.Type> x (Const16 <x.Type> [c+1])) (Const16 <x.Type> [d-c-1]))
4447         for {
4448                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4449                         if v_0.Op != OpLess16 {
4450                                 continue
4451                         }
4452                         x := v_0.Args[1]
4453                         v_0_0 := v_0.Args[0]
4454                         if v_0_0.Op != OpConst16 {
4455                                 continue
4456                         }
4457                         c := auxIntToInt16(v_0_0.AuxInt)
4458                         if v_1.Op != OpLess16 {
4459                                 continue
4460                         }
4461                         _ = v_1.Args[1]
4462                         if x != v_1.Args[0] {
4463                                 continue
4464                         }
4465                         v_1_1 := v_1.Args[1]
4466                         if v_1_1.Op != OpConst16 {
4467                                 continue
4468                         }
4469                         d := auxIntToInt16(v_1_1.AuxInt)
4470                         if !(d >= c+1 && c+1 > c) {
4471                                 continue
4472                         }
4473                         v.reset(OpLess16U)
4474                         v0 := b.NewValue0(v.Pos, OpSub16, x.Type)
4475                         v1 := b.NewValue0(v.Pos, OpConst16, x.Type)
4476                         v1.AuxInt = int16ToAuxInt(c + 1)
4477                         v0.AddArg2(x, v1)
4478                         v2 := b.NewValue0(v.Pos, OpConst16, x.Type)
4479                         v2.AuxInt = int16ToAuxInt(d - c - 1)
4480                         v.AddArg2(v0, v2)
4481                         return true
4482                 }
4483                 break
4484         }
4485         // match: (AndB (Less16 (Const16 [c]) x) (Leq16 x (Const16 [d])))
4486         // cond: d >= c+1 && c+1 > c
4487         // result: (Leq16U (Sub16 <x.Type> x (Const16 <x.Type> [c+1])) (Const16 <x.Type> [d-c-1]))
4488         for {
4489                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4490                         if v_0.Op != OpLess16 {
4491                                 continue
4492                         }
4493                         x := v_0.Args[1]
4494                         v_0_0 := v_0.Args[0]
4495                         if v_0_0.Op != OpConst16 {
4496                                 continue
4497                         }
4498                         c := auxIntToInt16(v_0_0.AuxInt)
4499                         if v_1.Op != OpLeq16 {
4500                                 continue
4501                         }
4502                         _ = v_1.Args[1]
4503                         if x != v_1.Args[0] {
4504                                 continue
4505                         }
4506                         v_1_1 := v_1.Args[1]
4507                         if v_1_1.Op != OpConst16 {
4508                                 continue
4509                         }
4510                         d := auxIntToInt16(v_1_1.AuxInt)
4511                         if !(d >= c+1 && c+1 > c) {
4512                                 continue
4513                         }
4514                         v.reset(OpLeq16U)
4515                         v0 := b.NewValue0(v.Pos, OpSub16, x.Type)
4516                         v1 := b.NewValue0(v.Pos, OpConst16, x.Type)
4517                         v1.AuxInt = int16ToAuxInt(c + 1)
4518                         v0.AddArg2(x, v1)
4519                         v2 := b.NewValue0(v.Pos, OpConst16, x.Type)
4520                         v2.AuxInt = int16ToAuxInt(d - c - 1)
4521                         v.AddArg2(v0, v2)
4522                         return true
4523                 }
4524                 break
4525         }
4526         // match: (AndB (Less8 (Const8 [c]) x) (Less8 x (Const8 [d])))
4527         // cond: d >= c+1 && c+1 > c
4528         // result: (Less8U (Sub8 <x.Type> x (Const8 <x.Type> [c+1])) (Const8 <x.Type> [d-c-1]))
4529         for {
4530                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4531                         if v_0.Op != OpLess8 {
4532                                 continue
4533                         }
4534                         x := v_0.Args[1]
4535                         v_0_0 := v_0.Args[0]
4536                         if v_0_0.Op != OpConst8 {
4537                                 continue
4538                         }
4539                         c := auxIntToInt8(v_0_0.AuxInt)
4540                         if v_1.Op != OpLess8 {
4541                                 continue
4542                         }
4543                         _ = v_1.Args[1]
4544                         if x != v_1.Args[0] {
4545                                 continue
4546                         }
4547                         v_1_1 := v_1.Args[1]
4548                         if v_1_1.Op != OpConst8 {
4549                                 continue
4550                         }
4551                         d := auxIntToInt8(v_1_1.AuxInt)
4552                         if !(d >= c+1 && c+1 > c) {
4553                                 continue
4554                         }
4555                         v.reset(OpLess8U)
4556                         v0 := b.NewValue0(v.Pos, OpSub8, x.Type)
4557                         v1 := b.NewValue0(v.Pos, OpConst8, x.Type)
4558                         v1.AuxInt = int8ToAuxInt(c + 1)
4559                         v0.AddArg2(x, v1)
4560                         v2 := b.NewValue0(v.Pos, OpConst8, x.Type)
4561                         v2.AuxInt = int8ToAuxInt(d - c - 1)
4562                         v.AddArg2(v0, v2)
4563                         return true
4564                 }
4565                 break
4566         }
4567         // match: (AndB (Less8 (Const8 [c]) x) (Leq8 x (Const8 [d])))
4568         // cond: d >= c+1 && c+1 > c
4569         // result: (Leq8U (Sub8 <x.Type> x (Const8 <x.Type> [c+1])) (Const8 <x.Type> [d-c-1]))
4570         for {
4571                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4572                         if v_0.Op != OpLess8 {
4573                                 continue
4574                         }
4575                         x := v_0.Args[1]
4576                         v_0_0 := v_0.Args[0]
4577                         if v_0_0.Op != OpConst8 {
4578                                 continue
4579                         }
4580                         c := auxIntToInt8(v_0_0.AuxInt)
4581                         if v_1.Op != OpLeq8 {
4582                                 continue
4583                         }
4584                         _ = v_1.Args[1]
4585                         if x != v_1.Args[0] {
4586                                 continue
4587                         }
4588                         v_1_1 := v_1.Args[1]
4589                         if v_1_1.Op != OpConst8 {
4590                                 continue
4591                         }
4592                         d := auxIntToInt8(v_1_1.AuxInt)
4593                         if !(d >= c+1 && c+1 > c) {
4594                                 continue
4595                         }
4596                         v.reset(OpLeq8U)
4597                         v0 := b.NewValue0(v.Pos, OpSub8, x.Type)
4598                         v1 := b.NewValue0(v.Pos, OpConst8, x.Type)
4599                         v1.AuxInt = int8ToAuxInt(c + 1)
4600                         v0.AddArg2(x, v1)
4601                         v2 := b.NewValue0(v.Pos, OpConst8, x.Type)
4602                         v2.AuxInt = int8ToAuxInt(d - c - 1)
4603                         v.AddArg2(v0, v2)
4604                         return true
4605                 }
4606                 break
4607         }
4608         // match: (AndB (Leq64U (Const64 [c]) x) (Less64U x (Const64 [d])))
4609         // cond: uint64(d) >= uint64(c)
4610         // result: (Less64U (Sub64 <x.Type> x (Const64 <x.Type> [c])) (Const64 <x.Type> [d-c]))
4611         for {
4612                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4613                         if v_0.Op != OpLeq64U {
4614                                 continue
4615                         }
4616                         x := v_0.Args[1]
4617                         v_0_0 := v_0.Args[0]
4618                         if v_0_0.Op != OpConst64 {
4619                                 continue
4620                         }
4621                         c := auxIntToInt64(v_0_0.AuxInt)
4622                         if v_1.Op != OpLess64U {
4623                                 continue
4624                         }
4625                         _ = v_1.Args[1]
4626                         if x != v_1.Args[0] {
4627                                 continue
4628                         }
4629                         v_1_1 := v_1.Args[1]
4630                         if v_1_1.Op != OpConst64 {
4631                                 continue
4632                         }
4633                         d := auxIntToInt64(v_1_1.AuxInt)
4634                         if !(uint64(d) >= uint64(c)) {
4635                                 continue
4636                         }
4637                         v.reset(OpLess64U)
4638                         v0 := b.NewValue0(v.Pos, OpSub64, x.Type)
4639                         v1 := b.NewValue0(v.Pos, OpConst64, x.Type)
4640                         v1.AuxInt = int64ToAuxInt(c)
4641                         v0.AddArg2(x, v1)
4642                         v2 := b.NewValue0(v.Pos, OpConst64, x.Type)
4643                         v2.AuxInt = int64ToAuxInt(d - c)
4644                         v.AddArg2(v0, v2)
4645                         return true
4646                 }
4647                 break
4648         }
4649         // match: (AndB (Leq64U (Const64 [c]) x) (Leq64U x (Const64 [d])))
4650         // cond: uint64(d) >= uint64(c)
4651         // result: (Leq64U (Sub64 <x.Type> x (Const64 <x.Type> [c])) (Const64 <x.Type> [d-c]))
4652         for {
4653                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4654                         if v_0.Op != OpLeq64U {
4655                                 continue
4656                         }
4657                         x := v_0.Args[1]
4658                         v_0_0 := v_0.Args[0]
4659                         if v_0_0.Op != OpConst64 {
4660                                 continue
4661                         }
4662                         c := auxIntToInt64(v_0_0.AuxInt)
4663                         if v_1.Op != OpLeq64U {
4664                                 continue
4665                         }
4666                         _ = v_1.Args[1]
4667                         if x != v_1.Args[0] {
4668                                 continue
4669                         }
4670                         v_1_1 := v_1.Args[1]
4671                         if v_1_1.Op != OpConst64 {
4672                                 continue
4673                         }
4674                         d := auxIntToInt64(v_1_1.AuxInt)
4675                         if !(uint64(d) >= uint64(c)) {
4676                                 continue
4677                         }
4678                         v.reset(OpLeq64U)
4679                         v0 := b.NewValue0(v.Pos, OpSub64, x.Type)
4680                         v1 := b.NewValue0(v.Pos, OpConst64, x.Type)
4681                         v1.AuxInt = int64ToAuxInt(c)
4682                         v0.AddArg2(x, v1)
4683                         v2 := b.NewValue0(v.Pos, OpConst64, x.Type)
4684                         v2.AuxInt = int64ToAuxInt(d - c)
4685                         v.AddArg2(v0, v2)
4686                         return true
4687                 }
4688                 break
4689         }
4690         // match: (AndB (Leq32U (Const32 [c]) x) (Less32U x (Const32 [d])))
4691         // cond: uint32(d) >= uint32(c)
4692         // result: (Less32U (Sub32 <x.Type> x (Const32 <x.Type> [c])) (Const32 <x.Type> [d-c]))
4693         for {
4694                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4695                         if v_0.Op != OpLeq32U {
4696                                 continue
4697                         }
4698                         x := v_0.Args[1]
4699                         v_0_0 := v_0.Args[0]
4700                         if v_0_0.Op != OpConst32 {
4701                                 continue
4702                         }
4703                         c := auxIntToInt32(v_0_0.AuxInt)
4704                         if v_1.Op != OpLess32U {
4705                                 continue
4706                         }
4707                         _ = v_1.Args[1]
4708                         if x != v_1.Args[0] {
4709                                 continue
4710                         }
4711                         v_1_1 := v_1.Args[1]
4712                         if v_1_1.Op != OpConst32 {
4713                                 continue
4714                         }
4715                         d := auxIntToInt32(v_1_1.AuxInt)
4716                         if !(uint32(d) >= uint32(c)) {
4717                                 continue
4718                         }
4719                         v.reset(OpLess32U)
4720                         v0 := b.NewValue0(v.Pos, OpSub32, x.Type)
4721                         v1 := b.NewValue0(v.Pos, OpConst32, x.Type)
4722                         v1.AuxInt = int32ToAuxInt(c)
4723                         v0.AddArg2(x, v1)
4724                         v2 := b.NewValue0(v.Pos, OpConst32, x.Type)
4725                         v2.AuxInt = int32ToAuxInt(d - c)
4726                         v.AddArg2(v0, v2)
4727                         return true
4728                 }
4729                 break
4730         }
4731         // match: (AndB (Leq32U (Const32 [c]) x) (Leq32U x (Const32 [d])))
4732         // cond: uint32(d) >= uint32(c)
4733         // result: (Leq32U (Sub32 <x.Type> x (Const32 <x.Type> [c])) (Const32 <x.Type> [d-c]))
4734         for {
4735                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4736                         if v_0.Op != OpLeq32U {
4737                                 continue
4738                         }
4739                         x := v_0.Args[1]
4740                         v_0_0 := v_0.Args[0]
4741                         if v_0_0.Op != OpConst32 {
4742                                 continue
4743                         }
4744                         c := auxIntToInt32(v_0_0.AuxInt)
4745                         if v_1.Op != OpLeq32U {
4746                                 continue
4747                         }
4748                         _ = v_1.Args[1]
4749                         if x != v_1.Args[0] {
4750                                 continue
4751                         }
4752                         v_1_1 := v_1.Args[1]
4753                         if v_1_1.Op != OpConst32 {
4754                                 continue
4755                         }
4756                         d := auxIntToInt32(v_1_1.AuxInt)
4757                         if !(uint32(d) >= uint32(c)) {
4758                                 continue
4759                         }
4760                         v.reset(OpLeq32U)
4761                         v0 := b.NewValue0(v.Pos, OpSub32, x.Type)
4762                         v1 := b.NewValue0(v.Pos, OpConst32, x.Type)
4763                         v1.AuxInt = int32ToAuxInt(c)
4764                         v0.AddArg2(x, v1)
4765                         v2 := b.NewValue0(v.Pos, OpConst32, x.Type)
4766                         v2.AuxInt = int32ToAuxInt(d - c)
4767                         v.AddArg2(v0, v2)
4768                         return true
4769                 }
4770                 break
4771         }
4772         // match: (AndB (Leq16U (Const16 [c]) x) (Less16U x (Const16 [d])))
4773         // cond: uint16(d) >= uint16(c)
4774         // result: (Less16U (Sub16 <x.Type> x (Const16 <x.Type> [c])) (Const16 <x.Type> [d-c]))
4775         for {
4776                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4777                         if v_0.Op != OpLeq16U {
4778                                 continue
4779                         }
4780                         x := v_0.Args[1]
4781                         v_0_0 := v_0.Args[0]
4782                         if v_0_0.Op != OpConst16 {
4783                                 continue
4784                         }
4785                         c := auxIntToInt16(v_0_0.AuxInt)
4786                         if v_1.Op != OpLess16U {
4787                                 continue
4788                         }
4789                         _ = v_1.Args[1]
4790                         if x != v_1.Args[0] {
4791                                 continue
4792                         }
4793                         v_1_1 := v_1.Args[1]
4794                         if v_1_1.Op != OpConst16 {
4795                                 continue
4796                         }
4797                         d := auxIntToInt16(v_1_1.AuxInt)
4798                         if !(uint16(d) >= uint16(c)) {
4799                                 continue
4800                         }
4801                         v.reset(OpLess16U)
4802                         v0 := b.NewValue0(v.Pos, OpSub16, x.Type)
4803                         v1 := b.NewValue0(v.Pos, OpConst16, x.Type)
4804                         v1.AuxInt = int16ToAuxInt(c)
4805                         v0.AddArg2(x, v1)
4806                         v2 := b.NewValue0(v.Pos, OpConst16, x.Type)
4807                         v2.AuxInt = int16ToAuxInt(d - c)
4808                         v.AddArg2(v0, v2)
4809                         return true
4810                 }
4811                 break
4812         }
4813         // match: (AndB (Leq16U (Const16 [c]) x) (Leq16U x (Const16 [d])))
4814         // cond: uint16(d) >= uint16(c)
4815         // result: (Leq16U (Sub16 <x.Type> x (Const16 <x.Type> [c])) (Const16 <x.Type> [d-c]))
4816         for {
4817                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4818                         if v_0.Op != OpLeq16U {
4819                                 continue
4820                         }
4821                         x := v_0.Args[1]
4822                         v_0_0 := v_0.Args[0]
4823                         if v_0_0.Op != OpConst16 {
4824                                 continue
4825                         }
4826                         c := auxIntToInt16(v_0_0.AuxInt)
4827                         if v_1.Op != OpLeq16U {
4828                                 continue
4829                         }
4830                         _ = v_1.Args[1]
4831                         if x != v_1.Args[0] {
4832                                 continue
4833                         }
4834                         v_1_1 := v_1.Args[1]
4835                         if v_1_1.Op != OpConst16 {
4836                                 continue
4837                         }
4838                         d := auxIntToInt16(v_1_1.AuxInt)
4839                         if !(uint16(d) >= uint16(c)) {
4840                                 continue
4841                         }
4842                         v.reset(OpLeq16U)
4843                         v0 := b.NewValue0(v.Pos, OpSub16, x.Type)
4844                         v1 := b.NewValue0(v.Pos, OpConst16, x.Type)
4845                         v1.AuxInt = int16ToAuxInt(c)
4846                         v0.AddArg2(x, v1)
4847                         v2 := b.NewValue0(v.Pos, OpConst16, x.Type)
4848                         v2.AuxInt = int16ToAuxInt(d - c)
4849                         v.AddArg2(v0, v2)
4850                         return true
4851                 }
4852                 break
4853         }
4854         // match: (AndB (Leq8U (Const8 [c]) x) (Less8U x (Const8 [d])))
4855         // cond: uint8(d) >= uint8(c)
4856         // result: (Less8U (Sub8 <x.Type> x (Const8 <x.Type> [c])) (Const8 <x.Type> [d-c]))
4857         for {
4858                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4859                         if v_0.Op != OpLeq8U {
4860                                 continue
4861                         }
4862                         x := v_0.Args[1]
4863                         v_0_0 := v_0.Args[0]
4864                         if v_0_0.Op != OpConst8 {
4865                                 continue
4866                         }
4867                         c := auxIntToInt8(v_0_0.AuxInt)
4868                         if v_1.Op != OpLess8U {
4869                                 continue
4870                         }
4871                         _ = v_1.Args[1]
4872                         if x != v_1.Args[0] {
4873                                 continue
4874                         }
4875                         v_1_1 := v_1.Args[1]
4876                         if v_1_1.Op != OpConst8 {
4877                                 continue
4878                         }
4879                         d := auxIntToInt8(v_1_1.AuxInt)
4880                         if !(uint8(d) >= uint8(c)) {
4881                                 continue
4882                         }
4883                         v.reset(OpLess8U)
4884                         v0 := b.NewValue0(v.Pos, OpSub8, x.Type)
4885                         v1 := b.NewValue0(v.Pos, OpConst8, x.Type)
4886                         v1.AuxInt = int8ToAuxInt(c)
4887                         v0.AddArg2(x, v1)
4888                         v2 := b.NewValue0(v.Pos, OpConst8, x.Type)
4889                         v2.AuxInt = int8ToAuxInt(d - c)
4890                         v.AddArg2(v0, v2)
4891                         return true
4892                 }
4893                 break
4894         }
4895         // match: (AndB (Leq8U (Const8 [c]) x) (Leq8U x (Const8 [d])))
4896         // cond: uint8(d) >= uint8(c)
4897         // result: (Leq8U (Sub8 <x.Type> x (Const8 <x.Type> [c])) (Const8 <x.Type> [d-c]))
4898         for {
4899                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4900                         if v_0.Op != OpLeq8U {
4901                                 continue
4902                         }
4903                         x := v_0.Args[1]
4904                         v_0_0 := v_0.Args[0]
4905                         if v_0_0.Op != OpConst8 {
4906                                 continue
4907                         }
4908                         c := auxIntToInt8(v_0_0.AuxInt)
4909                         if v_1.Op != OpLeq8U {
4910                                 continue
4911                         }
4912                         _ = v_1.Args[1]
4913                         if x != v_1.Args[0] {
4914                                 continue
4915                         }
4916                         v_1_1 := v_1.Args[1]
4917                         if v_1_1.Op != OpConst8 {
4918                                 continue
4919                         }
4920                         d := auxIntToInt8(v_1_1.AuxInt)
4921                         if !(uint8(d) >= uint8(c)) {
4922                                 continue
4923                         }
4924                         v.reset(OpLeq8U)
4925                         v0 := b.NewValue0(v.Pos, OpSub8, x.Type)
4926                         v1 := b.NewValue0(v.Pos, OpConst8, x.Type)
4927                         v1.AuxInt = int8ToAuxInt(c)
4928                         v0.AddArg2(x, v1)
4929                         v2 := b.NewValue0(v.Pos, OpConst8, x.Type)
4930                         v2.AuxInt = int8ToAuxInt(d - c)
4931                         v.AddArg2(v0, v2)
4932                         return true
4933                 }
4934                 break
4935         }
4936         // match: (AndB (Less64U (Const64 [c]) x) (Less64U x (Const64 [d])))
4937         // cond: uint64(d) >= uint64(c+1) && uint64(c+1) > uint64(c)
4938         // result: (Less64U (Sub64 <x.Type> x (Const64 <x.Type> [c+1])) (Const64 <x.Type> [d-c-1]))
4939         for {
4940                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4941                         if v_0.Op != OpLess64U {
4942                                 continue
4943                         }
4944                         x := v_0.Args[1]
4945                         v_0_0 := v_0.Args[0]
4946                         if v_0_0.Op != OpConst64 {
4947                                 continue
4948                         }
4949                         c := auxIntToInt64(v_0_0.AuxInt)
4950                         if v_1.Op != OpLess64U {
4951                                 continue
4952                         }
4953                         _ = v_1.Args[1]
4954                         if x != v_1.Args[0] {
4955                                 continue
4956                         }
4957                         v_1_1 := v_1.Args[1]
4958                         if v_1_1.Op != OpConst64 {
4959                                 continue
4960                         }
4961                         d := auxIntToInt64(v_1_1.AuxInt)
4962                         if !(uint64(d) >= uint64(c+1) && uint64(c+1) > uint64(c)) {
4963                                 continue
4964                         }
4965                         v.reset(OpLess64U)
4966                         v0 := b.NewValue0(v.Pos, OpSub64, x.Type)
4967                         v1 := b.NewValue0(v.Pos, OpConst64, x.Type)
4968                         v1.AuxInt = int64ToAuxInt(c + 1)
4969                         v0.AddArg2(x, v1)
4970                         v2 := b.NewValue0(v.Pos, OpConst64, x.Type)
4971                         v2.AuxInt = int64ToAuxInt(d - c - 1)
4972                         v.AddArg2(v0, v2)
4973                         return true
4974                 }
4975                 break
4976         }
4977         // match: (AndB (Less64U (Const64 [c]) x) (Leq64U x (Const64 [d])))
4978         // cond: uint64(d) >= uint64(c+1) && uint64(c+1) > uint64(c)
4979         // result: (Leq64U (Sub64 <x.Type> x (Const64 <x.Type> [c+1])) (Const64 <x.Type> [d-c-1]))
4980         for {
4981                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4982                         if v_0.Op != OpLess64U {
4983                                 continue
4984                         }
4985                         x := v_0.Args[1]
4986                         v_0_0 := v_0.Args[0]
4987                         if v_0_0.Op != OpConst64 {
4988                                 continue
4989                         }
4990                         c := auxIntToInt64(v_0_0.AuxInt)
4991                         if v_1.Op != OpLeq64U {
4992                                 continue
4993                         }
4994                         _ = v_1.Args[1]
4995                         if x != v_1.Args[0] {
4996                                 continue
4997                         }
4998                         v_1_1 := v_1.Args[1]
4999                         if v_1_1.Op != OpConst64 {
5000                                 continue
5001                         }
5002                         d := auxIntToInt64(v_1_1.AuxInt)
5003                         if !(uint64(d) >= uint64(c+1) && uint64(c+1) > uint64(c)) {
5004                                 continue
5005                         }
5006                         v.reset(OpLeq64U)
5007                         v0 := b.NewValue0(v.Pos, OpSub64, x.Type)
5008                         v1 := b.NewValue0(v.Pos, OpConst64, x.Type)
5009                         v1.AuxInt = int64ToAuxInt(c + 1)
5010                         v0.AddArg2(x, v1)
5011                         v2 := b.NewValue0(v.Pos, OpConst64, x.Type)
5012                         v2.AuxInt = int64ToAuxInt(d - c - 1)
5013                         v.AddArg2(v0, v2)
5014                         return true
5015                 }
5016                 break
5017         }
5018         // match: (AndB (Less32U (Const32 [c]) x) (Less32U x (Const32 [d])))
5019         // cond: uint32(d) >= uint32(c+1) && uint32(c+1) > uint32(c)
5020         // result: (Less32U (Sub32 <x.Type> x (Const32 <x.Type> [c+1])) (Const32 <x.Type> [d-c-1]))
5021         for {
5022                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5023                         if v_0.Op != OpLess32U {
5024                                 continue
5025                         }
5026                         x := v_0.Args[1]
5027                         v_0_0 := v_0.Args[0]
5028                         if v_0_0.Op != OpConst32 {
5029                                 continue
5030                         }
5031                         c := auxIntToInt32(v_0_0.AuxInt)
5032                         if v_1.Op != OpLess32U {
5033                                 continue
5034                         }
5035                         _ = v_1.Args[1]
5036                         if x != v_1.Args[0] {
5037                                 continue
5038                         }
5039                         v_1_1 := v_1.Args[1]
5040                         if v_1_1.Op != OpConst32 {
5041                                 continue
5042                         }
5043                         d := auxIntToInt32(v_1_1.AuxInt)
5044                         if !(uint32(d) >= uint32(c+1) && uint32(c+1) > uint32(c)) {
5045                                 continue
5046                         }
5047                         v.reset(OpLess32U)
5048                         v0 := b.NewValue0(v.Pos, OpSub32, x.Type)
5049                         v1 := b.NewValue0(v.Pos, OpConst32, x.Type)
5050                         v1.AuxInt = int32ToAuxInt(c + 1)
5051                         v0.AddArg2(x, v1)
5052                         v2 := b.NewValue0(v.Pos, OpConst32, x.Type)
5053                         v2.AuxInt = int32ToAuxInt(d - c - 1)
5054                         v.AddArg2(v0, v2)
5055                         return true
5056                 }
5057                 break
5058         }
5059         // match: (AndB (Less32U (Const32 [c]) x) (Leq32U x (Const32 [d])))
5060         // cond: uint32(d) >= uint32(c+1) && uint32(c+1) > uint32(c)
5061         // result: (Leq32U (Sub32 <x.Type> x (Const32 <x.Type> [c+1])) (Const32 <x.Type> [d-c-1]))
5062         for {
5063                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5064                         if v_0.Op != OpLess32U {
5065                                 continue
5066                         }
5067                         x := v_0.Args[1]
5068                         v_0_0 := v_0.Args[0]
5069                         if v_0_0.Op != OpConst32 {
5070                                 continue
5071                         }
5072                         c := auxIntToInt32(v_0_0.AuxInt)
5073                         if v_1.Op != OpLeq32U {
5074                                 continue
5075                         }
5076                         _ = v_1.Args[1]
5077                         if x != v_1.Args[0] {
5078                                 continue
5079                         }
5080                         v_1_1 := v_1.Args[1]
5081                         if v_1_1.Op != OpConst32 {
5082                                 continue
5083                         }
5084                         d := auxIntToInt32(v_1_1.AuxInt)
5085                         if !(uint32(d) >= uint32(c+1) && uint32(c+1) > uint32(c)) {
5086                                 continue
5087                         }
5088                         v.reset(OpLeq32U)
5089                         v0 := b.NewValue0(v.Pos, OpSub32, x.Type)
5090                         v1 := b.NewValue0(v.Pos, OpConst32, x.Type)
5091                         v1.AuxInt = int32ToAuxInt(c + 1)
5092                         v0.AddArg2(x, v1)
5093                         v2 := b.NewValue0(v.Pos, OpConst32, x.Type)
5094                         v2.AuxInt = int32ToAuxInt(d - c - 1)
5095                         v.AddArg2(v0, v2)
5096                         return true
5097                 }
5098                 break
5099         }
5100         // match: (AndB (Less16U (Const16 [c]) x) (Less16U x (Const16 [d])))
5101         // cond: uint16(d) >= uint16(c+1) && uint16(c+1) > uint16(c)
5102         // result: (Less16U (Sub16 <x.Type> x (Const16 <x.Type> [c+1])) (Const16 <x.Type> [d-c-1]))
5103         for {
5104                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5105                         if v_0.Op != OpLess16U {
5106                                 continue
5107                         }
5108                         x := v_0.Args[1]
5109                         v_0_0 := v_0.Args[0]
5110                         if v_0_0.Op != OpConst16 {
5111                                 continue
5112                         }
5113                         c := auxIntToInt16(v_0_0.AuxInt)
5114                         if v_1.Op != OpLess16U {
5115                                 continue
5116                         }
5117                         _ = v_1.Args[1]
5118                         if x != v_1.Args[0] {
5119                                 continue
5120                         }
5121                         v_1_1 := v_1.Args[1]
5122                         if v_1_1.Op != OpConst16 {
5123                                 continue
5124                         }
5125                         d := auxIntToInt16(v_1_1.AuxInt)
5126                         if !(uint16(d) >= uint16(c+1) && uint16(c+1) > uint16(c)) {
5127                                 continue
5128                         }
5129                         v.reset(OpLess16U)
5130                         v0 := b.NewValue0(v.Pos, OpSub16, x.Type)
5131                         v1 := b.NewValue0(v.Pos, OpConst16, x.Type)
5132                         v1.AuxInt = int16ToAuxInt(c + 1)
5133                         v0.AddArg2(x, v1)
5134                         v2 := b.NewValue0(v.Pos, OpConst16, x.Type)
5135                         v2.AuxInt = int16ToAuxInt(d - c - 1)
5136                         v.AddArg2(v0, v2)
5137                         return true
5138                 }
5139                 break
5140         }
5141         // match: (AndB (Less16U (Const16 [c]) x) (Leq16U x (Const16 [d])))
5142         // cond: uint16(d) >= uint16(c+1) && uint16(c+1) > uint16(c)
5143         // result: (Leq16U (Sub16 <x.Type> x (Const16 <x.Type> [c+1])) (Const16 <x.Type> [d-c-1]))
5144         for {
5145                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5146                         if v_0.Op != OpLess16U {
5147                                 continue
5148                         }
5149                         x := v_0.Args[1]
5150                         v_0_0 := v_0.Args[0]
5151                         if v_0_0.Op != OpConst16 {
5152                                 continue
5153                         }
5154                         c := auxIntToInt16(v_0_0.AuxInt)
5155                         if v_1.Op != OpLeq16U {
5156                                 continue
5157                         }
5158                         _ = v_1.Args[1]
5159                         if x != v_1.Args[0] {
5160                                 continue
5161                         }
5162                         v_1_1 := v_1.Args[1]
5163                         if v_1_1.Op != OpConst16 {
5164                                 continue
5165                         }
5166                         d := auxIntToInt16(v_1_1.AuxInt)
5167                         if !(uint16(d) >= uint16(c+1) && uint16(c+1) > uint16(c)) {
5168                                 continue
5169                         }
5170                         v.reset(OpLeq16U)
5171                         v0 := b.NewValue0(v.Pos, OpSub16, x.Type)
5172                         v1 := b.NewValue0(v.Pos, OpConst16, x.Type)
5173                         v1.AuxInt = int16ToAuxInt(c + 1)
5174                         v0.AddArg2(x, v1)
5175                         v2 := b.NewValue0(v.Pos, OpConst16, x.Type)
5176                         v2.AuxInt = int16ToAuxInt(d - c - 1)
5177                         v.AddArg2(v0, v2)
5178                         return true
5179                 }
5180                 break
5181         }
5182         // match: (AndB (Less8U (Const8 [c]) x) (Less8U x (Const8 [d])))
5183         // cond: uint8(d) >= uint8(c+1) && uint8(c+1) > uint8(c)
5184         // result: (Less8U (Sub8 <x.Type> x (Const8 <x.Type> [c+1])) (Const8 <x.Type> [d-c-1]))
5185         for {
5186                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5187                         if v_0.Op != OpLess8U {
5188                                 continue
5189                         }
5190                         x := v_0.Args[1]
5191                         v_0_0 := v_0.Args[0]
5192                         if v_0_0.Op != OpConst8 {
5193                                 continue
5194                         }
5195                         c := auxIntToInt8(v_0_0.AuxInt)
5196                         if v_1.Op != OpLess8U {
5197                                 continue
5198                         }
5199                         _ = v_1.Args[1]
5200                         if x != v_1.Args[0] {
5201                                 continue
5202                         }
5203                         v_1_1 := v_1.Args[1]
5204                         if v_1_1.Op != OpConst8 {
5205                                 continue
5206                         }
5207                         d := auxIntToInt8(v_1_1.AuxInt)
5208                         if !(uint8(d) >= uint8(c+1) && uint8(c+1) > uint8(c)) {
5209                                 continue
5210                         }
5211                         v.reset(OpLess8U)
5212                         v0 := b.NewValue0(v.Pos, OpSub8, x.Type)
5213                         v1 := b.NewValue0(v.Pos, OpConst8, x.Type)
5214                         v1.AuxInt = int8ToAuxInt(c + 1)
5215                         v0.AddArg2(x, v1)
5216                         v2 := b.NewValue0(v.Pos, OpConst8, x.Type)
5217                         v2.AuxInt = int8ToAuxInt(d - c - 1)
5218                         v.AddArg2(v0, v2)
5219                         return true
5220                 }
5221                 break
5222         }
5223         // match: (AndB (Less8U (Const8 [c]) x) (Leq8U x (Const8 [d])))
5224         // cond: uint8(d) >= uint8(c+1) && uint8(c+1) > uint8(c)
5225         // result: (Leq8U (Sub8 <x.Type> x (Const8 <x.Type> [c+1])) (Const8 <x.Type> [d-c-1]))
5226         for {
5227                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5228                         if v_0.Op != OpLess8U {
5229                                 continue
5230                         }
5231                         x := v_0.Args[1]
5232                         v_0_0 := v_0.Args[0]
5233                         if v_0_0.Op != OpConst8 {
5234                                 continue
5235                         }
5236                         c := auxIntToInt8(v_0_0.AuxInt)
5237                         if v_1.Op != OpLeq8U {
5238                                 continue
5239                         }
5240                         _ = v_1.Args[1]
5241                         if x != v_1.Args[0] {
5242                                 continue
5243                         }
5244                         v_1_1 := v_1.Args[1]
5245                         if v_1_1.Op != OpConst8 {
5246                                 continue
5247                         }
5248                         d := auxIntToInt8(v_1_1.AuxInt)
5249                         if !(uint8(d) >= uint8(c+1) && uint8(c+1) > uint8(c)) {
5250                                 continue
5251                         }
5252                         v.reset(OpLeq8U)
5253                         v0 := b.NewValue0(v.Pos, OpSub8, x.Type)
5254                         v1 := b.NewValue0(v.Pos, OpConst8, x.Type)
5255                         v1.AuxInt = int8ToAuxInt(c + 1)
5256                         v0.AddArg2(x, v1)
5257                         v2 := b.NewValue0(v.Pos, OpConst8, x.Type)
5258                         v2.AuxInt = int8ToAuxInt(d - c - 1)
5259                         v.AddArg2(v0, v2)
5260                         return true
5261                 }
5262                 break
5263         }
5264         return false
5265 }
5266 func rewriteValuegeneric_OpArraySelect(v *Value) bool {
5267         v_0 := v.Args[0]
5268         // match: (ArraySelect (ArrayMake1 x))
5269         // result: x
5270         for {
5271                 if v_0.Op != OpArrayMake1 {
5272                         break
5273                 }
5274                 x := v_0.Args[0]
5275                 v.copyOf(x)
5276                 return true
5277         }
5278         // match: (ArraySelect [0] (IData x))
5279         // result: (IData x)
5280         for {
5281                 if auxIntToInt64(v.AuxInt) != 0 || v_0.Op != OpIData {
5282                         break
5283                 }
5284                 x := v_0.Args[0]
5285                 v.reset(OpIData)
5286                 v.AddArg(x)
5287                 return true
5288         }
5289         return false
5290 }
5291 func rewriteValuegeneric_OpCeil(v *Value) bool {
5292         v_0 := v.Args[0]
5293         // match: (Ceil (Const64F [c]))
5294         // result: (Const64F [math.Ceil(c)])
5295         for {
5296                 if v_0.Op != OpConst64F {
5297                         break
5298                 }
5299                 c := auxIntToFloat64(v_0.AuxInt)
5300                 v.reset(OpConst64F)
5301                 v.AuxInt = float64ToAuxInt(math.Ceil(c))
5302                 return true
5303         }
5304         return false
5305 }
5306 func rewriteValuegeneric_OpCom16(v *Value) bool {
5307         v_0 := v.Args[0]
5308         // match: (Com16 (Com16 x))
5309         // result: x
5310         for {
5311                 if v_0.Op != OpCom16 {
5312                         break
5313                 }
5314                 x := v_0.Args[0]
5315                 v.copyOf(x)
5316                 return true
5317         }
5318         // match: (Com16 (Const16 [c]))
5319         // result: (Const16 [^c])
5320         for {
5321                 if v_0.Op != OpConst16 {
5322                         break
5323                 }
5324                 c := auxIntToInt16(v_0.AuxInt)
5325                 v.reset(OpConst16)
5326                 v.AuxInt = int16ToAuxInt(^c)
5327                 return true
5328         }
5329         // match: (Com16 (Add16 (Const16 [-1]) x))
5330         // result: (Neg16 x)
5331         for {
5332                 if v_0.Op != OpAdd16 {
5333                         break
5334                 }
5335                 _ = v_0.Args[1]
5336                 v_0_0 := v_0.Args[0]
5337                 v_0_1 := v_0.Args[1]
5338                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
5339                         if v_0_0.Op != OpConst16 || auxIntToInt16(v_0_0.AuxInt) != -1 {
5340                                 continue
5341                         }
5342                         x := v_0_1
5343                         v.reset(OpNeg16)
5344                         v.AddArg(x)
5345                         return true
5346                 }
5347                 break
5348         }
5349         return false
5350 }
5351 func rewriteValuegeneric_OpCom32(v *Value) bool {
5352         v_0 := v.Args[0]
5353         // match: (Com32 (Com32 x))
5354         // result: x
5355         for {
5356                 if v_0.Op != OpCom32 {
5357                         break
5358                 }
5359                 x := v_0.Args[0]
5360                 v.copyOf(x)
5361                 return true
5362         }
5363         // match: (Com32 (Const32 [c]))
5364         // result: (Const32 [^c])
5365         for {
5366                 if v_0.Op != OpConst32 {
5367                         break
5368                 }
5369                 c := auxIntToInt32(v_0.AuxInt)
5370                 v.reset(OpConst32)
5371                 v.AuxInt = int32ToAuxInt(^c)
5372                 return true
5373         }
5374         // match: (Com32 (Add32 (Const32 [-1]) x))
5375         // result: (Neg32 x)
5376         for {
5377                 if v_0.Op != OpAdd32 {
5378                         break
5379                 }
5380                 _ = v_0.Args[1]
5381                 v_0_0 := v_0.Args[0]
5382                 v_0_1 := v_0.Args[1]
5383                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
5384                         if v_0_0.Op != OpConst32 || auxIntToInt32(v_0_0.AuxInt) != -1 {
5385                                 continue
5386                         }
5387                         x := v_0_1
5388                         v.reset(OpNeg32)
5389                         v.AddArg(x)
5390                         return true
5391                 }
5392                 break
5393         }
5394         return false
5395 }
5396 func rewriteValuegeneric_OpCom64(v *Value) bool {
5397         v_0 := v.Args[0]
5398         // match: (Com64 (Com64 x))
5399         // result: x
5400         for {
5401                 if v_0.Op != OpCom64 {
5402                         break
5403                 }
5404                 x := v_0.Args[0]
5405                 v.copyOf(x)
5406                 return true
5407         }
5408         // match: (Com64 (Const64 [c]))
5409         // result: (Const64 [^c])
5410         for {
5411                 if v_0.Op != OpConst64 {
5412                         break
5413                 }
5414                 c := auxIntToInt64(v_0.AuxInt)
5415                 v.reset(OpConst64)
5416                 v.AuxInt = int64ToAuxInt(^c)
5417                 return true
5418         }
5419         // match: (Com64 (Add64 (Const64 [-1]) x))
5420         // result: (Neg64 x)
5421         for {
5422                 if v_0.Op != OpAdd64 {
5423                         break
5424                 }
5425                 _ = v_0.Args[1]
5426                 v_0_0 := v_0.Args[0]
5427                 v_0_1 := v_0.Args[1]
5428                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
5429                         if v_0_0.Op != OpConst64 || auxIntToInt64(v_0_0.AuxInt) != -1 {
5430                                 continue
5431                         }
5432                         x := v_0_1
5433                         v.reset(OpNeg64)
5434                         v.AddArg(x)
5435                         return true
5436                 }
5437                 break
5438         }
5439         return false
5440 }
5441 func rewriteValuegeneric_OpCom8(v *Value) bool {
5442         v_0 := v.Args[0]
5443         // match: (Com8 (Com8 x))
5444         // result: x
5445         for {
5446                 if v_0.Op != OpCom8 {
5447                         break
5448                 }
5449                 x := v_0.Args[0]
5450                 v.copyOf(x)
5451                 return true
5452         }
5453         // match: (Com8 (Const8 [c]))
5454         // result: (Const8 [^c])
5455         for {
5456                 if v_0.Op != OpConst8 {
5457                         break
5458                 }
5459                 c := auxIntToInt8(v_0.AuxInt)
5460                 v.reset(OpConst8)
5461                 v.AuxInt = int8ToAuxInt(^c)
5462                 return true
5463         }
5464         // match: (Com8 (Add8 (Const8 [-1]) x))
5465         // result: (Neg8 x)
5466         for {
5467                 if v_0.Op != OpAdd8 {
5468                         break
5469                 }
5470                 _ = v_0.Args[1]
5471                 v_0_0 := v_0.Args[0]
5472                 v_0_1 := v_0.Args[1]
5473                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
5474                         if v_0_0.Op != OpConst8 || auxIntToInt8(v_0_0.AuxInt) != -1 {
5475                                 continue
5476                         }
5477                         x := v_0_1
5478                         v.reset(OpNeg8)
5479                         v.AddArg(x)
5480                         return true
5481                 }
5482                 break
5483         }
5484         return false
5485 }
5486 func rewriteValuegeneric_OpConstInterface(v *Value) bool {
5487         b := v.Block
5488         typ := &b.Func.Config.Types
5489         // match: (ConstInterface)
5490         // result: (IMake (ConstNil <typ.Uintptr>) (ConstNil <typ.BytePtr>))
5491         for {
5492                 v.reset(OpIMake)
5493                 v0 := b.NewValue0(v.Pos, OpConstNil, typ.Uintptr)
5494                 v1 := b.NewValue0(v.Pos, OpConstNil, typ.BytePtr)
5495                 v.AddArg2(v0, v1)
5496                 return true
5497         }
5498 }
5499 func rewriteValuegeneric_OpConstSlice(v *Value) bool {
5500         b := v.Block
5501         config := b.Func.Config
5502         typ := &b.Func.Config.Types
5503         // match: (ConstSlice)
5504         // cond: config.PtrSize == 4
5505         // result: (SliceMake (ConstNil <v.Type.Elem().PtrTo()>) (Const32 <typ.Int> [0]) (Const32 <typ.Int> [0]))
5506         for {
5507                 if !(config.PtrSize == 4) {
5508                         break
5509                 }
5510                 v.reset(OpSliceMake)
5511                 v0 := b.NewValue0(v.Pos, OpConstNil, v.Type.Elem().PtrTo())
5512                 v1 := b.NewValue0(v.Pos, OpConst32, typ.Int)
5513                 v1.AuxInt = int32ToAuxInt(0)
5514                 v.AddArg3(v0, v1, v1)
5515                 return true
5516         }
5517         // match: (ConstSlice)
5518         // cond: config.PtrSize == 8
5519         // result: (SliceMake (ConstNil <v.Type.Elem().PtrTo()>) (Const64 <typ.Int> [0]) (Const64 <typ.Int> [0]))
5520         for {
5521                 if !(config.PtrSize == 8) {
5522                         break
5523                 }
5524                 v.reset(OpSliceMake)
5525                 v0 := b.NewValue0(v.Pos, OpConstNil, v.Type.Elem().PtrTo())
5526                 v1 := b.NewValue0(v.Pos, OpConst64, typ.Int)
5527                 v1.AuxInt = int64ToAuxInt(0)
5528                 v.AddArg3(v0, v1, v1)
5529                 return true
5530         }
5531         return false
5532 }
5533 func rewriteValuegeneric_OpConstString(v *Value) bool {
5534         b := v.Block
5535         config := b.Func.Config
5536         fe := b.Func.fe
5537         typ := &b.Func.Config.Types
5538         // match: (ConstString {str})
5539         // cond: config.PtrSize == 4 && str == ""
5540         // result: (StringMake (ConstNil) (Const32 <typ.Int> [0]))
5541         for {
5542                 str := auxToString(v.Aux)
5543                 if !(config.PtrSize == 4 && str == "") {
5544                         break
5545                 }
5546                 v.reset(OpStringMake)
5547                 v0 := b.NewValue0(v.Pos, OpConstNil, typ.BytePtr)
5548                 v1 := b.NewValue0(v.Pos, OpConst32, typ.Int)
5549                 v1.AuxInt = int32ToAuxInt(0)
5550                 v.AddArg2(v0, v1)
5551                 return true
5552         }
5553         // match: (ConstString {str})
5554         // cond: config.PtrSize == 8 && str == ""
5555         // result: (StringMake (ConstNil) (Const64 <typ.Int> [0]))
5556         for {
5557                 str := auxToString(v.Aux)
5558                 if !(config.PtrSize == 8 && str == "") {
5559                         break
5560                 }
5561                 v.reset(OpStringMake)
5562                 v0 := b.NewValue0(v.Pos, OpConstNil, typ.BytePtr)
5563                 v1 := b.NewValue0(v.Pos, OpConst64, typ.Int)
5564                 v1.AuxInt = int64ToAuxInt(0)
5565                 v.AddArg2(v0, v1)
5566                 return true
5567         }
5568         // match: (ConstString {str})
5569         // cond: config.PtrSize == 4 && str != ""
5570         // result: (StringMake (Addr <typ.BytePtr> {fe.StringData(str)} (SB)) (Const32 <typ.Int> [int32(len(str))]))
5571         for {
5572                 str := auxToString(v.Aux)
5573                 if !(config.PtrSize == 4 && str != "") {
5574                         break
5575                 }
5576                 v.reset(OpStringMake)
5577                 v0 := b.NewValue0(v.Pos, OpAddr, typ.BytePtr)
5578                 v0.Aux = symToAux(fe.StringData(str))
5579                 v1 := b.NewValue0(v.Pos, OpSB, typ.Uintptr)
5580                 v0.AddArg(v1)
5581                 v2 := b.NewValue0(v.Pos, OpConst32, typ.Int)
5582                 v2.AuxInt = int32ToAuxInt(int32(len(str)))
5583                 v.AddArg2(v0, v2)
5584                 return true
5585         }
5586         // match: (ConstString {str})
5587         // cond: config.PtrSize == 8 && str != ""
5588         // result: (StringMake (Addr <typ.BytePtr> {fe.StringData(str)} (SB)) (Const64 <typ.Int> [int64(len(str))]))
5589         for {
5590                 str := auxToString(v.Aux)
5591                 if !(config.PtrSize == 8 && str != "") {
5592                         break
5593                 }
5594                 v.reset(OpStringMake)
5595                 v0 := b.NewValue0(v.Pos, OpAddr, typ.BytePtr)
5596                 v0.Aux = symToAux(fe.StringData(str))
5597                 v1 := b.NewValue0(v.Pos, OpSB, typ.Uintptr)
5598                 v0.AddArg(v1)
5599                 v2 := b.NewValue0(v.Pos, OpConst64, typ.Int)
5600                 v2.AuxInt = int64ToAuxInt(int64(len(str)))
5601                 v.AddArg2(v0, v2)
5602                 return true
5603         }
5604         return false
5605 }
5606 func rewriteValuegeneric_OpConvert(v *Value) bool {
5607         v_1 := v.Args[1]
5608         v_0 := v.Args[0]
5609         // match: (Convert (Add64 (Convert ptr mem) off) mem)
5610         // result: (AddPtr ptr off)
5611         for {
5612                 if v_0.Op != OpAdd64 {
5613                         break
5614                 }
5615                 _ = v_0.Args[1]
5616                 v_0_0 := v_0.Args[0]
5617                 v_0_1 := v_0.Args[1]
5618                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
5619                         if v_0_0.Op != OpConvert {
5620                                 continue
5621                         }
5622                         mem := v_0_0.Args[1]
5623                         ptr := v_0_0.Args[0]
5624                         off := v_0_1
5625                         if mem != v_1 {
5626                                 continue
5627                         }
5628                         v.reset(OpAddPtr)
5629                         v.AddArg2(ptr, off)
5630                         return true
5631                 }
5632                 break
5633         }
5634         // match: (Convert (Add32 (Convert ptr mem) off) mem)
5635         // result: (AddPtr ptr off)
5636         for {
5637                 if v_0.Op != OpAdd32 {
5638                         break
5639                 }
5640                 _ = v_0.Args[1]
5641                 v_0_0 := v_0.Args[0]
5642                 v_0_1 := v_0.Args[1]
5643                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
5644                         if v_0_0.Op != OpConvert {
5645                                 continue
5646                         }
5647                         mem := v_0_0.Args[1]
5648                         ptr := v_0_0.Args[0]
5649                         off := v_0_1
5650                         if mem != v_1 {
5651                                 continue
5652                         }
5653                         v.reset(OpAddPtr)
5654                         v.AddArg2(ptr, off)
5655                         return true
5656                 }
5657                 break
5658         }
5659         // match: (Convert (Convert ptr mem) mem)
5660         // result: ptr
5661         for {
5662                 if v_0.Op != OpConvert {
5663                         break
5664                 }
5665                 mem := v_0.Args[1]
5666                 ptr := v_0.Args[0]
5667                 if mem != v_1 {
5668                         break
5669                 }
5670                 v.copyOf(ptr)
5671                 return true
5672         }
5673         return false
5674 }
5675 func rewriteValuegeneric_OpCtz16(v *Value) bool {
5676         v_0 := v.Args[0]
5677         b := v.Block
5678         config := b.Func.Config
5679         // match: (Ctz16 (Const16 [c]))
5680         // cond: config.PtrSize == 4
5681         // result: (Const32 [int32(ntz16(c))])
5682         for {
5683                 if v_0.Op != OpConst16 {
5684                         break
5685                 }
5686                 c := auxIntToInt16(v_0.AuxInt)
5687                 if !(config.PtrSize == 4) {
5688                         break
5689                 }
5690                 v.reset(OpConst32)
5691                 v.AuxInt = int32ToAuxInt(int32(ntz16(c)))
5692                 return true
5693         }
5694         // match: (Ctz16 (Const16 [c]))
5695         // cond: config.PtrSize == 8
5696         // result: (Const64 [int64(ntz16(c))])
5697         for {
5698                 if v_0.Op != OpConst16 {
5699                         break
5700                 }
5701                 c := auxIntToInt16(v_0.AuxInt)
5702                 if !(config.PtrSize == 8) {
5703                         break
5704                 }
5705                 v.reset(OpConst64)
5706                 v.AuxInt = int64ToAuxInt(int64(ntz16(c)))
5707                 return true
5708         }
5709         return false
5710 }
5711 func rewriteValuegeneric_OpCtz32(v *Value) bool {
5712         v_0 := v.Args[0]
5713         b := v.Block
5714         config := b.Func.Config
5715         // match: (Ctz32 (Const32 [c]))
5716         // cond: config.PtrSize == 4
5717         // result: (Const32 [int32(ntz32(c))])
5718         for {
5719                 if v_0.Op != OpConst32 {
5720                         break
5721                 }
5722                 c := auxIntToInt32(v_0.AuxInt)
5723                 if !(config.PtrSize == 4) {
5724                         break
5725                 }
5726                 v.reset(OpConst32)
5727                 v.AuxInt = int32ToAuxInt(int32(ntz32(c)))
5728                 return true
5729         }
5730         // match: (Ctz32 (Const32 [c]))
5731         // cond: config.PtrSize == 8
5732         // result: (Const64 [int64(ntz32(c))])
5733         for {
5734                 if v_0.Op != OpConst32 {
5735                         break
5736                 }
5737                 c := auxIntToInt32(v_0.AuxInt)
5738                 if !(config.PtrSize == 8) {
5739                         break
5740                 }
5741                 v.reset(OpConst64)
5742                 v.AuxInt = int64ToAuxInt(int64(ntz32(c)))
5743                 return true
5744         }
5745         return false
5746 }
5747 func rewriteValuegeneric_OpCtz64(v *Value) bool {
5748         v_0 := v.Args[0]
5749         b := v.Block
5750         config := b.Func.Config
5751         // match: (Ctz64 (Const64 [c]))
5752         // cond: config.PtrSize == 4
5753         // result: (Const32 [int32(ntz64(c))])
5754         for {
5755                 if v_0.Op != OpConst64 {
5756                         break
5757                 }
5758                 c := auxIntToInt64(v_0.AuxInt)
5759                 if !(config.PtrSize == 4) {
5760                         break
5761                 }
5762                 v.reset(OpConst32)
5763                 v.AuxInt = int32ToAuxInt(int32(ntz64(c)))
5764                 return true
5765         }
5766         // match: (Ctz64 (Const64 [c]))
5767         // cond: config.PtrSize == 8
5768         // result: (Const64 [int64(ntz64(c))])
5769         for {
5770                 if v_0.Op != OpConst64 {
5771                         break
5772                 }
5773                 c := auxIntToInt64(v_0.AuxInt)
5774                 if !(config.PtrSize == 8) {
5775                         break
5776                 }
5777                 v.reset(OpConst64)
5778                 v.AuxInt = int64ToAuxInt(int64(ntz64(c)))
5779                 return true
5780         }
5781         return false
5782 }
5783 func rewriteValuegeneric_OpCtz8(v *Value) bool {
5784         v_0 := v.Args[0]
5785         b := v.Block
5786         config := b.Func.Config
5787         // match: (Ctz8 (Const8 [c]))
5788         // cond: config.PtrSize == 4
5789         // result: (Const32 [int32(ntz8(c))])
5790         for {
5791                 if v_0.Op != OpConst8 {
5792                         break
5793                 }
5794                 c := auxIntToInt8(v_0.AuxInt)
5795                 if !(config.PtrSize == 4) {
5796                         break
5797                 }
5798                 v.reset(OpConst32)
5799                 v.AuxInt = int32ToAuxInt(int32(ntz8(c)))
5800                 return true
5801         }
5802         // match: (Ctz8 (Const8 [c]))
5803         // cond: config.PtrSize == 8
5804         // result: (Const64 [int64(ntz8(c))])
5805         for {
5806                 if v_0.Op != OpConst8 {
5807                         break
5808                 }
5809                 c := auxIntToInt8(v_0.AuxInt)
5810                 if !(config.PtrSize == 8) {
5811                         break
5812                 }
5813                 v.reset(OpConst64)
5814                 v.AuxInt = int64ToAuxInt(int64(ntz8(c)))
5815                 return true
5816         }
5817         return false
5818 }
5819 func rewriteValuegeneric_OpCvt32Fto32(v *Value) bool {
5820         v_0 := v.Args[0]
5821         // match: (Cvt32Fto32 (Const32F [c]))
5822         // result: (Const32 [int32(c)])
5823         for {
5824                 if v_0.Op != OpConst32F {
5825                         break
5826                 }
5827                 c := auxIntToFloat32(v_0.AuxInt)
5828                 v.reset(OpConst32)
5829                 v.AuxInt = int32ToAuxInt(int32(c))
5830                 return true
5831         }
5832         return false
5833 }
5834 func rewriteValuegeneric_OpCvt32Fto64(v *Value) bool {
5835         v_0 := v.Args[0]
5836         // match: (Cvt32Fto64 (Const32F [c]))
5837         // result: (Const64 [int64(c)])
5838         for {
5839                 if v_0.Op != OpConst32F {
5840                         break
5841                 }
5842                 c := auxIntToFloat32(v_0.AuxInt)
5843                 v.reset(OpConst64)
5844                 v.AuxInt = int64ToAuxInt(int64(c))
5845                 return true
5846         }
5847         return false
5848 }
5849 func rewriteValuegeneric_OpCvt32Fto64F(v *Value) bool {
5850         v_0 := v.Args[0]
5851         // match: (Cvt32Fto64F (Const32F [c]))
5852         // result: (Const64F [float64(c)])
5853         for {
5854                 if v_0.Op != OpConst32F {
5855                         break
5856                 }
5857                 c := auxIntToFloat32(v_0.AuxInt)
5858                 v.reset(OpConst64F)
5859                 v.AuxInt = float64ToAuxInt(float64(c))
5860                 return true
5861         }
5862         return false
5863 }
5864 func rewriteValuegeneric_OpCvt32to32F(v *Value) bool {
5865         v_0 := v.Args[0]
5866         // match: (Cvt32to32F (Const32 [c]))
5867         // result: (Const32F [float32(c)])
5868         for {
5869                 if v_0.Op != OpConst32 {
5870                         break
5871                 }
5872                 c := auxIntToInt32(v_0.AuxInt)
5873                 v.reset(OpConst32F)
5874                 v.AuxInt = float32ToAuxInt(float32(c))
5875                 return true
5876         }
5877         return false
5878 }
5879 func rewriteValuegeneric_OpCvt32to64F(v *Value) bool {
5880         v_0 := v.Args[0]
5881         // match: (Cvt32to64F (Const32 [c]))
5882         // result: (Const64F [float64(c)])
5883         for {
5884                 if v_0.Op != OpConst32 {
5885                         break
5886                 }
5887                 c := auxIntToInt32(v_0.AuxInt)
5888                 v.reset(OpConst64F)
5889                 v.AuxInt = float64ToAuxInt(float64(c))
5890                 return true
5891         }
5892         return false
5893 }
5894 func rewriteValuegeneric_OpCvt64Fto32(v *Value) bool {
5895         v_0 := v.Args[0]
5896         // match: (Cvt64Fto32 (Const64F [c]))
5897         // result: (Const32 [int32(c)])
5898         for {
5899                 if v_0.Op != OpConst64F {
5900                         break
5901                 }
5902                 c := auxIntToFloat64(v_0.AuxInt)
5903                 v.reset(OpConst32)
5904                 v.AuxInt = int32ToAuxInt(int32(c))
5905                 return true
5906         }
5907         return false
5908 }
5909 func rewriteValuegeneric_OpCvt64Fto32F(v *Value) bool {
5910         v_0 := v.Args[0]
5911         // match: (Cvt64Fto32F (Const64F [c]))
5912         // result: (Const32F [float32(c)])
5913         for {
5914                 if v_0.Op != OpConst64F {
5915                         break
5916                 }
5917                 c := auxIntToFloat64(v_0.AuxInt)
5918                 v.reset(OpConst32F)
5919                 v.AuxInt = float32ToAuxInt(float32(c))
5920                 return true
5921         }
5922         // match: (Cvt64Fto32F sqrt0:(Sqrt (Cvt32Fto64F x)))
5923         // cond: sqrt0.Uses==1
5924         // result: (Sqrt32 x)
5925         for {
5926                 sqrt0 := v_0
5927                 if sqrt0.Op != OpSqrt {
5928                         break
5929                 }
5930                 sqrt0_0 := sqrt0.Args[0]
5931                 if sqrt0_0.Op != OpCvt32Fto64F {
5932                         break
5933                 }
5934                 x := sqrt0_0.Args[0]
5935                 if !(sqrt0.Uses == 1) {
5936                         break
5937                 }
5938                 v.reset(OpSqrt32)
5939                 v.AddArg(x)
5940                 return true
5941         }
5942         return false
5943 }
5944 func rewriteValuegeneric_OpCvt64Fto64(v *Value) bool {
5945         v_0 := v.Args[0]
5946         // match: (Cvt64Fto64 (Const64F [c]))
5947         // result: (Const64 [int64(c)])
5948         for {
5949                 if v_0.Op != OpConst64F {
5950                         break
5951                 }
5952                 c := auxIntToFloat64(v_0.AuxInt)
5953                 v.reset(OpConst64)
5954                 v.AuxInt = int64ToAuxInt(int64(c))
5955                 return true
5956         }
5957         return false
5958 }
5959 func rewriteValuegeneric_OpCvt64to32F(v *Value) bool {
5960         v_0 := v.Args[0]
5961         // match: (Cvt64to32F (Const64 [c]))
5962         // result: (Const32F [float32(c)])
5963         for {
5964                 if v_0.Op != OpConst64 {
5965                         break
5966                 }
5967                 c := auxIntToInt64(v_0.AuxInt)
5968                 v.reset(OpConst32F)
5969                 v.AuxInt = float32ToAuxInt(float32(c))
5970                 return true
5971         }
5972         return false
5973 }
5974 func rewriteValuegeneric_OpCvt64to64F(v *Value) bool {
5975         v_0 := v.Args[0]
5976         // match: (Cvt64to64F (Const64 [c]))
5977         // result: (Const64F [float64(c)])
5978         for {
5979                 if v_0.Op != OpConst64 {
5980                         break
5981                 }
5982                 c := auxIntToInt64(v_0.AuxInt)
5983                 v.reset(OpConst64F)
5984                 v.AuxInt = float64ToAuxInt(float64(c))
5985                 return true
5986         }
5987         return false
5988 }
5989 func rewriteValuegeneric_OpCvtBoolToUint8(v *Value) bool {
5990         v_0 := v.Args[0]
5991         // match: (CvtBoolToUint8 (ConstBool [false]))
5992         // result: (Const8 [0])
5993         for {
5994                 if v_0.Op != OpConstBool || auxIntToBool(v_0.AuxInt) != false {
5995                         break
5996                 }
5997                 v.reset(OpConst8)
5998                 v.AuxInt = int8ToAuxInt(0)
5999                 return true
6000         }
6001         // match: (CvtBoolToUint8 (ConstBool [true]))
6002         // result: (Const8 [1])
6003         for {
6004                 if v_0.Op != OpConstBool || auxIntToBool(v_0.AuxInt) != true {
6005                         break
6006                 }
6007                 v.reset(OpConst8)
6008                 v.AuxInt = int8ToAuxInt(1)
6009                 return true
6010         }
6011         return false
6012 }
6013 func rewriteValuegeneric_OpDiv16(v *Value) bool {
6014         v_1 := v.Args[1]
6015         v_0 := v.Args[0]
6016         b := v.Block
6017         typ := &b.Func.Config.Types
6018         // match: (Div16 (Const16 [c]) (Const16 [d]))
6019         // cond: d != 0
6020         // result: (Const16 [c/d])
6021         for {
6022                 if v_0.Op != OpConst16 {
6023                         break
6024                 }
6025                 c := auxIntToInt16(v_0.AuxInt)
6026                 if v_1.Op != OpConst16 {
6027                         break
6028                 }
6029                 d := auxIntToInt16(v_1.AuxInt)
6030                 if !(d != 0) {
6031                         break
6032                 }
6033                 v.reset(OpConst16)
6034                 v.AuxInt = int16ToAuxInt(c / d)
6035                 return true
6036         }
6037         // match: (Div16 n (Const16 [c]))
6038         // cond: isNonNegative(n) && isPowerOfTwo16(c)
6039         // result: (Rsh16Ux64 n (Const64 <typ.UInt64> [log16(c)]))
6040         for {
6041                 n := v_0
6042                 if v_1.Op != OpConst16 {
6043                         break
6044                 }
6045                 c := auxIntToInt16(v_1.AuxInt)
6046                 if !(isNonNegative(n) && isPowerOfTwo16(c)) {
6047                         break
6048                 }
6049                 v.reset(OpRsh16Ux64)
6050                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6051                 v0.AuxInt = int64ToAuxInt(log16(c))
6052                 v.AddArg2(n, v0)
6053                 return true
6054         }
6055         // match: (Div16 <t> n (Const16 [c]))
6056         // cond: c < 0 && c != -1<<15
6057         // result: (Neg16 (Div16 <t> n (Const16 <t> [-c])))
6058         for {
6059                 t := v.Type
6060                 n := v_0
6061                 if v_1.Op != OpConst16 {
6062                         break
6063                 }
6064                 c := auxIntToInt16(v_1.AuxInt)
6065                 if !(c < 0 && c != -1<<15) {
6066                         break
6067                 }
6068                 v.reset(OpNeg16)
6069                 v0 := b.NewValue0(v.Pos, OpDiv16, t)
6070                 v1 := b.NewValue0(v.Pos, OpConst16, t)
6071                 v1.AuxInt = int16ToAuxInt(-c)
6072                 v0.AddArg2(n, v1)
6073                 v.AddArg(v0)
6074                 return true
6075         }
6076         // match: (Div16 <t> x (Const16 [-1<<15]))
6077         // result: (Rsh16Ux64 (And16 <t> x (Neg16 <t> x)) (Const64 <typ.UInt64> [15]))
6078         for {
6079                 t := v.Type
6080                 x := v_0
6081                 if v_1.Op != OpConst16 || auxIntToInt16(v_1.AuxInt) != -1<<15 {
6082                         break
6083                 }
6084                 v.reset(OpRsh16Ux64)
6085                 v0 := b.NewValue0(v.Pos, OpAnd16, t)
6086                 v1 := b.NewValue0(v.Pos, OpNeg16, t)
6087                 v1.AddArg(x)
6088                 v0.AddArg2(x, v1)
6089                 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6090                 v2.AuxInt = int64ToAuxInt(15)
6091                 v.AddArg2(v0, v2)
6092                 return true
6093         }
6094         // match: (Div16 <t> n (Const16 [c]))
6095         // cond: isPowerOfTwo16(c)
6096         // result: (Rsh16x64 (Add16 <t> n (Rsh16Ux64 <t> (Rsh16x64 <t> n (Const64 <typ.UInt64> [15])) (Const64 <typ.UInt64> [int64(16-log16(c))]))) (Const64 <typ.UInt64> [int64(log16(c))]))
6097         for {
6098                 t := v.Type
6099                 n := v_0
6100                 if v_1.Op != OpConst16 {
6101                         break
6102                 }
6103                 c := auxIntToInt16(v_1.AuxInt)
6104                 if !(isPowerOfTwo16(c)) {
6105                         break
6106                 }
6107                 v.reset(OpRsh16x64)
6108                 v0 := b.NewValue0(v.Pos, OpAdd16, t)
6109                 v1 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
6110                 v2 := b.NewValue0(v.Pos, OpRsh16x64, t)
6111                 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6112                 v3.AuxInt = int64ToAuxInt(15)
6113                 v2.AddArg2(n, v3)
6114                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6115                 v4.AuxInt = int64ToAuxInt(int64(16 - log16(c)))
6116                 v1.AddArg2(v2, v4)
6117                 v0.AddArg2(n, v1)
6118                 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6119                 v5.AuxInt = int64ToAuxInt(int64(log16(c)))
6120                 v.AddArg2(v0, v5)
6121                 return true
6122         }
6123         // match: (Div16 <t> x (Const16 [c]))
6124         // cond: smagicOK16(c)
6125         // result: (Sub16 <t> (Rsh32x64 <t> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int32(smagic16(c).m)]) (SignExt16to32 x)) (Const64 <typ.UInt64> [16+smagic16(c).s])) (Rsh32x64 <t> (SignExt16to32 x) (Const64 <typ.UInt64> [31])))
6126         for {
6127                 t := v.Type
6128                 x := v_0
6129                 if v_1.Op != OpConst16 {
6130                         break
6131                 }
6132                 c := auxIntToInt16(v_1.AuxInt)
6133                 if !(smagicOK16(c)) {
6134                         break
6135                 }
6136                 v.reset(OpSub16)
6137                 v.Type = t
6138                 v0 := b.NewValue0(v.Pos, OpRsh32x64, t)
6139                 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
6140                 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
6141                 v2.AuxInt = int32ToAuxInt(int32(smagic16(c).m))
6142                 v3 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
6143                 v3.AddArg(x)
6144                 v1.AddArg2(v2, v3)
6145                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6146                 v4.AuxInt = int64ToAuxInt(16 + smagic16(c).s)
6147                 v0.AddArg2(v1, v4)
6148                 v5 := b.NewValue0(v.Pos, OpRsh32x64, t)
6149                 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6150                 v6.AuxInt = int64ToAuxInt(31)
6151                 v5.AddArg2(v3, v6)
6152                 v.AddArg2(v0, v5)
6153                 return true
6154         }
6155         return false
6156 }
6157 func rewriteValuegeneric_OpDiv16u(v *Value) bool {
6158         v_1 := v.Args[1]
6159         v_0 := v.Args[0]
6160         b := v.Block
6161         config := b.Func.Config
6162         typ := &b.Func.Config.Types
6163         // match: (Div16u (Const16 [c]) (Const16 [d]))
6164         // cond: d != 0
6165         // result: (Const16 [int16(uint16(c)/uint16(d))])
6166         for {
6167                 if v_0.Op != OpConst16 {
6168                         break
6169                 }
6170                 c := auxIntToInt16(v_0.AuxInt)
6171                 if v_1.Op != OpConst16 {
6172                         break
6173                 }
6174                 d := auxIntToInt16(v_1.AuxInt)
6175                 if !(d != 0) {
6176                         break
6177                 }
6178                 v.reset(OpConst16)
6179                 v.AuxInt = int16ToAuxInt(int16(uint16(c) / uint16(d)))
6180                 return true
6181         }
6182         // match: (Div16u n (Const16 [c]))
6183         // cond: isPowerOfTwo16(c)
6184         // result: (Rsh16Ux64 n (Const64 <typ.UInt64> [log16(c)]))
6185         for {
6186                 n := v_0
6187                 if v_1.Op != OpConst16 {
6188                         break
6189                 }
6190                 c := auxIntToInt16(v_1.AuxInt)
6191                 if !(isPowerOfTwo16(c)) {
6192                         break
6193                 }
6194                 v.reset(OpRsh16Ux64)
6195                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6196                 v0.AuxInt = int64ToAuxInt(log16(c))
6197                 v.AddArg2(n, v0)
6198                 return true
6199         }
6200         // match: (Div16u x (Const16 [c]))
6201         // cond: umagicOK16(c) && config.RegSize == 8
6202         // result: (Trunc64to16 (Rsh64Ux64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(1<<16+umagic16(c).m)]) (ZeroExt16to64 x)) (Const64 <typ.UInt64> [16+umagic16(c).s])))
6203         for {
6204                 x := v_0
6205                 if v_1.Op != OpConst16 {
6206                         break
6207                 }
6208                 c := auxIntToInt16(v_1.AuxInt)
6209                 if !(umagicOK16(c) && config.RegSize == 8) {
6210                         break
6211                 }
6212                 v.reset(OpTrunc64to16)
6213                 v0 := b.NewValue0(v.Pos, OpRsh64Ux64, typ.UInt64)
6214                 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64)
6215                 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6216                 v2.AuxInt = int64ToAuxInt(int64(1<<16 + umagic16(c).m))
6217                 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
6218                 v3.AddArg(x)
6219                 v1.AddArg2(v2, v3)
6220                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6221                 v4.AuxInt = int64ToAuxInt(16 + umagic16(c).s)
6222                 v0.AddArg2(v1, v4)
6223                 v.AddArg(v0)
6224                 return true
6225         }
6226         // match: (Div16u x (Const16 [c]))
6227         // cond: umagicOK16(c) && config.RegSize == 4 && umagic16(c).m&1 == 0
6228         // result: (Trunc32to16 (Rsh32Ux64 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int32(1<<15+umagic16(c).m/2)]) (ZeroExt16to32 x)) (Const64 <typ.UInt64> [16+umagic16(c).s-1])))
6229         for {
6230                 x := v_0
6231                 if v_1.Op != OpConst16 {
6232                         break
6233                 }
6234                 c := auxIntToInt16(v_1.AuxInt)
6235                 if !(umagicOK16(c) && config.RegSize == 4 && umagic16(c).m&1 == 0) {
6236                         break
6237                 }
6238                 v.reset(OpTrunc32to16)
6239                 v0 := b.NewValue0(v.Pos, OpRsh32Ux64, typ.UInt32)
6240                 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
6241                 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
6242                 v2.AuxInt = int32ToAuxInt(int32(1<<15 + umagic16(c).m/2))
6243                 v3 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
6244                 v3.AddArg(x)
6245                 v1.AddArg2(v2, v3)
6246                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6247                 v4.AuxInt = int64ToAuxInt(16 + umagic16(c).s - 1)
6248                 v0.AddArg2(v1, v4)
6249                 v.AddArg(v0)
6250                 return true
6251         }
6252         // match: (Div16u x (Const16 [c]))
6253         // cond: umagicOK16(c) && config.RegSize == 4 && c&1 == 0
6254         // result: (Trunc32to16 (Rsh32Ux64 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int32(1<<15+(umagic16(c).m+1)/2)]) (Rsh32Ux64 <typ.UInt32> (ZeroExt16to32 x) (Const64 <typ.UInt64> [1]))) (Const64 <typ.UInt64> [16+umagic16(c).s-2])))
6255         for {
6256                 x := v_0
6257                 if v_1.Op != OpConst16 {
6258                         break
6259                 }
6260                 c := auxIntToInt16(v_1.AuxInt)
6261                 if !(umagicOK16(c) && config.RegSize == 4 && c&1 == 0) {
6262                         break
6263                 }
6264                 v.reset(OpTrunc32to16)
6265                 v0 := b.NewValue0(v.Pos, OpRsh32Ux64, typ.UInt32)
6266                 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
6267                 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
6268                 v2.AuxInt = int32ToAuxInt(int32(1<<15 + (umagic16(c).m+1)/2))
6269                 v3 := b.NewValue0(v.Pos, OpRsh32Ux64, typ.UInt32)
6270                 v4 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
6271                 v4.AddArg(x)
6272                 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6273                 v5.AuxInt = int64ToAuxInt(1)
6274                 v3.AddArg2(v4, v5)
6275                 v1.AddArg2(v2, v3)
6276                 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6277                 v6.AuxInt = int64ToAuxInt(16 + umagic16(c).s - 2)
6278                 v0.AddArg2(v1, v6)
6279                 v.AddArg(v0)
6280                 return true
6281         }
6282         // match: (Div16u x (Const16 [c]))
6283         // cond: umagicOK16(c) && config.RegSize == 4 && config.useAvg
6284         // result: (Trunc32to16 (Rsh32Ux64 <typ.UInt32> (Avg32u (Lsh32x64 <typ.UInt32> (ZeroExt16to32 x) (Const64 <typ.UInt64> [16])) (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int32(umagic16(c).m)]) (ZeroExt16to32 x))) (Const64 <typ.UInt64> [16+umagic16(c).s-1])))
6285         for {
6286                 x := v_0
6287                 if v_1.Op != OpConst16 {
6288                         break
6289                 }
6290                 c := auxIntToInt16(v_1.AuxInt)
6291                 if !(umagicOK16(c) && config.RegSize == 4 && config.useAvg) {
6292                         break
6293                 }
6294                 v.reset(OpTrunc32to16)
6295                 v0 := b.NewValue0(v.Pos, OpRsh32Ux64, typ.UInt32)
6296                 v1 := b.NewValue0(v.Pos, OpAvg32u, typ.UInt32)
6297                 v2 := b.NewValue0(v.Pos, OpLsh32x64, typ.UInt32)
6298                 v3 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
6299                 v3.AddArg(x)
6300                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6301                 v4.AuxInt = int64ToAuxInt(16)
6302                 v2.AddArg2(v3, v4)
6303                 v5 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
6304                 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
6305                 v6.AuxInt = int32ToAuxInt(int32(umagic16(c).m))
6306                 v5.AddArg2(v6, v3)
6307                 v1.AddArg2(v2, v5)
6308                 v7 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6309                 v7.AuxInt = int64ToAuxInt(16 + umagic16(c).s - 1)
6310                 v0.AddArg2(v1, v7)
6311                 v.AddArg(v0)
6312                 return true
6313         }
6314         return false
6315 }
6316 func rewriteValuegeneric_OpDiv32(v *Value) bool {
6317         v_1 := v.Args[1]
6318         v_0 := v.Args[0]
6319         b := v.Block
6320         config := b.Func.Config
6321         typ := &b.Func.Config.Types
6322         // match: (Div32 (Const32 [c]) (Const32 [d]))
6323         // cond: d != 0
6324         // result: (Const32 [c/d])
6325         for {
6326                 if v_0.Op != OpConst32 {
6327                         break
6328                 }
6329                 c := auxIntToInt32(v_0.AuxInt)
6330                 if v_1.Op != OpConst32 {
6331                         break
6332                 }
6333                 d := auxIntToInt32(v_1.AuxInt)
6334                 if !(d != 0) {
6335                         break
6336                 }
6337                 v.reset(OpConst32)
6338                 v.AuxInt = int32ToAuxInt(c / d)
6339                 return true
6340         }
6341         // match: (Div32 n (Const32 [c]))
6342         // cond: isNonNegative(n) && isPowerOfTwo32(c)
6343         // result: (Rsh32Ux64 n (Const64 <typ.UInt64> [log32(c)]))
6344         for {
6345                 n := v_0
6346                 if v_1.Op != OpConst32 {
6347                         break
6348                 }
6349                 c := auxIntToInt32(v_1.AuxInt)
6350                 if !(isNonNegative(n) && isPowerOfTwo32(c)) {
6351                         break
6352                 }
6353                 v.reset(OpRsh32Ux64)
6354                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6355                 v0.AuxInt = int64ToAuxInt(log32(c))
6356                 v.AddArg2(n, v0)
6357                 return true
6358         }
6359         // match: (Div32 <t> n (Const32 [c]))
6360         // cond: c < 0 && c != -1<<31
6361         // result: (Neg32 (Div32 <t> n (Const32 <t> [-c])))
6362         for {
6363                 t := v.Type
6364                 n := v_0
6365                 if v_1.Op != OpConst32 {
6366                         break
6367                 }
6368                 c := auxIntToInt32(v_1.AuxInt)
6369                 if !(c < 0 && c != -1<<31) {
6370                         break
6371                 }
6372                 v.reset(OpNeg32)
6373                 v0 := b.NewValue0(v.Pos, OpDiv32, t)
6374                 v1 := b.NewValue0(v.Pos, OpConst32, t)
6375                 v1.AuxInt = int32ToAuxInt(-c)
6376                 v0.AddArg2(n, v1)
6377                 v.AddArg(v0)
6378                 return true
6379         }
6380         // match: (Div32 <t> x (Const32 [-1<<31]))
6381         // result: (Rsh32Ux64 (And32 <t> x (Neg32 <t> x)) (Const64 <typ.UInt64> [31]))
6382         for {
6383                 t := v.Type
6384                 x := v_0
6385                 if v_1.Op != OpConst32 || auxIntToInt32(v_1.AuxInt) != -1<<31 {
6386                         break
6387                 }
6388                 v.reset(OpRsh32Ux64)
6389                 v0 := b.NewValue0(v.Pos, OpAnd32, t)
6390                 v1 := b.NewValue0(v.Pos, OpNeg32, t)
6391                 v1.AddArg(x)
6392                 v0.AddArg2(x, v1)
6393                 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6394                 v2.AuxInt = int64ToAuxInt(31)
6395                 v.AddArg2(v0, v2)
6396                 return true
6397         }
6398         // match: (Div32 <t> n (Const32 [c]))
6399         // cond: isPowerOfTwo32(c)
6400         // result: (Rsh32x64 (Add32 <t> n (Rsh32Ux64 <t> (Rsh32x64 <t> n (Const64 <typ.UInt64> [31])) (Const64 <typ.UInt64> [int64(32-log32(c))]))) (Const64 <typ.UInt64> [int64(log32(c))]))
6401         for {
6402                 t := v.Type
6403                 n := v_0
6404                 if v_1.Op != OpConst32 {
6405                         break
6406                 }
6407                 c := auxIntToInt32(v_1.AuxInt)
6408                 if !(isPowerOfTwo32(c)) {
6409                         break
6410                 }
6411                 v.reset(OpRsh32x64)
6412                 v0 := b.NewValue0(v.Pos, OpAdd32, t)
6413                 v1 := b.NewValue0(v.Pos, OpRsh32Ux64, t)
6414                 v2 := b.NewValue0(v.Pos, OpRsh32x64, t)
6415                 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6416                 v3.AuxInt = int64ToAuxInt(31)
6417                 v2.AddArg2(n, v3)
6418                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6419                 v4.AuxInt = int64ToAuxInt(int64(32 - log32(c)))
6420                 v1.AddArg2(v2, v4)
6421                 v0.AddArg2(n, v1)
6422                 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6423                 v5.AuxInt = int64ToAuxInt(int64(log32(c)))
6424                 v.AddArg2(v0, v5)
6425                 return true
6426         }
6427         // match: (Div32 <t> x (Const32 [c]))
6428         // cond: smagicOK32(c) && config.RegSize == 8
6429         // result: (Sub32 <t> (Rsh64x64 <t> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(smagic32(c).m)]) (SignExt32to64 x)) (Const64 <typ.UInt64> [32+smagic32(c).s])) (Rsh64x64 <t> (SignExt32to64 x) (Const64 <typ.UInt64> [63])))
6430         for {
6431                 t := v.Type
6432                 x := v_0
6433                 if v_1.Op != OpConst32 {
6434                         break
6435                 }
6436                 c := auxIntToInt32(v_1.AuxInt)
6437                 if !(smagicOK32(c) && config.RegSize == 8) {
6438                         break
6439                 }
6440                 v.reset(OpSub32)
6441                 v.Type = t
6442                 v0 := b.NewValue0(v.Pos, OpRsh64x64, t)
6443                 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64)
6444                 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6445                 v2.AuxInt = int64ToAuxInt(int64(smagic32(c).m))
6446                 v3 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
6447                 v3.AddArg(x)
6448                 v1.AddArg2(v2, v3)
6449                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6450                 v4.AuxInt = int64ToAuxInt(32 + smagic32(c).s)
6451                 v0.AddArg2(v1, v4)
6452                 v5 := b.NewValue0(v.Pos, OpRsh64x64, t)
6453                 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6454                 v6.AuxInt = int64ToAuxInt(63)
6455                 v5.AddArg2(v3, v6)
6456                 v.AddArg2(v0, v5)
6457                 return true
6458         }
6459         // match: (Div32 <t> x (Const32 [c]))
6460         // cond: smagicOK32(c) && config.RegSize == 4 && smagic32(c).m&1 == 0 && config.useHmul
6461         // result: (Sub32 <t> (Rsh32x64 <t> (Hmul32 <t> (Const32 <typ.UInt32> [int32(smagic32(c).m/2)]) x) (Const64 <typ.UInt64> [smagic32(c).s-1])) (Rsh32x64 <t> x (Const64 <typ.UInt64> [31])))
6462         for {
6463                 t := v.Type
6464                 x := v_0
6465                 if v_1.Op != OpConst32 {
6466                         break
6467                 }
6468                 c := auxIntToInt32(v_1.AuxInt)
6469                 if !(smagicOK32(c) && config.RegSize == 4 && smagic32(c).m&1 == 0 && config.useHmul) {
6470                         break
6471                 }
6472                 v.reset(OpSub32)
6473                 v.Type = t
6474                 v0 := b.NewValue0(v.Pos, OpRsh32x64, t)
6475                 v1 := b.NewValue0(v.Pos, OpHmul32, t)
6476                 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
6477                 v2.AuxInt = int32ToAuxInt(int32(smagic32(c).m / 2))
6478                 v1.AddArg2(v2, x)
6479                 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6480                 v3.AuxInt = int64ToAuxInt(smagic32(c).s - 1)
6481                 v0.AddArg2(v1, v3)
6482                 v4 := b.NewValue0(v.Pos, OpRsh32x64, t)
6483                 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6484                 v5.AuxInt = int64ToAuxInt(31)
6485                 v4.AddArg2(x, v5)
6486                 v.AddArg2(v0, v4)
6487                 return true
6488         }
6489         // match: (Div32 <t> x (Const32 [c]))
6490         // cond: smagicOK32(c) && config.RegSize == 4 && smagic32(c).m&1 != 0 && config.useHmul
6491         // result: (Sub32 <t> (Rsh32x64 <t> (Add32 <t> (Hmul32 <t> (Const32 <typ.UInt32> [int32(smagic32(c).m)]) x) x) (Const64 <typ.UInt64> [smagic32(c).s])) (Rsh32x64 <t> x (Const64 <typ.UInt64> [31])))
6492         for {
6493                 t := v.Type
6494                 x := v_0
6495                 if v_1.Op != OpConst32 {
6496                         break
6497                 }
6498                 c := auxIntToInt32(v_1.AuxInt)
6499                 if !(smagicOK32(c) && config.RegSize == 4 && smagic32(c).m&1 != 0 && config.useHmul) {
6500                         break
6501                 }
6502                 v.reset(OpSub32)
6503                 v.Type = t
6504                 v0 := b.NewValue0(v.Pos, OpRsh32x64, t)
6505                 v1 := b.NewValue0(v.Pos, OpAdd32, t)
6506                 v2 := b.NewValue0(v.Pos, OpHmul32, t)
6507                 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
6508                 v3.AuxInt = int32ToAuxInt(int32(smagic32(c).m))
6509                 v2.AddArg2(v3, x)
6510                 v1.AddArg2(v2, x)
6511                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6512                 v4.AuxInt = int64ToAuxInt(smagic32(c).s)
6513                 v0.AddArg2(v1, v4)
6514                 v5 := b.NewValue0(v.Pos, OpRsh32x64, t)
6515                 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6516                 v6.AuxInt = int64ToAuxInt(31)
6517                 v5.AddArg2(x, v6)
6518                 v.AddArg2(v0, v5)
6519                 return true
6520         }
6521         return false
6522 }
6523 func rewriteValuegeneric_OpDiv32F(v *Value) bool {
6524         v_1 := v.Args[1]
6525         v_0 := v.Args[0]
6526         b := v.Block
6527         // match: (Div32F (Const32F [c]) (Const32F [d]))
6528         // cond: c/d == c/d
6529         // result: (Const32F [c/d])
6530         for {
6531                 if v_0.Op != OpConst32F {
6532                         break
6533                 }
6534                 c := auxIntToFloat32(v_0.AuxInt)
6535                 if v_1.Op != OpConst32F {
6536                         break
6537                 }
6538                 d := auxIntToFloat32(v_1.AuxInt)
6539                 if !(c/d == c/d) {
6540                         break
6541                 }
6542                 v.reset(OpConst32F)
6543                 v.AuxInt = float32ToAuxInt(c / d)
6544                 return true
6545         }
6546         // match: (Div32F x (Const32F <t> [c]))
6547         // cond: reciprocalExact32(c)
6548         // result: (Mul32F x (Const32F <t> [1/c]))
6549         for {
6550                 x := v_0
6551                 if v_1.Op != OpConst32F {
6552                         break
6553                 }
6554                 t := v_1.Type
6555                 c := auxIntToFloat32(v_1.AuxInt)
6556                 if !(reciprocalExact32(c)) {
6557                         break
6558                 }
6559                 v.reset(OpMul32F)
6560                 v0 := b.NewValue0(v.Pos, OpConst32F, t)
6561                 v0.AuxInt = float32ToAuxInt(1 / c)
6562                 v.AddArg2(x, v0)
6563                 return true
6564         }
6565         return false
6566 }
6567 func rewriteValuegeneric_OpDiv32u(v *Value) bool {
6568         v_1 := v.Args[1]
6569         v_0 := v.Args[0]
6570         b := v.Block
6571         config := b.Func.Config
6572         typ := &b.Func.Config.Types
6573         // match: (Div32u (Const32 [c]) (Const32 [d]))
6574         // cond: d != 0
6575         // result: (Const32 [int32(uint32(c)/uint32(d))])
6576         for {
6577                 if v_0.Op != OpConst32 {
6578                         break
6579                 }
6580                 c := auxIntToInt32(v_0.AuxInt)
6581                 if v_1.Op != OpConst32 {
6582                         break
6583                 }
6584                 d := auxIntToInt32(v_1.AuxInt)
6585                 if !(d != 0) {
6586                         break
6587                 }
6588                 v.reset(OpConst32)
6589                 v.AuxInt = int32ToAuxInt(int32(uint32(c) / uint32(d)))
6590                 return true
6591         }
6592         // match: (Div32u n (Const32 [c]))
6593         // cond: isPowerOfTwo32(c)
6594         // result: (Rsh32Ux64 n (Const64 <typ.UInt64> [log32(c)]))
6595         for {
6596                 n := v_0
6597                 if v_1.Op != OpConst32 {
6598                         break
6599                 }
6600                 c := auxIntToInt32(v_1.AuxInt)
6601                 if !(isPowerOfTwo32(c)) {
6602                         break
6603                 }
6604                 v.reset(OpRsh32Ux64)
6605                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6606                 v0.AuxInt = int64ToAuxInt(log32(c))
6607                 v.AddArg2(n, v0)
6608                 return true
6609         }
6610         // match: (Div32u x (Const32 [c]))
6611         // cond: umagicOK32(c) && config.RegSize == 4 && umagic32(c).m&1 == 0 && config.useHmul
6612         // result: (Rsh32Ux64 <typ.UInt32> (Hmul32u <typ.UInt32> (Const32 <typ.UInt32> [int32(1<<31+umagic32(c).m/2)]) x) (Const64 <typ.UInt64> [umagic32(c).s-1]))
6613         for {
6614                 x := v_0
6615                 if v_1.Op != OpConst32 {
6616                         break
6617                 }
6618                 c := auxIntToInt32(v_1.AuxInt)
6619                 if !(umagicOK32(c) && config.RegSize == 4 && umagic32(c).m&1 == 0 && config.useHmul) {
6620                         break
6621                 }
6622                 v.reset(OpRsh32Ux64)
6623                 v.Type = typ.UInt32
6624                 v0 := b.NewValue0(v.Pos, OpHmul32u, typ.UInt32)
6625                 v1 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
6626                 v1.AuxInt = int32ToAuxInt(int32(1<<31 + umagic32(c).m/2))
6627                 v0.AddArg2(v1, x)
6628                 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6629                 v2.AuxInt = int64ToAuxInt(umagic32(c).s - 1)
6630                 v.AddArg2(v0, v2)
6631                 return true
6632         }
6633         // match: (Div32u x (Const32 [c]))
6634         // cond: umagicOK32(c) && config.RegSize == 4 && c&1 == 0 && config.useHmul
6635         // result: (Rsh32Ux64 <typ.UInt32> (Hmul32u <typ.UInt32> (Const32 <typ.UInt32> [int32(1<<31+(umagic32(c).m+1)/2)]) (Rsh32Ux64 <typ.UInt32> x (Const64 <typ.UInt64> [1]))) (Const64 <typ.UInt64> [umagic32(c).s-2]))
6636         for {
6637                 x := v_0
6638                 if v_1.Op != OpConst32 {
6639                         break
6640                 }
6641                 c := auxIntToInt32(v_1.AuxInt)
6642                 if !(umagicOK32(c) && config.RegSize == 4 && c&1 == 0 && config.useHmul) {
6643                         break
6644                 }
6645                 v.reset(OpRsh32Ux64)
6646                 v.Type = typ.UInt32
6647                 v0 := b.NewValue0(v.Pos, OpHmul32u, typ.UInt32)
6648                 v1 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
6649                 v1.AuxInt = int32ToAuxInt(int32(1<<31 + (umagic32(c).m+1)/2))
6650                 v2 := b.NewValue0(v.Pos, OpRsh32Ux64, typ.UInt32)
6651                 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6652                 v3.AuxInt = int64ToAuxInt(1)
6653                 v2.AddArg2(x, v3)
6654                 v0.AddArg2(v1, v2)
6655                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6656                 v4.AuxInt = int64ToAuxInt(umagic32(c).s - 2)
6657                 v.AddArg2(v0, v4)
6658                 return true
6659         }
6660         // match: (Div32u x (Const32 [c]))
6661         // cond: umagicOK32(c) && config.RegSize == 4 && config.useAvg && config.useHmul
6662         // result: (Rsh32Ux64 <typ.UInt32> (Avg32u x (Hmul32u <typ.UInt32> (Const32 <typ.UInt32> [int32(umagic32(c).m)]) x)) (Const64 <typ.UInt64> [umagic32(c).s-1]))
6663         for {
6664                 x := v_0
6665                 if v_1.Op != OpConst32 {
6666                         break
6667                 }
6668                 c := auxIntToInt32(v_1.AuxInt)
6669                 if !(umagicOK32(c) && config.RegSize == 4 && config.useAvg && config.useHmul) {
6670                         break
6671                 }
6672                 v.reset(OpRsh32Ux64)
6673                 v.Type = typ.UInt32
6674                 v0 := b.NewValue0(v.Pos, OpAvg32u, typ.UInt32)
6675                 v1 := b.NewValue0(v.Pos, OpHmul32u, typ.UInt32)
6676                 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
6677                 v2.AuxInt = int32ToAuxInt(int32(umagic32(c).m))
6678                 v1.AddArg2(v2, x)
6679                 v0.AddArg2(x, v1)
6680                 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6681                 v3.AuxInt = int64ToAuxInt(umagic32(c).s - 1)
6682                 v.AddArg2(v0, v3)
6683                 return true
6684         }
6685         // match: (Div32u x (Const32 [c]))
6686         // cond: umagicOK32(c) && config.RegSize == 8 && umagic32(c).m&1 == 0
6687         // result: (Trunc64to32 (Rsh64Ux64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(1<<31+umagic32(c).m/2)]) (ZeroExt32to64 x)) (Const64 <typ.UInt64> [32+umagic32(c).s-1])))
6688         for {
6689                 x := v_0
6690                 if v_1.Op != OpConst32 {
6691                         break
6692                 }
6693                 c := auxIntToInt32(v_1.AuxInt)
6694                 if !(umagicOK32(c) && config.RegSize == 8 && umagic32(c).m&1 == 0) {
6695                         break
6696                 }
6697                 v.reset(OpTrunc64to32)
6698                 v0 := b.NewValue0(v.Pos, OpRsh64Ux64, typ.UInt64)
6699                 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64)
6700                 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6701                 v2.AuxInt = int64ToAuxInt(int64(1<<31 + umagic32(c).m/2))
6702                 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
6703                 v3.AddArg(x)
6704                 v1.AddArg2(v2, v3)
6705                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6706                 v4.AuxInt = int64ToAuxInt(32 + umagic32(c).s - 1)
6707                 v0.AddArg2(v1, v4)
6708                 v.AddArg(v0)
6709                 return true
6710         }
6711         // match: (Div32u x (Const32 [c]))
6712         // cond: umagicOK32(c) && config.RegSize == 8 && c&1 == 0
6713         // result: (Trunc64to32 (Rsh64Ux64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(1<<31+(umagic32(c).m+1)/2)]) (Rsh64Ux64 <typ.UInt64> (ZeroExt32to64 x) (Const64 <typ.UInt64> [1]))) (Const64 <typ.UInt64> [32+umagic32(c).s-2])))
6714         for {
6715                 x := v_0
6716                 if v_1.Op != OpConst32 {
6717                         break
6718                 }
6719                 c := auxIntToInt32(v_1.AuxInt)
6720                 if !(umagicOK32(c) && config.RegSize == 8 && c&1 == 0) {
6721                         break
6722                 }
6723                 v.reset(OpTrunc64to32)
6724                 v0 := b.NewValue0(v.Pos, OpRsh64Ux64, typ.UInt64)
6725                 v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64)
6726                 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6727                 v2.AuxInt = int64ToAuxInt(int64(1<<31 + (umagic32(c).m+1)/2))
6728                 v3 := b.NewValue0(v.Pos, OpRsh64Ux64, typ.UInt64)
6729                 v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
6730                 v4.AddArg(x)
6731                 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6732                 v5.AuxInt = int64ToAuxInt(1)
6733                 v3.AddArg2(v4, v5)
6734                 v1.AddArg2(v2, v3)
6735                 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6736                 v6.AuxInt = int64ToAuxInt(32 + umagic32(c).s - 2)
6737                 v0.AddArg2(v1, v6)
6738                 v.AddArg(v0)
6739                 return true
6740         }
6741         // match: (Div32u x (Const32 [c]))
6742         // cond: umagicOK32(c) && config.RegSize == 8 && config.useAvg
6743         // result: (Trunc64to32 (Rsh64Ux64 <typ.UInt64> (Avg64u (Lsh64x64 <typ.UInt64> (ZeroExt32to64 x) (Const64 <typ.UInt64> [32])) (Mul64 <typ.UInt64> (Const64 <typ.UInt32> [int64(umagic32(c).m)]) (ZeroExt32to64 x))) (Const64 <typ.UInt64> [32+umagic32(c).s-1])))
6744         for {
6745                 x := v_0
6746                 if v_1.Op != OpConst32 {
6747                         break
6748                 }
6749                 c := auxIntToInt32(v_1.AuxInt)
6750                 if !(umagicOK32(c) && config.RegSize == 8 && config.useAvg) {
6751                         break
6752                 }
6753                 v.reset(OpTrunc64to32)
6754                 v0 := b.NewValue0(v.Pos, OpRsh64Ux64, typ.UInt64)
6755                 v1 := b.NewValue0(v.Pos, OpAvg64u, typ.UInt64)
6756                 v2 := b.NewValue0(v.Pos, OpLsh64x64, typ.UInt64)
6757                 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
6758                 v3.AddArg(x)
6759                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6760                 v4.AuxInt = int64ToAuxInt(32)
6761                 v2.AddArg2(v3, v4)
6762                 v5 := b.NewValue0(v.Pos, OpMul64, typ.UInt64)
6763                 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt32)
6764                 v6.AuxInt = int64ToAuxInt(int64(umagic32(c).m))
6765                 v5.AddArg2(v6, v3)
6766                 v1.AddArg2(v2, v5)
6767                 v7 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6768                 v7.AuxInt = int64ToAuxInt(32 + umagic32(c).s - 1)
6769                 v0.AddArg2(v1, v7)
6770                 v.AddArg(v0)
6771                 return true
6772         }
6773         return false
6774 }
6775 func rewriteValuegeneric_OpDiv64(v *Value) bool {
6776         v_1 := v.Args[1]
6777         v_0 := v.Args[0]
6778         b := v.Block
6779         config := b.Func.Config
6780         typ := &b.Func.Config.Types
6781         // match: (Div64 (Const64 [c]) (Const64 [d]))
6782         // cond: d != 0
6783         // result: (Const64 [c/d])
6784         for {
6785                 if v_0.Op != OpConst64 {
6786                         break
6787                 }
6788                 c := auxIntToInt64(v_0.AuxInt)
6789                 if v_1.Op != OpConst64 {
6790                         break
6791                 }
6792                 d := auxIntToInt64(v_1.AuxInt)
6793                 if !(d != 0) {
6794                         break
6795                 }
6796                 v.reset(OpConst64)
6797                 v.AuxInt = int64ToAuxInt(c / d)
6798                 return true
6799         }
6800         // match: (Div64 n (Const64 [c]))
6801         // cond: isNonNegative(n) && isPowerOfTwo64(c)
6802         // result: (Rsh64Ux64 n (Const64 <typ.UInt64> [log64(c)]))
6803         for {
6804                 n := v_0
6805                 if v_1.Op != OpConst64 {
6806                         break
6807                 }
6808                 c := auxIntToInt64(v_1.AuxInt)
6809                 if !(isNonNegative(n) && isPowerOfTwo64(c)) {
6810                         break
6811                 }
6812                 v.reset(OpRsh64Ux64)
6813                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6814                 v0.AuxInt = int64ToAuxInt(log64(c))
6815                 v.AddArg2(n, v0)
6816                 return true
6817         }
6818         // match: (Div64 n (Const64 [-1<<63]))
6819         // cond: isNonNegative(n)
6820         // result: (Const64 [0])
6821         for {
6822                 n := v_0
6823                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != -1<<63 || !(isNonNegative(n)) {
6824                         break
6825                 }
6826                 v.reset(OpConst64)
6827                 v.AuxInt = int64ToAuxInt(0)
6828                 return true
6829         }
6830         // match: (Div64 <t> n (Const64 [c]))
6831         // cond: c < 0 && c != -1<<63
6832         // result: (Neg64 (Div64 <t> n (Const64 <t> [-c])))
6833         for {
6834                 t := v.Type
6835                 n := v_0
6836                 if v_1.Op != OpConst64 {
6837                         break
6838                 }
6839                 c := auxIntToInt64(v_1.AuxInt)
6840                 if !(c < 0 && c != -1<<63) {
6841                         break
6842                 }
6843                 v.reset(OpNeg64)
6844                 v0 := b.NewValue0(v.Pos, OpDiv64, t)
6845                 v1 := b.NewValue0(v.Pos, OpConst64, t)
6846                 v1.AuxInt = int64ToAuxInt(-c)
6847                 v0.AddArg2(n, v1)
6848                 v.AddArg(v0)
6849                 return true
6850         }
6851         // match: (Div64 <t> x (Const64 [-1<<63]))
6852         // result: (Rsh64Ux64 (And64 <t> x (Neg64 <t> x)) (Const64 <typ.UInt64> [63]))
6853         for {
6854                 t := v.Type
6855                 x := v_0
6856                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != -1<<63 {
6857                         break
6858                 }
6859                 v.reset(OpRsh64Ux64)
6860                 v0 := b.NewValue0(v.Pos, OpAnd64, t)
6861                 v1 := b.NewValue0(v.Pos, OpNeg64, t)
6862                 v1.AddArg(x)
6863                 v0.AddArg2(x, v1)
6864                 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6865                 v2.AuxInt = int64ToAuxInt(63)
6866                 v.AddArg2(v0, v2)
6867                 return true
6868         }
6869         // match: (Div64 <t> n (Const64 [c]))
6870         // cond: isPowerOfTwo64(c)
6871         // result: (Rsh64x64 (Add64 <t> n (Rsh64Ux64 <t> (Rsh64x64 <t> n (Const64 <typ.UInt64> [63])) (Const64 <typ.UInt64> [int64(64-log64(c))]))) (Const64 <typ.UInt64> [int64(log64(c))]))
6872         for {
6873                 t := v.Type
6874                 n := v_0
6875                 if v_1.Op != OpConst64 {
6876                         break
6877                 }
6878                 c := auxIntToInt64(v_1.AuxInt)
6879                 if !(isPowerOfTwo64(c)) {
6880                         break
6881                 }
6882                 v.reset(OpRsh64x64)
6883                 v0 := b.NewValue0(v.Pos, OpAdd64, t)
6884                 v1 := b.NewValue0(v.Pos, OpRsh64Ux64, t)
6885                 v2 := b.NewValue0(v.Pos, OpRsh64x64, t)
6886                 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6887                 v3.AuxInt = int64ToAuxInt(63)
6888                 v2.AddArg2(n, v3)
6889                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6890                 v4.AuxInt = int64ToAuxInt(int64(64 - log64(c)))
6891                 v1.AddArg2(v2, v4)
6892                 v0.AddArg2(n, v1)
6893                 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6894                 v5.AuxInt = int64ToAuxInt(int64(log64(c)))
6895                 v.AddArg2(v0, v5)
6896                 return true
6897         }
6898         // match: (Div64 <t> x (Const64 [c]))
6899         // cond: smagicOK64(c) && smagic64(c).m&1 == 0 && config.useHmul
6900         // result: (Sub64 <t> (Rsh64x64 <t> (Hmul64 <t> (Const64 <typ.UInt64> [int64(smagic64(c).m/2)]) x) (Const64 <typ.UInt64> [smagic64(c).s-1])) (Rsh64x64 <t> x (Const64 <typ.UInt64> [63])))
6901         for {
6902                 t := v.Type
6903                 x := v_0
6904                 if v_1.Op != OpConst64 {
6905                         break
6906                 }
6907                 c := auxIntToInt64(v_1.AuxInt)
6908                 if !(smagicOK64(c) && smagic64(c).m&1 == 0 && config.useHmul) {
6909                         break
6910                 }
6911                 v.reset(OpSub64)
6912                 v.Type = t
6913                 v0 := b.NewValue0(v.Pos, OpRsh64x64, t)
6914                 v1 := b.NewValue0(v.Pos, OpHmul64, t)
6915                 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6916                 v2.AuxInt = int64ToAuxInt(int64(smagic64(c).m / 2))
6917                 v1.AddArg2(v2, x)
6918                 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6919                 v3.AuxInt = int64ToAuxInt(smagic64(c).s - 1)
6920                 v0.AddArg2(v1, v3)
6921                 v4 := b.NewValue0(v.Pos, OpRsh64x64, t)
6922                 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6923                 v5.AuxInt = int64ToAuxInt(63)
6924                 v4.AddArg2(x, v5)
6925                 v.AddArg2(v0, v4)
6926                 return true
6927         }
6928         // match: (Div64 <t> x (Const64 [c]))
6929         // cond: smagicOK64(c) && smagic64(c).m&1 != 0 && config.useHmul
6930         // result: (Sub64 <t> (Rsh64x64 <t> (Add64 <t> (Hmul64 <t> (Const64 <typ.UInt64> [int64(smagic64(c).m)]) x) x) (Const64 <typ.UInt64> [smagic64(c).s])) (Rsh64x64 <t> x (Const64 <typ.UInt64> [63])))
6931         for {
6932                 t := v.Type
6933                 x := v_0
6934                 if v_1.Op != OpConst64 {
6935                         break
6936                 }
6937                 c := auxIntToInt64(v_1.AuxInt)
6938                 if !(smagicOK64(c) && smagic64(c).m&1 != 0 && config.useHmul) {
6939                         break
6940                 }
6941                 v.reset(OpSub64)
6942                 v.Type = t
6943                 v0 := b.NewValue0(v.Pos, OpRsh64x64, t)
6944                 v1 := b.NewValue0(v.Pos, OpAdd64, t)
6945                 v2 := b.NewValue0(v.Pos, OpHmul64, t)
6946                 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6947                 v3.AuxInt = int64ToAuxInt(int64(smagic64(c).m))
6948                 v2.AddArg2(v3, x)
6949                 v1.AddArg2(v2, x)
6950                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6951                 v4.AuxInt = int64ToAuxInt(smagic64(c).s)
6952                 v0.AddArg2(v1, v4)
6953                 v5 := b.NewValue0(v.Pos, OpRsh64x64, t)
6954                 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
6955                 v6.AuxInt = int64ToAuxInt(63)
6956                 v5.AddArg2(x, v6)
6957                 v.AddArg2(v0, v5)
6958                 return true
6959         }
6960         return false
6961 }
6962 func rewriteValuegeneric_OpDiv64F(v *Value) bool {
6963         v_1 := v.Args[1]
6964         v_0 := v.Args[0]
6965         b := v.Block
6966         // match: (Div64F (Const64F [c]) (Const64F [d]))
6967         // cond: c/d == c/d
6968         // result: (Const64F [c/d])
6969         for {
6970                 if v_0.Op != OpConst64F {
6971                         break
6972                 }
6973                 c := auxIntToFloat64(v_0.AuxInt)
6974                 if v_1.Op != OpConst64F {
6975                         break
6976                 }
6977                 d := auxIntToFloat64(v_1.AuxInt)
6978                 if !(c/d == c/d) {
6979                         break
6980                 }
6981                 v.reset(OpConst64F)
6982                 v.AuxInt = float64ToAuxInt(c / d)
6983                 return true
6984         }
6985         // match: (Div64F x (Const64F <t> [c]))
6986         // cond: reciprocalExact64(c)
6987         // result: (Mul64F x (Const64F <t> [1/c]))
6988         for {
6989                 x := v_0
6990                 if v_1.Op != OpConst64F {
6991                         break
6992                 }
6993                 t := v_1.Type
6994                 c := auxIntToFloat64(v_1.AuxInt)
6995                 if !(reciprocalExact64(c)) {
6996                         break
6997                 }
6998                 v.reset(OpMul64F)
6999                 v0 := b.NewValue0(v.Pos, OpConst64F, t)
7000                 v0.AuxInt = float64ToAuxInt(1 / c)
7001                 v.AddArg2(x, v0)
7002                 return true
7003         }
7004         return false
7005 }
7006 func rewriteValuegeneric_OpDiv64u(v *Value) bool {
7007         v_1 := v.Args[1]
7008         v_0 := v.Args[0]
7009         b := v.Block
7010         config := b.Func.Config
7011         typ := &b.Func.Config.Types
7012         // match: (Div64u (Const64 [c]) (Const64 [d]))
7013         // cond: d != 0
7014         // result: (Const64 [int64(uint64(c)/uint64(d))])
7015         for {
7016                 if v_0.Op != OpConst64 {
7017                         break
7018                 }
7019                 c := auxIntToInt64(v_0.AuxInt)
7020                 if v_1.Op != OpConst64 {
7021                         break
7022                 }
7023                 d := auxIntToInt64(v_1.AuxInt)
7024                 if !(d != 0) {
7025                         break
7026                 }
7027                 v.reset(OpConst64)
7028                 v.AuxInt = int64ToAuxInt(int64(uint64(c) / uint64(d)))
7029                 return true
7030         }
7031         // match: (Div64u n (Const64 [c]))
7032         // cond: isPowerOfTwo64(c)
7033         // result: (Rsh64Ux64 n (Const64 <typ.UInt64> [log64(c)]))
7034         for {
7035                 n := v_0
7036                 if v_1.Op != OpConst64 {
7037                         break
7038                 }
7039                 c := auxIntToInt64(v_1.AuxInt)
7040                 if !(isPowerOfTwo64(c)) {
7041                         break
7042                 }
7043                 v.reset(OpRsh64Ux64)
7044                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7045                 v0.AuxInt = int64ToAuxInt(log64(c))
7046                 v.AddArg2(n, v0)
7047                 return true
7048         }
7049         // match: (Div64u n (Const64 [-1<<63]))
7050         // result: (Rsh64Ux64 n (Const64 <typ.UInt64> [63]))
7051         for {
7052                 n := v_0
7053                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != -1<<63 {
7054                         break
7055                 }
7056                 v.reset(OpRsh64Ux64)
7057                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7058                 v0.AuxInt = int64ToAuxInt(63)
7059                 v.AddArg2(n, v0)
7060                 return true
7061         }
7062         // match: (Div64u x (Const64 [c]))
7063         // cond: c > 0 && c <= 0xFFFF && umagicOK32(int32(c)) && config.RegSize == 4 && config.useHmul
7064         // result: (Add64 (Add64 <typ.UInt64> (Add64 <typ.UInt64> (Lsh64x64 <typ.UInt64> (ZeroExt32to64 (Div32u <typ.UInt32> (Trunc64to32 <typ.UInt32> (Rsh64Ux64 <typ.UInt64> x (Const64 <typ.UInt64> [32]))) (Const32 <typ.UInt32> [int32(c)]))) (Const64 <typ.UInt64> [32])) (ZeroExt32to64 (Div32u <typ.UInt32> (Trunc64to32 <typ.UInt32> x) (Const32 <typ.UInt32> [int32(c)])))) (Mul64 <typ.UInt64> (ZeroExt32to64 <typ.UInt64> (Mod32u <typ.UInt32> (Trunc64to32 <typ.UInt32> (Rsh64Ux64 <typ.UInt64> x (Const64 <typ.UInt64> [32]))) (Const32 <typ.UInt32> [int32(c)]))) (Const64 <typ.UInt64> [int64((1<<32)/c)]))) (ZeroExt32to64 (Div32u <typ.UInt32> (Add32 <typ.UInt32> (Mod32u <typ.UInt32> (Trunc64to32 <typ.UInt32> x) (Const32 <typ.UInt32> [int32(c)])) (Mul32 <typ.UInt32> (Mod32u <typ.UInt32> (Trunc64to32 <typ.UInt32> (Rsh64Ux64 <typ.UInt64> x (Const64 <typ.UInt64> [32]))) (Const32 <typ.UInt32> [int32(c)])) (Const32 <typ.UInt32> [int32((1<<32)%c)]))) (Const32 <typ.UInt32> [int32(c)]))))
7065         for {
7066                 x := v_0
7067                 if v_1.Op != OpConst64 {
7068                         break
7069                 }
7070                 c := auxIntToInt64(v_1.AuxInt)
7071                 if !(c > 0 && c <= 0xFFFF && umagicOK32(int32(c)) && config.RegSize == 4 && config.useHmul) {
7072                         break
7073                 }
7074                 v.reset(OpAdd64)
7075                 v0 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64)
7076                 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64)
7077                 v2 := b.NewValue0(v.Pos, OpLsh64x64, typ.UInt64)
7078                 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
7079                 v4 := b.NewValue0(v.Pos, OpDiv32u, typ.UInt32)
7080                 v5 := b.NewValue0(v.Pos, OpTrunc64to32, typ.UInt32)
7081                 v6 := b.NewValue0(v.Pos, OpRsh64Ux64, typ.UInt64)
7082                 v7 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7083                 v7.AuxInt = int64ToAuxInt(32)
7084                 v6.AddArg2(x, v7)
7085                 v5.AddArg(v6)
7086                 v8 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
7087                 v8.AuxInt = int32ToAuxInt(int32(c))
7088                 v4.AddArg2(v5, v8)
7089                 v3.AddArg(v4)
7090                 v2.AddArg2(v3, v7)
7091                 v9 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
7092                 v10 := b.NewValue0(v.Pos, OpDiv32u, typ.UInt32)
7093                 v11 := b.NewValue0(v.Pos, OpTrunc64to32, typ.UInt32)
7094                 v11.AddArg(x)
7095                 v10.AddArg2(v11, v8)
7096                 v9.AddArg(v10)
7097                 v1.AddArg2(v2, v9)
7098                 v12 := b.NewValue0(v.Pos, OpMul64, typ.UInt64)
7099                 v13 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
7100                 v14 := b.NewValue0(v.Pos, OpMod32u, typ.UInt32)
7101                 v14.AddArg2(v5, v8)
7102                 v13.AddArg(v14)
7103                 v15 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7104                 v15.AuxInt = int64ToAuxInt(int64((1 << 32) / c))
7105                 v12.AddArg2(v13, v15)
7106                 v0.AddArg2(v1, v12)
7107                 v16 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
7108                 v17 := b.NewValue0(v.Pos, OpDiv32u, typ.UInt32)
7109                 v18 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32)
7110                 v19 := b.NewValue0(v.Pos, OpMod32u, typ.UInt32)
7111                 v19.AddArg2(v11, v8)
7112                 v20 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
7113                 v21 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
7114                 v21.AuxInt = int32ToAuxInt(int32((1 << 32) % c))
7115                 v20.AddArg2(v14, v21)
7116                 v18.AddArg2(v19, v20)
7117                 v17.AddArg2(v18, v8)
7118                 v16.AddArg(v17)
7119                 v.AddArg2(v0, v16)
7120                 return true
7121         }
7122         // match: (Div64u x (Const64 [c]))
7123         // cond: umagicOK64(c) && config.RegSize == 8 && umagic64(c).m&1 == 0 && config.useHmul
7124         // result: (Rsh64Ux64 <typ.UInt64> (Hmul64u <typ.UInt64> (Const64 <typ.UInt64> [int64(1<<63+umagic64(c).m/2)]) x) (Const64 <typ.UInt64> [umagic64(c).s-1]))
7125         for {
7126                 x := v_0
7127                 if v_1.Op != OpConst64 {
7128                         break
7129                 }
7130                 c := auxIntToInt64(v_1.AuxInt)
7131                 if !(umagicOK64(c) && config.RegSize == 8 && umagic64(c).m&1 == 0 && config.useHmul) {
7132                         break
7133                 }
7134                 v.reset(OpRsh64Ux64)
7135                 v.Type = typ.UInt64
7136                 v0 := b.NewValue0(v.Pos, OpHmul64u, typ.UInt64)
7137                 v1 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7138                 v1.AuxInt = int64ToAuxInt(int64(1<<63 + umagic64(c).m/2))
7139                 v0.AddArg2(v1, x)
7140                 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7141                 v2.AuxInt = int64ToAuxInt(umagic64(c).s - 1)
7142                 v.AddArg2(v0, v2)
7143                 return true
7144         }
7145         // match: (Div64u x (Const64 [c]))
7146         // cond: umagicOK64(c) && config.RegSize == 8 && c&1 == 0 && config.useHmul
7147         // result: (Rsh64Ux64 <typ.UInt64> (Hmul64u <typ.UInt64> (Const64 <typ.UInt64> [int64(1<<63+(umagic64(c).m+1)/2)]) (Rsh64Ux64 <typ.UInt64> x (Const64 <typ.UInt64> [1]))) (Const64 <typ.UInt64> [umagic64(c).s-2]))
7148         for {
7149                 x := v_0
7150                 if v_1.Op != OpConst64 {
7151                         break
7152                 }
7153                 c := auxIntToInt64(v_1.AuxInt)
7154                 if !(umagicOK64(c) && config.RegSize == 8 && c&1 == 0 && config.useHmul) {
7155                         break
7156                 }
7157                 v.reset(OpRsh64Ux64)
7158                 v.Type = typ.UInt64
7159                 v0 := b.NewValue0(v.Pos, OpHmul64u, typ.UInt64)
7160                 v1 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7161                 v1.AuxInt = int64ToAuxInt(int64(1<<63 + (umagic64(c).m+1)/2))
7162                 v2 := b.NewValue0(v.Pos, OpRsh64Ux64, typ.UInt64)
7163                 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7164                 v3.AuxInt = int64ToAuxInt(1)
7165                 v2.AddArg2(x, v3)
7166                 v0.AddArg2(v1, v2)
7167                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7168                 v4.AuxInt = int64ToAuxInt(umagic64(c).s - 2)
7169                 v.AddArg2(v0, v4)
7170                 return true
7171         }
7172         // match: (Div64u x (Const64 [c]))
7173         // cond: umagicOK64(c) && config.RegSize == 8 && config.useAvg && config.useHmul
7174         // result: (Rsh64Ux64 <typ.UInt64> (Avg64u x (Hmul64u <typ.UInt64> (Const64 <typ.UInt64> [int64(umagic64(c).m)]) x)) (Const64 <typ.UInt64> [umagic64(c).s-1]))
7175         for {
7176                 x := v_0
7177                 if v_1.Op != OpConst64 {
7178                         break
7179                 }
7180                 c := auxIntToInt64(v_1.AuxInt)
7181                 if !(umagicOK64(c) && config.RegSize == 8 && config.useAvg && config.useHmul) {
7182                         break
7183                 }
7184                 v.reset(OpRsh64Ux64)
7185                 v.Type = typ.UInt64
7186                 v0 := b.NewValue0(v.Pos, OpAvg64u, typ.UInt64)
7187                 v1 := b.NewValue0(v.Pos, OpHmul64u, typ.UInt64)
7188                 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7189                 v2.AuxInt = int64ToAuxInt(int64(umagic64(c).m))
7190                 v1.AddArg2(v2, x)
7191                 v0.AddArg2(x, v1)
7192                 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7193                 v3.AuxInt = int64ToAuxInt(umagic64(c).s - 1)
7194                 v.AddArg2(v0, v3)
7195                 return true
7196         }
7197         return false
7198 }
7199 func rewriteValuegeneric_OpDiv8(v *Value) bool {
7200         v_1 := v.Args[1]
7201         v_0 := v.Args[0]
7202         b := v.Block
7203         typ := &b.Func.Config.Types
7204         // match: (Div8 (Const8 [c]) (Const8 [d]))
7205         // cond: d != 0
7206         // result: (Const8 [c/d])
7207         for {
7208                 if v_0.Op != OpConst8 {
7209                         break
7210                 }
7211                 c := auxIntToInt8(v_0.AuxInt)
7212                 if v_1.Op != OpConst8 {
7213                         break
7214                 }
7215                 d := auxIntToInt8(v_1.AuxInt)
7216                 if !(d != 0) {
7217                         break
7218                 }
7219                 v.reset(OpConst8)
7220                 v.AuxInt = int8ToAuxInt(c / d)
7221                 return true
7222         }
7223         // match: (Div8 n (Const8 [c]))
7224         // cond: isNonNegative(n) && isPowerOfTwo8(c)
7225         // result: (Rsh8Ux64 n (Const64 <typ.UInt64> [log8(c)]))
7226         for {
7227                 n := v_0
7228                 if v_1.Op != OpConst8 {
7229                         break
7230                 }
7231                 c := auxIntToInt8(v_1.AuxInt)
7232                 if !(isNonNegative(n) && isPowerOfTwo8(c)) {
7233                         break
7234                 }
7235                 v.reset(OpRsh8Ux64)
7236                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7237                 v0.AuxInt = int64ToAuxInt(log8(c))
7238                 v.AddArg2(n, v0)
7239                 return true
7240         }
7241         // match: (Div8 <t> n (Const8 [c]))
7242         // cond: c < 0 && c != -1<<7
7243         // result: (Neg8 (Div8 <t> n (Const8 <t> [-c])))
7244         for {
7245                 t := v.Type
7246                 n := v_0
7247                 if v_1.Op != OpConst8 {
7248                         break
7249                 }
7250                 c := auxIntToInt8(v_1.AuxInt)
7251                 if !(c < 0 && c != -1<<7) {
7252                         break
7253                 }
7254                 v.reset(OpNeg8)
7255                 v0 := b.NewValue0(v.Pos, OpDiv8, t)
7256                 v1 := b.NewValue0(v.Pos, OpConst8, t)
7257                 v1.AuxInt = int8ToAuxInt(-c)
7258                 v0.AddArg2(n, v1)
7259                 v.AddArg(v0)
7260                 return true
7261         }
7262         // match: (Div8 <t> x (Const8 [-1<<7 ]))
7263         // result: (Rsh8Ux64 (And8 <t> x (Neg8 <t> x)) (Const64 <typ.UInt64> [7 ]))
7264         for {
7265                 t := v.Type
7266                 x := v_0
7267                 if v_1.Op != OpConst8 || auxIntToInt8(v_1.AuxInt) != -1<<7 {
7268                         break
7269                 }
7270                 v.reset(OpRsh8Ux64)
7271                 v0 := b.NewValue0(v.Pos, OpAnd8, t)
7272                 v1 := b.NewValue0(v.Pos, OpNeg8, t)
7273                 v1.AddArg(x)
7274                 v0.AddArg2(x, v1)
7275                 v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7276                 v2.AuxInt = int64ToAuxInt(7)
7277                 v.AddArg2(v0, v2)
7278                 return true
7279         }
7280         // match: (Div8 <t> n (Const8 [c]))
7281         // cond: isPowerOfTwo8(c)
7282         // result: (Rsh8x64 (Add8 <t> n (Rsh8Ux64 <t> (Rsh8x64 <t> n (Const64 <typ.UInt64> [ 7])) (Const64 <typ.UInt64> [int64( 8-log8(c))]))) (Const64 <typ.UInt64> [int64(log8(c))]))
7283         for {
7284                 t := v.Type
7285                 n := v_0
7286                 if v_1.Op != OpConst8 {
7287                         break
7288                 }
7289                 c := auxIntToInt8(v_1.AuxInt)
7290                 if !(isPowerOfTwo8(c)) {
7291                         break
7292                 }
7293                 v.reset(OpRsh8x64)
7294                 v0 := b.NewValue0(v.Pos, OpAdd8, t)
7295                 v1 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
7296                 v2 := b.NewValue0(v.Pos, OpRsh8x64, t)
7297                 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7298                 v3.AuxInt = int64ToAuxInt(7)
7299                 v2.AddArg2(n, v3)
7300                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7301                 v4.AuxInt = int64ToAuxInt(int64(8 - log8(c)))
7302                 v1.AddArg2(v2, v4)
7303                 v0.AddArg2(n, v1)
7304                 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7305                 v5.AuxInt = int64ToAuxInt(int64(log8(c)))
7306                 v.AddArg2(v0, v5)
7307                 return true
7308         }
7309         // match: (Div8 <t> x (Const8 [c]))
7310         // cond: smagicOK8(c)
7311         // result: (Sub8 <t> (Rsh32x64 <t> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int32(smagic8(c).m)]) (SignExt8to32 x)) (Const64 <typ.UInt64> [8+smagic8(c).s])) (Rsh32x64 <t> (SignExt8to32 x) (Const64 <typ.UInt64> [31])))
7312         for {
7313                 t := v.Type
7314                 x := v_0
7315                 if v_1.Op != OpConst8 {
7316                         break
7317                 }
7318                 c := auxIntToInt8(v_1.AuxInt)
7319                 if !(smagicOK8(c)) {
7320                         break
7321                 }
7322                 v.reset(OpSub8)
7323                 v.Type = t
7324                 v0 := b.NewValue0(v.Pos, OpRsh32x64, t)
7325                 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
7326                 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
7327                 v2.AuxInt = int32ToAuxInt(int32(smagic8(c).m))
7328                 v3 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
7329                 v3.AddArg(x)
7330                 v1.AddArg2(v2, v3)
7331                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7332                 v4.AuxInt = int64ToAuxInt(8 + smagic8(c).s)
7333                 v0.AddArg2(v1, v4)
7334                 v5 := b.NewValue0(v.Pos, OpRsh32x64, t)
7335                 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7336                 v6.AuxInt = int64ToAuxInt(31)
7337                 v5.AddArg2(v3, v6)
7338                 v.AddArg2(v0, v5)
7339                 return true
7340         }
7341         return false
7342 }
7343 func rewriteValuegeneric_OpDiv8u(v *Value) bool {
7344         v_1 := v.Args[1]
7345         v_0 := v.Args[0]
7346         b := v.Block
7347         typ := &b.Func.Config.Types
7348         // match: (Div8u (Const8 [c]) (Const8 [d]))
7349         // cond: d != 0
7350         // result: (Const8 [int8(uint8(c)/uint8(d))])
7351         for {
7352                 if v_0.Op != OpConst8 {
7353                         break
7354                 }
7355                 c := auxIntToInt8(v_0.AuxInt)
7356                 if v_1.Op != OpConst8 {
7357                         break
7358                 }
7359                 d := auxIntToInt8(v_1.AuxInt)
7360                 if !(d != 0) {
7361                         break
7362                 }
7363                 v.reset(OpConst8)
7364                 v.AuxInt = int8ToAuxInt(int8(uint8(c) / uint8(d)))
7365                 return true
7366         }
7367         // match: (Div8u n (Const8 [c]))
7368         // cond: isPowerOfTwo8(c)
7369         // result: (Rsh8Ux64 n (Const64 <typ.UInt64> [log8(c)]))
7370         for {
7371                 n := v_0
7372                 if v_1.Op != OpConst8 {
7373                         break
7374                 }
7375                 c := auxIntToInt8(v_1.AuxInt)
7376                 if !(isPowerOfTwo8(c)) {
7377                         break
7378                 }
7379                 v.reset(OpRsh8Ux64)
7380                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7381                 v0.AuxInt = int64ToAuxInt(log8(c))
7382                 v.AddArg2(n, v0)
7383                 return true
7384         }
7385         // match: (Div8u x (Const8 [c]))
7386         // cond: umagicOK8(c)
7387         // result: (Trunc32to8 (Rsh32Ux64 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int32(1<<8+umagic8(c).m)]) (ZeroExt8to32 x)) (Const64 <typ.UInt64> [8+umagic8(c).s])))
7388         for {
7389                 x := v_0
7390                 if v_1.Op != OpConst8 {
7391                         break
7392                 }
7393                 c := auxIntToInt8(v_1.AuxInt)
7394                 if !(umagicOK8(c)) {
7395                         break
7396                 }
7397                 v.reset(OpTrunc32to8)
7398                 v0 := b.NewValue0(v.Pos, OpRsh32Ux64, typ.UInt32)
7399                 v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
7400                 v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
7401                 v2.AuxInt = int32ToAuxInt(int32(1<<8 + umagic8(c).m))
7402                 v3 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
7403                 v3.AddArg(x)
7404                 v1.AddArg2(v2, v3)
7405                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
7406                 v4.AuxInt = int64ToAuxInt(8 + umagic8(c).s)
7407                 v0.AddArg2(v1, v4)
7408                 v.AddArg(v0)
7409                 return true
7410         }
7411         return false
7412 }
7413 func rewriteValuegeneric_OpEq16(v *Value) bool {
7414         v_1 := v.Args[1]
7415         v_0 := v.Args[0]
7416         b := v.Block
7417         config := b.Func.Config
7418         typ := &b.Func.Config.Types
7419         // match: (Eq16 x x)
7420         // result: (ConstBool [true])
7421         for {
7422                 x := v_0
7423                 if x != v_1 {
7424                         break
7425                 }
7426                 v.reset(OpConstBool)
7427                 v.AuxInt = boolToAuxInt(true)
7428                 return true
7429         }
7430         // match: (Eq16 (Const16 <t> [c]) (Add16 (Const16 <t> [d]) x))
7431         // result: (Eq16 (Const16 <t> [c-d]) x)
7432         for {
7433                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7434                         if v_0.Op != OpConst16 {
7435                                 continue
7436                         }
7437                         t := v_0.Type
7438                         c := auxIntToInt16(v_0.AuxInt)
7439                         if v_1.Op != OpAdd16 {
7440                                 continue
7441                         }
7442                         _ = v_1.Args[1]
7443                         v_1_0 := v_1.Args[0]
7444                         v_1_1 := v_1.Args[1]
7445                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
7446                                 if v_1_0.Op != OpConst16 || v_1_0.Type != t {
7447                                         continue
7448                                 }
7449                                 d := auxIntToInt16(v_1_0.AuxInt)
7450                                 x := v_1_1
7451                                 v.reset(OpEq16)
7452                                 v0 := b.NewValue0(v.Pos, OpConst16, t)
7453                                 v0.AuxInt = int16ToAuxInt(c - d)
7454                                 v.AddArg2(v0, x)
7455                                 return true
7456                         }
7457                 }
7458                 break
7459         }
7460         // match: (Eq16 (Const16 [c]) (Const16 [d]))
7461         // result: (ConstBool [c == d])
7462         for {
7463                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7464                         if v_0.Op != OpConst16 {
7465                                 continue
7466                         }
7467                         c := auxIntToInt16(v_0.AuxInt)
7468                         if v_1.Op != OpConst16 {
7469                                 continue
7470                         }
7471                         d := auxIntToInt16(v_1.AuxInt)
7472                         v.reset(OpConstBool)
7473                         v.AuxInt = boolToAuxInt(c == d)
7474                         return true
7475                 }
7476                 break
7477         }
7478         // match: (Eq16 (Mod16u x (Const16 [c])) (Const16 [0]))
7479         // cond: x.Op != OpConst16 && udivisibleOK16(c) && !hasSmallRotate(config)
7480         // result: (Eq32 (Mod32u <typ.UInt32> (ZeroExt16to32 <typ.UInt32> x) (Const32 <typ.UInt32> [int32(uint16(c))])) (Const32 <typ.UInt32> [0]))
7481         for {
7482                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7483                         if v_0.Op != OpMod16u {
7484                                 continue
7485                         }
7486                         _ = v_0.Args[1]
7487                         x := v_0.Args[0]
7488                         v_0_1 := v_0.Args[1]
7489                         if v_0_1.Op != OpConst16 {
7490                                 continue
7491                         }
7492                         c := auxIntToInt16(v_0_1.AuxInt)
7493                         if v_1.Op != OpConst16 || auxIntToInt16(v_1.AuxInt) != 0 || !(x.Op != OpConst16 && udivisibleOK16(c) && !hasSmallRotate(config)) {
7494                                 continue
7495                         }
7496                         v.reset(OpEq32)
7497                         v0 := b.NewValue0(v.Pos, OpMod32u, typ.UInt32)
7498                         v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
7499                         v1.AddArg(x)
7500                         v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
7501                         v2.AuxInt = int32ToAuxInt(int32(uint16(c)))
7502                         v0.AddArg2(v1, v2)
7503                         v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
7504                         v3.AuxInt = int32ToAuxInt(0)
7505                         v.AddArg2(v0, v3)
7506                         return true
7507                 }
7508                 break
7509         }
7510         // match: (Eq16 (Mod16 x (Const16 [c])) (Const16 [0]))
7511         // cond: x.Op != OpConst16 && sdivisibleOK16(c) && !hasSmallRotate(config)
7512         // result: (Eq32 (Mod32 <typ.Int32> (SignExt16to32 <typ.Int32> x) (Const32 <typ.Int32> [int32(c)])) (Const32 <typ.Int32> [0]))
7513         for {
7514                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7515                         if v_0.Op != OpMod16 {
7516                                 continue
7517                         }
7518                         _ = v_0.Args[1]
7519                         x := v_0.Args[0]
7520                         v_0_1 := v_0.Args[1]
7521                         if v_0_1.Op != OpConst16 {
7522                                 continue
7523                         }
7524                         c := auxIntToInt16(v_0_1.AuxInt)
7525                         if v_1.Op != OpConst16 || auxIntToInt16(v_1.AuxInt) != 0 || !(x.Op != OpConst16 && sdivisibleOK16(c) && !hasSmallRotate(config)) {
7526                                 continue
7527                         }
7528                         v.reset(OpEq32)
7529                         v0 := b.NewValue0(v.Pos, OpMod32, typ.Int32)
7530                         v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
7531                         v1.AddArg(x)
7532                         v2 := b.NewValue0(v.Pos, OpConst32, typ.Int32)
7533                         v2.AuxInt = int32ToAuxInt(int32(c))
7534                         v0.AddArg2(v1, v2)
7535                         v3 := b.NewValue0(v.Pos, OpConst32, typ.Int32)
7536                         v3.AuxInt = int32ToAuxInt(0)
7537                         v.AddArg2(v0, v3)
7538                         return true
7539                 }
7540                 break
7541         }
7542         // match: (Eq16 x (Mul16 (Const16 [c]) (Trunc64to16 (Rsh64Ux64 mul:(Mul64 (Const64 [m]) (ZeroExt16to64 x)) (Const64 [s]))) ) )
7543         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic16(c).m) && s == 16+umagic16(c).s && x.Op != OpConst16 && udivisibleOK16(c)
7544         // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int16(udivisible16(c).m)]) x) (Const16 <typ.UInt16> [int16(16-udivisible16(c).k)]) ) (Const16 <typ.UInt16> [int16(udivisible16(c).max)]) )
7545         for {
7546                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7547                         x := v_0
7548                         if v_1.Op != OpMul16 {
7549                                 continue
7550                         }
7551                         _ = v_1.Args[1]
7552                         v_1_0 := v_1.Args[0]
7553                         v_1_1 := v_1.Args[1]
7554                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
7555                                 if v_1_0.Op != OpConst16 {
7556                                         continue
7557                                 }
7558                                 c := auxIntToInt16(v_1_0.AuxInt)
7559                                 if v_1_1.Op != OpTrunc64to16 {
7560                                         continue
7561                                 }
7562                                 v_1_1_0 := v_1_1.Args[0]
7563                                 if v_1_1_0.Op != OpRsh64Ux64 {
7564                                         continue
7565                                 }
7566                                 _ = v_1_1_0.Args[1]
7567                                 mul := v_1_1_0.Args[0]
7568                                 if mul.Op != OpMul64 {
7569                                         continue
7570                                 }
7571                                 _ = mul.Args[1]
7572                                 mul_0 := mul.Args[0]
7573                                 mul_1 := mul.Args[1]
7574                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
7575                                         if mul_0.Op != OpConst64 {
7576                                                 continue
7577                                         }
7578                                         m := auxIntToInt64(mul_0.AuxInt)
7579                                         if mul_1.Op != OpZeroExt16to64 || x != mul_1.Args[0] {
7580                                                 continue
7581                                         }
7582                                         v_1_1_0_1 := v_1_1_0.Args[1]
7583                                         if v_1_1_0_1.Op != OpConst64 {
7584                                                 continue
7585                                         }
7586                                         s := auxIntToInt64(v_1_1_0_1.AuxInt)
7587                                         if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<16+umagic16(c).m) && s == 16+umagic16(c).s && x.Op != OpConst16 && udivisibleOK16(c)) {
7588                                                 continue
7589                                         }
7590                                         v.reset(OpLeq16U)
7591                                         v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16)
7592                                         v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16)
7593                                         v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16)
7594                                         v2.AuxInt = int16ToAuxInt(int16(udivisible16(c).m))
7595                                         v1.AddArg2(v2, x)
7596                                         v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16)
7597                                         v3.AuxInt = int16ToAuxInt(int16(16 - udivisible16(c).k))
7598                                         v0.AddArg2(v1, v3)
7599                                         v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16)
7600                                         v4.AuxInt = int16ToAuxInt(int16(udivisible16(c).max))
7601                                         v.AddArg2(v0, v4)
7602                                         return true
7603                                 }
7604                         }
7605                 }
7606                 break
7607         }
7608         // match: (Eq16 x (Mul16 (Const16 [c]) (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (Const32 [m]) (ZeroExt16to32 x)) (Const64 [s]))) ) )
7609         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(1<<15+umagic16(c).m/2) && s == 16+umagic16(c).s-1 && x.Op != OpConst16 && udivisibleOK16(c)
7610         // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int16(udivisible16(c).m)]) x) (Const16 <typ.UInt16> [int16(16-udivisible16(c).k)]) ) (Const16 <typ.UInt16> [int16(udivisible16(c).max)]) )
7611         for {
7612                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7613                         x := v_0
7614                         if v_1.Op != OpMul16 {
7615                                 continue
7616                         }
7617                         _ = v_1.Args[1]
7618                         v_1_0 := v_1.Args[0]
7619                         v_1_1 := v_1.Args[1]
7620                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
7621                                 if v_1_0.Op != OpConst16 {
7622                                         continue
7623                                 }
7624                                 c := auxIntToInt16(v_1_0.AuxInt)
7625                                 if v_1_1.Op != OpTrunc32to16 {
7626                                         continue
7627                                 }
7628                                 v_1_1_0 := v_1_1.Args[0]
7629                                 if v_1_1_0.Op != OpRsh32Ux64 {
7630                                         continue
7631                                 }
7632                                 _ = v_1_1_0.Args[1]
7633                                 mul := v_1_1_0.Args[0]
7634                                 if mul.Op != OpMul32 {
7635                                         continue
7636                                 }
7637                                 _ = mul.Args[1]
7638                                 mul_0 := mul.Args[0]
7639                                 mul_1 := mul.Args[1]
7640                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
7641                                         if mul_0.Op != OpConst32 {
7642                                                 continue
7643                                         }
7644                                         m := auxIntToInt32(mul_0.AuxInt)
7645                                         if mul_1.Op != OpZeroExt16to32 || x != mul_1.Args[0] {
7646                                                 continue
7647                                         }
7648                                         v_1_1_0_1 := v_1_1_0.Args[1]
7649                                         if v_1_1_0_1.Op != OpConst64 {
7650                                                 continue
7651                                         }
7652                                         s := auxIntToInt64(v_1_1_0_1.AuxInt)
7653                                         if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(1<<15+umagic16(c).m/2) && s == 16+umagic16(c).s-1 && x.Op != OpConst16 && udivisibleOK16(c)) {
7654                                                 continue
7655                                         }
7656                                         v.reset(OpLeq16U)
7657                                         v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16)
7658                                         v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16)
7659                                         v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16)
7660                                         v2.AuxInt = int16ToAuxInt(int16(udivisible16(c).m))
7661                                         v1.AddArg2(v2, x)
7662                                         v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16)
7663                                         v3.AuxInt = int16ToAuxInt(int16(16 - udivisible16(c).k))
7664                                         v0.AddArg2(v1, v3)
7665                                         v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16)
7666                                         v4.AuxInt = int16ToAuxInt(int16(udivisible16(c).max))
7667                                         v.AddArg2(v0, v4)
7668                                         return true
7669                                 }
7670                         }
7671                 }
7672                 break
7673         }
7674         // match: (Eq16 x (Mul16 (Const16 [c]) (Trunc32to16 (Rsh32Ux64 mul:(Mul32 (Const32 [m]) (Rsh32Ux64 (ZeroExt16to32 x) (Const64 [1]))) (Const64 [s]))) ) )
7675         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(1<<15+(umagic16(c).m+1)/2) && s == 16+umagic16(c).s-2 && x.Op != OpConst16 && udivisibleOK16(c)
7676         // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int16(udivisible16(c).m)]) x) (Const16 <typ.UInt16> [int16(16-udivisible16(c).k)]) ) (Const16 <typ.UInt16> [int16(udivisible16(c).max)]) )
7677         for {
7678                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7679                         x := v_0
7680                         if v_1.Op != OpMul16 {
7681                                 continue
7682                         }
7683                         _ = v_1.Args[1]
7684                         v_1_0 := v_1.Args[0]
7685                         v_1_1 := v_1.Args[1]
7686                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
7687                                 if v_1_0.Op != OpConst16 {
7688                                         continue
7689                                 }
7690                                 c := auxIntToInt16(v_1_0.AuxInt)
7691                                 if v_1_1.Op != OpTrunc32to16 {
7692                                         continue
7693                                 }
7694                                 v_1_1_0 := v_1_1.Args[0]
7695                                 if v_1_1_0.Op != OpRsh32Ux64 {
7696                                         continue
7697                                 }
7698                                 _ = v_1_1_0.Args[1]
7699                                 mul := v_1_1_0.Args[0]
7700                                 if mul.Op != OpMul32 {
7701                                         continue
7702                                 }
7703                                 _ = mul.Args[1]
7704                                 mul_0 := mul.Args[0]
7705                                 mul_1 := mul.Args[1]
7706                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
7707                                         if mul_0.Op != OpConst32 {
7708                                                 continue
7709                                         }
7710                                         m := auxIntToInt32(mul_0.AuxInt)
7711                                         if mul_1.Op != OpRsh32Ux64 {
7712                                                 continue
7713                                         }
7714                                         _ = mul_1.Args[1]
7715                                         mul_1_0 := mul_1.Args[0]
7716                                         if mul_1_0.Op != OpZeroExt16to32 || x != mul_1_0.Args[0] {
7717                                                 continue
7718                                         }
7719                                         mul_1_1 := mul_1.Args[1]
7720                                         if mul_1_1.Op != OpConst64 || auxIntToInt64(mul_1_1.AuxInt) != 1 {
7721                                                 continue
7722                                         }
7723                                         v_1_1_0_1 := v_1_1_0.Args[1]
7724                                         if v_1_1_0_1.Op != OpConst64 {
7725                                                 continue
7726                                         }
7727                                         s := auxIntToInt64(v_1_1_0_1.AuxInt)
7728                                         if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(1<<15+(umagic16(c).m+1)/2) && s == 16+umagic16(c).s-2 && x.Op != OpConst16 && udivisibleOK16(c)) {
7729                                                 continue
7730                                         }
7731                                         v.reset(OpLeq16U)
7732                                         v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16)
7733                                         v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16)
7734                                         v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16)
7735                                         v2.AuxInt = int16ToAuxInt(int16(udivisible16(c).m))
7736                                         v1.AddArg2(v2, x)
7737                                         v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16)
7738                                         v3.AuxInt = int16ToAuxInt(int16(16 - udivisible16(c).k))
7739                                         v0.AddArg2(v1, v3)
7740                                         v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16)
7741                                         v4.AuxInt = int16ToAuxInt(int16(udivisible16(c).max))
7742                                         v.AddArg2(v0, v4)
7743                                         return true
7744                                 }
7745                         }
7746                 }
7747                 break
7748         }
7749         // match: (Eq16 x (Mul16 (Const16 [c]) (Trunc32to16 (Rsh32Ux64 (Avg32u (Lsh32x64 (ZeroExt16to32 x) (Const64 [16])) mul:(Mul32 (Const32 [m]) (ZeroExt16to32 x))) (Const64 [s]))) ) )
7750         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(umagic16(c).m) && s == 16+umagic16(c).s-1 && x.Op != OpConst16 && udivisibleOK16(c)
7751         // result: (Leq16U (RotateLeft16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int16(udivisible16(c).m)]) x) (Const16 <typ.UInt16> [int16(16-udivisible16(c).k)]) ) (Const16 <typ.UInt16> [int16(udivisible16(c).max)]) )
7752         for {
7753                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7754                         x := v_0
7755                         if v_1.Op != OpMul16 {
7756                                 continue
7757                         }
7758                         _ = v_1.Args[1]
7759                         v_1_0 := v_1.Args[0]
7760                         v_1_1 := v_1.Args[1]
7761                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
7762                                 if v_1_0.Op != OpConst16 {
7763                                         continue
7764                                 }
7765                                 c := auxIntToInt16(v_1_0.AuxInt)
7766                                 if v_1_1.Op != OpTrunc32to16 {
7767                                         continue
7768                                 }
7769                                 v_1_1_0 := v_1_1.Args[0]
7770                                 if v_1_1_0.Op != OpRsh32Ux64 {
7771                                         continue
7772                                 }
7773                                 _ = v_1_1_0.Args[1]
7774                                 v_1_1_0_0 := v_1_1_0.Args[0]
7775                                 if v_1_1_0_0.Op != OpAvg32u {
7776                                         continue
7777                                 }
7778                                 _ = v_1_1_0_0.Args[1]
7779                                 v_1_1_0_0_0 := v_1_1_0_0.Args[0]
7780                                 if v_1_1_0_0_0.Op != OpLsh32x64 {
7781                                         continue
7782                                 }
7783                                 _ = v_1_1_0_0_0.Args[1]
7784                                 v_1_1_0_0_0_0 := v_1_1_0_0_0.Args[0]
7785                                 if v_1_1_0_0_0_0.Op != OpZeroExt16to32 || x != v_1_1_0_0_0_0.Args[0] {
7786                                         continue
7787                                 }
7788                                 v_1_1_0_0_0_1 := v_1_1_0_0_0.Args[1]
7789                                 if v_1_1_0_0_0_1.Op != OpConst64 || auxIntToInt64(v_1_1_0_0_0_1.AuxInt) != 16 {
7790                                         continue
7791                                 }
7792                                 mul := v_1_1_0_0.Args[1]
7793                                 if mul.Op != OpMul32 {
7794                                         continue
7795                                 }
7796                                 _ = mul.Args[1]
7797                                 mul_0 := mul.Args[0]
7798                                 mul_1 := mul.Args[1]
7799                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
7800                                         if mul_0.Op != OpConst32 {
7801                                                 continue
7802                                         }
7803                                         m := auxIntToInt32(mul_0.AuxInt)
7804                                         if mul_1.Op != OpZeroExt16to32 || x != mul_1.Args[0] {
7805                                                 continue
7806                                         }
7807                                         v_1_1_0_1 := v_1_1_0.Args[1]
7808                                         if v_1_1_0_1.Op != OpConst64 {
7809                                                 continue
7810                                         }
7811                                         s := auxIntToInt64(v_1_1_0_1.AuxInt)
7812                                         if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(umagic16(c).m) && s == 16+umagic16(c).s-1 && x.Op != OpConst16 && udivisibleOK16(c)) {
7813                                                 continue
7814                                         }
7815                                         v.reset(OpLeq16U)
7816                                         v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16)
7817                                         v1 := b.NewValue0(v.Pos, OpMul16, typ.UInt16)
7818                                         v2 := b.NewValue0(v.Pos, OpConst16, typ.UInt16)
7819                                         v2.AuxInt = int16ToAuxInt(int16(udivisible16(c).m))
7820                                         v1.AddArg2(v2, x)
7821                                         v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16)
7822                                         v3.AuxInt = int16ToAuxInt(int16(16 - udivisible16(c).k))
7823                                         v0.AddArg2(v1, v3)
7824                                         v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16)
7825                                         v4.AuxInt = int16ToAuxInt(int16(udivisible16(c).max))
7826                                         v.AddArg2(v0, v4)
7827                                         return true
7828                                 }
7829                         }
7830                 }
7831                 break
7832         }
7833         // match: (Eq16 x (Mul16 (Const16 [c]) (Sub16 (Rsh32x64 mul:(Mul32 (Const32 [m]) (SignExt16to32 x)) (Const64 [s])) (Rsh32x64 (SignExt16to32 x) (Const64 [31]))) ) )
7834         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(smagic16(c).m) && s == 16+smagic16(c).s && x.Op != OpConst16 && sdivisibleOK16(c)
7835         // result: (Leq16U (RotateLeft16 <typ.UInt16> (Add16 <typ.UInt16> (Mul16 <typ.UInt16> (Const16 <typ.UInt16> [int16(sdivisible16(c).m)]) x) (Const16 <typ.UInt16> [int16(sdivisible16(c).a)]) ) (Const16 <typ.UInt16> [int16(16-sdivisible16(c).k)]) ) (Const16 <typ.UInt16> [int16(sdivisible16(c).max)]) )
7836         for {
7837                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7838                         x := v_0
7839                         if v_1.Op != OpMul16 {
7840                                 continue
7841                         }
7842                         _ = v_1.Args[1]
7843                         v_1_0 := v_1.Args[0]
7844                         v_1_1 := v_1.Args[1]
7845                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
7846                                 if v_1_0.Op != OpConst16 {
7847                                         continue
7848                                 }
7849                                 c := auxIntToInt16(v_1_0.AuxInt)
7850                                 if v_1_1.Op != OpSub16 {
7851                                         continue
7852                                 }
7853                                 _ = v_1_1.Args[1]
7854                                 v_1_1_0 := v_1_1.Args[0]
7855                                 if v_1_1_0.Op != OpRsh32x64 {
7856                                         continue
7857                                 }
7858                                 _ = v_1_1_0.Args[1]
7859                                 mul := v_1_1_0.Args[0]
7860                                 if mul.Op != OpMul32 {
7861                                         continue
7862                                 }
7863                                 _ = mul.Args[1]
7864                                 mul_0 := mul.Args[0]
7865                                 mul_1 := mul.Args[1]
7866                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
7867                                         if mul_0.Op != OpConst32 {
7868                                                 continue
7869                                         }
7870                                         m := auxIntToInt32(mul_0.AuxInt)
7871                                         if mul_1.Op != OpSignExt16to32 || x != mul_1.Args[0] {
7872                                                 continue
7873                                         }
7874                                         v_1_1_0_1 := v_1_1_0.Args[1]
7875                                         if v_1_1_0_1.Op != OpConst64 {
7876                                                 continue
7877                                         }
7878                                         s := auxIntToInt64(v_1_1_0_1.AuxInt)
7879                                         v_1_1_1 := v_1_1.Args[1]
7880                                         if v_1_1_1.Op != OpRsh32x64 {
7881                                                 continue
7882                                         }
7883                                         _ = v_1_1_1.Args[1]
7884                                         v_1_1_1_0 := v_1_1_1.Args[0]
7885                                         if v_1_1_1_0.Op != OpSignExt16to32 || x != v_1_1_1_0.Args[0] {
7886                                                 continue
7887                                         }
7888                                         v_1_1_1_1 := v_1_1_1.Args[1]
7889                                         if v_1_1_1_1.Op != OpConst64 || auxIntToInt64(v_1_1_1_1.AuxInt) != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(smagic16(c).m) && s == 16+smagic16(c).s && x.Op != OpConst16 && sdivisibleOK16(c)) {
7890                                                 continue
7891                                         }
7892                                         v.reset(OpLeq16U)
7893                                         v0 := b.NewValue0(v.Pos, OpRotateLeft16, typ.UInt16)
7894                                         v1 := b.NewValue0(v.Pos, OpAdd16, typ.UInt16)
7895                                         v2 := b.NewValue0(v.Pos, OpMul16, typ.UInt16)
7896                                         v3 := b.NewValue0(v.Pos, OpConst16, typ.UInt16)
7897                                         v3.AuxInt = int16ToAuxInt(int16(sdivisible16(c).m))
7898                                         v2.AddArg2(v3, x)
7899                                         v4 := b.NewValue0(v.Pos, OpConst16, typ.UInt16)
7900                                         v4.AuxInt = int16ToAuxInt(int16(sdivisible16(c).a))
7901                                         v1.AddArg2(v2, v4)
7902                                         v5 := b.NewValue0(v.Pos, OpConst16, typ.UInt16)
7903                                         v5.AuxInt = int16ToAuxInt(int16(16 - sdivisible16(c).k))
7904                                         v0.AddArg2(v1, v5)
7905                                         v6 := b.NewValue0(v.Pos, OpConst16, typ.UInt16)
7906                                         v6.AuxInt = int16ToAuxInt(int16(sdivisible16(c).max))
7907                                         v.AddArg2(v0, v6)
7908                                         return true
7909                                 }
7910                         }
7911                 }
7912                 break
7913         }
7914         // match: (Eq16 n (Lsh16x64 (Rsh16x64 (Add16 <t> n (Rsh16Ux64 <t> (Rsh16x64 <t> n (Const64 <typ.UInt64> [15])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) )
7915         // cond: k > 0 && k < 15 && kbar == 16 - k
7916         // result: (Eq16 (And16 <t> n (Const16 <t> [1<<uint(k)-1])) (Const16 <t> [0]))
7917         for {
7918                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7919                         n := v_0
7920                         if v_1.Op != OpLsh16x64 {
7921                                 continue
7922                         }
7923                         _ = v_1.Args[1]
7924                         v_1_0 := v_1.Args[0]
7925                         if v_1_0.Op != OpRsh16x64 {
7926                                 continue
7927                         }
7928                         _ = v_1_0.Args[1]
7929                         v_1_0_0 := v_1_0.Args[0]
7930                         if v_1_0_0.Op != OpAdd16 {
7931                                 continue
7932                         }
7933                         t := v_1_0_0.Type
7934                         _ = v_1_0_0.Args[1]
7935                         v_1_0_0_0 := v_1_0_0.Args[0]
7936                         v_1_0_0_1 := v_1_0_0.Args[1]
7937                         for _i1 := 0; _i1 <= 1; _i1, v_1_0_0_0, v_1_0_0_1 = _i1+1, v_1_0_0_1, v_1_0_0_0 {
7938                                 if n != v_1_0_0_0 || v_1_0_0_1.Op != OpRsh16Ux64 || v_1_0_0_1.Type != t {
7939                                         continue
7940                                 }
7941                                 _ = v_1_0_0_1.Args[1]
7942                                 v_1_0_0_1_0 := v_1_0_0_1.Args[0]
7943                                 if v_1_0_0_1_0.Op != OpRsh16x64 || v_1_0_0_1_0.Type != t {
7944                                         continue
7945                                 }
7946                                 _ = v_1_0_0_1_0.Args[1]
7947                                 if n != v_1_0_0_1_0.Args[0] {
7948                                         continue
7949                                 }
7950                                 v_1_0_0_1_0_1 := v_1_0_0_1_0.Args[1]
7951                                 if v_1_0_0_1_0_1.Op != OpConst64 || v_1_0_0_1_0_1.Type != typ.UInt64 || auxIntToInt64(v_1_0_0_1_0_1.AuxInt) != 15 {
7952                                         continue
7953                                 }
7954                                 v_1_0_0_1_1 := v_1_0_0_1.Args[1]
7955                                 if v_1_0_0_1_1.Op != OpConst64 || v_1_0_0_1_1.Type != typ.UInt64 {
7956                                         continue
7957                                 }
7958                                 kbar := auxIntToInt64(v_1_0_0_1_1.AuxInt)
7959                                 v_1_0_1 := v_1_0.Args[1]
7960                                 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 {
7961                                         continue
7962                                 }
7963                                 k := auxIntToInt64(v_1_0_1.AuxInt)
7964                                 v_1_1 := v_1.Args[1]
7965                                 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || auxIntToInt64(v_1_1.AuxInt) != k || !(k > 0 && k < 15 && kbar == 16-k) {
7966                                         continue
7967                                 }
7968                                 v.reset(OpEq16)
7969                                 v0 := b.NewValue0(v.Pos, OpAnd16, t)
7970                                 v1 := b.NewValue0(v.Pos, OpConst16, t)
7971                                 v1.AuxInt = int16ToAuxInt(1<<uint(k) - 1)
7972                                 v0.AddArg2(n, v1)
7973                                 v2 := b.NewValue0(v.Pos, OpConst16, t)
7974                                 v2.AuxInt = int16ToAuxInt(0)
7975                                 v.AddArg2(v0, v2)
7976                                 return true
7977                         }
7978                 }
7979                 break
7980         }
7981         // match: (Eq16 s:(Sub16 x y) (Const16 [0]))
7982         // cond: s.Uses == 1
7983         // result: (Eq16 x y)
7984         for {
7985                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
7986                         s := v_0
7987                         if s.Op != OpSub16 {
7988                                 continue
7989                         }
7990                         y := s.Args[1]
7991                         x := s.Args[0]
7992                         if v_1.Op != OpConst16 || auxIntToInt16(v_1.AuxInt) != 0 || !(s.Uses == 1) {
7993                                 continue
7994                         }
7995                         v.reset(OpEq16)
7996                         v.AddArg2(x, y)
7997                         return true
7998                 }
7999                 break
8000         }
8001         // match: (Eq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [y]))
8002         // cond: oneBit16(y)
8003         // result: (Neq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [0]))
8004         for {
8005                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8006                         if v_0.Op != OpAnd16 {
8007                                 continue
8008                         }
8009                         t := v_0.Type
8010                         _ = v_0.Args[1]
8011                         v_0_0 := v_0.Args[0]
8012                         v_0_1 := v_0.Args[1]
8013                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
8014                                 x := v_0_0
8015                                 if v_0_1.Op != OpConst16 || v_0_1.Type != t {
8016                                         continue
8017                                 }
8018                                 y := auxIntToInt16(v_0_1.AuxInt)
8019                                 if v_1.Op != OpConst16 || v_1.Type != t || auxIntToInt16(v_1.AuxInt) != y || !(oneBit16(y)) {
8020                                         continue
8021                                 }
8022                                 v.reset(OpNeq16)
8023                                 v0 := b.NewValue0(v.Pos, OpAnd16, t)
8024                                 v1 := b.NewValue0(v.Pos, OpConst16, t)
8025                                 v1.AuxInt = int16ToAuxInt(y)
8026                                 v0.AddArg2(x, v1)
8027                                 v2 := b.NewValue0(v.Pos, OpConst16, t)
8028                                 v2.AuxInt = int16ToAuxInt(0)
8029                                 v.AddArg2(v0, v2)
8030                                 return true
8031                         }
8032                 }
8033                 break
8034         }
8035         return false
8036 }
8037 func rewriteValuegeneric_OpEq32(v *Value) bool {
8038         v_1 := v.Args[1]
8039         v_0 := v.Args[0]
8040         b := v.Block
8041         typ := &b.Func.Config.Types
8042         // match: (Eq32 x x)
8043         // result: (ConstBool [true])
8044         for {
8045                 x := v_0
8046                 if x != v_1 {
8047                         break
8048                 }
8049                 v.reset(OpConstBool)
8050                 v.AuxInt = boolToAuxInt(true)
8051                 return true
8052         }
8053         // match: (Eq32 (Const32 <t> [c]) (Add32 (Const32 <t> [d]) x))
8054         // result: (Eq32 (Const32 <t> [c-d]) x)
8055         for {
8056                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8057                         if v_0.Op != OpConst32 {
8058                                 continue
8059                         }
8060                         t := v_0.Type
8061                         c := auxIntToInt32(v_0.AuxInt)
8062                         if v_1.Op != OpAdd32 {
8063                                 continue
8064                         }
8065                         _ = v_1.Args[1]
8066                         v_1_0 := v_1.Args[0]
8067                         v_1_1 := v_1.Args[1]
8068                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
8069                                 if v_1_0.Op != OpConst32 || v_1_0.Type != t {
8070                                         continue
8071                                 }
8072                                 d := auxIntToInt32(v_1_0.AuxInt)
8073                                 x := v_1_1
8074                                 v.reset(OpEq32)
8075                                 v0 := b.NewValue0(v.Pos, OpConst32, t)
8076                                 v0.AuxInt = int32ToAuxInt(c - d)
8077                                 v.AddArg2(v0, x)
8078                                 return true
8079                         }
8080                 }
8081                 break
8082         }
8083         // match: (Eq32 (Const32 [c]) (Const32 [d]))
8084         // result: (ConstBool [c == d])
8085         for {
8086                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8087                         if v_0.Op != OpConst32 {
8088                                 continue
8089                         }
8090                         c := auxIntToInt32(v_0.AuxInt)
8091                         if v_1.Op != OpConst32 {
8092                                 continue
8093                         }
8094                         d := auxIntToInt32(v_1.AuxInt)
8095                         v.reset(OpConstBool)
8096                         v.AuxInt = boolToAuxInt(c == d)
8097                         return true
8098                 }
8099                 break
8100         }
8101         // match: (Eq32 x (Mul32 (Const32 [c]) (Rsh32Ux64 mul:(Hmul32u (Const32 [m]) x) (Const64 [s])) ) )
8102         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(1<<31+umagic32(c).m/2) && s == umagic32(c).s-1 && x.Op != OpConst32 && udivisibleOK32(c)
8103         // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int32(udivisible32(c).m)]) x) (Const32 <typ.UInt32> [int32(32-udivisible32(c).k)]) ) (Const32 <typ.UInt32> [int32(udivisible32(c).max)]) )
8104         for {
8105                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8106                         x := v_0
8107                         if v_1.Op != OpMul32 {
8108                                 continue
8109                         }
8110                         _ = v_1.Args[1]
8111                         v_1_0 := v_1.Args[0]
8112                         v_1_1 := v_1.Args[1]
8113                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
8114                                 if v_1_0.Op != OpConst32 {
8115                                         continue
8116                                 }
8117                                 c := auxIntToInt32(v_1_0.AuxInt)
8118                                 if v_1_1.Op != OpRsh32Ux64 {
8119                                         continue
8120                                 }
8121                                 _ = v_1_1.Args[1]
8122                                 mul := v_1_1.Args[0]
8123                                 if mul.Op != OpHmul32u {
8124                                         continue
8125                                 }
8126                                 _ = mul.Args[1]
8127                                 mul_0 := mul.Args[0]
8128                                 mul_1 := mul.Args[1]
8129                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
8130                                         if mul_0.Op != OpConst32 {
8131                                                 continue
8132                                         }
8133                                         m := auxIntToInt32(mul_0.AuxInt)
8134                                         if x != mul_1 {
8135                                                 continue
8136                                         }
8137                                         v_1_1_1 := v_1_1.Args[1]
8138                                         if v_1_1_1.Op != OpConst64 {
8139                                                 continue
8140                                         }
8141                                         s := auxIntToInt64(v_1_1_1.AuxInt)
8142                                         if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(1<<31+umagic32(c).m/2) && s == umagic32(c).s-1 && x.Op != OpConst32 && udivisibleOK32(c)) {
8143                                                 continue
8144                                         }
8145                                         v.reset(OpLeq32U)
8146                                         v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32)
8147                                         v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
8148                                         v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8149                                         v2.AuxInt = int32ToAuxInt(int32(udivisible32(c).m))
8150                                         v1.AddArg2(v2, x)
8151                                         v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8152                                         v3.AuxInt = int32ToAuxInt(int32(32 - udivisible32(c).k))
8153                                         v0.AddArg2(v1, v3)
8154                                         v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8155                                         v4.AuxInt = int32ToAuxInt(int32(udivisible32(c).max))
8156                                         v.AddArg2(v0, v4)
8157                                         return true
8158                                 }
8159                         }
8160                 }
8161                 break
8162         }
8163         // match: (Eq32 x (Mul32 (Const32 [c]) (Rsh32Ux64 mul:(Hmul32u (Const32 <typ.UInt32> [m]) (Rsh32Ux64 x (Const64 [1]))) (Const64 [s])) ) )
8164         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(1<<31+(umagic32(c).m+1)/2) && s == umagic32(c).s-2 && x.Op != OpConst32 && udivisibleOK32(c)
8165         // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int32(udivisible32(c).m)]) x) (Const32 <typ.UInt32> [int32(32-udivisible32(c).k)]) ) (Const32 <typ.UInt32> [int32(udivisible32(c).max)]) )
8166         for {
8167                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8168                         x := v_0
8169                         if v_1.Op != OpMul32 {
8170                                 continue
8171                         }
8172                         _ = v_1.Args[1]
8173                         v_1_0 := v_1.Args[0]
8174                         v_1_1 := v_1.Args[1]
8175                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
8176                                 if v_1_0.Op != OpConst32 {
8177                                         continue
8178                                 }
8179                                 c := auxIntToInt32(v_1_0.AuxInt)
8180                                 if v_1_1.Op != OpRsh32Ux64 {
8181                                         continue
8182                                 }
8183                                 _ = v_1_1.Args[1]
8184                                 mul := v_1_1.Args[0]
8185                                 if mul.Op != OpHmul32u {
8186                                         continue
8187                                 }
8188                                 _ = mul.Args[1]
8189                                 mul_0 := mul.Args[0]
8190                                 mul_1 := mul.Args[1]
8191                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
8192                                         if mul_0.Op != OpConst32 || mul_0.Type != typ.UInt32 {
8193                                                 continue
8194                                         }
8195                                         m := auxIntToInt32(mul_0.AuxInt)
8196                                         if mul_1.Op != OpRsh32Ux64 {
8197                                                 continue
8198                                         }
8199                                         _ = mul_1.Args[1]
8200                                         if x != mul_1.Args[0] {
8201                                                 continue
8202                                         }
8203                                         mul_1_1 := mul_1.Args[1]
8204                                         if mul_1_1.Op != OpConst64 || auxIntToInt64(mul_1_1.AuxInt) != 1 {
8205                                                 continue
8206                                         }
8207                                         v_1_1_1 := v_1_1.Args[1]
8208                                         if v_1_1_1.Op != OpConst64 {
8209                                                 continue
8210                                         }
8211                                         s := auxIntToInt64(v_1_1_1.AuxInt)
8212                                         if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(1<<31+(umagic32(c).m+1)/2) && s == umagic32(c).s-2 && x.Op != OpConst32 && udivisibleOK32(c)) {
8213                                                 continue
8214                                         }
8215                                         v.reset(OpLeq32U)
8216                                         v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32)
8217                                         v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
8218                                         v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8219                                         v2.AuxInt = int32ToAuxInt(int32(udivisible32(c).m))
8220                                         v1.AddArg2(v2, x)
8221                                         v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8222                                         v3.AuxInt = int32ToAuxInt(int32(32 - udivisible32(c).k))
8223                                         v0.AddArg2(v1, v3)
8224                                         v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8225                                         v4.AuxInt = int32ToAuxInt(int32(udivisible32(c).max))
8226                                         v.AddArg2(v0, v4)
8227                                         return true
8228                                 }
8229                         }
8230                 }
8231                 break
8232         }
8233         // match: (Eq32 x (Mul32 (Const32 [c]) (Rsh32Ux64 (Avg32u x mul:(Hmul32u (Const32 [m]) x)) (Const64 [s])) ) )
8234         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(umagic32(c).m) && s == umagic32(c).s-1 && x.Op != OpConst32 && udivisibleOK32(c)
8235         // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int32(udivisible32(c).m)]) x) (Const32 <typ.UInt32> [int32(32-udivisible32(c).k)]) ) (Const32 <typ.UInt32> [int32(udivisible32(c).max)]) )
8236         for {
8237                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8238                         x := v_0
8239                         if v_1.Op != OpMul32 {
8240                                 continue
8241                         }
8242                         _ = v_1.Args[1]
8243                         v_1_0 := v_1.Args[0]
8244                         v_1_1 := v_1.Args[1]
8245                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
8246                                 if v_1_0.Op != OpConst32 {
8247                                         continue
8248                                 }
8249                                 c := auxIntToInt32(v_1_0.AuxInt)
8250                                 if v_1_1.Op != OpRsh32Ux64 {
8251                                         continue
8252                                 }
8253                                 _ = v_1_1.Args[1]
8254                                 v_1_1_0 := v_1_1.Args[0]
8255                                 if v_1_1_0.Op != OpAvg32u {
8256                                         continue
8257                                 }
8258                                 _ = v_1_1_0.Args[1]
8259                                 if x != v_1_1_0.Args[0] {
8260                                         continue
8261                                 }
8262                                 mul := v_1_1_0.Args[1]
8263                                 if mul.Op != OpHmul32u {
8264                                         continue
8265                                 }
8266                                 _ = mul.Args[1]
8267                                 mul_0 := mul.Args[0]
8268                                 mul_1 := mul.Args[1]
8269                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
8270                                         if mul_0.Op != OpConst32 {
8271                                                 continue
8272                                         }
8273                                         m := auxIntToInt32(mul_0.AuxInt)
8274                                         if x != mul_1 {
8275                                                 continue
8276                                         }
8277                                         v_1_1_1 := v_1_1.Args[1]
8278                                         if v_1_1_1.Op != OpConst64 {
8279                                                 continue
8280                                         }
8281                                         s := auxIntToInt64(v_1_1_1.AuxInt)
8282                                         if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(umagic32(c).m) && s == umagic32(c).s-1 && x.Op != OpConst32 && udivisibleOK32(c)) {
8283                                                 continue
8284                                         }
8285                                         v.reset(OpLeq32U)
8286                                         v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32)
8287                                         v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
8288                                         v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8289                                         v2.AuxInt = int32ToAuxInt(int32(udivisible32(c).m))
8290                                         v1.AddArg2(v2, x)
8291                                         v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8292                                         v3.AuxInt = int32ToAuxInt(int32(32 - udivisible32(c).k))
8293                                         v0.AddArg2(v1, v3)
8294                                         v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8295                                         v4.AuxInt = int32ToAuxInt(int32(udivisible32(c).max))
8296                                         v.AddArg2(v0, v4)
8297                                         return true
8298                                 }
8299                         }
8300                 }
8301                 break
8302         }
8303         // match: (Eq32 x (Mul32 (Const32 [c]) (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (Const64 [m]) (ZeroExt32to64 x)) (Const64 [s]))) ) )
8304         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic32(c).m/2) && s == 32+umagic32(c).s-1 && x.Op != OpConst32 && udivisibleOK32(c)
8305         // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int32(udivisible32(c).m)]) x) (Const32 <typ.UInt32> [int32(32-udivisible32(c).k)]) ) (Const32 <typ.UInt32> [int32(udivisible32(c).max)]) )
8306         for {
8307                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8308                         x := v_0
8309                         if v_1.Op != OpMul32 {
8310                                 continue
8311                         }
8312                         _ = v_1.Args[1]
8313                         v_1_0 := v_1.Args[0]
8314                         v_1_1 := v_1.Args[1]
8315                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
8316                                 if v_1_0.Op != OpConst32 {
8317                                         continue
8318                                 }
8319                                 c := auxIntToInt32(v_1_0.AuxInt)
8320                                 if v_1_1.Op != OpTrunc64to32 {
8321                                         continue
8322                                 }
8323                                 v_1_1_0 := v_1_1.Args[0]
8324                                 if v_1_1_0.Op != OpRsh64Ux64 {
8325                                         continue
8326                                 }
8327                                 _ = v_1_1_0.Args[1]
8328                                 mul := v_1_1_0.Args[0]
8329                                 if mul.Op != OpMul64 {
8330                                         continue
8331                                 }
8332                                 _ = mul.Args[1]
8333                                 mul_0 := mul.Args[0]
8334                                 mul_1 := mul.Args[1]
8335                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
8336                                         if mul_0.Op != OpConst64 {
8337                                                 continue
8338                                         }
8339                                         m := auxIntToInt64(mul_0.AuxInt)
8340                                         if mul_1.Op != OpZeroExt32to64 || x != mul_1.Args[0] {
8341                                                 continue
8342                                         }
8343                                         v_1_1_0_1 := v_1_1_0.Args[1]
8344                                         if v_1_1_0_1.Op != OpConst64 {
8345                                                 continue
8346                                         }
8347                                         s := auxIntToInt64(v_1_1_0_1.AuxInt)
8348                                         if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+umagic32(c).m/2) && s == 32+umagic32(c).s-1 && x.Op != OpConst32 && udivisibleOK32(c)) {
8349                                                 continue
8350                                         }
8351                                         v.reset(OpLeq32U)
8352                                         v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32)
8353                                         v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
8354                                         v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8355                                         v2.AuxInt = int32ToAuxInt(int32(udivisible32(c).m))
8356                                         v1.AddArg2(v2, x)
8357                                         v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8358                                         v3.AuxInt = int32ToAuxInt(int32(32 - udivisible32(c).k))
8359                                         v0.AddArg2(v1, v3)
8360                                         v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8361                                         v4.AuxInt = int32ToAuxInt(int32(udivisible32(c).max))
8362                                         v.AddArg2(v0, v4)
8363                                         return true
8364                                 }
8365                         }
8366                 }
8367                 break
8368         }
8369         // match: (Eq32 x (Mul32 (Const32 [c]) (Trunc64to32 (Rsh64Ux64 mul:(Mul64 (Const64 [m]) (Rsh64Ux64 (ZeroExt32to64 x) (Const64 [1]))) (Const64 [s]))) ) )
8370         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic32(c).m+1)/2) && s == 32+umagic32(c).s-2 && x.Op != OpConst32 && udivisibleOK32(c)
8371         // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int32(udivisible32(c).m)]) x) (Const32 <typ.UInt32> [int32(32-udivisible32(c).k)]) ) (Const32 <typ.UInt32> [int32(udivisible32(c).max)]) )
8372         for {
8373                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8374                         x := v_0
8375                         if v_1.Op != OpMul32 {
8376                                 continue
8377                         }
8378                         _ = v_1.Args[1]
8379                         v_1_0 := v_1.Args[0]
8380                         v_1_1 := v_1.Args[1]
8381                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
8382                                 if v_1_0.Op != OpConst32 {
8383                                         continue
8384                                 }
8385                                 c := auxIntToInt32(v_1_0.AuxInt)
8386                                 if v_1_1.Op != OpTrunc64to32 {
8387                                         continue
8388                                 }
8389                                 v_1_1_0 := v_1_1.Args[0]
8390                                 if v_1_1_0.Op != OpRsh64Ux64 {
8391                                         continue
8392                                 }
8393                                 _ = v_1_1_0.Args[1]
8394                                 mul := v_1_1_0.Args[0]
8395                                 if mul.Op != OpMul64 {
8396                                         continue
8397                                 }
8398                                 _ = mul.Args[1]
8399                                 mul_0 := mul.Args[0]
8400                                 mul_1 := mul.Args[1]
8401                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
8402                                         if mul_0.Op != OpConst64 {
8403                                                 continue
8404                                         }
8405                                         m := auxIntToInt64(mul_0.AuxInt)
8406                                         if mul_1.Op != OpRsh64Ux64 {
8407                                                 continue
8408                                         }
8409                                         _ = mul_1.Args[1]
8410                                         mul_1_0 := mul_1.Args[0]
8411                                         if mul_1_0.Op != OpZeroExt32to64 || x != mul_1_0.Args[0] {
8412                                                 continue
8413                                         }
8414                                         mul_1_1 := mul_1.Args[1]
8415                                         if mul_1_1.Op != OpConst64 || auxIntToInt64(mul_1_1.AuxInt) != 1 {
8416                                                 continue
8417                                         }
8418                                         v_1_1_0_1 := v_1_1_0.Args[1]
8419                                         if v_1_1_0_1.Op != OpConst64 {
8420                                                 continue
8421                                         }
8422                                         s := auxIntToInt64(v_1_1_0_1.AuxInt)
8423                                         if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<31+(umagic32(c).m+1)/2) && s == 32+umagic32(c).s-2 && x.Op != OpConst32 && udivisibleOK32(c)) {
8424                                                 continue
8425                                         }
8426                                         v.reset(OpLeq32U)
8427                                         v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32)
8428                                         v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
8429                                         v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8430                                         v2.AuxInt = int32ToAuxInt(int32(udivisible32(c).m))
8431                                         v1.AddArg2(v2, x)
8432                                         v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8433                                         v3.AuxInt = int32ToAuxInt(int32(32 - udivisible32(c).k))
8434                                         v0.AddArg2(v1, v3)
8435                                         v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8436                                         v4.AuxInt = int32ToAuxInt(int32(udivisible32(c).max))
8437                                         v.AddArg2(v0, v4)
8438                                         return true
8439                                 }
8440                         }
8441                 }
8442                 break
8443         }
8444         // match: (Eq32 x (Mul32 (Const32 [c]) (Trunc64to32 (Rsh64Ux64 (Avg64u (Lsh64x64 (ZeroExt32to64 x) (Const64 [32])) mul:(Mul64 (Const64 [m]) (ZeroExt32to64 x))) (Const64 [s]))) ) )
8445         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic32(c).m) && s == 32+umagic32(c).s-1 && x.Op != OpConst32 && udivisibleOK32(c)
8446         // result: (Leq32U (RotateLeft32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int32(udivisible32(c).m)]) x) (Const32 <typ.UInt32> [int32(32-udivisible32(c).k)]) ) (Const32 <typ.UInt32> [int32(udivisible32(c).max)]) )
8447         for {
8448                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8449                         x := v_0
8450                         if v_1.Op != OpMul32 {
8451                                 continue
8452                         }
8453                         _ = v_1.Args[1]
8454                         v_1_0 := v_1.Args[0]
8455                         v_1_1 := v_1.Args[1]
8456                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
8457                                 if v_1_0.Op != OpConst32 {
8458                                         continue
8459                                 }
8460                                 c := auxIntToInt32(v_1_0.AuxInt)
8461                                 if v_1_1.Op != OpTrunc64to32 {
8462                                         continue
8463                                 }
8464                                 v_1_1_0 := v_1_1.Args[0]
8465                                 if v_1_1_0.Op != OpRsh64Ux64 {
8466                                         continue
8467                                 }
8468                                 _ = v_1_1_0.Args[1]
8469                                 v_1_1_0_0 := v_1_1_0.Args[0]
8470                                 if v_1_1_0_0.Op != OpAvg64u {
8471                                         continue
8472                                 }
8473                                 _ = v_1_1_0_0.Args[1]
8474                                 v_1_1_0_0_0 := v_1_1_0_0.Args[0]
8475                                 if v_1_1_0_0_0.Op != OpLsh64x64 {
8476                                         continue
8477                                 }
8478                                 _ = v_1_1_0_0_0.Args[1]
8479                                 v_1_1_0_0_0_0 := v_1_1_0_0_0.Args[0]
8480                                 if v_1_1_0_0_0_0.Op != OpZeroExt32to64 || x != v_1_1_0_0_0_0.Args[0] {
8481                                         continue
8482                                 }
8483                                 v_1_1_0_0_0_1 := v_1_1_0_0_0.Args[1]
8484                                 if v_1_1_0_0_0_1.Op != OpConst64 || auxIntToInt64(v_1_1_0_0_0_1.AuxInt) != 32 {
8485                                         continue
8486                                 }
8487                                 mul := v_1_1_0_0.Args[1]
8488                                 if mul.Op != OpMul64 {
8489                                         continue
8490                                 }
8491                                 _ = mul.Args[1]
8492                                 mul_0 := mul.Args[0]
8493                                 mul_1 := mul.Args[1]
8494                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
8495                                         if mul_0.Op != OpConst64 {
8496                                                 continue
8497                                         }
8498                                         m := auxIntToInt64(mul_0.AuxInt)
8499                                         if mul_1.Op != OpZeroExt32to64 || x != mul_1.Args[0] {
8500                                                 continue
8501                                         }
8502                                         v_1_1_0_1 := v_1_1_0.Args[1]
8503                                         if v_1_1_0_1.Op != OpConst64 {
8504                                                 continue
8505                                         }
8506                                         s := auxIntToInt64(v_1_1_0_1.AuxInt)
8507                                         if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic32(c).m) && s == 32+umagic32(c).s-1 && x.Op != OpConst32 && udivisibleOK32(c)) {
8508                                                 continue
8509                                         }
8510                                         v.reset(OpLeq32U)
8511                                         v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32)
8512                                         v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
8513                                         v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8514                                         v2.AuxInt = int32ToAuxInt(int32(udivisible32(c).m))
8515                                         v1.AddArg2(v2, x)
8516                                         v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8517                                         v3.AuxInt = int32ToAuxInt(int32(32 - udivisible32(c).k))
8518                                         v0.AddArg2(v1, v3)
8519                                         v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8520                                         v4.AuxInt = int32ToAuxInt(int32(udivisible32(c).max))
8521                                         v.AddArg2(v0, v4)
8522                                         return true
8523                                 }
8524                         }
8525                 }
8526                 break
8527         }
8528         // match: (Eq32 x (Mul32 (Const32 [c]) (Sub32 (Rsh64x64 mul:(Mul64 (Const64 [m]) (SignExt32to64 x)) (Const64 [s])) (Rsh64x64 (SignExt32to64 x) (Const64 [63]))) ) )
8529         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic32(c).m) && s == 32+smagic32(c).s && x.Op != OpConst32 && sdivisibleOK32(c)
8530         // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int32(sdivisible32(c).m)]) x) (Const32 <typ.UInt32> [int32(sdivisible32(c).a)]) ) (Const32 <typ.UInt32> [int32(32-sdivisible32(c).k)]) ) (Const32 <typ.UInt32> [int32(sdivisible32(c).max)]) )
8531         for {
8532                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8533                         x := v_0
8534                         if v_1.Op != OpMul32 {
8535                                 continue
8536                         }
8537                         _ = v_1.Args[1]
8538                         v_1_0 := v_1.Args[0]
8539                         v_1_1 := v_1.Args[1]
8540                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
8541                                 if v_1_0.Op != OpConst32 {
8542                                         continue
8543                                 }
8544                                 c := auxIntToInt32(v_1_0.AuxInt)
8545                                 if v_1_1.Op != OpSub32 {
8546                                         continue
8547                                 }
8548                                 _ = v_1_1.Args[1]
8549                                 v_1_1_0 := v_1_1.Args[0]
8550                                 if v_1_1_0.Op != OpRsh64x64 {
8551                                         continue
8552                                 }
8553                                 _ = v_1_1_0.Args[1]
8554                                 mul := v_1_1_0.Args[0]
8555                                 if mul.Op != OpMul64 {
8556                                         continue
8557                                 }
8558                                 _ = mul.Args[1]
8559                                 mul_0 := mul.Args[0]
8560                                 mul_1 := mul.Args[1]
8561                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
8562                                         if mul_0.Op != OpConst64 {
8563                                                 continue
8564                                         }
8565                                         m := auxIntToInt64(mul_0.AuxInt)
8566                                         if mul_1.Op != OpSignExt32to64 || x != mul_1.Args[0] {
8567                                                 continue
8568                                         }
8569                                         v_1_1_0_1 := v_1_1_0.Args[1]
8570                                         if v_1_1_0_1.Op != OpConst64 {
8571                                                 continue
8572                                         }
8573                                         s := auxIntToInt64(v_1_1_0_1.AuxInt)
8574                                         v_1_1_1 := v_1_1.Args[1]
8575                                         if v_1_1_1.Op != OpRsh64x64 {
8576                                                 continue
8577                                         }
8578                                         _ = v_1_1_1.Args[1]
8579                                         v_1_1_1_0 := v_1_1_1.Args[0]
8580                                         if v_1_1_1_0.Op != OpSignExt32to64 || x != v_1_1_1_0.Args[0] {
8581                                                 continue
8582                                         }
8583                                         v_1_1_1_1 := v_1_1_1.Args[1]
8584                                         if v_1_1_1_1.Op != OpConst64 || auxIntToInt64(v_1_1_1_1.AuxInt) != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic32(c).m) && s == 32+smagic32(c).s && x.Op != OpConst32 && sdivisibleOK32(c)) {
8585                                                 continue
8586                                         }
8587                                         v.reset(OpLeq32U)
8588                                         v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32)
8589                                         v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32)
8590                                         v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
8591                                         v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8592                                         v3.AuxInt = int32ToAuxInt(int32(sdivisible32(c).m))
8593                                         v2.AddArg2(v3, x)
8594                                         v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8595                                         v4.AuxInt = int32ToAuxInt(int32(sdivisible32(c).a))
8596                                         v1.AddArg2(v2, v4)
8597                                         v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8598                                         v5.AuxInt = int32ToAuxInt(int32(32 - sdivisible32(c).k))
8599                                         v0.AddArg2(v1, v5)
8600                                         v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8601                                         v6.AuxInt = int32ToAuxInt(int32(sdivisible32(c).max))
8602                                         v.AddArg2(v0, v6)
8603                                         return true
8604                                 }
8605                         }
8606                 }
8607                 break
8608         }
8609         // match: (Eq32 x (Mul32 (Const32 [c]) (Sub32 (Rsh32x64 mul:(Hmul32 (Const32 [m]) x) (Const64 [s])) (Rsh32x64 x (Const64 [31]))) ) )
8610         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(smagic32(c).m/2) && s == smagic32(c).s-1 && x.Op != OpConst32 && sdivisibleOK32(c)
8611         // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int32(sdivisible32(c).m)]) x) (Const32 <typ.UInt32> [int32(sdivisible32(c).a)]) ) (Const32 <typ.UInt32> [int32(32-sdivisible32(c).k)]) ) (Const32 <typ.UInt32> [int32(sdivisible32(c).max)]) )
8612         for {
8613                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8614                         x := v_0
8615                         if v_1.Op != OpMul32 {
8616                                 continue
8617                         }
8618                         _ = v_1.Args[1]
8619                         v_1_0 := v_1.Args[0]
8620                         v_1_1 := v_1.Args[1]
8621                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
8622                                 if v_1_0.Op != OpConst32 {
8623                                         continue
8624                                 }
8625                                 c := auxIntToInt32(v_1_0.AuxInt)
8626                                 if v_1_1.Op != OpSub32 {
8627                                         continue
8628                                 }
8629                                 _ = v_1_1.Args[1]
8630                                 v_1_1_0 := v_1_1.Args[0]
8631                                 if v_1_1_0.Op != OpRsh32x64 {
8632                                         continue
8633                                 }
8634                                 _ = v_1_1_0.Args[1]
8635                                 mul := v_1_1_0.Args[0]
8636                                 if mul.Op != OpHmul32 {
8637                                         continue
8638                                 }
8639                                 _ = mul.Args[1]
8640                                 mul_0 := mul.Args[0]
8641                                 mul_1 := mul.Args[1]
8642                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
8643                                         if mul_0.Op != OpConst32 {
8644                                                 continue
8645                                         }
8646                                         m := auxIntToInt32(mul_0.AuxInt)
8647                                         if x != mul_1 {
8648                                                 continue
8649                                         }
8650                                         v_1_1_0_1 := v_1_1_0.Args[1]
8651                                         if v_1_1_0_1.Op != OpConst64 {
8652                                                 continue
8653                                         }
8654                                         s := auxIntToInt64(v_1_1_0_1.AuxInt)
8655                                         v_1_1_1 := v_1_1.Args[1]
8656                                         if v_1_1_1.Op != OpRsh32x64 {
8657                                                 continue
8658                                         }
8659                                         _ = v_1_1_1.Args[1]
8660                                         if x != v_1_1_1.Args[0] {
8661                                                 continue
8662                                         }
8663                                         v_1_1_1_1 := v_1_1_1.Args[1]
8664                                         if v_1_1_1_1.Op != OpConst64 || auxIntToInt64(v_1_1_1_1.AuxInt) != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(smagic32(c).m/2) && s == smagic32(c).s-1 && x.Op != OpConst32 && sdivisibleOK32(c)) {
8665                                                 continue
8666                                         }
8667                                         v.reset(OpLeq32U)
8668                                         v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32)
8669                                         v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32)
8670                                         v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
8671                                         v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8672                                         v3.AuxInt = int32ToAuxInt(int32(sdivisible32(c).m))
8673                                         v2.AddArg2(v3, x)
8674                                         v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8675                                         v4.AuxInt = int32ToAuxInt(int32(sdivisible32(c).a))
8676                                         v1.AddArg2(v2, v4)
8677                                         v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8678                                         v5.AuxInt = int32ToAuxInt(int32(32 - sdivisible32(c).k))
8679                                         v0.AddArg2(v1, v5)
8680                                         v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8681                                         v6.AuxInt = int32ToAuxInt(int32(sdivisible32(c).max))
8682                                         v.AddArg2(v0, v6)
8683                                         return true
8684                                 }
8685                         }
8686                 }
8687                 break
8688         }
8689         // match: (Eq32 x (Mul32 (Const32 [c]) (Sub32 (Rsh32x64 (Add32 mul:(Hmul32 (Const32 [m]) x) x) (Const64 [s])) (Rsh32x64 x (Const64 [31]))) ) )
8690         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(smagic32(c).m) && s == smagic32(c).s && x.Op != OpConst32 && sdivisibleOK32(c)
8691         // result: (Leq32U (RotateLeft32 <typ.UInt32> (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Const32 <typ.UInt32> [int32(sdivisible32(c).m)]) x) (Const32 <typ.UInt32> [int32(sdivisible32(c).a)]) ) (Const32 <typ.UInt32> [int32(32-sdivisible32(c).k)]) ) (Const32 <typ.UInt32> [int32(sdivisible32(c).max)]) )
8692         for {
8693                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8694                         x := v_0
8695                         if v_1.Op != OpMul32 {
8696                                 continue
8697                         }
8698                         _ = v_1.Args[1]
8699                         v_1_0 := v_1.Args[0]
8700                         v_1_1 := v_1.Args[1]
8701                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
8702                                 if v_1_0.Op != OpConst32 {
8703                                         continue
8704                                 }
8705                                 c := auxIntToInt32(v_1_0.AuxInt)
8706                                 if v_1_1.Op != OpSub32 {
8707                                         continue
8708                                 }
8709                                 _ = v_1_1.Args[1]
8710                                 v_1_1_0 := v_1_1.Args[0]
8711                                 if v_1_1_0.Op != OpRsh32x64 {
8712                                         continue
8713                                 }
8714                                 _ = v_1_1_0.Args[1]
8715                                 v_1_1_0_0 := v_1_1_0.Args[0]
8716                                 if v_1_1_0_0.Op != OpAdd32 {
8717                                         continue
8718                                 }
8719                                 _ = v_1_1_0_0.Args[1]
8720                                 v_1_1_0_0_0 := v_1_1_0_0.Args[0]
8721                                 v_1_1_0_0_1 := v_1_1_0_0.Args[1]
8722                                 for _i2 := 0; _i2 <= 1; _i2, v_1_1_0_0_0, v_1_1_0_0_1 = _i2+1, v_1_1_0_0_1, v_1_1_0_0_0 {
8723                                         mul := v_1_1_0_0_0
8724                                         if mul.Op != OpHmul32 {
8725                                                 continue
8726                                         }
8727                                         _ = mul.Args[1]
8728                                         mul_0 := mul.Args[0]
8729                                         mul_1 := mul.Args[1]
8730                                         for _i3 := 0; _i3 <= 1; _i3, mul_0, mul_1 = _i3+1, mul_1, mul_0 {
8731                                                 if mul_0.Op != OpConst32 {
8732                                                         continue
8733                                                 }
8734                                                 m := auxIntToInt32(mul_0.AuxInt)
8735                                                 if x != mul_1 || x != v_1_1_0_0_1 {
8736                                                         continue
8737                                                 }
8738                                                 v_1_1_0_1 := v_1_1_0.Args[1]
8739                                                 if v_1_1_0_1.Op != OpConst64 {
8740                                                         continue
8741                                                 }
8742                                                 s := auxIntToInt64(v_1_1_0_1.AuxInt)
8743                                                 v_1_1_1 := v_1_1.Args[1]
8744                                                 if v_1_1_1.Op != OpRsh32x64 {
8745                                                         continue
8746                                                 }
8747                                                 _ = v_1_1_1.Args[1]
8748                                                 if x != v_1_1_1.Args[0] {
8749                                                         continue
8750                                                 }
8751                                                 v_1_1_1_1 := v_1_1_1.Args[1]
8752                                                 if v_1_1_1_1.Op != OpConst64 || auxIntToInt64(v_1_1_1_1.AuxInt) != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(smagic32(c).m) && s == smagic32(c).s && x.Op != OpConst32 && sdivisibleOK32(c)) {
8753                                                         continue
8754                                                 }
8755                                                 v.reset(OpLeq32U)
8756                                                 v0 := b.NewValue0(v.Pos, OpRotateLeft32, typ.UInt32)
8757                                                 v1 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32)
8758                                                 v2 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
8759                                                 v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8760                                                 v3.AuxInt = int32ToAuxInt(int32(sdivisible32(c).m))
8761                                                 v2.AddArg2(v3, x)
8762                                                 v4 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8763                                                 v4.AuxInt = int32ToAuxInt(int32(sdivisible32(c).a))
8764                                                 v1.AddArg2(v2, v4)
8765                                                 v5 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8766                                                 v5.AuxInt = int32ToAuxInt(int32(32 - sdivisible32(c).k))
8767                                                 v0.AddArg2(v1, v5)
8768                                                 v6 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
8769                                                 v6.AuxInt = int32ToAuxInt(int32(sdivisible32(c).max))
8770                                                 v.AddArg2(v0, v6)
8771                                                 return true
8772                                         }
8773                                 }
8774                         }
8775                 }
8776                 break
8777         }
8778         // match: (Eq32 n (Lsh32x64 (Rsh32x64 (Add32 <t> n (Rsh32Ux64 <t> (Rsh32x64 <t> n (Const64 <typ.UInt64> [31])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) )
8779         // cond: k > 0 && k < 31 && kbar == 32 - k
8780         // result: (Eq32 (And32 <t> n (Const32 <t> [1<<uint(k)-1])) (Const32 <t> [0]))
8781         for {
8782                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8783                         n := v_0
8784                         if v_1.Op != OpLsh32x64 {
8785                                 continue
8786                         }
8787                         _ = v_1.Args[1]
8788                         v_1_0 := v_1.Args[0]
8789                         if v_1_0.Op != OpRsh32x64 {
8790                                 continue
8791                         }
8792                         _ = v_1_0.Args[1]
8793                         v_1_0_0 := v_1_0.Args[0]
8794                         if v_1_0_0.Op != OpAdd32 {
8795                                 continue
8796                         }
8797                         t := v_1_0_0.Type
8798                         _ = v_1_0_0.Args[1]
8799                         v_1_0_0_0 := v_1_0_0.Args[0]
8800                         v_1_0_0_1 := v_1_0_0.Args[1]
8801                         for _i1 := 0; _i1 <= 1; _i1, v_1_0_0_0, v_1_0_0_1 = _i1+1, v_1_0_0_1, v_1_0_0_0 {
8802                                 if n != v_1_0_0_0 || v_1_0_0_1.Op != OpRsh32Ux64 || v_1_0_0_1.Type != t {
8803                                         continue
8804                                 }
8805                                 _ = v_1_0_0_1.Args[1]
8806                                 v_1_0_0_1_0 := v_1_0_0_1.Args[0]
8807                                 if v_1_0_0_1_0.Op != OpRsh32x64 || v_1_0_0_1_0.Type != t {
8808                                         continue
8809                                 }
8810                                 _ = v_1_0_0_1_0.Args[1]
8811                                 if n != v_1_0_0_1_0.Args[0] {
8812                                         continue
8813                                 }
8814                                 v_1_0_0_1_0_1 := v_1_0_0_1_0.Args[1]
8815                                 if v_1_0_0_1_0_1.Op != OpConst64 || v_1_0_0_1_0_1.Type != typ.UInt64 || auxIntToInt64(v_1_0_0_1_0_1.AuxInt) != 31 {
8816                                         continue
8817                                 }
8818                                 v_1_0_0_1_1 := v_1_0_0_1.Args[1]
8819                                 if v_1_0_0_1_1.Op != OpConst64 || v_1_0_0_1_1.Type != typ.UInt64 {
8820                                         continue
8821                                 }
8822                                 kbar := auxIntToInt64(v_1_0_0_1_1.AuxInt)
8823                                 v_1_0_1 := v_1_0.Args[1]
8824                                 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 {
8825                                         continue
8826                                 }
8827                                 k := auxIntToInt64(v_1_0_1.AuxInt)
8828                                 v_1_1 := v_1.Args[1]
8829                                 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || auxIntToInt64(v_1_1.AuxInt) != k || !(k > 0 && k < 31 && kbar == 32-k) {
8830                                         continue
8831                                 }
8832                                 v.reset(OpEq32)
8833                                 v0 := b.NewValue0(v.Pos, OpAnd32, t)
8834                                 v1 := b.NewValue0(v.Pos, OpConst32, t)
8835                                 v1.AuxInt = int32ToAuxInt(1<<uint(k) - 1)
8836                                 v0.AddArg2(n, v1)
8837                                 v2 := b.NewValue0(v.Pos, OpConst32, t)
8838                                 v2.AuxInt = int32ToAuxInt(0)
8839                                 v.AddArg2(v0, v2)
8840                                 return true
8841                         }
8842                 }
8843                 break
8844         }
8845         // match: (Eq32 s:(Sub32 x y) (Const32 [0]))
8846         // cond: s.Uses == 1
8847         // result: (Eq32 x y)
8848         for {
8849                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8850                         s := v_0
8851                         if s.Op != OpSub32 {
8852                                 continue
8853                         }
8854                         y := s.Args[1]
8855                         x := s.Args[0]
8856                         if v_1.Op != OpConst32 || auxIntToInt32(v_1.AuxInt) != 0 || !(s.Uses == 1) {
8857                                 continue
8858                         }
8859                         v.reset(OpEq32)
8860                         v.AddArg2(x, y)
8861                         return true
8862                 }
8863                 break
8864         }
8865         // match: (Eq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [y]))
8866         // cond: oneBit32(y)
8867         // result: (Neq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [0]))
8868         for {
8869                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8870                         if v_0.Op != OpAnd32 {
8871                                 continue
8872                         }
8873                         t := v_0.Type
8874                         _ = v_0.Args[1]
8875                         v_0_0 := v_0.Args[0]
8876                         v_0_1 := v_0.Args[1]
8877                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
8878                                 x := v_0_0
8879                                 if v_0_1.Op != OpConst32 || v_0_1.Type != t {
8880                                         continue
8881                                 }
8882                                 y := auxIntToInt32(v_0_1.AuxInt)
8883                                 if v_1.Op != OpConst32 || v_1.Type != t || auxIntToInt32(v_1.AuxInt) != y || !(oneBit32(y)) {
8884                                         continue
8885                                 }
8886                                 v.reset(OpNeq32)
8887                                 v0 := b.NewValue0(v.Pos, OpAnd32, t)
8888                                 v1 := b.NewValue0(v.Pos, OpConst32, t)
8889                                 v1.AuxInt = int32ToAuxInt(y)
8890                                 v0.AddArg2(x, v1)
8891                                 v2 := b.NewValue0(v.Pos, OpConst32, t)
8892                                 v2.AuxInt = int32ToAuxInt(0)
8893                                 v.AddArg2(v0, v2)
8894                                 return true
8895                         }
8896                 }
8897                 break
8898         }
8899         return false
8900 }
8901 func rewriteValuegeneric_OpEq32F(v *Value) bool {
8902         v_1 := v.Args[1]
8903         v_0 := v.Args[0]
8904         // match: (Eq32F (Const32F [c]) (Const32F [d]))
8905         // result: (ConstBool [c == d])
8906         for {
8907                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8908                         if v_0.Op != OpConst32F {
8909                                 continue
8910                         }
8911                         c := auxIntToFloat32(v_0.AuxInt)
8912                         if v_1.Op != OpConst32F {
8913                                 continue
8914                         }
8915                         d := auxIntToFloat32(v_1.AuxInt)
8916                         v.reset(OpConstBool)
8917                         v.AuxInt = boolToAuxInt(c == d)
8918                         return true
8919                 }
8920                 break
8921         }
8922         return false
8923 }
8924 func rewriteValuegeneric_OpEq64(v *Value) bool {
8925         v_1 := v.Args[1]
8926         v_0 := v.Args[0]
8927         b := v.Block
8928         typ := &b.Func.Config.Types
8929         // match: (Eq64 x x)
8930         // result: (ConstBool [true])
8931         for {
8932                 x := v_0
8933                 if x != v_1 {
8934                         break
8935                 }
8936                 v.reset(OpConstBool)
8937                 v.AuxInt = boolToAuxInt(true)
8938                 return true
8939         }
8940         // match: (Eq64 (Const64 <t> [c]) (Add64 (Const64 <t> [d]) x))
8941         // result: (Eq64 (Const64 <t> [c-d]) x)
8942         for {
8943                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8944                         if v_0.Op != OpConst64 {
8945                                 continue
8946                         }
8947                         t := v_0.Type
8948                         c := auxIntToInt64(v_0.AuxInt)
8949                         if v_1.Op != OpAdd64 {
8950                                 continue
8951                         }
8952                         _ = v_1.Args[1]
8953                         v_1_0 := v_1.Args[0]
8954                         v_1_1 := v_1.Args[1]
8955                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
8956                                 if v_1_0.Op != OpConst64 || v_1_0.Type != t {
8957                                         continue
8958                                 }
8959                                 d := auxIntToInt64(v_1_0.AuxInt)
8960                                 x := v_1_1
8961                                 v.reset(OpEq64)
8962                                 v0 := b.NewValue0(v.Pos, OpConst64, t)
8963                                 v0.AuxInt = int64ToAuxInt(c - d)
8964                                 v.AddArg2(v0, x)
8965                                 return true
8966                         }
8967                 }
8968                 break
8969         }
8970         // match: (Eq64 (Const64 [c]) (Const64 [d]))
8971         // result: (ConstBool [c == d])
8972         for {
8973                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8974                         if v_0.Op != OpConst64 {
8975                                 continue
8976                         }
8977                         c := auxIntToInt64(v_0.AuxInt)
8978                         if v_1.Op != OpConst64 {
8979                                 continue
8980                         }
8981                         d := auxIntToInt64(v_1.AuxInt)
8982                         v.reset(OpConstBool)
8983                         v.AuxInt = boolToAuxInt(c == d)
8984                         return true
8985                 }
8986                 break
8987         }
8988         // match: (Eq64 x (Mul64 (Const64 [c]) (Rsh64Ux64 mul:(Hmul64u (Const64 [m]) x) (Const64 [s])) ) )
8989         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic64(c).m/2) && s == umagic64(c).s-1 && x.Op != OpConst64 && udivisibleOK64(c)
8990         // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible64(c).m)]) x) (Const64 <typ.UInt64> [64-udivisible64(c).k]) ) (Const64 <typ.UInt64> [int64(udivisible64(c).max)]) )
8991         for {
8992                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8993                         x := v_0
8994                         if v_1.Op != OpMul64 {
8995                                 continue
8996                         }
8997                         _ = v_1.Args[1]
8998                         v_1_0 := v_1.Args[0]
8999                         v_1_1 := v_1.Args[1]
9000                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
9001                                 if v_1_0.Op != OpConst64 {
9002                                         continue
9003                                 }
9004                                 c := auxIntToInt64(v_1_0.AuxInt)
9005                                 if v_1_1.Op != OpRsh64Ux64 {
9006                                         continue
9007                                 }
9008                                 _ = v_1_1.Args[1]
9009                                 mul := v_1_1.Args[0]
9010                                 if mul.Op != OpHmul64u {
9011                                         continue
9012                                 }
9013                                 _ = mul.Args[1]
9014                                 mul_0 := mul.Args[0]
9015                                 mul_1 := mul.Args[1]
9016                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
9017                                         if mul_0.Op != OpConst64 {
9018                                                 continue
9019                                         }
9020                                         m := auxIntToInt64(mul_0.AuxInt)
9021                                         if x != mul_1 {
9022                                                 continue
9023                                         }
9024                                         v_1_1_1 := v_1_1.Args[1]
9025                                         if v_1_1_1.Op != OpConst64 {
9026                                                 continue
9027                                         }
9028                                         s := auxIntToInt64(v_1_1_1.AuxInt)
9029                                         if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+umagic64(c).m/2) && s == umagic64(c).s-1 && x.Op != OpConst64 && udivisibleOK64(c)) {
9030                                                 continue
9031                                         }
9032                                         v.reset(OpLeq64U)
9033                                         v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64)
9034                                         v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64)
9035                                         v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9036                                         v2.AuxInt = int64ToAuxInt(int64(udivisible64(c).m))
9037                                         v1.AddArg2(v2, x)
9038                                         v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9039                                         v3.AuxInt = int64ToAuxInt(64 - udivisible64(c).k)
9040                                         v0.AddArg2(v1, v3)
9041                                         v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9042                                         v4.AuxInt = int64ToAuxInt(int64(udivisible64(c).max))
9043                                         v.AddArg2(v0, v4)
9044                                         return true
9045                                 }
9046                         }
9047                 }
9048                 break
9049         }
9050         // match: (Eq64 x (Mul64 (Const64 [c]) (Rsh64Ux64 mul:(Hmul64u (Const64 [m]) (Rsh64Ux64 x (Const64 [1]))) (Const64 [s])) ) )
9051         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic64(c).m+1)/2) && s == umagic64(c).s-2 && x.Op != OpConst64 && udivisibleOK64(c)
9052         // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible64(c).m)]) x) (Const64 <typ.UInt64> [64-udivisible64(c).k]) ) (Const64 <typ.UInt64> [int64(udivisible64(c).max)]) )
9053         for {
9054                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9055                         x := v_0
9056                         if v_1.Op != OpMul64 {
9057                                 continue
9058                         }
9059                         _ = v_1.Args[1]
9060                         v_1_0 := v_1.Args[0]
9061                         v_1_1 := v_1.Args[1]
9062                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
9063                                 if v_1_0.Op != OpConst64 {
9064                                         continue
9065                                 }
9066                                 c := auxIntToInt64(v_1_0.AuxInt)
9067                                 if v_1_1.Op != OpRsh64Ux64 {
9068                                         continue
9069                                 }
9070                                 _ = v_1_1.Args[1]
9071                                 mul := v_1_1.Args[0]
9072                                 if mul.Op != OpHmul64u {
9073                                         continue
9074                                 }
9075                                 _ = mul.Args[1]
9076                                 mul_0 := mul.Args[0]
9077                                 mul_1 := mul.Args[1]
9078                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
9079                                         if mul_0.Op != OpConst64 {
9080                                                 continue
9081                                         }
9082                                         m := auxIntToInt64(mul_0.AuxInt)
9083                                         if mul_1.Op != OpRsh64Ux64 {
9084                                                 continue
9085                                         }
9086                                         _ = mul_1.Args[1]
9087                                         if x != mul_1.Args[0] {
9088                                                 continue
9089                                         }
9090                                         mul_1_1 := mul_1.Args[1]
9091                                         if mul_1_1.Op != OpConst64 || auxIntToInt64(mul_1_1.AuxInt) != 1 {
9092                                                 continue
9093                                         }
9094                                         v_1_1_1 := v_1_1.Args[1]
9095                                         if v_1_1_1.Op != OpConst64 {
9096                                                 continue
9097                                         }
9098                                         s := auxIntToInt64(v_1_1_1.AuxInt)
9099                                         if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(1<<63+(umagic64(c).m+1)/2) && s == umagic64(c).s-2 && x.Op != OpConst64 && udivisibleOK64(c)) {
9100                                                 continue
9101                                         }
9102                                         v.reset(OpLeq64U)
9103                                         v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64)
9104                                         v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64)
9105                                         v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9106                                         v2.AuxInt = int64ToAuxInt(int64(udivisible64(c).m))
9107                                         v1.AddArg2(v2, x)
9108                                         v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9109                                         v3.AuxInt = int64ToAuxInt(64 - udivisible64(c).k)
9110                                         v0.AddArg2(v1, v3)
9111                                         v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9112                                         v4.AuxInt = int64ToAuxInt(int64(udivisible64(c).max))
9113                                         v.AddArg2(v0, v4)
9114                                         return true
9115                                 }
9116                         }
9117                 }
9118                 break
9119         }
9120         // match: (Eq64 x (Mul64 (Const64 [c]) (Rsh64Ux64 (Avg64u x mul:(Hmul64u (Const64 [m]) x)) (Const64 [s])) ) )
9121         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic64(c).m) && s == umagic64(c).s-1 && x.Op != OpConst64 && udivisibleOK64(c)
9122         // result: (Leq64U (RotateLeft64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(udivisible64(c).m)]) x) (Const64 <typ.UInt64> [64-udivisible64(c).k]) ) (Const64 <typ.UInt64> [int64(udivisible64(c).max)]) )
9123         for {
9124                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9125                         x := v_0
9126                         if v_1.Op != OpMul64 {
9127                                 continue
9128                         }
9129                         _ = v_1.Args[1]
9130                         v_1_0 := v_1.Args[0]
9131                         v_1_1 := v_1.Args[1]
9132                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
9133                                 if v_1_0.Op != OpConst64 {
9134                                         continue
9135                                 }
9136                                 c := auxIntToInt64(v_1_0.AuxInt)
9137                                 if v_1_1.Op != OpRsh64Ux64 {
9138                                         continue
9139                                 }
9140                                 _ = v_1_1.Args[1]
9141                                 v_1_1_0 := v_1_1.Args[0]
9142                                 if v_1_1_0.Op != OpAvg64u {
9143                                         continue
9144                                 }
9145                                 _ = v_1_1_0.Args[1]
9146                                 if x != v_1_1_0.Args[0] {
9147                                         continue
9148                                 }
9149                                 mul := v_1_1_0.Args[1]
9150                                 if mul.Op != OpHmul64u {
9151                                         continue
9152                                 }
9153                                 _ = mul.Args[1]
9154                                 mul_0 := mul.Args[0]
9155                                 mul_1 := mul.Args[1]
9156                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
9157                                         if mul_0.Op != OpConst64 {
9158                                                 continue
9159                                         }
9160                                         m := auxIntToInt64(mul_0.AuxInt)
9161                                         if x != mul_1 {
9162                                                 continue
9163                                         }
9164                                         v_1_1_1 := v_1_1.Args[1]
9165                                         if v_1_1_1.Op != OpConst64 {
9166                                                 continue
9167                                         }
9168                                         s := auxIntToInt64(v_1_1_1.AuxInt)
9169                                         if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(umagic64(c).m) && s == umagic64(c).s-1 && x.Op != OpConst64 && udivisibleOK64(c)) {
9170                                                 continue
9171                                         }
9172                                         v.reset(OpLeq64U)
9173                                         v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64)
9174                                         v1 := b.NewValue0(v.Pos, OpMul64, typ.UInt64)
9175                                         v2 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9176                                         v2.AuxInt = int64ToAuxInt(int64(udivisible64(c).m))
9177                                         v1.AddArg2(v2, x)
9178                                         v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9179                                         v3.AuxInt = int64ToAuxInt(64 - udivisible64(c).k)
9180                                         v0.AddArg2(v1, v3)
9181                                         v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9182                                         v4.AuxInt = int64ToAuxInt(int64(udivisible64(c).max))
9183                                         v.AddArg2(v0, v4)
9184                                         return true
9185                                 }
9186                         }
9187                 }
9188                 break
9189         }
9190         // match: (Eq64 x (Mul64 (Const64 [c]) (Sub64 (Rsh64x64 mul:(Hmul64 (Const64 [m]) x) (Const64 [s])) (Rsh64x64 x (Const64 [63]))) ) )
9191         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic64(c).m/2) && s == smagic64(c).s-1 && x.Op != OpConst64 && sdivisibleOK64(c)
9192         // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible64(c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible64(c).a)]) ) (Const64 <typ.UInt64> [64-sdivisible64(c).k]) ) (Const64 <typ.UInt64> [int64(sdivisible64(c).max)]) )
9193         for {
9194                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9195                         x := v_0
9196                         if v_1.Op != OpMul64 {
9197                                 continue
9198                         }
9199                         _ = v_1.Args[1]
9200                         v_1_0 := v_1.Args[0]
9201                         v_1_1 := v_1.Args[1]
9202                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
9203                                 if v_1_0.Op != OpConst64 {
9204                                         continue
9205                                 }
9206                                 c := auxIntToInt64(v_1_0.AuxInt)
9207                                 if v_1_1.Op != OpSub64 {
9208                                         continue
9209                                 }
9210                                 _ = v_1_1.Args[1]
9211                                 v_1_1_0 := v_1_1.Args[0]
9212                                 if v_1_1_0.Op != OpRsh64x64 {
9213                                         continue
9214                                 }
9215                                 _ = v_1_1_0.Args[1]
9216                                 mul := v_1_1_0.Args[0]
9217                                 if mul.Op != OpHmul64 {
9218                                         continue
9219                                 }
9220                                 _ = mul.Args[1]
9221                                 mul_0 := mul.Args[0]
9222                                 mul_1 := mul.Args[1]
9223                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
9224                                         if mul_0.Op != OpConst64 {
9225                                                 continue
9226                                         }
9227                                         m := auxIntToInt64(mul_0.AuxInt)
9228                                         if x != mul_1 {
9229                                                 continue
9230                                         }
9231                                         v_1_1_0_1 := v_1_1_0.Args[1]
9232                                         if v_1_1_0_1.Op != OpConst64 {
9233                                                 continue
9234                                         }
9235                                         s := auxIntToInt64(v_1_1_0_1.AuxInt)
9236                                         v_1_1_1 := v_1_1.Args[1]
9237                                         if v_1_1_1.Op != OpRsh64x64 {
9238                                                 continue
9239                                         }
9240                                         _ = v_1_1_1.Args[1]
9241                                         if x != v_1_1_1.Args[0] {
9242                                                 continue
9243                                         }
9244                                         v_1_1_1_1 := v_1_1_1.Args[1]
9245                                         if v_1_1_1_1.Op != OpConst64 || auxIntToInt64(v_1_1_1_1.AuxInt) != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic64(c).m/2) && s == smagic64(c).s-1 && x.Op != OpConst64 && sdivisibleOK64(c)) {
9246                                                 continue
9247                                         }
9248                                         v.reset(OpLeq64U)
9249                                         v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64)
9250                                         v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64)
9251                                         v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64)
9252                                         v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9253                                         v3.AuxInt = int64ToAuxInt(int64(sdivisible64(c).m))
9254                                         v2.AddArg2(v3, x)
9255                                         v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9256                                         v4.AuxInt = int64ToAuxInt(int64(sdivisible64(c).a))
9257                                         v1.AddArg2(v2, v4)
9258                                         v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9259                                         v5.AuxInt = int64ToAuxInt(64 - sdivisible64(c).k)
9260                                         v0.AddArg2(v1, v5)
9261                                         v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9262                                         v6.AuxInt = int64ToAuxInt(int64(sdivisible64(c).max))
9263                                         v.AddArg2(v0, v6)
9264                                         return true
9265                                 }
9266                         }
9267                 }
9268                 break
9269         }
9270         // match: (Eq64 x (Mul64 (Const64 [c]) (Sub64 (Rsh64x64 (Add64 mul:(Hmul64 (Const64 [m]) x) x) (Const64 [s])) (Rsh64x64 x (Const64 [63]))) ) )
9271         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic64(c).m) && s == smagic64(c).s && x.Op != OpConst64 && sdivisibleOK64(c)
9272         // result: (Leq64U (RotateLeft64 <typ.UInt64> (Add64 <typ.UInt64> (Mul64 <typ.UInt64> (Const64 <typ.UInt64> [int64(sdivisible64(c).m)]) x) (Const64 <typ.UInt64> [int64(sdivisible64(c).a)]) ) (Const64 <typ.UInt64> [64-sdivisible64(c).k]) ) (Const64 <typ.UInt64> [int64(sdivisible64(c).max)]) )
9273         for {
9274                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9275                         x := v_0
9276                         if v_1.Op != OpMul64 {
9277                                 continue
9278                         }
9279                         _ = v_1.Args[1]
9280                         v_1_0 := v_1.Args[0]
9281                         v_1_1 := v_1.Args[1]
9282                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
9283                                 if v_1_0.Op != OpConst64 {
9284                                         continue
9285                                 }
9286                                 c := auxIntToInt64(v_1_0.AuxInt)
9287                                 if v_1_1.Op != OpSub64 {
9288                                         continue
9289                                 }
9290                                 _ = v_1_1.Args[1]
9291                                 v_1_1_0 := v_1_1.Args[0]
9292                                 if v_1_1_0.Op != OpRsh64x64 {
9293                                         continue
9294                                 }
9295                                 _ = v_1_1_0.Args[1]
9296                                 v_1_1_0_0 := v_1_1_0.Args[0]
9297                                 if v_1_1_0_0.Op != OpAdd64 {
9298                                         continue
9299                                 }
9300                                 _ = v_1_1_0_0.Args[1]
9301                                 v_1_1_0_0_0 := v_1_1_0_0.Args[0]
9302                                 v_1_1_0_0_1 := v_1_1_0_0.Args[1]
9303                                 for _i2 := 0; _i2 <= 1; _i2, v_1_1_0_0_0, v_1_1_0_0_1 = _i2+1, v_1_1_0_0_1, v_1_1_0_0_0 {
9304                                         mul := v_1_1_0_0_0
9305                                         if mul.Op != OpHmul64 {
9306                                                 continue
9307                                         }
9308                                         _ = mul.Args[1]
9309                                         mul_0 := mul.Args[0]
9310                                         mul_1 := mul.Args[1]
9311                                         for _i3 := 0; _i3 <= 1; _i3, mul_0, mul_1 = _i3+1, mul_1, mul_0 {
9312                                                 if mul_0.Op != OpConst64 {
9313                                                         continue
9314                                                 }
9315                                                 m := auxIntToInt64(mul_0.AuxInt)
9316                                                 if x != mul_1 || x != v_1_1_0_0_1 {
9317                                                         continue
9318                                                 }
9319                                                 v_1_1_0_1 := v_1_1_0.Args[1]
9320                                                 if v_1_1_0_1.Op != OpConst64 {
9321                                                         continue
9322                                                 }
9323                                                 s := auxIntToInt64(v_1_1_0_1.AuxInt)
9324                                                 v_1_1_1 := v_1_1.Args[1]
9325                                                 if v_1_1_1.Op != OpRsh64x64 {
9326                                                         continue
9327                                                 }
9328                                                 _ = v_1_1_1.Args[1]
9329                                                 if x != v_1_1_1.Args[0] {
9330                                                         continue
9331                                                 }
9332                                                 v_1_1_1_1 := v_1_1_1.Args[1]
9333                                                 if v_1_1_1_1.Op != OpConst64 || auxIntToInt64(v_1_1_1_1.AuxInt) != 63 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int64(smagic64(c).m) && s == smagic64(c).s && x.Op != OpConst64 && sdivisibleOK64(c)) {
9334                                                         continue
9335                                                 }
9336                                                 v.reset(OpLeq64U)
9337                                                 v0 := b.NewValue0(v.Pos, OpRotateLeft64, typ.UInt64)
9338                                                 v1 := b.NewValue0(v.Pos, OpAdd64, typ.UInt64)
9339                                                 v2 := b.NewValue0(v.Pos, OpMul64, typ.UInt64)
9340                                                 v3 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9341                                                 v3.AuxInt = int64ToAuxInt(int64(sdivisible64(c).m))
9342                                                 v2.AddArg2(v3, x)
9343                                                 v4 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9344                                                 v4.AuxInt = int64ToAuxInt(int64(sdivisible64(c).a))
9345                                                 v1.AddArg2(v2, v4)
9346                                                 v5 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9347                                                 v5.AuxInt = int64ToAuxInt(64 - sdivisible64(c).k)
9348                                                 v0.AddArg2(v1, v5)
9349                                                 v6 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
9350                                                 v6.AuxInt = int64ToAuxInt(int64(sdivisible64(c).max))
9351                                                 v.AddArg2(v0, v6)
9352                                                 return true
9353                                         }
9354                                 }
9355                         }
9356                 }
9357                 break
9358         }
9359         // match: (Eq64 n (Lsh64x64 (Rsh64x64 (Add64 <t> n (Rsh64Ux64 <t> (Rsh64x64 <t> n (Const64 <typ.UInt64> [63])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) )
9360         // cond: k > 0 && k < 63 && kbar == 64 - k
9361         // result: (Eq64 (And64 <t> n (Const64 <t> [1<<uint(k)-1])) (Const64 <t> [0]))
9362         for {
9363                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9364                         n := v_0
9365                         if v_1.Op != OpLsh64x64 {
9366                                 continue
9367                         }
9368                         _ = v_1.Args[1]
9369                         v_1_0 := v_1.Args[0]
9370                         if v_1_0.Op != OpRsh64x64 {
9371                                 continue
9372                         }
9373                         _ = v_1_0.Args[1]
9374                         v_1_0_0 := v_1_0.Args[0]
9375                         if v_1_0_0.Op != OpAdd64 {
9376                                 continue
9377                         }
9378                         t := v_1_0_0.Type
9379                         _ = v_1_0_0.Args[1]
9380                         v_1_0_0_0 := v_1_0_0.Args[0]
9381                         v_1_0_0_1 := v_1_0_0.Args[1]
9382                         for _i1 := 0; _i1 <= 1; _i1, v_1_0_0_0, v_1_0_0_1 = _i1+1, v_1_0_0_1, v_1_0_0_0 {
9383                                 if n != v_1_0_0_0 || v_1_0_0_1.Op != OpRsh64Ux64 || v_1_0_0_1.Type != t {
9384                                         continue
9385                                 }
9386                                 _ = v_1_0_0_1.Args[1]
9387                                 v_1_0_0_1_0 := v_1_0_0_1.Args[0]
9388                                 if v_1_0_0_1_0.Op != OpRsh64x64 || v_1_0_0_1_0.Type != t {
9389                                         continue
9390                                 }
9391                                 _ = v_1_0_0_1_0.Args[1]
9392                                 if n != v_1_0_0_1_0.Args[0] {
9393                                         continue
9394                                 }
9395                                 v_1_0_0_1_0_1 := v_1_0_0_1_0.Args[1]
9396                                 if v_1_0_0_1_0_1.Op != OpConst64 || v_1_0_0_1_0_1.Type != typ.UInt64 || auxIntToInt64(v_1_0_0_1_0_1.AuxInt) != 63 {
9397                                         continue
9398                                 }
9399                                 v_1_0_0_1_1 := v_1_0_0_1.Args[1]
9400                                 if v_1_0_0_1_1.Op != OpConst64 || v_1_0_0_1_1.Type != typ.UInt64 {
9401                                         continue
9402                                 }
9403                                 kbar := auxIntToInt64(v_1_0_0_1_1.AuxInt)
9404                                 v_1_0_1 := v_1_0.Args[1]
9405                                 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 {
9406                                         continue
9407                                 }
9408                                 k := auxIntToInt64(v_1_0_1.AuxInt)
9409                                 v_1_1 := v_1.Args[1]
9410                                 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || auxIntToInt64(v_1_1.AuxInt) != k || !(k > 0 && k < 63 && kbar == 64-k) {
9411                                         continue
9412                                 }
9413                                 v.reset(OpEq64)
9414                                 v0 := b.NewValue0(v.Pos, OpAnd64, t)
9415                                 v1 := b.NewValue0(v.Pos, OpConst64, t)
9416                                 v1.AuxInt = int64ToAuxInt(1<<uint(k) - 1)
9417                                 v0.AddArg2(n, v1)
9418                                 v2 := b.NewValue0(v.Pos, OpConst64, t)
9419                                 v2.AuxInt = int64ToAuxInt(0)
9420                                 v.AddArg2(v0, v2)
9421                                 return true
9422                         }
9423                 }
9424                 break
9425         }
9426         // match: (Eq64 s:(Sub64 x y) (Const64 [0]))
9427         // cond: s.Uses == 1
9428         // result: (Eq64 x y)
9429         for {
9430                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9431                         s := v_0
9432                         if s.Op != OpSub64 {
9433                                 continue
9434                         }
9435                         y := s.Args[1]
9436                         x := s.Args[0]
9437                         if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 0 || !(s.Uses == 1) {
9438                                 continue
9439                         }
9440                         v.reset(OpEq64)
9441                         v.AddArg2(x, y)
9442                         return true
9443                 }
9444                 break
9445         }
9446         // match: (Eq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [y]))
9447         // cond: oneBit64(y)
9448         // result: (Neq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [0]))
9449         for {
9450                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9451                         if v_0.Op != OpAnd64 {
9452                                 continue
9453                         }
9454                         t := v_0.Type
9455                         _ = v_0.Args[1]
9456                         v_0_0 := v_0.Args[0]
9457                         v_0_1 := v_0.Args[1]
9458                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
9459                                 x := v_0_0
9460                                 if v_0_1.Op != OpConst64 || v_0_1.Type != t {
9461                                         continue
9462                                 }
9463                                 y := auxIntToInt64(v_0_1.AuxInt)
9464                                 if v_1.Op != OpConst64 || v_1.Type != t || auxIntToInt64(v_1.AuxInt) != y || !(oneBit64(y)) {
9465                                         continue
9466                                 }
9467                                 v.reset(OpNeq64)
9468                                 v0 := b.NewValue0(v.Pos, OpAnd64, t)
9469                                 v1 := b.NewValue0(v.Pos, OpConst64, t)
9470                                 v1.AuxInt = int64ToAuxInt(y)
9471                                 v0.AddArg2(x, v1)
9472                                 v2 := b.NewValue0(v.Pos, OpConst64, t)
9473                                 v2.AuxInt = int64ToAuxInt(0)
9474                                 v.AddArg2(v0, v2)
9475                                 return true
9476                         }
9477                 }
9478                 break
9479         }
9480         return false
9481 }
9482 func rewriteValuegeneric_OpEq64F(v *Value) bool {
9483         v_1 := v.Args[1]
9484         v_0 := v.Args[0]
9485         // match: (Eq64F (Const64F [c]) (Const64F [d]))
9486         // result: (ConstBool [c == d])
9487         for {
9488                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9489                         if v_0.Op != OpConst64F {
9490                                 continue
9491                         }
9492                         c := auxIntToFloat64(v_0.AuxInt)
9493                         if v_1.Op != OpConst64F {
9494                                 continue
9495                         }
9496                         d := auxIntToFloat64(v_1.AuxInt)
9497                         v.reset(OpConstBool)
9498                         v.AuxInt = boolToAuxInt(c == d)
9499                         return true
9500                 }
9501                 break
9502         }
9503         return false
9504 }
9505 func rewriteValuegeneric_OpEq8(v *Value) bool {
9506         v_1 := v.Args[1]
9507         v_0 := v.Args[0]
9508         b := v.Block
9509         config := b.Func.Config
9510         typ := &b.Func.Config.Types
9511         // match: (Eq8 x x)
9512         // result: (ConstBool [true])
9513         for {
9514                 x := v_0
9515                 if x != v_1 {
9516                         break
9517                 }
9518                 v.reset(OpConstBool)
9519                 v.AuxInt = boolToAuxInt(true)
9520                 return true
9521         }
9522         // match: (Eq8 (Const8 <t> [c]) (Add8 (Const8 <t> [d]) x))
9523         // result: (Eq8 (Const8 <t> [c-d]) x)
9524         for {
9525                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9526                         if v_0.Op != OpConst8 {
9527                                 continue
9528                         }
9529                         t := v_0.Type
9530                         c := auxIntToInt8(v_0.AuxInt)
9531                         if v_1.Op != OpAdd8 {
9532                                 continue
9533                         }
9534                         _ = v_1.Args[1]
9535                         v_1_0 := v_1.Args[0]
9536                         v_1_1 := v_1.Args[1]
9537                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
9538                                 if v_1_0.Op != OpConst8 || v_1_0.Type != t {
9539                                         continue
9540                                 }
9541                                 d := auxIntToInt8(v_1_0.AuxInt)
9542                                 x := v_1_1
9543                                 v.reset(OpEq8)
9544                                 v0 := b.NewValue0(v.Pos, OpConst8, t)
9545                                 v0.AuxInt = int8ToAuxInt(c - d)
9546                                 v.AddArg2(v0, x)
9547                                 return true
9548                         }
9549                 }
9550                 break
9551         }
9552         // match: (Eq8 (Const8 [c]) (Const8 [d]))
9553         // result: (ConstBool [c == d])
9554         for {
9555                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9556                         if v_0.Op != OpConst8 {
9557                                 continue
9558                         }
9559                         c := auxIntToInt8(v_0.AuxInt)
9560                         if v_1.Op != OpConst8 {
9561                                 continue
9562                         }
9563                         d := auxIntToInt8(v_1.AuxInt)
9564                         v.reset(OpConstBool)
9565                         v.AuxInt = boolToAuxInt(c == d)
9566                         return true
9567                 }
9568                 break
9569         }
9570         // match: (Eq8 (Mod8u x (Const8 [c])) (Const8 [0]))
9571         // cond: x.Op != OpConst8 && udivisibleOK8(c) && !hasSmallRotate(config)
9572         // result: (Eq32 (Mod32u <typ.UInt32> (ZeroExt8to32 <typ.UInt32> x) (Const32 <typ.UInt32> [int32(uint8(c))])) (Const32 <typ.UInt32> [0]))
9573         for {
9574                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9575                         if v_0.Op != OpMod8u {
9576                                 continue
9577                         }
9578                         _ = v_0.Args[1]
9579                         x := v_0.Args[0]
9580                         v_0_1 := v_0.Args[1]
9581                         if v_0_1.Op != OpConst8 {
9582                                 continue
9583                         }
9584                         c := auxIntToInt8(v_0_1.AuxInt)
9585                         if v_1.Op != OpConst8 || auxIntToInt8(v_1.AuxInt) != 0 || !(x.Op != OpConst8 && udivisibleOK8(c) && !hasSmallRotate(config)) {
9586                                 continue
9587                         }
9588                         v.reset(OpEq32)
9589                         v0 := b.NewValue0(v.Pos, OpMod32u, typ.UInt32)
9590                         v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
9591                         v1.AddArg(x)
9592                         v2 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
9593                         v2.AuxInt = int32ToAuxInt(int32(uint8(c)))
9594                         v0.AddArg2(v1, v2)
9595                         v3 := b.NewValue0(v.Pos, OpConst32, typ.UInt32)
9596                         v3.AuxInt = int32ToAuxInt(0)
9597                         v.AddArg2(v0, v3)
9598                         return true
9599                 }
9600                 break
9601         }
9602         // match: (Eq8 (Mod8 x (Const8 [c])) (Const8 [0]))
9603         // cond: x.Op != OpConst8 && sdivisibleOK8(c) && !hasSmallRotate(config)
9604         // result: (Eq32 (Mod32 <typ.Int32> (SignExt8to32 <typ.Int32> x) (Const32 <typ.Int32> [int32(c)])) (Const32 <typ.Int32> [0]))
9605         for {
9606                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9607                         if v_0.Op != OpMod8 {
9608                                 continue
9609                         }
9610                         _ = v_0.Args[1]
9611                         x := v_0.Args[0]
9612                         v_0_1 := v_0.Args[1]
9613                         if v_0_1.Op != OpConst8 {
9614                                 continue
9615                         }
9616                         c := auxIntToInt8(v_0_1.AuxInt)
9617                         if v_1.Op != OpConst8 || auxIntToInt8(v_1.AuxInt) != 0 || !(x.Op != OpConst8 && sdivisibleOK8(c) && !hasSmallRotate(config)) {
9618                                 continue
9619                         }
9620                         v.reset(OpEq32)
9621                         v0 := b.NewValue0(v.Pos, OpMod32, typ.Int32)
9622                         v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
9623                         v1.AddArg(x)
9624                         v2 := b.NewValue0(v.Pos, OpConst32, typ.Int32)
9625                         v2.AuxInt = int32ToAuxInt(int32(c))
9626                         v0.AddArg2(v1, v2)
9627                         v3 := b.NewValue0(v.Pos, OpConst32, typ.Int32)
9628                         v3.AuxInt = int32ToAuxInt(0)
9629                         v.AddArg2(v0, v3)
9630                         return true
9631                 }
9632                 break
9633         }
9634         // match: (Eq8 x (Mul8 (Const8 [c]) (Trunc32to8 (Rsh32Ux64 mul:(Mul32 (Const32 [m]) (ZeroExt8to32 x)) (Const64 [s]))) ) )
9635         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(1<<8+umagic8(c).m) && s == 8+umagic8(c).s && x.Op != OpConst8 && udivisibleOK8(c)
9636         // result: (Leq8U (RotateLeft8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int8(udivisible8(c).m)]) x) (Const8 <typ.UInt8> [int8(8-udivisible8(c).k)]) ) (Const8 <typ.UInt8> [int8(udivisible8(c).max)]) )
9637         for {
9638                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9639                         x := v_0
9640                         if v_1.Op != OpMul8 {
9641                                 continue
9642                         }
9643                         _ = v_1.Args[1]
9644                         v_1_0 := v_1.Args[0]
9645                         v_1_1 := v_1.Args[1]
9646                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
9647                                 if v_1_0.Op != OpConst8 {
9648                                         continue
9649                                 }
9650                                 c := auxIntToInt8(v_1_0.AuxInt)
9651                                 if v_1_1.Op != OpTrunc32to8 {
9652                                         continue
9653                                 }
9654                                 v_1_1_0 := v_1_1.Args[0]
9655                                 if v_1_1_0.Op != OpRsh32Ux64 {
9656                                         continue
9657                                 }
9658                                 _ = v_1_1_0.Args[1]
9659                                 mul := v_1_1_0.Args[0]
9660                                 if mul.Op != OpMul32 {
9661                                         continue
9662                                 }
9663                                 _ = mul.Args[1]
9664                                 mul_0 := mul.Args[0]
9665                                 mul_1 := mul.Args[1]
9666                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
9667                                         if mul_0.Op != OpConst32 {
9668                                                 continue
9669                                         }
9670                                         m := auxIntToInt32(mul_0.AuxInt)
9671                                         if mul_1.Op != OpZeroExt8to32 || x != mul_1.Args[0] {
9672                                                 continue
9673                                         }
9674                                         v_1_1_0_1 := v_1_1_0.Args[1]
9675                                         if v_1_1_0_1.Op != OpConst64 {
9676                                                 continue
9677                                         }
9678                                         s := auxIntToInt64(v_1_1_0_1.AuxInt)
9679                                         if !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(1<<8+umagic8(c).m) && s == 8+umagic8(c).s && x.Op != OpConst8 && udivisibleOK8(c)) {
9680                                                 continue
9681                                         }
9682                                         v.reset(OpLeq8U)
9683                                         v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8)
9684                                         v1 := b.NewValue0(v.Pos, OpMul8, typ.UInt8)
9685                                         v2 := b.NewValue0(v.Pos, OpConst8, typ.UInt8)
9686                                         v2.AuxInt = int8ToAuxInt(int8(udivisible8(c).m))
9687                                         v1.AddArg2(v2, x)
9688                                         v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8)
9689                                         v3.AuxInt = int8ToAuxInt(int8(8 - udivisible8(c).k))
9690                                         v0.AddArg2(v1, v3)
9691                                         v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8)
9692                                         v4.AuxInt = int8ToAuxInt(int8(udivisible8(c).max))
9693                                         v.AddArg2(v0, v4)
9694                                         return true
9695                                 }
9696                         }
9697                 }
9698                 break
9699         }
9700         // match: (Eq8 x (Mul8 (Const8 [c]) (Sub8 (Rsh32x64 mul:(Mul32 (Const32 [m]) (SignExt8to32 x)) (Const64 [s])) (Rsh32x64 (SignExt8to32 x) (Const64 [31]))) ) )
9701         // cond: v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(smagic8(c).m) && s == 8+smagic8(c).s && x.Op != OpConst8 && sdivisibleOK8(c)
9702         // result: (Leq8U (RotateLeft8 <typ.UInt8> (Add8 <typ.UInt8> (Mul8 <typ.UInt8> (Const8 <typ.UInt8> [int8(sdivisible8(c).m)]) x) (Const8 <typ.UInt8> [int8(sdivisible8(c).a)]) ) (Const8 <typ.UInt8> [int8(8-sdivisible8(c).k)]) ) (Const8 <typ.UInt8> [int8(sdivisible8(c).max)]) )
9703         for {
9704                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9705                         x := v_0
9706                         if v_1.Op != OpMul8 {
9707                                 continue
9708                         }
9709                         _ = v_1.Args[1]
9710                         v_1_0 := v_1.Args[0]
9711                         v_1_1 := v_1.Args[1]
9712                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
9713                                 if v_1_0.Op != OpConst8 {
9714                                         continue
9715                                 }
9716                                 c := auxIntToInt8(v_1_0.AuxInt)
9717                                 if v_1_1.Op != OpSub8 {
9718                                         continue
9719                                 }
9720                                 _ = v_1_1.Args[1]
9721                                 v_1_1_0 := v_1_1.Args[0]
9722                                 if v_1_1_0.Op != OpRsh32x64 {
9723                                         continue
9724                                 }
9725                                 _ = v_1_1_0.Args[1]
9726                                 mul := v_1_1_0.Args[0]
9727                                 if mul.Op != OpMul32 {
9728                                         continue
9729                                 }
9730                                 _ = mul.Args[1]
9731                                 mul_0 := mul.Args[0]
9732                                 mul_1 := mul.Args[1]
9733                                 for _i2 := 0; _i2 <= 1; _i2, mul_0, mul_1 = _i2+1, mul_1, mul_0 {
9734                                         if mul_0.Op != OpConst32 {
9735                                                 continue
9736                                         }
9737                                         m := auxIntToInt32(mul_0.AuxInt)
9738                                         if mul_1.Op != OpSignExt8to32 || x != mul_1.Args[0] {
9739                                                 continue
9740                                         }
9741                                         v_1_1_0_1 := v_1_1_0.Args[1]
9742                                         if v_1_1_0_1.Op != OpConst64 {
9743                                                 continue
9744                                         }
9745                                         s := auxIntToInt64(v_1_1_0_1.AuxInt)
9746                                         v_1_1_1 := v_1_1.Args[1]
9747                                         if v_1_1_1.Op != OpRsh32x64 {
9748                                                 continue
9749                                         }
9750                                         _ = v_1_1_1.Args[1]
9751                                         v_1_1_1_0 := v_1_1_1.Args[0]
9752                                         if v_1_1_1_0.Op != OpSignExt8to32 || x != v_1_1_1_0.Args[0] {
9753                                                 continue
9754                                         }
9755                                         v_1_1_1_1 := v_1_1_1.Args[1]
9756                                         if v_1_1_1_1.Op != OpConst64 || auxIntToInt64(v_1_1_1_1.AuxInt) != 31 || !(v.Block.Func.pass.name != "opt" && mul.Uses == 1 && m == int32(smagic8(c).m) && s == 8+smagic8(c).s && x.Op != OpConst8 && sdivisibleOK8(c)) {
9757                                                 continue
9758                                         }
9759                                         v.reset(OpLeq8U)
9760                                         v0 := b.NewValue0(v.Pos, OpRotateLeft8, typ.UInt8)
9761                                         v1 := b.NewValue0(v.Pos, OpAdd8, typ.UInt8)
9762                                         v2 := b.NewValue0(v.Pos, OpMul8, typ.UInt8)
9763                                         v3 := b.NewValue0(v.Pos, OpConst8, typ.UInt8)
9764                                         v3.AuxInt = int8ToAuxInt(int8(sdivisible8(c).m))
9765                                         v2.AddArg2(v3, x)
9766                                         v4 := b.NewValue0(v.Pos, OpConst8, typ.UInt8)
9767                                         v4.AuxInt = int8ToAuxInt(int8(sdivisible8(c).a))
9768                                         v1.AddArg2(v2, v4)
9769                                         v5 := b.NewValue0(v.Pos, OpConst8, typ.UInt8)
9770                                         v5.AuxInt = int8ToAuxInt(int8(8 - sdivisible8(c).k))
9771                                         v0.AddArg2(v1, v5)
9772                                         v6 := b.NewValue0(v.Pos, OpConst8, typ.UInt8)
9773                                         v6.AuxInt = int8ToAuxInt(int8(sdivisible8(c).max))
9774                                         v.AddArg2(v0, v6)
9775                                         return true
9776                                 }
9777                         }
9778                 }
9779                 break
9780         }
9781         // match: (Eq8 n (Lsh8x64 (Rsh8x64 (Add8 <t> n (Rsh8Ux64 <t> (Rsh8x64 <t> n (Const64 <typ.UInt64> [ 7])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) )
9782         // cond: k > 0 && k < 7 && kbar == 8 - k
9783         // result: (Eq8 (And8 <t> n (Const8 <t> [1<<uint(k)-1])) (Const8 <t> [0]))
9784         for {
9785                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9786                         n := v_0
9787                         if v_1.Op != OpLsh8x64 {
9788                                 continue
9789                         }
9790                         _ = v_1.Args[1]
9791                         v_1_0 := v_1.Args[0]
9792                         if v_1_0.Op != OpRsh8x64 {
9793                                 continue
9794                         }
9795                         _ = v_1_0.Args[1]
9796                         v_1_0_0 := v_1_0.Args[0]
9797                         if v_1_0_0.Op != OpAdd8 {
9798                                 continue
9799                         }
9800                         t := v_1_0_0.Type
9801                         _ = v_1_0_0.Args[1]
9802                         v_1_0_0_0 := v_1_0_0.Args[0]
9803                         v_1_0_0_1 := v_1_0_0.Args[1]
9804                         for _i1 := 0; _i1 <= 1; _i1, v_1_0_0_0, v_1_0_0_1 = _i1+1, v_1_0_0_1, v_1_0_0_0 {
9805                                 if n != v_1_0_0_0 || v_1_0_0_1.Op != OpRsh8Ux64 || v_1_0_0_1.Type != t {
9806                                         continue
9807                                 }
9808                                 _ = v_1_0_0_1.Args[1]
9809                                 v_1_0_0_1_0 := v_1_0_0_1.Args[0]
9810                                 if v_1_0_0_1_0.Op != OpRsh8x64 || v_1_0_0_1_0.Type != t {
9811                                         continue
9812                                 }
9813                                 _ = v_1_0_0_1_0.Args[1]
9814                                 if n != v_1_0_0_1_0.Args[0] {
9815                                         continue
9816                                 }
9817                                 v_1_0_0_1_0_1 := v_1_0_0_1_0.Args[1]
9818                                 if v_1_0_0_1_0_1.Op != OpConst64 || v_1_0_0_1_0_1.Type != typ.UInt64 || auxIntToInt64(v_1_0_0_1_0_1.AuxInt) != 7 {
9819                                         continue
9820                                 }
9821                                 v_1_0_0_1_1 := v_1_0_0_1.Args[1]
9822                                 if v_1_0_0_1_1.Op != OpConst64 || v_1_0_0_1_1.Type != typ.UInt64 {
9823                                         continue
9824                                 }
9825                                 kbar := auxIntToInt64(v_1_0_0_1_1.AuxInt)
9826                                 v_1_0_1 := v_1_0.Args[1]
9827                                 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 {
9828                                         continue
9829                                 }
9830                                 k := auxIntToInt64(v_1_0_1.AuxInt)
9831                                 v_1_1 := v_1.Args[1]
9832                                 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || auxIntToInt64(v_1_1.AuxInt) != k || !(k > 0 && k < 7 && kbar == 8-k) {
9833                                         continue
9834                                 }
9835                                 v.reset(OpEq8)
9836                                 v0 := b.NewValue0(v.Pos, OpAnd8, t)
9837                                 v1 := b.NewValue0(v.Pos, OpConst8, t)
9838                                 v1.AuxInt = int8ToAuxInt(1<<uint(k) - 1)
9839                                 v0.AddArg2(n, v1)
9840                                 v2 := b.NewValue0(v.Pos, OpConst8, t)
9841                                 v2.AuxInt = int8ToAuxInt(0)
9842                                 v.AddArg2(v0, v2)
9843                                 return true
9844                         }
9845                 }
9846                 break
9847         }
9848         // match: (Eq8 s:(Sub8 x y) (Const8 [0]))
9849         // cond: s.Uses == 1
9850         // result: (Eq8 x y)
9851         for {
9852                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9853                         s := v_0
9854                         if s.Op != OpSub8 {
9855                                 continue
9856                         }
9857                         y := s.Args[1]
9858                         x := s.Args[0]
9859                         if v_1.Op != OpConst8 || auxIntToInt8(v_1.AuxInt) != 0 || !(s.Uses == 1) {
9860                                 continue
9861                         }
9862                         v.reset(OpEq8)
9863                         v.AddArg2(x, y)
9864                         return true
9865                 }
9866                 break
9867         }
9868         // match: (Eq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [y]))
9869         // cond: oneBit8(y)
9870         // result: (Neq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [0]))
9871         for {
9872                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9873                         if v_0.Op != OpAnd8 {
9874                                 continue
9875                         }
9876                         t := v_0.Type
9877                         _ = v_0.Args[1]
9878                         v_0_0 := v_0.Args[0]
9879                         v_0_1 := v_0.Args[1]
9880                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
9881                                 x := v_0_0
9882                                 if v_0_1.Op != OpConst8 || v_0_1.Type != t {
9883                                         continue
9884                                 }
9885                                 y := auxIntToInt8(v_0_1.AuxInt)
9886                                 if v_1.Op != OpConst8 || v_1.Type != t || auxIntToInt8(v_1.AuxInt) != y || !(oneBit8(y)) {
9887                                         continue
9888                                 }
9889                                 v.reset(OpNeq8)
9890                                 v0 := b.NewValue0(v.Pos, OpAnd8, t)
9891                                 v1 := b.NewValue0(v.Pos, OpConst8, t)
9892                                 v1.AuxInt = int8ToAuxInt(y)
9893                                 v0.AddArg2(x, v1)
9894                                 v2 := b.NewValue0(v.Pos, OpConst8, t)
9895                                 v2.AuxInt = int8ToAuxInt(0)
9896                                 v.AddArg2(v0, v2)
9897                                 return true
9898                         }
9899                 }
9900                 break
9901         }
9902         return false
9903 }
9904 func rewriteValuegeneric_OpEqB(v *Value) bool {
9905         v_1 := v.Args[1]
9906         v_0 := v.Args[0]
9907         // match: (EqB (ConstBool [c]) (ConstBool [d]))
9908         // result: (ConstBool [c == d])
9909         for {
9910                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9911                         if v_0.Op != OpConstBool {
9912                                 continue
9913                         }
9914                         c := auxIntToBool(v_0.AuxInt)
9915                         if v_1.Op != OpConstBool {
9916                                 continue
9917                         }
9918                         d := auxIntToBool(v_1.AuxInt)
9919                         v.reset(OpConstBool)
9920                         v.AuxInt = boolToAuxInt(c == d)
9921                         return true
9922                 }
9923                 break
9924         }
9925         // match: (EqB (ConstBool [false]) x)
9926         // result: (Not x)
9927         for {
9928                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9929                         if v_0.Op != OpConstBool || auxIntToBool(v_0.AuxInt) != false {
9930                                 continue
9931                         }
9932                         x := v_1
9933                         v.reset(OpNot)
9934                         v.AddArg(x)
9935                         return true
9936                 }
9937                 break
9938         }
9939         // match: (EqB (ConstBool [true]) x)
9940         // result: x
9941         for {
9942                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9943                         if v_0.Op != OpConstBool || auxIntToBool(v_0.AuxInt) != true {
9944                                 continue
9945                         }
9946                         x := v_1
9947                         v.copyOf(x)
9948                         return true
9949                 }
9950                 break
9951         }
9952         return false
9953 }
9954 func rewriteValuegeneric_OpEqInter(v *Value) bool {
9955         v_1 := v.Args[1]
9956         v_0 := v.Args[0]
9957         b := v.Block
9958         typ := &b.Func.Config.Types
9959         // match: (EqInter x y)
9960         // result: (EqPtr (ITab x) (ITab y))
9961         for {
9962                 x := v_0
9963                 y := v_1
9964                 v.reset(OpEqPtr)
9965                 v0 := b.NewValue0(v.Pos, OpITab, typ.Uintptr)
9966                 v0.AddArg(x)
9967                 v1 := b.NewValue0(v.Pos, OpITab, typ.Uintptr)
9968                 v1.AddArg(y)
9969                 v.AddArg2(v0, v1)
9970                 return true
9971         }
9972 }
9973 func rewriteValuegeneric_OpEqPtr(v *Value) bool {
9974         v_1 := v.Args[1]
9975         v_0 := v.Args[0]
9976         b := v.Block
9977         typ := &b.Func.Config.Types
9978         // match: (EqPtr x x)
9979         // result: (ConstBool [true])
9980         for {
9981                 x := v_0
9982                 if x != v_1 {
9983                         break
9984                 }
9985                 v.reset(OpConstBool)
9986                 v.AuxInt = boolToAuxInt(true)
9987                 return true
9988         }
9989         // match: (EqPtr (Addr {x} _) (Addr {y} _))
9990         // result: (ConstBool [x == y])
9991         for {
9992                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
9993                         if v_0.Op != OpAddr {
9994                                 continue
9995                         }
9996                         x := auxToSym(v_0.Aux)
9997                         if v_1.Op != OpAddr {
9998                                 continue
9999                         }
10000                         y := auxToSym(v_1.Aux)
10001                         v.reset(OpConstBool)
10002                         v.AuxInt = boolToAuxInt(x == y)
10003                         return true
10004                 }
10005                 break
10006         }
10007         // match: (EqPtr (Addr {x} _) (OffPtr [o] (Addr {y} _)))
10008         // result: (ConstBool [x == y && o == 0])
10009         for {
10010                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10011                         if v_0.Op != OpAddr {
10012                                 continue
10013                         }
10014                         x := auxToSym(v_0.Aux)
10015                         if v_1.Op != OpOffPtr {
10016                                 continue
10017                         }
10018                         o := auxIntToInt64(v_1.AuxInt)
10019                         v_1_0 := v_1.Args[0]
10020                         if v_1_0.Op != OpAddr {
10021                                 continue
10022                         }
10023                         y := auxToSym(v_1_0.Aux)
10024                         v.reset(OpConstBool)
10025                         v.AuxInt = boolToAuxInt(x == y && o == 0)
10026                         return true
10027                 }
10028                 break
10029         }
10030         // match: (EqPtr (OffPtr [o1] (Addr {x} _)) (OffPtr [o2] (Addr {y} _)))
10031         // result: (ConstBool [x == y && o1 == o2])
10032         for {
10033                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10034                         if v_0.Op != OpOffPtr {
10035                                 continue
10036                         }
10037                         o1 := auxIntToInt64(v_0.AuxInt)
10038                         v_0_0 := v_0.Args[0]
10039                         if v_0_0.Op != OpAddr {
10040                                 continue
10041                         }
10042                         x := auxToSym(v_0_0.Aux)
10043                         if v_1.Op != OpOffPtr {
10044                                 continue
10045                         }
10046                         o2 := auxIntToInt64(v_1.AuxInt)
10047                         v_1_0 := v_1.Args[0]
10048                         if v_1_0.Op != OpAddr {
10049                                 continue
10050                         }
10051                         y := auxToSym(v_1_0.Aux)
10052                         v.reset(OpConstBool)
10053                         v.AuxInt = boolToAuxInt(x == y && o1 == o2)
10054                         return true
10055                 }
10056                 break
10057         }
10058         // match: (EqPtr (LocalAddr {x} _ _) (LocalAddr {y} _ _))
10059         // result: (ConstBool [x == y])
10060         for {
10061                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10062                         if v_0.Op != OpLocalAddr {
10063                                 continue
10064                         }
10065                         x := auxToSym(v_0.Aux)
10066                         if v_1.Op != OpLocalAddr {
10067                                 continue
10068                         }
10069                         y := auxToSym(v_1.Aux)
10070                         v.reset(OpConstBool)
10071                         v.AuxInt = boolToAuxInt(x == y)
10072                         return true
10073                 }
10074                 break
10075         }
10076         // match: (EqPtr (LocalAddr {x} _ _) (OffPtr [o] (LocalAddr {y} _ _)))
10077         // result: (ConstBool [x == y && o == 0])
10078         for {
10079                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10080                         if v_0.Op != OpLocalAddr {
10081                                 continue
10082                         }
10083                         x := auxToSym(v_0.Aux)
10084                         if v_1.Op != OpOffPtr {
10085                                 continue
10086                         }
10087                         o := auxIntToInt64(v_1.AuxInt)
10088                         v_1_0 := v_1.Args[0]
10089                         if v_1_0.Op != OpLocalAddr {
10090                                 continue
10091                         }
10092                         y := auxToSym(v_1_0.Aux)
10093                         v.reset(OpConstBool)
10094                         v.AuxInt = boolToAuxInt(x == y && o == 0)
10095                         return true
10096                 }
10097                 break
10098         }
10099         // match: (EqPtr (OffPtr [o1] (LocalAddr {x} _ _)) (OffPtr [o2] (LocalAddr {y} _ _)))
10100         // result: (ConstBool [x == y && o1 == o2])
10101         for {
10102                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10103                         if v_0.Op != OpOffPtr {
10104                                 continue
10105                         }
10106                         o1 := auxIntToInt64(v_0.AuxInt)
10107                         v_0_0 := v_0.Args[0]
10108                         if v_0_0.Op != OpLocalAddr {
10109                                 continue
10110                         }
10111                         x := auxToSym(v_0_0.Aux)
10112                         if v_1.Op != OpOffPtr {
10113                                 continue
10114                         }
10115                         o2 := auxIntToInt64(v_1.AuxInt)
10116                         v_1_0 := v_1.Args[0]
10117                         if v_1_0.Op != OpLocalAddr {
10118                                 continue
10119                         }
10120                         y := auxToSym(v_1_0.Aux)
10121                         v.reset(OpConstBool)
10122                         v.AuxInt = boolToAuxInt(x == y && o1 == o2)
10123                         return true
10124                 }
10125                 break
10126         }
10127         // match: (EqPtr (OffPtr [o1] p1) p2)
10128         // cond: isSamePtr(p1, p2)
10129         // result: (ConstBool [o1 == 0])
10130         for {
10131                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10132                         if v_0.Op != OpOffPtr {
10133                                 continue
10134                         }
10135                         o1 := auxIntToInt64(v_0.AuxInt)
10136                         p1 := v_0.Args[0]
10137                         p2 := v_1
10138                         if !(isSamePtr(p1, p2)) {
10139                                 continue
10140                         }
10141                         v.reset(OpConstBool)
10142                         v.AuxInt = boolToAuxInt(o1 == 0)
10143                         return true
10144                 }
10145                 break
10146         }
10147         // match: (EqPtr (OffPtr [o1] p1) (OffPtr [o2] p2))
10148         // cond: isSamePtr(p1, p2)
10149         // result: (ConstBool [o1 == o2])
10150         for {
10151                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10152                         if v_0.Op != OpOffPtr {
10153                                 continue
10154                         }
10155                         o1 := auxIntToInt64(v_0.AuxInt)
10156                         p1 := v_0.Args[0]
10157                         if v_1.Op != OpOffPtr {
10158                                 continue
10159                         }
10160                         o2 := auxIntToInt64(v_1.AuxInt)
10161                         p2 := v_1.Args[0]
10162                         if !(isSamePtr(p1, p2)) {
10163                                 continue
10164                         }
10165                         v.reset(OpConstBool)
10166                         v.AuxInt = boolToAuxInt(o1 == o2)
10167                         return true
10168                 }
10169                 break
10170         }
10171         // match: (EqPtr (Const32 [c]) (Const32 [d]))
10172         // result: (ConstBool [c == d])
10173         for {
10174                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10175                         if v_0.Op != OpConst32 {
10176                                 continue
10177                         }
10178                         c := auxIntToInt32(v_0.AuxInt)
10179                         if v_1.Op != OpConst32 {
10180                                 continue
10181                         }
10182                         d := auxIntToInt32(v_1.AuxInt)
10183                         v.reset(OpConstBool)
10184                         v.AuxInt = boolToAuxInt(c == d)
10185                         return true
10186                 }
10187                 break
10188         }
10189         // match: (EqPtr (Const64 [c]) (Const64 [d]))
10190         // result: (ConstBool [c == d])
10191         for {
10192                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10193                         if v_0.Op != OpConst64 {
10194                                 continue
10195                         }
10196                         c := auxIntToInt64(v_0.AuxInt)
10197                         if v_1.Op != OpConst64 {
10198                                 continue
10199                         }
10200                         d := auxIntToInt64(v_1.AuxInt)
10201                         v.reset(OpConstBool)
10202                         v.AuxInt = boolToAuxInt(c == d)
10203                         return true
10204                 }
10205                 break
10206         }
10207         // match: (EqPtr (Convert (Addr {x} _) _) (Addr {y} _))
10208         // result: (ConstBool [x==y])
10209         for {
10210                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10211                         if v_0.Op != OpConvert {
10212                                 continue
10213                         }
10214                         v_0_0 := v_0.Args[0]
10215                         if v_0_0.Op != OpAddr {
10216                                 continue
10217                         }
10218                         x := auxToSym(v_0_0.Aux)
10219                         if v_1.Op != OpAddr {
10220                                 continue
10221                         }
10222                         y := auxToSym(v_1.Aux)
10223                         v.reset(OpConstBool)
10224                         v.AuxInt = boolToAuxInt(x == y)
10225                         return true
10226                 }
10227                 break
10228         }
10229         // match: (EqPtr (LocalAddr _ _) (Addr _))
10230         // result: (ConstBool [false])
10231         for {
10232                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10233                         if v_0.Op != OpLocalAddr || v_1.Op != OpAddr {
10234                                 continue
10235                         }
10236                         v.reset(OpConstBool)
10237                         v.AuxInt = boolToAuxInt(false)
10238                         return true
10239                 }
10240                 break
10241         }
10242         // match: (EqPtr (OffPtr (LocalAddr _ _)) (Addr _))
10243         // result: (ConstBool [false])
10244         for {
10245                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10246                         if v_0.Op != OpOffPtr {
10247                                 continue
10248                         }
10249                         v_0_0 := v_0.Args[0]
10250                         if v_0_0.Op != OpLocalAddr || v_1.Op != OpAddr {
10251                                 continue
10252                         }
10253                         v.reset(OpConstBool)
10254                         v.AuxInt = boolToAuxInt(false)
10255                         return true
10256                 }
10257                 break
10258         }
10259         // match: (EqPtr (LocalAddr _ _) (OffPtr (Addr _)))
10260         // result: (ConstBool [false])
10261         for {
10262                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10263                         if v_0.Op != OpLocalAddr || v_1.Op != OpOffPtr {
10264                                 continue
10265                         }
10266                         v_1_0 := v_1.Args[0]
10267                         if v_1_0.Op != OpAddr {
10268                                 continue
10269                         }
10270                         v.reset(OpConstBool)
10271                         v.AuxInt = boolToAuxInt(false)
10272                         return true
10273                 }
10274                 break
10275         }
10276         // match: (EqPtr (OffPtr (LocalAddr _ _)) (OffPtr (Addr _)))
10277         // result: (ConstBool [false])
10278         for {
10279                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10280                         if v_0.Op != OpOffPtr {
10281                                 continue
10282                         }
10283                         v_0_0 := v_0.Args[0]
10284                         if v_0_0.Op != OpLocalAddr || v_1.Op != OpOffPtr {
10285                                 continue
10286                         }
10287                         v_1_0 := v_1.Args[0]
10288                         if v_1_0.Op != OpAddr {
10289                                 continue
10290                         }
10291                         v.reset(OpConstBool)
10292                         v.AuxInt = boolToAuxInt(false)
10293                         return true
10294                 }
10295                 break
10296         }
10297         // match: (EqPtr (AddPtr p1 o1) p2)
10298         // cond: isSamePtr(p1, p2)
10299         // result: (Not (IsNonNil o1))
10300         for {
10301                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10302                         if v_0.Op != OpAddPtr {
10303                                 continue
10304                         }
10305                         o1 := v_0.Args[1]
10306                         p1 := v_0.Args[0]
10307                         p2 := v_1
10308                         if !(isSamePtr(p1, p2)) {
10309                                 continue
10310                         }
10311                         v.reset(OpNot)
10312                         v0 := b.NewValue0(v.Pos, OpIsNonNil, typ.Bool)
10313                         v0.AddArg(o1)
10314                         v.AddArg(v0)
10315                         return true
10316                 }
10317                 break
10318         }
10319         // match: (EqPtr (Const32 [0]) p)
10320         // result: (Not (IsNonNil p))
10321         for {
10322                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10323                         if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
10324                                 continue
10325                         }
10326                         p := v_1
10327                         v.reset(OpNot)
10328                         v0 := b.NewValue0(v.Pos, OpIsNonNil, typ.Bool)
10329                         v0.AddArg(p)
10330                         v.AddArg(v0)
10331                         return true
10332                 }
10333                 break
10334         }
10335         // match: (EqPtr (Const64 [0]) p)
10336         // result: (Not (IsNonNil p))
10337         for {
10338                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10339                         if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
10340                                 continue
10341                         }
10342                         p := v_1
10343                         v.reset(OpNot)
10344                         v0 := b.NewValue0(v.Pos, OpIsNonNil, typ.Bool)
10345                         v0.AddArg(p)
10346                         v.AddArg(v0)
10347                         return true
10348                 }
10349                 break
10350         }
10351         // match: (EqPtr (ConstNil) p)
10352         // result: (Not (IsNonNil p))
10353         for {
10354                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
10355                         if v_0.Op != OpConstNil {
10356                                 continue
10357                         }
10358                         p := v_1
10359                         v.reset(OpNot)
10360                         v0 := b.NewValue0(v.Pos, OpIsNonNil, typ.Bool)
10361                         v0.AddArg(p)
10362                         v.AddArg(v0)
10363                         return true
10364                 }
10365                 break
10366         }
10367         return false
10368 }
10369 func rewriteValuegeneric_OpEqSlice(v *Value) bool {
10370         v_1 := v.Args[1]
10371         v_0 := v.Args[0]
10372         b := v.Block
10373         typ := &b.Func.Config.Types
10374         // match: (EqSlice x y)
10375         // result: (EqPtr (SlicePtr x) (SlicePtr y))
10376         for {
10377                 x := v_0
10378                 y := v_1
10379                 v.reset(OpEqPtr)
10380                 v0 := b.NewValue0(v.Pos, OpSlicePtr, typ.BytePtr)
10381                 v0.AddArg(x)
10382                 v1 := b.NewValue0(v.Pos, OpSlicePtr, typ.BytePtr)
10383                 v1.AddArg(y)
10384                 v.AddArg2(v0, v1)
10385                 return true
10386         }
10387 }
10388 func rewriteValuegeneric_OpFloor(v *Value) bool {
10389         v_0 := v.Args[0]
10390         // match: (Floor (Const64F [c]))
10391         // result: (Const64F [math.Floor(c)])
10392         for {
10393                 if v_0.Op != OpConst64F {
10394                         break
10395                 }
10396                 c := auxIntToFloat64(v_0.AuxInt)
10397                 v.reset(OpConst64F)
10398                 v.AuxInt = float64ToAuxInt(math.Floor(c))
10399                 return true
10400         }
10401         return false
10402 }
10403 func rewriteValuegeneric_OpIMake(v *Value) bool {
10404         v_1 := v.Args[1]
10405         v_0 := v.Args[0]
10406         // match: (IMake _typ (StructMake1 val))
10407         // result: (IMake _typ val)
10408         for {
10409                 _typ := v_0
10410                 if v_1.Op != OpStructMake1 {
10411                         break
10412                 }
10413                 val := v_1.Args[0]
10414                 v.reset(OpIMake)
10415                 v.AddArg2(_typ, val)
10416                 return true
10417         }
10418         // match: (IMake _typ (ArrayMake1 val))
10419         // result: (IMake _typ val)
10420         for {
10421                 _typ := v_0
10422                 if v_1.Op != OpArrayMake1 {
10423                         break
10424                 }
10425                 val := v_1.Args[0]
10426                 v.reset(OpIMake)
10427                 v.AddArg2(_typ, val)
10428                 return true
10429         }
10430         return false
10431 }
10432 func rewriteValuegeneric_OpInterLECall(v *Value) bool {
10433         // match: (InterLECall [argsize] {auxCall} (Addr {fn} (SB)) ___)
10434         // result: devirtLECall(v, fn.(*obj.LSym))
10435         for {
10436                 if len(v.Args) < 1 {
10437                         break
10438                 }
10439                 v_0 := v.Args[0]
10440                 if v_0.Op != OpAddr {
10441                         break
10442                 }
10443                 fn := auxToSym(v_0.Aux)
10444                 v_0_0 := v_0.Args[0]
10445                 if v_0_0.Op != OpSB {
10446                         break
10447                 }
10448                 v.copyOf(devirtLECall(v, fn.(*obj.LSym)))
10449                 return true
10450         }
10451         return false
10452 }
10453 func rewriteValuegeneric_OpIsInBounds(v *Value) bool {
10454         v_1 := v.Args[1]
10455         v_0 := v.Args[0]
10456         // match: (IsInBounds (ZeroExt8to32 _) (Const32 [c]))
10457         // cond: (1 << 8) <= c
10458         // result: (ConstBool [true])
10459         for {
10460                 if v_0.Op != OpZeroExt8to32 || v_1.Op != OpConst32 {
10461                         break
10462                 }
10463                 c := auxIntToInt32(v_1.AuxInt)
10464                 if !((1 << 8) <= c) {
10465                         break
10466                 }
10467                 v.reset(OpConstBool)
10468                 v.AuxInt = boolToAuxInt(true)
10469                 return true
10470         }
10471         // match: (IsInBounds (ZeroExt8to64 _) (Const64 [c]))
10472         // cond: (1 << 8) <= c
10473         // result: (ConstBool [true])
10474         for {
10475                 if v_0.Op != OpZeroExt8to64 || v_1.Op != OpConst64 {
10476                         break
10477                 }
10478                 c := auxIntToInt64(v_1.AuxInt)
10479                 if !((1 << 8) <= c) {
10480                         break
10481                 }
10482                 v.reset(OpConstBool)
10483                 v.AuxInt = boolToAuxInt(true)
10484                 return true
10485         }
10486         // match: (IsInBounds (ZeroExt16to32 _) (Const32 [c]))
10487         // cond: (1 << 16) <= c
10488         // result: (ConstBool [true])
10489         for {
10490                 if v_0.Op != OpZeroExt16to32 || v_1.Op != OpConst32 {
10491                         break
10492                 }
10493                 c := auxIntToInt32(v_1.AuxInt)
10494                 if !((1 << 16) <= c) {
10495                         break
10496                 }
10497                 v.reset(OpConstBool)
10498                 v.AuxInt = boolToAuxInt(true)
10499                 return true
10500         }
10501         // match: (IsInBounds (ZeroExt16to64 _) (Const64 [c]))
10502         // cond: (1 << 16) <= c
10503         // result: (ConstBool [true])
10504         for {
10505                 if v_0.Op != OpZeroExt16to64 || v_1.Op != OpConst64 {
10506                         break
10507                 }
10508                 c := auxIntToInt64(v_1.AuxInt)
10509                 if !((1 << 16) <= c) {
10510                         break
10511                 }
10512                 v.reset(OpConstBool)
10513                 v.AuxInt = boolToAuxInt(true)
10514                 return true
10515         }
10516         // match: (IsInBounds x x)
10517         // result: (ConstBool [false])
10518         for {
10519                 x := v_0
10520                 if x != v_1 {
10521                         break
10522                 }
10523                 v.reset(OpConstBool)
10524                 v.AuxInt = boolToAuxInt(false)
10525                 return true
10526         }
10527         // match: (IsInBounds (And8 (Const8 [c]) _) (Const8 [d]))
10528         // cond: 0 <= c && c < d
10529         // result: (ConstBool [true])
10530         for {
10531                 if v_0.Op != OpAnd8 {
10532                         break
10533                 }
10534                 v_0_0 := v_0.Args[0]
10535                 v_0_1 := v_0.Args[1]
10536                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
10537                         if v_0_0.Op != OpConst8 {
10538                                 continue
10539                         }
10540                         c := auxIntToInt8(v_0_0.AuxInt)
10541                         if v_1.Op != OpConst8 {
10542                                 continue
10543                         }
10544                         d := auxIntToInt8(v_1.AuxInt)
10545                         if !(0 <= c && c < d) {
10546                                 continue
10547                         }
10548                         v.reset(OpConstBool)
10549                         v.AuxInt = boolToAuxInt(true)
10550                         return true
10551                 }
10552                 break
10553         }
10554         // match: (IsInBounds (ZeroExt8to16 (And8 (Const8 [c]) _)) (Const16 [d]))
10555         // cond: 0 <= c && int16(c) < d
10556         // result: (ConstBool [true])
10557         for {
10558                 if v_0.Op != OpZeroExt8to16 {
10559                         break
10560                 }
10561                 v_0_0 := v_0.Args[0]
10562                 if v_0_0.Op != OpAnd8 {
10563                         break
10564                 }
10565                 v_0_0_0 := v_0_0.Args[0]
10566                 v_0_0_1 := v_0_0.Args[1]
10567                 for _i0 := 0; _i0 <= 1; _i0, v_0_0_0, v_0_0_1 = _i0+1, v_0_0_1, v_0_0_0 {
10568                         if v_0_0_0.Op != OpConst8 {
10569                                 continue
10570                         }
10571                         c := auxIntToInt8(v_0_0_0.AuxInt)
10572                         if v_1.Op != OpConst16 {
10573                                 continue
10574                         }
10575                         d := auxIntToInt16(v_1.AuxInt)
10576                         if !(0 <= c && int16(c) < d) {
10577                                 continue
10578                         }
10579                         v.reset(OpConstBool)
10580                         v.AuxInt = boolToAuxInt(true)
10581                         return true
10582                 }
10583                 break
10584         }
10585         // match: (IsInBounds (ZeroExt8to32 (And8 (Const8 [c]) _)) (Const32 [d]))
10586         // cond: 0 <= c && int32(c) < d
10587         // result: (ConstBool [true])
10588         for {
10589                 if v_0.Op != OpZeroExt8to32 {
10590                         break
10591                 }
10592                 v_0_0 := v_0.Args[0]
10593                 if v_0_0.Op != OpAnd8 {
10594                         break
10595                 }
10596                 v_0_0_0 := v_0_0.Args[0]
10597                 v_0_0_1 := v_0_0.Args[1]
10598                 for _i0 := 0; _i0 <= 1; _i0, v_0_0_0, v_0_0_1 = _i0+1, v_0_0_1, v_0_0_0 {
10599                         if v_0_0_0.Op != OpConst8 {
10600                                 continue
10601                         }
10602                         c := auxIntToInt8(v_0_0_0.AuxInt)
10603                         if v_1.Op != OpConst32 {
10604                                 continue
10605                         }
10606                         d := auxIntToInt32(v_1.AuxInt)
10607                         if !(0 <= c && int32(c) < d) {
10608                                 continue
10609                         }
10610                         v.reset(OpConstBool)
10611                         v.AuxInt = boolToAuxInt(true)
10612                         return true
10613                 }
10614                 break
10615         }
10616         // match: (IsInBounds (ZeroExt8to64 (And8 (Const8 [c]) _)) (Const64 [d]))
10617         // cond: 0 <= c && int64(c) < d
10618         // result: (ConstBool [true])
10619         for {
10620                 if v_0.Op != OpZeroExt8to64 {
10621                         break
10622                 }
10623                 v_0_0 := v_0.Args[0]
10624                 if v_0_0.Op != OpAnd8 {
10625                         break
10626                 }
10627                 v_0_0_0 := v_0_0.Args[0]
10628                 v_0_0_1 := v_0_0.Args[1]
10629                 for _i0 := 0; _i0 <= 1; _i0, v_0_0_0, v_0_0_1 = _i0+1, v_0_0_1, v_0_0_0 {
10630                         if v_0_0_0.Op != OpConst8 {
10631                                 continue
10632                         }
10633                         c := auxIntToInt8(v_0_0_0.AuxInt)
10634                         if v_1.Op != OpConst64 {
10635                                 continue
10636                         }
10637                         d := auxIntToInt64(v_1.AuxInt)
10638                         if !(0 <= c && int64(c) < d) {
10639                                 continue
10640                         }
10641                         v.reset(OpConstBool)
10642                         v.AuxInt = boolToAuxInt(true)
10643                         return true
10644                 }
10645                 break
10646         }
10647         // match: (IsInBounds (And16 (Const16 [c]) _) (Const16 [d]))
10648         // cond: 0 <= c && c < d
10649         // result: (ConstBool [true])
10650         for {
10651                 if v_0.Op != OpAnd16 {
10652                         break
10653                 }
10654                 v_0_0 := v_0.Args[0]
10655                 v_0_1 := v_0.Args[1]
10656                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
10657                         if v_0_0.Op != OpConst16 {
10658                                 continue
10659                         }
10660                         c := auxIntToInt16(v_0_0.AuxInt)
10661                         if v_1.Op != OpConst16 {
10662                                 continue
10663                         }
10664                         d := auxIntToInt16(v_1.AuxInt)
10665                         if !(0 <= c && c < d) {
10666                                 continue
10667                         }
10668                         v.reset(OpConstBool)
10669                         v.AuxInt = boolToAuxInt(true)
10670                         return true
10671                 }
10672                 break
10673         }
10674         // match: (IsInBounds (ZeroExt16to32 (And16 (Const16 [c]) _)) (Const32 [d]))
10675         // cond: 0 <= c && int32(c) < d
10676         // result: (ConstBool [true])
10677         for {
10678                 if v_0.Op != OpZeroExt16to32 {
10679                         break
10680                 }
10681                 v_0_0 := v_0.Args[0]
10682                 if v_0_0.Op != OpAnd16 {
10683                         break
10684                 }
10685                 v_0_0_0 := v_0_0.Args[0]
10686                 v_0_0_1 := v_0_0.Args[1]
10687                 for _i0 := 0; _i0 <= 1; _i0, v_0_0_0, v_0_0_1 = _i0+1, v_0_0_1, v_0_0_0 {
10688                         if v_0_0_0.Op != OpConst16 {
10689                                 continue
10690                         }
10691                         c := auxIntToInt16(v_0_0_0.AuxInt)
10692                         if v_1.Op != OpConst32 {
10693                                 continue
10694                         }
10695                         d := auxIntToInt32(v_1.AuxInt)
10696                         if !(0 <= c && int32(c) < d) {
10697                                 continue
10698                         }
10699                         v.reset(OpConstBool)
10700                         v.AuxInt = boolToAuxInt(true)
10701                         return true
10702                 }
10703                 break
10704         }
10705         // match: (IsInBounds (ZeroExt16to64 (And16 (Const16 [c]) _)) (Const64 [d]))
10706         // cond: 0 <= c && int64(c) < d
10707         // result: (ConstBool [true])
10708         for {
10709                 if v_0.Op != OpZeroExt16to64 {
10710                         break
10711                 }
10712                 v_0_0 := v_0.Args[0]
10713                 if v_0_0.Op != OpAnd16 {
10714                         break
10715                 }
10716                 v_0_0_0 := v_0_0.Args[0]
10717                 v_0_0_1 := v_0_0.Args[1]
10718                 for _i0 := 0; _i0 <= 1; _i0, v_0_0_0, v_0_0_1 = _i0+1, v_0_0_1, v_0_0_0 {
10719                         if v_0_0_0.Op != OpConst16 {
10720                                 continue
10721                         }
10722                         c := auxIntToInt16(v_0_0_0.AuxInt)
10723                         if v_1.Op != OpConst64 {
10724                                 continue
10725                         }
10726                         d := auxIntToInt64(v_1.AuxInt)
10727                         if !(0 <= c && int64(c) < d) {
10728                                 continue
10729                         }
10730                         v.reset(OpConstBool)
10731                         v.AuxInt = boolToAuxInt(true)
10732                         return true
10733                 }
10734                 break
10735         }
10736         // match: (IsInBounds (And32 (Const32 [c]) _) (Const32 [d]))
10737         // cond: 0 <= c && c < d
10738         // result: (ConstBool [true])
10739         for {
10740                 if v_0.Op != OpAnd32 {
10741                         break
10742                 }
10743                 v_0_0 := v_0.Args[0]
10744                 v_0_1 := v_0.Args[1]
10745                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
10746                         if v_0_0.Op != OpConst32 {
10747                                 continue
10748                         }
10749                         c := auxIntToInt32(v_0_0.AuxInt)
10750                         if v_1.Op != OpConst32 {
10751                                 continue
10752                         }
10753                         d := auxIntToInt32(v_1.AuxInt)
10754                         if !(0 <= c && c < d) {
10755                                 continue
10756                         }
10757                         v.reset(OpConstBool)
10758                         v.AuxInt = boolToAuxInt(true)
10759                         return true
10760                 }
10761                 break
10762         }
10763         // match: (IsInBounds (ZeroExt32to64 (And32 (Const32 [c]) _)) (Const64 [d]))
10764         // cond: 0 <= c && int64(c) < d
10765         // result: (ConstBool [true])
10766         for {
10767                 if v_0.Op != OpZeroExt32to64 {
10768                         break
10769                 }
10770                 v_0_0 := v_0.Args[0]
10771                 if v_0_0.Op != OpAnd32 {
10772                         break
10773                 }
10774                 v_0_0_0 := v_0_0.Args[0]
10775                 v_0_0_1 := v_0_0.Args[1]
10776                 for _i0 := 0; _i0 <= 1; _i0, v_0_0_0, v_0_0_1 = _i0+1, v_0_0_1, v_0_0_0 {
10777                         if v_0_0_0.Op != OpConst32 {
10778                                 continue
10779                         }
10780                         c := auxIntToInt32(v_0_0_0.AuxInt)
10781                         if v_1.Op != OpConst64 {
10782                                 continue
10783                         }
10784                         d := auxIntToInt64(v_1.AuxInt)
10785                         if !(0 <= c && int64(c) < d) {
10786                                 continue
10787                         }
10788                         v.reset(OpConstBool)
10789                         v.AuxInt = boolToAuxInt(true)
10790                         return true
10791                 }
10792                 break
10793         }
10794         // match: (IsInBounds (And64 (Const64 [c]) _) (Const64 [d]))
10795         // cond: 0 <= c && c < d
10796         // result: (ConstBool [true])
10797         for {
10798                 if v_0.Op != OpAnd64 {
10799                         break
10800                 }
10801                 v_0_0 := v_0.Args[0]
10802                 v_0_1 := v_0.Args[1]
10803                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
10804                         if v_0_0.Op != OpConst64 {
10805                                 continue
10806                         }
10807                         c := auxIntToInt64(v_0_0.AuxInt)
10808                         if v_1.Op != OpConst64 {
10809                                 continue
10810                         }
10811                         d := auxIntToInt64(v_1.AuxInt)
10812                         if !(0 <= c && c < d) {
10813                                 continue
10814                         }
10815                         v.reset(OpConstBool)
10816                         v.AuxInt = boolToAuxInt(true)
10817                         return true
10818                 }
10819                 break
10820         }
10821         // match: (IsInBounds (Const32 [c]) (Const32 [d]))
10822         // result: (ConstBool [0 <= c && c < d])
10823         for {
10824                 if v_0.Op != OpConst32 {
10825                         break
10826                 }
10827                 c := auxIntToInt32(v_0.AuxInt)
10828                 if v_1.Op != OpConst32 {
10829                         break
10830                 }
10831                 d := auxIntToInt32(v_1.AuxInt)
10832                 v.reset(OpConstBool)
10833                 v.AuxInt = boolToAuxInt(0 <= c && c < d)
10834                 return true
10835         }
10836         // match: (IsInBounds (Const64 [c]) (Const64 [d]))
10837         // result: (ConstBool [0 <= c && c < d])
10838         for {
10839                 if v_0.Op != OpConst64 {
10840                         break
10841                 }
10842                 c := auxIntToInt64(v_0.AuxInt)
10843                 if v_1.Op != OpConst64 {
10844                         break
10845                 }
10846                 d := auxIntToInt64(v_1.AuxInt)
10847                 v.reset(OpConstBool)
10848                 v.AuxInt = boolToAuxInt(0 <= c && c < d)
10849                 return true
10850         }
10851         // match: (IsInBounds (Mod32u _ y) y)
10852         // result: (ConstBool [true])
10853         for {
10854                 if v_0.Op != OpMod32u {
10855                         break
10856                 }
10857                 y := v_0.Args[1]
10858                 if y != v_1 {
10859                         break
10860                 }
10861                 v.reset(OpConstBool)
10862                 v.AuxInt = boolToAuxInt(true)
10863                 return true
10864         }
10865         // match: (IsInBounds (Mod64u _ y) y)
10866         // result: (ConstBool [true])
10867         for {
10868                 if v_0.Op != OpMod64u {
10869                         break
10870                 }
10871                 y := v_0.Args[1]
10872                 if y != v_1 {
10873                         break
10874                 }
10875                 v.reset(OpConstBool)
10876                 v.AuxInt = boolToAuxInt(true)
10877                 return true
10878         }
10879         // match: (IsInBounds (ZeroExt8to64 (Rsh8Ux64 _ (Const64 [c]))) (Const64 [d]))
10880         // cond: 0 < c && c < 8 && 1<<uint( 8-c)-1 < d
10881         // result: (ConstBool [true])
10882         for {
10883                 if v_0.Op != OpZeroExt8to64 {
10884                         break
10885                 }
10886                 v_0_0 := v_0.Args[0]
10887                 if v_0_0.Op != OpRsh8Ux64 {
10888                         break
10889                 }
10890                 _ = v_0_0.Args[1]
10891                 v_0_0_1 := v_0_0.Args[1]
10892                 if v_0_0_1.Op != OpConst64 {
10893                         break
10894                 }
10895                 c := auxIntToInt64(v_0_0_1.AuxInt)
10896                 if v_1.Op != OpConst64 {
10897                         break
10898                 }
10899                 d := auxIntToInt64(v_1.AuxInt)
10900                 if !(0 < c && c < 8 && 1<<uint(8-c)-1 < d) {
10901                         break
10902                 }
10903                 v.reset(OpConstBool)
10904                 v.AuxInt = boolToAuxInt(true)
10905                 return true
10906         }
10907         // match: (IsInBounds (ZeroExt8to32 (Rsh8Ux64 _ (Const64 [c]))) (Const32 [d]))
10908         // cond: 0 < c && c < 8 && 1<<uint( 8-c)-1 < d
10909         // result: (ConstBool [true])
10910         for {
10911                 if v_0.Op != OpZeroExt8to32 {
10912                         break
10913                 }
10914                 v_0_0 := v_0.Args[0]
10915                 if v_0_0.Op != OpRsh8Ux64 {
10916                         break
10917                 }
10918                 _ = v_0_0.Args[1]
10919                 v_0_0_1 := v_0_0.Args[1]
10920                 if v_0_0_1.Op != OpConst64 {
10921                         break
10922                 }
10923                 c := auxIntToInt64(v_0_0_1.AuxInt)
10924                 if v_1.Op != OpConst32 {
10925                         break
10926                 }
10927                 d := auxIntToInt32(v_1.AuxInt)
10928                 if !(0 < c && c < 8 && 1<<uint(8-c)-1 < d) {
10929                         break
10930                 }
10931                 v.reset(OpConstBool)
10932                 v.AuxInt = boolToAuxInt(true)
10933                 return true
10934         }
10935         // match: (IsInBounds (ZeroExt8to16 (Rsh8Ux64 _ (Const64 [c]))) (Const16 [d]))
10936         // cond: 0 < c && c < 8 && 1<<uint( 8-c)-1 < d
10937         // result: (ConstBool [true])
10938         for {
10939                 if v_0.Op != OpZeroExt8to16 {
10940                         break
10941                 }
10942                 v_0_0 := v_0.Args[0]
10943                 if v_0_0.Op != OpRsh8Ux64 {
10944                         break
10945                 }
10946                 _ = v_0_0.Args[1]
10947                 v_0_0_1 := v_0_0.Args[1]
10948                 if v_0_0_1.Op != OpConst64 {
10949                         break
10950                 }
10951                 c := auxIntToInt64(v_0_0_1.AuxInt)
10952                 if v_1.Op != OpConst16 {
10953                         break
10954                 }
10955                 d := auxIntToInt16(v_1.AuxInt)
10956                 if !(0 < c && c < 8 && 1<<uint(8-c)-1 < d) {
10957                         break
10958                 }
10959                 v.reset(OpConstBool)
10960                 v.AuxInt = boolToAuxInt(true)
10961                 return true
10962         }
10963         // match: (IsInBounds (Rsh8Ux64 _ (Const64 [c])) (Const64 [d]))
10964         // cond: 0 < c && c < 8 && 1<<uint( 8-c)-1 < d
10965         // result: (ConstBool [true])
10966         for {
10967                 if v_0.Op != OpRsh8Ux64 {
10968                         break
10969                 }
10970                 _ = v_0.Args[1]
10971                 v_0_1 := v_0.Args[1]
10972                 if v_0_1.Op != OpConst64 {
10973                         break
10974                 }
10975                 c := auxIntToInt64(v_0_1.AuxInt)
10976                 if v_1.Op != OpConst64 {
10977                         break
10978                 }
10979                 d := auxIntToInt64(v_1.AuxInt)
10980                 if !(0 < c && c < 8 && 1<<uint(8-c)-1 < d) {
10981                         break
10982                 }
10983                 v.reset(OpConstBool)
10984                 v.AuxInt = boolToAuxInt(true)
10985                 return true
10986         }
10987         // match: (IsInBounds (ZeroExt16to64 (Rsh16Ux64 _ (Const64 [c]))) (Const64 [d]))
10988         // cond: 0 < c && c < 16 && 1<<uint(16-c)-1 < d
10989         // result: (ConstBool [true])
10990         for {
10991                 if v_0.Op != OpZeroExt16to64 {
10992                         break
10993                 }
10994                 v_0_0 := v_0.Args[0]
10995                 if v_0_0.Op != OpRsh16Ux64 {
10996                         break
10997                 }
10998                 _ = v_0_0.Args[1]
10999                 v_0_0_1 := v_0_0.Args[1]
11000                 if v_0_0_1.Op != OpConst64 {
11001                         break
11002                 }
11003                 c := auxIntToInt64(v_0_0_1.AuxInt)
11004                 if v_1.Op != OpConst64 {
11005                         break
11006                 }
11007                 d := auxIntToInt64(v_1.AuxInt)
11008                 if !(0 < c && c < 16 && 1<<uint(16-c)-1 < d) {
11009                         break
11010                 }
11011                 v.reset(OpConstBool)
11012                 v.AuxInt = boolToAuxInt(true)
11013                 return true
11014         }
11015         // match: (IsInBounds (ZeroExt16to32 (Rsh16Ux64 _ (Const64 [c]))) (Const64 [d]))
11016         // cond: 0 < c && c < 16 && 1<<uint(16-c)-1 < d
11017         // result: (ConstBool [true])
11018         for {
11019                 if v_0.Op != OpZeroExt16to32 {
11020                         break
11021                 }
11022                 v_0_0 := v_0.Args[0]
11023                 if v_0_0.Op != OpRsh16Ux64 {
11024                         break
11025                 }
11026                 _ = v_0_0.Args[1]
11027                 v_0_0_1 := v_0_0.Args[1]
11028                 if v_0_0_1.Op != OpConst64 {
11029                         break
11030                 }
11031                 c := auxIntToInt64(v_0_0_1.AuxInt)
11032                 if v_1.Op != OpConst64 {
11033                         break
11034                 }
11035                 d := auxIntToInt64(v_1.AuxInt)
11036                 if !(0 < c && c < 16 && 1<<uint(16-c)-1 < d) {
11037                         break
11038                 }
11039                 v.reset(OpConstBool)
11040                 v.AuxInt = boolToAuxInt(true)
11041                 return true
11042         }
11043         // match: (IsInBounds (Rsh16Ux64 _ (Const64 [c])) (Const64 [d]))
11044         // cond: 0 < c && c < 16 && 1<<uint(16-c)-1 < d
11045         // result: (ConstBool [true])
11046         for {
11047                 if v_0.Op != OpRsh16Ux64 {
11048                         break
11049                 }
11050                 _ = v_0.Args[1]
11051                 v_0_1 := v_0.Args[1]
11052                 if v_0_1.Op != OpConst64 {
11053                         break
11054                 }
11055                 c := auxIntToInt64(v_0_1.AuxInt)
11056                 if v_1.Op != OpConst64 {
11057                         break
11058                 }
11059                 d := auxIntToInt64(v_1.AuxInt)
11060                 if !(0 < c && c < 16 && 1<<uint(16-c)-1 < d) {
11061                         break
11062                 }
11063                 v.reset(OpConstBool)
11064                 v.AuxInt = boolToAuxInt(true)
11065                 return true
11066         }
11067         // match: (IsInBounds (ZeroExt32to64 (Rsh32Ux64 _ (Const64 [c]))) (Const64 [d]))
11068         // cond: 0 < c && c < 32 && 1<<uint(32-c)-1 < d
11069         // result: (ConstBool [true])
11070         for {
11071                 if v_0.Op != OpZeroExt32to64 {
11072                         break
11073                 }
11074                 v_0_0 := v_0.Args[0]
11075                 if v_0_0.Op != OpRsh32Ux64 {
11076                         break
11077                 }
11078                 _ = v_0_0.Args[1]
11079                 v_0_0_1 := v_0_0.Args[1]
11080                 if v_0_0_1.Op != OpConst64 {
11081                         break
11082                 }
11083                 c := auxIntToInt64(v_0_0_1.AuxInt)
11084                 if v_1.Op != OpConst64 {
11085                         break
11086                 }
11087                 d := auxIntToInt64(v_1.AuxInt)
11088                 if !(0 < c && c < 32 && 1<<uint(32-c)-1 < d) {
11089                         break
11090                 }
11091                 v.reset(OpConstBool)
11092                 v.AuxInt = boolToAuxInt(true)
11093                 return true
11094         }
11095         // match: (IsInBounds (Rsh32Ux64 _ (Const64 [c])) (Const64 [d]))
11096         // cond: 0 < c && c < 32 && 1<<uint(32-c)-1 < d
11097         // result: (ConstBool [true])
11098         for {
11099                 if v_0.Op != OpRsh32Ux64 {
11100                         break
11101                 }
11102                 _ = v_0.Args[1]
11103                 v_0_1 := v_0.Args[1]
11104                 if v_0_1.Op != OpConst64 {
11105                         break
11106                 }
11107                 c := auxIntToInt64(v_0_1.AuxInt)
11108                 if v_1.Op != OpConst64 {
11109                         break
11110                 }
11111                 d := auxIntToInt64(v_1.AuxInt)
11112                 if !(0 < c && c < 32 && 1<<uint(32-c)-1 < d) {
11113                         break
11114                 }
11115                 v.reset(OpConstBool)
11116                 v.AuxInt = boolToAuxInt(true)
11117                 return true
11118         }
11119         // match: (IsInBounds (Rsh64Ux64 _ (Const64 [c])) (Const64 [d]))
11120         // cond: 0 < c && c < 64 && 1<<uint(64-c)-1 < d
11121         // result: (ConstBool [true])
11122         for {
11123                 if v_0.Op != OpRsh64Ux64 {
11124                         break
11125                 }
11126                 _ = v_0.Args[1]
11127                 v_0_1 := v_0.Args[1]
11128                 if v_0_1.Op != OpConst64 {
11129                         break
11130                 }
11131                 c := auxIntToInt64(v_0_1.AuxInt)
11132                 if v_1.Op != OpConst64 {
11133                         break
11134                 }
11135                 d := auxIntToInt64(v_1.AuxInt)
11136                 if !(0 < c && c < 64 && 1<<uint(64-c)-1 < d) {
11137                         break
11138                 }
11139                 v.reset(OpConstBool)
11140                 v.AuxInt = boolToAuxInt(true)
11141                 return true
11142         }
11143         return false
11144 }
11145 func rewriteValuegeneric_OpIsNonNil(v *Value) bool {
11146         v_0 := v.Args[0]
11147         // match: (IsNonNil (ConstNil))
11148         // result: (ConstBool [false])
11149         for {
11150                 if v_0.Op != OpConstNil {
11151                         break
11152                 }
11153                 v.reset(OpConstBool)
11154                 v.AuxInt = boolToAuxInt(false)
11155                 return true
11156         }
11157         // match: (IsNonNil (Const32 [c]))
11158         // result: (ConstBool [c != 0])
11159         for {
11160                 if v_0.Op != OpConst32 {
11161                         break
11162                 }
11163                 c := auxIntToInt32(v_0.AuxInt)
11164                 v.reset(OpConstBool)
11165                 v.AuxInt = boolToAuxInt(c != 0)
11166                 return true
11167         }
11168         // match: (IsNonNil (Const64 [c]))
11169         // result: (ConstBool [c != 0])
11170         for {
11171                 if v_0.Op != OpConst64 {
11172                         break
11173                 }
11174                 c := auxIntToInt64(v_0.AuxInt)
11175                 v.reset(OpConstBool)
11176                 v.AuxInt = boolToAuxInt(c != 0)
11177                 return true
11178         }
11179         // match: (IsNonNil (Addr _) )
11180         // result: (ConstBool [true])
11181         for {
11182                 if v_0.Op != OpAddr {
11183                         break
11184                 }
11185                 v.reset(OpConstBool)
11186                 v.AuxInt = boolToAuxInt(true)
11187                 return true
11188         }
11189         // match: (IsNonNil (Convert (Addr _) _))
11190         // result: (ConstBool [true])
11191         for {
11192                 if v_0.Op != OpConvert {
11193                         break
11194                 }
11195                 v_0_0 := v_0.Args[0]
11196                 if v_0_0.Op != OpAddr {
11197                         break
11198                 }
11199                 v.reset(OpConstBool)
11200                 v.AuxInt = boolToAuxInt(true)
11201                 return true
11202         }
11203         // match: (IsNonNil (LocalAddr _ _))
11204         // result: (ConstBool [true])
11205         for {
11206                 if v_0.Op != OpLocalAddr {
11207                         break
11208                 }
11209                 v.reset(OpConstBool)
11210                 v.AuxInt = boolToAuxInt(true)
11211                 return true
11212         }
11213         return false
11214 }
11215 func rewriteValuegeneric_OpIsSliceInBounds(v *Value) bool {
11216         v_1 := v.Args[1]
11217         v_0 := v.Args[0]
11218         // match: (IsSliceInBounds x x)
11219         // result: (ConstBool [true])
11220         for {
11221                 x := v_0
11222                 if x != v_1 {
11223                         break
11224                 }
11225                 v.reset(OpConstBool)
11226                 v.AuxInt = boolToAuxInt(true)
11227                 return true
11228         }
11229         // match: (IsSliceInBounds (And32 (Const32 [c]) _) (Const32 [d]))
11230         // cond: 0 <= c && c <= d
11231         // result: (ConstBool [true])
11232         for {
11233                 if v_0.Op != OpAnd32 {
11234                         break
11235                 }
11236                 v_0_0 := v_0.Args[0]
11237                 v_0_1 := v_0.Args[1]
11238                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
11239                         if v_0_0.Op != OpConst32 {
11240                                 continue
11241                         }
11242                         c := auxIntToInt32(v_0_0.AuxInt)
11243                         if v_1.Op != OpConst32 {
11244                                 continue
11245                         }
11246                         d := auxIntToInt32(v_1.AuxInt)
11247                         if !(0 <= c && c <= d) {
11248                                 continue
11249                         }
11250                         v.reset(OpConstBool)
11251                         v.AuxInt = boolToAuxInt(true)
11252                         return true
11253                 }
11254                 break
11255         }
11256         // match: (IsSliceInBounds (And64 (Const64 [c]) _) (Const64 [d]))
11257         // cond: 0 <= c && c <= d
11258         // result: (ConstBool [true])
11259         for {
11260                 if v_0.Op != OpAnd64 {
11261                         break
11262                 }
11263                 v_0_0 := v_0.Args[0]
11264                 v_0_1 := v_0.Args[1]
11265                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
11266                         if v_0_0.Op != OpConst64 {
11267                                 continue
11268                         }
11269                         c := auxIntToInt64(v_0_0.AuxInt)
11270                         if v_1.Op != OpConst64 {
11271                                 continue
11272                         }
11273                         d := auxIntToInt64(v_1.AuxInt)
11274                         if !(0 <= c && c <= d) {
11275                                 continue
11276                         }
11277                         v.reset(OpConstBool)
11278                         v.AuxInt = boolToAuxInt(true)
11279                         return true
11280                 }
11281                 break
11282         }
11283         // match: (IsSliceInBounds (Const32 [0]) _)
11284         // result: (ConstBool [true])
11285         for {
11286                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
11287                         break
11288                 }
11289                 v.reset(OpConstBool)
11290                 v.AuxInt = boolToAuxInt(true)
11291                 return true
11292         }
11293         // match: (IsSliceInBounds (Const64 [0]) _)
11294         // result: (ConstBool [true])
11295         for {
11296                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
11297                         break
11298                 }
11299                 v.reset(OpConstBool)
11300                 v.AuxInt = boolToAuxInt(true)
11301                 return true
11302         }
11303         // match: (IsSliceInBounds (Const32 [c]) (Const32 [d]))
11304         // result: (ConstBool [0 <= c && c <= d])
11305         for {
11306                 if v_0.Op != OpConst32 {
11307                         break
11308                 }
11309                 c := auxIntToInt32(v_0.AuxInt)
11310                 if v_1.Op != OpConst32 {
11311                         break
11312                 }
11313                 d := auxIntToInt32(v_1.AuxInt)
11314                 v.reset(OpConstBool)
11315                 v.AuxInt = boolToAuxInt(0 <= c && c <= d)
11316                 return true
11317         }
11318         // match: (IsSliceInBounds (Const64 [c]) (Const64 [d]))
11319         // result: (ConstBool [0 <= c && c <= d])
11320         for {
11321                 if v_0.Op != OpConst64 {
11322                         break
11323                 }
11324                 c := auxIntToInt64(v_0.AuxInt)
11325                 if v_1.Op != OpConst64 {
11326                         break
11327                 }
11328                 d := auxIntToInt64(v_1.AuxInt)
11329                 v.reset(OpConstBool)
11330                 v.AuxInt = boolToAuxInt(0 <= c && c <= d)
11331                 return true
11332         }
11333         // match: (IsSliceInBounds (SliceLen x) (SliceCap x))
11334         // result: (ConstBool [true])
11335         for {
11336                 if v_0.Op != OpSliceLen {
11337                         break
11338                 }
11339                 x := v_0.Args[0]
11340                 if v_1.Op != OpSliceCap || x != v_1.Args[0] {
11341                         break
11342                 }
11343                 v.reset(OpConstBool)
11344                 v.AuxInt = boolToAuxInt(true)
11345                 return true
11346         }
11347         return false
11348 }
11349 func rewriteValuegeneric_OpLeq16(v *Value) bool {
11350         v_1 := v.Args[1]
11351         v_0 := v.Args[0]
11352         b := v.Block
11353         // match: (Leq16 (Const16 [c]) (Const16 [d]))
11354         // result: (ConstBool [c <= d])
11355         for {
11356                 if v_0.Op != OpConst16 {
11357                         break
11358                 }
11359                 c := auxIntToInt16(v_0.AuxInt)
11360                 if v_1.Op != OpConst16 {
11361                         break
11362                 }
11363                 d := auxIntToInt16(v_1.AuxInt)
11364                 v.reset(OpConstBool)
11365                 v.AuxInt = boolToAuxInt(c <= d)
11366                 return true
11367         }
11368         // match: (Leq16 (Const16 [0]) (And16 _ (Const16 [c])))
11369         // cond: c >= 0
11370         // result: (ConstBool [true])
11371         for {
11372                 if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 || v_1.Op != OpAnd16 {
11373                         break
11374                 }
11375                 _ = v_1.Args[1]
11376                 v_1_0 := v_1.Args[0]
11377                 v_1_1 := v_1.Args[1]
11378                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
11379                         if v_1_1.Op != OpConst16 {
11380                                 continue
11381                         }
11382                         c := auxIntToInt16(v_1_1.AuxInt)
11383                         if !(c >= 0) {
11384                                 continue
11385                         }
11386                         v.reset(OpConstBool)
11387                         v.AuxInt = boolToAuxInt(true)
11388                         return true
11389                 }
11390                 break
11391         }
11392         // match: (Leq16 (Const16 [0]) (Rsh16Ux64 _ (Const64 [c])))
11393         // cond: c > 0
11394         // result: (ConstBool [true])
11395         for {
11396                 if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 || v_1.Op != OpRsh16Ux64 {
11397                         break
11398                 }
11399                 _ = v_1.Args[1]
11400                 v_1_1 := v_1.Args[1]
11401                 if v_1_1.Op != OpConst64 {
11402                         break
11403                 }
11404                 c := auxIntToInt64(v_1_1.AuxInt)
11405                 if !(c > 0) {
11406                         break
11407                 }
11408                 v.reset(OpConstBool)
11409                 v.AuxInt = boolToAuxInt(true)
11410                 return true
11411         }
11412         // match: (Leq16 x (Const16 <t> [-1]))
11413         // result: (Less16 x (Const16 <t> [0]))
11414         for {
11415                 x := v_0
11416                 if v_1.Op != OpConst16 {
11417                         break
11418                 }
11419                 t := v_1.Type
11420                 if auxIntToInt16(v_1.AuxInt) != -1 {
11421                         break
11422                 }
11423                 v.reset(OpLess16)
11424                 v0 := b.NewValue0(v.Pos, OpConst16, t)
11425                 v0.AuxInt = int16ToAuxInt(0)
11426                 v.AddArg2(x, v0)
11427                 return true
11428         }
11429         // match: (Leq16 (Const16 <t> [1]) x)
11430         // result: (Less16 (Const16 <t> [0]) x)
11431         for {
11432                 if v_0.Op != OpConst16 {
11433                         break
11434                 }
11435                 t := v_0.Type
11436                 if auxIntToInt16(v_0.AuxInt) != 1 {
11437                         break
11438                 }
11439                 x := v_1
11440                 v.reset(OpLess16)
11441                 v0 := b.NewValue0(v.Pos, OpConst16, t)
11442                 v0.AuxInt = int16ToAuxInt(0)
11443                 v.AddArg2(v0, x)
11444                 return true
11445         }
11446         return false
11447 }
11448 func rewriteValuegeneric_OpLeq16U(v *Value) bool {
11449         v_1 := v.Args[1]
11450         v_0 := v.Args[0]
11451         b := v.Block
11452         // match: (Leq16U (Const16 [c]) (Const16 [d]))
11453         // result: (ConstBool [uint16(c) <= uint16(d)])
11454         for {
11455                 if v_0.Op != OpConst16 {
11456                         break
11457                 }
11458                 c := auxIntToInt16(v_0.AuxInt)
11459                 if v_1.Op != OpConst16 {
11460                         break
11461                 }
11462                 d := auxIntToInt16(v_1.AuxInt)
11463                 v.reset(OpConstBool)
11464                 v.AuxInt = boolToAuxInt(uint16(c) <= uint16(d))
11465                 return true
11466         }
11467         // match: (Leq16U (Const16 <t> [1]) x)
11468         // result: (Neq16 (Const16 <t> [0]) x)
11469         for {
11470                 if v_0.Op != OpConst16 {
11471                         break
11472                 }
11473                 t := v_0.Type
11474                 if auxIntToInt16(v_0.AuxInt) != 1 {
11475                         break
11476                 }
11477                 x := v_1
11478                 v.reset(OpNeq16)
11479                 v0 := b.NewValue0(v.Pos, OpConst16, t)
11480                 v0.AuxInt = int16ToAuxInt(0)
11481                 v.AddArg2(v0, x)
11482                 return true
11483         }
11484         // match: (Leq16U (Const16 [0]) _)
11485         // result: (ConstBool [true])
11486         for {
11487                 if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
11488                         break
11489                 }
11490                 v.reset(OpConstBool)
11491                 v.AuxInt = boolToAuxInt(true)
11492                 return true
11493         }
11494         return false
11495 }
11496 func rewriteValuegeneric_OpLeq32(v *Value) bool {
11497         v_1 := v.Args[1]
11498         v_0 := v.Args[0]
11499         b := v.Block
11500         // match: (Leq32 (Const32 [c]) (Const32 [d]))
11501         // result: (ConstBool [c <= d])
11502         for {
11503                 if v_0.Op != OpConst32 {
11504                         break
11505                 }
11506                 c := auxIntToInt32(v_0.AuxInt)
11507                 if v_1.Op != OpConst32 {
11508                         break
11509                 }
11510                 d := auxIntToInt32(v_1.AuxInt)
11511                 v.reset(OpConstBool)
11512                 v.AuxInt = boolToAuxInt(c <= d)
11513                 return true
11514         }
11515         // match: (Leq32 (Const32 [0]) (And32 _ (Const32 [c])))
11516         // cond: c >= 0
11517         // result: (ConstBool [true])
11518         for {
11519                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 || v_1.Op != OpAnd32 {
11520                         break
11521                 }
11522                 _ = v_1.Args[1]
11523                 v_1_0 := v_1.Args[0]
11524                 v_1_1 := v_1.Args[1]
11525                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
11526                         if v_1_1.Op != OpConst32 {
11527                                 continue
11528                         }
11529                         c := auxIntToInt32(v_1_1.AuxInt)
11530                         if !(c >= 0) {
11531                                 continue
11532                         }
11533                         v.reset(OpConstBool)
11534                         v.AuxInt = boolToAuxInt(true)
11535                         return true
11536                 }
11537                 break
11538         }
11539         // match: (Leq32 (Const32 [0]) (Rsh32Ux64 _ (Const64 [c])))
11540         // cond: c > 0
11541         // result: (ConstBool [true])
11542         for {
11543                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 || v_1.Op != OpRsh32Ux64 {
11544                         break
11545                 }
11546                 _ = v_1.Args[1]
11547                 v_1_1 := v_1.Args[1]
11548                 if v_1_1.Op != OpConst64 {
11549                         break
11550                 }
11551                 c := auxIntToInt64(v_1_1.AuxInt)
11552                 if !(c > 0) {
11553                         break
11554                 }
11555                 v.reset(OpConstBool)
11556                 v.AuxInt = boolToAuxInt(true)
11557                 return true
11558         }
11559         // match: (Leq32 x (Const32 <t> [-1]))
11560         // result: (Less32 x (Const32 <t> [0]))
11561         for {
11562                 x := v_0
11563                 if v_1.Op != OpConst32 {
11564                         break
11565                 }
11566                 t := v_1.Type
11567                 if auxIntToInt32(v_1.AuxInt) != -1 {
11568                         break
11569                 }
11570                 v.reset(OpLess32)
11571                 v0 := b.NewValue0(v.Pos, OpConst32, t)
11572                 v0.AuxInt = int32ToAuxInt(0)
11573                 v.AddArg2(x, v0)
11574                 return true
11575         }
11576         // match: (Leq32 (Const32 <t> [1]) x)
11577         // result: (Less32 (Const32 <t> [0]) x)
11578         for {
11579                 if v_0.Op != OpConst32 {
11580                         break
11581                 }
11582                 t := v_0.Type
11583                 if auxIntToInt32(v_0.AuxInt) != 1 {
11584                         break
11585                 }
11586                 x := v_1
11587                 v.reset(OpLess32)
11588                 v0 := b.NewValue0(v.Pos, OpConst32, t)
11589                 v0.AuxInt = int32ToAuxInt(0)
11590                 v.AddArg2(v0, x)
11591                 return true
11592         }
11593         return false
11594 }
11595 func rewriteValuegeneric_OpLeq32F(v *Value) bool {
11596         v_1 := v.Args[1]
11597         v_0 := v.Args[0]
11598         // match: (Leq32F (Const32F [c]) (Const32F [d]))
11599         // result: (ConstBool [c <= d])
11600         for {
11601                 if v_0.Op != OpConst32F {
11602                         break
11603                 }
11604                 c := auxIntToFloat32(v_0.AuxInt)
11605                 if v_1.Op != OpConst32F {
11606                         break
11607                 }
11608                 d := auxIntToFloat32(v_1.AuxInt)
11609                 v.reset(OpConstBool)
11610                 v.AuxInt = boolToAuxInt(c <= d)
11611                 return true
11612         }
11613         return false
11614 }
11615 func rewriteValuegeneric_OpLeq32U(v *Value) bool {
11616         v_1 := v.Args[1]
11617         v_0 := v.Args[0]
11618         b := v.Block
11619         // match: (Leq32U (Const32 [c]) (Const32 [d]))
11620         // result: (ConstBool [uint32(c) <= uint32(d)])
11621         for {
11622                 if v_0.Op != OpConst32 {
11623                         break
11624                 }
11625                 c := auxIntToInt32(v_0.AuxInt)
11626                 if v_1.Op != OpConst32 {
11627                         break
11628                 }
11629                 d := auxIntToInt32(v_1.AuxInt)
11630                 v.reset(OpConstBool)
11631                 v.AuxInt = boolToAuxInt(uint32(c) <= uint32(d))
11632                 return true
11633         }
11634         // match: (Leq32U (Const32 <t> [1]) x)
11635         // result: (Neq32 (Const32 <t> [0]) x)
11636         for {
11637                 if v_0.Op != OpConst32 {
11638                         break
11639                 }
11640                 t := v_0.Type
11641                 if auxIntToInt32(v_0.AuxInt) != 1 {
11642                         break
11643                 }
11644                 x := v_1
11645                 v.reset(OpNeq32)
11646                 v0 := b.NewValue0(v.Pos, OpConst32, t)
11647                 v0.AuxInt = int32ToAuxInt(0)
11648                 v.AddArg2(v0, x)
11649                 return true
11650         }
11651         // match: (Leq32U (Const32 [0]) _)
11652         // result: (ConstBool [true])
11653         for {
11654                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
11655                         break
11656                 }
11657                 v.reset(OpConstBool)
11658                 v.AuxInt = boolToAuxInt(true)
11659                 return true
11660         }
11661         return false
11662 }
11663 func rewriteValuegeneric_OpLeq64(v *Value) bool {
11664         v_1 := v.Args[1]
11665         v_0 := v.Args[0]
11666         b := v.Block
11667         // match: (Leq64 (Const64 [c]) (Const64 [d]))
11668         // result: (ConstBool [c <= d])
11669         for {
11670                 if v_0.Op != OpConst64 {
11671                         break
11672                 }
11673                 c := auxIntToInt64(v_0.AuxInt)
11674                 if v_1.Op != OpConst64 {
11675                         break
11676                 }
11677                 d := auxIntToInt64(v_1.AuxInt)
11678                 v.reset(OpConstBool)
11679                 v.AuxInt = boolToAuxInt(c <= d)
11680                 return true
11681         }
11682         // match: (Leq64 (Const64 [0]) (And64 _ (Const64 [c])))
11683         // cond: c >= 0
11684         // result: (ConstBool [true])
11685         for {
11686                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 || v_1.Op != OpAnd64 {
11687                         break
11688                 }
11689                 _ = v_1.Args[1]
11690                 v_1_0 := v_1.Args[0]
11691                 v_1_1 := v_1.Args[1]
11692                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
11693                         if v_1_1.Op != OpConst64 {
11694                                 continue
11695                         }
11696                         c := auxIntToInt64(v_1_1.AuxInt)
11697                         if !(c >= 0) {
11698                                 continue
11699                         }
11700                         v.reset(OpConstBool)
11701                         v.AuxInt = boolToAuxInt(true)
11702                         return true
11703                 }
11704                 break
11705         }
11706         // match: (Leq64 (Const64 [0]) (Rsh64Ux64 _ (Const64 [c])))
11707         // cond: c > 0
11708         // result: (ConstBool [true])
11709         for {
11710                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 || v_1.Op != OpRsh64Ux64 {
11711                         break
11712                 }
11713                 _ = v_1.Args[1]
11714                 v_1_1 := v_1.Args[1]
11715                 if v_1_1.Op != OpConst64 {
11716                         break
11717                 }
11718                 c := auxIntToInt64(v_1_1.AuxInt)
11719                 if !(c > 0) {
11720                         break
11721                 }
11722                 v.reset(OpConstBool)
11723                 v.AuxInt = boolToAuxInt(true)
11724                 return true
11725         }
11726         // match: (Leq64 x (Const64 <t> [-1]))
11727         // result: (Less64 x (Const64 <t> [0]))
11728         for {
11729                 x := v_0
11730                 if v_1.Op != OpConst64 {
11731                         break
11732                 }
11733                 t := v_1.Type
11734                 if auxIntToInt64(v_1.AuxInt) != -1 {
11735                         break
11736                 }
11737                 v.reset(OpLess64)
11738                 v0 := b.NewValue0(v.Pos, OpConst64, t)
11739                 v0.AuxInt = int64ToAuxInt(0)
11740                 v.AddArg2(x, v0)
11741                 return true
11742         }
11743         // match: (Leq64 (Const64 <t> [1]) x)
11744         // result: (Less64 (Const64 <t> [0]) x)
11745         for {
11746                 if v_0.Op != OpConst64 {
11747                         break
11748                 }
11749                 t := v_0.Type
11750                 if auxIntToInt64(v_0.AuxInt) != 1 {
11751                         break
11752                 }
11753                 x := v_1
11754                 v.reset(OpLess64)
11755                 v0 := b.NewValue0(v.Pos, OpConst64, t)
11756                 v0.AuxInt = int64ToAuxInt(0)
11757                 v.AddArg2(v0, x)
11758                 return true
11759         }
11760         return false
11761 }
11762 func rewriteValuegeneric_OpLeq64F(v *Value) bool {
11763         v_1 := v.Args[1]
11764         v_0 := v.Args[0]
11765         // match: (Leq64F (Const64F [c]) (Const64F [d]))
11766         // result: (ConstBool [c <= d])
11767         for {
11768                 if v_0.Op != OpConst64F {
11769                         break
11770                 }
11771                 c := auxIntToFloat64(v_0.AuxInt)
11772                 if v_1.Op != OpConst64F {
11773                         break
11774                 }
11775                 d := auxIntToFloat64(v_1.AuxInt)
11776                 v.reset(OpConstBool)
11777                 v.AuxInt = boolToAuxInt(c <= d)
11778                 return true
11779         }
11780         return false
11781 }
11782 func rewriteValuegeneric_OpLeq64U(v *Value) bool {
11783         v_1 := v.Args[1]
11784         v_0 := v.Args[0]
11785         b := v.Block
11786         // match: (Leq64U (Const64 [c]) (Const64 [d]))
11787         // result: (ConstBool [uint64(c) <= uint64(d)])
11788         for {
11789                 if v_0.Op != OpConst64 {
11790                         break
11791                 }
11792                 c := auxIntToInt64(v_0.AuxInt)
11793                 if v_1.Op != OpConst64 {
11794                         break
11795                 }
11796                 d := auxIntToInt64(v_1.AuxInt)
11797                 v.reset(OpConstBool)
11798                 v.AuxInt = boolToAuxInt(uint64(c) <= uint64(d))
11799                 return true
11800         }
11801         // match: (Leq64U (Const64 <t> [1]) x)
11802         // result: (Neq64 (Const64 <t> [0]) x)
11803         for {
11804                 if v_0.Op != OpConst64 {
11805                         break
11806                 }
11807                 t := v_0.Type
11808                 if auxIntToInt64(v_0.AuxInt) != 1 {
11809                         break
11810                 }
11811                 x := v_1
11812                 v.reset(OpNeq64)
11813                 v0 := b.NewValue0(v.Pos, OpConst64, t)
11814                 v0.AuxInt = int64ToAuxInt(0)
11815                 v.AddArg2(v0, x)
11816                 return true
11817         }
11818         // match: (Leq64U (Const64 [0]) _)
11819         // result: (ConstBool [true])
11820         for {
11821                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
11822                         break
11823                 }
11824                 v.reset(OpConstBool)
11825                 v.AuxInt = boolToAuxInt(true)
11826                 return true
11827         }
11828         return false
11829 }
11830 func rewriteValuegeneric_OpLeq8(v *Value) bool {
11831         v_1 := v.Args[1]
11832         v_0 := v.Args[0]
11833         b := v.Block
11834         // match: (Leq8 (Const8 [c]) (Const8 [d]))
11835         // result: (ConstBool [c <= d])
11836         for {
11837                 if v_0.Op != OpConst8 {
11838                         break
11839                 }
11840                 c := auxIntToInt8(v_0.AuxInt)
11841                 if v_1.Op != OpConst8 {
11842                         break
11843                 }
11844                 d := auxIntToInt8(v_1.AuxInt)
11845                 v.reset(OpConstBool)
11846                 v.AuxInt = boolToAuxInt(c <= d)
11847                 return true
11848         }
11849         // match: (Leq8 (Const8 [0]) (And8 _ (Const8 [c])))
11850         // cond: c >= 0
11851         // result: (ConstBool [true])
11852         for {
11853                 if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 || v_1.Op != OpAnd8 {
11854                         break
11855                 }
11856                 _ = v_1.Args[1]
11857                 v_1_0 := v_1.Args[0]
11858                 v_1_1 := v_1.Args[1]
11859                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
11860                         if v_1_1.Op != OpConst8 {
11861                                 continue
11862                         }
11863                         c := auxIntToInt8(v_1_1.AuxInt)
11864                         if !(c >= 0) {
11865                                 continue
11866                         }
11867                         v.reset(OpConstBool)
11868                         v.AuxInt = boolToAuxInt(true)
11869                         return true
11870                 }
11871                 break
11872         }
11873         // match: (Leq8 (Const8 [0]) (Rsh8Ux64 _ (Const64 [c])))
11874         // cond: c > 0
11875         // result: (ConstBool [true])
11876         for {
11877                 if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 || v_1.Op != OpRsh8Ux64 {
11878                         break
11879                 }
11880                 _ = v_1.Args[1]
11881                 v_1_1 := v_1.Args[1]
11882                 if v_1_1.Op != OpConst64 {
11883                         break
11884                 }
11885                 c := auxIntToInt64(v_1_1.AuxInt)
11886                 if !(c > 0) {
11887                         break
11888                 }
11889                 v.reset(OpConstBool)
11890                 v.AuxInt = boolToAuxInt(true)
11891                 return true
11892         }
11893         // match: (Leq8 x (Const8 <t> [-1]))
11894         // result: (Less8 x (Const8 <t> [0]))
11895         for {
11896                 x := v_0
11897                 if v_1.Op != OpConst8 {
11898                         break
11899                 }
11900                 t := v_1.Type
11901                 if auxIntToInt8(v_1.AuxInt) != -1 {
11902                         break
11903                 }
11904                 v.reset(OpLess8)
11905                 v0 := b.NewValue0(v.Pos, OpConst8, t)
11906                 v0.AuxInt = int8ToAuxInt(0)
11907                 v.AddArg2(x, v0)
11908                 return true
11909         }
11910         // match: (Leq8 (Const8 <t> [1]) x)
11911         // result: (Less8 (Const8 <t> [0]) x)
11912         for {
11913                 if v_0.Op != OpConst8 {
11914                         break
11915                 }
11916                 t := v_0.Type
11917                 if auxIntToInt8(v_0.AuxInt) != 1 {
11918                         break
11919                 }
11920                 x := v_1
11921                 v.reset(OpLess8)
11922                 v0 := b.NewValue0(v.Pos, OpConst8, t)
11923                 v0.AuxInt = int8ToAuxInt(0)
11924                 v.AddArg2(v0, x)
11925                 return true
11926         }
11927         return false
11928 }
11929 func rewriteValuegeneric_OpLeq8U(v *Value) bool {
11930         v_1 := v.Args[1]
11931         v_0 := v.Args[0]
11932         b := v.Block
11933         // match: (Leq8U (Const8 [c]) (Const8 [d]))
11934         // result: (ConstBool [ uint8(c) <= uint8(d)])
11935         for {
11936                 if v_0.Op != OpConst8 {
11937                         break
11938                 }
11939                 c := auxIntToInt8(v_0.AuxInt)
11940                 if v_1.Op != OpConst8 {
11941                         break
11942                 }
11943                 d := auxIntToInt8(v_1.AuxInt)
11944                 v.reset(OpConstBool)
11945                 v.AuxInt = boolToAuxInt(uint8(c) <= uint8(d))
11946                 return true
11947         }
11948         // match: (Leq8U (Const8 <t> [1]) x)
11949         // result: (Neq8 (Const8 <t> [0]) x)
11950         for {
11951                 if v_0.Op != OpConst8 {
11952                         break
11953                 }
11954                 t := v_0.Type
11955                 if auxIntToInt8(v_0.AuxInt) != 1 {
11956                         break
11957                 }
11958                 x := v_1
11959                 v.reset(OpNeq8)
11960                 v0 := b.NewValue0(v.Pos, OpConst8, t)
11961                 v0.AuxInt = int8ToAuxInt(0)
11962                 v.AddArg2(v0, x)
11963                 return true
11964         }
11965         // match: (Leq8U (Const8 [0]) _)
11966         // result: (ConstBool [true])
11967         for {
11968                 if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
11969                         break
11970                 }
11971                 v.reset(OpConstBool)
11972                 v.AuxInt = boolToAuxInt(true)
11973                 return true
11974         }
11975         return false
11976 }
11977 func rewriteValuegeneric_OpLess16(v *Value) bool {
11978         v_1 := v.Args[1]
11979         v_0 := v.Args[0]
11980         b := v.Block
11981         // match: (Less16 (Const16 [c]) (Const16 [d]))
11982         // result: (ConstBool [c < d])
11983         for {
11984                 if v_0.Op != OpConst16 {
11985                         break
11986                 }
11987                 c := auxIntToInt16(v_0.AuxInt)
11988                 if v_1.Op != OpConst16 {
11989                         break
11990                 }
11991                 d := auxIntToInt16(v_1.AuxInt)
11992                 v.reset(OpConstBool)
11993                 v.AuxInt = boolToAuxInt(c < d)
11994                 return true
11995         }
11996         // match: (Less16 (Const16 <t> [0]) x)
11997         // cond: isNonNegative(x)
11998         // result: (Neq16 (Const16 <t> [0]) x)
11999         for {
12000                 if v_0.Op != OpConst16 {
12001                         break
12002                 }
12003                 t := v_0.Type
12004                 if auxIntToInt16(v_0.AuxInt) != 0 {
12005                         break
12006                 }
12007                 x := v_1
12008                 if !(isNonNegative(x)) {
12009                         break
12010                 }
12011                 v.reset(OpNeq16)
12012                 v0 := b.NewValue0(v.Pos, OpConst16, t)
12013                 v0.AuxInt = int16ToAuxInt(0)
12014                 v.AddArg2(v0, x)
12015                 return true
12016         }
12017         // match: (Less16 x (Const16 <t> [1]))
12018         // cond: isNonNegative(x)
12019         // result: (Eq16 (Const16 <t> [0]) x)
12020         for {
12021                 x := v_0
12022                 if v_1.Op != OpConst16 {
12023                         break
12024                 }
12025                 t := v_1.Type
12026                 if auxIntToInt16(v_1.AuxInt) != 1 || !(isNonNegative(x)) {
12027                         break
12028                 }
12029                 v.reset(OpEq16)
12030                 v0 := b.NewValue0(v.Pos, OpConst16, t)
12031                 v0.AuxInt = int16ToAuxInt(0)
12032                 v.AddArg2(v0, x)
12033                 return true
12034         }
12035         // match: (Less16 x (Const16 <t> [1]))
12036         // result: (Leq16 x (Const16 <t> [0]))
12037         for {
12038                 x := v_0
12039                 if v_1.Op != OpConst16 {
12040                         break
12041                 }
12042                 t := v_1.Type
12043                 if auxIntToInt16(v_1.AuxInt) != 1 {
12044                         break
12045                 }
12046                 v.reset(OpLeq16)
12047                 v0 := b.NewValue0(v.Pos, OpConst16, t)
12048                 v0.AuxInt = int16ToAuxInt(0)
12049                 v.AddArg2(x, v0)
12050                 return true
12051         }
12052         // match: (Less16 (Const16 <t> [-1]) x)
12053         // result: (Leq16 (Const16 <t> [0]) x)
12054         for {
12055                 if v_0.Op != OpConst16 {
12056                         break
12057                 }
12058                 t := v_0.Type
12059                 if auxIntToInt16(v_0.AuxInt) != -1 {
12060                         break
12061                 }
12062                 x := v_1
12063                 v.reset(OpLeq16)
12064                 v0 := b.NewValue0(v.Pos, OpConst16, t)
12065                 v0.AuxInt = int16ToAuxInt(0)
12066                 v.AddArg2(v0, x)
12067                 return true
12068         }
12069         return false
12070 }
12071 func rewriteValuegeneric_OpLess16U(v *Value) bool {
12072         v_1 := v.Args[1]
12073         v_0 := v.Args[0]
12074         b := v.Block
12075         // match: (Less16U (Const16 [c]) (Const16 [d]))
12076         // result: (ConstBool [uint16(c) < uint16(d)])
12077         for {
12078                 if v_0.Op != OpConst16 {
12079                         break
12080                 }
12081                 c := auxIntToInt16(v_0.AuxInt)
12082                 if v_1.Op != OpConst16 {
12083                         break
12084                 }
12085                 d := auxIntToInt16(v_1.AuxInt)
12086                 v.reset(OpConstBool)
12087                 v.AuxInt = boolToAuxInt(uint16(c) < uint16(d))
12088                 return true
12089         }
12090         // match: (Less16U x (Const16 <t> [1]))
12091         // result: (Eq16 (Const16 <t> [0]) x)
12092         for {
12093                 x := v_0
12094                 if v_1.Op != OpConst16 {
12095                         break
12096                 }
12097                 t := v_1.Type
12098                 if auxIntToInt16(v_1.AuxInt) != 1 {
12099                         break
12100                 }
12101                 v.reset(OpEq16)
12102                 v0 := b.NewValue0(v.Pos, OpConst16, t)
12103                 v0.AuxInt = int16ToAuxInt(0)
12104                 v.AddArg2(v0, x)
12105                 return true
12106         }
12107         // match: (Less16U _ (Const16 [0]))
12108         // result: (ConstBool [false])
12109         for {
12110                 if v_1.Op != OpConst16 || auxIntToInt16(v_1.AuxInt) != 0 {
12111                         break
12112                 }
12113                 v.reset(OpConstBool)
12114                 v.AuxInt = boolToAuxInt(false)
12115                 return true
12116         }
12117         return false
12118 }
12119 func rewriteValuegeneric_OpLess32(v *Value) bool {
12120         v_1 := v.Args[1]
12121         v_0 := v.Args[0]
12122         b := v.Block
12123         // match: (Less32 (Const32 [c]) (Const32 [d]))
12124         // result: (ConstBool [c < d])
12125         for {
12126                 if v_0.Op != OpConst32 {
12127                         break
12128                 }
12129                 c := auxIntToInt32(v_0.AuxInt)
12130                 if v_1.Op != OpConst32 {
12131                         break
12132                 }
12133                 d := auxIntToInt32(v_1.AuxInt)
12134                 v.reset(OpConstBool)
12135                 v.AuxInt = boolToAuxInt(c < d)
12136                 return true
12137         }
12138         // match: (Less32 (Const32 <t> [0]) x)
12139         // cond: isNonNegative(x)
12140         // result: (Neq32 (Const32 <t> [0]) x)
12141         for {
12142                 if v_0.Op != OpConst32 {
12143                         break
12144                 }
12145                 t := v_0.Type
12146                 if auxIntToInt32(v_0.AuxInt) != 0 {
12147                         break
12148                 }
12149                 x := v_1
12150                 if !(isNonNegative(x)) {
12151                         break
12152                 }
12153                 v.reset(OpNeq32)
12154                 v0 := b.NewValue0(v.Pos, OpConst32, t)
12155                 v0.AuxInt = int32ToAuxInt(0)
12156                 v.AddArg2(v0, x)
12157                 return true
12158         }
12159         // match: (Less32 x (Const32 <t> [1]))
12160         // cond: isNonNegative(x)
12161         // result: (Eq32 (Const32 <t> [0]) x)
12162         for {
12163                 x := v_0
12164                 if v_1.Op != OpConst32 {
12165                         break
12166                 }
12167                 t := v_1.Type
12168                 if auxIntToInt32(v_1.AuxInt) != 1 || !(isNonNegative(x)) {
12169                         break
12170                 }
12171                 v.reset(OpEq32)
12172                 v0 := b.NewValue0(v.Pos, OpConst32, t)
12173                 v0.AuxInt = int32ToAuxInt(0)
12174                 v.AddArg2(v0, x)
12175                 return true
12176         }
12177         // match: (Less32 x (Const32 <t> [1]))
12178         // result: (Leq32 x (Const32 <t> [0]))
12179         for {
12180                 x := v_0
12181                 if v_1.Op != OpConst32 {
12182                         break
12183                 }
12184                 t := v_1.Type
12185                 if auxIntToInt32(v_1.AuxInt) != 1 {
12186                         break
12187                 }
12188                 v.reset(OpLeq32)
12189                 v0 := b.NewValue0(v.Pos, OpConst32, t)
12190                 v0.AuxInt = int32ToAuxInt(0)
12191                 v.AddArg2(x, v0)
12192                 return true
12193         }
12194         // match: (Less32 (Const32 <t> [-1]) x)
12195         // result: (Leq32 (Const32 <t> [0]) x)
12196         for {
12197                 if v_0.Op != OpConst32 {
12198                         break
12199                 }
12200                 t := v_0.Type
12201                 if auxIntToInt32(v_0.AuxInt) != -1 {
12202                         break
12203                 }
12204                 x := v_1
12205                 v.reset(OpLeq32)
12206                 v0 := b.NewValue0(v.Pos, OpConst32, t)
12207                 v0.AuxInt = int32ToAuxInt(0)
12208                 v.AddArg2(v0, x)
12209                 return true
12210         }
12211         return false
12212 }
12213 func rewriteValuegeneric_OpLess32F(v *Value) bool {
12214         v_1 := v.Args[1]
12215         v_0 := v.Args[0]
12216         // match: (Less32F (Const32F [c]) (Const32F [d]))
12217         // result: (ConstBool [c < d])
12218         for {
12219                 if v_0.Op != OpConst32F {
12220                         break
12221                 }
12222                 c := auxIntToFloat32(v_0.AuxInt)
12223                 if v_1.Op != OpConst32F {
12224                         break
12225                 }
12226                 d := auxIntToFloat32(v_1.AuxInt)
12227                 v.reset(OpConstBool)
12228                 v.AuxInt = boolToAuxInt(c < d)
12229                 return true
12230         }
12231         return false
12232 }
12233 func rewriteValuegeneric_OpLess32U(v *Value) bool {
12234         v_1 := v.Args[1]
12235         v_0 := v.Args[0]
12236         b := v.Block
12237         // match: (Less32U (Const32 [c]) (Const32 [d]))
12238         // result: (ConstBool [uint32(c) < uint32(d)])
12239         for {
12240                 if v_0.Op != OpConst32 {
12241                         break
12242                 }
12243                 c := auxIntToInt32(v_0.AuxInt)
12244                 if v_1.Op != OpConst32 {
12245                         break
12246                 }
12247                 d := auxIntToInt32(v_1.AuxInt)
12248                 v.reset(OpConstBool)
12249                 v.AuxInt = boolToAuxInt(uint32(c) < uint32(d))
12250                 return true
12251         }
12252         // match: (Less32U x (Const32 <t> [1]))
12253         // result: (Eq32 (Const32 <t> [0]) x)
12254         for {
12255                 x := v_0
12256                 if v_1.Op != OpConst32 {
12257                         break
12258                 }
12259                 t := v_1.Type
12260                 if auxIntToInt32(v_1.AuxInt) != 1 {
12261                         break
12262                 }
12263                 v.reset(OpEq32)
12264                 v0 := b.NewValue0(v.Pos, OpConst32, t)
12265                 v0.AuxInt = int32ToAuxInt(0)
12266                 v.AddArg2(v0, x)
12267                 return true
12268         }
12269         // match: (Less32U _ (Const32 [0]))
12270         // result: (ConstBool [false])
12271         for {
12272                 if v_1.Op != OpConst32 || auxIntToInt32(v_1.AuxInt) != 0 {
12273                         break
12274                 }
12275                 v.reset(OpConstBool)
12276                 v.AuxInt = boolToAuxInt(false)
12277                 return true
12278         }
12279         return false
12280 }
12281 func rewriteValuegeneric_OpLess64(v *Value) bool {
12282         v_1 := v.Args[1]
12283         v_0 := v.Args[0]
12284         b := v.Block
12285         // match: (Less64 (Const64 [c]) (Const64 [d]))
12286         // result: (ConstBool [c < d])
12287         for {
12288                 if v_0.Op != OpConst64 {
12289                         break
12290                 }
12291                 c := auxIntToInt64(v_0.AuxInt)
12292                 if v_1.Op != OpConst64 {
12293                         break
12294                 }
12295                 d := auxIntToInt64(v_1.AuxInt)
12296                 v.reset(OpConstBool)
12297                 v.AuxInt = boolToAuxInt(c < d)
12298                 return true
12299         }
12300         // match: (Less64 (Const64 <t> [0]) x)
12301         // cond: isNonNegative(x)
12302         // result: (Neq64 (Const64 <t> [0]) x)
12303         for {
12304                 if v_0.Op != OpConst64 {
12305                         break
12306                 }
12307                 t := v_0.Type
12308                 if auxIntToInt64(v_0.AuxInt) != 0 {
12309                         break
12310                 }
12311                 x := v_1
12312                 if !(isNonNegative(x)) {
12313                         break
12314                 }
12315                 v.reset(OpNeq64)
12316                 v0 := b.NewValue0(v.Pos, OpConst64, t)
12317                 v0.AuxInt = int64ToAuxInt(0)
12318                 v.AddArg2(v0, x)
12319                 return true
12320         }
12321         // match: (Less64 x (Const64 <t> [1]))
12322         // cond: isNonNegative(x)
12323         // result: (Eq64 (Const64 <t> [0]) x)
12324         for {
12325                 x := v_0
12326                 if v_1.Op != OpConst64 {
12327                         break
12328                 }
12329                 t := v_1.Type
12330                 if auxIntToInt64(v_1.AuxInt) != 1 || !(isNonNegative(x)) {
12331                         break
12332                 }
12333                 v.reset(OpEq64)
12334                 v0 := b.NewValue0(v.Pos, OpConst64, t)
12335                 v0.AuxInt = int64ToAuxInt(0)
12336                 v.AddArg2(v0, x)
12337                 return true
12338         }
12339         // match: (Less64 x (Const64 <t> [1]))
12340         // result: (Leq64 x (Const64 <t> [0]))
12341         for {
12342                 x := v_0
12343                 if v_1.Op != OpConst64 {
12344                         break
12345                 }
12346                 t := v_1.Type
12347                 if auxIntToInt64(v_1.AuxInt) != 1 {
12348                         break
12349                 }
12350                 v.reset(OpLeq64)
12351                 v0 := b.NewValue0(v.Pos, OpConst64, t)
12352                 v0.AuxInt = int64ToAuxInt(0)
12353                 v.AddArg2(x, v0)
12354                 return true
12355         }
12356         // match: (Less64 (Const64 <t> [-1]) x)
12357         // result: (Leq64 (Const64 <t> [0]) x)
12358         for {
12359                 if v_0.Op != OpConst64 {
12360                         break
12361                 }
12362                 t := v_0.Type
12363                 if auxIntToInt64(v_0.AuxInt) != -1 {
12364                         break
12365                 }
12366                 x := v_1
12367                 v.reset(OpLeq64)
12368                 v0 := b.NewValue0(v.Pos, OpConst64, t)
12369                 v0.AuxInt = int64ToAuxInt(0)
12370                 v.AddArg2(v0, x)
12371                 return true
12372         }
12373         return false
12374 }
12375 func rewriteValuegeneric_OpLess64F(v *Value) bool {
12376         v_1 := v.Args[1]
12377         v_0 := v.Args[0]
12378         // match: (Less64F (Const64F [c]) (Const64F [d]))
12379         // result: (ConstBool [c < d])
12380         for {
12381                 if v_0.Op != OpConst64F {
12382                         break
12383                 }
12384                 c := auxIntToFloat64(v_0.AuxInt)
12385                 if v_1.Op != OpConst64F {
12386                         break
12387                 }
12388                 d := auxIntToFloat64(v_1.AuxInt)
12389                 v.reset(OpConstBool)
12390                 v.AuxInt = boolToAuxInt(c < d)
12391                 return true
12392         }
12393         return false
12394 }
12395 func rewriteValuegeneric_OpLess64U(v *Value) bool {
12396         v_1 := v.Args[1]
12397         v_0 := v.Args[0]
12398         b := v.Block
12399         // match: (Less64U (Const64 [c]) (Const64 [d]))
12400         // result: (ConstBool [uint64(c) < uint64(d)])
12401         for {
12402                 if v_0.Op != OpConst64 {
12403                         break
12404                 }
12405                 c := auxIntToInt64(v_0.AuxInt)
12406                 if v_1.Op != OpConst64 {
12407                         break
12408                 }
12409                 d := auxIntToInt64(v_1.AuxInt)
12410                 v.reset(OpConstBool)
12411                 v.AuxInt = boolToAuxInt(uint64(c) < uint64(d))
12412                 return true
12413         }
12414         // match: (Less64U x (Const64 <t> [1]))
12415         // result: (Eq64 (Const64 <t> [0]) x)
12416         for {
12417                 x := v_0
12418                 if v_1.Op != OpConst64 {
12419                         break
12420                 }
12421                 t := v_1.Type
12422                 if auxIntToInt64(v_1.AuxInt) != 1 {
12423                         break
12424                 }
12425                 v.reset(OpEq64)
12426                 v0 := b.NewValue0(v.Pos, OpConst64, t)
12427                 v0.AuxInt = int64ToAuxInt(0)
12428                 v.AddArg2(v0, x)
12429                 return true
12430         }
12431         // match: (Less64U _ (Const64 [0]))
12432         // result: (ConstBool [false])
12433         for {
12434                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 0 {
12435                         break
12436                 }
12437                 v.reset(OpConstBool)
12438                 v.AuxInt = boolToAuxInt(false)
12439                 return true
12440         }
12441         return false
12442 }
12443 func rewriteValuegeneric_OpLess8(v *Value) bool {
12444         v_1 := v.Args[1]
12445         v_0 := v.Args[0]
12446         b := v.Block
12447         // match: (Less8 (Const8 [c]) (Const8 [d]))
12448         // result: (ConstBool [c < d])
12449         for {
12450                 if v_0.Op != OpConst8 {
12451                         break
12452                 }
12453                 c := auxIntToInt8(v_0.AuxInt)
12454                 if v_1.Op != OpConst8 {
12455                         break
12456                 }
12457                 d := auxIntToInt8(v_1.AuxInt)
12458                 v.reset(OpConstBool)
12459                 v.AuxInt = boolToAuxInt(c < d)
12460                 return true
12461         }
12462         // match: (Less8 (Const8 <t> [0]) x)
12463         // cond: isNonNegative(x)
12464         // result: (Neq8 (Const8 <t> [0]) x)
12465         for {
12466                 if v_0.Op != OpConst8 {
12467                         break
12468                 }
12469                 t := v_0.Type
12470                 if auxIntToInt8(v_0.AuxInt) != 0 {
12471                         break
12472                 }
12473                 x := v_1
12474                 if !(isNonNegative(x)) {
12475                         break
12476                 }
12477                 v.reset(OpNeq8)
12478                 v0 := b.NewValue0(v.Pos, OpConst8, t)
12479                 v0.AuxInt = int8ToAuxInt(0)
12480                 v.AddArg2(v0, x)
12481                 return true
12482         }
12483         // match: (Less8 x (Const8 <t> [1]))
12484         // cond: isNonNegative(x)
12485         // result: (Eq8 (Const8 <t> [0]) x)
12486         for {
12487                 x := v_0
12488                 if v_1.Op != OpConst8 {
12489                         break
12490                 }
12491                 t := v_1.Type
12492                 if auxIntToInt8(v_1.AuxInt) != 1 || !(isNonNegative(x)) {
12493                         break
12494                 }
12495                 v.reset(OpEq8)
12496                 v0 := b.NewValue0(v.Pos, OpConst8, t)
12497                 v0.AuxInt = int8ToAuxInt(0)
12498                 v.AddArg2(v0, x)
12499                 return true
12500         }
12501         // match: (Less8 x (Const8 <t> [1]))
12502         // result: (Leq8 x (Const8 <t> [0]))
12503         for {
12504                 x := v_0
12505                 if v_1.Op != OpConst8 {
12506                         break
12507                 }
12508                 t := v_1.Type
12509                 if auxIntToInt8(v_1.AuxInt) != 1 {
12510                         break
12511                 }
12512                 v.reset(OpLeq8)
12513                 v0 := b.NewValue0(v.Pos, OpConst8, t)
12514                 v0.AuxInt = int8ToAuxInt(0)
12515                 v.AddArg2(x, v0)
12516                 return true
12517         }
12518         // match: (Less8 (Const8 <t> [-1]) x)
12519         // result: (Leq8 (Const8 <t> [0]) x)
12520         for {
12521                 if v_0.Op != OpConst8 {
12522                         break
12523                 }
12524                 t := v_0.Type
12525                 if auxIntToInt8(v_0.AuxInt) != -1 {
12526                         break
12527                 }
12528                 x := v_1
12529                 v.reset(OpLeq8)
12530                 v0 := b.NewValue0(v.Pos, OpConst8, t)
12531                 v0.AuxInt = int8ToAuxInt(0)
12532                 v.AddArg2(v0, x)
12533                 return true
12534         }
12535         return false
12536 }
12537 func rewriteValuegeneric_OpLess8U(v *Value) bool {
12538         v_1 := v.Args[1]
12539         v_0 := v.Args[0]
12540         b := v.Block
12541         // match: (Less8U (Const8 [c]) (Const8 [d]))
12542         // result: (ConstBool [ uint8(c) < uint8(d)])
12543         for {
12544                 if v_0.Op != OpConst8 {
12545                         break
12546                 }
12547                 c := auxIntToInt8(v_0.AuxInt)
12548                 if v_1.Op != OpConst8 {
12549                         break
12550                 }
12551                 d := auxIntToInt8(v_1.AuxInt)
12552                 v.reset(OpConstBool)
12553                 v.AuxInt = boolToAuxInt(uint8(c) < uint8(d))
12554                 return true
12555         }
12556         // match: (Less8U x (Const8 <t> [1]))
12557         // result: (Eq8 (Const8 <t> [0]) x)
12558         for {
12559                 x := v_0
12560                 if v_1.Op != OpConst8 {
12561                         break
12562                 }
12563                 t := v_1.Type
12564                 if auxIntToInt8(v_1.AuxInt) != 1 {
12565                         break
12566                 }
12567                 v.reset(OpEq8)
12568                 v0 := b.NewValue0(v.Pos, OpConst8, t)
12569                 v0.AuxInt = int8ToAuxInt(0)
12570                 v.AddArg2(v0, x)
12571                 return true
12572         }
12573         // match: (Less8U _ (Const8 [0]))
12574         // result: (ConstBool [false])
12575         for {
12576                 if v_1.Op != OpConst8 || auxIntToInt8(v_1.AuxInt) != 0 {
12577                         break
12578                 }
12579                 v.reset(OpConstBool)
12580                 v.AuxInt = boolToAuxInt(false)
12581                 return true
12582         }
12583         return false
12584 }
12585 func rewriteValuegeneric_OpLoad(v *Value) bool {
12586         v_1 := v.Args[1]
12587         v_0 := v.Args[0]
12588         b := v.Block
12589         config := b.Func.Config
12590         fe := b.Func.fe
12591         // match: (Load <t1> p1 (Store {t2} p2 x _))
12592         // cond: isSamePtr(p1, p2) && t1.Compare(x.Type) == types.CMPeq && t1.Size() == t2.Size()
12593         // result: x
12594         for {
12595                 t1 := v.Type
12596                 p1 := v_0
12597                 if v_1.Op != OpStore {
12598                         break
12599                 }
12600                 t2 := auxToType(v_1.Aux)
12601                 x := v_1.Args[1]
12602                 p2 := v_1.Args[0]
12603                 if !(isSamePtr(p1, p2) && t1.Compare(x.Type) == types.CMPeq && t1.Size() == t2.Size()) {
12604                         break
12605                 }
12606                 v.copyOf(x)
12607                 return true
12608         }
12609         // match: (Load <t1> p1 (Store {t2} p2 _ (Store {t3} p3 x _)))
12610         // cond: isSamePtr(p1, p3) && t1.Compare(x.Type) == types.CMPeq && t1.Size() == t2.Size() && disjoint(p3, t3.Size(), p2, t2.Size())
12611         // result: x
12612         for {
12613                 t1 := v.Type
12614                 p1 := v_0
12615                 if v_1.Op != OpStore {
12616                         break
12617                 }
12618                 t2 := auxToType(v_1.Aux)
12619                 _ = v_1.Args[2]
12620                 p2 := v_1.Args[0]
12621                 v_1_2 := v_1.Args[2]
12622                 if v_1_2.Op != OpStore {
12623                         break
12624                 }
12625                 t3 := auxToType(v_1_2.Aux)
12626                 x := v_1_2.Args[1]
12627                 p3 := v_1_2.Args[0]
12628                 if !(isSamePtr(p1, p3) && t1.Compare(x.Type) == types.CMPeq && t1.Size() == t2.Size() && disjoint(p3, t3.Size(), p2, t2.Size())) {
12629                         break
12630                 }
12631                 v.copyOf(x)
12632                 return true
12633         }
12634         // match: (Load <t1> p1 (Store {t2} p2 _ (Store {t3} p3 _ (Store {t4} p4 x _))))
12635         // cond: isSamePtr(p1, p4) && t1.Compare(x.Type) == types.CMPeq && t1.Size() == t2.Size() && disjoint(p4, t4.Size(), p2, t2.Size()) && disjoint(p4, t4.Size(), p3, t3.Size())
12636         // result: x
12637         for {
12638                 t1 := v.Type
12639                 p1 := v_0
12640                 if v_1.Op != OpStore {
12641                         break
12642                 }
12643                 t2 := auxToType(v_1.Aux)
12644                 _ = v_1.Args[2]
12645                 p2 := v_1.Args[0]
12646                 v_1_2 := v_1.Args[2]
12647                 if v_1_2.Op != OpStore {
12648                         break
12649                 }
12650                 t3 := auxToType(v_1_2.Aux)
12651                 _ = v_1_2.Args[2]
12652                 p3 := v_1_2.Args[0]
12653                 v_1_2_2 := v_1_2.Args[2]
12654                 if v_1_2_2.Op != OpStore {
12655                         break
12656                 }
12657                 t4 := auxToType(v_1_2_2.Aux)
12658                 x := v_1_2_2.Args[1]
12659                 p4 := v_1_2_2.Args[0]
12660                 if !(isSamePtr(p1, p4) && t1.Compare(x.Type) == types.CMPeq && t1.Size() == t2.Size() && disjoint(p4, t4.Size(), p2, t2.Size()) && disjoint(p4, t4.Size(), p3, t3.Size())) {
12661                         break
12662                 }
12663                 v.copyOf(x)
12664                 return true
12665         }
12666         // match: (Load <t1> p1 (Store {t2} p2 _ (Store {t3} p3 _ (Store {t4} p4 _ (Store {t5} p5 x _)))))
12667         // cond: isSamePtr(p1, p5) && t1.Compare(x.Type) == types.CMPeq && t1.Size() == t2.Size() && disjoint(p5, t5.Size(), p2, t2.Size()) && disjoint(p5, t5.Size(), p3, t3.Size()) && disjoint(p5, t5.Size(), p4, t4.Size())
12668         // result: x
12669         for {
12670                 t1 := v.Type
12671                 p1 := v_0
12672                 if v_1.Op != OpStore {
12673                         break
12674                 }
12675                 t2 := auxToType(v_1.Aux)
12676                 _ = v_1.Args[2]
12677                 p2 := v_1.Args[0]
12678                 v_1_2 := v_1.Args[2]
12679                 if v_1_2.Op != OpStore {
12680                         break
12681                 }
12682                 t3 := auxToType(v_1_2.Aux)
12683                 _ = v_1_2.Args[2]
12684                 p3 := v_1_2.Args[0]
12685                 v_1_2_2 := v_1_2.Args[2]
12686                 if v_1_2_2.Op != OpStore {
12687                         break
12688                 }
12689                 t4 := auxToType(v_1_2_2.Aux)
12690                 _ = v_1_2_2.Args[2]
12691                 p4 := v_1_2_2.Args[0]
12692                 v_1_2_2_2 := v_1_2_2.Args[2]
12693                 if v_1_2_2_2.Op != OpStore {
12694                         break
12695                 }
12696                 t5 := auxToType(v_1_2_2_2.Aux)
12697                 x := v_1_2_2_2.Args[1]
12698                 p5 := v_1_2_2_2.Args[0]
12699                 if !(isSamePtr(p1, p5) && t1.Compare(x.Type) == types.CMPeq && t1.Size() == t2.Size() && disjoint(p5, t5.Size(), p2, t2.Size()) && disjoint(p5, t5.Size(), p3, t3.Size()) && disjoint(p5, t5.Size(), p4, t4.Size())) {
12700                         break
12701                 }
12702                 v.copyOf(x)
12703                 return true
12704         }
12705         // match: (Load <t1> p1 (Store {t2} p2 (Const64 [x]) _))
12706         // cond: isSamePtr(p1,p2) && sizeof(t2) == 8 && is64BitFloat(t1) && !math.IsNaN(math.Float64frombits(uint64(x)))
12707         // result: (Const64F [math.Float64frombits(uint64(x))])
12708         for {
12709                 t1 := v.Type
12710                 p1 := v_0
12711                 if v_1.Op != OpStore {
12712                         break
12713                 }
12714                 t2 := auxToType(v_1.Aux)
12715                 _ = v_1.Args[1]
12716                 p2 := v_1.Args[0]
12717                 v_1_1 := v_1.Args[1]
12718                 if v_1_1.Op != OpConst64 {
12719                         break
12720                 }
12721                 x := auxIntToInt64(v_1_1.AuxInt)
12722                 if !(isSamePtr(p1, p2) && sizeof(t2) == 8 && is64BitFloat(t1) && !math.IsNaN(math.Float64frombits(uint64(x)))) {
12723                         break
12724                 }
12725                 v.reset(OpConst64F)
12726                 v.AuxInt = float64ToAuxInt(math.Float64frombits(uint64(x)))
12727                 return true
12728         }
12729         // match: (Load <t1> p1 (Store {t2} p2 (Const32 [x]) _))
12730         // cond: isSamePtr(p1,p2) && sizeof(t2) == 4 && is32BitFloat(t1) && !math.IsNaN(float64(math.Float32frombits(uint32(x))))
12731         // result: (Const32F [math.Float32frombits(uint32(x))])
12732         for {
12733                 t1 := v.Type
12734                 p1 := v_0
12735                 if v_1.Op != OpStore {
12736                         break
12737                 }
12738                 t2 := auxToType(v_1.Aux)
12739                 _ = v_1.Args[1]
12740                 p2 := v_1.Args[0]
12741                 v_1_1 := v_1.Args[1]
12742                 if v_1_1.Op != OpConst32 {
12743                         break
12744                 }
12745                 x := auxIntToInt32(v_1_1.AuxInt)
12746                 if !(isSamePtr(p1, p2) && sizeof(t2) == 4 && is32BitFloat(t1) && !math.IsNaN(float64(math.Float32frombits(uint32(x))))) {
12747                         break
12748                 }
12749                 v.reset(OpConst32F)
12750                 v.AuxInt = float32ToAuxInt(math.Float32frombits(uint32(x)))
12751                 return true
12752         }
12753         // match: (Load <t1> p1 (Store {t2} p2 (Const64F [x]) _))
12754         // cond: isSamePtr(p1,p2) && sizeof(t2) == 8 && is64BitInt(t1)
12755         // result: (Const64 [int64(math.Float64bits(x))])
12756         for {
12757                 t1 := v.Type
12758                 p1 := v_0
12759                 if v_1.Op != OpStore {
12760                         break
12761                 }
12762                 t2 := auxToType(v_1.Aux)
12763                 _ = v_1.Args[1]
12764                 p2 := v_1.Args[0]
12765                 v_1_1 := v_1.Args[1]
12766                 if v_1_1.Op != OpConst64F {
12767                         break
12768                 }
12769                 x := auxIntToFloat64(v_1_1.AuxInt)
12770                 if !(isSamePtr(p1, p2) && sizeof(t2) == 8 && is64BitInt(t1)) {
12771                         break
12772                 }
12773                 v.reset(OpConst64)
12774                 v.AuxInt = int64ToAuxInt(int64(math.Float64bits(x)))
12775                 return true
12776         }
12777         // match: (Load <t1> p1 (Store {t2} p2 (Const32F [x]) _))
12778         // cond: isSamePtr(p1,p2) && sizeof(t2) == 4 && is32BitInt(t1)
12779         // result: (Const32 [int32(math.Float32bits(x))])
12780         for {
12781                 t1 := v.Type
12782                 p1 := v_0
12783                 if v_1.Op != OpStore {
12784                         break
12785                 }
12786                 t2 := auxToType(v_1.Aux)
12787                 _ = v_1.Args[1]
12788                 p2 := v_1.Args[0]
12789                 v_1_1 := v_1.Args[1]
12790                 if v_1_1.Op != OpConst32F {
12791                         break
12792                 }
12793                 x := auxIntToFloat32(v_1_1.AuxInt)
12794                 if !(isSamePtr(p1, p2) && sizeof(t2) == 4 && is32BitInt(t1)) {
12795                         break
12796                 }
12797                 v.reset(OpConst32)
12798                 v.AuxInt = int32ToAuxInt(int32(math.Float32bits(x)))
12799                 return true
12800         }
12801         // match: (Load <t1> op:(OffPtr [o1] p1) (Store {t2} p2 _ mem:(Zero [n] p3 _)))
12802         // cond: o1 >= 0 && o1+t1.Size() <= n && isSamePtr(p1, p3) && fe.CanSSA(t1) && disjoint(op, t1.Size(), p2, t2.Size())
12803         // result: @mem.Block (Load <t1> (OffPtr <op.Type> [o1] p3) mem)
12804         for {
12805                 t1 := v.Type
12806                 op := v_0
12807                 if op.Op != OpOffPtr {
12808                         break
12809                 }
12810                 o1 := auxIntToInt64(op.AuxInt)
12811                 p1 := op.Args[0]
12812                 if v_1.Op != OpStore {
12813                         break
12814                 }
12815                 t2 := auxToType(v_1.Aux)
12816                 _ = v_1.Args[2]
12817                 p2 := v_1.Args[0]
12818                 mem := v_1.Args[2]
12819                 if mem.Op != OpZero {
12820                         break
12821                 }
12822                 n := auxIntToInt64(mem.AuxInt)
12823                 p3 := mem.Args[0]
12824                 if !(o1 >= 0 && o1+t1.Size() <= n && isSamePtr(p1, p3) && fe.CanSSA(t1) && disjoint(op, t1.Size(), p2, t2.Size())) {
12825                         break
12826                 }
12827                 b = mem.Block
12828                 v0 := b.NewValue0(v.Pos, OpLoad, t1)
12829                 v.copyOf(v0)
12830                 v1 := b.NewValue0(v.Pos, OpOffPtr, op.Type)
12831                 v1.AuxInt = int64ToAuxInt(o1)
12832                 v1.AddArg(p3)
12833                 v0.AddArg2(v1, mem)
12834                 return true
12835         }
12836         // match: (Load <t1> op:(OffPtr [o1] p1) (Store {t2} p2 _ (Store {t3} p3 _ mem:(Zero [n] p4 _))))
12837         // cond: o1 >= 0 && o1+t1.Size() <= n && isSamePtr(p1, p4) && fe.CanSSA(t1) && disjoint(op, t1.Size(), p2, t2.Size()) && disjoint(op, t1.Size(), p3, t3.Size())
12838         // result: @mem.Block (Load <t1> (OffPtr <op.Type> [o1] p4) mem)
12839         for {
12840                 t1 := v.Type
12841                 op := v_0
12842                 if op.Op != OpOffPtr {
12843                         break
12844                 }
12845                 o1 := auxIntToInt64(op.AuxInt)
12846                 p1 := op.Args[0]
12847                 if v_1.Op != OpStore {
12848                         break
12849                 }
12850                 t2 := auxToType(v_1.Aux)
12851                 _ = v_1.Args[2]
12852                 p2 := v_1.Args[0]
12853                 v_1_2 := v_1.Args[2]
12854                 if v_1_2.Op != OpStore {
12855                         break
12856                 }
12857                 t3 := auxToType(v_1_2.Aux)
12858                 _ = v_1_2.Args[2]
12859                 p3 := v_1_2.Args[0]
12860                 mem := v_1_2.Args[2]
12861                 if mem.Op != OpZero {
12862                         break
12863                 }
12864                 n := auxIntToInt64(mem.AuxInt)
12865                 p4 := mem.Args[0]
12866                 if !(o1 >= 0 && o1+t1.Size() <= n && isSamePtr(p1, p4) && fe.CanSSA(t1) && disjoint(op, t1.Size(), p2, t2.Size()) && disjoint(op, t1.Size(), p3, t3.Size())) {
12867                         break
12868                 }
12869                 b = mem.Block
12870                 v0 := b.NewValue0(v.Pos, OpLoad, t1)
12871                 v.copyOf(v0)
12872                 v1 := b.NewValue0(v.Pos, OpOffPtr, op.Type)
12873                 v1.AuxInt = int64ToAuxInt(o1)
12874                 v1.AddArg(p4)
12875                 v0.AddArg2(v1, mem)
12876                 return true
12877         }
12878         // match: (Load <t1> op:(OffPtr [o1] p1) (Store {t2} p2 _ (Store {t3} p3 _ (Store {t4} p4 _ mem:(Zero [n] p5 _)))))
12879         // cond: o1 >= 0 && o1+t1.Size() <= n && isSamePtr(p1, p5) && fe.CanSSA(t1) && disjoint(op, t1.Size(), p2, t2.Size()) && disjoint(op, t1.Size(), p3, t3.Size()) && disjoint(op, t1.Size(), p4, t4.Size())
12880         // result: @mem.Block (Load <t1> (OffPtr <op.Type> [o1] p5) mem)
12881         for {
12882                 t1 := v.Type
12883                 op := v_0
12884                 if op.Op != OpOffPtr {
12885                         break
12886                 }
12887                 o1 := auxIntToInt64(op.AuxInt)
12888                 p1 := op.Args[0]
12889                 if v_1.Op != OpStore {
12890                         break
12891                 }
12892                 t2 := auxToType(v_1.Aux)
12893                 _ = v_1.Args[2]
12894                 p2 := v_1.Args[0]
12895                 v_1_2 := v_1.Args[2]
12896                 if v_1_2.Op != OpStore {
12897                         break
12898                 }
12899                 t3 := auxToType(v_1_2.Aux)
12900                 _ = v_1_2.Args[2]
12901                 p3 := v_1_2.Args[0]
12902                 v_1_2_2 := v_1_2.Args[2]
12903                 if v_1_2_2.Op != OpStore {
12904                         break
12905                 }
12906                 t4 := auxToType(v_1_2_2.Aux)
12907                 _ = v_1_2_2.Args[2]
12908                 p4 := v_1_2_2.Args[0]
12909                 mem := v_1_2_2.Args[2]
12910                 if mem.Op != OpZero {
12911                         break
12912                 }
12913                 n := auxIntToInt64(mem.AuxInt)
12914                 p5 := mem.Args[0]
12915                 if !(o1 >= 0 && o1+t1.Size() <= n && isSamePtr(p1, p5) && fe.CanSSA(t1) && disjoint(op, t1.Size(), p2, t2.Size()) && disjoint(op, t1.Size(), p3, t3.Size()) && disjoint(op, t1.Size(), p4, t4.Size())) {
12916                         break
12917                 }
12918                 b = mem.Block
12919                 v0 := b.NewValue0(v.Pos, OpLoad, t1)
12920                 v.copyOf(v0)
12921                 v1 := b.NewValue0(v.Pos, OpOffPtr, op.Type)
12922                 v1.AuxInt = int64ToAuxInt(o1)
12923                 v1.AddArg(p5)
12924                 v0.AddArg2(v1, mem)
12925                 return true
12926         }
12927         // match: (Load <t1> op:(OffPtr [o1] p1) (Store {t2} p2 _ (Store {t3} p3 _ (Store {t4} p4 _ (Store {t5} p5 _ mem:(Zero [n] p6 _))))))
12928         // cond: o1 >= 0 && o1+t1.Size() <= n && isSamePtr(p1, p6) && fe.CanSSA(t1) && disjoint(op, t1.Size(), p2, t2.Size()) && disjoint(op, t1.Size(), p3, t3.Size()) && disjoint(op, t1.Size(), p4, t4.Size()) && disjoint(op, t1.Size(), p5, t5.Size())
12929         // result: @mem.Block (Load <t1> (OffPtr <op.Type> [o1] p6) mem)
12930         for {
12931                 t1 := v.Type
12932                 op := v_0
12933                 if op.Op != OpOffPtr {
12934                         break
12935                 }
12936                 o1 := auxIntToInt64(op.AuxInt)
12937                 p1 := op.Args[0]
12938                 if v_1.Op != OpStore {
12939                         break
12940                 }
12941                 t2 := auxToType(v_1.Aux)
12942                 _ = v_1.Args[2]
12943                 p2 := v_1.Args[0]
12944                 v_1_2 := v_1.Args[2]
12945                 if v_1_2.Op != OpStore {
12946                         break
12947                 }
12948                 t3 := auxToType(v_1_2.Aux)
12949                 _ = v_1_2.Args[2]
12950                 p3 := v_1_2.Args[0]
12951                 v_1_2_2 := v_1_2.Args[2]
12952                 if v_1_2_2.Op != OpStore {
12953                         break
12954                 }
12955                 t4 := auxToType(v_1_2_2.Aux)
12956                 _ = v_1_2_2.Args[2]
12957                 p4 := v_1_2_2.Args[0]
12958                 v_1_2_2_2 := v_1_2_2.Args[2]
12959                 if v_1_2_2_2.Op != OpStore {
12960                         break
12961                 }
12962                 t5 := auxToType(v_1_2_2_2.Aux)
12963                 _ = v_1_2_2_2.Args[2]
12964                 p5 := v_1_2_2_2.Args[0]
12965                 mem := v_1_2_2_2.Args[2]
12966                 if mem.Op != OpZero {
12967                         break
12968                 }
12969                 n := auxIntToInt64(mem.AuxInt)
12970                 p6 := mem.Args[0]
12971                 if !(o1 >= 0 && o1+t1.Size() <= n && isSamePtr(p1, p6) && fe.CanSSA(t1) && disjoint(op, t1.Size(), p2, t2.Size()) && disjoint(op, t1.Size(), p3, t3.Size()) && disjoint(op, t1.Size(), p4, t4.Size()) && disjoint(op, t1.Size(), p5, t5.Size())) {
12972                         break
12973                 }
12974                 b = mem.Block
12975                 v0 := b.NewValue0(v.Pos, OpLoad, t1)
12976                 v.copyOf(v0)
12977                 v1 := b.NewValue0(v.Pos, OpOffPtr, op.Type)
12978                 v1.AuxInt = int64ToAuxInt(o1)
12979                 v1.AddArg(p6)
12980                 v0.AddArg2(v1, mem)
12981                 return true
12982         }
12983         // match: (Load <t1> (OffPtr [o] p1) (Zero [n] p2 _))
12984         // cond: t1.IsBoolean() && isSamePtr(p1, p2) && n >= o + 1
12985         // result: (ConstBool [false])
12986         for {
12987                 t1 := v.Type
12988                 if v_0.Op != OpOffPtr {
12989                         break
12990                 }
12991                 o := auxIntToInt64(v_0.AuxInt)
12992                 p1 := v_0.Args[0]
12993                 if v_1.Op != OpZero {
12994                         break
12995                 }
12996                 n := auxIntToInt64(v_1.AuxInt)
12997                 p2 := v_1.Args[0]
12998                 if !(t1.IsBoolean() && isSamePtr(p1, p2) && n >= o+1) {
12999                         break
13000                 }
13001                 v.reset(OpConstBool)
13002                 v.AuxInt = boolToAuxInt(false)
13003                 return true
13004         }
13005         // match: (Load <t1> (OffPtr [o] p1) (Zero [n] p2 _))
13006         // cond: is8BitInt(t1) && isSamePtr(p1, p2) && n >= o + 1
13007         // result: (Const8 [0])
13008         for {
13009                 t1 := v.Type
13010                 if v_0.Op != OpOffPtr {
13011                         break
13012                 }
13013                 o := auxIntToInt64(v_0.AuxInt)
13014                 p1 := v_0.Args[0]
13015                 if v_1.Op != OpZero {
13016                         break
13017                 }
13018                 n := auxIntToInt64(v_1.AuxInt)
13019                 p2 := v_1.Args[0]
13020                 if !(is8BitInt(t1) && isSamePtr(p1, p2) && n >= o+1) {
13021                         break
13022                 }
13023                 v.reset(OpConst8)
13024                 v.AuxInt = int8ToAuxInt(0)
13025                 return true
13026         }
13027         // match: (Load <t1> (OffPtr [o] p1) (Zero [n] p2 _))
13028         // cond: is16BitInt(t1) && isSamePtr(p1, p2) && n >= o + 2
13029         // result: (Const16 [0])
13030         for {
13031                 t1 := v.Type
13032                 if v_0.Op != OpOffPtr {
13033                         break
13034                 }
13035                 o := auxIntToInt64(v_0.AuxInt)
13036                 p1 := v_0.Args[0]
13037                 if v_1.Op != OpZero {
13038                         break
13039                 }
13040                 n := auxIntToInt64(v_1.AuxInt)
13041                 p2 := v_1.Args[0]
13042                 if !(is16BitInt(t1) && isSamePtr(p1, p2) && n >= o+2) {
13043                         break
13044                 }
13045                 v.reset(OpConst16)
13046                 v.AuxInt = int16ToAuxInt(0)
13047                 return true
13048         }
13049         // match: (Load <t1> (OffPtr [o] p1) (Zero [n] p2 _))
13050         // cond: is32BitInt(t1) && isSamePtr(p1, p2) && n >= o + 4
13051         // result: (Const32 [0])
13052         for {
13053                 t1 := v.Type
13054                 if v_0.Op != OpOffPtr {
13055                         break
13056                 }
13057                 o := auxIntToInt64(v_0.AuxInt)
13058                 p1 := v_0.Args[0]
13059                 if v_1.Op != OpZero {
13060                         break
13061                 }
13062                 n := auxIntToInt64(v_1.AuxInt)
13063                 p2 := v_1.Args[0]
13064                 if !(is32BitInt(t1) && isSamePtr(p1, p2) && n >= o+4) {
13065                         break
13066                 }
13067                 v.reset(OpConst32)
13068                 v.AuxInt = int32ToAuxInt(0)
13069                 return true
13070         }
13071         // match: (Load <t1> (OffPtr [o] p1) (Zero [n] p2 _))
13072         // cond: is64BitInt(t1) && isSamePtr(p1, p2) && n >= o + 8
13073         // result: (Const64 [0])
13074         for {
13075                 t1 := v.Type
13076                 if v_0.Op != OpOffPtr {
13077                         break
13078                 }
13079                 o := auxIntToInt64(v_0.AuxInt)
13080                 p1 := v_0.Args[0]
13081                 if v_1.Op != OpZero {
13082                         break
13083                 }
13084                 n := auxIntToInt64(v_1.AuxInt)
13085                 p2 := v_1.Args[0]
13086                 if !(is64BitInt(t1) && isSamePtr(p1, p2) && n >= o+8) {
13087                         break
13088                 }
13089                 v.reset(OpConst64)
13090                 v.AuxInt = int64ToAuxInt(0)
13091                 return true
13092         }
13093         // match: (Load <t1> (OffPtr [o] p1) (Zero [n] p2 _))
13094         // cond: is32BitFloat(t1) && isSamePtr(p1, p2) && n >= o + 4
13095         // result: (Const32F [0])
13096         for {
13097                 t1 := v.Type
13098                 if v_0.Op != OpOffPtr {
13099                         break
13100                 }
13101                 o := auxIntToInt64(v_0.AuxInt)
13102                 p1 := v_0.Args[0]
13103                 if v_1.Op != OpZero {
13104                         break
13105                 }
13106                 n := auxIntToInt64(v_1.AuxInt)
13107                 p2 := v_1.Args[0]
13108                 if !(is32BitFloat(t1) && isSamePtr(p1, p2) && n >= o+4) {
13109                         break
13110                 }
13111                 v.reset(OpConst32F)
13112                 v.AuxInt = float32ToAuxInt(0)
13113                 return true
13114         }
13115         // match: (Load <t1> (OffPtr [o] p1) (Zero [n] p2 _))
13116         // cond: is64BitFloat(t1) && isSamePtr(p1, p2) && n >= o + 8
13117         // result: (Const64F [0])
13118         for {
13119                 t1 := v.Type
13120                 if v_0.Op != OpOffPtr {
13121                         break
13122                 }
13123                 o := auxIntToInt64(v_0.AuxInt)
13124                 p1 := v_0.Args[0]
13125                 if v_1.Op != OpZero {
13126                         break
13127                 }
13128                 n := auxIntToInt64(v_1.AuxInt)
13129                 p2 := v_1.Args[0]
13130                 if !(is64BitFloat(t1) && isSamePtr(p1, p2) && n >= o+8) {
13131                         break
13132                 }
13133                 v.reset(OpConst64F)
13134                 v.AuxInt = float64ToAuxInt(0)
13135                 return true
13136         }
13137         // match: (Load <t> _ _)
13138         // cond: t.IsStruct() && t.NumFields() == 0 && fe.CanSSA(t)
13139         // result: (StructMake0)
13140         for {
13141                 t := v.Type
13142                 if !(t.IsStruct() && t.NumFields() == 0 && fe.CanSSA(t)) {
13143                         break
13144                 }
13145                 v.reset(OpStructMake0)
13146                 return true
13147         }
13148         // match: (Load <t> ptr mem)
13149         // cond: t.IsStruct() && t.NumFields() == 1 && fe.CanSSA(t)
13150         // result: (StructMake1 (Load <t.FieldType(0)> (OffPtr <t.FieldType(0).PtrTo()> [0] ptr) mem))
13151         for {
13152                 t := v.Type
13153                 ptr := v_0
13154                 mem := v_1
13155                 if !(t.IsStruct() && t.NumFields() == 1 && fe.CanSSA(t)) {
13156                         break
13157                 }
13158                 v.reset(OpStructMake1)
13159                 v0 := b.NewValue0(v.Pos, OpLoad, t.FieldType(0))
13160                 v1 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(0).PtrTo())
13161                 v1.AuxInt = int64ToAuxInt(0)
13162                 v1.AddArg(ptr)
13163                 v0.AddArg2(v1, mem)
13164                 v.AddArg(v0)
13165                 return true
13166         }
13167         // match: (Load <t> ptr mem)
13168         // cond: t.IsStruct() && t.NumFields() == 2 && fe.CanSSA(t)
13169         // result: (StructMake2 (Load <t.FieldType(0)> (OffPtr <t.FieldType(0).PtrTo()> [0] ptr) mem) (Load <t.FieldType(1)> (OffPtr <t.FieldType(1).PtrTo()> [t.FieldOff(1)] ptr) mem))
13170         for {
13171                 t := v.Type
13172                 ptr := v_0
13173                 mem := v_1
13174                 if !(t.IsStruct() && t.NumFields() == 2 && fe.CanSSA(t)) {
13175                         break
13176                 }
13177                 v.reset(OpStructMake2)
13178                 v0 := b.NewValue0(v.Pos, OpLoad, t.FieldType(0))
13179                 v1 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(0).PtrTo())
13180                 v1.AuxInt = int64ToAuxInt(0)
13181                 v1.AddArg(ptr)
13182                 v0.AddArg2(v1, mem)
13183                 v2 := b.NewValue0(v.Pos, OpLoad, t.FieldType(1))
13184                 v3 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(1).PtrTo())
13185                 v3.AuxInt = int64ToAuxInt(t.FieldOff(1))
13186                 v3.AddArg(ptr)
13187                 v2.AddArg2(v3, mem)
13188                 v.AddArg2(v0, v2)
13189                 return true
13190         }
13191         // match: (Load <t> ptr mem)
13192         // cond: t.IsStruct() && t.NumFields() == 3 && fe.CanSSA(t)
13193         // result: (StructMake3 (Load <t.FieldType(0)> (OffPtr <t.FieldType(0).PtrTo()> [0] ptr) mem) (Load <t.FieldType(1)> (OffPtr <t.FieldType(1).PtrTo()> [t.FieldOff(1)] ptr) mem) (Load <t.FieldType(2)> (OffPtr <t.FieldType(2).PtrTo()> [t.FieldOff(2)] ptr) mem))
13194         for {
13195                 t := v.Type
13196                 ptr := v_0
13197                 mem := v_1
13198                 if !(t.IsStruct() && t.NumFields() == 3 && fe.CanSSA(t)) {
13199                         break
13200                 }
13201                 v.reset(OpStructMake3)
13202                 v0 := b.NewValue0(v.Pos, OpLoad, t.FieldType(0))
13203                 v1 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(0).PtrTo())
13204                 v1.AuxInt = int64ToAuxInt(0)
13205                 v1.AddArg(ptr)
13206                 v0.AddArg2(v1, mem)
13207                 v2 := b.NewValue0(v.Pos, OpLoad, t.FieldType(1))
13208                 v3 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(1).PtrTo())
13209                 v3.AuxInt = int64ToAuxInt(t.FieldOff(1))
13210                 v3.AddArg(ptr)
13211                 v2.AddArg2(v3, mem)
13212                 v4 := b.NewValue0(v.Pos, OpLoad, t.FieldType(2))
13213                 v5 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(2).PtrTo())
13214                 v5.AuxInt = int64ToAuxInt(t.FieldOff(2))
13215                 v5.AddArg(ptr)
13216                 v4.AddArg2(v5, mem)
13217                 v.AddArg3(v0, v2, v4)
13218                 return true
13219         }
13220         // match: (Load <t> ptr mem)
13221         // cond: t.IsStruct() && t.NumFields() == 4 && fe.CanSSA(t)
13222         // result: (StructMake4 (Load <t.FieldType(0)> (OffPtr <t.FieldType(0).PtrTo()> [0] ptr) mem) (Load <t.FieldType(1)> (OffPtr <t.FieldType(1).PtrTo()> [t.FieldOff(1)] ptr) mem) (Load <t.FieldType(2)> (OffPtr <t.FieldType(2).PtrTo()> [t.FieldOff(2)] ptr) mem) (Load <t.FieldType(3)> (OffPtr <t.FieldType(3).PtrTo()> [t.FieldOff(3)] ptr) mem))
13223         for {
13224                 t := v.Type
13225                 ptr := v_0
13226                 mem := v_1
13227                 if !(t.IsStruct() && t.NumFields() == 4 && fe.CanSSA(t)) {
13228                         break
13229                 }
13230                 v.reset(OpStructMake4)
13231                 v0 := b.NewValue0(v.Pos, OpLoad, t.FieldType(0))
13232                 v1 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(0).PtrTo())
13233                 v1.AuxInt = int64ToAuxInt(0)
13234                 v1.AddArg(ptr)
13235                 v0.AddArg2(v1, mem)
13236                 v2 := b.NewValue0(v.Pos, OpLoad, t.FieldType(1))
13237                 v3 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(1).PtrTo())
13238                 v3.AuxInt = int64ToAuxInt(t.FieldOff(1))
13239                 v3.AddArg(ptr)
13240                 v2.AddArg2(v3, mem)
13241                 v4 := b.NewValue0(v.Pos, OpLoad, t.FieldType(2))
13242                 v5 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(2).PtrTo())
13243                 v5.AuxInt = int64ToAuxInt(t.FieldOff(2))
13244                 v5.AddArg(ptr)
13245                 v4.AddArg2(v5, mem)
13246                 v6 := b.NewValue0(v.Pos, OpLoad, t.FieldType(3))
13247                 v7 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(3).PtrTo())
13248                 v7.AuxInt = int64ToAuxInt(t.FieldOff(3))
13249                 v7.AddArg(ptr)
13250                 v6.AddArg2(v7, mem)
13251                 v.AddArg4(v0, v2, v4, v6)
13252                 return true
13253         }
13254         // match: (Load <t> _ _)
13255         // cond: t.IsArray() && t.NumElem() == 0
13256         // result: (ArrayMake0)
13257         for {
13258                 t := v.Type
13259                 if !(t.IsArray() && t.NumElem() == 0) {
13260                         break
13261                 }
13262                 v.reset(OpArrayMake0)
13263                 return true
13264         }
13265         // match: (Load <t> ptr mem)
13266         // cond: t.IsArray() && t.NumElem() == 1 && fe.CanSSA(t)
13267         // result: (ArrayMake1 (Load <t.Elem()> ptr mem))
13268         for {
13269                 t := v.Type
13270                 ptr := v_0
13271                 mem := v_1
13272                 if !(t.IsArray() && t.NumElem() == 1 && fe.CanSSA(t)) {
13273                         break
13274                 }
13275                 v.reset(OpArrayMake1)
13276                 v0 := b.NewValue0(v.Pos, OpLoad, t.Elem())
13277                 v0.AddArg2(ptr, mem)
13278                 v.AddArg(v0)
13279                 return true
13280         }
13281         // match: (Load <t> (OffPtr [off] (Addr {s} sb) ) _)
13282         // cond: t.IsUintptr() && isFixedSym(s, off)
13283         // result: (Addr {fixedSym(b.Func, s, off)} sb)
13284         for {
13285                 t := v.Type
13286                 if v_0.Op != OpOffPtr {
13287                         break
13288                 }
13289                 off := auxIntToInt64(v_0.AuxInt)
13290                 v_0_0 := v_0.Args[0]
13291                 if v_0_0.Op != OpAddr {
13292                         break
13293                 }
13294                 s := auxToSym(v_0_0.Aux)
13295                 sb := v_0_0.Args[0]
13296                 if !(t.IsUintptr() && isFixedSym(s, off)) {
13297                         break
13298                 }
13299                 v.reset(OpAddr)
13300                 v.Aux = symToAux(fixedSym(b.Func, s, off))
13301                 v.AddArg(sb)
13302                 return true
13303         }
13304         // match: (Load <t> (OffPtr [off] (Convert (Addr {s} sb) _) ) _)
13305         // cond: t.IsUintptr() && isFixedSym(s, off)
13306         // result: (Addr {fixedSym(b.Func, s, off)} sb)
13307         for {
13308                 t := v.Type
13309                 if v_0.Op != OpOffPtr {
13310                         break
13311                 }
13312                 off := auxIntToInt64(v_0.AuxInt)
13313                 v_0_0 := v_0.Args[0]
13314                 if v_0_0.Op != OpConvert {
13315                         break
13316                 }
13317                 v_0_0_0 := v_0_0.Args[0]
13318                 if v_0_0_0.Op != OpAddr {
13319                         break
13320                 }
13321                 s := auxToSym(v_0_0_0.Aux)
13322                 sb := v_0_0_0.Args[0]
13323                 if !(t.IsUintptr() && isFixedSym(s, off)) {
13324                         break
13325                 }
13326                 v.reset(OpAddr)
13327                 v.Aux = symToAux(fixedSym(b.Func, s, off))
13328                 v.AddArg(sb)
13329                 return true
13330         }
13331         // match: (Load <t> (OffPtr [off] (ITab (IMake (Addr {s} sb) _))) _)
13332         // cond: t.IsUintptr() && isFixedSym(s, off)
13333         // result: (Addr {fixedSym(b.Func, s, off)} sb)
13334         for {
13335                 t := v.Type
13336                 if v_0.Op != OpOffPtr {
13337                         break
13338                 }
13339                 off := auxIntToInt64(v_0.AuxInt)
13340                 v_0_0 := v_0.Args[0]
13341                 if v_0_0.Op != OpITab {
13342                         break
13343                 }
13344                 v_0_0_0 := v_0_0.Args[0]
13345                 if v_0_0_0.Op != OpIMake {
13346                         break
13347                 }
13348                 v_0_0_0_0 := v_0_0_0.Args[0]
13349                 if v_0_0_0_0.Op != OpAddr {
13350                         break
13351                 }
13352                 s := auxToSym(v_0_0_0_0.Aux)
13353                 sb := v_0_0_0_0.Args[0]
13354                 if !(t.IsUintptr() && isFixedSym(s, off)) {
13355                         break
13356                 }
13357                 v.reset(OpAddr)
13358                 v.Aux = symToAux(fixedSym(b.Func, s, off))
13359                 v.AddArg(sb)
13360                 return true
13361         }
13362         // match: (Load <t> (OffPtr [off] (ITab (IMake (Convert (Addr {s} sb) _) _))) _)
13363         // cond: t.IsUintptr() && isFixedSym(s, off)
13364         // result: (Addr {fixedSym(b.Func, s, off)} sb)
13365         for {
13366                 t := v.Type
13367                 if v_0.Op != OpOffPtr {
13368                         break
13369                 }
13370                 off := auxIntToInt64(v_0.AuxInt)
13371                 v_0_0 := v_0.Args[0]
13372                 if v_0_0.Op != OpITab {
13373                         break
13374                 }
13375                 v_0_0_0 := v_0_0.Args[0]
13376                 if v_0_0_0.Op != OpIMake {
13377                         break
13378                 }
13379                 v_0_0_0_0 := v_0_0_0.Args[0]
13380                 if v_0_0_0_0.Op != OpConvert {
13381                         break
13382                 }
13383                 v_0_0_0_0_0 := v_0_0_0_0.Args[0]
13384                 if v_0_0_0_0_0.Op != OpAddr {
13385                         break
13386                 }
13387                 s := auxToSym(v_0_0_0_0_0.Aux)
13388                 sb := v_0_0_0_0_0.Args[0]
13389                 if !(t.IsUintptr() && isFixedSym(s, off)) {
13390                         break
13391                 }
13392                 v.reset(OpAddr)
13393                 v.Aux = symToAux(fixedSym(b.Func, s, off))
13394                 v.AddArg(sb)
13395                 return true
13396         }
13397         // match: (Load <t> (OffPtr [off] (Addr {sym} _) ) _)
13398         // cond: t.IsInteger() && t.Size() == 4 && isFixed32(config, sym, off)
13399         // result: (Const32 [fixed32(config, sym, off)])
13400         for {
13401                 t := v.Type
13402                 if v_0.Op != OpOffPtr {
13403                         break
13404                 }
13405                 off := auxIntToInt64(v_0.AuxInt)
13406                 v_0_0 := v_0.Args[0]
13407                 if v_0_0.Op != OpAddr {
13408                         break
13409                 }
13410                 sym := auxToSym(v_0_0.Aux)
13411                 if !(t.IsInteger() && t.Size() == 4 && isFixed32(config, sym, off)) {
13412                         break
13413                 }
13414                 v.reset(OpConst32)
13415                 v.AuxInt = int32ToAuxInt(fixed32(config, sym, off))
13416                 return true
13417         }
13418         // match: (Load <t> (OffPtr [off] (Convert (Addr {sym} _) _) ) _)
13419         // cond: t.IsInteger() && t.Size() == 4 && isFixed32(config, sym, off)
13420         // result: (Const32 [fixed32(config, sym, off)])
13421         for {
13422                 t := v.Type
13423                 if v_0.Op != OpOffPtr {
13424                         break
13425                 }
13426                 off := auxIntToInt64(v_0.AuxInt)
13427                 v_0_0 := v_0.Args[0]
13428                 if v_0_0.Op != OpConvert {
13429                         break
13430                 }
13431                 v_0_0_0 := v_0_0.Args[0]
13432                 if v_0_0_0.Op != OpAddr {
13433                         break
13434                 }
13435                 sym := auxToSym(v_0_0_0.Aux)
13436                 if !(t.IsInteger() && t.Size() == 4 && isFixed32(config, sym, off)) {
13437                         break
13438                 }
13439                 v.reset(OpConst32)
13440                 v.AuxInt = int32ToAuxInt(fixed32(config, sym, off))
13441                 return true
13442         }
13443         // match: (Load <t> (OffPtr [off] (ITab (IMake (Addr {sym} _) _))) _)
13444         // cond: t.IsInteger() && t.Size() == 4 && isFixed32(config, sym, off)
13445         // result: (Const32 [fixed32(config, sym, off)])
13446         for {
13447                 t := v.Type
13448                 if v_0.Op != OpOffPtr {
13449                         break
13450                 }
13451                 off := auxIntToInt64(v_0.AuxInt)
13452                 v_0_0 := v_0.Args[0]
13453                 if v_0_0.Op != OpITab {
13454                         break
13455                 }
13456                 v_0_0_0 := v_0_0.Args[0]
13457                 if v_0_0_0.Op != OpIMake {
13458                         break
13459                 }
13460                 v_0_0_0_0 := v_0_0_0.Args[0]
13461                 if v_0_0_0_0.Op != OpAddr {
13462                         break
13463                 }
13464                 sym := auxToSym(v_0_0_0_0.Aux)
13465                 if !(t.IsInteger() && t.Size() == 4 && isFixed32(config, sym, off)) {
13466                         break
13467                 }
13468                 v.reset(OpConst32)
13469                 v.AuxInt = int32ToAuxInt(fixed32(config, sym, off))
13470                 return true
13471         }
13472         // match: (Load <t> (OffPtr [off] (ITab (IMake (Convert (Addr {sym} _) _) _))) _)
13473         // cond: t.IsInteger() && t.Size() == 4 && isFixed32(config, sym, off)
13474         // result: (Const32 [fixed32(config, sym, off)])
13475         for {
13476                 t := v.Type
13477                 if v_0.Op != OpOffPtr {
13478                         break
13479                 }
13480                 off := auxIntToInt64(v_0.AuxInt)
13481                 v_0_0 := v_0.Args[0]
13482                 if v_0_0.Op != OpITab {
13483                         break
13484                 }
13485                 v_0_0_0 := v_0_0.Args[0]
13486                 if v_0_0_0.Op != OpIMake {
13487                         break
13488                 }
13489                 v_0_0_0_0 := v_0_0_0.Args[0]
13490                 if v_0_0_0_0.Op != OpConvert {
13491                         break
13492                 }
13493                 v_0_0_0_0_0 := v_0_0_0_0.Args[0]
13494                 if v_0_0_0_0_0.Op != OpAddr {
13495                         break
13496                 }
13497                 sym := auxToSym(v_0_0_0_0_0.Aux)
13498                 if !(t.IsInteger() && t.Size() == 4 && isFixed32(config, sym, off)) {
13499                         break
13500                 }
13501                 v.reset(OpConst32)
13502                 v.AuxInt = int32ToAuxInt(fixed32(config, sym, off))
13503                 return true
13504         }
13505         return false
13506 }
13507 func rewriteValuegeneric_OpLsh16x16(v *Value) bool {
13508         v_1 := v.Args[1]
13509         v_0 := v.Args[0]
13510         b := v.Block
13511         // match: (Lsh16x16 <t> x (Const16 [c]))
13512         // result: (Lsh16x64 x (Const64 <t> [int64(uint16(c))]))
13513         for {
13514                 t := v.Type
13515                 x := v_0
13516                 if v_1.Op != OpConst16 {
13517                         break
13518                 }
13519                 c := auxIntToInt16(v_1.AuxInt)
13520                 v.reset(OpLsh16x64)
13521                 v0 := b.NewValue0(v.Pos, OpConst64, t)
13522                 v0.AuxInt = int64ToAuxInt(int64(uint16(c)))
13523                 v.AddArg2(x, v0)
13524                 return true
13525         }
13526         // match: (Lsh16x16 (Const16 [0]) _)
13527         // result: (Const16 [0])
13528         for {
13529                 if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
13530                         break
13531                 }
13532                 v.reset(OpConst16)
13533                 v.AuxInt = int16ToAuxInt(0)
13534                 return true
13535         }
13536         return false
13537 }
13538 func rewriteValuegeneric_OpLsh16x32(v *Value) bool {
13539         v_1 := v.Args[1]
13540         v_0 := v.Args[0]
13541         b := v.Block
13542         // match: (Lsh16x32 <t> x (Const32 [c]))
13543         // result: (Lsh16x64 x (Const64 <t> [int64(uint32(c))]))
13544         for {
13545                 t := v.Type
13546                 x := v_0
13547                 if v_1.Op != OpConst32 {
13548                         break
13549                 }
13550                 c := auxIntToInt32(v_1.AuxInt)
13551                 v.reset(OpLsh16x64)
13552                 v0 := b.NewValue0(v.Pos, OpConst64, t)
13553                 v0.AuxInt = int64ToAuxInt(int64(uint32(c)))
13554                 v.AddArg2(x, v0)
13555                 return true
13556         }
13557         // match: (Lsh16x32 (Const16 [0]) _)
13558         // result: (Const16 [0])
13559         for {
13560                 if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
13561                         break
13562                 }
13563                 v.reset(OpConst16)
13564                 v.AuxInt = int16ToAuxInt(0)
13565                 return true
13566         }
13567         return false
13568 }
13569 func rewriteValuegeneric_OpLsh16x64(v *Value) bool {
13570         v_1 := v.Args[1]
13571         v_0 := v.Args[0]
13572         b := v.Block
13573         typ := &b.Func.Config.Types
13574         // match: (Lsh16x64 (Const16 [c]) (Const64 [d]))
13575         // result: (Const16 [c << uint64(d)])
13576         for {
13577                 if v_0.Op != OpConst16 {
13578                         break
13579                 }
13580                 c := auxIntToInt16(v_0.AuxInt)
13581                 if v_1.Op != OpConst64 {
13582                         break
13583                 }
13584                 d := auxIntToInt64(v_1.AuxInt)
13585                 v.reset(OpConst16)
13586                 v.AuxInt = int16ToAuxInt(c << uint64(d))
13587                 return true
13588         }
13589         // match: (Lsh16x64 x (Const64 [0]))
13590         // result: x
13591         for {
13592                 x := v_0
13593                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 0 {
13594                         break
13595                 }
13596                 v.copyOf(x)
13597                 return true
13598         }
13599         // match: (Lsh16x64 (Const16 [0]) _)
13600         // result: (Const16 [0])
13601         for {
13602                 if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
13603                         break
13604                 }
13605                 v.reset(OpConst16)
13606                 v.AuxInt = int16ToAuxInt(0)
13607                 return true
13608         }
13609         // match: (Lsh16x64 _ (Const64 [c]))
13610         // cond: uint64(c) >= 16
13611         // result: (Const16 [0])
13612         for {
13613                 if v_1.Op != OpConst64 {
13614                         break
13615                 }
13616                 c := auxIntToInt64(v_1.AuxInt)
13617                 if !(uint64(c) >= 16) {
13618                         break
13619                 }
13620                 v.reset(OpConst16)
13621                 v.AuxInt = int16ToAuxInt(0)
13622                 return true
13623         }
13624         // match: (Lsh16x64 <t> (Lsh16x64 x (Const64 [c])) (Const64 [d]))
13625         // cond: !uaddOvf(c,d)
13626         // result: (Lsh16x64 x (Const64 <t> [c+d]))
13627         for {
13628                 t := v.Type
13629                 if v_0.Op != OpLsh16x64 {
13630                         break
13631                 }
13632                 _ = v_0.Args[1]
13633                 x := v_0.Args[0]
13634                 v_0_1 := v_0.Args[1]
13635                 if v_0_1.Op != OpConst64 {
13636                         break
13637                 }
13638                 c := auxIntToInt64(v_0_1.AuxInt)
13639                 if v_1.Op != OpConst64 {
13640                         break
13641                 }
13642                 d := auxIntToInt64(v_1.AuxInt)
13643                 if !(!uaddOvf(c, d)) {
13644                         break
13645                 }
13646                 v.reset(OpLsh16x64)
13647                 v0 := b.NewValue0(v.Pos, OpConst64, t)
13648                 v0.AuxInt = int64ToAuxInt(c + d)
13649                 v.AddArg2(x, v0)
13650                 return true
13651         }
13652         // match: (Lsh16x64 i:(Rsh16x64 x (Const64 [c])) (Const64 [c]))
13653         // cond: c >= 0 && c < 16 && i.Uses == 1
13654         // result: (And16 x (Const16 <v.Type> [int16(-1) << c]))
13655         for {
13656                 i := v_0
13657                 if i.Op != OpRsh16x64 {
13658                         break
13659                 }
13660                 _ = i.Args[1]
13661                 x := i.Args[0]
13662                 i_1 := i.Args[1]
13663                 if i_1.Op != OpConst64 {
13664                         break
13665                 }
13666                 c := auxIntToInt64(i_1.AuxInt)
13667                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != c || !(c >= 0 && c < 16 && i.Uses == 1) {
13668                         break
13669                 }
13670                 v.reset(OpAnd16)
13671                 v0 := b.NewValue0(v.Pos, OpConst16, v.Type)
13672                 v0.AuxInt = int16ToAuxInt(int16(-1) << c)
13673                 v.AddArg2(x, v0)
13674                 return true
13675         }
13676         // match: (Lsh16x64 i:(Rsh16Ux64 x (Const64 [c])) (Const64 [c]))
13677         // cond: c >= 0 && c < 16 && i.Uses == 1
13678         // result: (And16 x (Const16 <v.Type> [int16(-1) << c]))
13679         for {
13680                 i := v_0
13681                 if i.Op != OpRsh16Ux64 {
13682                         break
13683                 }
13684                 _ = i.Args[1]
13685                 x := i.Args[0]
13686                 i_1 := i.Args[1]
13687                 if i_1.Op != OpConst64 {
13688                         break
13689                 }
13690                 c := auxIntToInt64(i_1.AuxInt)
13691                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != c || !(c >= 0 && c < 16 && i.Uses == 1) {
13692                         break
13693                 }
13694                 v.reset(OpAnd16)
13695                 v0 := b.NewValue0(v.Pos, OpConst16, v.Type)
13696                 v0.AuxInt = int16ToAuxInt(int16(-1) << c)
13697                 v.AddArg2(x, v0)
13698                 return true
13699         }
13700         // match: (Lsh16x64 (Rsh16Ux64 (Lsh16x64 x (Const64 [c1])) (Const64 [c2])) (Const64 [c3]))
13701         // cond: uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)
13702         // result: (Lsh16x64 x (Const64 <typ.UInt64> [c1-c2+c3]))
13703         for {
13704                 if v_0.Op != OpRsh16Ux64 {
13705                         break
13706                 }
13707                 _ = v_0.Args[1]
13708                 v_0_0 := v_0.Args[0]
13709                 if v_0_0.Op != OpLsh16x64 {
13710                         break
13711                 }
13712                 _ = v_0_0.Args[1]
13713                 x := v_0_0.Args[0]
13714                 v_0_0_1 := v_0_0.Args[1]
13715                 if v_0_0_1.Op != OpConst64 {
13716                         break
13717                 }
13718                 c1 := auxIntToInt64(v_0_0_1.AuxInt)
13719                 v_0_1 := v_0.Args[1]
13720                 if v_0_1.Op != OpConst64 {
13721                         break
13722                 }
13723                 c2 := auxIntToInt64(v_0_1.AuxInt)
13724                 if v_1.Op != OpConst64 {
13725                         break
13726                 }
13727                 c3 := auxIntToInt64(v_1.AuxInt)
13728                 if !(uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)) {
13729                         break
13730                 }
13731                 v.reset(OpLsh16x64)
13732                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
13733                 v0.AuxInt = int64ToAuxInt(c1 - c2 + c3)
13734                 v.AddArg2(x, v0)
13735                 return true
13736         }
13737         return false
13738 }
13739 func rewriteValuegeneric_OpLsh16x8(v *Value) bool {
13740         v_1 := v.Args[1]
13741         v_0 := v.Args[0]
13742         b := v.Block
13743         // match: (Lsh16x8 <t> x (Const8 [c]))
13744         // result: (Lsh16x64 x (Const64 <t> [int64(uint8(c))]))
13745         for {
13746                 t := v.Type
13747                 x := v_0
13748                 if v_1.Op != OpConst8 {
13749                         break
13750                 }
13751                 c := auxIntToInt8(v_1.AuxInt)
13752                 v.reset(OpLsh16x64)
13753                 v0 := b.NewValue0(v.Pos, OpConst64, t)
13754                 v0.AuxInt = int64ToAuxInt(int64(uint8(c)))
13755                 v.AddArg2(x, v0)
13756                 return true
13757         }
13758         // match: (Lsh16x8 (Const16 [0]) _)
13759         // result: (Const16 [0])
13760         for {
13761                 if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
13762                         break
13763                 }
13764                 v.reset(OpConst16)
13765                 v.AuxInt = int16ToAuxInt(0)
13766                 return true
13767         }
13768         return false
13769 }
13770 func rewriteValuegeneric_OpLsh32x16(v *Value) bool {
13771         v_1 := v.Args[1]
13772         v_0 := v.Args[0]
13773         b := v.Block
13774         // match: (Lsh32x16 <t> x (Const16 [c]))
13775         // result: (Lsh32x64 x (Const64 <t> [int64(uint16(c))]))
13776         for {
13777                 t := v.Type
13778                 x := v_0
13779                 if v_1.Op != OpConst16 {
13780                         break
13781                 }
13782                 c := auxIntToInt16(v_1.AuxInt)
13783                 v.reset(OpLsh32x64)
13784                 v0 := b.NewValue0(v.Pos, OpConst64, t)
13785                 v0.AuxInt = int64ToAuxInt(int64(uint16(c)))
13786                 v.AddArg2(x, v0)
13787                 return true
13788         }
13789         // match: (Lsh32x16 (Const32 [0]) _)
13790         // result: (Const32 [0])
13791         for {
13792                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
13793                         break
13794                 }
13795                 v.reset(OpConst32)
13796                 v.AuxInt = int32ToAuxInt(0)
13797                 return true
13798         }
13799         return false
13800 }
13801 func rewriteValuegeneric_OpLsh32x32(v *Value) bool {
13802         v_1 := v.Args[1]
13803         v_0 := v.Args[0]
13804         b := v.Block
13805         // match: (Lsh32x32 <t> x (Const32 [c]))
13806         // result: (Lsh32x64 x (Const64 <t> [int64(uint32(c))]))
13807         for {
13808                 t := v.Type
13809                 x := v_0
13810                 if v_1.Op != OpConst32 {
13811                         break
13812                 }
13813                 c := auxIntToInt32(v_1.AuxInt)
13814                 v.reset(OpLsh32x64)
13815                 v0 := b.NewValue0(v.Pos, OpConst64, t)
13816                 v0.AuxInt = int64ToAuxInt(int64(uint32(c)))
13817                 v.AddArg2(x, v0)
13818                 return true
13819         }
13820         // match: (Lsh32x32 (Const32 [0]) _)
13821         // result: (Const32 [0])
13822         for {
13823                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
13824                         break
13825                 }
13826                 v.reset(OpConst32)
13827                 v.AuxInt = int32ToAuxInt(0)
13828                 return true
13829         }
13830         return false
13831 }
13832 func rewriteValuegeneric_OpLsh32x64(v *Value) bool {
13833         v_1 := v.Args[1]
13834         v_0 := v.Args[0]
13835         b := v.Block
13836         typ := &b.Func.Config.Types
13837         // match: (Lsh32x64 (Const32 [c]) (Const64 [d]))
13838         // result: (Const32 [c << uint64(d)])
13839         for {
13840                 if v_0.Op != OpConst32 {
13841                         break
13842                 }
13843                 c := auxIntToInt32(v_0.AuxInt)
13844                 if v_1.Op != OpConst64 {
13845                         break
13846                 }
13847                 d := auxIntToInt64(v_1.AuxInt)
13848                 v.reset(OpConst32)
13849                 v.AuxInt = int32ToAuxInt(c << uint64(d))
13850                 return true
13851         }
13852         // match: (Lsh32x64 x (Const64 [0]))
13853         // result: x
13854         for {
13855                 x := v_0
13856                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 0 {
13857                         break
13858                 }
13859                 v.copyOf(x)
13860                 return true
13861         }
13862         // match: (Lsh32x64 (Const32 [0]) _)
13863         // result: (Const32 [0])
13864         for {
13865                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
13866                         break
13867                 }
13868                 v.reset(OpConst32)
13869                 v.AuxInt = int32ToAuxInt(0)
13870                 return true
13871         }
13872         // match: (Lsh32x64 _ (Const64 [c]))
13873         // cond: uint64(c) >= 32
13874         // result: (Const32 [0])
13875         for {
13876                 if v_1.Op != OpConst64 {
13877                         break
13878                 }
13879                 c := auxIntToInt64(v_1.AuxInt)
13880                 if !(uint64(c) >= 32) {
13881                         break
13882                 }
13883                 v.reset(OpConst32)
13884                 v.AuxInt = int32ToAuxInt(0)
13885                 return true
13886         }
13887         // match: (Lsh32x64 <t> (Lsh32x64 x (Const64 [c])) (Const64 [d]))
13888         // cond: !uaddOvf(c,d)
13889         // result: (Lsh32x64 x (Const64 <t> [c+d]))
13890         for {
13891                 t := v.Type
13892                 if v_0.Op != OpLsh32x64 {
13893                         break
13894                 }
13895                 _ = v_0.Args[1]
13896                 x := v_0.Args[0]
13897                 v_0_1 := v_0.Args[1]
13898                 if v_0_1.Op != OpConst64 {
13899                         break
13900                 }
13901                 c := auxIntToInt64(v_0_1.AuxInt)
13902                 if v_1.Op != OpConst64 {
13903                         break
13904                 }
13905                 d := auxIntToInt64(v_1.AuxInt)
13906                 if !(!uaddOvf(c, d)) {
13907                         break
13908                 }
13909                 v.reset(OpLsh32x64)
13910                 v0 := b.NewValue0(v.Pos, OpConst64, t)
13911                 v0.AuxInt = int64ToAuxInt(c + d)
13912                 v.AddArg2(x, v0)
13913                 return true
13914         }
13915         // match: (Lsh32x64 i:(Rsh32x64 x (Const64 [c])) (Const64 [c]))
13916         // cond: c >= 0 && c < 32 && i.Uses == 1
13917         // result: (And32 x (Const32 <v.Type> [int32(-1) << c]))
13918         for {
13919                 i := v_0
13920                 if i.Op != OpRsh32x64 {
13921                         break
13922                 }
13923                 _ = i.Args[1]
13924                 x := i.Args[0]
13925                 i_1 := i.Args[1]
13926                 if i_1.Op != OpConst64 {
13927                         break
13928                 }
13929                 c := auxIntToInt64(i_1.AuxInt)
13930                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != c || !(c >= 0 && c < 32 && i.Uses == 1) {
13931                         break
13932                 }
13933                 v.reset(OpAnd32)
13934                 v0 := b.NewValue0(v.Pos, OpConst32, v.Type)
13935                 v0.AuxInt = int32ToAuxInt(int32(-1) << c)
13936                 v.AddArg2(x, v0)
13937                 return true
13938         }
13939         // match: (Lsh32x64 i:(Rsh32Ux64 x (Const64 [c])) (Const64 [c]))
13940         // cond: c >= 0 && c < 32 && i.Uses == 1
13941         // result: (And32 x (Const32 <v.Type> [int32(-1) << c]))
13942         for {
13943                 i := v_0
13944                 if i.Op != OpRsh32Ux64 {
13945                         break
13946                 }
13947                 _ = i.Args[1]
13948                 x := i.Args[0]
13949                 i_1 := i.Args[1]
13950                 if i_1.Op != OpConst64 {
13951                         break
13952                 }
13953                 c := auxIntToInt64(i_1.AuxInt)
13954                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != c || !(c >= 0 && c < 32 && i.Uses == 1) {
13955                         break
13956                 }
13957                 v.reset(OpAnd32)
13958                 v0 := b.NewValue0(v.Pos, OpConst32, v.Type)
13959                 v0.AuxInt = int32ToAuxInt(int32(-1) << c)
13960                 v.AddArg2(x, v0)
13961                 return true
13962         }
13963         // match: (Lsh32x64 (Rsh32Ux64 (Lsh32x64 x (Const64 [c1])) (Const64 [c2])) (Const64 [c3]))
13964         // cond: uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)
13965         // result: (Lsh32x64 x (Const64 <typ.UInt64> [c1-c2+c3]))
13966         for {
13967                 if v_0.Op != OpRsh32Ux64 {
13968                         break
13969                 }
13970                 _ = v_0.Args[1]
13971                 v_0_0 := v_0.Args[0]
13972                 if v_0_0.Op != OpLsh32x64 {
13973                         break
13974                 }
13975                 _ = v_0_0.Args[1]
13976                 x := v_0_0.Args[0]
13977                 v_0_0_1 := v_0_0.Args[1]
13978                 if v_0_0_1.Op != OpConst64 {
13979                         break
13980                 }
13981                 c1 := auxIntToInt64(v_0_0_1.AuxInt)
13982                 v_0_1 := v_0.Args[1]
13983                 if v_0_1.Op != OpConst64 {
13984                         break
13985                 }
13986                 c2 := auxIntToInt64(v_0_1.AuxInt)
13987                 if v_1.Op != OpConst64 {
13988                         break
13989                 }
13990                 c3 := auxIntToInt64(v_1.AuxInt)
13991                 if !(uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)) {
13992                         break
13993                 }
13994                 v.reset(OpLsh32x64)
13995                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
13996                 v0.AuxInt = int64ToAuxInt(c1 - c2 + c3)
13997                 v.AddArg2(x, v0)
13998                 return true
13999         }
14000         return false
14001 }
14002 func rewriteValuegeneric_OpLsh32x8(v *Value) bool {
14003         v_1 := v.Args[1]
14004         v_0 := v.Args[0]
14005         b := v.Block
14006         // match: (Lsh32x8 <t> x (Const8 [c]))
14007         // result: (Lsh32x64 x (Const64 <t> [int64(uint8(c))]))
14008         for {
14009                 t := v.Type
14010                 x := v_0
14011                 if v_1.Op != OpConst8 {
14012                         break
14013                 }
14014                 c := auxIntToInt8(v_1.AuxInt)
14015                 v.reset(OpLsh32x64)
14016                 v0 := b.NewValue0(v.Pos, OpConst64, t)
14017                 v0.AuxInt = int64ToAuxInt(int64(uint8(c)))
14018                 v.AddArg2(x, v0)
14019                 return true
14020         }
14021         // match: (Lsh32x8 (Const32 [0]) _)
14022         // result: (Const32 [0])
14023         for {
14024                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
14025                         break
14026                 }
14027                 v.reset(OpConst32)
14028                 v.AuxInt = int32ToAuxInt(0)
14029                 return true
14030         }
14031         return false
14032 }
14033 func rewriteValuegeneric_OpLsh64x16(v *Value) bool {
14034         v_1 := v.Args[1]
14035         v_0 := v.Args[0]
14036         b := v.Block
14037         // match: (Lsh64x16 <t> x (Const16 [c]))
14038         // result: (Lsh64x64 x (Const64 <t> [int64(uint16(c))]))
14039         for {
14040                 t := v.Type
14041                 x := v_0
14042                 if v_1.Op != OpConst16 {
14043                         break
14044                 }
14045                 c := auxIntToInt16(v_1.AuxInt)
14046                 v.reset(OpLsh64x64)
14047                 v0 := b.NewValue0(v.Pos, OpConst64, t)
14048                 v0.AuxInt = int64ToAuxInt(int64(uint16(c)))
14049                 v.AddArg2(x, v0)
14050                 return true
14051         }
14052         // match: (Lsh64x16 (Const64 [0]) _)
14053         // result: (Const64 [0])
14054         for {
14055                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
14056                         break
14057                 }
14058                 v.reset(OpConst64)
14059                 v.AuxInt = int64ToAuxInt(0)
14060                 return true
14061         }
14062         return false
14063 }
14064 func rewriteValuegeneric_OpLsh64x32(v *Value) bool {
14065         v_1 := v.Args[1]
14066         v_0 := v.Args[0]
14067         b := v.Block
14068         // match: (Lsh64x32 <t> x (Const32 [c]))
14069         // result: (Lsh64x64 x (Const64 <t> [int64(uint32(c))]))
14070         for {
14071                 t := v.Type
14072                 x := v_0
14073                 if v_1.Op != OpConst32 {
14074                         break
14075                 }
14076                 c := auxIntToInt32(v_1.AuxInt)
14077                 v.reset(OpLsh64x64)
14078                 v0 := b.NewValue0(v.Pos, OpConst64, t)
14079                 v0.AuxInt = int64ToAuxInt(int64(uint32(c)))
14080                 v.AddArg2(x, v0)
14081                 return true
14082         }
14083         // match: (Lsh64x32 (Const64 [0]) _)
14084         // result: (Const64 [0])
14085         for {
14086                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
14087                         break
14088                 }
14089                 v.reset(OpConst64)
14090                 v.AuxInt = int64ToAuxInt(0)
14091                 return true
14092         }
14093         return false
14094 }
14095 func rewriteValuegeneric_OpLsh64x64(v *Value) bool {
14096         v_1 := v.Args[1]
14097         v_0 := v.Args[0]
14098         b := v.Block
14099         typ := &b.Func.Config.Types
14100         // match: (Lsh64x64 (Const64 [c]) (Const64 [d]))
14101         // result: (Const64 [c << uint64(d)])
14102         for {
14103                 if v_0.Op != OpConst64 {
14104                         break
14105                 }
14106                 c := auxIntToInt64(v_0.AuxInt)
14107                 if v_1.Op != OpConst64 {
14108                         break
14109                 }
14110                 d := auxIntToInt64(v_1.AuxInt)
14111                 v.reset(OpConst64)
14112                 v.AuxInt = int64ToAuxInt(c << uint64(d))
14113                 return true
14114         }
14115         // match: (Lsh64x64 x (Const64 [0]))
14116         // result: x
14117         for {
14118                 x := v_0
14119                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 0 {
14120                         break
14121                 }
14122                 v.copyOf(x)
14123                 return true
14124         }
14125         // match: (Lsh64x64 (Const64 [0]) _)
14126         // result: (Const64 [0])
14127         for {
14128                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
14129                         break
14130                 }
14131                 v.reset(OpConst64)
14132                 v.AuxInt = int64ToAuxInt(0)
14133                 return true
14134         }
14135         // match: (Lsh64x64 _ (Const64 [c]))
14136         // cond: uint64(c) >= 64
14137         // result: (Const64 [0])
14138         for {
14139                 if v_1.Op != OpConst64 {
14140                         break
14141                 }
14142                 c := auxIntToInt64(v_1.AuxInt)
14143                 if !(uint64(c) >= 64) {
14144                         break
14145                 }
14146                 v.reset(OpConst64)
14147                 v.AuxInt = int64ToAuxInt(0)
14148                 return true
14149         }
14150         // match: (Lsh64x64 <t> (Lsh64x64 x (Const64 [c])) (Const64 [d]))
14151         // cond: !uaddOvf(c,d)
14152         // result: (Lsh64x64 x (Const64 <t> [c+d]))
14153         for {
14154                 t := v.Type
14155                 if v_0.Op != OpLsh64x64 {
14156                         break
14157                 }
14158                 _ = v_0.Args[1]
14159                 x := v_0.Args[0]
14160                 v_0_1 := v_0.Args[1]
14161                 if v_0_1.Op != OpConst64 {
14162                         break
14163                 }
14164                 c := auxIntToInt64(v_0_1.AuxInt)
14165                 if v_1.Op != OpConst64 {
14166                         break
14167                 }
14168                 d := auxIntToInt64(v_1.AuxInt)
14169                 if !(!uaddOvf(c, d)) {
14170                         break
14171                 }
14172                 v.reset(OpLsh64x64)
14173                 v0 := b.NewValue0(v.Pos, OpConst64, t)
14174                 v0.AuxInt = int64ToAuxInt(c + d)
14175                 v.AddArg2(x, v0)
14176                 return true
14177         }
14178         // match: (Lsh64x64 i:(Rsh64x64 x (Const64 [c])) (Const64 [c]))
14179         // cond: c >= 0 && c < 64 && i.Uses == 1
14180         // result: (And64 x (Const64 <v.Type> [int64(-1) << c]))
14181         for {
14182                 i := v_0
14183                 if i.Op != OpRsh64x64 {
14184                         break
14185                 }
14186                 _ = i.Args[1]
14187                 x := i.Args[0]
14188                 i_1 := i.Args[1]
14189                 if i_1.Op != OpConst64 {
14190                         break
14191                 }
14192                 c := auxIntToInt64(i_1.AuxInt)
14193                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != c || !(c >= 0 && c < 64 && i.Uses == 1) {
14194                         break
14195                 }
14196                 v.reset(OpAnd64)
14197                 v0 := b.NewValue0(v.Pos, OpConst64, v.Type)
14198                 v0.AuxInt = int64ToAuxInt(int64(-1) << c)
14199                 v.AddArg2(x, v0)
14200                 return true
14201         }
14202         // match: (Lsh64x64 i:(Rsh64Ux64 x (Const64 [c])) (Const64 [c]))
14203         // cond: c >= 0 && c < 64 && i.Uses == 1
14204         // result: (And64 x (Const64 <v.Type> [int64(-1) << c]))
14205         for {
14206                 i := v_0
14207                 if i.Op != OpRsh64Ux64 {
14208                         break
14209                 }
14210                 _ = i.Args[1]
14211                 x := i.Args[0]
14212                 i_1 := i.Args[1]
14213                 if i_1.Op != OpConst64 {
14214                         break
14215                 }
14216                 c := auxIntToInt64(i_1.AuxInt)
14217                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != c || !(c >= 0 && c < 64 && i.Uses == 1) {
14218                         break
14219                 }
14220                 v.reset(OpAnd64)
14221                 v0 := b.NewValue0(v.Pos, OpConst64, v.Type)
14222                 v0.AuxInt = int64ToAuxInt(int64(-1) << c)
14223                 v.AddArg2(x, v0)
14224                 return true
14225         }
14226         // match: (Lsh64x64 (Rsh64Ux64 (Lsh64x64 x (Const64 [c1])) (Const64 [c2])) (Const64 [c3]))
14227         // cond: uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)
14228         // result: (Lsh64x64 x (Const64 <typ.UInt64> [c1-c2+c3]))
14229         for {
14230                 if v_0.Op != OpRsh64Ux64 {
14231                         break
14232                 }
14233                 _ = v_0.Args[1]
14234                 v_0_0 := v_0.Args[0]
14235                 if v_0_0.Op != OpLsh64x64 {
14236                         break
14237                 }
14238                 _ = v_0_0.Args[1]
14239                 x := v_0_0.Args[0]
14240                 v_0_0_1 := v_0_0.Args[1]
14241                 if v_0_0_1.Op != OpConst64 {
14242                         break
14243                 }
14244                 c1 := auxIntToInt64(v_0_0_1.AuxInt)
14245                 v_0_1 := v_0.Args[1]
14246                 if v_0_1.Op != OpConst64 {
14247                         break
14248                 }
14249                 c2 := auxIntToInt64(v_0_1.AuxInt)
14250                 if v_1.Op != OpConst64 {
14251                         break
14252                 }
14253                 c3 := auxIntToInt64(v_1.AuxInt)
14254                 if !(uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)) {
14255                         break
14256                 }
14257                 v.reset(OpLsh64x64)
14258                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
14259                 v0.AuxInt = int64ToAuxInt(c1 - c2 + c3)
14260                 v.AddArg2(x, v0)
14261                 return true
14262         }
14263         return false
14264 }
14265 func rewriteValuegeneric_OpLsh64x8(v *Value) bool {
14266         v_1 := v.Args[1]
14267         v_0 := v.Args[0]
14268         b := v.Block
14269         // match: (Lsh64x8 <t> x (Const8 [c]))
14270         // result: (Lsh64x64 x (Const64 <t> [int64(uint8(c))]))
14271         for {
14272                 t := v.Type
14273                 x := v_0
14274                 if v_1.Op != OpConst8 {
14275                         break
14276                 }
14277                 c := auxIntToInt8(v_1.AuxInt)
14278                 v.reset(OpLsh64x64)
14279                 v0 := b.NewValue0(v.Pos, OpConst64, t)
14280                 v0.AuxInt = int64ToAuxInt(int64(uint8(c)))
14281                 v.AddArg2(x, v0)
14282                 return true
14283         }
14284         // match: (Lsh64x8 (Const64 [0]) _)
14285         // result: (Const64 [0])
14286         for {
14287                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
14288                         break
14289                 }
14290                 v.reset(OpConst64)
14291                 v.AuxInt = int64ToAuxInt(0)
14292                 return true
14293         }
14294         return false
14295 }
14296 func rewriteValuegeneric_OpLsh8x16(v *Value) bool {
14297         v_1 := v.Args[1]
14298         v_0 := v.Args[0]
14299         b := v.Block
14300         // match: (Lsh8x16 <t> x (Const16 [c]))
14301         // result: (Lsh8x64 x (Const64 <t> [int64(uint16(c))]))
14302         for {
14303                 t := v.Type
14304                 x := v_0
14305                 if v_1.Op != OpConst16 {
14306                         break
14307                 }
14308                 c := auxIntToInt16(v_1.AuxInt)
14309                 v.reset(OpLsh8x64)
14310                 v0 := b.NewValue0(v.Pos, OpConst64, t)
14311                 v0.AuxInt = int64ToAuxInt(int64(uint16(c)))
14312                 v.AddArg2(x, v0)
14313                 return true
14314         }
14315         // match: (Lsh8x16 (Const8 [0]) _)
14316         // result: (Const8 [0])
14317         for {
14318                 if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
14319                         break
14320                 }
14321                 v.reset(OpConst8)
14322                 v.AuxInt = int8ToAuxInt(0)
14323                 return true
14324         }
14325         return false
14326 }
14327 func rewriteValuegeneric_OpLsh8x32(v *Value) bool {
14328         v_1 := v.Args[1]
14329         v_0 := v.Args[0]
14330         b := v.Block
14331         // match: (Lsh8x32 <t> x (Const32 [c]))
14332         // result: (Lsh8x64 x (Const64 <t> [int64(uint32(c))]))
14333         for {
14334                 t := v.Type
14335                 x := v_0
14336                 if v_1.Op != OpConst32 {
14337                         break
14338                 }
14339                 c := auxIntToInt32(v_1.AuxInt)
14340                 v.reset(OpLsh8x64)
14341                 v0 := b.NewValue0(v.Pos, OpConst64, t)
14342                 v0.AuxInt = int64ToAuxInt(int64(uint32(c)))
14343                 v.AddArg2(x, v0)
14344                 return true
14345         }
14346         // match: (Lsh8x32 (Const8 [0]) _)
14347         // result: (Const8 [0])
14348         for {
14349                 if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
14350                         break
14351                 }
14352                 v.reset(OpConst8)
14353                 v.AuxInt = int8ToAuxInt(0)
14354                 return true
14355         }
14356         return false
14357 }
14358 func rewriteValuegeneric_OpLsh8x64(v *Value) bool {
14359         v_1 := v.Args[1]
14360         v_0 := v.Args[0]
14361         b := v.Block
14362         typ := &b.Func.Config.Types
14363         // match: (Lsh8x64 (Const8 [c]) (Const64 [d]))
14364         // result: (Const8 [c << uint64(d)])
14365         for {
14366                 if v_0.Op != OpConst8 {
14367                         break
14368                 }
14369                 c := auxIntToInt8(v_0.AuxInt)
14370                 if v_1.Op != OpConst64 {
14371                         break
14372                 }
14373                 d := auxIntToInt64(v_1.AuxInt)
14374                 v.reset(OpConst8)
14375                 v.AuxInt = int8ToAuxInt(c << uint64(d))
14376                 return true
14377         }
14378         // match: (Lsh8x64 x (Const64 [0]))
14379         // result: x
14380         for {
14381                 x := v_0
14382                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 0 {
14383                         break
14384                 }
14385                 v.copyOf(x)
14386                 return true
14387         }
14388         // match: (Lsh8x64 (Const8 [0]) _)
14389         // result: (Const8 [0])
14390         for {
14391                 if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
14392                         break
14393                 }
14394                 v.reset(OpConst8)
14395                 v.AuxInt = int8ToAuxInt(0)
14396                 return true
14397         }
14398         // match: (Lsh8x64 _ (Const64 [c]))
14399         // cond: uint64(c) >= 8
14400         // result: (Const8 [0])
14401         for {
14402                 if v_1.Op != OpConst64 {
14403                         break
14404                 }
14405                 c := auxIntToInt64(v_1.AuxInt)
14406                 if !(uint64(c) >= 8) {
14407                         break
14408                 }
14409                 v.reset(OpConst8)
14410                 v.AuxInt = int8ToAuxInt(0)
14411                 return true
14412         }
14413         // match: (Lsh8x64 <t> (Lsh8x64 x (Const64 [c])) (Const64 [d]))
14414         // cond: !uaddOvf(c,d)
14415         // result: (Lsh8x64 x (Const64 <t> [c+d]))
14416         for {
14417                 t := v.Type
14418                 if v_0.Op != OpLsh8x64 {
14419                         break
14420                 }
14421                 _ = v_0.Args[1]
14422                 x := v_0.Args[0]
14423                 v_0_1 := v_0.Args[1]
14424                 if v_0_1.Op != OpConst64 {
14425                         break
14426                 }
14427                 c := auxIntToInt64(v_0_1.AuxInt)
14428                 if v_1.Op != OpConst64 {
14429                         break
14430                 }
14431                 d := auxIntToInt64(v_1.AuxInt)
14432                 if !(!uaddOvf(c, d)) {
14433                         break
14434                 }
14435                 v.reset(OpLsh8x64)
14436                 v0 := b.NewValue0(v.Pos, OpConst64, t)
14437                 v0.AuxInt = int64ToAuxInt(c + d)
14438                 v.AddArg2(x, v0)
14439                 return true
14440         }
14441         // match: (Lsh8x64 i:(Rsh8x64 x (Const64 [c])) (Const64 [c]))
14442         // cond: c >= 0 && c < 8 && i.Uses == 1
14443         // result: (And8 x (Const8 <v.Type> [int8(-1) << c]))
14444         for {
14445                 i := v_0
14446                 if i.Op != OpRsh8x64 {
14447                         break
14448                 }
14449                 _ = i.Args[1]
14450                 x := i.Args[0]
14451                 i_1 := i.Args[1]
14452                 if i_1.Op != OpConst64 {
14453                         break
14454                 }
14455                 c := auxIntToInt64(i_1.AuxInt)
14456                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != c || !(c >= 0 && c < 8 && i.Uses == 1) {
14457                         break
14458                 }
14459                 v.reset(OpAnd8)
14460                 v0 := b.NewValue0(v.Pos, OpConst8, v.Type)
14461                 v0.AuxInt = int8ToAuxInt(int8(-1) << c)
14462                 v.AddArg2(x, v0)
14463                 return true
14464         }
14465         // match: (Lsh8x64 i:(Rsh8Ux64 x (Const64 [c])) (Const64 [c]))
14466         // cond: c >= 0 && c < 8 && i.Uses == 1
14467         // result: (And8 x (Const8 <v.Type> [int8(-1) << c]))
14468         for {
14469                 i := v_0
14470                 if i.Op != OpRsh8Ux64 {
14471                         break
14472                 }
14473                 _ = i.Args[1]
14474                 x := i.Args[0]
14475                 i_1 := i.Args[1]
14476                 if i_1.Op != OpConst64 {
14477                         break
14478                 }
14479                 c := auxIntToInt64(i_1.AuxInt)
14480                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != c || !(c >= 0 && c < 8 && i.Uses == 1) {
14481                         break
14482                 }
14483                 v.reset(OpAnd8)
14484                 v0 := b.NewValue0(v.Pos, OpConst8, v.Type)
14485                 v0.AuxInt = int8ToAuxInt(int8(-1) << c)
14486                 v.AddArg2(x, v0)
14487                 return true
14488         }
14489         // match: (Lsh8x64 (Rsh8Ux64 (Lsh8x64 x (Const64 [c1])) (Const64 [c2])) (Const64 [c3]))
14490         // cond: uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)
14491         // result: (Lsh8x64 x (Const64 <typ.UInt64> [c1-c2+c3]))
14492         for {
14493                 if v_0.Op != OpRsh8Ux64 {
14494                         break
14495                 }
14496                 _ = v_0.Args[1]
14497                 v_0_0 := v_0.Args[0]
14498                 if v_0_0.Op != OpLsh8x64 {
14499                         break
14500                 }
14501                 _ = v_0_0.Args[1]
14502                 x := v_0_0.Args[0]
14503                 v_0_0_1 := v_0_0.Args[1]
14504                 if v_0_0_1.Op != OpConst64 {
14505                         break
14506                 }
14507                 c1 := auxIntToInt64(v_0_0_1.AuxInt)
14508                 v_0_1 := v_0.Args[1]
14509                 if v_0_1.Op != OpConst64 {
14510                         break
14511                 }
14512                 c2 := auxIntToInt64(v_0_1.AuxInt)
14513                 if v_1.Op != OpConst64 {
14514                         break
14515                 }
14516                 c3 := auxIntToInt64(v_1.AuxInt)
14517                 if !(uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)) {
14518                         break
14519                 }
14520                 v.reset(OpLsh8x64)
14521                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
14522                 v0.AuxInt = int64ToAuxInt(c1 - c2 + c3)
14523                 v.AddArg2(x, v0)
14524                 return true
14525         }
14526         return false
14527 }
14528 func rewriteValuegeneric_OpLsh8x8(v *Value) bool {
14529         v_1 := v.Args[1]
14530         v_0 := v.Args[0]
14531         b := v.Block
14532         // match: (Lsh8x8 <t> x (Const8 [c]))
14533         // result: (Lsh8x64 x (Const64 <t> [int64(uint8(c))]))
14534         for {
14535                 t := v.Type
14536                 x := v_0
14537                 if v_1.Op != OpConst8 {
14538                         break
14539                 }
14540                 c := auxIntToInt8(v_1.AuxInt)
14541                 v.reset(OpLsh8x64)
14542                 v0 := b.NewValue0(v.Pos, OpConst64, t)
14543                 v0.AuxInt = int64ToAuxInt(int64(uint8(c)))
14544                 v.AddArg2(x, v0)
14545                 return true
14546         }
14547         // match: (Lsh8x8 (Const8 [0]) _)
14548         // result: (Const8 [0])
14549         for {
14550                 if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
14551                         break
14552                 }
14553                 v.reset(OpConst8)
14554                 v.AuxInt = int8ToAuxInt(0)
14555                 return true
14556         }
14557         return false
14558 }
14559 func rewriteValuegeneric_OpMod16(v *Value) bool {
14560         v_1 := v.Args[1]
14561         v_0 := v.Args[0]
14562         b := v.Block
14563         // match: (Mod16 (Const16 [c]) (Const16 [d]))
14564         // cond: d != 0
14565         // result: (Const16 [c % d])
14566         for {
14567                 if v_0.Op != OpConst16 {
14568                         break
14569                 }
14570                 c := auxIntToInt16(v_0.AuxInt)
14571                 if v_1.Op != OpConst16 {
14572                         break
14573                 }
14574                 d := auxIntToInt16(v_1.AuxInt)
14575                 if !(d != 0) {
14576                         break
14577                 }
14578                 v.reset(OpConst16)
14579                 v.AuxInt = int16ToAuxInt(c % d)
14580                 return true
14581         }
14582         // match: (Mod16 <t> n (Const16 [c]))
14583         // cond: isNonNegative(n) && isPowerOfTwo16(c)
14584         // result: (And16 n (Const16 <t> [c-1]))
14585         for {
14586                 t := v.Type
14587                 n := v_0
14588                 if v_1.Op != OpConst16 {
14589                         break
14590                 }
14591                 c := auxIntToInt16(v_1.AuxInt)
14592                 if !(isNonNegative(n) && isPowerOfTwo16(c)) {
14593                         break
14594                 }
14595                 v.reset(OpAnd16)
14596                 v0 := b.NewValue0(v.Pos, OpConst16, t)
14597                 v0.AuxInt = int16ToAuxInt(c - 1)
14598                 v.AddArg2(n, v0)
14599                 return true
14600         }
14601         // match: (Mod16 <t> n (Const16 [c]))
14602         // cond: c < 0 && c != -1<<15
14603         // result: (Mod16 <t> n (Const16 <t> [-c]))
14604         for {
14605                 t := v.Type
14606                 n := v_0
14607                 if v_1.Op != OpConst16 {
14608                         break
14609                 }
14610                 c := auxIntToInt16(v_1.AuxInt)
14611                 if !(c < 0 && c != -1<<15) {
14612                         break
14613                 }
14614                 v.reset(OpMod16)
14615                 v.Type = t
14616                 v0 := b.NewValue0(v.Pos, OpConst16, t)
14617                 v0.AuxInt = int16ToAuxInt(-c)
14618                 v.AddArg2(n, v0)
14619                 return true
14620         }
14621         // match: (Mod16 <t> x (Const16 [c]))
14622         // cond: x.Op != OpConst16 && (c > 0 || c == -1<<15)
14623         // result: (Sub16 x (Mul16 <t> (Div16 <t> x (Const16 <t> [c])) (Const16 <t> [c])))
14624         for {
14625                 t := v.Type
14626                 x := v_0
14627                 if v_1.Op != OpConst16 {
14628                         break
14629                 }
14630                 c := auxIntToInt16(v_1.AuxInt)
14631                 if !(x.Op != OpConst16 && (c > 0 || c == -1<<15)) {
14632                         break
14633                 }
14634                 v.reset(OpSub16)
14635                 v0 := b.NewValue0(v.Pos, OpMul16, t)
14636                 v1 := b.NewValue0(v.Pos, OpDiv16, t)
14637                 v2 := b.NewValue0(v.Pos, OpConst16, t)
14638                 v2.AuxInt = int16ToAuxInt(c)
14639                 v1.AddArg2(x, v2)
14640                 v0.AddArg2(v1, v2)
14641                 v.AddArg2(x, v0)
14642                 return true
14643         }
14644         return false
14645 }
14646 func rewriteValuegeneric_OpMod16u(v *Value) bool {
14647         v_1 := v.Args[1]
14648         v_0 := v.Args[0]
14649         b := v.Block
14650         // match: (Mod16u (Const16 [c]) (Const16 [d]))
14651         // cond: d != 0
14652         // result: (Const16 [int16(uint16(c) % uint16(d))])
14653         for {
14654                 if v_0.Op != OpConst16 {
14655                         break
14656                 }
14657                 c := auxIntToInt16(v_0.AuxInt)
14658                 if v_1.Op != OpConst16 {
14659                         break
14660                 }
14661                 d := auxIntToInt16(v_1.AuxInt)
14662                 if !(d != 0) {
14663                         break
14664                 }
14665                 v.reset(OpConst16)
14666                 v.AuxInt = int16ToAuxInt(int16(uint16(c) % uint16(d)))
14667                 return true
14668         }
14669         // match: (Mod16u <t> n (Const16 [c]))
14670         // cond: isPowerOfTwo16(c)
14671         // result: (And16 n (Const16 <t> [c-1]))
14672         for {
14673                 t := v.Type
14674                 n := v_0
14675                 if v_1.Op != OpConst16 {
14676                         break
14677                 }
14678                 c := auxIntToInt16(v_1.AuxInt)
14679                 if !(isPowerOfTwo16(c)) {
14680                         break
14681                 }
14682                 v.reset(OpAnd16)
14683                 v0 := b.NewValue0(v.Pos, OpConst16, t)
14684                 v0.AuxInt = int16ToAuxInt(c - 1)
14685                 v.AddArg2(n, v0)
14686                 return true
14687         }
14688         // match: (Mod16u <t> x (Const16 [c]))
14689         // cond: x.Op != OpConst16 && c > 0 && umagicOK16(c)
14690         // result: (Sub16 x (Mul16 <t> (Div16u <t> x (Const16 <t> [c])) (Const16 <t> [c])))
14691         for {
14692                 t := v.Type
14693                 x := v_0
14694                 if v_1.Op != OpConst16 {
14695                         break
14696                 }
14697                 c := auxIntToInt16(v_1.AuxInt)
14698                 if !(x.Op != OpConst16 && c > 0 && umagicOK16(c)) {
14699                         break
14700                 }
14701                 v.reset(OpSub16)
14702                 v0 := b.NewValue0(v.Pos, OpMul16, t)
14703                 v1 := b.NewValue0(v.Pos, OpDiv16u, t)
14704                 v2 := b.NewValue0(v.Pos, OpConst16, t)
14705                 v2.AuxInt = int16ToAuxInt(c)
14706                 v1.AddArg2(x, v2)
14707                 v0.AddArg2(v1, v2)
14708                 v.AddArg2(x, v0)
14709                 return true
14710         }
14711         return false
14712 }
14713 func rewriteValuegeneric_OpMod32(v *Value) bool {
14714         v_1 := v.Args[1]
14715         v_0 := v.Args[0]
14716         b := v.Block
14717         // match: (Mod32 (Const32 [c]) (Const32 [d]))
14718         // cond: d != 0
14719         // result: (Const32 [c % d])
14720         for {
14721                 if v_0.Op != OpConst32 {
14722                         break
14723                 }
14724                 c := auxIntToInt32(v_0.AuxInt)
14725                 if v_1.Op != OpConst32 {
14726                         break
14727                 }
14728                 d := auxIntToInt32(v_1.AuxInt)
14729                 if !(d != 0) {
14730                         break
14731                 }
14732                 v.reset(OpConst32)
14733                 v.AuxInt = int32ToAuxInt(c % d)
14734                 return true
14735         }
14736         // match: (Mod32 <t> n (Const32 [c]))
14737         // cond: isNonNegative(n) && isPowerOfTwo32(c)
14738         // result: (And32 n (Const32 <t> [c-1]))
14739         for {
14740                 t := v.Type
14741                 n := v_0
14742                 if v_1.Op != OpConst32 {
14743                         break
14744                 }
14745                 c := auxIntToInt32(v_1.AuxInt)
14746                 if !(isNonNegative(n) && isPowerOfTwo32(c)) {
14747                         break
14748                 }
14749                 v.reset(OpAnd32)
14750                 v0 := b.NewValue0(v.Pos, OpConst32, t)
14751                 v0.AuxInt = int32ToAuxInt(c - 1)
14752                 v.AddArg2(n, v0)
14753                 return true
14754         }
14755         // match: (Mod32 <t> n (Const32 [c]))
14756         // cond: c < 0 && c != -1<<31
14757         // result: (Mod32 <t> n (Const32 <t> [-c]))
14758         for {
14759                 t := v.Type
14760                 n := v_0
14761                 if v_1.Op != OpConst32 {
14762                         break
14763                 }
14764                 c := auxIntToInt32(v_1.AuxInt)
14765                 if !(c < 0 && c != -1<<31) {
14766                         break
14767                 }
14768                 v.reset(OpMod32)
14769                 v.Type = t
14770                 v0 := b.NewValue0(v.Pos, OpConst32, t)
14771                 v0.AuxInt = int32ToAuxInt(-c)
14772                 v.AddArg2(n, v0)
14773                 return true
14774         }
14775         // match: (Mod32 <t> x (Const32 [c]))
14776         // cond: x.Op != OpConst32 && (c > 0 || c == -1<<31)
14777         // result: (Sub32 x (Mul32 <t> (Div32 <t> x (Const32 <t> [c])) (Const32 <t> [c])))
14778         for {
14779                 t := v.Type
14780                 x := v_0
14781                 if v_1.Op != OpConst32 {
14782                         break
14783                 }
14784                 c := auxIntToInt32(v_1.AuxInt)
14785                 if !(x.Op != OpConst32 && (c > 0 || c == -1<<31)) {
14786                         break
14787                 }
14788                 v.reset(OpSub32)
14789                 v0 := b.NewValue0(v.Pos, OpMul32, t)
14790                 v1 := b.NewValue0(v.Pos, OpDiv32, t)
14791                 v2 := b.NewValue0(v.Pos, OpConst32, t)
14792                 v2.AuxInt = int32ToAuxInt(c)
14793                 v1.AddArg2(x, v2)
14794                 v0.AddArg2(v1, v2)
14795                 v.AddArg2(x, v0)
14796                 return true
14797         }
14798         return false
14799 }
14800 func rewriteValuegeneric_OpMod32u(v *Value) bool {
14801         v_1 := v.Args[1]
14802         v_0 := v.Args[0]
14803         b := v.Block
14804         // match: (Mod32u (Const32 [c]) (Const32 [d]))
14805         // cond: d != 0
14806         // result: (Const32 [int32(uint32(c) % uint32(d))])
14807         for {
14808                 if v_0.Op != OpConst32 {
14809                         break
14810                 }
14811                 c := auxIntToInt32(v_0.AuxInt)
14812                 if v_1.Op != OpConst32 {
14813                         break
14814                 }
14815                 d := auxIntToInt32(v_1.AuxInt)
14816                 if !(d != 0) {
14817                         break
14818                 }
14819                 v.reset(OpConst32)
14820                 v.AuxInt = int32ToAuxInt(int32(uint32(c) % uint32(d)))
14821                 return true
14822         }
14823         // match: (Mod32u <t> n (Const32 [c]))
14824         // cond: isPowerOfTwo32(c)
14825         // result: (And32 n (Const32 <t> [c-1]))
14826         for {
14827                 t := v.Type
14828                 n := v_0
14829                 if v_1.Op != OpConst32 {
14830                         break
14831                 }
14832                 c := auxIntToInt32(v_1.AuxInt)
14833                 if !(isPowerOfTwo32(c)) {
14834                         break
14835                 }
14836                 v.reset(OpAnd32)
14837                 v0 := b.NewValue0(v.Pos, OpConst32, t)
14838                 v0.AuxInt = int32ToAuxInt(c - 1)
14839                 v.AddArg2(n, v0)
14840                 return true
14841         }
14842         // match: (Mod32u <t> x (Const32 [c]))
14843         // cond: x.Op != OpConst32 && c > 0 && umagicOK32(c)
14844         // result: (Sub32 x (Mul32 <t> (Div32u <t> x (Const32 <t> [c])) (Const32 <t> [c])))
14845         for {
14846                 t := v.Type
14847                 x := v_0
14848                 if v_1.Op != OpConst32 {
14849                         break
14850                 }
14851                 c := auxIntToInt32(v_1.AuxInt)
14852                 if !(x.Op != OpConst32 && c > 0 && umagicOK32(c)) {
14853                         break
14854                 }
14855                 v.reset(OpSub32)
14856                 v0 := b.NewValue0(v.Pos, OpMul32, t)
14857                 v1 := b.NewValue0(v.Pos, OpDiv32u, t)
14858                 v2 := b.NewValue0(v.Pos, OpConst32, t)
14859                 v2.AuxInt = int32ToAuxInt(c)
14860                 v1.AddArg2(x, v2)
14861                 v0.AddArg2(v1, v2)
14862                 v.AddArg2(x, v0)
14863                 return true
14864         }
14865         return false
14866 }
14867 func rewriteValuegeneric_OpMod64(v *Value) bool {
14868         v_1 := v.Args[1]
14869         v_0 := v.Args[0]
14870         b := v.Block
14871         // match: (Mod64 (Const64 [c]) (Const64 [d]))
14872         // cond: d != 0
14873         // result: (Const64 [c % d])
14874         for {
14875                 if v_0.Op != OpConst64 {
14876                         break
14877                 }
14878                 c := auxIntToInt64(v_0.AuxInt)
14879                 if v_1.Op != OpConst64 {
14880                         break
14881                 }
14882                 d := auxIntToInt64(v_1.AuxInt)
14883                 if !(d != 0) {
14884                         break
14885                 }
14886                 v.reset(OpConst64)
14887                 v.AuxInt = int64ToAuxInt(c % d)
14888                 return true
14889         }
14890         // match: (Mod64 <t> n (Const64 [c]))
14891         // cond: isNonNegative(n) && isPowerOfTwo64(c)
14892         // result: (And64 n (Const64 <t> [c-1]))
14893         for {
14894                 t := v.Type
14895                 n := v_0
14896                 if v_1.Op != OpConst64 {
14897                         break
14898                 }
14899                 c := auxIntToInt64(v_1.AuxInt)
14900                 if !(isNonNegative(n) && isPowerOfTwo64(c)) {
14901                         break
14902                 }
14903                 v.reset(OpAnd64)
14904                 v0 := b.NewValue0(v.Pos, OpConst64, t)
14905                 v0.AuxInt = int64ToAuxInt(c - 1)
14906                 v.AddArg2(n, v0)
14907                 return true
14908         }
14909         // match: (Mod64 n (Const64 [-1<<63]))
14910         // cond: isNonNegative(n)
14911         // result: n
14912         for {
14913                 n := v_0
14914                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != -1<<63 || !(isNonNegative(n)) {
14915                         break
14916                 }
14917                 v.copyOf(n)
14918                 return true
14919         }
14920         // match: (Mod64 <t> n (Const64 [c]))
14921         // cond: c < 0 && c != -1<<63
14922         // result: (Mod64 <t> n (Const64 <t> [-c]))
14923         for {
14924                 t := v.Type
14925                 n := v_0
14926                 if v_1.Op != OpConst64 {
14927                         break
14928                 }
14929                 c := auxIntToInt64(v_1.AuxInt)
14930                 if !(c < 0 && c != -1<<63) {
14931                         break
14932                 }
14933                 v.reset(OpMod64)
14934                 v.Type = t
14935                 v0 := b.NewValue0(v.Pos, OpConst64, t)
14936                 v0.AuxInt = int64ToAuxInt(-c)
14937                 v.AddArg2(n, v0)
14938                 return true
14939         }
14940         // match: (Mod64 <t> x (Const64 [c]))
14941         // cond: x.Op != OpConst64 && (c > 0 || c == -1<<63)
14942         // result: (Sub64 x (Mul64 <t> (Div64 <t> x (Const64 <t> [c])) (Const64 <t> [c])))
14943         for {
14944                 t := v.Type
14945                 x := v_0
14946                 if v_1.Op != OpConst64 {
14947                         break
14948                 }
14949                 c := auxIntToInt64(v_1.AuxInt)
14950                 if !(x.Op != OpConst64 && (c > 0 || c == -1<<63)) {
14951                         break
14952                 }
14953                 v.reset(OpSub64)
14954                 v0 := b.NewValue0(v.Pos, OpMul64, t)
14955                 v1 := b.NewValue0(v.Pos, OpDiv64, t)
14956                 v2 := b.NewValue0(v.Pos, OpConst64, t)
14957                 v2.AuxInt = int64ToAuxInt(c)
14958                 v1.AddArg2(x, v2)
14959                 v0.AddArg2(v1, v2)
14960                 v.AddArg2(x, v0)
14961                 return true
14962         }
14963         return false
14964 }
14965 func rewriteValuegeneric_OpMod64u(v *Value) bool {
14966         v_1 := v.Args[1]
14967         v_0 := v.Args[0]
14968         b := v.Block
14969         // match: (Mod64u (Const64 [c]) (Const64 [d]))
14970         // cond: d != 0
14971         // result: (Const64 [int64(uint64(c) % uint64(d))])
14972         for {
14973                 if v_0.Op != OpConst64 {
14974                         break
14975                 }
14976                 c := auxIntToInt64(v_0.AuxInt)
14977                 if v_1.Op != OpConst64 {
14978                         break
14979                 }
14980                 d := auxIntToInt64(v_1.AuxInt)
14981                 if !(d != 0) {
14982                         break
14983                 }
14984                 v.reset(OpConst64)
14985                 v.AuxInt = int64ToAuxInt(int64(uint64(c) % uint64(d)))
14986                 return true
14987         }
14988         // match: (Mod64u <t> n (Const64 [c]))
14989         // cond: isPowerOfTwo64(c)
14990         // result: (And64 n (Const64 <t> [c-1]))
14991         for {
14992                 t := v.Type
14993                 n := v_0
14994                 if v_1.Op != OpConst64 {
14995                         break
14996                 }
14997                 c := auxIntToInt64(v_1.AuxInt)
14998                 if !(isPowerOfTwo64(c)) {
14999                         break
15000                 }
15001                 v.reset(OpAnd64)
15002                 v0 := b.NewValue0(v.Pos, OpConst64, t)
15003                 v0.AuxInt = int64ToAuxInt(c - 1)
15004                 v.AddArg2(n, v0)
15005                 return true
15006         }
15007         // match: (Mod64u <t> n (Const64 [-1<<63]))
15008         // result: (And64 n (Const64 <t> [1<<63-1]))
15009         for {
15010                 t := v.Type
15011                 n := v_0
15012                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != -1<<63 {
15013                         break
15014                 }
15015                 v.reset(OpAnd64)
15016                 v0 := b.NewValue0(v.Pos, OpConst64, t)
15017                 v0.AuxInt = int64ToAuxInt(1<<63 - 1)
15018                 v.AddArg2(n, v0)
15019                 return true
15020         }
15021         // match: (Mod64u <t> x (Const64 [c]))
15022         // cond: x.Op != OpConst64 && c > 0 && umagicOK64(c)
15023         // result: (Sub64 x (Mul64 <t> (Div64u <t> x (Const64 <t> [c])) (Const64 <t> [c])))
15024         for {
15025                 t := v.Type
15026                 x := v_0
15027                 if v_1.Op != OpConst64 {
15028                         break
15029                 }
15030                 c := auxIntToInt64(v_1.AuxInt)
15031                 if !(x.Op != OpConst64 && c > 0 && umagicOK64(c)) {
15032                         break
15033                 }
15034                 v.reset(OpSub64)
15035                 v0 := b.NewValue0(v.Pos, OpMul64, t)
15036                 v1 := b.NewValue0(v.Pos, OpDiv64u, t)
15037                 v2 := b.NewValue0(v.Pos, OpConst64, t)
15038                 v2.AuxInt = int64ToAuxInt(c)
15039                 v1.AddArg2(x, v2)
15040                 v0.AddArg2(v1, v2)
15041                 v.AddArg2(x, v0)
15042                 return true
15043         }
15044         return false
15045 }
15046 func rewriteValuegeneric_OpMod8(v *Value) bool {
15047         v_1 := v.Args[1]
15048         v_0 := v.Args[0]
15049         b := v.Block
15050         // match: (Mod8 (Const8 [c]) (Const8 [d]))
15051         // cond: d != 0
15052         // result: (Const8 [c % d])
15053         for {
15054                 if v_0.Op != OpConst8 {
15055                         break
15056                 }
15057                 c := auxIntToInt8(v_0.AuxInt)
15058                 if v_1.Op != OpConst8 {
15059                         break
15060                 }
15061                 d := auxIntToInt8(v_1.AuxInt)
15062                 if !(d != 0) {
15063                         break
15064                 }
15065                 v.reset(OpConst8)
15066                 v.AuxInt = int8ToAuxInt(c % d)
15067                 return true
15068         }
15069         // match: (Mod8 <t> n (Const8 [c]))
15070         // cond: isNonNegative(n) && isPowerOfTwo8(c)
15071         // result: (And8 n (Const8 <t> [c-1]))
15072         for {
15073                 t := v.Type
15074                 n := v_0
15075                 if v_1.Op != OpConst8 {
15076                         break
15077                 }
15078                 c := auxIntToInt8(v_1.AuxInt)
15079                 if !(isNonNegative(n) && isPowerOfTwo8(c)) {
15080                         break
15081                 }
15082                 v.reset(OpAnd8)
15083                 v0 := b.NewValue0(v.Pos, OpConst8, t)
15084                 v0.AuxInt = int8ToAuxInt(c - 1)
15085                 v.AddArg2(n, v0)
15086                 return true
15087         }
15088         // match: (Mod8 <t> n (Const8 [c]))
15089         // cond: c < 0 && c != -1<<7
15090         // result: (Mod8 <t> n (Const8 <t> [-c]))
15091         for {
15092                 t := v.Type
15093                 n := v_0
15094                 if v_1.Op != OpConst8 {
15095                         break
15096                 }
15097                 c := auxIntToInt8(v_1.AuxInt)
15098                 if !(c < 0 && c != -1<<7) {
15099                         break
15100                 }
15101                 v.reset(OpMod8)
15102                 v.Type = t
15103                 v0 := b.NewValue0(v.Pos, OpConst8, t)
15104                 v0.AuxInt = int8ToAuxInt(-c)
15105                 v.AddArg2(n, v0)
15106                 return true
15107         }
15108         // match: (Mod8 <t> x (Const8 [c]))
15109         // cond: x.Op != OpConst8 && (c > 0 || c == -1<<7)
15110         // result: (Sub8 x (Mul8 <t> (Div8 <t> x (Const8 <t> [c])) (Const8 <t> [c])))
15111         for {
15112                 t := v.Type
15113                 x := v_0
15114                 if v_1.Op != OpConst8 {
15115                         break
15116                 }
15117                 c := auxIntToInt8(v_1.AuxInt)
15118                 if !(x.Op != OpConst8 && (c > 0 || c == -1<<7)) {
15119                         break
15120                 }
15121                 v.reset(OpSub8)
15122                 v0 := b.NewValue0(v.Pos, OpMul8, t)
15123                 v1 := b.NewValue0(v.Pos, OpDiv8, t)
15124                 v2 := b.NewValue0(v.Pos, OpConst8, t)
15125                 v2.AuxInt = int8ToAuxInt(c)
15126                 v1.AddArg2(x, v2)
15127                 v0.AddArg2(v1, v2)
15128                 v.AddArg2(x, v0)
15129                 return true
15130         }
15131         return false
15132 }
15133 func rewriteValuegeneric_OpMod8u(v *Value) bool {
15134         v_1 := v.Args[1]
15135         v_0 := v.Args[0]
15136         b := v.Block
15137         // match: (Mod8u (Const8 [c]) (Const8 [d]))
15138         // cond: d != 0
15139         // result: (Const8 [int8(uint8(c) % uint8(d))])
15140         for {
15141                 if v_0.Op != OpConst8 {
15142                         break
15143                 }
15144                 c := auxIntToInt8(v_0.AuxInt)
15145                 if v_1.Op != OpConst8 {
15146                         break
15147                 }
15148                 d := auxIntToInt8(v_1.AuxInt)
15149                 if !(d != 0) {
15150                         break
15151                 }
15152                 v.reset(OpConst8)
15153                 v.AuxInt = int8ToAuxInt(int8(uint8(c) % uint8(d)))
15154                 return true
15155         }
15156         // match: (Mod8u <t> n (Const8 [c]))
15157         // cond: isPowerOfTwo8(c)
15158         // result: (And8 n (Const8 <t> [c-1]))
15159         for {
15160                 t := v.Type
15161                 n := v_0
15162                 if v_1.Op != OpConst8 {
15163                         break
15164                 }
15165                 c := auxIntToInt8(v_1.AuxInt)
15166                 if !(isPowerOfTwo8(c)) {
15167                         break
15168                 }
15169                 v.reset(OpAnd8)
15170                 v0 := b.NewValue0(v.Pos, OpConst8, t)
15171                 v0.AuxInt = int8ToAuxInt(c - 1)
15172                 v.AddArg2(n, v0)
15173                 return true
15174         }
15175         // match: (Mod8u <t> x (Const8 [c]))
15176         // cond: x.Op != OpConst8 && c > 0 && umagicOK8( c)
15177         // result: (Sub8 x (Mul8 <t> (Div8u <t> x (Const8 <t> [c])) (Const8 <t> [c])))
15178         for {
15179                 t := v.Type
15180                 x := v_0
15181                 if v_1.Op != OpConst8 {
15182                         break
15183                 }
15184                 c := auxIntToInt8(v_1.AuxInt)
15185                 if !(x.Op != OpConst8 && c > 0 && umagicOK8(c)) {
15186                         break
15187                 }
15188                 v.reset(OpSub8)
15189                 v0 := b.NewValue0(v.Pos, OpMul8, t)
15190                 v1 := b.NewValue0(v.Pos, OpDiv8u, t)
15191                 v2 := b.NewValue0(v.Pos, OpConst8, t)
15192                 v2.AuxInt = int8ToAuxInt(c)
15193                 v1.AddArg2(x, v2)
15194                 v0.AddArg2(v1, v2)
15195                 v.AddArg2(x, v0)
15196                 return true
15197         }
15198         return false
15199 }
15200 func rewriteValuegeneric_OpMove(v *Value) bool {
15201         v_2 := v.Args[2]
15202         v_1 := v.Args[1]
15203         v_0 := v.Args[0]
15204         b := v.Block
15205         config := b.Func.Config
15206         // match: (Move {t} [n] dst1 src mem:(Zero {t} [n] dst2 _))
15207         // cond: isSamePtr(src, dst2)
15208         // result: (Zero {t} [n] dst1 mem)
15209         for {
15210                 n := auxIntToInt64(v.AuxInt)
15211                 t := auxToType(v.Aux)
15212                 dst1 := v_0
15213                 src := v_1
15214                 mem := v_2
15215                 if mem.Op != OpZero || auxIntToInt64(mem.AuxInt) != n || auxToType(mem.Aux) != t {
15216                         break
15217                 }
15218                 dst2 := mem.Args[0]
15219                 if !(isSamePtr(src, dst2)) {
15220                         break
15221                 }
15222                 v.reset(OpZero)
15223                 v.AuxInt = int64ToAuxInt(n)
15224                 v.Aux = typeToAux(t)
15225                 v.AddArg2(dst1, mem)
15226                 return true
15227         }
15228         // match: (Move {t} [n] dst1 src mem:(VarDef (Zero {t} [n] dst0 _)))
15229         // cond: isSamePtr(src, dst0)
15230         // result: (Zero {t} [n] dst1 mem)
15231         for {
15232                 n := auxIntToInt64(v.AuxInt)
15233                 t := auxToType(v.Aux)
15234                 dst1 := v_0
15235                 src := v_1
15236                 mem := v_2
15237                 if mem.Op != OpVarDef {
15238                         break
15239                 }
15240                 mem_0 := mem.Args[0]
15241                 if mem_0.Op != OpZero || auxIntToInt64(mem_0.AuxInt) != n || auxToType(mem_0.Aux) != t {
15242                         break
15243                 }
15244                 dst0 := mem_0.Args[0]
15245                 if !(isSamePtr(src, dst0)) {
15246                         break
15247                 }
15248                 v.reset(OpZero)
15249                 v.AuxInt = int64ToAuxInt(n)
15250                 v.Aux = typeToAux(t)
15251                 v.AddArg2(dst1, mem)
15252                 return true
15253         }
15254         // match: (Move {t} [n] dst (Addr {sym} (SB)) mem)
15255         // cond: symIsROZero(sym)
15256         // result: (Zero {t} [n] dst mem)
15257         for {
15258                 n := auxIntToInt64(v.AuxInt)
15259                 t := auxToType(v.Aux)
15260                 dst := v_0
15261                 if v_1.Op != OpAddr {
15262                         break
15263                 }
15264                 sym := auxToSym(v_1.Aux)
15265                 v_1_0 := v_1.Args[0]
15266                 if v_1_0.Op != OpSB {
15267                         break
15268                 }
15269                 mem := v_2
15270                 if !(symIsROZero(sym)) {
15271                         break
15272                 }
15273                 v.reset(OpZero)
15274                 v.AuxInt = int64ToAuxInt(n)
15275                 v.Aux = typeToAux(t)
15276                 v.AddArg2(dst, mem)
15277                 return true
15278         }
15279         // match: (Move {t1} [n] dst1 src1 store:(Store {t2} op:(OffPtr [o2] dst2) _ mem))
15280         // cond: isSamePtr(dst1, dst2) && store.Uses == 1 && n >= o2 + t2.Size() && disjoint(src1, n, op, t2.Size()) && clobber(store)
15281         // result: (Move {t1} [n] dst1 src1 mem)
15282         for {
15283                 n := auxIntToInt64(v.AuxInt)
15284                 t1 := auxToType(v.Aux)
15285                 dst1 := v_0
15286                 src1 := v_1
15287                 store := v_2
15288                 if store.Op != OpStore {
15289                         break
15290                 }
15291                 t2 := auxToType(store.Aux)
15292                 mem := store.Args[2]
15293                 op := store.Args[0]
15294                 if op.Op != OpOffPtr {
15295                         break
15296                 }
15297                 o2 := auxIntToInt64(op.AuxInt)
15298                 dst2 := op.Args[0]
15299                 if !(isSamePtr(dst1, dst2) && store.Uses == 1 && n >= o2+t2.Size() && disjoint(src1, n, op, t2.Size()) && clobber(store)) {
15300                         break
15301                 }
15302                 v.reset(OpMove)
15303                 v.AuxInt = int64ToAuxInt(n)
15304                 v.Aux = typeToAux(t1)
15305                 v.AddArg3(dst1, src1, mem)
15306                 return true
15307         }
15308         // match: (Move {t} [n] dst1 src1 move:(Move {t} [n] dst2 _ mem))
15309         // cond: move.Uses == 1 && isSamePtr(dst1, dst2) && disjoint(src1, n, dst2, n) && clobber(move)
15310         // result: (Move {t} [n] dst1 src1 mem)
15311         for {
15312                 n := auxIntToInt64(v.AuxInt)
15313                 t := auxToType(v.Aux)
15314                 dst1 := v_0
15315                 src1 := v_1
15316                 move := v_2
15317                 if move.Op != OpMove || auxIntToInt64(move.AuxInt) != n || auxToType(move.Aux) != t {
15318                         break
15319                 }
15320                 mem := move.Args[2]
15321                 dst2 := move.Args[0]
15322                 if !(move.Uses == 1 && isSamePtr(dst1, dst2) && disjoint(src1, n, dst2, n) && clobber(move)) {
15323                         break
15324                 }
15325                 v.reset(OpMove)
15326                 v.AuxInt = int64ToAuxInt(n)
15327                 v.Aux = typeToAux(t)
15328                 v.AddArg3(dst1, src1, mem)
15329                 return true
15330         }
15331         // match: (Move {t} [n] dst1 src1 vardef:(VarDef {x} move:(Move {t} [n] dst2 _ mem)))
15332         // cond: move.Uses == 1 && vardef.Uses == 1 && isSamePtr(dst1, dst2) && disjoint(src1, n, dst2, n) && clobber(move, vardef)
15333         // result: (Move {t} [n] dst1 src1 (VarDef {x} mem))
15334         for {
15335                 n := auxIntToInt64(v.AuxInt)
15336                 t := auxToType(v.Aux)
15337                 dst1 := v_0
15338                 src1 := v_1
15339                 vardef := v_2
15340                 if vardef.Op != OpVarDef {
15341                         break
15342                 }
15343                 x := auxToSym(vardef.Aux)
15344                 move := vardef.Args[0]
15345                 if move.Op != OpMove || auxIntToInt64(move.AuxInt) != n || auxToType(move.Aux) != t {
15346                         break
15347                 }
15348                 mem := move.Args[2]
15349                 dst2 := move.Args[0]
15350                 if !(move.Uses == 1 && vardef.Uses == 1 && isSamePtr(dst1, dst2) && disjoint(src1, n, dst2, n) && clobber(move, vardef)) {
15351                         break
15352                 }
15353                 v.reset(OpMove)
15354                 v.AuxInt = int64ToAuxInt(n)
15355                 v.Aux = typeToAux(t)
15356                 v0 := b.NewValue0(v.Pos, OpVarDef, types.TypeMem)
15357                 v0.Aux = symToAux(x)
15358                 v0.AddArg(mem)
15359                 v.AddArg3(dst1, src1, v0)
15360                 return true
15361         }
15362         // match: (Move {t} [n] dst1 src1 zero:(Zero {t} [n] dst2 mem))
15363         // cond: zero.Uses == 1 && isSamePtr(dst1, dst2) && disjoint(src1, n, dst2, n) && clobber(zero)
15364         // result: (Move {t} [n] dst1 src1 mem)
15365         for {
15366                 n := auxIntToInt64(v.AuxInt)
15367                 t := auxToType(v.Aux)
15368                 dst1 := v_0
15369                 src1 := v_1
15370                 zero := v_2
15371                 if zero.Op != OpZero || auxIntToInt64(zero.AuxInt) != n || auxToType(zero.Aux) != t {
15372                         break
15373                 }
15374                 mem := zero.Args[1]
15375                 dst2 := zero.Args[0]
15376                 if !(zero.Uses == 1 && isSamePtr(dst1, dst2) && disjoint(src1, n, dst2, n) && clobber(zero)) {
15377                         break
15378                 }
15379                 v.reset(OpMove)
15380                 v.AuxInt = int64ToAuxInt(n)
15381                 v.Aux = typeToAux(t)
15382                 v.AddArg3(dst1, src1, mem)
15383                 return true
15384         }
15385         // match: (Move {t} [n] dst1 src1 vardef:(VarDef {x} zero:(Zero {t} [n] dst2 mem)))
15386         // cond: zero.Uses == 1 && vardef.Uses == 1 && isSamePtr(dst1, dst2) && disjoint(src1, n, dst2, n) && clobber(zero, vardef)
15387         // result: (Move {t} [n] dst1 src1 (VarDef {x} mem))
15388         for {
15389                 n := auxIntToInt64(v.AuxInt)
15390                 t := auxToType(v.Aux)
15391                 dst1 := v_0
15392                 src1 := v_1
15393                 vardef := v_2
15394                 if vardef.Op != OpVarDef {
15395                         break
15396                 }
15397                 x := auxToSym(vardef.Aux)
15398                 zero := vardef.Args[0]
15399                 if zero.Op != OpZero || auxIntToInt64(zero.AuxInt) != n || auxToType(zero.Aux) != t {
15400                         break
15401                 }
15402                 mem := zero.Args[1]
15403                 dst2 := zero.Args[0]
15404                 if !(zero.Uses == 1 && vardef.Uses == 1 && isSamePtr(dst1, dst2) && disjoint(src1, n, dst2, n) && clobber(zero, vardef)) {
15405                         break
15406                 }
15407                 v.reset(OpMove)
15408                 v.AuxInt = int64ToAuxInt(n)
15409                 v.Aux = typeToAux(t)
15410                 v0 := b.NewValue0(v.Pos, OpVarDef, types.TypeMem)
15411                 v0.Aux = symToAux(x)
15412                 v0.AddArg(mem)
15413                 v.AddArg3(dst1, src1, v0)
15414                 return true
15415         }
15416         // match: (Move {t1} [n] dst p1 mem:(Store {t2} op2:(OffPtr <tt2> [o2] p2) d1 (Store {t3} op3:(OffPtr <tt3> [0] p3) d2 _)))
15417         // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && o2 == t3.Size() && n == t2.Size() + t3.Size()
15418         // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [0] dst) d2 mem))
15419         for {
15420                 n := auxIntToInt64(v.AuxInt)
15421                 t1 := auxToType(v.Aux)
15422                 dst := v_0
15423                 p1 := v_1
15424                 mem := v_2
15425                 if mem.Op != OpStore {
15426                         break
15427                 }
15428                 t2 := auxToType(mem.Aux)
15429                 _ = mem.Args[2]
15430                 op2 := mem.Args[0]
15431                 if op2.Op != OpOffPtr {
15432                         break
15433                 }
15434                 tt2 := op2.Type
15435                 o2 := auxIntToInt64(op2.AuxInt)
15436                 p2 := op2.Args[0]
15437                 d1 := mem.Args[1]
15438                 mem_2 := mem.Args[2]
15439                 if mem_2.Op != OpStore {
15440                         break
15441                 }
15442                 t3 := auxToType(mem_2.Aux)
15443                 d2 := mem_2.Args[1]
15444                 op3 := mem_2.Args[0]
15445                 if op3.Op != OpOffPtr {
15446                         break
15447                 }
15448                 tt3 := op3.Type
15449                 if auxIntToInt64(op3.AuxInt) != 0 {
15450                         break
15451                 }
15452                 p3 := op3.Args[0]
15453                 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && o2 == t3.Size() && n == t2.Size()+t3.Size()) {
15454                         break
15455                 }
15456                 v.reset(OpStore)
15457                 v.Aux = typeToAux(t2)
15458                 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2)
15459                 v0.AuxInt = int64ToAuxInt(o2)
15460                 v0.AddArg(dst)
15461                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
15462                 v1.Aux = typeToAux(t3)
15463                 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3)
15464                 v2.AuxInt = int64ToAuxInt(0)
15465                 v2.AddArg(dst)
15466                 v1.AddArg3(v2, d2, mem)
15467                 v.AddArg3(v0, d1, v1)
15468                 return true
15469         }
15470         // match: (Move {t1} [n] dst p1 mem:(Store {t2} op2:(OffPtr <tt2> [o2] p2) d1 (Store {t3} op3:(OffPtr <tt3> [o3] p3) d2 (Store {t4} op4:(OffPtr <tt4> [0] p4) d3 _))))
15471         // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && o3 == t4.Size() && o2-o3 == t3.Size() && n == t2.Size() + t3.Size() + t4.Size()
15472         // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Store {t4} (OffPtr <tt4> [0] dst) d3 mem)))
15473         for {
15474                 n := auxIntToInt64(v.AuxInt)
15475                 t1 := auxToType(v.Aux)
15476                 dst := v_0
15477                 p1 := v_1
15478                 mem := v_2
15479                 if mem.Op != OpStore {
15480                         break
15481                 }
15482                 t2 := auxToType(mem.Aux)
15483                 _ = mem.Args[2]
15484                 op2 := mem.Args[0]
15485                 if op2.Op != OpOffPtr {
15486                         break
15487                 }
15488                 tt2 := op2.Type
15489                 o2 := auxIntToInt64(op2.AuxInt)
15490                 p2 := op2.Args[0]
15491                 d1 := mem.Args[1]
15492                 mem_2 := mem.Args[2]
15493                 if mem_2.Op != OpStore {
15494                         break
15495                 }
15496                 t3 := auxToType(mem_2.Aux)
15497                 _ = mem_2.Args[2]
15498                 op3 := mem_2.Args[0]
15499                 if op3.Op != OpOffPtr {
15500                         break
15501                 }
15502                 tt3 := op3.Type
15503                 o3 := auxIntToInt64(op3.AuxInt)
15504                 p3 := op3.Args[0]
15505                 d2 := mem_2.Args[1]
15506                 mem_2_2 := mem_2.Args[2]
15507                 if mem_2_2.Op != OpStore {
15508                         break
15509                 }
15510                 t4 := auxToType(mem_2_2.Aux)
15511                 d3 := mem_2_2.Args[1]
15512                 op4 := mem_2_2.Args[0]
15513                 if op4.Op != OpOffPtr {
15514                         break
15515                 }
15516                 tt4 := op4.Type
15517                 if auxIntToInt64(op4.AuxInt) != 0 {
15518                         break
15519                 }
15520                 p4 := op4.Args[0]
15521                 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && o3 == t4.Size() && o2-o3 == t3.Size() && n == t2.Size()+t3.Size()+t4.Size()) {
15522                         break
15523                 }
15524                 v.reset(OpStore)
15525                 v.Aux = typeToAux(t2)
15526                 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2)
15527                 v0.AuxInt = int64ToAuxInt(o2)
15528                 v0.AddArg(dst)
15529                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
15530                 v1.Aux = typeToAux(t3)
15531                 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3)
15532                 v2.AuxInt = int64ToAuxInt(o3)
15533                 v2.AddArg(dst)
15534                 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
15535                 v3.Aux = typeToAux(t4)
15536                 v4 := b.NewValue0(v.Pos, OpOffPtr, tt4)
15537                 v4.AuxInt = int64ToAuxInt(0)
15538                 v4.AddArg(dst)
15539                 v3.AddArg3(v4, d3, mem)
15540                 v1.AddArg3(v2, d2, v3)
15541                 v.AddArg3(v0, d1, v1)
15542                 return true
15543         }
15544         // match: (Move {t1} [n] dst p1 mem:(Store {t2} op2:(OffPtr <tt2> [o2] p2) d1 (Store {t3} op3:(OffPtr <tt3> [o3] p3) d2 (Store {t4} op4:(OffPtr <tt4> [o4] p4) d3 (Store {t5} op5:(OffPtr <tt5> [0] p5) d4 _)))))
15545         // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && t5.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && registerizable(b, t5) && o4 == t5.Size() && o3-o4 == t4.Size() && o2-o3 == t3.Size() && n == t2.Size() + t3.Size() + t4.Size() + t5.Size()
15546         // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Store {t4} (OffPtr <tt4> [o4] dst) d3 (Store {t5} (OffPtr <tt5> [0] dst) d4 mem))))
15547         for {
15548                 n := auxIntToInt64(v.AuxInt)
15549                 t1 := auxToType(v.Aux)
15550                 dst := v_0
15551                 p1 := v_1
15552                 mem := v_2
15553                 if mem.Op != OpStore {
15554                         break
15555                 }
15556                 t2 := auxToType(mem.Aux)
15557                 _ = mem.Args[2]
15558                 op2 := mem.Args[0]
15559                 if op2.Op != OpOffPtr {
15560                         break
15561                 }
15562                 tt2 := op2.Type
15563                 o2 := auxIntToInt64(op2.AuxInt)
15564                 p2 := op2.Args[0]
15565                 d1 := mem.Args[1]
15566                 mem_2 := mem.Args[2]
15567                 if mem_2.Op != OpStore {
15568                         break
15569                 }
15570                 t3 := auxToType(mem_2.Aux)
15571                 _ = mem_2.Args[2]
15572                 op3 := mem_2.Args[0]
15573                 if op3.Op != OpOffPtr {
15574                         break
15575                 }
15576                 tt3 := op3.Type
15577                 o3 := auxIntToInt64(op3.AuxInt)
15578                 p3 := op3.Args[0]
15579                 d2 := mem_2.Args[1]
15580                 mem_2_2 := mem_2.Args[2]
15581                 if mem_2_2.Op != OpStore {
15582                         break
15583                 }
15584                 t4 := auxToType(mem_2_2.Aux)
15585                 _ = mem_2_2.Args[2]
15586                 op4 := mem_2_2.Args[0]
15587                 if op4.Op != OpOffPtr {
15588                         break
15589                 }
15590                 tt4 := op4.Type
15591                 o4 := auxIntToInt64(op4.AuxInt)
15592                 p4 := op4.Args[0]
15593                 d3 := mem_2_2.Args[1]
15594                 mem_2_2_2 := mem_2_2.Args[2]
15595                 if mem_2_2_2.Op != OpStore {
15596                         break
15597                 }
15598                 t5 := auxToType(mem_2_2_2.Aux)
15599                 d4 := mem_2_2_2.Args[1]
15600                 op5 := mem_2_2_2.Args[0]
15601                 if op5.Op != OpOffPtr {
15602                         break
15603                 }
15604                 tt5 := op5.Type
15605                 if auxIntToInt64(op5.AuxInt) != 0 {
15606                         break
15607                 }
15608                 p5 := op5.Args[0]
15609                 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && t5.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && registerizable(b, t5) && o4 == t5.Size() && o3-o4 == t4.Size() && o2-o3 == t3.Size() && n == t2.Size()+t3.Size()+t4.Size()+t5.Size()) {
15610                         break
15611                 }
15612                 v.reset(OpStore)
15613                 v.Aux = typeToAux(t2)
15614                 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2)
15615                 v0.AuxInt = int64ToAuxInt(o2)
15616                 v0.AddArg(dst)
15617                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
15618                 v1.Aux = typeToAux(t3)
15619                 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3)
15620                 v2.AuxInt = int64ToAuxInt(o3)
15621                 v2.AddArg(dst)
15622                 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
15623                 v3.Aux = typeToAux(t4)
15624                 v4 := b.NewValue0(v.Pos, OpOffPtr, tt4)
15625                 v4.AuxInt = int64ToAuxInt(o4)
15626                 v4.AddArg(dst)
15627                 v5 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
15628                 v5.Aux = typeToAux(t5)
15629                 v6 := b.NewValue0(v.Pos, OpOffPtr, tt5)
15630                 v6.AuxInt = int64ToAuxInt(0)
15631                 v6.AddArg(dst)
15632                 v5.AddArg3(v6, d4, mem)
15633                 v3.AddArg3(v4, d3, v5)
15634                 v1.AddArg3(v2, d2, v3)
15635                 v.AddArg3(v0, d1, v1)
15636                 return true
15637         }
15638         // match: (Move {t1} [n] dst p1 mem:(VarDef (Store {t2} op2:(OffPtr <tt2> [o2] p2) d1 (Store {t3} op3:(OffPtr <tt3> [0] p3) d2 _))))
15639         // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && o2 == t3.Size() && n == t2.Size() + t3.Size()
15640         // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [0] dst) d2 mem))
15641         for {
15642                 n := auxIntToInt64(v.AuxInt)
15643                 t1 := auxToType(v.Aux)
15644                 dst := v_0
15645                 p1 := v_1
15646                 mem := v_2
15647                 if mem.Op != OpVarDef {
15648                         break
15649                 }
15650                 mem_0 := mem.Args[0]
15651                 if mem_0.Op != OpStore {
15652                         break
15653                 }
15654                 t2 := auxToType(mem_0.Aux)
15655                 _ = mem_0.Args[2]
15656                 op2 := mem_0.Args[0]
15657                 if op2.Op != OpOffPtr {
15658                         break
15659                 }
15660                 tt2 := op2.Type
15661                 o2 := auxIntToInt64(op2.AuxInt)
15662                 p2 := op2.Args[0]
15663                 d1 := mem_0.Args[1]
15664                 mem_0_2 := mem_0.Args[2]
15665                 if mem_0_2.Op != OpStore {
15666                         break
15667                 }
15668                 t3 := auxToType(mem_0_2.Aux)
15669                 d2 := mem_0_2.Args[1]
15670                 op3 := mem_0_2.Args[0]
15671                 if op3.Op != OpOffPtr {
15672                         break
15673                 }
15674                 tt3 := op3.Type
15675                 if auxIntToInt64(op3.AuxInt) != 0 {
15676                         break
15677                 }
15678                 p3 := op3.Args[0]
15679                 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && o2 == t3.Size() && n == t2.Size()+t3.Size()) {
15680                         break
15681                 }
15682                 v.reset(OpStore)
15683                 v.Aux = typeToAux(t2)
15684                 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2)
15685                 v0.AuxInt = int64ToAuxInt(o2)
15686                 v0.AddArg(dst)
15687                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
15688                 v1.Aux = typeToAux(t3)
15689                 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3)
15690                 v2.AuxInt = int64ToAuxInt(0)
15691                 v2.AddArg(dst)
15692                 v1.AddArg3(v2, d2, mem)
15693                 v.AddArg3(v0, d1, v1)
15694                 return true
15695         }
15696         // match: (Move {t1} [n] dst p1 mem:(VarDef (Store {t2} op2:(OffPtr <tt2> [o2] p2) d1 (Store {t3} op3:(OffPtr <tt3> [o3] p3) d2 (Store {t4} op4:(OffPtr <tt4> [0] p4) d3 _)))))
15697         // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && o3 == t4.Size() && o2-o3 == t3.Size() && n == t2.Size() + t3.Size() + t4.Size()
15698         // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Store {t4} (OffPtr <tt4> [0] dst) d3 mem)))
15699         for {
15700                 n := auxIntToInt64(v.AuxInt)
15701                 t1 := auxToType(v.Aux)
15702                 dst := v_0
15703                 p1 := v_1
15704                 mem := v_2
15705                 if mem.Op != OpVarDef {
15706                         break
15707                 }
15708                 mem_0 := mem.Args[0]
15709                 if mem_0.Op != OpStore {
15710                         break
15711                 }
15712                 t2 := auxToType(mem_0.Aux)
15713                 _ = mem_0.Args[2]
15714                 op2 := mem_0.Args[0]
15715                 if op2.Op != OpOffPtr {
15716                         break
15717                 }
15718                 tt2 := op2.Type
15719                 o2 := auxIntToInt64(op2.AuxInt)
15720                 p2 := op2.Args[0]
15721                 d1 := mem_0.Args[1]
15722                 mem_0_2 := mem_0.Args[2]
15723                 if mem_0_2.Op != OpStore {
15724                         break
15725                 }
15726                 t3 := auxToType(mem_0_2.Aux)
15727                 _ = mem_0_2.Args[2]
15728                 op3 := mem_0_2.Args[0]
15729                 if op3.Op != OpOffPtr {
15730                         break
15731                 }
15732                 tt3 := op3.Type
15733                 o3 := auxIntToInt64(op3.AuxInt)
15734                 p3 := op3.Args[0]
15735                 d2 := mem_0_2.Args[1]
15736                 mem_0_2_2 := mem_0_2.Args[2]
15737                 if mem_0_2_2.Op != OpStore {
15738                         break
15739                 }
15740                 t4 := auxToType(mem_0_2_2.Aux)
15741                 d3 := mem_0_2_2.Args[1]
15742                 op4 := mem_0_2_2.Args[0]
15743                 if op4.Op != OpOffPtr {
15744                         break
15745                 }
15746                 tt4 := op4.Type
15747                 if auxIntToInt64(op4.AuxInt) != 0 {
15748                         break
15749                 }
15750                 p4 := op4.Args[0]
15751                 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && o3 == t4.Size() && o2-o3 == t3.Size() && n == t2.Size()+t3.Size()+t4.Size()) {
15752                         break
15753                 }
15754                 v.reset(OpStore)
15755                 v.Aux = typeToAux(t2)
15756                 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2)
15757                 v0.AuxInt = int64ToAuxInt(o2)
15758                 v0.AddArg(dst)
15759                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
15760                 v1.Aux = typeToAux(t3)
15761                 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3)
15762                 v2.AuxInt = int64ToAuxInt(o3)
15763                 v2.AddArg(dst)
15764                 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
15765                 v3.Aux = typeToAux(t4)
15766                 v4 := b.NewValue0(v.Pos, OpOffPtr, tt4)
15767                 v4.AuxInt = int64ToAuxInt(0)
15768                 v4.AddArg(dst)
15769                 v3.AddArg3(v4, d3, mem)
15770                 v1.AddArg3(v2, d2, v3)
15771                 v.AddArg3(v0, d1, v1)
15772                 return true
15773         }
15774         // match: (Move {t1} [n] dst p1 mem:(VarDef (Store {t2} op2:(OffPtr <tt2> [o2] p2) d1 (Store {t3} op3:(OffPtr <tt3> [o3] p3) d2 (Store {t4} op4:(OffPtr <tt4> [o4] p4) d3 (Store {t5} op5:(OffPtr <tt5> [0] p5) d4 _))))))
15775         // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && t5.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && registerizable(b, t5) && o4 == t5.Size() && o3-o4 == t4.Size() && o2-o3 == t3.Size() && n == t2.Size() + t3.Size() + t4.Size() + t5.Size()
15776         // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Store {t4} (OffPtr <tt4> [o4] dst) d3 (Store {t5} (OffPtr <tt5> [0] dst) d4 mem))))
15777         for {
15778                 n := auxIntToInt64(v.AuxInt)
15779                 t1 := auxToType(v.Aux)
15780                 dst := v_0
15781                 p1 := v_1
15782                 mem := v_2
15783                 if mem.Op != OpVarDef {
15784                         break
15785                 }
15786                 mem_0 := mem.Args[0]
15787                 if mem_0.Op != OpStore {
15788                         break
15789                 }
15790                 t2 := auxToType(mem_0.Aux)
15791                 _ = mem_0.Args[2]
15792                 op2 := mem_0.Args[0]
15793                 if op2.Op != OpOffPtr {
15794                         break
15795                 }
15796                 tt2 := op2.Type
15797                 o2 := auxIntToInt64(op2.AuxInt)
15798                 p2 := op2.Args[0]
15799                 d1 := mem_0.Args[1]
15800                 mem_0_2 := mem_0.Args[2]
15801                 if mem_0_2.Op != OpStore {
15802                         break
15803                 }
15804                 t3 := auxToType(mem_0_2.Aux)
15805                 _ = mem_0_2.Args[2]
15806                 op3 := mem_0_2.Args[0]
15807                 if op3.Op != OpOffPtr {
15808                         break
15809                 }
15810                 tt3 := op3.Type
15811                 o3 := auxIntToInt64(op3.AuxInt)
15812                 p3 := op3.Args[0]
15813                 d2 := mem_0_2.Args[1]
15814                 mem_0_2_2 := mem_0_2.Args[2]
15815                 if mem_0_2_2.Op != OpStore {
15816                         break
15817                 }
15818                 t4 := auxToType(mem_0_2_2.Aux)
15819                 _ = mem_0_2_2.Args[2]
15820                 op4 := mem_0_2_2.Args[0]
15821                 if op4.Op != OpOffPtr {
15822                         break
15823                 }
15824                 tt4 := op4.Type
15825                 o4 := auxIntToInt64(op4.AuxInt)
15826                 p4 := op4.Args[0]
15827                 d3 := mem_0_2_2.Args[1]
15828                 mem_0_2_2_2 := mem_0_2_2.Args[2]
15829                 if mem_0_2_2_2.Op != OpStore {
15830                         break
15831                 }
15832                 t5 := auxToType(mem_0_2_2_2.Aux)
15833                 d4 := mem_0_2_2_2.Args[1]
15834                 op5 := mem_0_2_2_2.Args[0]
15835                 if op5.Op != OpOffPtr {
15836                         break
15837                 }
15838                 tt5 := op5.Type
15839                 if auxIntToInt64(op5.AuxInt) != 0 {
15840                         break
15841                 }
15842                 p5 := op5.Args[0]
15843                 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && t5.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && registerizable(b, t5) && o4 == t5.Size() && o3-o4 == t4.Size() && o2-o3 == t3.Size() && n == t2.Size()+t3.Size()+t4.Size()+t5.Size()) {
15844                         break
15845                 }
15846                 v.reset(OpStore)
15847                 v.Aux = typeToAux(t2)
15848                 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2)
15849                 v0.AuxInt = int64ToAuxInt(o2)
15850                 v0.AddArg(dst)
15851                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
15852                 v1.Aux = typeToAux(t3)
15853                 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3)
15854                 v2.AuxInt = int64ToAuxInt(o3)
15855                 v2.AddArg(dst)
15856                 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
15857                 v3.Aux = typeToAux(t4)
15858                 v4 := b.NewValue0(v.Pos, OpOffPtr, tt4)
15859                 v4.AuxInt = int64ToAuxInt(o4)
15860                 v4.AddArg(dst)
15861                 v5 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
15862                 v5.Aux = typeToAux(t5)
15863                 v6 := b.NewValue0(v.Pos, OpOffPtr, tt5)
15864                 v6.AuxInt = int64ToAuxInt(0)
15865                 v6.AddArg(dst)
15866                 v5.AddArg3(v6, d4, mem)
15867                 v3.AddArg3(v4, d3, v5)
15868                 v1.AddArg3(v2, d2, v3)
15869                 v.AddArg3(v0, d1, v1)
15870                 return true
15871         }
15872         // match: (Move {t1} [n] dst p1 mem:(Store {t2} op2:(OffPtr <tt2> [o2] p2) d1 (Zero {t3} [n] p3 _)))
15873         // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && registerizable(b, t2) && n >= o2 + t2.Size()
15874         // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Zero {t1} [n] dst mem))
15875         for {
15876                 n := auxIntToInt64(v.AuxInt)
15877                 t1 := auxToType(v.Aux)
15878                 dst := v_0
15879                 p1 := v_1
15880                 mem := v_2
15881                 if mem.Op != OpStore {
15882                         break
15883                 }
15884                 t2 := auxToType(mem.Aux)
15885                 _ = mem.Args[2]
15886                 op2 := mem.Args[0]
15887                 if op2.Op != OpOffPtr {
15888                         break
15889                 }
15890                 tt2 := op2.Type
15891                 o2 := auxIntToInt64(op2.AuxInt)
15892                 p2 := op2.Args[0]
15893                 d1 := mem.Args[1]
15894                 mem_2 := mem.Args[2]
15895                 if mem_2.Op != OpZero || auxIntToInt64(mem_2.AuxInt) != n {
15896                         break
15897                 }
15898                 t3 := auxToType(mem_2.Aux)
15899                 p3 := mem_2.Args[0]
15900                 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && registerizable(b, t2) && n >= o2+t2.Size()) {
15901                         break
15902                 }
15903                 v.reset(OpStore)
15904                 v.Aux = typeToAux(t2)
15905                 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2)
15906                 v0.AuxInt = int64ToAuxInt(o2)
15907                 v0.AddArg(dst)
15908                 v1 := b.NewValue0(v.Pos, OpZero, types.TypeMem)
15909                 v1.AuxInt = int64ToAuxInt(n)
15910                 v1.Aux = typeToAux(t1)
15911                 v1.AddArg2(dst, mem)
15912                 v.AddArg3(v0, d1, v1)
15913                 return true
15914         }
15915         // match: (Move {t1} [n] dst p1 mem:(Store {t2} (OffPtr <tt2> [o2] p2) d1 (Store {t3} (OffPtr <tt3> [o3] p3) d2 (Zero {t4} [n] p4 _))))
15916         // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && n >= o2 + t2.Size() && n >= o3 + t3.Size()
15917         // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Zero {t1} [n] dst mem)))
15918         for {
15919                 n := auxIntToInt64(v.AuxInt)
15920                 t1 := auxToType(v.Aux)
15921                 dst := v_0
15922                 p1 := v_1
15923                 mem := v_2
15924                 if mem.Op != OpStore {
15925                         break
15926                 }
15927                 t2 := auxToType(mem.Aux)
15928                 _ = mem.Args[2]
15929                 mem_0 := mem.Args[0]
15930                 if mem_0.Op != OpOffPtr {
15931                         break
15932                 }
15933                 tt2 := mem_0.Type
15934                 o2 := auxIntToInt64(mem_0.AuxInt)
15935                 p2 := mem_0.Args[0]
15936                 d1 := mem.Args[1]
15937                 mem_2 := mem.Args[2]
15938                 if mem_2.Op != OpStore {
15939                         break
15940                 }
15941                 t3 := auxToType(mem_2.Aux)
15942                 _ = mem_2.Args[2]
15943                 mem_2_0 := mem_2.Args[0]
15944                 if mem_2_0.Op != OpOffPtr {
15945                         break
15946                 }
15947                 tt3 := mem_2_0.Type
15948                 o3 := auxIntToInt64(mem_2_0.AuxInt)
15949                 p3 := mem_2_0.Args[0]
15950                 d2 := mem_2.Args[1]
15951                 mem_2_2 := mem_2.Args[2]
15952                 if mem_2_2.Op != OpZero || auxIntToInt64(mem_2_2.AuxInt) != n {
15953                         break
15954                 }
15955                 t4 := auxToType(mem_2_2.Aux)
15956                 p4 := mem_2_2.Args[0]
15957                 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && n >= o2+t2.Size() && n >= o3+t3.Size()) {
15958                         break
15959                 }
15960                 v.reset(OpStore)
15961                 v.Aux = typeToAux(t2)
15962                 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2)
15963                 v0.AuxInt = int64ToAuxInt(o2)
15964                 v0.AddArg(dst)
15965                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
15966                 v1.Aux = typeToAux(t3)
15967                 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3)
15968                 v2.AuxInt = int64ToAuxInt(o3)
15969                 v2.AddArg(dst)
15970                 v3 := b.NewValue0(v.Pos, OpZero, types.TypeMem)
15971                 v3.AuxInt = int64ToAuxInt(n)
15972                 v3.Aux = typeToAux(t1)
15973                 v3.AddArg2(dst, mem)
15974                 v1.AddArg3(v2, d2, v3)
15975                 v.AddArg3(v0, d1, v1)
15976                 return true
15977         }
15978         // match: (Move {t1} [n] dst p1 mem:(Store {t2} (OffPtr <tt2> [o2] p2) d1 (Store {t3} (OffPtr <tt3> [o3] p3) d2 (Store {t4} (OffPtr <tt4> [o4] p4) d3 (Zero {t5} [n] p5 _)))))
15979         // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && t5.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && n >= o2 + t2.Size() && n >= o3 + t3.Size() && n >= o4 + t4.Size()
15980         // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Store {t4} (OffPtr <tt4> [o4] dst) d3 (Zero {t1} [n] dst mem))))
15981         for {
15982                 n := auxIntToInt64(v.AuxInt)
15983                 t1 := auxToType(v.Aux)
15984                 dst := v_0
15985                 p1 := v_1
15986                 mem := v_2
15987                 if mem.Op != OpStore {
15988                         break
15989                 }
15990                 t2 := auxToType(mem.Aux)
15991                 _ = mem.Args[2]
15992                 mem_0 := mem.Args[0]
15993                 if mem_0.Op != OpOffPtr {
15994                         break
15995                 }
15996                 tt2 := mem_0.Type
15997                 o2 := auxIntToInt64(mem_0.AuxInt)
15998                 p2 := mem_0.Args[0]
15999                 d1 := mem.Args[1]
16000                 mem_2 := mem.Args[2]
16001                 if mem_2.Op != OpStore {
16002                         break
16003                 }
16004                 t3 := auxToType(mem_2.Aux)
16005                 _ = mem_2.Args[2]
16006                 mem_2_0 := mem_2.Args[0]
16007                 if mem_2_0.Op != OpOffPtr {
16008                         break
16009                 }
16010                 tt3 := mem_2_0.Type
16011                 o3 := auxIntToInt64(mem_2_0.AuxInt)
16012                 p3 := mem_2_0.Args[0]
16013                 d2 := mem_2.Args[1]
16014                 mem_2_2 := mem_2.Args[2]
16015                 if mem_2_2.Op != OpStore {
16016                         break
16017                 }
16018                 t4 := auxToType(mem_2_2.Aux)
16019                 _ = mem_2_2.Args[2]
16020                 mem_2_2_0 := mem_2_2.Args[0]
16021                 if mem_2_2_0.Op != OpOffPtr {
16022                         break
16023                 }
16024                 tt4 := mem_2_2_0.Type
16025                 o4 := auxIntToInt64(mem_2_2_0.AuxInt)
16026                 p4 := mem_2_2_0.Args[0]
16027                 d3 := mem_2_2.Args[1]
16028                 mem_2_2_2 := mem_2_2.Args[2]
16029                 if mem_2_2_2.Op != OpZero || auxIntToInt64(mem_2_2_2.AuxInt) != n {
16030                         break
16031                 }
16032                 t5 := auxToType(mem_2_2_2.Aux)
16033                 p5 := mem_2_2_2.Args[0]
16034                 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && t5.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && n >= o2+t2.Size() && n >= o3+t3.Size() && n >= o4+t4.Size()) {
16035                         break
16036                 }
16037                 v.reset(OpStore)
16038                 v.Aux = typeToAux(t2)
16039                 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2)
16040                 v0.AuxInt = int64ToAuxInt(o2)
16041                 v0.AddArg(dst)
16042                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
16043                 v1.Aux = typeToAux(t3)
16044                 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3)
16045                 v2.AuxInt = int64ToAuxInt(o3)
16046                 v2.AddArg(dst)
16047                 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
16048                 v3.Aux = typeToAux(t4)
16049                 v4 := b.NewValue0(v.Pos, OpOffPtr, tt4)
16050                 v4.AuxInt = int64ToAuxInt(o4)
16051                 v4.AddArg(dst)
16052                 v5 := b.NewValue0(v.Pos, OpZero, types.TypeMem)
16053                 v5.AuxInt = int64ToAuxInt(n)
16054                 v5.Aux = typeToAux(t1)
16055                 v5.AddArg2(dst, mem)
16056                 v3.AddArg3(v4, d3, v5)
16057                 v1.AddArg3(v2, d2, v3)
16058                 v.AddArg3(v0, d1, v1)
16059                 return true
16060         }
16061         // match: (Move {t1} [n] dst p1 mem:(Store {t2} (OffPtr <tt2> [o2] p2) d1 (Store {t3} (OffPtr <tt3> [o3] p3) d2 (Store {t4} (OffPtr <tt4> [o4] p4) d3 (Store {t5} (OffPtr <tt5> [o5] p5) d4 (Zero {t6} [n] p6 _))))))
16062         // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && isSamePtr(p5, p6) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && t5.Alignment() <= t1.Alignment() && t6.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && registerizable(b, t5) && n >= o2 + t2.Size() && n >= o3 + t3.Size() && n >= o4 + t4.Size() && n >= o5 + t5.Size()
16063         // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Store {t4} (OffPtr <tt4> [o4] dst) d3 (Store {t5} (OffPtr <tt5> [o5] dst) d4 (Zero {t1} [n] dst mem)))))
16064         for {
16065                 n := auxIntToInt64(v.AuxInt)
16066                 t1 := auxToType(v.Aux)
16067                 dst := v_0
16068                 p1 := v_1
16069                 mem := v_2
16070                 if mem.Op != OpStore {
16071                         break
16072                 }
16073                 t2 := auxToType(mem.Aux)
16074                 _ = mem.Args[2]
16075                 mem_0 := mem.Args[0]
16076                 if mem_0.Op != OpOffPtr {
16077                         break
16078                 }
16079                 tt2 := mem_0.Type
16080                 o2 := auxIntToInt64(mem_0.AuxInt)
16081                 p2 := mem_0.Args[0]
16082                 d1 := mem.Args[1]
16083                 mem_2 := mem.Args[2]
16084                 if mem_2.Op != OpStore {
16085                         break
16086                 }
16087                 t3 := auxToType(mem_2.Aux)
16088                 _ = mem_2.Args[2]
16089                 mem_2_0 := mem_2.Args[0]
16090                 if mem_2_0.Op != OpOffPtr {
16091                         break
16092                 }
16093                 tt3 := mem_2_0.Type
16094                 o3 := auxIntToInt64(mem_2_0.AuxInt)
16095                 p3 := mem_2_0.Args[0]
16096                 d2 := mem_2.Args[1]
16097                 mem_2_2 := mem_2.Args[2]
16098                 if mem_2_2.Op != OpStore {
16099                         break
16100                 }
16101                 t4 := auxToType(mem_2_2.Aux)
16102                 _ = mem_2_2.Args[2]
16103                 mem_2_2_0 := mem_2_2.Args[0]
16104                 if mem_2_2_0.Op != OpOffPtr {
16105                         break
16106                 }
16107                 tt4 := mem_2_2_0.Type
16108                 o4 := auxIntToInt64(mem_2_2_0.AuxInt)
16109                 p4 := mem_2_2_0.Args[0]
16110                 d3 := mem_2_2.Args[1]
16111                 mem_2_2_2 := mem_2_2.Args[2]
16112                 if mem_2_2_2.Op != OpStore {
16113                         break
16114                 }
16115                 t5 := auxToType(mem_2_2_2.Aux)
16116                 _ = mem_2_2_2.Args[2]
16117                 mem_2_2_2_0 := mem_2_2_2.Args[0]
16118                 if mem_2_2_2_0.Op != OpOffPtr {
16119                         break
16120                 }
16121                 tt5 := mem_2_2_2_0.Type
16122                 o5 := auxIntToInt64(mem_2_2_2_0.AuxInt)
16123                 p5 := mem_2_2_2_0.Args[0]
16124                 d4 := mem_2_2_2.Args[1]
16125                 mem_2_2_2_2 := mem_2_2_2.Args[2]
16126                 if mem_2_2_2_2.Op != OpZero || auxIntToInt64(mem_2_2_2_2.AuxInt) != n {
16127                         break
16128                 }
16129                 t6 := auxToType(mem_2_2_2_2.Aux)
16130                 p6 := mem_2_2_2_2.Args[0]
16131                 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && isSamePtr(p5, p6) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && t5.Alignment() <= t1.Alignment() && t6.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && registerizable(b, t5) && n >= o2+t2.Size() && n >= o3+t3.Size() && n >= o4+t4.Size() && n >= o5+t5.Size()) {
16132                         break
16133                 }
16134                 v.reset(OpStore)
16135                 v.Aux = typeToAux(t2)
16136                 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2)
16137                 v0.AuxInt = int64ToAuxInt(o2)
16138                 v0.AddArg(dst)
16139                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
16140                 v1.Aux = typeToAux(t3)
16141                 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3)
16142                 v2.AuxInt = int64ToAuxInt(o3)
16143                 v2.AddArg(dst)
16144                 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
16145                 v3.Aux = typeToAux(t4)
16146                 v4 := b.NewValue0(v.Pos, OpOffPtr, tt4)
16147                 v4.AuxInt = int64ToAuxInt(o4)
16148                 v4.AddArg(dst)
16149                 v5 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
16150                 v5.Aux = typeToAux(t5)
16151                 v6 := b.NewValue0(v.Pos, OpOffPtr, tt5)
16152                 v6.AuxInt = int64ToAuxInt(o5)
16153                 v6.AddArg(dst)
16154                 v7 := b.NewValue0(v.Pos, OpZero, types.TypeMem)
16155                 v7.AuxInt = int64ToAuxInt(n)
16156                 v7.Aux = typeToAux(t1)
16157                 v7.AddArg2(dst, mem)
16158                 v5.AddArg3(v6, d4, v7)
16159                 v3.AddArg3(v4, d3, v5)
16160                 v1.AddArg3(v2, d2, v3)
16161                 v.AddArg3(v0, d1, v1)
16162                 return true
16163         }
16164         // match: (Move {t1} [n] dst p1 mem:(VarDef (Store {t2} op2:(OffPtr <tt2> [o2] p2) d1 (Zero {t3} [n] p3 _))))
16165         // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && registerizable(b, t2) && n >= o2 + t2.Size()
16166         // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Zero {t1} [n] dst mem))
16167         for {
16168                 n := auxIntToInt64(v.AuxInt)
16169                 t1 := auxToType(v.Aux)
16170                 dst := v_0
16171                 p1 := v_1
16172                 mem := v_2
16173                 if mem.Op != OpVarDef {
16174                         break
16175                 }
16176                 mem_0 := mem.Args[0]
16177                 if mem_0.Op != OpStore {
16178                         break
16179                 }
16180                 t2 := auxToType(mem_0.Aux)
16181                 _ = mem_0.Args[2]
16182                 op2 := mem_0.Args[0]
16183                 if op2.Op != OpOffPtr {
16184                         break
16185                 }
16186                 tt2 := op2.Type
16187                 o2 := auxIntToInt64(op2.AuxInt)
16188                 p2 := op2.Args[0]
16189                 d1 := mem_0.Args[1]
16190                 mem_0_2 := mem_0.Args[2]
16191                 if mem_0_2.Op != OpZero || auxIntToInt64(mem_0_2.AuxInt) != n {
16192                         break
16193                 }
16194                 t3 := auxToType(mem_0_2.Aux)
16195                 p3 := mem_0_2.Args[0]
16196                 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && registerizable(b, t2) && n >= o2+t2.Size()) {
16197                         break
16198                 }
16199                 v.reset(OpStore)
16200                 v.Aux = typeToAux(t2)
16201                 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2)
16202                 v0.AuxInt = int64ToAuxInt(o2)
16203                 v0.AddArg(dst)
16204                 v1 := b.NewValue0(v.Pos, OpZero, types.TypeMem)
16205                 v1.AuxInt = int64ToAuxInt(n)
16206                 v1.Aux = typeToAux(t1)
16207                 v1.AddArg2(dst, mem)
16208                 v.AddArg3(v0, d1, v1)
16209                 return true
16210         }
16211         // match: (Move {t1} [n] dst p1 mem:(VarDef (Store {t2} (OffPtr <tt2> [o2] p2) d1 (Store {t3} (OffPtr <tt3> [o3] p3) d2 (Zero {t4} [n] p4 _)))))
16212         // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && n >= o2 + t2.Size() && n >= o3 + t3.Size()
16213         // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Zero {t1} [n] dst mem)))
16214         for {
16215                 n := auxIntToInt64(v.AuxInt)
16216                 t1 := auxToType(v.Aux)
16217                 dst := v_0
16218                 p1 := v_1
16219                 mem := v_2
16220                 if mem.Op != OpVarDef {
16221                         break
16222                 }
16223                 mem_0 := mem.Args[0]
16224                 if mem_0.Op != OpStore {
16225                         break
16226                 }
16227                 t2 := auxToType(mem_0.Aux)
16228                 _ = mem_0.Args[2]
16229                 mem_0_0 := mem_0.Args[0]
16230                 if mem_0_0.Op != OpOffPtr {
16231                         break
16232                 }
16233                 tt2 := mem_0_0.Type
16234                 o2 := auxIntToInt64(mem_0_0.AuxInt)
16235                 p2 := mem_0_0.Args[0]
16236                 d1 := mem_0.Args[1]
16237                 mem_0_2 := mem_0.Args[2]
16238                 if mem_0_2.Op != OpStore {
16239                         break
16240                 }
16241                 t3 := auxToType(mem_0_2.Aux)
16242                 _ = mem_0_2.Args[2]
16243                 mem_0_2_0 := mem_0_2.Args[0]
16244                 if mem_0_2_0.Op != OpOffPtr {
16245                         break
16246                 }
16247                 tt3 := mem_0_2_0.Type
16248                 o3 := auxIntToInt64(mem_0_2_0.AuxInt)
16249                 p3 := mem_0_2_0.Args[0]
16250                 d2 := mem_0_2.Args[1]
16251                 mem_0_2_2 := mem_0_2.Args[2]
16252                 if mem_0_2_2.Op != OpZero || auxIntToInt64(mem_0_2_2.AuxInt) != n {
16253                         break
16254                 }
16255                 t4 := auxToType(mem_0_2_2.Aux)
16256                 p4 := mem_0_2_2.Args[0]
16257                 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && n >= o2+t2.Size() && n >= o3+t3.Size()) {
16258                         break
16259                 }
16260                 v.reset(OpStore)
16261                 v.Aux = typeToAux(t2)
16262                 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2)
16263                 v0.AuxInt = int64ToAuxInt(o2)
16264                 v0.AddArg(dst)
16265                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
16266                 v1.Aux = typeToAux(t3)
16267                 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3)
16268                 v2.AuxInt = int64ToAuxInt(o3)
16269                 v2.AddArg(dst)
16270                 v3 := b.NewValue0(v.Pos, OpZero, types.TypeMem)
16271                 v3.AuxInt = int64ToAuxInt(n)
16272                 v3.Aux = typeToAux(t1)
16273                 v3.AddArg2(dst, mem)
16274                 v1.AddArg3(v2, d2, v3)
16275                 v.AddArg3(v0, d1, v1)
16276                 return true
16277         }
16278         // match: (Move {t1} [n] dst p1 mem:(VarDef (Store {t2} (OffPtr <tt2> [o2] p2) d1 (Store {t3} (OffPtr <tt3> [o3] p3) d2 (Store {t4} (OffPtr <tt4> [o4] p4) d3 (Zero {t5} [n] p5 _))))))
16279         // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && t5.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && n >= o2 + t2.Size() && n >= o3 + t3.Size() && n >= o4 + t4.Size()
16280         // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Store {t4} (OffPtr <tt4> [o4] dst) d3 (Zero {t1} [n] dst mem))))
16281         for {
16282                 n := auxIntToInt64(v.AuxInt)
16283                 t1 := auxToType(v.Aux)
16284                 dst := v_0
16285                 p1 := v_1
16286                 mem := v_2
16287                 if mem.Op != OpVarDef {
16288                         break
16289                 }
16290                 mem_0 := mem.Args[0]
16291                 if mem_0.Op != OpStore {
16292                         break
16293                 }
16294                 t2 := auxToType(mem_0.Aux)
16295                 _ = mem_0.Args[2]
16296                 mem_0_0 := mem_0.Args[0]
16297                 if mem_0_0.Op != OpOffPtr {
16298                         break
16299                 }
16300                 tt2 := mem_0_0.Type
16301                 o2 := auxIntToInt64(mem_0_0.AuxInt)
16302                 p2 := mem_0_0.Args[0]
16303                 d1 := mem_0.Args[1]
16304                 mem_0_2 := mem_0.Args[2]
16305                 if mem_0_2.Op != OpStore {
16306                         break
16307                 }
16308                 t3 := auxToType(mem_0_2.Aux)
16309                 _ = mem_0_2.Args[2]
16310                 mem_0_2_0 := mem_0_2.Args[0]
16311                 if mem_0_2_0.Op != OpOffPtr {
16312                         break
16313                 }
16314                 tt3 := mem_0_2_0.Type
16315                 o3 := auxIntToInt64(mem_0_2_0.AuxInt)
16316                 p3 := mem_0_2_0.Args[0]
16317                 d2 := mem_0_2.Args[1]
16318                 mem_0_2_2 := mem_0_2.Args[2]
16319                 if mem_0_2_2.Op != OpStore {
16320                         break
16321                 }
16322                 t4 := auxToType(mem_0_2_2.Aux)
16323                 _ = mem_0_2_2.Args[2]
16324                 mem_0_2_2_0 := mem_0_2_2.Args[0]
16325                 if mem_0_2_2_0.Op != OpOffPtr {
16326                         break
16327                 }
16328                 tt4 := mem_0_2_2_0.Type
16329                 o4 := auxIntToInt64(mem_0_2_2_0.AuxInt)
16330                 p4 := mem_0_2_2_0.Args[0]
16331                 d3 := mem_0_2_2.Args[1]
16332                 mem_0_2_2_2 := mem_0_2_2.Args[2]
16333                 if mem_0_2_2_2.Op != OpZero || auxIntToInt64(mem_0_2_2_2.AuxInt) != n {
16334                         break
16335                 }
16336                 t5 := auxToType(mem_0_2_2_2.Aux)
16337                 p5 := mem_0_2_2_2.Args[0]
16338                 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && t5.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && n >= o2+t2.Size() && n >= o3+t3.Size() && n >= o4+t4.Size()) {
16339                         break
16340                 }
16341                 v.reset(OpStore)
16342                 v.Aux = typeToAux(t2)
16343                 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2)
16344                 v0.AuxInt = int64ToAuxInt(o2)
16345                 v0.AddArg(dst)
16346                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
16347                 v1.Aux = typeToAux(t3)
16348                 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3)
16349                 v2.AuxInt = int64ToAuxInt(o3)
16350                 v2.AddArg(dst)
16351                 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
16352                 v3.Aux = typeToAux(t4)
16353                 v4 := b.NewValue0(v.Pos, OpOffPtr, tt4)
16354                 v4.AuxInt = int64ToAuxInt(o4)
16355                 v4.AddArg(dst)
16356                 v5 := b.NewValue0(v.Pos, OpZero, types.TypeMem)
16357                 v5.AuxInt = int64ToAuxInt(n)
16358                 v5.Aux = typeToAux(t1)
16359                 v5.AddArg2(dst, mem)
16360                 v3.AddArg3(v4, d3, v5)
16361                 v1.AddArg3(v2, d2, v3)
16362                 v.AddArg3(v0, d1, v1)
16363                 return true
16364         }
16365         // match: (Move {t1} [n] dst p1 mem:(VarDef (Store {t2} (OffPtr <tt2> [o2] p2) d1 (Store {t3} (OffPtr <tt3> [o3] p3) d2 (Store {t4} (OffPtr <tt4> [o4] p4) d3 (Store {t5} (OffPtr <tt5> [o5] p5) d4 (Zero {t6} [n] p6 _)))))))
16366         // cond: isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && isSamePtr(p5, p6) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && t5.Alignment() <= t1.Alignment() && t6.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && registerizable(b, t5) && n >= o2 + t2.Size() && n >= o3 + t3.Size() && n >= o4 + t4.Size() && n >= o5 + t5.Size()
16367         // result: (Store {t2} (OffPtr <tt2> [o2] dst) d1 (Store {t3} (OffPtr <tt3> [o3] dst) d2 (Store {t4} (OffPtr <tt4> [o4] dst) d3 (Store {t5} (OffPtr <tt5> [o5] dst) d4 (Zero {t1} [n] dst mem)))))
16368         for {
16369                 n := auxIntToInt64(v.AuxInt)
16370                 t1 := auxToType(v.Aux)
16371                 dst := v_0
16372                 p1 := v_1
16373                 mem := v_2
16374                 if mem.Op != OpVarDef {
16375                         break
16376                 }
16377                 mem_0 := mem.Args[0]
16378                 if mem_0.Op != OpStore {
16379                         break
16380                 }
16381                 t2 := auxToType(mem_0.Aux)
16382                 _ = mem_0.Args[2]
16383                 mem_0_0 := mem_0.Args[0]
16384                 if mem_0_0.Op != OpOffPtr {
16385                         break
16386                 }
16387                 tt2 := mem_0_0.Type
16388                 o2 := auxIntToInt64(mem_0_0.AuxInt)
16389                 p2 := mem_0_0.Args[0]
16390                 d1 := mem_0.Args[1]
16391                 mem_0_2 := mem_0.Args[2]
16392                 if mem_0_2.Op != OpStore {
16393                         break
16394                 }
16395                 t3 := auxToType(mem_0_2.Aux)
16396                 _ = mem_0_2.Args[2]
16397                 mem_0_2_0 := mem_0_2.Args[0]
16398                 if mem_0_2_0.Op != OpOffPtr {
16399                         break
16400                 }
16401                 tt3 := mem_0_2_0.Type
16402                 o3 := auxIntToInt64(mem_0_2_0.AuxInt)
16403                 p3 := mem_0_2_0.Args[0]
16404                 d2 := mem_0_2.Args[1]
16405                 mem_0_2_2 := mem_0_2.Args[2]
16406                 if mem_0_2_2.Op != OpStore {
16407                         break
16408                 }
16409                 t4 := auxToType(mem_0_2_2.Aux)
16410                 _ = mem_0_2_2.Args[2]
16411                 mem_0_2_2_0 := mem_0_2_2.Args[0]
16412                 if mem_0_2_2_0.Op != OpOffPtr {
16413                         break
16414                 }
16415                 tt4 := mem_0_2_2_0.Type
16416                 o4 := auxIntToInt64(mem_0_2_2_0.AuxInt)
16417                 p4 := mem_0_2_2_0.Args[0]
16418                 d3 := mem_0_2_2.Args[1]
16419                 mem_0_2_2_2 := mem_0_2_2.Args[2]
16420                 if mem_0_2_2_2.Op != OpStore {
16421                         break
16422                 }
16423                 t5 := auxToType(mem_0_2_2_2.Aux)
16424                 _ = mem_0_2_2_2.Args[2]
16425                 mem_0_2_2_2_0 := mem_0_2_2_2.Args[0]
16426                 if mem_0_2_2_2_0.Op != OpOffPtr {
16427                         break
16428                 }
16429                 tt5 := mem_0_2_2_2_0.Type
16430                 o5 := auxIntToInt64(mem_0_2_2_2_0.AuxInt)
16431                 p5 := mem_0_2_2_2_0.Args[0]
16432                 d4 := mem_0_2_2_2.Args[1]
16433                 mem_0_2_2_2_2 := mem_0_2_2_2.Args[2]
16434                 if mem_0_2_2_2_2.Op != OpZero || auxIntToInt64(mem_0_2_2_2_2.AuxInt) != n {
16435                         break
16436                 }
16437                 t6 := auxToType(mem_0_2_2_2_2.Aux)
16438                 p6 := mem_0_2_2_2_2.Args[0]
16439                 if !(isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && isSamePtr(p5, p6) && t2.Alignment() <= t1.Alignment() && t3.Alignment() <= t1.Alignment() && t4.Alignment() <= t1.Alignment() && t5.Alignment() <= t1.Alignment() && t6.Alignment() <= t1.Alignment() && registerizable(b, t2) && registerizable(b, t3) && registerizable(b, t4) && registerizable(b, t5) && n >= o2+t2.Size() && n >= o3+t3.Size() && n >= o4+t4.Size() && n >= o5+t5.Size()) {
16440                         break
16441                 }
16442                 v.reset(OpStore)
16443                 v.Aux = typeToAux(t2)
16444                 v0 := b.NewValue0(v.Pos, OpOffPtr, tt2)
16445                 v0.AuxInt = int64ToAuxInt(o2)
16446                 v0.AddArg(dst)
16447                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
16448                 v1.Aux = typeToAux(t3)
16449                 v2 := b.NewValue0(v.Pos, OpOffPtr, tt3)
16450                 v2.AuxInt = int64ToAuxInt(o3)
16451                 v2.AddArg(dst)
16452                 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
16453                 v3.Aux = typeToAux(t4)
16454                 v4 := b.NewValue0(v.Pos, OpOffPtr, tt4)
16455                 v4.AuxInt = int64ToAuxInt(o4)
16456                 v4.AddArg(dst)
16457                 v5 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
16458                 v5.Aux = typeToAux(t5)
16459                 v6 := b.NewValue0(v.Pos, OpOffPtr, tt5)
16460                 v6.AuxInt = int64ToAuxInt(o5)
16461                 v6.AddArg(dst)
16462                 v7 := b.NewValue0(v.Pos, OpZero, types.TypeMem)
16463                 v7.AuxInt = int64ToAuxInt(n)
16464                 v7.Aux = typeToAux(t1)
16465                 v7.AddArg2(dst, mem)
16466                 v5.AddArg3(v6, d4, v7)
16467                 v3.AddArg3(v4, d3, v5)
16468                 v1.AddArg3(v2, d2, v3)
16469                 v.AddArg3(v0, d1, v1)
16470                 return true
16471         }
16472         // match: (Move {t1} [s] dst tmp1 midmem:(Move {t2} [s] tmp2 src _))
16473         // cond: t1.Compare(t2) == types.CMPeq && isSamePtr(tmp1, tmp2) && isStackPtr(src) && !isVolatile(src) && disjoint(src, s, tmp2, s) && (disjoint(src, s, dst, s) || isInlinableMemmove(dst, src, s, config))
16474         // result: (Move {t1} [s] dst src midmem)
16475         for {
16476                 s := auxIntToInt64(v.AuxInt)
16477                 t1 := auxToType(v.Aux)
16478                 dst := v_0
16479                 tmp1 := v_1
16480                 midmem := v_2
16481                 if midmem.Op != OpMove || auxIntToInt64(midmem.AuxInt) != s {
16482                         break
16483                 }
16484                 t2 := auxToType(midmem.Aux)
16485                 src := midmem.Args[1]
16486                 tmp2 := midmem.Args[0]
16487                 if !(t1.Compare(t2) == types.CMPeq && isSamePtr(tmp1, tmp2) && isStackPtr(src) && !isVolatile(src) && disjoint(src, s, tmp2, s) && (disjoint(src, s, dst, s) || isInlinableMemmove(dst, src, s, config))) {
16488                         break
16489                 }
16490                 v.reset(OpMove)
16491                 v.AuxInt = int64ToAuxInt(s)
16492                 v.Aux = typeToAux(t1)
16493                 v.AddArg3(dst, src, midmem)
16494                 return true
16495         }
16496         // match: (Move {t1} [s] dst tmp1 midmem:(VarDef (Move {t2} [s] tmp2 src _)))
16497         // cond: t1.Compare(t2) == types.CMPeq && isSamePtr(tmp1, tmp2) && isStackPtr(src) && !isVolatile(src) && disjoint(src, s, tmp2, s) && (disjoint(src, s, dst, s) || isInlinableMemmove(dst, src, s, config))
16498         // result: (Move {t1} [s] dst src midmem)
16499         for {
16500                 s := auxIntToInt64(v.AuxInt)
16501                 t1 := auxToType(v.Aux)
16502                 dst := v_0
16503                 tmp1 := v_1
16504                 midmem := v_2
16505                 if midmem.Op != OpVarDef {
16506                         break
16507                 }
16508                 midmem_0 := midmem.Args[0]
16509                 if midmem_0.Op != OpMove || auxIntToInt64(midmem_0.AuxInt) != s {
16510                         break
16511                 }
16512                 t2 := auxToType(midmem_0.Aux)
16513                 src := midmem_0.Args[1]
16514                 tmp2 := midmem_0.Args[0]
16515                 if !(t1.Compare(t2) == types.CMPeq && isSamePtr(tmp1, tmp2) && isStackPtr(src) && !isVolatile(src) && disjoint(src, s, tmp2, s) && (disjoint(src, s, dst, s) || isInlinableMemmove(dst, src, s, config))) {
16516                         break
16517                 }
16518                 v.reset(OpMove)
16519                 v.AuxInt = int64ToAuxInt(s)
16520                 v.Aux = typeToAux(t1)
16521                 v.AddArg3(dst, src, midmem)
16522                 return true
16523         }
16524         // match: (Move dst src mem)
16525         // cond: isSamePtr(dst, src)
16526         // result: mem
16527         for {
16528                 dst := v_0
16529                 src := v_1
16530                 mem := v_2
16531                 if !(isSamePtr(dst, src)) {
16532                         break
16533                 }
16534                 v.copyOf(mem)
16535                 return true
16536         }
16537         return false
16538 }
16539 func rewriteValuegeneric_OpMul16(v *Value) bool {
16540         v_1 := v.Args[1]
16541         v_0 := v.Args[0]
16542         b := v.Block
16543         typ := &b.Func.Config.Types
16544         // match: (Mul16 (Const16 [c]) (Const16 [d]))
16545         // result: (Const16 [c*d])
16546         for {
16547                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16548                         if v_0.Op != OpConst16 {
16549                                 continue
16550                         }
16551                         c := auxIntToInt16(v_0.AuxInt)
16552                         if v_1.Op != OpConst16 {
16553                                 continue
16554                         }
16555                         d := auxIntToInt16(v_1.AuxInt)
16556                         v.reset(OpConst16)
16557                         v.AuxInt = int16ToAuxInt(c * d)
16558                         return true
16559                 }
16560                 break
16561         }
16562         // match: (Mul16 (Const16 [1]) x)
16563         // result: x
16564         for {
16565                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16566                         if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 1 {
16567                                 continue
16568                         }
16569                         x := v_1
16570                         v.copyOf(x)
16571                         return true
16572                 }
16573                 break
16574         }
16575         // match: (Mul16 (Const16 [-1]) x)
16576         // result: (Neg16 x)
16577         for {
16578                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16579                         if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != -1 {
16580                                 continue
16581                         }
16582                         x := v_1
16583                         v.reset(OpNeg16)
16584                         v.AddArg(x)
16585                         return true
16586                 }
16587                 break
16588         }
16589         // match: (Mul16 <t> n (Const16 [c]))
16590         // cond: isPowerOfTwo16(c)
16591         // result: (Lsh16x64 <t> n (Const64 <typ.UInt64> [log16(c)]))
16592         for {
16593                 t := v.Type
16594                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16595                         n := v_0
16596                         if v_1.Op != OpConst16 {
16597                                 continue
16598                         }
16599                         c := auxIntToInt16(v_1.AuxInt)
16600                         if !(isPowerOfTwo16(c)) {
16601                                 continue
16602                         }
16603                         v.reset(OpLsh16x64)
16604                         v.Type = t
16605                         v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
16606                         v0.AuxInt = int64ToAuxInt(log16(c))
16607                         v.AddArg2(n, v0)
16608                         return true
16609                 }
16610                 break
16611         }
16612         // match: (Mul16 <t> n (Const16 [c]))
16613         // cond: t.IsSigned() && isPowerOfTwo16(-c)
16614         // result: (Neg16 (Lsh16x64 <t> n (Const64 <typ.UInt64> [log16(-c)])))
16615         for {
16616                 t := v.Type
16617                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16618                         n := v_0
16619                         if v_1.Op != OpConst16 {
16620                                 continue
16621                         }
16622                         c := auxIntToInt16(v_1.AuxInt)
16623                         if !(t.IsSigned() && isPowerOfTwo16(-c)) {
16624                                 continue
16625                         }
16626                         v.reset(OpNeg16)
16627                         v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
16628                         v1 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
16629                         v1.AuxInt = int64ToAuxInt(log16(-c))
16630                         v0.AddArg2(n, v1)
16631                         v.AddArg(v0)
16632                         return true
16633                 }
16634                 break
16635         }
16636         // match: (Mul16 (Const16 [0]) _)
16637         // result: (Const16 [0])
16638         for {
16639                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16640                         if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
16641                                 continue
16642                         }
16643                         v.reset(OpConst16)
16644                         v.AuxInt = int16ToAuxInt(0)
16645                         return true
16646                 }
16647                 break
16648         }
16649         // match: (Mul16 (Mul16 i:(Const16 <t>) z) x)
16650         // cond: (z.Op != OpConst16 && x.Op != OpConst16)
16651         // result: (Mul16 i (Mul16 <t> x z))
16652         for {
16653                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16654                         if v_0.Op != OpMul16 {
16655                                 continue
16656                         }
16657                         _ = v_0.Args[1]
16658                         v_0_0 := v_0.Args[0]
16659                         v_0_1 := v_0.Args[1]
16660                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
16661                                 i := v_0_0
16662                                 if i.Op != OpConst16 {
16663                                         continue
16664                                 }
16665                                 t := i.Type
16666                                 z := v_0_1
16667                                 x := v_1
16668                                 if !(z.Op != OpConst16 && x.Op != OpConst16) {
16669                                         continue
16670                                 }
16671                                 v.reset(OpMul16)
16672                                 v0 := b.NewValue0(v.Pos, OpMul16, t)
16673                                 v0.AddArg2(x, z)
16674                                 v.AddArg2(i, v0)
16675                                 return true
16676                         }
16677                 }
16678                 break
16679         }
16680         // match: (Mul16 (Const16 <t> [c]) (Mul16 (Const16 <t> [d]) x))
16681         // result: (Mul16 (Const16 <t> [c*d]) x)
16682         for {
16683                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16684                         if v_0.Op != OpConst16 {
16685                                 continue
16686                         }
16687                         t := v_0.Type
16688                         c := auxIntToInt16(v_0.AuxInt)
16689                         if v_1.Op != OpMul16 {
16690                                 continue
16691                         }
16692                         _ = v_1.Args[1]
16693                         v_1_0 := v_1.Args[0]
16694                         v_1_1 := v_1.Args[1]
16695                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
16696                                 if v_1_0.Op != OpConst16 || v_1_0.Type != t {
16697                                         continue
16698                                 }
16699                                 d := auxIntToInt16(v_1_0.AuxInt)
16700                                 x := v_1_1
16701                                 v.reset(OpMul16)
16702                                 v0 := b.NewValue0(v.Pos, OpConst16, t)
16703                                 v0.AuxInt = int16ToAuxInt(c * d)
16704                                 v.AddArg2(v0, x)
16705                                 return true
16706                         }
16707                 }
16708                 break
16709         }
16710         return false
16711 }
16712 func rewriteValuegeneric_OpMul32(v *Value) bool {
16713         v_1 := v.Args[1]
16714         v_0 := v.Args[0]
16715         b := v.Block
16716         typ := &b.Func.Config.Types
16717         // match: (Mul32 (Const32 [c]) (Const32 [d]))
16718         // result: (Const32 [c*d])
16719         for {
16720                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16721                         if v_0.Op != OpConst32 {
16722                                 continue
16723                         }
16724                         c := auxIntToInt32(v_0.AuxInt)
16725                         if v_1.Op != OpConst32 {
16726                                 continue
16727                         }
16728                         d := auxIntToInt32(v_1.AuxInt)
16729                         v.reset(OpConst32)
16730                         v.AuxInt = int32ToAuxInt(c * d)
16731                         return true
16732                 }
16733                 break
16734         }
16735         // match: (Mul32 (Const32 [1]) x)
16736         // result: x
16737         for {
16738                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16739                         if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 1 {
16740                                 continue
16741                         }
16742                         x := v_1
16743                         v.copyOf(x)
16744                         return true
16745                 }
16746                 break
16747         }
16748         // match: (Mul32 (Const32 [-1]) x)
16749         // result: (Neg32 x)
16750         for {
16751                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16752                         if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != -1 {
16753                                 continue
16754                         }
16755                         x := v_1
16756                         v.reset(OpNeg32)
16757                         v.AddArg(x)
16758                         return true
16759                 }
16760                 break
16761         }
16762         // match: (Mul32 <t> n (Const32 [c]))
16763         // cond: isPowerOfTwo32(c)
16764         // result: (Lsh32x64 <t> n (Const64 <typ.UInt64> [log32(c)]))
16765         for {
16766                 t := v.Type
16767                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16768                         n := v_0
16769                         if v_1.Op != OpConst32 {
16770                                 continue
16771                         }
16772                         c := auxIntToInt32(v_1.AuxInt)
16773                         if !(isPowerOfTwo32(c)) {
16774                                 continue
16775                         }
16776                         v.reset(OpLsh32x64)
16777                         v.Type = t
16778                         v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
16779                         v0.AuxInt = int64ToAuxInt(log32(c))
16780                         v.AddArg2(n, v0)
16781                         return true
16782                 }
16783                 break
16784         }
16785         // match: (Mul32 <t> n (Const32 [c]))
16786         // cond: t.IsSigned() && isPowerOfTwo32(-c)
16787         // result: (Neg32 (Lsh32x64 <t> n (Const64 <typ.UInt64> [log32(-c)])))
16788         for {
16789                 t := v.Type
16790                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16791                         n := v_0
16792                         if v_1.Op != OpConst32 {
16793                                 continue
16794                         }
16795                         c := auxIntToInt32(v_1.AuxInt)
16796                         if !(t.IsSigned() && isPowerOfTwo32(-c)) {
16797                                 continue
16798                         }
16799                         v.reset(OpNeg32)
16800                         v0 := b.NewValue0(v.Pos, OpLsh32x64, t)
16801                         v1 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
16802                         v1.AuxInt = int64ToAuxInt(log32(-c))
16803                         v0.AddArg2(n, v1)
16804                         v.AddArg(v0)
16805                         return true
16806                 }
16807                 break
16808         }
16809         // match: (Mul32 (Const32 <t> [c]) (Add32 <t> (Const32 <t> [d]) x))
16810         // result: (Add32 (Const32 <t> [c*d]) (Mul32 <t> (Const32 <t> [c]) x))
16811         for {
16812                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16813                         if v_0.Op != OpConst32 {
16814                                 continue
16815                         }
16816                         t := v_0.Type
16817                         c := auxIntToInt32(v_0.AuxInt)
16818                         if v_1.Op != OpAdd32 || v_1.Type != t {
16819                                 continue
16820                         }
16821                         _ = v_1.Args[1]
16822                         v_1_0 := v_1.Args[0]
16823                         v_1_1 := v_1.Args[1]
16824                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
16825                                 if v_1_0.Op != OpConst32 || v_1_0.Type != t {
16826                                         continue
16827                                 }
16828                                 d := auxIntToInt32(v_1_0.AuxInt)
16829                                 x := v_1_1
16830                                 v.reset(OpAdd32)
16831                                 v0 := b.NewValue0(v.Pos, OpConst32, t)
16832                                 v0.AuxInt = int32ToAuxInt(c * d)
16833                                 v1 := b.NewValue0(v.Pos, OpMul32, t)
16834                                 v2 := b.NewValue0(v.Pos, OpConst32, t)
16835                                 v2.AuxInt = int32ToAuxInt(c)
16836                                 v1.AddArg2(v2, x)
16837                                 v.AddArg2(v0, v1)
16838                                 return true
16839                         }
16840                 }
16841                 break
16842         }
16843         // match: (Mul32 (Const32 [0]) _)
16844         // result: (Const32 [0])
16845         for {
16846                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16847                         if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
16848                                 continue
16849                         }
16850                         v.reset(OpConst32)
16851                         v.AuxInt = int32ToAuxInt(0)
16852                         return true
16853                 }
16854                 break
16855         }
16856         // match: (Mul32 (Mul32 i:(Const32 <t>) z) x)
16857         // cond: (z.Op != OpConst32 && x.Op != OpConst32)
16858         // result: (Mul32 i (Mul32 <t> x z))
16859         for {
16860                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16861                         if v_0.Op != OpMul32 {
16862                                 continue
16863                         }
16864                         _ = v_0.Args[1]
16865                         v_0_0 := v_0.Args[0]
16866                         v_0_1 := v_0.Args[1]
16867                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
16868                                 i := v_0_0
16869                                 if i.Op != OpConst32 {
16870                                         continue
16871                                 }
16872                                 t := i.Type
16873                                 z := v_0_1
16874                                 x := v_1
16875                                 if !(z.Op != OpConst32 && x.Op != OpConst32) {
16876                                         continue
16877                                 }
16878                                 v.reset(OpMul32)
16879                                 v0 := b.NewValue0(v.Pos, OpMul32, t)
16880                                 v0.AddArg2(x, z)
16881                                 v.AddArg2(i, v0)
16882                                 return true
16883                         }
16884                 }
16885                 break
16886         }
16887         // match: (Mul32 (Const32 <t> [c]) (Mul32 (Const32 <t> [d]) x))
16888         // result: (Mul32 (Const32 <t> [c*d]) x)
16889         for {
16890                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16891                         if v_0.Op != OpConst32 {
16892                                 continue
16893                         }
16894                         t := v_0.Type
16895                         c := auxIntToInt32(v_0.AuxInt)
16896                         if v_1.Op != OpMul32 {
16897                                 continue
16898                         }
16899                         _ = v_1.Args[1]
16900                         v_1_0 := v_1.Args[0]
16901                         v_1_1 := v_1.Args[1]
16902                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
16903                                 if v_1_0.Op != OpConst32 || v_1_0.Type != t {
16904                                         continue
16905                                 }
16906                                 d := auxIntToInt32(v_1_0.AuxInt)
16907                                 x := v_1_1
16908                                 v.reset(OpMul32)
16909                                 v0 := b.NewValue0(v.Pos, OpConst32, t)
16910                                 v0.AuxInt = int32ToAuxInt(c * d)
16911                                 v.AddArg2(v0, x)
16912                                 return true
16913                         }
16914                 }
16915                 break
16916         }
16917         return false
16918 }
16919 func rewriteValuegeneric_OpMul32F(v *Value) bool {
16920         v_1 := v.Args[1]
16921         v_0 := v.Args[0]
16922         // match: (Mul32F (Const32F [c]) (Const32F [d]))
16923         // cond: c*d == c*d
16924         // result: (Const32F [c*d])
16925         for {
16926                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16927                         if v_0.Op != OpConst32F {
16928                                 continue
16929                         }
16930                         c := auxIntToFloat32(v_0.AuxInt)
16931                         if v_1.Op != OpConst32F {
16932                                 continue
16933                         }
16934                         d := auxIntToFloat32(v_1.AuxInt)
16935                         if !(c*d == c*d) {
16936                                 continue
16937                         }
16938                         v.reset(OpConst32F)
16939                         v.AuxInt = float32ToAuxInt(c * d)
16940                         return true
16941                 }
16942                 break
16943         }
16944         // match: (Mul32F x (Const32F [1]))
16945         // result: x
16946         for {
16947                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16948                         x := v_0
16949                         if v_1.Op != OpConst32F || auxIntToFloat32(v_1.AuxInt) != 1 {
16950                                 continue
16951                         }
16952                         v.copyOf(x)
16953                         return true
16954                 }
16955                 break
16956         }
16957         // match: (Mul32F x (Const32F [-1]))
16958         // result: (Neg32F x)
16959         for {
16960                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16961                         x := v_0
16962                         if v_1.Op != OpConst32F || auxIntToFloat32(v_1.AuxInt) != -1 {
16963                                 continue
16964                         }
16965                         v.reset(OpNeg32F)
16966                         v.AddArg(x)
16967                         return true
16968                 }
16969                 break
16970         }
16971         // match: (Mul32F x (Const32F [2]))
16972         // result: (Add32F x x)
16973         for {
16974                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16975                         x := v_0
16976                         if v_1.Op != OpConst32F || auxIntToFloat32(v_1.AuxInt) != 2 {
16977                                 continue
16978                         }
16979                         v.reset(OpAdd32F)
16980                         v.AddArg2(x, x)
16981                         return true
16982                 }
16983                 break
16984         }
16985         return false
16986 }
16987 func rewriteValuegeneric_OpMul64(v *Value) bool {
16988         v_1 := v.Args[1]
16989         v_0 := v.Args[0]
16990         b := v.Block
16991         typ := &b.Func.Config.Types
16992         // match: (Mul64 (Const64 [c]) (Const64 [d]))
16993         // result: (Const64 [c*d])
16994         for {
16995                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
16996                         if v_0.Op != OpConst64 {
16997                                 continue
16998                         }
16999                         c := auxIntToInt64(v_0.AuxInt)
17000                         if v_1.Op != OpConst64 {
17001                                 continue
17002                         }
17003                         d := auxIntToInt64(v_1.AuxInt)
17004                         v.reset(OpConst64)
17005                         v.AuxInt = int64ToAuxInt(c * d)
17006                         return true
17007                 }
17008                 break
17009         }
17010         // match: (Mul64 (Const64 [1]) x)
17011         // result: x
17012         for {
17013                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17014                         if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 1 {
17015                                 continue
17016                         }
17017                         x := v_1
17018                         v.copyOf(x)
17019                         return true
17020                 }
17021                 break
17022         }
17023         // match: (Mul64 (Const64 [-1]) x)
17024         // result: (Neg64 x)
17025         for {
17026                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17027                         if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != -1 {
17028                                 continue
17029                         }
17030                         x := v_1
17031                         v.reset(OpNeg64)
17032                         v.AddArg(x)
17033                         return true
17034                 }
17035                 break
17036         }
17037         // match: (Mul64 <t> n (Const64 [c]))
17038         // cond: isPowerOfTwo64(c)
17039         // result: (Lsh64x64 <t> n (Const64 <typ.UInt64> [log64(c)]))
17040         for {
17041                 t := v.Type
17042                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17043                         n := v_0
17044                         if v_1.Op != OpConst64 {
17045                                 continue
17046                         }
17047                         c := auxIntToInt64(v_1.AuxInt)
17048                         if !(isPowerOfTwo64(c)) {
17049                                 continue
17050                         }
17051                         v.reset(OpLsh64x64)
17052                         v.Type = t
17053                         v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
17054                         v0.AuxInt = int64ToAuxInt(log64(c))
17055                         v.AddArg2(n, v0)
17056                         return true
17057                 }
17058                 break
17059         }
17060         // match: (Mul64 <t> n (Const64 [c]))
17061         // cond: t.IsSigned() && isPowerOfTwo64(-c)
17062         // result: (Neg64 (Lsh64x64 <t> n (Const64 <typ.UInt64> [log64(-c)])))
17063         for {
17064                 t := v.Type
17065                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17066                         n := v_0
17067                         if v_1.Op != OpConst64 {
17068                                 continue
17069                         }
17070                         c := auxIntToInt64(v_1.AuxInt)
17071                         if !(t.IsSigned() && isPowerOfTwo64(-c)) {
17072                                 continue
17073                         }
17074                         v.reset(OpNeg64)
17075                         v0 := b.NewValue0(v.Pos, OpLsh64x64, t)
17076                         v1 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
17077                         v1.AuxInt = int64ToAuxInt(log64(-c))
17078                         v0.AddArg2(n, v1)
17079                         v.AddArg(v0)
17080                         return true
17081                 }
17082                 break
17083         }
17084         // match: (Mul64 (Const64 <t> [c]) (Add64 <t> (Const64 <t> [d]) x))
17085         // result: (Add64 (Const64 <t> [c*d]) (Mul64 <t> (Const64 <t> [c]) x))
17086         for {
17087                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17088                         if v_0.Op != OpConst64 {
17089                                 continue
17090                         }
17091                         t := v_0.Type
17092                         c := auxIntToInt64(v_0.AuxInt)
17093                         if v_1.Op != OpAdd64 || v_1.Type != t {
17094                                 continue
17095                         }
17096                         _ = v_1.Args[1]
17097                         v_1_0 := v_1.Args[0]
17098                         v_1_1 := v_1.Args[1]
17099                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
17100                                 if v_1_0.Op != OpConst64 || v_1_0.Type != t {
17101                                         continue
17102                                 }
17103                                 d := auxIntToInt64(v_1_0.AuxInt)
17104                                 x := v_1_1
17105                                 v.reset(OpAdd64)
17106                                 v0 := b.NewValue0(v.Pos, OpConst64, t)
17107                                 v0.AuxInt = int64ToAuxInt(c * d)
17108                                 v1 := b.NewValue0(v.Pos, OpMul64, t)
17109                                 v2 := b.NewValue0(v.Pos, OpConst64, t)
17110                                 v2.AuxInt = int64ToAuxInt(c)
17111                                 v1.AddArg2(v2, x)
17112                                 v.AddArg2(v0, v1)
17113                                 return true
17114                         }
17115                 }
17116                 break
17117         }
17118         // match: (Mul64 (Const64 [0]) _)
17119         // result: (Const64 [0])
17120         for {
17121                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17122                         if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
17123                                 continue
17124                         }
17125                         v.reset(OpConst64)
17126                         v.AuxInt = int64ToAuxInt(0)
17127                         return true
17128                 }
17129                 break
17130         }
17131         // match: (Mul64 (Mul64 i:(Const64 <t>) z) x)
17132         // cond: (z.Op != OpConst64 && x.Op != OpConst64)
17133         // result: (Mul64 i (Mul64 <t> x z))
17134         for {
17135                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17136                         if v_0.Op != OpMul64 {
17137                                 continue
17138                         }
17139                         _ = v_0.Args[1]
17140                         v_0_0 := v_0.Args[0]
17141                         v_0_1 := v_0.Args[1]
17142                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
17143                                 i := v_0_0
17144                                 if i.Op != OpConst64 {
17145                                         continue
17146                                 }
17147                                 t := i.Type
17148                                 z := v_0_1
17149                                 x := v_1
17150                                 if !(z.Op != OpConst64 && x.Op != OpConst64) {
17151                                         continue
17152                                 }
17153                                 v.reset(OpMul64)
17154                                 v0 := b.NewValue0(v.Pos, OpMul64, t)
17155                                 v0.AddArg2(x, z)
17156                                 v.AddArg2(i, v0)
17157                                 return true
17158                         }
17159                 }
17160                 break
17161         }
17162         // match: (Mul64 (Const64 <t> [c]) (Mul64 (Const64 <t> [d]) x))
17163         // result: (Mul64 (Const64 <t> [c*d]) x)
17164         for {
17165                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17166                         if v_0.Op != OpConst64 {
17167                                 continue
17168                         }
17169                         t := v_0.Type
17170                         c := auxIntToInt64(v_0.AuxInt)
17171                         if v_1.Op != OpMul64 {
17172                                 continue
17173                         }
17174                         _ = v_1.Args[1]
17175                         v_1_0 := v_1.Args[0]
17176                         v_1_1 := v_1.Args[1]
17177                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
17178                                 if v_1_0.Op != OpConst64 || v_1_0.Type != t {
17179                                         continue
17180                                 }
17181                                 d := auxIntToInt64(v_1_0.AuxInt)
17182                                 x := v_1_1
17183                                 v.reset(OpMul64)
17184                                 v0 := b.NewValue0(v.Pos, OpConst64, t)
17185                                 v0.AuxInt = int64ToAuxInt(c * d)
17186                                 v.AddArg2(v0, x)
17187                                 return true
17188                         }
17189                 }
17190                 break
17191         }
17192         return false
17193 }
17194 func rewriteValuegeneric_OpMul64F(v *Value) bool {
17195         v_1 := v.Args[1]
17196         v_0 := v.Args[0]
17197         // match: (Mul64F (Const64F [c]) (Const64F [d]))
17198         // cond: c*d == c*d
17199         // result: (Const64F [c*d])
17200         for {
17201                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17202                         if v_0.Op != OpConst64F {
17203                                 continue
17204                         }
17205                         c := auxIntToFloat64(v_0.AuxInt)
17206                         if v_1.Op != OpConst64F {
17207                                 continue
17208                         }
17209                         d := auxIntToFloat64(v_1.AuxInt)
17210                         if !(c*d == c*d) {
17211                                 continue
17212                         }
17213                         v.reset(OpConst64F)
17214                         v.AuxInt = float64ToAuxInt(c * d)
17215                         return true
17216                 }
17217                 break
17218         }
17219         // match: (Mul64F x (Const64F [1]))
17220         // result: x
17221         for {
17222                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17223                         x := v_0
17224                         if v_1.Op != OpConst64F || auxIntToFloat64(v_1.AuxInt) != 1 {
17225                                 continue
17226                         }
17227                         v.copyOf(x)
17228                         return true
17229                 }
17230                 break
17231         }
17232         // match: (Mul64F x (Const64F [-1]))
17233         // result: (Neg64F x)
17234         for {
17235                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17236                         x := v_0
17237                         if v_1.Op != OpConst64F || auxIntToFloat64(v_1.AuxInt) != -1 {
17238                                 continue
17239                         }
17240                         v.reset(OpNeg64F)
17241                         v.AddArg(x)
17242                         return true
17243                 }
17244                 break
17245         }
17246         // match: (Mul64F x (Const64F [2]))
17247         // result: (Add64F x x)
17248         for {
17249                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17250                         x := v_0
17251                         if v_1.Op != OpConst64F || auxIntToFloat64(v_1.AuxInt) != 2 {
17252                                 continue
17253                         }
17254                         v.reset(OpAdd64F)
17255                         v.AddArg2(x, x)
17256                         return true
17257                 }
17258                 break
17259         }
17260         return false
17261 }
17262 func rewriteValuegeneric_OpMul8(v *Value) bool {
17263         v_1 := v.Args[1]
17264         v_0 := v.Args[0]
17265         b := v.Block
17266         typ := &b.Func.Config.Types
17267         // match: (Mul8 (Const8 [c]) (Const8 [d]))
17268         // result: (Const8 [c*d])
17269         for {
17270                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17271                         if v_0.Op != OpConst8 {
17272                                 continue
17273                         }
17274                         c := auxIntToInt8(v_0.AuxInt)
17275                         if v_1.Op != OpConst8 {
17276                                 continue
17277                         }
17278                         d := auxIntToInt8(v_1.AuxInt)
17279                         v.reset(OpConst8)
17280                         v.AuxInt = int8ToAuxInt(c * d)
17281                         return true
17282                 }
17283                 break
17284         }
17285         // match: (Mul8 (Const8 [1]) x)
17286         // result: x
17287         for {
17288                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17289                         if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 1 {
17290                                 continue
17291                         }
17292                         x := v_1
17293                         v.copyOf(x)
17294                         return true
17295                 }
17296                 break
17297         }
17298         // match: (Mul8 (Const8 [-1]) x)
17299         // result: (Neg8 x)
17300         for {
17301                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17302                         if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != -1 {
17303                                 continue
17304                         }
17305                         x := v_1
17306                         v.reset(OpNeg8)
17307                         v.AddArg(x)
17308                         return true
17309                 }
17310                 break
17311         }
17312         // match: (Mul8 <t> n (Const8 [c]))
17313         // cond: isPowerOfTwo8(c)
17314         // result: (Lsh8x64 <t> n (Const64 <typ.UInt64> [log8(c)]))
17315         for {
17316                 t := v.Type
17317                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17318                         n := v_0
17319                         if v_1.Op != OpConst8 {
17320                                 continue
17321                         }
17322                         c := auxIntToInt8(v_1.AuxInt)
17323                         if !(isPowerOfTwo8(c)) {
17324                                 continue
17325                         }
17326                         v.reset(OpLsh8x64)
17327                         v.Type = t
17328                         v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
17329                         v0.AuxInt = int64ToAuxInt(log8(c))
17330                         v.AddArg2(n, v0)
17331                         return true
17332                 }
17333                 break
17334         }
17335         // match: (Mul8 <t> n (Const8 [c]))
17336         // cond: t.IsSigned() && isPowerOfTwo8(-c)
17337         // result: (Neg8 (Lsh8x64 <t> n (Const64 <typ.UInt64> [log8(-c)])))
17338         for {
17339                 t := v.Type
17340                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17341                         n := v_0
17342                         if v_1.Op != OpConst8 {
17343                                 continue
17344                         }
17345                         c := auxIntToInt8(v_1.AuxInt)
17346                         if !(t.IsSigned() && isPowerOfTwo8(-c)) {
17347                                 continue
17348                         }
17349                         v.reset(OpNeg8)
17350                         v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
17351                         v1 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
17352                         v1.AuxInt = int64ToAuxInt(log8(-c))
17353                         v0.AddArg2(n, v1)
17354                         v.AddArg(v0)
17355                         return true
17356                 }
17357                 break
17358         }
17359         // match: (Mul8 (Const8 [0]) _)
17360         // result: (Const8 [0])
17361         for {
17362                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17363                         if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
17364                                 continue
17365                         }
17366                         v.reset(OpConst8)
17367                         v.AuxInt = int8ToAuxInt(0)
17368                         return true
17369                 }
17370                 break
17371         }
17372         // match: (Mul8 (Mul8 i:(Const8 <t>) z) x)
17373         // cond: (z.Op != OpConst8 && x.Op != OpConst8)
17374         // result: (Mul8 i (Mul8 <t> x z))
17375         for {
17376                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17377                         if v_0.Op != OpMul8 {
17378                                 continue
17379                         }
17380                         _ = v_0.Args[1]
17381                         v_0_0 := v_0.Args[0]
17382                         v_0_1 := v_0.Args[1]
17383                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
17384                                 i := v_0_0
17385                                 if i.Op != OpConst8 {
17386                                         continue
17387                                 }
17388                                 t := i.Type
17389                                 z := v_0_1
17390                                 x := v_1
17391                                 if !(z.Op != OpConst8 && x.Op != OpConst8) {
17392                                         continue
17393                                 }
17394                                 v.reset(OpMul8)
17395                                 v0 := b.NewValue0(v.Pos, OpMul8, t)
17396                                 v0.AddArg2(x, z)
17397                                 v.AddArg2(i, v0)
17398                                 return true
17399                         }
17400                 }
17401                 break
17402         }
17403         // match: (Mul8 (Const8 <t> [c]) (Mul8 (Const8 <t> [d]) x))
17404         // result: (Mul8 (Const8 <t> [c*d]) x)
17405         for {
17406                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17407                         if v_0.Op != OpConst8 {
17408                                 continue
17409                         }
17410                         t := v_0.Type
17411                         c := auxIntToInt8(v_0.AuxInt)
17412                         if v_1.Op != OpMul8 {
17413                                 continue
17414                         }
17415                         _ = v_1.Args[1]
17416                         v_1_0 := v_1.Args[0]
17417                         v_1_1 := v_1.Args[1]
17418                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
17419                                 if v_1_0.Op != OpConst8 || v_1_0.Type != t {
17420                                         continue
17421                                 }
17422                                 d := auxIntToInt8(v_1_0.AuxInt)
17423                                 x := v_1_1
17424                                 v.reset(OpMul8)
17425                                 v0 := b.NewValue0(v.Pos, OpConst8, t)
17426                                 v0.AuxInt = int8ToAuxInt(c * d)
17427                                 v.AddArg2(v0, x)
17428                                 return true
17429                         }
17430                 }
17431                 break
17432         }
17433         return false
17434 }
17435 func rewriteValuegeneric_OpNeg16(v *Value) bool {
17436         v_0 := v.Args[0]
17437         b := v.Block
17438         // match: (Neg16 (Const16 [c]))
17439         // result: (Const16 [-c])
17440         for {
17441                 if v_0.Op != OpConst16 {
17442                         break
17443                 }
17444                 c := auxIntToInt16(v_0.AuxInt)
17445                 v.reset(OpConst16)
17446                 v.AuxInt = int16ToAuxInt(-c)
17447                 return true
17448         }
17449         // match: (Neg16 (Sub16 x y))
17450         // result: (Sub16 y x)
17451         for {
17452                 if v_0.Op != OpSub16 {
17453                         break
17454                 }
17455                 y := v_0.Args[1]
17456                 x := v_0.Args[0]
17457                 v.reset(OpSub16)
17458                 v.AddArg2(y, x)
17459                 return true
17460         }
17461         // match: (Neg16 (Neg16 x))
17462         // result: x
17463         for {
17464                 if v_0.Op != OpNeg16 {
17465                         break
17466                 }
17467                 x := v_0.Args[0]
17468                 v.copyOf(x)
17469                 return true
17470         }
17471         // match: (Neg16 <t> (Com16 x))
17472         // result: (Add16 (Const16 <t> [1]) x)
17473         for {
17474                 t := v.Type
17475                 if v_0.Op != OpCom16 {
17476                         break
17477                 }
17478                 x := v_0.Args[0]
17479                 v.reset(OpAdd16)
17480                 v0 := b.NewValue0(v.Pos, OpConst16, t)
17481                 v0.AuxInt = int16ToAuxInt(1)
17482                 v.AddArg2(v0, x)
17483                 return true
17484         }
17485         return false
17486 }
17487 func rewriteValuegeneric_OpNeg32(v *Value) bool {
17488         v_0 := v.Args[0]
17489         b := v.Block
17490         // match: (Neg32 (Const32 [c]))
17491         // result: (Const32 [-c])
17492         for {
17493                 if v_0.Op != OpConst32 {
17494                         break
17495                 }
17496                 c := auxIntToInt32(v_0.AuxInt)
17497                 v.reset(OpConst32)
17498                 v.AuxInt = int32ToAuxInt(-c)
17499                 return true
17500         }
17501         // match: (Neg32 (Sub32 x y))
17502         // result: (Sub32 y x)
17503         for {
17504                 if v_0.Op != OpSub32 {
17505                         break
17506                 }
17507                 y := v_0.Args[1]
17508                 x := v_0.Args[0]
17509                 v.reset(OpSub32)
17510                 v.AddArg2(y, x)
17511                 return true
17512         }
17513         // match: (Neg32 (Neg32 x))
17514         // result: x
17515         for {
17516                 if v_0.Op != OpNeg32 {
17517                         break
17518                 }
17519                 x := v_0.Args[0]
17520                 v.copyOf(x)
17521                 return true
17522         }
17523         // match: (Neg32 <t> (Com32 x))
17524         // result: (Add32 (Const32 <t> [1]) x)
17525         for {
17526                 t := v.Type
17527                 if v_0.Op != OpCom32 {
17528                         break
17529                 }
17530                 x := v_0.Args[0]
17531                 v.reset(OpAdd32)
17532                 v0 := b.NewValue0(v.Pos, OpConst32, t)
17533                 v0.AuxInt = int32ToAuxInt(1)
17534                 v.AddArg2(v0, x)
17535                 return true
17536         }
17537         return false
17538 }
17539 func rewriteValuegeneric_OpNeg32F(v *Value) bool {
17540         v_0 := v.Args[0]
17541         // match: (Neg32F (Const32F [c]))
17542         // cond: c != 0
17543         // result: (Const32F [-c])
17544         for {
17545                 if v_0.Op != OpConst32F {
17546                         break
17547                 }
17548                 c := auxIntToFloat32(v_0.AuxInt)
17549                 if !(c != 0) {
17550                         break
17551                 }
17552                 v.reset(OpConst32F)
17553                 v.AuxInt = float32ToAuxInt(-c)
17554                 return true
17555         }
17556         return false
17557 }
17558 func rewriteValuegeneric_OpNeg64(v *Value) bool {
17559         v_0 := v.Args[0]
17560         b := v.Block
17561         // match: (Neg64 (Const64 [c]))
17562         // result: (Const64 [-c])
17563         for {
17564                 if v_0.Op != OpConst64 {
17565                         break
17566                 }
17567                 c := auxIntToInt64(v_0.AuxInt)
17568                 v.reset(OpConst64)
17569                 v.AuxInt = int64ToAuxInt(-c)
17570                 return true
17571         }
17572         // match: (Neg64 (Sub64 x y))
17573         // result: (Sub64 y x)
17574         for {
17575                 if v_0.Op != OpSub64 {
17576                         break
17577                 }
17578                 y := v_0.Args[1]
17579                 x := v_0.Args[0]
17580                 v.reset(OpSub64)
17581                 v.AddArg2(y, x)
17582                 return true
17583         }
17584         // match: (Neg64 (Neg64 x))
17585         // result: x
17586         for {
17587                 if v_0.Op != OpNeg64 {
17588                         break
17589                 }
17590                 x := v_0.Args[0]
17591                 v.copyOf(x)
17592                 return true
17593         }
17594         // match: (Neg64 <t> (Com64 x))
17595         // result: (Add64 (Const64 <t> [1]) x)
17596         for {
17597                 t := v.Type
17598                 if v_0.Op != OpCom64 {
17599                         break
17600                 }
17601                 x := v_0.Args[0]
17602                 v.reset(OpAdd64)
17603                 v0 := b.NewValue0(v.Pos, OpConst64, t)
17604                 v0.AuxInt = int64ToAuxInt(1)
17605                 v.AddArg2(v0, x)
17606                 return true
17607         }
17608         return false
17609 }
17610 func rewriteValuegeneric_OpNeg64F(v *Value) bool {
17611         v_0 := v.Args[0]
17612         // match: (Neg64F (Const64F [c]))
17613         // cond: c != 0
17614         // result: (Const64F [-c])
17615         for {
17616                 if v_0.Op != OpConst64F {
17617                         break
17618                 }
17619                 c := auxIntToFloat64(v_0.AuxInt)
17620                 if !(c != 0) {
17621                         break
17622                 }
17623                 v.reset(OpConst64F)
17624                 v.AuxInt = float64ToAuxInt(-c)
17625                 return true
17626         }
17627         return false
17628 }
17629 func rewriteValuegeneric_OpNeg8(v *Value) bool {
17630         v_0 := v.Args[0]
17631         b := v.Block
17632         // match: (Neg8 (Const8 [c]))
17633         // result: (Const8 [-c])
17634         for {
17635                 if v_0.Op != OpConst8 {
17636                         break
17637                 }
17638                 c := auxIntToInt8(v_0.AuxInt)
17639                 v.reset(OpConst8)
17640                 v.AuxInt = int8ToAuxInt(-c)
17641                 return true
17642         }
17643         // match: (Neg8 (Sub8 x y))
17644         // result: (Sub8 y x)
17645         for {
17646                 if v_0.Op != OpSub8 {
17647                         break
17648                 }
17649                 y := v_0.Args[1]
17650                 x := v_0.Args[0]
17651                 v.reset(OpSub8)
17652                 v.AddArg2(y, x)
17653                 return true
17654         }
17655         // match: (Neg8 (Neg8 x))
17656         // result: x
17657         for {
17658                 if v_0.Op != OpNeg8 {
17659                         break
17660                 }
17661                 x := v_0.Args[0]
17662                 v.copyOf(x)
17663                 return true
17664         }
17665         // match: (Neg8 <t> (Com8 x))
17666         // result: (Add8 (Const8 <t> [1]) x)
17667         for {
17668                 t := v.Type
17669                 if v_0.Op != OpCom8 {
17670                         break
17671                 }
17672                 x := v_0.Args[0]
17673                 v.reset(OpAdd8)
17674                 v0 := b.NewValue0(v.Pos, OpConst8, t)
17675                 v0.AuxInt = int8ToAuxInt(1)
17676                 v.AddArg2(v0, x)
17677                 return true
17678         }
17679         return false
17680 }
17681 func rewriteValuegeneric_OpNeq16(v *Value) bool {
17682         v_1 := v.Args[1]
17683         v_0 := v.Args[0]
17684         b := v.Block
17685         typ := &b.Func.Config.Types
17686         // match: (Neq16 x x)
17687         // result: (ConstBool [false])
17688         for {
17689                 x := v_0
17690                 if x != v_1 {
17691                         break
17692                 }
17693                 v.reset(OpConstBool)
17694                 v.AuxInt = boolToAuxInt(false)
17695                 return true
17696         }
17697         // match: (Neq16 (Const16 <t> [c]) (Add16 (Const16 <t> [d]) x))
17698         // result: (Neq16 (Const16 <t> [c-d]) x)
17699         for {
17700                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17701                         if v_0.Op != OpConst16 {
17702                                 continue
17703                         }
17704                         t := v_0.Type
17705                         c := auxIntToInt16(v_0.AuxInt)
17706                         if v_1.Op != OpAdd16 {
17707                                 continue
17708                         }
17709                         _ = v_1.Args[1]
17710                         v_1_0 := v_1.Args[0]
17711                         v_1_1 := v_1.Args[1]
17712                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
17713                                 if v_1_0.Op != OpConst16 || v_1_0.Type != t {
17714                                         continue
17715                                 }
17716                                 d := auxIntToInt16(v_1_0.AuxInt)
17717                                 x := v_1_1
17718                                 v.reset(OpNeq16)
17719                                 v0 := b.NewValue0(v.Pos, OpConst16, t)
17720                                 v0.AuxInt = int16ToAuxInt(c - d)
17721                                 v.AddArg2(v0, x)
17722                                 return true
17723                         }
17724                 }
17725                 break
17726         }
17727         // match: (Neq16 (Const16 [c]) (Const16 [d]))
17728         // result: (ConstBool [c != d])
17729         for {
17730                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17731                         if v_0.Op != OpConst16 {
17732                                 continue
17733                         }
17734                         c := auxIntToInt16(v_0.AuxInt)
17735                         if v_1.Op != OpConst16 {
17736                                 continue
17737                         }
17738                         d := auxIntToInt16(v_1.AuxInt)
17739                         v.reset(OpConstBool)
17740                         v.AuxInt = boolToAuxInt(c != d)
17741                         return true
17742                 }
17743                 break
17744         }
17745         // match: (Neq16 n (Lsh16x64 (Rsh16x64 (Add16 <t> n (Rsh16Ux64 <t> (Rsh16x64 <t> n (Const64 <typ.UInt64> [15])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) )
17746         // cond: k > 0 && k < 15 && kbar == 16 - k
17747         // result: (Neq16 (And16 <t> n (Const16 <t> [1<<uint(k)-1])) (Const16 <t> [0]))
17748         for {
17749                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17750                         n := v_0
17751                         if v_1.Op != OpLsh16x64 {
17752                                 continue
17753                         }
17754                         _ = v_1.Args[1]
17755                         v_1_0 := v_1.Args[0]
17756                         if v_1_0.Op != OpRsh16x64 {
17757                                 continue
17758                         }
17759                         _ = v_1_0.Args[1]
17760                         v_1_0_0 := v_1_0.Args[0]
17761                         if v_1_0_0.Op != OpAdd16 {
17762                                 continue
17763                         }
17764                         t := v_1_0_0.Type
17765                         _ = v_1_0_0.Args[1]
17766                         v_1_0_0_0 := v_1_0_0.Args[0]
17767                         v_1_0_0_1 := v_1_0_0.Args[1]
17768                         for _i1 := 0; _i1 <= 1; _i1, v_1_0_0_0, v_1_0_0_1 = _i1+1, v_1_0_0_1, v_1_0_0_0 {
17769                                 if n != v_1_0_0_0 || v_1_0_0_1.Op != OpRsh16Ux64 || v_1_0_0_1.Type != t {
17770                                         continue
17771                                 }
17772                                 _ = v_1_0_0_1.Args[1]
17773                                 v_1_0_0_1_0 := v_1_0_0_1.Args[0]
17774                                 if v_1_0_0_1_0.Op != OpRsh16x64 || v_1_0_0_1_0.Type != t {
17775                                         continue
17776                                 }
17777                                 _ = v_1_0_0_1_0.Args[1]
17778                                 if n != v_1_0_0_1_0.Args[0] {
17779                                         continue
17780                                 }
17781                                 v_1_0_0_1_0_1 := v_1_0_0_1_0.Args[1]
17782                                 if v_1_0_0_1_0_1.Op != OpConst64 || v_1_0_0_1_0_1.Type != typ.UInt64 || auxIntToInt64(v_1_0_0_1_0_1.AuxInt) != 15 {
17783                                         continue
17784                                 }
17785                                 v_1_0_0_1_1 := v_1_0_0_1.Args[1]
17786                                 if v_1_0_0_1_1.Op != OpConst64 || v_1_0_0_1_1.Type != typ.UInt64 {
17787                                         continue
17788                                 }
17789                                 kbar := auxIntToInt64(v_1_0_0_1_1.AuxInt)
17790                                 v_1_0_1 := v_1_0.Args[1]
17791                                 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 {
17792                                         continue
17793                                 }
17794                                 k := auxIntToInt64(v_1_0_1.AuxInt)
17795                                 v_1_1 := v_1.Args[1]
17796                                 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || auxIntToInt64(v_1_1.AuxInt) != k || !(k > 0 && k < 15 && kbar == 16-k) {
17797                                         continue
17798                                 }
17799                                 v.reset(OpNeq16)
17800                                 v0 := b.NewValue0(v.Pos, OpAnd16, t)
17801                                 v1 := b.NewValue0(v.Pos, OpConst16, t)
17802                                 v1.AuxInt = int16ToAuxInt(1<<uint(k) - 1)
17803                                 v0.AddArg2(n, v1)
17804                                 v2 := b.NewValue0(v.Pos, OpConst16, t)
17805                                 v2.AuxInt = int16ToAuxInt(0)
17806                                 v.AddArg2(v0, v2)
17807                                 return true
17808                         }
17809                 }
17810                 break
17811         }
17812         // match: (Neq16 s:(Sub16 x y) (Const16 [0]))
17813         // cond: s.Uses == 1
17814         // result: (Neq16 x y)
17815         for {
17816                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17817                         s := v_0
17818                         if s.Op != OpSub16 {
17819                                 continue
17820                         }
17821                         y := s.Args[1]
17822                         x := s.Args[0]
17823                         if v_1.Op != OpConst16 || auxIntToInt16(v_1.AuxInt) != 0 || !(s.Uses == 1) {
17824                                 continue
17825                         }
17826                         v.reset(OpNeq16)
17827                         v.AddArg2(x, y)
17828                         return true
17829                 }
17830                 break
17831         }
17832         // match: (Neq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [y]))
17833         // cond: oneBit16(y)
17834         // result: (Eq16 (And16 <t> x (Const16 <t> [y])) (Const16 <t> [0]))
17835         for {
17836                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17837                         if v_0.Op != OpAnd16 {
17838                                 continue
17839                         }
17840                         t := v_0.Type
17841                         _ = v_0.Args[1]
17842                         v_0_0 := v_0.Args[0]
17843                         v_0_1 := v_0.Args[1]
17844                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
17845                                 x := v_0_0
17846                                 if v_0_1.Op != OpConst16 || v_0_1.Type != t {
17847                                         continue
17848                                 }
17849                                 y := auxIntToInt16(v_0_1.AuxInt)
17850                                 if v_1.Op != OpConst16 || v_1.Type != t || auxIntToInt16(v_1.AuxInt) != y || !(oneBit16(y)) {
17851                                         continue
17852                                 }
17853                                 v.reset(OpEq16)
17854                                 v0 := b.NewValue0(v.Pos, OpAnd16, t)
17855                                 v1 := b.NewValue0(v.Pos, OpConst16, t)
17856                                 v1.AuxInt = int16ToAuxInt(y)
17857                                 v0.AddArg2(x, v1)
17858                                 v2 := b.NewValue0(v.Pos, OpConst16, t)
17859                                 v2.AuxInt = int16ToAuxInt(0)
17860                                 v.AddArg2(v0, v2)
17861                                 return true
17862                         }
17863                 }
17864                 break
17865         }
17866         return false
17867 }
17868 func rewriteValuegeneric_OpNeq32(v *Value) bool {
17869         v_1 := v.Args[1]
17870         v_0 := v.Args[0]
17871         b := v.Block
17872         typ := &b.Func.Config.Types
17873         // match: (Neq32 x x)
17874         // result: (ConstBool [false])
17875         for {
17876                 x := v_0
17877                 if x != v_1 {
17878                         break
17879                 }
17880                 v.reset(OpConstBool)
17881                 v.AuxInt = boolToAuxInt(false)
17882                 return true
17883         }
17884         // match: (Neq32 (Const32 <t> [c]) (Add32 (Const32 <t> [d]) x))
17885         // result: (Neq32 (Const32 <t> [c-d]) x)
17886         for {
17887                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17888                         if v_0.Op != OpConst32 {
17889                                 continue
17890                         }
17891                         t := v_0.Type
17892                         c := auxIntToInt32(v_0.AuxInt)
17893                         if v_1.Op != OpAdd32 {
17894                                 continue
17895                         }
17896                         _ = v_1.Args[1]
17897                         v_1_0 := v_1.Args[0]
17898                         v_1_1 := v_1.Args[1]
17899                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
17900                                 if v_1_0.Op != OpConst32 || v_1_0.Type != t {
17901                                         continue
17902                                 }
17903                                 d := auxIntToInt32(v_1_0.AuxInt)
17904                                 x := v_1_1
17905                                 v.reset(OpNeq32)
17906                                 v0 := b.NewValue0(v.Pos, OpConst32, t)
17907                                 v0.AuxInt = int32ToAuxInt(c - d)
17908                                 v.AddArg2(v0, x)
17909                                 return true
17910                         }
17911                 }
17912                 break
17913         }
17914         // match: (Neq32 (Const32 [c]) (Const32 [d]))
17915         // result: (ConstBool [c != d])
17916         for {
17917                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17918                         if v_0.Op != OpConst32 {
17919                                 continue
17920                         }
17921                         c := auxIntToInt32(v_0.AuxInt)
17922                         if v_1.Op != OpConst32 {
17923                                 continue
17924                         }
17925                         d := auxIntToInt32(v_1.AuxInt)
17926                         v.reset(OpConstBool)
17927                         v.AuxInt = boolToAuxInt(c != d)
17928                         return true
17929                 }
17930                 break
17931         }
17932         // match: (Neq32 n (Lsh32x64 (Rsh32x64 (Add32 <t> n (Rsh32Ux64 <t> (Rsh32x64 <t> n (Const64 <typ.UInt64> [31])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) )
17933         // cond: k > 0 && k < 31 && kbar == 32 - k
17934         // result: (Neq32 (And32 <t> n (Const32 <t> [1<<uint(k)-1])) (Const32 <t> [0]))
17935         for {
17936                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
17937                         n := v_0
17938                         if v_1.Op != OpLsh32x64 {
17939                                 continue
17940                         }
17941                         _ = v_1.Args[1]
17942                         v_1_0 := v_1.Args[0]
17943                         if v_1_0.Op != OpRsh32x64 {
17944                                 continue
17945                         }
17946                         _ = v_1_0.Args[1]
17947                         v_1_0_0 := v_1_0.Args[0]
17948                         if v_1_0_0.Op != OpAdd32 {
17949                                 continue
17950                         }
17951                         t := v_1_0_0.Type
17952                         _ = v_1_0_0.Args[1]
17953                         v_1_0_0_0 := v_1_0_0.Args[0]
17954                         v_1_0_0_1 := v_1_0_0.Args[1]
17955                         for _i1 := 0; _i1 <= 1; _i1, v_1_0_0_0, v_1_0_0_1 = _i1+1, v_1_0_0_1, v_1_0_0_0 {
17956                                 if n != v_1_0_0_0 || v_1_0_0_1.Op != OpRsh32Ux64 || v_1_0_0_1.Type != t {
17957                                         continue
17958                                 }
17959                                 _ = v_1_0_0_1.Args[1]
17960                                 v_1_0_0_1_0 := v_1_0_0_1.Args[0]
17961                                 if v_1_0_0_1_0.Op != OpRsh32x64 || v_1_0_0_1_0.Type != t {
17962                                         continue
17963                                 }
17964                                 _ = v_1_0_0_1_0.Args[1]
17965                                 if n != v_1_0_0_1_0.Args[0] {
17966                                         continue
17967                                 }
17968                                 v_1_0_0_1_0_1 := v_1_0_0_1_0.Args[1]
17969                                 if v_1_0_0_1_0_1.Op != OpConst64 || v_1_0_0_1_0_1.Type != typ.UInt64 || auxIntToInt64(v_1_0_0_1_0_1.AuxInt) != 31 {
17970                                         continue
17971                                 }
17972                                 v_1_0_0_1_1 := v_1_0_0_1.Args[1]
17973                                 if v_1_0_0_1_1.Op != OpConst64 || v_1_0_0_1_1.Type != typ.UInt64 {
17974                                         continue
17975                                 }
17976                                 kbar := auxIntToInt64(v_1_0_0_1_1.AuxInt)
17977                                 v_1_0_1 := v_1_0.Args[1]
17978                                 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 {
17979                                         continue
17980                                 }
17981                                 k := auxIntToInt64(v_1_0_1.AuxInt)
17982                                 v_1_1 := v_1.Args[1]
17983                                 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || auxIntToInt64(v_1_1.AuxInt) != k || !(k > 0 && k < 31 && kbar == 32-k) {
17984                                         continue
17985                                 }
17986                                 v.reset(OpNeq32)
17987                                 v0 := b.NewValue0(v.Pos, OpAnd32, t)
17988                                 v1 := b.NewValue0(v.Pos, OpConst32, t)
17989                                 v1.AuxInt = int32ToAuxInt(1<<uint(k) - 1)
17990                                 v0.AddArg2(n, v1)
17991                                 v2 := b.NewValue0(v.Pos, OpConst32, t)
17992                                 v2.AuxInt = int32ToAuxInt(0)
17993                                 v.AddArg2(v0, v2)
17994                                 return true
17995                         }
17996                 }
17997                 break
17998         }
17999         // match: (Neq32 s:(Sub32 x y) (Const32 [0]))
18000         // cond: s.Uses == 1
18001         // result: (Neq32 x y)
18002         for {
18003                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18004                         s := v_0
18005                         if s.Op != OpSub32 {
18006                                 continue
18007                         }
18008                         y := s.Args[1]
18009                         x := s.Args[0]
18010                         if v_1.Op != OpConst32 || auxIntToInt32(v_1.AuxInt) != 0 || !(s.Uses == 1) {
18011                                 continue
18012                         }
18013                         v.reset(OpNeq32)
18014                         v.AddArg2(x, y)
18015                         return true
18016                 }
18017                 break
18018         }
18019         // match: (Neq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [y]))
18020         // cond: oneBit32(y)
18021         // result: (Eq32 (And32 <t> x (Const32 <t> [y])) (Const32 <t> [0]))
18022         for {
18023                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18024                         if v_0.Op != OpAnd32 {
18025                                 continue
18026                         }
18027                         t := v_0.Type
18028                         _ = v_0.Args[1]
18029                         v_0_0 := v_0.Args[0]
18030                         v_0_1 := v_0.Args[1]
18031                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
18032                                 x := v_0_0
18033                                 if v_0_1.Op != OpConst32 || v_0_1.Type != t {
18034                                         continue
18035                                 }
18036                                 y := auxIntToInt32(v_0_1.AuxInt)
18037                                 if v_1.Op != OpConst32 || v_1.Type != t || auxIntToInt32(v_1.AuxInt) != y || !(oneBit32(y)) {
18038                                         continue
18039                                 }
18040                                 v.reset(OpEq32)
18041                                 v0 := b.NewValue0(v.Pos, OpAnd32, t)
18042                                 v1 := b.NewValue0(v.Pos, OpConst32, t)
18043                                 v1.AuxInt = int32ToAuxInt(y)
18044                                 v0.AddArg2(x, v1)
18045                                 v2 := b.NewValue0(v.Pos, OpConst32, t)
18046                                 v2.AuxInt = int32ToAuxInt(0)
18047                                 v.AddArg2(v0, v2)
18048                                 return true
18049                         }
18050                 }
18051                 break
18052         }
18053         return false
18054 }
18055 func rewriteValuegeneric_OpNeq32F(v *Value) bool {
18056         v_1 := v.Args[1]
18057         v_0 := v.Args[0]
18058         // match: (Neq32F (Const32F [c]) (Const32F [d]))
18059         // result: (ConstBool [c != d])
18060         for {
18061                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18062                         if v_0.Op != OpConst32F {
18063                                 continue
18064                         }
18065                         c := auxIntToFloat32(v_0.AuxInt)
18066                         if v_1.Op != OpConst32F {
18067                                 continue
18068                         }
18069                         d := auxIntToFloat32(v_1.AuxInt)
18070                         v.reset(OpConstBool)
18071                         v.AuxInt = boolToAuxInt(c != d)
18072                         return true
18073                 }
18074                 break
18075         }
18076         return false
18077 }
18078 func rewriteValuegeneric_OpNeq64(v *Value) bool {
18079         v_1 := v.Args[1]
18080         v_0 := v.Args[0]
18081         b := v.Block
18082         typ := &b.Func.Config.Types
18083         // match: (Neq64 x x)
18084         // result: (ConstBool [false])
18085         for {
18086                 x := v_0
18087                 if x != v_1 {
18088                         break
18089                 }
18090                 v.reset(OpConstBool)
18091                 v.AuxInt = boolToAuxInt(false)
18092                 return true
18093         }
18094         // match: (Neq64 (Const64 <t> [c]) (Add64 (Const64 <t> [d]) x))
18095         // result: (Neq64 (Const64 <t> [c-d]) x)
18096         for {
18097                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18098                         if v_0.Op != OpConst64 {
18099                                 continue
18100                         }
18101                         t := v_0.Type
18102                         c := auxIntToInt64(v_0.AuxInt)
18103                         if v_1.Op != OpAdd64 {
18104                                 continue
18105                         }
18106                         _ = v_1.Args[1]
18107                         v_1_0 := v_1.Args[0]
18108                         v_1_1 := v_1.Args[1]
18109                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
18110                                 if v_1_0.Op != OpConst64 || v_1_0.Type != t {
18111                                         continue
18112                                 }
18113                                 d := auxIntToInt64(v_1_0.AuxInt)
18114                                 x := v_1_1
18115                                 v.reset(OpNeq64)
18116                                 v0 := b.NewValue0(v.Pos, OpConst64, t)
18117                                 v0.AuxInt = int64ToAuxInt(c - d)
18118                                 v.AddArg2(v0, x)
18119                                 return true
18120                         }
18121                 }
18122                 break
18123         }
18124         // match: (Neq64 (Const64 [c]) (Const64 [d]))
18125         // result: (ConstBool [c != d])
18126         for {
18127                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18128                         if v_0.Op != OpConst64 {
18129                                 continue
18130                         }
18131                         c := auxIntToInt64(v_0.AuxInt)
18132                         if v_1.Op != OpConst64 {
18133                                 continue
18134                         }
18135                         d := auxIntToInt64(v_1.AuxInt)
18136                         v.reset(OpConstBool)
18137                         v.AuxInt = boolToAuxInt(c != d)
18138                         return true
18139                 }
18140                 break
18141         }
18142         // match: (Neq64 n (Lsh64x64 (Rsh64x64 (Add64 <t> n (Rsh64Ux64 <t> (Rsh64x64 <t> n (Const64 <typ.UInt64> [63])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) )
18143         // cond: k > 0 && k < 63 && kbar == 64 - k
18144         // result: (Neq64 (And64 <t> n (Const64 <t> [1<<uint(k)-1])) (Const64 <t> [0]))
18145         for {
18146                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18147                         n := v_0
18148                         if v_1.Op != OpLsh64x64 {
18149                                 continue
18150                         }
18151                         _ = v_1.Args[1]
18152                         v_1_0 := v_1.Args[0]
18153                         if v_1_0.Op != OpRsh64x64 {
18154                                 continue
18155                         }
18156                         _ = v_1_0.Args[1]
18157                         v_1_0_0 := v_1_0.Args[0]
18158                         if v_1_0_0.Op != OpAdd64 {
18159                                 continue
18160                         }
18161                         t := v_1_0_0.Type
18162                         _ = v_1_0_0.Args[1]
18163                         v_1_0_0_0 := v_1_0_0.Args[0]
18164                         v_1_0_0_1 := v_1_0_0.Args[1]
18165                         for _i1 := 0; _i1 <= 1; _i1, v_1_0_0_0, v_1_0_0_1 = _i1+1, v_1_0_0_1, v_1_0_0_0 {
18166                                 if n != v_1_0_0_0 || v_1_0_0_1.Op != OpRsh64Ux64 || v_1_0_0_1.Type != t {
18167                                         continue
18168                                 }
18169                                 _ = v_1_0_0_1.Args[1]
18170                                 v_1_0_0_1_0 := v_1_0_0_1.Args[0]
18171                                 if v_1_0_0_1_0.Op != OpRsh64x64 || v_1_0_0_1_0.Type != t {
18172                                         continue
18173                                 }
18174                                 _ = v_1_0_0_1_0.Args[1]
18175                                 if n != v_1_0_0_1_0.Args[0] {
18176                                         continue
18177                                 }
18178                                 v_1_0_0_1_0_1 := v_1_0_0_1_0.Args[1]
18179                                 if v_1_0_0_1_0_1.Op != OpConst64 || v_1_0_0_1_0_1.Type != typ.UInt64 || auxIntToInt64(v_1_0_0_1_0_1.AuxInt) != 63 {
18180                                         continue
18181                                 }
18182                                 v_1_0_0_1_1 := v_1_0_0_1.Args[1]
18183                                 if v_1_0_0_1_1.Op != OpConst64 || v_1_0_0_1_1.Type != typ.UInt64 {
18184                                         continue
18185                                 }
18186                                 kbar := auxIntToInt64(v_1_0_0_1_1.AuxInt)
18187                                 v_1_0_1 := v_1_0.Args[1]
18188                                 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 {
18189                                         continue
18190                                 }
18191                                 k := auxIntToInt64(v_1_0_1.AuxInt)
18192                                 v_1_1 := v_1.Args[1]
18193                                 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || auxIntToInt64(v_1_1.AuxInt) != k || !(k > 0 && k < 63 && kbar == 64-k) {
18194                                         continue
18195                                 }
18196                                 v.reset(OpNeq64)
18197                                 v0 := b.NewValue0(v.Pos, OpAnd64, t)
18198                                 v1 := b.NewValue0(v.Pos, OpConst64, t)
18199                                 v1.AuxInt = int64ToAuxInt(1<<uint(k) - 1)
18200                                 v0.AddArg2(n, v1)
18201                                 v2 := b.NewValue0(v.Pos, OpConst64, t)
18202                                 v2.AuxInt = int64ToAuxInt(0)
18203                                 v.AddArg2(v0, v2)
18204                                 return true
18205                         }
18206                 }
18207                 break
18208         }
18209         // match: (Neq64 s:(Sub64 x y) (Const64 [0]))
18210         // cond: s.Uses == 1
18211         // result: (Neq64 x y)
18212         for {
18213                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18214                         s := v_0
18215                         if s.Op != OpSub64 {
18216                                 continue
18217                         }
18218                         y := s.Args[1]
18219                         x := s.Args[0]
18220                         if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 0 || !(s.Uses == 1) {
18221                                 continue
18222                         }
18223                         v.reset(OpNeq64)
18224                         v.AddArg2(x, y)
18225                         return true
18226                 }
18227                 break
18228         }
18229         // match: (Neq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [y]))
18230         // cond: oneBit64(y)
18231         // result: (Eq64 (And64 <t> x (Const64 <t> [y])) (Const64 <t> [0]))
18232         for {
18233                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18234                         if v_0.Op != OpAnd64 {
18235                                 continue
18236                         }
18237                         t := v_0.Type
18238                         _ = v_0.Args[1]
18239                         v_0_0 := v_0.Args[0]
18240                         v_0_1 := v_0.Args[1]
18241                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
18242                                 x := v_0_0
18243                                 if v_0_1.Op != OpConst64 || v_0_1.Type != t {
18244                                         continue
18245                                 }
18246                                 y := auxIntToInt64(v_0_1.AuxInt)
18247                                 if v_1.Op != OpConst64 || v_1.Type != t || auxIntToInt64(v_1.AuxInt) != y || !(oneBit64(y)) {
18248                                         continue
18249                                 }
18250                                 v.reset(OpEq64)
18251                                 v0 := b.NewValue0(v.Pos, OpAnd64, t)
18252                                 v1 := b.NewValue0(v.Pos, OpConst64, t)
18253                                 v1.AuxInt = int64ToAuxInt(y)
18254                                 v0.AddArg2(x, v1)
18255                                 v2 := b.NewValue0(v.Pos, OpConst64, t)
18256                                 v2.AuxInt = int64ToAuxInt(0)
18257                                 v.AddArg2(v0, v2)
18258                                 return true
18259                         }
18260                 }
18261                 break
18262         }
18263         return false
18264 }
18265 func rewriteValuegeneric_OpNeq64F(v *Value) bool {
18266         v_1 := v.Args[1]
18267         v_0 := v.Args[0]
18268         // match: (Neq64F (Const64F [c]) (Const64F [d]))
18269         // result: (ConstBool [c != d])
18270         for {
18271                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18272                         if v_0.Op != OpConst64F {
18273                                 continue
18274                         }
18275                         c := auxIntToFloat64(v_0.AuxInt)
18276                         if v_1.Op != OpConst64F {
18277                                 continue
18278                         }
18279                         d := auxIntToFloat64(v_1.AuxInt)
18280                         v.reset(OpConstBool)
18281                         v.AuxInt = boolToAuxInt(c != d)
18282                         return true
18283                 }
18284                 break
18285         }
18286         return false
18287 }
18288 func rewriteValuegeneric_OpNeq8(v *Value) bool {
18289         v_1 := v.Args[1]
18290         v_0 := v.Args[0]
18291         b := v.Block
18292         typ := &b.Func.Config.Types
18293         // match: (Neq8 x x)
18294         // result: (ConstBool [false])
18295         for {
18296                 x := v_0
18297                 if x != v_1 {
18298                         break
18299                 }
18300                 v.reset(OpConstBool)
18301                 v.AuxInt = boolToAuxInt(false)
18302                 return true
18303         }
18304         // match: (Neq8 (Const8 <t> [c]) (Add8 (Const8 <t> [d]) x))
18305         // result: (Neq8 (Const8 <t> [c-d]) x)
18306         for {
18307                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18308                         if v_0.Op != OpConst8 {
18309                                 continue
18310                         }
18311                         t := v_0.Type
18312                         c := auxIntToInt8(v_0.AuxInt)
18313                         if v_1.Op != OpAdd8 {
18314                                 continue
18315                         }
18316                         _ = v_1.Args[1]
18317                         v_1_0 := v_1.Args[0]
18318                         v_1_1 := v_1.Args[1]
18319                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
18320                                 if v_1_0.Op != OpConst8 || v_1_0.Type != t {
18321                                         continue
18322                                 }
18323                                 d := auxIntToInt8(v_1_0.AuxInt)
18324                                 x := v_1_1
18325                                 v.reset(OpNeq8)
18326                                 v0 := b.NewValue0(v.Pos, OpConst8, t)
18327                                 v0.AuxInt = int8ToAuxInt(c - d)
18328                                 v.AddArg2(v0, x)
18329                                 return true
18330                         }
18331                 }
18332                 break
18333         }
18334         // match: (Neq8 (Const8 [c]) (Const8 [d]))
18335         // result: (ConstBool [c != d])
18336         for {
18337                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18338                         if v_0.Op != OpConst8 {
18339                                 continue
18340                         }
18341                         c := auxIntToInt8(v_0.AuxInt)
18342                         if v_1.Op != OpConst8 {
18343                                 continue
18344                         }
18345                         d := auxIntToInt8(v_1.AuxInt)
18346                         v.reset(OpConstBool)
18347                         v.AuxInt = boolToAuxInt(c != d)
18348                         return true
18349                 }
18350                 break
18351         }
18352         // match: (Neq8 n (Lsh8x64 (Rsh8x64 (Add8 <t> n (Rsh8Ux64 <t> (Rsh8x64 <t> n (Const64 <typ.UInt64> [ 7])) (Const64 <typ.UInt64> [kbar]))) (Const64 <typ.UInt64> [k])) (Const64 <typ.UInt64> [k])) )
18353         // cond: k > 0 && k < 7 && kbar == 8 - k
18354         // result: (Neq8 (And8 <t> n (Const8 <t> [1<<uint(k)-1])) (Const8 <t> [0]))
18355         for {
18356                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18357                         n := v_0
18358                         if v_1.Op != OpLsh8x64 {
18359                                 continue
18360                         }
18361                         _ = v_1.Args[1]
18362                         v_1_0 := v_1.Args[0]
18363                         if v_1_0.Op != OpRsh8x64 {
18364                                 continue
18365                         }
18366                         _ = v_1_0.Args[1]
18367                         v_1_0_0 := v_1_0.Args[0]
18368                         if v_1_0_0.Op != OpAdd8 {
18369                                 continue
18370                         }
18371                         t := v_1_0_0.Type
18372                         _ = v_1_0_0.Args[1]
18373                         v_1_0_0_0 := v_1_0_0.Args[0]
18374                         v_1_0_0_1 := v_1_0_0.Args[1]
18375                         for _i1 := 0; _i1 <= 1; _i1, v_1_0_0_0, v_1_0_0_1 = _i1+1, v_1_0_0_1, v_1_0_0_0 {
18376                                 if n != v_1_0_0_0 || v_1_0_0_1.Op != OpRsh8Ux64 || v_1_0_0_1.Type != t {
18377                                         continue
18378                                 }
18379                                 _ = v_1_0_0_1.Args[1]
18380                                 v_1_0_0_1_0 := v_1_0_0_1.Args[0]
18381                                 if v_1_0_0_1_0.Op != OpRsh8x64 || v_1_0_0_1_0.Type != t {
18382                                         continue
18383                                 }
18384                                 _ = v_1_0_0_1_0.Args[1]
18385                                 if n != v_1_0_0_1_0.Args[0] {
18386                                         continue
18387                                 }
18388                                 v_1_0_0_1_0_1 := v_1_0_0_1_0.Args[1]
18389                                 if v_1_0_0_1_0_1.Op != OpConst64 || v_1_0_0_1_0_1.Type != typ.UInt64 || auxIntToInt64(v_1_0_0_1_0_1.AuxInt) != 7 {
18390                                         continue
18391                                 }
18392                                 v_1_0_0_1_1 := v_1_0_0_1.Args[1]
18393                                 if v_1_0_0_1_1.Op != OpConst64 || v_1_0_0_1_1.Type != typ.UInt64 {
18394                                         continue
18395                                 }
18396                                 kbar := auxIntToInt64(v_1_0_0_1_1.AuxInt)
18397                                 v_1_0_1 := v_1_0.Args[1]
18398                                 if v_1_0_1.Op != OpConst64 || v_1_0_1.Type != typ.UInt64 {
18399                                         continue
18400                                 }
18401                                 k := auxIntToInt64(v_1_0_1.AuxInt)
18402                                 v_1_1 := v_1.Args[1]
18403                                 if v_1_1.Op != OpConst64 || v_1_1.Type != typ.UInt64 || auxIntToInt64(v_1_1.AuxInt) != k || !(k > 0 && k < 7 && kbar == 8-k) {
18404                                         continue
18405                                 }
18406                                 v.reset(OpNeq8)
18407                                 v0 := b.NewValue0(v.Pos, OpAnd8, t)
18408                                 v1 := b.NewValue0(v.Pos, OpConst8, t)
18409                                 v1.AuxInt = int8ToAuxInt(1<<uint(k) - 1)
18410                                 v0.AddArg2(n, v1)
18411                                 v2 := b.NewValue0(v.Pos, OpConst8, t)
18412                                 v2.AuxInt = int8ToAuxInt(0)
18413                                 v.AddArg2(v0, v2)
18414                                 return true
18415                         }
18416                 }
18417                 break
18418         }
18419         // match: (Neq8 s:(Sub8 x y) (Const8 [0]))
18420         // cond: s.Uses == 1
18421         // result: (Neq8 x y)
18422         for {
18423                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18424                         s := v_0
18425                         if s.Op != OpSub8 {
18426                                 continue
18427                         }
18428                         y := s.Args[1]
18429                         x := s.Args[0]
18430                         if v_1.Op != OpConst8 || auxIntToInt8(v_1.AuxInt) != 0 || !(s.Uses == 1) {
18431                                 continue
18432                         }
18433                         v.reset(OpNeq8)
18434                         v.AddArg2(x, y)
18435                         return true
18436                 }
18437                 break
18438         }
18439         // match: (Neq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [y]))
18440         // cond: oneBit8(y)
18441         // result: (Eq8 (And8 <t> x (Const8 <t> [y])) (Const8 <t> [0]))
18442         for {
18443                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18444                         if v_0.Op != OpAnd8 {
18445                                 continue
18446                         }
18447                         t := v_0.Type
18448                         _ = v_0.Args[1]
18449                         v_0_0 := v_0.Args[0]
18450                         v_0_1 := v_0.Args[1]
18451                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
18452                                 x := v_0_0
18453                                 if v_0_1.Op != OpConst8 || v_0_1.Type != t {
18454                                         continue
18455                                 }
18456                                 y := auxIntToInt8(v_0_1.AuxInt)
18457                                 if v_1.Op != OpConst8 || v_1.Type != t || auxIntToInt8(v_1.AuxInt) != y || !(oneBit8(y)) {
18458                                         continue
18459                                 }
18460                                 v.reset(OpEq8)
18461                                 v0 := b.NewValue0(v.Pos, OpAnd8, t)
18462                                 v1 := b.NewValue0(v.Pos, OpConst8, t)
18463                                 v1.AuxInt = int8ToAuxInt(y)
18464                                 v0.AddArg2(x, v1)
18465                                 v2 := b.NewValue0(v.Pos, OpConst8, t)
18466                                 v2.AuxInt = int8ToAuxInt(0)
18467                                 v.AddArg2(v0, v2)
18468                                 return true
18469                         }
18470                 }
18471                 break
18472         }
18473         return false
18474 }
18475 func rewriteValuegeneric_OpNeqB(v *Value) bool {
18476         v_1 := v.Args[1]
18477         v_0 := v.Args[0]
18478         // match: (NeqB (ConstBool [c]) (ConstBool [d]))
18479         // result: (ConstBool [c != d])
18480         for {
18481                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18482                         if v_0.Op != OpConstBool {
18483                                 continue
18484                         }
18485                         c := auxIntToBool(v_0.AuxInt)
18486                         if v_1.Op != OpConstBool {
18487                                 continue
18488                         }
18489                         d := auxIntToBool(v_1.AuxInt)
18490                         v.reset(OpConstBool)
18491                         v.AuxInt = boolToAuxInt(c != d)
18492                         return true
18493                 }
18494                 break
18495         }
18496         // match: (NeqB (ConstBool [false]) x)
18497         // result: x
18498         for {
18499                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18500                         if v_0.Op != OpConstBool || auxIntToBool(v_0.AuxInt) != false {
18501                                 continue
18502                         }
18503                         x := v_1
18504                         v.copyOf(x)
18505                         return true
18506                 }
18507                 break
18508         }
18509         // match: (NeqB (ConstBool [true]) x)
18510         // result: (Not x)
18511         for {
18512                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18513                         if v_0.Op != OpConstBool || auxIntToBool(v_0.AuxInt) != true {
18514                                 continue
18515                         }
18516                         x := v_1
18517                         v.reset(OpNot)
18518                         v.AddArg(x)
18519                         return true
18520                 }
18521                 break
18522         }
18523         // match: (NeqB (Not x) (Not y))
18524         // result: (NeqB x y)
18525         for {
18526                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18527                         if v_0.Op != OpNot {
18528                                 continue
18529                         }
18530                         x := v_0.Args[0]
18531                         if v_1.Op != OpNot {
18532                                 continue
18533                         }
18534                         y := v_1.Args[0]
18535                         v.reset(OpNeqB)
18536                         v.AddArg2(x, y)
18537                         return true
18538                 }
18539                 break
18540         }
18541         return false
18542 }
18543 func rewriteValuegeneric_OpNeqInter(v *Value) bool {
18544         v_1 := v.Args[1]
18545         v_0 := v.Args[0]
18546         b := v.Block
18547         typ := &b.Func.Config.Types
18548         // match: (NeqInter x y)
18549         // result: (NeqPtr (ITab x) (ITab y))
18550         for {
18551                 x := v_0
18552                 y := v_1
18553                 v.reset(OpNeqPtr)
18554                 v0 := b.NewValue0(v.Pos, OpITab, typ.Uintptr)
18555                 v0.AddArg(x)
18556                 v1 := b.NewValue0(v.Pos, OpITab, typ.Uintptr)
18557                 v1.AddArg(y)
18558                 v.AddArg2(v0, v1)
18559                 return true
18560         }
18561 }
18562 func rewriteValuegeneric_OpNeqPtr(v *Value) bool {
18563         v_1 := v.Args[1]
18564         v_0 := v.Args[0]
18565         // match: (NeqPtr x x)
18566         // result: (ConstBool [false])
18567         for {
18568                 x := v_0
18569                 if x != v_1 {
18570                         break
18571                 }
18572                 v.reset(OpConstBool)
18573                 v.AuxInt = boolToAuxInt(false)
18574                 return true
18575         }
18576         // match: (NeqPtr (Addr {x} _) (Addr {y} _))
18577         // result: (ConstBool [x != y])
18578         for {
18579                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18580                         if v_0.Op != OpAddr {
18581                                 continue
18582                         }
18583                         x := auxToSym(v_0.Aux)
18584                         if v_1.Op != OpAddr {
18585                                 continue
18586                         }
18587                         y := auxToSym(v_1.Aux)
18588                         v.reset(OpConstBool)
18589                         v.AuxInt = boolToAuxInt(x != y)
18590                         return true
18591                 }
18592                 break
18593         }
18594         // match: (NeqPtr (Addr {x} _) (OffPtr [o] (Addr {y} _)))
18595         // result: (ConstBool [x != y || o != 0])
18596         for {
18597                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18598                         if v_0.Op != OpAddr {
18599                                 continue
18600                         }
18601                         x := auxToSym(v_0.Aux)
18602                         if v_1.Op != OpOffPtr {
18603                                 continue
18604                         }
18605                         o := auxIntToInt64(v_1.AuxInt)
18606                         v_1_0 := v_1.Args[0]
18607                         if v_1_0.Op != OpAddr {
18608                                 continue
18609                         }
18610                         y := auxToSym(v_1_0.Aux)
18611                         v.reset(OpConstBool)
18612                         v.AuxInt = boolToAuxInt(x != y || o != 0)
18613                         return true
18614                 }
18615                 break
18616         }
18617         // match: (NeqPtr (OffPtr [o1] (Addr {x} _)) (OffPtr [o2] (Addr {y} _)))
18618         // result: (ConstBool [x != y || o1 != o2])
18619         for {
18620                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18621                         if v_0.Op != OpOffPtr {
18622                                 continue
18623                         }
18624                         o1 := auxIntToInt64(v_0.AuxInt)
18625                         v_0_0 := v_0.Args[0]
18626                         if v_0_0.Op != OpAddr {
18627                                 continue
18628                         }
18629                         x := auxToSym(v_0_0.Aux)
18630                         if v_1.Op != OpOffPtr {
18631                                 continue
18632                         }
18633                         o2 := auxIntToInt64(v_1.AuxInt)
18634                         v_1_0 := v_1.Args[0]
18635                         if v_1_0.Op != OpAddr {
18636                                 continue
18637                         }
18638                         y := auxToSym(v_1_0.Aux)
18639                         v.reset(OpConstBool)
18640                         v.AuxInt = boolToAuxInt(x != y || o1 != o2)
18641                         return true
18642                 }
18643                 break
18644         }
18645         // match: (NeqPtr (LocalAddr {x} _ _) (LocalAddr {y} _ _))
18646         // result: (ConstBool [x != y])
18647         for {
18648                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18649                         if v_0.Op != OpLocalAddr {
18650                                 continue
18651                         }
18652                         x := auxToSym(v_0.Aux)
18653                         if v_1.Op != OpLocalAddr {
18654                                 continue
18655                         }
18656                         y := auxToSym(v_1.Aux)
18657                         v.reset(OpConstBool)
18658                         v.AuxInt = boolToAuxInt(x != y)
18659                         return true
18660                 }
18661                 break
18662         }
18663         // match: (NeqPtr (LocalAddr {x} _ _) (OffPtr [o] (LocalAddr {y} _ _)))
18664         // result: (ConstBool [x != y || o != 0])
18665         for {
18666                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18667                         if v_0.Op != OpLocalAddr {
18668                                 continue
18669                         }
18670                         x := auxToSym(v_0.Aux)
18671                         if v_1.Op != OpOffPtr {
18672                                 continue
18673                         }
18674                         o := auxIntToInt64(v_1.AuxInt)
18675                         v_1_0 := v_1.Args[0]
18676                         if v_1_0.Op != OpLocalAddr {
18677                                 continue
18678                         }
18679                         y := auxToSym(v_1_0.Aux)
18680                         v.reset(OpConstBool)
18681                         v.AuxInt = boolToAuxInt(x != y || o != 0)
18682                         return true
18683                 }
18684                 break
18685         }
18686         // match: (NeqPtr (OffPtr [o1] (LocalAddr {x} _ _)) (OffPtr [o2] (LocalAddr {y} _ _)))
18687         // result: (ConstBool [x != y || o1 != o2])
18688         for {
18689                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18690                         if v_0.Op != OpOffPtr {
18691                                 continue
18692                         }
18693                         o1 := auxIntToInt64(v_0.AuxInt)
18694                         v_0_0 := v_0.Args[0]
18695                         if v_0_0.Op != OpLocalAddr {
18696                                 continue
18697                         }
18698                         x := auxToSym(v_0_0.Aux)
18699                         if v_1.Op != OpOffPtr {
18700                                 continue
18701                         }
18702                         o2 := auxIntToInt64(v_1.AuxInt)
18703                         v_1_0 := v_1.Args[0]
18704                         if v_1_0.Op != OpLocalAddr {
18705                                 continue
18706                         }
18707                         y := auxToSym(v_1_0.Aux)
18708                         v.reset(OpConstBool)
18709                         v.AuxInt = boolToAuxInt(x != y || o1 != o2)
18710                         return true
18711                 }
18712                 break
18713         }
18714         // match: (NeqPtr (OffPtr [o1] p1) p2)
18715         // cond: isSamePtr(p1, p2)
18716         // result: (ConstBool [o1 != 0])
18717         for {
18718                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18719                         if v_0.Op != OpOffPtr {
18720                                 continue
18721                         }
18722                         o1 := auxIntToInt64(v_0.AuxInt)
18723                         p1 := v_0.Args[0]
18724                         p2 := v_1
18725                         if !(isSamePtr(p1, p2)) {
18726                                 continue
18727                         }
18728                         v.reset(OpConstBool)
18729                         v.AuxInt = boolToAuxInt(o1 != 0)
18730                         return true
18731                 }
18732                 break
18733         }
18734         // match: (NeqPtr (OffPtr [o1] p1) (OffPtr [o2] p2))
18735         // cond: isSamePtr(p1, p2)
18736         // result: (ConstBool [o1 != o2])
18737         for {
18738                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18739                         if v_0.Op != OpOffPtr {
18740                                 continue
18741                         }
18742                         o1 := auxIntToInt64(v_0.AuxInt)
18743                         p1 := v_0.Args[0]
18744                         if v_1.Op != OpOffPtr {
18745                                 continue
18746                         }
18747                         o2 := auxIntToInt64(v_1.AuxInt)
18748                         p2 := v_1.Args[0]
18749                         if !(isSamePtr(p1, p2)) {
18750                                 continue
18751                         }
18752                         v.reset(OpConstBool)
18753                         v.AuxInt = boolToAuxInt(o1 != o2)
18754                         return true
18755                 }
18756                 break
18757         }
18758         // match: (NeqPtr (Const32 [c]) (Const32 [d]))
18759         // result: (ConstBool [c != d])
18760         for {
18761                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18762                         if v_0.Op != OpConst32 {
18763                                 continue
18764                         }
18765                         c := auxIntToInt32(v_0.AuxInt)
18766                         if v_1.Op != OpConst32 {
18767                                 continue
18768                         }
18769                         d := auxIntToInt32(v_1.AuxInt)
18770                         v.reset(OpConstBool)
18771                         v.AuxInt = boolToAuxInt(c != d)
18772                         return true
18773                 }
18774                 break
18775         }
18776         // match: (NeqPtr (Const64 [c]) (Const64 [d]))
18777         // result: (ConstBool [c != d])
18778         for {
18779                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18780                         if v_0.Op != OpConst64 {
18781                                 continue
18782                         }
18783                         c := auxIntToInt64(v_0.AuxInt)
18784                         if v_1.Op != OpConst64 {
18785                                 continue
18786                         }
18787                         d := auxIntToInt64(v_1.AuxInt)
18788                         v.reset(OpConstBool)
18789                         v.AuxInt = boolToAuxInt(c != d)
18790                         return true
18791                 }
18792                 break
18793         }
18794         // match: (NeqPtr (Convert (Addr {x} _) _) (Addr {y} _))
18795         // result: (ConstBool [x!=y])
18796         for {
18797                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18798                         if v_0.Op != OpConvert {
18799                                 continue
18800                         }
18801                         v_0_0 := v_0.Args[0]
18802                         if v_0_0.Op != OpAddr {
18803                                 continue
18804                         }
18805                         x := auxToSym(v_0_0.Aux)
18806                         if v_1.Op != OpAddr {
18807                                 continue
18808                         }
18809                         y := auxToSym(v_1.Aux)
18810                         v.reset(OpConstBool)
18811                         v.AuxInt = boolToAuxInt(x != y)
18812                         return true
18813                 }
18814                 break
18815         }
18816         // match: (NeqPtr (LocalAddr _ _) (Addr _))
18817         // result: (ConstBool [true])
18818         for {
18819                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18820                         if v_0.Op != OpLocalAddr || v_1.Op != OpAddr {
18821                                 continue
18822                         }
18823                         v.reset(OpConstBool)
18824                         v.AuxInt = boolToAuxInt(true)
18825                         return true
18826                 }
18827                 break
18828         }
18829         // match: (NeqPtr (OffPtr (LocalAddr _ _)) (Addr _))
18830         // result: (ConstBool [true])
18831         for {
18832                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18833                         if v_0.Op != OpOffPtr {
18834                                 continue
18835                         }
18836                         v_0_0 := v_0.Args[0]
18837                         if v_0_0.Op != OpLocalAddr || v_1.Op != OpAddr {
18838                                 continue
18839                         }
18840                         v.reset(OpConstBool)
18841                         v.AuxInt = boolToAuxInt(true)
18842                         return true
18843                 }
18844                 break
18845         }
18846         // match: (NeqPtr (LocalAddr _ _) (OffPtr (Addr _)))
18847         // result: (ConstBool [true])
18848         for {
18849                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18850                         if v_0.Op != OpLocalAddr || v_1.Op != OpOffPtr {
18851                                 continue
18852                         }
18853                         v_1_0 := v_1.Args[0]
18854                         if v_1_0.Op != OpAddr {
18855                                 continue
18856                         }
18857                         v.reset(OpConstBool)
18858                         v.AuxInt = boolToAuxInt(true)
18859                         return true
18860                 }
18861                 break
18862         }
18863         // match: (NeqPtr (OffPtr (LocalAddr _ _)) (OffPtr (Addr _)))
18864         // result: (ConstBool [true])
18865         for {
18866                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18867                         if v_0.Op != OpOffPtr {
18868                                 continue
18869                         }
18870                         v_0_0 := v_0.Args[0]
18871                         if v_0_0.Op != OpLocalAddr || v_1.Op != OpOffPtr {
18872                                 continue
18873                         }
18874                         v_1_0 := v_1.Args[0]
18875                         if v_1_0.Op != OpAddr {
18876                                 continue
18877                         }
18878                         v.reset(OpConstBool)
18879                         v.AuxInt = boolToAuxInt(true)
18880                         return true
18881                 }
18882                 break
18883         }
18884         // match: (NeqPtr (AddPtr p1 o1) p2)
18885         // cond: isSamePtr(p1, p2)
18886         // result: (IsNonNil o1)
18887         for {
18888                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18889                         if v_0.Op != OpAddPtr {
18890                                 continue
18891                         }
18892                         o1 := v_0.Args[1]
18893                         p1 := v_0.Args[0]
18894                         p2 := v_1
18895                         if !(isSamePtr(p1, p2)) {
18896                                 continue
18897                         }
18898                         v.reset(OpIsNonNil)
18899                         v.AddArg(o1)
18900                         return true
18901                 }
18902                 break
18903         }
18904         // match: (NeqPtr (Const32 [0]) p)
18905         // result: (IsNonNil p)
18906         for {
18907                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18908                         if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
18909                                 continue
18910                         }
18911                         p := v_1
18912                         v.reset(OpIsNonNil)
18913                         v.AddArg(p)
18914                         return true
18915                 }
18916                 break
18917         }
18918         // match: (NeqPtr (Const64 [0]) p)
18919         // result: (IsNonNil p)
18920         for {
18921                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18922                         if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
18923                                 continue
18924                         }
18925                         p := v_1
18926                         v.reset(OpIsNonNil)
18927                         v.AddArg(p)
18928                         return true
18929                 }
18930                 break
18931         }
18932         // match: (NeqPtr (ConstNil) p)
18933         // result: (IsNonNil p)
18934         for {
18935                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
18936                         if v_0.Op != OpConstNil {
18937                                 continue
18938                         }
18939                         p := v_1
18940                         v.reset(OpIsNonNil)
18941                         v.AddArg(p)
18942                         return true
18943                 }
18944                 break
18945         }
18946         return false
18947 }
18948 func rewriteValuegeneric_OpNeqSlice(v *Value) bool {
18949         v_1 := v.Args[1]
18950         v_0 := v.Args[0]
18951         b := v.Block
18952         typ := &b.Func.Config.Types
18953         // match: (NeqSlice x y)
18954         // result: (NeqPtr (SlicePtr x) (SlicePtr y))
18955         for {
18956                 x := v_0
18957                 y := v_1
18958                 v.reset(OpNeqPtr)
18959                 v0 := b.NewValue0(v.Pos, OpSlicePtr, typ.BytePtr)
18960                 v0.AddArg(x)
18961                 v1 := b.NewValue0(v.Pos, OpSlicePtr, typ.BytePtr)
18962                 v1.AddArg(y)
18963                 v.AddArg2(v0, v1)
18964                 return true
18965         }
18966 }
18967 func rewriteValuegeneric_OpNilCheck(v *Value) bool {
18968         v_1 := v.Args[1]
18969         v_0 := v.Args[0]
18970         b := v.Block
18971         fe := b.Func.fe
18972         // match: (NilCheck (GetG mem) mem)
18973         // result: mem
18974         for {
18975                 if v_0.Op != OpGetG {
18976                         break
18977                 }
18978                 mem := v_0.Args[0]
18979                 if mem != v_1 {
18980                         break
18981                 }
18982                 v.copyOf(mem)
18983                 return true
18984         }
18985         // match: (NilCheck (SelectN [0] call:(StaticLECall _ _)) _)
18986         // cond: isSameCall(call.Aux, "runtime.newobject") && warnRule(fe.Debug_checknil(), v, "removed nil check")
18987         // result: (Invalid)
18988         for {
18989                 if v_0.Op != OpSelectN || auxIntToInt64(v_0.AuxInt) != 0 {
18990                         break
18991                 }
18992                 call := v_0.Args[0]
18993                 if call.Op != OpStaticLECall || len(call.Args) != 2 || !(isSameCall(call.Aux, "runtime.newobject") && warnRule(fe.Debug_checknil(), v, "removed nil check")) {
18994                         break
18995                 }
18996                 v.reset(OpInvalid)
18997                 return true
18998         }
18999         // match: (NilCheck (OffPtr (SelectN [0] call:(StaticLECall _ _))) _)
19000         // cond: isSameCall(call.Aux, "runtime.newobject") && warnRule(fe.Debug_checknil(), v, "removed nil check")
19001         // result: (Invalid)
19002         for {
19003                 if v_0.Op != OpOffPtr {
19004                         break
19005                 }
19006                 v_0_0 := v_0.Args[0]
19007                 if v_0_0.Op != OpSelectN || auxIntToInt64(v_0_0.AuxInt) != 0 {
19008                         break
19009                 }
19010                 call := v_0_0.Args[0]
19011                 if call.Op != OpStaticLECall || len(call.Args) != 2 || !(isSameCall(call.Aux, "runtime.newobject") && warnRule(fe.Debug_checknil(), v, "removed nil check")) {
19012                         break
19013                 }
19014                 v.reset(OpInvalid)
19015                 return true
19016         }
19017         // match: (NilCheck (Addr {_} (SB)) _)
19018         // result: (Invalid)
19019         for {
19020                 if v_0.Op != OpAddr {
19021                         break
19022                 }
19023                 v_0_0 := v_0.Args[0]
19024                 if v_0_0.Op != OpSB {
19025                         break
19026                 }
19027                 v.reset(OpInvalid)
19028                 return true
19029         }
19030         // match: (NilCheck (Convert (Addr {_} (SB)) _) _)
19031         // result: (Invalid)
19032         for {
19033                 if v_0.Op != OpConvert {
19034                         break
19035                 }
19036                 v_0_0 := v_0.Args[0]
19037                 if v_0_0.Op != OpAddr {
19038                         break
19039                 }
19040                 v_0_0_0 := v_0_0.Args[0]
19041                 if v_0_0_0.Op != OpSB {
19042                         break
19043                 }
19044                 v.reset(OpInvalid)
19045                 return true
19046         }
19047         return false
19048 }
19049 func rewriteValuegeneric_OpNot(v *Value) bool {
19050         v_0 := v.Args[0]
19051         // match: (Not (ConstBool [c]))
19052         // result: (ConstBool [!c])
19053         for {
19054                 if v_0.Op != OpConstBool {
19055                         break
19056                 }
19057                 c := auxIntToBool(v_0.AuxInt)
19058                 v.reset(OpConstBool)
19059                 v.AuxInt = boolToAuxInt(!c)
19060                 return true
19061         }
19062         // match: (Not (Eq64 x y))
19063         // result: (Neq64 x y)
19064         for {
19065                 if v_0.Op != OpEq64 {
19066                         break
19067                 }
19068                 y := v_0.Args[1]
19069                 x := v_0.Args[0]
19070                 v.reset(OpNeq64)
19071                 v.AddArg2(x, y)
19072                 return true
19073         }
19074         // match: (Not (Eq32 x y))
19075         // result: (Neq32 x y)
19076         for {
19077                 if v_0.Op != OpEq32 {
19078                         break
19079                 }
19080                 y := v_0.Args[1]
19081                 x := v_0.Args[0]
19082                 v.reset(OpNeq32)
19083                 v.AddArg2(x, y)
19084                 return true
19085         }
19086         // match: (Not (Eq16 x y))
19087         // result: (Neq16 x y)
19088         for {
19089                 if v_0.Op != OpEq16 {
19090                         break
19091                 }
19092                 y := v_0.Args[1]
19093                 x := v_0.Args[0]
19094                 v.reset(OpNeq16)
19095                 v.AddArg2(x, y)
19096                 return true
19097         }
19098         // match: (Not (Eq8 x y))
19099         // result: (Neq8 x y)
19100         for {
19101                 if v_0.Op != OpEq8 {
19102                         break
19103                 }
19104                 y := v_0.Args[1]
19105                 x := v_0.Args[0]
19106                 v.reset(OpNeq8)
19107                 v.AddArg2(x, y)
19108                 return true
19109         }
19110         // match: (Not (EqB x y))
19111         // result: (NeqB x y)
19112         for {
19113                 if v_0.Op != OpEqB {
19114                         break
19115                 }
19116                 y := v_0.Args[1]
19117                 x := v_0.Args[0]
19118                 v.reset(OpNeqB)
19119                 v.AddArg2(x, y)
19120                 return true
19121         }
19122         // match: (Not (EqPtr x y))
19123         // result: (NeqPtr x y)
19124         for {
19125                 if v_0.Op != OpEqPtr {
19126                         break
19127                 }
19128                 y := v_0.Args[1]
19129                 x := v_0.Args[0]
19130                 v.reset(OpNeqPtr)
19131                 v.AddArg2(x, y)
19132                 return true
19133         }
19134         // match: (Not (Eq64F x y))
19135         // result: (Neq64F x y)
19136         for {
19137                 if v_0.Op != OpEq64F {
19138                         break
19139                 }
19140                 y := v_0.Args[1]
19141                 x := v_0.Args[0]
19142                 v.reset(OpNeq64F)
19143                 v.AddArg2(x, y)
19144                 return true
19145         }
19146         // match: (Not (Eq32F x y))
19147         // result: (Neq32F x y)
19148         for {
19149                 if v_0.Op != OpEq32F {
19150                         break
19151                 }
19152                 y := v_0.Args[1]
19153                 x := v_0.Args[0]
19154                 v.reset(OpNeq32F)
19155                 v.AddArg2(x, y)
19156                 return true
19157         }
19158         // match: (Not (Neq64 x y))
19159         // result: (Eq64 x y)
19160         for {
19161                 if v_0.Op != OpNeq64 {
19162                         break
19163                 }
19164                 y := v_0.Args[1]
19165                 x := v_0.Args[0]
19166                 v.reset(OpEq64)
19167                 v.AddArg2(x, y)
19168                 return true
19169         }
19170         // match: (Not (Neq32 x y))
19171         // result: (Eq32 x y)
19172         for {
19173                 if v_0.Op != OpNeq32 {
19174                         break
19175                 }
19176                 y := v_0.Args[1]
19177                 x := v_0.Args[0]
19178                 v.reset(OpEq32)
19179                 v.AddArg2(x, y)
19180                 return true
19181         }
19182         // match: (Not (Neq16 x y))
19183         // result: (Eq16 x y)
19184         for {
19185                 if v_0.Op != OpNeq16 {
19186                         break
19187                 }
19188                 y := v_0.Args[1]
19189                 x := v_0.Args[0]
19190                 v.reset(OpEq16)
19191                 v.AddArg2(x, y)
19192                 return true
19193         }
19194         // match: (Not (Neq8 x y))
19195         // result: (Eq8 x y)
19196         for {
19197                 if v_0.Op != OpNeq8 {
19198                         break
19199                 }
19200                 y := v_0.Args[1]
19201                 x := v_0.Args[0]
19202                 v.reset(OpEq8)
19203                 v.AddArg2(x, y)
19204                 return true
19205         }
19206         // match: (Not (NeqB x y))
19207         // result: (EqB x y)
19208         for {
19209                 if v_0.Op != OpNeqB {
19210                         break
19211                 }
19212                 y := v_0.Args[1]
19213                 x := v_0.Args[0]
19214                 v.reset(OpEqB)
19215                 v.AddArg2(x, y)
19216                 return true
19217         }
19218         // match: (Not (NeqPtr x y))
19219         // result: (EqPtr x y)
19220         for {
19221                 if v_0.Op != OpNeqPtr {
19222                         break
19223                 }
19224                 y := v_0.Args[1]
19225                 x := v_0.Args[0]
19226                 v.reset(OpEqPtr)
19227                 v.AddArg2(x, y)
19228                 return true
19229         }
19230         // match: (Not (Neq64F x y))
19231         // result: (Eq64F x y)
19232         for {
19233                 if v_0.Op != OpNeq64F {
19234                         break
19235                 }
19236                 y := v_0.Args[1]
19237                 x := v_0.Args[0]
19238                 v.reset(OpEq64F)
19239                 v.AddArg2(x, y)
19240                 return true
19241         }
19242         // match: (Not (Neq32F x y))
19243         // result: (Eq32F x y)
19244         for {
19245                 if v_0.Op != OpNeq32F {
19246                         break
19247                 }
19248                 y := v_0.Args[1]
19249                 x := v_0.Args[0]
19250                 v.reset(OpEq32F)
19251                 v.AddArg2(x, y)
19252                 return true
19253         }
19254         // match: (Not (Less64 x y))
19255         // result: (Leq64 y x)
19256         for {
19257                 if v_0.Op != OpLess64 {
19258                         break
19259                 }
19260                 y := v_0.Args[1]
19261                 x := v_0.Args[0]
19262                 v.reset(OpLeq64)
19263                 v.AddArg2(y, x)
19264                 return true
19265         }
19266         // match: (Not (Less32 x y))
19267         // result: (Leq32 y x)
19268         for {
19269                 if v_0.Op != OpLess32 {
19270                         break
19271                 }
19272                 y := v_0.Args[1]
19273                 x := v_0.Args[0]
19274                 v.reset(OpLeq32)
19275                 v.AddArg2(y, x)
19276                 return true
19277         }
19278         // match: (Not (Less16 x y))
19279         // result: (Leq16 y x)
19280         for {
19281                 if v_0.Op != OpLess16 {
19282                         break
19283                 }
19284                 y := v_0.Args[1]
19285                 x := v_0.Args[0]
19286                 v.reset(OpLeq16)
19287                 v.AddArg2(y, x)
19288                 return true
19289         }
19290         // match: (Not (Less8 x y))
19291         // result: (Leq8 y x)
19292         for {
19293                 if v_0.Op != OpLess8 {
19294                         break
19295                 }
19296                 y := v_0.Args[1]
19297                 x := v_0.Args[0]
19298                 v.reset(OpLeq8)
19299                 v.AddArg2(y, x)
19300                 return true
19301         }
19302         // match: (Not (Less64U x y))
19303         // result: (Leq64U y x)
19304         for {
19305                 if v_0.Op != OpLess64U {
19306                         break
19307                 }
19308                 y := v_0.Args[1]
19309                 x := v_0.Args[0]
19310                 v.reset(OpLeq64U)
19311                 v.AddArg2(y, x)
19312                 return true
19313         }
19314         // match: (Not (Less32U x y))
19315         // result: (Leq32U y x)
19316         for {
19317                 if v_0.Op != OpLess32U {
19318                         break
19319                 }
19320                 y := v_0.Args[1]
19321                 x := v_0.Args[0]
19322                 v.reset(OpLeq32U)
19323                 v.AddArg2(y, x)
19324                 return true
19325         }
19326         // match: (Not (Less16U x y))
19327         // result: (Leq16U y x)
19328         for {
19329                 if v_0.Op != OpLess16U {
19330                         break
19331                 }
19332                 y := v_0.Args[1]
19333                 x := v_0.Args[0]
19334                 v.reset(OpLeq16U)
19335                 v.AddArg2(y, x)
19336                 return true
19337         }
19338         // match: (Not (Less8U x y))
19339         // result: (Leq8U y x)
19340         for {
19341                 if v_0.Op != OpLess8U {
19342                         break
19343                 }
19344                 y := v_0.Args[1]
19345                 x := v_0.Args[0]
19346                 v.reset(OpLeq8U)
19347                 v.AddArg2(y, x)
19348                 return true
19349         }
19350         // match: (Not (Leq64 x y))
19351         // result: (Less64 y x)
19352         for {
19353                 if v_0.Op != OpLeq64 {
19354                         break
19355                 }
19356                 y := v_0.Args[1]
19357                 x := v_0.Args[0]
19358                 v.reset(OpLess64)
19359                 v.AddArg2(y, x)
19360                 return true
19361         }
19362         // match: (Not (Leq32 x y))
19363         // result: (Less32 y x)
19364         for {
19365                 if v_0.Op != OpLeq32 {
19366                         break
19367                 }
19368                 y := v_0.Args[1]
19369                 x := v_0.Args[0]
19370                 v.reset(OpLess32)
19371                 v.AddArg2(y, x)
19372                 return true
19373         }
19374         // match: (Not (Leq16 x y))
19375         // result: (Less16 y x)
19376         for {
19377                 if v_0.Op != OpLeq16 {
19378                         break
19379                 }
19380                 y := v_0.Args[1]
19381                 x := v_0.Args[0]
19382                 v.reset(OpLess16)
19383                 v.AddArg2(y, x)
19384                 return true
19385         }
19386         // match: (Not (Leq8 x y))
19387         // result: (Less8 y x)
19388         for {
19389                 if v_0.Op != OpLeq8 {
19390                         break
19391                 }
19392                 y := v_0.Args[1]
19393                 x := v_0.Args[0]
19394                 v.reset(OpLess8)
19395                 v.AddArg2(y, x)
19396                 return true
19397         }
19398         // match: (Not (Leq64U x y))
19399         // result: (Less64U y x)
19400         for {
19401                 if v_0.Op != OpLeq64U {
19402                         break
19403                 }
19404                 y := v_0.Args[1]
19405                 x := v_0.Args[0]
19406                 v.reset(OpLess64U)
19407                 v.AddArg2(y, x)
19408                 return true
19409         }
19410         // match: (Not (Leq32U x y))
19411         // result: (Less32U y x)
19412         for {
19413                 if v_0.Op != OpLeq32U {
19414                         break
19415                 }
19416                 y := v_0.Args[1]
19417                 x := v_0.Args[0]
19418                 v.reset(OpLess32U)
19419                 v.AddArg2(y, x)
19420                 return true
19421         }
19422         // match: (Not (Leq16U x y))
19423         // result: (Less16U y x)
19424         for {
19425                 if v_0.Op != OpLeq16U {
19426                         break
19427                 }
19428                 y := v_0.Args[1]
19429                 x := v_0.Args[0]
19430                 v.reset(OpLess16U)
19431                 v.AddArg2(y, x)
19432                 return true
19433         }
19434         // match: (Not (Leq8U x y))
19435         // result: (Less8U y x)
19436         for {
19437                 if v_0.Op != OpLeq8U {
19438                         break
19439                 }
19440                 y := v_0.Args[1]
19441                 x := v_0.Args[0]
19442                 v.reset(OpLess8U)
19443                 v.AddArg2(y, x)
19444                 return true
19445         }
19446         return false
19447 }
19448 func rewriteValuegeneric_OpOffPtr(v *Value) bool {
19449         v_0 := v.Args[0]
19450         // match: (OffPtr (OffPtr p [y]) [x])
19451         // result: (OffPtr p [x+y])
19452         for {
19453                 x := auxIntToInt64(v.AuxInt)
19454                 if v_0.Op != OpOffPtr {
19455                         break
19456                 }
19457                 y := auxIntToInt64(v_0.AuxInt)
19458                 p := v_0.Args[0]
19459                 v.reset(OpOffPtr)
19460                 v.AuxInt = int64ToAuxInt(x + y)
19461                 v.AddArg(p)
19462                 return true
19463         }
19464         // match: (OffPtr p [0])
19465         // cond: v.Type.Compare(p.Type) == types.CMPeq
19466         // result: p
19467         for {
19468                 if auxIntToInt64(v.AuxInt) != 0 {
19469                         break
19470                 }
19471                 p := v_0
19472                 if !(v.Type.Compare(p.Type) == types.CMPeq) {
19473                         break
19474                 }
19475                 v.copyOf(p)
19476                 return true
19477         }
19478         return false
19479 }
19480 func rewriteValuegeneric_OpOr16(v *Value) bool {
19481         v_1 := v.Args[1]
19482         v_0 := v.Args[0]
19483         b := v.Block
19484         config := b.Func.Config
19485         // match: (Or16 (Const16 [c]) (Const16 [d]))
19486         // result: (Const16 [c|d])
19487         for {
19488                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19489                         if v_0.Op != OpConst16 {
19490                                 continue
19491                         }
19492                         c := auxIntToInt16(v_0.AuxInt)
19493                         if v_1.Op != OpConst16 {
19494                                 continue
19495                         }
19496                         d := auxIntToInt16(v_1.AuxInt)
19497                         v.reset(OpConst16)
19498                         v.AuxInt = int16ToAuxInt(c | d)
19499                         return true
19500                 }
19501                 break
19502         }
19503         // match: (Or16 <t> (Com16 x) (Com16 y))
19504         // result: (Com16 (And16 <t> x y))
19505         for {
19506                 t := v.Type
19507                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19508                         if v_0.Op != OpCom16 {
19509                                 continue
19510                         }
19511                         x := v_0.Args[0]
19512                         if v_1.Op != OpCom16 {
19513                                 continue
19514                         }
19515                         y := v_1.Args[0]
19516                         v.reset(OpCom16)
19517                         v0 := b.NewValue0(v.Pos, OpAnd16, t)
19518                         v0.AddArg2(x, y)
19519                         v.AddArg(v0)
19520                         return true
19521                 }
19522                 break
19523         }
19524         // match: (Or16 x x)
19525         // result: x
19526         for {
19527                 x := v_0
19528                 if x != v_1 {
19529                         break
19530                 }
19531                 v.copyOf(x)
19532                 return true
19533         }
19534         // match: (Or16 (Const16 [0]) x)
19535         // result: x
19536         for {
19537                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19538                         if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
19539                                 continue
19540                         }
19541                         x := v_1
19542                         v.copyOf(x)
19543                         return true
19544                 }
19545                 break
19546         }
19547         // match: (Or16 (Const16 [-1]) _)
19548         // result: (Const16 [-1])
19549         for {
19550                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19551                         if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != -1 {
19552                                 continue
19553                         }
19554                         v.reset(OpConst16)
19555                         v.AuxInt = int16ToAuxInt(-1)
19556                         return true
19557                 }
19558                 break
19559         }
19560         // match: (Or16 (Com16 x) x)
19561         // result: (Const16 [-1])
19562         for {
19563                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19564                         if v_0.Op != OpCom16 {
19565                                 continue
19566                         }
19567                         x := v_0.Args[0]
19568                         if x != v_1 {
19569                                 continue
19570                         }
19571                         v.reset(OpConst16)
19572                         v.AuxInt = int16ToAuxInt(-1)
19573                         return true
19574                 }
19575                 break
19576         }
19577         // match: (Or16 x (Or16 x y))
19578         // result: (Or16 x y)
19579         for {
19580                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19581                         x := v_0
19582                         if v_1.Op != OpOr16 {
19583                                 continue
19584                         }
19585                         _ = v_1.Args[1]
19586                         v_1_0 := v_1.Args[0]
19587                         v_1_1 := v_1.Args[1]
19588                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
19589                                 if x != v_1_0 {
19590                                         continue
19591                                 }
19592                                 y := v_1_1
19593                                 v.reset(OpOr16)
19594                                 v.AddArg2(x, y)
19595                                 return true
19596                         }
19597                 }
19598                 break
19599         }
19600         // match: (Or16 (And16 x (Const16 [c2])) (Const16 <t> [c1]))
19601         // cond: ^(c1 | c2) == 0
19602         // result: (Or16 (Const16 <t> [c1]) x)
19603         for {
19604                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19605                         if v_0.Op != OpAnd16 {
19606                                 continue
19607                         }
19608                         _ = v_0.Args[1]
19609                         v_0_0 := v_0.Args[0]
19610                         v_0_1 := v_0.Args[1]
19611                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
19612                                 x := v_0_0
19613                                 if v_0_1.Op != OpConst16 {
19614                                         continue
19615                                 }
19616                                 c2 := auxIntToInt16(v_0_1.AuxInt)
19617                                 if v_1.Op != OpConst16 {
19618                                         continue
19619                                 }
19620                                 t := v_1.Type
19621                                 c1 := auxIntToInt16(v_1.AuxInt)
19622                                 if !(^(c1 | c2) == 0) {
19623                                         continue
19624                                 }
19625                                 v.reset(OpOr16)
19626                                 v0 := b.NewValue0(v.Pos, OpConst16, t)
19627                                 v0.AuxInt = int16ToAuxInt(c1)
19628                                 v.AddArg2(v0, x)
19629                                 return true
19630                         }
19631                 }
19632                 break
19633         }
19634         // match: (Or16 (Or16 i:(Const16 <t>) z) x)
19635         // cond: (z.Op != OpConst16 && x.Op != OpConst16)
19636         // result: (Or16 i (Or16 <t> z x))
19637         for {
19638                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19639                         if v_0.Op != OpOr16 {
19640                                 continue
19641                         }
19642                         _ = v_0.Args[1]
19643                         v_0_0 := v_0.Args[0]
19644                         v_0_1 := v_0.Args[1]
19645                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
19646                                 i := v_0_0
19647                                 if i.Op != OpConst16 {
19648                                         continue
19649                                 }
19650                                 t := i.Type
19651                                 z := v_0_1
19652                                 x := v_1
19653                                 if !(z.Op != OpConst16 && x.Op != OpConst16) {
19654                                         continue
19655                                 }
19656                                 v.reset(OpOr16)
19657                                 v0 := b.NewValue0(v.Pos, OpOr16, t)
19658                                 v0.AddArg2(z, x)
19659                                 v.AddArg2(i, v0)
19660                                 return true
19661                         }
19662                 }
19663                 break
19664         }
19665         // match: (Or16 (Const16 <t> [c]) (Or16 (Const16 <t> [d]) x))
19666         // result: (Or16 (Const16 <t> [c|d]) x)
19667         for {
19668                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19669                         if v_0.Op != OpConst16 {
19670                                 continue
19671                         }
19672                         t := v_0.Type
19673                         c := auxIntToInt16(v_0.AuxInt)
19674                         if v_1.Op != OpOr16 {
19675                                 continue
19676                         }
19677                         _ = v_1.Args[1]
19678                         v_1_0 := v_1.Args[0]
19679                         v_1_1 := v_1.Args[1]
19680                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
19681                                 if v_1_0.Op != OpConst16 || v_1_0.Type != t {
19682                                         continue
19683                                 }
19684                                 d := auxIntToInt16(v_1_0.AuxInt)
19685                                 x := v_1_1
19686                                 v.reset(OpOr16)
19687                                 v0 := b.NewValue0(v.Pos, OpConst16, t)
19688                                 v0.AuxInt = int16ToAuxInt(c | d)
19689                                 v.AddArg2(v0, x)
19690                                 return true
19691                         }
19692                 }
19693                 break
19694         }
19695         // match: (Or16 (Lsh16x64 x z:(Const64 <t> [c])) (Rsh16Ux64 x (Const64 [d])))
19696         // cond: c < 16 && d == 16-c && canRotate(config, 16)
19697         // result: (RotateLeft16 x z)
19698         for {
19699                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19700                         if v_0.Op != OpLsh16x64 {
19701                                 continue
19702                         }
19703                         _ = v_0.Args[1]
19704                         x := v_0.Args[0]
19705                         z := v_0.Args[1]
19706                         if z.Op != OpConst64 {
19707                                 continue
19708                         }
19709                         c := auxIntToInt64(z.AuxInt)
19710                         if v_1.Op != OpRsh16Ux64 {
19711                                 continue
19712                         }
19713                         _ = v_1.Args[1]
19714                         if x != v_1.Args[0] {
19715                                 continue
19716                         }
19717                         v_1_1 := v_1.Args[1]
19718                         if v_1_1.Op != OpConst64 {
19719                                 continue
19720                         }
19721                         d := auxIntToInt64(v_1_1.AuxInt)
19722                         if !(c < 16 && d == 16-c && canRotate(config, 16)) {
19723                                 continue
19724                         }
19725                         v.reset(OpRotateLeft16)
19726                         v.AddArg2(x, z)
19727                         return true
19728                 }
19729                 break
19730         }
19731         // match: (Or16 left:(Lsh16x64 x y) right:(Rsh16Ux64 x (Sub64 (Const64 [16]) y)))
19732         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
19733         // result: (RotateLeft16 x y)
19734         for {
19735                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19736                         left := v_0
19737                         if left.Op != OpLsh16x64 {
19738                                 continue
19739                         }
19740                         y := left.Args[1]
19741                         x := left.Args[0]
19742                         right := v_1
19743                         if right.Op != OpRsh16Ux64 {
19744                                 continue
19745                         }
19746                         _ = right.Args[1]
19747                         if x != right.Args[0] {
19748                                 continue
19749                         }
19750                         right_1 := right.Args[1]
19751                         if right_1.Op != OpSub64 {
19752                                 continue
19753                         }
19754                         _ = right_1.Args[1]
19755                         right_1_0 := right_1.Args[0]
19756                         if right_1_0.Op != OpConst64 || auxIntToInt64(right_1_0.AuxInt) != 16 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
19757                                 continue
19758                         }
19759                         v.reset(OpRotateLeft16)
19760                         v.AddArg2(x, y)
19761                         return true
19762                 }
19763                 break
19764         }
19765         // match: (Or16 left:(Lsh16x32 x y) right:(Rsh16Ux32 x (Sub32 (Const32 [16]) y)))
19766         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
19767         // result: (RotateLeft16 x y)
19768         for {
19769                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19770                         left := v_0
19771                         if left.Op != OpLsh16x32 {
19772                                 continue
19773                         }
19774                         y := left.Args[1]
19775                         x := left.Args[0]
19776                         right := v_1
19777                         if right.Op != OpRsh16Ux32 {
19778                                 continue
19779                         }
19780                         _ = right.Args[1]
19781                         if x != right.Args[0] {
19782                                 continue
19783                         }
19784                         right_1 := right.Args[1]
19785                         if right_1.Op != OpSub32 {
19786                                 continue
19787                         }
19788                         _ = right_1.Args[1]
19789                         right_1_0 := right_1.Args[0]
19790                         if right_1_0.Op != OpConst32 || auxIntToInt32(right_1_0.AuxInt) != 16 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
19791                                 continue
19792                         }
19793                         v.reset(OpRotateLeft16)
19794                         v.AddArg2(x, y)
19795                         return true
19796                 }
19797                 break
19798         }
19799         // match: (Or16 left:(Lsh16x16 x y) right:(Rsh16Ux16 x (Sub16 (Const16 [16]) y)))
19800         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
19801         // result: (RotateLeft16 x y)
19802         for {
19803                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19804                         left := v_0
19805                         if left.Op != OpLsh16x16 {
19806                                 continue
19807                         }
19808                         y := left.Args[1]
19809                         x := left.Args[0]
19810                         right := v_1
19811                         if right.Op != OpRsh16Ux16 {
19812                                 continue
19813                         }
19814                         _ = right.Args[1]
19815                         if x != right.Args[0] {
19816                                 continue
19817                         }
19818                         right_1 := right.Args[1]
19819                         if right_1.Op != OpSub16 {
19820                                 continue
19821                         }
19822                         _ = right_1.Args[1]
19823                         right_1_0 := right_1.Args[0]
19824                         if right_1_0.Op != OpConst16 || auxIntToInt16(right_1_0.AuxInt) != 16 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
19825                                 continue
19826                         }
19827                         v.reset(OpRotateLeft16)
19828                         v.AddArg2(x, y)
19829                         return true
19830                 }
19831                 break
19832         }
19833         // match: (Or16 left:(Lsh16x8 x y) right:(Rsh16Ux8 x (Sub8 (Const8 [16]) y)))
19834         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
19835         // result: (RotateLeft16 x y)
19836         for {
19837                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19838                         left := v_0
19839                         if left.Op != OpLsh16x8 {
19840                                 continue
19841                         }
19842                         y := left.Args[1]
19843                         x := left.Args[0]
19844                         right := v_1
19845                         if right.Op != OpRsh16Ux8 {
19846                                 continue
19847                         }
19848                         _ = right.Args[1]
19849                         if x != right.Args[0] {
19850                                 continue
19851                         }
19852                         right_1 := right.Args[1]
19853                         if right_1.Op != OpSub8 {
19854                                 continue
19855                         }
19856                         _ = right_1.Args[1]
19857                         right_1_0 := right_1.Args[0]
19858                         if right_1_0.Op != OpConst8 || auxIntToInt8(right_1_0.AuxInt) != 16 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
19859                                 continue
19860                         }
19861                         v.reset(OpRotateLeft16)
19862                         v.AddArg2(x, y)
19863                         return true
19864                 }
19865                 break
19866         }
19867         // match: (Or16 right:(Rsh16Ux64 x y) left:(Lsh16x64 x z:(Sub64 (Const64 [16]) y)))
19868         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
19869         // result: (RotateLeft16 x z)
19870         for {
19871                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19872                         right := v_0
19873                         if right.Op != OpRsh16Ux64 {
19874                                 continue
19875                         }
19876                         y := right.Args[1]
19877                         x := right.Args[0]
19878                         left := v_1
19879                         if left.Op != OpLsh16x64 {
19880                                 continue
19881                         }
19882                         _ = left.Args[1]
19883                         if x != left.Args[0] {
19884                                 continue
19885                         }
19886                         z := left.Args[1]
19887                         if z.Op != OpSub64 {
19888                                 continue
19889                         }
19890                         _ = z.Args[1]
19891                         z_0 := z.Args[0]
19892                         if z_0.Op != OpConst64 || auxIntToInt64(z_0.AuxInt) != 16 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
19893                                 continue
19894                         }
19895                         v.reset(OpRotateLeft16)
19896                         v.AddArg2(x, z)
19897                         return true
19898                 }
19899                 break
19900         }
19901         // match: (Or16 right:(Rsh16Ux32 x y) left:(Lsh16x32 x z:(Sub32 (Const32 [16]) y)))
19902         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
19903         // result: (RotateLeft16 x z)
19904         for {
19905                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19906                         right := v_0
19907                         if right.Op != OpRsh16Ux32 {
19908                                 continue
19909                         }
19910                         y := right.Args[1]
19911                         x := right.Args[0]
19912                         left := v_1
19913                         if left.Op != OpLsh16x32 {
19914                                 continue
19915                         }
19916                         _ = left.Args[1]
19917                         if x != left.Args[0] {
19918                                 continue
19919                         }
19920                         z := left.Args[1]
19921                         if z.Op != OpSub32 {
19922                                 continue
19923                         }
19924                         _ = z.Args[1]
19925                         z_0 := z.Args[0]
19926                         if z_0.Op != OpConst32 || auxIntToInt32(z_0.AuxInt) != 16 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
19927                                 continue
19928                         }
19929                         v.reset(OpRotateLeft16)
19930                         v.AddArg2(x, z)
19931                         return true
19932                 }
19933                 break
19934         }
19935         // match: (Or16 right:(Rsh16Ux16 x y) left:(Lsh16x16 x z:(Sub16 (Const16 [16]) y)))
19936         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
19937         // result: (RotateLeft16 x z)
19938         for {
19939                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19940                         right := v_0
19941                         if right.Op != OpRsh16Ux16 {
19942                                 continue
19943                         }
19944                         y := right.Args[1]
19945                         x := right.Args[0]
19946                         left := v_1
19947                         if left.Op != OpLsh16x16 {
19948                                 continue
19949                         }
19950                         _ = left.Args[1]
19951                         if x != left.Args[0] {
19952                                 continue
19953                         }
19954                         z := left.Args[1]
19955                         if z.Op != OpSub16 {
19956                                 continue
19957                         }
19958                         _ = z.Args[1]
19959                         z_0 := z.Args[0]
19960                         if z_0.Op != OpConst16 || auxIntToInt16(z_0.AuxInt) != 16 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
19961                                 continue
19962                         }
19963                         v.reset(OpRotateLeft16)
19964                         v.AddArg2(x, z)
19965                         return true
19966                 }
19967                 break
19968         }
19969         // match: (Or16 right:(Rsh16Ux8 x y) left:(Lsh16x8 x z:(Sub8 (Const8 [16]) y)))
19970         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
19971         // result: (RotateLeft16 x z)
19972         for {
19973                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
19974                         right := v_0
19975                         if right.Op != OpRsh16Ux8 {
19976                                 continue
19977                         }
19978                         y := right.Args[1]
19979                         x := right.Args[0]
19980                         left := v_1
19981                         if left.Op != OpLsh16x8 {
19982                                 continue
19983                         }
19984                         _ = left.Args[1]
19985                         if x != left.Args[0] {
19986                                 continue
19987                         }
19988                         z := left.Args[1]
19989                         if z.Op != OpSub8 {
19990                                 continue
19991                         }
19992                         _ = z.Args[1]
19993                         z_0 := z.Args[0]
19994                         if z_0.Op != OpConst8 || auxIntToInt8(z_0.AuxInt) != 16 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
19995                                 continue
19996                         }
19997                         v.reset(OpRotateLeft16)
19998                         v.AddArg2(x, z)
19999                         return true
20000                 }
20001                 break
20002         }
20003         return false
20004 }
20005 func rewriteValuegeneric_OpOr32(v *Value) bool {
20006         v_1 := v.Args[1]
20007         v_0 := v.Args[0]
20008         b := v.Block
20009         config := b.Func.Config
20010         // match: (Or32 (Const32 [c]) (Const32 [d]))
20011         // result: (Const32 [c|d])
20012         for {
20013                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20014                         if v_0.Op != OpConst32 {
20015                                 continue
20016                         }
20017                         c := auxIntToInt32(v_0.AuxInt)
20018                         if v_1.Op != OpConst32 {
20019                                 continue
20020                         }
20021                         d := auxIntToInt32(v_1.AuxInt)
20022                         v.reset(OpConst32)
20023                         v.AuxInt = int32ToAuxInt(c | d)
20024                         return true
20025                 }
20026                 break
20027         }
20028         // match: (Or32 <t> (Com32 x) (Com32 y))
20029         // result: (Com32 (And32 <t> x y))
20030         for {
20031                 t := v.Type
20032                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20033                         if v_0.Op != OpCom32 {
20034                                 continue
20035                         }
20036                         x := v_0.Args[0]
20037                         if v_1.Op != OpCom32 {
20038                                 continue
20039                         }
20040                         y := v_1.Args[0]
20041                         v.reset(OpCom32)
20042                         v0 := b.NewValue0(v.Pos, OpAnd32, t)
20043                         v0.AddArg2(x, y)
20044                         v.AddArg(v0)
20045                         return true
20046                 }
20047                 break
20048         }
20049         // match: (Or32 x x)
20050         // result: x
20051         for {
20052                 x := v_0
20053                 if x != v_1 {
20054                         break
20055                 }
20056                 v.copyOf(x)
20057                 return true
20058         }
20059         // match: (Or32 (Const32 [0]) x)
20060         // result: x
20061         for {
20062                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20063                         if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
20064                                 continue
20065                         }
20066                         x := v_1
20067                         v.copyOf(x)
20068                         return true
20069                 }
20070                 break
20071         }
20072         // match: (Or32 (Const32 [-1]) _)
20073         // result: (Const32 [-1])
20074         for {
20075                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20076                         if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != -1 {
20077                                 continue
20078                         }
20079                         v.reset(OpConst32)
20080                         v.AuxInt = int32ToAuxInt(-1)
20081                         return true
20082                 }
20083                 break
20084         }
20085         // match: (Or32 (Com32 x) x)
20086         // result: (Const32 [-1])
20087         for {
20088                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20089                         if v_0.Op != OpCom32 {
20090                                 continue
20091                         }
20092                         x := v_0.Args[0]
20093                         if x != v_1 {
20094                                 continue
20095                         }
20096                         v.reset(OpConst32)
20097                         v.AuxInt = int32ToAuxInt(-1)
20098                         return true
20099                 }
20100                 break
20101         }
20102         // match: (Or32 x (Or32 x y))
20103         // result: (Or32 x y)
20104         for {
20105                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20106                         x := v_0
20107                         if v_1.Op != OpOr32 {
20108                                 continue
20109                         }
20110                         _ = v_1.Args[1]
20111                         v_1_0 := v_1.Args[0]
20112                         v_1_1 := v_1.Args[1]
20113                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
20114                                 if x != v_1_0 {
20115                                         continue
20116                                 }
20117                                 y := v_1_1
20118                                 v.reset(OpOr32)
20119                                 v.AddArg2(x, y)
20120                                 return true
20121                         }
20122                 }
20123                 break
20124         }
20125         // match: (Or32 (And32 x (Const32 [c2])) (Const32 <t> [c1]))
20126         // cond: ^(c1 | c2) == 0
20127         // result: (Or32 (Const32 <t> [c1]) x)
20128         for {
20129                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20130                         if v_0.Op != OpAnd32 {
20131                                 continue
20132                         }
20133                         _ = v_0.Args[1]
20134                         v_0_0 := v_0.Args[0]
20135                         v_0_1 := v_0.Args[1]
20136                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
20137                                 x := v_0_0
20138                                 if v_0_1.Op != OpConst32 {
20139                                         continue
20140                                 }
20141                                 c2 := auxIntToInt32(v_0_1.AuxInt)
20142                                 if v_1.Op != OpConst32 {
20143                                         continue
20144                                 }
20145                                 t := v_1.Type
20146                                 c1 := auxIntToInt32(v_1.AuxInt)
20147                                 if !(^(c1 | c2) == 0) {
20148                                         continue
20149                                 }
20150                                 v.reset(OpOr32)
20151                                 v0 := b.NewValue0(v.Pos, OpConst32, t)
20152                                 v0.AuxInt = int32ToAuxInt(c1)
20153                                 v.AddArg2(v0, x)
20154                                 return true
20155                         }
20156                 }
20157                 break
20158         }
20159         // match: (Or32 (Or32 i:(Const32 <t>) z) x)
20160         // cond: (z.Op != OpConst32 && x.Op != OpConst32)
20161         // result: (Or32 i (Or32 <t> z x))
20162         for {
20163                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20164                         if v_0.Op != OpOr32 {
20165                                 continue
20166                         }
20167                         _ = v_0.Args[1]
20168                         v_0_0 := v_0.Args[0]
20169                         v_0_1 := v_0.Args[1]
20170                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
20171                                 i := v_0_0
20172                                 if i.Op != OpConst32 {
20173                                         continue
20174                                 }
20175                                 t := i.Type
20176                                 z := v_0_1
20177                                 x := v_1
20178                                 if !(z.Op != OpConst32 && x.Op != OpConst32) {
20179                                         continue
20180                                 }
20181                                 v.reset(OpOr32)
20182                                 v0 := b.NewValue0(v.Pos, OpOr32, t)
20183                                 v0.AddArg2(z, x)
20184                                 v.AddArg2(i, v0)
20185                                 return true
20186                         }
20187                 }
20188                 break
20189         }
20190         // match: (Or32 (Const32 <t> [c]) (Or32 (Const32 <t> [d]) x))
20191         // result: (Or32 (Const32 <t> [c|d]) x)
20192         for {
20193                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20194                         if v_0.Op != OpConst32 {
20195                                 continue
20196                         }
20197                         t := v_0.Type
20198                         c := auxIntToInt32(v_0.AuxInt)
20199                         if v_1.Op != OpOr32 {
20200                                 continue
20201                         }
20202                         _ = v_1.Args[1]
20203                         v_1_0 := v_1.Args[0]
20204                         v_1_1 := v_1.Args[1]
20205                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
20206                                 if v_1_0.Op != OpConst32 || v_1_0.Type != t {
20207                                         continue
20208                                 }
20209                                 d := auxIntToInt32(v_1_0.AuxInt)
20210                                 x := v_1_1
20211                                 v.reset(OpOr32)
20212                                 v0 := b.NewValue0(v.Pos, OpConst32, t)
20213                                 v0.AuxInt = int32ToAuxInt(c | d)
20214                                 v.AddArg2(v0, x)
20215                                 return true
20216                         }
20217                 }
20218                 break
20219         }
20220         // match: (Or32 (Lsh32x64 x z:(Const64 <t> [c])) (Rsh32Ux64 x (Const64 [d])))
20221         // cond: c < 32 && d == 32-c && canRotate(config, 32)
20222         // result: (RotateLeft32 x z)
20223         for {
20224                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20225                         if v_0.Op != OpLsh32x64 {
20226                                 continue
20227                         }
20228                         _ = v_0.Args[1]
20229                         x := v_0.Args[0]
20230                         z := v_0.Args[1]
20231                         if z.Op != OpConst64 {
20232                                 continue
20233                         }
20234                         c := auxIntToInt64(z.AuxInt)
20235                         if v_1.Op != OpRsh32Ux64 {
20236                                 continue
20237                         }
20238                         _ = v_1.Args[1]
20239                         if x != v_1.Args[0] {
20240                                 continue
20241                         }
20242                         v_1_1 := v_1.Args[1]
20243                         if v_1_1.Op != OpConst64 {
20244                                 continue
20245                         }
20246                         d := auxIntToInt64(v_1_1.AuxInt)
20247                         if !(c < 32 && d == 32-c && canRotate(config, 32)) {
20248                                 continue
20249                         }
20250                         v.reset(OpRotateLeft32)
20251                         v.AddArg2(x, z)
20252                         return true
20253                 }
20254                 break
20255         }
20256         // match: (Or32 left:(Lsh32x64 x y) right:(Rsh32Ux64 x (Sub64 (Const64 [32]) y)))
20257         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
20258         // result: (RotateLeft32 x y)
20259         for {
20260                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20261                         left := v_0
20262                         if left.Op != OpLsh32x64 {
20263                                 continue
20264                         }
20265                         y := left.Args[1]
20266                         x := left.Args[0]
20267                         right := v_1
20268                         if right.Op != OpRsh32Ux64 {
20269                                 continue
20270                         }
20271                         _ = right.Args[1]
20272                         if x != right.Args[0] {
20273                                 continue
20274                         }
20275                         right_1 := right.Args[1]
20276                         if right_1.Op != OpSub64 {
20277                                 continue
20278                         }
20279                         _ = right_1.Args[1]
20280                         right_1_0 := right_1.Args[0]
20281                         if right_1_0.Op != OpConst64 || auxIntToInt64(right_1_0.AuxInt) != 32 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
20282                                 continue
20283                         }
20284                         v.reset(OpRotateLeft32)
20285                         v.AddArg2(x, y)
20286                         return true
20287                 }
20288                 break
20289         }
20290         // match: (Or32 left:(Lsh32x32 x y) right:(Rsh32Ux32 x (Sub32 (Const32 [32]) y)))
20291         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
20292         // result: (RotateLeft32 x y)
20293         for {
20294                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20295                         left := v_0
20296                         if left.Op != OpLsh32x32 {
20297                                 continue
20298                         }
20299                         y := left.Args[1]
20300                         x := left.Args[0]
20301                         right := v_1
20302                         if right.Op != OpRsh32Ux32 {
20303                                 continue
20304                         }
20305                         _ = right.Args[1]
20306                         if x != right.Args[0] {
20307                                 continue
20308                         }
20309                         right_1 := right.Args[1]
20310                         if right_1.Op != OpSub32 {
20311                                 continue
20312                         }
20313                         _ = right_1.Args[1]
20314                         right_1_0 := right_1.Args[0]
20315                         if right_1_0.Op != OpConst32 || auxIntToInt32(right_1_0.AuxInt) != 32 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
20316                                 continue
20317                         }
20318                         v.reset(OpRotateLeft32)
20319                         v.AddArg2(x, y)
20320                         return true
20321                 }
20322                 break
20323         }
20324         // match: (Or32 left:(Lsh32x16 x y) right:(Rsh32Ux16 x (Sub16 (Const16 [32]) y)))
20325         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
20326         // result: (RotateLeft32 x y)
20327         for {
20328                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20329                         left := v_0
20330                         if left.Op != OpLsh32x16 {
20331                                 continue
20332                         }
20333                         y := left.Args[1]
20334                         x := left.Args[0]
20335                         right := v_1
20336                         if right.Op != OpRsh32Ux16 {
20337                                 continue
20338                         }
20339                         _ = right.Args[1]
20340                         if x != right.Args[0] {
20341                                 continue
20342                         }
20343                         right_1 := right.Args[1]
20344                         if right_1.Op != OpSub16 {
20345                                 continue
20346                         }
20347                         _ = right_1.Args[1]
20348                         right_1_0 := right_1.Args[0]
20349                         if right_1_0.Op != OpConst16 || auxIntToInt16(right_1_0.AuxInt) != 32 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
20350                                 continue
20351                         }
20352                         v.reset(OpRotateLeft32)
20353                         v.AddArg2(x, y)
20354                         return true
20355                 }
20356                 break
20357         }
20358         // match: (Or32 left:(Lsh32x8 x y) right:(Rsh32Ux8 x (Sub8 (Const8 [32]) y)))
20359         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
20360         // result: (RotateLeft32 x y)
20361         for {
20362                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20363                         left := v_0
20364                         if left.Op != OpLsh32x8 {
20365                                 continue
20366                         }
20367                         y := left.Args[1]
20368                         x := left.Args[0]
20369                         right := v_1
20370                         if right.Op != OpRsh32Ux8 {
20371                                 continue
20372                         }
20373                         _ = right.Args[1]
20374                         if x != right.Args[0] {
20375                                 continue
20376                         }
20377                         right_1 := right.Args[1]
20378                         if right_1.Op != OpSub8 {
20379                                 continue
20380                         }
20381                         _ = right_1.Args[1]
20382                         right_1_0 := right_1.Args[0]
20383                         if right_1_0.Op != OpConst8 || auxIntToInt8(right_1_0.AuxInt) != 32 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
20384                                 continue
20385                         }
20386                         v.reset(OpRotateLeft32)
20387                         v.AddArg2(x, y)
20388                         return true
20389                 }
20390                 break
20391         }
20392         // match: (Or32 right:(Rsh32Ux64 x y) left:(Lsh32x64 x z:(Sub64 (Const64 [32]) y)))
20393         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
20394         // result: (RotateLeft32 x z)
20395         for {
20396                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20397                         right := v_0
20398                         if right.Op != OpRsh32Ux64 {
20399                                 continue
20400                         }
20401                         y := right.Args[1]
20402                         x := right.Args[0]
20403                         left := v_1
20404                         if left.Op != OpLsh32x64 {
20405                                 continue
20406                         }
20407                         _ = left.Args[1]
20408                         if x != left.Args[0] {
20409                                 continue
20410                         }
20411                         z := left.Args[1]
20412                         if z.Op != OpSub64 {
20413                                 continue
20414                         }
20415                         _ = z.Args[1]
20416                         z_0 := z.Args[0]
20417                         if z_0.Op != OpConst64 || auxIntToInt64(z_0.AuxInt) != 32 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
20418                                 continue
20419                         }
20420                         v.reset(OpRotateLeft32)
20421                         v.AddArg2(x, z)
20422                         return true
20423                 }
20424                 break
20425         }
20426         // match: (Or32 right:(Rsh32Ux32 x y) left:(Lsh32x32 x z:(Sub32 (Const32 [32]) y)))
20427         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
20428         // result: (RotateLeft32 x z)
20429         for {
20430                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20431                         right := v_0
20432                         if right.Op != OpRsh32Ux32 {
20433                                 continue
20434                         }
20435                         y := right.Args[1]
20436                         x := right.Args[0]
20437                         left := v_1
20438                         if left.Op != OpLsh32x32 {
20439                                 continue
20440                         }
20441                         _ = left.Args[1]
20442                         if x != left.Args[0] {
20443                                 continue
20444                         }
20445                         z := left.Args[1]
20446                         if z.Op != OpSub32 {
20447                                 continue
20448                         }
20449                         _ = z.Args[1]
20450                         z_0 := z.Args[0]
20451                         if z_0.Op != OpConst32 || auxIntToInt32(z_0.AuxInt) != 32 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
20452                                 continue
20453                         }
20454                         v.reset(OpRotateLeft32)
20455                         v.AddArg2(x, z)
20456                         return true
20457                 }
20458                 break
20459         }
20460         // match: (Or32 right:(Rsh32Ux16 x y) left:(Lsh32x16 x z:(Sub16 (Const16 [32]) y)))
20461         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
20462         // result: (RotateLeft32 x z)
20463         for {
20464                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20465                         right := v_0
20466                         if right.Op != OpRsh32Ux16 {
20467                                 continue
20468                         }
20469                         y := right.Args[1]
20470                         x := right.Args[0]
20471                         left := v_1
20472                         if left.Op != OpLsh32x16 {
20473                                 continue
20474                         }
20475                         _ = left.Args[1]
20476                         if x != left.Args[0] {
20477                                 continue
20478                         }
20479                         z := left.Args[1]
20480                         if z.Op != OpSub16 {
20481                                 continue
20482                         }
20483                         _ = z.Args[1]
20484                         z_0 := z.Args[0]
20485                         if z_0.Op != OpConst16 || auxIntToInt16(z_0.AuxInt) != 32 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
20486                                 continue
20487                         }
20488                         v.reset(OpRotateLeft32)
20489                         v.AddArg2(x, z)
20490                         return true
20491                 }
20492                 break
20493         }
20494         // match: (Or32 right:(Rsh32Ux8 x y) left:(Lsh32x8 x z:(Sub8 (Const8 [32]) y)))
20495         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
20496         // result: (RotateLeft32 x z)
20497         for {
20498                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20499                         right := v_0
20500                         if right.Op != OpRsh32Ux8 {
20501                                 continue
20502                         }
20503                         y := right.Args[1]
20504                         x := right.Args[0]
20505                         left := v_1
20506                         if left.Op != OpLsh32x8 {
20507                                 continue
20508                         }
20509                         _ = left.Args[1]
20510                         if x != left.Args[0] {
20511                                 continue
20512                         }
20513                         z := left.Args[1]
20514                         if z.Op != OpSub8 {
20515                                 continue
20516                         }
20517                         _ = z.Args[1]
20518                         z_0 := z.Args[0]
20519                         if z_0.Op != OpConst8 || auxIntToInt8(z_0.AuxInt) != 32 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
20520                                 continue
20521                         }
20522                         v.reset(OpRotateLeft32)
20523                         v.AddArg2(x, z)
20524                         return true
20525                 }
20526                 break
20527         }
20528         return false
20529 }
20530 func rewriteValuegeneric_OpOr64(v *Value) bool {
20531         v_1 := v.Args[1]
20532         v_0 := v.Args[0]
20533         b := v.Block
20534         config := b.Func.Config
20535         // match: (Or64 (Const64 [c]) (Const64 [d]))
20536         // result: (Const64 [c|d])
20537         for {
20538                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20539                         if v_0.Op != OpConst64 {
20540                                 continue
20541                         }
20542                         c := auxIntToInt64(v_0.AuxInt)
20543                         if v_1.Op != OpConst64 {
20544                                 continue
20545                         }
20546                         d := auxIntToInt64(v_1.AuxInt)
20547                         v.reset(OpConst64)
20548                         v.AuxInt = int64ToAuxInt(c | d)
20549                         return true
20550                 }
20551                 break
20552         }
20553         // match: (Or64 <t> (Com64 x) (Com64 y))
20554         // result: (Com64 (And64 <t> x y))
20555         for {
20556                 t := v.Type
20557                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20558                         if v_0.Op != OpCom64 {
20559                                 continue
20560                         }
20561                         x := v_0.Args[0]
20562                         if v_1.Op != OpCom64 {
20563                                 continue
20564                         }
20565                         y := v_1.Args[0]
20566                         v.reset(OpCom64)
20567                         v0 := b.NewValue0(v.Pos, OpAnd64, t)
20568                         v0.AddArg2(x, y)
20569                         v.AddArg(v0)
20570                         return true
20571                 }
20572                 break
20573         }
20574         // match: (Or64 x x)
20575         // result: x
20576         for {
20577                 x := v_0
20578                 if x != v_1 {
20579                         break
20580                 }
20581                 v.copyOf(x)
20582                 return true
20583         }
20584         // match: (Or64 (Const64 [0]) x)
20585         // result: x
20586         for {
20587                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20588                         if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
20589                                 continue
20590                         }
20591                         x := v_1
20592                         v.copyOf(x)
20593                         return true
20594                 }
20595                 break
20596         }
20597         // match: (Or64 (Const64 [-1]) _)
20598         // result: (Const64 [-1])
20599         for {
20600                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20601                         if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != -1 {
20602                                 continue
20603                         }
20604                         v.reset(OpConst64)
20605                         v.AuxInt = int64ToAuxInt(-1)
20606                         return true
20607                 }
20608                 break
20609         }
20610         // match: (Or64 (Com64 x) x)
20611         // result: (Const64 [-1])
20612         for {
20613                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20614                         if v_0.Op != OpCom64 {
20615                                 continue
20616                         }
20617                         x := v_0.Args[0]
20618                         if x != v_1 {
20619                                 continue
20620                         }
20621                         v.reset(OpConst64)
20622                         v.AuxInt = int64ToAuxInt(-1)
20623                         return true
20624                 }
20625                 break
20626         }
20627         // match: (Or64 x (Or64 x y))
20628         // result: (Or64 x y)
20629         for {
20630                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20631                         x := v_0
20632                         if v_1.Op != OpOr64 {
20633                                 continue
20634                         }
20635                         _ = v_1.Args[1]
20636                         v_1_0 := v_1.Args[0]
20637                         v_1_1 := v_1.Args[1]
20638                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
20639                                 if x != v_1_0 {
20640                                         continue
20641                                 }
20642                                 y := v_1_1
20643                                 v.reset(OpOr64)
20644                                 v.AddArg2(x, y)
20645                                 return true
20646                         }
20647                 }
20648                 break
20649         }
20650         // match: (Or64 (And64 x (Const64 [c2])) (Const64 <t> [c1]))
20651         // cond: ^(c1 | c2) == 0
20652         // result: (Or64 (Const64 <t> [c1]) x)
20653         for {
20654                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20655                         if v_0.Op != OpAnd64 {
20656                                 continue
20657                         }
20658                         _ = v_0.Args[1]
20659                         v_0_0 := v_0.Args[0]
20660                         v_0_1 := v_0.Args[1]
20661                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
20662                                 x := v_0_0
20663                                 if v_0_1.Op != OpConst64 {
20664                                         continue
20665                                 }
20666                                 c2 := auxIntToInt64(v_0_1.AuxInt)
20667                                 if v_1.Op != OpConst64 {
20668                                         continue
20669                                 }
20670                                 t := v_1.Type
20671                                 c1 := auxIntToInt64(v_1.AuxInt)
20672                                 if !(^(c1 | c2) == 0) {
20673                                         continue
20674                                 }
20675                                 v.reset(OpOr64)
20676                                 v0 := b.NewValue0(v.Pos, OpConst64, t)
20677                                 v0.AuxInt = int64ToAuxInt(c1)
20678                                 v.AddArg2(v0, x)
20679                                 return true
20680                         }
20681                 }
20682                 break
20683         }
20684         // match: (Or64 (Or64 i:(Const64 <t>) z) x)
20685         // cond: (z.Op != OpConst64 && x.Op != OpConst64)
20686         // result: (Or64 i (Or64 <t> z x))
20687         for {
20688                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20689                         if v_0.Op != OpOr64 {
20690                                 continue
20691                         }
20692                         _ = v_0.Args[1]
20693                         v_0_0 := v_0.Args[0]
20694                         v_0_1 := v_0.Args[1]
20695                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
20696                                 i := v_0_0
20697                                 if i.Op != OpConst64 {
20698                                         continue
20699                                 }
20700                                 t := i.Type
20701                                 z := v_0_1
20702                                 x := v_1
20703                                 if !(z.Op != OpConst64 && x.Op != OpConst64) {
20704                                         continue
20705                                 }
20706                                 v.reset(OpOr64)
20707                                 v0 := b.NewValue0(v.Pos, OpOr64, t)
20708                                 v0.AddArg2(z, x)
20709                                 v.AddArg2(i, v0)
20710                                 return true
20711                         }
20712                 }
20713                 break
20714         }
20715         // match: (Or64 (Const64 <t> [c]) (Or64 (Const64 <t> [d]) x))
20716         // result: (Or64 (Const64 <t> [c|d]) x)
20717         for {
20718                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20719                         if v_0.Op != OpConst64 {
20720                                 continue
20721                         }
20722                         t := v_0.Type
20723                         c := auxIntToInt64(v_0.AuxInt)
20724                         if v_1.Op != OpOr64 {
20725                                 continue
20726                         }
20727                         _ = v_1.Args[1]
20728                         v_1_0 := v_1.Args[0]
20729                         v_1_1 := v_1.Args[1]
20730                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
20731                                 if v_1_0.Op != OpConst64 || v_1_0.Type != t {
20732                                         continue
20733                                 }
20734                                 d := auxIntToInt64(v_1_0.AuxInt)
20735                                 x := v_1_1
20736                                 v.reset(OpOr64)
20737                                 v0 := b.NewValue0(v.Pos, OpConst64, t)
20738                                 v0.AuxInt = int64ToAuxInt(c | d)
20739                                 v.AddArg2(v0, x)
20740                                 return true
20741                         }
20742                 }
20743                 break
20744         }
20745         // match: (Or64 (Lsh64x64 x z:(Const64 <t> [c])) (Rsh64Ux64 x (Const64 [d])))
20746         // cond: c < 64 && d == 64-c && canRotate(config, 64)
20747         // result: (RotateLeft64 x z)
20748         for {
20749                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20750                         if v_0.Op != OpLsh64x64 {
20751                                 continue
20752                         }
20753                         _ = v_0.Args[1]
20754                         x := v_0.Args[0]
20755                         z := v_0.Args[1]
20756                         if z.Op != OpConst64 {
20757                                 continue
20758                         }
20759                         c := auxIntToInt64(z.AuxInt)
20760                         if v_1.Op != OpRsh64Ux64 {
20761                                 continue
20762                         }
20763                         _ = v_1.Args[1]
20764                         if x != v_1.Args[0] {
20765                                 continue
20766                         }
20767                         v_1_1 := v_1.Args[1]
20768                         if v_1_1.Op != OpConst64 {
20769                                 continue
20770                         }
20771                         d := auxIntToInt64(v_1_1.AuxInt)
20772                         if !(c < 64 && d == 64-c && canRotate(config, 64)) {
20773                                 continue
20774                         }
20775                         v.reset(OpRotateLeft64)
20776                         v.AddArg2(x, z)
20777                         return true
20778                 }
20779                 break
20780         }
20781         // match: (Or64 left:(Lsh64x64 x y) right:(Rsh64Ux64 x (Sub64 (Const64 [64]) y)))
20782         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
20783         // result: (RotateLeft64 x y)
20784         for {
20785                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20786                         left := v_0
20787                         if left.Op != OpLsh64x64 {
20788                                 continue
20789                         }
20790                         y := left.Args[1]
20791                         x := left.Args[0]
20792                         right := v_1
20793                         if right.Op != OpRsh64Ux64 {
20794                                 continue
20795                         }
20796                         _ = right.Args[1]
20797                         if x != right.Args[0] {
20798                                 continue
20799                         }
20800                         right_1 := right.Args[1]
20801                         if right_1.Op != OpSub64 {
20802                                 continue
20803                         }
20804                         _ = right_1.Args[1]
20805                         right_1_0 := right_1.Args[0]
20806                         if right_1_0.Op != OpConst64 || auxIntToInt64(right_1_0.AuxInt) != 64 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
20807                                 continue
20808                         }
20809                         v.reset(OpRotateLeft64)
20810                         v.AddArg2(x, y)
20811                         return true
20812                 }
20813                 break
20814         }
20815         // match: (Or64 left:(Lsh64x32 x y) right:(Rsh64Ux32 x (Sub32 (Const32 [64]) y)))
20816         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
20817         // result: (RotateLeft64 x y)
20818         for {
20819                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20820                         left := v_0
20821                         if left.Op != OpLsh64x32 {
20822                                 continue
20823                         }
20824                         y := left.Args[1]
20825                         x := left.Args[0]
20826                         right := v_1
20827                         if right.Op != OpRsh64Ux32 {
20828                                 continue
20829                         }
20830                         _ = right.Args[1]
20831                         if x != right.Args[0] {
20832                                 continue
20833                         }
20834                         right_1 := right.Args[1]
20835                         if right_1.Op != OpSub32 {
20836                                 continue
20837                         }
20838                         _ = right_1.Args[1]
20839                         right_1_0 := right_1.Args[0]
20840                         if right_1_0.Op != OpConst32 || auxIntToInt32(right_1_0.AuxInt) != 64 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
20841                                 continue
20842                         }
20843                         v.reset(OpRotateLeft64)
20844                         v.AddArg2(x, y)
20845                         return true
20846                 }
20847                 break
20848         }
20849         // match: (Or64 left:(Lsh64x16 x y) right:(Rsh64Ux16 x (Sub16 (Const16 [64]) y)))
20850         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
20851         // result: (RotateLeft64 x y)
20852         for {
20853                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20854                         left := v_0
20855                         if left.Op != OpLsh64x16 {
20856                                 continue
20857                         }
20858                         y := left.Args[1]
20859                         x := left.Args[0]
20860                         right := v_1
20861                         if right.Op != OpRsh64Ux16 {
20862                                 continue
20863                         }
20864                         _ = right.Args[1]
20865                         if x != right.Args[0] {
20866                                 continue
20867                         }
20868                         right_1 := right.Args[1]
20869                         if right_1.Op != OpSub16 {
20870                                 continue
20871                         }
20872                         _ = right_1.Args[1]
20873                         right_1_0 := right_1.Args[0]
20874                         if right_1_0.Op != OpConst16 || auxIntToInt16(right_1_0.AuxInt) != 64 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
20875                                 continue
20876                         }
20877                         v.reset(OpRotateLeft64)
20878                         v.AddArg2(x, y)
20879                         return true
20880                 }
20881                 break
20882         }
20883         // match: (Or64 left:(Lsh64x8 x y) right:(Rsh64Ux8 x (Sub8 (Const8 [64]) y)))
20884         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
20885         // result: (RotateLeft64 x y)
20886         for {
20887                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20888                         left := v_0
20889                         if left.Op != OpLsh64x8 {
20890                                 continue
20891                         }
20892                         y := left.Args[1]
20893                         x := left.Args[0]
20894                         right := v_1
20895                         if right.Op != OpRsh64Ux8 {
20896                                 continue
20897                         }
20898                         _ = right.Args[1]
20899                         if x != right.Args[0] {
20900                                 continue
20901                         }
20902                         right_1 := right.Args[1]
20903                         if right_1.Op != OpSub8 {
20904                                 continue
20905                         }
20906                         _ = right_1.Args[1]
20907                         right_1_0 := right_1.Args[0]
20908                         if right_1_0.Op != OpConst8 || auxIntToInt8(right_1_0.AuxInt) != 64 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
20909                                 continue
20910                         }
20911                         v.reset(OpRotateLeft64)
20912                         v.AddArg2(x, y)
20913                         return true
20914                 }
20915                 break
20916         }
20917         // match: (Or64 right:(Rsh64Ux64 x y) left:(Lsh64x64 x z:(Sub64 (Const64 [64]) y)))
20918         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
20919         // result: (RotateLeft64 x z)
20920         for {
20921                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20922                         right := v_0
20923                         if right.Op != OpRsh64Ux64 {
20924                                 continue
20925                         }
20926                         y := right.Args[1]
20927                         x := right.Args[0]
20928                         left := v_1
20929                         if left.Op != OpLsh64x64 {
20930                                 continue
20931                         }
20932                         _ = left.Args[1]
20933                         if x != left.Args[0] {
20934                                 continue
20935                         }
20936                         z := left.Args[1]
20937                         if z.Op != OpSub64 {
20938                                 continue
20939                         }
20940                         _ = z.Args[1]
20941                         z_0 := z.Args[0]
20942                         if z_0.Op != OpConst64 || auxIntToInt64(z_0.AuxInt) != 64 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
20943                                 continue
20944                         }
20945                         v.reset(OpRotateLeft64)
20946                         v.AddArg2(x, z)
20947                         return true
20948                 }
20949                 break
20950         }
20951         // match: (Or64 right:(Rsh64Ux32 x y) left:(Lsh64x32 x z:(Sub32 (Const32 [64]) y)))
20952         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
20953         // result: (RotateLeft64 x z)
20954         for {
20955                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20956                         right := v_0
20957                         if right.Op != OpRsh64Ux32 {
20958                                 continue
20959                         }
20960                         y := right.Args[1]
20961                         x := right.Args[0]
20962                         left := v_1
20963                         if left.Op != OpLsh64x32 {
20964                                 continue
20965                         }
20966                         _ = left.Args[1]
20967                         if x != left.Args[0] {
20968                                 continue
20969                         }
20970                         z := left.Args[1]
20971                         if z.Op != OpSub32 {
20972                                 continue
20973                         }
20974                         _ = z.Args[1]
20975                         z_0 := z.Args[0]
20976                         if z_0.Op != OpConst32 || auxIntToInt32(z_0.AuxInt) != 64 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
20977                                 continue
20978                         }
20979                         v.reset(OpRotateLeft64)
20980                         v.AddArg2(x, z)
20981                         return true
20982                 }
20983                 break
20984         }
20985         // match: (Or64 right:(Rsh64Ux16 x y) left:(Lsh64x16 x z:(Sub16 (Const16 [64]) y)))
20986         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
20987         // result: (RotateLeft64 x z)
20988         for {
20989                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
20990                         right := v_0
20991                         if right.Op != OpRsh64Ux16 {
20992                                 continue
20993                         }
20994                         y := right.Args[1]
20995                         x := right.Args[0]
20996                         left := v_1
20997                         if left.Op != OpLsh64x16 {
20998                                 continue
20999                         }
21000                         _ = left.Args[1]
21001                         if x != left.Args[0] {
21002                                 continue
21003                         }
21004                         z := left.Args[1]
21005                         if z.Op != OpSub16 {
21006                                 continue
21007                         }
21008                         _ = z.Args[1]
21009                         z_0 := z.Args[0]
21010                         if z_0.Op != OpConst16 || auxIntToInt16(z_0.AuxInt) != 64 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
21011                                 continue
21012                         }
21013                         v.reset(OpRotateLeft64)
21014                         v.AddArg2(x, z)
21015                         return true
21016                 }
21017                 break
21018         }
21019         // match: (Or64 right:(Rsh64Ux8 x y) left:(Lsh64x8 x z:(Sub8 (Const8 [64]) y)))
21020         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
21021         // result: (RotateLeft64 x z)
21022         for {
21023                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21024                         right := v_0
21025                         if right.Op != OpRsh64Ux8 {
21026                                 continue
21027                         }
21028                         y := right.Args[1]
21029                         x := right.Args[0]
21030                         left := v_1
21031                         if left.Op != OpLsh64x8 {
21032                                 continue
21033                         }
21034                         _ = left.Args[1]
21035                         if x != left.Args[0] {
21036                                 continue
21037                         }
21038                         z := left.Args[1]
21039                         if z.Op != OpSub8 {
21040                                 continue
21041                         }
21042                         _ = z.Args[1]
21043                         z_0 := z.Args[0]
21044                         if z_0.Op != OpConst8 || auxIntToInt8(z_0.AuxInt) != 64 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
21045                                 continue
21046                         }
21047                         v.reset(OpRotateLeft64)
21048                         v.AddArg2(x, z)
21049                         return true
21050                 }
21051                 break
21052         }
21053         return false
21054 }
21055 func rewriteValuegeneric_OpOr8(v *Value) bool {
21056         v_1 := v.Args[1]
21057         v_0 := v.Args[0]
21058         b := v.Block
21059         config := b.Func.Config
21060         // match: (Or8 (Const8 [c]) (Const8 [d]))
21061         // result: (Const8 [c|d])
21062         for {
21063                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21064                         if v_0.Op != OpConst8 {
21065                                 continue
21066                         }
21067                         c := auxIntToInt8(v_0.AuxInt)
21068                         if v_1.Op != OpConst8 {
21069                                 continue
21070                         }
21071                         d := auxIntToInt8(v_1.AuxInt)
21072                         v.reset(OpConst8)
21073                         v.AuxInt = int8ToAuxInt(c | d)
21074                         return true
21075                 }
21076                 break
21077         }
21078         // match: (Or8 <t> (Com8 x) (Com8 y))
21079         // result: (Com8 (And8 <t> x y))
21080         for {
21081                 t := v.Type
21082                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21083                         if v_0.Op != OpCom8 {
21084                                 continue
21085                         }
21086                         x := v_0.Args[0]
21087                         if v_1.Op != OpCom8 {
21088                                 continue
21089                         }
21090                         y := v_1.Args[0]
21091                         v.reset(OpCom8)
21092                         v0 := b.NewValue0(v.Pos, OpAnd8, t)
21093                         v0.AddArg2(x, y)
21094                         v.AddArg(v0)
21095                         return true
21096                 }
21097                 break
21098         }
21099         // match: (Or8 x x)
21100         // result: x
21101         for {
21102                 x := v_0
21103                 if x != v_1 {
21104                         break
21105                 }
21106                 v.copyOf(x)
21107                 return true
21108         }
21109         // match: (Or8 (Const8 [0]) x)
21110         // result: x
21111         for {
21112                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21113                         if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
21114                                 continue
21115                         }
21116                         x := v_1
21117                         v.copyOf(x)
21118                         return true
21119                 }
21120                 break
21121         }
21122         // match: (Or8 (Const8 [-1]) _)
21123         // result: (Const8 [-1])
21124         for {
21125                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21126                         if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != -1 {
21127                                 continue
21128                         }
21129                         v.reset(OpConst8)
21130                         v.AuxInt = int8ToAuxInt(-1)
21131                         return true
21132                 }
21133                 break
21134         }
21135         // match: (Or8 (Com8 x) x)
21136         // result: (Const8 [-1])
21137         for {
21138                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21139                         if v_0.Op != OpCom8 {
21140                                 continue
21141                         }
21142                         x := v_0.Args[0]
21143                         if x != v_1 {
21144                                 continue
21145                         }
21146                         v.reset(OpConst8)
21147                         v.AuxInt = int8ToAuxInt(-1)
21148                         return true
21149                 }
21150                 break
21151         }
21152         // match: (Or8 x (Or8 x y))
21153         // result: (Or8 x y)
21154         for {
21155                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21156                         x := v_0
21157                         if v_1.Op != OpOr8 {
21158                                 continue
21159                         }
21160                         _ = v_1.Args[1]
21161                         v_1_0 := v_1.Args[0]
21162                         v_1_1 := v_1.Args[1]
21163                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
21164                                 if x != v_1_0 {
21165                                         continue
21166                                 }
21167                                 y := v_1_1
21168                                 v.reset(OpOr8)
21169                                 v.AddArg2(x, y)
21170                                 return true
21171                         }
21172                 }
21173                 break
21174         }
21175         // match: (Or8 (And8 x (Const8 [c2])) (Const8 <t> [c1]))
21176         // cond: ^(c1 | c2) == 0
21177         // result: (Or8 (Const8 <t> [c1]) x)
21178         for {
21179                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21180                         if v_0.Op != OpAnd8 {
21181                                 continue
21182                         }
21183                         _ = v_0.Args[1]
21184                         v_0_0 := v_0.Args[0]
21185                         v_0_1 := v_0.Args[1]
21186                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
21187                                 x := v_0_0
21188                                 if v_0_1.Op != OpConst8 {
21189                                         continue
21190                                 }
21191                                 c2 := auxIntToInt8(v_0_1.AuxInt)
21192                                 if v_1.Op != OpConst8 {
21193                                         continue
21194                                 }
21195                                 t := v_1.Type
21196                                 c1 := auxIntToInt8(v_1.AuxInt)
21197                                 if !(^(c1 | c2) == 0) {
21198                                         continue
21199                                 }
21200                                 v.reset(OpOr8)
21201                                 v0 := b.NewValue0(v.Pos, OpConst8, t)
21202                                 v0.AuxInt = int8ToAuxInt(c1)
21203                                 v.AddArg2(v0, x)
21204                                 return true
21205                         }
21206                 }
21207                 break
21208         }
21209         // match: (Or8 (Or8 i:(Const8 <t>) z) x)
21210         // cond: (z.Op != OpConst8 && x.Op != OpConst8)
21211         // result: (Or8 i (Or8 <t> z x))
21212         for {
21213                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21214                         if v_0.Op != OpOr8 {
21215                                 continue
21216                         }
21217                         _ = v_0.Args[1]
21218                         v_0_0 := v_0.Args[0]
21219                         v_0_1 := v_0.Args[1]
21220                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
21221                                 i := v_0_0
21222                                 if i.Op != OpConst8 {
21223                                         continue
21224                                 }
21225                                 t := i.Type
21226                                 z := v_0_1
21227                                 x := v_1
21228                                 if !(z.Op != OpConst8 && x.Op != OpConst8) {
21229                                         continue
21230                                 }
21231                                 v.reset(OpOr8)
21232                                 v0 := b.NewValue0(v.Pos, OpOr8, t)
21233                                 v0.AddArg2(z, x)
21234                                 v.AddArg2(i, v0)
21235                                 return true
21236                         }
21237                 }
21238                 break
21239         }
21240         // match: (Or8 (Const8 <t> [c]) (Or8 (Const8 <t> [d]) x))
21241         // result: (Or8 (Const8 <t> [c|d]) x)
21242         for {
21243                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21244                         if v_0.Op != OpConst8 {
21245                                 continue
21246                         }
21247                         t := v_0.Type
21248                         c := auxIntToInt8(v_0.AuxInt)
21249                         if v_1.Op != OpOr8 {
21250                                 continue
21251                         }
21252                         _ = v_1.Args[1]
21253                         v_1_0 := v_1.Args[0]
21254                         v_1_1 := v_1.Args[1]
21255                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
21256                                 if v_1_0.Op != OpConst8 || v_1_0.Type != t {
21257                                         continue
21258                                 }
21259                                 d := auxIntToInt8(v_1_0.AuxInt)
21260                                 x := v_1_1
21261                                 v.reset(OpOr8)
21262                                 v0 := b.NewValue0(v.Pos, OpConst8, t)
21263                                 v0.AuxInt = int8ToAuxInt(c | d)
21264                                 v.AddArg2(v0, x)
21265                                 return true
21266                         }
21267                 }
21268                 break
21269         }
21270         // match: (Or8 (Lsh8x64 x z:(Const64 <t> [c])) (Rsh8Ux64 x (Const64 [d])))
21271         // cond: c < 8 && d == 8-c && canRotate(config, 8)
21272         // result: (RotateLeft8 x z)
21273         for {
21274                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21275                         if v_0.Op != OpLsh8x64 {
21276                                 continue
21277                         }
21278                         _ = v_0.Args[1]
21279                         x := v_0.Args[0]
21280                         z := v_0.Args[1]
21281                         if z.Op != OpConst64 {
21282                                 continue
21283                         }
21284                         c := auxIntToInt64(z.AuxInt)
21285                         if v_1.Op != OpRsh8Ux64 {
21286                                 continue
21287                         }
21288                         _ = v_1.Args[1]
21289                         if x != v_1.Args[0] {
21290                                 continue
21291                         }
21292                         v_1_1 := v_1.Args[1]
21293                         if v_1_1.Op != OpConst64 {
21294                                 continue
21295                         }
21296                         d := auxIntToInt64(v_1_1.AuxInt)
21297                         if !(c < 8 && d == 8-c && canRotate(config, 8)) {
21298                                 continue
21299                         }
21300                         v.reset(OpRotateLeft8)
21301                         v.AddArg2(x, z)
21302                         return true
21303                 }
21304                 break
21305         }
21306         // match: (Or8 left:(Lsh8x64 x y) right:(Rsh8Ux64 x (Sub64 (Const64 [8]) y)))
21307         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
21308         // result: (RotateLeft8 x y)
21309         for {
21310                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21311                         left := v_0
21312                         if left.Op != OpLsh8x64 {
21313                                 continue
21314                         }
21315                         y := left.Args[1]
21316                         x := left.Args[0]
21317                         right := v_1
21318                         if right.Op != OpRsh8Ux64 {
21319                                 continue
21320                         }
21321                         _ = right.Args[1]
21322                         if x != right.Args[0] {
21323                                 continue
21324                         }
21325                         right_1 := right.Args[1]
21326                         if right_1.Op != OpSub64 {
21327                                 continue
21328                         }
21329                         _ = right_1.Args[1]
21330                         right_1_0 := right_1.Args[0]
21331                         if right_1_0.Op != OpConst64 || auxIntToInt64(right_1_0.AuxInt) != 8 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
21332                                 continue
21333                         }
21334                         v.reset(OpRotateLeft8)
21335                         v.AddArg2(x, y)
21336                         return true
21337                 }
21338                 break
21339         }
21340         // match: (Or8 left:(Lsh8x32 x y) right:(Rsh8Ux32 x (Sub32 (Const32 [8]) y)))
21341         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
21342         // result: (RotateLeft8 x y)
21343         for {
21344                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21345                         left := v_0
21346                         if left.Op != OpLsh8x32 {
21347                                 continue
21348                         }
21349                         y := left.Args[1]
21350                         x := left.Args[0]
21351                         right := v_1
21352                         if right.Op != OpRsh8Ux32 {
21353                                 continue
21354                         }
21355                         _ = right.Args[1]
21356                         if x != right.Args[0] {
21357                                 continue
21358                         }
21359                         right_1 := right.Args[1]
21360                         if right_1.Op != OpSub32 {
21361                                 continue
21362                         }
21363                         _ = right_1.Args[1]
21364                         right_1_0 := right_1.Args[0]
21365                         if right_1_0.Op != OpConst32 || auxIntToInt32(right_1_0.AuxInt) != 8 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
21366                                 continue
21367                         }
21368                         v.reset(OpRotateLeft8)
21369                         v.AddArg2(x, y)
21370                         return true
21371                 }
21372                 break
21373         }
21374         // match: (Or8 left:(Lsh8x16 x y) right:(Rsh8Ux16 x (Sub16 (Const16 [8]) y)))
21375         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
21376         // result: (RotateLeft8 x y)
21377         for {
21378                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21379                         left := v_0
21380                         if left.Op != OpLsh8x16 {
21381                                 continue
21382                         }
21383                         y := left.Args[1]
21384                         x := left.Args[0]
21385                         right := v_1
21386                         if right.Op != OpRsh8Ux16 {
21387                                 continue
21388                         }
21389                         _ = right.Args[1]
21390                         if x != right.Args[0] {
21391                                 continue
21392                         }
21393                         right_1 := right.Args[1]
21394                         if right_1.Op != OpSub16 {
21395                                 continue
21396                         }
21397                         _ = right_1.Args[1]
21398                         right_1_0 := right_1.Args[0]
21399                         if right_1_0.Op != OpConst16 || auxIntToInt16(right_1_0.AuxInt) != 8 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
21400                                 continue
21401                         }
21402                         v.reset(OpRotateLeft8)
21403                         v.AddArg2(x, y)
21404                         return true
21405                 }
21406                 break
21407         }
21408         // match: (Or8 left:(Lsh8x8 x y) right:(Rsh8Ux8 x (Sub8 (Const8 [8]) y)))
21409         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
21410         // result: (RotateLeft8 x y)
21411         for {
21412                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21413                         left := v_0
21414                         if left.Op != OpLsh8x8 {
21415                                 continue
21416                         }
21417                         y := left.Args[1]
21418                         x := left.Args[0]
21419                         right := v_1
21420                         if right.Op != OpRsh8Ux8 {
21421                                 continue
21422                         }
21423                         _ = right.Args[1]
21424                         if x != right.Args[0] {
21425                                 continue
21426                         }
21427                         right_1 := right.Args[1]
21428                         if right_1.Op != OpSub8 {
21429                                 continue
21430                         }
21431                         _ = right_1.Args[1]
21432                         right_1_0 := right_1.Args[0]
21433                         if right_1_0.Op != OpConst8 || auxIntToInt8(right_1_0.AuxInt) != 8 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
21434                                 continue
21435                         }
21436                         v.reset(OpRotateLeft8)
21437                         v.AddArg2(x, y)
21438                         return true
21439                 }
21440                 break
21441         }
21442         // match: (Or8 right:(Rsh8Ux64 x y) left:(Lsh8x64 x z:(Sub64 (Const64 [8]) y)))
21443         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
21444         // result: (RotateLeft8 x z)
21445         for {
21446                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21447                         right := v_0
21448                         if right.Op != OpRsh8Ux64 {
21449                                 continue
21450                         }
21451                         y := right.Args[1]
21452                         x := right.Args[0]
21453                         left := v_1
21454                         if left.Op != OpLsh8x64 {
21455                                 continue
21456                         }
21457                         _ = left.Args[1]
21458                         if x != left.Args[0] {
21459                                 continue
21460                         }
21461                         z := left.Args[1]
21462                         if z.Op != OpSub64 {
21463                                 continue
21464                         }
21465                         _ = z.Args[1]
21466                         z_0 := z.Args[0]
21467                         if z_0.Op != OpConst64 || auxIntToInt64(z_0.AuxInt) != 8 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
21468                                 continue
21469                         }
21470                         v.reset(OpRotateLeft8)
21471                         v.AddArg2(x, z)
21472                         return true
21473                 }
21474                 break
21475         }
21476         // match: (Or8 right:(Rsh8Ux32 x y) left:(Lsh8x32 x z:(Sub32 (Const32 [8]) y)))
21477         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
21478         // result: (RotateLeft8 x z)
21479         for {
21480                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21481                         right := v_0
21482                         if right.Op != OpRsh8Ux32 {
21483                                 continue
21484                         }
21485                         y := right.Args[1]
21486                         x := right.Args[0]
21487                         left := v_1
21488                         if left.Op != OpLsh8x32 {
21489                                 continue
21490                         }
21491                         _ = left.Args[1]
21492                         if x != left.Args[0] {
21493                                 continue
21494                         }
21495                         z := left.Args[1]
21496                         if z.Op != OpSub32 {
21497                                 continue
21498                         }
21499                         _ = z.Args[1]
21500                         z_0 := z.Args[0]
21501                         if z_0.Op != OpConst32 || auxIntToInt32(z_0.AuxInt) != 8 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
21502                                 continue
21503                         }
21504                         v.reset(OpRotateLeft8)
21505                         v.AddArg2(x, z)
21506                         return true
21507                 }
21508                 break
21509         }
21510         // match: (Or8 right:(Rsh8Ux16 x y) left:(Lsh8x16 x z:(Sub16 (Const16 [8]) y)))
21511         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
21512         // result: (RotateLeft8 x z)
21513         for {
21514                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21515                         right := v_0
21516                         if right.Op != OpRsh8Ux16 {
21517                                 continue
21518                         }
21519                         y := right.Args[1]
21520                         x := right.Args[0]
21521                         left := v_1
21522                         if left.Op != OpLsh8x16 {
21523                                 continue
21524                         }
21525                         _ = left.Args[1]
21526                         if x != left.Args[0] {
21527                                 continue
21528                         }
21529                         z := left.Args[1]
21530                         if z.Op != OpSub16 {
21531                                 continue
21532                         }
21533                         _ = z.Args[1]
21534                         z_0 := z.Args[0]
21535                         if z_0.Op != OpConst16 || auxIntToInt16(z_0.AuxInt) != 8 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
21536                                 continue
21537                         }
21538                         v.reset(OpRotateLeft8)
21539                         v.AddArg2(x, z)
21540                         return true
21541                 }
21542                 break
21543         }
21544         // match: (Or8 right:(Rsh8Ux8 x y) left:(Lsh8x8 x z:(Sub8 (Const8 [8]) y)))
21545         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
21546         // result: (RotateLeft8 x z)
21547         for {
21548                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21549                         right := v_0
21550                         if right.Op != OpRsh8Ux8 {
21551                                 continue
21552                         }
21553                         y := right.Args[1]
21554                         x := right.Args[0]
21555                         left := v_1
21556                         if left.Op != OpLsh8x8 {
21557                                 continue
21558                         }
21559                         _ = left.Args[1]
21560                         if x != left.Args[0] {
21561                                 continue
21562                         }
21563                         z := left.Args[1]
21564                         if z.Op != OpSub8 {
21565                                 continue
21566                         }
21567                         _ = z.Args[1]
21568                         z_0 := z.Args[0]
21569                         if z_0.Op != OpConst8 || auxIntToInt8(z_0.AuxInt) != 8 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
21570                                 continue
21571                         }
21572                         v.reset(OpRotateLeft8)
21573                         v.AddArg2(x, z)
21574                         return true
21575                 }
21576                 break
21577         }
21578         return false
21579 }
21580 func rewriteValuegeneric_OpOrB(v *Value) bool {
21581         v_1 := v.Args[1]
21582         v_0 := v.Args[0]
21583         b := v.Block
21584         // match: (OrB (Less64 (Const64 [c]) x) (Less64 x (Const64 [d])))
21585         // cond: c >= d
21586         // result: (Less64U (Const64 <x.Type> [c-d]) (Sub64 <x.Type> x (Const64 <x.Type> [d])))
21587         for {
21588                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21589                         if v_0.Op != OpLess64 {
21590                                 continue
21591                         }
21592                         x := v_0.Args[1]
21593                         v_0_0 := v_0.Args[0]
21594                         if v_0_0.Op != OpConst64 {
21595                                 continue
21596                         }
21597                         c := auxIntToInt64(v_0_0.AuxInt)
21598                         if v_1.Op != OpLess64 {
21599                                 continue
21600                         }
21601                         _ = v_1.Args[1]
21602                         if x != v_1.Args[0] {
21603                                 continue
21604                         }
21605                         v_1_1 := v_1.Args[1]
21606                         if v_1_1.Op != OpConst64 {
21607                                 continue
21608                         }
21609                         d := auxIntToInt64(v_1_1.AuxInt)
21610                         if !(c >= d) {
21611                                 continue
21612                         }
21613                         v.reset(OpLess64U)
21614                         v0 := b.NewValue0(v.Pos, OpConst64, x.Type)
21615                         v0.AuxInt = int64ToAuxInt(c - d)
21616                         v1 := b.NewValue0(v.Pos, OpSub64, x.Type)
21617                         v2 := b.NewValue0(v.Pos, OpConst64, x.Type)
21618                         v2.AuxInt = int64ToAuxInt(d)
21619                         v1.AddArg2(x, v2)
21620                         v.AddArg2(v0, v1)
21621                         return true
21622                 }
21623                 break
21624         }
21625         // match: (OrB (Leq64 (Const64 [c]) x) (Less64 x (Const64 [d])))
21626         // cond: c >= d
21627         // result: (Leq64U (Const64 <x.Type> [c-d]) (Sub64 <x.Type> x (Const64 <x.Type> [d])))
21628         for {
21629                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21630                         if v_0.Op != OpLeq64 {
21631                                 continue
21632                         }
21633                         x := v_0.Args[1]
21634                         v_0_0 := v_0.Args[0]
21635                         if v_0_0.Op != OpConst64 {
21636                                 continue
21637                         }
21638                         c := auxIntToInt64(v_0_0.AuxInt)
21639                         if v_1.Op != OpLess64 {
21640                                 continue
21641                         }
21642                         _ = v_1.Args[1]
21643                         if x != v_1.Args[0] {
21644                                 continue
21645                         }
21646                         v_1_1 := v_1.Args[1]
21647                         if v_1_1.Op != OpConst64 {
21648                                 continue
21649                         }
21650                         d := auxIntToInt64(v_1_1.AuxInt)
21651                         if !(c >= d) {
21652                                 continue
21653                         }
21654                         v.reset(OpLeq64U)
21655                         v0 := b.NewValue0(v.Pos, OpConst64, x.Type)
21656                         v0.AuxInt = int64ToAuxInt(c - d)
21657                         v1 := b.NewValue0(v.Pos, OpSub64, x.Type)
21658                         v2 := b.NewValue0(v.Pos, OpConst64, x.Type)
21659                         v2.AuxInt = int64ToAuxInt(d)
21660                         v1.AddArg2(x, v2)
21661                         v.AddArg2(v0, v1)
21662                         return true
21663                 }
21664                 break
21665         }
21666         // match: (OrB (Less32 (Const32 [c]) x) (Less32 x (Const32 [d])))
21667         // cond: c >= d
21668         // result: (Less32U (Const32 <x.Type> [c-d]) (Sub32 <x.Type> x (Const32 <x.Type> [d])))
21669         for {
21670                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21671                         if v_0.Op != OpLess32 {
21672                                 continue
21673                         }
21674                         x := v_0.Args[1]
21675                         v_0_0 := v_0.Args[0]
21676                         if v_0_0.Op != OpConst32 {
21677                                 continue
21678                         }
21679                         c := auxIntToInt32(v_0_0.AuxInt)
21680                         if v_1.Op != OpLess32 {
21681                                 continue
21682                         }
21683                         _ = v_1.Args[1]
21684                         if x != v_1.Args[0] {
21685                                 continue
21686                         }
21687                         v_1_1 := v_1.Args[1]
21688                         if v_1_1.Op != OpConst32 {
21689                                 continue
21690                         }
21691                         d := auxIntToInt32(v_1_1.AuxInt)
21692                         if !(c >= d) {
21693                                 continue
21694                         }
21695                         v.reset(OpLess32U)
21696                         v0 := b.NewValue0(v.Pos, OpConst32, x.Type)
21697                         v0.AuxInt = int32ToAuxInt(c - d)
21698                         v1 := b.NewValue0(v.Pos, OpSub32, x.Type)
21699                         v2 := b.NewValue0(v.Pos, OpConst32, x.Type)
21700                         v2.AuxInt = int32ToAuxInt(d)
21701                         v1.AddArg2(x, v2)
21702                         v.AddArg2(v0, v1)
21703                         return true
21704                 }
21705                 break
21706         }
21707         // match: (OrB (Leq32 (Const32 [c]) x) (Less32 x (Const32 [d])))
21708         // cond: c >= d
21709         // result: (Leq32U (Const32 <x.Type> [c-d]) (Sub32 <x.Type> x (Const32 <x.Type> [d])))
21710         for {
21711                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21712                         if v_0.Op != OpLeq32 {
21713                                 continue
21714                         }
21715                         x := v_0.Args[1]
21716                         v_0_0 := v_0.Args[0]
21717                         if v_0_0.Op != OpConst32 {
21718                                 continue
21719                         }
21720                         c := auxIntToInt32(v_0_0.AuxInt)
21721                         if v_1.Op != OpLess32 {
21722                                 continue
21723                         }
21724                         _ = v_1.Args[1]
21725                         if x != v_1.Args[0] {
21726                                 continue
21727                         }
21728                         v_1_1 := v_1.Args[1]
21729                         if v_1_1.Op != OpConst32 {
21730                                 continue
21731                         }
21732                         d := auxIntToInt32(v_1_1.AuxInt)
21733                         if !(c >= d) {
21734                                 continue
21735                         }
21736                         v.reset(OpLeq32U)
21737                         v0 := b.NewValue0(v.Pos, OpConst32, x.Type)
21738                         v0.AuxInt = int32ToAuxInt(c - d)
21739                         v1 := b.NewValue0(v.Pos, OpSub32, x.Type)
21740                         v2 := b.NewValue0(v.Pos, OpConst32, x.Type)
21741                         v2.AuxInt = int32ToAuxInt(d)
21742                         v1.AddArg2(x, v2)
21743                         v.AddArg2(v0, v1)
21744                         return true
21745                 }
21746                 break
21747         }
21748         // match: (OrB (Less16 (Const16 [c]) x) (Less16 x (Const16 [d])))
21749         // cond: c >= d
21750         // result: (Less16U (Const16 <x.Type> [c-d]) (Sub16 <x.Type> x (Const16 <x.Type> [d])))
21751         for {
21752                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21753                         if v_0.Op != OpLess16 {
21754                                 continue
21755                         }
21756                         x := v_0.Args[1]
21757                         v_0_0 := v_0.Args[0]
21758                         if v_0_0.Op != OpConst16 {
21759                                 continue
21760                         }
21761                         c := auxIntToInt16(v_0_0.AuxInt)
21762                         if v_1.Op != OpLess16 {
21763                                 continue
21764                         }
21765                         _ = v_1.Args[1]
21766                         if x != v_1.Args[0] {
21767                                 continue
21768                         }
21769                         v_1_1 := v_1.Args[1]
21770                         if v_1_1.Op != OpConst16 {
21771                                 continue
21772                         }
21773                         d := auxIntToInt16(v_1_1.AuxInt)
21774                         if !(c >= d) {
21775                                 continue
21776                         }
21777                         v.reset(OpLess16U)
21778                         v0 := b.NewValue0(v.Pos, OpConst16, x.Type)
21779                         v0.AuxInt = int16ToAuxInt(c - d)
21780                         v1 := b.NewValue0(v.Pos, OpSub16, x.Type)
21781                         v2 := b.NewValue0(v.Pos, OpConst16, x.Type)
21782                         v2.AuxInt = int16ToAuxInt(d)
21783                         v1.AddArg2(x, v2)
21784                         v.AddArg2(v0, v1)
21785                         return true
21786                 }
21787                 break
21788         }
21789         // match: (OrB (Leq16 (Const16 [c]) x) (Less16 x (Const16 [d])))
21790         // cond: c >= d
21791         // result: (Leq16U (Const16 <x.Type> [c-d]) (Sub16 <x.Type> x (Const16 <x.Type> [d])))
21792         for {
21793                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21794                         if v_0.Op != OpLeq16 {
21795                                 continue
21796                         }
21797                         x := v_0.Args[1]
21798                         v_0_0 := v_0.Args[0]
21799                         if v_0_0.Op != OpConst16 {
21800                                 continue
21801                         }
21802                         c := auxIntToInt16(v_0_0.AuxInt)
21803                         if v_1.Op != OpLess16 {
21804                                 continue
21805                         }
21806                         _ = v_1.Args[1]
21807                         if x != v_1.Args[0] {
21808                                 continue
21809                         }
21810                         v_1_1 := v_1.Args[1]
21811                         if v_1_1.Op != OpConst16 {
21812                                 continue
21813                         }
21814                         d := auxIntToInt16(v_1_1.AuxInt)
21815                         if !(c >= d) {
21816                                 continue
21817                         }
21818                         v.reset(OpLeq16U)
21819                         v0 := b.NewValue0(v.Pos, OpConst16, x.Type)
21820                         v0.AuxInt = int16ToAuxInt(c - d)
21821                         v1 := b.NewValue0(v.Pos, OpSub16, x.Type)
21822                         v2 := b.NewValue0(v.Pos, OpConst16, x.Type)
21823                         v2.AuxInt = int16ToAuxInt(d)
21824                         v1.AddArg2(x, v2)
21825                         v.AddArg2(v0, v1)
21826                         return true
21827                 }
21828                 break
21829         }
21830         // match: (OrB (Less8 (Const8 [c]) x) (Less8 x (Const8 [d])))
21831         // cond: c >= d
21832         // result: (Less8U (Const8 <x.Type> [c-d]) (Sub8 <x.Type> x (Const8 <x.Type> [d])))
21833         for {
21834                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21835                         if v_0.Op != OpLess8 {
21836                                 continue
21837                         }
21838                         x := v_0.Args[1]
21839                         v_0_0 := v_0.Args[0]
21840                         if v_0_0.Op != OpConst8 {
21841                                 continue
21842                         }
21843                         c := auxIntToInt8(v_0_0.AuxInt)
21844                         if v_1.Op != OpLess8 {
21845                                 continue
21846                         }
21847                         _ = v_1.Args[1]
21848                         if x != v_1.Args[0] {
21849                                 continue
21850                         }
21851                         v_1_1 := v_1.Args[1]
21852                         if v_1_1.Op != OpConst8 {
21853                                 continue
21854                         }
21855                         d := auxIntToInt8(v_1_1.AuxInt)
21856                         if !(c >= d) {
21857                                 continue
21858                         }
21859                         v.reset(OpLess8U)
21860                         v0 := b.NewValue0(v.Pos, OpConst8, x.Type)
21861                         v0.AuxInt = int8ToAuxInt(c - d)
21862                         v1 := b.NewValue0(v.Pos, OpSub8, x.Type)
21863                         v2 := b.NewValue0(v.Pos, OpConst8, x.Type)
21864                         v2.AuxInt = int8ToAuxInt(d)
21865                         v1.AddArg2(x, v2)
21866                         v.AddArg2(v0, v1)
21867                         return true
21868                 }
21869                 break
21870         }
21871         // match: (OrB (Leq8 (Const8 [c]) x) (Less8 x (Const8 [d])))
21872         // cond: c >= d
21873         // result: (Leq8U (Const8 <x.Type> [c-d]) (Sub8 <x.Type> x (Const8 <x.Type> [d])))
21874         for {
21875                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21876                         if v_0.Op != OpLeq8 {
21877                                 continue
21878                         }
21879                         x := v_0.Args[1]
21880                         v_0_0 := v_0.Args[0]
21881                         if v_0_0.Op != OpConst8 {
21882                                 continue
21883                         }
21884                         c := auxIntToInt8(v_0_0.AuxInt)
21885                         if v_1.Op != OpLess8 {
21886                                 continue
21887                         }
21888                         _ = v_1.Args[1]
21889                         if x != v_1.Args[0] {
21890                                 continue
21891                         }
21892                         v_1_1 := v_1.Args[1]
21893                         if v_1_1.Op != OpConst8 {
21894                                 continue
21895                         }
21896                         d := auxIntToInt8(v_1_1.AuxInt)
21897                         if !(c >= d) {
21898                                 continue
21899                         }
21900                         v.reset(OpLeq8U)
21901                         v0 := b.NewValue0(v.Pos, OpConst8, x.Type)
21902                         v0.AuxInt = int8ToAuxInt(c - d)
21903                         v1 := b.NewValue0(v.Pos, OpSub8, x.Type)
21904                         v2 := b.NewValue0(v.Pos, OpConst8, x.Type)
21905                         v2.AuxInt = int8ToAuxInt(d)
21906                         v1.AddArg2(x, v2)
21907                         v.AddArg2(v0, v1)
21908                         return true
21909                 }
21910                 break
21911         }
21912         // match: (OrB (Less64 (Const64 [c]) x) (Leq64 x (Const64 [d])))
21913         // cond: c >= d+1 && d+1 > d
21914         // result: (Less64U (Const64 <x.Type> [c-d-1]) (Sub64 <x.Type> x (Const64 <x.Type> [d+1])))
21915         for {
21916                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21917                         if v_0.Op != OpLess64 {
21918                                 continue
21919                         }
21920                         x := v_0.Args[1]
21921                         v_0_0 := v_0.Args[0]
21922                         if v_0_0.Op != OpConst64 {
21923                                 continue
21924                         }
21925                         c := auxIntToInt64(v_0_0.AuxInt)
21926                         if v_1.Op != OpLeq64 {
21927                                 continue
21928                         }
21929                         _ = v_1.Args[1]
21930                         if x != v_1.Args[0] {
21931                                 continue
21932                         }
21933                         v_1_1 := v_1.Args[1]
21934                         if v_1_1.Op != OpConst64 {
21935                                 continue
21936                         }
21937                         d := auxIntToInt64(v_1_1.AuxInt)
21938                         if !(c >= d+1 && d+1 > d) {
21939                                 continue
21940                         }
21941                         v.reset(OpLess64U)
21942                         v0 := b.NewValue0(v.Pos, OpConst64, x.Type)
21943                         v0.AuxInt = int64ToAuxInt(c - d - 1)
21944                         v1 := b.NewValue0(v.Pos, OpSub64, x.Type)
21945                         v2 := b.NewValue0(v.Pos, OpConst64, x.Type)
21946                         v2.AuxInt = int64ToAuxInt(d + 1)
21947                         v1.AddArg2(x, v2)
21948                         v.AddArg2(v0, v1)
21949                         return true
21950                 }
21951                 break
21952         }
21953         // match: (OrB (Leq64 (Const64 [c]) x) (Leq64 x (Const64 [d])))
21954         // cond: c >= d+1 && d+1 > d
21955         // result: (Leq64U (Const64 <x.Type> [c-d-1]) (Sub64 <x.Type> x (Const64 <x.Type> [d+1])))
21956         for {
21957                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21958                         if v_0.Op != OpLeq64 {
21959                                 continue
21960                         }
21961                         x := v_0.Args[1]
21962                         v_0_0 := v_0.Args[0]
21963                         if v_0_0.Op != OpConst64 {
21964                                 continue
21965                         }
21966                         c := auxIntToInt64(v_0_0.AuxInt)
21967                         if v_1.Op != OpLeq64 {
21968                                 continue
21969                         }
21970                         _ = v_1.Args[1]
21971                         if x != v_1.Args[0] {
21972                                 continue
21973                         }
21974                         v_1_1 := v_1.Args[1]
21975                         if v_1_1.Op != OpConst64 {
21976                                 continue
21977                         }
21978                         d := auxIntToInt64(v_1_1.AuxInt)
21979                         if !(c >= d+1 && d+1 > d) {
21980                                 continue
21981                         }
21982                         v.reset(OpLeq64U)
21983                         v0 := b.NewValue0(v.Pos, OpConst64, x.Type)
21984                         v0.AuxInt = int64ToAuxInt(c - d - 1)
21985                         v1 := b.NewValue0(v.Pos, OpSub64, x.Type)
21986                         v2 := b.NewValue0(v.Pos, OpConst64, x.Type)
21987                         v2.AuxInt = int64ToAuxInt(d + 1)
21988                         v1.AddArg2(x, v2)
21989                         v.AddArg2(v0, v1)
21990                         return true
21991                 }
21992                 break
21993         }
21994         // match: (OrB (Less32 (Const32 [c]) x) (Leq32 x (Const32 [d])))
21995         // cond: c >= d+1 && d+1 > d
21996         // result: (Less32U (Const32 <x.Type> [c-d-1]) (Sub32 <x.Type> x (Const32 <x.Type> [d+1])))
21997         for {
21998                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
21999                         if v_0.Op != OpLess32 {
22000                                 continue
22001                         }
22002                         x := v_0.Args[1]
22003                         v_0_0 := v_0.Args[0]
22004                         if v_0_0.Op != OpConst32 {
22005                                 continue
22006                         }
22007                         c := auxIntToInt32(v_0_0.AuxInt)
22008                         if v_1.Op != OpLeq32 {
22009                                 continue
22010                         }
22011                         _ = v_1.Args[1]
22012                         if x != v_1.Args[0] {
22013                                 continue
22014                         }
22015                         v_1_1 := v_1.Args[1]
22016                         if v_1_1.Op != OpConst32 {
22017                                 continue
22018                         }
22019                         d := auxIntToInt32(v_1_1.AuxInt)
22020                         if !(c >= d+1 && d+1 > d) {
22021                                 continue
22022                         }
22023                         v.reset(OpLess32U)
22024                         v0 := b.NewValue0(v.Pos, OpConst32, x.Type)
22025                         v0.AuxInt = int32ToAuxInt(c - d - 1)
22026                         v1 := b.NewValue0(v.Pos, OpSub32, x.Type)
22027                         v2 := b.NewValue0(v.Pos, OpConst32, x.Type)
22028                         v2.AuxInt = int32ToAuxInt(d + 1)
22029                         v1.AddArg2(x, v2)
22030                         v.AddArg2(v0, v1)
22031                         return true
22032                 }
22033                 break
22034         }
22035         // match: (OrB (Leq32 (Const32 [c]) x) (Leq32 x (Const32 [d])))
22036         // cond: c >= d+1 && d+1 > d
22037         // result: (Leq32U (Const32 <x.Type> [c-d-1]) (Sub32 <x.Type> x (Const32 <x.Type> [d+1])))
22038         for {
22039                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22040                         if v_0.Op != OpLeq32 {
22041                                 continue
22042                         }
22043                         x := v_0.Args[1]
22044                         v_0_0 := v_0.Args[0]
22045                         if v_0_0.Op != OpConst32 {
22046                                 continue
22047                         }
22048                         c := auxIntToInt32(v_0_0.AuxInt)
22049                         if v_1.Op != OpLeq32 {
22050                                 continue
22051                         }
22052                         _ = v_1.Args[1]
22053                         if x != v_1.Args[0] {
22054                                 continue
22055                         }
22056                         v_1_1 := v_1.Args[1]
22057                         if v_1_1.Op != OpConst32 {
22058                                 continue
22059                         }
22060                         d := auxIntToInt32(v_1_1.AuxInt)
22061                         if !(c >= d+1 && d+1 > d) {
22062                                 continue
22063                         }
22064                         v.reset(OpLeq32U)
22065                         v0 := b.NewValue0(v.Pos, OpConst32, x.Type)
22066                         v0.AuxInt = int32ToAuxInt(c - d - 1)
22067                         v1 := b.NewValue0(v.Pos, OpSub32, x.Type)
22068                         v2 := b.NewValue0(v.Pos, OpConst32, x.Type)
22069                         v2.AuxInt = int32ToAuxInt(d + 1)
22070                         v1.AddArg2(x, v2)
22071                         v.AddArg2(v0, v1)
22072                         return true
22073                 }
22074                 break
22075         }
22076         // match: (OrB (Less16 (Const16 [c]) x) (Leq16 x (Const16 [d])))
22077         // cond: c >= d+1 && d+1 > d
22078         // result: (Less16U (Const16 <x.Type> [c-d-1]) (Sub16 <x.Type> x (Const16 <x.Type> [d+1])))
22079         for {
22080                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22081                         if v_0.Op != OpLess16 {
22082                                 continue
22083                         }
22084                         x := v_0.Args[1]
22085                         v_0_0 := v_0.Args[0]
22086                         if v_0_0.Op != OpConst16 {
22087                                 continue
22088                         }
22089                         c := auxIntToInt16(v_0_0.AuxInt)
22090                         if v_1.Op != OpLeq16 {
22091                                 continue
22092                         }
22093                         _ = v_1.Args[1]
22094                         if x != v_1.Args[0] {
22095                                 continue
22096                         }
22097                         v_1_1 := v_1.Args[1]
22098                         if v_1_1.Op != OpConst16 {
22099                                 continue
22100                         }
22101                         d := auxIntToInt16(v_1_1.AuxInt)
22102                         if !(c >= d+1 && d+1 > d) {
22103                                 continue
22104                         }
22105                         v.reset(OpLess16U)
22106                         v0 := b.NewValue0(v.Pos, OpConst16, x.Type)
22107                         v0.AuxInt = int16ToAuxInt(c - d - 1)
22108                         v1 := b.NewValue0(v.Pos, OpSub16, x.Type)
22109                         v2 := b.NewValue0(v.Pos, OpConst16, x.Type)
22110                         v2.AuxInt = int16ToAuxInt(d + 1)
22111                         v1.AddArg2(x, v2)
22112                         v.AddArg2(v0, v1)
22113                         return true
22114                 }
22115                 break
22116         }
22117         // match: (OrB (Leq16 (Const16 [c]) x) (Leq16 x (Const16 [d])))
22118         // cond: c >= d+1 && d+1 > d
22119         // result: (Leq16U (Const16 <x.Type> [c-d-1]) (Sub16 <x.Type> x (Const16 <x.Type> [d+1])))
22120         for {
22121                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22122                         if v_0.Op != OpLeq16 {
22123                                 continue
22124                         }
22125                         x := v_0.Args[1]
22126                         v_0_0 := v_0.Args[0]
22127                         if v_0_0.Op != OpConst16 {
22128                                 continue
22129                         }
22130                         c := auxIntToInt16(v_0_0.AuxInt)
22131                         if v_1.Op != OpLeq16 {
22132                                 continue
22133                         }
22134                         _ = v_1.Args[1]
22135                         if x != v_1.Args[0] {
22136                                 continue
22137                         }
22138                         v_1_1 := v_1.Args[1]
22139                         if v_1_1.Op != OpConst16 {
22140                                 continue
22141                         }
22142                         d := auxIntToInt16(v_1_1.AuxInt)
22143                         if !(c >= d+1 && d+1 > d) {
22144                                 continue
22145                         }
22146                         v.reset(OpLeq16U)
22147                         v0 := b.NewValue0(v.Pos, OpConst16, x.Type)
22148                         v0.AuxInt = int16ToAuxInt(c - d - 1)
22149                         v1 := b.NewValue0(v.Pos, OpSub16, x.Type)
22150                         v2 := b.NewValue0(v.Pos, OpConst16, x.Type)
22151                         v2.AuxInt = int16ToAuxInt(d + 1)
22152                         v1.AddArg2(x, v2)
22153                         v.AddArg2(v0, v1)
22154                         return true
22155                 }
22156                 break
22157         }
22158         // match: (OrB (Less8 (Const8 [c]) x) (Leq8 x (Const8 [d])))
22159         // cond: c >= d+1 && d+1 > d
22160         // result: (Less8U (Const8 <x.Type> [c-d-1]) (Sub8 <x.Type> x (Const8 <x.Type> [d+1])))
22161         for {
22162                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22163                         if v_0.Op != OpLess8 {
22164                                 continue
22165                         }
22166                         x := v_0.Args[1]
22167                         v_0_0 := v_0.Args[0]
22168                         if v_0_0.Op != OpConst8 {
22169                                 continue
22170                         }
22171                         c := auxIntToInt8(v_0_0.AuxInt)
22172                         if v_1.Op != OpLeq8 {
22173                                 continue
22174                         }
22175                         _ = v_1.Args[1]
22176                         if x != v_1.Args[0] {
22177                                 continue
22178                         }
22179                         v_1_1 := v_1.Args[1]
22180                         if v_1_1.Op != OpConst8 {
22181                                 continue
22182                         }
22183                         d := auxIntToInt8(v_1_1.AuxInt)
22184                         if !(c >= d+1 && d+1 > d) {
22185                                 continue
22186                         }
22187                         v.reset(OpLess8U)
22188                         v0 := b.NewValue0(v.Pos, OpConst8, x.Type)
22189                         v0.AuxInt = int8ToAuxInt(c - d - 1)
22190                         v1 := b.NewValue0(v.Pos, OpSub8, x.Type)
22191                         v2 := b.NewValue0(v.Pos, OpConst8, x.Type)
22192                         v2.AuxInt = int8ToAuxInt(d + 1)
22193                         v1.AddArg2(x, v2)
22194                         v.AddArg2(v0, v1)
22195                         return true
22196                 }
22197                 break
22198         }
22199         // match: (OrB (Leq8 (Const8 [c]) x) (Leq8 x (Const8 [d])))
22200         // cond: c >= d+1 && d+1 > d
22201         // result: (Leq8U (Const8 <x.Type> [c-d-1]) (Sub8 <x.Type> x (Const8 <x.Type> [d+1])))
22202         for {
22203                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22204                         if v_0.Op != OpLeq8 {
22205                                 continue
22206                         }
22207                         x := v_0.Args[1]
22208                         v_0_0 := v_0.Args[0]
22209                         if v_0_0.Op != OpConst8 {
22210                                 continue
22211                         }
22212                         c := auxIntToInt8(v_0_0.AuxInt)
22213                         if v_1.Op != OpLeq8 {
22214                                 continue
22215                         }
22216                         _ = v_1.Args[1]
22217                         if x != v_1.Args[0] {
22218                                 continue
22219                         }
22220                         v_1_1 := v_1.Args[1]
22221                         if v_1_1.Op != OpConst8 {
22222                                 continue
22223                         }
22224                         d := auxIntToInt8(v_1_1.AuxInt)
22225                         if !(c >= d+1 && d+1 > d) {
22226                                 continue
22227                         }
22228                         v.reset(OpLeq8U)
22229                         v0 := b.NewValue0(v.Pos, OpConst8, x.Type)
22230                         v0.AuxInt = int8ToAuxInt(c - d - 1)
22231                         v1 := b.NewValue0(v.Pos, OpSub8, x.Type)
22232                         v2 := b.NewValue0(v.Pos, OpConst8, x.Type)
22233                         v2.AuxInt = int8ToAuxInt(d + 1)
22234                         v1.AddArg2(x, v2)
22235                         v.AddArg2(v0, v1)
22236                         return true
22237                 }
22238                 break
22239         }
22240         // match: (OrB (Less64U (Const64 [c]) x) (Less64U x (Const64 [d])))
22241         // cond: uint64(c) >= uint64(d)
22242         // result: (Less64U (Const64 <x.Type> [c-d]) (Sub64 <x.Type> x (Const64 <x.Type> [d])))
22243         for {
22244                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22245                         if v_0.Op != OpLess64U {
22246                                 continue
22247                         }
22248                         x := v_0.Args[1]
22249                         v_0_0 := v_0.Args[0]
22250                         if v_0_0.Op != OpConst64 {
22251                                 continue
22252                         }
22253                         c := auxIntToInt64(v_0_0.AuxInt)
22254                         if v_1.Op != OpLess64U {
22255                                 continue
22256                         }
22257                         _ = v_1.Args[1]
22258                         if x != v_1.Args[0] {
22259                                 continue
22260                         }
22261                         v_1_1 := v_1.Args[1]
22262                         if v_1_1.Op != OpConst64 {
22263                                 continue
22264                         }
22265                         d := auxIntToInt64(v_1_1.AuxInt)
22266                         if !(uint64(c) >= uint64(d)) {
22267                                 continue
22268                         }
22269                         v.reset(OpLess64U)
22270                         v0 := b.NewValue0(v.Pos, OpConst64, x.Type)
22271                         v0.AuxInt = int64ToAuxInt(c - d)
22272                         v1 := b.NewValue0(v.Pos, OpSub64, x.Type)
22273                         v2 := b.NewValue0(v.Pos, OpConst64, x.Type)
22274                         v2.AuxInt = int64ToAuxInt(d)
22275                         v1.AddArg2(x, v2)
22276                         v.AddArg2(v0, v1)
22277                         return true
22278                 }
22279                 break
22280         }
22281         // match: (OrB (Leq64U (Const64 [c]) x) (Less64U x (Const64 [d])))
22282         // cond: uint64(c) >= uint64(d)
22283         // result: (Leq64U (Const64 <x.Type> [c-d]) (Sub64 <x.Type> x (Const64 <x.Type> [d])))
22284         for {
22285                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22286                         if v_0.Op != OpLeq64U {
22287                                 continue
22288                         }
22289                         x := v_0.Args[1]
22290                         v_0_0 := v_0.Args[0]
22291                         if v_0_0.Op != OpConst64 {
22292                                 continue
22293                         }
22294                         c := auxIntToInt64(v_0_0.AuxInt)
22295                         if v_1.Op != OpLess64U {
22296                                 continue
22297                         }
22298                         _ = v_1.Args[1]
22299                         if x != v_1.Args[0] {
22300                                 continue
22301                         }
22302                         v_1_1 := v_1.Args[1]
22303                         if v_1_1.Op != OpConst64 {
22304                                 continue
22305                         }
22306                         d := auxIntToInt64(v_1_1.AuxInt)
22307                         if !(uint64(c) >= uint64(d)) {
22308                                 continue
22309                         }
22310                         v.reset(OpLeq64U)
22311                         v0 := b.NewValue0(v.Pos, OpConst64, x.Type)
22312                         v0.AuxInt = int64ToAuxInt(c - d)
22313                         v1 := b.NewValue0(v.Pos, OpSub64, x.Type)
22314                         v2 := b.NewValue0(v.Pos, OpConst64, x.Type)
22315                         v2.AuxInt = int64ToAuxInt(d)
22316                         v1.AddArg2(x, v2)
22317                         v.AddArg2(v0, v1)
22318                         return true
22319                 }
22320                 break
22321         }
22322         // match: (OrB (Less32U (Const32 [c]) x) (Less32U x (Const32 [d])))
22323         // cond: uint32(c) >= uint32(d)
22324         // result: (Less32U (Const32 <x.Type> [c-d]) (Sub32 <x.Type> x (Const32 <x.Type> [d])))
22325         for {
22326                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22327                         if v_0.Op != OpLess32U {
22328                                 continue
22329                         }
22330                         x := v_0.Args[1]
22331                         v_0_0 := v_0.Args[0]
22332                         if v_0_0.Op != OpConst32 {
22333                                 continue
22334                         }
22335                         c := auxIntToInt32(v_0_0.AuxInt)
22336                         if v_1.Op != OpLess32U {
22337                                 continue
22338                         }
22339                         _ = v_1.Args[1]
22340                         if x != v_1.Args[0] {
22341                                 continue
22342                         }
22343                         v_1_1 := v_1.Args[1]
22344                         if v_1_1.Op != OpConst32 {
22345                                 continue
22346                         }
22347                         d := auxIntToInt32(v_1_1.AuxInt)
22348                         if !(uint32(c) >= uint32(d)) {
22349                                 continue
22350                         }
22351                         v.reset(OpLess32U)
22352                         v0 := b.NewValue0(v.Pos, OpConst32, x.Type)
22353                         v0.AuxInt = int32ToAuxInt(c - d)
22354                         v1 := b.NewValue0(v.Pos, OpSub32, x.Type)
22355                         v2 := b.NewValue0(v.Pos, OpConst32, x.Type)
22356                         v2.AuxInt = int32ToAuxInt(d)
22357                         v1.AddArg2(x, v2)
22358                         v.AddArg2(v0, v1)
22359                         return true
22360                 }
22361                 break
22362         }
22363         // match: (OrB (Leq32U (Const32 [c]) x) (Less32U x (Const32 [d])))
22364         // cond: uint32(c) >= uint32(d)
22365         // result: (Leq32U (Const32 <x.Type> [c-d]) (Sub32 <x.Type> x (Const32 <x.Type> [d])))
22366         for {
22367                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22368                         if v_0.Op != OpLeq32U {
22369                                 continue
22370                         }
22371                         x := v_0.Args[1]
22372                         v_0_0 := v_0.Args[0]
22373                         if v_0_0.Op != OpConst32 {
22374                                 continue
22375                         }
22376                         c := auxIntToInt32(v_0_0.AuxInt)
22377                         if v_1.Op != OpLess32U {
22378                                 continue
22379                         }
22380                         _ = v_1.Args[1]
22381                         if x != v_1.Args[0] {
22382                                 continue
22383                         }
22384                         v_1_1 := v_1.Args[1]
22385                         if v_1_1.Op != OpConst32 {
22386                                 continue
22387                         }
22388                         d := auxIntToInt32(v_1_1.AuxInt)
22389                         if !(uint32(c) >= uint32(d)) {
22390                                 continue
22391                         }
22392                         v.reset(OpLeq32U)
22393                         v0 := b.NewValue0(v.Pos, OpConst32, x.Type)
22394                         v0.AuxInt = int32ToAuxInt(c - d)
22395                         v1 := b.NewValue0(v.Pos, OpSub32, x.Type)
22396                         v2 := b.NewValue0(v.Pos, OpConst32, x.Type)
22397                         v2.AuxInt = int32ToAuxInt(d)
22398                         v1.AddArg2(x, v2)
22399                         v.AddArg2(v0, v1)
22400                         return true
22401                 }
22402                 break
22403         }
22404         // match: (OrB (Less16U (Const16 [c]) x) (Less16U x (Const16 [d])))
22405         // cond: uint16(c) >= uint16(d)
22406         // result: (Less16U (Const16 <x.Type> [c-d]) (Sub16 <x.Type> x (Const16 <x.Type> [d])))
22407         for {
22408                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22409                         if v_0.Op != OpLess16U {
22410                                 continue
22411                         }
22412                         x := v_0.Args[1]
22413                         v_0_0 := v_0.Args[0]
22414                         if v_0_0.Op != OpConst16 {
22415                                 continue
22416                         }
22417                         c := auxIntToInt16(v_0_0.AuxInt)
22418                         if v_1.Op != OpLess16U {
22419                                 continue
22420                         }
22421                         _ = v_1.Args[1]
22422                         if x != v_1.Args[0] {
22423                                 continue
22424                         }
22425                         v_1_1 := v_1.Args[1]
22426                         if v_1_1.Op != OpConst16 {
22427                                 continue
22428                         }
22429                         d := auxIntToInt16(v_1_1.AuxInt)
22430                         if !(uint16(c) >= uint16(d)) {
22431                                 continue
22432                         }
22433                         v.reset(OpLess16U)
22434                         v0 := b.NewValue0(v.Pos, OpConst16, x.Type)
22435                         v0.AuxInt = int16ToAuxInt(c - d)
22436                         v1 := b.NewValue0(v.Pos, OpSub16, x.Type)
22437                         v2 := b.NewValue0(v.Pos, OpConst16, x.Type)
22438                         v2.AuxInt = int16ToAuxInt(d)
22439                         v1.AddArg2(x, v2)
22440                         v.AddArg2(v0, v1)
22441                         return true
22442                 }
22443                 break
22444         }
22445         // match: (OrB (Leq16U (Const16 [c]) x) (Less16U x (Const16 [d])))
22446         // cond: uint16(c) >= uint16(d)
22447         // result: (Leq16U (Const16 <x.Type> [c-d]) (Sub16 <x.Type> x (Const16 <x.Type> [d])))
22448         for {
22449                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22450                         if v_0.Op != OpLeq16U {
22451                                 continue
22452                         }
22453                         x := v_0.Args[1]
22454                         v_0_0 := v_0.Args[0]
22455                         if v_0_0.Op != OpConst16 {
22456                                 continue
22457                         }
22458                         c := auxIntToInt16(v_0_0.AuxInt)
22459                         if v_1.Op != OpLess16U {
22460                                 continue
22461                         }
22462                         _ = v_1.Args[1]
22463                         if x != v_1.Args[0] {
22464                                 continue
22465                         }
22466                         v_1_1 := v_1.Args[1]
22467                         if v_1_1.Op != OpConst16 {
22468                                 continue
22469                         }
22470                         d := auxIntToInt16(v_1_1.AuxInt)
22471                         if !(uint16(c) >= uint16(d)) {
22472                                 continue
22473                         }
22474                         v.reset(OpLeq16U)
22475                         v0 := b.NewValue0(v.Pos, OpConst16, x.Type)
22476                         v0.AuxInt = int16ToAuxInt(c - d)
22477                         v1 := b.NewValue0(v.Pos, OpSub16, x.Type)
22478                         v2 := b.NewValue0(v.Pos, OpConst16, x.Type)
22479                         v2.AuxInt = int16ToAuxInt(d)
22480                         v1.AddArg2(x, v2)
22481                         v.AddArg2(v0, v1)
22482                         return true
22483                 }
22484                 break
22485         }
22486         // match: (OrB (Less8U (Const8 [c]) x) (Less8U x (Const8 [d])))
22487         // cond: uint8(c) >= uint8(d)
22488         // result: (Less8U (Const8 <x.Type> [c-d]) (Sub8 <x.Type> x (Const8 <x.Type> [d])))
22489         for {
22490                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22491                         if v_0.Op != OpLess8U {
22492                                 continue
22493                         }
22494                         x := v_0.Args[1]
22495                         v_0_0 := v_0.Args[0]
22496                         if v_0_0.Op != OpConst8 {
22497                                 continue
22498                         }
22499                         c := auxIntToInt8(v_0_0.AuxInt)
22500                         if v_1.Op != OpLess8U {
22501                                 continue
22502                         }
22503                         _ = v_1.Args[1]
22504                         if x != v_1.Args[0] {
22505                                 continue
22506                         }
22507                         v_1_1 := v_1.Args[1]
22508                         if v_1_1.Op != OpConst8 {
22509                                 continue
22510                         }
22511                         d := auxIntToInt8(v_1_1.AuxInt)
22512                         if !(uint8(c) >= uint8(d)) {
22513                                 continue
22514                         }
22515                         v.reset(OpLess8U)
22516                         v0 := b.NewValue0(v.Pos, OpConst8, x.Type)
22517                         v0.AuxInt = int8ToAuxInt(c - d)
22518                         v1 := b.NewValue0(v.Pos, OpSub8, x.Type)
22519                         v2 := b.NewValue0(v.Pos, OpConst8, x.Type)
22520                         v2.AuxInt = int8ToAuxInt(d)
22521                         v1.AddArg2(x, v2)
22522                         v.AddArg2(v0, v1)
22523                         return true
22524                 }
22525                 break
22526         }
22527         // match: (OrB (Leq8U (Const8 [c]) x) (Less8U x (Const8 [d])))
22528         // cond: uint8(c) >= uint8(d)
22529         // result: (Leq8U (Const8 <x.Type> [c-d]) (Sub8 <x.Type> x (Const8 <x.Type> [d])))
22530         for {
22531                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22532                         if v_0.Op != OpLeq8U {
22533                                 continue
22534                         }
22535                         x := v_0.Args[1]
22536                         v_0_0 := v_0.Args[0]
22537                         if v_0_0.Op != OpConst8 {
22538                                 continue
22539                         }
22540                         c := auxIntToInt8(v_0_0.AuxInt)
22541                         if v_1.Op != OpLess8U {
22542                                 continue
22543                         }
22544                         _ = v_1.Args[1]
22545                         if x != v_1.Args[0] {
22546                                 continue
22547                         }
22548                         v_1_1 := v_1.Args[1]
22549                         if v_1_1.Op != OpConst8 {
22550                                 continue
22551                         }
22552                         d := auxIntToInt8(v_1_1.AuxInt)
22553                         if !(uint8(c) >= uint8(d)) {
22554                                 continue
22555                         }
22556                         v.reset(OpLeq8U)
22557                         v0 := b.NewValue0(v.Pos, OpConst8, x.Type)
22558                         v0.AuxInt = int8ToAuxInt(c - d)
22559                         v1 := b.NewValue0(v.Pos, OpSub8, x.Type)
22560                         v2 := b.NewValue0(v.Pos, OpConst8, x.Type)
22561                         v2.AuxInt = int8ToAuxInt(d)
22562                         v1.AddArg2(x, v2)
22563                         v.AddArg2(v0, v1)
22564                         return true
22565                 }
22566                 break
22567         }
22568         // match: (OrB (Less64U (Const64 [c]) x) (Leq64U x (Const64 [d])))
22569         // cond: uint64(c) >= uint64(d+1) && uint64(d+1) > uint64(d)
22570         // result: (Less64U (Const64 <x.Type> [c-d-1]) (Sub64 <x.Type> x (Const64 <x.Type> [d+1])))
22571         for {
22572                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22573                         if v_0.Op != OpLess64U {
22574                                 continue
22575                         }
22576                         x := v_0.Args[1]
22577                         v_0_0 := v_0.Args[0]
22578                         if v_0_0.Op != OpConst64 {
22579                                 continue
22580                         }
22581                         c := auxIntToInt64(v_0_0.AuxInt)
22582                         if v_1.Op != OpLeq64U {
22583                                 continue
22584                         }
22585                         _ = v_1.Args[1]
22586                         if x != v_1.Args[0] {
22587                                 continue
22588                         }
22589                         v_1_1 := v_1.Args[1]
22590                         if v_1_1.Op != OpConst64 {
22591                                 continue
22592                         }
22593                         d := auxIntToInt64(v_1_1.AuxInt)
22594                         if !(uint64(c) >= uint64(d+1) && uint64(d+1) > uint64(d)) {
22595                                 continue
22596                         }
22597                         v.reset(OpLess64U)
22598                         v0 := b.NewValue0(v.Pos, OpConst64, x.Type)
22599                         v0.AuxInt = int64ToAuxInt(c - d - 1)
22600                         v1 := b.NewValue0(v.Pos, OpSub64, x.Type)
22601                         v2 := b.NewValue0(v.Pos, OpConst64, x.Type)
22602                         v2.AuxInt = int64ToAuxInt(d + 1)
22603                         v1.AddArg2(x, v2)
22604                         v.AddArg2(v0, v1)
22605                         return true
22606                 }
22607                 break
22608         }
22609         // match: (OrB (Leq64U (Const64 [c]) x) (Leq64U x (Const64 [d])))
22610         // cond: uint64(c) >= uint64(d+1) && uint64(d+1) > uint64(d)
22611         // result: (Leq64U (Const64 <x.Type> [c-d-1]) (Sub64 <x.Type> x (Const64 <x.Type> [d+1])))
22612         for {
22613                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22614                         if v_0.Op != OpLeq64U {
22615                                 continue
22616                         }
22617                         x := v_0.Args[1]
22618                         v_0_0 := v_0.Args[0]
22619                         if v_0_0.Op != OpConst64 {
22620                                 continue
22621                         }
22622                         c := auxIntToInt64(v_0_0.AuxInt)
22623                         if v_1.Op != OpLeq64U {
22624                                 continue
22625                         }
22626                         _ = v_1.Args[1]
22627                         if x != v_1.Args[0] {
22628                                 continue
22629                         }
22630                         v_1_1 := v_1.Args[1]
22631                         if v_1_1.Op != OpConst64 {
22632                                 continue
22633                         }
22634                         d := auxIntToInt64(v_1_1.AuxInt)
22635                         if !(uint64(c) >= uint64(d+1) && uint64(d+1) > uint64(d)) {
22636                                 continue
22637                         }
22638                         v.reset(OpLeq64U)
22639                         v0 := b.NewValue0(v.Pos, OpConst64, x.Type)
22640                         v0.AuxInt = int64ToAuxInt(c - d - 1)
22641                         v1 := b.NewValue0(v.Pos, OpSub64, x.Type)
22642                         v2 := b.NewValue0(v.Pos, OpConst64, x.Type)
22643                         v2.AuxInt = int64ToAuxInt(d + 1)
22644                         v1.AddArg2(x, v2)
22645                         v.AddArg2(v0, v1)
22646                         return true
22647                 }
22648                 break
22649         }
22650         // match: (OrB (Less32U (Const32 [c]) x) (Leq32U x (Const32 [d])))
22651         // cond: uint32(c) >= uint32(d+1) && uint32(d+1) > uint32(d)
22652         // result: (Less32U (Const32 <x.Type> [c-d-1]) (Sub32 <x.Type> x (Const32 <x.Type> [d+1])))
22653         for {
22654                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22655                         if v_0.Op != OpLess32U {
22656                                 continue
22657                         }
22658                         x := v_0.Args[1]
22659                         v_0_0 := v_0.Args[0]
22660                         if v_0_0.Op != OpConst32 {
22661                                 continue
22662                         }
22663                         c := auxIntToInt32(v_0_0.AuxInt)
22664                         if v_1.Op != OpLeq32U {
22665                                 continue
22666                         }
22667                         _ = v_1.Args[1]
22668                         if x != v_1.Args[0] {
22669                                 continue
22670                         }
22671                         v_1_1 := v_1.Args[1]
22672                         if v_1_1.Op != OpConst32 {
22673                                 continue
22674                         }
22675                         d := auxIntToInt32(v_1_1.AuxInt)
22676                         if !(uint32(c) >= uint32(d+1) && uint32(d+1) > uint32(d)) {
22677                                 continue
22678                         }
22679                         v.reset(OpLess32U)
22680                         v0 := b.NewValue0(v.Pos, OpConst32, x.Type)
22681                         v0.AuxInt = int32ToAuxInt(c - d - 1)
22682                         v1 := b.NewValue0(v.Pos, OpSub32, x.Type)
22683                         v2 := b.NewValue0(v.Pos, OpConst32, x.Type)
22684                         v2.AuxInt = int32ToAuxInt(d + 1)
22685                         v1.AddArg2(x, v2)
22686                         v.AddArg2(v0, v1)
22687                         return true
22688                 }
22689                 break
22690         }
22691         // match: (OrB (Leq32U (Const32 [c]) x) (Leq32U x (Const32 [d])))
22692         // cond: uint32(c) >= uint32(d+1) && uint32(d+1) > uint32(d)
22693         // result: (Leq32U (Const32 <x.Type> [c-d-1]) (Sub32 <x.Type> x (Const32 <x.Type> [d+1])))
22694         for {
22695                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22696                         if v_0.Op != OpLeq32U {
22697                                 continue
22698                         }
22699                         x := v_0.Args[1]
22700                         v_0_0 := v_0.Args[0]
22701                         if v_0_0.Op != OpConst32 {
22702                                 continue
22703                         }
22704                         c := auxIntToInt32(v_0_0.AuxInt)
22705                         if v_1.Op != OpLeq32U {
22706                                 continue
22707                         }
22708                         _ = v_1.Args[1]
22709                         if x != v_1.Args[0] {
22710                                 continue
22711                         }
22712                         v_1_1 := v_1.Args[1]
22713                         if v_1_1.Op != OpConst32 {
22714                                 continue
22715                         }
22716                         d := auxIntToInt32(v_1_1.AuxInt)
22717                         if !(uint32(c) >= uint32(d+1) && uint32(d+1) > uint32(d)) {
22718                                 continue
22719                         }
22720                         v.reset(OpLeq32U)
22721                         v0 := b.NewValue0(v.Pos, OpConst32, x.Type)
22722                         v0.AuxInt = int32ToAuxInt(c - d - 1)
22723                         v1 := b.NewValue0(v.Pos, OpSub32, x.Type)
22724                         v2 := b.NewValue0(v.Pos, OpConst32, x.Type)
22725                         v2.AuxInt = int32ToAuxInt(d + 1)
22726                         v1.AddArg2(x, v2)
22727                         v.AddArg2(v0, v1)
22728                         return true
22729                 }
22730                 break
22731         }
22732         // match: (OrB (Less16U (Const16 [c]) x) (Leq16U x (Const16 [d])))
22733         // cond: uint16(c) >= uint16(d+1) && uint16(d+1) > uint16(d)
22734         // result: (Less16U (Const16 <x.Type> [c-d-1]) (Sub16 <x.Type> x (Const16 <x.Type> [d+1])))
22735         for {
22736                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22737                         if v_0.Op != OpLess16U {
22738                                 continue
22739                         }
22740                         x := v_0.Args[1]
22741                         v_0_0 := v_0.Args[0]
22742                         if v_0_0.Op != OpConst16 {
22743                                 continue
22744                         }
22745                         c := auxIntToInt16(v_0_0.AuxInt)
22746                         if v_1.Op != OpLeq16U {
22747                                 continue
22748                         }
22749                         _ = v_1.Args[1]
22750                         if x != v_1.Args[0] {
22751                                 continue
22752                         }
22753                         v_1_1 := v_1.Args[1]
22754                         if v_1_1.Op != OpConst16 {
22755                                 continue
22756                         }
22757                         d := auxIntToInt16(v_1_1.AuxInt)
22758                         if !(uint16(c) >= uint16(d+1) && uint16(d+1) > uint16(d)) {
22759                                 continue
22760                         }
22761                         v.reset(OpLess16U)
22762                         v0 := b.NewValue0(v.Pos, OpConst16, x.Type)
22763                         v0.AuxInt = int16ToAuxInt(c - d - 1)
22764                         v1 := b.NewValue0(v.Pos, OpSub16, x.Type)
22765                         v2 := b.NewValue0(v.Pos, OpConst16, x.Type)
22766                         v2.AuxInt = int16ToAuxInt(d + 1)
22767                         v1.AddArg2(x, v2)
22768                         v.AddArg2(v0, v1)
22769                         return true
22770                 }
22771                 break
22772         }
22773         // match: (OrB (Leq16U (Const16 [c]) x) (Leq16U x (Const16 [d])))
22774         // cond: uint16(c) >= uint16(d+1) && uint16(d+1) > uint16(d)
22775         // result: (Leq16U (Const16 <x.Type> [c-d-1]) (Sub16 <x.Type> x (Const16 <x.Type> [d+1])))
22776         for {
22777                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22778                         if v_0.Op != OpLeq16U {
22779                                 continue
22780                         }
22781                         x := v_0.Args[1]
22782                         v_0_0 := v_0.Args[0]
22783                         if v_0_0.Op != OpConst16 {
22784                                 continue
22785                         }
22786                         c := auxIntToInt16(v_0_0.AuxInt)
22787                         if v_1.Op != OpLeq16U {
22788                                 continue
22789                         }
22790                         _ = v_1.Args[1]
22791                         if x != v_1.Args[0] {
22792                                 continue
22793                         }
22794                         v_1_1 := v_1.Args[1]
22795                         if v_1_1.Op != OpConst16 {
22796                                 continue
22797                         }
22798                         d := auxIntToInt16(v_1_1.AuxInt)
22799                         if !(uint16(c) >= uint16(d+1) && uint16(d+1) > uint16(d)) {
22800                                 continue
22801                         }
22802                         v.reset(OpLeq16U)
22803                         v0 := b.NewValue0(v.Pos, OpConst16, x.Type)
22804                         v0.AuxInt = int16ToAuxInt(c - d - 1)
22805                         v1 := b.NewValue0(v.Pos, OpSub16, x.Type)
22806                         v2 := b.NewValue0(v.Pos, OpConst16, x.Type)
22807                         v2.AuxInt = int16ToAuxInt(d + 1)
22808                         v1.AddArg2(x, v2)
22809                         v.AddArg2(v0, v1)
22810                         return true
22811                 }
22812                 break
22813         }
22814         // match: (OrB (Less8U (Const8 [c]) x) (Leq8U x (Const8 [d])))
22815         // cond: uint8(c) >= uint8(d+1) && uint8(d+1) > uint8(d)
22816         // result: (Less8U (Const8 <x.Type> [c-d-1]) (Sub8 <x.Type> x (Const8 <x.Type> [d+1])))
22817         for {
22818                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22819                         if v_0.Op != OpLess8U {
22820                                 continue
22821                         }
22822                         x := v_0.Args[1]
22823                         v_0_0 := v_0.Args[0]
22824                         if v_0_0.Op != OpConst8 {
22825                                 continue
22826                         }
22827                         c := auxIntToInt8(v_0_0.AuxInt)
22828                         if v_1.Op != OpLeq8U {
22829                                 continue
22830                         }
22831                         _ = v_1.Args[1]
22832                         if x != v_1.Args[0] {
22833                                 continue
22834                         }
22835                         v_1_1 := v_1.Args[1]
22836                         if v_1_1.Op != OpConst8 {
22837                                 continue
22838                         }
22839                         d := auxIntToInt8(v_1_1.AuxInt)
22840                         if !(uint8(c) >= uint8(d+1) && uint8(d+1) > uint8(d)) {
22841                                 continue
22842                         }
22843                         v.reset(OpLess8U)
22844                         v0 := b.NewValue0(v.Pos, OpConst8, x.Type)
22845                         v0.AuxInt = int8ToAuxInt(c - d - 1)
22846                         v1 := b.NewValue0(v.Pos, OpSub8, x.Type)
22847                         v2 := b.NewValue0(v.Pos, OpConst8, x.Type)
22848                         v2.AuxInt = int8ToAuxInt(d + 1)
22849                         v1.AddArg2(x, v2)
22850                         v.AddArg2(v0, v1)
22851                         return true
22852                 }
22853                 break
22854         }
22855         // match: (OrB (Leq8U (Const8 [c]) x) (Leq8U x (Const8 [d])))
22856         // cond: uint8(c) >= uint8(d+1) && uint8(d+1) > uint8(d)
22857         // result: (Leq8U (Const8 <x.Type> [c-d-1]) (Sub8 <x.Type> x (Const8 <x.Type> [d+1])))
22858         for {
22859                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
22860                         if v_0.Op != OpLeq8U {
22861                                 continue
22862                         }
22863                         x := v_0.Args[1]
22864                         v_0_0 := v_0.Args[0]
22865                         if v_0_0.Op != OpConst8 {
22866                                 continue
22867                         }
22868                         c := auxIntToInt8(v_0_0.AuxInt)
22869                         if v_1.Op != OpLeq8U {
22870                                 continue
22871                         }
22872                         _ = v_1.Args[1]
22873                         if x != v_1.Args[0] {
22874                                 continue
22875                         }
22876                         v_1_1 := v_1.Args[1]
22877                         if v_1_1.Op != OpConst8 {
22878                                 continue
22879                         }
22880                         d := auxIntToInt8(v_1_1.AuxInt)
22881                         if !(uint8(c) >= uint8(d+1) && uint8(d+1) > uint8(d)) {
22882                                 continue
22883                         }
22884                         v.reset(OpLeq8U)
22885                         v0 := b.NewValue0(v.Pos, OpConst8, x.Type)
22886                         v0.AuxInt = int8ToAuxInt(c - d - 1)
22887                         v1 := b.NewValue0(v.Pos, OpSub8, x.Type)
22888                         v2 := b.NewValue0(v.Pos, OpConst8, x.Type)
22889                         v2.AuxInt = int8ToAuxInt(d + 1)
22890                         v1.AddArg2(x, v2)
22891                         v.AddArg2(v0, v1)
22892                         return true
22893                 }
22894                 break
22895         }
22896         return false
22897 }
22898 func rewriteValuegeneric_OpPhi(v *Value) bool {
22899         b := v.Block
22900         // match: (Phi (Const8 [c]) (Const8 [c]))
22901         // result: (Const8 [c])
22902         for {
22903                 if len(v.Args) != 2 {
22904                         break
22905                 }
22906                 _ = v.Args[1]
22907                 v_0 := v.Args[0]
22908                 if v_0.Op != OpConst8 {
22909                         break
22910                 }
22911                 c := auxIntToInt8(v_0.AuxInt)
22912                 v_1 := v.Args[1]
22913                 if v_1.Op != OpConst8 || auxIntToInt8(v_1.AuxInt) != c {
22914                         break
22915                 }
22916                 v.reset(OpConst8)
22917                 v.AuxInt = int8ToAuxInt(c)
22918                 return true
22919         }
22920         // match: (Phi (Const16 [c]) (Const16 [c]))
22921         // result: (Const16 [c])
22922         for {
22923                 if len(v.Args) != 2 {
22924                         break
22925                 }
22926                 _ = v.Args[1]
22927                 v_0 := v.Args[0]
22928                 if v_0.Op != OpConst16 {
22929                         break
22930                 }
22931                 c := auxIntToInt16(v_0.AuxInt)
22932                 v_1 := v.Args[1]
22933                 if v_1.Op != OpConst16 || auxIntToInt16(v_1.AuxInt) != c {
22934                         break
22935                 }
22936                 v.reset(OpConst16)
22937                 v.AuxInt = int16ToAuxInt(c)
22938                 return true
22939         }
22940         // match: (Phi (Const32 [c]) (Const32 [c]))
22941         // result: (Const32 [c])
22942         for {
22943                 if len(v.Args) != 2 {
22944                         break
22945                 }
22946                 _ = v.Args[1]
22947                 v_0 := v.Args[0]
22948                 if v_0.Op != OpConst32 {
22949                         break
22950                 }
22951                 c := auxIntToInt32(v_0.AuxInt)
22952                 v_1 := v.Args[1]
22953                 if v_1.Op != OpConst32 || auxIntToInt32(v_1.AuxInt) != c {
22954                         break
22955                 }
22956                 v.reset(OpConst32)
22957                 v.AuxInt = int32ToAuxInt(c)
22958                 return true
22959         }
22960         // match: (Phi (Const64 [c]) (Const64 [c]))
22961         // result: (Const64 [c])
22962         for {
22963                 if len(v.Args) != 2 {
22964                         break
22965                 }
22966                 _ = v.Args[1]
22967                 v_0 := v.Args[0]
22968                 if v_0.Op != OpConst64 {
22969                         break
22970                 }
22971                 c := auxIntToInt64(v_0.AuxInt)
22972                 v_1 := v.Args[1]
22973                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != c {
22974                         break
22975                 }
22976                 v.reset(OpConst64)
22977                 v.AuxInt = int64ToAuxInt(c)
22978                 return true
22979         }
22980         // match: (Phi <t> nx:(Not x) ny:(Not y))
22981         // cond: nx.Uses == 1 && ny.Uses == 1
22982         // result: (Not (Phi <t> x y))
22983         for {
22984                 if len(v.Args) != 2 {
22985                         break
22986                 }
22987                 t := v.Type
22988                 _ = v.Args[1]
22989                 nx := v.Args[0]
22990                 if nx.Op != OpNot {
22991                         break
22992                 }
22993                 x := nx.Args[0]
22994                 ny := v.Args[1]
22995                 if ny.Op != OpNot {
22996                         break
22997                 }
22998                 y := ny.Args[0]
22999                 if !(nx.Uses == 1 && ny.Uses == 1) {
23000                         break
23001                 }
23002                 v.reset(OpNot)
23003                 v0 := b.NewValue0(v.Pos, OpPhi, t)
23004                 v0.AddArg2(x, y)
23005                 v.AddArg(v0)
23006                 return true
23007         }
23008         return false
23009 }
23010 func rewriteValuegeneric_OpPtrIndex(v *Value) bool {
23011         v_1 := v.Args[1]
23012         v_0 := v.Args[0]
23013         b := v.Block
23014         config := b.Func.Config
23015         typ := &b.Func.Config.Types
23016         // match: (PtrIndex <t> ptr idx)
23017         // cond: config.PtrSize == 4 && is32Bit(t.Elem().Size())
23018         // result: (AddPtr ptr (Mul32 <typ.Int> idx (Const32 <typ.Int> [int32(t.Elem().Size())])))
23019         for {
23020                 t := v.Type
23021                 ptr := v_0
23022                 idx := v_1
23023                 if !(config.PtrSize == 4 && is32Bit(t.Elem().Size())) {
23024                         break
23025                 }
23026                 v.reset(OpAddPtr)
23027                 v0 := b.NewValue0(v.Pos, OpMul32, typ.Int)
23028                 v1 := b.NewValue0(v.Pos, OpConst32, typ.Int)
23029                 v1.AuxInt = int32ToAuxInt(int32(t.Elem().Size()))
23030                 v0.AddArg2(idx, v1)
23031                 v.AddArg2(ptr, v0)
23032                 return true
23033         }
23034         // match: (PtrIndex <t> ptr idx)
23035         // cond: config.PtrSize == 8
23036         // result: (AddPtr ptr (Mul64 <typ.Int> idx (Const64 <typ.Int> [t.Elem().Size()])))
23037         for {
23038                 t := v.Type
23039                 ptr := v_0
23040                 idx := v_1
23041                 if !(config.PtrSize == 8) {
23042                         break
23043                 }
23044                 v.reset(OpAddPtr)
23045                 v0 := b.NewValue0(v.Pos, OpMul64, typ.Int)
23046                 v1 := b.NewValue0(v.Pos, OpConst64, typ.Int)
23047                 v1.AuxInt = int64ToAuxInt(t.Elem().Size())
23048                 v0.AddArg2(idx, v1)
23049                 v.AddArg2(ptr, v0)
23050                 return true
23051         }
23052         return false
23053 }
23054 func rewriteValuegeneric_OpRotateLeft16(v *Value) bool {
23055         v_1 := v.Args[1]
23056         v_0 := v.Args[0]
23057         b := v.Block
23058         config := b.Func.Config
23059         // match: (RotateLeft16 x (Const16 [c]))
23060         // cond: c%16 == 0
23061         // result: x
23062         for {
23063                 x := v_0
23064                 if v_1.Op != OpConst16 {
23065                         break
23066                 }
23067                 c := auxIntToInt16(v_1.AuxInt)
23068                 if !(c%16 == 0) {
23069                         break
23070                 }
23071                 v.copyOf(x)
23072                 return true
23073         }
23074         // match: (RotateLeft16 x (And64 y (Const64 [c])))
23075         // cond: c&15 == 15
23076         // result: (RotateLeft16 x y)
23077         for {
23078                 x := v_0
23079                 if v_1.Op != OpAnd64 {
23080                         break
23081                 }
23082                 _ = v_1.Args[1]
23083                 v_1_0 := v_1.Args[0]
23084                 v_1_1 := v_1.Args[1]
23085                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
23086                         y := v_1_0
23087                         if v_1_1.Op != OpConst64 {
23088                                 continue
23089                         }
23090                         c := auxIntToInt64(v_1_1.AuxInt)
23091                         if !(c&15 == 15) {
23092                                 continue
23093                         }
23094                         v.reset(OpRotateLeft16)
23095                         v.AddArg2(x, y)
23096                         return true
23097                 }
23098                 break
23099         }
23100         // match: (RotateLeft16 x (And32 y (Const32 [c])))
23101         // cond: c&15 == 15
23102         // result: (RotateLeft16 x y)
23103         for {
23104                 x := v_0
23105                 if v_1.Op != OpAnd32 {
23106                         break
23107                 }
23108                 _ = v_1.Args[1]
23109                 v_1_0 := v_1.Args[0]
23110                 v_1_1 := v_1.Args[1]
23111                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
23112                         y := v_1_0
23113                         if v_1_1.Op != OpConst32 {
23114                                 continue
23115                         }
23116                         c := auxIntToInt32(v_1_1.AuxInt)
23117                         if !(c&15 == 15) {
23118                                 continue
23119                         }
23120                         v.reset(OpRotateLeft16)
23121                         v.AddArg2(x, y)
23122                         return true
23123                 }
23124                 break
23125         }
23126         // match: (RotateLeft16 x (And16 y (Const16 [c])))
23127         // cond: c&15 == 15
23128         // result: (RotateLeft16 x y)
23129         for {
23130                 x := v_0
23131                 if v_1.Op != OpAnd16 {
23132                         break
23133                 }
23134                 _ = v_1.Args[1]
23135                 v_1_0 := v_1.Args[0]
23136                 v_1_1 := v_1.Args[1]
23137                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
23138                         y := v_1_0
23139                         if v_1_1.Op != OpConst16 {
23140                                 continue
23141                         }
23142                         c := auxIntToInt16(v_1_1.AuxInt)
23143                         if !(c&15 == 15) {
23144                                 continue
23145                         }
23146                         v.reset(OpRotateLeft16)
23147                         v.AddArg2(x, y)
23148                         return true
23149                 }
23150                 break
23151         }
23152         // match: (RotateLeft16 x (And8 y (Const8 [c])))
23153         // cond: c&15 == 15
23154         // result: (RotateLeft16 x y)
23155         for {
23156                 x := v_0
23157                 if v_1.Op != OpAnd8 {
23158                         break
23159                 }
23160                 _ = v_1.Args[1]
23161                 v_1_0 := v_1.Args[0]
23162                 v_1_1 := v_1.Args[1]
23163                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
23164                         y := v_1_0
23165                         if v_1_1.Op != OpConst8 {
23166                                 continue
23167                         }
23168                         c := auxIntToInt8(v_1_1.AuxInt)
23169                         if !(c&15 == 15) {
23170                                 continue
23171                         }
23172                         v.reset(OpRotateLeft16)
23173                         v.AddArg2(x, y)
23174                         return true
23175                 }
23176                 break
23177         }
23178         // match: (RotateLeft16 x (Neg64 (And64 y (Const64 [c]))))
23179         // cond: c&15 == 15
23180         // result: (RotateLeft16 x (Neg64 <y.Type> y))
23181         for {
23182                 x := v_0
23183                 if v_1.Op != OpNeg64 {
23184                         break
23185                 }
23186                 v_1_0 := v_1.Args[0]
23187                 if v_1_0.Op != OpAnd64 {
23188                         break
23189                 }
23190                 _ = v_1_0.Args[1]
23191                 v_1_0_0 := v_1_0.Args[0]
23192                 v_1_0_1 := v_1_0.Args[1]
23193                 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
23194                         y := v_1_0_0
23195                         if v_1_0_1.Op != OpConst64 {
23196                                 continue
23197                         }
23198                         c := auxIntToInt64(v_1_0_1.AuxInt)
23199                         if !(c&15 == 15) {
23200                                 continue
23201                         }
23202                         v.reset(OpRotateLeft16)
23203                         v0 := b.NewValue0(v.Pos, OpNeg64, y.Type)
23204                         v0.AddArg(y)
23205                         v.AddArg2(x, v0)
23206                         return true
23207                 }
23208                 break
23209         }
23210         // match: (RotateLeft16 x (Neg32 (And32 y (Const32 [c]))))
23211         // cond: c&15 == 15
23212         // result: (RotateLeft16 x (Neg32 <y.Type> y))
23213         for {
23214                 x := v_0
23215                 if v_1.Op != OpNeg32 {
23216                         break
23217                 }
23218                 v_1_0 := v_1.Args[0]
23219                 if v_1_0.Op != OpAnd32 {
23220                         break
23221                 }
23222                 _ = v_1_0.Args[1]
23223                 v_1_0_0 := v_1_0.Args[0]
23224                 v_1_0_1 := v_1_0.Args[1]
23225                 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
23226                         y := v_1_0_0
23227                         if v_1_0_1.Op != OpConst32 {
23228                                 continue
23229                         }
23230                         c := auxIntToInt32(v_1_0_1.AuxInt)
23231                         if !(c&15 == 15) {
23232                                 continue
23233                         }
23234                         v.reset(OpRotateLeft16)
23235                         v0 := b.NewValue0(v.Pos, OpNeg32, y.Type)
23236                         v0.AddArg(y)
23237                         v.AddArg2(x, v0)
23238                         return true
23239                 }
23240                 break
23241         }
23242         // match: (RotateLeft16 x (Neg16 (And16 y (Const16 [c]))))
23243         // cond: c&15 == 15
23244         // result: (RotateLeft16 x (Neg16 <y.Type> y))
23245         for {
23246                 x := v_0
23247                 if v_1.Op != OpNeg16 {
23248                         break
23249                 }
23250                 v_1_0 := v_1.Args[0]
23251                 if v_1_0.Op != OpAnd16 {
23252                         break
23253                 }
23254                 _ = v_1_0.Args[1]
23255                 v_1_0_0 := v_1_0.Args[0]
23256                 v_1_0_1 := v_1_0.Args[1]
23257                 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
23258                         y := v_1_0_0
23259                         if v_1_0_1.Op != OpConst16 {
23260                                 continue
23261                         }
23262                         c := auxIntToInt16(v_1_0_1.AuxInt)
23263                         if !(c&15 == 15) {
23264                                 continue
23265                         }
23266                         v.reset(OpRotateLeft16)
23267                         v0 := b.NewValue0(v.Pos, OpNeg16, y.Type)
23268                         v0.AddArg(y)
23269                         v.AddArg2(x, v0)
23270                         return true
23271                 }
23272                 break
23273         }
23274         // match: (RotateLeft16 x (Neg8 (And8 y (Const8 [c]))))
23275         // cond: c&15 == 15
23276         // result: (RotateLeft16 x (Neg8 <y.Type> y))
23277         for {
23278                 x := v_0
23279                 if v_1.Op != OpNeg8 {
23280                         break
23281                 }
23282                 v_1_0 := v_1.Args[0]
23283                 if v_1_0.Op != OpAnd8 {
23284                         break
23285                 }
23286                 _ = v_1_0.Args[1]
23287                 v_1_0_0 := v_1_0.Args[0]
23288                 v_1_0_1 := v_1_0.Args[1]
23289                 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
23290                         y := v_1_0_0
23291                         if v_1_0_1.Op != OpConst8 {
23292                                 continue
23293                         }
23294                         c := auxIntToInt8(v_1_0_1.AuxInt)
23295                         if !(c&15 == 15) {
23296                                 continue
23297                         }
23298                         v.reset(OpRotateLeft16)
23299                         v0 := b.NewValue0(v.Pos, OpNeg8, y.Type)
23300                         v0.AddArg(y)
23301                         v.AddArg2(x, v0)
23302                         return true
23303                 }
23304                 break
23305         }
23306         // match: (RotateLeft16 x (Add64 y (Const64 [c])))
23307         // cond: c&15 == 0
23308         // result: (RotateLeft16 x y)
23309         for {
23310                 x := v_0
23311                 if v_1.Op != OpAdd64 {
23312                         break
23313                 }
23314                 _ = v_1.Args[1]
23315                 v_1_0 := v_1.Args[0]
23316                 v_1_1 := v_1.Args[1]
23317                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
23318                         y := v_1_0
23319                         if v_1_1.Op != OpConst64 {
23320                                 continue
23321                         }
23322                         c := auxIntToInt64(v_1_1.AuxInt)
23323                         if !(c&15 == 0) {
23324                                 continue
23325                         }
23326                         v.reset(OpRotateLeft16)
23327                         v.AddArg2(x, y)
23328                         return true
23329                 }
23330                 break
23331         }
23332         // match: (RotateLeft16 x (Add32 y (Const32 [c])))
23333         // cond: c&15 == 0
23334         // result: (RotateLeft16 x y)
23335         for {
23336                 x := v_0
23337                 if v_1.Op != OpAdd32 {
23338                         break
23339                 }
23340                 _ = v_1.Args[1]
23341                 v_1_0 := v_1.Args[0]
23342                 v_1_1 := v_1.Args[1]
23343                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
23344                         y := v_1_0
23345                         if v_1_1.Op != OpConst32 {
23346                                 continue
23347                         }
23348                         c := auxIntToInt32(v_1_1.AuxInt)
23349                         if !(c&15 == 0) {
23350                                 continue
23351                         }
23352                         v.reset(OpRotateLeft16)
23353                         v.AddArg2(x, y)
23354                         return true
23355                 }
23356                 break
23357         }
23358         // match: (RotateLeft16 x (Add16 y (Const16 [c])))
23359         // cond: c&15 == 0
23360         // result: (RotateLeft16 x y)
23361         for {
23362                 x := v_0
23363                 if v_1.Op != OpAdd16 {
23364                         break
23365                 }
23366                 _ = v_1.Args[1]
23367                 v_1_0 := v_1.Args[0]
23368                 v_1_1 := v_1.Args[1]
23369                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
23370                         y := v_1_0
23371                         if v_1_1.Op != OpConst16 {
23372                                 continue
23373                         }
23374                         c := auxIntToInt16(v_1_1.AuxInt)
23375                         if !(c&15 == 0) {
23376                                 continue
23377                         }
23378                         v.reset(OpRotateLeft16)
23379                         v.AddArg2(x, y)
23380                         return true
23381                 }
23382                 break
23383         }
23384         // match: (RotateLeft16 x (Add8 y (Const8 [c])))
23385         // cond: c&15 == 0
23386         // result: (RotateLeft16 x y)
23387         for {
23388                 x := v_0
23389                 if v_1.Op != OpAdd8 {
23390                         break
23391                 }
23392                 _ = v_1.Args[1]
23393                 v_1_0 := v_1.Args[0]
23394                 v_1_1 := v_1.Args[1]
23395                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
23396                         y := v_1_0
23397                         if v_1_1.Op != OpConst8 {
23398                                 continue
23399                         }
23400                         c := auxIntToInt8(v_1_1.AuxInt)
23401                         if !(c&15 == 0) {
23402                                 continue
23403                         }
23404                         v.reset(OpRotateLeft16)
23405                         v.AddArg2(x, y)
23406                         return true
23407                 }
23408                 break
23409         }
23410         // match: (RotateLeft16 x (Sub64 (Const64 [c]) y))
23411         // cond: c&15 == 0
23412         // result: (RotateLeft16 x (Neg64 <y.Type> y))
23413         for {
23414                 x := v_0
23415                 if v_1.Op != OpSub64 {
23416                         break
23417                 }
23418                 y := v_1.Args[1]
23419                 v_1_0 := v_1.Args[0]
23420                 if v_1_0.Op != OpConst64 {
23421                         break
23422                 }
23423                 c := auxIntToInt64(v_1_0.AuxInt)
23424                 if !(c&15 == 0) {
23425                         break
23426                 }
23427                 v.reset(OpRotateLeft16)
23428                 v0 := b.NewValue0(v.Pos, OpNeg64, y.Type)
23429                 v0.AddArg(y)
23430                 v.AddArg2(x, v0)
23431                 return true
23432         }
23433         // match: (RotateLeft16 x (Sub32 (Const32 [c]) y))
23434         // cond: c&15 == 0
23435         // result: (RotateLeft16 x (Neg32 <y.Type> y))
23436         for {
23437                 x := v_0
23438                 if v_1.Op != OpSub32 {
23439                         break
23440                 }
23441                 y := v_1.Args[1]
23442                 v_1_0 := v_1.Args[0]
23443                 if v_1_0.Op != OpConst32 {
23444                         break
23445                 }
23446                 c := auxIntToInt32(v_1_0.AuxInt)
23447                 if !(c&15 == 0) {
23448                         break
23449                 }
23450                 v.reset(OpRotateLeft16)
23451                 v0 := b.NewValue0(v.Pos, OpNeg32, y.Type)
23452                 v0.AddArg(y)
23453                 v.AddArg2(x, v0)
23454                 return true
23455         }
23456         // match: (RotateLeft16 x (Sub16 (Const16 [c]) y))
23457         // cond: c&15 == 0
23458         // result: (RotateLeft16 x (Neg16 <y.Type> y))
23459         for {
23460                 x := v_0
23461                 if v_1.Op != OpSub16 {
23462                         break
23463                 }
23464                 y := v_1.Args[1]
23465                 v_1_0 := v_1.Args[0]
23466                 if v_1_0.Op != OpConst16 {
23467                         break
23468                 }
23469                 c := auxIntToInt16(v_1_0.AuxInt)
23470                 if !(c&15 == 0) {
23471                         break
23472                 }
23473                 v.reset(OpRotateLeft16)
23474                 v0 := b.NewValue0(v.Pos, OpNeg16, y.Type)
23475                 v0.AddArg(y)
23476                 v.AddArg2(x, v0)
23477                 return true
23478         }
23479         // match: (RotateLeft16 x (Sub8 (Const8 [c]) y))
23480         // cond: c&15 == 0
23481         // result: (RotateLeft16 x (Neg8 <y.Type> y))
23482         for {
23483                 x := v_0
23484                 if v_1.Op != OpSub8 {
23485                         break
23486                 }
23487                 y := v_1.Args[1]
23488                 v_1_0 := v_1.Args[0]
23489                 if v_1_0.Op != OpConst8 {
23490                         break
23491                 }
23492                 c := auxIntToInt8(v_1_0.AuxInt)
23493                 if !(c&15 == 0) {
23494                         break
23495                 }
23496                 v.reset(OpRotateLeft16)
23497                 v0 := b.NewValue0(v.Pos, OpNeg8, y.Type)
23498                 v0.AddArg(y)
23499                 v.AddArg2(x, v0)
23500                 return true
23501         }
23502         // match: (RotateLeft16 x (Const64 <t> [c]))
23503         // cond: config.PtrSize == 4
23504         // result: (RotateLeft16 x (Const32 <t> [int32(c)]))
23505         for {
23506                 x := v_0
23507                 if v_1.Op != OpConst64 {
23508                         break
23509                 }
23510                 t := v_1.Type
23511                 c := auxIntToInt64(v_1.AuxInt)
23512                 if !(config.PtrSize == 4) {
23513                         break
23514                 }
23515                 v.reset(OpRotateLeft16)
23516                 v0 := b.NewValue0(v.Pos, OpConst32, t)
23517                 v0.AuxInt = int32ToAuxInt(int32(c))
23518                 v.AddArg2(x, v0)
23519                 return true
23520         }
23521         // match: (RotateLeft16 (RotateLeft16 x c) d)
23522         // cond: c.Type.Size() == 8 && d.Type.Size() == 8
23523         // result: (RotateLeft16 x (Add64 <c.Type> c d))
23524         for {
23525                 if v_0.Op != OpRotateLeft16 {
23526                         break
23527                 }
23528                 c := v_0.Args[1]
23529                 x := v_0.Args[0]
23530                 d := v_1
23531                 if !(c.Type.Size() == 8 && d.Type.Size() == 8) {
23532                         break
23533                 }
23534                 v.reset(OpRotateLeft16)
23535                 v0 := b.NewValue0(v.Pos, OpAdd64, c.Type)
23536                 v0.AddArg2(c, d)
23537                 v.AddArg2(x, v0)
23538                 return true
23539         }
23540         // match: (RotateLeft16 (RotateLeft16 x c) d)
23541         // cond: c.Type.Size() == 4 && d.Type.Size() == 4
23542         // result: (RotateLeft16 x (Add32 <c.Type> c d))
23543         for {
23544                 if v_0.Op != OpRotateLeft16 {
23545                         break
23546                 }
23547                 c := v_0.Args[1]
23548                 x := v_0.Args[0]
23549                 d := v_1
23550                 if !(c.Type.Size() == 4 && d.Type.Size() == 4) {
23551                         break
23552                 }
23553                 v.reset(OpRotateLeft16)
23554                 v0 := b.NewValue0(v.Pos, OpAdd32, c.Type)
23555                 v0.AddArg2(c, d)
23556                 v.AddArg2(x, v0)
23557                 return true
23558         }
23559         // match: (RotateLeft16 (RotateLeft16 x c) d)
23560         // cond: c.Type.Size() == 2 && d.Type.Size() == 2
23561         // result: (RotateLeft16 x (Add16 <c.Type> c d))
23562         for {
23563                 if v_0.Op != OpRotateLeft16 {
23564                         break
23565                 }
23566                 c := v_0.Args[1]
23567                 x := v_0.Args[0]
23568                 d := v_1
23569                 if !(c.Type.Size() == 2 && d.Type.Size() == 2) {
23570                         break
23571                 }
23572                 v.reset(OpRotateLeft16)
23573                 v0 := b.NewValue0(v.Pos, OpAdd16, c.Type)
23574                 v0.AddArg2(c, d)
23575                 v.AddArg2(x, v0)
23576                 return true
23577         }
23578         // match: (RotateLeft16 (RotateLeft16 x c) d)
23579         // cond: c.Type.Size() == 1 && d.Type.Size() == 1
23580         // result: (RotateLeft16 x (Add8 <c.Type> c d))
23581         for {
23582                 if v_0.Op != OpRotateLeft16 {
23583                         break
23584                 }
23585                 c := v_0.Args[1]
23586                 x := v_0.Args[0]
23587                 d := v_1
23588                 if !(c.Type.Size() == 1 && d.Type.Size() == 1) {
23589                         break
23590                 }
23591                 v.reset(OpRotateLeft16)
23592                 v0 := b.NewValue0(v.Pos, OpAdd8, c.Type)
23593                 v0.AddArg2(c, d)
23594                 v.AddArg2(x, v0)
23595                 return true
23596         }
23597         return false
23598 }
23599 func rewriteValuegeneric_OpRotateLeft32(v *Value) bool {
23600         v_1 := v.Args[1]
23601         v_0 := v.Args[0]
23602         b := v.Block
23603         config := b.Func.Config
23604         // match: (RotateLeft32 x (Const32 [c]))
23605         // cond: c%32 == 0
23606         // result: x
23607         for {
23608                 x := v_0
23609                 if v_1.Op != OpConst32 {
23610                         break
23611                 }
23612                 c := auxIntToInt32(v_1.AuxInt)
23613                 if !(c%32 == 0) {
23614                         break
23615                 }
23616                 v.copyOf(x)
23617                 return true
23618         }
23619         // match: (RotateLeft32 x (And64 y (Const64 [c])))
23620         // cond: c&31 == 31
23621         // result: (RotateLeft32 x y)
23622         for {
23623                 x := v_0
23624                 if v_1.Op != OpAnd64 {
23625                         break
23626                 }
23627                 _ = v_1.Args[1]
23628                 v_1_0 := v_1.Args[0]
23629                 v_1_1 := v_1.Args[1]
23630                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
23631                         y := v_1_0
23632                         if v_1_1.Op != OpConst64 {
23633                                 continue
23634                         }
23635                         c := auxIntToInt64(v_1_1.AuxInt)
23636                         if !(c&31 == 31) {
23637                                 continue
23638                         }
23639                         v.reset(OpRotateLeft32)
23640                         v.AddArg2(x, y)
23641                         return true
23642                 }
23643                 break
23644         }
23645         // match: (RotateLeft32 x (And32 y (Const32 [c])))
23646         // cond: c&31 == 31
23647         // result: (RotateLeft32 x y)
23648         for {
23649                 x := v_0
23650                 if v_1.Op != OpAnd32 {
23651                         break
23652                 }
23653                 _ = v_1.Args[1]
23654                 v_1_0 := v_1.Args[0]
23655                 v_1_1 := v_1.Args[1]
23656                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
23657                         y := v_1_0
23658                         if v_1_1.Op != OpConst32 {
23659                                 continue
23660                         }
23661                         c := auxIntToInt32(v_1_1.AuxInt)
23662                         if !(c&31 == 31) {
23663                                 continue
23664                         }
23665                         v.reset(OpRotateLeft32)
23666                         v.AddArg2(x, y)
23667                         return true
23668                 }
23669                 break
23670         }
23671         // match: (RotateLeft32 x (And16 y (Const16 [c])))
23672         // cond: c&31 == 31
23673         // result: (RotateLeft32 x y)
23674         for {
23675                 x := v_0
23676                 if v_1.Op != OpAnd16 {
23677                         break
23678                 }
23679                 _ = v_1.Args[1]
23680                 v_1_0 := v_1.Args[0]
23681                 v_1_1 := v_1.Args[1]
23682                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
23683                         y := v_1_0
23684                         if v_1_1.Op != OpConst16 {
23685                                 continue
23686                         }
23687                         c := auxIntToInt16(v_1_1.AuxInt)
23688                         if !(c&31 == 31) {
23689                                 continue
23690                         }
23691                         v.reset(OpRotateLeft32)
23692                         v.AddArg2(x, y)
23693                         return true
23694                 }
23695                 break
23696         }
23697         // match: (RotateLeft32 x (And8 y (Const8 [c])))
23698         // cond: c&31 == 31
23699         // result: (RotateLeft32 x y)
23700         for {
23701                 x := v_0
23702                 if v_1.Op != OpAnd8 {
23703                         break
23704                 }
23705                 _ = v_1.Args[1]
23706                 v_1_0 := v_1.Args[0]
23707                 v_1_1 := v_1.Args[1]
23708                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
23709                         y := v_1_0
23710                         if v_1_1.Op != OpConst8 {
23711                                 continue
23712                         }
23713                         c := auxIntToInt8(v_1_1.AuxInt)
23714                         if !(c&31 == 31) {
23715                                 continue
23716                         }
23717                         v.reset(OpRotateLeft32)
23718                         v.AddArg2(x, y)
23719                         return true
23720                 }
23721                 break
23722         }
23723         // match: (RotateLeft32 x (Neg64 (And64 y (Const64 [c]))))
23724         // cond: c&31 == 31
23725         // result: (RotateLeft32 x (Neg64 <y.Type> y))
23726         for {
23727                 x := v_0
23728                 if v_1.Op != OpNeg64 {
23729                         break
23730                 }
23731                 v_1_0 := v_1.Args[0]
23732                 if v_1_0.Op != OpAnd64 {
23733                         break
23734                 }
23735                 _ = v_1_0.Args[1]
23736                 v_1_0_0 := v_1_0.Args[0]
23737                 v_1_0_1 := v_1_0.Args[1]
23738                 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
23739                         y := v_1_0_0
23740                         if v_1_0_1.Op != OpConst64 {
23741                                 continue
23742                         }
23743                         c := auxIntToInt64(v_1_0_1.AuxInt)
23744                         if !(c&31 == 31) {
23745                                 continue
23746                         }
23747                         v.reset(OpRotateLeft32)
23748                         v0 := b.NewValue0(v.Pos, OpNeg64, y.Type)
23749                         v0.AddArg(y)
23750                         v.AddArg2(x, v0)
23751                         return true
23752                 }
23753                 break
23754         }
23755         // match: (RotateLeft32 x (Neg32 (And32 y (Const32 [c]))))
23756         // cond: c&31 == 31
23757         // result: (RotateLeft32 x (Neg32 <y.Type> y))
23758         for {
23759                 x := v_0
23760                 if v_1.Op != OpNeg32 {
23761                         break
23762                 }
23763                 v_1_0 := v_1.Args[0]
23764                 if v_1_0.Op != OpAnd32 {
23765                         break
23766                 }
23767                 _ = v_1_0.Args[1]
23768                 v_1_0_0 := v_1_0.Args[0]
23769                 v_1_0_1 := v_1_0.Args[1]
23770                 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
23771                         y := v_1_0_0
23772                         if v_1_0_1.Op != OpConst32 {
23773                                 continue
23774                         }
23775                         c := auxIntToInt32(v_1_0_1.AuxInt)
23776                         if !(c&31 == 31) {
23777                                 continue
23778                         }
23779                         v.reset(OpRotateLeft32)
23780                         v0 := b.NewValue0(v.Pos, OpNeg32, y.Type)
23781                         v0.AddArg(y)
23782                         v.AddArg2(x, v0)
23783                         return true
23784                 }
23785                 break
23786         }
23787         // match: (RotateLeft32 x (Neg16 (And16 y (Const16 [c]))))
23788         // cond: c&31 == 31
23789         // result: (RotateLeft32 x (Neg16 <y.Type> y))
23790         for {
23791                 x := v_0
23792                 if v_1.Op != OpNeg16 {
23793                         break
23794                 }
23795                 v_1_0 := v_1.Args[0]
23796                 if v_1_0.Op != OpAnd16 {
23797                         break
23798                 }
23799                 _ = v_1_0.Args[1]
23800                 v_1_0_0 := v_1_0.Args[0]
23801                 v_1_0_1 := v_1_0.Args[1]
23802                 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
23803                         y := v_1_0_0
23804                         if v_1_0_1.Op != OpConst16 {
23805                                 continue
23806                         }
23807                         c := auxIntToInt16(v_1_0_1.AuxInt)
23808                         if !(c&31 == 31) {
23809                                 continue
23810                         }
23811                         v.reset(OpRotateLeft32)
23812                         v0 := b.NewValue0(v.Pos, OpNeg16, y.Type)
23813                         v0.AddArg(y)
23814                         v.AddArg2(x, v0)
23815                         return true
23816                 }
23817                 break
23818         }
23819         // match: (RotateLeft32 x (Neg8 (And8 y (Const8 [c]))))
23820         // cond: c&31 == 31
23821         // result: (RotateLeft32 x (Neg8 <y.Type> y))
23822         for {
23823                 x := v_0
23824                 if v_1.Op != OpNeg8 {
23825                         break
23826                 }
23827                 v_1_0 := v_1.Args[0]
23828                 if v_1_0.Op != OpAnd8 {
23829                         break
23830                 }
23831                 _ = v_1_0.Args[1]
23832                 v_1_0_0 := v_1_0.Args[0]
23833                 v_1_0_1 := v_1_0.Args[1]
23834                 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
23835                         y := v_1_0_0
23836                         if v_1_0_1.Op != OpConst8 {
23837                                 continue
23838                         }
23839                         c := auxIntToInt8(v_1_0_1.AuxInt)
23840                         if !(c&31 == 31) {
23841                                 continue
23842                         }
23843                         v.reset(OpRotateLeft32)
23844                         v0 := b.NewValue0(v.Pos, OpNeg8, y.Type)
23845                         v0.AddArg(y)
23846                         v.AddArg2(x, v0)
23847                         return true
23848                 }
23849                 break
23850         }
23851         // match: (RotateLeft32 x (Add64 y (Const64 [c])))
23852         // cond: c&31 == 0
23853         // result: (RotateLeft32 x y)
23854         for {
23855                 x := v_0
23856                 if v_1.Op != OpAdd64 {
23857                         break
23858                 }
23859                 _ = v_1.Args[1]
23860                 v_1_0 := v_1.Args[0]
23861                 v_1_1 := v_1.Args[1]
23862                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
23863                         y := v_1_0
23864                         if v_1_1.Op != OpConst64 {
23865                                 continue
23866                         }
23867                         c := auxIntToInt64(v_1_1.AuxInt)
23868                         if !(c&31 == 0) {
23869                                 continue
23870                         }
23871                         v.reset(OpRotateLeft32)
23872                         v.AddArg2(x, y)
23873                         return true
23874                 }
23875                 break
23876         }
23877         // match: (RotateLeft32 x (Add32 y (Const32 [c])))
23878         // cond: c&31 == 0
23879         // result: (RotateLeft32 x y)
23880         for {
23881                 x := v_0
23882                 if v_1.Op != OpAdd32 {
23883                         break
23884                 }
23885                 _ = v_1.Args[1]
23886                 v_1_0 := v_1.Args[0]
23887                 v_1_1 := v_1.Args[1]
23888                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
23889                         y := v_1_0
23890                         if v_1_1.Op != OpConst32 {
23891                                 continue
23892                         }
23893                         c := auxIntToInt32(v_1_1.AuxInt)
23894                         if !(c&31 == 0) {
23895                                 continue
23896                         }
23897                         v.reset(OpRotateLeft32)
23898                         v.AddArg2(x, y)
23899                         return true
23900                 }
23901                 break
23902         }
23903         // match: (RotateLeft32 x (Add16 y (Const16 [c])))
23904         // cond: c&31 == 0
23905         // result: (RotateLeft32 x y)
23906         for {
23907                 x := v_0
23908                 if v_1.Op != OpAdd16 {
23909                         break
23910                 }
23911                 _ = v_1.Args[1]
23912                 v_1_0 := v_1.Args[0]
23913                 v_1_1 := v_1.Args[1]
23914                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
23915                         y := v_1_0
23916                         if v_1_1.Op != OpConst16 {
23917                                 continue
23918                         }
23919                         c := auxIntToInt16(v_1_1.AuxInt)
23920                         if !(c&31 == 0) {
23921                                 continue
23922                         }
23923                         v.reset(OpRotateLeft32)
23924                         v.AddArg2(x, y)
23925                         return true
23926                 }
23927                 break
23928         }
23929         // match: (RotateLeft32 x (Add8 y (Const8 [c])))
23930         // cond: c&31 == 0
23931         // result: (RotateLeft32 x y)
23932         for {
23933                 x := v_0
23934                 if v_1.Op != OpAdd8 {
23935                         break
23936                 }
23937                 _ = v_1.Args[1]
23938                 v_1_0 := v_1.Args[0]
23939                 v_1_1 := v_1.Args[1]
23940                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
23941                         y := v_1_0
23942                         if v_1_1.Op != OpConst8 {
23943                                 continue
23944                         }
23945                         c := auxIntToInt8(v_1_1.AuxInt)
23946                         if !(c&31 == 0) {
23947                                 continue
23948                         }
23949                         v.reset(OpRotateLeft32)
23950                         v.AddArg2(x, y)
23951                         return true
23952                 }
23953                 break
23954         }
23955         // match: (RotateLeft32 x (Sub64 (Const64 [c]) y))
23956         // cond: c&31 == 0
23957         // result: (RotateLeft32 x (Neg64 <y.Type> y))
23958         for {
23959                 x := v_0
23960                 if v_1.Op != OpSub64 {
23961                         break
23962                 }
23963                 y := v_1.Args[1]
23964                 v_1_0 := v_1.Args[0]
23965                 if v_1_0.Op != OpConst64 {
23966                         break
23967                 }
23968                 c := auxIntToInt64(v_1_0.AuxInt)
23969                 if !(c&31 == 0) {
23970                         break
23971                 }
23972                 v.reset(OpRotateLeft32)
23973                 v0 := b.NewValue0(v.Pos, OpNeg64, y.Type)
23974                 v0.AddArg(y)
23975                 v.AddArg2(x, v0)
23976                 return true
23977         }
23978         // match: (RotateLeft32 x (Sub32 (Const32 [c]) y))
23979         // cond: c&31 == 0
23980         // result: (RotateLeft32 x (Neg32 <y.Type> y))
23981         for {
23982                 x := v_0
23983                 if v_1.Op != OpSub32 {
23984                         break
23985                 }
23986                 y := v_1.Args[1]
23987                 v_1_0 := v_1.Args[0]
23988                 if v_1_0.Op != OpConst32 {
23989                         break
23990                 }
23991                 c := auxIntToInt32(v_1_0.AuxInt)
23992                 if !(c&31 == 0) {
23993                         break
23994                 }
23995                 v.reset(OpRotateLeft32)
23996                 v0 := b.NewValue0(v.Pos, OpNeg32, y.Type)
23997                 v0.AddArg(y)
23998                 v.AddArg2(x, v0)
23999                 return true
24000         }
24001         // match: (RotateLeft32 x (Sub16 (Const16 [c]) y))
24002         // cond: c&31 == 0
24003         // result: (RotateLeft32 x (Neg16 <y.Type> y))
24004         for {
24005                 x := v_0
24006                 if v_1.Op != OpSub16 {
24007                         break
24008                 }
24009                 y := v_1.Args[1]
24010                 v_1_0 := v_1.Args[0]
24011                 if v_1_0.Op != OpConst16 {
24012                         break
24013                 }
24014                 c := auxIntToInt16(v_1_0.AuxInt)
24015                 if !(c&31 == 0) {
24016                         break
24017                 }
24018                 v.reset(OpRotateLeft32)
24019                 v0 := b.NewValue0(v.Pos, OpNeg16, y.Type)
24020                 v0.AddArg(y)
24021                 v.AddArg2(x, v0)
24022                 return true
24023         }
24024         // match: (RotateLeft32 x (Sub8 (Const8 [c]) y))
24025         // cond: c&31 == 0
24026         // result: (RotateLeft32 x (Neg8 <y.Type> y))
24027         for {
24028                 x := v_0
24029                 if v_1.Op != OpSub8 {
24030                         break
24031                 }
24032                 y := v_1.Args[1]
24033                 v_1_0 := v_1.Args[0]
24034                 if v_1_0.Op != OpConst8 {
24035                         break
24036                 }
24037                 c := auxIntToInt8(v_1_0.AuxInt)
24038                 if !(c&31 == 0) {
24039                         break
24040                 }
24041                 v.reset(OpRotateLeft32)
24042                 v0 := b.NewValue0(v.Pos, OpNeg8, y.Type)
24043                 v0.AddArg(y)
24044                 v.AddArg2(x, v0)
24045                 return true
24046         }
24047         // match: (RotateLeft32 x (Const64 <t> [c]))
24048         // cond: config.PtrSize == 4
24049         // result: (RotateLeft32 x (Const32 <t> [int32(c)]))
24050         for {
24051                 x := v_0
24052                 if v_1.Op != OpConst64 {
24053                         break
24054                 }
24055                 t := v_1.Type
24056                 c := auxIntToInt64(v_1.AuxInt)
24057                 if !(config.PtrSize == 4) {
24058                         break
24059                 }
24060                 v.reset(OpRotateLeft32)
24061                 v0 := b.NewValue0(v.Pos, OpConst32, t)
24062                 v0.AuxInt = int32ToAuxInt(int32(c))
24063                 v.AddArg2(x, v0)
24064                 return true
24065         }
24066         // match: (RotateLeft32 (RotateLeft32 x c) d)
24067         // cond: c.Type.Size() == 8 && d.Type.Size() == 8
24068         // result: (RotateLeft32 x (Add64 <c.Type> c d))
24069         for {
24070                 if v_0.Op != OpRotateLeft32 {
24071                         break
24072                 }
24073                 c := v_0.Args[1]
24074                 x := v_0.Args[0]
24075                 d := v_1
24076                 if !(c.Type.Size() == 8 && d.Type.Size() == 8) {
24077                         break
24078                 }
24079                 v.reset(OpRotateLeft32)
24080                 v0 := b.NewValue0(v.Pos, OpAdd64, c.Type)
24081                 v0.AddArg2(c, d)
24082                 v.AddArg2(x, v0)
24083                 return true
24084         }
24085         // match: (RotateLeft32 (RotateLeft32 x c) d)
24086         // cond: c.Type.Size() == 4 && d.Type.Size() == 4
24087         // result: (RotateLeft32 x (Add32 <c.Type> c d))
24088         for {
24089                 if v_0.Op != OpRotateLeft32 {
24090                         break
24091                 }
24092                 c := v_0.Args[1]
24093                 x := v_0.Args[0]
24094                 d := v_1
24095                 if !(c.Type.Size() == 4 && d.Type.Size() == 4) {
24096                         break
24097                 }
24098                 v.reset(OpRotateLeft32)
24099                 v0 := b.NewValue0(v.Pos, OpAdd32, c.Type)
24100                 v0.AddArg2(c, d)
24101                 v.AddArg2(x, v0)
24102                 return true
24103         }
24104         // match: (RotateLeft32 (RotateLeft32 x c) d)
24105         // cond: c.Type.Size() == 2 && d.Type.Size() == 2
24106         // result: (RotateLeft32 x (Add16 <c.Type> c d))
24107         for {
24108                 if v_0.Op != OpRotateLeft32 {
24109                         break
24110                 }
24111                 c := v_0.Args[1]
24112                 x := v_0.Args[0]
24113                 d := v_1
24114                 if !(c.Type.Size() == 2 && d.Type.Size() == 2) {
24115                         break
24116                 }
24117                 v.reset(OpRotateLeft32)
24118                 v0 := b.NewValue0(v.Pos, OpAdd16, c.Type)
24119                 v0.AddArg2(c, d)
24120                 v.AddArg2(x, v0)
24121                 return true
24122         }
24123         // match: (RotateLeft32 (RotateLeft32 x c) d)
24124         // cond: c.Type.Size() == 1 && d.Type.Size() == 1
24125         // result: (RotateLeft32 x (Add8 <c.Type> c d))
24126         for {
24127                 if v_0.Op != OpRotateLeft32 {
24128                         break
24129                 }
24130                 c := v_0.Args[1]
24131                 x := v_0.Args[0]
24132                 d := v_1
24133                 if !(c.Type.Size() == 1 && d.Type.Size() == 1) {
24134                         break
24135                 }
24136                 v.reset(OpRotateLeft32)
24137                 v0 := b.NewValue0(v.Pos, OpAdd8, c.Type)
24138                 v0.AddArg2(c, d)
24139                 v.AddArg2(x, v0)
24140                 return true
24141         }
24142         return false
24143 }
24144 func rewriteValuegeneric_OpRotateLeft64(v *Value) bool {
24145         v_1 := v.Args[1]
24146         v_0 := v.Args[0]
24147         b := v.Block
24148         config := b.Func.Config
24149         // match: (RotateLeft64 x (Const64 [c]))
24150         // cond: c%64 == 0
24151         // result: x
24152         for {
24153                 x := v_0
24154                 if v_1.Op != OpConst64 {
24155                         break
24156                 }
24157                 c := auxIntToInt64(v_1.AuxInt)
24158                 if !(c%64 == 0) {
24159                         break
24160                 }
24161                 v.copyOf(x)
24162                 return true
24163         }
24164         // match: (RotateLeft64 x (And64 y (Const64 [c])))
24165         // cond: c&63 == 63
24166         // result: (RotateLeft64 x y)
24167         for {
24168                 x := v_0
24169                 if v_1.Op != OpAnd64 {
24170                         break
24171                 }
24172                 _ = v_1.Args[1]
24173                 v_1_0 := v_1.Args[0]
24174                 v_1_1 := v_1.Args[1]
24175                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
24176                         y := v_1_0
24177                         if v_1_1.Op != OpConst64 {
24178                                 continue
24179                         }
24180                         c := auxIntToInt64(v_1_1.AuxInt)
24181                         if !(c&63 == 63) {
24182                                 continue
24183                         }
24184                         v.reset(OpRotateLeft64)
24185                         v.AddArg2(x, y)
24186                         return true
24187                 }
24188                 break
24189         }
24190         // match: (RotateLeft64 x (And32 y (Const32 [c])))
24191         // cond: c&63 == 63
24192         // result: (RotateLeft64 x y)
24193         for {
24194                 x := v_0
24195                 if v_1.Op != OpAnd32 {
24196                         break
24197                 }
24198                 _ = v_1.Args[1]
24199                 v_1_0 := v_1.Args[0]
24200                 v_1_1 := v_1.Args[1]
24201                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
24202                         y := v_1_0
24203                         if v_1_1.Op != OpConst32 {
24204                                 continue
24205                         }
24206                         c := auxIntToInt32(v_1_1.AuxInt)
24207                         if !(c&63 == 63) {
24208                                 continue
24209                         }
24210                         v.reset(OpRotateLeft64)
24211                         v.AddArg2(x, y)
24212                         return true
24213                 }
24214                 break
24215         }
24216         // match: (RotateLeft64 x (And16 y (Const16 [c])))
24217         // cond: c&63 == 63
24218         // result: (RotateLeft64 x y)
24219         for {
24220                 x := v_0
24221                 if v_1.Op != OpAnd16 {
24222                         break
24223                 }
24224                 _ = v_1.Args[1]
24225                 v_1_0 := v_1.Args[0]
24226                 v_1_1 := v_1.Args[1]
24227                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
24228                         y := v_1_0
24229                         if v_1_1.Op != OpConst16 {
24230                                 continue
24231                         }
24232                         c := auxIntToInt16(v_1_1.AuxInt)
24233                         if !(c&63 == 63) {
24234                                 continue
24235                         }
24236                         v.reset(OpRotateLeft64)
24237                         v.AddArg2(x, y)
24238                         return true
24239                 }
24240                 break
24241         }
24242         // match: (RotateLeft64 x (And8 y (Const8 [c])))
24243         // cond: c&63 == 63
24244         // result: (RotateLeft64 x y)
24245         for {
24246                 x := v_0
24247                 if v_1.Op != OpAnd8 {
24248                         break
24249                 }
24250                 _ = v_1.Args[1]
24251                 v_1_0 := v_1.Args[0]
24252                 v_1_1 := v_1.Args[1]
24253                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
24254                         y := v_1_0
24255                         if v_1_1.Op != OpConst8 {
24256                                 continue
24257                         }
24258                         c := auxIntToInt8(v_1_1.AuxInt)
24259                         if !(c&63 == 63) {
24260                                 continue
24261                         }
24262                         v.reset(OpRotateLeft64)
24263                         v.AddArg2(x, y)
24264                         return true
24265                 }
24266                 break
24267         }
24268         // match: (RotateLeft64 x (Neg64 (And64 y (Const64 [c]))))
24269         // cond: c&63 == 63
24270         // result: (RotateLeft64 x (Neg64 <y.Type> y))
24271         for {
24272                 x := v_0
24273                 if v_1.Op != OpNeg64 {
24274                         break
24275                 }
24276                 v_1_0 := v_1.Args[0]
24277                 if v_1_0.Op != OpAnd64 {
24278                         break
24279                 }
24280                 _ = v_1_0.Args[1]
24281                 v_1_0_0 := v_1_0.Args[0]
24282                 v_1_0_1 := v_1_0.Args[1]
24283                 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
24284                         y := v_1_0_0
24285                         if v_1_0_1.Op != OpConst64 {
24286                                 continue
24287                         }
24288                         c := auxIntToInt64(v_1_0_1.AuxInt)
24289                         if !(c&63 == 63) {
24290                                 continue
24291                         }
24292                         v.reset(OpRotateLeft64)
24293                         v0 := b.NewValue0(v.Pos, OpNeg64, y.Type)
24294                         v0.AddArg(y)
24295                         v.AddArg2(x, v0)
24296                         return true
24297                 }
24298                 break
24299         }
24300         // match: (RotateLeft64 x (Neg32 (And32 y (Const32 [c]))))
24301         // cond: c&63 == 63
24302         // result: (RotateLeft64 x (Neg32 <y.Type> y))
24303         for {
24304                 x := v_0
24305                 if v_1.Op != OpNeg32 {
24306                         break
24307                 }
24308                 v_1_0 := v_1.Args[0]
24309                 if v_1_0.Op != OpAnd32 {
24310                         break
24311                 }
24312                 _ = v_1_0.Args[1]
24313                 v_1_0_0 := v_1_0.Args[0]
24314                 v_1_0_1 := v_1_0.Args[1]
24315                 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
24316                         y := v_1_0_0
24317                         if v_1_0_1.Op != OpConst32 {
24318                                 continue
24319                         }
24320                         c := auxIntToInt32(v_1_0_1.AuxInt)
24321                         if !(c&63 == 63) {
24322                                 continue
24323                         }
24324                         v.reset(OpRotateLeft64)
24325                         v0 := b.NewValue0(v.Pos, OpNeg32, y.Type)
24326                         v0.AddArg(y)
24327                         v.AddArg2(x, v0)
24328                         return true
24329                 }
24330                 break
24331         }
24332         // match: (RotateLeft64 x (Neg16 (And16 y (Const16 [c]))))
24333         // cond: c&63 == 63
24334         // result: (RotateLeft64 x (Neg16 <y.Type> y))
24335         for {
24336                 x := v_0
24337                 if v_1.Op != OpNeg16 {
24338                         break
24339                 }
24340                 v_1_0 := v_1.Args[0]
24341                 if v_1_0.Op != OpAnd16 {
24342                         break
24343                 }
24344                 _ = v_1_0.Args[1]
24345                 v_1_0_0 := v_1_0.Args[0]
24346                 v_1_0_1 := v_1_0.Args[1]
24347                 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
24348                         y := v_1_0_0
24349                         if v_1_0_1.Op != OpConst16 {
24350                                 continue
24351                         }
24352                         c := auxIntToInt16(v_1_0_1.AuxInt)
24353                         if !(c&63 == 63) {
24354                                 continue
24355                         }
24356                         v.reset(OpRotateLeft64)
24357                         v0 := b.NewValue0(v.Pos, OpNeg16, y.Type)
24358                         v0.AddArg(y)
24359                         v.AddArg2(x, v0)
24360                         return true
24361                 }
24362                 break
24363         }
24364         // match: (RotateLeft64 x (Neg8 (And8 y (Const8 [c]))))
24365         // cond: c&63 == 63
24366         // result: (RotateLeft64 x (Neg8 <y.Type> y))
24367         for {
24368                 x := v_0
24369                 if v_1.Op != OpNeg8 {
24370                         break
24371                 }
24372                 v_1_0 := v_1.Args[0]
24373                 if v_1_0.Op != OpAnd8 {
24374                         break
24375                 }
24376                 _ = v_1_0.Args[1]
24377                 v_1_0_0 := v_1_0.Args[0]
24378                 v_1_0_1 := v_1_0.Args[1]
24379                 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
24380                         y := v_1_0_0
24381                         if v_1_0_1.Op != OpConst8 {
24382                                 continue
24383                         }
24384                         c := auxIntToInt8(v_1_0_1.AuxInt)
24385                         if !(c&63 == 63) {
24386                                 continue
24387                         }
24388                         v.reset(OpRotateLeft64)
24389                         v0 := b.NewValue0(v.Pos, OpNeg8, y.Type)
24390                         v0.AddArg(y)
24391                         v.AddArg2(x, v0)
24392                         return true
24393                 }
24394                 break
24395         }
24396         // match: (RotateLeft64 x (Add64 y (Const64 [c])))
24397         // cond: c&63 == 0
24398         // result: (RotateLeft64 x y)
24399         for {
24400                 x := v_0
24401                 if v_1.Op != OpAdd64 {
24402                         break
24403                 }
24404                 _ = v_1.Args[1]
24405                 v_1_0 := v_1.Args[0]
24406                 v_1_1 := v_1.Args[1]
24407                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
24408                         y := v_1_0
24409                         if v_1_1.Op != OpConst64 {
24410                                 continue
24411                         }
24412                         c := auxIntToInt64(v_1_1.AuxInt)
24413                         if !(c&63 == 0) {
24414                                 continue
24415                         }
24416                         v.reset(OpRotateLeft64)
24417                         v.AddArg2(x, y)
24418                         return true
24419                 }
24420                 break
24421         }
24422         // match: (RotateLeft64 x (Add32 y (Const32 [c])))
24423         // cond: c&63 == 0
24424         // result: (RotateLeft64 x y)
24425         for {
24426                 x := v_0
24427                 if v_1.Op != OpAdd32 {
24428                         break
24429                 }
24430                 _ = v_1.Args[1]
24431                 v_1_0 := v_1.Args[0]
24432                 v_1_1 := v_1.Args[1]
24433                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
24434                         y := v_1_0
24435                         if v_1_1.Op != OpConst32 {
24436                                 continue
24437                         }
24438                         c := auxIntToInt32(v_1_1.AuxInt)
24439                         if !(c&63 == 0) {
24440                                 continue
24441                         }
24442                         v.reset(OpRotateLeft64)
24443                         v.AddArg2(x, y)
24444                         return true
24445                 }
24446                 break
24447         }
24448         // match: (RotateLeft64 x (Add16 y (Const16 [c])))
24449         // cond: c&63 == 0
24450         // result: (RotateLeft64 x y)
24451         for {
24452                 x := v_0
24453                 if v_1.Op != OpAdd16 {
24454                         break
24455                 }
24456                 _ = v_1.Args[1]
24457                 v_1_0 := v_1.Args[0]
24458                 v_1_1 := v_1.Args[1]
24459                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
24460                         y := v_1_0
24461                         if v_1_1.Op != OpConst16 {
24462                                 continue
24463                         }
24464                         c := auxIntToInt16(v_1_1.AuxInt)
24465                         if !(c&63 == 0) {
24466                                 continue
24467                         }
24468                         v.reset(OpRotateLeft64)
24469                         v.AddArg2(x, y)
24470                         return true
24471                 }
24472                 break
24473         }
24474         // match: (RotateLeft64 x (Add8 y (Const8 [c])))
24475         // cond: c&63 == 0
24476         // result: (RotateLeft64 x y)
24477         for {
24478                 x := v_0
24479                 if v_1.Op != OpAdd8 {
24480                         break
24481                 }
24482                 _ = v_1.Args[1]
24483                 v_1_0 := v_1.Args[0]
24484                 v_1_1 := v_1.Args[1]
24485                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
24486                         y := v_1_0
24487                         if v_1_1.Op != OpConst8 {
24488                                 continue
24489                         }
24490                         c := auxIntToInt8(v_1_1.AuxInt)
24491                         if !(c&63 == 0) {
24492                                 continue
24493                         }
24494                         v.reset(OpRotateLeft64)
24495                         v.AddArg2(x, y)
24496                         return true
24497                 }
24498                 break
24499         }
24500         // match: (RotateLeft64 x (Sub64 (Const64 [c]) y))
24501         // cond: c&63 == 0
24502         // result: (RotateLeft64 x (Neg64 <y.Type> y))
24503         for {
24504                 x := v_0
24505                 if v_1.Op != OpSub64 {
24506                         break
24507                 }
24508                 y := v_1.Args[1]
24509                 v_1_0 := v_1.Args[0]
24510                 if v_1_0.Op != OpConst64 {
24511                         break
24512                 }
24513                 c := auxIntToInt64(v_1_0.AuxInt)
24514                 if !(c&63 == 0) {
24515                         break
24516                 }
24517                 v.reset(OpRotateLeft64)
24518                 v0 := b.NewValue0(v.Pos, OpNeg64, y.Type)
24519                 v0.AddArg(y)
24520                 v.AddArg2(x, v0)
24521                 return true
24522         }
24523         // match: (RotateLeft64 x (Sub32 (Const32 [c]) y))
24524         // cond: c&63 == 0
24525         // result: (RotateLeft64 x (Neg32 <y.Type> y))
24526         for {
24527                 x := v_0
24528                 if v_1.Op != OpSub32 {
24529                         break
24530                 }
24531                 y := v_1.Args[1]
24532                 v_1_0 := v_1.Args[0]
24533                 if v_1_0.Op != OpConst32 {
24534                         break
24535                 }
24536                 c := auxIntToInt32(v_1_0.AuxInt)
24537                 if !(c&63 == 0) {
24538                         break
24539                 }
24540                 v.reset(OpRotateLeft64)
24541                 v0 := b.NewValue0(v.Pos, OpNeg32, y.Type)
24542                 v0.AddArg(y)
24543                 v.AddArg2(x, v0)
24544                 return true
24545         }
24546         // match: (RotateLeft64 x (Sub16 (Const16 [c]) y))
24547         // cond: c&63 == 0
24548         // result: (RotateLeft64 x (Neg16 <y.Type> y))
24549         for {
24550                 x := v_0
24551                 if v_1.Op != OpSub16 {
24552                         break
24553                 }
24554                 y := v_1.Args[1]
24555                 v_1_0 := v_1.Args[0]
24556                 if v_1_0.Op != OpConst16 {
24557                         break
24558                 }
24559                 c := auxIntToInt16(v_1_0.AuxInt)
24560                 if !(c&63 == 0) {
24561                         break
24562                 }
24563                 v.reset(OpRotateLeft64)
24564                 v0 := b.NewValue0(v.Pos, OpNeg16, y.Type)
24565                 v0.AddArg(y)
24566                 v.AddArg2(x, v0)
24567                 return true
24568         }
24569         // match: (RotateLeft64 x (Sub8 (Const8 [c]) y))
24570         // cond: c&63 == 0
24571         // result: (RotateLeft64 x (Neg8 <y.Type> y))
24572         for {
24573                 x := v_0
24574                 if v_1.Op != OpSub8 {
24575                         break
24576                 }
24577                 y := v_1.Args[1]
24578                 v_1_0 := v_1.Args[0]
24579                 if v_1_0.Op != OpConst8 {
24580                         break
24581                 }
24582                 c := auxIntToInt8(v_1_0.AuxInt)
24583                 if !(c&63 == 0) {
24584                         break
24585                 }
24586                 v.reset(OpRotateLeft64)
24587                 v0 := b.NewValue0(v.Pos, OpNeg8, y.Type)
24588                 v0.AddArg(y)
24589                 v.AddArg2(x, v0)
24590                 return true
24591         }
24592         // match: (RotateLeft64 x (Const64 <t> [c]))
24593         // cond: config.PtrSize == 4
24594         // result: (RotateLeft64 x (Const32 <t> [int32(c)]))
24595         for {
24596                 x := v_0
24597                 if v_1.Op != OpConst64 {
24598                         break
24599                 }
24600                 t := v_1.Type
24601                 c := auxIntToInt64(v_1.AuxInt)
24602                 if !(config.PtrSize == 4) {
24603                         break
24604                 }
24605                 v.reset(OpRotateLeft64)
24606                 v0 := b.NewValue0(v.Pos, OpConst32, t)
24607                 v0.AuxInt = int32ToAuxInt(int32(c))
24608                 v.AddArg2(x, v0)
24609                 return true
24610         }
24611         // match: (RotateLeft64 (RotateLeft64 x c) d)
24612         // cond: c.Type.Size() == 8 && d.Type.Size() == 8
24613         // result: (RotateLeft64 x (Add64 <c.Type> c d))
24614         for {
24615                 if v_0.Op != OpRotateLeft64 {
24616                         break
24617                 }
24618                 c := v_0.Args[1]
24619                 x := v_0.Args[0]
24620                 d := v_1
24621                 if !(c.Type.Size() == 8 && d.Type.Size() == 8) {
24622                         break
24623                 }
24624                 v.reset(OpRotateLeft64)
24625                 v0 := b.NewValue0(v.Pos, OpAdd64, c.Type)
24626                 v0.AddArg2(c, d)
24627                 v.AddArg2(x, v0)
24628                 return true
24629         }
24630         // match: (RotateLeft64 (RotateLeft64 x c) d)
24631         // cond: c.Type.Size() == 4 && d.Type.Size() == 4
24632         // result: (RotateLeft64 x (Add32 <c.Type> c d))
24633         for {
24634                 if v_0.Op != OpRotateLeft64 {
24635                         break
24636                 }
24637                 c := v_0.Args[1]
24638                 x := v_0.Args[0]
24639                 d := v_1
24640                 if !(c.Type.Size() == 4 && d.Type.Size() == 4) {
24641                         break
24642                 }
24643                 v.reset(OpRotateLeft64)
24644                 v0 := b.NewValue0(v.Pos, OpAdd32, c.Type)
24645                 v0.AddArg2(c, d)
24646                 v.AddArg2(x, v0)
24647                 return true
24648         }
24649         // match: (RotateLeft64 (RotateLeft64 x c) d)
24650         // cond: c.Type.Size() == 2 && d.Type.Size() == 2
24651         // result: (RotateLeft64 x (Add16 <c.Type> c d))
24652         for {
24653                 if v_0.Op != OpRotateLeft64 {
24654                         break
24655                 }
24656                 c := v_0.Args[1]
24657                 x := v_0.Args[0]
24658                 d := v_1
24659                 if !(c.Type.Size() == 2 && d.Type.Size() == 2) {
24660                         break
24661                 }
24662                 v.reset(OpRotateLeft64)
24663                 v0 := b.NewValue0(v.Pos, OpAdd16, c.Type)
24664                 v0.AddArg2(c, d)
24665                 v.AddArg2(x, v0)
24666                 return true
24667         }
24668         // match: (RotateLeft64 (RotateLeft64 x c) d)
24669         // cond: c.Type.Size() == 1 && d.Type.Size() == 1
24670         // result: (RotateLeft64 x (Add8 <c.Type> c d))
24671         for {
24672                 if v_0.Op != OpRotateLeft64 {
24673                         break
24674                 }
24675                 c := v_0.Args[1]
24676                 x := v_0.Args[0]
24677                 d := v_1
24678                 if !(c.Type.Size() == 1 && d.Type.Size() == 1) {
24679                         break
24680                 }
24681                 v.reset(OpRotateLeft64)
24682                 v0 := b.NewValue0(v.Pos, OpAdd8, c.Type)
24683                 v0.AddArg2(c, d)
24684                 v.AddArg2(x, v0)
24685                 return true
24686         }
24687         return false
24688 }
24689 func rewriteValuegeneric_OpRotateLeft8(v *Value) bool {
24690         v_1 := v.Args[1]
24691         v_0 := v.Args[0]
24692         b := v.Block
24693         config := b.Func.Config
24694         // match: (RotateLeft8 x (Const8 [c]))
24695         // cond: c%8 == 0
24696         // result: x
24697         for {
24698                 x := v_0
24699                 if v_1.Op != OpConst8 {
24700                         break
24701                 }
24702                 c := auxIntToInt8(v_1.AuxInt)
24703                 if !(c%8 == 0) {
24704                         break
24705                 }
24706                 v.copyOf(x)
24707                 return true
24708         }
24709         // match: (RotateLeft8 x (And64 y (Const64 [c])))
24710         // cond: c&7 == 7
24711         // result: (RotateLeft8 x y)
24712         for {
24713                 x := v_0
24714                 if v_1.Op != OpAnd64 {
24715                         break
24716                 }
24717                 _ = v_1.Args[1]
24718                 v_1_0 := v_1.Args[0]
24719                 v_1_1 := v_1.Args[1]
24720                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
24721                         y := v_1_0
24722                         if v_1_1.Op != OpConst64 {
24723                                 continue
24724                         }
24725                         c := auxIntToInt64(v_1_1.AuxInt)
24726                         if !(c&7 == 7) {
24727                                 continue
24728                         }
24729                         v.reset(OpRotateLeft8)
24730                         v.AddArg2(x, y)
24731                         return true
24732                 }
24733                 break
24734         }
24735         // match: (RotateLeft8 x (And32 y (Const32 [c])))
24736         // cond: c&7 == 7
24737         // result: (RotateLeft8 x y)
24738         for {
24739                 x := v_0
24740                 if v_1.Op != OpAnd32 {
24741                         break
24742                 }
24743                 _ = v_1.Args[1]
24744                 v_1_0 := v_1.Args[0]
24745                 v_1_1 := v_1.Args[1]
24746                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
24747                         y := v_1_0
24748                         if v_1_1.Op != OpConst32 {
24749                                 continue
24750                         }
24751                         c := auxIntToInt32(v_1_1.AuxInt)
24752                         if !(c&7 == 7) {
24753                                 continue
24754                         }
24755                         v.reset(OpRotateLeft8)
24756                         v.AddArg2(x, y)
24757                         return true
24758                 }
24759                 break
24760         }
24761         // match: (RotateLeft8 x (And16 y (Const16 [c])))
24762         // cond: c&7 == 7
24763         // result: (RotateLeft8 x y)
24764         for {
24765                 x := v_0
24766                 if v_1.Op != OpAnd16 {
24767                         break
24768                 }
24769                 _ = v_1.Args[1]
24770                 v_1_0 := v_1.Args[0]
24771                 v_1_1 := v_1.Args[1]
24772                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
24773                         y := v_1_0
24774                         if v_1_1.Op != OpConst16 {
24775                                 continue
24776                         }
24777                         c := auxIntToInt16(v_1_1.AuxInt)
24778                         if !(c&7 == 7) {
24779                                 continue
24780                         }
24781                         v.reset(OpRotateLeft8)
24782                         v.AddArg2(x, y)
24783                         return true
24784                 }
24785                 break
24786         }
24787         // match: (RotateLeft8 x (And8 y (Const8 [c])))
24788         // cond: c&7 == 7
24789         // result: (RotateLeft8 x y)
24790         for {
24791                 x := v_0
24792                 if v_1.Op != OpAnd8 {
24793                         break
24794                 }
24795                 _ = v_1.Args[1]
24796                 v_1_0 := v_1.Args[0]
24797                 v_1_1 := v_1.Args[1]
24798                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
24799                         y := v_1_0
24800                         if v_1_1.Op != OpConst8 {
24801                                 continue
24802                         }
24803                         c := auxIntToInt8(v_1_1.AuxInt)
24804                         if !(c&7 == 7) {
24805                                 continue
24806                         }
24807                         v.reset(OpRotateLeft8)
24808                         v.AddArg2(x, y)
24809                         return true
24810                 }
24811                 break
24812         }
24813         // match: (RotateLeft8 x (Neg64 (And64 y (Const64 [c]))))
24814         // cond: c&7 == 7
24815         // result: (RotateLeft8 x (Neg64 <y.Type> y))
24816         for {
24817                 x := v_0
24818                 if v_1.Op != OpNeg64 {
24819                         break
24820                 }
24821                 v_1_0 := v_1.Args[0]
24822                 if v_1_0.Op != OpAnd64 {
24823                         break
24824                 }
24825                 _ = v_1_0.Args[1]
24826                 v_1_0_0 := v_1_0.Args[0]
24827                 v_1_0_1 := v_1_0.Args[1]
24828                 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
24829                         y := v_1_0_0
24830                         if v_1_0_1.Op != OpConst64 {
24831                                 continue
24832                         }
24833                         c := auxIntToInt64(v_1_0_1.AuxInt)
24834                         if !(c&7 == 7) {
24835                                 continue
24836                         }
24837                         v.reset(OpRotateLeft8)
24838                         v0 := b.NewValue0(v.Pos, OpNeg64, y.Type)
24839                         v0.AddArg(y)
24840                         v.AddArg2(x, v0)
24841                         return true
24842                 }
24843                 break
24844         }
24845         // match: (RotateLeft8 x (Neg32 (And32 y (Const32 [c]))))
24846         // cond: c&7 == 7
24847         // result: (RotateLeft8 x (Neg32 <y.Type> y))
24848         for {
24849                 x := v_0
24850                 if v_1.Op != OpNeg32 {
24851                         break
24852                 }
24853                 v_1_0 := v_1.Args[0]
24854                 if v_1_0.Op != OpAnd32 {
24855                         break
24856                 }
24857                 _ = v_1_0.Args[1]
24858                 v_1_0_0 := v_1_0.Args[0]
24859                 v_1_0_1 := v_1_0.Args[1]
24860                 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
24861                         y := v_1_0_0
24862                         if v_1_0_1.Op != OpConst32 {
24863                                 continue
24864                         }
24865                         c := auxIntToInt32(v_1_0_1.AuxInt)
24866                         if !(c&7 == 7) {
24867                                 continue
24868                         }
24869                         v.reset(OpRotateLeft8)
24870                         v0 := b.NewValue0(v.Pos, OpNeg32, y.Type)
24871                         v0.AddArg(y)
24872                         v.AddArg2(x, v0)
24873                         return true
24874                 }
24875                 break
24876         }
24877         // match: (RotateLeft8 x (Neg16 (And16 y (Const16 [c]))))
24878         // cond: c&7 == 7
24879         // result: (RotateLeft8 x (Neg16 <y.Type> y))
24880         for {
24881                 x := v_0
24882                 if v_1.Op != OpNeg16 {
24883                         break
24884                 }
24885                 v_1_0 := v_1.Args[0]
24886                 if v_1_0.Op != OpAnd16 {
24887                         break
24888                 }
24889                 _ = v_1_0.Args[1]
24890                 v_1_0_0 := v_1_0.Args[0]
24891                 v_1_0_1 := v_1_0.Args[1]
24892                 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
24893                         y := v_1_0_0
24894                         if v_1_0_1.Op != OpConst16 {
24895                                 continue
24896                         }
24897                         c := auxIntToInt16(v_1_0_1.AuxInt)
24898                         if !(c&7 == 7) {
24899                                 continue
24900                         }
24901                         v.reset(OpRotateLeft8)
24902                         v0 := b.NewValue0(v.Pos, OpNeg16, y.Type)
24903                         v0.AddArg(y)
24904                         v.AddArg2(x, v0)
24905                         return true
24906                 }
24907                 break
24908         }
24909         // match: (RotateLeft8 x (Neg8 (And8 y (Const8 [c]))))
24910         // cond: c&7 == 7
24911         // result: (RotateLeft8 x (Neg8 <y.Type> y))
24912         for {
24913                 x := v_0
24914                 if v_1.Op != OpNeg8 {
24915                         break
24916                 }
24917                 v_1_0 := v_1.Args[0]
24918                 if v_1_0.Op != OpAnd8 {
24919                         break
24920                 }
24921                 _ = v_1_0.Args[1]
24922                 v_1_0_0 := v_1_0.Args[0]
24923                 v_1_0_1 := v_1_0.Args[1]
24924                 for _i0 := 0; _i0 <= 1; _i0, v_1_0_0, v_1_0_1 = _i0+1, v_1_0_1, v_1_0_0 {
24925                         y := v_1_0_0
24926                         if v_1_0_1.Op != OpConst8 {
24927                                 continue
24928                         }
24929                         c := auxIntToInt8(v_1_0_1.AuxInt)
24930                         if !(c&7 == 7) {
24931                                 continue
24932                         }
24933                         v.reset(OpRotateLeft8)
24934                         v0 := b.NewValue0(v.Pos, OpNeg8, y.Type)
24935                         v0.AddArg(y)
24936                         v.AddArg2(x, v0)
24937                         return true
24938                 }
24939                 break
24940         }
24941         // match: (RotateLeft8 x (Add64 y (Const64 [c])))
24942         // cond: c&7 == 0
24943         // result: (RotateLeft8 x y)
24944         for {
24945                 x := v_0
24946                 if v_1.Op != OpAdd64 {
24947                         break
24948                 }
24949                 _ = v_1.Args[1]
24950                 v_1_0 := v_1.Args[0]
24951                 v_1_1 := v_1.Args[1]
24952                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
24953                         y := v_1_0
24954                         if v_1_1.Op != OpConst64 {
24955                                 continue
24956                         }
24957                         c := auxIntToInt64(v_1_1.AuxInt)
24958                         if !(c&7 == 0) {
24959                                 continue
24960                         }
24961                         v.reset(OpRotateLeft8)
24962                         v.AddArg2(x, y)
24963                         return true
24964                 }
24965                 break
24966         }
24967         // match: (RotateLeft8 x (Add32 y (Const32 [c])))
24968         // cond: c&7 == 0
24969         // result: (RotateLeft8 x y)
24970         for {
24971                 x := v_0
24972                 if v_1.Op != OpAdd32 {
24973                         break
24974                 }
24975                 _ = v_1.Args[1]
24976                 v_1_0 := v_1.Args[0]
24977                 v_1_1 := v_1.Args[1]
24978                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
24979                         y := v_1_0
24980                         if v_1_1.Op != OpConst32 {
24981                                 continue
24982                         }
24983                         c := auxIntToInt32(v_1_1.AuxInt)
24984                         if !(c&7 == 0) {
24985                                 continue
24986                         }
24987                         v.reset(OpRotateLeft8)
24988                         v.AddArg2(x, y)
24989                         return true
24990                 }
24991                 break
24992         }
24993         // match: (RotateLeft8 x (Add16 y (Const16 [c])))
24994         // cond: c&7 == 0
24995         // result: (RotateLeft8 x y)
24996         for {
24997                 x := v_0
24998                 if v_1.Op != OpAdd16 {
24999                         break
25000                 }
25001                 _ = v_1.Args[1]
25002                 v_1_0 := v_1.Args[0]
25003                 v_1_1 := v_1.Args[1]
25004                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
25005                         y := v_1_0
25006                         if v_1_1.Op != OpConst16 {
25007                                 continue
25008                         }
25009                         c := auxIntToInt16(v_1_1.AuxInt)
25010                         if !(c&7 == 0) {
25011                                 continue
25012                         }
25013                         v.reset(OpRotateLeft8)
25014                         v.AddArg2(x, y)
25015                         return true
25016                 }
25017                 break
25018         }
25019         // match: (RotateLeft8 x (Add8 y (Const8 [c])))
25020         // cond: c&7 == 0
25021         // result: (RotateLeft8 x y)
25022         for {
25023                 x := v_0
25024                 if v_1.Op != OpAdd8 {
25025                         break
25026                 }
25027                 _ = v_1.Args[1]
25028                 v_1_0 := v_1.Args[0]
25029                 v_1_1 := v_1.Args[1]
25030                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
25031                         y := v_1_0
25032                         if v_1_1.Op != OpConst8 {
25033                                 continue
25034                         }
25035                         c := auxIntToInt8(v_1_1.AuxInt)
25036                         if !(c&7 == 0) {
25037                                 continue
25038                         }
25039                         v.reset(OpRotateLeft8)
25040                         v.AddArg2(x, y)
25041                         return true
25042                 }
25043                 break
25044         }
25045         // match: (RotateLeft8 x (Sub64 (Const64 [c]) y))
25046         // cond: c&7 == 0
25047         // result: (RotateLeft8 x (Neg64 <y.Type> y))
25048         for {
25049                 x := v_0
25050                 if v_1.Op != OpSub64 {
25051                         break
25052                 }
25053                 y := v_1.Args[1]
25054                 v_1_0 := v_1.Args[0]
25055                 if v_1_0.Op != OpConst64 {
25056                         break
25057                 }
25058                 c := auxIntToInt64(v_1_0.AuxInt)
25059                 if !(c&7 == 0) {
25060                         break
25061                 }
25062                 v.reset(OpRotateLeft8)
25063                 v0 := b.NewValue0(v.Pos, OpNeg64, y.Type)
25064                 v0.AddArg(y)
25065                 v.AddArg2(x, v0)
25066                 return true
25067         }
25068         // match: (RotateLeft8 x (Sub32 (Const32 [c]) y))
25069         // cond: c&7 == 0
25070         // result: (RotateLeft8 x (Neg32 <y.Type> y))
25071         for {
25072                 x := v_0
25073                 if v_1.Op != OpSub32 {
25074                         break
25075                 }
25076                 y := v_1.Args[1]
25077                 v_1_0 := v_1.Args[0]
25078                 if v_1_0.Op != OpConst32 {
25079                         break
25080                 }
25081                 c := auxIntToInt32(v_1_0.AuxInt)
25082                 if !(c&7 == 0) {
25083                         break
25084                 }
25085                 v.reset(OpRotateLeft8)
25086                 v0 := b.NewValue0(v.Pos, OpNeg32, y.Type)
25087                 v0.AddArg(y)
25088                 v.AddArg2(x, v0)
25089                 return true
25090         }
25091         // match: (RotateLeft8 x (Sub16 (Const16 [c]) y))
25092         // cond: c&7 == 0
25093         // result: (RotateLeft8 x (Neg16 <y.Type> y))
25094         for {
25095                 x := v_0
25096                 if v_1.Op != OpSub16 {
25097                         break
25098                 }
25099                 y := v_1.Args[1]
25100                 v_1_0 := v_1.Args[0]
25101                 if v_1_0.Op != OpConst16 {
25102                         break
25103                 }
25104                 c := auxIntToInt16(v_1_0.AuxInt)
25105                 if !(c&7 == 0) {
25106                         break
25107                 }
25108                 v.reset(OpRotateLeft8)
25109                 v0 := b.NewValue0(v.Pos, OpNeg16, y.Type)
25110                 v0.AddArg(y)
25111                 v.AddArg2(x, v0)
25112                 return true
25113         }
25114         // match: (RotateLeft8 x (Sub8 (Const8 [c]) y))
25115         // cond: c&7 == 0
25116         // result: (RotateLeft8 x (Neg8 <y.Type> y))
25117         for {
25118                 x := v_0
25119                 if v_1.Op != OpSub8 {
25120                         break
25121                 }
25122                 y := v_1.Args[1]
25123                 v_1_0 := v_1.Args[0]
25124                 if v_1_0.Op != OpConst8 {
25125                         break
25126                 }
25127                 c := auxIntToInt8(v_1_0.AuxInt)
25128                 if !(c&7 == 0) {
25129                         break
25130                 }
25131                 v.reset(OpRotateLeft8)
25132                 v0 := b.NewValue0(v.Pos, OpNeg8, y.Type)
25133                 v0.AddArg(y)
25134                 v.AddArg2(x, v0)
25135                 return true
25136         }
25137         // match: (RotateLeft8 x (Const64 <t> [c]))
25138         // cond: config.PtrSize == 4
25139         // result: (RotateLeft8 x (Const32 <t> [int32(c)]))
25140         for {
25141                 x := v_0
25142                 if v_1.Op != OpConst64 {
25143                         break
25144                 }
25145                 t := v_1.Type
25146                 c := auxIntToInt64(v_1.AuxInt)
25147                 if !(config.PtrSize == 4) {
25148                         break
25149                 }
25150                 v.reset(OpRotateLeft8)
25151                 v0 := b.NewValue0(v.Pos, OpConst32, t)
25152                 v0.AuxInt = int32ToAuxInt(int32(c))
25153                 v.AddArg2(x, v0)
25154                 return true
25155         }
25156         // match: (RotateLeft8 (RotateLeft8 x c) d)
25157         // cond: c.Type.Size() == 8 && d.Type.Size() == 8
25158         // result: (RotateLeft8 x (Add64 <c.Type> c d))
25159         for {
25160                 if v_0.Op != OpRotateLeft8 {
25161                         break
25162                 }
25163                 c := v_0.Args[1]
25164                 x := v_0.Args[0]
25165                 d := v_1
25166                 if !(c.Type.Size() == 8 && d.Type.Size() == 8) {
25167                         break
25168                 }
25169                 v.reset(OpRotateLeft8)
25170                 v0 := b.NewValue0(v.Pos, OpAdd64, c.Type)
25171                 v0.AddArg2(c, d)
25172                 v.AddArg2(x, v0)
25173                 return true
25174         }
25175         // match: (RotateLeft8 (RotateLeft8 x c) d)
25176         // cond: c.Type.Size() == 4 && d.Type.Size() == 4
25177         // result: (RotateLeft8 x (Add32 <c.Type> c d))
25178         for {
25179                 if v_0.Op != OpRotateLeft8 {
25180                         break
25181                 }
25182                 c := v_0.Args[1]
25183                 x := v_0.Args[0]
25184                 d := v_1
25185                 if !(c.Type.Size() == 4 && d.Type.Size() == 4) {
25186                         break
25187                 }
25188                 v.reset(OpRotateLeft8)
25189                 v0 := b.NewValue0(v.Pos, OpAdd32, c.Type)
25190                 v0.AddArg2(c, d)
25191                 v.AddArg2(x, v0)
25192                 return true
25193         }
25194         // match: (RotateLeft8 (RotateLeft8 x c) d)
25195         // cond: c.Type.Size() == 2 && d.Type.Size() == 2
25196         // result: (RotateLeft8 x (Add16 <c.Type> c d))
25197         for {
25198                 if v_0.Op != OpRotateLeft8 {
25199                         break
25200                 }
25201                 c := v_0.Args[1]
25202                 x := v_0.Args[0]
25203                 d := v_1
25204                 if !(c.Type.Size() == 2 && d.Type.Size() == 2) {
25205                         break
25206                 }
25207                 v.reset(OpRotateLeft8)
25208                 v0 := b.NewValue0(v.Pos, OpAdd16, c.Type)
25209                 v0.AddArg2(c, d)
25210                 v.AddArg2(x, v0)
25211                 return true
25212         }
25213         // match: (RotateLeft8 (RotateLeft8 x c) d)
25214         // cond: c.Type.Size() == 1 && d.Type.Size() == 1
25215         // result: (RotateLeft8 x (Add8 <c.Type> c d))
25216         for {
25217                 if v_0.Op != OpRotateLeft8 {
25218                         break
25219                 }
25220                 c := v_0.Args[1]
25221                 x := v_0.Args[0]
25222                 d := v_1
25223                 if !(c.Type.Size() == 1 && d.Type.Size() == 1) {
25224                         break
25225                 }
25226                 v.reset(OpRotateLeft8)
25227                 v0 := b.NewValue0(v.Pos, OpAdd8, c.Type)
25228                 v0.AddArg2(c, d)
25229                 v.AddArg2(x, v0)
25230                 return true
25231         }
25232         return false
25233 }
25234 func rewriteValuegeneric_OpRound32F(v *Value) bool {
25235         v_0 := v.Args[0]
25236         // match: (Round32F x:(Const32F))
25237         // result: x
25238         for {
25239                 x := v_0
25240                 if x.Op != OpConst32F {
25241                         break
25242                 }
25243                 v.copyOf(x)
25244                 return true
25245         }
25246         return false
25247 }
25248 func rewriteValuegeneric_OpRound64F(v *Value) bool {
25249         v_0 := v.Args[0]
25250         // match: (Round64F x:(Const64F))
25251         // result: x
25252         for {
25253                 x := v_0
25254                 if x.Op != OpConst64F {
25255                         break
25256                 }
25257                 v.copyOf(x)
25258                 return true
25259         }
25260         return false
25261 }
25262 func rewriteValuegeneric_OpRoundToEven(v *Value) bool {
25263         v_0 := v.Args[0]
25264         // match: (RoundToEven (Const64F [c]))
25265         // result: (Const64F [math.RoundToEven(c)])
25266         for {
25267                 if v_0.Op != OpConst64F {
25268                         break
25269                 }
25270                 c := auxIntToFloat64(v_0.AuxInt)
25271                 v.reset(OpConst64F)
25272                 v.AuxInt = float64ToAuxInt(math.RoundToEven(c))
25273                 return true
25274         }
25275         return false
25276 }
25277 func rewriteValuegeneric_OpRsh16Ux16(v *Value) bool {
25278         v_1 := v.Args[1]
25279         v_0 := v.Args[0]
25280         b := v.Block
25281         // match: (Rsh16Ux16 <t> x (Const16 [c]))
25282         // result: (Rsh16Ux64 x (Const64 <t> [int64(uint16(c))]))
25283         for {
25284                 t := v.Type
25285                 x := v_0
25286                 if v_1.Op != OpConst16 {
25287                         break
25288                 }
25289                 c := auxIntToInt16(v_1.AuxInt)
25290                 v.reset(OpRsh16Ux64)
25291                 v0 := b.NewValue0(v.Pos, OpConst64, t)
25292                 v0.AuxInt = int64ToAuxInt(int64(uint16(c)))
25293                 v.AddArg2(x, v0)
25294                 return true
25295         }
25296         // match: (Rsh16Ux16 (Const16 [0]) _)
25297         // result: (Const16 [0])
25298         for {
25299                 if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
25300                         break
25301                 }
25302                 v.reset(OpConst16)
25303                 v.AuxInt = int16ToAuxInt(0)
25304                 return true
25305         }
25306         return false
25307 }
25308 func rewriteValuegeneric_OpRsh16Ux32(v *Value) bool {
25309         v_1 := v.Args[1]
25310         v_0 := v.Args[0]
25311         b := v.Block
25312         // match: (Rsh16Ux32 <t> x (Const32 [c]))
25313         // result: (Rsh16Ux64 x (Const64 <t> [int64(uint32(c))]))
25314         for {
25315                 t := v.Type
25316                 x := v_0
25317                 if v_1.Op != OpConst32 {
25318                         break
25319                 }
25320                 c := auxIntToInt32(v_1.AuxInt)
25321                 v.reset(OpRsh16Ux64)
25322                 v0 := b.NewValue0(v.Pos, OpConst64, t)
25323                 v0.AuxInt = int64ToAuxInt(int64(uint32(c)))
25324                 v.AddArg2(x, v0)
25325                 return true
25326         }
25327         // match: (Rsh16Ux32 (Const16 [0]) _)
25328         // result: (Const16 [0])
25329         for {
25330                 if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
25331                         break
25332                 }
25333                 v.reset(OpConst16)
25334                 v.AuxInt = int16ToAuxInt(0)
25335                 return true
25336         }
25337         return false
25338 }
25339 func rewriteValuegeneric_OpRsh16Ux64(v *Value) bool {
25340         v_1 := v.Args[1]
25341         v_0 := v.Args[0]
25342         b := v.Block
25343         typ := &b.Func.Config.Types
25344         // match: (Rsh16Ux64 (Const16 [c]) (Const64 [d]))
25345         // result: (Const16 [int16(uint16(c) >> uint64(d))])
25346         for {
25347                 if v_0.Op != OpConst16 {
25348                         break
25349                 }
25350                 c := auxIntToInt16(v_0.AuxInt)
25351                 if v_1.Op != OpConst64 {
25352                         break
25353                 }
25354                 d := auxIntToInt64(v_1.AuxInt)
25355                 v.reset(OpConst16)
25356                 v.AuxInt = int16ToAuxInt(int16(uint16(c) >> uint64(d)))
25357                 return true
25358         }
25359         // match: (Rsh16Ux64 x (Const64 [0]))
25360         // result: x
25361         for {
25362                 x := v_0
25363                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 0 {
25364                         break
25365                 }
25366                 v.copyOf(x)
25367                 return true
25368         }
25369         // match: (Rsh16Ux64 (Const16 [0]) _)
25370         // result: (Const16 [0])
25371         for {
25372                 if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
25373                         break
25374                 }
25375                 v.reset(OpConst16)
25376                 v.AuxInt = int16ToAuxInt(0)
25377                 return true
25378         }
25379         // match: (Rsh16Ux64 _ (Const64 [c]))
25380         // cond: uint64(c) >= 16
25381         // result: (Const16 [0])
25382         for {
25383                 if v_1.Op != OpConst64 {
25384                         break
25385                 }
25386                 c := auxIntToInt64(v_1.AuxInt)
25387                 if !(uint64(c) >= 16) {
25388                         break
25389                 }
25390                 v.reset(OpConst16)
25391                 v.AuxInt = int16ToAuxInt(0)
25392                 return true
25393         }
25394         // match: (Rsh16Ux64 <t> (Rsh16Ux64 x (Const64 [c])) (Const64 [d]))
25395         // cond: !uaddOvf(c,d)
25396         // result: (Rsh16Ux64 x (Const64 <t> [c+d]))
25397         for {
25398                 t := v.Type
25399                 if v_0.Op != OpRsh16Ux64 {
25400                         break
25401                 }
25402                 _ = v_0.Args[1]
25403                 x := v_0.Args[0]
25404                 v_0_1 := v_0.Args[1]
25405                 if v_0_1.Op != OpConst64 {
25406                         break
25407                 }
25408                 c := auxIntToInt64(v_0_1.AuxInt)
25409                 if v_1.Op != OpConst64 {
25410                         break
25411                 }
25412                 d := auxIntToInt64(v_1.AuxInt)
25413                 if !(!uaddOvf(c, d)) {
25414                         break
25415                 }
25416                 v.reset(OpRsh16Ux64)
25417                 v0 := b.NewValue0(v.Pos, OpConst64, t)
25418                 v0.AuxInt = int64ToAuxInt(c + d)
25419                 v.AddArg2(x, v0)
25420                 return true
25421         }
25422         // match: (Rsh16Ux64 (Rsh16x64 x _) (Const64 <t> [15]))
25423         // result: (Rsh16Ux64 x (Const64 <t> [15]))
25424         for {
25425                 if v_0.Op != OpRsh16x64 {
25426                         break
25427                 }
25428                 x := v_0.Args[0]
25429                 if v_1.Op != OpConst64 {
25430                         break
25431                 }
25432                 t := v_1.Type
25433                 if auxIntToInt64(v_1.AuxInt) != 15 {
25434                         break
25435                 }
25436                 v.reset(OpRsh16Ux64)
25437                 v0 := b.NewValue0(v.Pos, OpConst64, t)
25438                 v0.AuxInt = int64ToAuxInt(15)
25439                 v.AddArg2(x, v0)
25440                 return true
25441         }
25442         // match: (Rsh16Ux64 i:(Lsh16x64 x (Const64 [c])) (Const64 [c]))
25443         // cond: c >= 0 && c < 16 && i.Uses == 1
25444         // result: (And16 x (Const16 <v.Type> [int16(^uint16(0)>>c)]))
25445         for {
25446                 i := v_0
25447                 if i.Op != OpLsh16x64 {
25448                         break
25449                 }
25450                 _ = i.Args[1]
25451                 x := i.Args[0]
25452                 i_1 := i.Args[1]
25453                 if i_1.Op != OpConst64 {
25454                         break
25455                 }
25456                 c := auxIntToInt64(i_1.AuxInt)
25457                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != c || !(c >= 0 && c < 16 && i.Uses == 1) {
25458                         break
25459                 }
25460                 v.reset(OpAnd16)
25461                 v0 := b.NewValue0(v.Pos, OpConst16, v.Type)
25462                 v0.AuxInt = int16ToAuxInt(int16(^uint16(0) >> c))
25463                 v.AddArg2(x, v0)
25464                 return true
25465         }
25466         // match: (Rsh16Ux64 (Lsh16x64 (Rsh16Ux64 x (Const64 [c1])) (Const64 [c2])) (Const64 [c3]))
25467         // cond: uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)
25468         // result: (Rsh16Ux64 x (Const64 <typ.UInt64> [c1-c2+c3]))
25469         for {
25470                 if v_0.Op != OpLsh16x64 {
25471                         break
25472                 }
25473                 _ = v_0.Args[1]
25474                 v_0_0 := v_0.Args[0]
25475                 if v_0_0.Op != OpRsh16Ux64 {
25476                         break
25477                 }
25478                 _ = v_0_0.Args[1]
25479                 x := v_0_0.Args[0]
25480                 v_0_0_1 := v_0_0.Args[1]
25481                 if v_0_0_1.Op != OpConst64 {
25482                         break
25483                 }
25484                 c1 := auxIntToInt64(v_0_0_1.AuxInt)
25485                 v_0_1 := v_0.Args[1]
25486                 if v_0_1.Op != OpConst64 {
25487                         break
25488                 }
25489                 c2 := auxIntToInt64(v_0_1.AuxInt)
25490                 if v_1.Op != OpConst64 {
25491                         break
25492                 }
25493                 c3 := auxIntToInt64(v_1.AuxInt)
25494                 if !(uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)) {
25495                         break
25496                 }
25497                 v.reset(OpRsh16Ux64)
25498                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
25499                 v0.AuxInt = int64ToAuxInt(c1 - c2 + c3)
25500                 v.AddArg2(x, v0)
25501                 return true
25502         }
25503         // match: (Rsh16Ux64 (Lsh16x64 x (Const64 [8])) (Const64 [8]))
25504         // result: (ZeroExt8to16 (Trunc16to8 <typ.UInt8> x))
25505         for {
25506                 if v_0.Op != OpLsh16x64 {
25507                         break
25508                 }
25509                 _ = v_0.Args[1]
25510                 x := v_0.Args[0]
25511                 v_0_1 := v_0.Args[1]
25512                 if v_0_1.Op != OpConst64 || auxIntToInt64(v_0_1.AuxInt) != 8 || v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 8 {
25513                         break
25514                 }
25515                 v.reset(OpZeroExt8to16)
25516                 v0 := b.NewValue0(v.Pos, OpTrunc16to8, typ.UInt8)
25517                 v0.AddArg(x)
25518                 v.AddArg(v0)
25519                 return true
25520         }
25521         return false
25522 }
25523 func rewriteValuegeneric_OpRsh16Ux8(v *Value) bool {
25524         v_1 := v.Args[1]
25525         v_0 := v.Args[0]
25526         b := v.Block
25527         // match: (Rsh16Ux8 <t> x (Const8 [c]))
25528         // result: (Rsh16Ux64 x (Const64 <t> [int64(uint8(c))]))
25529         for {
25530                 t := v.Type
25531                 x := v_0
25532                 if v_1.Op != OpConst8 {
25533                         break
25534                 }
25535                 c := auxIntToInt8(v_1.AuxInt)
25536                 v.reset(OpRsh16Ux64)
25537                 v0 := b.NewValue0(v.Pos, OpConst64, t)
25538                 v0.AuxInt = int64ToAuxInt(int64(uint8(c)))
25539                 v.AddArg2(x, v0)
25540                 return true
25541         }
25542         // match: (Rsh16Ux8 (Const16 [0]) _)
25543         // result: (Const16 [0])
25544         for {
25545                 if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
25546                         break
25547                 }
25548                 v.reset(OpConst16)
25549                 v.AuxInt = int16ToAuxInt(0)
25550                 return true
25551         }
25552         return false
25553 }
25554 func rewriteValuegeneric_OpRsh16x16(v *Value) bool {
25555         v_1 := v.Args[1]
25556         v_0 := v.Args[0]
25557         b := v.Block
25558         // match: (Rsh16x16 <t> x (Const16 [c]))
25559         // result: (Rsh16x64 x (Const64 <t> [int64(uint16(c))]))
25560         for {
25561                 t := v.Type
25562                 x := v_0
25563                 if v_1.Op != OpConst16 {
25564                         break
25565                 }
25566                 c := auxIntToInt16(v_1.AuxInt)
25567                 v.reset(OpRsh16x64)
25568                 v0 := b.NewValue0(v.Pos, OpConst64, t)
25569                 v0.AuxInt = int64ToAuxInt(int64(uint16(c)))
25570                 v.AddArg2(x, v0)
25571                 return true
25572         }
25573         // match: (Rsh16x16 (Const16 [0]) _)
25574         // result: (Const16 [0])
25575         for {
25576                 if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
25577                         break
25578                 }
25579                 v.reset(OpConst16)
25580                 v.AuxInt = int16ToAuxInt(0)
25581                 return true
25582         }
25583         return false
25584 }
25585 func rewriteValuegeneric_OpRsh16x32(v *Value) bool {
25586         v_1 := v.Args[1]
25587         v_0 := v.Args[0]
25588         b := v.Block
25589         // match: (Rsh16x32 <t> x (Const32 [c]))
25590         // result: (Rsh16x64 x (Const64 <t> [int64(uint32(c))]))
25591         for {
25592                 t := v.Type
25593                 x := v_0
25594                 if v_1.Op != OpConst32 {
25595                         break
25596                 }
25597                 c := auxIntToInt32(v_1.AuxInt)
25598                 v.reset(OpRsh16x64)
25599                 v0 := b.NewValue0(v.Pos, OpConst64, t)
25600                 v0.AuxInt = int64ToAuxInt(int64(uint32(c)))
25601                 v.AddArg2(x, v0)
25602                 return true
25603         }
25604         // match: (Rsh16x32 (Const16 [0]) _)
25605         // result: (Const16 [0])
25606         for {
25607                 if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
25608                         break
25609                 }
25610                 v.reset(OpConst16)
25611                 v.AuxInt = int16ToAuxInt(0)
25612                 return true
25613         }
25614         return false
25615 }
25616 func rewriteValuegeneric_OpRsh16x64(v *Value) bool {
25617         v_1 := v.Args[1]
25618         v_0 := v.Args[0]
25619         b := v.Block
25620         typ := &b.Func.Config.Types
25621         // match: (Rsh16x64 (Const16 [c]) (Const64 [d]))
25622         // result: (Const16 [c >> uint64(d)])
25623         for {
25624                 if v_0.Op != OpConst16 {
25625                         break
25626                 }
25627                 c := auxIntToInt16(v_0.AuxInt)
25628                 if v_1.Op != OpConst64 {
25629                         break
25630                 }
25631                 d := auxIntToInt64(v_1.AuxInt)
25632                 v.reset(OpConst16)
25633                 v.AuxInt = int16ToAuxInt(c >> uint64(d))
25634                 return true
25635         }
25636         // match: (Rsh16x64 x (Const64 [0]))
25637         // result: x
25638         for {
25639                 x := v_0
25640                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 0 {
25641                         break
25642                 }
25643                 v.copyOf(x)
25644                 return true
25645         }
25646         // match: (Rsh16x64 (Const16 [0]) _)
25647         // result: (Const16 [0])
25648         for {
25649                 if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
25650                         break
25651                 }
25652                 v.reset(OpConst16)
25653                 v.AuxInt = int16ToAuxInt(0)
25654                 return true
25655         }
25656         // match: (Rsh16x64 <t> (Rsh16x64 x (Const64 [c])) (Const64 [d]))
25657         // cond: !uaddOvf(c,d)
25658         // result: (Rsh16x64 x (Const64 <t> [c+d]))
25659         for {
25660                 t := v.Type
25661                 if v_0.Op != OpRsh16x64 {
25662                         break
25663                 }
25664                 _ = v_0.Args[1]
25665                 x := v_0.Args[0]
25666                 v_0_1 := v_0.Args[1]
25667                 if v_0_1.Op != OpConst64 {
25668                         break
25669                 }
25670                 c := auxIntToInt64(v_0_1.AuxInt)
25671                 if v_1.Op != OpConst64 {
25672                         break
25673                 }
25674                 d := auxIntToInt64(v_1.AuxInt)
25675                 if !(!uaddOvf(c, d)) {
25676                         break
25677                 }
25678                 v.reset(OpRsh16x64)
25679                 v0 := b.NewValue0(v.Pos, OpConst64, t)
25680                 v0.AuxInt = int64ToAuxInt(c + d)
25681                 v.AddArg2(x, v0)
25682                 return true
25683         }
25684         // match: (Rsh16x64 (Lsh16x64 x (Const64 [8])) (Const64 [8]))
25685         // result: (SignExt8to16 (Trunc16to8 <typ.Int8> x))
25686         for {
25687                 if v_0.Op != OpLsh16x64 {
25688                         break
25689                 }
25690                 _ = v_0.Args[1]
25691                 x := v_0.Args[0]
25692                 v_0_1 := v_0.Args[1]
25693                 if v_0_1.Op != OpConst64 || auxIntToInt64(v_0_1.AuxInt) != 8 || v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 8 {
25694                         break
25695                 }
25696                 v.reset(OpSignExt8to16)
25697                 v0 := b.NewValue0(v.Pos, OpTrunc16to8, typ.Int8)
25698                 v0.AddArg(x)
25699                 v.AddArg(v0)
25700                 return true
25701         }
25702         return false
25703 }
25704 func rewriteValuegeneric_OpRsh16x8(v *Value) bool {
25705         v_1 := v.Args[1]
25706         v_0 := v.Args[0]
25707         b := v.Block
25708         // match: (Rsh16x8 <t> x (Const8 [c]))
25709         // result: (Rsh16x64 x (Const64 <t> [int64(uint8(c))]))
25710         for {
25711                 t := v.Type
25712                 x := v_0
25713                 if v_1.Op != OpConst8 {
25714                         break
25715                 }
25716                 c := auxIntToInt8(v_1.AuxInt)
25717                 v.reset(OpRsh16x64)
25718                 v0 := b.NewValue0(v.Pos, OpConst64, t)
25719                 v0.AuxInt = int64ToAuxInt(int64(uint8(c)))
25720                 v.AddArg2(x, v0)
25721                 return true
25722         }
25723         // match: (Rsh16x8 (Const16 [0]) _)
25724         // result: (Const16 [0])
25725         for {
25726                 if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
25727                         break
25728                 }
25729                 v.reset(OpConst16)
25730                 v.AuxInt = int16ToAuxInt(0)
25731                 return true
25732         }
25733         return false
25734 }
25735 func rewriteValuegeneric_OpRsh32Ux16(v *Value) bool {
25736         v_1 := v.Args[1]
25737         v_0 := v.Args[0]
25738         b := v.Block
25739         // match: (Rsh32Ux16 <t> x (Const16 [c]))
25740         // result: (Rsh32Ux64 x (Const64 <t> [int64(uint16(c))]))
25741         for {
25742                 t := v.Type
25743                 x := v_0
25744                 if v_1.Op != OpConst16 {
25745                         break
25746                 }
25747                 c := auxIntToInt16(v_1.AuxInt)
25748                 v.reset(OpRsh32Ux64)
25749                 v0 := b.NewValue0(v.Pos, OpConst64, t)
25750                 v0.AuxInt = int64ToAuxInt(int64(uint16(c)))
25751                 v.AddArg2(x, v0)
25752                 return true
25753         }
25754         // match: (Rsh32Ux16 (Const32 [0]) _)
25755         // result: (Const32 [0])
25756         for {
25757                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
25758                         break
25759                 }
25760                 v.reset(OpConst32)
25761                 v.AuxInt = int32ToAuxInt(0)
25762                 return true
25763         }
25764         return false
25765 }
25766 func rewriteValuegeneric_OpRsh32Ux32(v *Value) bool {
25767         v_1 := v.Args[1]
25768         v_0 := v.Args[0]
25769         b := v.Block
25770         // match: (Rsh32Ux32 <t> x (Const32 [c]))
25771         // result: (Rsh32Ux64 x (Const64 <t> [int64(uint32(c))]))
25772         for {
25773                 t := v.Type
25774                 x := v_0
25775                 if v_1.Op != OpConst32 {
25776                         break
25777                 }
25778                 c := auxIntToInt32(v_1.AuxInt)
25779                 v.reset(OpRsh32Ux64)
25780                 v0 := b.NewValue0(v.Pos, OpConst64, t)
25781                 v0.AuxInt = int64ToAuxInt(int64(uint32(c)))
25782                 v.AddArg2(x, v0)
25783                 return true
25784         }
25785         // match: (Rsh32Ux32 (Const32 [0]) _)
25786         // result: (Const32 [0])
25787         for {
25788                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
25789                         break
25790                 }
25791                 v.reset(OpConst32)
25792                 v.AuxInt = int32ToAuxInt(0)
25793                 return true
25794         }
25795         return false
25796 }
25797 func rewriteValuegeneric_OpRsh32Ux64(v *Value) bool {
25798         v_1 := v.Args[1]
25799         v_0 := v.Args[0]
25800         b := v.Block
25801         typ := &b.Func.Config.Types
25802         // match: (Rsh32Ux64 (Const32 [c]) (Const64 [d]))
25803         // result: (Const32 [int32(uint32(c) >> uint64(d))])
25804         for {
25805                 if v_0.Op != OpConst32 {
25806                         break
25807                 }
25808                 c := auxIntToInt32(v_0.AuxInt)
25809                 if v_1.Op != OpConst64 {
25810                         break
25811                 }
25812                 d := auxIntToInt64(v_1.AuxInt)
25813                 v.reset(OpConst32)
25814                 v.AuxInt = int32ToAuxInt(int32(uint32(c) >> uint64(d)))
25815                 return true
25816         }
25817         // match: (Rsh32Ux64 x (Const64 [0]))
25818         // result: x
25819         for {
25820                 x := v_0
25821                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 0 {
25822                         break
25823                 }
25824                 v.copyOf(x)
25825                 return true
25826         }
25827         // match: (Rsh32Ux64 (Const32 [0]) _)
25828         // result: (Const32 [0])
25829         for {
25830                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
25831                         break
25832                 }
25833                 v.reset(OpConst32)
25834                 v.AuxInt = int32ToAuxInt(0)
25835                 return true
25836         }
25837         // match: (Rsh32Ux64 _ (Const64 [c]))
25838         // cond: uint64(c) >= 32
25839         // result: (Const32 [0])
25840         for {
25841                 if v_1.Op != OpConst64 {
25842                         break
25843                 }
25844                 c := auxIntToInt64(v_1.AuxInt)
25845                 if !(uint64(c) >= 32) {
25846                         break
25847                 }
25848                 v.reset(OpConst32)
25849                 v.AuxInt = int32ToAuxInt(0)
25850                 return true
25851         }
25852         // match: (Rsh32Ux64 <t> (Rsh32Ux64 x (Const64 [c])) (Const64 [d]))
25853         // cond: !uaddOvf(c,d)
25854         // result: (Rsh32Ux64 x (Const64 <t> [c+d]))
25855         for {
25856                 t := v.Type
25857                 if v_0.Op != OpRsh32Ux64 {
25858                         break
25859                 }
25860                 _ = v_0.Args[1]
25861                 x := v_0.Args[0]
25862                 v_0_1 := v_0.Args[1]
25863                 if v_0_1.Op != OpConst64 {
25864                         break
25865                 }
25866                 c := auxIntToInt64(v_0_1.AuxInt)
25867                 if v_1.Op != OpConst64 {
25868                         break
25869                 }
25870                 d := auxIntToInt64(v_1.AuxInt)
25871                 if !(!uaddOvf(c, d)) {
25872                         break
25873                 }
25874                 v.reset(OpRsh32Ux64)
25875                 v0 := b.NewValue0(v.Pos, OpConst64, t)
25876                 v0.AuxInt = int64ToAuxInt(c + d)
25877                 v.AddArg2(x, v0)
25878                 return true
25879         }
25880         // match: (Rsh32Ux64 (Rsh32x64 x _) (Const64 <t> [31]))
25881         // result: (Rsh32Ux64 x (Const64 <t> [31]))
25882         for {
25883                 if v_0.Op != OpRsh32x64 {
25884                         break
25885                 }
25886                 x := v_0.Args[0]
25887                 if v_1.Op != OpConst64 {
25888                         break
25889                 }
25890                 t := v_1.Type
25891                 if auxIntToInt64(v_1.AuxInt) != 31 {
25892                         break
25893                 }
25894                 v.reset(OpRsh32Ux64)
25895                 v0 := b.NewValue0(v.Pos, OpConst64, t)
25896                 v0.AuxInt = int64ToAuxInt(31)
25897                 v.AddArg2(x, v0)
25898                 return true
25899         }
25900         // match: (Rsh32Ux64 i:(Lsh32x64 x (Const64 [c])) (Const64 [c]))
25901         // cond: c >= 0 && c < 32 && i.Uses == 1
25902         // result: (And32 x (Const32 <v.Type> [int32(^uint32(0)>>c)]))
25903         for {
25904                 i := v_0
25905                 if i.Op != OpLsh32x64 {
25906                         break
25907                 }
25908                 _ = i.Args[1]
25909                 x := i.Args[0]
25910                 i_1 := i.Args[1]
25911                 if i_1.Op != OpConst64 {
25912                         break
25913                 }
25914                 c := auxIntToInt64(i_1.AuxInt)
25915                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != c || !(c >= 0 && c < 32 && i.Uses == 1) {
25916                         break
25917                 }
25918                 v.reset(OpAnd32)
25919                 v0 := b.NewValue0(v.Pos, OpConst32, v.Type)
25920                 v0.AuxInt = int32ToAuxInt(int32(^uint32(0) >> c))
25921                 v.AddArg2(x, v0)
25922                 return true
25923         }
25924         // match: (Rsh32Ux64 (Lsh32x64 (Rsh32Ux64 x (Const64 [c1])) (Const64 [c2])) (Const64 [c3]))
25925         // cond: uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)
25926         // result: (Rsh32Ux64 x (Const64 <typ.UInt64> [c1-c2+c3]))
25927         for {
25928                 if v_0.Op != OpLsh32x64 {
25929                         break
25930                 }
25931                 _ = v_0.Args[1]
25932                 v_0_0 := v_0.Args[0]
25933                 if v_0_0.Op != OpRsh32Ux64 {
25934                         break
25935                 }
25936                 _ = v_0_0.Args[1]
25937                 x := v_0_0.Args[0]
25938                 v_0_0_1 := v_0_0.Args[1]
25939                 if v_0_0_1.Op != OpConst64 {
25940                         break
25941                 }
25942                 c1 := auxIntToInt64(v_0_0_1.AuxInt)
25943                 v_0_1 := v_0.Args[1]
25944                 if v_0_1.Op != OpConst64 {
25945                         break
25946                 }
25947                 c2 := auxIntToInt64(v_0_1.AuxInt)
25948                 if v_1.Op != OpConst64 {
25949                         break
25950                 }
25951                 c3 := auxIntToInt64(v_1.AuxInt)
25952                 if !(uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)) {
25953                         break
25954                 }
25955                 v.reset(OpRsh32Ux64)
25956                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
25957                 v0.AuxInt = int64ToAuxInt(c1 - c2 + c3)
25958                 v.AddArg2(x, v0)
25959                 return true
25960         }
25961         // match: (Rsh32Ux64 (Lsh32x64 x (Const64 [24])) (Const64 [24]))
25962         // result: (ZeroExt8to32 (Trunc32to8 <typ.UInt8> x))
25963         for {
25964                 if v_0.Op != OpLsh32x64 {
25965                         break
25966                 }
25967                 _ = v_0.Args[1]
25968                 x := v_0.Args[0]
25969                 v_0_1 := v_0.Args[1]
25970                 if v_0_1.Op != OpConst64 || auxIntToInt64(v_0_1.AuxInt) != 24 || v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 24 {
25971                         break
25972                 }
25973                 v.reset(OpZeroExt8to32)
25974                 v0 := b.NewValue0(v.Pos, OpTrunc32to8, typ.UInt8)
25975                 v0.AddArg(x)
25976                 v.AddArg(v0)
25977                 return true
25978         }
25979         // match: (Rsh32Ux64 (Lsh32x64 x (Const64 [16])) (Const64 [16]))
25980         // result: (ZeroExt16to32 (Trunc32to16 <typ.UInt16> x))
25981         for {
25982                 if v_0.Op != OpLsh32x64 {
25983                         break
25984                 }
25985                 _ = v_0.Args[1]
25986                 x := v_0.Args[0]
25987                 v_0_1 := v_0.Args[1]
25988                 if v_0_1.Op != OpConst64 || auxIntToInt64(v_0_1.AuxInt) != 16 || v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 16 {
25989                         break
25990                 }
25991                 v.reset(OpZeroExt16to32)
25992                 v0 := b.NewValue0(v.Pos, OpTrunc32to16, typ.UInt16)
25993                 v0.AddArg(x)
25994                 v.AddArg(v0)
25995                 return true
25996         }
25997         return false
25998 }
25999 func rewriteValuegeneric_OpRsh32Ux8(v *Value) bool {
26000         v_1 := v.Args[1]
26001         v_0 := v.Args[0]
26002         b := v.Block
26003         // match: (Rsh32Ux8 <t> x (Const8 [c]))
26004         // result: (Rsh32Ux64 x (Const64 <t> [int64(uint8(c))]))
26005         for {
26006                 t := v.Type
26007                 x := v_0
26008                 if v_1.Op != OpConst8 {
26009                         break
26010                 }
26011                 c := auxIntToInt8(v_1.AuxInt)
26012                 v.reset(OpRsh32Ux64)
26013                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26014                 v0.AuxInt = int64ToAuxInt(int64(uint8(c)))
26015                 v.AddArg2(x, v0)
26016                 return true
26017         }
26018         // match: (Rsh32Ux8 (Const32 [0]) _)
26019         // result: (Const32 [0])
26020         for {
26021                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
26022                         break
26023                 }
26024                 v.reset(OpConst32)
26025                 v.AuxInt = int32ToAuxInt(0)
26026                 return true
26027         }
26028         return false
26029 }
26030 func rewriteValuegeneric_OpRsh32x16(v *Value) bool {
26031         v_1 := v.Args[1]
26032         v_0 := v.Args[0]
26033         b := v.Block
26034         // match: (Rsh32x16 <t> x (Const16 [c]))
26035         // result: (Rsh32x64 x (Const64 <t> [int64(uint16(c))]))
26036         for {
26037                 t := v.Type
26038                 x := v_0
26039                 if v_1.Op != OpConst16 {
26040                         break
26041                 }
26042                 c := auxIntToInt16(v_1.AuxInt)
26043                 v.reset(OpRsh32x64)
26044                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26045                 v0.AuxInt = int64ToAuxInt(int64(uint16(c)))
26046                 v.AddArg2(x, v0)
26047                 return true
26048         }
26049         // match: (Rsh32x16 (Const32 [0]) _)
26050         // result: (Const32 [0])
26051         for {
26052                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
26053                         break
26054                 }
26055                 v.reset(OpConst32)
26056                 v.AuxInt = int32ToAuxInt(0)
26057                 return true
26058         }
26059         return false
26060 }
26061 func rewriteValuegeneric_OpRsh32x32(v *Value) bool {
26062         v_1 := v.Args[1]
26063         v_0 := v.Args[0]
26064         b := v.Block
26065         // match: (Rsh32x32 <t> x (Const32 [c]))
26066         // result: (Rsh32x64 x (Const64 <t> [int64(uint32(c))]))
26067         for {
26068                 t := v.Type
26069                 x := v_0
26070                 if v_1.Op != OpConst32 {
26071                         break
26072                 }
26073                 c := auxIntToInt32(v_1.AuxInt)
26074                 v.reset(OpRsh32x64)
26075                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26076                 v0.AuxInt = int64ToAuxInt(int64(uint32(c)))
26077                 v.AddArg2(x, v0)
26078                 return true
26079         }
26080         // match: (Rsh32x32 (Const32 [0]) _)
26081         // result: (Const32 [0])
26082         for {
26083                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
26084                         break
26085                 }
26086                 v.reset(OpConst32)
26087                 v.AuxInt = int32ToAuxInt(0)
26088                 return true
26089         }
26090         return false
26091 }
26092 func rewriteValuegeneric_OpRsh32x64(v *Value) bool {
26093         v_1 := v.Args[1]
26094         v_0 := v.Args[0]
26095         b := v.Block
26096         typ := &b.Func.Config.Types
26097         // match: (Rsh32x64 (Const32 [c]) (Const64 [d]))
26098         // result: (Const32 [c >> uint64(d)])
26099         for {
26100                 if v_0.Op != OpConst32 {
26101                         break
26102                 }
26103                 c := auxIntToInt32(v_0.AuxInt)
26104                 if v_1.Op != OpConst64 {
26105                         break
26106                 }
26107                 d := auxIntToInt64(v_1.AuxInt)
26108                 v.reset(OpConst32)
26109                 v.AuxInt = int32ToAuxInt(c >> uint64(d))
26110                 return true
26111         }
26112         // match: (Rsh32x64 x (Const64 [0]))
26113         // result: x
26114         for {
26115                 x := v_0
26116                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 0 {
26117                         break
26118                 }
26119                 v.copyOf(x)
26120                 return true
26121         }
26122         // match: (Rsh32x64 (Const32 [0]) _)
26123         // result: (Const32 [0])
26124         for {
26125                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
26126                         break
26127                 }
26128                 v.reset(OpConst32)
26129                 v.AuxInt = int32ToAuxInt(0)
26130                 return true
26131         }
26132         // match: (Rsh32x64 <t> (Rsh32x64 x (Const64 [c])) (Const64 [d]))
26133         // cond: !uaddOvf(c,d)
26134         // result: (Rsh32x64 x (Const64 <t> [c+d]))
26135         for {
26136                 t := v.Type
26137                 if v_0.Op != OpRsh32x64 {
26138                         break
26139                 }
26140                 _ = v_0.Args[1]
26141                 x := v_0.Args[0]
26142                 v_0_1 := v_0.Args[1]
26143                 if v_0_1.Op != OpConst64 {
26144                         break
26145                 }
26146                 c := auxIntToInt64(v_0_1.AuxInt)
26147                 if v_1.Op != OpConst64 {
26148                         break
26149                 }
26150                 d := auxIntToInt64(v_1.AuxInt)
26151                 if !(!uaddOvf(c, d)) {
26152                         break
26153                 }
26154                 v.reset(OpRsh32x64)
26155                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26156                 v0.AuxInt = int64ToAuxInt(c + d)
26157                 v.AddArg2(x, v0)
26158                 return true
26159         }
26160         // match: (Rsh32x64 (Lsh32x64 x (Const64 [24])) (Const64 [24]))
26161         // result: (SignExt8to32 (Trunc32to8 <typ.Int8> x))
26162         for {
26163                 if v_0.Op != OpLsh32x64 {
26164                         break
26165                 }
26166                 _ = v_0.Args[1]
26167                 x := v_0.Args[0]
26168                 v_0_1 := v_0.Args[1]
26169                 if v_0_1.Op != OpConst64 || auxIntToInt64(v_0_1.AuxInt) != 24 || v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 24 {
26170                         break
26171                 }
26172                 v.reset(OpSignExt8to32)
26173                 v0 := b.NewValue0(v.Pos, OpTrunc32to8, typ.Int8)
26174                 v0.AddArg(x)
26175                 v.AddArg(v0)
26176                 return true
26177         }
26178         // match: (Rsh32x64 (Lsh32x64 x (Const64 [16])) (Const64 [16]))
26179         // result: (SignExt16to32 (Trunc32to16 <typ.Int16> x))
26180         for {
26181                 if v_0.Op != OpLsh32x64 {
26182                         break
26183                 }
26184                 _ = v_0.Args[1]
26185                 x := v_0.Args[0]
26186                 v_0_1 := v_0.Args[1]
26187                 if v_0_1.Op != OpConst64 || auxIntToInt64(v_0_1.AuxInt) != 16 || v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 16 {
26188                         break
26189                 }
26190                 v.reset(OpSignExt16to32)
26191                 v0 := b.NewValue0(v.Pos, OpTrunc32to16, typ.Int16)
26192                 v0.AddArg(x)
26193                 v.AddArg(v0)
26194                 return true
26195         }
26196         return false
26197 }
26198 func rewriteValuegeneric_OpRsh32x8(v *Value) bool {
26199         v_1 := v.Args[1]
26200         v_0 := v.Args[0]
26201         b := v.Block
26202         // match: (Rsh32x8 <t> x (Const8 [c]))
26203         // result: (Rsh32x64 x (Const64 <t> [int64(uint8(c))]))
26204         for {
26205                 t := v.Type
26206                 x := v_0
26207                 if v_1.Op != OpConst8 {
26208                         break
26209                 }
26210                 c := auxIntToInt8(v_1.AuxInt)
26211                 v.reset(OpRsh32x64)
26212                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26213                 v0.AuxInt = int64ToAuxInt(int64(uint8(c)))
26214                 v.AddArg2(x, v0)
26215                 return true
26216         }
26217         // match: (Rsh32x8 (Const32 [0]) _)
26218         // result: (Const32 [0])
26219         for {
26220                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
26221                         break
26222                 }
26223                 v.reset(OpConst32)
26224                 v.AuxInt = int32ToAuxInt(0)
26225                 return true
26226         }
26227         return false
26228 }
26229 func rewriteValuegeneric_OpRsh64Ux16(v *Value) bool {
26230         v_1 := v.Args[1]
26231         v_0 := v.Args[0]
26232         b := v.Block
26233         // match: (Rsh64Ux16 <t> x (Const16 [c]))
26234         // result: (Rsh64Ux64 x (Const64 <t> [int64(uint16(c))]))
26235         for {
26236                 t := v.Type
26237                 x := v_0
26238                 if v_1.Op != OpConst16 {
26239                         break
26240                 }
26241                 c := auxIntToInt16(v_1.AuxInt)
26242                 v.reset(OpRsh64Ux64)
26243                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26244                 v0.AuxInt = int64ToAuxInt(int64(uint16(c)))
26245                 v.AddArg2(x, v0)
26246                 return true
26247         }
26248         // match: (Rsh64Ux16 (Const64 [0]) _)
26249         // result: (Const64 [0])
26250         for {
26251                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
26252                         break
26253                 }
26254                 v.reset(OpConst64)
26255                 v.AuxInt = int64ToAuxInt(0)
26256                 return true
26257         }
26258         return false
26259 }
26260 func rewriteValuegeneric_OpRsh64Ux32(v *Value) bool {
26261         v_1 := v.Args[1]
26262         v_0 := v.Args[0]
26263         b := v.Block
26264         // match: (Rsh64Ux32 <t> x (Const32 [c]))
26265         // result: (Rsh64Ux64 x (Const64 <t> [int64(uint32(c))]))
26266         for {
26267                 t := v.Type
26268                 x := v_0
26269                 if v_1.Op != OpConst32 {
26270                         break
26271                 }
26272                 c := auxIntToInt32(v_1.AuxInt)
26273                 v.reset(OpRsh64Ux64)
26274                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26275                 v0.AuxInt = int64ToAuxInt(int64(uint32(c)))
26276                 v.AddArg2(x, v0)
26277                 return true
26278         }
26279         // match: (Rsh64Ux32 (Const64 [0]) _)
26280         // result: (Const64 [0])
26281         for {
26282                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
26283                         break
26284                 }
26285                 v.reset(OpConst64)
26286                 v.AuxInt = int64ToAuxInt(0)
26287                 return true
26288         }
26289         return false
26290 }
26291 func rewriteValuegeneric_OpRsh64Ux64(v *Value) bool {
26292         v_1 := v.Args[1]
26293         v_0 := v.Args[0]
26294         b := v.Block
26295         typ := &b.Func.Config.Types
26296         // match: (Rsh64Ux64 (Const64 [c]) (Const64 [d]))
26297         // result: (Const64 [int64(uint64(c) >> uint64(d))])
26298         for {
26299                 if v_0.Op != OpConst64 {
26300                         break
26301                 }
26302                 c := auxIntToInt64(v_0.AuxInt)
26303                 if v_1.Op != OpConst64 {
26304                         break
26305                 }
26306                 d := auxIntToInt64(v_1.AuxInt)
26307                 v.reset(OpConst64)
26308                 v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
26309                 return true
26310         }
26311         // match: (Rsh64Ux64 x (Const64 [0]))
26312         // result: x
26313         for {
26314                 x := v_0
26315                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 0 {
26316                         break
26317                 }
26318                 v.copyOf(x)
26319                 return true
26320         }
26321         // match: (Rsh64Ux64 (Const64 [0]) _)
26322         // result: (Const64 [0])
26323         for {
26324                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
26325                         break
26326                 }
26327                 v.reset(OpConst64)
26328                 v.AuxInt = int64ToAuxInt(0)
26329                 return true
26330         }
26331         // match: (Rsh64Ux64 _ (Const64 [c]))
26332         // cond: uint64(c) >= 64
26333         // result: (Const64 [0])
26334         for {
26335                 if v_1.Op != OpConst64 {
26336                         break
26337                 }
26338                 c := auxIntToInt64(v_1.AuxInt)
26339                 if !(uint64(c) >= 64) {
26340                         break
26341                 }
26342                 v.reset(OpConst64)
26343                 v.AuxInt = int64ToAuxInt(0)
26344                 return true
26345         }
26346         // match: (Rsh64Ux64 <t> (Rsh64Ux64 x (Const64 [c])) (Const64 [d]))
26347         // cond: !uaddOvf(c,d)
26348         // result: (Rsh64Ux64 x (Const64 <t> [c+d]))
26349         for {
26350                 t := v.Type
26351                 if v_0.Op != OpRsh64Ux64 {
26352                         break
26353                 }
26354                 _ = v_0.Args[1]
26355                 x := v_0.Args[0]
26356                 v_0_1 := v_0.Args[1]
26357                 if v_0_1.Op != OpConst64 {
26358                         break
26359                 }
26360                 c := auxIntToInt64(v_0_1.AuxInt)
26361                 if v_1.Op != OpConst64 {
26362                         break
26363                 }
26364                 d := auxIntToInt64(v_1.AuxInt)
26365                 if !(!uaddOvf(c, d)) {
26366                         break
26367                 }
26368                 v.reset(OpRsh64Ux64)
26369                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26370                 v0.AuxInt = int64ToAuxInt(c + d)
26371                 v.AddArg2(x, v0)
26372                 return true
26373         }
26374         // match: (Rsh64Ux64 (Rsh64x64 x _) (Const64 <t> [63]))
26375         // result: (Rsh64Ux64 x (Const64 <t> [63]))
26376         for {
26377                 if v_0.Op != OpRsh64x64 {
26378                         break
26379                 }
26380                 x := v_0.Args[0]
26381                 if v_1.Op != OpConst64 {
26382                         break
26383                 }
26384                 t := v_1.Type
26385                 if auxIntToInt64(v_1.AuxInt) != 63 {
26386                         break
26387                 }
26388                 v.reset(OpRsh64Ux64)
26389                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26390                 v0.AuxInt = int64ToAuxInt(63)
26391                 v.AddArg2(x, v0)
26392                 return true
26393         }
26394         // match: (Rsh64Ux64 i:(Lsh64x64 x (Const64 [c])) (Const64 [c]))
26395         // cond: c >= 0 && c < 64 && i.Uses == 1
26396         // result: (And64 x (Const64 <v.Type> [int64(^uint64(0)>>c)]))
26397         for {
26398                 i := v_0
26399                 if i.Op != OpLsh64x64 {
26400                         break
26401                 }
26402                 _ = i.Args[1]
26403                 x := i.Args[0]
26404                 i_1 := i.Args[1]
26405                 if i_1.Op != OpConst64 {
26406                         break
26407                 }
26408                 c := auxIntToInt64(i_1.AuxInt)
26409                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != c || !(c >= 0 && c < 64 && i.Uses == 1) {
26410                         break
26411                 }
26412                 v.reset(OpAnd64)
26413                 v0 := b.NewValue0(v.Pos, OpConst64, v.Type)
26414                 v0.AuxInt = int64ToAuxInt(int64(^uint64(0) >> c))
26415                 v.AddArg2(x, v0)
26416                 return true
26417         }
26418         // match: (Rsh64Ux64 (Lsh64x64 (Rsh64Ux64 x (Const64 [c1])) (Const64 [c2])) (Const64 [c3]))
26419         // cond: uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)
26420         // result: (Rsh64Ux64 x (Const64 <typ.UInt64> [c1-c2+c3]))
26421         for {
26422                 if v_0.Op != OpLsh64x64 {
26423                         break
26424                 }
26425                 _ = v_0.Args[1]
26426                 v_0_0 := v_0.Args[0]
26427                 if v_0_0.Op != OpRsh64Ux64 {
26428                         break
26429                 }
26430                 _ = v_0_0.Args[1]
26431                 x := v_0_0.Args[0]
26432                 v_0_0_1 := v_0_0.Args[1]
26433                 if v_0_0_1.Op != OpConst64 {
26434                         break
26435                 }
26436                 c1 := auxIntToInt64(v_0_0_1.AuxInt)
26437                 v_0_1 := v_0.Args[1]
26438                 if v_0_1.Op != OpConst64 {
26439                         break
26440                 }
26441                 c2 := auxIntToInt64(v_0_1.AuxInt)
26442                 if v_1.Op != OpConst64 {
26443                         break
26444                 }
26445                 c3 := auxIntToInt64(v_1.AuxInt)
26446                 if !(uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)) {
26447                         break
26448                 }
26449                 v.reset(OpRsh64Ux64)
26450                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
26451                 v0.AuxInt = int64ToAuxInt(c1 - c2 + c3)
26452                 v.AddArg2(x, v0)
26453                 return true
26454         }
26455         // match: (Rsh64Ux64 (Lsh64x64 x (Const64 [56])) (Const64 [56]))
26456         // result: (ZeroExt8to64 (Trunc64to8 <typ.UInt8> x))
26457         for {
26458                 if v_0.Op != OpLsh64x64 {
26459                         break
26460                 }
26461                 _ = v_0.Args[1]
26462                 x := v_0.Args[0]
26463                 v_0_1 := v_0.Args[1]
26464                 if v_0_1.Op != OpConst64 || auxIntToInt64(v_0_1.AuxInt) != 56 || v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 56 {
26465                         break
26466                 }
26467                 v.reset(OpZeroExt8to64)
26468                 v0 := b.NewValue0(v.Pos, OpTrunc64to8, typ.UInt8)
26469                 v0.AddArg(x)
26470                 v.AddArg(v0)
26471                 return true
26472         }
26473         // match: (Rsh64Ux64 (Lsh64x64 x (Const64 [48])) (Const64 [48]))
26474         // result: (ZeroExt16to64 (Trunc64to16 <typ.UInt16> x))
26475         for {
26476                 if v_0.Op != OpLsh64x64 {
26477                         break
26478                 }
26479                 _ = v_0.Args[1]
26480                 x := v_0.Args[0]
26481                 v_0_1 := v_0.Args[1]
26482                 if v_0_1.Op != OpConst64 || auxIntToInt64(v_0_1.AuxInt) != 48 || v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 48 {
26483                         break
26484                 }
26485                 v.reset(OpZeroExt16to64)
26486                 v0 := b.NewValue0(v.Pos, OpTrunc64to16, typ.UInt16)
26487                 v0.AddArg(x)
26488                 v.AddArg(v0)
26489                 return true
26490         }
26491         // match: (Rsh64Ux64 (Lsh64x64 x (Const64 [32])) (Const64 [32]))
26492         // result: (ZeroExt32to64 (Trunc64to32 <typ.UInt32> x))
26493         for {
26494                 if v_0.Op != OpLsh64x64 {
26495                         break
26496                 }
26497                 _ = v_0.Args[1]
26498                 x := v_0.Args[0]
26499                 v_0_1 := v_0.Args[1]
26500                 if v_0_1.Op != OpConst64 || auxIntToInt64(v_0_1.AuxInt) != 32 || v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 32 {
26501                         break
26502                 }
26503                 v.reset(OpZeroExt32to64)
26504                 v0 := b.NewValue0(v.Pos, OpTrunc64to32, typ.UInt32)
26505                 v0.AddArg(x)
26506                 v.AddArg(v0)
26507                 return true
26508         }
26509         return false
26510 }
26511 func rewriteValuegeneric_OpRsh64Ux8(v *Value) bool {
26512         v_1 := v.Args[1]
26513         v_0 := v.Args[0]
26514         b := v.Block
26515         // match: (Rsh64Ux8 <t> x (Const8 [c]))
26516         // result: (Rsh64Ux64 x (Const64 <t> [int64(uint8(c))]))
26517         for {
26518                 t := v.Type
26519                 x := v_0
26520                 if v_1.Op != OpConst8 {
26521                         break
26522                 }
26523                 c := auxIntToInt8(v_1.AuxInt)
26524                 v.reset(OpRsh64Ux64)
26525                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26526                 v0.AuxInt = int64ToAuxInt(int64(uint8(c)))
26527                 v.AddArg2(x, v0)
26528                 return true
26529         }
26530         // match: (Rsh64Ux8 (Const64 [0]) _)
26531         // result: (Const64 [0])
26532         for {
26533                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
26534                         break
26535                 }
26536                 v.reset(OpConst64)
26537                 v.AuxInt = int64ToAuxInt(0)
26538                 return true
26539         }
26540         return false
26541 }
26542 func rewriteValuegeneric_OpRsh64x16(v *Value) bool {
26543         v_1 := v.Args[1]
26544         v_0 := v.Args[0]
26545         b := v.Block
26546         // match: (Rsh64x16 <t> x (Const16 [c]))
26547         // result: (Rsh64x64 x (Const64 <t> [int64(uint16(c))]))
26548         for {
26549                 t := v.Type
26550                 x := v_0
26551                 if v_1.Op != OpConst16 {
26552                         break
26553                 }
26554                 c := auxIntToInt16(v_1.AuxInt)
26555                 v.reset(OpRsh64x64)
26556                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26557                 v0.AuxInt = int64ToAuxInt(int64(uint16(c)))
26558                 v.AddArg2(x, v0)
26559                 return true
26560         }
26561         // match: (Rsh64x16 (Const64 [0]) _)
26562         // result: (Const64 [0])
26563         for {
26564                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
26565                         break
26566                 }
26567                 v.reset(OpConst64)
26568                 v.AuxInt = int64ToAuxInt(0)
26569                 return true
26570         }
26571         return false
26572 }
26573 func rewriteValuegeneric_OpRsh64x32(v *Value) bool {
26574         v_1 := v.Args[1]
26575         v_0 := v.Args[0]
26576         b := v.Block
26577         // match: (Rsh64x32 <t> x (Const32 [c]))
26578         // result: (Rsh64x64 x (Const64 <t> [int64(uint32(c))]))
26579         for {
26580                 t := v.Type
26581                 x := v_0
26582                 if v_1.Op != OpConst32 {
26583                         break
26584                 }
26585                 c := auxIntToInt32(v_1.AuxInt)
26586                 v.reset(OpRsh64x64)
26587                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26588                 v0.AuxInt = int64ToAuxInt(int64(uint32(c)))
26589                 v.AddArg2(x, v0)
26590                 return true
26591         }
26592         // match: (Rsh64x32 (Const64 [0]) _)
26593         // result: (Const64 [0])
26594         for {
26595                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
26596                         break
26597                 }
26598                 v.reset(OpConst64)
26599                 v.AuxInt = int64ToAuxInt(0)
26600                 return true
26601         }
26602         return false
26603 }
26604 func rewriteValuegeneric_OpRsh64x64(v *Value) bool {
26605         v_1 := v.Args[1]
26606         v_0 := v.Args[0]
26607         b := v.Block
26608         typ := &b.Func.Config.Types
26609         // match: (Rsh64x64 (Const64 [c]) (Const64 [d]))
26610         // result: (Const64 [c >> uint64(d)])
26611         for {
26612                 if v_0.Op != OpConst64 {
26613                         break
26614                 }
26615                 c := auxIntToInt64(v_0.AuxInt)
26616                 if v_1.Op != OpConst64 {
26617                         break
26618                 }
26619                 d := auxIntToInt64(v_1.AuxInt)
26620                 v.reset(OpConst64)
26621                 v.AuxInt = int64ToAuxInt(c >> uint64(d))
26622                 return true
26623         }
26624         // match: (Rsh64x64 x (Const64 [0]))
26625         // result: x
26626         for {
26627                 x := v_0
26628                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 0 {
26629                         break
26630                 }
26631                 v.copyOf(x)
26632                 return true
26633         }
26634         // match: (Rsh64x64 (Const64 [0]) _)
26635         // result: (Const64 [0])
26636         for {
26637                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
26638                         break
26639                 }
26640                 v.reset(OpConst64)
26641                 v.AuxInt = int64ToAuxInt(0)
26642                 return true
26643         }
26644         // match: (Rsh64x64 <t> (Rsh64x64 x (Const64 [c])) (Const64 [d]))
26645         // cond: !uaddOvf(c,d)
26646         // result: (Rsh64x64 x (Const64 <t> [c+d]))
26647         for {
26648                 t := v.Type
26649                 if v_0.Op != OpRsh64x64 {
26650                         break
26651                 }
26652                 _ = v_0.Args[1]
26653                 x := v_0.Args[0]
26654                 v_0_1 := v_0.Args[1]
26655                 if v_0_1.Op != OpConst64 {
26656                         break
26657                 }
26658                 c := auxIntToInt64(v_0_1.AuxInt)
26659                 if v_1.Op != OpConst64 {
26660                         break
26661                 }
26662                 d := auxIntToInt64(v_1.AuxInt)
26663                 if !(!uaddOvf(c, d)) {
26664                         break
26665                 }
26666                 v.reset(OpRsh64x64)
26667                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26668                 v0.AuxInt = int64ToAuxInt(c + d)
26669                 v.AddArg2(x, v0)
26670                 return true
26671         }
26672         // match: (Rsh64x64 (Lsh64x64 x (Const64 [56])) (Const64 [56]))
26673         // result: (SignExt8to64 (Trunc64to8 <typ.Int8> x))
26674         for {
26675                 if v_0.Op != OpLsh64x64 {
26676                         break
26677                 }
26678                 _ = v_0.Args[1]
26679                 x := v_0.Args[0]
26680                 v_0_1 := v_0.Args[1]
26681                 if v_0_1.Op != OpConst64 || auxIntToInt64(v_0_1.AuxInt) != 56 || v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 56 {
26682                         break
26683                 }
26684                 v.reset(OpSignExt8to64)
26685                 v0 := b.NewValue0(v.Pos, OpTrunc64to8, typ.Int8)
26686                 v0.AddArg(x)
26687                 v.AddArg(v0)
26688                 return true
26689         }
26690         // match: (Rsh64x64 (Lsh64x64 x (Const64 [48])) (Const64 [48]))
26691         // result: (SignExt16to64 (Trunc64to16 <typ.Int16> x))
26692         for {
26693                 if v_0.Op != OpLsh64x64 {
26694                         break
26695                 }
26696                 _ = v_0.Args[1]
26697                 x := v_0.Args[0]
26698                 v_0_1 := v_0.Args[1]
26699                 if v_0_1.Op != OpConst64 || auxIntToInt64(v_0_1.AuxInt) != 48 || v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 48 {
26700                         break
26701                 }
26702                 v.reset(OpSignExt16to64)
26703                 v0 := b.NewValue0(v.Pos, OpTrunc64to16, typ.Int16)
26704                 v0.AddArg(x)
26705                 v.AddArg(v0)
26706                 return true
26707         }
26708         // match: (Rsh64x64 (Lsh64x64 x (Const64 [32])) (Const64 [32]))
26709         // result: (SignExt32to64 (Trunc64to32 <typ.Int32> x))
26710         for {
26711                 if v_0.Op != OpLsh64x64 {
26712                         break
26713                 }
26714                 _ = v_0.Args[1]
26715                 x := v_0.Args[0]
26716                 v_0_1 := v_0.Args[1]
26717                 if v_0_1.Op != OpConst64 || auxIntToInt64(v_0_1.AuxInt) != 32 || v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 32 {
26718                         break
26719                 }
26720                 v.reset(OpSignExt32to64)
26721                 v0 := b.NewValue0(v.Pos, OpTrunc64to32, typ.Int32)
26722                 v0.AddArg(x)
26723                 v.AddArg(v0)
26724                 return true
26725         }
26726         return false
26727 }
26728 func rewriteValuegeneric_OpRsh64x8(v *Value) bool {
26729         v_1 := v.Args[1]
26730         v_0 := v.Args[0]
26731         b := v.Block
26732         // match: (Rsh64x8 <t> x (Const8 [c]))
26733         // result: (Rsh64x64 x (Const64 <t> [int64(uint8(c))]))
26734         for {
26735                 t := v.Type
26736                 x := v_0
26737                 if v_1.Op != OpConst8 {
26738                         break
26739                 }
26740                 c := auxIntToInt8(v_1.AuxInt)
26741                 v.reset(OpRsh64x64)
26742                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26743                 v0.AuxInt = int64ToAuxInt(int64(uint8(c)))
26744                 v.AddArg2(x, v0)
26745                 return true
26746         }
26747         // match: (Rsh64x8 (Const64 [0]) _)
26748         // result: (Const64 [0])
26749         for {
26750                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
26751                         break
26752                 }
26753                 v.reset(OpConst64)
26754                 v.AuxInt = int64ToAuxInt(0)
26755                 return true
26756         }
26757         return false
26758 }
26759 func rewriteValuegeneric_OpRsh8Ux16(v *Value) bool {
26760         v_1 := v.Args[1]
26761         v_0 := v.Args[0]
26762         b := v.Block
26763         // match: (Rsh8Ux16 <t> x (Const16 [c]))
26764         // result: (Rsh8Ux64 x (Const64 <t> [int64(uint16(c))]))
26765         for {
26766                 t := v.Type
26767                 x := v_0
26768                 if v_1.Op != OpConst16 {
26769                         break
26770                 }
26771                 c := auxIntToInt16(v_1.AuxInt)
26772                 v.reset(OpRsh8Ux64)
26773                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26774                 v0.AuxInt = int64ToAuxInt(int64(uint16(c)))
26775                 v.AddArg2(x, v0)
26776                 return true
26777         }
26778         // match: (Rsh8Ux16 (Const8 [0]) _)
26779         // result: (Const8 [0])
26780         for {
26781                 if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
26782                         break
26783                 }
26784                 v.reset(OpConst8)
26785                 v.AuxInt = int8ToAuxInt(0)
26786                 return true
26787         }
26788         return false
26789 }
26790 func rewriteValuegeneric_OpRsh8Ux32(v *Value) bool {
26791         v_1 := v.Args[1]
26792         v_0 := v.Args[0]
26793         b := v.Block
26794         // match: (Rsh8Ux32 <t> x (Const32 [c]))
26795         // result: (Rsh8Ux64 x (Const64 <t> [int64(uint32(c))]))
26796         for {
26797                 t := v.Type
26798                 x := v_0
26799                 if v_1.Op != OpConst32 {
26800                         break
26801                 }
26802                 c := auxIntToInt32(v_1.AuxInt)
26803                 v.reset(OpRsh8Ux64)
26804                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26805                 v0.AuxInt = int64ToAuxInt(int64(uint32(c)))
26806                 v.AddArg2(x, v0)
26807                 return true
26808         }
26809         // match: (Rsh8Ux32 (Const8 [0]) _)
26810         // result: (Const8 [0])
26811         for {
26812                 if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
26813                         break
26814                 }
26815                 v.reset(OpConst8)
26816                 v.AuxInt = int8ToAuxInt(0)
26817                 return true
26818         }
26819         return false
26820 }
26821 func rewriteValuegeneric_OpRsh8Ux64(v *Value) bool {
26822         v_1 := v.Args[1]
26823         v_0 := v.Args[0]
26824         b := v.Block
26825         typ := &b.Func.Config.Types
26826         // match: (Rsh8Ux64 (Const8 [c]) (Const64 [d]))
26827         // result: (Const8 [int8(uint8(c) >> uint64(d))])
26828         for {
26829                 if v_0.Op != OpConst8 {
26830                         break
26831                 }
26832                 c := auxIntToInt8(v_0.AuxInt)
26833                 if v_1.Op != OpConst64 {
26834                         break
26835                 }
26836                 d := auxIntToInt64(v_1.AuxInt)
26837                 v.reset(OpConst8)
26838                 v.AuxInt = int8ToAuxInt(int8(uint8(c) >> uint64(d)))
26839                 return true
26840         }
26841         // match: (Rsh8Ux64 x (Const64 [0]))
26842         // result: x
26843         for {
26844                 x := v_0
26845                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 0 {
26846                         break
26847                 }
26848                 v.copyOf(x)
26849                 return true
26850         }
26851         // match: (Rsh8Ux64 (Const8 [0]) _)
26852         // result: (Const8 [0])
26853         for {
26854                 if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
26855                         break
26856                 }
26857                 v.reset(OpConst8)
26858                 v.AuxInt = int8ToAuxInt(0)
26859                 return true
26860         }
26861         // match: (Rsh8Ux64 _ (Const64 [c]))
26862         // cond: uint64(c) >= 8
26863         // result: (Const8 [0])
26864         for {
26865                 if v_1.Op != OpConst64 {
26866                         break
26867                 }
26868                 c := auxIntToInt64(v_1.AuxInt)
26869                 if !(uint64(c) >= 8) {
26870                         break
26871                 }
26872                 v.reset(OpConst8)
26873                 v.AuxInt = int8ToAuxInt(0)
26874                 return true
26875         }
26876         // match: (Rsh8Ux64 <t> (Rsh8Ux64 x (Const64 [c])) (Const64 [d]))
26877         // cond: !uaddOvf(c,d)
26878         // result: (Rsh8Ux64 x (Const64 <t> [c+d]))
26879         for {
26880                 t := v.Type
26881                 if v_0.Op != OpRsh8Ux64 {
26882                         break
26883                 }
26884                 _ = v_0.Args[1]
26885                 x := v_0.Args[0]
26886                 v_0_1 := v_0.Args[1]
26887                 if v_0_1.Op != OpConst64 {
26888                         break
26889                 }
26890                 c := auxIntToInt64(v_0_1.AuxInt)
26891                 if v_1.Op != OpConst64 {
26892                         break
26893                 }
26894                 d := auxIntToInt64(v_1.AuxInt)
26895                 if !(!uaddOvf(c, d)) {
26896                         break
26897                 }
26898                 v.reset(OpRsh8Ux64)
26899                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26900                 v0.AuxInt = int64ToAuxInt(c + d)
26901                 v.AddArg2(x, v0)
26902                 return true
26903         }
26904         // match: (Rsh8Ux64 (Rsh8x64 x _) (Const64 <t> [7] ))
26905         // result: (Rsh8Ux64 x (Const64 <t> [7] ))
26906         for {
26907                 if v_0.Op != OpRsh8x64 {
26908                         break
26909                 }
26910                 x := v_0.Args[0]
26911                 if v_1.Op != OpConst64 {
26912                         break
26913                 }
26914                 t := v_1.Type
26915                 if auxIntToInt64(v_1.AuxInt) != 7 {
26916                         break
26917                 }
26918                 v.reset(OpRsh8Ux64)
26919                 v0 := b.NewValue0(v.Pos, OpConst64, t)
26920                 v0.AuxInt = int64ToAuxInt(7)
26921                 v.AddArg2(x, v0)
26922                 return true
26923         }
26924         // match: (Rsh8Ux64 i:(Lsh8x64 x (Const64 [c])) (Const64 [c]))
26925         // cond: c >= 0 && c < 8 && i.Uses == 1
26926         // result: (And8 x (Const8 <v.Type> [int8 (^uint8 (0)>>c)]))
26927         for {
26928                 i := v_0
26929                 if i.Op != OpLsh8x64 {
26930                         break
26931                 }
26932                 _ = i.Args[1]
26933                 x := i.Args[0]
26934                 i_1 := i.Args[1]
26935                 if i_1.Op != OpConst64 {
26936                         break
26937                 }
26938                 c := auxIntToInt64(i_1.AuxInt)
26939                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != c || !(c >= 0 && c < 8 && i.Uses == 1) {
26940                         break
26941                 }
26942                 v.reset(OpAnd8)
26943                 v0 := b.NewValue0(v.Pos, OpConst8, v.Type)
26944                 v0.AuxInt = int8ToAuxInt(int8(^uint8(0) >> c))
26945                 v.AddArg2(x, v0)
26946                 return true
26947         }
26948         // match: (Rsh8Ux64 (Lsh8x64 (Rsh8Ux64 x (Const64 [c1])) (Const64 [c2])) (Const64 [c3]))
26949         // cond: uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)
26950         // result: (Rsh8Ux64 x (Const64 <typ.UInt64> [c1-c2+c3]))
26951         for {
26952                 if v_0.Op != OpLsh8x64 {
26953                         break
26954                 }
26955                 _ = v_0.Args[1]
26956                 v_0_0 := v_0.Args[0]
26957                 if v_0_0.Op != OpRsh8Ux64 {
26958                         break
26959                 }
26960                 _ = v_0_0.Args[1]
26961                 x := v_0_0.Args[0]
26962                 v_0_0_1 := v_0_0.Args[1]
26963                 if v_0_0_1.Op != OpConst64 {
26964                         break
26965                 }
26966                 c1 := auxIntToInt64(v_0_0_1.AuxInt)
26967                 v_0_1 := v_0.Args[1]
26968                 if v_0_1.Op != OpConst64 {
26969                         break
26970                 }
26971                 c2 := auxIntToInt64(v_0_1.AuxInt)
26972                 if v_1.Op != OpConst64 {
26973                         break
26974                 }
26975                 c3 := auxIntToInt64(v_1.AuxInt)
26976                 if !(uint64(c1) >= uint64(c2) && uint64(c3) >= uint64(c2) && !uaddOvf(c1-c2, c3)) {
26977                         break
26978                 }
26979                 v.reset(OpRsh8Ux64)
26980                 v0 := b.NewValue0(v.Pos, OpConst64, typ.UInt64)
26981                 v0.AuxInt = int64ToAuxInt(c1 - c2 + c3)
26982                 v.AddArg2(x, v0)
26983                 return true
26984         }
26985         return false
26986 }
26987 func rewriteValuegeneric_OpRsh8Ux8(v *Value) bool {
26988         v_1 := v.Args[1]
26989         v_0 := v.Args[0]
26990         b := v.Block
26991         // match: (Rsh8Ux8 <t> x (Const8 [c]))
26992         // result: (Rsh8Ux64 x (Const64 <t> [int64(uint8(c))]))
26993         for {
26994                 t := v.Type
26995                 x := v_0
26996                 if v_1.Op != OpConst8 {
26997                         break
26998                 }
26999                 c := auxIntToInt8(v_1.AuxInt)
27000                 v.reset(OpRsh8Ux64)
27001                 v0 := b.NewValue0(v.Pos, OpConst64, t)
27002                 v0.AuxInt = int64ToAuxInt(int64(uint8(c)))
27003                 v.AddArg2(x, v0)
27004                 return true
27005         }
27006         // match: (Rsh8Ux8 (Const8 [0]) _)
27007         // result: (Const8 [0])
27008         for {
27009                 if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
27010                         break
27011                 }
27012                 v.reset(OpConst8)
27013                 v.AuxInt = int8ToAuxInt(0)
27014                 return true
27015         }
27016         return false
27017 }
27018 func rewriteValuegeneric_OpRsh8x16(v *Value) bool {
27019         v_1 := v.Args[1]
27020         v_0 := v.Args[0]
27021         b := v.Block
27022         // match: (Rsh8x16 <t> x (Const16 [c]))
27023         // result: (Rsh8x64 x (Const64 <t> [int64(uint16(c))]))
27024         for {
27025                 t := v.Type
27026                 x := v_0
27027                 if v_1.Op != OpConst16 {
27028                         break
27029                 }
27030                 c := auxIntToInt16(v_1.AuxInt)
27031                 v.reset(OpRsh8x64)
27032                 v0 := b.NewValue0(v.Pos, OpConst64, t)
27033                 v0.AuxInt = int64ToAuxInt(int64(uint16(c)))
27034                 v.AddArg2(x, v0)
27035                 return true
27036         }
27037         // match: (Rsh8x16 (Const8 [0]) _)
27038         // result: (Const8 [0])
27039         for {
27040                 if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
27041                         break
27042                 }
27043                 v.reset(OpConst8)
27044                 v.AuxInt = int8ToAuxInt(0)
27045                 return true
27046         }
27047         return false
27048 }
27049 func rewriteValuegeneric_OpRsh8x32(v *Value) bool {
27050         v_1 := v.Args[1]
27051         v_0 := v.Args[0]
27052         b := v.Block
27053         // match: (Rsh8x32 <t> x (Const32 [c]))
27054         // result: (Rsh8x64 x (Const64 <t> [int64(uint32(c))]))
27055         for {
27056                 t := v.Type
27057                 x := v_0
27058                 if v_1.Op != OpConst32 {
27059                         break
27060                 }
27061                 c := auxIntToInt32(v_1.AuxInt)
27062                 v.reset(OpRsh8x64)
27063                 v0 := b.NewValue0(v.Pos, OpConst64, t)
27064                 v0.AuxInt = int64ToAuxInt(int64(uint32(c)))
27065                 v.AddArg2(x, v0)
27066                 return true
27067         }
27068         // match: (Rsh8x32 (Const8 [0]) _)
27069         // result: (Const8 [0])
27070         for {
27071                 if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
27072                         break
27073                 }
27074                 v.reset(OpConst8)
27075                 v.AuxInt = int8ToAuxInt(0)
27076                 return true
27077         }
27078         return false
27079 }
27080 func rewriteValuegeneric_OpRsh8x64(v *Value) bool {
27081         v_1 := v.Args[1]
27082         v_0 := v.Args[0]
27083         b := v.Block
27084         // match: (Rsh8x64 (Const8 [c]) (Const64 [d]))
27085         // result: (Const8 [c >> uint64(d)])
27086         for {
27087                 if v_0.Op != OpConst8 {
27088                         break
27089                 }
27090                 c := auxIntToInt8(v_0.AuxInt)
27091                 if v_1.Op != OpConst64 {
27092                         break
27093                 }
27094                 d := auxIntToInt64(v_1.AuxInt)
27095                 v.reset(OpConst8)
27096                 v.AuxInt = int8ToAuxInt(c >> uint64(d))
27097                 return true
27098         }
27099         // match: (Rsh8x64 x (Const64 [0]))
27100         // result: x
27101         for {
27102                 x := v_0
27103                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 0 {
27104                         break
27105                 }
27106                 v.copyOf(x)
27107                 return true
27108         }
27109         // match: (Rsh8x64 (Const8 [0]) _)
27110         // result: (Const8 [0])
27111         for {
27112                 if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
27113                         break
27114                 }
27115                 v.reset(OpConst8)
27116                 v.AuxInt = int8ToAuxInt(0)
27117                 return true
27118         }
27119         // match: (Rsh8x64 <t> (Rsh8x64 x (Const64 [c])) (Const64 [d]))
27120         // cond: !uaddOvf(c,d)
27121         // result: (Rsh8x64 x (Const64 <t> [c+d]))
27122         for {
27123                 t := v.Type
27124                 if v_0.Op != OpRsh8x64 {
27125                         break
27126                 }
27127                 _ = v_0.Args[1]
27128                 x := v_0.Args[0]
27129                 v_0_1 := v_0.Args[1]
27130                 if v_0_1.Op != OpConst64 {
27131                         break
27132                 }
27133                 c := auxIntToInt64(v_0_1.AuxInt)
27134                 if v_1.Op != OpConst64 {
27135                         break
27136                 }
27137                 d := auxIntToInt64(v_1.AuxInt)
27138                 if !(!uaddOvf(c, d)) {
27139                         break
27140                 }
27141                 v.reset(OpRsh8x64)
27142                 v0 := b.NewValue0(v.Pos, OpConst64, t)
27143                 v0.AuxInt = int64ToAuxInt(c + d)
27144                 v.AddArg2(x, v0)
27145                 return true
27146         }
27147         return false
27148 }
27149 func rewriteValuegeneric_OpRsh8x8(v *Value) bool {
27150         v_1 := v.Args[1]
27151         v_0 := v.Args[0]
27152         b := v.Block
27153         // match: (Rsh8x8 <t> x (Const8 [c]))
27154         // result: (Rsh8x64 x (Const64 <t> [int64(uint8(c))]))
27155         for {
27156                 t := v.Type
27157                 x := v_0
27158                 if v_1.Op != OpConst8 {
27159                         break
27160                 }
27161                 c := auxIntToInt8(v_1.AuxInt)
27162                 v.reset(OpRsh8x64)
27163                 v0 := b.NewValue0(v.Pos, OpConst64, t)
27164                 v0.AuxInt = int64ToAuxInt(int64(uint8(c)))
27165                 v.AddArg2(x, v0)
27166                 return true
27167         }
27168         // match: (Rsh8x8 (Const8 [0]) _)
27169         // result: (Const8 [0])
27170         for {
27171                 if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
27172                         break
27173                 }
27174                 v.reset(OpConst8)
27175                 v.AuxInt = int8ToAuxInt(0)
27176                 return true
27177         }
27178         return false
27179 }
27180 func rewriteValuegeneric_OpSelect0(v *Value) bool {
27181         v_0 := v.Args[0]
27182         // match: (Select0 (Div128u (Const64 [0]) lo y))
27183         // result: (Div64u lo y)
27184         for {
27185                 if v_0.Op != OpDiv128u {
27186                         break
27187                 }
27188                 y := v_0.Args[2]
27189                 v_0_0 := v_0.Args[0]
27190                 if v_0_0.Op != OpConst64 || auxIntToInt64(v_0_0.AuxInt) != 0 {
27191                         break
27192                 }
27193                 lo := v_0.Args[1]
27194                 v.reset(OpDiv64u)
27195                 v.AddArg2(lo, y)
27196                 return true
27197         }
27198         // match: (Select0 (Mul32uover (Const32 [1]) x))
27199         // result: x
27200         for {
27201                 if v_0.Op != OpMul32uover {
27202                         break
27203                 }
27204                 _ = v_0.Args[1]
27205                 v_0_0 := v_0.Args[0]
27206                 v_0_1 := v_0.Args[1]
27207                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
27208                         if v_0_0.Op != OpConst32 || auxIntToInt32(v_0_0.AuxInt) != 1 {
27209                                 continue
27210                         }
27211                         x := v_0_1
27212                         v.copyOf(x)
27213                         return true
27214                 }
27215                 break
27216         }
27217         // match: (Select0 (Mul64uover (Const64 [1]) x))
27218         // result: x
27219         for {
27220                 if v_0.Op != OpMul64uover {
27221                         break
27222                 }
27223                 _ = v_0.Args[1]
27224                 v_0_0 := v_0.Args[0]
27225                 v_0_1 := v_0.Args[1]
27226                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
27227                         if v_0_0.Op != OpConst64 || auxIntToInt64(v_0_0.AuxInt) != 1 {
27228                                 continue
27229                         }
27230                         x := v_0_1
27231                         v.copyOf(x)
27232                         return true
27233                 }
27234                 break
27235         }
27236         // match: (Select0 (Mul64uover (Const64 [0]) x))
27237         // result: (Const64 [0])
27238         for {
27239                 if v_0.Op != OpMul64uover {
27240                         break
27241                 }
27242                 _ = v_0.Args[1]
27243                 v_0_0 := v_0.Args[0]
27244                 v_0_1 := v_0.Args[1]
27245                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
27246                         if v_0_0.Op != OpConst64 || auxIntToInt64(v_0_0.AuxInt) != 0 {
27247                                 continue
27248                         }
27249                         v.reset(OpConst64)
27250                         v.AuxInt = int64ToAuxInt(0)
27251                         return true
27252                 }
27253                 break
27254         }
27255         // match: (Select0 (Mul32uover (Const32 [0]) x))
27256         // result: (Const32 [0])
27257         for {
27258                 if v_0.Op != OpMul32uover {
27259                         break
27260                 }
27261                 _ = v_0.Args[1]
27262                 v_0_0 := v_0.Args[0]
27263                 v_0_1 := v_0.Args[1]
27264                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
27265                         if v_0_0.Op != OpConst32 || auxIntToInt32(v_0_0.AuxInt) != 0 {
27266                                 continue
27267                         }
27268                         v.reset(OpConst32)
27269                         v.AuxInt = int32ToAuxInt(0)
27270                         return true
27271                 }
27272                 break
27273         }
27274         return false
27275 }
27276 func rewriteValuegeneric_OpSelect1(v *Value) bool {
27277         v_0 := v.Args[0]
27278         // match: (Select1 (Div128u (Const64 [0]) lo y))
27279         // result: (Mod64u lo y)
27280         for {
27281                 if v_0.Op != OpDiv128u {
27282                         break
27283                 }
27284                 y := v_0.Args[2]
27285                 v_0_0 := v_0.Args[0]
27286                 if v_0_0.Op != OpConst64 || auxIntToInt64(v_0_0.AuxInt) != 0 {
27287                         break
27288                 }
27289                 lo := v_0.Args[1]
27290                 v.reset(OpMod64u)
27291                 v.AddArg2(lo, y)
27292                 return true
27293         }
27294         // match: (Select1 (Mul32uover (Const32 [1]) x))
27295         // result: (ConstBool [false])
27296         for {
27297                 if v_0.Op != OpMul32uover {
27298                         break
27299                 }
27300                 _ = v_0.Args[1]
27301                 v_0_0 := v_0.Args[0]
27302                 v_0_1 := v_0.Args[1]
27303                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
27304                         if v_0_0.Op != OpConst32 || auxIntToInt32(v_0_0.AuxInt) != 1 {
27305                                 continue
27306                         }
27307                         v.reset(OpConstBool)
27308                         v.AuxInt = boolToAuxInt(false)
27309                         return true
27310                 }
27311                 break
27312         }
27313         // match: (Select1 (Mul64uover (Const64 [1]) x))
27314         // result: (ConstBool [false])
27315         for {
27316                 if v_0.Op != OpMul64uover {
27317                         break
27318                 }
27319                 _ = v_0.Args[1]
27320                 v_0_0 := v_0.Args[0]
27321                 v_0_1 := v_0.Args[1]
27322                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
27323                         if v_0_0.Op != OpConst64 || auxIntToInt64(v_0_0.AuxInt) != 1 {
27324                                 continue
27325                         }
27326                         v.reset(OpConstBool)
27327                         v.AuxInt = boolToAuxInt(false)
27328                         return true
27329                 }
27330                 break
27331         }
27332         // match: (Select1 (Mul64uover (Const64 [0]) x))
27333         // result: (ConstBool [false])
27334         for {
27335                 if v_0.Op != OpMul64uover {
27336                         break
27337                 }
27338                 _ = v_0.Args[1]
27339                 v_0_0 := v_0.Args[0]
27340                 v_0_1 := v_0.Args[1]
27341                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
27342                         if v_0_0.Op != OpConst64 || auxIntToInt64(v_0_0.AuxInt) != 0 {
27343                                 continue
27344                         }
27345                         v.reset(OpConstBool)
27346                         v.AuxInt = boolToAuxInt(false)
27347                         return true
27348                 }
27349                 break
27350         }
27351         // match: (Select1 (Mul32uover (Const32 [0]) x))
27352         // result: (ConstBool [false])
27353         for {
27354                 if v_0.Op != OpMul32uover {
27355                         break
27356                 }
27357                 _ = v_0.Args[1]
27358                 v_0_0 := v_0.Args[0]
27359                 v_0_1 := v_0.Args[1]
27360                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
27361                         if v_0_0.Op != OpConst32 || auxIntToInt32(v_0_0.AuxInt) != 0 {
27362                                 continue
27363                         }
27364                         v.reset(OpConstBool)
27365                         v.AuxInt = boolToAuxInt(false)
27366                         return true
27367                 }
27368                 break
27369         }
27370         return false
27371 }
27372 func rewriteValuegeneric_OpSelectN(v *Value) bool {
27373         v_0 := v.Args[0]
27374         b := v.Block
27375         config := b.Func.Config
27376         // match: (SelectN [0] (MakeResult x ___))
27377         // result: x
27378         for {
27379                 if auxIntToInt64(v.AuxInt) != 0 || v_0.Op != OpMakeResult || len(v_0.Args) < 1 {
27380                         break
27381                 }
27382                 x := v_0.Args[0]
27383                 v.copyOf(x)
27384                 return true
27385         }
27386         // match: (SelectN [1] (MakeResult x y ___))
27387         // result: y
27388         for {
27389                 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpMakeResult || len(v_0.Args) < 2 {
27390                         break
27391                 }
27392                 y := v_0.Args[1]
27393                 v.copyOf(y)
27394                 return true
27395         }
27396         // match: (SelectN [2] (MakeResult x y z ___))
27397         // result: z
27398         for {
27399                 if auxIntToInt64(v.AuxInt) != 2 || v_0.Op != OpMakeResult || len(v_0.Args) < 3 {
27400                         break
27401                 }
27402                 z := v_0.Args[2]
27403                 v.copyOf(z)
27404                 return true
27405         }
27406         // match: (SelectN [0] call:(StaticCall {sym} sptr (Const64 [c]) mem))
27407         // cond: isInlinableMemclr(config, int64(c)) && isSameCall(sym, "runtime.memclrNoHeapPointers") && call.Uses == 1 && clobber(call)
27408         // result: (Zero {types.Types[types.TUINT8]} [int64(c)] sptr mem)
27409         for {
27410                 if auxIntToInt64(v.AuxInt) != 0 {
27411                         break
27412                 }
27413                 call := v_0
27414                 if call.Op != OpStaticCall || len(call.Args) != 3 {
27415                         break
27416                 }
27417                 sym := auxToCall(call.Aux)
27418                 mem := call.Args[2]
27419                 sptr := call.Args[0]
27420                 call_1 := call.Args[1]
27421                 if call_1.Op != OpConst64 {
27422                         break
27423                 }
27424                 c := auxIntToInt64(call_1.AuxInt)
27425                 if !(isInlinableMemclr(config, int64(c)) && isSameCall(sym, "runtime.memclrNoHeapPointers") && call.Uses == 1 && clobber(call)) {
27426                         break
27427                 }
27428                 v.reset(OpZero)
27429                 v.AuxInt = int64ToAuxInt(int64(c))
27430                 v.Aux = typeToAux(types.Types[types.TUINT8])
27431                 v.AddArg2(sptr, mem)
27432                 return true
27433         }
27434         // match: (SelectN [0] call:(StaticCall {sym} sptr (Const32 [c]) mem))
27435         // cond: isInlinableMemclr(config, int64(c)) && isSameCall(sym, "runtime.memclrNoHeapPointers") && call.Uses == 1 && clobber(call)
27436         // result: (Zero {types.Types[types.TUINT8]} [int64(c)] sptr mem)
27437         for {
27438                 if auxIntToInt64(v.AuxInt) != 0 {
27439                         break
27440                 }
27441                 call := v_0
27442                 if call.Op != OpStaticCall || len(call.Args) != 3 {
27443                         break
27444                 }
27445                 sym := auxToCall(call.Aux)
27446                 mem := call.Args[2]
27447                 sptr := call.Args[0]
27448                 call_1 := call.Args[1]
27449                 if call_1.Op != OpConst32 {
27450                         break
27451                 }
27452                 c := auxIntToInt32(call_1.AuxInt)
27453                 if !(isInlinableMemclr(config, int64(c)) && isSameCall(sym, "runtime.memclrNoHeapPointers") && call.Uses == 1 && clobber(call)) {
27454                         break
27455                 }
27456                 v.reset(OpZero)
27457                 v.AuxInt = int64ToAuxInt(int64(c))
27458                 v.Aux = typeToAux(types.Types[types.TUINT8])
27459                 v.AddArg2(sptr, mem)
27460                 return true
27461         }
27462         // match: (SelectN [0] call:(StaticCall {sym} s1:(Store _ (Const64 [sz]) s2:(Store _ src s3:(Store {t} _ dst mem)))))
27463         // cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, int64(sz), config) && clobber(s1, s2, s3, call)
27464         // result: (Move {types.Types[types.TUINT8]} [int64(sz)] dst src mem)
27465         for {
27466                 if auxIntToInt64(v.AuxInt) != 0 {
27467                         break
27468                 }
27469                 call := v_0
27470                 if call.Op != OpStaticCall || len(call.Args) != 1 {
27471                         break
27472                 }
27473                 sym := auxToCall(call.Aux)
27474                 s1 := call.Args[0]
27475                 if s1.Op != OpStore {
27476                         break
27477                 }
27478                 _ = s1.Args[2]
27479                 s1_1 := s1.Args[1]
27480                 if s1_1.Op != OpConst64 {
27481                         break
27482                 }
27483                 sz := auxIntToInt64(s1_1.AuxInt)
27484                 s2 := s1.Args[2]
27485                 if s2.Op != OpStore {
27486                         break
27487                 }
27488                 _ = s2.Args[2]
27489                 src := s2.Args[1]
27490                 s3 := s2.Args[2]
27491                 if s3.Op != OpStore {
27492                         break
27493                 }
27494                 mem := s3.Args[2]
27495                 dst := s3.Args[1]
27496                 if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, int64(sz), config) && clobber(s1, s2, s3, call)) {
27497                         break
27498                 }
27499                 v.reset(OpMove)
27500                 v.AuxInt = int64ToAuxInt(int64(sz))
27501                 v.Aux = typeToAux(types.Types[types.TUINT8])
27502                 v.AddArg3(dst, src, mem)
27503                 return true
27504         }
27505         // match: (SelectN [0] call:(StaticCall {sym} s1:(Store _ (Const32 [sz]) s2:(Store _ src s3:(Store {t} _ dst mem)))))
27506         // cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, int64(sz), config) && clobber(s1, s2, s3, call)
27507         // result: (Move {types.Types[types.TUINT8]} [int64(sz)] dst src mem)
27508         for {
27509                 if auxIntToInt64(v.AuxInt) != 0 {
27510                         break
27511                 }
27512                 call := v_0
27513                 if call.Op != OpStaticCall || len(call.Args) != 1 {
27514                         break
27515                 }
27516                 sym := auxToCall(call.Aux)
27517                 s1 := call.Args[0]
27518                 if s1.Op != OpStore {
27519                         break
27520                 }
27521                 _ = s1.Args[2]
27522                 s1_1 := s1.Args[1]
27523                 if s1_1.Op != OpConst32 {
27524                         break
27525                 }
27526                 sz := auxIntToInt32(s1_1.AuxInt)
27527                 s2 := s1.Args[2]
27528                 if s2.Op != OpStore {
27529                         break
27530                 }
27531                 _ = s2.Args[2]
27532                 src := s2.Args[1]
27533                 s3 := s2.Args[2]
27534                 if s3.Op != OpStore {
27535                         break
27536                 }
27537                 mem := s3.Args[2]
27538                 dst := s3.Args[1]
27539                 if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, int64(sz), config) && clobber(s1, s2, s3, call)) {
27540                         break
27541                 }
27542                 v.reset(OpMove)
27543                 v.AuxInt = int64ToAuxInt(int64(sz))
27544                 v.Aux = typeToAux(types.Types[types.TUINT8])
27545                 v.AddArg3(dst, src, mem)
27546                 return true
27547         }
27548         // match: (SelectN [0] call:(StaticCall {sym} dst src (Const64 [sz]) mem))
27549         // cond: sz >= 0 && call.Uses == 1 && isSameCall(sym, "runtime.memmove") && isInlinableMemmove(dst, src, int64(sz), config) && clobber(call)
27550         // result: (Move {types.Types[types.TUINT8]} [int64(sz)] dst src mem)
27551         for {
27552                 if auxIntToInt64(v.AuxInt) != 0 {
27553                         break
27554                 }
27555                 call := v_0
27556                 if call.Op != OpStaticCall || len(call.Args) != 4 {
27557                         break
27558                 }
27559                 sym := auxToCall(call.Aux)
27560                 mem := call.Args[3]
27561                 dst := call.Args[0]
27562                 src := call.Args[1]
27563                 call_2 := call.Args[2]
27564                 if call_2.Op != OpConst64 {
27565                         break
27566                 }
27567                 sz := auxIntToInt64(call_2.AuxInt)
27568                 if !(sz >= 0 && call.Uses == 1 && isSameCall(sym, "runtime.memmove") && isInlinableMemmove(dst, src, int64(sz), config) && clobber(call)) {
27569                         break
27570                 }
27571                 v.reset(OpMove)
27572                 v.AuxInt = int64ToAuxInt(int64(sz))
27573                 v.Aux = typeToAux(types.Types[types.TUINT8])
27574                 v.AddArg3(dst, src, mem)
27575                 return true
27576         }
27577         // match: (SelectN [0] call:(StaticCall {sym} dst src (Const32 [sz]) mem))
27578         // cond: sz >= 0 && call.Uses == 1 && isSameCall(sym, "runtime.memmove") && isInlinableMemmove(dst, src, int64(sz), config) && clobber(call)
27579         // result: (Move {types.Types[types.TUINT8]} [int64(sz)] dst src mem)
27580         for {
27581                 if auxIntToInt64(v.AuxInt) != 0 {
27582                         break
27583                 }
27584                 call := v_0
27585                 if call.Op != OpStaticCall || len(call.Args) != 4 {
27586                         break
27587                 }
27588                 sym := auxToCall(call.Aux)
27589                 mem := call.Args[3]
27590                 dst := call.Args[0]
27591                 src := call.Args[1]
27592                 call_2 := call.Args[2]
27593                 if call_2.Op != OpConst32 {
27594                         break
27595                 }
27596                 sz := auxIntToInt32(call_2.AuxInt)
27597                 if !(sz >= 0 && call.Uses == 1 && isSameCall(sym, "runtime.memmove") && isInlinableMemmove(dst, src, int64(sz), config) && clobber(call)) {
27598                         break
27599                 }
27600                 v.reset(OpMove)
27601                 v.AuxInt = int64ToAuxInt(int64(sz))
27602                 v.Aux = typeToAux(types.Types[types.TUINT8])
27603                 v.AddArg3(dst, src, mem)
27604                 return true
27605         }
27606         // match: (SelectN [0] call:(StaticLECall {sym} dst src (Const64 [sz]) mem))
27607         // cond: sz >= 0 && call.Uses == 1 && isSameCall(sym, "runtime.memmove") && isInlinableMemmove(dst, src, int64(sz), config) && clobber(call)
27608         // result: (Move {types.Types[types.TUINT8]} [int64(sz)] dst src mem)
27609         for {
27610                 if auxIntToInt64(v.AuxInt) != 0 {
27611                         break
27612                 }
27613                 call := v_0
27614                 if call.Op != OpStaticLECall || len(call.Args) != 4 {
27615                         break
27616                 }
27617                 sym := auxToCall(call.Aux)
27618                 mem := call.Args[3]
27619                 dst := call.Args[0]
27620                 src := call.Args[1]
27621                 call_2 := call.Args[2]
27622                 if call_2.Op != OpConst64 {
27623                         break
27624                 }
27625                 sz := auxIntToInt64(call_2.AuxInt)
27626                 if !(sz >= 0 && call.Uses == 1 && isSameCall(sym, "runtime.memmove") && isInlinableMemmove(dst, src, int64(sz), config) && clobber(call)) {
27627                         break
27628                 }
27629                 v.reset(OpMove)
27630                 v.AuxInt = int64ToAuxInt(int64(sz))
27631                 v.Aux = typeToAux(types.Types[types.TUINT8])
27632                 v.AddArg3(dst, src, mem)
27633                 return true
27634         }
27635         // match: (SelectN [0] call:(StaticLECall {sym} dst src (Const32 [sz]) mem))
27636         // cond: sz >= 0 && call.Uses == 1 && isSameCall(sym, "runtime.memmove") && isInlinableMemmove(dst, src, int64(sz), config) && clobber(call)
27637         // result: (Move {types.Types[types.TUINT8]} [int64(sz)] dst src mem)
27638         for {
27639                 if auxIntToInt64(v.AuxInt) != 0 {
27640                         break
27641                 }
27642                 call := v_0
27643                 if call.Op != OpStaticLECall || len(call.Args) != 4 {
27644                         break
27645                 }
27646                 sym := auxToCall(call.Aux)
27647                 mem := call.Args[3]
27648                 dst := call.Args[0]
27649                 src := call.Args[1]
27650                 call_2 := call.Args[2]
27651                 if call_2.Op != OpConst32 {
27652                         break
27653                 }
27654                 sz := auxIntToInt32(call_2.AuxInt)
27655                 if !(sz >= 0 && call.Uses == 1 && isSameCall(sym, "runtime.memmove") && isInlinableMemmove(dst, src, int64(sz), config) && clobber(call)) {
27656                         break
27657                 }
27658                 v.reset(OpMove)
27659                 v.AuxInt = int64ToAuxInt(int64(sz))
27660                 v.Aux = typeToAux(types.Types[types.TUINT8])
27661                 v.AddArg3(dst, src, mem)
27662                 return true
27663         }
27664         // match: (SelectN [0] call:(StaticLECall {sym} a x))
27665         // cond: needRaceCleanup(sym, call) && clobber(call)
27666         // result: x
27667         for {
27668                 if auxIntToInt64(v.AuxInt) != 0 {
27669                         break
27670                 }
27671                 call := v_0
27672                 if call.Op != OpStaticLECall || len(call.Args) != 2 {
27673                         break
27674                 }
27675                 sym := auxToCall(call.Aux)
27676                 x := call.Args[1]
27677                 if !(needRaceCleanup(sym, call) && clobber(call)) {
27678                         break
27679                 }
27680                 v.copyOf(x)
27681                 return true
27682         }
27683         // match: (SelectN [0] call:(StaticLECall {sym} x))
27684         // cond: needRaceCleanup(sym, call) && clobber(call)
27685         // result: x
27686         for {
27687                 if auxIntToInt64(v.AuxInt) != 0 {
27688                         break
27689                 }
27690                 call := v_0
27691                 if call.Op != OpStaticLECall || len(call.Args) != 1 {
27692                         break
27693                 }
27694                 sym := auxToCall(call.Aux)
27695                 x := call.Args[0]
27696                 if !(needRaceCleanup(sym, call) && clobber(call)) {
27697                         break
27698                 }
27699                 v.copyOf(x)
27700                 return true
27701         }
27702         // match: (SelectN [1] (StaticCall {sym} _ newLen:(Const64) _ _ _ _))
27703         // cond: v.Type.IsInteger() && isSameCall(sym, "runtime.growslice")
27704         // result: newLen
27705         for {
27706                 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpStaticCall || len(v_0.Args) != 6 {
27707                         break
27708                 }
27709                 sym := auxToCall(v_0.Aux)
27710                 _ = v_0.Args[1]
27711                 newLen := v_0.Args[1]
27712                 if newLen.Op != OpConst64 || !(v.Type.IsInteger() && isSameCall(sym, "runtime.growslice")) {
27713                         break
27714                 }
27715                 v.copyOf(newLen)
27716                 return true
27717         }
27718         // match: (SelectN [1] (StaticCall {sym} _ newLen:(Const32) _ _ _ _))
27719         // cond: v.Type.IsInteger() && isSameCall(sym, "runtime.growslice")
27720         // result: newLen
27721         for {
27722                 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpStaticCall || len(v_0.Args) != 6 {
27723                         break
27724                 }
27725                 sym := auxToCall(v_0.Aux)
27726                 _ = v_0.Args[1]
27727                 newLen := v_0.Args[1]
27728                 if newLen.Op != OpConst32 || !(v.Type.IsInteger() && isSameCall(sym, "runtime.growslice")) {
27729                         break
27730                 }
27731                 v.copyOf(newLen)
27732                 return true
27733         }
27734         return false
27735 }
27736 func rewriteValuegeneric_OpSignExt16to32(v *Value) bool {
27737         v_0 := v.Args[0]
27738         // match: (SignExt16to32 (Const16 [c]))
27739         // result: (Const32 [int32(c)])
27740         for {
27741                 if v_0.Op != OpConst16 {
27742                         break
27743                 }
27744                 c := auxIntToInt16(v_0.AuxInt)
27745                 v.reset(OpConst32)
27746                 v.AuxInt = int32ToAuxInt(int32(c))
27747                 return true
27748         }
27749         // match: (SignExt16to32 (Trunc32to16 x:(Rsh32x64 _ (Const64 [s]))))
27750         // cond: s >= 16
27751         // result: x
27752         for {
27753                 if v_0.Op != OpTrunc32to16 {
27754                         break
27755                 }
27756                 x := v_0.Args[0]
27757                 if x.Op != OpRsh32x64 {
27758                         break
27759                 }
27760                 _ = x.Args[1]
27761                 x_1 := x.Args[1]
27762                 if x_1.Op != OpConst64 {
27763                         break
27764                 }
27765                 s := auxIntToInt64(x_1.AuxInt)
27766                 if !(s >= 16) {
27767                         break
27768                 }
27769                 v.copyOf(x)
27770                 return true
27771         }
27772         return false
27773 }
27774 func rewriteValuegeneric_OpSignExt16to64(v *Value) bool {
27775         v_0 := v.Args[0]
27776         // match: (SignExt16to64 (Const16 [c]))
27777         // result: (Const64 [int64(c)])
27778         for {
27779                 if v_0.Op != OpConst16 {
27780                         break
27781                 }
27782                 c := auxIntToInt16(v_0.AuxInt)
27783                 v.reset(OpConst64)
27784                 v.AuxInt = int64ToAuxInt(int64(c))
27785                 return true
27786         }
27787         // match: (SignExt16to64 (Trunc64to16 x:(Rsh64x64 _ (Const64 [s]))))
27788         // cond: s >= 48
27789         // result: x
27790         for {
27791                 if v_0.Op != OpTrunc64to16 {
27792                         break
27793                 }
27794                 x := v_0.Args[0]
27795                 if x.Op != OpRsh64x64 {
27796                         break
27797                 }
27798                 _ = x.Args[1]
27799                 x_1 := x.Args[1]
27800                 if x_1.Op != OpConst64 {
27801                         break
27802                 }
27803                 s := auxIntToInt64(x_1.AuxInt)
27804                 if !(s >= 48) {
27805                         break
27806                 }
27807                 v.copyOf(x)
27808                 return true
27809         }
27810         return false
27811 }
27812 func rewriteValuegeneric_OpSignExt32to64(v *Value) bool {
27813         v_0 := v.Args[0]
27814         // match: (SignExt32to64 (Const32 [c]))
27815         // result: (Const64 [int64(c)])
27816         for {
27817                 if v_0.Op != OpConst32 {
27818                         break
27819                 }
27820                 c := auxIntToInt32(v_0.AuxInt)
27821                 v.reset(OpConst64)
27822                 v.AuxInt = int64ToAuxInt(int64(c))
27823                 return true
27824         }
27825         // match: (SignExt32to64 (Trunc64to32 x:(Rsh64x64 _ (Const64 [s]))))
27826         // cond: s >= 32
27827         // result: x
27828         for {
27829                 if v_0.Op != OpTrunc64to32 {
27830                         break
27831                 }
27832                 x := v_0.Args[0]
27833                 if x.Op != OpRsh64x64 {
27834                         break
27835                 }
27836                 _ = x.Args[1]
27837                 x_1 := x.Args[1]
27838                 if x_1.Op != OpConst64 {
27839                         break
27840                 }
27841                 s := auxIntToInt64(x_1.AuxInt)
27842                 if !(s >= 32) {
27843                         break
27844                 }
27845                 v.copyOf(x)
27846                 return true
27847         }
27848         return false
27849 }
27850 func rewriteValuegeneric_OpSignExt8to16(v *Value) bool {
27851         v_0 := v.Args[0]
27852         // match: (SignExt8to16 (Const8 [c]))
27853         // result: (Const16 [int16(c)])
27854         for {
27855                 if v_0.Op != OpConst8 {
27856                         break
27857                 }
27858                 c := auxIntToInt8(v_0.AuxInt)
27859                 v.reset(OpConst16)
27860                 v.AuxInt = int16ToAuxInt(int16(c))
27861                 return true
27862         }
27863         // match: (SignExt8to16 (Trunc16to8 x:(Rsh16x64 _ (Const64 [s]))))
27864         // cond: s >= 8
27865         // result: x
27866         for {
27867                 if v_0.Op != OpTrunc16to8 {
27868                         break
27869                 }
27870                 x := v_0.Args[0]
27871                 if x.Op != OpRsh16x64 {
27872                         break
27873                 }
27874                 _ = x.Args[1]
27875                 x_1 := x.Args[1]
27876                 if x_1.Op != OpConst64 {
27877                         break
27878                 }
27879                 s := auxIntToInt64(x_1.AuxInt)
27880                 if !(s >= 8) {
27881                         break
27882                 }
27883                 v.copyOf(x)
27884                 return true
27885         }
27886         return false
27887 }
27888 func rewriteValuegeneric_OpSignExt8to32(v *Value) bool {
27889         v_0 := v.Args[0]
27890         // match: (SignExt8to32 (Const8 [c]))
27891         // result: (Const32 [int32(c)])
27892         for {
27893                 if v_0.Op != OpConst8 {
27894                         break
27895                 }
27896                 c := auxIntToInt8(v_0.AuxInt)
27897                 v.reset(OpConst32)
27898                 v.AuxInt = int32ToAuxInt(int32(c))
27899                 return true
27900         }
27901         // match: (SignExt8to32 (Trunc32to8 x:(Rsh32x64 _ (Const64 [s]))))
27902         // cond: s >= 24
27903         // result: x
27904         for {
27905                 if v_0.Op != OpTrunc32to8 {
27906                         break
27907                 }
27908                 x := v_0.Args[0]
27909                 if x.Op != OpRsh32x64 {
27910                         break
27911                 }
27912                 _ = x.Args[1]
27913                 x_1 := x.Args[1]
27914                 if x_1.Op != OpConst64 {
27915                         break
27916                 }
27917                 s := auxIntToInt64(x_1.AuxInt)
27918                 if !(s >= 24) {
27919                         break
27920                 }
27921                 v.copyOf(x)
27922                 return true
27923         }
27924         return false
27925 }
27926 func rewriteValuegeneric_OpSignExt8to64(v *Value) bool {
27927         v_0 := v.Args[0]
27928         // match: (SignExt8to64 (Const8 [c]))
27929         // result: (Const64 [int64(c)])
27930         for {
27931                 if v_0.Op != OpConst8 {
27932                         break
27933                 }
27934                 c := auxIntToInt8(v_0.AuxInt)
27935                 v.reset(OpConst64)
27936                 v.AuxInt = int64ToAuxInt(int64(c))
27937                 return true
27938         }
27939         // match: (SignExt8to64 (Trunc64to8 x:(Rsh64x64 _ (Const64 [s]))))
27940         // cond: s >= 56
27941         // result: x
27942         for {
27943                 if v_0.Op != OpTrunc64to8 {
27944                         break
27945                 }
27946                 x := v_0.Args[0]
27947                 if x.Op != OpRsh64x64 {
27948                         break
27949                 }
27950                 _ = x.Args[1]
27951                 x_1 := x.Args[1]
27952                 if x_1.Op != OpConst64 {
27953                         break
27954                 }
27955                 s := auxIntToInt64(x_1.AuxInt)
27956                 if !(s >= 56) {
27957                         break
27958                 }
27959                 v.copyOf(x)
27960                 return true
27961         }
27962         return false
27963 }
27964 func rewriteValuegeneric_OpSliceCap(v *Value) bool {
27965         v_0 := v.Args[0]
27966         // match: (SliceCap (SliceMake _ _ (Const64 <t> [c])))
27967         // result: (Const64 <t> [c])
27968         for {
27969                 if v_0.Op != OpSliceMake {
27970                         break
27971                 }
27972                 _ = v_0.Args[2]
27973                 v_0_2 := v_0.Args[2]
27974                 if v_0_2.Op != OpConst64 {
27975                         break
27976                 }
27977                 t := v_0_2.Type
27978                 c := auxIntToInt64(v_0_2.AuxInt)
27979                 v.reset(OpConst64)
27980                 v.Type = t
27981                 v.AuxInt = int64ToAuxInt(c)
27982                 return true
27983         }
27984         // match: (SliceCap (SliceMake _ _ (Const32 <t> [c])))
27985         // result: (Const32 <t> [c])
27986         for {
27987                 if v_0.Op != OpSliceMake {
27988                         break
27989                 }
27990                 _ = v_0.Args[2]
27991                 v_0_2 := v_0.Args[2]
27992                 if v_0_2.Op != OpConst32 {
27993                         break
27994                 }
27995                 t := v_0_2.Type
27996                 c := auxIntToInt32(v_0_2.AuxInt)
27997                 v.reset(OpConst32)
27998                 v.Type = t
27999                 v.AuxInt = int32ToAuxInt(c)
28000                 return true
28001         }
28002         // match: (SliceCap (SliceMake _ _ (SliceCap x)))
28003         // result: (SliceCap x)
28004         for {
28005                 if v_0.Op != OpSliceMake {
28006                         break
28007                 }
28008                 _ = v_0.Args[2]
28009                 v_0_2 := v_0.Args[2]
28010                 if v_0_2.Op != OpSliceCap {
28011                         break
28012                 }
28013                 x := v_0_2.Args[0]
28014                 v.reset(OpSliceCap)
28015                 v.AddArg(x)
28016                 return true
28017         }
28018         // match: (SliceCap (SliceMake _ _ (SliceLen x)))
28019         // result: (SliceLen x)
28020         for {
28021                 if v_0.Op != OpSliceMake {
28022                         break
28023                 }
28024                 _ = v_0.Args[2]
28025                 v_0_2 := v_0.Args[2]
28026                 if v_0_2.Op != OpSliceLen {
28027                         break
28028                 }
28029                 x := v_0_2.Args[0]
28030                 v.reset(OpSliceLen)
28031                 v.AddArg(x)
28032                 return true
28033         }
28034         return false
28035 }
28036 func rewriteValuegeneric_OpSliceLen(v *Value) bool {
28037         v_0 := v.Args[0]
28038         // match: (SliceLen (SliceMake _ (Const64 <t> [c]) _))
28039         // result: (Const64 <t> [c])
28040         for {
28041                 if v_0.Op != OpSliceMake {
28042                         break
28043                 }
28044                 _ = v_0.Args[1]
28045                 v_0_1 := v_0.Args[1]
28046                 if v_0_1.Op != OpConst64 {
28047                         break
28048                 }
28049                 t := v_0_1.Type
28050                 c := auxIntToInt64(v_0_1.AuxInt)
28051                 v.reset(OpConst64)
28052                 v.Type = t
28053                 v.AuxInt = int64ToAuxInt(c)
28054                 return true
28055         }
28056         // match: (SliceLen (SliceMake _ (Const32 <t> [c]) _))
28057         // result: (Const32 <t> [c])
28058         for {
28059                 if v_0.Op != OpSliceMake {
28060                         break
28061                 }
28062                 _ = v_0.Args[1]
28063                 v_0_1 := v_0.Args[1]
28064                 if v_0_1.Op != OpConst32 {
28065                         break
28066                 }
28067                 t := v_0_1.Type
28068                 c := auxIntToInt32(v_0_1.AuxInt)
28069                 v.reset(OpConst32)
28070                 v.Type = t
28071                 v.AuxInt = int32ToAuxInt(c)
28072                 return true
28073         }
28074         // match: (SliceLen (SliceMake _ (SliceLen x) _))
28075         // result: (SliceLen x)
28076         for {
28077                 if v_0.Op != OpSliceMake {
28078                         break
28079                 }
28080                 _ = v_0.Args[1]
28081                 v_0_1 := v_0.Args[1]
28082                 if v_0_1.Op != OpSliceLen {
28083                         break
28084                 }
28085                 x := v_0_1.Args[0]
28086                 v.reset(OpSliceLen)
28087                 v.AddArg(x)
28088                 return true
28089         }
28090         // match: (SliceLen (SelectN [0] (StaticLECall {sym} _ newLen:(Const64) _ _ _ _)))
28091         // cond: isSameCall(sym, "runtime.growslice")
28092         // result: newLen
28093         for {
28094                 if v_0.Op != OpSelectN || auxIntToInt64(v_0.AuxInt) != 0 {
28095                         break
28096                 }
28097                 v_0_0 := v_0.Args[0]
28098                 if v_0_0.Op != OpStaticLECall || len(v_0_0.Args) != 6 {
28099                         break
28100                 }
28101                 sym := auxToCall(v_0_0.Aux)
28102                 _ = v_0_0.Args[1]
28103                 newLen := v_0_0.Args[1]
28104                 if newLen.Op != OpConst64 || !(isSameCall(sym, "runtime.growslice")) {
28105                         break
28106                 }
28107                 v.copyOf(newLen)
28108                 return true
28109         }
28110         // match: (SliceLen (SelectN [0] (StaticLECall {sym} _ newLen:(Const32) _ _ _ _)))
28111         // cond: isSameCall(sym, "runtime.growslice")
28112         // result: newLen
28113         for {
28114                 if v_0.Op != OpSelectN || auxIntToInt64(v_0.AuxInt) != 0 {
28115                         break
28116                 }
28117                 v_0_0 := v_0.Args[0]
28118                 if v_0_0.Op != OpStaticLECall || len(v_0_0.Args) != 6 {
28119                         break
28120                 }
28121                 sym := auxToCall(v_0_0.Aux)
28122                 _ = v_0_0.Args[1]
28123                 newLen := v_0_0.Args[1]
28124                 if newLen.Op != OpConst32 || !(isSameCall(sym, "runtime.growslice")) {
28125                         break
28126                 }
28127                 v.copyOf(newLen)
28128                 return true
28129         }
28130         return false
28131 }
28132 func rewriteValuegeneric_OpSlicePtr(v *Value) bool {
28133         v_0 := v.Args[0]
28134         // match: (SlicePtr (SliceMake (SlicePtr x) _ _))
28135         // result: (SlicePtr x)
28136         for {
28137                 if v_0.Op != OpSliceMake {
28138                         break
28139                 }
28140                 v_0_0 := v_0.Args[0]
28141                 if v_0_0.Op != OpSlicePtr {
28142                         break
28143                 }
28144                 x := v_0_0.Args[0]
28145                 v.reset(OpSlicePtr)
28146                 v.AddArg(x)
28147                 return true
28148         }
28149         return false
28150 }
28151 func rewriteValuegeneric_OpSlicemask(v *Value) bool {
28152         v_0 := v.Args[0]
28153         // match: (Slicemask (Const32 [x]))
28154         // cond: x > 0
28155         // result: (Const32 [-1])
28156         for {
28157                 if v_0.Op != OpConst32 {
28158                         break
28159                 }
28160                 x := auxIntToInt32(v_0.AuxInt)
28161                 if !(x > 0) {
28162                         break
28163                 }
28164                 v.reset(OpConst32)
28165                 v.AuxInt = int32ToAuxInt(-1)
28166                 return true
28167         }
28168         // match: (Slicemask (Const32 [0]))
28169         // result: (Const32 [0])
28170         for {
28171                 if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
28172                         break
28173                 }
28174                 v.reset(OpConst32)
28175                 v.AuxInt = int32ToAuxInt(0)
28176                 return true
28177         }
28178         // match: (Slicemask (Const64 [x]))
28179         // cond: x > 0
28180         // result: (Const64 [-1])
28181         for {
28182                 if v_0.Op != OpConst64 {
28183                         break
28184                 }
28185                 x := auxIntToInt64(v_0.AuxInt)
28186                 if !(x > 0) {
28187                         break
28188                 }
28189                 v.reset(OpConst64)
28190                 v.AuxInt = int64ToAuxInt(-1)
28191                 return true
28192         }
28193         // match: (Slicemask (Const64 [0]))
28194         // result: (Const64 [0])
28195         for {
28196                 if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
28197                         break
28198                 }
28199                 v.reset(OpConst64)
28200                 v.AuxInt = int64ToAuxInt(0)
28201                 return true
28202         }
28203         return false
28204 }
28205 func rewriteValuegeneric_OpSqrt(v *Value) bool {
28206         v_0 := v.Args[0]
28207         // match: (Sqrt (Const64F [c]))
28208         // cond: !math.IsNaN(math.Sqrt(c))
28209         // result: (Const64F [math.Sqrt(c)])
28210         for {
28211                 if v_0.Op != OpConst64F {
28212                         break
28213                 }
28214                 c := auxIntToFloat64(v_0.AuxInt)
28215                 if !(!math.IsNaN(math.Sqrt(c))) {
28216                         break
28217                 }
28218                 v.reset(OpConst64F)
28219                 v.AuxInt = float64ToAuxInt(math.Sqrt(c))
28220                 return true
28221         }
28222         return false
28223 }
28224 func rewriteValuegeneric_OpStaticCall(v *Value) bool {
28225         b := v.Block
28226         typ := &b.Func.Config.Types
28227         // match: (StaticCall {callAux} p q _ mem)
28228         // cond: isSameCall(callAux, "runtime.memequal") && isSamePtr(p, q)
28229         // result: (MakeResult (ConstBool <typ.Bool> [true]) mem)
28230         for {
28231                 if len(v.Args) != 4 {
28232                         break
28233                 }
28234                 callAux := auxToCall(v.Aux)
28235                 mem := v.Args[3]
28236                 p := v.Args[0]
28237                 q := v.Args[1]
28238                 if !(isSameCall(callAux, "runtime.memequal") && isSamePtr(p, q)) {
28239                         break
28240                 }
28241                 v.reset(OpMakeResult)
28242                 v0 := b.NewValue0(v.Pos, OpConstBool, typ.Bool)
28243                 v0.AuxInt = boolToAuxInt(true)
28244                 v.AddArg2(v0, mem)
28245                 return true
28246         }
28247         return false
28248 }
28249 func rewriteValuegeneric_OpStaticLECall(v *Value) bool {
28250         b := v.Block
28251         config := b.Func.Config
28252         typ := &b.Func.Config.Types
28253         // match: (StaticLECall {callAux} sptr (Addr {scon} (SB)) (Const64 [1]) mem)
28254         // cond: isSameCall(callAux, "runtime.memequal") && symIsRO(scon)
28255         // result: (MakeResult (Eq8 (Load <typ.Int8> sptr mem) (Const8 <typ.Int8> [int8(read8(scon,0))])) mem)
28256         for {
28257                 if len(v.Args) != 4 {
28258                         break
28259                 }
28260                 callAux := auxToCall(v.Aux)
28261                 mem := v.Args[3]
28262                 sptr := v.Args[0]
28263                 v_1 := v.Args[1]
28264                 if v_1.Op != OpAddr {
28265                         break
28266                 }
28267                 scon := auxToSym(v_1.Aux)
28268                 v_1_0 := v_1.Args[0]
28269                 if v_1_0.Op != OpSB {
28270                         break
28271                 }
28272                 v_2 := v.Args[2]
28273                 if v_2.Op != OpConst64 || auxIntToInt64(v_2.AuxInt) != 1 || !(isSameCall(callAux, "runtime.memequal") && symIsRO(scon)) {
28274                         break
28275                 }
28276                 v.reset(OpMakeResult)
28277                 v0 := b.NewValue0(v.Pos, OpEq8, typ.Bool)
28278                 v1 := b.NewValue0(v.Pos, OpLoad, typ.Int8)
28279                 v1.AddArg2(sptr, mem)
28280                 v2 := b.NewValue0(v.Pos, OpConst8, typ.Int8)
28281                 v2.AuxInt = int8ToAuxInt(int8(read8(scon, 0)))
28282                 v0.AddArg2(v1, v2)
28283                 v.AddArg2(v0, mem)
28284                 return true
28285         }
28286         // match: (StaticLECall {callAux} (Addr {scon} (SB)) sptr (Const64 [1]) mem)
28287         // cond: isSameCall(callAux, "runtime.memequal") && symIsRO(scon)
28288         // result: (MakeResult (Eq8 (Load <typ.Int8> sptr mem) (Const8 <typ.Int8> [int8(read8(scon,0))])) mem)
28289         for {
28290                 if len(v.Args) != 4 {
28291                         break
28292                 }
28293                 callAux := auxToCall(v.Aux)
28294                 mem := v.Args[3]
28295                 v_0 := v.Args[0]
28296                 if v_0.Op != OpAddr {
28297                         break
28298                 }
28299                 scon := auxToSym(v_0.Aux)
28300                 v_0_0 := v_0.Args[0]
28301                 if v_0_0.Op != OpSB {
28302                         break
28303                 }
28304                 sptr := v.Args[1]
28305                 v_2 := v.Args[2]
28306                 if v_2.Op != OpConst64 || auxIntToInt64(v_2.AuxInt) != 1 || !(isSameCall(callAux, "runtime.memequal") && symIsRO(scon)) {
28307                         break
28308                 }
28309                 v.reset(OpMakeResult)
28310                 v0 := b.NewValue0(v.Pos, OpEq8, typ.Bool)
28311                 v1 := b.NewValue0(v.Pos, OpLoad, typ.Int8)
28312                 v1.AddArg2(sptr, mem)
28313                 v2 := b.NewValue0(v.Pos, OpConst8, typ.Int8)
28314                 v2.AuxInt = int8ToAuxInt(int8(read8(scon, 0)))
28315                 v0.AddArg2(v1, v2)
28316                 v.AddArg2(v0, mem)
28317                 return true
28318         }
28319         // match: (StaticLECall {callAux} sptr (Addr {scon} (SB)) (Const64 [2]) mem)
28320         // cond: isSameCall(callAux, "runtime.memequal") && symIsRO(scon) && canLoadUnaligned(config)
28321         // result: (MakeResult (Eq16 (Load <typ.Int16> sptr mem) (Const16 <typ.Int16> [int16(read16(scon,0,config.ctxt.Arch.ByteOrder))])) mem)
28322         for {
28323                 if len(v.Args) != 4 {
28324                         break
28325                 }
28326                 callAux := auxToCall(v.Aux)
28327                 mem := v.Args[3]
28328                 sptr := v.Args[0]
28329                 v_1 := v.Args[1]
28330                 if v_1.Op != OpAddr {
28331                         break
28332                 }
28333                 scon := auxToSym(v_1.Aux)
28334                 v_1_0 := v_1.Args[0]
28335                 if v_1_0.Op != OpSB {
28336                         break
28337                 }
28338                 v_2 := v.Args[2]
28339                 if v_2.Op != OpConst64 || auxIntToInt64(v_2.AuxInt) != 2 || !(isSameCall(callAux, "runtime.memequal") && symIsRO(scon) && canLoadUnaligned(config)) {
28340                         break
28341                 }
28342                 v.reset(OpMakeResult)
28343                 v0 := b.NewValue0(v.Pos, OpEq16, typ.Bool)
28344                 v1 := b.NewValue0(v.Pos, OpLoad, typ.Int16)
28345                 v1.AddArg2(sptr, mem)
28346                 v2 := b.NewValue0(v.Pos, OpConst16, typ.Int16)
28347                 v2.AuxInt = int16ToAuxInt(int16(read16(scon, 0, config.ctxt.Arch.ByteOrder)))
28348                 v0.AddArg2(v1, v2)
28349                 v.AddArg2(v0, mem)
28350                 return true
28351         }
28352         // match: (StaticLECall {callAux} (Addr {scon} (SB)) sptr (Const64 [2]) mem)
28353         // cond: isSameCall(callAux, "runtime.memequal") && symIsRO(scon) && canLoadUnaligned(config)
28354         // result: (MakeResult (Eq16 (Load <typ.Int16> sptr mem) (Const16 <typ.Int16> [int16(read16(scon,0,config.ctxt.Arch.ByteOrder))])) mem)
28355         for {
28356                 if len(v.Args) != 4 {
28357                         break
28358                 }
28359                 callAux := auxToCall(v.Aux)
28360                 mem := v.Args[3]
28361                 v_0 := v.Args[0]
28362                 if v_0.Op != OpAddr {
28363                         break
28364                 }
28365                 scon := auxToSym(v_0.Aux)
28366                 v_0_0 := v_0.Args[0]
28367                 if v_0_0.Op != OpSB {
28368                         break
28369                 }
28370                 sptr := v.Args[1]
28371                 v_2 := v.Args[2]
28372                 if v_2.Op != OpConst64 || auxIntToInt64(v_2.AuxInt) != 2 || !(isSameCall(callAux, "runtime.memequal") && symIsRO(scon) && canLoadUnaligned(config)) {
28373                         break
28374                 }
28375                 v.reset(OpMakeResult)
28376                 v0 := b.NewValue0(v.Pos, OpEq16, typ.Bool)
28377                 v1 := b.NewValue0(v.Pos, OpLoad, typ.Int16)
28378                 v1.AddArg2(sptr, mem)
28379                 v2 := b.NewValue0(v.Pos, OpConst16, typ.Int16)
28380                 v2.AuxInt = int16ToAuxInt(int16(read16(scon, 0, config.ctxt.Arch.ByteOrder)))
28381                 v0.AddArg2(v1, v2)
28382                 v.AddArg2(v0, mem)
28383                 return true
28384         }
28385         // match: (StaticLECall {callAux} sptr (Addr {scon} (SB)) (Const64 [4]) mem)
28386         // cond: isSameCall(callAux, "runtime.memequal") && symIsRO(scon) && canLoadUnaligned(config)
28387         // result: (MakeResult (Eq32 (Load <typ.Int32> sptr mem) (Const32 <typ.Int32> [int32(read32(scon,0,config.ctxt.Arch.ByteOrder))])) mem)
28388         for {
28389                 if len(v.Args) != 4 {
28390                         break
28391                 }
28392                 callAux := auxToCall(v.Aux)
28393                 mem := v.Args[3]
28394                 sptr := v.Args[0]
28395                 v_1 := v.Args[1]
28396                 if v_1.Op != OpAddr {
28397                         break
28398                 }
28399                 scon := auxToSym(v_1.Aux)
28400                 v_1_0 := v_1.Args[0]
28401                 if v_1_0.Op != OpSB {
28402                         break
28403                 }
28404                 v_2 := v.Args[2]
28405                 if v_2.Op != OpConst64 || auxIntToInt64(v_2.AuxInt) != 4 || !(isSameCall(callAux, "runtime.memequal") && symIsRO(scon) && canLoadUnaligned(config)) {
28406                         break
28407                 }
28408                 v.reset(OpMakeResult)
28409                 v0 := b.NewValue0(v.Pos, OpEq32, typ.Bool)
28410                 v1 := b.NewValue0(v.Pos, OpLoad, typ.Int32)
28411                 v1.AddArg2(sptr, mem)
28412                 v2 := b.NewValue0(v.Pos, OpConst32, typ.Int32)
28413                 v2.AuxInt = int32ToAuxInt(int32(read32(scon, 0, config.ctxt.Arch.ByteOrder)))
28414                 v0.AddArg2(v1, v2)
28415                 v.AddArg2(v0, mem)
28416                 return true
28417         }
28418         // match: (StaticLECall {callAux} (Addr {scon} (SB)) sptr (Const64 [4]) mem)
28419         // cond: isSameCall(callAux, "runtime.memequal") && symIsRO(scon) && canLoadUnaligned(config)
28420         // result: (MakeResult (Eq32 (Load <typ.Int32> sptr mem) (Const32 <typ.Int32> [int32(read32(scon,0,config.ctxt.Arch.ByteOrder))])) mem)
28421         for {
28422                 if len(v.Args) != 4 {
28423                         break
28424                 }
28425                 callAux := auxToCall(v.Aux)
28426                 mem := v.Args[3]
28427                 v_0 := v.Args[0]
28428                 if v_0.Op != OpAddr {
28429                         break
28430                 }
28431                 scon := auxToSym(v_0.Aux)
28432                 v_0_0 := v_0.Args[0]
28433                 if v_0_0.Op != OpSB {
28434                         break
28435                 }
28436                 sptr := v.Args[1]
28437                 v_2 := v.Args[2]
28438                 if v_2.Op != OpConst64 || auxIntToInt64(v_2.AuxInt) != 4 || !(isSameCall(callAux, "runtime.memequal") && symIsRO(scon) && canLoadUnaligned(config)) {
28439                         break
28440                 }
28441                 v.reset(OpMakeResult)
28442                 v0 := b.NewValue0(v.Pos, OpEq32, typ.Bool)
28443                 v1 := b.NewValue0(v.Pos, OpLoad, typ.Int32)
28444                 v1.AddArg2(sptr, mem)
28445                 v2 := b.NewValue0(v.Pos, OpConst32, typ.Int32)
28446                 v2.AuxInt = int32ToAuxInt(int32(read32(scon, 0, config.ctxt.Arch.ByteOrder)))
28447                 v0.AddArg2(v1, v2)
28448                 v.AddArg2(v0, mem)
28449                 return true
28450         }
28451         // match: (StaticLECall {callAux} sptr (Addr {scon} (SB)) (Const64 [8]) mem)
28452         // cond: isSameCall(callAux, "runtime.memequal") && symIsRO(scon) && canLoadUnaligned(config) && config.PtrSize == 8
28453         // result: (MakeResult (Eq64 (Load <typ.Int64> sptr mem) (Const64 <typ.Int64> [int64(read64(scon,0,config.ctxt.Arch.ByteOrder))])) mem)
28454         for {
28455                 if len(v.Args) != 4 {
28456                         break
28457                 }
28458                 callAux := auxToCall(v.Aux)
28459                 mem := v.Args[3]
28460                 sptr := v.Args[0]
28461                 v_1 := v.Args[1]
28462                 if v_1.Op != OpAddr {
28463                         break
28464                 }
28465                 scon := auxToSym(v_1.Aux)
28466                 v_1_0 := v_1.Args[0]
28467                 if v_1_0.Op != OpSB {
28468                         break
28469                 }
28470                 v_2 := v.Args[2]
28471                 if v_2.Op != OpConst64 || auxIntToInt64(v_2.AuxInt) != 8 || !(isSameCall(callAux, "runtime.memequal") && symIsRO(scon) && canLoadUnaligned(config) && config.PtrSize == 8) {
28472                         break
28473                 }
28474                 v.reset(OpMakeResult)
28475                 v0 := b.NewValue0(v.Pos, OpEq64, typ.Bool)
28476                 v1 := b.NewValue0(v.Pos, OpLoad, typ.Int64)
28477                 v1.AddArg2(sptr, mem)
28478                 v2 := b.NewValue0(v.Pos, OpConst64, typ.Int64)
28479                 v2.AuxInt = int64ToAuxInt(int64(read64(scon, 0, config.ctxt.Arch.ByteOrder)))
28480                 v0.AddArg2(v1, v2)
28481                 v.AddArg2(v0, mem)
28482                 return true
28483         }
28484         // match: (StaticLECall {callAux} (Addr {scon} (SB)) sptr (Const64 [8]) mem)
28485         // cond: isSameCall(callAux, "runtime.memequal") && symIsRO(scon) && canLoadUnaligned(config) && config.PtrSize == 8
28486         // result: (MakeResult (Eq64 (Load <typ.Int64> sptr mem) (Const64 <typ.Int64> [int64(read64(scon,0,config.ctxt.Arch.ByteOrder))])) mem)
28487         for {
28488                 if len(v.Args) != 4 {
28489                         break
28490                 }
28491                 callAux := auxToCall(v.Aux)
28492                 mem := v.Args[3]
28493                 v_0 := v.Args[0]
28494                 if v_0.Op != OpAddr {
28495                         break
28496                 }
28497                 scon := auxToSym(v_0.Aux)
28498                 v_0_0 := v_0.Args[0]
28499                 if v_0_0.Op != OpSB {
28500                         break
28501                 }
28502                 sptr := v.Args[1]
28503                 v_2 := v.Args[2]
28504                 if v_2.Op != OpConst64 || auxIntToInt64(v_2.AuxInt) != 8 || !(isSameCall(callAux, "runtime.memequal") && symIsRO(scon) && canLoadUnaligned(config) && config.PtrSize == 8) {
28505                         break
28506                 }
28507                 v.reset(OpMakeResult)
28508                 v0 := b.NewValue0(v.Pos, OpEq64, typ.Bool)
28509                 v1 := b.NewValue0(v.Pos, OpLoad, typ.Int64)
28510                 v1.AddArg2(sptr, mem)
28511                 v2 := b.NewValue0(v.Pos, OpConst64, typ.Int64)
28512                 v2.AuxInt = int64ToAuxInt(int64(read64(scon, 0, config.ctxt.Arch.ByteOrder)))
28513                 v0.AddArg2(v1, v2)
28514                 v.AddArg2(v0, mem)
28515                 return true
28516         }
28517         // match: (StaticLECall {callAux} _ _ (Const64 [0]) mem)
28518         // cond: isSameCall(callAux, "runtime.memequal")
28519         // result: (MakeResult (ConstBool <typ.Bool> [true]) mem)
28520         for {
28521                 if len(v.Args) != 4 {
28522                         break
28523                 }
28524                 callAux := auxToCall(v.Aux)
28525                 mem := v.Args[3]
28526                 v_2 := v.Args[2]
28527                 if v_2.Op != OpConst64 || auxIntToInt64(v_2.AuxInt) != 0 || !(isSameCall(callAux, "runtime.memequal")) {
28528                         break
28529                 }
28530                 v.reset(OpMakeResult)
28531                 v0 := b.NewValue0(v.Pos, OpConstBool, typ.Bool)
28532                 v0.AuxInt = boolToAuxInt(true)
28533                 v.AddArg2(v0, mem)
28534                 return true
28535         }
28536         // match: (StaticLECall {callAux} p q _ mem)
28537         // cond: isSameCall(callAux, "runtime.memequal") && isSamePtr(p, q)
28538         // result: (MakeResult (ConstBool <typ.Bool> [true]) mem)
28539         for {
28540                 if len(v.Args) != 4 {
28541                         break
28542                 }
28543                 callAux := auxToCall(v.Aux)
28544                 mem := v.Args[3]
28545                 p := v.Args[0]
28546                 q := v.Args[1]
28547                 if !(isSameCall(callAux, "runtime.memequal") && isSamePtr(p, q)) {
28548                         break
28549                 }
28550                 v.reset(OpMakeResult)
28551                 v0 := b.NewValue0(v.Pos, OpConstBool, typ.Bool)
28552                 v0.AuxInt = boolToAuxInt(true)
28553                 v.AddArg2(v0, mem)
28554                 return true
28555         }
28556         // match: (StaticLECall {callAux} _ (Const64 [0]) (Const64 [0]) mem)
28557         // cond: isSameCall(callAux, "runtime.makeslice")
28558         // result: (MakeResult (Addr <v.Type.FieldType(0)> {ir.Syms.Zerobase} (SB)) mem)
28559         for {
28560                 if len(v.Args) != 4 {
28561                         break
28562                 }
28563                 callAux := auxToCall(v.Aux)
28564                 mem := v.Args[3]
28565                 v_1 := v.Args[1]
28566                 if v_1.Op != OpConst64 || auxIntToInt64(v_1.AuxInt) != 0 {
28567                         break
28568                 }
28569                 v_2 := v.Args[2]
28570                 if v_2.Op != OpConst64 || auxIntToInt64(v_2.AuxInt) != 0 || !(isSameCall(callAux, "runtime.makeslice")) {
28571                         break
28572                 }
28573                 v.reset(OpMakeResult)
28574                 v0 := b.NewValue0(v.Pos, OpAddr, v.Type.FieldType(0))
28575                 v0.Aux = symToAux(ir.Syms.Zerobase)
28576                 v1 := b.NewValue0(v.Pos, OpSB, typ.Uintptr)
28577                 v0.AddArg(v1)
28578                 v.AddArg2(v0, mem)
28579                 return true
28580         }
28581         // match: (StaticLECall {callAux} _ (Const32 [0]) (Const32 [0]) mem)
28582         // cond: isSameCall(callAux, "runtime.makeslice")
28583         // result: (MakeResult (Addr <v.Type.FieldType(0)> {ir.Syms.Zerobase} (SB)) mem)
28584         for {
28585                 if len(v.Args) != 4 {
28586                         break
28587                 }
28588                 callAux := auxToCall(v.Aux)
28589                 mem := v.Args[3]
28590                 v_1 := v.Args[1]
28591                 if v_1.Op != OpConst32 || auxIntToInt32(v_1.AuxInt) != 0 {
28592                         break
28593                 }
28594                 v_2 := v.Args[2]
28595                 if v_2.Op != OpConst32 || auxIntToInt32(v_2.AuxInt) != 0 || !(isSameCall(callAux, "runtime.makeslice")) {
28596                         break
28597                 }
28598                 v.reset(OpMakeResult)
28599                 v0 := b.NewValue0(v.Pos, OpAddr, v.Type.FieldType(0))
28600                 v0.Aux = symToAux(ir.Syms.Zerobase)
28601                 v1 := b.NewValue0(v.Pos, OpSB, typ.Uintptr)
28602                 v0.AddArg(v1)
28603                 v.AddArg2(v0, mem)
28604                 return true
28605         }
28606         return false
28607 }
28608 func rewriteValuegeneric_OpStore(v *Value) bool {
28609         v_2 := v.Args[2]
28610         v_1 := v.Args[1]
28611         v_0 := v.Args[0]
28612         b := v.Block
28613         fe := b.Func.fe
28614         // match: (Store {t1} p1 (Load <t2> p2 mem) mem)
28615         // cond: isSamePtr(p1, p2) && t2.Size() == t1.Size()
28616         // result: mem
28617         for {
28618                 t1 := auxToType(v.Aux)
28619                 p1 := v_0
28620                 if v_1.Op != OpLoad {
28621                         break
28622                 }
28623                 t2 := v_1.Type
28624                 mem := v_1.Args[1]
28625                 p2 := v_1.Args[0]
28626                 if mem != v_2 || !(isSamePtr(p1, p2) && t2.Size() == t1.Size()) {
28627                         break
28628                 }
28629                 v.copyOf(mem)
28630                 return true
28631         }
28632         // match: (Store {t1} p1 (Load <t2> p2 oldmem) mem:(Store {t3} p3 _ oldmem))
28633         // cond: isSamePtr(p1, p2) && t2.Size() == t1.Size() && disjoint(p1, t1.Size(), p3, t3.Size())
28634         // result: mem
28635         for {
28636                 t1 := auxToType(v.Aux)
28637                 p1 := v_0
28638                 if v_1.Op != OpLoad {
28639                         break
28640                 }
28641                 t2 := v_1.Type
28642                 oldmem := v_1.Args[1]
28643                 p2 := v_1.Args[0]
28644                 mem := v_2
28645                 if mem.Op != OpStore {
28646                         break
28647                 }
28648                 t3 := auxToType(mem.Aux)
28649                 _ = mem.Args[2]
28650                 p3 := mem.Args[0]
28651                 if oldmem != mem.Args[2] || !(isSamePtr(p1, p2) && t2.Size() == t1.Size() && disjoint(p1, t1.Size(), p3, t3.Size())) {
28652                         break
28653                 }
28654                 v.copyOf(mem)
28655                 return true
28656         }
28657         // match: (Store {t1} p1 (Load <t2> p2 oldmem) mem:(Store {t3} p3 _ (Store {t4} p4 _ oldmem)))
28658         // cond: isSamePtr(p1, p2) && t2.Size() == t1.Size() && disjoint(p1, t1.Size(), p3, t3.Size()) && disjoint(p1, t1.Size(), p4, t4.Size())
28659         // result: mem
28660         for {
28661                 t1 := auxToType(v.Aux)
28662                 p1 := v_0
28663                 if v_1.Op != OpLoad {
28664                         break
28665                 }
28666                 t2 := v_1.Type
28667                 oldmem := v_1.Args[1]
28668                 p2 := v_1.Args[0]
28669                 mem := v_2
28670                 if mem.Op != OpStore {
28671                         break
28672                 }
28673                 t3 := auxToType(mem.Aux)
28674                 _ = mem.Args[2]
28675                 p3 := mem.Args[0]
28676                 mem_2 := mem.Args[2]
28677                 if mem_2.Op != OpStore {
28678                         break
28679                 }
28680                 t4 := auxToType(mem_2.Aux)
28681                 _ = mem_2.Args[2]
28682                 p4 := mem_2.Args[0]
28683                 if oldmem != mem_2.Args[2] || !(isSamePtr(p1, p2) && t2.Size() == t1.Size() && disjoint(p1, t1.Size(), p3, t3.Size()) && disjoint(p1, t1.Size(), p4, t4.Size())) {
28684                         break
28685                 }
28686                 v.copyOf(mem)
28687                 return true
28688         }
28689         // match: (Store {t1} p1 (Load <t2> p2 oldmem) mem:(Store {t3} p3 _ (Store {t4} p4 _ (Store {t5} p5 _ oldmem))))
28690         // cond: isSamePtr(p1, p2) && t2.Size() == t1.Size() && disjoint(p1, t1.Size(), p3, t3.Size()) && disjoint(p1, t1.Size(), p4, t4.Size()) && disjoint(p1, t1.Size(), p5, t5.Size())
28691         // result: mem
28692         for {
28693                 t1 := auxToType(v.Aux)
28694                 p1 := v_0
28695                 if v_1.Op != OpLoad {
28696                         break
28697                 }
28698                 t2 := v_1.Type
28699                 oldmem := v_1.Args[1]
28700                 p2 := v_1.Args[0]
28701                 mem := v_2
28702                 if mem.Op != OpStore {
28703                         break
28704                 }
28705                 t3 := auxToType(mem.Aux)
28706                 _ = mem.Args[2]
28707                 p3 := mem.Args[0]
28708                 mem_2 := mem.Args[2]
28709                 if mem_2.Op != OpStore {
28710                         break
28711                 }
28712                 t4 := auxToType(mem_2.Aux)
28713                 _ = mem_2.Args[2]
28714                 p4 := mem_2.Args[0]
28715                 mem_2_2 := mem_2.Args[2]
28716                 if mem_2_2.Op != OpStore {
28717                         break
28718                 }
28719                 t5 := auxToType(mem_2_2.Aux)
28720                 _ = mem_2_2.Args[2]
28721                 p5 := mem_2_2.Args[0]
28722                 if oldmem != mem_2_2.Args[2] || !(isSamePtr(p1, p2) && t2.Size() == t1.Size() && disjoint(p1, t1.Size(), p3, t3.Size()) && disjoint(p1, t1.Size(), p4, t4.Size()) && disjoint(p1, t1.Size(), p5, t5.Size())) {
28723                         break
28724                 }
28725                 v.copyOf(mem)
28726                 return true
28727         }
28728         // match: (Store {t} (OffPtr [o] p1) x mem:(Zero [n] p2 _))
28729         // cond: isConstZero(x) && o >= 0 && t.Size() + o <= n && isSamePtr(p1, p2)
28730         // result: mem
28731         for {
28732                 t := auxToType(v.Aux)
28733                 if v_0.Op != OpOffPtr {
28734                         break
28735                 }
28736                 o := auxIntToInt64(v_0.AuxInt)
28737                 p1 := v_0.Args[0]
28738                 x := v_1
28739                 mem := v_2
28740                 if mem.Op != OpZero {
28741                         break
28742                 }
28743                 n := auxIntToInt64(mem.AuxInt)
28744                 p2 := mem.Args[0]
28745                 if !(isConstZero(x) && o >= 0 && t.Size()+o <= n && isSamePtr(p1, p2)) {
28746                         break
28747                 }
28748                 v.copyOf(mem)
28749                 return true
28750         }
28751         // match: (Store {t1} op:(OffPtr [o1] p1) x mem:(Store {t2} p2 _ (Zero [n] p3 _)))
28752         // cond: isConstZero(x) && o1 >= 0 && t1.Size() + o1 <= n && isSamePtr(p1, p3) && disjoint(op, t1.Size(), p2, t2.Size())
28753         // result: mem
28754         for {
28755                 t1 := auxToType(v.Aux)
28756                 op := v_0
28757                 if op.Op != OpOffPtr {
28758                         break
28759                 }
28760                 o1 := auxIntToInt64(op.AuxInt)
28761                 p1 := op.Args[0]
28762                 x := v_1
28763                 mem := v_2
28764                 if mem.Op != OpStore {
28765                         break
28766                 }
28767                 t2 := auxToType(mem.Aux)
28768                 _ = mem.Args[2]
28769                 p2 := mem.Args[0]
28770                 mem_2 := mem.Args[2]
28771                 if mem_2.Op != OpZero {
28772                         break
28773                 }
28774                 n := auxIntToInt64(mem_2.AuxInt)
28775                 p3 := mem_2.Args[0]
28776                 if !(isConstZero(x) && o1 >= 0 && t1.Size()+o1 <= n && isSamePtr(p1, p3) && disjoint(op, t1.Size(), p2, t2.Size())) {
28777                         break
28778                 }
28779                 v.copyOf(mem)
28780                 return true
28781         }
28782         // match: (Store {t1} op:(OffPtr [o1] p1) x mem:(Store {t2} p2 _ (Store {t3} p3 _ (Zero [n] p4 _))))
28783         // cond: isConstZero(x) && o1 >= 0 && t1.Size() + o1 <= n && isSamePtr(p1, p4) && disjoint(op, t1.Size(), p2, t2.Size()) && disjoint(op, t1.Size(), p3, t3.Size())
28784         // result: mem
28785         for {
28786                 t1 := auxToType(v.Aux)
28787                 op := v_0
28788                 if op.Op != OpOffPtr {
28789                         break
28790                 }
28791                 o1 := auxIntToInt64(op.AuxInt)
28792                 p1 := op.Args[0]
28793                 x := v_1
28794                 mem := v_2
28795                 if mem.Op != OpStore {
28796                         break
28797                 }
28798                 t2 := auxToType(mem.Aux)
28799                 _ = mem.Args[2]
28800                 p2 := mem.Args[0]
28801                 mem_2 := mem.Args[2]
28802                 if mem_2.Op != OpStore {
28803                         break
28804                 }
28805                 t3 := auxToType(mem_2.Aux)
28806                 _ = mem_2.Args[2]
28807                 p3 := mem_2.Args[0]
28808                 mem_2_2 := mem_2.Args[2]
28809                 if mem_2_2.Op != OpZero {
28810                         break
28811                 }
28812                 n := auxIntToInt64(mem_2_2.AuxInt)
28813                 p4 := mem_2_2.Args[0]
28814                 if !(isConstZero(x) && o1 >= 0 && t1.Size()+o1 <= n && isSamePtr(p1, p4) && disjoint(op, t1.Size(), p2, t2.Size()) && disjoint(op, t1.Size(), p3, t3.Size())) {
28815                         break
28816                 }
28817                 v.copyOf(mem)
28818                 return true
28819         }
28820         // match: (Store {t1} op:(OffPtr [o1] p1) x mem:(Store {t2} p2 _ (Store {t3} p3 _ (Store {t4} p4 _ (Zero [n] p5 _)))))
28821         // cond: isConstZero(x) && o1 >= 0 && t1.Size() + o1 <= n && isSamePtr(p1, p5) && disjoint(op, t1.Size(), p2, t2.Size()) && disjoint(op, t1.Size(), p3, t3.Size()) && disjoint(op, t1.Size(), p4, t4.Size())
28822         // result: mem
28823         for {
28824                 t1 := auxToType(v.Aux)
28825                 op := v_0
28826                 if op.Op != OpOffPtr {
28827                         break
28828                 }
28829                 o1 := auxIntToInt64(op.AuxInt)
28830                 p1 := op.Args[0]
28831                 x := v_1
28832                 mem := v_2
28833                 if mem.Op != OpStore {
28834                         break
28835                 }
28836                 t2 := auxToType(mem.Aux)
28837                 _ = mem.Args[2]
28838                 p2 := mem.Args[0]
28839                 mem_2 := mem.Args[2]
28840                 if mem_2.Op != OpStore {
28841                         break
28842                 }
28843                 t3 := auxToType(mem_2.Aux)
28844                 _ = mem_2.Args[2]
28845                 p3 := mem_2.Args[0]
28846                 mem_2_2 := mem_2.Args[2]
28847                 if mem_2_2.Op != OpStore {
28848                         break
28849                 }
28850                 t4 := auxToType(mem_2_2.Aux)
28851                 _ = mem_2_2.Args[2]
28852                 p4 := mem_2_2.Args[0]
28853                 mem_2_2_2 := mem_2_2.Args[2]
28854                 if mem_2_2_2.Op != OpZero {
28855                         break
28856                 }
28857                 n := auxIntToInt64(mem_2_2_2.AuxInt)
28858                 p5 := mem_2_2_2.Args[0]
28859                 if !(isConstZero(x) && o1 >= 0 && t1.Size()+o1 <= n && isSamePtr(p1, p5) && disjoint(op, t1.Size(), p2, t2.Size()) && disjoint(op, t1.Size(), p3, t3.Size()) && disjoint(op, t1.Size(), p4, t4.Size())) {
28860                         break
28861                 }
28862                 v.copyOf(mem)
28863                 return true
28864         }
28865         // match: (Store _ (StructMake0) mem)
28866         // result: mem
28867         for {
28868                 if v_1.Op != OpStructMake0 {
28869                         break
28870                 }
28871                 mem := v_2
28872                 v.copyOf(mem)
28873                 return true
28874         }
28875         // match: (Store dst (StructMake1 <t> f0) mem)
28876         // result: (Store {t.FieldType(0)} (OffPtr <t.FieldType(0).PtrTo()> [0] dst) f0 mem)
28877         for {
28878                 dst := v_0
28879                 if v_1.Op != OpStructMake1 {
28880                         break
28881                 }
28882                 t := v_1.Type
28883                 f0 := v_1.Args[0]
28884                 mem := v_2
28885                 v.reset(OpStore)
28886                 v.Aux = typeToAux(t.FieldType(0))
28887                 v0 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(0).PtrTo())
28888                 v0.AuxInt = int64ToAuxInt(0)
28889                 v0.AddArg(dst)
28890                 v.AddArg3(v0, f0, mem)
28891                 return true
28892         }
28893         // match: (Store dst (StructMake2 <t> f0 f1) mem)
28894         // result: (Store {t.FieldType(1)} (OffPtr <t.FieldType(1).PtrTo()> [t.FieldOff(1)] dst) f1 (Store {t.FieldType(0)} (OffPtr <t.FieldType(0).PtrTo()> [0] dst) f0 mem))
28895         for {
28896                 dst := v_0
28897                 if v_1.Op != OpStructMake2 {
28898                         break
28899                 }
28900                 t := v_1.Type
28901                 f1 := v_1.Args[1]
28902                 f0 := v_1.Args[0]
28903                 mem := v_2
28904                 v.reset(OpStore)
28905                 v.Aux = typeToAux(t.FieldType(1))
28906                 v0 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(1).PtrTo())
28907                 v0.AuxInt = int64ToAuxInt(t.FieldOff(1))
28908                 v0.AddArg(dst)
28909                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
28910                 v1.Aux = typeToAux(t.FieldType(0))
28911                 v2 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(0).PtrTo())
28912                 v2.AuxInt = int64ToAuxInt(0)
28913                 v2.AddArg(dst)
28914                 v1.AddArg3(v2, f0, mem)
28915                 v.AddArg3(v0, f1, v1)
28916                 return true
28917         }
28918         // match: (Store dst (StructMake3 <t> f0 f1 f2) mem)
28919         // result: (Store {t.FieldType(2)} (OffPtr <t.FieldType(2).PtrTo()> [t.FieldOff(2)] dst) f2 (Store {t.FieldType(1)} (OffPtr <t.FieldType(1).PtrTo()> [t.FieldOff(1)] dst) f1 (Store {t.FieldType(0)} (OffPtr <t.FieldType(0).PtrTo()> [0] dst) f0 mem)))
28920         for {
28921                 dst := v_0
28922                 if v_1.Op != OpStructMake3 {
28923                         break
28924                 }
28925                 t := v_1.Type
28926                 f2 := v_1.Args[2]
28927                 f0 := v_1.Args[0]
28928                 f1 := v_1.Args[1]
28929                 mem := v_2
28930                 v.reset(OpStore)
28931                 v.Aux = typeToAux(t.FieldType(2))
28932                 v0 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(2).PtrTo())
28933                 v0.AuxInt = int64ToAuxInt(t.FieldOff(2))
28934                 v0.AddArg(dst)
28935                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
28936                 v1.Aux = typeToAux(t.FieldType(1))
28937                 v2 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(1).PtrTo())
28938                 v2.AuxInt = int64ToAuxInt(t.FieldOff(1))
28939                 v2.AddArg(dst)
28940                 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
28941                 v3.Aux = typeToAux(t.FieldType(0))
28942                 v4 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(0).PtrTo())
28943                 v4.AuxInt = int64ToAuxInt(0)
28944                 v4.AddArg(dst)
28945                 v3.AddArg3(v4, f0, mem)
28946                 v1.AddArg3(v2, f1, v3)
28947                 v.AddArg3(v0, f2, v1)
28948                 return true
28949         }
28950         // match: (Store dst (StructMake4 <t> f0 f1 f2 f3) mem)
28951         // result: (Store {t.FieldType(3)} (OffPtr <t.FieldType(3).PtrTo()> [t.FieldOff(3)] dst) f3 (Store {t.FieldType(2)} (OffPtr <t.FieldType(2).PtrTo()> [t.FieldOff(2)] dst) f2 (Store {t.FieldType(1)} (OffPtr <t.FieldType(1).PtrTo()> [t.FieldOff(1)] dst) f1 (Store {t.FieldType(0)} (OffPtr <t.FieldType(0).PtrTo()> [0] dst) f0 mem))))
28952         for {
28953                 dst := v_0
28954                 if v_1.Op != OpStructMake4 {
28955                         break
28956                 }
28957                 t := v_1.Type
28958                 f3 := v_1.Args[3]
28959                 f0 := v_1.Args[0]
28960                 f1 := v_1.Args[1]
28961                 f2 := v_1.Args[2]
28962                 mem := v_2
28963                 v.reset(OpStore)
28964                 v.Aux = typeToAux(t.FieldType(3))
28965                 v0 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(3).PtrTo())
28966                 v0.AuxInt = int64ToAuxInt(t.FieldOff(3))
28967                 v0.AddArg(dst)
28968                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
28969                 v1.Aux = typeToAux(t.FieldType(2))
28970                 v2 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(2).PtrTo())
28971                 v2.AuxInt = int64ToAuxInt(t.FieldOff(2))
28972                 v2.AddArg(dst)
28973                 v3 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
28974                 v3.Aux = typeToAux(t.FieldType(1))
28975                 v4 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(1).PtrTo())
28976                 v4.AuxInt = int64ToAuxInt(t.FieldOff(1))
28977                 v4.AddArg(dst)
28978                 v5 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
28979                 v5.Aux = typeToAux(t.FieldType(0))
28980                 v6 := b.NewValue0(v.Pos, OpOffPtr, t.FieldType(0).PtrTo())
28981                 v6.AuxInt = int64ToAuxInt(0)
28982                 v6.AddArg(dst)
28983                 v5.AddArg3(v6, f0, mem)
28984                 v3.AddArg3(v4, f1, v5)
28985                 v1.AddArg3(v2, f2, v3)
28986                 v.AddArg3(v0, f3, v1)
28987                 return true
28988         }
28989         // match: (Store {t} dst (Load src mem) mem)
28990         // cond: !fe.CanSSA(t)
28991         // result: (Move {t} [t.Size()] dst src mem)
28992         for {
28993                 t := auxToType(v.Aux)
28994                 dst := v_0
28995                 if v_1.Op != OpLoad {
28996                         break
28997                 }
28998                 mem := v_1.Args[1]
28999                 src := v_1.Args[0]
29000                 if mem != v_2 || !(!fe.CanSSA(t)) {
29001                         break
29002                 }
29003                 v.reset(OpMove)
29004                 v.AuxInt = int64ToAuxInt(t.Size())
29005                 v.Aux = typeToAux(t)
29006                 v.AddArg3(dst, src, mem)
29007                 return true
29008         }
29009         // match: (Store {t} dst (Load src mem) (VarDef {x} mem))
29010         // cond: !fe.CanSSA(t)
29011         // result: (Move {t} [t.Size()] dst src (VarDef {x} mem))
29012         for {
29013                 t := auxToType(v.Aux)
29014                 dst := v_0
29015                 if v_1.Op != OpLoad {
29016                         break
29017                 }
29018                 mem := v_1.Args[1]
29019                 src := v_1.Args[0]
29020                 if v_2.Op != OpVarDef {
29021                         break
29022                 }
29023                 x := auxToSym(v_2.Aux)
29024                 if mem != v_2.Args[0] || !(!fe.CanSSA(t)) {
29025                         break
29026                 }
29027                 v.reset(OpMove)
29028                 v.AuxInt = int64ToAuxInt(t.Size())
29029                 v.Aux = typeToAux(t)
29030                 v0 := b.NewValue0(v.Pos, OpVarDef, types.TypeMem)
29031                 v0.Aux = symToAux(x)
29032                 v0.AddArg(mem)
29033                 v.AddArg3(dst, src, v0)
29034                 return true
29035         }
29036         // match: (Store _ (ArrayMake0) mem)
29037         // result: mem
29038         for {
29039                 if v_1.Op != OpArrayMake0 {
29040                         break
29041                 }
29042                 mem := v_2
29043                 v.copyOf(mem)
29044                 return true
29045         }
29046         // match: (Store dst (ArrayMake1 e) mem)
29047         // result: (Store {e.Type} dst e mem)
29048         for {
29049                 dst := v_0
29050                 if v_1.Op != OpArrayMake1 {
29051                         break
29052                 }
29053                 e := v_1.Args[0]
29054                 mem := v_2
29055                 v.reset(OpStore)
29056                 v.Aux = typeToAux(e.Type)
29057                 v.AddArg3(dst, e, mem)
29058                 return true
29059         }
29060         // match: (Store (SelectN [0] call:(StaticLECall _ _)) x mem:(SelectN [1] call))
29061         // cond: isConstZero(x) && isSameCall(call.Aux, "runtime.newobject")
29062         // result: mem
29063         for {
29064                 if v_0.Op != OpSelectN || auxIntToInt64(v_0.AuxInt) != 0 {
29065                         break
29066                 }
29067                 call := v_0.Args[0]
29068                 if call.Op != OpStaticLECall || len(call.Args) != 2 {
29069                         break
29070                 }
29071                 x := v_1
29072                 mem := v_2
29073                 if mem.Op != OpSelectN || auxIntToInt64(mem.AuxInt) != 1 || call != mem.Args[0] || !(isConstZero(x) && isSameCall(call.Aux, "runtime.newobject")) {
29074                         break
29075                 }
29076                 v.copyOf(mem)
29077                 return true
29078         }
29079         // match: (Store (OffPtr (SelectN [0] call:(StaticLECall _ _))) x mem:(SelectN [1] call))
29080         // cond: isConstZero(x) && isSameCall(call.Aux, "runtime.newobject")
29081         // result: mem
29082         for {
29083                 if v_0.Op != OpOffPtr {
29084                         break
29085                 }
29086                 v_0_0 := v_0.Args[0]
29087                 if v_0_0.Op != OpSelectN || auxIntToInt64(v_0_0.AuxInt) != 0 {
29088                         break
29089                 }
29090                 call := v_0_0.Args[0]
29091                 if call.Op != OpStaticLECall || len(call.Args) != 2 {
29092                         break
29093                 }
29094                 x := v_1
29095                 mem := v_2
29096                 if mem.Op != OpSelectN || auxIntToInt64(mem.AuxInt) != 1 || call != mem.Args[0] || !(isConstZero(x) && isSameCall(call.Aux, "runtime.newobject")) {
29097                         break
29098                 }
29099                 v.copyOf(mem)
29100                 return true
29101         }
29102         // match: (Store {t1} op1:(OffPtr [o1] p1) d1 m2:(Store {t2} op2:(OffPtr [0] p2) d2 m3:(Move [n] p3 _ mem)))
29103         // cond: m2.Uses == 1 && m3.Uses == 1 && o1 == t2.Size() && n == t2.Size() + t1.Size() && isSamePtr(p1, p2) && isSamePtr(p2, p3) && clobber(m2, m3)
29104         // result: (Store {t1} op1 d1 (Store {t2} op2 d2 mem))
29105         for {
29106                 t1 := auxToType(v.Aux)
29107                 op1 := v_0
29108                 if op1.Op != OpOffPtr {
29109                         break
29110                 }
29111                 o1 := auxIntToInt64(op1.AuxInt)
29112                 p1 := op1.Args[0]
29113                 d1 := v_1
29114                 m2 := v_2
29115                 if m2.Op != OpStore {
29116                         break
29117                 }
29118                 t2 := auxToType(m2.Aux)
29119                 _ = m2.Args[2]
29120                 op2 := m2.Args[0]
29121                 if op2.Op != OpOffPtr || auxIntToInt64(op2.AuxInt) != 0 {
29122                         break
29123                 }
29124                 p2 := op2.Args[0]
29125                 d2 := m2.Args[1]
29126                 m3 := m2.Args[2]
29127                 if m3.Op != OpMove {
29128                         break
29129                 }
29130                 n := auxIntToInt64(m3.AuxInt)
29131                 mem := m3.Args[2]
29132                 p3 := m3.Args[0]
29133                 if !(m2.Uses == 1 && m3.Uses == 1 && o1 == t2.Size() && n == t2.Size()+t1.Size() && isSamePtr(p1, p2) && isSamePtr(p2, p3) && clobber(m2, m3)) {
29134                         break
29135                 }
29136                 v.reset(OpStore)
29137                 v.Aux = typeToAux(t1)
29138                 v0 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
29139                 v0.Aux = typeToAux(t2)
29140                 v0.AddArg3(op2, d2, mem)
29141                 v.AddArg3(op1, d1, v0)
29142                 return true
29143         }
29144         // match: (Store {t1} op1:(OffPtr [o1] p1) d1 m2:(Store {t2} op2:(OffPtr [o2] p2) d2 m3:(Store {t3} op3:(OffPtr [0] p3) d3 m4:(Move [n] p4 _ mem))))
29145         // cond: m2.Uses == 1 && m3.Uses == 1 && m4.Uses == 1 && o2 == t3.Size() && o1-o2 == t2.Size() && n == t3.Size() + t2.Size() + t1.Size() && isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && clobber(m2, m3, m4)
29146         // result: (Store {t1} op1 d1 (Store {t2} op2 d2 (Store {t3} op3 d3 mem)))
29147         for {
29148                 t1 := auxToType(v.Aux)
29149                 op1 := v_0
29150                 if op1.Op != OpOffPtr {
29151                         break
29152                 }
29153                 o1 := auxIntToInt64(op1.AuxInt)
29154                 p1 := op1.Args[0]
29155                 d1 := v_1
29156                 m2 := v_2
29157                 if m2.Op != OpStore {
29158                         break
29159                 }
29160                 t2 := auxToType(m2.Aux)
29161                 _ = m2.Args[2]
29162                 op2 := m2.Args[0]
29163                 if op2.Op != OpOffPtr {
29164                         break
29165                 }
29166                 o2 := auxIntToInt64(op2.AuxInt)
29167                 p2 := op2.Args[0]
29168                 d2 := m2.Args[1]
29169                 m3 := m2.Args[2]
29170                 if m3.Op != OpStore {
29171                         break
29172                 }
29173                 t3 := auxToType(m3.Aux)
29174                 _ = m3.Args[2]
29175                 op3 := m3.Args[0]
29176                 if op3.Op != OpOffPtr || auxIntToInt64(op3.AuxInt) != 0 {
29177                         break
29178                 }
29179                 p3 := op3.Args[0]
29180                 d3 := m3.Args[1]
29181                 m4 := m3.Args[2]
29182                 if m4.Op != OpMove {
29183                         break
29184                 }
29185                 n := auxIntToInt64(m4.AuxInt)
29186                 mem := m4.Args[2]
29187                 p4 := m4.Args[0]
29188                 if !(m2.Uses == 1 && m3.Uses == 1 && m4.Uses == 1 && o2 == t3.Size() && o1-o2 == t2.Size() && n == t3.Size()+t2.Size()+t1.Size() && isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && clobber(m2, m3, m4)) {
29189                         break
29190                 }
29191                 v.reset(OpStore)
29192                 v.Aux = typeToAux(t1)
29193                 v0 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
29194                 v0.Aux = typeToAux(t2)
29195                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
29196                 v1.Aux = typeToAux(t3)
29197                 v1.AddArg3(op3, d3, mem)
29198                 v0.AddArg3(op2, d2, v1)
29199                 v.AddArg3(op1, d1, v0)
29200                 return true
29201         }
29202         // match: (Store {t1} op1:(OffPtr [o1] p1) d1 m2:(Store {t2} op2:(OffPtr [o2] p2) d2 m3:(Store {t3} op3:(OffPtr [o3] p3) d3 m4:(Store {t4} op4:(OffPtr [0] p4) d4 m5:(Move [n] p5 _ mem)))))
29203         // cond: m2.Uses == 1 && m3.Uses == 1 && m4.Uses == 1 && m5.Uses == 1 && o3 == t4.Size() && o2-o3 == t3.Size() && o1-o2 == t2.Size() && n == t4.Size() + t3.Size() + t2.Size() + t1.Size() && isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && clobber(m2, m3, m4, m5)
29204         // result: (Store {t1} op1 d1 (Store {t2} op2 d2 (Store {t3} op3 d3 (Store {t4} op4 d4 mem))))
29205         for {
29206                 t1 := auxToType(v.Aux)
29207                 op1 := v_0
29208                 if op1.Op != OpOffPtr {
29209                         break
29210                 }
29211                 o1 := auxIntToInt64(op1.AuxInt)
29212                 p1 := op1.Args[0]
29213                 d1 := v_1
29214                 m2 := v_2
29215                 if m2.Op != OpStore {
29216                         break
29217                 }
29218                 t2 := auxToType(m2.Aux)
29219                 _ = m2.Args[2]
29220                 op2 := m2.Args[0]
29221                 if op2.Op != OpOffPtr {
29222                         break
29223                 }
29224                 o2 := auxIntToInt64(op2.AuxInt)
29225                 p2 := op2.Args[0]
29226                 d2 := m2.Args[1]
29227                 m3 := m2.Args[2]
29228                 if m3.Op != OpStore {
29229                         break
29230                 }
29231                 t3 := auxToType(m3.Aux)
29232                 _ = m3.Args[2]
29233                 op3 := m3.Args[0]
29234                 if op3.Op != OpOffPtr {
29235                         break
29236                 }
29237                 o3 := auxIntToInt64(op3.AuxInt)
29238                 p3 := op3.Args[0]
29239                 d3 := m3.Args[1]
29240                 m4 := m3.Args[2]
29241                 if m4.Op != OpStore {
29242                         break
29243                 }
29244                 t4 := auxToType(m4.Aux)
29245                 _ = m4.Args[2]
29246                 op4 := m4.Args[0]
29247                 if op4.Op != OpOffPtr || auxIntToInt64(op4.AuxInt) != 0 {
29248                         break
29249                 }
29250                 p4 := op4.Args[0]
29251                 d4 := m4.Args[1]
29252                 m5 := m4.Args[2]
29253                 if m5.Op != OpMove {
29254                         break
29255                 }
29256                 n := auxIntToInt64(m5.AuxInt)
29257                 mem := m5.Args[2]
29258                 p5 := m5.Args[0]
29259                 if !(m2.Uses == 1 && m3.Uses == 1 && m4.Uses == 1 && m5.Uses == 1 && o3 == t4.Size() && o2-o3 == t3.Size() && o1-o2 == t2.Size() && n == t4.Size()+t3.Size()+t2.Size()+t1.Size() && isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && clobber(m2, m3, m4, m5)) {
29260                         break
29261                 }
29262                 v.reset(OpStore)
29263                 v.Aux = typeToAux(t1)
29264                 v0 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
29265                 v0.Aux = typeToAux(t2)
29266                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
29267                 v1.Aux = typeToAux(t3)
29268                 v2 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
29269                 v2.Aux = typeToAux(t4)
29270                 v2.AddArg3(op4, d4, mem)
29271                 v1.AddArg3(op3, d3, v2)
29272                 v0.AddArg3(op2, d2, v1)
29273                 v.AddArg3(op1, d1, v0)
29274                 return true
29275         }
29276         // match: (Store {t1} op1:(OffPtr [o1] p1) d1 m2:(Store {t2} op2:(OffPtr [0] p2) d2 m3:(Zero [n] p3 mem)))
29277         // cond: m2.Uses == 1 && m3.Uses == 1 && o1 == t2.Size() && n == t2.Size() + t1.Size() && isSamePtr(p1, p2) && isSamePtr(p2, p3) && clobber(m2, m3)
29278         // result: (Store {t1} op1 d1 (Store {t2} op2 d2 mem))
29279         for {
29280                 t1 := auxToType(v.Aux)
29281                 op1 := v_0
29282                 if op1.Op != OpOffPtr {
29283                         break
29284                 }
29285                 o1 := auxIntToInt64(op1.AuxInt)
29286                 p1 := op1.Args[0]
29287                 d1 := v_1
29288                 m2 := v_2
29289                 if m2.Op != OpStore {
29290                         break
29291                 }
29292                 t2 := auxToType(m2.Aux)
29293                 _ = m2.Args[2]
29294                 op2 := m2.Args[0]
29295                 if op2.Op != OpOffPtr || auxIntToInt64(op2.AuxInt) != 0 {
29296                         break
29297                 }
29298                 p2 := op2.Args[0]
29299                 d2 := m2.Args[1]
29300                 m3 := m2.Args[2]
29301                 if m3.Op != OpZero {
29302                         break
29303                 }
29304                 n := auxIntToInt64(m3.AuxInt)
29305                 mem := m3.Args[1]
29306                 p3 := m3.Args[0]
29307                 if !(m2.Uses == 1 && m3.Uses == 1 && o1 == t2.Size() && n == t2.Size()+t1.Size() && isSamePtr(p1, p2) && isSamePtr(p2, p3) && clobber(m2, m3)) {
29308                         break
29309                 }
29310                 v.reset(OpStore)
29311                 v.Aux = typeToAux(t1)
29312                 v0 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
29313                 v0.Aux = typeToAux(t2)
29314                 v0.AddArg3(op2, d2, mem)
29315                 v.AddArg3(op1, d1, v0)
29316                 return true
29317         }
29318         // match: (Store {t1} op1:(OffPtr [o1] p1) d1 m2:(Store {t2} op2:(OffPtr [o2] p2) d2 m3:(Store {t3} op3:(OffPtr [0] p3) d3 m4:(Zero [n] p4 mem))))
29319         // cond: m2.Uses == 1 && m3.Uses == 1 && m4.Uses == 1 && o2 == t3.Size() && o1-o2 == t2.Size() && n == t3.Size() + t2.Size() + t1.Size() && isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && clobber(m2, m3, m4)
29320         // result: (Store {t1} op1 d1 (Store {t2} op2 d2 (Store {t3} op3 d3 mem)))
29321         for {
29322                 t1 := auxToType(v.Aux)
29323                 op1 := v_0
29324                 if op1.Op != OpOffPtr {
29325                         break
29326                 }
29327                 o1 := auxIntToInt64(op1.AuxInt)
29328                 p1 := op1.Args[0]
29329                 d1 := v_1
29330                 m2 := v_2
29331                 if m2.Op != OpStore {
29332                         break
29333                 }
29334                 t2 := auxToType(m2.Aux)
29335                 _ = m2.Args[2]
29336                 op2 := m2.Args[0]
29337                 if op2.Op != OpOffPtr {
29338                         break
29339                 }
29340                 o2 := auxIntToInt64(op2.AuxInt)
29341                 p2 := op2.Args[0]
29342                 d2 := m2.Args[1]
29343                 m3 := m2.Args[2]
29344                 if m3.Op != OpStore {
29345                         break
29346                 }
29347                 t3 := auxToType(m3.Aux)
29348                 _ = m3.Args[2]
29349                 op3 := m3.Args[0]
29350                 if op3.Op != OpOffPtr || auxIntToInt64(op3.AuxInt) != 0 {
29351                         break
29352                 }
29353                 p3 := op3.Args[0]
29354                 d3 := m3.Args[1]
29355                 m4 := m3.Args[2]
29356                 if m4.Op != OpZero {
29357                         break
29358                 }
29359                 n := auxIntToInt64(m4.AuxInt)
29360                 mem := m4.Args[1]
29361                 p4 := m4.Args[0]
29362                 if !(m2.Uses == 1 && m3.Uses == 1 && m4.Uses == 1 && o2 == t3.Size() && o1-o2 == t2.Size() && n == t3.Size()+t2.Size()+t1.Size() && isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && clobber(m2, m3, m4)) {
29363                         break
29364                 }
29365                 v.reset(OpStore)
29366                 v.Aux = typeToAux(t1)
29367                 v0 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
29368                 v0.Aux = typeToAux(t2)
29369                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
29370                 v1.Aux = typeToAux(t3)
29371                 v1.AddArg3(op3, d3, mem)
29372                 v0.AddArg3(op2, d2, v1)
29373                 v.AddArg3(op1, d1, v0)
29374                 return true
29375         }
29376         // match: (Store {t1} op1:(OffPtr [o1] p1) d1 m2:(Store {t2} op2:(OffPtr [o2] p2) d2 m3:(Store {t3} op3:(OffPtr [o3] p3) d3 m4:(Store {t4} op4:(OffPtr [0] p4) d4 m5:(Zero [n] p5 mem)))))
29377         // cond: m2.Uses == 1 && m3.Uses == 1 && m4.Uses == 1 && m5.Uses == 1 && o3 == t4.Size() && o2-o3 == t3.Size() && o1-o2 == t2.Size() && n == t4.Size() + t3.Size() + t2.Size() + t1.Size() && isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && clobber(m2, m3, m4, m5)
29378         // result: (Store {t1} op1 d1 (Store {t2} op2 d2 (Store {t3} op3 d3 (Store {t4} op4 d4 mem))))
29379         for {
29380                 t1 := auxToType(v.Aux)
29381                 op1 := v_0
29382                 if op1.Op != OpOffPtr {
29383                         break
29384                 }
29385                 o1 := auxIntToInt64(op1.AuxInt)
29386                 p1 := op1.Args[0]
29387                 d1 := v_1
29388                 m2 := v_2
29389                 if m2.Op != OpStore {
29390                         break
29391                 }
29392                 t2 := auxToType(m2.Aux)
29393                 _ = m2.Args[2]
29394                 op2 := m2.Args[0]
29395                 if op2.Op != OpOffPtr {
29396                         break
29397                 }
29398                 o2 := auxIntToInt64(op2.AuxInt)
29399                 p2 := op2.Args[0]
29400                 d2 := m2.Args[1]
29401                 m3 := m2.Args[2]
29402                 if m3.Op != OpStore {
29403                         break
29404                 }
29405                 t3 := auxToType(m3.Aux)
29406                 _ = m3.Args[2]
29407                 op3 := m3.Args[0]
29408                 if op3.Op != OpOffPtr {
29409                         break
29410                 }
29411                 o3 := auxIntToInt64(op3.AuxInt)
29412                 p3 := op3.Args[0]
29413                 d3 := m3.Args[1]
29414                 m4 := m3.Args[2]
29415                 if m4.Op != OpStore {
29416                         break
29417                 }
29418                 t4 := auxToType(m4.Aux)
29419                 _ = m4.Args[2]
29420                 op4 := m4.Args[0]
29421                 if op4.Op != OpOffPtr || auxIntToInt64(op4.AuxInt) != 0 {
29422                         break
29423                 }
29424                 p4 := op4.Args[0]
29425                 d4 := m4.Args[1]
29426                 m5 := m4.Args[2]
29427                 if m5.Op != OpZero {
29428                         break
29429                 }
29430                 n := auxIntToInt64(m5.AuxInt)
29431                 mem := m5.Args[1]
29432                 p5 := m5.Args[0]
29433                 if !(m2.Uses == 1 && m3.Uses == 1 && m4.Uses == 1 && m5.Uses == 1 && o3 == t4.Size() && o2-o3 == t3.Size() && o1-o2 == t2.Size() && n == t4.Size()+t3.Size()+t2.Size()+t1.Size() && isSamePtr(p1, p2) && isSamePtr(p2, p3) && isSamePtr(p3, p4) && isSamePtr(p4, p5) && clobber(m2, m3, m4, m5)) {
29434                         break
29435                 }
29436                 v.reset(OpStore)
29437                 v.Aux = typeToAux(t1)
29438                 v0 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
29439                 v0.Aux = typeToAux(t2)
29440                 v1 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
29441                 v1.Aux = typeToAux(t3)
29442                 v2 := b.NewValue0(v.Pos, OpStore, types.TypeMem)
29443                 v2.Aux = typeToAux(t4)
29444                 v2.AddArg3(op4, d4, mem)
29445                 v1.AddArg3(op3, d3, v2)
29446                 v0.AddArg3(op2, d2, v1)
29447                 v.AddArg3(op1, d1, v0)
29448                 return true
29449         }
29450         return false
29451 }
29452 func rewriteValuegeneric_OpStringLen(v *Value) bool {
29453         v_0 := v.Args[0]
29454         // match: (StringLen (StringMake _ (Const64 <t> [c])))
29455         // result: (Const64 <t> [c])
29456         for {
29457                 if v_0.Op != OpStringMake {
29458                         break
29459                 }
29460                 _ = v_0.Args[1]
29461                 v_0_1 := v_0.Args[1]
29462                 if v_0_1.Op != OpConst64 {
29463                         break
29464                 }
29465                 t := v_0_1.Type
29466                 c := auxIntToInt64(v_0_1.AuxInt)
29467                 v.reset(OpConst64)
29468                 v.Type = t
29469                 v.AuxInt = int64ToAuxInt(c)
29470                 return true
29471         }
29472         return false
29473 }
29474 func rewriteValuegeneric_OpStringPtr(v *Value) bool {
29475         v_0 := v.Args[0]
29476         // match: (StringPtr (StringMake (Addr <t> {s} base) _))
29477         // result: (Addr <t> {s} base)
29478         for {
29479                 if v_0.Op != OpStringMake {
29480                         break
29481                 }
29482                 v_0_0 := v_0.Args[0]
29483                 if v_0_0.Op != OpAddr {
29484                         break
29485                 }
29486                 t := v_0_0.Type
29487                 s := auxToSym(v_0_0.Aux)
29488                 base := v_0_0.Args[0]
29489                 v.reset(OpAddr)
29490                 v.Type = t
29491                 v.Aux = symToAux(s)
29492                 v.AddArg(base)
29493                 return true
29494         }
29495         return false
29496 }
29497 func rewriteValuegeneric_OpStructSelect(v *Value) bool {
29498         v_0 := v.Args[0]
29499         b := v.Block
29500         fe := b.Func.fe
29501         // match: (StructSelect (StructMake1 x))
29502         // result: x
29503         for {
29504                 if v_0.Op != OpStructMake1 {
29505                         break
29506                 }
29507                 x := v_0.Args[0]
29508                 v.copyOf(x)
29509                 return true
29510         }
29511         // match: (StructSelect [0] (StructMake2 x _))
29512         // result: x
29513         for {
29514                 if auxIntToInt64(v.AuxInt) != 0 || v_0.Op != OpStructMake2 {
29515                         break
29516                 }
29517                 x := v_0.Args[0]
29518                 v.copyOf(x)
29519                 return true
29520         }
29521         // match: (StructSelect [1] (StructMake2 _ x))
29522         // result: x
29523         for {
29524                 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpStructMake2 {
29525                         break
29526                 }
29527                 x := v_0.Args[1]
29528                 v.copyOf(x)
29529                 return true
29530         }
29531         // match: (StructSelect [0] (StructMake3 x _ _))
29532         // result: x
29533         for {
29534                 if auxIntToInt64(v.AuxInt) != 0 || v_0.Op != OpStructMake3 {
29535                         break
29536                 }
29537                 x := v_0.Args[0]
29538                 v.copyOf(x)
29539                 return true
29540         }
29541         // match: (StructSelect [1] (StructMake3 _ x _))
29542         // result: x
29543         for {
29544                 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpStructMake3 {
29545                         break
29546                 }
29547                 x := v_0.Args[1]
29548                 v.copyOf(x)
29549                 return true
29550         }
29551         // match: (StructSelect [2] (StructMake3 _ _ x))
29552         // result: x
29553         for {
29554                 if auxIntToInt64(v.AuxInt) != 2 || v_0.Op != OpStructMake3 {
29555                         break
29556                 }
29557                 x := v_0.Args[2]
29558                 v.copyOf(x)
29559                 return true
29560         }
29561         // match: (StructSelect [0] (StructMake4 x _ _ _))
29562         // result: x
29563         for {
29564                 if auxIntToInt64(v.AuxInt) != 0 || v_0.Op != OpStructMake4 {
29565                         break
29566                 }
29567                 x := v_0.Args[0]
29568                 v.copyOf(x)
29569                 return true
29570         }
29571         // match: (StructSelect [1] (StructMake4 _ x _ _))
29572         // result: x
29573         for {
29574                 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpStructMake4 {
29575                         break
29576                 }
29577                 x := v_0.Args[1]
29578                 v.copyOf(x)
29579                 return true
29580         }
29581         // match: (StructSelect [2] (StructMake4 _ _ x _))
29582         // result: x
29583         for {
29584                 if auxIntToInt64(v.AuxInt) != 2 || v_0.Op != OpStructMake4 {
29585                         break
29586                 }
29587                 x := v_0.Args[2]
29588                 v.copyOf(x)
29589                 return true
29590         }
29591         // match: (StructSelect [3] (StructMake4 _ _ _ x))
29592         // result: x
29593         for {
29594                 if auxIntToInt64(v.AuxInt) != 3 || v_0.Op != OpStructMake4 {
29595                         break
29596                 }
29597                 x := v_0.Args[3]
29598                 v.copyOf(x)
29599                 return true
29600         }
29601         // match: (StructSelect [i] x:(Load <t> ptr mem))
29602         // cond: !fe.CanSSA(t)
29603         // result: @x.Block (Load <v.Type> (OffPtr <v.Type.PtrTo()> [t.FieldOff(int(i))] ptr) mem)
29604         for {
29605                 i := auxIntToInt64(v.AuxInt)
29606                 x := v_0
29607                 if x.Op != OpLoad {
29608                         break
29609                 }
29610                 t := x.Type
29611                 mem := x.Args[1]
29612                 ptr := x.Args[0]
29613                 if !(!fe.CanSSA(t)) {
29614                         break
29615                 }
29616                 b = x.Block
29617                 v0 := b.NewValue0(v.Pos, OpLoad, v.Type)
29618                 v.copyOf(v0)
29619                 v1 := b.NewValue0(v.Pos, OpOffPtr, v.Type.PtrTo())
29620                 v1.AuxInt = int64ToAuxInt(t.FieldOff(int(i)))
29621                 v1.AddArg(ptr)
29622                 v0.AddArg2(v1, mem)
29623                 return true
29624         }
29625         // match: (StructSelect [0] (IData x))
29626         // result: (IData x)
29627         for {
29628                 if auxIntToInt64(v.AuxInt) != 0 || v_0.Op != OpIData {
29629                         break
29630                 }
29631                 x := v_0.Args[0]
29632                 v.reset(OpIData)
29633                 v.AddArg(x)
29634                 return true
29635         }
29636         return false
29637 }
29638 func rewriteValuegeneric_OpSub16(v *Value) bool {
29639         v_1 := v.Args[1]
29640         v_0 := v.Args[0]
29641         b := v.Block
29642         // match: (Sub16 (Const16 [c]) (Const16 [d]))
29643         // result: (Const16 [c-d])
29644         for {
29645                 if v_0.Op != OpConst16 {
29646                         break
29647                 }
29648                 c := auxIntToInt16(v_0.AuxInt)
29649                 if v_1.Op != OpConst16 {
29650                         break
29651                 }
29652                 d := auxIntToInt16(v_1.AuxInt)
29653                 v.reset(OpConst16)
29654                 v.AuxInt = int16ToAuxInt(c - d)
29655                 return true
29656         }
29657         // match: (Sub16 x (Const16 <t> [c]))
29658         // cond: x.Op != OpConst16
29659         // result: (Add16 (Const16 <t> [-c]) x)
29660         for {
29661                 x := v_0
29662                 if v_1.Op != OpConst16 {
29663                         break
29664                 }
29665                 t := v_1.Type
29666                 c := auxIntToInt16(v_1.AuxInt)
29667                 if !(x.Op != OpConst16) {
29668                         break
29669                 }
29670                 v.reset(OpAdd16)
29671                 v0 := b.NewValue0(v.Pos, OpConst16, t)
29672                 v0.AuxInt = int16ToAuxInt(-c)
29673                 v.AddArg2(v0, x)
29674                 return true
29675         }
29676         // match: (Sub16 <t> (Mul16 x y) (Mul16 x z))
29677         // result: (Mul16 x (Sub16 <t> y z))
29678         for {
29679                 t := v.Type
29680                 if v_0.Op != OpMul16 {
29681                         break
29682                 }
29683                 _ = v_0.Args[1]
29684                 v_0_0 := v_0.Args[0]
29685                 v_0_1 := v_0.Args[1]
29686                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
29687                         x := v_0_0
29688                         y := v_0_1
29689                         if v_1.Op != OpMul16 {
29690                                 continue
29691                         }
29692                         _ = v_1.Args[1]
29693                         v_1_0 := v_1.Args[0]
29694                         v_1_1 := v_1.Args[1]
29695                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
29696                                 if x != v_1_0 {
29697                                         continue
29698                                 }
29699                                 z := v_1_1
29700                                 v.reset(OpMul16)
29701                                 v0 := b.NewValue0(v.Pos, OpSub16, t)
29702                                 v0.AddArg2(y, z)
29703                                 v.AddArg2(x, v0)
29704                                 return true
29705                         }
29706                 }
29707                 break
29708         }
29709         // match: (Sub16 x x)
29710         // result: (Const16 [0])
29711         for {
29712                 x := v_0
29713                 if x != v_1 {
29714                         break
29715                 }
29716                 v.reset(OpConst16)
29717                 v.AuxInt = int16ToAuxInt(0)
29718                 return true
29719         }
29720         // match: (Sub16 (Neg16 x) (Com16 x))
29721         // result: (Const16 [1])
29722         for {
29723                 if v_0.Op != OpNeg16 {
29724                         break
29725                 }
29726                 x := v_0.Args[0]
29727                 if v_1.Op != OpCom16 || x != v_1.Args[0] {
29728                         break
29729                 }
29730                 v.reset(OpConst16)
29731                 v.AuxInt = int16ToAuxInt(1)
29732                 return true
29733         }
29734         // match: (Sub16 (Com16 x) (Neg16 x))
29735         // result: (Const16 [-1])
29736         for {
29737                 if v_0.Op != OpCom16 {
29738                         break
29739                 }
29740                 x := v_0.Args[0]
29741                 if v_1.Op != OpNeg16 || x != v_1.Args[0] {
29742                         break
29743                 }
29744                 v.reset(OpConst16)
29745                 v.AuxInt = int16ToAuxInt(-1)
29746                 return true
29747         }
29748         // match: (Sub16 (Add16 t x) (Add16 t y))
29749         // result: (Sub16 x y)
29750         for {
29751                 if v_0.Op != OpAdd16 {
29752                         break
29753                 }
29754                 _ = v_0.Args[1]
29755                 v_0_0 := v_0.Args[0]
29756                 v_0_1 := v_0.Args[1]
29757                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
29758                         t := v_0_0
29759                         x := v_0_1
29760                         if v_1.Op != OpAdd16 {
29761                                 continue
29762                         }
29763                         _ = v_1.Args[1]
29764                         v_1_0 := v_1.Args[0]
29765                         v_1_1 := v_1.Args[1]
29766                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
29767                                 if t != v_1_0 {
29768                                         continue
29769                                 }
29770                                 y := v_1_1
29771                                 v.reset(OpSub16)
29772                                 v.AddArg2(x, y)
29773                                 return true
29774                         }
29775                 }
29776                 break
29777         }
29778         // match: (Sub16 (Add16 x y) x)
29779         // result: y
29780         for {
29781                 if v_0.Op != OpAdd16 {
29782                         break
29783                 }
29784                 _ = v_0.Args[1]
29785                 v_0_0 := v_0.Args[0]
29786                 v_0_1 := v_0.Args[1]
29787                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
29788                         x := v_0_0
29789                         y := v_0_1
29790                         if x != v_1 {
29791                                 continue
29792                         }
29793                         v.copyOf(y)
29794                         return true
29795                 }
29796                 break
29797         }
29798         // match: (Sub16 (Add16 x y) y)
29799         // result: x
29800         for {
29801                 if v_0.Op != OpAdd16 {
29802                         break
29803                 }
29804                 _ = v_0.Args[1]
29805                 v_0_0 := v_0.Args[0]
29806                 v_0_1 := v_0.Args[1]
29807                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
29808                         x := v_0_0
29809                         y := v_0_1
29810                         if y != v_1 {
29811                                 continue
29812                         }
29813                         v.copyOf(x)
29814                         return true
29815                 }
29816                 break
29817         }
29818         // match: (Sub16 (Sub16 x y) x)
29819         // result: (Neg16 y)
29820         for {
29821                 if v_0.Op != OpSub16 {
29822                         break
29823                 }
29824                 y := v_0.Args[1]
29825                 x := v_0.Args[0]
29826                 if x != v_1 {
29827                         break
29828                 }
29829                 v.reset(OpNeg16)
29830                 v.AddArg(y)
29831                 return true
29832         }
29833         // match: (Sub16 x (Add16 x y))
29834         // result: (Neg16 y)
29835         for {
29836                 x := v_0
29837                 if v_1.Op != OpAdd16 {
29838                         break
29839                 }
29840                 _ = v_1.Args[1]
29841                 v_1_0 := v_1.Args[0]
29842                 v_1_1 := v_1.Args[1]
29843                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
29844                         if x != v_1_0 {
29845                                 continue
29846                         }
29847                         y := v_1_1
29848                         v.reset(OpNeg16)
29849                         v.AddArg(y)
29850                         return true
29851                 }
29852                 break
29853         }
29854         // match: (Sub16 x (Sub16 i:(Const16 <t>) z))
29855         // cond: (z.Op != OpConst16 && x.Op != OpConst16)
29856         // result: (Sub16 (Add16 <t> x z) i)
29857         for {
29858                 x := v_0
29859                 if v_1.Op != OpSub16 {
29860                         break
29861                 }
29862                 z := v_1.Args[1]
29863                 i := v_1.Args[0]
29864                 if i.Op != OpConst16 {
29865                         break
29866                 }
29867                 t := i.Type
29868                 if !(z.Op != OpConst16 && x.Op != OpConst16) {
29869                         break
29870                 }
29871                 v.reset(OpSub16)
29872                 v0 := b.NewValue0(v.Pos, OpAdd16, t)
29873                 v0.AddArg2(x, z)
29874                 v.AddArg2(v0, i)
29875                 return true
29876         }
29877         // match: (Sub16 x (Add16 z i:(Const16 <t>)))
29878         // cond: (z.Op != OpConst16 && x.Op != OpConst16)
29879         // result: (Sub16 (Sub16 <t> x z) i)
29880         for {
29881                 x := v_0
29882                 if v_1.Op != OpAdd16 {
29883                         break
29884                 }
29885                 _ = v_1.Args[1]
29886                 v_1_0 := v_1.Args[0]
29887                 v_1_1 := v_1.Args[1]
29888                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
29889                         z := v_1_0
29890                         i := v_1_1
29891                         if i.Op != OpConst16 {
29892                                 continue
29893                         }
29894                         t := i.Type
29895                         if !(z.Op != OpConst16 && x.Op != OpConst16) {
29896                                 continue
29897                         }
29898                         v.reset(OpSub16)
29899                         v0 := b.NewValue0(v.Pos, OpSub16, t)
29900                         v0.AddArg2(x, z)
29901                         v.AddArg2(v0, i)
29902                         return true
29903                 }
29904                 break
29905         }
29906         // match: (Sub16 (Sub16 i:(Const16 <t>) z) x)
29907         // cond: (z.Op != OpConst16 && x.Op != OpConst16)
29908         // result: (Sub16 i (Add16 <t> z x))
29909         for {
29910                 if v_0.Op != OpSub16 {
29911                         break
29912                 }
29913                 z := v_0.Args[1]
29914                 i := v_0.Args[0]
29915                 if i.Op != OpConst16 {
29916                         break
29917                 }
29918                 t := i.Type
29919                 x := v_1
29920                 if !(z.Op != OpConst16 && x.Op != OpConst16) {
29921                         break
29922                 }
29923                 v.reset(OpSub16)
29924                 v0 := b.NewValue0(v.Pos, OpAdd16, t)
29925                 v0.AddArg2(z, x)
29926                 v.AddArg2(i, v0)
29927                 return true
29928         }
29929         // match: (Sub16 (Add16 z i:(Const16 <t>)) x)
29930         // cond: (z.Op != OpConst16 && x.Op != OpConst16)
29931         // result: (Add16 i (Sub16 <t> z x))
29932         for {
29933                 if v_0.Op != OpAdd16 {
29934                         break
29935                 }
29936                 _ = v_0.Args[1]
29937                 v_0_0 := v_0.Args[0]
29938                 v_0_1 := v_0.Args[1]
29939                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
29940                         z := v_0_0
29941                         i := v_0_1
29942                         if i.Op != OpConst16 {
29943                                 continue
29944                         }
29945                         t := i.Type
29946                         x := v_1
29947                         if !(z.Op != OpConst16 && x.Op != OpConst16) {
29948                                 continue
29949                         }
29950                         v.reset(OpAdd16)
29951                         v0 := b.NewValue0(v.Pos, OpSub16, t)
29952                         v0.AddArg2(z, x)
29953                         v.AddArg2(i, v0)
29954                         return true
29955                 }
29956                 break
29957         }
29958         // match: (Sub16 (Const16 <t> [c]) (Sub16 (Const16 <t> [d]) x))
29959         // result: (Add16 (Const16 <t> [c-d]) x)
29960         for {
29961                 if v_0.Op != OpConst16 {
29962                         break
29963                 }
29964                 t := v_0.Type
29965                 c := auxIntToInt16(v_0.AuxInt)
29966                 if v_1.Op != OpSub16 {
29967                         break
29968                 }
29969                 x := v_1.Args[1]
29970                 v_1_0 := v_1.Args[0]
29971                 if v_1_0.Op != OpConst16 || v_1_0.Type != t {
29972                         break
29973                 }
29974                 d := auxIntToInt16(v_1_0.AuxInt)
29975                 v.reset(OpAdd16)
29976                 v0 := b.NewValue0(v.Pos, OpConst16, t)
29977                 v0.AuxInt = int16ToAuxInt(c - d)
29978                 v.AddArg2(v0, x)
29979                 return true
29980         }
29981         // match: (Sub16 (Const16 <t> [c]) (Add16 (Const16 <t> [d]) x))
29982         // result: (Sub16 (Const16 <t> [c-d]) x)
29983         for {
29984                 if v_0.Op != OpConst16 {
29985                         break
29986                 }
29987                 t := v_0.Type
29988                 c := auxIntToInt16(v_0.AuxInt)
29989                 if v_1.Op != OpAdd16 {
29990                         break
29991                 }
29992                 _ = v_1.Args[1]
29993                 v_1_0 := v_1.Args[0]
29994                 v_1_1 := v_1.Args[1]
29995                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
29996                         if v_1_0.Op != OpConst16 || v_1_0.Type != t {
29997                                 continue
29998                         }
29999                         d := auxIntToInt16(v_1_0.AuxInt)
30000                         x := v_1_1
30001                         v.reset(OpSub16)
30002                         v0 := b.NewValue0(v.Pos, OpConst16, t)
30003                         v0.AuxInt = int16ToAuxInt(c - d)
30004                         v.AddArg2(v0, x)
30005                         return true
30006                 }
30007                 break
30008         }
30009         return false
30010 }
30011 func rewriteValuegeneric_OpSub32(v *Value) bool {
30012         v_1 := v.Args[1]
30013         v_0 := v.Args[0]
30014         b := v.Block
30015         // match: (Sub32 (Const32 [c]) (Const32 [d]))
30016         // result: (Const32 [c-d])
30017         for {
30018                 if v_0.Op != OpConst32 {
30019                         break
30020                 }
30021                 c := auxIntToInt32(v_0.AuxInt)
30022                 if v_1.Op != OpConst32 {
30023                         break
30024                 }
30025                 d := auxIntToInt32(v_1.AuxInt)
30026                 v.reset(OpConst32)
30027                 v.AuxInt = int32ToAuxInt(c - d)
30028                 return true
30029         }
30030         // match: (Sub32 x (Const32 <t> [c]))
30031         // cond: x.Op != OpConst32
30032         // result: (Add32 (Const32 <t> [-c]) x)
30033         for {
30034                 x := v_0
30035                 if v_1.Op != OpConst32 {
30036                         break
30037                 }
30038                 t := v_1.Type
30039                 c := auxIntToInt32(v_1.AuxInt)
30040                 if !(x.Op != OpConst32) {
30041                         break
30042                 }
30043                 v.reset(OpAdd32)
30044                 v0 := b.NewValue0(v.Pos, OpConst32, t)
30045                 v0.AuxInt = int32ToAuxInt(-c)
30046                 v.AddArg2(v0, x)
30047                 return true
30048         }
30049         // match: (Sub32 <t> (Mul32 x y) (Mul32 x z))
30050         // result: (Mul32 x (Sub32 <t> y z))
30051         for {
30052                 t := v.Type
30053                 if v_0.Op != OpMul32 {
30054                         break
30055                 }
30056                 _ = v_0.Args[1]
30057                 v_0_0 := v_0.Args[0]
30058                 v_0_1 := v_0.Args[1]
30059                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
30060                         x := v_0_0
30061                         y := v_0_1
30062                         if v_1.Op != OpMul32 {
30063                                 continue
30064                         }
30065                         _ = v_1.Args[1]
30066                         v_1_0 := v_1.Args[0]
30067                         v_1_1 := v_1.Args[1]
30068                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
30069                                 if x != v_1_0 {
30070                                         continue
30071                                 }
30072                                 z := v_1_1
30073                                 v.reset(OpMul32)
30074                                 v0 := b.NewValue0(v.Pos, OpSub32, t)
30075                                 v0.AddArg2(y, z)
30076                                 v.AddArg2(x, v0)
30077                                 return true
30078                         }
30079                 }
30080                 break
30081         }
30082         // match: (Sub32 x x)
30083         // result: (Const32 [0])
30084         for {
30085                 x := v_0
30086                 if x != v_1 {
30087                         break
30088                 }
30089                 v.reset(OpConst32)
30090                 v.AuxInt = int32ToAuxInt(0)
30091                 return true
30092         }
30093         // match: (Sub32 (Neg32 x) (Com32 x))
30094         // result: (Const32 [1])
30095         for {
30096                 if v_0.Op != OpNeg32 {
30097                         break
30098                 }
30099                 x := v_0.Args[0]
30100                 if v_1.Op != OpCom32 || x != v_1.Args[0] {
30101                         break
30102                 }
30103                 v.reset(OpConst32)
30104                 v.AuxInt = int32ToAuxInt(1)
30105                 return true
30106         }
30107         // match: (Sub32 (Com32 x) (Neg32 x))
30108         // result: (Const32 [-1])
30109         for {
30110                 if v_0.Op != OpCom32 {
30111                         break
30112                 }
30113                 x := v_0.Args[0]
30114                 if v_1.Op != OpNeg32 || x != v_1.Args[0] {
30115                         break
30116                 }
30117                 v.reset(OpConst32)
30118                 v.AuxInt = int32ToAuxInt(-1)
30119                 return true
30120         }
30121         // match: (Sub32 (Add32 t x) (Add32 t y))
30122         // result: (Sub32 x y)
30123         for {
30124                 if v_0.Op != OpAdd32 {
30125                         break
30126                 }
30127                 _ = v_0.Args[1]
30128                 v_0_0 := v_0.Args[0]
30129                 v_0_1 := v_0.Args[1]
30130                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
30131                         t := v_0_0
30132                         x := v_0_1
30133                         if v_1.Op != OpAdd32 {
30134                                 continue
30135                         }
30136                         _ = v_1.Args[1]
30137                         v_1_0 := v_1.Args[0]
30138                         v_1_1 := v_1.Args[1]
30139                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
30140                                 if t != v_1_0 {
30141                                         continue
30142                                 }
30143                                 y := v_1_1
30144                                 v.reset(OpSub32)
30145                                 v.AddArg2(x, y)
30146                                 return true
30147                         }
30148                 }
30149                 break
30150         }
30151         // match: (Sub32 (Add32 x y) x)
30152         // result: y
30153         for {
30154                 if v_0.Op != OpAdd32 {
30155                         break
30156                 }
30157                 _ = v_0.Args[1]
30158                 v_0_0 := v_0.Args[0]
30159                 v_0_1 := v_0.Args[1]
30160                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
30161                         x := v_0_0
30162                         y := v_0_1
30163                         if x != v_1 {
30164                                 continue
30165                         }
30166                         v.copyOf(y)
30167                         return true
30168                 }
30169                 break
30170         }
30171         // match: (Sub32 (Add32 x y) y)
30172         // result: x
30173         for {
30174                 if v_0.Op != OpAdd32 {
30175                         break
30176                 }
30177                 _ = v_0.Args[1]
30178                 v_0_0 := v_0.Args[0]
30179                 v_0_1 := v_0.Args[1]
30180                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
30181                         x := v_0_0
30182                         y := v_0_1
30183                         if y != v_1 {
30184                                 continue
30185                         }
30186                         v.copyOf(x)
30187                         return true
30188                 }
30189                 break
30190         }
30191         // match: (Sub32 (Sub32 x y) x)
30192         // result: (Neg32 y)
30193         for {
30194                 if v_0.Op != OpSub32 {
30195                         break
30196                 }
30197                 y := v_0.Args[1]
30198                 x := v_0.Args[0]
30199                 if x != v_1 {
30200                         break
30201                 }
30202                 v.reset(OpNeg32)
30203                 v.AddArg(y)
30204                 return true
30205         }
30206         // match: (Sub32 x (Add32 x y))
30207         // result: (Neg32 y)
30208         for {
30209                 x := v_0
30210                 if v_1.Op != OpAdd32 {
30211                         break
30212                 }
30213                 _ = v_1.Args[1]
30214                 v_1_0 := v_1.Args[0]
30215                 v_1_1 := v_1.Args[1]
30216                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
30217                         if x != v_1_0 {
30218                                 continue
30219                         }
30220                         y := v_1_1
30221                         v.reset(OpNeg32)
30222                         v.AddArg(y)
30223                         return true
30224                 }
30225                 break
30226         }
30227         // match: (Sub32 x (Sub32 i:(Const32 <t>) z))
30228         // cond: (z.Op != OpConst32 && x.Op != OpConst32)
30229         // result: (Sub32 (Add32 <t> x z) i)
30230         for {
30231                 x := v_0
30232                 if v_1.Op != OpSub32 {
30233                         break
30234                 }
30235                 z := v_1.Args[1]
30236                 i := v_1.Args[0]
30237                 if i.Op != OpConst32 {
30238                         break
30239                 }
30240                 t := i.Type
30241                 if !(z.Op != OpConst32 && x.Op != OpConst32) {
30242                         break
30243                 }
30244                 v.reset(OpSub32)
30245                 v0 := b.NewValue0(v.Pos, OpAdd32, t)
30246                 v0.AddArg2(x, z)
30247                 v.AddArg2(v0, i)
30248                 return true
30249         }
30250         // match: (Sub32 x (Add32 z i:(Const32 <t>)))
30251         // cond: (z.Op != OpConst32 && x.Op != OpConst32)
30252         // result: (Sub32 (Sub32 <t> x z) i)
30253         for {
30254                 x := v_0
30255                 if v_1.Op != OpAdd32 {
30256                         break
30257                 }
30258                 _ = v_1.Args[1]
30259                 v_1_0 := v_1.Args[0]
30260                 v_1_1 := v_1.Args[1]
30261                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
30262                         z := v_1_0
30263                         i := v_1_1
30264                         if i.Op != OpConst32 {
30265                                 continue
30266                         }
30267                         t := i.Type
30268                         if !(z.Op != OpConst32 && x.Op != OpConst32) {
30269                                 continue
30270                         }
30271                         v.reset(OpSub32)
30272                         v0 := b.NewValue0(v.Pos, OpSub32, t)
30273                         v0.AddArg2(x, z)
30274                         v.AddArg2(v0, i)
30275                         return true
30276                 }
30277                 break
30278         }
30279         // match: (Sub32 (Sub32 i:(Const32 <t>) z) x)
30280         // cond: (z.Op != OpConst32 && x.Op != OpConst32)
30281         // result: (Sub32 i (Add32 <t> z x))
30282         for {
30283                 if v_0.Op != OpSub32 {
30284                         break
30285                 }
30286                 z := v_0.Args[1]
30287                 i := v_0.Args[0]
30288                 if i.Op != OpConst32 {
30289                         break
30290                 }
30291                 t := i.Type
30292                 x := v_1
30293                 if !(z.Op != OpConst32 && x.Op != OpConst32) {
30294                         break
30295                 }
30296                 v.reset(OpSub32)
30297                 v0 := b.NewValue0(v.Pos, OpAdd32, t)
30298                 v0.AddArg2(z, x)
30299                 v.AddArg2(i, v0)
30300                 return true
30301         }
30302         // match: (Sub32 (Add32 z i:(Const32 <t>)) x)
30303         // cond: (z.Op != OpConst32 && x.Op != OpConst32)
30304         // result: (Add32 i (Sub32 <t> z x))
30305         for {
30306                 if v_0.Op != OpAdd32 {
30307                         break
30308                 }
30309                 _ = v_0.Args[1]
30310                 v_0_0 := v_0.Args[0]
30311                 v_0_1 := v_0.Args[1]
30312                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
30313                         z := v_0_0
30314                         i := v_0_1
30315                         if i.Op != OpConst32 {
30316                                 continue
30317                         }
30318                         t := i.Type
30319                         x := v_1
30320                         if !(z.Op != OpConst32 && x.Op != OpConst32) {
30321                                 continue
30322                         }
30323                         v.reset(OpAdd32)
30324                         v0 := b.NewValue0(v.Pos, OpSub32, t)
30325                         v0.AddArg2(z, x)
30326                         v.AddArg2(i, v0)
30327                         return true
30328                 }
30329                 break
30330         }
30331         // match: (Sub32 (Const32 <t> [c]) (Sub32 (Const32 <t> [d]) x))
30332         // result: (Add32 (Const32 <t> [c-d]) x)
30333         for {
30334                 if v_0.Op != OpConst32 {
30335                         break
30336                 }
30337                 t := v_0.Type
30338                 c := auxIntToInt32(v_0.AuxInt)
30339                 if v_1.Op != OpSub32 {
30340                         break
30341                 }
30342                 x := v_1.Args[1]
30343                 v_1_0 := v_1.Args[0]
30344                 if v_1_0.Op != OpConst32 || v_1_0.Type != t {
30345                         break
30346                 }
30347                 d := auxIntToInt32(v_1_0.AuxInt)
30348                 v.reset(OpAdd32)
30349                 v0 := b.NewValue0(v.Pos, OpConst32, t)
30350                 v0.AuxInt = int32ToAuxInt(c - d)
30351                 v.AddArg2(v0, x)
30352                 return true
30353         }
30354         // match: (Sub32 (Const32 <t> [c]) (Add32 (Const32 <t> [d]) x))
30355         // result: (Sub32 (Const32 <t> [c-d]) x)
30356         for {
30357                 if v_0.Op != OpConst32 {
30358                         break
30359                 }
30360                 t := v_0.Type
30361                 c := auxIntToInt32(v_0.AuxInt)
30362                 if v_1.Op != OpAdd32 {
30363                         break
30364                 }
30365                 _ = v_1.Args[1]
30366                 v_1_0 := v_1.Args[0]
30367                 v_1_1 := v_1.Args[1]
30368                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
30369                         if v_1_0.Op != OpConst32 || v_1_0.Type != t {
30370                                 continue
30371                         }
30372                         d := auxIntToInt32(v_1_0.AuxInt)
30373                         x := v_1_1
30374                         v.reset(OpSub32)
30375                         v0 := b.NewValue0(v.Pos, OpConst32, t)
30376                         v0.AuxInt = int32ToAuxInt(c - d)
30377                         v.AddArg2(v0, x)
30378                         return true
30379                 }
30380                 break
30381         }
30382         return false
30383 }
30384 func rewriteValuegeneric_OpSub32F(v *Value) bool {
30385         v_1 := v.Args[1]
30386         v_0 := v.Args[0]
30387         // match: (Sub32F (Const32F [c]) (Const32F [d]))
30388         // cond: c-d == c-d
30389         // result: (Const32F [c-d])
30390         for {
30391                 if v_0.Op != OpConst32F {
30392                         break
30393                 }
30394                 c := auxIntToFloat32(v_0.AuxInt)
30395                 if v_1.Op != OpConst32F {
30396                         break
30397                 }
30398                 d := auxIntToFloat32(v_1.AuxInt)
30399                 if !(c-d == c-d) {
30400                         break
30401                 }
30402                 v.reset(OpConst32F)
30403                 v.AuxInt = float32ToAuxInt(c - d)
30404                 return true
30405         }
30406         return false
30407 }
30408 func rewriteValuegeneric_OpSub64(v *Value) bool {
30409         v_1 := v.Args[1]
30410         v_0 := v.Args[0]
30411         b := v.Block
30412         // match: (Sub64 (Const64 [c]) (Const64 [d]))
30413         // result: (Const64 [c-d])
30414         for {
30415                 if v_0.Op != OpConst64 {
30416                         break
30417                 }
30418                 c := auxIntToInt64(v_0.AuxInt)
30419                 if v_1.Op != OpConst64 {
30420                         break
30421                 }
30422                 d := auxIntToInt64(v_1.AuxInt)
30423                 v.reset(OpConst64)
30424                 v.AuxInt = int64ToAuxInt(c - d)
30425                 return true
30426         }
30427         // match: (Sub64 x (Const64 <t> [c]))
30428         // cond: x.Op != OpConst64
30429         // result: (Add64 (Const64 <t> [-c]) x)
30430         for {
30431                 x := v_0
30432                 if v_1.Op != OpConst64 {
30433                         break
30434                 }
30435                 t := v_1.Type
30436                 c := auxIntToInt64(v_1.AuxInt)
30437                 if !(x.Op != OpConst64) {
30438                         break
30439                 }
30440                 v.reset(OpAdd64)
30441                 v0 := b.NewValue0(v.Pos, OpConst64, t)
30442                 v0.AuxInt = int64ToAuxInt(-c)
30443                 v.AddArg2(v0, x)
30444                 return true
30445         }
30446         // match: (Sub64 <t> (Mul64 x y) (Mul64 x z))
30447         // result: (Mul64 x (Sub64 <t> y z))
30448         for {
30449                 t := v.Type
30450                 if v_0.Op != OpMul64 {
30451                         break
30452                 }
30453                 _ = v_0.Args[1]
30454                 v_0_0 := v_0.Args[0]
30455                 v_0_1 := v_0.Args[1]
30456                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
30457                         x := v_0_0
30458                         y := v_0_1
30459                         if v_1.Op != OpMul64 {
30460                                 continue
30461                         }
30462                         _ = v_1.Args[1]
30463                         v_1_0 := v_1.Args[0]
30464                         v_1_1 := v_1.Args[1]
30465                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
30466                                 if x != v_1_0 {
30467                                         continue
30468                                 }
30469                                 z := v_1_1
30470                                 v.reset(OpMul64)
30471                                 v0 := b.NewValue0(v.Pos, OpSub64, t)
30472                                 v0.AddArg2(y, z)
30473                                 v.AddArg2(x, v0)
30474                                 return true
30475                         }
30476                 }
30477                 break
30478         }
30479         // match: (Sub64 x x)
30480         // result: (Const64 [0])
30481         for {
30482                 x := v_0
30483                 if x != v_1 {
30484                         break
30485                 }
30486                 v.reset(OpConst64)
30487                 v.AuxInt = int64ToAuxInt(0)
30488                 return true
30489         }
30490         // match: (Sub64 (Neg64 x) (Com64 x))
30491         // result: (Const64 [1])
30492         for {
30493                 if v_0.Op != OpNeg64 {
30494                         break
30495                 }
30496                 x := v_0.Args[0]
30497                 if v_1.Op != OpCom64 || x != v_1.Args[0] {
30498                         break
30499                 }
30500                 v.reset(OpConst64)
30501                 v.AuxInt = int64ToAuxInt(1)
30502                 return true
30503         }
30504         // match: (Sub64 (Com64 x) (Neg64 x))
30505         // result: (Const64 [-1])
30506         for {
30507                 if v_0.Op != OpCom64 {
30508                         break
30509                 }
30510                 x := v_0.Args[0]
30511                 if v_1.Op != OpNeg64 || x != v_1.Args[0] {
30512                         break
30513                 }
30514                 v.reset(OpConst64)
30515                 v.AuxInt = int64ToAuxInt(-1)
30516                 return true
30517         }
30518         // match: (Sub64 (Add64 t x) (Add64 t y))
30519         // result: (Sub64 x y)
30520         for {
30521                 if v_0.Op != OpAdd64 {
30522                         break
30523                 }
30524                 _ = v_0.Args[1]
30525                 v_0_0 := v_0.Args[0]
30526                 v_0_1 := v_0.Args[1]
30527                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
30528                         t := v_0_0
30529                         x := v_0_1
30530                         if v_1.Op != OpAdd64 {
30531                                 continue
30532                         }
30533                         _ = v_1.Args[1]
30534                         v_1_0 := v_1.Args[0]
30535                         v_1_1 := v_1.Args[1]
30536                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
30537                                 if t != v_1_0 {
30538                                         continue
30539                                 }
30540                                 y := v_1_1
30541                                 v.reset(OpSub64)
30542                                 v.AddArg2(x, y)
30543                                 return true
30544                         }
30545                 }
30546                 break
30547         }
30548         // match: (Sub64 (Add64 x y) x)
30549         // result: y
30550         for {
30551                 if v_0.Op != OpAdd64 {
30552                         break
30553                 }
30554                 _ = v_0.Args[1]
30555                 v_0_0 := v_0.Args[0]
30556                 v_0_1 := v_0.Args[1]
30557                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
30558                         x := v_0_0
30559                         y := v_0_1
30560                         if x != v_1 {
30561                                 continue
30562                         }
30563                         v.copyOf(y)
30564                         return true
30565                 }
30566                 break
30567         }
30568         // match: (Sub64 (Add64 x y) y)
30569         // result: x
30570         for {
30571                 if v_0.Op != OpAdd64 {
30572                         break
30573                 }
30574                 _ = v_0.Args[1]
30575                 v_0_0 := v_0.Args[0]
30576                 v_0_1 := v_0.Args[1]
30577                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
30578                         x := v_0_0
30579                         y := v_0_1
30580                         if y != v_1 {
30581                                 continue
30582                         }
30583                         v.copyOf(x)
30584                         return true
30585                 }
30586                 break
30587         }
30588         // match: (Sub64 (Sub64 x y) x)
30589         // result: (Neg64 y)
30590         for {
30591                 if v_0.Op != OpSub64 {
30592                         break
30593                 }
30594                 y := v_0.Args[1]
30595                 x := v_0.Args[0]
30596                 if x != v_1 {
30597                         break
30598                 }
30599                 v.reset(OpNeg64)
30600                 v.AddArg(y)
30601                 return true
30602         }
30603         // match: (Sub64 x (Add64 x y))
30604         // result: (Neg64 y)
30605         for {
30606                 x := v_0
30607                 if v_1.Op != OpAdd64 {
30608                         break
30609                 }
30610                 _ = v_1.Args[1]
30611                 v_1_0 := v_1.Args[0]
30612                 v_1_1 := v_1.Args[1]
30613                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
30614                         if x != v_1_0 {
30615                                 continue
30616                         }
30617                         y := v_1_1
30618                         v.reset(OpNeg64)
30619                         v.AddArg(y)
30620                         return true
30621                 }
30622                 break
30623         }
30624         // match: (Sub64 x (Sub64 i:(Const64 <t>) z))
30625         // cond: (z.Op != OpConst64 && x.Op != OpConst64)
30626         // result: (Sub64 (Add64 <t> x z) i)
30627         for {
30628                 x := v_0
30629                 if v_1.Op != OpSub64 {
30630                         break
30631                 }
30632                 z := v_1.Args[1]
30633                 i := v_1.Args[0]
30634                 if i.Op != OpConst64 {
30635                         break
30636                 }
30637                 t := i.Type
30638                 if !(z.Op != OpConst64 && x.Op != OpConst64) {
30639                         break
30640                 }
30641                 v.reset(OpSub64)
30642                 v0 := b.NewValue0(v.Pos, OpAdd64, t)
30643                 v0.AddArg2(x, z)
30644                 v.AddArg2(v0, i)
30645                 return true
30646         }
30647         // match: (Sub64 x (Add64 z i:(Const64 <t>)))
30648         // cond: (z.Op != OpConst64 && x.Op != OpConst64)
30649         // result: (Sub64 (Sub64 <t> x z) i)
30650         for {
30651                 x := v_0
30652                 if v_1.Op != OpAdd64 {
30653                         break
30654                 }
30655                 _ = v_1.Args[1]
30656                 v_1_0 := v_1.Args[0]
30657                 v_1_1 := v_1.Args[1]
30658                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
30659                         z := v_1_0
30660                         i := v_1_1
30661                         if i.Op != OpConst64 {
30662                                 continue
30663                         }
30664                         t := i.Type
30665                         if !(z.Op != OpConst64 && x.Op != OpConst64) {
30666                                 continue
30667                         }
30668                         v.reset(OpSub64)
30669                         v0 := b.NewValue0(v.Pos, OpSub64, t)
30670                         v0.AddArg2(x, z)
30671                         v.AddArg2(v0, i)
30672                         return true
30673                 }
30674                 break
30675         }
30676         // match: (Sub64 (Sub64 i:(Const64 <t>) z) x)
30677         // cond: (z.Op != OpConst64 && x.Op != OpConst64)
30678         // result: (Sub64 i (Add64 <t> z x))
30679         for {
30680                 if v_0.Op != OpSub64 {
30681                         break
30682                 }
30683                 z := v_0.Args[1]
30684                 i := v_0.Args[0]
30685                 if i.Op != OpConst64 {
30686                         break
30687                 }
30688                 t := i.Type
30689                 x := v_1
30690                 if !(z.Op != OpConst64 && x.Op != OpConst64) {
30691                         break
30692                 }
30693                 v.reset(OpSub64)
30694                 v0 := b.NewValue0(v.Pos, OpAdd64, t)
30695                 v0.AddArg2(z, x)
30696                 v.AddArg2(i, v0)
30697                 return true
30698         }
30699         // match: (Sub64 (Add64 z i:(Const64 <t>)) x)
30700         // cond: (z.Op != OpConst64 && x.Op != OpConst64)
30701         // result: (Add64 i (Sub64 <t> z x))
30702         for {
30703                 if v_0.Op != OpAdd64 {
30704                         break
30705                 }
30706                 _ = v_0.Args[1]
30707                 v_0_0 := v_0.Args[0]
30708                 v_0_1 := v_0.Args[1]
30709                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
30710                         z := v_0_0
30711                         i := v_0_1
30712                         if i.Op != OpConst64 {
30713                                 continue
30714                         }
30715                         t := i.Type
30716                         x := v_1
30717                         if !(z.Op != OpConst64 && x.Op != OpConst64) {
30718                                 continue
30719                         }
30720                         v.reset(OpAdd64)
30721                         v0 := b.NewValue0(v.Pos, OpSub64, t)
30722                         v0.AddArg2(z, x)
30723                         v.AddArg2(i, v0)
30724                         return true
30725                 }
30726                 break
30727         }
30728         // match: (Sub64 (Const64 <t> [c]) (Sub64 (Const64 <t> [d]) x))
30729         // result: (Add64 (Const64 <t> [c-d]) x)
30730         for {
30731                 if v_0.Op != OpConst64 {
30732                         break
30733                 }
30734                 t := v_0.Type
30735                 c := auxIntToInt64(v_0.AuxInt)
30736                 if v_1.Op != OpSub64 {
30737                         break
30738                 }
30739                 x := v_1.Args[1]
30740                 v_1_0 := v_1.Args[0]
30741                 if v_1_0.Op != OpConst64 || v_1_0.Type != t {
30742                         break
30743                 }
30744                 d := auxIntToInt64(v_1_0.AuxInt)
30745                 v.reset(OpAdd64)
30746                 v0 := b.NewValue0(v.Pos, OpConst64, t)
30747                 v0.AuxInt = int64ToAuxInt(c - d)
30748                 v.AddArg2(v0, x)
30749                 return true
30750         }
30751         // match: (Sub64 (Const64 <t> [c]) (Add64 (Const64 <t> [d]) x))
30752         // result: (Sub64 (Const64 <t> [c-d]) x)
30753         for {
30754                 if v_0.Op != OpConst64 {
30755                         break
30756                 }
30757                 t := v_0.Type
30758                 c := auxIntToInt64(v_0.AuxInt)
30759                 if v_1.Op != OpAdd64 {
30760                         break
30761                 }
30762                 _ = v_1.Args[1]
30763                 v_1_0 := v_1.Args[0]
30764                 v_1_1 := v_1.Args[1]
30765                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
30766                         if v_1_0.Op != OpConst64 || v_1_0.Type != t {
30767                                 continue
30768                         }
30769                         d := auxIntToInt64(v_1_0.AuxInt)
30770                         x := v_1_1
30771                         v.reset(OpSub64)
30772                         v0 := b.NewValue0(v.Pos, OpConst64, t)
30773                         v0.AuxInt = int64ToAuxInt(c - d)
30774                         v.AddArg2(v0, x)
30775                         return true
30776                 }
30777                 break
30778         }
30779         return false
30780 }
30781 func rewriteValuegeneric_OpSub64F(v *Value) bool {
30782         v_1 := v.Args[1]
30783         v_0 := v.Args[0]
30784         // match: (Sub64F (Const64F [c]) (Const64F [d]))
30785         // cond: c-d == c-d
30786         // result: (Const64F [c-d])
30787         for {
30788                 if v_0.Op != OpConst64F {
30789                         break
30790                 }
30791                 c := auxIntToFloat64(v_0.AuxInt)
30792                 if v_1.Op != OpConst64F {
30793                         break
30794                 }
30795                 d := auxIntToFloat64(v_1.AuxInt)
30796                 if !(c-d == c-d) {
30797                         break
30798                 }
30799                 v.reset(OpConst64F)
30800                 v.AuxInt = float64ToAuxInt(c - d)
30801                 return true
30802         }
30803         return false
30804 }
30805 func rewriteValuegeneric_OpSub8(v *Value) bool {
30806         v_1 := v.Args[1]
30807         v_0 := v.Args[0]
30808         b := v.Block
30809         // match: (Sub8 (Const8 [c]) (Const8 [d]))
30810         // result: (Const8 [c-d])
30811         for {
30812                 if v_0.Op != OpConst8 {
30813                         break
30814                 }
30815                 c := auxIntToInt8(v_0.AuxInt)
30816                 if v_1.Op != OpConst8 {
30817                         break
30818                 }
30819                 d := auxIntToInt8(v_1.AuxInt)
30820                 v.reset(OpConst8)
30821                 v.AuxInt = int8ToAuxInt(c - d)
30822                 return true
30823         }
30824         // match: (Sub8 x (Const8 <t> [c]))
30825         // cond: x.Op != OpConst8
30826         // result: (Add8 (Const8 <t> [-c]) x)
30827         for {
30828                 x := v_0
30829                 if v_1.Op != OpConst8 {
30830                         break
30831                 }
30832                 t := v_1.Type
30833                 c := auxIntToInt8(v_1.AuxInt)
30834                 if !(x.Op != OpConst8) {
30835                         break
30836                 }
30837                 v.reset(OpAdd8)
30838                 v0 := b.NewValue0(v.Pos, OpConst8, t)
30839                 v0.AuxInt = int8ToAuxInt(-c)
30840                 v.AddArg2(v0, x)
30841                 return true
30842         }
30843         // match: (Sub8 <t> (Mul8 x y) (Mul8 x z))
30844         // result: (Mul8 x (Sub8 <t> y z))
30845         for {
30846                 t := v.Type
30847                 if v_0.Op != OpMul8 {
30848                         break
30849                 }
30850                 _ = v_0.Args[1]
30851                 v_0_0 := v_0.Args[0]
30852                 v_0_1 := v_0.Args[1]
30853                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
30854                         x := v_0_0
30855                         y := v_0_1
30856                         if v_1.Op != OpMul8 {
30857                                 continue
30858                         }
30859                         _ = v_1.Args[1]
30860                         v_1_0 := v_1.Args[0]
30861                         v_1_1 := v_1.Args[1]
30862                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
30863                                 if x != v_1_0 {
30864                                         continue
30865                                 }
30866                                 z := v_1_1
30867                                 v.reset(OpMul8)
30868                                 v0 := b.NewValue0(v.Pos, OpSub8, t)
30869                                 v0.AddArg2(y, z)
30870                                 v.AddArg2(x, v0)
30871                                 return true
30872                         }
30873                 }
30874                 break
30875         }
30876         // match: (Sub8 x x)
30877         // result: (Const8 [0])
30878         for {
30879                 x := v_0
30880                 if x != v_1 {
30881                         break
30882                 }
30883                 v.reset(OpConst8)
30884                 v.AuxInt = int8ToAuxInt(0)
30885                 return true
30886         }
30887         // match: (Sub8 (Neg8 x) (Com8 x))
30888         // result: (Const8 [1])
30889         for {
30890                 if v_0.Op != OpNeg8 {
30891                         break
30892                 }
30893                 x := v_0.Args[0]
30894                 if v_1.Op != OpCom8 || x != v_1.Args[0] {
30895                         break
30896                 }
30897                 v.reset(OpConst8)
30898                 v.AuxInt = int8ToAuxInt(1)
30899                 return true
30900         }
30901         // match: (Sub8 (Com8 x) (Neg8 x))
30902         // result: (Const8 [-1])
30903         for {
30904                 if v_0.Op != OpCom8 {
30905                         break
30906                 }
30907                 x := v_0.Args[0]
30908                 if v_1.Op != OpNeg8 || x != v_1.Args[0] {
30909                         break
30910                 }
30911                 v.reset(OpConst8)
30912                 v.AuxInt = int8ToAuxInt(-1)
30913                 return true
30914         }
30915         // match: (Sub8 (Add8 t x) (Add8 t y))
30916         // result: (Sub8 x y)
30917         for {
30918                 if v_0.Op != OpAdd8 {
30919                         break
30920                 }
30921                 _ = v_0.Args[1]
30922                 v_0_0 := v_0.Args[0]
30923                 v_0_1 := v_0.Args[1]
30924                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
30925                         t := v_0_0
30926                         x := v_0_1
30927                         if v_1.Op != OpAdd8 {
30928                                 continue
30929                         }
30930                         _ = v_1.Args[1]
30931                         v_1_0 := v_1.Args[0]
30932                         v_1_1 := v_1.Args[1]
30933                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
30934                                 if t != v_1_0 {
30935                                         continue
30936                                 }
30937                                 y := v_1_1
30938                                 v.reset(OpSub8)
30939                                 v.AddArg2(x, y)
30940                                 return true
30941                         }
30942                 }
30943                 break
30944         }
30945         // match: (Sub8 (Add8 x y) x)
30946         // result: y
30947         for {
30948                 if v_0.Op != OpAdd8 {
30949                         break
30950                 }
30951                 _ = v_0.Args[1]
30952                 v_0_0 := v_0.Args[0]
30953                 v_0_1 := v_0.Args[1]
30954                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
30955                         x := v_0_0
30956                         y := v_0_1
30957                         if x != v_1 {
30958                                 continue
30959                         }
30960                         v.copyOf(y)
30961                         return true
30962                 }
30963                 break
30964         }
30965         // match: (Sub8 (Add8 x y) y)
30966         // result: x
30967         for {
30968                 if v_0.Op != OpAdd8 {
30969                         break
30970                 }
30971                 _ = v_0.Args[1]
30972                 v_0_0 := v_0.Args[0]
30973                 v_0_1 := v_0.Args[1]
30974                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
30975                         x := v_0_0
30976                         y := v_0_1
30977                         if y != v_1 {
30978                                 continue
30979                         }
30980                         v.copyOf(x)
30981                         return true
30982                 }
30983                 break
30984         }
30985         // match: (Sub8 (Sub8 x y) x)
30986         // result: (Neg8 y)
30987         for {
30988                 if v_0.Op != OpSub8 {
30989                         break
30990                 }
30991                 y := v_0.Args[1]
30992                 x := v_0.Args[0]
30993                 if x != v_1 {
30994                         break
30995                 }
30996                 v.reset(OpNeg8)
30997                 v.AddArg(y)
30998                 return true
30999         }
31000         // match: (Sub8 x (Add8 x y))
31001         // result: (Neg8 y)
31002         for {
31003                 x := v_0
31004                 if v_1.Op != OpAdd8 {
31005                         break
31006                 }
31007                 _ = v_1.Args[1]
31008                 v_1_0 := v_1.Args[0]
31009                 v_1_1 := v_1.Args[1]
31010                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
31011                         if x != v_1_0 {
31012                                 continue
31013                         }
31014                         y := v_1_1
31015                         v.reset(OpNeg8)
31016                         v.AddArg(y)
31017                         return true
31018                 }
31019                 break
31020         }
31021         // match: (Sub8 x (Sub8 i:(Const8 <t>) z))
31022         // cond: (z.Op != OpConst8 && x.Op != OpConst8)
31023         // result: (Sub8 (Add8 <t> x z) i)
31024         for {
31025                 x := v_0
31026                 if v_1.Op != OpSub8 {
31027                         break
31028                 }
31029                 z := v_1.Args[1]
31030                 i := v_1.Args[0]
31031                 if i.Op != OpConst8 {
31032                         break
31033                 }
31034                 t := i.Type
31035                 if !(z.Op != OpConst8 && x.Op != OpConst8) {
31036                         break
31037                 }
31038                 v.reset(OpSub8)
31039                 v0 := b.NewValue0(v.Pos, OpAdd8, t)
31040                 v0.AddArg2(x, z)
31041                 v.AddArg2(v0, i)
31042                 return true
31043         }
31044         // match: (Sub8 x (Add8 z i:(Const8 <t>)))
31045         // cond: (z.Op != OpConst8 && x.Op != OpConst8)
31046         // result: (Sub8 (Sub8 <t> x z) i)
31047         for {
31048                 x := v_0
31049                 if v_1.Op != OpAdd8 {
31050                         break
31051                 }
31052                 _ = v_1.Args[1]
31053                 v_1_0 := v_1.Args[0]
31054                 v_1_1 := v_1.Args[1]
31055                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
31056                         z := v_1_0
31057                         i := v_1_1
31058                         if i.Op != OpConst8 {
31059                                 continue
31060                         }
31061                         t := i.Type
31062                         if !(z.Op != OpConst8 && x.Op != OpConst8) {
31063                                 continue
31064                         }
31065                         v.reset(OpSub8)
31066                         v0 := b.NewValue0(v.Pos, OpSub8, t)
31067                         v0.AddArg2(x, z)
31068                         v.AddArg2(v0, i)
31069                         return true
31070                 }
31071                 break
31072         }
31073         // match: (Sub8 (Sub8 i:(Const8 <t>) z) x)
31074         // cond: (z.Op != OpConst8 && x.Op != OpConst8)
31075         // result: (Sub8 i (Add8 <t> z x))
31076         for {
31077                 if v_0.Op != OpSub8 {
31078                         break
31079                 }
31080                 z := v_0.Args[1]
31081                 i := v_0.Args[0]
31082                 if i.Op != OpConst8 {
31083                         break
31084                 }
31085                 t := i.Type
31086                 x := v_1
31087                 if !(z.Op != OpConst8 && x.Op != OpConst8) {
31088                         break
31089                 }
31090                 v.reset(OpSub8)
31091                 v0 := b.NewValue0(v.Pos, OpAdd8, t)
31092                 v0.AddArg2(z, x)
31093                 v.AddArg2(i, v0)
31094                 return true
31095         }
31096         // match: (Sub8 (Add8 z i:(Const8 <t>)) x)
31097         // cond: (z.Op != OpConst8 && x.Op != OpConst8)
31098         // result: (Add8 i (Sub8 <t> z x))
31099         for {
31100                 if v_0.Op != OpAdd8 {
31101                         break
31102                 }
31103                 _ = v_0.Args[1]
31104                 v_0_0 := v_0.Args[0]
31105                 v_0_1 := v_0.Args[1]
31106                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
31107                         z := v_0_0
31108                         i := v_0_1
31109                         if i.Op != OpConst8 {
31110                                 continue
31111                         }
31112                         t := i.Type
31113                         x := v_1
31114                         if !(z.Op != OpConst8 && x.Op != OpConst8) {
31115                                 continue
31116                         }
31117                         v.reset(OpAdd8)
31118                         v0 := b.NewValue0(v.Pos, OpSub8, t)
31119                         v0.AddArg2(z, x)
31120                         v.AddArg2(i, v0)
31121                         return true
31122                 }
31123                 break
31124         }
31125         // match: (Sub8 (Const8 <t> [c]) (Sub8 (Const8 <t> [d]) x))
31126         // result: (Add8 (Const8 <t> [c-d]) x)
31127         for {
31128                 if v_0.Op != OpConst8 {
31129                         break
31130                 }
31131                 t := v_0.Type
31132                 c := auxIntToInt8(v_0.AuxInt)
31133                 if v_1.Op != OpSub8 {
31134                         break
31135                 }
31136                 x := v_1.Args[1]
31137                 v_1_0 := v_1.Args[0]
31138                 if v_1_0.Op != OpConst8 || v_1_0.Type != t {
31139                         break
31140                 }
31141                 d := auxIntToInt8(v_1_0.AuxInt)
31142                 v.reset(OpAdd8)
31143                 v0 := b.NewValue0(v.Pos, OpConst8, t)
31144                 v0.AuxInt = int8ToAuxInt(c - d)
31145                 v.AddArg2(v0, x)
31146                 return true
31147         }
31148         // match: (Sub8 (Const8 <t> [c]) (Add8 (Const8 <t> [d]) x))
31149         // result: (Sub8 (Const8 <t> [c-d]) x)
31150         for {
31151                 if v_0.Op != OpConst8 {
31152                         break
31153                 }
31154                 t := v_0.Type
31155                 c := auxIntToInt8(v_0.AuxInt)
31156                 if v_1.Op != OpAdd8 {
31157                         break
31158                 }
31159                 _ = v_1.Args[1]
31160                 v_1_0 := v_1.Args[0]
31161                 v_1_1 := v_1.Args[1]
31162                 for _i0 := 0; _i0 <= 1; _i0, v_1_0, v_1_1 = _i0+1, v_1_1, v_1_0 {
31163                         if v_1_0.Op != OpConst8 || v_1_0.Type != t {
31164                                 continue
31165                         }
31166                         d := auxIntToInt8(v_1_0.AuxInt)
31167                         x := v_1_1
31168                         v.reset(OpSub8)
31169                         v0 := b.NewValue0(v.Pos, OpConst8, t)
31170                         v0.AuxInt = int8ToAuxInt(c - d)
31171                         v.AddArg2(v0, x)
31172                         return true
31173                 }
31174                 break
31175         }
31176         return false
31177 }
31178 func rewriteValuegeneric_OpTrunc(v *Value) bool {
31179         v_0 := v.Args[0]
31180         // match: (Trunc (Const64F [c]))
31181         // result: (Const64F [math.Trunc(c)])
31182         for {
31183                 if v_0.Op != OpConst64F {
31184                         break
31185                 }
31186                 c := auxIntToFloat64(v_0.AuxInt)
31187                 v.reset(OpConst64F)
31188                 v.AuxInt = float64ToAuxInt(math.Trunc(c))
31189                 return true
31190         }
31191         return false
31192 }
31193 func rewriteValuegeneric_OpTrunc16to8(v *Value) bool {
31194         v_0 := v.Args[0]
31195         // match: (Trunc16to8 (Const16 [c]))
31196         // result: (Const8 [int8(c)])
31197         for {
31198                 if v_0.Op != OpConst16 {
31199                         break
31200                 }
31201                 c := auxIntToInt16(v_0.AuxInt)
31202                 v.reset(OpConst8)
31203                 v.AuxInt = int8ToAuxInt(int8(c))
31204                 return true
31205         }
31206         // match: (Trunc16to8 (ZeroExt8to16 x))
31207         // result: x
31208         for {
31209                 if v_0.Op != OpZeroExt8to16 {
31210                         break
31211                 }
31212                 x := v_0.Args[0]
31213                 v.copyOf(x)
31214                 return true
31215         }
31216         // match: (Trunc16to8 (SignExt8to16 x))
31217         // result: x
31218         for {
31219                 if v_0.Op != OpSignExt8to16 {
31220                         break
31221                 }
31222                 x := v_0.Args[0]
31223                 v.copyOf(x)
31224                 return true
31225         }
31226         // match: (Trunc16to8 (And16 (Const16 [y]) x))
31227         // cond: y&0xFF == 0xFF
31228         // result: (Trunc16to8 x)
31229         for {
31230                 if v_0.Op != OpAnd16 {
31231                         break
31232                 }
31233                 _ = v_0.Args[1]
31234                 v_0_0 := v_0.Args[0]
31235                 v_0_1 := v_0.Args[1]
31236                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
31237                         if v_0_0.Op != OpConst16 {
31238                                 continue
31239                         }
31240                         y := auxIntToInt16(v_0_0.AuxInt)
31241                         x := v_0_1
31242                         if !(y&0xFF == 0xFF) {
31243                                 continue
31244                         }
31245                         v.reset(OpTrunc16to8)
31246                         v.AddArg(x)
31247                         return true
31248                 }
31249                 break
31250         }
31251         return false
31252 }
31253 func rewriteValuegeneric_OpTrunc32to16(v *Value) bool {
31254         v_0 := v.Args[0]
31255         // match: (Trunc32to16 (Const32 [c]))
31256         // result: (Const16 [int16(c)])
31257         for {
31258                 if v_0.Op != OpConst32 {
31259                         break
31260                 }
31261                 c := auxIntToInt32(v_0.AuxInt)
31262                 v.reset(OpConst16)
31263                 v.AuxInt = int16ToAuxInt(int16(c))
31264                 return true
31265         }
31266         // match: (Trunc32to16 (ZeroExt8to32 x))
31267         // result: (ZeroExt8to16 x)
31268         for {
31269                 if v_0.Op != OpZeroExt8to32 {
31270                         break
31271                 }
31272                 x := v_0.Args[0]
31273                 v.reset(OpZeroExt8to16)
31274                 v.AddArg(x)
31275                 return true
31276         }
31277         // match: (Trunc32to16 (ZeroExt16to32 x))
31278         // result: x
31279         for {
31280                 if v_0.Op != OpZeroExt16to32 {
31281                         break
31282                 }
31283                 x := v_0.Args[0]
31284                 v.copyOf(x)
31285                 return true
31286         }
31287         // match: (Trunc32to16 (SignExt8to32 x))
31288         // result: (SignExt8to16 x)
31289         for {
31290                 if v_0.Op != OpSignExt8to32 {
31291                         break
31292                 }
31293                 x := v_0.Args[0]
31294                 v.reset(OpSignExt8to16)
31295                 v.AddArg(x)
31296                 return true
31297         }
31298         // match: (Trunc32to16 (SignExt16to32 x))
31299         // result: x
31300         for {
31301                 if v_0.Op != OpSignExt16to32 {
31302                         break
31303                 }
31304                 x := v_0.Args[0]
31305                 v.copyOf(x)
31306                 return true
31307         }
31308         // match: (Trunc32to16 (And32 (Const32 [y]) x))
31309         // cond: y&0xFFFF == 0xFFFF
31310         // result: (Trunc32to16 x)
31311         for {
31312                 if v_0.Op != OpAnd32 {
31313                         break
31314                 }
31315                 _ = v_0.Args[1]
31316                 v_0_0 := v_0.Args[0]
31317                 v_0_1 := v_0.Args[1]
31318                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
31319                         if v_0_0.Op != OpConst32 {
31320                                 continue
31321                         }
31322                         y := auxIntToInt32(v_0_0.AuxInt)
31323                         x := v_0_1
31324                         if !(y&0xFFFF == 0xFFFF) {
31325                                 continue
31326                         }
31327                         v.reset(OpTrunc32to16)
31328                         v.AddArg(x)
31329                         return true
31330                 }
31331                 break
31332         }
31333         return false
31334 }
31335 func rewriteValuegeneric_OpTrunc32to8(v *Value) bool {
31336         v_0 := v.Args[0]
31337         // match: (Trunc32to8 (Const32 [c]))
31338         // result: (Const8 [int8(c)])
31339         for {
31340                 if v_0.Op != OpConst32 {
31341                         break
31342                 }
31343                 c := auxIntToInt32(v_0.AuxInt)
31344                 v.reset(OpConst8)
31345                 v.AuxInt = int8ToAuxInt(int8(c))
31346                 return true
31347         }
31348         // match: (Trunc32to8 (ZeroExt8to32 x))
31349         // result: x
31350         for {
31351                 if v_0.Op != OpZeroExt8to32 {
31352                         break
31353                 }
31354                 x := v_0.Args[0]
31355                 v.copyOf(x)
31356                 return true
31357         }
31358         // match: (Trunc32to8 (SignExt8to32 x))
31359         // result: x
31360         for {
31361                 if v_0.Op != OpSignExt8to32 {
31362                         break
31363                 }
31364                 x := v_0.Args[0]
31365                 v.copyOf(x)
31366                 return true
31367         }
31368         // match: (Trunc32to8 (And32 (Const32 [y]) x))
31369         // cond: y&0xFF == 0xFF
31370         // result: (Trunc32to8 x)
31371         for {
31372                 if v_0.Op != OpAnd32 {
31373                         break
31374                 }
31375                 _ = v_0.Args[1]
31376                 v_0_0 := v_0.Args[0]
31377                 v_0_1 := v_0.Args[1]
31378                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
31379                         if v_0_0.Op != OpConst32 {
31380                                 continue
31381                         }
31382                         y := auxIntToInt32(v_0_0.AuxInt)
31383                         x := v_0_1
31384                         if !(y&0xFF == 0xFF) {
31385                                 continue
31386                         }
31387                         v.reset(OpTrunc32to8)
31388                         v.AddArg(x)
31389                         return true
31390                 }
31391                 break
31392         }
31393         return false
31394 }
31395 func rewriteValuegeneric_OpTrunc64to16(v *Value) bool {
31396         v_0 := v.Args[0]
31397         // match: (Trunc64to16 (Const64 [c]))
31398         // result: (Const16 [int16(c)])
31399         for {
31400                 if v_0.Op != OpConst64 {
31401                         break
31402                 }
31403                 c := auxIntToInt64(v_0.AuxInt)
31404                 v.reset(OpConst16)
31405                 v.AuxInt = int16ToAuxInt(int16(c))
31406                 return true
31407         }
31408         // match: (Trunc64to16 (ZeroExt8to64 x))
31409         // result: (ZeroExt8to16 x)
31410         for {
31411                 if v_0.Op != OpZeroExt8to64 {
31412                         break
31413                 }
31414                 x := v_0.Args[0]
31415                 v.reset(OpZeroExt8to16)
31416                 v.AddArg(x)
31417                 return true
31418         }
31419         // match: (Trunc64to16 (ZeroExt16to64 x))
31420         // result: x
31421         for {
31422                 if v_0.Op != OpZeroExt16to64 {
31423                         break
31424                 }
31425                 x := v_0.Args[0]
31426                 v.copyOf(x)
31427                 return true
31428         }
31429         // match: (Trunc64to16 (SignExt8to64 x))
31430         // result: (SignExt8to16 x)
31431         for {
31432                 if v_0.Op != OpSignExt8to64 {
31433                         break
31434                 }
31435                 x := v_0.Args[0]
31436                 v.reset(OpSignExt8to16)
31437                 v.AddArg(x)
31438                 return true
31439         }
31440         // match: (Trunc64to16 (SignExt16to64 x))
31441         // result: x
31442         for {
31443                 if v_0.Op != OpSignExt16to64 {
31444                         break
31445                 }
31446                 x := v_0.Args[0]
31447                 v.copyOf(x)
31448                 return true
31449         }
31450         // match: (Trunc64to16 (And64 (Const64 [y]) x))
31451         // cond: y&0xFFFF == 0xFFFF
31452         // result: (Trunc64to16 x)
31453         for {
31454                 if v_0.Op != OpAnd64 {
31455                         break
31456                 }
31457                 _ = v_0.Args[1]
31458                 v_0_0 := v_0.Args[0]
31459                 v_0_1 := v_0.Args[1]
31460                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
31461                         if v_0_0.Op != OpConst64 {
31462                                 continue
31463                         }
31464                         y := auxIntToInt64(v_0_0.AuxInt)
31465                         x := v_0_1
31466                         if !(y&0xFFFF == 0xFFFF) {
31467                                 continue
31468                         }
31469                         v.reset(OpTrunc64to16)
31470                         v.AddArg(x)
31471                         return true
31472                 }
31473                 break
31474         }
31475         return false
31476 }
31477 func rewriteValuegeneric_OpTrunc64to32(v *Value) bool {
31478         v_0 := v.Args[0]
31479         // match: (Trunc64to32 (Const64 [c]))
31480         // result: (Const32 [int32(c)])
31481         for {
31482                 if v_0.Op != OpConst64 {
31483                         break
31484                 }
31485                 c := auxIntToInt64(v_0.AuxInt)
31486                 v.reset(OpConst32)
31487                 v.AuxInt = int32ToAuxInt(int32(c))
31488                 return true
31489         }
31490         // match: (Trunc64to32 (ZeroExt8to64 x))
31491         // result: (ZeroExt8to32 x)
31492         for {
31493                 if v_0.Op != OpZeroExt8to64 {
31494                         break
31495                 }
31496                 x := v_0.Args[0]
31497                 v.reset(OpZeroExt8to32)
31498                 v.AddArg(x)
31499                 return true
31500         }
31501         // match: (Trunc64to32 (ZeroExt16to64 x))
31502         // result: (ZeroExt16to32 x)
31503         for {
31504                 if v_0.Op != OpZeroExt16to64 {
31505                         break
31506                 }
31507                 x := v_0.Args[0]
31508                 v.reset(OpZeroExt16to32)
31509                 v.AddArg(x)
31510                 return true
31511         }
31512         // match: (Trunc64to32 (ZeroExt32to64 x))
31513         // result: x
31514         for {
31515                 if v_0.Op != OpZeroExt32to64 {
31516                         break
31517                 }
31518                 x := v_0.Args[0]
31519                 v.copyOf(x)
31520                 return true
31521         }
31522         // match: (Trunc64to32 (SignExt8to64 x))
31523         // result: (SignExt8to32 x)
31524         for {
31525                 if v_0.Op != OpSignExt8to64 {
31526                         break
31527                 }
31528                 x := v_0.Args[0]
31529                 v.reset(OpSignExt8to32)
31530                 v.AddArg(x)
31531                 return true
31532         }
31533         // match: (Trunc64to32 (SignExt16to64 x))
31534         // result: (SignExt16to32 x)
31535         for {
31536                 if v_0.Op != OpSignExt16to64 {
31537                         break
31538                 }
31539                 x := v_0.Args[0]
31540                 v.reset(OpSignExt16to32)
31541                 v.AddArg(x)
31542                 return true
31543         }
31544         // match: (Trunc64to32 (SignExt32to64 x))
31545         // result: x
31546         for {
31547                 if v_0.Op != OpSignExt32to64 {
31548                         break
31549                 }
31550                 x := v_0.Args[0]
31551                 v.copyOf(x)
31552                 return true
31553         }
31554         // match: (Trunc64to32 (And64 (Const64 [y]) x))
31555         // cond: y&0xFFFFFFFF == 0xFFFFFFFF
31556         // result: (Trunc64to32 x)
31557         for {
31558                 if v_0.Op != OpAnd64 {
31559                         break
31560                 }
31561                 _ = v_0.Args[1]
31562                 v_0_0 := v_0.Args[0]
31563                 v_0_1 := v_0.Args[1]
31564                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
31565                         if v_0_0.Op != OpConst64 {
31566                                 continue
31567                         }
31568                         y := auxIntToInt64(v_0_0.AuxInt)
31569                         x := v_0_1
31570                         if !(y&0xFFFFFFFF == 0xFFFFFFFF) {
31571                                 continue
31572                         }
31573                         v.reset(OpTrunc64to32)
31574                         v.AddArg(x)
31575                         return true
31576                 }
31577                 break
31578         }
31579         return false
31580 }
31581 func rewriteValuegeneric_OpTrunc64to8(v *Value) bool {
31582         v_0 := v.Args[0]
31583         // match: (Trunc64to8 (Const64 [c]))
31584         // result: (Const8 [int8(c)])
31585         for {
31586                 if v_0.Op != OpConst64 {
31587                         break
31588                 }
31589                 c := auxIntToInt64(v_0.AuxInt)
31590                 v.reset(OpConst8)
31591                 v.AuxInt = int8ToAuxInt(int8(c))
31592                 return true
31593         }
31594         // match: (Trunc64to8 (ZeroExt8to64 x))
31595         // result: x
31596         for {
31597                 if v_0.Op != OpZeroExt8to64 {
31598                         break
31599                 }
31600                 x := v_0.Args[0]
31601                 v.copyOf(x)
31602                 return true
31603         }
31604         // match: (Trunc64to8 (SignExt8to64 x))
31605         // result: x
31606         for {
31607                 if v_0.Op != OpSignExt8to64 {
31608                         break
31609                 }
31610                 x := v_0.Args[0]
31611                 v.copyOf(x)
31612                 return true
31613         }
31614         // match: (Trunc64to8 (And64 (Const64 [y]) x))
31615         // cond: y&0xFF == 0xFF
31616         // result: (Trunc64to8 x)
31617         for {
31618                 if v_0.Op != OpAnd64 {
31619                         break
31620                 }
31621                 _ = v_0.Args[1]
31622                 v_0_0 := v_0.Args[0]
31623                 v_0_1 := v_0.Args[1]
31624                 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
31625                         if v_0_0.Op != OpConst64 {
31626                                 continue
31627                         }
31628                         y := auxIntToInt64(v_0_0.AuxInt)
31629                         x := v_0_1
31630                         if !(y&0xFF == 0xFF) {
31631                                 continue
31632                         }
31633                         v.reset(OpTrunc64to8)
31634                         v.AddArg(x)
31635                         return true
31636                 }
31637                 break
31638         }
31639         return false
31640 }
31641 func rewriteValuegeneric_OpXor16(v *Value) bool {
31642         v_1 := v.Args[1]
31643         v_0 := v.Args[0]
31644         b := v.Block
31645         config := b.Func.Config
31646         // match: (Xor16 (Const16 [c]) (Const16 [d]))
31647         // result: (Const16 [c^d])
31648         for {
31649                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
31650                         if v_0.Op != OpConst16 {
31651                                 continue
31652                         }
31653                         c := auxIntToInt16(v_0.AuxInt)
31654                         if v_1.Op != OpConst16 {
31655                                 continue
31656                         }
31657                         d := auxIntToInt16(v_1.AuxInt)
31658                         v.reset(OpConst16)
31659                         v.AuxInt = int16ToAuxInt(c ^ d)
31660                         return true
31661                 }
31662                 break
31663         }
31664         // match: (Xor16 x x)
31665         // result: (Const16 [0])
31666         for {
31667                 x := v_0
31668                 if x != v_1 {
31669                         break
31670                 }
31671                 v.reset(OpConst16)
31672                 v.AuxInt = int16ToAuxInt(0)
31673                 return true
31674         }
31675         // match: (Xor16 (Const16 [0]) x)
31676         // result: x
31677         for {
31678                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
31679                         if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != 0 {
31680                                 continue
31681                         }
31682                         x := v_1
31683                         v.copyOf(x)
31684                         return true
31685                 }
31686                 break
31687         }
31688         // match: (Xor16 (Com16 x) x)
31689         // result: (Const16 [-1])
31690         for {
31691                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
31692                         if v_0.Op != OpCom16 {
31693                                 continue
31694                         }
31695                         x := v_0.Args[0]
31696                         if x != v_1 {
31697                                 continue
31698                         }
31699                         v.reset(OpConst16)
31700                         v.AuxInt = int16ToAuxInt(-1)
31701                         return true
31702                 }
31703                 break
31704         }
31705         // match: (Xor16 (Const16 [-1]) x)
31706         // result: (Com16 x)
31707         for {
31708                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
31709                         if v_0.Op != OpConst16 || auxIntToInt16(v_0.AuxInt) != -1 {
31710                                 continue
31711                         }
31712                         x := v_1
31713                         v.reset(OpCom16)
31714                         v.AddArg(x)
31715                         return true
31716                 }
31717                 break
31718         }
31719         // match: (Xor16 x (Xor16 x y))
31720         // result: y
31721         for {
31722                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
31723                         x := v_0
31724                         if v_1.Op != OpXor16 {
31725                                 continue
31726                         }
31727                         _ = v_1.Args[1]
31728                         v_1_0 := v_1.Args[0]
31729                         v_1_1 := v_1.Args[1]
31730                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
31731                                 if x != v_1_0 {
31732                                         continue
31733                                 }
31734                                 y := v_1_1
31735                                 v.copyOf(y)
31736                                 return true
31737                         }
31738                 }
31739                 break
31740         }
31741         // match: (Xor16 (Xor16 i:(Const16 <t>) z) x)
31742         // cond: (z.Op != OpConst16 && x.Op != OpConst16)
31743         // result: (Xor16 i (Xor16 <t> z x))
31744         for {
31745                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
31746                         if v_0.Op != OpXor16 {
31747                                 continue
31748                         }
31749                         _ = v_0.Args[1]
31750                         v_0_0 := v_0.Args[0]
31751                         v_0_1 := v_0.Args[1]
31752                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
31753                                 i := v_0_0
31754                                 if i.Op != OpConst16 {
31755                                         continue
31756                                 }
31757                                 t := i.Type
31758                                 z := v_0_1
31759                                 x := v_1
31760                                 if !(z.Op != OpConst16 && x.Op != OpConst16) {
31761                                         continue
31762                                 }
31763                                 v.reset(OpXor16)
31764                                 v0 := b.NewValue0(v.Pos, OpXor16, t)
31765                                 v0.AddArg2(z, x)
31766                                 v.AddArg2(i, v0)
31767                                 return true
31768                         }
31769                 }
31770                 break
31771         }
31772         // match: (Xor16 (Const16 <t> [c]) (Xor16 (Const16 <t> [d]) x))
31773         // result: (Xor16 (Const16 <t> [c^d]) x)
31774         for {
31775                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
31776                         if v_0.Op != OpConst16 {
31777                                 continue
31778                         }
31779                         t := v_0.Type
31780                         c := auxIntToInt16(v_0.AuxInt)
31781                         if v_1.Op != OpXor16 {
31782                                 continue
31783                         }
31784                         _ = v_1.Args[1]
31785                         v_1_0 := v_1.Args[0]
31786                         v_1_1 := v_1.Args[1]
31787                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
31788                                 if v_1_0.Op != OpConst16 || v_1_0.Type != t {
31789                                         continue
31790                                 }
31791                                 d := auxIntToInt16(v_1_0.AuxInt)
31792                                 x := v_1_1
31793                                 v.reset(OpXor16)
31794                                 v0 := b.NewValue0(v.Pos, OpConst16, t)
31795                                 v0.AuxInt = int16ToAuxInt(c ^ d)
31796                                 v.AddArg2(v0, x)
31797                                 return true
31798                         }
31799                 }
31800                 break
31801         }
31802         // match: (Xor16 (Lsh16x64 x z:(Const64 <t> [c])) (Rsh16Ux64 x (Const64 [d])))
31803         // cond: c < 16 && d == 16-c && canRotate(config, 16)
31804         // result: (RotateLeft16 x z)
31805         for {
31806                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
31807                         if v_0.Op != OpLsh16x64 {
31808                                 continue
31809                         }
31810                         _ = v_0.Args[1]
31811                         x := v_0.Args[0]
31812                         z := v_0.Args[1]
31813                         if z.Op != OpConst64 {
31814                                 continue
31815                         }
31816                         c := auxIntToInt64(z.AuxInt)
31817                         if v_1.Op != OpRsh16Ux64 {
31818                                 continue
31819                         }
31820                         _ = v_1.Args[1]
31821                         if x != v_1.Args[0] {
31822                                 continue
31823                         }
31824                         v_1_1 := v_1.Args[1]
31825                         if v_1_1.Op != OpConst64 {
31826                                 continue
31827                         }
31828                         d := auxIntToInt64(v_1_1.AuxInt)
31829                         if !(c < 16 && d == 16-c && canRotate(config, 16)) {
31830                                 continue
31831                         }
31832                         v.reset(OpRotateLeft16)
31833                         v.AddArg2(x, z)
31834                         return true
31835                 }
31836                 break
31837         }
31838         // match: (Xor16 left:(Lsh16x64 x y) right:(Rsh16Ux64 x (Sub64 (Const64 [16]) y)))
31839         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
31840         // result: (RotateLeft16 x y)
31841         for {
31842                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
31843                         left := v_0
31844                         if left.Op != OpLsh16x64 {
31845                                 continue
31846                         }
31847                         y := left.Args[1]
31848                         x := left.Args[0]
31849                         right := v_1
31850                         if right.Op != OpRsh16Ux64 {
31851                                 continue
31852                         }
31853                         _ = right.Args[1]
31854                         if x != right.Args[0] {
31855                                 continue
31856                         }
31857                         right_1 := right.Args[1]
31858                         if right_1.Op != OpSub64 {
31859                                 continue
31860                         }
31861                         _ = right_1.Args[1]
31862                         right_1_0 := right_1.Args[0]
31863                         if right_1_0.Op != OpConst64 || auxIntToInt64(right_1_0.AuxInt) != 16 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
31864                                 continue
31865                         }
31866                         v.reset(OpRotateLeft16)
31867                         v.AddArg2(x, y)
31868                         return true
31869                 }
31870                 break
31871         }
31872         // match: (Xor16 left:(Lsh16x32 x y) right:(Rsh16Ux32 x (Sub32 (Const32 [16]) y)))
31873         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
31874         // result: (RotateLeft16 x y)
31875         for {
31876                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
31877                         left := v_0
31878                         if left.Op != OpLsh16x32 {
31879                                 continue
31880                         }
31881                         y := left.Args[1]
31882                         x := left.Args[0]
31883                         right := v_1
31884                         if right.Op != OpRsh16Ux32 {
31885                                 continue
31886                         }
31887                         _ = right.Args[1]
31888                         if x != right.Args[0] {
31889                                 continue
31890                         }
31891                         right_1 := right.Args[1]
31892                         if right_1.Op != OpSub32 {
31893                                 continue
31894                         }
31895                         _ = right_1.Args[1]
31896                         right_1_0 := right_1.Args[0]
31897                         if right_1_0.Op != OpConst32 || auxIntToInt32(right_1_0.AuxInt) != 16 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
31898                                 continue
31899                         }
31900                         v.reset(OpRotateLeft16)
31901                         v.AddArg2(x, y)
31902                         return true
31903                 }
31904                 break
31905         }
31906         // match: (Xor16 left:(Lsh16x16 x y) right:(Rsh16Ux16 x (Sub16 (Const16 [16]) y)))
31907         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
31908         // result: (RotateLeft16 x y)
31909         for {
31910                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
31911                         left := v_0
31912                         if left.Op != OpLsh16x16 {
31913                                 continue
31914                         }
31915                         y := left.Args[1]
31916                         x := left.Args[0]
31917                         right := v_1
31918                         if right.Op != OpRsh16Ux16 {
31919                                 continue
31920                         }
31921                         _ = right.Args[1]
31922                         if x != right.Args[0] {
31923                                 continue
31924                         }
31925                         right_1 := right.Args[1]
31926                         if right_1.Op != OpSub16 {
31927                                 continue
31928                         }
31929                         _ = right_1.Args[1]
31930                         right_1_0 := right_1.Args[0]
31931                         if right_1_0.Op != OpConst16 || auxIntToInt16(right_1_0.AuxInt) != 16 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
31932                                 continue
31933                         }
31934                         v.reset(OpRotateLeft16)
31935                         v.AddArg2(x, y)
31936                         return true
31937                 }
31938                 break
31939         }
31940         // match: (Xor16 left:(Lsh16x8 x y) right:(Rsh16Ux8 x (Sub8 (Const8 [16]) y)))
31941         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
31942         // result: (RotateLeft16 x y)
31943         for {
31944                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
31945                         left := v_0
31946                         if left.Op != OpLsh16x8 {
31947                                 continue
31948                         }
31949                         y := left.Args[1]
31950                         x := left.Args[0]
31951                         right := v_1
31952                         if right.Op != OpRsh16Ux8 {
31953                                 continue
31954                         }
31955                         _ = right.Args[1]
31956                         if x != right.Args[0] {
31957                                 continue
31958                         }
31959                         right_1 := right.Args[1]
31960                         if right_1.Op != OpSub8 {
31961                                 continue
31962                         }
31963                         _ = right_1.Args[1]
31964                         right_1_0 := right_1.Args[0]
31965                         if right_1_0.Op != OpConst8 || auxIntToInt8(right_1_0.AuxInt) != 16 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
31966                                 continue
31967                         }
31968                         v.reset(OpRotateLeft16)
31969                         v.AddArg2(x, y)
31970                         return true
31971                 }
31972                 break
31973         }
31974         // match: (Xor16 right:(Rsh16Ux64 x y) left:(Lsh16x64 x z:(Sub64 (Const64 [16]) y)))
31975         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
31976         // result: (RotateLeft16 x z)
31977         for {
31978                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
31979                         right := v_0
31980                         if right.Op != OpRsh16Ux64 {
31981                                 continue
31982                         }
31983                         y := right.Args[1]
31984                         x := right.Args[0]
31985                         left := v_1
31986                         if left.Op != OpLsh16x64 {
31987                                 continue
31988                         }
31989                         _ = left.Args[1]
31990                         if x != left.Args[0] {
31991                                 continue
31992                         }
31993                         z := left.Args[1]
31994                         if z.Op != OpSub64 {
31995                                 continue
31996                         }
31997                         _ = z.Args[1]
31998                         z_0 := z.Args[0]
31999                         if z_0.Op != OpConst64 || auxIntToInt64(z_0.AuxInt) != 16 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
32000                                 continue
32001                         }
32002                         v.reset(OpRotateLeft16)
32003                         v.AddArg2(x, z)
32004                         return true
32005                 }
32006                 break
32007         }
32008         // match: (Xor16 right:(Rsh16Ux32 x y) left:(Lsh16x32 x z:(Sub32 (Const32 [16]) y)))
32009         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
32010         // result: (RotateLeft16 x z)
32011         for {
32012                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32013                         right := v_0
32014                         if right.Op != OpRsh16Ux32 {
32015                                 continue
32016                         }
32017                         y := right.Args[1]
32018                         x := right.Args[0]
32019                         left := v_1
32020                         if left.Op != OpLsh16x32 {
32021                                 continue
32022                         }
32023                         _ = left.Args[1]
32024                         if x != left.Args[0] {
32025                                 continue
32026                         }
32027                         z := left.Args[1]
32028                         if z.Op != OpSub32 {
32029                                 continue
32030                         }
32031                         _ = z.Args[1]
32032                         z_0 := z.Args[0]
32033                         if z_0.Op != OpConst32 || auxIntToInt32(z_0.AuxInt) != 16 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
32034                                 continue
32035                         }
32036                         v.reset(OpRotateLeft16)
32037                         v.AddArg2(x, z)
32038                         return true
32039                 }
32040                 break
32041         }
32042         // match: (Xor16 right:(Rsh16Ux16 x y) left:(Lsh16x16 x z:(Sub16 (Const16 [16]) y)))
32043         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
32044         // result: (RotateLeft16 x z)
32045         for {
32046                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32047                         right := v_0
32048                         if right.Op != OpRsh16Ux16 {
32049                                 continue
32050                         }
32051                         y := right.Args[1]
32052                         x := right.Args[0]
32053                         left := v_1
32054                         if left.Op != OpLsh16x16 {
32055                                 continue
32056                         }
32057                         _ = left.Args[1]
32058                         if x != left.Args[0] {
32059                                 continue
32060                         }
32061                         z := left.Args[1]
32062                         if z.Op != OpSub16 {
32063                                 continue
32064                         }
32065                         _ = z.Args[1]
32066                         z_0 := z.Args[0]
32067                         if z_0.Op != OpConst16 || auxIntToInt16(z_0.AuxInt) != 16 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
32068                                 continue
32069                         }
32070                         v.reset(OpRotateLeft16)
32071                         v.AddArg2(x, z)
32072                         return true
32073                 }
32074                 break
32075         }
32076         // match: (Xor16 right:(Rsh16Ux8 x y) left:(Lsh16x8 x z:(Sub8 (Const8 [16]) y)))
32077         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)
32078         // result: (RotateLeft16 x z)
32079         for {
32080                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32081                         right := v_0
32082                         if right.Op != OpRsh16Ux8 {
32083                                 continue
32084                         }
32085                         y := right.Args[1]
32086                         x := right.Args[0]
32087                         left := v_1
32088                         if left.Op != OpLsh16x8 {
32089                                 continue
32090                         }
32091                         _ = left.Args[1]
32092                         if x != left.Args[0] {
32093                                 continue
32094                         }
32095                         z := left.Args[1]
32096                         if z.Op != OpSub8 {
32097                                 continue
32098                         }
32099                         _ = z.Args[1]
32100                         z_0 := z.Args[0]
32101                         if z_0.Op != OpConst8 || auxIntToInt8(z_0.AuxInt) != 16 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 16)) {
32102                                 continue
32103                         }
32104                         v.reset(OpRotateLeft16)
32105                         v.AddArg2(x, z)
32106                         return true
32107                 }
32108                 break
32109         }
32110         return false
32111 }
32112 func rewriteValuegeneric_OpXor32(v *Value) bool {
32113         v_1 := v.Args[1]
32114         v_0 := v.Args[0]
32115         b := v.Block
32116         config := b.Func.Config
32117         // match: (Xor32 (Const32 [c]) (Const32 [d]))
32118         // result: (Const32 [c^d])
32119         for {
32120                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32121                         if v_0.Op != OpConst32 {
32122                                 continue
32123                         }
32124                         c := auxIntToInt32(v_0.AuxInt)
32125                         if v_1.Op != OpConst32 {
32126                                 continue
32127                         }
32128                         d := auxIntToInt32(v_1.AuxInt)
32129                         v.reset(OpConst32)
32130                         v.AuxInt = int32ToAuxInt(c ^ d)
32131                         return true
32132                 }
32133                 break
32134         }
32135         // match: (Xor32 x x)
32136         // result: (Const32 [0])
32137         for {
32138                 x := v_0
32139                 if x != v_1 {
32140                         break
32141                 }
32142                 v.reset(OpConst32)
32143                 v.AuxInt = int32ToAuxInt(0)
32144                 return true
32145         }
32146         // match: (Xor32 (Const32 [0]) x)
32147         // result: x
32148         for {
32149                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32150                         if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != 0 {
32151                                 continue
32152                         }
32153                         x := v_1
32154                         v.copyOf(x)
32155                         return true
32156                 }
32157                 break
32158         }
32159         // match: (Xor32 (Com32 x) x)
32160         // result: (Const32 [-1])
32161         for {
32162                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32163                         if v_0.Op != OpCom32 {
32164                                 continue
32165                         }
32166                         x := v_0.Args[0]
32167                         if x != v_1 {
32168                                 continue
32169                         }
32170                         v.reset(OpConst32)
32171                         v.AuxInt = int32ToAuxInt(-1)
32172                         return true
32173                 }
32174                 break
32175         }
32176         // match: (Xor32 (Const32 [-1]) x)
32177         // result: (Com32 x)
32178         for {
32179                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32180                         if v_0.Op != OpConst32 || auxIntToInt32(v_0.AuxInt) != -1 {
32181                                 continue
32182                         }
32183                         x := v_1
32184                         v.reset(OpCom32)
32185                         v.AddArg(x)
32186                         return true
32187                 }
32188                 break
32189         }
32190         // match: (Xor32 x (Xor32 x y))
32191         // result: y
32192         for {
32193                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32194                         x := v_0
32195                         if v_1.Op != OpXor32 {
32196                                 continue
32197                         }
32198                         _ = v_1.Args[1]
32199                         v_1_0 := v_1.Args[0]
32200                         v_1_1 := v_1.Args[1]
32201                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
32202                                 if x != v_1_0 {
32203                                         continue
32204                                 }
32205                                 y := v_1_1
32206                                 v.copyOf(y)
32207                                 return true
32208                         }
32209                 }
32210                 break
32211         }
32212         // match: (Xor32 (Xor32 i:(Const32 <t>) z) x)
32213         // cond: (z.Op != OpConst32 && x.Op != OpConst32)
32214         // result: (Xor32 i (Xor32 <t> z x))
32215         for {
32216                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32217                         if v_0.Op != OpXor32 {
32218                                 continue
32219                         }
32220                         _ = v_0.Args[1]
32221                         v_0_0 := v_0.Args[0]
32222                         v_0_1 := v_0.Args[1]
32223                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
32224                                 i := v_0_0
32225                                 if i.Op != OpConst32 {
32226                                         continue
32227                                 }
32228                                 t := i.Type
32229                                 z := v_0_1
32230                                 x := v_1
32231                                 if !(z.Op != OpConst32 && x.Op != OpConst32) {
32232                                         continue
32233                                 }
32234                                 v.reset(OpXor32)
32235                                 v0 := b.NewValue0(v.Pos, OpXor32, t)
32236                                 v0.AddArg2(z, x)
32237                                 v.AddArg2(i, v0)
32238                                 return true
32239                         }
32240                 }
32241                 break
32242         }
32243         // match: (Xor32 (Const32 <t> [c]) (Xor32 (Const32 <t> [d]) x))
32244         // result: (Xor32 (Const32 <t> [c^d]) x)
32245         for {
32246                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32247                         if v_0.Op != OpConst32 {
32248                                 continue
32249                         }
32250                         t := v_0.Type
32251                         c := auxIntToInt32(v_0.AuxInt)
32252                         if v_1.Op != OpXor32 {
32253                                 continue
32254                         }
32255                         _ = v_1.Args[1]
32256                         v_1_0 := v_1.Args[0]
32257                         v_1_1 := v_1.Args[1]
32258                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
32259                                 if v_1_0.Op != OpConst32 || v_1_0.Type != t {
32260                                         continue
32261                                 }
32262                                 d := auxIntToInt32(v_1_0.AuxInt)
32263                                 x := v_1_1
32264                                 v.reset(OpXor32)
32265                                 v0 := b.NewValue0(v.Pos, OpConst32, t)
32266                                 v0.AuxInt = int32ToAuxInt(c ^ d)
32267                                 v.AddArg2(v0, x)
32268                                 return true
32269                         }
32270                 }
32271                 break
32272         }
32273         // match: (Xor32 (Lsh32x64 x z:(Const64 <t> [c])) (Rsh32Ux64 x (Const64 [d])))
32274         // cond: c < 32 && d == 32-c && canRotate(config, 32)
32275         // result: (RotateLeft32 x z)
32276         for {
32277                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32278                         if v_0.Op != OpLsh32x64 {
32279                                 continue
32280                         }
32281                         _ = v_0.Args[1]
32282                         x := v_0.Args[0]
32283                         z := v_0.Args[1]
32284                         if z.Op != OpConst64 {
32285                                 continue
32286                         }
32287                         c := auxIntToInt64(z.AuxInt)
32288                         if v_1.Op != OpRsh32Ux64 {
32289                                 continue
32290                         }
32291                         _ = v_1.Args[1]
32292                         if x != v_1.Args[0] {
32293                                 continue
32294                         }
32295                         v_1_1 := v_1.Args[1]
32296                         if v_1_1.Op != OpConst64 {
32297                                 continue
32298                         }
32299                         d := auxIntToInt64(v_1_1.AuxInt)
32300                         if !(c < 32 && d == 32-c && canRotate(config, 32)) {
32301                                 continue
32302                         }
32303                         v.reset(OpRotateLeft32)
32304                         v.AddArg2(x, z)
32305                         return true
32306                 }
32307                 break
32308         }
32309         // match: (Xor32 left:(Lsh32x64 x y) right:(Rsh32Ux64 x (Sub64 (Const64 [32]) y)))
32310         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
32311         // result: (RotateLeft32 x y)
32312         for {
32313                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32314                         left := v_0
32315                         if left.Op != OpLsh32x64 {
32316                                 continue
32317                         }
32318                         y := left.Args[1]
32319                         x := left.Args[0]
32320                         right := v_1
32321                         if right.Op != OpRsh32Ux64 {
32322                                 continue
32323                         }
32324                         _ = right.Args[1]
32325                         if x != right.Args[0] {
32326                                 continue
32327                         }
32328                         right_1 := right.Args[1]
32329                         if right_1.Op != OpSub64 {
32330                                 continue
32331                         }
32332                         _ = right_1.Args[1]
32333                         right_1_0 := right_1.Args[0]
32334                         if right_1_0.Op != OpConst64 || auxIntToInt64(right_1_0.AuxInt) != 32 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
32335                                 continue
32336                         }
32337                         v.reset(OpRotateLeft32)
32338                         v.AddArg2(x, y)
32339                         return true
32340                 }
32341                 break
32342         }
32343         // match: (Xor32 left:(Lsh32x32 x y) right:(Rsh32Ux32 x (Sub32 (Const32 [32]) y)))
32344         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
32345         // result: (RotateLeft32 x y)
32346         for {
32347                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32348                         left := v_0
32349                         if left.Op != OpLsh32x32 {
32350                                 continue
32351                         }
32352                         y := left.Args[1]
32353                         x := left.Args[0]
32354                         right := v_1
32355                         if right.Op != OpRsh32Ux32 {
32356                                 continue
32357                         }
32358                         _ = right.Args[1]
32359                         if x != right.Args[0] {
32360                                 continue
32361                         }
32362                         right_1 := right.Args[1]
32363                         if right_1.Op != OpSub32 {
32364                                 continue
32365                         }
32366                         _ = right_1.Args[1]
32367                         right_1_0 := right_1.Args[0]
32368                         if right_1_0.Op != OpConst32 || auxIntToInt32(right_1_0.AuxInt) != 32 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
32369                                 continue
32370                         }
32371                         v.reset(OpRotateLeft32)
32372                         v.AddArg2(x, y)
32373                         return true
32374                 }
32375                 break
32376         }
32377         // match: (Xor32 left:(Lsh32x16 x y) right:(Rsh32Ux16 x (Sub16 (Const16 [32]) y)))
32378         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
32379         // result: (RotateLeft32 x y)
32380         for {
32381                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32382                         left := v_0
32383                         if left.Op != OpLsh32x16 {
32384                                 continue
32385                         }
32386                         y := left.Args[1]
32387                         x := left.Args[0]
32388                         right := v_1
32389                         if right.Op != OpRsh32Ux16 {
32390                                 continue
32391                         }
32392                         _ = right.Args[1]
32393                         if x != right.Args[0] {
32394                                 continue
32395                         }
32396                         right_1 := right.Args[1]
32397                         if right_1.Op != OpSub16 {
32398                                 continue
32399                         }
32400                         _ = right_1.Args[1]
32401                         right_1_0 := right_1.Args[0]
32402                         if right_1_0.Op != OpConst16 || auxIntToInt16(right_1_0.AuxInt) != 32 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
32403                                 continue
32404                         }
32405                         v.reset(OpRotateLeft32)
32406                         v.AddArg2(x, y)
32407                         return true
32408                 }
32409                 break
32410         }
32411         // match: (Xor32 left:(Lsh32x8 x y) right:(Rsh32Ux8 x (Sub8 (Const8 [32]) y)))
32412         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
32413         // result: (RotateLeft32 x y)
32414         for {
32415                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32416                         left := v_0
32417                         if left.Op != OpLsh32x8 {
32418                                 continue
32419                         }
32420                         y := left.Args[1]
32421                         x := left.Args[0]
32422                         right := v_1
32423                         if right.Op != OpRsh32Ux8 {
32424                                 continue
32425                         }
32426                         _ = right.Args[1]
32427                         if x != right.Args[0] {
32428                                 continue
32429                         }
32430                         right_1 := right.Args[1]
32431                         if right_1.Op != OpSub8 {
32432                                 continue
32433                         }
32434                         _ = right_1.Args[1]
32435                         right_1_0 := right_1.Args[0]
32436                         if right_1_0.Op != OpConst8 || auxIntToInt8(right_1_0.AuxInt) != 32 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
32437                                 continue
32438                         }
32439                         v.reset(OpRotateLeft32)
32440                         v.AddArg2(x, y)
32441                         return true
32442                 }
32443                 break
32444         }
32445         // match: (Xor32 right:(Rsh32Ux64 x y) left:(Lsh32x64 x z:(Sub64 (Const64 [32]) y)))
32446         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
32447         // result: (RotateLeft32 x z)
32448         for {
32449                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32450                         right := v_0
32451                         if right.Op != OpRsh32Ux64 {
32452                                 continue
32453                         }
32454                         y := right.Args[1]
32455                         x := right.Args[0]
32456                         left := v_1
32457                         if left.Op != OpLsh32x64 {
32458                                 continue
32459                         }
32460                         _ = left.Args[1]
32461                         if x != left.Args[0] {
32462                                 continue
32463                         }
32464                         z := left.Args[1]
32465                         if z.Op != OpSub64 {
32466                                 continue
32467                         }
32468                         _ = z.Args[1]
32469                         z_0 := z.Args[0]
32470                         if z_0.Op != OpConst64 || auxIntToInt64(z_0.AuxInt) != 32 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
32471                                 continue
32472                         }
32473                         v.reset(OpRotateLeft32)
32474                         v.AddArg2(x, z)
32475                         return true
32476                 }
32477                 break
32478         }
32479         // match: (Xor32 right:(Rsh32Ux32 x y) left:(Lsh32x32 x z:(Sub32 (Const32 [32]) y)))
32480         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
32481         // result: (RotateLeft32 x z)
32482         for {
32483                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32484                         right := v_0
32485                         if right.Op != OpRsh32Ux32 {
32486                                 continue
32487                         }
32488                         y := right.Args[1]
32489                         x := right.Args[0]
32490                         left := v_1
32491                         if left.Op != OpLsh32x32 {
32492                                 continue
32493                         }
32494                         _ = left.Args[1]
32495                         if x != left.Args[0] {
32496                                 continue
32497                         }
32498                         z := left.Args[1]
32499                         if z.Op != OpSub32 {
32500                                 continue
32501                         }
32502                         _ = z.Args[1]
32503                         z_0 := z.Args[0]
32504                         if z_0.Op != OpConst32 || auxIntToInt32(z_0.AuxInt) != 32 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
32505                                 continue
32506                         }
32507                         v.reset(OpRotateLeft32)
32508                         v.AddArg2(x, z)
32509                         return true
32510                 }
32511                 break
32512         }
32513         // match: (Xor32 right:(Rsh32Ux16 x y) left:(Lsh32x16 x z:(Sub16 (Const16 [32]) y)))
32514         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
32515         // result: (RotateLeft32 x z)
32516         for {
32517                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32518                         right := v_0
32519                         if right.Op != OpRsh32Ux16 {
32520                                 continue
32521                         }
32522                         y := right.Args[1]
32523                         x := right.Args[0]
32524                         left := v_1
32525                         if left.Op != OpLsh32x16 {
32526                                 continue
32527                         }
32528                         _ = left.Args[1]
32529                         if x != left.Args[0] {
32530                                 continue
32531                         }
32532                         z := left.Args[1]
32533                         if z.Op != OpSub16 {
32534                                 continue
32535                         }
32536                         _ = z.Args[1]
32537                         z_0 := z.Args[0]
32538                         if z_0.Op != OpConst16 || auxIntToInt16(z_0.AuxInt) != 32 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
32539                                 continue
32540                         }
32541                         v.reset(OpRotateLeft32)
32542                         v.AddArg2(x, z)
32543                         return true
32544                 }
32545                 break
32546         }
32547         // match: (Xor32 right:(Rsh32Ux8 x y) left:(Lsh32x8 x z:(Sub8 (Const8 [32]) y)))
32548         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)
32549         // result: (RotateLeft32 x z)
32550         for {
32551                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32552                         right := v_0
32553                         if right.Op != OpRsh32Ux8 {
32554                                 continue
32555                         }
32556                         y := right.Args[1]
32557                         x := right.Args[0]
32558                         left := v_1
32559                         if left.Op != OpLsh32x8 {
32560                                 continue
32561                         }
32562                         _ = left.Args[1]
32563                         if x != left.Args[0] {
32564                                 continue
32565                         }
32566                         z := left.Args[1]
32567                         if z.Op != OpSub8 {
32568                                 continue
32569                         }
32570                         _ = z.Args[1]
32571                         z_0 := z.Args[0]
32572                         if z_0.Op != OpConst8 || auxIntToInt8(z_0.AuxInt) != 32 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 32)) {
32573                                 continue
32574                         }
32575                         v.reset(OpRotateLeft32)
32576                         v.AddArg2(x, z)
32577                         return true
32578                 }
32579                 break
32580         }
32581         return false
32582 }
32583 func rewriteValuegeneric_OpXor64(v *Value) bool {
32584         v_1 := v.Args[1]
32585         v_0 := v.Args[0]
32586         b := v.Block
32587         config := b.Func.Config
32588         // match: (Xor64 (Const64 [c]) (Const64 [d]))
32589         // result: (Const64 [c^d])
32590         for {
32591                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32592                         if v_0.Op != OpConst64 {
32593                                 continue
32594                         }
32595                         c := auxIntToInt64(v_0.AuxInt)
32596                         if v_1.Op != OpConst64 {
32597                                 continue
32598                         }
32599                         d := auxIntToInt64(v_1.AuxInt)
32600                         v.reset(OpConst64)
32601                         v.AuxInt = int64ToAuxInt(c ^ d)
32602                         return true
32603                 }
32604                 break
32605         }
32606         // match: (Xor64 x x)
32607         // result: (Const64 [0])
32608         for {
32609                 x := v_0
32610                 if x != v_1 {
32611                         break
32612                 }
32613                 v.reset(OpConst64)
32614                 v.AuxInt = int64ToAuxInt(0)
32615                 return true
32616         }
32617         // match: (Xor64 (Const64 [0]) x)
32618         // result: x
32619         for {
32620                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32621                         if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != 0 {
32622                                 continue
32623                         }
32624                         x := v_1
32625                         v.copyOf(x)
32626                         return true
32627                 }
32628                 break
32629         }
32630         // match: (Xor64 (Com64 x) x)
32631         // result: (Const64 [-1])
32632         for {
32633                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32634                         if v_0.Op != OpCom64 {
32635                                 continue
32636                         }
32637                         x := v_0.Args[0]
32638                         if x != v_1 {
32639                                 continue
32640                         }
32641                         v.reset(OpConst64)
32642                         v.AuxInt = int64ToAuxInt(-1)
32643                         return true
32644                 }
32645                 break
32646         }
32647         // match: (Xor64 (Const64 [-1]) x)
32648         // result: (Com64 x)
32649         for {
32650                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32651                         if v_0.Op != OpConst64 || auxIntToInt64(v_0.AuxInt) != -1 {
32652                                 continue
32653                         }
32654                         x := v_1
32655                         v.reset(OpCom64)
32656                         v.AddArg(x)
32657                         return true
32658                 }
32659                 break
32660         }
32661         // match: (Xor64 x (Xor64 x y))
32662         // result: y
32663         for {
32664                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32665                         x := v_0
32666                         if v_1.Op != OpXor64 {
32667                                 continue
32668                         }
32669                         _ = v_1.Args[1]
32670                         v_1_0 := v_1.Args[0]
32671                         v_1_1 := v_1.Args[1]
32672                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
32673                                 if x != v_1_0 {
32674                                         continue
32675                                 }
32676                                 y := v_1_1
32677                                 v.copyOf(y)
32678                                 return true
32679                         }
32680                 }
32681                 break
32682         }
32683         // match: (Xor64 (Xor64 i:(Const64 <t>) z) x)
32684         // cond: (z.Op != OpConst64 && x.Op != OpConst64)
32685         // result: (Xor64 i (Xor64 <t> z x))
32686         for {
32687                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32688                         if v_0.Op != OpXor64 {
32689                                 continue
32690                         }
32691                         _ = v_0.Args[1]
32692                         v_0_0 := v_0.Args[0]
32693                         v_0_1 := v_0.Args[1]
32694                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
32695                                 i := v_0_0
32696                                 if i.Op != OpConst64 {
32697                                         continue
32698                                 }
32699                                 t := i.Type
32700                                 z := v_0_1
32701                                 x := v_1
32702                                 if !(z.Op != OpConst64 && x.Op != OpConst64) {
32703                                         continue
32704                                 }
32705                                 v.reset(OpXor64)
32706                                 v0 := b.NewValue0(v.Pos, OpXor64, t)
32707                                 v0.AddArg2(z, x)
32708                                 v.AddArg2(i, v0)
32709                                 return true
32710                         }
32711                 }
32712                 break
32713         }
32714         // match: (Xor64 (Const64 <t> [c]) (Xor64 (Const64 <t> [d]) x))
32715         // result: (Xor64 (Const64 <t> [c^d]) x)
32716         for {
32717                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32718                         if v_0.Op != OpConst64 {
32719                                 continue
32720                         }
32721                         t := v_0.Type
32722                         c := auxIntToInt64(v_0.AuxInt)
32723                         if v_1.Op != OpXor64 {
32724                                 continue
32725                         }
32726                         _ = v_1.Args[1]
32727                         v_1_0 := v_1.Args[0]
32728                         v_1_1 := v_1.Args[1]
32729                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
32730                                 if v_1_0.Op != OpConst64 || v_1_0.Type != t {
32731                                         continue
32732                                 }
32733                                 d := auxIntToInt64(v_1_0.AuxInt)
32734                                 x := v_1_1
32735                                 v.reset(OpXor64)
32736                                 v0 := b.NewValue0(v.Pos, OpConst64, t)
32737                                 v0.AuxInt = int64ToAuxInt(c ^ d)
32738                                 v.AddArg2(v0, x)
32739                                 return true
32740                         }
32741                 }
32742                 break
32743         }
32744         // match: (Xor64 (Lsh64x64 x z:(Const64 <t> [c])) (Rsh64Ux64 x (Const64 [d])))
32745         // cond: c < 64 && d == 64-c && canRotate(config, 64)
32746         // result: (RotateLeft64 x z)
32747         for {
32748                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32749                         if v_0.Op != OpLsh64x64 {
32750                                 continue
32751                         }
32752                         _ = v_0.Args[1]
32753                         x := v_0.Args[0]
32754                         z := v_0.Args[1]
32755                         if z.Op != OpConst64 {
32756                                 continue
32757                         }
32758                         c := auxIntToInt64(z.AuxInt)
32759                         if v_1.Op != OpRsh64Ux64 {
32760                                 continue
32761                         }
32762                         _ = v_1.Args[1]
32763                         if x != v_1.Args[0] {
32764                                 continue
32765                         }
32766                         v_1_1 := v_1.Args[1]
32767                         if v_1_1.Op != OpConst64 {
32768                                 continue
32769                         }
32770                         d := auxIntToInt64(v_1_1.AuxInt)
32771                         if !(c < 64 && d == 64-c && canRotate(config, 64)) {
32772                                 continue
32773                         }
32774                         v.reset(OpRotateLeft64)
32775                         v.AddArg2(x, z)
32776                         return true
32777                 }
32778                 break
32779         }
32780         // match: (Xor64 left:(Lsh64x64 x y) right:(Rsh64Ux64 x (Sub64 (Const64 [64]) y)))
32781         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
32782         // result: (RotateLeft64 x y)
32783         for {
32784                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32785                         left := v_0
32786                         if left.Op != OpLsh64x64 {
32787                                 continue
32788                         }
32789                         y := left.Args[1]
32790                         x := left.Args[0]
32791                         right := v_1
32792                         if right.Op != OpRsh64Ux64 {
32793                                 continue
32794                         }
32795                         _ = right.Args[1]
32796                         if x != right.Args[0] {
32797                                 continue
32798                         }
32799                         right_1 := right.Args[1]
32800                         if right_1.Op != OpSub64 {
32801                                 continue
32802                         }
32803                         _ = right_1.Args[1]
32804                         right_1_0 := right_1.Args[0]
32805                         if right_1_0.Op != OpConst64 || auxIntToInt64(right_1_0.AuxInt) != 64 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
32806                                 continue
32807                         }
32808                         v.reset(OpRotateLeft64)
32809                         v.AddArg2(x, y)
32810                         return true
32811                 }
32812                 break
32813         }
32814         // match: (Xor64 left:(Lsh64x32 x y) right:(Rsh64Ux32 x (Sub32 (Const32 [64]) y)))
32815         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
32816         // result: (RotateLeft64 x y)
32817         for {
32818                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32819                         left := v_0
32820                         if left.Op != OpLsh64x32 {
32821                                 continue
32822                         }
32823                         y := left.Args[1]
32824                         x := left.Args[0]
32825                         right := v_1
32826                         if right.Op != OpRsh64Ux32 {
32827                                 continue
32828                         }
32829                         _ = right.Args[1]
32830                         if x != right.Args[0] {
32831                                 continue
32832                         }
32833                         right_1 := right.Args[1]
32834                         if right_1.Op != OpSub32 {
32835                                 continue
32836                         }
32837                         _ = right_1.Args[1]
32838                         right_1_0 := right_1.Args[0]
32839                         if right_1_0.Op != OpConst32 || auxIntToInt32(right_1_0.AuxInt) != 64 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
32840                                 continue
32841                         }
32842                         v.reset(OpRotateLeft64)
32843                         v.AddArg2(x, y)
32844                         return true
32845                 }
32846                 break
32847         }
32848         // match: (Xor64 left:(Lsh64x16 x y) right:(Rsh64Ux16 x (Sub16 (Const16 [64]) y)))
32849         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
32850         // result: (RotateLeft64 x y)
32851         for {
32852                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32853                         left := v_0
32854                         if left.Op != OpLsh64x16 {
32855                                 continue
32856                         }
32857                         y := left.Args[1]
32858                         x := left.Args[0]
32859                         right := v_1
32860                         if right.Op != OpRsh64Ux16 {
32861                                 continue
32862                         }
32863                         _ = right.Args[1]
32864                         if x != right.Args[0] {
32865                                 continue
32866                         }
32867                         right_1 := right.Args[1]
32868                         if right_1.Op != OpSub16 {
32869                                 continue
32870                         }
32871                         _ = right_1.Args[1]
32872                         right_1_0 := right_1.Args[0]
32873                         if right_1_0.Op != OpConst16 || auxIntToInt16(right_1_0.AuxInt) != 64 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
32874                                 continue
32875                         }
32876                         v.reset(OpRotateLeft64)
32877                         v.AddArg2(x, y)
32878                         return true
32879                 }
32880                 break
32881         }
32882         // match: (Xor64 left:(Lsh64x8 x y) right:(Rsh64Ux8 x (Sub8 (Const8 [64]) y)))
32883         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
32884         // result: (RotateLeft64 x y)
32885         for {
32886                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32887                         left := v_0
32888                         if left.Op != OpLsh64x8 {
32889                                 continue
32890                         }
32891                         y := left.Args[1]
32892                         x := left.Args[0]
32893                         right := v_1
32894                         if right.Op != OpRsh64Ux8 {
32895                                 continue
32896                         }
32897                         _ = right.Args[1]
32898                         if x != right.Args[0] {
32899                                 continue
32900                         }
32901                         right_1 := right.Args[1]
32902                         if right_1.Op != OpSub8 {
32903                                 continue
32904                         }
32905                         _ = right_1.Args[1]
32906                         right_1_0 := right_1.Args[0]
32907                         if right_1_0.Op != OpConst8 || auxIntToInt8(right_1_0.AuxInt) != 64 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
32908                                 continue
32909                         }
32910                         v.reset(OpRotateLeft64)
32911                         v.AddArg2(x, y)
32912                         return true
32913                 }
32914                 break
32915         }
32916         // match: (Xor64 right:(Rsh64Ux64 x y) left:(Lsh64x64 x z:(Sub64 (Const64 [64]) y)))
32917         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
32918         // result: (RotateLeft64 x z)
32919         for {
32920                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32921                         right := v_0
32922                         if right.Op != OpRsh64Ux64 {
32923                                 continue
32924                         }
32925                         y := right.Args[1]
32926                         x := right.Args[0]
32927                         left := v_1
32928                         if left.Op != OpLsh64x64 {
32929                                 continue
32930                         }
32931                         _ = left.Args[1]
32932                         if x != left.Args[0] {
32933                                 continue
32934                         }
32935                         z := left.Args[1]
32936                         if z.Op != OpSub64 {
32937                                 continue
32938                         }
32939                         _ = z.Args[1]
32940                         z_0 := z.Args[0]
32941                         if z_0.Op != OpConst64 || auxIntToInt64(z_0.AuxInt) != 64 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
32942                                 continue
32943                         }
32944                         v.reset(OpRotateLeft64)
32945                         v.AddArg2(x, z)
32946                         return true
32947                 }
32948                 break
32949         }
32950         // match: (Xor64 right:(Rsh64Ux32 x y) left:(Lsh64x32 x z:(Sub32 (Const32 [64]) y)))
32951         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
32952         // result: (RotateLeft64 x z)
32953         for {
32954                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32955                         right := v_0
32956                         if right.Op != OpRsh64Ux32 {
32957                                 continue
32958                         }
32959                         y := right.Args[1]
32960                         x := right.Args[0]
32961                         left := v_1
32962                         if left.Op != OpLsh64x32 {
32963                                 continue
32964                         }
32965                         _ = left.Args[1]
32966                         if x != left.Args[0] {
32967                                 continue
32968                         }
32969                         z := left.Args[1]
32970                         if z.Op != OpSub32 {
32971                                 continue
32972                         }
32973                         _ = z.Args[1]
32974                         z_0 := z.Args[0]
32975                         if z_0.Op != OpConst32 || auxIntToInt32(z_0.AuxInt) != 64 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
32976                                 continue
32977                         }
32978                         v.reset(OpRotateLeft64)
32979                         v.AddArg2(x, z)
32980                         return true
32981                 }
32982                 break
32983         }
32984         // match: (Xor64 right:(Rsh64Ux16 x y) left:(Lsh64x16 x z:(Sub16 (Const16 [64]) y)))
32985         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
32986         // result: (RotateLeft64 x z)
32987         for {
32988                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
32989                         right := v_0
32990                         if right.Op != OpRsh64Ux16 {
32991                                 continue
32992                         }
32993                         y := right.Args[1]
32994                         x := right.Args[0]
32995                         left := v_1
32996                         if left.Op != OpLsh64x16 {
32997                                 continue
32998                         }
32999                         _ = left.Args[1]
33000                         if x != left.Args[0] {
33001                                 continue
33002                         }
33003                         z := left.Args[1]
33004                         if z.Op != OpSub16 {
33005                                 continue
33006                         }
33007                         _ = z.Args[1]
33008                         z_0 := z.Args[0]
33009                         if z_0.Op != OpConst16 || auxIntToInt16(z_0.AuxInt) != 64 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
33010                                 continue
33011                         }
33012                         v.reset(OpRotateLeft64)
33013                         v.AddArg2(x, z)
33014                         return true
33015                 }
33016                 break
33017         }
33018         // match: (Xor64 right:(Rsh64Ux8 x y) left:(Lsh64x8 x z:(Sub8 (Const8 [64]) y)))
33019         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)
33020         // result: (RotateLeft64 x z)
33021         for {
33022                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33023                         right := v_0
33024                         if right.Op != OpRsh64Ux8 {
33025                                 continue
33026                         }
33027                         y := right.Args[1]
33028                         x := right.Args[0]
33029                         left := v_1
33030                         if left.Op != OpLsh64x8 {
33031                                 continue
33032                         }
33033                         _ = left.Args[1]
33034                         if x != left.Args[0] {
33035                                 continue
33036                         }
33037                         z := left.Args[1]
33038                         if z.Op != OpSub8 {
33039                                 continue
33040                         }
33041                         _ = z.Args[1]
33042                         z_0 := z.Args[0]
33043                         if z_0.Op != OpConst8 || auxIntToInt8(z_0.AuxInt) != 64 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 64)) {
33044                                 continue
33045                         }
33046                         v.reset(OpRotateLeft64)
33047                         v.AddArg2(x, z)
33048                         return true
33049                 }
33050                 break
33051         }
33052         return false
33053 }
33054 func rewriteValuegeneric_OpXor8(v *Value) bool {
33055         v_1 := v.Args[1]
33056         v_0 := v.Args[0]
33057         b := v.Block
33058         config := b.Func.Config
33059         // match: (Xor8 (Const8 [c]) (Const8 [d]))
33060         // result: (Const8 [c^d])
33061         for {
33062                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33063                         if v_0.Op != OpConst8 {
33064                                 continue
33065                         }
33066                         c := auxIntToInt8(v_0.AuxInt)
33067                         if v_1.Op != OpConst8 {
33068                                 continue
33069                         }
33070                         d := auxIntToInt8(v_1.AuxInt)
33071                         v.reset(OpConst8)
33072                         v.AuxInt = int8ToAuxInt(c ^ d)
33073                         return true
33074                 }
33075                 break
33076         }
33077         // match: (Xor8 x x)
33078         // result: (Const8 [0])
33079         for {
33080                 x := v_0
33081                 if x != v_1 {
33082                         break
33083                 }
33084                 v.reset(OpConst8)
33085                 v.AuxInt = int8ToAuxInt(0)
33086                 return true
33087         }
33088         // match: (Xor8 (Const8 [0]) x)
33089         // result: x
33090         for {
33091                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33092                         if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != 0 {
33093                                 continue
33094                         }
33095                         x := v_1
33096                         v.copyOf(x)
33097                         return true
33098                 }
33099                 break
33100         }
33101         // match: (Xor8 (Com8 x) x)
33102         // result: (Const8 [-1])
33103         for {
33104                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33105                         if v_0.Op != OpCom8 {
33106                                 continue
33107                         }
33108                         x := v_0.Args[0]
33109                         if x != v_1 {
33110                                 continue
33111                         }
33112                         v.reset(OpConst8)
33113                         v.AuxInt = int8ToAuxInt(-1)
33114                         return true
33115                 }
33116                 break
33117         }
33118         // match: (Xor8 (Const8 [-1]) x)
33119         // result: (Com8 x)
33120         for {
33121                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33122                         if v_0.Op != OpConst8 || auxIntToInt8(v_0.AuxInt) != -1 {
33123                                 continue
33124                         }
33125                         x := v_1
33126                         v.reset(OpCom8)
33127                         v.AddArg(x)
33128                         return true
33129                 }
33130                 break
33131         }
33132         // match: (Xor8 x (Xor8 x y))
33133         // result: y
33134         for {
33135                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33136                         x := v_0
33137                         if v_1.Op != OpXor8 {
33138                                 continue
33139                         }
33140                         _ = v_1.Args[1]
33141                         v_1_0 := v_1.Args[0]
33142                         v_1_1 := v_1.Args[1]
33143                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
33144                                 if x != v_1_0 {
33145                                         continue
33146                                 }
33147                                 y := v_1_1
33148                                 v.copyOf(y)
33149                                 return true
33150                         }
33151                 }
33152                 break
33153         }
33154         // match: (Xor8 (Xor8 i:(Const8 <t>) z) x)
33155         // cond: (z.Op != OpConst8 && x.Op != OpConst8)
33156         // result: (Xor8 i (Xor8 <t> z x))
33157         for {
33158                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33159                         if v_0.Op != OpXor8 {
33160                                 continue
33161                         }
33162                         _ = v_0.Args[1]
33163                         v_0_0 := v_0.Args[0]
33164                         v_0_1 := v_0.Args[1]
33165                         for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
33166                                 i := v_0_0
33167                                 if i.Op != OpConst8 {
33168                                         continue
33169                                 }
33170                                 t := i.Type
33171                                 z := v_0_1
33172                                 x := v_1
33173                                 if !(z.Op != OpConst8 && x.Op != OpConst8) {
33174                                         continue
33175                                 }
33176                                 v.reset(OpXor8)
33177                                 v0 := b.NewValue0(v.Pos, OpXor8, t)
33178                                 v0.AddArg2(z, x)
33179                                 v.AddArg2(i, v0)
33180                                 return true
33181                         }
33182                 }
33183                 break
33184         }
33185         // match: (Xor8 (Const8 <t> [c]) (Xor8 (Const8 <t> [d]) x))
33186         // result: (Xor8 (Const8 <t> [c^d]) x)
33187         for {
33188                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33189                         if v_0.Op != OpConst8 {
33190                                 continue
33191                         }
33192                         t := v_0.Type
33193                         c := auxIntToInt8(v_0.AuxInt)
33194                         if v_1.Op != OpXor8 {
33195                                 continue
33196                         }
33197                         _ = v_1.Args[1]
33198                         v_1_0 := v_1.Args[0]
33199                         v_1_1 := v_1.Args[1]
33200                         for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
33201                                 if v_1_0.Op != OpConst8 || v_1_0.Type != t {
33202                                         continue
33203                                 }
33204                                 d := auxIntToInt8(v_1_0.AuxInt)
33205                                 x := v_1_1
33206                                 v.reset(OpXor8)
33207                                 v0 := b.NewValue0(v.Pos, OpConst8, t)
33208                                 v0.AuxInt = int8ToAuxInt(c ^ d)
33209                                 v.AddArg2(v0, x)
33210                                 return true
33211                         }
33212                 }
33213                 break
33214         }
33215         // match: (Xor8 (Lsh8x64 x z:(Const64 <t> [c])) (Rsh8Ux64 x (Const64 [d])))
33216         // cond: c < 8 && d == 8-c && canRotate(config, 8)
33217         // result: (RotateLeft8 x z)
33218         for {
33219                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33220                         if v_0.Op != OpLsh8x64 {
33221                                 continue
33222                         }
33223                         _ = v_0.Args[1]
33224                         x := v_0.Args[0]
33225                         z := v_0.Args[1]
33226                         if z.Op != OpConst64 {
33227                                 continue
33228                         }
33229                         c := auxIntToInt64(z.AuxInt)
33230                         if v_1.Op != OpRsh8Ux64 {
33231                                 continue
33232                         }
33233                         _ = v_1.Args[1]
33234                         if x != v_1.Args[0] {
33235                                 continue
33236                         }
33237                         v_1_1 := v_1.Args[1]
33238                         if v_1_1.Op != OpConst64 {
33239                                 continue
33240                         }
33241                         d := auxIntToInt64(v_1_1.AuxInt)
33242                         if !(c < 8 && d == 8-c && canRotate(config, 8)) {
33243                                 continue
33244                         }
33245                         v.reset(OpRotateLeft8)
33246                         v.AddArg2(x, z)
33247                         return true
33248                 }
33249                 break
33250         }
33251         // match: (Xor8 left:(Lsh8x64 x y) right:(Rsh8Ux64 x (Sub64 (Const64 [8]) y)))
33252         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
33253         // result: (RotateLeft8 x y)
33254         for {
33255                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33256                         left := v_0
33257                         if left.Op != OpLsh8x64 {
33258                                 continue
33259                         }
33260                         y := left.Args[1]
33261                         x := left.Args[0]
33262                         right := v_1
33263                         if right.Op != OpRsh8Ux64 {
33264                                 continue
33265                         }
33266                         _ = right.Args[1]
33267                         if x != right.Args[0] {
33268                                 continue
33269                         }
33270                         right_1 := right.Args[1]
33271                         if right_1.Op != OpSub64 {
33272                                 continue
33273                         }
33274                         _ = right_1.Args[1]
33275                         right_1_0 := right_1.Args[0]
33276                         if right_1_0.Op != OpConst64 || auxIntToInt64(right_1_0.AuxInt) != 8 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
33277                                 continue
33278                         }
33279                         v.reset(OpRotateLeft8)
33280                         v.AddArg2(x, y)
33281                         return true
33282                 }
33283                 break
33284         }
33285         // match: (Xor8 left:(Lsh8x32 x y) right:(Rsh8Ux32 x (Sub32 (Const32 [8]) y)))
33286         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
33287         // result: (RotateLeft8 x y)
33288         for {
33289                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33290                         left := v_0
33291                         if left.Op != OpLsh8x32 {
33292                                 continue
33293                         }
33294                         y := left.Args[1]
33295                         x := left.Args[0]
33296                         right := v_1
33297                         if right.Op != OpRsh8Ux32 {
33298                                 continue
33299                         }
33300                         _ = right.Args[1]
33301                         if x != right.Args[0] {
33302                                 continue
33303                         }
33304                         right_1 := right.Args[1]
33305                         if right_1.Op != OpSub32 {
33306                                 continue
33307                         }
33308                         _ = right_1.Args[1]
33309                         right_1_0 := right_1.Args[0]
33310                         if right_1_0.Op != OpConst32 || auxIntToInt32(right_1_0.AuxInt) != 8 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
33311                                 continue
33312                         }
33313                         v.reset(OpRotateLeft8)
33314                         v.AddArg2(x, y)
33315                         return true
33316                 }
33317                 break
33318         }
33319         // match: (Xor8 left:(Lsh8x16 x y) right:(Rsh8Ux16 x (Sub16 (Const16 [8]) y)))
33320         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
33321         // result: (RotateLeft8 x y)
33322         for {
33323                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33324                         left := v_0
33325                         if left.Op != OpLsh8x16 {
33326                                 continue
33327                         }
33328                         y := left.Args[1]
33329                         x := left.Args[0]
33330                         right := v_1
33331                         if right.Op != OpRsh8Ux16 {
33332                                 continue
33333                         }
33334                         _ = right.Args[1]
33335                         if x != right.Args[0] {
33336                                 continue
33337                         }
33338                         right_1 := right.Args[1]
33339                         if right_1.Op != OpSub16 {
33340                                 continue
33341                         }
33342                         _ = right_1.Args[1]
33343                         right_1_0 := right_1.Args[0]
33344                         if right_1_0.Op != OpConst16 || auxIntToInt16(right_1_0.AuxInt) != 8 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
33345                                 continue
33346                         }
33347                         v.reset(OpRotateLeft8)
33348                         v.AddArg2(x, y)
33349                         return true
33350                 }
33351                 break
33352         }
33353         // match: (Xor8 left:(Lsh8x8 x y) right:(Rsh8Ux8 x (Sub8 (Const8 [8]) y)))
33354         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
33355         // result: (RotateLeft8 x y)
33356         for {
33357                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33358                         left := v_0
33359                         if left.Op != OpLsh8x8 {
33360                                 continue
33361                         }
33362                         y := left.Args[1]
33363                         x := left.Args[0]
33364                         right := v_1
33365                         if right.Op != OpRsh8Ux8 {
33366                                 continue
33367                         }
33368                         _ = right.Args[1]
33369                         if x != right.Args[0] {
33370                                 continue
33371                         }
33372                         right_1 := right.Args[1]
33373                         if right_1.Op != OpSub8 {
33374                                 continue
33375                         }
33376                         _ = right_1.Args[1]
33377                         right_1_0 := right_1.Args[0]
33378                         if right_1_0.Op != OpConst8 || auxIntToInt8(right_1_0.AuxInt) != 8 || y != right_1.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
33379                                 continue
33380                         }
33381                         v.reset(OpRotateLeft8)
33382                         v.AddArg2(x, y)
33383                         return true
33384                 }
33385                 break
33386         }
33387         // match: (Xor8 right:(Rsh8Ux64 x y) left:(Lsh8x64 x z:(Sub64 (Const64 [8]) y)))
33388         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
33389         // result: (RotateLeft8 x z)
33390         for {
33391                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33392                         right := v_0
33393                         if right.Op != OpRsh8Ux64 {
33394                                 continue
33395                         }
33396                         y := right.Args[1]
33397                         x := right.Args[0]
33398                         left := v_1
33399                         if left.Op != OpLsh8x64 {
33400                                 continue
33401                         }
33402                         _ = left.Args[1]
33403                         if x != left.Args[0] {
33404                                 continue
33405                         }
33406                         z := left.Args[1]
33407                         if z.Op != OpSub64 {
33408                                 continue
33409                         }
33410                         _ = z.Args[1]
33411                         z_0 := z.Args[0]
33412                         if z_0.Op != OpConst64 || auxIntToInt64(z_0.AuxInt) != 8 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
33413                                 continue
33414                         }
33415                         v.reset(OpRotateLeft8)
33416                         v.AddArg2(x, z)
33417                         return true
33418                 }
33419                 break
33420         }
33421         // match: (Xor8 right:(Rsh8Ux32 x y) left:(Lsh8x32 x z:(Sub32 (Const32 [8]) y)))
33422         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
33423         // result: (RotateLeft8 x z)
33424         for {
33425                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33426                         right := v_0
33427                         if right.Op != OpRsh8Ux32 {
33428                                 continue
33429                         }
33430                         y := right.Args[1]
33431                         x := right.Args[0]
33432                         left := v_1
33433                         if left.Op != OpLsh8x32 {
33434                                 continue
33435                         }
33436                         _ = left.Args[1]
33437                         if x != left.Args[0] {
33438                                 continue
33439                         }
33440                         z := left.Args[1]
33441                         if z.Op != OpSub32 {
33442                                 continue
33443                         }
33444                         _ = z.Args[1]
33445                         z_0 := z.Args[0]
33446                         if z_0.Op != OpConst32 || auxIntToInt32(z_0.AuxInt) != 8 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
33447                                 continue
33448                         }
33449                         v.reset(OpRotateLeft8)
33450                         v.AddArg2(x, z)
33451                         return true
33452                 }
33453                 break
33454         }
33455         // match: (Xor8 right:(Rsh8Ux16 x y) left:(Lsh8x16 x z:(Sub16 (Const16 [8]) y)))
33456         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
33457         // result: (RotateLeft8 x z)
33458         for {
33459                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33460                         right := v_0
33461                         if right.Op != OpRsh8Ux16 {
33462                                 continue
33463                         }
33464                         y := right.Args[1]
33465                         x := right.Args[0]
33466                         left := v_1
33467                         if left.Op != OpLsh8x16 {
33468                                 continue
33469                         }
33470                         _ = left.Args[1]
33471                         if x != left.Args[0] {
33472                                 continue
33473                         }
33474                         z := left.Args[1]
33475                         if z.Op != OpSub16 {
33476                                 continue
33477                         }
33478                         _ = z.Args[1]
33479                         z_0 := z.Args[0]
33480                         if z_0.Op != OpConst16 || auxIntToInt16(z_0.AuxInt) != 8 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
33481                                 continue
33482                         }
33483                         v.reset(OpRotateLeft8)
33484                         v.AddArg2(x, z)
33485                         return true
33486                 }
33487                 break
33488         }
33489         // match: (Xor8 right:(Rsh8Ux8 x y) left:(Lsh8x8 x z:(Sub8 (Const8 [8]) y)))
33490         // cond: (shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)
33491         // result: (RotateLeft8 x z)
33492         for {
33493                 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
33494                         right := v_0
33495                         if right.Op != OpRsh8Ux8 {
33496                                 continue
33497                         }
33498                         y := right.Args[1]
33499                         x := right.Args[0]
33500                         left := v_1
33501                         if left.Op != OpLsh8x8 {
33502                                 continue
33503                         }
33504                         _ = left.Args[1]
33505                         if x != left.Args[0] {
33506                                 continue
33507                         }
33508                         z := left.Args[1]
33509                         if z.Op != OpSub8 {
33510                                 continue
33511                         }
33512                         _ = z.Args[1]
33513                         z_0 := z.Args[0]
33514                         if z_0.Op != OpConst8 || auxIntToInt8(z_0.AuxInt) != 8 || y != z.Args[1] || !((shiftIsBounded(left) || shiftIsBounded(right)) && canRotate(config, 8)) {
33515                                 continue
33516                         }
33517                         v.reset(OpRotateLeft8)
33518                         v.AddArg2(x, z)
33519                         return true
33520                 }
33521                 break
33522         }
33523         return false
33524 }
33525 func rewriteValuegeneric_OpZero(v *Value) bool {
33526         v_1 := v.Args[1]
33527         v_0 := v.Args[0]
33528         b := v.Block
33529         // match: (Zero (SelectN [0] call:(StaticLECall _ _)) mem:(SelectN [1] call))
33530         // cond: isSameCall(call.Aux, "runtime.newobject")
33531         // result: mem
33532         for {
33533                 if v_0.Op != OpSelectN || auxIntToInt64(v_0.AuxInt) != 0 {
33534                         break
33535                 }
33536                 call := v_0.Args[0]
33537                 if call.Op != OpStaticLECall || len(call.Args) != 2 {
33538                         break
33539                 }
33540                 mem := v_1
33541                 if mem.Op != OpSelectN || auxIntToInt64(mem.AuxInt) != 1 || call != mem.Args[0] || !(isSameCall(call.Aux, "runtime.newobject")) {
33542                         break
33543                 }
33544                 v.copyOf(mem)
33545                 return true
33546         }
33547         // match: (Zero {t1} [n] p1 store:(Store {t2} (OffPtr [o2] p2) _ mem))
33548         // cond: isSamePtr(p1, p2) && store.Uses == 1 && n >= o2 + t2.Size() && clobber(store)
33549         // result: (Zero {t1} [n] p1 mem)
33550         for {
33551                 n := auxIntToInt64(v.AuxInt)
33552                 t1 := auxToType(v.Aux)
33553                 p1 := v_0
33554                 store := v_1
33555                 if store.Op != OpStore {
33556                         break
33557                 }
33558                 t2 := auxToType(store.Aux)
33559                 mem := store.Args[2]
33560                 store_0 := store.Args[0]
33561                 if store_0.Op != OpOffPtr {
33562                         break
33563                 }
33564                 o2 := auxIntToInt64(store_0.AuxInt)
33565                 p2 := store_0.Args[0]
33566                 if !(isSamePtr(p1, p2) && store.Uses == 1 && n >= o2+t2.Size() && clobber(store)) {
33567                         break
33568                 }
33569                 v.reset(OpZero)
33570                 v.AuxInt = int64ToAuxInt(n)
33571                 v.Aux = typeToAux(t1)
33572                 v.AddArg2(p1, mem)
33573                 return true
33574         }
33575         // match: (Zero {t} [n] dst1 move:(Move {t} [n] dst2 _ mem))
33576         // cond: move.Uses == 1 && isSamePtr(dst1, dst2) && clobber(move)
33577         // result: (Zero {t} [n] dst1 mem)
33578         for {
33579                 n := auxIntToInt64(v.AuxInt)
33580                 t := auxToType(v.Aux)
33581                 dst1 := v_0
33582                 move := v_1
33583                 if move.Op != OpMove || auxIntToInt64(move.AuxInt) != n || auxToType(move.Aux) != t {
33584                         break
33585                 }
33586                 mem := move.Args[2]
33587                 dst2 := move.Args[0]
33588                 if !(move.Uses == 1 && isSamePtr(dst1, dst2) && clobber(move)) {
33589                         break
33590                 }
33591                 v.reset(OpZero)
33592                 v.AuxInt = int64ToAuxInt(n)
33593                 v.Aux = typeToAux(t)
33594                 v.AddArg2(dst1, mem)
33595                 return true
33596         }
33597         // match: (Zero {t} [n] dst1 vardef:(VarDef {x} move:(Move {t} [n] dst2 _ mem)))
33598         // cond: move.Uses == 1 && vardef.Uses == 1 && isSamePtr(dst1, dst2) && clobber(move, vardef)
33599         // result: (Zero {t} [n] dst1 (VarDef {x} mem))
33600         for {
33601                 n := auxIntToInt64(v.AuxInt)
33602                 t := auxToType(v.Aux)
33603                 dst1 := v_0
33604                 vardef := v_1
33605                 if vardef.Op != OpVarDef {
33606                         break
33607                 }
33608                 x := auxToSym(vardef.Aux)
33609                 move := vardef.Args[0]
33610                 if move.Op != OpMove || auxIntToInt64(move.AuxInt) != n || auxToType(move.Aux) != t {
33611                         break
33612                 }
33613                 mem := move.Args[2]
33614                 dst2 := move.Args[0]
33615                 if !(move.Uses == 1 && vardef.Uses == 1 && isSamePtr(dst1, dst2) && clobber(move, vardef)) {
33616                         break
33617                 }
33618                 v.reset(OpZero)
33619                 v.AuxInt = int64ToAuxInt(n)
33620                 v.Aux = typeToAux(t)
33621                 v0 := b.NewValue0(v.Pos, OpVarDef, types.TypeMem)
33622                 v0.Aux = symToAux(x)
33623                 v0.AddArg(mem)
33624                 v.AddArg2(dst1, v0)
33625                 return true
33626         }
33627         // match: (Zero {t} [s] dst1 zero:(Zero {t} [s] dst2 _))
33628         // cond: isSamePtr(dst1, dst2)
33629         // result: zero
33630         for {
33631                 s := auxIntToInt64(v.AuxInt)
33632                 t := auxToType(v.Aux)
33633                 dst1 := v_0
33634                 zero := v_1
33635                 if zero.Op != OpZero || auxIntToInt64(zero.AuxInt) != s || auxToType(zero.Aux) != t {
33636                         break
33637                 }
33638                 dst2 := zero.Args[0]
33639                 if !(isSamePtr(dst1, dst2)) {
33640                         break
33641                 }
33642                 v.copyOf(zero)
33643                 return true
33644         }
33645         // match: (Zero {t} [s] dst1 vardef:(VarDef (Zero {t} [s] dst2 _)))
33646         // cond: isSamePtr(dst1, dst2)
33647         // result: vardef
33648         for {
33649                 s := auxIntToInt64(v.AuxInt)
33650                 t := auxToType(v.Aux)
33651                 dst1 := v_0
33652                 vardef := v_1
33653                 if vardef.Op != OpVarDef {
33654                         break
33655                 }
33656                 vardef_0 := vardef.Args[0]
33657                 if vardef_0.Op != OpZero || auxIntToInt64(vardef_0.AuxInt) != s || auxToType(vardef_0.Aux) != t {
33658                         break
33659                 }
33660                 dst2 := vardef_0.Args[0]
33661                 if !(isSamePtr(dst1, dst2)) {
33662                         break
33663                 }
33664                 v.copyOf(vardef)
33665                 return true
33666         }
33667         return false
33668 }
33669 func rewriteValuegeneric_OpZeroExt16to32(v *Value) bool {
33670         v_0 := v.Args[0]
33671         // match: (ZeroExt16to32 (Const16 [c]))
33672         // result: (Const32 [int32(uint16(c))])
33673         for {
33674                 if v_0.Op != OpConst16 {
33675                         break
33676                 }
33677                 c := auxIntToInt16(v_0.AuxInt)
33678                 v.reset(OpConst32)
33679                 v.AuxInt = int32ToAuxInt(int32(uint16(c)))
33680                 return true
33681         }
33682         // match: (ZeroExt16to32 (Trunc32to16 x:(Rsh32Ux64 _ (Const64 [s]))))
33683         // cond: s >= 16
33684         // result: x
33685         for {
33686                 if v_0.Op != OpTrunc32to16 {
33687                         break
33688                 }
33689                 x := v_0.Args[0]
33690                 if x.Op != OpRsh32Ux64 {
33691                         break
33692                 }
33693                 _ = x.Args[1]
33694                 x_1 := x.Args[1]
33695                 if x_1.Op != OpConst64 {
33696                         break
33697                 }
33698                 s := auxIntToInt64(x_1.AuxInt)
33699                 if !(s >= 16) {
33700                         break
33701                 }
33702                 v.copyOf(x)
33703                 return true
33704         }
33705         return false
33706 }
33707 func rewriteValuegeneric_OpZeroExt16to64(v *Value) bool {
33708         v_0 := v.Args[0]
33709         // match: (ZeroExt16to64 (Const16 [c]))
33710         // result: (Const64 [int64(uint16(c))])
33711         for {
33712                 if v_0.Op != OpConst16 {
33713                         break
33714                 }
33715                 c := auxIntToInt16(v_0.AuxInt)
33716                 v.reset(OpConst64)
33717                 v.AuxInt = int64ToAuxInt(int64(uint16(c)))
33718                 return true
33719         }
33720         // match: (ZeroExt16to64 (Trunc64to16 x:(Rsh64Ux64 _ (Const64 [s]))))
33721         // cond: s >= 48
33722         // result: x
33723         for {
33724                 if v_0.Op != OpTrunc64to16 {
33725                         break
33726                 }
33727                 x := v_0.Args[0]
33728                 if x.Op != OpRsh64Ux64 {
33729                         break
33730                 }
33731                 _ = x.Args[1]
33732                 x_1 := x.Args[1]
33733                 if x_1.Op != OpConst64 {
33734                         break
33735                 }
33736                 s := auxIntToInt64(x_1.AuxInt)
33737                 if !(s >= 48) {
33738                         break
33739                 }
33740                 v.copyOf(x)
33741                 return true
33742         }
33743         return false
33744 }
33745 func rewriteValuegeneric_OpZeroExt32to64(v *Value) bool {
33746         v_0 := v.Args[0]
33747         // match: (ZeroExt32to64 (Const32 [c]))
33748         // result: (Const64 [int64(uint32(c))])
33749         for {
33750                 if v_0.Op != OpConst32 {
33751                         break
33752                 }
33753                 c := auxIntToInt32(v_0.AuxInt)
33754                 v.reset(OpConst64)
33755                 v.AuxInt = int64ToAuxInt(int64(uint32(c)))
33756                 return true
33757         }
33758         // match: (ZeroExt32to64 (Trunc64to32 x:(Rsh64Ux64 _ (Const64 [s]))))
33759         // cond: s >= 32
33760         // result: x
33761         for {
33762                 if v_0.Op != OpTrunc64to32 {
33763                         break
33764                 }
33765                 x := v_0.Args[0]
33766                 if x.Op != OpRsh64Ux64 {
33767                         break
33768                 }
33769                 _ = x.Args[1]
33770                 x_1 := x.Args[1]
33771                 if x_1.Op != OpConst64 {
33772                         break
33773                 }
33774                 s := auxIntToInt64(x_1.AuxInt)
33775                 if !(s >= 32) {
33776                         break
33777                 }
33778                 v.copyOf(x)
33779                 return true
33780         }
33781         return false
33782 }
33783 func rewriteValuegeneric_OpZeroExt8to16(v *Value) bool {
33784         v_0 := v.Args[0]
33785         // match: (ZeroExt8to16 (Const8 [c]))
33786         // result: (Const16 [int16( uint8(c))])
33787         for {
33788                 if v_0.Op != OpConst8 {
33789                         break
33790                 }
33791                 c := auxIntToInt8(v_0.AuxInt)
33792                 v.reset(OpConst16)
33793                 v.AuxInt = int16ToAuxInt(int16(uint8(c)))
33794                 return true
33795         }
33796         // match: (ZeroExt8to16 (Trunc16to8 x:(Rsh16Ux64 _ (Const64 [s]))))
33797         // cond: s >= 8
33798         // result: x
33799         for {
33800                 if v_0.Op != OpTrunc16to8 {
33801                         break
33802                 }
33803                 x := v_0.Args[0]
33804                 if x.Op != OpRsh16Ux64 {
33805                         break
33806                 }
33807                 _ = x.Args[1]
33808                 x_1 := x.Args[1]
33809                 if x_1.Op != OpConst64 {
33810                         break
33811                 }
33812                 s := auxIntToInt64(x_1.AuxInt)
33813                 if !(s >= 8) {
33814                         break
33815                 }
33816                 v.copyOf(x)
33817                 return true
33818         }
33819         return false
33820 }
33821 func rewriteValuegeneric_OpZeroExt8to32(v *Value) bool {
33822         v_0 := v.Args[0]
33823         // match: (ZeroExt8to32 (Const8 [c]))
33824         // result: (Const32 [int32( uint8(c))])
33825         for {
33826                 if v_0.Op != OpConst8 {
33827                         break
33828                 }
33829                 c := auxIntToInt8(v_0.AuxInt)
33830                 v.reset(OpConst32)
33831                 v.AuxInt = int32ToAuxInt(int32(uint8(c)))
33832                 return true
33833         }
33834         // match: (ZeroExt8to32 (Trunc32to8 x:(Rsh32Ux64 _ (Const64 [s]))))
33835         // cond: s >= 24
33836         // result: x
33837         for {
33838                 if v_0.Op != OpTrunc32to8 {
33839                         break
33840                 }
33841                 x := v_0.Args[0]
33842                 if x.Op != OpRsh32Ux64 {
33843                         break
33844                 }
33845                 _ = x.Args[1]
33846                 x_1 := x.Args[1]
33847                 if x_1.Op != OpConst64 {
33848                         break
33849                 }
33850                 s := auxIntToInt64(x_1.AuxInt)
33851                 if !(s >= 24) {
33852                         break
33853                 }
33854                 v.copyOf(x)
33855                 return true
33856         }
33857         return false
33858 }
33859 func rewriteValuegeneric_OpZeroExt8to64(v *Value) bool {
33860         v_0 := v.Args[0]
33861         // match: (ZeroExt8to64 (Const8 [c]))
33862         // result: (Const64 [int64( uint8(c))])
33863         for {
33864                 if v_0.Op != OpConst8 {
33865                         break
33866                 }
33867                 c := auxIntToInt8(v_0.AuxInt)
33868                 v.reset(OpConst64)
33869                 v.AuxInt = int64ToAuxInt(int64(uint8(c)))
33870                 return true
33871         }
33872         // match: (ZeroExt8to64 (Trunc64to8 x:(Rsh64Ux64 _ (Const64 [s]))))
33873         // cond: s >= 56
33874         // result: x
33875         for {
33876                 if v_0.Op != OpTrunc64to8 {
33877                         break
33878                 }
33879                 x := v_0.Args[0]
33880                 if x.Op != OpRsh64Ux64 {
33881                         break
33882                 }
33883                 _ = x.Args[1]
33884                 x_1 := x.Args[1]
33885                 if x_1.Op != OpConst64 {
33886                         break
33887                 }
33888                 s := auxIntToInt64(x_1.AuxInt)
33889                 if !(s >= 56) {
33890                         break
33891                 }
33892                 v.copyOf(x)
33893                 return true
33894         }
33895         return false
33896 }
33897 func rewriteBlockgeneric(b *Block) bool {
33898         switch b.Kind {
33899         case BlockIf:
33900                 // match: (If (Not cond) yes no)
33901                 // result: (If cond no yes)
33902                 for b.Controls[0].Op == OpNot {
33903                         v_0 := b.Controls[0]
33904                         cond := v_0.Args[0]
33905                         b.resetWithControl(BlockIf, cond)
33906                         b.swapSuccessors()
33907                         return true
33908                 }
33909                 // match: (If (ConstBool [c]) yes no)
33910                 // cond: c
33911                 // result: (First yes no)
33912                 for b.Controls[0].Op == OpConstBool {
33913                         v_0 := b.Controls[0]
33914                         c := auxIntToBool(v_0.AuxInt)
33915                         if !(c) {
33916                                 break
33917                         }
33918                         b.Reset(BlockFirst)
33919                         return true
33920                 }
33921                 // match: (If (ConstBool [c]) yes no)
33922                 // cond: !c
33923                 // result: (First no yes)
33924                 for b.Controls[0].Op == OpConstBool {
33925                         v_0 := b.Controls[0]
33926                         c := auxIntToBool(v_0.AuxInt)
33927                         if !(!c) {
33928                                 break
33929                         }
33930                         b.Reset(BlockFirst)
33931                         b.swapSuccessors()
33932                         return true
33933                 }
33934         }
33935         return false
33936 }