1
2
3 package ssa
4
5 import "internal/buildcfg"
6 import "math"
7 import "cmd/compile/internal/types"
8
9 func rewriteValuePPC64(v *Value) bool {
10 switch v.Op {
11 case OpAbs:
12 v.Op = OpPPC64FABS
13 return true
14 case OpAdd16:
15 v.Op = OpPPC64ADD
16 return true
17 case OpAdd32:
18 v.Op = OpPPC64ADD
19 return true
20 case OpAdd32F:
21 v.Op = OpPPC64FADDS
22 return true
23 case OpAdd64:
24 v.Op = OpPPC64ADD
25 return true
26 case OpAdd64F:
27 v.Op = OpPPC64FADD
28 return true
29 case OpAdd8:
30 v.Op = OpPPC64ADD
31 return true
32 case OpAddPtr:
33 v.Op = OpPPC64ADD
34 return true
35 case OpAddr:
36 return rewriteValuePPC64_OpAddr(v)
37 case OpAnd16:
38 v.Op = OpPPC64AND
39 return true
40 case OpAnd32:
41 v.Op = OpPPC64AND
42 return true
43 case OpAnd64:
44 v.Op = OpPPC64AND
45 return true
46 case OpAnd8:
47 v.Op = OpPPC64AND
48 return true
49 case OpAndB:
50 v.Op = OpPPC64AND
51 return true
52 case OpAtomicAdd32:
53 v.Op = OpPPC64LoweredAtomicAdd32
54 return true
55 case OpAtomicAdd64:
56 v.Op = OpPPC64LoweredAtomicAdd64
57 return true
58 case OpAtomicAnd32:
59 v.Op = OpPPC64LoweredAtomicAnd32
60 return true
61 case OpAtomicAnd8:
62 v.Op = OpPPC64LoweredAtomicAnd8
63 return true
64 case OpAtomicCompareAndSwap32:
65 return rewriteValuePPC64_OpAtomicCompareAndSwap32(v)
66 case OpAtomicCompareAndSwap64:
67 return rewriteValuePPC64_OpAtomicCompareAndSwap64(v)
68 case OpAtomicCompareAndSwapRel32:
69 return rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v)
70 case OpAtomicExchange32:
71 v.Op = OpPPC64LoweredAtomicExchange32
72 return true
73 case OpAtomicExchange64:
74 v.Op = OpPPC64LoweredAtomicExchange64
75 return true
76 case OpAtomicExchange8:
77 v.Op = OpPPC64LoweredAtomicExchange8
78 return true
79 case OpAtomicLoad32:
80 return rewriteValuePPC64_OpAtomicLoad32(v)
81 case OpAtomicLoad64:
82 return rewriteValuePPC64_OpAtomicLoad64(v)
83 case OpAtomicLoad8:
84 return rewriteValuePPC64_OpAtomicLoad8(v)
85 case OpAtomicLoadAcq32:
86 return rewriteValuePPC64_OpAtomicLoadAcq32(v)
87 case OpAtomicLoadAcq64:
88 return rewriteValuePPC64_OpAtomicLoadAcq64(v)
89 case OpAtomicLoadPtr:
90 return rewriteValuePPC64_OpAtomicLoadPtr(v)
91 case OpAtomicOr32:
92 v.Op = OpPPC64LoweredAtomicOr32
93 return true
94 case OpAtomicOr8:
95 v.Op = OpPPC64LoweredAtomicOr8
96 return true
97 case OpAtomicStore32:
98 return rewriteValuePPC64_OpAtomicStore32(v)
99 case OpAtomicStore64:
100 return rewriteValuePPC64_OpAtomicStore64(v)
101 case OpAtomicStore8:
102 return rewriteValuePPC64_OpAtomicStore8(v)
103 case OpAtomicStoreRel32:
104 return rewriteValuePPC64_OpAtomicStoreRel32(v)
105 case OpAtomicStoreRel64:
106 return rewriteValuePPC64_OpAtomicStoreRel64(v)
107 case OpAvg64u:
108 return rewriteValuePPC64_OpAvg64u(v)
109 case OpBitLen16:
110 return rewriteValuePPC64_OpBitLen16(v)
111 case OpBitLen32:
112 return rewriteValuePPC64_OpBitLen32(v)
113 case OpBitLen64:
114 return rewriteValuePPC64_OpBitLen64(v)
115 case OpBitLen8:
116 return rewriteValuePPC64_OpBitLen8(v)
117 case OpBswap16:
118 return rewriteValuePPC64_OpBswap16(v)
119 case OpBswap32:
120 return rewriteValuePPC64_OpBswap32(v)
121 case OpBswap64:
122 return rewriteValuePPC64_OpBswap64(v)
123 case OpCeil:
124 v.Op = OpPPC64FCEIL
125 return true
126 case OpClosureCall:
127 v.Op = OpPPC64CALLclosure
128 return true
129 case OpCom16:
130 return rewriteValuePPC64_OpCom16(v)
131 case OpCom32:
132 return rewriteValuePPC64_OpCom32(v)
133 case OpCom64:
134 return rewriteValuePPC64_OpCom64(v)
135 case OpCom8:
136 return rewriteValuePPC64_OpCom8(v)
137 case OpCondSelect:
138 return rewriteValuePPC64_OpCondSelect(v)
139 case OpConst16:
140 return rewriteValuePPC64_OpConst16(v)
141 case OpConst32:
142 return rewriteValuePPC64_OpConst32(v)
143 case OpConst32F:
144 v.Op = OpPPC64FMOVSconst
145 return true
146 case OpConst64:
147 return rewriteValuePPC64_OpConst64(v)
148 case OpConst64F:
149 v.Op = OpPPC64FMOVDconst
150 return true
151 case OpConst8:
152 return rewriteValuePPC64_OpConst8(v)
153 case OpConstBool:
154 return rewriteValuePPC64_OpConstBool(v)
155 case OpConstNil:
156 return rewriteValuePPC64_OpConstNil(v)
157 case OpCopysign:
158 return rewriteValuePPC64_OpCopysign(v)
159 case OpCtz16:
160 return rewriteValuePPC64_OpCtz16(v)
161 case OpCtz16NonZero:
162 v.Op = OpCtz64
163 return true
164 case OpCtz32:
165 return rewriteValuePPC64_OpCtz32(v)
166 case OpCtz32NonZero:
167 v.Op = OpCtz64
168 return true
169 case OpCtz64:
170 return rewriteValuePPC64_OpCtz64(v)
171 case OpCtz64NonZero:
172 v.Op = OpCtz64
173 return true
174 case OpCtz8:
175 return rewriteValuePPC64_OpCtz8(v)
176 case OpCtz8NonZero:
177 v.Op = OpCtz64
178 return true
179 case OpCvt32Fto32:
180 return rewriteValuePPC64_OpCvt32Fto32(v)
181 case OpCvt32Fto64:
182 return rewriteValuePPC64_OpCvt32Fto64(v)
183 case OpCvt32Fto64F:
184 v.Op = OpCopy
185 return true
186 case OpCvt32to32F:
187 return rewriteValuePPC64_OpCvt32to32F(v)
188 case OpCvt32to64F:
189 return rewriteValuePPC64_OpCvt32to64F(v)
190 case OpCvt64Fto32:
191 return rewriteValuePPC64_OpCvt64Fto32(v)
192 case OpCvt64Fto32F:
193 v.Op = OpPPC64FRSP
194 return true
195 case OpCvt64Fto64:
196 return rewriteValuePPC64_OpCvt64Fto64(v)
197 case OpCvt64to32F:
198 return rewriteValuePPC64_OpCvt64to32F(v)
199 case OpCvt64to64F:
200 return rewriteValuePPC64_OpCvt64to64F(v)
201 case OpCvtBoolToUint8:
202 v.Op = OpCopy
203 return true
204 case OpDiv16:
205 return rewriteValuePPC64_OpDiv16(v)
206 case OpDiv16u:
207 return rewriteValuePPC64_OpDiv16u(v)
208 case OpDiv32:
209 return rewriteValuePPC64_OpDiv32(v)
210 case OpDiv32F:
211 v.Op = OpPPC64FDIVS
212 return true
213 case OpDiv32u:
214 v.Op = OpPPC64DIVWU
215 return true
216 case OpDiv64:
217 return rewriteValuePPC64_OpDiv64(v)
218 case OpDiv64F:
219 v.Op = OpPPC64FDIV
220 return true
221 case OpDiv64u:
222 v.Op = OpPPC64DIVDU
223 return true
224 case OpDiv8:
225 return rewriteValuePPC64_OpDiv8(v)
226 case OpDiv8u:
227 return rewriteValuePPC64_OpDiv8u(v)
228 case OpEq16:
229 return rewriteValuePPC64_OpEq16(v)
230 case OpEq32:
231 return rewriteValuePPC64_OpEq32(v)
232 case OpEq32F:
233 return rewriteValuePPC64_OpEq32F(v)
234 case OpEq64:
235 return rewriteValuePPC64_OpEq64(v)
236 case OpEq64F:
237 return rewriteValuePPC64_OpEq64F(v)
238 case OpEq8:
239 return rewriteValuePPC64_OpEq8(v)
240 case OpEqB:
241 return rewriteValuePPC64_OpEqB(v)
242 case OpEqPtr:
243 return rewriteValuePPC64_OpEqPtr(v)
244 case OpFMA:
245 v.Op = OpPPC64FMADD
246 return true
247 case OpFloor:
248 v.Op = OpPPC64FFLOOR
249 return true
250 case OpGetCallerPC:
251 v.Op = OpPPC64LoweredGetCallerPC
252 return true
253 case OpGetCallerSP:
254 v.Op = OpPPC64LoweredGetCallerSP
255 return true
256 case OpGetClosurePtr:
257 v.Op = OpPPC64LoweredGetClosurePtr
258 return true
259 case OpHmul32:
260 v.Op = OpPPC64MULHW
261 return true
262 case OpHmul32u:
263 v.Op = OpPPC64MULHWU
264 return true
265 case OpHmul64:
266 v.Op = OpPPC64MULHD
267 return true
268 case OpHmul64u:
269 v.Op = OpPPC64MULHDU
270 return true
271 case OpInterCall:
272 v.Op = OpPPC64CALLinter
273 return true
274 case OpIsInBounds:
275 return rewriteValuePPC64_OpIsInBounds(v)
276 case OpIsNonNil:
277 return rewriteValuePPC64_OpIsNonNil(v)
278 case OpIsSliceInBounds:
279 return rewriteValuePPC64_OpIsSliceInBounds(v)
280 case OpLeq16:
281 return rewriteValuePPC64_OpLeq16(v)
282 case OpLeq16U:
283 return rewriteValuePPC64_OpLeq16U(v)
284 case OpLeq32:
285 return rewriteValuePPC64_OpLeq32(v)
286 case OpLeq32F:
287 return rewriteValuePPC64_OpLeq32F(v)
288 case OpLeq32U:
289 return rewriteValuePPC64_OpLeq32U(v)
290 case OpLeq64:
291 return rewriteValuePPC64_OpLeq64(v)
292 case OpLeq64F:
293 return rewriteValuePPC64_OpLeq64F(v)
294 case OpLeq64U:
295 return rewriteValuePPC64_OpLeq64U(v)
296 case OpLeq8:
297 return rewriteValuePPC64_OpLeq8(v)
298 case OpLeq8U:
299 return rewriteValuePPC64_OpLeq8U(v)
300 case OpLess16:
301 return rewriteValuePPC64_OpLess16(v)
302 case OpLess16U:
303 return rewriteValuePPC64_OpLess16U(v)
304 case OpLess32:
305 return rewriteValuePPC64_OpLess32(v)
306 case OpLess32F:
307 return rewriteValuePPC64_OpLess32F(v)
308 case OpLess32U:
309 return rewriteValuePPC64_OpLess32U(v)
310 case OpLess64:
311 return rewriteValuePPC64_OpLess64(v)
312 case OpLess64F:
313 return rewriteValuePPC64_OpLess64F(v)
314 case OpLess64U:
315 return rewriteValuePPC64_OpLess64U(v)
316 case OpLess8:
317 return rewriteValuePPC64_OpLess8(v)
318 case OpLess8U:
319 return rewriteValuePPC64_OpLess8U(v)
320 case OpLoad:
321 return rewriteValuePPC64_OpLoad(v)
322 case OpLocalAddr:
323 return rewriteValuePPC64_OpLocalAddr(v)
324 case OpLsh16x16:
325 return rewriteValuePPC64_OpLsh16x16(v)
326 case OpLsh16x32:
327 return rewriteValuePPC64_OpLsh16x32(v)
328 case OpLsh16x64:
329 return rewriteValuePPC64_OpLsh16x64(v)
330 case OpLsh16x8:
331 return rewriteValuePPC64_OpLsh16x8(v)
332 case OpLsh32x16:
333 return rewriteValuePPC64_OpLsh32x16(v)
334 case OpLsh32x32:
335 return rewriteValuePPC64_OpLsh32x32(v)
336 case OpLsh32x64:
337 return rewriteValuePPC64_OpLsh32x64(v)
338 case OpLsh32x8:
339 return rewriteValuePPC64_OpLsh32x8(v)
340 case OpLsh64x16:
341 return rewriteValuePPC64_OpLsh64x16(v)
342 case OpLsh64x32:
343 return rewriteValuePPC64_OpLsh64x32(v)
344 case OpLsh64x64:
345 return rewriteValuePPC64_OpLsh64x64(v)
346 case OpLsh64x8:
347 return rewriteValuePPC64_OpLsh64x8(v)
348 case OpLsh8x16:
349 return rewriteValuePPC64_OpLsh8x16(v)
350 case OpLsh8x32:
351 return rewriteValuePPC64_OpLsh8x32(v)
352 case OpLsh8x64:
353 return rewriteValuePPC64_OpLsh8x64(v)
354 case OpLsh8x8:
355 return rewriteValuePPC64_OpLsh8x8(v)
356 case OpMax32F:
357 return rewriteValuePPC64_OpMax32F(v)
358 case OpMax64F:
359 return rewriteValuePPC64_OpMax64F(v)
360 case OpMin32F:
361 return rewriteValuePPC64_OpMin32F(v)
362 case OpMin64F:
363 return rewriteValuePPC64_OpMin64F(v)
364 case OpMod16:
365 return rewriteValuePPC64_OpMod16(v)
366 case OpMod16u:
367 return rewriteValuePPC64_OpMod16u(v)
368 case OpMod32:
369 return rewriteValuePPC64_OpMod32(v)
370 case OpMod32u:
371 return rewriteValuePPC64_OpMod32u(v)
372 case OpMod64:
373 return rewriteValuePPC64_OpMod64(v)
374 case OpMod64u:
375 return rewriteValuePPC64_OpMod64u(v)
376 case OpMod8:
377 return rewriteValuePPC64_OpMod8(v)
378 case OpMod8u:
379 return rewriteValuePPC64_OpMod8u(v)
380 case OpMove:
381 return rewriteValuePPC64_OpMove(v)
382 case OpMul16:
383 v.Op = OpPPC64MULLW
384 return true
385 case OpMul32:
386 v.Op = OpPPC64MULLW
387 return true
388 case OpMul32F:
389 v.Op = OpPPC64FMULS
390 return true
391 case OpMul64:
392 v.Op = OpPPC64MULLD
393 return true
394 case OpMul64F:
395 v.Op = OpPPC64FMUL
396 return true
397 case OpMul8:
398 v.Op = OpPPC64MULLW
399 return true
400 case OpNeg16:
401 v.Op = OpPPC64NEG
402 return true
403 case OpNeg32:
404 v.Op = OpPPC64NEG
405 return true
406 case OpNeg32F:
407 v.Op = OpPPC64FNEG
408 return true
409 case OpNeg64:
410 v.Op = OpPPC64NEG
411 return true
412 case OpNeg64F:
413 v.Op = OpPPC64FNEG
414 return true
415 case OpNeg8:
416 v.Op = OpPPC64NEG
417 return true
418 case OpNeq16:
419 return rewriteValuePPC64_OpNeq16(v)
420 case OpNeq32:
421 return rewriteValuePPC64_OpNeq32(v)
422 case OpNeq32F:
423 return rewriteValuePPC64_OpNeq32F(v)
424 case OpNeq64:
425 return rewriteValuePPC64_OpNeq64(v)
426 case OpNeq64F:
427 return rewriteValuePPC64_OpNeq64F(v)
428 case OpNeq8:
429 return rewriteValuePPC64_OpNeq8(v)
430 case OpNeqB:
431 v.Op = OpPPC64XOR
432 return true
433 case OpNeqPtr:
434 return rewriteValuePPC64_OpNeqPtr(v)
435 case OpNilCheck:
436 v.Op = OpPPC64LoweredNilCheck
437 return true
438 case OpNot:
439 return rewriteValuePPC64_OpNot(v)
440 case OpOffPtr:
441 return rewriteValuePPC64_OpOffPtr(v)
442 case OpOr16:
443 v.Op = OpPPC64OR
444 return true
445 case OpOr32:
446 v.Op = OpPPC64OR
447 return true
448 case OpOr64:
449 v.Op = OpPPC64OR
450 return true
451 case OpOr8:
452 v.Op = OpPPC64OR
453 return true
454 case OpOrB:
455 v.Op = OpPPC64OR
456 return true
457 case OpPPC64ADD:
458 return rewriteValuePPC64_OpPPC64ADD(v)
459 case OpPPC64ADDC:
460 return rewriteValuePPC64_OpPPC64ADDC(v)
461 case OpPPC64ADDE:
462 return rewriteValuePPC64_OpPPC64ADDE(v)
463 case OpPPC64ADDconst:
464 return rewriteValuePPC64_OpPPC64ADDconst(v)
465 case OpPPC64AND:
466 return rewriteValuePPC64_OpPPC64AND(v)
467 case OpPPC64ANDN:
468 return rewriteValuePPC64_OpPPC64ANDN(v)
469 case OpPPC64ANDconst:
470 return rewriteValuePPC64_OpPPC64ANDconst(v)
471 case OpPPC64BRD:
472 return rewriteValuePPC64_OpPPC64BRD(v)
473 case OpPPC64BRH:
474 return rewriteValuePPC64_OpPPC64BRH(v)
475 case OpPPC64BRW:
476 return rewriteValuePPC64_OpPPC64BRW(v)
477 case OpPPC64CLRLSLDI:
478 return rewriteValuePPC64_OpPPC64CLRLSLDI(v)
479 case OpPPC64CMP:
480 return rewriteValuePPC64_OpPPC64CMP(v)
481 case OpPPC64CMPU:
482 return rewriteValuePPC64_OpPPC64CMPU(v)
483 case OpPPC64CMPUconst:
484 return rewriteValuePPC64_OpPPC64CMPUconst(v)
485 case OpPPC64CMPW:
486 return rewriteValuePPC64_OpPPC64CMPW(v)
487 case OpPPC64CMPWU:
488 return rewriteValuePPC64_OpPPC64CMPWU(v)
489 case OpPPC64CMPWUconst:
490 return rewriteValuePPC64_OpPPC64CMPWUconst(v)
491 case OpPPC64CMPWconst:
492 return rewriteValuePPC64_OpPPC64CMPWconst(v)
493 case OpPPC64CMPconst:
494 return rewriteValuePPC64_OpPPC64CMPconst(v)
495 case OpPPC64Equal:
496 return rewriteValuePPC64_OpPPC64Equal(v)
497 case OpPPC64FABS:
498 return rewriteValuePPC64_OpPPC64FABS(v)
499 case OpPPC64FADD:
500 return rewriteValuePPC64_OpPPC64FADD(v)
501 case OpPPC64FADDS:
502 return rewriteValuePPC64_OpPPC64FADDS(v)
503 case OpPPC64FCEIL:
504 return rewriteValuePPC64_OpPPC64FCEIL(v)
505 case OpPPC64FFLOOR:
506 return rewriteValuePPC64_OpPPC64FFLOOR(v)
507 case OpPPC64FGreaterEqual:
508 return rewriteValuePPC64_OpPPC64FGreaterEqual(v)
509 case OpPPC64FGreaterThan:
510 return rewriteValuePPC64_OpPPC64FGreaterThan(v)
511 case OpPPC64FLessEqual:
512 return rewriteValuePPC64_OpPPC64FLessEqual(v)
513 case OpPPC64FLessThan:
514 return rewriteValuePPC64_OpPPC64FLessThan(v)
515 case OpPPC64FMOVDload:
516 return rewriteValuePPC64_OpPPC64FMOVDload(v)
517 case OpPPC64FMOVDstore:
518 return rewriteValuePPC64_OpPPC64FMOVDstore(v)
519 case OpPPC64FMOVSload:
520 return rewriteValuePPC64_OpPPC64FMOVSload(v)
521 case OpPPC64FMOVSstore:
522 return rewriteValuePPC64_OpPPC64FMOVSstore(v)
523 case OpPPC64FNEG:
524 return rewriteValuePPC64_OpPPC64FNEG(v)
525 case OpPPC64FSQRT:
526 return rewriteValuePPC64_OpPPC64FSQRT(v)
527 case OpPPC64FSUB:
528 return rewriteValuePPC64_OpPPC64FSUB(v)
529 case OpPPC64FSUBS:
530 return rewriteValuePPC64_OpPPC64FSUBS(v)
531 case OpPPC64FTRUNC:
532 return rewriteValuePPC64_OpPPC64FTRUNC(v)
533 case OpPPC64GreaterEqual:
534 return rewriteValuePPC64_OpPPC64GreaterEqual(v)
535 case OpPPC64GreaterThan:
536 return rewriteValuePPC64_OpPPC64GreaterThan(v)
537 case OpPPC64ISEL:
538 return rewriteValuePPC64_OpPPC64ISEL(v)
539 case OpPPC64LessEqual:
540 return rewriteValuePPC64_OpPPC64LessEqual(v)
541 case OpPPC64LessThan:
542 return rewriteValuePPC64_OpPPC64LessThan(v)
543 case OpPPC64LoweredPanicBoundsCR:
544 return rewriteValuePPC64_OpPPC64LoweredPanicBoundsCR(v)
545 case OpPPC64LoweredPanicBoundsRC:
546 return rewriteValuePPC64_OpPPC64LoweredPanicBoundsRC(v)
547 case OpPPC64LoweredPanicBoundsRR:
548 return rewriteValuePPC64_OpPPC64LoweredPanicBoundsRR(v)
549 case OpPPC64MFVSRD:
550 return rewriteValuePPC64_OpPPC64MFVSRD(v)
551 case OpPPC64MOVBZload:
552 return rewriteValuePPC64_OpPPC64MOVBZload(v)
553 case OpPPC64MOVBZloadidx:
554 return rewriteValuePPC64_OpPPC64MOVBZloadidx(v)
555 case OpPPC64MOVBZreg:
556 return rewriteValuePPC64_OpPPC64MOVBZreg(v)
557 case OpPPC64MOVBreg:
558 return rewriteValuePPC64_OpPPC64MOVBreg(v)
559 case OpPPC64MOVBstore:
560 return rewriteValuePPC64_OpPPC64MOVBstore(v)
561 case OpPPC64MOVBstoreidx:
562 return rewriteValuePPC64_OpPPC64MOVBstoreidx(v)
563 case OpPPC64MOVBstorezero:
564 return rewriteValuePPC64_OpPPC64MOVBstorezero(v)
565 case OpPPC64MOVDaddr:
566 return rewriteValuePPC64_OpPPC64MOVDaddr(v)
567 case OpPPC64MOVDload:
568 return rewriteValuePPC64_OpPPC64MOVDload(v)
569 case OpPPC64MOVDloadidx:
570 return rewriteValuePPC64_OpPPC64MOVDloadidx(v)
571 case OpPPC64MOVDstore:
572 return rewriteValuePPC64_OpPPC64MOVDstore(v)
573 case OpPPC64MOVDstoreidx:
574 return rewriteValuePPC64_OpPPC64MOVDstoreidx(v)
575 case OpPPC64MOVDstorezero:
576 return rewriteValuePPC64_OpPPC64MOVDstorezero(v)
577 case OpPPC64MOVHBRstore:
578 return rewriteValuePPC64_OpPPC64MOVHBRstore(v)
579 case OpPPC64MOVHZload:
580 return rewriteValuePPC64_OpPPC64MOVHZload(v)
581 case OpPPC64MOVHZloadidx:
582 return rewriteValuePPC64_OpPPC64MOVHZloadidx(v)
583 case OpPPC64MOVHZreg:
584 return rewriteValuePPC64_OpPPC64MOVHZreg(v)
585 case OpPPC64MOVHload:
586 return rewriteValuePPC64_OpPPC64MOVHload(v)
587 case OpPPC64MOVHloadidx:
588 return rewriteValuePPC64_OpPPC64MOVHloadidx(v)
589 case OpPPC64MOVHreg:
590 return rewriteValuePPC64_OpPPC64MOVHreg(v)
591 case OpPPC64MOVHstore:
592 return rewriteValuePPC64_OpPPC64MOVHstore(v)
593 case OpPPC64MOVHstoreidx:
594 return rewriteValuePPC64_OpPPC64MOVHstoreidx(v)
595 case OpPPC64MOVHstorezero:
596 return rewriteValuePPC64_OpPPC64MOVHstorezero(v)
597 case OpPPC64MOVWBRstore:
598 return rewriteValuePPC64_OpPPC64MOVWBRstore(v)
599 case OpPPC64MOVWZload:
600 return rewriteValuePPC64_OpPPC64MOVWZload(v)
601 case OpPPC64MOVWZloadidx:
602 return rewriteValuePPC64_OpPPC64MOVWZloadidx(v)
603 case OpPPC64MOVWZreg:
604 return rewriteValuePPC64_OpPPC64MOVWZreg(v)
605 case OpPPC64MOVWload:
606 return rewriteValuePPC64_OpPPC64MOVWload(v)
607 case OpPPC64MOVWloadidx:
608 return rewriteValuePPC64_OpPPC64MOVWloadidx(v)
609 case OpPPC64MOVWreg:
610 return rewriteValuePPC64_OpPPC64MOVWreg(v)
611 case OpPPC64MOVWstore:
612 return rewriteValuePPC64_OpPPC64MOVWstore(v)
613 case OpPPC64MOVWstoreidx:
614 return rewriteValuePPC64_OpPPC64MOVWstoreidx(v)
615 case OpPPC64MOVWstorezero:
616 return rewriteValuePPC64_OpPPC64MOVWstorezero(v)
617 case OpPPC64MTVSRD:
618 return rewriteValuePPC64_OpPPC64MTVSRD(v)
619 case OpPPC64MULLD:
620 return rewriteValuePPC64_OpPPC64MULLD(v)
621 case OpPPC64MULLW:
622 return rewriteValuePPC64_OpPPC64MULLW(v)
623 case OpPPC64NEG:
624 return rewriteValuePPC64_OpPPC64NEG(v)
625 case OpPPC64NOR:
626 return rewriteValuePPC64_OpPPC64NOR(v)
627 case OpPPC64NotEqual:
628 return rewriteValuePPC64_OpPPC64NotEqual(v)
629 case OpPPC64OR:
630 return rewriteValuePPC64_OpPPC64OR(v)
631 case OpPPC64ORN:
632 return rewriteValuePPC64_OpPPC64ORN(v)
633 case OpPPC64ORconst:
634 return rewriteValuePPC64_OpPPC64ORconst(v)
635 case OpPPC64RLWINM:
636 return rewriteValuePPC64_OpPPC64RLWINM(v)
637 case OpPPC64ROTL:
638 return rewriteValuePPC64_OpPPC64ROTL(v)
639 case OpPPC64ROTLW:
640 return rewriteValuePPC64_OpPPC64ROTLW(v)
641 case OpPPC64ROTLWconst:
642 return rewriteValuePPC64_OpPPC64ROTLWconst(v)
643 case OpPPC64SETBC:
644 return rewriteValuePPC64_OpPPC64SETBC(v)
645 case OpPPC64SETBCR:
646 return rewriteValuePPC64_OpPPC64SETBCR(v)
647 case OpPPC64SLD:
648 return rewriteValuePPC64_OpPPC64SLD(v)
649 case OpPPC64SLDconst:
650 return rewriteValuePPC64_OpPPC64SLDconst(v)
651 case OpPPC64SLW:
652 return rewriteValuePPC64_OpPPC64SLW(v)
653 case OpPPC64SLWconst:
654 return rewriteValuePPC64_OpPPC64SLWconst(v)
655 case OpPPC64SRAD:
656 return rewriteValuePPC64_OpPPC64SRAD(v)
657 case OpPPC64SRAW:
658 return rewriteValuePPC64_OpPPC64SRAW(v)
659 case OpPPC64SRD:
660 return rewriteValuePPC64_OpPPC64SRD(v)
661 case OpPPC64SRW:
662 return rewriteValuePPC64_OpPPC64SRW(v)
663 case OpPPC64SRWconst:
664 return rewriteValuePPC64_OpPPC64SRWconst(v)
665 case OpPPC64SUB:
666 return rewriteValuePPC64_OpPPC64SUB(v)
667 case OpPPC64SUBE:
668 return rewriteValuePPC64_OpPPC64SUBE(v)
669 case OpPPC64SUBFCconst:
670 return rewriteValuePPC64_OpPPC64SUBFCconst(v)
671 case OpPPC64XOR:
672 return rewriteValuePPC64_OpPPC64XOR(v)
673 case OpPPC64XORconst:
674 return rewriteValuePPC64_OpPPC64XORconst(v)
675 case OpPanicBounds:
676 v.Op = OpPPC64LoweredPanicBoundsRR
677 return true
678 case OpPopCount16:
679 return rewriteValuePPC64_OpPopCount16(v)
680 case OpPopCount32:
681 return rewriteValuePPC64_OpPopCount32(v)
682 case OpPopCount64:
683 v.Op = OpPPC64POPCNTD
684 return true
685 case OpPopCount8:
686 return rewriteValuePPC64_OpPopCount8(v)
687 case OpPrefetchCache:
688 return rewriteValuePPC64_OpPrefetchCache(v)
689 case OpPrefetchCacheStreamed:
690 return rewriteValuePPC64_OpPrefetchCacheStreamed(v)
691 case OpPubBarrier:
692 v.Op = OpPPC64LoweredPubBarrier
693 return true
694 case OpRotateLeft16:
695 return rewriteValuePPC64_OpRotateLeft16(v)
696 case OpRotateLeft32:
697 v.Op = OpPPC64ROTLW
698 return true
699 case OpRotateLeft64:
700 v.Op = OpPPC64ROTL
701 return true
702 case OpRotateLeft8:
703 return rewriteValuePPC64_OpRotateLeft8(v)
704 case OpRound:
705 v.Op = OpPPC64FROUND
706 return true
707 case OpRound32F:
708 v.Op = OpPPC64LoweredRound32F
709 return true
710 case OpRound64F:
711 v.Op = OpPPC64LoweredRound64F
712 return true
713 case OpRsh16Ux16:
714 return rewriteValuePPC64_OpRsh16Ux16(v)
715 case OpRsh16Ux32:
716 return rewriteValuePPC64_OpRsh16Ux32(v)
717 case OpRsh16Ux64:
718 return rewriteValuePPC64_OpRsh16Ux64(v)
719 case OpRsh16Ux8:
720 return rewriteValuePPC64_OpRsh16Ux8(v)
721 case OpRsh16x16:
722 return rewriteValuePPC64_OpRsh16x16(v)
723 case OpRsh16x32:
724 return rewriteValuePPC64_OpRsh16x32(v)
725 case OpRsh16x64:
726 return rewriteValuePPC64_OpRsh16x64(v)
727 case OpRsh16x8:
728 return rewriteValuePPC64_OpRsh16x8(v)
729 case OpRsh32Ux16:
730 return rewriteValuePPC64_OpRsh32Ux16(v)
731 case OpRsh32Ux32:
732 return rewriteValuePPC64_OpRsh32Ux32(v)
733 case OpRsh32Ux64:
734 return rewriteValuePPC64_OpRsh32Ux64(v)
735 case OpRsh32Ux8:
736 return rewriteValuePPC64_OpRsh32Ux8(v)
737 case OpRsh32x16:
738 return rewriteValuePPC64_OpRsh32x16(v)
739 case OpRsh32x32:
740 return rewriteValuePPC64_OpRsh32x32(v)
741 case OpRsh32x64:
742 return rewriteValuePPC64_OpRsh32x64(v)
743 case OpRsh32x8:
744 return rewriteValuePPC64_OpRsh32x8(v)
745 case OpRsh64Ux16:
746 return rewriteValuePPC64_OpRsh64Ux16(v)
747 case OpRsh64Ux32:
748 return rewriteValuePPC64_OpRsh64Ux32(v)
749 case OpRsh64Ux64:
750 return rewriteValuePPC64_OpRsh64Ux64(v)
751 case OpRsh64Ux8:
752 return rewriteValuePPC64_OpRsh64Ux8(v)
753 case OpRsh64x16:
754 return rewriteValuePPC64_OpRsh64x16(v)
755 case OpRsh64x32:
756 return rewriteValuePPC64_OpRsh64x32(v)
757 case OpRsh64x64:
758 return rewriteValuePPC64_OpRsh64x64(v)
759 case OpRsh64x8:
760 return rewriteValuePPC64_OpRsh64x8(v)
761 case OpRsh8Ux16:
762 return rewriteValuePPC64_OpRsh8Ux16(v)
763 case OpRsh8Ux32:
764 return rewriteValuePPC64_OpRsh8Ux32(v)
765 case OpRsh8Ux64:
766 return rewriteValuePPC64_OpRsh8Ux64(v)
767 case OpRsh8Ux8:
768 return rewriteValuePPC64_OpRsh8Ux8(v)
769 case OpRsh8x16:
770 return rewriteValuePPC64_OpRsh8x16(v)
771 case OpRsh8x32:
772 return rewriteValuePPC64_OpRsh8x32(v)
773 case OpRsh8x64:
774 return rewriteValuePPC64_OpRsh8x64(v)
775 case OpRsh8x8:
776 return rewriteValuePPC64_OpRsh8x8(v)
777 case OpSelect0:
778 return rewriteValuePPC64_OpSelect0(v)
779 case OpSelect1:
780 return rewriteValuePPC64_OpSelect1(v)
781 case OpSelectN:
782 return rewriteValuePPC64_OpSelectN(v)
783 case OpSignExt16to32:
784 v.Op = OpPPC64MOVHreg
785 return true
786 case OpSignExt16to64:
787 v.Op = OpPPC64MOVHreg
788 return true
789 case OpSignExt32to64:
790 v.Op = OpPPC64MOVWreg
791 return true
792 case OpSignExt8to16:
793 v.Op = OpPPC64MOVBreg
794 return true
795 case OpSignExt8to32:
796 v.Op = OpPPC64MOVBreg
797 return true
798 case OpSignExt8to64:
799 v.Op = OpPPC64MOVBreg
800 return true
801 case OpSlicemask:
802 return rewriteValuePPC64_OpSlicemask(v)
803 case OpSqrt:
804 v.Op = OpPPC64FSQRT
805 return true
806 case OpSqrt32:
807 v.Op = OpPPC64FSQRTS
808 return true
809 case OpStaticCall:
810 v.Op = OpPPC64CALLstatic
811 return true
812 case OpStore:
813 return rewriteValuePPC64_OpStore(v)
814 case OpSub16:
815 v.Op = OpPPC64SUB
816 return true
817 case OpSub32:
818 v.Op = OpPPC64SUB
819 return true
820 case OpSub32F:
821 v.Op = OpPPC64FSUBS
822 return true
823 case OpSub64:
824 v.Op = OpPPC64SUB
825 return true
826 case OpSub64F:
827 v.Op = OpPPC64FSUB
828 return true
829 case OpSub8:
830 v.Op = OpPPC64SUB
831 return true
832 case OpSubPtr:
833 v.Op = OpPPC64SUB
834 return true
835 case OpTailCall:
836 v.Op = OpPPC64CALLtail
837 return true
838 case OpTailCallInter:
839 v.Op = OpPPC64CALLtailinter
840 return true
841 case OpTrunc:
842 v.Op = OpPPC64FTRUNC
843 return true
844 case OpTrunc16to8:
845 return rewriteValuePPC64_OpTrunc16to8(v)
846 case OpTrunc32to16:
847 return rewriteValuePPC64_OpTrunc32to16(v)
848 case OpTrunc32to8:
849 return rewriteValuePPC64_OpTrunc32to8(v)
850 case OpTrunc64to16:
851 return rewriteValuePPC64_OpTrunc64to16(v)
852 case OpTrunc64to32:
853 return rewriteValuePPC64_OpTrunc64to32(v)
854 case OpTrunc64to8:
855 return rewriteValuePPC64_OpTrunc64to8(v)
856 case OpWB:
857 v.Op = OpPPC64LoweredWB
858 return true
859 case OpXor16:
860 v.Op = OpPPC64XOR
861 return true
862 case OpXor32:
863 v.Op = OpPPC64XOR
864 return true
865 case OpXor64:
866 v.Op = OpPPC64XOR
867 return true
868 case OpXor8:
869 v.Op = OpPPC64XOR
870 return true
871 case OpZero:
872 return rewriteValuePPC64_OpZero(v)
873 case OpZeroExt16to32:
874 v.Op = OpPPC64MOVHZreg
875 return true
876 case OpZeroExt16to64:
877 v.Op = OpPPC64MOVHZreg
878 return true
879 case OpZeroExt32to64:
880 v.Op = OpPPC64MOVWZreg
881 return true
882 case OpZeroExt8to16:
883 v.Op = OpPPC64MOVBZreg
884 return true
885 case OpZeroExt8to32:
886 v.Op = OpPPC64MOVBZreg
887 return true
888 case OpZeroExt8to64:
889 v.Op = OpPPC64MOVBZreg
890 return true
891 }
892 return false
893 }
894 func rewriteValuePPC64_OpAddr(v *Value) bool {
895 v_0 := v.Args[0]
896
897
898 for {
899 sym := auxToSym(v.Aux)
900 base := v_0
901 v.reset(OpPPC64MOVDaddr)
902 v.AuxInt = int32ToAuxInt(0)
903 v.Aux = symToAux(sym)
904 v.AddArg(base)
905 return true
906 }
907 }
908 func rewriteValuePPC64_OpAtomicCompareAndSwap32(v *Value) bool {
909 v_3 := v.Args[3]
910 v_2 := v.Args[2]
911 v_1 := v.Args[1]
912 v_0 := v.Args[0]
913
914
915 for {
916 ptr := v_0
917 old := v_1
918 new_ := v_2
919 mem := v_3
920 v.reset(OpPPC64LoweredAtomicCas32)
921 v.AuxInt = int64ToAuxInt(1)
922 v.AddArg4(ptr, old, new_, mem)
923 return true
924 }
925 }
926 func rewriteValuePPC64_OpAtomicCompareAndSwap64(v *Value) bool {
927 v_3 := v.Args[3]
928 v_2 := v.Args[2]
929 v_1 := v.Args[1]
930 v_0 := v.Args[0]
931
932
933 for {
934 ptr := v_0
935 old := v_1
936 new_ := v_2
937 mem := v_3
938 v.reset(OpPPC64LoweredAtomicCas64)
939 v.AuxInt = int64ToAuxInt(1)
940 v.AddArg4(ptr, old, new_, mem)
941 return true
942 }
943 }
944 func rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v *Value) bool {
945 v_3 := v.Args[3]
946 v_2 := v.Args[2]
947 v_1 := v.Args[1]
948 v_0 := v.Args[0]
949
950
951 for {
952 ptr := v_0
953 old := v_1
954 new_ := v_2
955 mem := v_3
956 v.reset(OpPPC64LoweredAtomicCas32)
957 v.AuxInt = int64ToAuxInt(0)
958 v.AddArg4(ptr, old, new_, mem)
959 return true
960 }
961 }
962 func rewriteValuePPC64_OpAtomicLoad32(v *Value) bool {
963 v_1 := v.Args[1]
964 v_0 := v.Args[0]
965
966
967 for {
968 ptr := v_0
969 mem := v_1
970 v.reset(OpPPC64LoweredAtomicLoad32)
971 v.AuxInt = int64ToAuxInt(1)
972 v.AddArg2(ptr, mem)
973 return true
974 }
975 }
976 func rewriteValuePPC64_OpAtomicLoad64(v *Value) bool {
977 v_1 := v.Args[1]
978 v_0 := v.Args[0]
979
980
981 for {
982 ptr := v_0
983 mem := v_1
984 v.reset(OpPPC64LoweredAtomicLoad64)
985 v.AuxInt = int64ToAuxInt(1)
986 v.AddArg2(ptr, mem)
987 return true
988 }
989 }
990 func rewriteValuePPC64_OpAtomicLoad8(v *Value) bool {
991 v_1 := v.Args[1]
992 v_0 := v.Args[0]
993
994
995 for {
996 ptr := v_0
997 mem := v_1
998 v.reset(OpPPC64LoweredAtomicLoad8)
999 v.AuxInt = int64ToAuxInt(1)
1000 v.AddArg2(ptr, mem)
1001 return true
1002 }
1003 }
1004 func rewriteValuePPC64_OpAtomicLoadAcq32(v *Value) bool {
1005 v_1 := v.Args[1]
1006 v_0 := v.Args[0]
1007
1008
1009 for {
1010 ptr := v_0
1011 mem := v_1
1012 v.reset(OpPPC64LoweredAtomicLoad32)
1013 v.AuxInt = int64ToAuxInt(0)
1014 v.AddArg2(ptr, mem)
1015 return true
1016 }
1017 }
1018 func rewriteValuePPC64_OpAtomicLoadAcq64(v *Value) bool {
1019 v_1 := v.Args[1]
1020 v_0 := v.Args[0]
1021
1022
1023 for {
1024 ptr := v_0
1025 mem := v_1
1026 v.reset(OpPPC64LoweredAtomicLoad64)
1027 v.AuxInt = int64ToAuxInt(0)
1028 v.AddArg2(ptr, mem)
1029 return true
1030 }
1031 }
1032 func rewriteValuePPC64_OpAtomicLoadPtr(v *Value) bool {
1033 v_1 := v.Args[1]
1034 v_0 := v.Args[0]
1035
1036
1037 for {
1038 ptr := v_0
1039 mem := v_1
1040 v.reset(OpPPC64LoweredAtomicLoadPtr)
1041 v.AuxInt = int64ToAuxInt(1)
1042 v.AddArg2(ptr, mem)
1043 return true
1044 }
1045 }
1046 func rewriteValuePPC64_OpAtomicStore32(v *Value) bool {
1047 v_2 := v.Args[2]
1048 v_1 := v.Args[1]
1049 v_0 := v.Args[0]
1050
1051
1052 for {
1053 ptr := v_0
1054 val := v_1
1055 mem := v_2
1056 v.reset(OpPPC64LoweredAtomicStore32)
1057 v.AuxInt = int64ToAuxInt(1)
1058 v.AddArg3(ptr, val, mem)
1059 return true
1060 }
1061 }
1062 func rewriteValuePPC64_OpAtomicStore64(v *Value) bool {
1063 v_2 := v.Args[2]
1064 v_1 := v.Args[1]
1065 v_0 := v.Args[0]
1066
1067
1068 for {
1069 ptr := v_0
1070 val := v_1
1071 mem := v_2
1072 v.reset(OpPPC64LoweredAtomicStore64)
1073 v.AuxInt = int64ToAuxInt(1)
1074 v.AddArg3(ptr, val, mem)
1075 return true
1076 }
1077 }
1078 func rewriteValuePPC64_OpAtomicStore8(v *Value) bool {
1079 v_2 := v.Args[2]
1080 v_1 := v.Args[1]
1081 v_0 := v.Args[0]
1082
1083
1084 for {
1085 ptr := v_0
1086 val := v_1
1087 mem := v_2
1088 v.reset(OpPPC64LoweredAtomicStore8)
1089 v.AuxInt = int64ToAuxInt(1)
1090 v.AddArg3(ptr, val, mem)
1091 return true
1092 }
1093 }
1094 func rewriteValuePPC64_OpAtomicStoreRel32(v *Value) bool {
1095 v_2 := v.Args[2]
1096 v_1 := v.Args[1]
1097 v_0 := v.Args[0]
1098
1099
1100 for {
1101 ptr := v_0
1102 val := v_1
1103 mem := v_2
1104 v.reset(OpPPC64LoweredAtomicStore32)
1105 v.AuxInt = int64ToAuxInt(0)
1106 v.AddArg3(ptr, val, mem)
1107 return true
1108 }
1109 }
1110 func rewriteValuePPC64_OpAtomicStoreRel64(v *Value) bool {
1111 v_2 := v.Args[2]
1112 v_1 := v.Args[1]
1113 v_0 := v.Args[0]
1114
1115
1116 for {
1117 ptr := v_0
1118 val := v_1
1119 mem := v_2
1120 v.reset(OpPPC64LoweredAtomicStore64)
1121 v.AuxInt = int64ToAuxInt(0)
1122 v.AddArg3(ptr, val, mem)
1123 return true
1124 }
1125 }
1126 func rewriteValuePPC64_OpAvg64u(v *Value) bool {
1127 v_1 := v.Args[1]
1128 v_0 := v.Args[0]
1129 b := v.Block
1130
1131
1132 for {
1133 t := v.Type
1134 x := v_0
1135 y := v_1
1136 v.reset(OpPPC64ADD)
1137 v0 := b.NewValue0(v.Pos, OpPPC64SRDconst, t)
1138 v0.AuxInt = int64ToAuxInt(1)
1139 v1 := b.NewValue0(v.Pos, OpPPC64SUB, t)
1140 v1.AddArg2(x, y)
1141 v0.AddArg(v1)
1142 v.AddArg2(v0, y)
1143 return true
1144 }
1145 }
1146 func rewriteValuePPC64_OpBitLen16(v *Value) bool {
1147 v_0 := v.Args[0]
1148 b := v.Block
1149 typ := &b.Func.Config.Types
1150
1151
1152 for {
1153 x := v_0
1154 v.reset(OpBitLen64)
1155 v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
1156 v0.AddArg(x)
1157 v.AddArg(v0)
1158 return true
1159 }
1160 }
1161 func rewriteValuePPC64_OpBitLen32(v *Value) bool {
1162 v_0 := v.Args[0]
1163 b := v.Block
1164 typ := &b.Func.Config.Types
1165
1166
1167 for {
1168 x := v_0
1169 v.reset(OpPPC64SUBFCconst)
1170 v.AuxInt = int64ToAuxInt(32)
1171 v0 := b.NewValue0(v.Pos, OpPPC64CNTLZW, typ.Int)
1172 v0.AddArg(x)
1173 v.AddArg(v0)
1174 return true
1175 }
1176 }
1177 func rewriteValuePPC64_OpBitLen64(v *Value) bool {
1178 v_0 := v.Args[0]
1179 b := v.Block
1180 typ := &b.Func.Config.Types
1181
1182
1183 for {
1184 x := v_0
1185 v.reset(OpPPC64SUBFCconst)
1186 v.AuxInt = int64ToAuxInt(64)
1187 v0 := b.NewValue0(v.Pos, OpPPC64CNTLZD, typ.Int)
1188 v0.AddArg(x)
1189 v.AddArg(v0)
1190 return true
1191 }
1192 }
1193 func rewriteValuePPC64_OpBitLen8(v *Value) bool {
1194 v_0 := v.Args[0]
1195 b := v.Block
1196 typ := &b.Func.Config.Types
1197
1198
1199 for {
1200 x := v_0
1201 v.reset(OpBitLen64)
1202 v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
1203 v0.AddArg(x)
1204 v.AddArg(v0)
1205 return true
1206 }
1207 }
1208 func rewriteValuePPC64_OpBswap16(v *Value) bool {
1209 v_0 := v.Args[0]
1210 b := v.Block
1211 typ := &b.Func.Config.Types
1212
1213
1214
1215 for {
1216 x := v_0
1217 if !(buildcfg.GOPPC64 >= 10) {
1218 break
1219 }
1220 v.reset(OpPPC64BRH)
1221 v.AddArg(x)
1222 return true
1223 }
1224
1225
1226 for {
1227 x := v_0
1228 if x.Op != OpPPC64MOVHZload {
1229 break
1230 }
1231 off := auxIntToInt32(x.AuxInt)
1232 sym := auxToSym(x.Aux)
1233 mem := x.Args[1]
1234 ptr := x.Args[0]
1235 b = x.Block
1236 v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
1237 v.copyOf(v0)
1238 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
1239 v1.AuxInt = int32ToAuxInt(off)
1240 v1.Aux = symToAux(sym)
1241 v1.AddArg(ptr)
1242 v0.AddArg2(v1, mem)
1243 return true
1244 }
1245
1246
1247 for {
1248 x := v_0
1249 if x.Op != OpPPC64MOVHZloadidx {
1250 break
1251 }
1252 mem := x.Args[2]
1253 ptr := x.Args[0]
1254 idx := x.Args[1]
1255 b = x.Block
1256 v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
1257 v.copyOf(v0)
1258 v0.AddArg3(ptr, idx, mem)
1259 return true
1260 }
1261 return false
1262 }
1263 func rewriteValuePPC64_OpBswap32(v *Value) bool {
1264 v_0 := v.Args[0]
1265 b := v.Block
1266 typ := &b.Func.Config.Types
1267
1268
1269
1270 for {
1271 x := v_0
1272 if !(buildcfg.GOPPC64 >= 10) {
1273 break
1274 }
1275 v.reset(OpPPC64BRW)
1276 v.AddArg(x)
1277 return true
1278 }
1279
1280
1281 for {
1282 x := v_0
1283 if x.Op != OpPPC64MOVWZload {
1284 break
1285 }
1286 off := auxIntToInt32(x.AuxInt)
1287 sym := auxToSym(x.Aux)
1288 mem := x.Args[1]
1289 ptr := x.Args[0]
1290 b = x.Block
1291 v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
1292 v.copyOf(v0)
1293 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
1294 v1.AuxInt = int32ToAuxInt(off)
1295 v1.Aux = symToAux(sym)
1296 v1.AddArg(ptr)
1297 v0.AddArg2(v1, mem)
1298 return true
1299 }
1300
1301
1302 for {
1303 x := v_0
1304 if x.Op != OpPPC64MOVWZloadidx {
1305 break
1306 }
1307 mem := x.Args[2]
1308 ptr := x.Args[0]
1309 idx := x.Args[1]
1310 b = x.Block
1311 v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
1312 v.copyOf(v0)
1313 v0.AddArg3(ptr, idx, mem)
1314 return true
1315 }
1316 return false
1317 }
1318 func rewriteValuePPC64_OpBswap64(v *Value) bool {
1319 v_0 := v.Args[0]
1320 b := v.Block
1321 typ := &b.Func.Config.Types
1322
1323
1324
1325 for {
1326 x := v_0
1327 if !(buildcfg.GOPPC64 >= 10) {
1328 break
1329 }
1330 v.reset(OpPPC64BRD)
1331 v.AddArg(x)
1332 return true
1333 }
1334
1335
1336 for {
1337 x := v_0
1338 if x.Op != OpPPC64MOVDload {
1339 break
1340 }
1341 off := auxIntToInt32(x.AuxInt)
1342 sym := auxToSym(x.Aux)
1343 mem := x.Args[1]
1344 ptr := x.Args[0]
1345 b = x.Block
1346 v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
1347 v.copyOf(v0)
1348 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
1349 v1.AuxInt = int32ToAuxInt(off)
1350 v1.Aux = symToAux(sym)
1351 v1.AddArg(ptr)
1352 v0.AddArg2(v1, mem)
1353 return true
1354 }
1355
1356
1357 for {
1358 x := v_0
1359 if x.Op != OpPPC64MOVDloadidx {
1360 break
1361 }
1362 mem := x.Args[2]
1363 ptr := x.Args[0]
1364 idx := x.Args[1]
1365 b = x.Block
1366 v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
1367 v.copyOf(v0)
1368 v0.AddArg3(ptr, idx, mem)
1369 return true
1370 }
1371 return false
1372 }
1373 func rewriteValuePPC64_OpCom16(v *Value) bool {
1374 v_0 := v.Args[0]
1375
1376
1377 for {
1378 x := v_0
1379 v.reset(OpPPC64NOR)
1380 v.AddArg2(x, x)
1381 return true
1382 }
1383 }
1384 func rewriteValuePPC64_OpCom32(v *Value) bool {
1385 v_0 := v.Args[0]
1386
1387
1388 for {
1389 x := v_0
1390 v.reset(OpPPC64NOR)
1391 v.AddArg2(x, x)
1392 return true
1393 }
1394 }
1395 func rewriteValuePPC64_OpCom64(v *Value) bool {
1396 v_0 := v.Args[0]
1397
1398
1399 for {
1400 x := v_0
1401 v.reset(OpPPC64NOR)
1402 v.AddArg2(x, x)
1403 return true
1404 }
1405 }
1406 func rewriteValuePPC64_OpCom8(v *Value) bool {
1407 v_0 := v.Args[0]
1408
1409
1410 for {
1411 x := v_0
1412 v.reset(OpPPC64NOR)
1413 v.AddArg2(x, x)
1414 return true
1415 }
1416 }
1417 func rewriteValuePPC64_OpCondSelect(v *Value) bool {
1418 v_2 := v.Args[2]
1419 v_1 := v.Args[1]
1420 v_0 := v.Args[0]
1421 b := v.Block
1422 typ := &b.Func.Config.Types
1423
1424
1425 for {
1426 x := v_0
1427 y := v_1
1428 if v_2.Op != OpPPC64SETBC {
1429 break
1430 }
1431 a := auxIntToInt32(v_2.AuxInt)
1432 cmp := v_2.Args[0]
1433 v.reset(OpPPC64ISEL)
1434 v.AuxInt = int32ToAuxInt(a)
1435 v.AddArg3(x, y, cmp)
1436 return true
1437 }
1438
1439
1440 for {
1441 x := v_0
1442 y := v_1
1443 if v_2.Op != OpPPC64SETBCR {
1444 break
1445 }
1446 a := auxIntToInt32(v_2.AuxInt)
1447 cmp := v_2.Args[0]
1448 v.reset(OpPPC64ISEL)
1449 v.AuxInt = int32ToAuxInt(a + 4)
1450 v.AddArg3(x, y, cmp)
1451 return true
1452 }
1453
1454
1455
1456 for {
1457 x := v_0
1458 y := v_1
1459 bool := v_2
1460 if !(flagArg(bool) == nil) {
1461 break
1462 }
1463 v.reset(OpPPC64ISEL)
1464 v.AuxInt = int32ToAuxInt(6)
1465 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
1466 v0.AuxInt = int64ToAuxInt(0)
1467 v1 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
1468 v1.AuxInt = int64ToAuxInt(1)
1469 v1.AddArg(bool)
1470 v0.AddArg(v1)
1471 v.AddArg3(x, y, v0)
1472 return true
1473 }
1474 return false
1475 }
1476 func rewriteValuePPC64_OpConst16(v *Value) bool {
1477
1478
1479 for {
1480 val := auxIntToInt16(v.AuxInt)
1481 v.reset(OpPPC64MOVDconst)
1482 v.AuxInt = int64ToAuxInt(int64(val))
1483 return true
1484 }
1485 }
1486 func rewriteValuePPC64_OpConst32(v *Value) bool {
1487
1488
1489 for {
1490 val := auxIntToInt32(v.AuxInt)
1491 v.reset(OpPPC64MOVDconst)
1492 v.AuxInt = int64ToAuxInt(int64(val))
1493 return true
1494 }
1495 }
1496 func rewriteValuePPC64_OpConst64(v *Value) bool {
1497
1498
1499 for {
1500 val := auxIntToInt64(v.AuxInt)
1501 v.reset(OpPPC64MOVDconst)
1502 v.AuxInt = int64ToAuxInt(int64(val))
1503 return true
1504 }
1505 }
1506 func rewriteValuePPC64_OpConst8(v *Value) bool {
1507
1508
1509 for {
1510 val := auxIntToInt8(v.AuxInt)
1511 v.reset(OpPPC64MOVDconst)
1512 v.AuxInt = int64ToAuxInt(int64(val))
1513 return true
1514 }
1515 }
1516 func rewriteValuePPC64_OpConstBool(v *Value) bool {
1517
1518
1519 for {
1520 t := auxIntToBool(v.AuxInt)
1521 v.reset(OpPPC64MOVDconst)
1522 v.AuxInt = int64ToAuxInt(b2i(t))
1523 return true
1524 }
1525 }
1526 func rewriteValuePPC64_OpConstNil(v *Value) bool {
1527
1528
1529 for {
1530 v.reset(OpPPC64MOVDconst)
1531 v.AuxInt = int64ToAuxInt(0)
1532 return true
1533 }
1534 }
1535 func rewriteValuePPC64_OpCopysign(v *Value) bool {
1536 v_1 := v.Args[1]
1537 v_0 := v.Args[0]
1538
1539
1540 for {
1541 x := v_0
1542 y := v_1
1543 v.reset(OpPPC64FCPSGN)
1544 v.AddArg2(y, x)
1545 return true
1546 }
1547 }
1548 func rewriteValuePPC64_OpCtz16(v *Value) bool {
1549 v_0 := v.Args[0]
1550 b := v.Block
1551 typ := &b.Func.Config.Types
1552
1553
1554
1555 for {
1556 x := v_0
1557 if !(buildcfg.GOPPC64 <= 8) {
1558 break
1559 }
1560 v.reset(OpPPC64POPCNTW)
1561 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
1562 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int16)
1563 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int16)
1564 v2.AuxInt = int64ToAuxInt(-1)
1565 v2.AddArg(x)
1566 v1.AddArg2(v2, x)
1567 v0.AddArg(v1)
1568 v.AddArg(v0)
1569 return true
1570 }
1571
1572
1573
1574 for {
1575 x := v_0
1576 if !(buildcfg.GOPPC64 >= 9) {
1577 break
1578 }
1579 v.reset(OpPPC64CNTTZD)
1580 v0 := b.NewValue0(v.Pos, OpPPC64OR, typ.UInt64)
1581 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
1582 v1.AuxInt = int64ToAuxInt(1 << 16)
1583 v0.AddArg2(x, v1)
1584 v.AddArg(v0)
1585 return true
1586 }
1587 return false
1588 }
1589 func rewriteValuePPC64_OpCtz32(v *Value) bool {
1590 v_0 := v.Args[0]
1591 b := v.Block
1592 typ := &b.Func.Config.Types
1593
1594
1595
1596 for {
1597 x := v_0
1598 if !(buildcfg.GOPPC64 <= 8) {
1599 break
1600 }
1601 v.reset(OpPPC64POPCNTW)
1602 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
1603 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int)
1604 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int)
1605 v2.AuxInt = int64ToAuxInt(-1)
1606 v2.AddArg(x)
1607 v1.AddArg2(v2, x)
1608 v0.AddArg(v1)
1609 v.AddArg(v0)
1610 return true
1611 }
1612
1613
1614
1615 for {
1616 x := v_0
1617 if !(buildcfg.GOPPC64 >= 9) {
1618 break
1619 }
1620 v.reset(OpPPC64CNTTZW)
1621 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
1622 v0.AddArg(x)
1623 v.AddArg(v0)
1624 return true
1625 }
1626 return false
1627 }
1628 func rewriteValuePPC64_OpCtz64(v *Value) bool {
1629 v_0 := v.Args[0]
1630 b := v.Block
1631 typ := &b.Func.Config.Types
1632
1633
1634
1635 for {
1636 x := v_0
1637 if !(buildcfg.GOPPC64 <= 8) {
1638 break
1639 }
1640 v.reset(OpPPC64POPCNTD)
1641 v0 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int64)
1642 v1 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int64)
1643 v1.AuxInt = int64ToAuxInt(-1)
1644 v1.AddArg(x)
1645 v0.AddArg2(v1, x)
1646 v.AddArg(v0)
1647 return true
1648 }
1649
1650
1651
1652 for {
1653 x := v_0
1654 if !(buildcfg.GOPPC64 >= 9) {
1655 break
1656 }
1657 v.reset(OpPPC64CNTTZD)
1658 v.AddArg(x)
1659 return true
1660 }
1661 return false
1662 }
1663 func rewriteValuePPC64_OpCtz8(v *Value) bool {
1664 v_0 := v.Args[0]
1665 b := v.Block
1666 typ := &b.Func.Config.Types
1667
1668
1669
1670 for {
1671 x := v_0
1672 if !(buildcfg.GOPPC64 <= 8) {
1673 break
1674 }
1675 v.reset(OpPPC64POPCNTB)
1676 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
1677 v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.UInt8)
1678 v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.UInt8)
1679 v2.AuxInt = int64ToAuxInt(-1)
1680 v2.AddArg(x)
1681 v1.AddArg2(v2, x)
1682 v0.AddArg(v1)
1683 v.AddArg(v0)
1684 return true
1685 }
1686
1687
1688
1689 for {
1690 x := v_0
1691 if !(buildcfg.GOPPC64 >= 9) {
1692 break
1693 }
1694 v.reset(OpPPC64CNTTZD)
1695 v0 := b.NewValue0(v.Pos, OpPPC64OR, typ.UInt64)
1696 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
1697 v1.AuxInt = int64ToAuxInt(1 << 8)
1698 v0.AddArg2(x, v1)
1699 v.AddArg(v0)
1700 return true
1701 }
1702 return false
1703 }
1704 func rewriteValuePPC64_OpCvt32Fto32(v *Value) bool {
1705 v_0 := v.Args[0]
1706 b := v.Block
1707 typ := &b.Func.Config.Types
1708
1709
1710 for {
1711 x := v_0
1712 v.reset(OpPPC64MFVSRD)
1713 v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
1714 v0.AddArg(x)
1715 v.AddArg(v0)
1716 return true
1717 }
1718 }
1719 func rewriteValuePPC64_OpCvt32Fto64(v *Value) bool {
1720 v_0 := v.Args[0]
1721 b := v.Block
1722 typ := &b.Func.Config.Types
1723
1724
1725 for {
1726 x := v_0
1727 v.reset(OpPPC64MFVSRD)
1728 v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
1729 v0.AddArg(x)
1730 v.AddArg(v0)
1731 return true
1732 }
1733 }
1734 func rewriteValuePPC64_OpCvt32to32F(v *Value) bool {
1735 v_0 := v.Args[0]
1736 b := v.Block
1737 typ := &b.Func.Config.Types
1738
1739
1740 for {
1741 x := v_0
1742 v.reset(OpPPC64FCFIDS)
1743 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1744 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1745 v1.AddArg(x)
1746 v0.AddArg(v1)
1747 v.AddArg(v0)
1748 return true
1749 }
1750 }
1751 func rewriteValuePPC64_OpCvt32to64F(v *Value) bool {
1752 v_0 := v.Args[0]
1753 b := v.Block
1754 typ := &b.Func.Config.Types
1755
1756
1757 for {
1758 x := v_0
1759 v.reset(OpPPC64FCFID)
1760 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1761 v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
1762 v1.AddArg(x)
1763 v0.AddArg(v1)
1764 v.AddArg(v0)
1765 return true
1766 }
1767 }
1768 func rewriteValuePPC64_OpCvt64Fto32(v *Value) bool {
1769 v_0 := v.Args[0]
1770 b := v.Block
1771 typ := &b.Func.Config.Types
1772
1773
1774 for {
1775 x := v_0
1776 v.reset(OpPPC64MFVSRD)
1777 v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
1778 v0.AddArg(x)
1779 v.AddArg(v0)
1780 return true
1781 }
1782 }
1783 func rewriteValuePPC64_OpCvt64Fto64(v *Value) bool {
1784 v_0 := v.Args[0]
1785 b := v.Block
1786 typ := &b.Func.Config.Types
1787
1788
1789 for {
1790 x := v_0
1791 v.reset(OpPPC64MFVSRD)
1792 v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
1793 v0.AddArg(x)
1794 v.AddArg(v0)
1795 return true
1796 }
1797 }
1798 func rewriteValuePPC64_OpCvt64to32F(v *Value) bool {
1799 v_0 := v.Args[0]
1800 b := v.Block
1801 typ := &b.Func.Config.Types
1802
1803
1804 for {
1805 x := v_0
1806 v.reset(OpPPC64FCFIDS)
1807 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1808 v0.AddArg(x)
1809 v.AddArg(v0)
1810 return true
1811 }
1812 }
1813 func rewriteValuePPC64_OpCvt64to64F(v *Value) bool {
1814 v_0 := v.Args[0]
1815 b := v.Block
1816 typ := &b.Func.Config.Types
1817
1818
1819 for {
1820 x := v_0
1821 v.reset(OpPPC64FCFID)
1822 v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
1823 v0.AddArg(x)
1824 v.AddArg(v0)
1825 return true
1826 }
1827 }
1828 func rewriteValuePPC64_OpDiv16(v *Value) bool {
1829 v_1 := v.Args[1]
1830 v_0 := v.Args[0]
1831 b := v.Block
1832 typ := &b.Func.Config.Types
1833
1834
1835 for {
1836 if auxIntToBool(v.AuxInt) != false {
1837 break
1838 }
1839 x := v_0
1840 y := v_1
1841 v.reset(OpPPC64DIVW)
1842 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1843 v0.AddArg(x)
1844 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1845 v1.AddArg(y)
1846 v.AddArg2(v0, v1)
1847 return true
1848 }
1849 return false
1850 }
1851 func rewriteValuePPC64_OpDiv16u(v *Value) bool {
1852 v_1 := v.Args[1]
1853 v_0 := v.Args[0]
1854 b := v.Block
1855 typ := &b.Func.Config.Types
1856
1857
1858 for {
1859 x := v_0
1860 y := v_1
1861 v.reset(OpPPC64DIVWU)
1862 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1863 v0.AddArg(x)
1864 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1865 v1.AddArg(y)
1866 v.AddArg2(v0, v1)
1867 return true
1868 }
1869 }
1870 func rewriteValuePPC64_OpDiv32(v *Value) bool {
1871 v_1 := v.Args[1]
1872 v_0 := v.Args[0]
1873
1874
1875 for {
1876 if auxIntToBool(v.AuxInt) != false {
1877 break
1878 }
1879 x := v_0
1880 y := v_1
1881 v.reset(OpPPC64DIVW)
1882 v.AddArg2(x, y)
1883 return true
1884 }
1885 return false
1886 }
1887 func rewriteValuePPC64_OpDiv64(v *Value) bool {
1888 v_1 := v.Args[1]
1889 v_0 := v.Args[0]
1890
1891
1892 for {
1893 if auxIntToBool(v.AuxInt) != false {
1894 break
1895 }
1896 x := v_0
1897 y := v_1
1898 v.reset(OpPPC64DIVD)
1899 v.AddArg2(x, y)
1900 return true
1901 }
1902 return false
1903 }
1904 func rewriteValuePPC64_OpDiv8(v *Value) bool {
1905 v_1 := v.Args[1]
1906 v_0 := v.Args[0]
1907 b := v.Block
1908 typ := &b.Func.Config.Types
1909
1910
1911 for {
1912 x := v_0
1913 y := v_1
1914 v.reset(OpPPC64DIVW)
1915 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1916 v0.AddArg(x)
1917 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
1918 v1.AddArg(y)
1919 v.AddArg2(v0, v1)
1920 return true
1921 }
1922 }
1923 func rewriteValuePPC64_OpDiv8u(v *Value) bool {
1924 v_1 := v.Args[1]
1925 v_0 := v.Args[0]
1926 b := v.Block
1927 typ := &b.Func.Config.Types
1928
1929
1930 for {
1931 x := v_0
1932 y := v_1
1933 v.reset(OpPPC64DIVWU)
1934 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
1935 v0.AddArg(x)
1936 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
1937 v1.AddArg(y)
1938 v.AddArg2(v0, v1)
1939 return true
1940 }
1941 }
1942 func rewriteValuePPC64_OpEq16(v *Value) bool {
1943 v_1 := v.Args[1]
1944 v_0 := v.Args[0]
1945 b := v.Block
1946 typ := &b.Func.Config.Types
1947
1948
1949
1950 for {
1951 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1952 x := v_0
1953 y := v_1
1954 if !(x.Type.IsSigned() && y.Type.IsSigned()) {
1955 continue
1956 }
1957 v.reset(OpPPC64Equal)
1958 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1959 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1960 v1.AddArg(x)
1961 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
1962 v2.AddArg(y)
1963 v0.AddArg2(v1, v2)
1964 v.AddArg(v0)
1965 return true
1966 }
1967 break
1968 }
1969
1970
1971 for {
1972 x := v_0
1973 y := v_1
1974 v.reset(OpPPC64Equal)
1975 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1976 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1977 v1.AddArg(x)
1978 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
1979 v2.AddArg(y)
1980 v0.AddArg2(v1, v2)
1981 v.AddArg(v0)
1982 return true
1983 }
1984 }
1985 func rewriteValuePPC64_OpEq32(v *Value) bool {
1986 v_1 := v.Args[1]
1987 v_0 := v.Args[0]
1988 b := v.Block
1989
1990
1991 for {
1992 x := v_0
1993 y := v_1
1994 v.reset(OpPPC64Equal)
1995 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
1996 v0.AddArg2(x, y)
1997 v.AddArg(v0)
1998 return true
1999 }
2000 }
2001 func rewriteValuePPC64_OpEq32F(v *Value) bool {
2002 v_1 := v.Args[1]
2003 v_0 := v.Args[0]
2004 b := v.Block
2005
2006
2007 for {
2008 x := v_0
2009 y := v_1
2010 v.reset(OpPPC64Equal)
2011 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2012 v0.AddArg2(x, y)
2013 v.AddArg(v0)
2014 return true
2015 }
2016 }
2017 func rewriteValuePPC64_OpEq64(v *Value) bool {
2018 v_1 := v.Args[1]
2019 v_0 := v.Args[0]
2020 b := v.Block
2021
2022
2023 for {
2024 x := v_0
2025 y := v_1
2026 v.reset(OpPPC64Equal)
2027 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
2028 v0.AddArg2(x, y)
2029 v.AddArg(v0)
2030 return true
2031 }
2032 }
2033 func rewriteValuePPC64_OpEq64F(v *Value) bool {
2034 v_1 := v.Args[1]
2035 v_0 := v.Args[0]
2036 b := v.Block
2037
2038
2039 for {
2040 x := v_0
2041 y := v_1
2042 v.reset(OpPPC64Equal)
2043 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2044 v0.AddArg2(x, y)
2045 v.AddArg(v0)
2046 return true
2047 }
2048 }
2049 func rewriteValuePPC64_OpEq8(v *Value) bool {
2050 v_1 := v.Args[1]
2051 v_0 := v.Args[0]
2052 b := v.Block
2053 typ := &b.Func.Config.Types
2054
2055
2056
2057 for {
2058 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2059 x := v_0
2060 y := v_1
2061 if !(x.Type.IsSigned() && y.Type.IsSigned()) {
2062 continue
2063 }
2064 v.reset(OpPPC64Equal)
2065 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2066 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2067 v1.AddArg(x)
2068 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2069 v2.AddArg(y)
2070 v0.AddArg2(v1, v2)
2071 v.AddArg(v0)
2072 return true
2073 }
2074 break
2075 }
2076
2077
2078 for {
2079 x := v_0
2080 y := v_1
2081 v.reset(OpPPC64Equal)
2082 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2083 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2084 v1.AddArg(x)
2085 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2086 v2.AddArg(y)
2087 v0.AddArg2(v1, v2)
2088 v.AddArg(v0)
2089 return true
2090 }
2091 }
2092 func rewriteValuePPC64_OpEqB(v *Value) bool {
2093 v_1 := v.Args[1]
2094 v_0 := v.Args[0]
2095 b := v.Block
2096 typ := &b.Func.Config.Types
2097
2098
2099 for {
2100 x := v_0
2101 y := v_1
2102 v.reset(OpPPC64ANDconst)
2103 v.AuxInt = int64ToAuxInt(1)
2104 v0 := b.NewValue0(v.Pos, OpPPC64EQV, typ.Int64)
2105 v0.AddArg2(x, y)
2106 v.AddArg(v0)
2107 return true
2108 }
2109 }
2110 func rewriteValuePPC64_OpEqPtr(v *Value) bool {
2111 v_1 := v.Args[1]
2112 v_0 := v.Args[0]
2113 b := v.Block
2114
2115
2116 for {
2117 x := v_0
2118 y := v_1
2119 v.reset(OpPPC64Equal)
2120 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
2121 v0.AddArg2(x, y)
2122 v.AddArg(v0)
2123 return true
2124 }
2125 }
2126 func rewriteValuePPC64_OpIsInBounds(v *Value) bool {
2127 v_1 := v.Args[1]
2128 v_0 := v.Args[0]
2129 b := v.Block
2130
2131
2132 for {
2133 idx := v_0
2134 len := v_1
2135 v.reset(OpPPC64LessThan)
2136 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2137 v0.AddArg2(idx, len)
2138 v.AddArg(v0)
2139 return true
2140 }
2141 }
2142 func rewriteValuePPC64_OpIsNonNil(v *Value) bool {
2143 v_0 := v.Args[0]
2144 b := v.Block
2145
2146
2147 for {
2148 ptr := v_0
2149 v.reset(OpPPC64NotEqual)
2150 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
2151 v0.AuxInt = int64ToAuxInt(0)
2152 v0.AddArg(ptr)
2153 v.AddArg(v0)
2154 return true
2155 }
2156 }
2157 func rewriteValuePPC64_OpIsSliceInBounds(v *Value) bool {
2158 v_1 := v.Args[1]
2159 v_0 := v.Args[0]
2160 b := v.Block
2161
2162
2163 for {
2164 idx := v_0
2165 len := v_1
2166 v.reset(OpPPC64LessEqual)
2167 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2168 v0.AddArg2(idx, len)
2169 v.AddArg(v0)
2170 return true
2171 }
2172 }
2173 func rewriteValuePPC64_OpLeq16(v *Value) bool {
2174 v_1 := v.Args[1]
2175 v_0 := v.Args[0]
2176 b := v.Block
2177 typ := &b.Func.Config.Types
2178
2179
2180 for {
2181 x := v_0
2182 y := v_1
2183 v.reset(OpPPC64LessEqual)
2184 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2185 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2186 v1.AddArg(x)
2187 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2188 v2.AddArg(y)
2189 v0.AddArg2(v1, v2)
2190 v.AddArg(v0)
2191 return true
2192 }
2193 }
2194 func rewriteValuePPC64_OpLeq16U(v *Value) bool {
2195 v_1 := v.Args[1]
2196 v_0 := v.Args[0]
2197 b := v.Block
2198 typ := &b.Func.Config.Types
2199
2200
2201 for {
2202 x := v_0
2203 y := v_1
2204 v.reset(OpPPC64LessEqual)
2205 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2206 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2207 v1.AddArg(x)
2208 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2209 v2.AddArg(y)
2210 v0.AddArg2(v1, v2)
2211 v.AddArg(v0)
2212 return true
2213 }
2214 }
2215 func rewriteValuePPC64_OpLeq32(v *Value) bool {
2216 v_1 := v.Args[1]
2217 v_0 := v.Args[0]
2218 b := v.Block
2219
2220
2221 for {
2222 x := v_0
2223 y := v_1
2224 v.reset(OpPPC64LessEqual)
2225 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2226 v0.AddArg2(x, y)
2227 v.AddArg(v0)
2228 return true
2229 }
2230 }
2231 func rewriteValuePPC64_OpLeq32F(v *Value) bool {
2232 v_1 := v.Args[1]
2233 v_0 := v.Args[0]
2234 b := v.Block
2235
2236
2237 for {
2238 x := v_0
2239 y := v_1
2240 v.reset(OpPPC64FLessEqual)
2241 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2242 v0.AddArg2(x, y)
2243 v.AddArg(v0)
2244 return true
2245 }
2246 }
2247 func rewriteValuePPC64_OpLeq32U(v *Value) bool {
2248 v_1 := v.Args[1]
2249 v_0 := v.Args[0]
2250 b := v.Block
2251
2252
2253 for {
2254 x := v_0
2255 y := v_1
2256 v.reset(OpPPC64LessEqual)
2257 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2258 v0.AddArg2(x, y)
2259 v.AddArg(v0)
2260 return true
2261 }
2262 }
2263 func rewriteValuePPC64_OpLeq64(v *Value) bool {
2264 v_1 := v.Args[1]
2265 v_0 := v.Args[0]
2266 b := v.Block
2267
2268
2269 for {
2270 x := v_0
2271 y := v_1
2272 v.reset(OpPPC64LessEqual)
2273 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
2274 v0.AddArg2(x, y)
2275 v.AddArg(v0)
2276 return true
2277 }
2278 }
2279 func rewriteValuePPC64_OpLeq64F(v *Value) bool {
2280 v_1 := v.Args[1]
2281 v_0 := v.Args[0]
2282 b := v.Block
2283
2284
2285 for {
2286 x := v_0
2287 y := v_1
2288 v.reset(OpPPC64FLessEqual)
2289 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2290 v0.AddArg2(x, y)
2291 v.AddArg(v0)
2292 return true
2293 }
2294 }
2295 func rewriteValuePPC64_OpLeq64U(v *Value) bool {
2296 v_1 := v.Args[1]
2297 v_0 := v.Args[0]
2298 b := v.Block
2299
2300
2301 for {
2302 x := v_0
2303 y := v_1
2304 v.reset(OpPPC64LessEqual)
2305 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2306 v0.AddArg2(x, y)
2307 v.AddArg(v0)
2308 return true
2309 }
2310 }
2311 func rewriteValuePPC64_OpLeq8(v *Value) bool {
2312 v_1 := v.Args[1]
2313 v_0 := v.Args[0]
2314 b := v.Block
2315 typ := &b.Func.Config.Types
2316
2317
2318 for {
2319 x := v_0
2320 y := v_1
2321 v.reset(OpPPC64LessEqual)
2322 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2323 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2324 v1.AddArg(x)
2325 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2326 v2.AddArg(y)
2327 v0.AddArg2(v1, v2)
2328 v.AddArg(v0)
2329 return true
2330 }
2331 }
2332 func rewriteValuePPC64_OpLeq8U(v *Value) bool {
2333 v_1 := v.Args[1]
2334 v_0 := v.Args[0]
2335 b := v.Block
2336 typ := &b.Func.Config.Types
2337
2338
2339 for {
2340 x := v_0
2341 y := v_1
2342 v.reset(OpPPC64LessEqual)
2343 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2344 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2345 v1.AddArg(x)
2346 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2347 v2.AddArg(y)
2348 v0.AddArg2(v1, v2)
2349 v.AddArg(v0)
2350 return true
2351 }
2352 }
2353 func rewriteValuePPC64_OpLess16(v *Value) bool {
2354 v_1 := v.Args[1]
2355 v_0 := v.Args[0]
2356 b := v.Block
2357 typ := &b.Func.Config.Types
2358
2359
2360 for {
2361 x := v_0
2362 y := v_1
2363 v.reset(OpPPC64LessThan)
2364 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2365 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2366 v1.AddArg(x)
2367 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
2368 v2.AddArg(y)
2369 v0.AddArg2(v1, v2)
2370 v.AddArg(v0)
2371 return true
2372 }
2373 }
2374 func rewriteValuePPC64_OpLess16U(v *Value) bool {
2375 v_1 := v.Args[1]
2376 v_0 := v.Args[0]
2377 b := v.Block
2378 typ := &b.Func.Config.Types
2379
2380
2381 for {
2382 x := v_0
2383 y := v_1
2384 v.reset(OpPPC64LessThan)
2385 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2386 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2387 v1.AddArg(x)
2388 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
2389 v2.AddArg(y)
2390 v0.AddArg2(v1, v2)
2391 v.AddArg(v0)
2392 return true
2393 }
2394 }
2395 func rewriteValuePPC64_OpLess32(v *Value) bool {
2396 v_1 := v.Args[1]
2397 v_0 := v.Args[0]
2398 b := v.Block
2399
2400
2401 for {
2402 x := v_0
2403 y := v_1
2404 v.reset(OpPPC64LessThan)
2405 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2406 v0.AddArg2(x, y)
2407 v.AddArg(v0)
2408 return true
2409 }
2410 }
2411 func rewriteValuePPC64_OpLess32F(v *Value) bool {
2412 v_1 := v.Args[1]
2413 v_0 := v.Args[0]
2414 b := v.Block
2415
2416
2417 for {
2418 x := v_0
2419 y := v_1
2420 v.reset(OpPPC64FLessThan)
2421 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2422 v0.AddArg2(x, y)
2423 v.AddArg(v0)
2424 return true
2425 }
2426 }
2427 func rewriteValuePPC64_OpLess32U(v *Value) bool {
2428 v_1 := v.Args[1]
2429 v_0 := v.Args[0]
2430 b := v.Block
2431
2432
2433 for {
2434 x := v_0
2435 y := v_1
2436 v.reset(OpPPC64LessThan)
2437 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2438 v0.AddArg2(x, y)
2439 v.AddArg(v0)
2440 return true
2441 }
2442 }
2443 func rewriteValuePPC64_OpLess64(v *Value) bool {
2444 v_1 := v.Args[1]
2445 v_0 := v.Args[0]
2446 b := v.Block
2447
2448
2449 for {
2450 x := v_0
2451 y := v_1
2452 v.reset(OpPPC64LessThan)
2453 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
2454 v0.AddArg2(x, y)
2455 v.AddArg(v0)
2456 return true
2457 }
2458 }
2459 func rewriteValuePPC64_OpLess64F(v *Value) bool {
2460 v_1 := v.Args[1]
2461 v_0 := v.Args[0]
2462 b := v.Block
2463
2464
2465 for {
2466 x := v_0
2467 y := v_1
2468 v.reset(OpPPC64FLessThan)
2469 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
2470 v0.AddArg2(x, y)
2471 v.AddArg(v0)
2472 return true
2473 }
2474 }
2475 func rewriteValuePPC64_OpLess64U(v *Value) bool {
2476 v_1 := v.Args[1]
2477 v_0 := v.Args[0]
2478 b := v.Block
2479
2480
2481 for {
2482 x := v_0
2483 y := v_1
2484 v.reset(OpPPC64LessThan)
2485 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
2486 v0.AddArg2(x, y)
2487 v.AddArg(v0)
2488 return true
2489 }
2490 }
2491 func rewriteValuePPC64_OpLess8(v *Value) bool {
2492 v_1 := v.Args[1]
2493 v_0 := v.Args[0]
2494 b := v.Block
2495 typ := &b.Func.Config.Types
2496
2497
2498 for {
2499 x := v_0
2500 y := v_1
2501 v.reset(OpPPC64LessThan)
2502 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
2503 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2504 v1.AddArg(x)
2505 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
2506 v2.AddArg(y)
2507 v0.AddArg2(v1, v2)
2508 v.AddArg(v0)
2509 return true
2510 }
2511 }
2512 func rewriteValuePPC64_OpLess8U(v *Value) bool {
2513 v_1 := v.Args[1]
2514 v_0 := v.Args[0]
2515 b := v.Block
2516 typ := &b.Func.Config.Types
2517
2518
2519 for {
2520 x := v_0
2521 y := v_1
2522 v.reset(OpPPC64LessThan)
2523 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
2524 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2525 v1.AddArg(x)
2526 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
2527 v2.AddArg(y)
2528 v0.AddArg2(v1, v2)
2529 v.AddArg(v0)
2530 return true
2531 }
2532 }
2533 func rewriteValuePPC64_OpLoad(v *Value) bool {
2534 v_1 := v.Args[1]
2535 v_0 := v.Args[0]
2536 b := v.Block
2537 typ := &b.Func.Config.Types
2538
2539
2540
2541 for {
2542 t := v.Type
2543 ptr := v_0
2544 mem := v_1
2545 if !(is64BitInt(t) || isPtr(t)) {
2546 break
2547 }
2548 v.reset(OpPPC64MOVDload)
2549 v.AddArg2(ptr, mem)
2550 return true
2551 }
2552
2553
2554
2555 for {
2556 t := v.Type
2557 ptr := v_0
2558 mem := v_1
2559 if !(is32BitInt(t) && t.IsSigned()) {
2560 break
2561 }
2562 v.reset(OpPPC64MOVWload)
2563 v.AddArg2(ptr, mem)
2564 return true
2565 }
2566
2567
2568
2569 for {
2570 t := v.Type
2571 ptr := v_0
2572 mem := v_1
2573 if !(is32BitInt(t) && !t.IsSigned()) {
2574 break
2575 }
2576 v.reset(OpPPC64MOVWZload)
2577 v.AddArg2(ptr, mem)
2578 return true
2579 }
2580
2581
2582
2583 for {
2584 t := v.Type
2585 ptr := v_0
2586 mem := v_1
2587 if !(is16BitInt(t) && t.IsSigned()) {
2588 break
2589 }
2590 v.reset(OpPPC64MOVHload)
2591 v.AddArg2(ptr, mem)
2592 return true
2593 }
2594
2595
2596
2597 for {
2598 t := v.Type
2599 ptr := v_0
2600 mem := v_1
2601 if !(is16BitInt(t) && !t.IsSigned()) {
2602 break
2603 }
2604 v.reset(OpPPC64MOVHZload)
2605 v.AddArg2(ptr, mem)
2606 return true
2607 }
2608
2609
2610
2611 for {
2612 t := v.Type
2613 ptr := v_0
2614 mem := v_1
2615 if !(t.IsBoolean()) {
2616 break
2617 }
2618 v.reset(OpPPC64MOVBZload)
2619 v.AddArg2(ptr, mem)
2620 return true
2621 }
2622
2623
2624
2625 for {
2626 t := v.Type
2627 ptr := v_0
2628 mem := v_1
2629 if !(is8BitInt(t) && t.IsSigned()) {
2630 break
2631 }
2632 v.reset(OpPPC64MOVBreg)
2633 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
2634 v0.AddArg2(ptr, mem)
2635 v.AddArg(v0)
2636 return true
2637 }
2638
2639
2640
2641 for {
2642 t := v.Type
2643 ptr := v_0
2644 mem := v_1
2645 if !(is8BitInt(t) && !t.IsSigned()) {
2646 break
2647 }
2648 v.reset(OpPPC64MOVBZload)
2649 v.AddArg2(ptr, mem)
2650 return true
2651 }
2652
2653
2654
2655 for {
2656 t := v.Type
2657 ptr := v_0
2658 mem := v_1
2659 if !(is32BitFloat(t)) {
2660 break
2661 }
2662 v.reset(OpPPC64FMOVSload)
2663 v.AddArg2(ptr, mem)
2664 return true
2665 }
2666
2667
2668
2669 for {
2670 t := v.Type
2671 ptr := v_0
2672 mem := v_1
2673 if !(is64BitFloat(t)) {
2674 break
2675 }
2676 v.reset(OpPPC64FMOVDload)
2677 v.AddArg2(ptr, mem)
2678 return true
2679 }
2680 return false
2681 }
2682 func rewriteValuePPC64_OpLocalAddr(v *Value) bool {
2683 v_1 := v.Args[1]
2684 v_0 := v.Args[0]
2685 b := v.Block
2686 typ := &b.Func.Config.Types
2687
2688
2689
2690 for {
2691 t := v.Type
2692 sym := auxToSym(v.Aux)
2693 base := v_0
2694 mem := v_1
2695 if !(t.Elem().HasPointers()) {
2696 break
2697 }
2698 v.reset(OpPPC64MOVDaddr)
2699 v.Aux = symToAux(sym)
2700 v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
2701 v0.AddArg2(base, mem)
2702 v.AddArg(v0)
2703 return true
2704 }
2705
2706
2707
2708 for {
2709 t := v.Type
2710 sym := auxToSym(v.Aux)
2711 base := v_0
2712 if !(!t.Elem().HasPointers()) {
2713 break
2714 }
2715 v.reset(OpPPC64MOVDaddr)
2716 v.Aux = symToAux(sym)
2717 v.AddArg(base)
2718 return true
2719 }
2720 return false
2721 }
2722 func rewriteValuePPC64_OpLsh16x16(v *Value) bool {
2723 v_1 := v.Args[1]
2724 v_0 := v.Args[0]
2725 b := v.Block
2726 typ := &b.Func.Config.Types
2727
2728
2729
2730 for {
2731 x := v_0
2732 y := v_1
2733 if !(shiftIsBounded(v)) {
2734 break
2735 }
2736 v.reset(OpPPC64SLD)
2737 v.AddArg2(x, y)
2738 return true
2739 }
2740
2741
2742 for {
2743 t := v.Type
2744 x := v_0
2745 y := v_1
2746 v.reset(OpPPC64ISEL)
2747 v.AuxInt = int32ToAuxInt(2)
2748 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2749 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
2750 v1.AddArg(x)
2751 v0.AddArg2(v1, y)
2752 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2753 v2.AuxInt = int64ToAuxInt(0)
2754 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
2755 v3.AuxInt = int64ToAuxInt(0)
2756 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
2757 v4.AuxInt = int64ToAuxInt(0xFFF0)
2758 v4.AddArg(y)
2759 v3.AddArg(v4)
2760 v.AddArg3(v0, v2, v3)
2761 return true
2762 }
2763 }
2764 func rewriteValuePPC64_OpLsh16x32(v *Value) bool {
2765 v_1 := v.Args[1]
2766 v_0 := v.Args[0]
2767 b := v.Block
2768 typ := &b.Func.Config.Types
2769
2770
2771
2772 for {
2773 x := v_0
2774 y := v_1
2775 if !(shiftIsBounded(v)) {
2776 break
2777 }
2778 v.reset(OpPPC64SLD)
2779 v.AddArg2(x, y)
2780 return true
2781 }
2782
2783
2784 for {
2785 t := v.Type
2786 x := v_0
2787 y := v_1
2788 v.reset(OpPPC64ISEL)
2789 v.AuxInt = int32ToAuxInt(0)
2790 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2791 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
2792 v1.AddArg(x)
2793 v0.AddArg2(v1, y)
2794 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2795 v2.AuxInt = int64ToAuxInt(0)
2796 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
2797 v3.AuxInt = int32ToAuxInt(16)
2798 v3.AddArg(y)
2799 v.AddArg3(v0, v2, v3)
2800 return true
2801 }
2802 }
2803 func rewriteValuePPC64_OpLsh16x64(v *Value) bool {
2804 v_1 := v.Args[1]
2805 v_0 := v.Args[0]
2806 b := v.Block
2807 typ := &b.Func.Config.Types
2808
2809
2810
2811 for {
2812 x := v_0
2813 if v_1.Op != OpPPC64MOVDconst {
2814 break
2815 }
2816 c := auxIntToInt64(v_1.AuxInt)
2817 if !(uint64(c) < 16) {
2818 break
2819 }
2820 v.reset(OpPPC64SLWconst)
2821 v.AuxInt = int64ToAuxInt(c)
2822 v.AddArg(x)
2823 return true
2824 }
2825
2826
2827
2828 for {
2829 x := v_0
2830 y := v_1
2831 if !(shiftIsBounded(v)) {
2832 break
2833 }
2834 v.reset(OpPPC64SLD)
2835 v.AddArg2(x, y)
2836 return true
2837 }
2838
2839
2840 for {
2841 t := v.Type
2842 x := v_0
2843 y := v_1
2844 v.reset(OpPPC64ISEL)
2845 v.AuxInt = int32ToAuxInt(0)
2846 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2847 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
2848 v1.AddArg(x)
2849 v0.AddArg2(v1, y)
2850 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2851 v2.AuxInt = int64ToAuxInt(0)
2852 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
2853 v3.AuxInt = int64ToAuxInt(16)
2854 v3.AddArg(y)
2855 v.AddArg3(v0, v2, v3)
2856 return true
2857 }
2858 }
2859 func rewriteValuePPC64_OpLsh16x8(v *Value) bool {
2860 v_1 := v.Args[1]
2861 v_0 := v.Args[0]
2862 b := v.Block
2863 typ := &b.Func.Config.Types
2864
2865
2866
2867 for {
2868 x := v_0
2869 y := v_1
2870 if !(shiftIsBounded(v)) {
2871 break
2872 }
2873 v.reset(OpPPC64SLD)
2874 v.AddArg2(x, y)
2875 return true
2876 }
2877
2878
2879 for {
2880 t := v.Type
2881 x := v_0
2882 y := v_1
2883 v.reset(OpPPC64ISEL)
2884 v.AuxInt = int32ToAuxInt(2)
2885 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
2886 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
2887 v1.AddArg(x)
2888 v0.AddArg2(v1, y)
2889 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2890 v2.AuxInt = int64ToAuxInt(0)
2891 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
2892 v3.AuxInt = int64ToAuxInt(0)
2893 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
2894 v4.AuxInt = int64ToAuxInt(0x00F0)
2895 v4.AddArg(y)
2896 v3.AddArg(v4)
2897 v.AddArg3(v0, v2, v3)
2898 return true
2899 }
2900 }
2901 func rewriteValuePPC64_OpLsh32x16(v *Value) bool {
2902 v_1 := v.Args[1]
2903 v_0 := v.Args[0]
2904 b := v.Block
2905 typ := &b.Func.Config.Types
2906
2907
2908
2909 for {
2910 x := v_0
2911 y := v_1
2912 if !(shiftIsBounded(v)) {
2913 break
2914 }
2915 v.reset(OpPPC64SLW)
2916 v.AddArg2(x, y)
2917 return true
2918 }
2919
2920
2921 for {
2922 t := v.Type
2923 x := v_0
2924 y := v_1
2925 v.reset(OpPPC64ISEL)
2926 v.AuxInt = int32ToAuxInt(2)
2927 v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
2928 v0.AddArg2(x, y)
2929 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2930 v1.AuxInt = int64ToAuxInt(0)
2931 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
2932 v2.AuxInt = int64ToAuxInt(0)
2933 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
2934 v3.AuxInt = int64ToAuxInt(0xFFE0)
2935 v3.AddArg(y)
2936 v2.AddArg(v3)
2937 v.AddArg3(v0, v1, v2)
2938 return true
2939 }
2940 }
2941 func rewriteValuePPC64_OpLsh32x32(v *Value) bool {
2942 v_1 := v.Args[1]
2943 v_0 := v.Args[0]
2944 b := v.Block
2945 typ := &b.Func.Config.Types
2946
2947
2948
2949 for {
2950 x := v_0
2951 y := v_1
2952 if !(shiftIsBounded(v)) {
2953 break
2954 }
2955 v.reset(OpPPC64SLW)
2956 v.AddArg2(x, y)
2957 return true
2958 }
2959
2960
2961 for {
2962 t := v.Type
2963 x := v_0
2964 y := v_1
2965 v.reset(OpPPC64ISEL)
2966 v.AuxInt = int32ToAuxInt(0)
2967 v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
2968 v0.AddArg2(x, y)
2969 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
2970 v1.AuxInt = int64ToAuxInt(0)
2971 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
2972 v2.AuxInt = int32ToAuxInt(32)
2973 v2.AddArg(y)
2974 v.AddArg3(v0, v1, v2)
2975 return true
2976 }
2977 }
2978 func rewriteValuePPC64_OpLsh32x64(v *Value) bool {
2979 v_1 := v.Args[1]
2980 v_0 := v.Args[0]
2981 b := v.Block
2982 typ := &b.Func.Config.Types
2983
2984
2985
2986 for {
2987 x := v_0
2988 if v_1.Op != OpPPC64MOVDconst {
2989 break
2990 }
2991 c := auxIntToInt64(v_1.AuxInt)
2992 if !(uint64(c) < 32) {
2993 break
2994 }
2995 v.reset(OpPPC64SLWconst)
2996 v.AuxInt = int64ToAuxInt(c)
2997 v.AddArg(x)
2998 return true
2999 }
3000
3001
3002
3003 for {
3004 x := v_0
3005 y := v_1
3006 if !(shiftIsBounded(v)) {
3007 break
3008 }
3009 v.reset(OpPPC64SLW)
3010 v.AddArg2(x, y)
3011 return true
3012 }
3013
3014
3015 for {
3016 t := v.Type
3017 x := v_0
3018 y := v_1
3019 v.reset(OpPPC64ISEL)
3020 v.AuxInt = int32ToAuxInt(0)
3021 v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
3022 v0.AddArg2(x, y)
3023 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3024 v1.AuxInt = int64ToAuxInt(0)
3025 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
3026 v2.AuxInt = int64ToAuxInt(32)
3027 v2.AddArg(y)
3028 v.AddArg3(v0, v1, v2)
3029 return true
3030 }
3031 }
3032 func rewriteValuePPC64_OpLsh32x8(v *Value) bool {
3033 v_1 := v.Args[1]
3034 v_0 := v.Args[0]
3035 b := v.Block
3036 typ := &b.Func.Config.Types
3037
3038
3039
3040 for {
3041 x := v_0
3042 y := v_1
3043 if !(shiftIsBounded(v)) {
3044 break
3045 }
3046 v.reset(OpPPC64SLW)
3047 v.AddArg2(x, y)
3048 return true
3049 }
3050
3051
3052 for {
3053 t := v.Type
3054 x := v_0
3055 y := v_1
3056 v.reset(OpPPC64ISEL)
3057 v.AuxInt = int32ToAuxInt(2)
3058 v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
3059 v0.AddArg2(x, y)
3060 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3061 v1.AuxInt = int64ToAuxInt(0)
3062 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
3063 v2.AuxInt = int64ToAuxInt(0)
3064 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
3065 v3.AuxInt = int64ToAuxInt(0x00E0)
3066 v3.AddArg(y)
3067 v2.AddArg(v3)
3068 v.AddArg3(v0, v1, v2)
3069 return true
3070 }
3071 }
3072 func rewriteValuePPC64_OpLsh64x16(v *Value) bool {
3073 v_1 := v.Args[1]
3074 v_0 := v.Args[0]
3075 b := v.Block
3076 typ := &b.Func.Config.Types
3077
3078
3079
3080 for {
3081 x := v_0
3082 y := v_1
3083 if !(shiftIsBounded(v)) {
3084 break
3085 }
3086 v.reset(OpPPC64SLD)
3087 v.AddArg2(x, y)
3088 return true
3089 }
3090
3091
3092 for {
3093 t := v.Type
3094 x := v_0
3095 y := v_1
3096 v.reset(OpPPC64ISEL)
3097 v.AuxInt = int32ToAuxInt(2)
3098 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3099 v0.AddArg2(x, y)
3100 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3101 v1.AuxInt = int64ToAuxInt(0)
3102 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
3103 v2.AuxInt = int64ToAuxInt(0)
3104 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
3105 v3.AuxInt = int64ToAuxInt(0xFFC0)
3106 v3.AddArg(y)
3107 v2.AddArg(v3)
3108 v.AddArg3(v0, v1, v2)
3109 return true
3110 }
3111 }
3112 func rewriteValuePPC64_OpLsh64x32(v *Value) bool {
3113 v_1 := v.Args[1]
3114 v_0 := v.Args[0]
3115 b := v.Block
3116 typ := &b.Func.Config.Types
3117
3118
3119
3120 for {
3121 x := v_0
3122 y := v_1
3123 if !(shiftIsBounded(v)) {
3124 break
3125 }
3126 v.reset(OpPPC64SLD)
3127 v.AddArg2(x, y)
3128 return true
3129 }
3130
3131
3132 for {
3133 t := v.Type
3134 x := v_0
3135 y := v_1
3136 v.reset(OpPPC64ISEL)
3137 v.AuxInt = int32ToAuxInt(0)
3138 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3139 v0.AddArg2(x, y)
3140 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3141 v1.AuxInt = int64ToAuxInt(0)
3142 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
3143 v2.AuxInt = int32ToAuxInt(64)
3144 v2.AddArg(y)
3145 v.AddArg3(v0, v1, v2)
3146 return true
3147 }
3148 }
3149 func rewriteValuePPC64_OpLsh64x64(v *Value) bool {
3150 v_1 := v.Args[1]
3151 v_0 := v.Args[0]
3152 b := v.Block
3153 typ := &b.Func.Config.Types
3154
3155
3156
3157 for {
3158 x := v_0
3159 if v_1.Op != OpPPC64MOVDconst {
3160 break
3161 }
3162 c := auxIntToInt64(v_1.AuxInt)
3163 if !(uint64(c) < 64) {
3164 break
3165 }
3166 v.reset(OpPPC64SLDconst)
3167 v.AuxInt = int64ToAuxInt(c)
3168 v.AddArg(x)
3169 return true
3170 }
3171
3172
3173
3174 for {
3175 x := v_0
3176 y := v_1
3177 if !(shiftIsBounded(v)) {
3178 break
3179 }
3180 v.reset(OpPPC64SLD)
3181 v.AddArg2(x, y)
3182 return true
3183 }
3184
3185
3186 for {
3187 t := v.Type
3188 x := v_0
3189 y := v_1
3190 v.reset(OpPPC64ISEL)
3191 v.AuxInt = int32ToAuxInt(0)
3192 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3193 v0.AddArg2(x, y)
3194 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3195 v1.AuxInt = int64ToAuxInt(0)
3196 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
3197 v2.AuxInt = int64ToAuxInt(64)
3198 v2.AddArg(y)
3199 v.AddArg3(v0, v1, v2)
3200 return true
3201 }
3202 }
3203 func rewriteValuePPC64_OpLsh64x8(v *Value) bool {
3204 v_1 := v.Args[1]
3205 v_0 := v.Args[0]
3206 b := v.Block
3207 typ := &b.Func.Config.Types
3208
3209
3210
3211 for {
3212 x := v_0
3213 y := v_1
3214 if !(shiftIsBounded(v)) {
3215 break
3216 }
3217 v.reset(OpPPC64SLD)
3218 v.AddArg2(x, y)
3219 return true
3220 }
3221
3222
3223 for {
3224 t := v.Type
3225 x := v_0
3226 y := v_1
3227 v.reset(OpPPC64ISEL)
3228 v.AuxInt = int32ToAuxInt(2)
3229 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3230 v0.AddArg2(x, y)
3231 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3232 v1.AuxInt = int64ToAuxInt(0)
3233 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
3234 v2.AuxInt = int64ToAuxInt(0)
3235 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
3236 v3.AuxInt = int64ToAuxInt(0x00C0)
3237 v3.AddArg(y)
3238 v2.AddArg(v3)
3239 v.AddArg3(v0, v1, v2)
3240 return true
3241 }
3242 }
3243 func rewriteValuePPC64_OpLsh8x16(v *Value) bool {
3244 v_1 := v.Args[1]
3245 v_0 := v.Args[0]
3246 b := v.Block
3247 typ := &b.Func.Config.Types
3248
3249
3250
3251 for {
3252 x := v_0
3253 y := v_1
3254 if !(shiftIsBounded(v)) {
3255 break
3256 }
3257 v.reset(OpPPC64SLD)
3258 v.AddArg2(x, y)
3259 return true
3260 }
3261
3262
3263 for {
3264 t := v.Type
3265 x := v_0
3266 y := v_1
3267 v.reset(OpPPC64ISEL)
3268 v.AuxInt = int32ToAuxInt(2)
3269 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3270 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
3271 v1.AddArg(x)
3272 v0.AddArg2(v1, y)
3273 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3274 v2.AuxInt = int64ToAuxInt(0)
3275 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
3276 v3.AuxInt = int64ToAuxInt(0)
3277 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
3278 v4.AuxInt = int64ToAuxInt(0xFFF8)
3279 v4.AddArg(y)
3280 v3.AddArg(v4)
3281 v.AddArg3(v0, v2, v3)
3282 return true
3283 }
3284 }
3285 func rewriteValuePPC64_OpLsh8x32(v *Value) bool {
3286 v_1 := v.Args[1]
3287 v_0 := v.Args[0]
3288 b := v.Block
3289 typ := &b.Func.Config.Types
3290
3291
3292
3293 for {
3294 x := v_0
3295 y := v_1
3296 if !(shiftIsBounded(v)) {
3297 break
3298 }
3299 v.reset(OpPPC64SLD)
3300 v.AddArg2(x, y)
3301 return true
3302 }
3303
3304
3305 for {
3306 t := v.Type
3307 x := v_0
3308 y := v_1
3309 v.reset(OpPPC64ISEL)
3310 v.AuxInt = int32ToAuxInt(0)
3311 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3312 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
3313 v1.AddArg(x)
3314 v0.AddArg2(v1, y)
3315 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3316 v2.AuxInt = int64ToAuxInt(0)
3317 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
3318 v3.AuxInt = int32ToAuxInt(8)
3319 v3.AddArg(y)
3320 v.AddArg3(v0, v2, v3)
3321 return true
3322 }
3323 }
3324 func rewriteValuePPC64_OpLsh8x64(v *Value) bool {
3325 v_1 := v.Args[1]
3326 v_0 := v.Args[0]
3327 b := v.Block
3328 typ := &b.Func.Config.Types
3329
3330
3331
3332 for {
3333 x := v_0
3334 if v_1.Op != OpPPC64MOVDconst {
3335 break
3336 }
3337 c := auxIntToInt64(v_1.AuxInt)
3338 if !(uint64(c) < 8) {
3339 break
3340 }
3341 v.reset(OpPPC64SLWconst)
3342 v.AuxInt = int64ToAuxInt(c)
3343 v.AddArg(x)
3344 return true
3345 }
3346
3347
3348
3349 for {
3350 x := v_0
3351 y := v_1
3352 if !(shiftIsBounded(v)) {
3353 break
3354 }
3355 v.reset(OpPPC64SLD)
3356 v.AddArg2(x, y)
3357 return true
3358 }
3359
3360
3361 for {
3362 t := v.Type
3363 x := v_0
3364 y := v_1
3365 v.reset(OpPPC64ISEL)
3366 v.AuxInt = int32ToAuxInt(0)
3367 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3368 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
3369 v1.AddArg(x)
3370 v0.AddArg2(v1, y)
3371 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3372 v2.AuxInt = int64ToAuxInt(0)
3373 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
3374 v3.AuxInt = int64ToAuxInt(8)
3375 v3.AddArg(y)
3376 v.AddArg3(v0, v2, v3)
3377 return true
3378 }
3379 }
3380 func rewriteValuePPC64_OpLsh8x8(v *Value) bool {
3381 v_1 := v.Args[1]
3382 v_0 := v.Args[0]
3383 b := v.Block
3384 typ := &b.Func.Config.Types
3385
3386
3387
3388 for {
3389 x := v_0
3390 y := v_1
3391 if !(shiftIsBounded(v)) {
3392 break
3393 }
3394 v.reset(OpPPC64SLD)
3395 v.AddArg2(x, y)
3396 return true
3397 }
3398
3399
3400 for {
3401 t := v.Type
3402 x := v_0
3403 y := v_1
3404 v.reset(OpPPC64ISEL)
3405 v.AuxInt = int32ToAuxInt(2)
3406 v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
3407 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
3408 v1.AddArg(x)
3409 v0.AddArg2(v1, y)
3410 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
3411 v2.AuxInt = int64ToAuxInt(0)
3412 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
3413 v3.AuxInt = int64ToAuxInt(0)
3414 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
3415 v4.AuxInt = int64ToAuxInt(0x00F8)
3416 v4.AddArg(y)
3417 v3.AddArg(v4)
3418 v.AddArg3(v0, v2, v3)
3419 return true
3420 }
3421 }
3422 func rewriteValuePPC64_OpMax32F(v *Value) bool {
3423 v_1 := v.Args[1]
3424 v_0 := v.Args[0]
3425
3426
3427
3428 for {
3429 x := v_0
3430 y := v_1
3431 if !(buildcfg.GOPPC64 >= 9) {
3432 break
3433 }
3434 v.reset(OpPPC64XSMAXJDP)
3435 v.AddArg2(x, y)
3436 return true
3437 }
3438 return false
3439 }
3440 func rewriteValuePPC64_OpMax64F(v *Value) bool {
3441 v_1 := v.Args[1]
3442 v_0 := v.Args[0]
3443
3444
3445
3446 for {
3447 x := v_0
3448 y := v_1
3449 if !(buildcfg.GOPPC64 >= 9) {
3450 break
3451 }
3452 v.reset(OpPPC64XSMAXJDP)
3453 v.AddArg2(x, y)
3454 return true
3455 }
3456 return false
3457 }
3458 func rewriteValuePPC64_OpMin32F(v *Value) bool {
3459 v_1 := v.Args[1]
3460 v_0 := v.Args[0]
3461
3462
3463
3464 for {
3465 x := v_0
3466 y := v_1
3467 if !(buildcfg.GOPPC64 >= 9) {
3468 break
3469 }
3470 v.reset(OpPPC64XSMINJDP)
3471 v.AddArg2(x, y)
3472 return true
3473 }
3474 return false
3475 }
3476 func rewriteValuePPC64_OpMin64F(v *Value) bool {
3477 v_1 := v.Args[1]
3478 v_0 := v.Args[0]
3479
3480
3481
3482 for {
3483 x := v_0
3484 y := v_1
3485 if !(buildcfg.GOPPC64 >= 9) {
3486 break
3487 }
3488 v.reset(OpPPC64XSMINJDP)
3489 v.AddArg2(x, y)
3490 return true
3491 }
3492 return false
3493 }
3494 func rewriteValuePPC64_OpMod16(v *Value) bool {
3495 v_1 := v.Args[1]
3496 v_0 := v.Args[0]
3497 b := v.Block
3498 typ := &b.Func.Config.Types
3499
3500
3501 for {
3502 x := v_0
3503 y := v_1
3504 v.reset(OpMod32)
3505 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3506 v0.AddArg(x)
3507 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3508 v1.AddArg(y)
3509 v.AddArg2(v0, v1)
3510 return true
3511 }
3512 }
3513 func rewriteValuePPC64_OpMod16u(v *Value) bool {
3514 v_1 := v.Args[1]
3515 v_0 := v.Args[0]
3516 b := v.Block
3517 typ := &b.Func.Config.Types
3518
3519
3520 for {
3521 x := v_0
3522 y := v_1
3523 v.reset(OpMod32u)
3524 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3525 v0.AddArg(x)
3526 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3527 v1.AddArg(y)
3528 v.AddArg2(v0, v1)
3529 return true
3530 }
3531 }
3532 func rewriteValuePPC64_OpMod32(v *Value) bool {
3533 v_1 := v.Args[1]
3534 v_0 := v.Args[0]
3535 b := v.Block
3536 typ := &b.Func.Config.Types
3537
3538
3539
3540 for {
3541 x := v_0
3542 y := v_1
3543 if !(buildcfg.GOPPC64 >= 9) {
3544 break
3545 }
3546 v.reset(OpPPC64MODSW)
3547 v.AddArg2(x, y)
3548 return true
3549 }
3550
3551
3552
3553 for {
3554 x := v_0
3555 y := v_1
3556 if !(buildcfg.GOPPC64 <= 8) {
3557 break
3558 }
3559 v.reset(OpPPC64SUB)
3560 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
3561 v1 := b.NewValue0(v.Pos, OpPPC64DIVW, typ.Int32)
3562 v1.AddArg2(x, y)
3563 v0.AddArg2(y, v1)
3564 v.AddArg2(x, v0)
3565 return true
3566 }
3567 return false
3568 }
3569 func rewriteValuePPC64_OpMod32u(v *Value) bool {
3570 v_1 := v.Args[1]
3571 v_0 := v.Args[0]
3572 b := v.Block
3573 typ := &b.Func.Config.Types
3574
3575
3576
3577 for {
3578 x := v_0
3579 y := v_1
3580 if !(buildcfg.GOPPC64 >= 9) {
3581 break
3582 }
3583 v.reset(OpPPC64MODUW)
3584 v.AddArg2(x, y)
3585 return true
3586 }
3587
3588
3589
3590 for {
3591 x := v_0
3592 y := v_1
3593 if !(buildcfg.GOPPC64 <= 8) {
3594 break
3595 }
3596 v.reset(OpPPC64SUB)
3597 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
3598 v1 := b.NewValue0(v.Pos, OpPPC64DIVWU, typ.Int32)
3599 v1.AddArg2(x, y)
3600 v0.AddArg2(y, v1)
3601 v.AddArg2(x, v0)
3602 return true
3603 }
3604 return false
3605 }
3606 func rewriteValuePPC64_OpMod64(v *Value) bool {
3607 v_1 := v.Args[1]
3608 v_0 := v.Args[0]
3609 b := v.Block
3610 typ := &b.Func.Config.Types
3611
3612
3613
3614 for {
3615 x := v_0
3616 y := v_1
3617 if !(buildcfg.GOPPC64 >= 9) {
3618 break
3619 }
3620 v.reset(OpPPC64MODSD)
3621 v.AddArg2(x, y)
3622 return true
3623 }
3624
3625
3626
3627 for {
3628 x := v_0
3629 y := v_1
3630 if !(buildcfg.GOPPC64 <= 8) {
3631 break
3632 }
3633 v.reset(OpPPC64SUB)
3634 v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
3635 v1 := b.NewValue0(v.Pos, OpPPC64DIVD, typ.Int64)
3636 v1.AddArg2(x, y)
3637 v0.AddArg2(y, v1)
3638 v.AddArg2(x, v0)
3639 return true
3640 }
3641 return false
3642 }
3643 func rewriteValuePPC64_OpMod64u(v *Value) bool {
3644 v_1 := v.Args[1]
3645 v_0 := v.Args[0]
3646 b := v.Block
3647 typ := &b.Func.Config.Types
3648
3649
3650
3651 for {
3652 x := v_0
3653 y := v_1
3654 if !(buildcfg.GOPPC64 >= 9) {
3655 break
3656 }
3657 v.reset(OpPPC64MODUD)
3658 v.AddArg2(x, y)
3659 return true
3660 }
3661
3662
3663
3664 for {
3665 x := v_0
3666 y := v_1
3667 if !(buildcfg.GOPPC64 <= 8) {
3668 break
3669 }
3670 v.reset(OpPPC64SUB)
3671 v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
3672 v1 := b.NewValue0(v.Pos, OpPPC64DIVDU, typ.Int64)
3673 v1.AddArg2(x, y)
3674 v0.AddArg2(y, v1)
3675 v.AddArg2(x, v0)
3676 return true
3677 }
3678 return false
3679 }
3680 func rewriteValuePPC64_OpMod8(v *Value) bool {
3681 v_1 := v.Args[1]
3682 v_0 := v.Args[0]
3683 b := v.Block
3684 typ := &b.Func.Config.Types
3685
3686
3687 for {
3688 x := v_0
3689 y := v_1
3690 v.reset(OpMod32)
3691 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
3692 v0.AddArg(x)
3693 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
3694 v1.AddArg(y)
3695 v.AddArg2(v0, v1)
3696 return true
3697 }
3698 }
3699 func rewriteValuePPC64_OpMod8u(v *Value) bool {
3700 v_1 := v.Args[1]
3701 v_0 := v.Args[0]
3702 b := v.Block
3703 typ := &b.Func.Config.Types
3704
3705
3706 for {
3707 x := v_0
3708 y := v_1
3709 v.reset(OpMod32u)
3710 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
3711 v0.AddArg(x)
3712 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
3713 v1.AddArg(y)
3714 v.AddArg2(v0, v1)
3715 return true
3716 }
3717 }
3718 func rewriteValuePPC64_OpMove(v *Value) bool {
3719 v_2 := v.Args[2]
3720 v_1 := v.Args[1]
3721 v_0 := v.Args[0]
3722 b := v.Block
3723 typ := &b.Func.Config.Types
3724
3725
3726 for {
3727 if auxIntToInt64(v.AuxInt) != 0 {
3728 break
3729 }
3730 mem := v_2
3731 v.copyOf(mem)
3732 return true
3733 }
3734
3735
3736 for {
3737 if auxIntToInt64(v.AuxInt) != 1 {
3738 break
3739 }
3740 dst := v_0
3741 src := v_1
3742 mem := v_2
3743 v.reset(OpPPC64MOVBstore)
3744 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3745 v0.AddArg2(src, mem)
3746 v.AddArg3(dst, v0, mem)
3747 return true
3748 }
3749
3750
3751 for {
3752 if auxIntToInt64(v.AuxInt) != 2 {
3753 break
3754 }
3755 dst := v_0
3756 src := v_1
3757 mem := v_2
3758 v.reset(OpPPC64MOVHstore)
3759 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
3760 v0.AddArg2(src, mem)
3761 v.AddArg3(dst, v0, mem)
3762 return true
3763 }
3764
3765
3766 for {
3767 if auxIntToInt64(v.AuxInt) != 4 {
3768 break
3769 }
3770 dst := v_0
3771 src := v_1
3772 mem := v_2
3773 v.reset(OpPPC64MOVWstore)
3774 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3775 v0.AddArg2(src, mem)
3776 v.AddArg3(dst, v0, mem)
3777 return true
3778 }
3779
3780
3781 for {
3782 if auxIntToInt64(v.AuxInt) != 8 {
3783 break
3784 }
3785 dst := v_0
3786 src := v_1
3787 mem := v_2
3788 v.reset(OpPPC64MOVDstore)
3789 v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, typ.Int64)
3790 v0.AddArg2(src, mem)
3791 v.AddArg3(dst, v0, mem)
3792 return true
3793 }
3794
3795
3796 for {
3797 if auxIntToInt64(v.AuxInt) != 3 {
3798 break
3799 }
3800 dst := v_0
3801 src := v_1
3802 mem := v_2
3803 v.reset(OpPPC64MOVBstore)
3804 v.AuxInt = int32ToAuxInt(2)
3805 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3806 v0.AuxInt = int32ToAuxInt(2)
3807 v0.AddArg2(src, mem)
3808 v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
3809 v2 := b.NewValue0(v.Pos, OpPPC64MOVHload, typ.Int16)
3810 v2.AddArg2(src, mem)
3811 v1.AddArg3(dst, v2, mem)
3812 v.AddArg3(dst, v0, v1)
3813 return true
3814 }
3815
3816
3817 for {
3818 if auxIntToInt64(v.AuxInt) != 5 {
3819 break
3820 }
3821 dst := v_0
3822 src := v_1
3823 mem := v_2
3824 v.reset(OpPPC64MOVBstore)
3825 v.AuxInt = int32ToAuxInt(4)
3826 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3827 v0.AuxInt = int32ToAuxInt(4)
3828 v0.AddArg2(src, mem)
3829 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
3830 v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3831 v2.AddArg2(src, mem)
3832 v1.AddArg3(dst, v2, mem)
3833 v.AddArg3(dst, v0, v1)
3834 return true
3835 }
3836
3837
3838 for {
3839 if auxIntToInt64(v.AuxInt) != 6 {
3840 break
3841 }
3842 dst := v_0
3843 src := v_1
3844 mem := v_2
3845 v.reset(OpPPC64MOVHstore)
3846 v.AuxInt = int32ToAuxInt(4)
3847 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
3848 v0.AuxInt = int32ToAuxInt(4)
3849 v0.AddArg2(src, mem)
3850 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
3851 v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3852 v2.AddArg2(src, mem)
3853 v1.AddArg3(dst, v2, mem)
3854 v.AddArg3(dst, v0, v1)
3855 return true
3856 }
3857
3858
3859 for {
3860 if auxIntToInt64(v.AuxInt) != 7 {
3861 break
3862 }
3863 dst := v_0
3864 src := v_1
3865 mem := v_2
3866 v.reset(OpPPC64MOVBstore)
3867 v.AuxInt = int32ToAuxInt(6)
3868 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
3869 v0.AuxInt = int32ToAuxInt(6)
3870 v0.AddArg2(src, mem)
3871 v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
3872 v1.AuxInt = int32ToAuxInt(4)
3873 v2 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
3874 v2.AuxInt = int32ToAuxInt(4)
3875 v2.AddArg2(src, mem)
3876 v3 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
3877 v4 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
3878 v4.AddArg2(src, mem)
3879 v3.AddArg3(dst, v4, mem)
3880 v1.AddArg3(dst, v2, v3)
3881 v.AddArg3(dst, v0, v1)
3882 return true
3883 }
3884
3885
3886
3887 for {
3888 s := auxIntToInt64(v.AuxInt)
3889 dst := v_0
3890 src := v_1
3891 mem := v_2
3892 if !(s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)) {
3893 break
3894 }
3895 v.reset(OpPPC64LoweredMove)
3896 v.AuxInt = int64ToAuxInt(s)
3897 v.AddArg3(dst, src, mem)
3898 return true
3899 }
3900
3901
3902
3903 for {
3904 s := auxIntToInt64(v.AuxInt)
3905 dst := v_0
3906 src := v_1
3907 mem := v_2
3908 if !(s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9) {
3909 break
3910 }
3911 v.reset(OpPPC64LoweredQuadMoveShort)
3912 v.AuxInt = int64ToAuxInt(s)
3913 v.AddArg3(dst, src, mem)
3914 return true
3915 }
3916
3917
3918
3919 for {
3920 s := auxIntToInt64(v.AuxInt)
3921 dst := v_0
3922 src := v_1
3923 mem := v_2
3924 if !(s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)) {
3925 break
3926 }
3927 v.reset(OpPPC64LoweredQuadMove)
3928 v.AuxInt = int64ToAuxInt(s)
3929 v.AddArg3(dst, src, mem)
3930 return true
3931 }
3932 return false
3933 }
3934 func rewriteValuePPC64_OpNeq16(v *Value) bool {
3935 v_1 := v.Args[1]
3936 v_0 := v.Args[0]
3937 b := v.Block
3938 typ := &b.Func.Config.Types
3939
3940
3941
3942 for {
3943 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3944 x := v_0
3945 y := v_1
3946 if !(x.Type.IsSigned() && y.Type.IsSigned()) {
3947 continue
3948 }
3949 v.reset(OpPPC64NotEqual)
3950 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3951 v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3952 v1.AddArg(x)
3953 v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
3954 v2.AddArg(y)
3955 v0.AddArg2(v1, v2)
3956 v.AddArg(v0)
3957 return true
3958 }
3959 break
3960 }
3961
3962
3963 for {
3964 x := v_0
3965 y := v_1
3966 v.reset(OpPPC64NotEqual)
3967 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3968 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3969 v1.AddArg(x)
3970 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
3971 v2.AddArg(y)
3972 v0.AddArg2(v1, v2)
3973 v.AddArg(v0)
3974 return true
3975 }
3976 }
3977 func rewriteValuePPC64_OpNeq32(v *Value) bool {
3978 v_1 := v.Args[1]
3979 v_0 := v.Args[0]
3980 b := v.Block
3981
3982
3983 for {
3984 x := v_0
3985 y := v_1
3986 v.reset(OpPPC64NotEqual)
3987 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
3988 v0.AddArg2(x, y)
3989 v.AddArg(v0)
3990 return true
3991 }
3992 }
3993 func rewriteValuePPC64_OpNeq32F(v *Value) bool {
3994 v_1 := v.Args[1]
3995 v_0 := v.Args[0]
3996 b := v.Block
3997
3998
3999 for {
4000 x := v_0
4001 y := v_1
4002 v.reset(OpPPC64NotEqual)
4003 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
4004 v0.AddArg2(x, y)
4005 v.AddArg(v0)
4006 return true
4007 }
4008 }
4009 func rewriteValuePPC64_OpNeq64(v *Value) bool {
4010 v_1 := v.Args[1]
4011 v_0 := v.Args[0]
4012 b := v.Block
4013
4014
4015 for {
4016 x := v_0
4017 y := v_1
4018 v.reset(OpPPC64NotEqual)
4019 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
4020 v0.AddArg2(x, y)
4021 v.AddArg(v0)
4022 return true
4023 }
4024 }
4025 func rewriteValuePPC64_OpNeq64F(v *Value) bool {
4026 v_1 := v.Args[1]
4027 v_0 := v.Args[0]
4028 b := v.Block
4029
4030
4031 for {
4032 x := v_0
4033 y := v_1
4034 v.reset(OpPPC64NotEqual)
4035 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
4036 v0.AddArg2(x, y)
4037 v.AddArg(v0)
4038 return true
4039 }
4040 }
4041 func rewriteValuePPC64_OpNeq8(v *Value) bool {
4042 v_1 := v.Args[1]
4043 v_0 := v.Args[0]
4044 b := v.Block
4045 typ := &b.Func.Config.Types
4046
4047
4048
4049 for {
4050 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4051 x := v_0
4052 y := v_1
4053 if !(x.Type.IsSigned() && y.Type.IsSigned()) {
4054 continue
4055 }
4056 v.reset(OpPPC64NotEqual)
4057 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
4058 v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
4059 v1.AddArg(x)
4060 v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
4061 v2.AddArg(y)
4062 v0.AddArg2(v1, v2)
4063 v.AddArg(v0)
4064 return true
4065 }
4066 break
4067 }
4068
4069
4070 for {
4071 x := v_0
4072 y := v_1
4073 v.reset(OpPPC64NotEqual)
4074 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
4075 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
4076 v1.AddArg(x)
4077 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
4078 v2.AddArg(y)
4079 v0.AddArg2(v1, v2)
4080 v.AddArg(v0)
4081 return true
4082 }
4083 }
4084 func rewriteValuePPC64_OpNeqPtr(v *Value) bool {
4085 v_1 := v.Args[1]
4086 v_0 := v.Args[0]
4087 b := v.Block
4088
4089
4090 for {
4091 x := v_0
4092 y := v_1
4093 v.reset(OpPPC64NotEqual)
4094 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
4095 v0.AddArg2(x, y)
4096 v.AddArg(v0)
4097 return true
4098 }
4099 }
4100 func rewriteValuePPC64_OpNot(v *Value) bool {
4101 v_0 := v.Args[0]
4102
4103
4104 for {
4105 x := v_0
4106 v.reset(OpPPC64XORconst)
4107 v.AuxInt = int64ToAuxInt(1)
4108 v.AddArg(x)
4109 return true
4110 }
4111 }
4112 func rewriteValuePPC64_OpOffPtr(v *Value) bool {
4113 v_0 := v.Args[0]
4114 b := v.Block
4115 typ := &b.Func.Config.Types
4116
4117
4118 for {
4119 off := auxIntToInt64(v.AuxInt)
4120 ptr := v_0
4121 v.reset(OpPPC64ADD)
4122 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
4123 v0.AuxInt = int64ToAuxInt(off)
4124 v.AddArg2(v0, ptr)
4125 return true
4126 }
4127 }
4128 func rewriteValuePPC64_OpPPC64ADD(v *Value) bool {
4129 v_1 := v.Args[1]
4130 v_0 := v.Args[0]
4131 b := v.Block
4132
4133
4134
4135 for {
4136 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4137 z := v_0
4138 l := v_1
4139 if l.Op != OpPPC64MULLD {
4140 continue
4141 }
4142 y := l.Args[1]
4143 x := l.Args[0]
4144 if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
4145 continue
4146 }
4147 v.reset(OpPPC64MADDLD)
4148 v.AddArg3(x, y, z)
4149 return true
4150 }
4151 break
4152 }
4153
4154
4155
4156 for {
4157 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4158 z := v_0
4159 l := v_1
4160 if l.Op != OpPPC64MULLDconst {
4161 continue
4162 }
4163 mt := l.Type
4164 x := auxIntToInt32(l.AuxInt)
4165 y := l.Args[0]
4166 if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
4167 continue
4168 }
4169 v.reset(OpPPC64MADDLD)
4170 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, mt)
4171 v0.AuxInt = int64ToAuxInt(int64(x))
4172 v.AddArg3(v0, y, z)
4173 return true
4174 }
4175 break
4176 }
4177
4178
4179
4180 for {
4181 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4182 x := v_0
4183 if v_1.Op != OpPPC64MOVDconst {
4184 continue
4185 }
4186 t := v_1.Type
4187 c := auxIntToInt64(v_1.AuxInt)
4188 if !(is32Bit(c) && !t.IsPtr()) {
4189 continue
4190 }
4191 v.reset(OpPPC64ADDconst)
4192 v.AuxInt = int64ToAuxInt(c)
4193 v.AddArg(x)
4194 return true
4195 }
4196 break
4197 }
4198 return false
4199 }
4200 func rewriteValuePPC64_OpPPC64ADDC(v *Value) bool {
4201 v_1 := v.Args[1]
4202 v_0 := v.Args[0]
4203
4204
4205
4206 for {
4207 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4208 x := v_0
4209 if v_1.Op != OpPPC64MOVDconst {
4210 continue
4211 }
4212 y := auxIntToInt64(v_1.AuxInt)
4213 if !(is16Bit(y)) {
4214 continue
4215 }
4216 v.reset(OpPPC64ADDCconst)
4217 v.AuxInt = int64ToAuxInt(y)
4218 v.AddArg(x)
4219 return true
4220 }
4221 break
4222 }
4223 return false
4224 }
4225 func rewriteValuePPC64_OpPPC64ADDE(v *Value) bool {
4226 v_2 := v.Args[2]
4227 v_1 := v.Args[1]
4228 v_0 := v.Args[0]
4229 b := v.Block
4230 typ := &b.Func.Config.Types
4231
4232
4233 for {
4234 x := v_0
4235 y := v_1
4236 if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
4237 break
4238 }
4239 v_2_0 := v_2.Args[0]
4240 if v_2_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_2_0.AuxInt) != -1 {
4241 break
4242 }
4243 v_2_0_0 := v_2_0.Args[0]
4244 if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
4245 break
4246 }
4247 v.reset(OpPPC64ADDC)
4248 v.AddArg2(x, y)
4249 return true
4250 }
4251
4252
4253 for {
4254 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4255 if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 {
4256 continue
4257 }
4258 y := v_1
4259 c := v_2
4260 v.reset(OpPPC64ADDZE)
4261 v.AddArg2(y, c)
4262 return true
4263 }
4264 break
4265 }
4266 return false
4267 }
4268 func rewriteValuePPC64_OpPPC64ADDconst(v *Value) bool {
4269 v_0 := v.Args[0]
4270 b := v.Block
4271
4272
4273
4274 for {
4275 at := v.Type
4276 z := auxIntToInt64(v.AuxInt)
4277 l := v_0
4278 if l.Op != OpPPC64MULLD {
4279 break
4280 }
4281 y := l.Args[1]
4282 x := l.Args[0]
4283 if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
4284 break
4285 }
4286 v.reset(OpPPC64MADDLD)
4287 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, at)
4288 v0.AuxInt = int64ToAuxInt(int64(z))
4289 v.AddArg3(x, y, v0)
4290 return true
4291 }
4292
4293
4294
4295 for {
4296 at := v.Type
4297 z := auxIntToInt64(v.AuxInt)
4298 l := v_0
4299 if l.Op != OpPPC64MULLDconst {
4300 break
4301 }
4302 mt := l.Type
4303 x := auxIntToInt32(l.AuxInt)
4304 y := l.Args[0]
4305 if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
4306 break
4307 }
4308 v.reset(OpPPC64MADDLD)
4309 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, mt)
4310 v0.AuxInt = int64ToAuxInt(int64(x))
4311 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, at)
4312 v1.AuxInt = int64ToAuxInt(int64(z))
4313 v.AddArg3(v0, y, v1)
4314 return true
4315 }
4316
4317
4318
4319 for {
4320 c := auxIntToInt64(v.AuxInt)
4321 if v_0.Op != OpPPC64ADDconst {
4322 break
4323 }
4324 d := auxIntToInt64(v_0.AuxInt)
4325 x := v_0.Args[0]
4326 if !(is32Bit(c + d)) {
4327 break
4328 }
4329 v.reset(OpPPC64ADDconst)
4330 v.AuxInt = int64ToAuxInt(c + d)
4331 v.AddArg(x)
4332 return true
4333 }
4334
4335
4336 for {
4337 if auxIntToInt64(v.AuxInt) != 0 {
4338 break
4339 }
4340 x := v_0
4341 v.copyOf(x)
4342 return true
4343 }
4344
4345
4346
4347 for {
4348 c := auxIntToInt64(v.AuxInt)
4349 if v_0.Op != OpPPC64MOVDaddr {
4350 break
4351 }
4352 d := auxIntToInt32(v_0.AuxInt)
4353 sym := auxToSym(v_0.Aux)
4354 x := v_0.Args[0]
4355 if !(is32Bit(c + int64(d))) {
4356 break
4357 }
4358 v.reset(OpPPC64MOVDaddr)
4359 v.AuxInt = int32ToAuxInt(int32(c + int64(d)))
4360 v.Aux = symToAux(sym)
4361 v.AddArg(x)
4362 return true
4363 }
4364
4365
4366
4367 for {
4368 c := auxIntToInt64(v.AuxInt)
4369 x := v_0
4370 if x.Op != OpSP || !(is32Bit(c)) {
4371 break
4372 }
4373 v.reset(OpPPC64MOVDaddr)
4374 v.AuxInt = int32ToAuxInt(int32(c))
4375 v.AddArg(x)
4376 return true
4377 }
4378
4379
4380
4381 for {
4382 c := auxIntToInt64(v.AuxInt)
4383 if v_0.Op != OpPPC64SUBFCconst {
4384 break
4385 }
4386 d := auxIntToInt64(v_0.AuxInt)
4387 x := v_0.Args[0]
4388 if !(is32Bit(c + d)) {
4389 break
4390 }
4391 v.reset(OpPPC64SUBFCconst)
4392 v.AuxInt = int64ToAuxInt(c + d)
4393 v.AddArg(x)
4394 return true
4395 }
4396 return false
4397 }
4398 func rewriteValuePPC64_OpPPC64AND(v *Value) bool {
4399 v_1 := v.Args[1]
4400 v_0 := v.Args[0]
4401
4402
4403
4404 for {
4405 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4406 if v_0.Op != OpPPC64MOVDconst {
4407 continue
4408 }
4409 m := auxIntToInt64(v_0.AuxInt)
4410 if v_1.Op != OpPPC64ROTLWconst {
4411 continue
4412 }
4413 r := auxIntToInt64(v_1.AuxInt)
4414 x := v_1.Args[0]
4415 if !(isPPC64WordRotateMask(m)) {
4416 continue
4417 }
4418 v.reset(OpPPC64RLWINM)
4419 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
4420 v.AddArg(x)
4421 return true
4422 }
4423 break
4424 }
4425
4426
4427
4428 for {
4429 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4430 if v_0.Op != OpPPC64MOVDconst {
4431 continue
4432 }
4433 m := auxIntToInt64(v_0.AuxInt)
4434 if v_1.Op != OpPPC64ROTLW {
4435 continue
4436 }
4437 r := v_1.Args[1]
4438 x := v_1.Args[0]
4439 if !(isPPC64WordRotateMask(m)) {
4440 continue
4441 }
4442 v.reset(OpPPC64RLWNM)
4443 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
4444 v.AddArg2(x, r)
4445 return true
4446 }
4447 break
4448 }
4449
4450
4451
4452 for {
4453 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4454 if v_0.Op != OpPPC64MOVDconst {
4455 continue
4456 }
4457 m := auxIntToInt64(v_0.AuxInt)
4458 if v_1.Op != OpPPC64SRWconst {
4459 continue
4460 }
4461 s := auxIntToInt64(v_1.AuxInt)
4462 if !(mergePPC64RShiftMask(m, s, 32) == 0) {
4463 continue
4464 }
4465 v.reset(OpPPC64MOVDconst)
4466 v.AuxInt = int64ToAuxInt(0)
4467 return true
4468 }
4469 break
4470 }
4471
4472
4473
4474 for {
4475 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4476 if v_0.Op != OpPPC64MOVDconst {
4477 continue
4478 }
4479 m := auxIntToInt64(v_0.AuxInt)
4480 if v_1.Op != OpPPC64SRWconst {
4481 continue
4482 }
4483 s := auxIntToInt64(v_1.AuxInt)
4484 x := v_1.Args[0]
4485 if !(mergePPC64AndSrwi(m, s) != 0) {
4486 continue
4487 }
4488 v.reset(OpPPC64RLWINM)
4489 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
4490 v.AddArg(x)
4491 return true
4492 }
4493 break
4494 }
4495
4496
4497
4498 for {
4499 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4500 if v_0.Op != OpPPC64MOVDconst {
4501 continue
4502 }
4503 m := auxIntToInt64(v_0.AuxInt)
4504 if v_1.Op != OpPPC64SRDconst {
4505 continue
4506 }
4507 s := auxIntToInt64(v_1.AuxInt)
4508 x := v_1.Args[0]
4509 if !(mergePPC64AndSrdi(m, s) != 0) {
4510 continue
4511 }
4512 v.reset(OpPPC64RLWINM)
4513 v.AuxInt = int64ToAuxInt(mergePPC64AndSrdi(m, s))
4514 v.AddArg(x)
4515 return true
4516 }
4517 break
4518 }
4519
4520
4521
4522 for {
4523 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4524 if v_0.Op != OpPPC64MOVDconst {
4525 continue
4526 }
4527 m := auxIntToInt64(v_0.AuxInt)
4528 if v_1.Op != OpPPC64SLDconst {
4529 continue
4530 }
4531 s := auxIntToInt64(v_1.AuxInt)
4532 x := v_1.Args[0]
4533 if !(mergePPC64AndSldi(m, s) != 0) {
4534 continue
4535 }
4536 v.reset(OpPPC64RLWINM)
4537 v.AuxInt = int64ToAuxInt(mergePPC64AndSldi(m, s))
4538 v.AddArg(x)
4539 return true
4540 }
4541 break
4542 }
4543
4544
4545 for {
4546 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4547 x := v_0
4548 if v_1.Op != OpPPC64NOR {
4549 continue
4550 }
4551 y := v_1.Args[1]
4552 if y != v_1.Args[0] {
4553 continue
4554 }
4555 v.reset(OpPPC64ANDN)
4556 v.AddArg2(x, y)
4557 return true
4558 }
4559 break
4560 }
4561
4562
4563 for {
4564 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4565 if v_0.Op != OpPPC64MOVDconst {
4566 continue
4567 }
4568 c := auxIntToInt64(v_0.AuxInt)
4569 if v_1.Op != OpPPC64MOVDconst {
4570 continue
4571 }
4572 d := auxIntToInt64(v_1.AuxInt)
4573 v.reset(OpPPC64MOVDconst)
4574 v.AuxInt = int64ToAuxInt(c & d)
4575 return true
4576 }
4577 break
4578 }
4579
4580
4581 for {
4582 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4583 x := v_0
4584 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
4585 continue
4586 }
4587 v.copyOf(x)
4588 return true
4589 }
4590 break
4591 }
4592
4593
4594
4595 for {
4596 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4597 x := v_0
4598 if v_1.Op != OpPPC64MOVDconst {
4599 continue
4600 }
4601 c := auxIntToInt64(v_1.AuxInt)
4602 if !(isU16Bit(c)) {
4603 continue
4604 }
4605 v.reset(OpPPC64ANDconst)
4606 v.AuxInt = int64ToAuxInt(c)
4607 v.AddArg(x)
4608 return true
4609 }
4610 break
4611 }
4612
4613
4614
4615 for {
4616 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4617 if v_0.Op != OpPPC64MOVDconst {
4618 continue
4619 }
4620 c := auxIntToInt64(v_0.AuxInt)
4621 y := v_1
4622 if y.Op != OpPPC64MOVWZreg || !(c&0xFFFFFFFF == 0xFFFFFFFF) {
4623 continue
4624 }
4625 v.copyOf(y)
4626 return true
4627 }
4628 break
4629 }
4630
4631
4632 for {
4633 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4634 if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0xFFFFFFFF {
4635 continue
4636 }
4637 y := v_1
4638 if y.Op != OpPPC64MOVWreg {
4639 continue
4640 }
4641 x := y.Args[0]
4642 v.reset(OpPPC64MOVWZreg)
4643 v.AddArg(x)
4644 return true
4645 }
4646 break
4647 }
4648
4649
4650 for {
4651 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
4652 if v_0.Op != OpPPC64MOVDconst {
4653 continue
4654 }
4655 c := auxIntToInt64(v_0.AuxInt)
4656 x := v_1
4657 if x.Op != OpPPC64MOVBZload {
4658 continue
4659 }
4660 v.reset(OpPPC64ANDconst)
4661 v.AuxInt = int64ToAuxInt(c & 0xFF)
4662 v.AddArg(x)
4663 return true
4664 }
4665 break
4666 }
4667 return false
4668 }
4669 func rewriteValuePPC64_OpPPC64ANDN(v *Value) bool {
4670 v_1 := v.Args[1]
4671 v_0 := v.Args[0]
4672
4673
4674 for {
4675 if v_0.Op != OpPPC64MOVDconst {
4676 break
4677 }
4678 c := auxIntToInt64(v_0.AuxInt)
4679 if v_1.Op != OpPPC64MOVDconst {
4680 break
4681 }
4682 d := auxIntToInt64(v_1.AuxInt)
4683 v.reset(OpPPC64MOVDconst)
4684 v.AuxInt = int64ToAuxInt(c &^ d)
4685 return true
4686 }
4687 return false
4688 }
4689 func rewriteValuePPC64_OpPPC64ANDconst(v *Value) bool {
4690 v_0 := v.Args[0]
4691
4692
4693
4694 for {
4695 m := auxIntToInt64(v.AuxInt)
4696 if v_0.Op != OpPPC64ROTLWconst {
4697 break
4698 }
4699 r := auxIntToInt64(v_0.AuxInt)
4700 x := v_0.Args[0]
4701 if !(isPPC64WordRotateMask(m)) {
4702 break
4703 }
4704 v.reset(OpPPC64RLWINM)
4705 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
4706 v.AddArg(x)
4707 return true
4708 }
4709
4710
4711
4712 for {
4713 m := auxIntToInt64(v.AuxInt)
4714 if v_0.Op != OpPPC64ROTLW {
4715 break
4716 }
4717 r := v_0.Args[1]
4718 x := v_0.Args[0]
4719 if !(isPPC64WordRotateMask(m)) {
4720 break
4721 }
4722 v.reset(OpPPC64RLWNM)
4723 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
4724 v.AddArg2(x, r)
4725 return true
4726 }
4727
4728
4729
4730 for {
4731 m := auxIntToInt64(v.AuxInt)
4732 if v_0.Op != OpPPC64SRWconst {
4733 break
4734 }
4735 s := auxIntToInt64(v_0.AuxInt)
4736 if !(mergePPC64RShiftMask(m, s, 32) == 0) {
4737 break
4738 }
4739 v.reset(OpPPC64MOVDconst)
4740 v.AuxInt = int64ToAuxInt(0)
4741 return true
4742 }
4743
4744
4745
4746 for {
4747 m := auxIntToInt64(v.AuxInt)
4748 if v_0.Op != OpPPC64SRWconst {
4749 break
4750 }
4751 s := auxIntToInt64(v_0.AuxInt)
4752 x := v_0.Args[0]
4753 if !(mergePPC64AndSrwi(m, s) != 0) {
4754 break
4755 }
4756 v.reset(OpPPC64RLWINM)
4757 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
4758 v.AddArg(x)
4759 return true
4760 }
4761
4762
4763
4764 for {
4765 m := auxIntToInt64(v.AuxInt)
4766 if v_0.Op != OpPPC64SRDconst {
4767 break
4768 }
4769 s := auxIntToInt64(v_0.AuxInt)
4770 x := v_0.Args[0]
4771 if !(mergePPC64AndSrdi(m, s) != 0) {
4772 break
4773 }
4774 v.reset(OpPPC64RLWINM)
4775 v.AuxInt = int64ToAuxInt(mergePPC64AndSrdi(m, s))
4776 v.AddArg(x)
4777 return true
4778 }
4779
4780
4781
4782 for {
4783 m := auxIntToInt64(v.AuxInt)
4784 if v_0.Op != OpPPC64SLDconst {
4785 break
4786 }
4787 s := auxIntToInt64(v_0.AuxInt)
4788 x := v_0.Args[0]
4789 if !(mergePPC64AndSldi(m, s) != 0) {
4790 break
4791 }
4792 v.reset(OpPPC64RLWINM)
4793 v.AuxInt = int64ToAuxInt(mergePPC64AndSldi(m, s))
4794 v.AddArg(x)
4795 return true
4796 }
4797
4798
4799 for {
4800 c := auxIntToInt64(v.AuxInt)
4801 if v_0.Op != OpPPC64ANDconst {
4802 break
4803 }
4804 d := auxIntToInt64(v_0.AuxInt)
4805 x := v_0.Args[0]
4806 v.reset(OpPPC64ANDconst)
4807 v.AuxInt = int64ToAuxInt(c & d)
4808 v.AddArg(x)
4809 return true
4810 }
4811
4812
4813 for {
4814 if auxIntToInt64(v.AuxInt) != -1 {
4815 break
4816 }
4817 x := v_0
4818 v.copyOf(x)
4819 return true
4820 }
4821
4822
4823 for {
4824 if auxIntToInt64(v.AuxInt) != 0 {
4825 break
4826 }
4827 v.reset(OpPPC64MOVDconst)
4828 v.AuxInt = int64ToAuxInt(0)
4829 return true
4830 }
4831
4832
4833
4834 for {
4835 c := auxIntToInt64(v.AuxInt)
4836 y := v_0
4837 if y.Op != OpPPC64MOVBZreg || !(c&0xFF == 0xFF) {
4838 break
4839 }
4840 v.copyOf(y)
4841 return true
4842 }
4843
4844
4845 for {
4846 if auxIntToInt64(v.AuxInt) != 0xFF || v_0.Op != OpPPC64MOVBreg {
4847 break
4848 }
4849 x := v_0.Args[0]
4850 v.reset(OpPPC64MOVBZreg)
4851 v.AddArg(x)
4852 return true
4853 }
4854
4855
4856
4857 for {
4858 c := auxIntToInt64(v.AuxInt)
4859 y := v_0
4860 if y.Op != OpPPC64MOVHZreg || !(c&0xFFFF == 0xFFFF) {
4861 break
4862 }
4863 v.copyOf(y)
4864 return true
4865 }
4866
4867
4868 for {
4869 if auxIntToInt64(v.AuxInt) != 0xFFFF || v_0.Op != OpPPC64MOVHreg {
4870 break
4871 }
4872 x := v_0.Args[0]
4873 v.reset(OpPPC64MOVHZreg)
4874 v.AddArg(x)
4875 return true
4876 }
4877
4878
4879 for {
4880 c := auxIntToInt64(v.AuxInt)
4881 if v_0.Op != OpPPC64MOVBZreg {
4882 break
4883 }
4884 x := v_0.Args[0]
4885 v.reset(OpPPC64ANDconst)
4886 v.AuxInt = int64ToAuxInt(c & 0xFF)
4887 v.AddArg(x)
4888 return true
4889 }
4890
4891
4892 for {
4893 c := auxIntToInt64(v.AuxInt)
4894 if v_0.Op != OpPPC64MOVHZreg {
4895 break
4896 }
4897 x := v_0.Args[0]
4898 v.reset(OpPPC64ANDconst)
4899 v.AuxInt = int64ToAuxInt(c & 0xFFFF)
4900 v.AddArg(x)
4901 return true
4902 }
4903
4904
4905 for {
4906 c := auxIntToInt64(v.AuxInt)
4907 if v_0.Op != OpPPC64MOVWZreg {
4908 break
4909 }
4910 x := v_0.Args[0]
4911 v.reset(OpPPC64ANDconst)
4912 v.AuxInt = int64ToAuxInt(c & 0xFFFFFFFF)
4913 v.AddArg(x)
4914 return true
4915 }
4916
4917
4918
4919 for {
4920 m := auxIntToInt64(v.AuxInt)
4921 if v_0.Op != OpPPC64RLWINM {
4922 break
4923 }
4924 r := auxIntToInt64(v_0.AuxInt)
4925 y := v_0.Args[0]
4926 if !(mergePPC64AndRlwinm(uint32(m), r) != 0) {
4927 break
4928 }
4929 v.reset(OpPPC64RLWINM)
4930 v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(uint32(m), r))
4931 v.AddArg(y)
4932 return true
4933 }
4934
4935
4936
4937 for {
4938 if auxIntToInt64(v.AuxInt) != 1 {
4939 break
4940 }
4941 z := v_0
4942 if z.Op != OpPPC64SRADconst || auxIntToInt64(z.AuxInt) != 63 {
4943 break
4944 }
4945 x := z.Args[0]
4946 if !(z.Uses == 1) {
4947 break
4948 }
4949 v.reset(OpPPC64SRDconst)
4950 v.AuxInt = int64ToAuxInt(63)
4951 v.AddArg(x)
4952 return true
4953 }
4954 return false
4955 }
4956 func rewriteValuePPC64_OpPPC64BRD(v *Value) bool {
4957 v_0 := v.Args[0]
4958 b := v.Block
4959 typ := &b.Func.Config.Types
4960
4961
4962
4963 for {
4964 x := v_0
4965 if x.Op != OpPPC64MOVDload {
4966 break
4967 }
4968 off := auxIntToInt32(x.AuxInt)
4969 sym := auxToSym(x.Aux)
4970 mem := x.Args[1]
4971 ptr := x.Args[0]
4972 if !(x.Uses == 1) {
4973 break
4974 }
4975 b = x.Block
4976 v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
4977 v.copyOf(v0)
4978 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
4979 v1.AuxInt = int32ToAuxInt(off)
4980 v1.Aux = symToAux(sym)
4981 v1.AddArg(ptr)
4982 v0.AddArg2(v1, mem)
4983 return true
4984 }
4985
4986
4987
4988 for {
4989 x := v_0
4990 if x.Op != OpPPC64MOVDloadidx {
4991 break
4992 }
4993 mem := x.Args[2]
4994 ptr := x.Args[0]
4995 idx := x.Args[1]
4996 if !(x.Uses == 1) {
4997 break
4998 }
4999 b = x.Block
5000 v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
5001 v.copyOf(v0)
5002 v0.AddArg3(ptr, idx, mem)
5003 return true
5004 }
5005 return false
5006 }
5007 func rewriteValuePPC64_OpPPC64BRH(v *Value) bool {
5008 v_0 := v.Args[0]
5009 b := v.Block
5010 typ := &b.Func.Config.Types
5011
5012
5013
5014 for {
5015 x := v_0
5016 if x.Op != OpPPC64MOVHZload {
5017 break
5018 }
5019 off := auxIntToInt32(x.AuxInt)
5020 sym := auxToSym(x.Aux)
5021 mem := x.Args[1]
5022 ptr := x.Args[0]
5023 if !(x.Uses == 1) {
5024 break
5025 }
5026 b = x.Block
5027 v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
5028 v.copyOf(v0)
5029 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
5030 v1.AuxInt = int32ToAuxInt(off)
5031 v1.Aux = symToAux(sym)
5032 v1.AddArg(ptr)
5033 v0.AddArg2(v1, mem)
5034 return true
5035 }
5036
5037
5038
5039 for {
5040 x := v_0
5041 if x.Op != OpPPC64MOVHZloadidx {
5042 break
5043 }
5044 mem := x.Args[2]
5045 ptr := x.Args[0]
5046 idx := x.Args[1]
5047 if !(x.Uses == 1) {
5048 break
5049 }
5050 b = x.Block
5051 v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
5052 v.copyOf(v0)
5053 v0.AddArg3(ptr, idx, mem)
5054 return true
5055 }
5056 return false
5057 }
5058 func rewriteValuePPC64_OpPPC64BRW(v *Value) bool {
5059 v_0 := v.Args[0]
5060 b := v.Block
5061 typ := &b.Func.Config.Types
5062
5063
5064
5065 for {
5066 x := v_0
5067 if x.Op != OpPPC64MOVWZload {
5068 break
5069 }
5070 off := auxIntToInt32(x.AuxInt)
5071 sym := auxToSym(x.Aux)
5072 mem := x.Args[1]
5073 ptr := x.Args[0]
5074 if !(x.Uses == 1) {
5075 break
5076 }
5077 b = x.Block
5078 v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
5079 v.copyOf(v0)
5080 v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
5081 v1.AuxInt = int32ToAuxInt(off)
5082 v1.Aux = symToAux(sym)
5083 v1.AddArg(ptr)
5084 v0.AddArg2(v1, mem)
5085 return true
5086 }
5087
5088
5089
5090 for {
5091 x := v_0
5092 if x.Op != OpPPC64MOVWZloadidx {
5093 break
5094 }
5095 mem := x.Args[2]
5096 ptr := x.Args[0]
5097 idx := x.Args[1]
5098 if !(x.Uses == 1) {
5099 break
5100 }
5101 b = x.Block
5102 v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
5103 v.copyOf(v0)
5104 v0.AddArg3(ptr, idx, mem)
5105 return true
5106 }
5107 return false
5108 }
5109 func rewriteValuePPC64_OpPPC64CLRLSLDI(v *Value) bool {
5110 v_0 := v.Args[0]
5111
5112
5113
5114 for {
5115 c := auxIntToInt32(v.AuxInt)
5116 if v_0.Op != OpPPC64SRWconst {
5117 break
5118 }
5119 s := auxIntToInt64(v_0.AuxInt)
5120 x := v_0.Args[0]
5121 if !(mergePPC64ClrlsldiSrw(int64(c), s) != 0) {
5122 break
5123 }
5124 v.reset(OpPPC64RLWINM)
5125 v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrw(int64(c), s))
5126 v.AddArg(x)
5127 return true
5128 }
5129
5130
5131
5132 for {
5133 c := auxIntToInt32(v.AuxInt)
5134 if v_0.Op != OpPPC64SRDconst {
5135 break
5136 }
5137 s := auxIntToInt64(v_0.AuxInt)
5138 x := v_0.Args[0]
5139 if !(mergePPC64ClrlsldiSrd(int64(c), s) != 0) {
5140 break
5141 }
5142 v.reset(OpPPC64RLWINM)
5143 v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrd(int64(c), s))
5144 v.AddArg(x)
5145 return true
5146 }
5147
5148
5149
5150 for {
5151 c := auxIntToInt32(v.AuxInt)
5152 i := v_0
5153 if i.Op != OpPPC64RLWINM {
5154 break
5155 }
5156 s := auxIntToInt64(i.AuxInt)
5157 x := i.Args[0]
5158 if !(mergePPC64ClrlsldiRlwinm(c, s) != 0) {
5159 break
5160 }
5161 v.reset(OpPPC64RLWINM)
5162 v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiRlwinm(c, s))
5163 v.AddArg(x)
5164 return true
5165 }
5166 return false
5167 }
5168 func rewriteValuePPC64_OpPPC64CMP(v *Value) bool {
5169 v_1 := v.Args[1]
5170 v_0 := v.Args[0]
5171 b := v.Block
5172
5173
5174
5175 for {
5176 x := v_0
5177 if v_1.Op != OpPPC64MOVDconst {
5178 break
5179 }
5180 c := auxIntToInt64(v_1.AuxInt)
5181 if !(is16Bit(c)) {
5182 break
5183 }
5184 v.reset(OpPPC64CMPconst)
5185 v.AuxInt = int64ToAuxInt(c)
5186 v.AddArg(x)
5187 return true
5188 }
5189
5190
5191
5192 for {
5193 if v_0.Op != OpPPC64MOVDconst {
5194 break
5195 }
5196 c := auxIntToInt64(v_0.AuxInt)
5197 y := v_1
5198 if !(is16Bit(c)) {
5199 break
5200 }
5201 v.reset(OpPPC64InvertFlags)
5202 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
5203 v0.AuxInt = int64ToAuxInt(c)
5204 v0.AddArg(y)
5205 v.AddArg(v0)
5206 return true
5207 }
5208
5209
5210
5211 for {
5212 x := v_0
5213 y := v_1
5214 if !(canonLessThan(x, y)) {
5215 break
5216 }
5217 v.reset(OpPPC64InvertFlags)
5218 v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
5219 v0.AddArg2(y, x)
5220 v.AddArg(v0)
5221 return true
5222 }
5223 return false
5224 }
5225 func rewriteValuePPC64_OpPPC64CMPU(v *Value) bool {
5226 v_1 := v.Args[1]
5227 v_0 := v.Args[0]
5228 b := v.Block
5229
5230
5231
5232 for {
5233 x := v_0
5234 if v_1.Op != OpPPC64MOVDconst {
5235 break
5236 }
5237 c := auxIntToInt64(v_1.AuxInt)
5238 if !(isU16Bit(c)) {
5239 break
5240 }
5241 v.reset(OpPPC64CMPUconst)
5242 v.AuxInt = int64ToAuxInt(c)
5243 v.AddArg(x)
5244 return true
5245 }
5246
5247
5248
5249 for {
5250 if v_0.Op != OpPPC64MOVDconst {
5251 break
5252 }
5253 c := auxIntToInt64(v_0.AuxInt)
5254 y := v_1
5255 if !(isU16Bit(c)) {
5256 break
5257 }
5258 v.reset(OpPPC64InvertFlags)
5259 v0 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
5260 v0.AuxInt = int64ToAuxInt(c)
5261 v0.AddArg(y)
5262 v.AddArg(v0)
5263 return true
5264 }
5265
5266
5267
5268 for {
5269 x := v_0
5270 y := v_1
5271 if !(canonLessThan(x, y)) {
5272 break
5273 }
5274 v.reset(OpPPC64InvertFlags)
5275 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
5276 v0.AddArg2(y, x)
5277 v.AddArg(v0)
5278 return true
5279 }
5280 return false
5281 }
5282 func rewriteValuePPC64_OpPPC64CMPUconst(v *Value) bool {
5283 v_0 := v.Args[0]
5284
5285
5286
5287 for {
5288 d := auxIntToInt64(v.AuxInt)
5289 if v_0.Op != OpPPC64ANDconst {
5290 break
5291 }
5292 c := auxIntToInt64(v_0.AuxInt)
5293 if !(uint64(d) > uint64(c)) {
5294 break
5295 }
5296 v.reset(OpPPC64FlagLT)
5297 return true
5298 }
5299
5300
5301
5302 for {
5303 y := auxIntToInt64(v.AuxInt)
5304 if v_0.Op != OpPPC64MOVDconst {
5305 break
5306 }
5307 x := auxIntToInt64(v_0.AuxInt)
5308 if !(x == y) {
5309 break
5310 }
5311 v.reset(OpPPC64FlagEQ)
5312 return true
5313 }
5314
5315
5316
5317 for {
5318 y := auxIntToInt64(v.AuxInt)
5319 if v_0.Op != OpPPC64MOVDconst {
5320 break
5321 }
5322 x := auxIntToInt64(v_0.AuxInt)
5323 if !(uint64(x) < uint64(y)) {
5324 break
5325 }
5326 v.reset(OpPPC64FlagLT)
5327 return true
5328 }
5329
5330
5331
5332 for {
5333 y := auxIntToInt64(v.AuxInt)
5334 if v_0.Op != OpPPC64MOVDconst {
5335 break
5336 }
5337 x := auxIntToInt64(v_0.AuxInt)
5338 if !(uint64(x) > uint64(y)) {
5339 break
5340 }
5341 v.reset(OpPPC64FlagGT)
5342 return true
5343 }
5344
5345
5346 for {
5347 if auxIntToInt64(v.AuxInt) != 0 {
5348 break
5349 }
5350 a := v_0
5351 if a.Op != OpPPC64ANDconst {
5352 break
5353 }
5354 v.reset(OpPPC64CMPconst)
5355 v.AuxInt = int64ToAuxInt(0)
5356 v.AddArg(a)
5357 return true
5358 }
5359 return false
5360 }
5361 func rewriteValuePPC64_OpPPC64CMPW(v *Value) bool {
5362 v_1 := v.Args[1]
5363 v_0 := v.Args[0]
5364 b := v.Block
5365
5366
5367 for {
5368 x := v_0
5369 if v_1.Op != OpPPC64MOVWreg {
5370 break
5371 }
5372 y := v_1.Args[0]
5373 v.reset(OpPPC64CMPW)
5374 v.AddArg2(x, y)
5375 return true
5376 }
5377
5378
5379 for {
5380 if v_0.Op != OpPPC64MOVWreg {
5381 break
5382 }
5383 x := v_0.Args[0]
5384 y := v_1
5385 v.reset(OpPPC64CMPW)
5386 v.AddArg2(x, y)
5387 return true
5388 }
5389
5390
5391
5392 for {
5393 x := v_0
5394 if v_1.Op != OpPPC64MOVDconst {
5395 break
5396 }
5397 c := auxIntToInt64(v_1.AuxInt)
5398 if !(is16Bit(c)) {
5399 break
5400 }
5401 v.reset(OpPPC64CMPWconst)
5402 v.AuxInt = int32ToAuxInt(int32(c))
5403 v.AddArg(x)
5404 return true
5405 }
5406
5407
5408
5409 for {
5410 if v_0.Op != OpPPC64MOVDconst {
5411 break
5412 }
5413 c := auxIntToInt64(v_0.AuxInt)
5414 y := v_1
5415 if !(is16Bit(c)) {
5416 break
5417 }
5418 v.reset(OpPPC64InvertFlags)
5419 v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, types.TypeFlags)
5420 v0.AuxInt = int32ToAuxInt(int32(c))
5421 v0.AddArg(y)
5422 v.AddArg(v0)
5423 return true
5424 }
5425
5426
5427
5428 for {
5429 x := v_0
5430 y := v_1
5431 if !(canonLessThan(x, y)) {
5432 break
5433 }
5434 v.reset(OpPPC64InvertFlags)
5435 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
5436 v0.AddArg2(y, x)
5437 v.AddArg(v0)
5438 return true
5439 }
5440 return false
5441 }
5442 func rewriteValuePPC64_OpPPC64CMPWU(v *Value) bool {
5443 v_1 := v.Args[1]
5444 v_0 := v.Args[0]
5445 b := v.Block
5446
5447
5448 for {
5449 x := v_0
5450 if v_1.Op != OpPPC64MOVWZreg {
5451 break
5452 }
5453 y := v_1.Args[0]
5454 v.reset(OpPPC64CMPWU)
5455 v.AddArg2(x, y)
5456 return true
5457 }
5458
5459
5460 for {
5461 if v_0.Op != OpPPC64MOVWZreg {
5462 break
5463 }
5464 x := v_0.Args[0]
5465 y := v_1
5466 v.reset(OpPPC64CMPWU)
5467 v.AddArg2(x, y)
5468 return true
5469 }
5470
5471
5472
5473 for {
5474 x := v_0
5475 if v_1.Op != OpPPC64MOVDconst {
5476 break
5477 }
5478 c := auxIntToInt64(v_1.AuxInt)
5479 if !(isU16Bit(c)) {
5480 break
5481 }
5482 v.reset(OpPPC64CMPWUconst)
5483 v.AuxInt = int32ToAuxInt(int32(c))
5484 v.AddArg(x)
5485 return true
5486 }
5487
5488
5489
5490 for {
5491 if v_0.Op != OpPPC64MOVDconst {
5492 break
5493 }
5494 c := auxIntToInt64(v_0.AuxInt)
5495 y := v_1
5496 if !(isU16Bit(c)) {
5497 break
5498 }
5499 v.reset(OpPPC64InvertFlags)
5500 v0 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
5501 v0.AuxInt = int32ToAuxInt(int32(c))
5502 v0.AddArg(y)
5503 v.AddArg(v0)
5504 return true
5505 }
5506
5507
5508
5509 for {
5510 x := v_0
5511 y := v_1
5512 if !(canonLessThan(x, y)) {
5513 break
5514 }
5515 v.reset(OpPPC64InvertFlags)
5516 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
5517 v0.AddArg2(y, x)
5518 v.AddArg(v0)
5519 return true
5520 }
5521 return false
5522 }
5523 func rewriteValuePPC64_OpPPC64CMPWUconst(v *Value) bool {
5524 v_0 := v.Args[0]
5525
5526
5527
5528 for {
5529 d := auxIntToInt32(v.AuxInt)
5530 if v_0.Op != OpPPC64ANDconst {
5531 break
5532 }
5533 c := auxIntToInt64(v_0.AuxInt)
5534 if !(uint64(d) > uint64(c)) {
5535 break
5536 }
5537 v.reset(OpPPC64FlagLT)
5538 return true
5539 }
5540
5541
5542
5543 for {
5544 y := auxIntToInt32(v.AuxInt)
5545 if v_0.Op != OpPPC64MOVDconst {
5546 break
5547 }
5548 x := auxIntToInt64(v_0.AuxInt)
5549 if !(int32(x) == int32(y)) {
5550 break
5551 }
5552 v.reset(OpPPC64FlagEQ)
5553 return true
5554 }
5555
5556
5557
5558 for {
5559 y := auxIntToInt32(v.AuxInt)
5560 if v_0.Op != OpPPC64MOVDconst {
5561 break
5562 }
5563 x := auxIntToInt64(v_0.AuxInt)
5564 if !(uint32(x) < uint32(y)) {
5565 break
5566 }
5567 v.reset(OpPPC64FlagLT)
5568 return true
5569 }
5570
5571
5572
5573 for {
5574 y := auxIntToInt32(v.AuxInt)
5575 if v_0.Op != OpPPC64MOVDconst {
5576 break
5577 }
5578 x := auxIntToInt64(v_0.AuxInt)
5579 if !(uint32(x) > uint32(y)) {
5580 break
5581 }
5582 v.reset(OpPPC64FlagGT)
5583 return true
5584 }
5585
5586
5587 for {
5588 if auxIntToInt32(v.AuxInt) != 0 {
5589 break
5590 }
5591 a := v_0
5592 if a.Op != OpPPC64ANDconst {
5593 break
5594 }
5595 v.reset(OpPPC64CMPconst)
5596 v.AuxInt = int64ToAuxInt(0)
5597 v.AddArg(a)
5598 return true
5599 }
5600 return false
5601 }
5602 func rewriteValuePPC64_OpPPC64CMPWconst(v *Value) bool {
5603 v_0 := v.Args[0]
5604
5605
5606
5607 for {
5608 y := auxIntToInt32(v.AuxInt)
5609 if v_0.Op != OpPPC64MOVDconst {
5610 break
5611 }
5612 x := auxIntToInt64(v_0.AuxInt)
5613 if !(int32(x) == int32(y)) {
5614 break
5615 }
5616 v.reset(OpPPC64FlagEQ)
5617 return true
5618 }
5619
5620
5621
5622 for {
5623 y := auxIntToInt32(v.AuxInt)
5624 if v_0.Op != OpPPC64MOVDconst {
5625 break
5626 }
5627 x := auxIntToInt64(v_0.AuxInt)
5628 if !(int32(x) < int32(y)) {
5629 break
5630 }
5631 v.reset(OpPPC64FlagLT)
5632 return true
5633 }
5634
5635
5636
5637 for {
5638 y := auxIntToInt32(v.AuxInt)
5639 if v_0.Op != OpPPC64MOVDconst {
5640 break
5641 }
5642 x := auxIntToInt64(v_0.AuxInt)
5643 if !(int32(x) > int32(y)) {
5644 break
5645 }
5646 v.reset(OpPPC64FlagGT)
5647 return true
5648 }
5649
5650
5651 for {
5652 if auxIntToInt32(v.AuxInt) != 0 {
5653 break
5654 }
5655 a := v_0
5656 if a.Op != OpPPC64ANDconst {
5657 break
5658 }
5659 v.reset(OpPPC64CMPconst)
5660 v.AuxInt = int64ToAuxInt(0)
5661 v.AddArg(a)
5662 return true
5663 }
5664 return false
5665 }
5666 func rewriteValuePPC64_OpPPC64CMPconst(v *Value) bool {
5667 v_0 := v.Args[0]
5668
5669
5670
5671 for {
5672 y := auxIntToInt64(v.AuxInt)
5673 if v_0.Op != OpPPC64MOVDconst {
5674 break
5675 }
5676 x := auxIntToInt64(v_0.AuxInt)
5677 if !(x == y) {
5678 break
5679 }
5680 v.reset(OpPPC64FlagEQ)
5681 return true
5682 }
5683
5684
5685
5686 for {
5687 y := auxIntToInt64(v.AuxInt)
5688 if v_0.Op != OpPPC64MOVDconst {
5689 break
5690 }
5691 x := auxIntToInt64(v_0.AuxInt)
5692 if !(x < y) {
5693 break
5694 }
5695 v.reset(OpPPC64FlagLT)
5696 return true
5697 }
5698
5699
5700
5701 for {
5702 y := auxIntToInt64(v.AuxInt)
5703 if v_0.Op != OpPPC64MOVDconst {
5704 break
5705 }
5706 x := auxIntToInt64(v_0.AuxInt)
5707 if !(x > y) {
5708 break
5709 }
5710 v.reset(OpPPC64FlagGT)
5711 return true
5712 }
5713 return false
5714 }
5715 func rewriteValuePPC64_OpPPC64Equal(v *Value) bool {
5716 v_0 := v.Args[0]
5717
5718
5719 for {
5720 if v_0.Op != OpPPC64FlagEQ {
5721 break
5722 }
5723 v.reset(OpPPC64MOVDconst)
5724 v.AuxInt = int64ToAuxInt(1)
5725 return true
5726 }
5727
5728
5729 for {
5730 if v_0.Op != OpPPC64FlagLT {
5731 break
5732 }
5733 v.reset(OpPPC64MOVDconst)
5734 v.AuxInt = int64ToAuxInt(0)
5735 return true
5736 }
5737
5738
5739 for {
5740 if v_0.Op != OpPPC64FlagGT {
5741 break
5742 }
5743 v.reset(OpPPC64MOVDconst)
5744 v.AuxInt = int64ToAuxInt(0)
5745 return true
5746 }
5747
5748
5749 for {
5750 if v_0.Op != OpPPC64InvertFlags {
5751 break
5752 }
5753 x := v_0.Args[0]
5754 v.reset(OpPPC64Equal)
5755 v.AddArg(x)
5756 return true
5757 }
5758
5759
5760 for {
5761 cmp := v_0
5762 v.reset(OpPPC64SETBC)
5763 v.AuxInt = int32ToAuxInt(2)
5764 v.AddArg(cmp)
5765 return true
5766 }
5767 }
5768 func rewriteValuePPC64_OpPPC64FABS(v *Value) bool {
5769 v_0 := v.Args[0]
5770
5771
5772 for {
5773 if v_0.Op != OpPPC64FMOVDconst {
5774 break
5775 }
5776 x := auxIntToFloat64(v_0.AuxInt)
5777 v.reset(OpPPC64FMOVDconst)
5778 v.AuxInt = float64ToAuxInt(math.Abs(x))
5779 return true
5780 }
5781 return false
5782 }
5783 func rewriteValuePPC64_OpPPC64FADD(v *Value) bool {
5784 v_1 := v.Args[1]
5785 v_0 := v.Args[0]
5786
5787
5788
5789 for {
5790 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5791 if v_0.Op != OpPPC64FMUL {
5792 continue
5793 }
5794 _ = v_0.Args[1]
5795 v_0_0 := v_0.Args[0]
5796 v_0_1 := v_0.Args[1]
5797 for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
5798 x := v_0_0
5799 y := v_0_1
5800 z := v_1
5801 if !(x.Block.Func.useFMA(v)) {
5802 continue
5803 }
5804 v.reset(OpPPC64FMADD)
5805 v.AddArg3(x, y, z)
5806 return true
5807 }
5808 }
5809 break
5810 }
5811 return false
5812 }
5813 func rewriteValuePPC64_OpPPC64FADDS(v *Value) bool {
5814 v_1 := v.Args[1]
5815 v_0 := v.Args[0]
5816
5817
5818
5819 for {
5820 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5821 if v_0.Op != OpPPC64FMULS {
5822 continue
5823 }
5824 _ = v_0.Args[1]
5825 v_0_0 := v_0.Args[0]
5826 v_0_1 := v_0.Args[1]
5827 for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
5828 x := v_0_0
5829 y := v_0_1
5830 z := v_1
5831 if !(x.Block.Func.useFMA(v)) {
5832 continue
5833 }
5834 v.reset(OpPPC64FMADDS)
5835 v.AddArg3(x, y, z)
5836 return true
5837 }
5838 }
5839 break
5840 }
5841 return false
5842 }
5843 func rewriteValuePPC64_OpPPC64FCEIL(v *Value) bool {
5844 v_0 := v.Args[0]
5845
5846
5847 for {
5848 if v_0.Op != OpPPC64FMOVDconst {
5849 break
5850 }
5851 x := auxIntToFloat64(v_0.AuxInt)
5852 v.reset(OpPPC64FMOVDconst)
5853 v.AuxInt = float64ToAuxInt(math.Ceil(x))
5854 return true
5855 }
5856 return false
5857 }
5858 func rewriteValuePPC64_OpPPC64FFLOOR(v *Value) bool {
5859 v_0 := v.Args[0]
5860
5861
5862 for {
5863 if v_0.Op != OpPPC64FMOVDconst {
5864 break
5865 }
5866 x := auxIntToFloat64(v_0.AuxInt)
5867 v.reset(OpPPC64FMOVDconst)
5868 v.AuxInt = float64ToAuxInt(math.Floor(x))
5869 return true
5870 }
5871 return false
5872 }
5873 func rewriteValuePPC64_OpPPC64FGreaterEqual(v *Value) bool {
5874 v_0 := v.Args[0]
5875 b := v.Block
5876 typ := &b.Func.Config.Types
5877
5878
5879 for {
5880 cmp := v_0
5881 v.reset(OpPPC64OR)
5882 v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
5883 v0.AuxInt = int32ToAuxInt(2)
5884 v0.AddArg(cmp)
5885 v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
5886 v1.AuxInt = int32ToAuxInt(1)
5887 v1.AddArg(cmp)
5888 v.AddArg2(v0, v1)
5889 return true
5890 }
5891 }
5892 func rewriteValuePPC64_OpPPC64FGreaterThan(v *Value) bool {
5893 v_0 := v.Args[0]
5894
5895
5896 for {
5897 cmp := v_0
5898 v.reset(OpPPC64SETBC)
5899 v.AuxInt = int32ToAuxInt(1)
5900 v.AddArg(cmp)
5901 return true
5902 }
5903 }
5904 func rewriteValuePPC64_OpPPC64FLessEqual(v *Value) bool {
5905 v_0 := v.Args[0]
5906 b := v.Block
5907 typ := &b.Func.Config.Types
5908
5909
5910 for {
5911 cmp := v_0
5912 v.reset(OpPPC64OR)
5913 v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
5914 v0.AuxInt = int32ToAuxInt(2)
5915 v0.AddArg(cmp)
5916 v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
5917 v1.AuxInt = int32ToAuxInt(0)
5918 v1.AddArg(cmp)
5919 v.AddArg2(v0, v1)
5920 return true
5921 }
5922 }
5923 func rewriteValuePPC64_OpPPC64FLessThan(v *Value) bool {
5924 v_0 := v.Args[0]
5925
5926
5927 for {
5928 cmp := v_0
5929 v.reset(OpPPC64SETBC)
5930 v.AuxInt = int32ToAuxInt(0)
5931 v.AddArg(cmp)
5932 return true
5933 }
5934 }
5935 func rewriteValuePPC64_OpPPC64FMOVDload(v *Value) bool {
5936 v_1 := v.Args[1]
5937 v_0 := v.Args[0]
5938
5939
5940 for {
5941 off := auxIntToInt32(v.AuxInt)
5942 sym := auxToSym(v.Aux)
5943 ptr := v_0
5944 if v_1.Op != OpPPC64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
5945 break
5946 }
5947 x := v_1.Args[1]
5948 if ptr != v_1.Args[0] {
5949 break
5950 }
5951 v.reset(OpPPC64MTVSRD)
5952 v.AddArg(x)
5953 return true
5954 }
5955
5956
5957
5958 for {
5959 off1 := auxIntToInt32(v.AuxInt)
5960 sym1 := auxToSym(v.Aux)
5961 p := v_0
5962 if p.Op != OpPPC64MOVDaddr {
5963 break
5964 }
5965 off2 := auxIntToInt32(p.AuxInt)
5966 sym2 := auxToSym(p.Aux)
5967 ptr := p.Args[0]
5968 mem := v_1
5969 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
5970 break
5971 }
5972 v.reset(OpPPC64FMOVDload)
5973 v.AuxInt = int32ToAuxInt(off1 + off2)
5974 v.Aux = symToAux(mergeSym(sym1, sym2))
5975 v.AddArg2(ptr, mem)
5976 return true
5977 }
5978
5979
5980
5981 for {
5982 off1 := auxIntToInt32(v.AuxInt)
5983 sym := auxToSym(v.Aux)
5984 if v_0.Op != OpPPC64ADDconst {
5985 break
5986 }
5987 off2 := auxIntToInt64(v_0.AuxInt)
5988 ptr := v_0.Args[0]
5989 mem := v_1
5990 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
5991 break
5992 }
5993 v.reset(OpPPC64FMOVDload)
5994 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
5995 v.Aux = symToAux(sym)
5996 v.AddArg2(ptr, mem)
5997 return true
5998 }
5999 return false
6000 }
6001 func rewriteValuePPC64_OpPPC64FMOVDstore(v *Value) bool {
6002 v_2 := v.Args[2]
6003 v_1 := v.Args[1]
6004 v_0 := v.Args[0]
6005
6006
6007 for {
6008 off := auxIntToInt32(v.AuxInt)
6009 sym := auxToSym(v.Aux)
6010 ptr := v_0
6011 if v_1.Op != OpPPC64MTVSRD {
6012 break
6013 }
6014 x := v_1.Args[0]
6015 mem := v_2
6016 v.reset(OpPPC64MOVDstore)
6017 v.AuxInt = int32ToAuxInt(off)
6018 v.Aux = symToAux(sym)
6019 v.AddArg3(ptr, x, mem)
6020 return true
6021 }
6022
6023
6024
6025 for {
6026 off1 := auxIntToInt32(v.AuxInt)
6027 sym := auxToSym(v.Aux)
6028 if v_0.Op != OpPPC64ADDconst {
6029 break
6030 }
6031 off2 := auxIntToInt64(v_0.AuxInt)
6032 ptr := v_0.Args[0]
6033 val := v_1
6034 mem := v_2
6035 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
6036 break
6037 }
6038 v.reset(OpPPC64FMOVDstore)
6039 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
6040 v.Aux = symToAux(sym)
6041 v.AddArg3(ptr, val, mem)
6042 return true
6043 }
6044
6045
6046
6047 for {
6048 off1 := auxIntToInt32(v.AuxInt)
6049 sym1 := auxToSym(v.Aux)
6050 p := v_0
6051 if p.Op != OpPPC64MOVDaddr {
6052 break
6053 }
6054 off2 := auxIntToInt32(p.AuxInt)
6055 sym2 := auxToSym(p.Aux)
6056 ptr := p.Args[0]
6057 val := v_1
6058 mem := v_2
6059 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
6060 break
6061 }
6062 v.reset(OpPPC64FMOVDstore)
6063 v.AuxInt = int32ToAuxInt(off1 + off2)
6064 v.Aux = symToAux(mergeSym(sym1, sym2))
6065 v.AddArg3(ptr, val, mem)
6066 return true
6067 }
6068 return false
6069 }
6070 func rewriteValuePPC64_OpPPC64FMOVSload(v *Value) bool {
6071 v_1 := v.Args[1]
6072 v_0 := v.Args[0]
6073
6074
6075
6076 for {
6077 off1 := auxIntToInt32(v.AuxInt)
6078 sym1 := auxToSym(v.Aux)
6079 p := v_0
6080 if p.Op != OpPPC64MOVDaddr {
6081 break
6082 }
6083 off2 := auxIntToInt32(p.AuxInt)
6084 sym2 := auxToSym(p.Aux)
6085 ptr := p.Args[0]
6086 mem := v_1
6087 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
6088 break
6089 }
6090 v.reset(OpPPC64FMOVSload)
6091 v.AuxInt = int32ToAuxInt(off1 + off2)
6092 v.Aux = symToAux(mergeSym(sym1, sym2))
6093 v.AddArg2(ptr, mem)
6094 return true
6095 }
6096
6097
6098
6099 for {
6100 off1 := auxIntToInt32(v.AuxInt)
6101 sym := auxToSym(v.Aux)
6102 if v_0.Op != OpPPC64ADDconst {
6103 break
6104 }
6105 off2 := auxIntToInt64(v_0.AuxInt)
6106 ptr := v_0.Args[0]
6107 mem := v_1
6108 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
6109 break
6110 }
6111 v.reset(OpPPC64FMOVSload)
6112 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
6113 v.Aux = symToAux(sym)
6114 v.AddArg2(ptr, mem)
6115 return true
6116 }
6117 return false
6118 }
6119 func rewriteValuePPC64_OpPPC64FMOVSstore(v *Value) bool {
6120 v_2 := v.Args[2]
6121 v_1 := v.Args[1]
6122 v_0 := v.Args[0]
6123
6124
6125
6126 for {
6127 off1 := auxIntToInt32(v.AuxInt)
6128 sym := auxToSym(v.Aux)
6129 if v_0.Op != OpPPC64ADDconst {
6130 break
6131 }
6132 off2 := auxIntToInt64(v_0.AuxInt)
6133 ptr := v_0.Args[0]
6134 val := v_1
6135 mem := v_2
6136 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
6137 break
6138 }
6139 v.reset(OpPPC64FMOVSstore)
6140 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
6141 v.Aux = symToAux(sym)
6142 v.AddArg3(ptr, val, mem)
6143 return true
6144 }
6145
6146
6147
6148 for {
6149 off1 := auxIntToInt32(v.AuxInt)
6150 sym1 := auxToSym(v.Aux)
6151 p := v_0
6152 if p.Op != OpPPC64MOVDaddr {
6153 break
6154 }
6155 off2 := auxIntToInt32(p.AuxInt)
6156 sym2 := auxToSym(p.Aux)
6157 ptr := p.Args[0]
6158 val := v_1
6159 mem := v_2
6160 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
6161 break
6162 }
6163 v.reset(OpPPC64FMOVSstore)
6164 v.AuxInt = int32ToAuxInt(off1 + off2)
6165 v.Aux = symToAux(mergeSym(sym1, sym2))
6166 v.AddArg3(ptr, val, mem)
6167 return true
6168 }
6169 return false
6170 }
6171 func rewriteValuePPC64_OpPPC64FNEG(v *Value) bool {
6172 v_0 := v.Args[0]
6173
6174
6175 for {
6176 if v_0.Op != OpPPC64FABS {
6177 break
6178 }
6179 x := v_0.Args[0]
6180 v.reset(OpPPC64FNABS)
6181 v.AddArg(x)
6182 return true
6183 }
6184
6185
6186 for {
6187 if v_0.Op != OpPPC64FNABS {
6188 break
6189 }
6190 x := v_0.Args[0]
6191 v.reset(OpPPC64FABS)
6192 v.AddArg(x)
6193 return true
6194 }
6195 return false
6196 }
6197 func rewriteValuePPC64_OpPPC64FSQRT(v *Value) bool {
6198 v_0 := v.Args[0]
6199
6200
6201
6202 for {
6203 if v_0.Op != OpPPC64FMOVDconst {
6204 break
6205 }
6206 x := auxIntToFloat64(v_0.AuxInt)
6207 if !(x >= 0) {
6208 break
6209 }
6210 v.reset(OpPPC64FMOVDconst)
6211 v.AuxInt = float64ToAuxInt(math.Sqrt(x))
6212 return true
6213 }
6214 return false
6215 }
6216 func rewriteValuePPC64_OpPPC64FSUB(v *Value) bool {
6217 v_1 := v.Args[1]
6218 v_0 := v.Args[0]
6219
6220
6221
6222 for {
6223 if v_0.Op != OpPPC64FMUL {
6224 break
6225 }
6226 _ = v_0.Args[1]
6227 v_0_0 := v_0.Args[0]
6228 v_0_1 := v_0.Args[1]
6229 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6230 x := v_0_0
6231 y := v_0_1
6232 z := v_1
6233 if !(x.Block.Func.useFMA(v)) {
6234 continue
6235 }
6236 v.reset(OpPPC64FMSUB)
6237 v.AddArg3(x, y, z)
6238 return true
6239 }
6240 break
6241 }
6242 return false
6243 }
6244 func rewriteValuePPC64_OpPPC64FSUBS(v *Value) bool {
6245 v_1 := v.Args[1]
6246 v_0 := v.Args[0]
6247
6248
6249
6250 for {
6251 if v_0.Op != OpPPC64FMULS {
6252 break
6253 }
6254 _ = v_0.Args[1]
6255 v_0_0 := v_0.Args[0]
6256 v_0_1 := v_0.Args[1]
6257 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
6258 x := v_0_0
6259 y := v_0_1
6260 z := v_1
6261 if !(x.Block.Func.useFMA(v)) {
6262 continue
6263 }
6264 v.reset(OpPPC64FMSUBS)
6265 v.AddArg3(x, y, z)
6266 return true
6267 }
6268 break
6269 }
6270 return false
6271 }
6272 func rewriteValuePPC64_OpPPC64FTRUNC(v *Value) bool {
6273 v_0 := v.Args[0]
6274
6275
6276 for {
6277 if v_0.Op != OpPPC64FMOVDconst {
6278 break
6279 }
6280 x := auxIntToFloat64(v_0.AuxInt)
6281 v.reset(OpPPC64FMOVDconst)
6282 v.AuxInt = float64ToAuxInt(math.Trunc(x))
6283 return true
6284 }
6285 return false
6286 }
6287 func rewriteValuePPC64_OpPPC64GreaterEqual(v *Value) bool {
6288 v_0 := v.Args[0]
6289
6290
6291 for {
6292 if v_0.Op != OpPPC64FlagEQ {
6293 break
6294 }
6295 v.reset(OpPPC64MOVDconst)
6296 v.AuxInt = int64ToAuxInt(1)
6297 return true
6298 }
6299
6300
6301 for {
6302 if v_0.Op != OpPPC64FlagLT {
6303 break
6304 }
6305 v.reset(OpPPC64MOVDconst)
6306 v.AuxInt = int64ToAuxInt(0)
6307 return true
6308 }
6309
6310
6311 for {
6312 if v_0.Op != OpPPC64FlagGT {
6313 break
6314 }
6315 v.reset(OpPPC64MOVDconst)
6316 v.AuxInt = int64ToAuxInt(1)
6317 return true
6318 }
6319
6320
6321 for {
6322 if v_0.Op != OpPPC64InvertFlags {
6323 break
6324 }
6325 x := v_0.Args[0]
6326 v.reset(OpPPC64LessEqual)
6327 v.AddArg(x)
6328 return true
6329 }
6330
6331
6332 for {
6333 cmp := v_0
6334 v.reset(OpPPC64SETBCR)
6335 v.AuxInt = int32ToAuxInt(0)
6336 v.AddArg(cmp)
6337 return true
6338 }
6339 }
6340 func rewriteValuePPC64_OpPPC64GreaterThan(v *Value) bool {
6341 v_0 := v.Args[0]
6342
6343
6344 for {
6345 if v_0.Op != OpPPC64FlagEQ {
6346 break
6347 }
6348 v.reset(OpPPC64MOVDconst)
6349 v.AuxInt = int64ToAuxInt(0)
6350 return true
6351 }
6352
6353
6354 for {
6355 if v_0.Op != OpPPC64FlagLT {
6356 break
6357 }
6358 v.reset(OpPPC64MOVDconst)
6359 v.AuxInt = int64ToAuxInt(0)
6360 return true
6361 }
6362
6363
6364 for {
6365 if v_0.Op != OpPPC64FlagGT {
6366 break
6367 }
6368 v.reset(OpPPC64MOVDconst)
6369 v.AuxInt = int64ToAuxInt(1)
6370 return true
6371 }
6372
6373
6374 for {
6375 if v_0.Op != OpPPC64InvertFlags {
6376 break
6377 }
6378 x := v_0.Args[0]
6379 v.reset(OpPPC64LessThan)
6380 v.AddArg(x)
6381 return true
6382 }
6383
6384
6385 for {
6386 cmp := v_0
6387 v.reset(OpPPC64SETBC)
6388 v.AuxInt = int32ToAuxInt(1)
6389 v.AddArg(cmp)
6390 return true
6391 }
6392 }
6393 func rewriteValuePPC64_OpPPC64ISEL(v *Value) bool {
6394 v_2 := v.Args[2]
6395 v_1 := v.Args[1]
6396 v_0 := v.Args[0]
6397
6398
6399 for {
6400 if auxIntToInt32(v.AuxInt) != 6 {
6401 break
6402 }
6403 x := v_0
6404 y := v_1
6405 if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
6406 break
6407 }
6408 v_2_0 := v_2.Args[0]
6409 if v_2_0.Op != OpPPC64ANDconst || auxIntToInt64(v_2_0.AuxInt) != 1 {
6410 break
6411 }
6412 v_2_0_0 := v_2_0.Args[0]
6413 if v_2_0_0.Op != OpPPC64SETBC {
6414 break
6415 }
6416 c := auxIntToInt32(v_2_0_0.AuxInt)
6417 cmp := v_2_0_0.Args[0]
6418 v.reset(OpPPC64ISEL)
6419 v.AuxInt = int32ToAuxInt(c)
6420 v.AddArg3(x, y, cmp)
6421 return true
6422 }
6423
6424
6425 for {
6426 if auxIntToInt32(v.AuxInt) != 6 {
6427 break
6428 }
6429 x := v_0
6430 y := v_1
6431 if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
6432 break
6433 }
6434 v_2_0 := v_2.Args[0]
6435 if v_2_0.Op != OpPPC64SETBC {
6436 break
6437 }
6438 c := auxIntToInt32(v_2_0.AuxInt)
6439 cmp := v_2_0.Args[0]
6440 v.reset(OpPPC64ISEL)
6441 v.AuxInt = int32ToAuxInt(c)
6442 v.AddArg3(x, y, cmp)
6443 return true
6444 }
6445
6446
6447 for {
6448 if auxIntToInt32(v.AuxInt) != 6 {
6449 break
6450 }
6451 x := v_0
6452 y := v_1
6453 if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
6454 break
6455 }
6456 v_2_0 := v_2.Args[0]
6457 if v_2_0.Op != OpPPC64SETBC {
6458 break
6459 }
6460 c := auxIntToInt32(v_2_0.AuxInt)
6461 cmp := v_2_0.Args[0]
6462 v.reset(OpPPC64ISEL)
6463 v.AuxInt = int32ToAuxInt(c)
6464 v.AddArg3(x, y, cmp)
6465 return true
6466 }
6467
6468
6469 for {
6470 if auxIntToInt32(v.AuxInt) != 6 {
6471 break
6472 }
6473 x := v_0
6474 y := v_1
6475 if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
6476 break
6477 }
6478 v_2_0 := v_2.Args[0]
6479 if v_2_0.Op != OpPPC64SETBCR {
6480 break
6481 }
6482 c := auxIntToInt32(v_2_0.AuxInt)
6483 cmp := v_2_0.Args[0]
6484 v.reset(OpPPC64ISEL)
6485 v.AuxInt = int32ToAuxInt(c + 4)
6486 v.AddArg3(x, y, cmp)
6487 return true
6488 }
6489
6490
6491 for {
6492 if auxIntToInt32(v.AuxInt) != 6 {
6493 break
6494 }
6495 x := v_0
6496 y := v_1
6497 if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
6498 break
6499 }
6500 v_2_0 := v_2.Args[0]
6501 if v_2_0.Op != OpPPC64SETBCR {
6502 break
6503 }
6504 c := auxIntToInt32(v_2_0.AuxInt)
6505 cmp := v_2_0.Args[0]
6506 v.reset(OpPPC64ISEL)
6507 v.AuxInt = int32ToAuxInt(c + 4)
6508 v.AddArg3(x, y, cmp)
6509 return true
6510 }
6511
6512
6513 for {
6514 if auxIntToInt32(v.AuxInt) != 2 {
6515 break
6516 }
6517 x := v_0
6518 if v_2.Op != OpPPC64FlagEQ {
6519 break
6520 }
6521 v.copyOf(x)
6522 return true
6523 }
6524
6525
6526 for {
6527 if auxIntToInt32(v.AuxInt) != 2 {
6528 break
6529 }
6530 y := v_1
6531 if v_2.Op != OpPPC64FlagLT {
6532 break
6533 }
6534 v.copyOf(y)
6535 return true
6536 }
6537
6538
6539 for {
6540 if auxIntToInt32(v.AuxInt) != 2 {
6541 break
6542 }
6543 y := v_1
6544 if v_2.Op != OpPPC64FlagGT {
6545 break
6546 }
6547 v.copyOf(y)
6548 return true
6549 }
6550
6551
6552 for {
6553 if auxIntToInt32(v.AuxInt) != 6 {
6554 break
6555 }
6556 y := v_1
6557 if v_2.Op != OpPPC64FlagEQ {
6558 break
6559 }
6560 v.copyOf(y)
6561 return true
6562 }
6563
6564
6565 for {
6566 if auxIntToInt32(v.AuxInt) != 6 {
6567 break
6568 }
6569 x := v_0
6570 if v_2.Op != OpPPC64FlagLT {
6571 break
6572 }
6573 v.copyOf(x)
6574 return true
6575 }
6576
6577
6578 for {
6579 if auxIntToInt32(v.AuxInt) != 6 {
6580 break
6581 }
6582 x := v_0
6583 if v_2.Op != OpPPC64FlagGT {
6584 break
6585 }
6586 v.copyOf(x)
6587 return true
6588 }
6589
6590
6591 for {
6592 if auxIntToInt32(v.AuxInt) != 0 {
6593 break
6594 }
6595 y := v_1
6596 if v_2.Op != OpPPC64FlagEQ {
6597 break
6598 }
6599 v.copyOf(y)
6600 return true
6601 }
6602
6603
6604 for {
6605 if auxIntToInt32(v.AuxInt) != 0 {
6606 break
6607 }
6608 y := v_1
6609 if v_2.Op != OpPPC64FlagGT {
6610 break
6611 }
6612 v.copyOf(y)
6613 return true
6614 }
6615
6616
6617 for {
6618 if auxIntToInt32(v.AuxInt) != 0 {
6619 break
6620 }
6621 x := v_0
6622 if v_2.Op != OpPPC64FlagLT {
6623 break
6624 }
6625 v.copyOf(x)
6626 return true
6627 }
6628
6629
6630 for {
6631 if auxIntToInt32(v.AuxInt) != 5 {
6632 break
6633 }
6634 x := v_1
6635 if v_2.Op != OpPPC64FlagEQ {
6636 break
6637 }
6638 v.copyOf(x)
6639 return true
6640 }
6641
6642
6643 for {
6644 if auxIntToInt32(v.AuxInt) != 5 {
6645 break
6646 }
6647 x := v_1
6648 if v_2.Op != OpPPC64FlagLT {
6649 break
6650 }
6651 v.copyOf(x)
6652 return true
6653 }
6654
6655
6656 for {
6657 if auxIntToInt32(v.AuxInt) != 5 {
6658 break
6659 }
6660 y := v_0
6661 if v_2.Op != OpPPC64FlagGT {
6662 break
6663 }
6664 v.copyOf(y)
6665 return true
6666 }
6667
6668
6669 for {
6670 if auxIntToInt32(v.AuxInt) != 1 {
6671 break
6672 }
6673 y := v_1
6674 if v_2.Op != OpPPC64FlagEQ {
6675 break
6676 }
6677 v.copyOf(y)
6678 return true
6679 }
6680
6681
6682 for {
6683 if auxIntToInt32(v.AuxInt) != 1 {
6684 break
6685 }
6686 y := v_1
6687 if v_2.Op != OpPPC64FlagLT {
6688 break
6689 }
6690 v.copyOf(y)
6691 return true
6692 }
6693
6694
6695 for {
6696 if auxIntToInt32(v.AuxInt) != 1 {
6697 break
6698 }
6699 x := v_0
6700 if v_2.Op != OpPPC64FlagGT {
6701 break
6702 }
6703 v.copyOf(x)
6704 return true
6705 }
6706
6707
6708 for {
6709 if auxIntToInt32(v.AuxInt) != 4 {
6710 break
6711 }
6712 x := v_0
6713 if v_2.Op != OpPPC64FlagEQ {
6714 break
6715 }
6716 v.copyOf(x)
6717 return true
6718 }
6719
6720
6721 for {
6722 if auxIntToInt32(v.AuxInt) != 4 {
6723 break
6724 }
6725 x := v_0
6726 if v_2.Op != OpPPC64FlagGT {
6727 break
6728 }
6729 v.copyOf(x)
6730 return true
6731 }
6732
6733
6734 for {
6735 if auxIntToInt32(v.AuxInt) != 4 {
6736 break
6737 }
6738 y := v_1
6739 if v_2.Op != OpPPC64FlagLT {
6740 break
6741 }
6742 v.copyOf(y)
6743 return true
6744 }
6745
6746
6747
6748 for {
6749 n := auxIntToInt32(v.AuxInt)
6750 x := v_0
6751 y := v_1
6752 if v_2.Op != OpPPC64InvertFlags {
6753 break
6754 }
6755 bool := v_2.Args[0]
6756 if !(n%4 == 0) {
6757 break
6758 }
6759 v.reset(OpPPC64ISEL)
6760 v.AuxInt = int32ToAuxInt(n + 1)
6761 v.AddArg3(x, y, bool)
6762 return true
6763 }
6764
6765
6766
6767 for {
6768 n := auxIntToInt32(v.AuxInt)
6769 x := v_0
6770 y := v_1
6771 if v_2.Op != OpPPC64InvertFlags {
6772 break
6773 }
6774 bool := v_2.Args[0]
6775 if !(n%4 == 1) {
6776 break
6777 }
6778 v.reset(OpPPC64ISEL)
6779 v.AuxInt = int32ToAuxInt(n - 1)
6780 v.AddArg3(x, y, bool)
6781 return true
6782 }
6783
6784
6785
6786 for {
6787 n := auxIntToInt32(v.AuxInt)
6788 x := v_0
6789 y := v_1
6790 if v_2.Op != OpPPC64InvertFlags {
6791 break
6792 }
6793 bool := v_2.Args[0]
6794 if !(n%4 == 2) {
6795 break
6796 }
6797 v.reset(OpPPC64ISEL)
6798 v.AuxInt = int32ToAuxInt(n)
6799 v.AddArg3(x, y, bool)
6800 return true
6801 }
6802 return false
6803 }
6804 func rewriteValuePPC64_OpPPC64LessEqual(v *Value) bool {
6805 v_0 := v.Args[0]
6806
6807
6808 for {
6809 if v_0.Op != OpPPC64FlagEQ {
6810 break
6811 }
6812 v.reset(OpPPC64MOVDconst)
6813 v.AuxInt = int64ToAuxInt(1)
6814 return true
6815 }
6816
6817
6818 for {
6819 if v_0.Op != OpPPC64FlagLT {
6820 break
6821 }
6822 v.reset(OpPPC64MOVDconst)
6823 v.AuxInt = int64ToAuxInt(1)
6824 return true
6825 }
6826
6827
6828 for {
6829 if v_0.Op != OpPPC64FlagGT {
6830 break
6831 }
6832 v.reset(OpPPC64MOVDconst)
6833 v.AuxInt = int64ToAuxInt(0)
6834 return true
6835 }
6836
6837
6838 for {
6839 if v_0.Op != OpPPC64InvertFlags {
6840 break
6841 }
6842 x := v_0.Args[0]
6843 v.reset(OpPPC64GreaterEqual)
6844 v.AddArg(x)
6845 return true
6846 }
6847
6848
6849 for {
6850 cmp := v_0
6851 v.reset(OpPPC64SETBCR)
6852 v.AuxInt = int32ToAuxInt(1)
6853 v.AddArg(cmp)
6854 return true
6855 }
6856 }
6857 func rewriteValuePPC64_OpPPC64LessThan(v *Value) bool {
6858 v_0 := v.Args[0]
6859
6860
6861 for {
6862 if v_0.Op != OpPPC64FlagEQ {
6863 break
6864 }
6865 v.reset(OpPPC64MOVDconst)
6866 v.AuxInt = int64ToAuxInt(0)
6867 return true
6868 }
6869
6870
6871 for {
6872 if v_0.Op != OpPPC64FlagLT {
6873 break
6874 }
6875 v.reset(OpPPC64MOVDconst)
6876 v.AuxInt = int64ToAuxInt(1)
6877 return true
6878 }
6879
6880
6881 for {
6882 if v_0.Op != OpPPC64FlagGT {
6883 break
6884 }
6885 v.reset(OpPPC64MOVDconst)
6886 v.AuxInt = int64ToAuxInt(0)
6887 return true
6888 }
6889
6890
6891 for {
6892 if v_0.Op != OpPPC64InvertFlags {
6893 break
6894 }
6895 x := v_0.Args[0]
6896 v.reset(OpPPC64GreaterThan)
6897 v.AddArg(x)
6898 return true
6899 }
6900
6901
6902 for {
6903 cmp := v_0
6904 v.reset(OpPPC64SETBC)
6905 v.AuxInt = int32ToAuxInt(0)
6906 v.AddArg(cmp)
6907 return true
6908 }
6909 }
6910 func rewriteValuePPC64_OpPPC64LoweredPanicBoundsCR(v *Value) bool {
6911 v_1 := v.Args[1]
6912 v_0 := v.Args[0]
6913
6914
6915 for {
6916 kind := auxIntToInt64(v.AuxInt)
6917 p := auxToPanicBoundsC(v.Aux)
6918 if v_0.Op != OpPPC64MOVDconst {
6919 break
6920 }
6921 c := auxIntToInt64(v_0.AuxInt)
6922 mem := v_1
6923 v.reset(OpPPC64LoweredPanicBoundsCC)
6924 v.AuxInt = int64ToAuxInt(kind)
6925 v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: p.C, Cy: c})
6926 v.AddArg(mem)
6927 return true
6928 }
6929 return false
6930 }
6931 func rewriteValuePPC64_OpPPC64LoweredPanicBoundsRC(v *Value) bool {
6932 v_1 := v.Args[1]
6933 v_0 := v.Args[0]
6934
6935
6936 for {
6937 kind := auxIntToInt64(v.AuxInt)
6938 p := auxToPanicBoundsC(v.Aux)
6939 if v_0.Op != OpPPC64MOVDconst {
6940 break
6941 }
6942 c := auxIntToInt64(v_0.AuxInt)
6943 mem := v_1
6944 v.reset(OpPPC64LoweredPanicBoundsCC)
6945 v.AuxInt = int64ToAuxInt(kind)
6946 v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: c, Cy: p.C})
6947 v.AddArg(mem)
6948 return true
6949 }
6950 return false
6951 }
6952 func rewriteValuePPC64_OpPPC64LoweredPanicBoundsRR(v *Value) bool {
6953 v_2 := v.Args[2]
6954 v_1 := v.Args[1]
6955 v_0 := v.Args[0]
6956
6957
6958 for {
6959 kind := auxIntToInt64(v.AuxInt)
6960 x := v_0
6961 if v_1.Op != OpPPC64MOVDconst {
6962 break
6963 }
6964 c := auxIntToInt64(v_1.AuxInt)
6965 mem := v_2
6966 v.reset(OpPPC64LoweredPanicBoundsRC)
6967 v.AuxInt = int64ToAuxInt(kind)
6968 v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
6969 v.AddArg2(x, mem)
6970 return true
6971 }
6972
6973
6974 for {
6975 kind := auxIntToInt64(v.AuxInt)
6976 if v_0.Op != OpPPC64MOVDconst {
6977 break
6978 }
6979 c := auxIntToInt64(v_0.AuxInt)
6980 y := v_1
6981 mem := v_2
6982 v.reset(OpPPC64LoweredPanicBoundsCR)
6983 v.AuxInt = int64ToAuxInt(kind)
6984 v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
6985 v.AddArg2(y, mem)
6986 return true
6987 }
6988 return false
6989 }
6990 func rewriteValuePPC64_OpPPC64MFVSRD(v *Value) bool {
6991 v_0 := v.Args[0]
6992 b := v.Block
6993 typ := &b.Func.Config.Types
6994
6995
6996 for {
6997 if v_0.Op != OpPPC64FMOVDconst {
6998 break
6999 }
7000 c := auxIntToFloat64(v_0.AuxInt)
7001 v.reset(OpPPC64MOVDconst)
7002 v.AuxInt = int64ToAuxInt(int64(math.Float64bits(c)))
7003 return true
7004 }
7005
7006
7007
7008 for {
7009 x := v_0
7010 if x.Op != OpPPC64FMOVDload {
7011 break
7012 }
7013 off := auxIntToInt32(x.AuxInt)
7014 sym := auxToSym(x.Aux)
7015 mem := x.Args[1]
7016 ptr := x.Args[0]
7017 if !(x.Uses == 1 && clobber(x)) {
7018 break
7019 }
7020 b = x.Block
7021 v0 := b.NewValue0(x.Pos, OpPPC64MOVDload, typ.Int64)
7022 v.copyOf(v0)
7023 v0.AuxInt = int32ToAuxInt(off)
7024 v0.Aux = symToAux(sym)
7025 v0.AddArg2(ptr, mem)
7026 return true
7027 }
7028 return false
7029 }
7030 func rewriteValuePPC64_OpPPC64MOVBZload(v *Value) bool {
7031 v_1 := v.Args[1]
7032 v_0 := v.Args[0]
7033
7034
7035
7036 for {
7037 off1 := auxIntToInt32(v.AuxInt)
7038 sym1 := auxToSym(v.Aux)
7039 p := v_0
7040 if p.Op != OpPPC64MOVDaddr {
7041 break
7042 }
7043 off2 := auxIntToInt32(p.AuxInt)
7044 sym2 := auxToSym(p.Aux)
7045 ptr := p.Args[0]
7046 mem := v_1
7047 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
7048 break
7049 }
7050 v.reset(OpPPC64MOVBZload)
7051 v.AuxInt = int32ToAuxInt(off1 + off2)
7052 v.Aux = symToAux(mergeSym(sym1, sym2))
7053 v.AddArg2(ptr, mem)
7054 return true
7055 }
7056
7057
7058
7059 for {
7060 off1 := auxIntToInt32(v.AuxInt)
7061 sym := auxToSym(v.Aux)
7062 if v_0.Op != OpPPC64ADDconst {
7063 break
7064 }
7065 off2 := auxIntToInt64(v_0.AuxInt)
7066 x := v_0.Args[0]
7067 mem := v_1
7068 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
7069 break
7070 }
7071 v.reset(OpPPC64MOVBZload)
7072 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
7073 v.Aux = symToAux(sym)
7074 v.AddArg2(x, mem)
7075 return true
7076 }
7077
7078
7079
7080 for {
7081 if auxIntToInt32(v.AuxInt) != 0 {
7082 break
7083 }
7084 sym := auxToSym(v.Aux)
7085 p := v_0
7086 if p.Op != OpPPC64ADD {
7087 break
7088 }
7089 idx := p.Args[1]
7090 ptr := p.Args[0]
7091 mem := v_1
7092 if !(sym == nil && p.Uses == 1) {
7093 break
7094 }
7095 v.reset(OpPPC64MOVBZloadidx)
7096 v.AddArg3(ptr, idx, mem)
7097 return true
7098 }
7099 return false
7100 }
7101 func rewriteValuePPC64_OpPPC64MOVBZloadidx(v *Value) bool {
7102 v_2 := v.Args[2]
7103 v_1 := v.Args[1]
7104 v_0 := v.Args[0]
7105
7106
7107
7108 for {
7109 ptr := v_0
7110 if v_1.Op != OpPPC64MOVDconst {
7111 break
7112 }
7113 c := auxIntToInt64(v_1.AuxInt)
7114 mem := v_2
7115 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
7116 break
7117 }
7118 v.reset(OpPPC64MOVBZload)
7119 v.AuxInt = int32ToAuxInt(int32(c))
7120 v.AddArg2(ptr, mem)
7121 return true
7122 }
7123
7124
7125
7126 for {
7127 if v_0.Op != OpPPC64MOVDconst {
7128 break
7129 }
7130 c := auxIntToInt64(v_0.AuxInt)
7131 ptr := v_1
7132 mem := v_2
7133 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
7134 break
7135 }
7136 v.reset(OpPPC64MOVBZload)
7137 v.AuxInt = int32ToAuxInt(int32(c))
7138 v.AddArg2(ptr, mem)
7139 return true
7140 }
7141 return false
7142 }
7143 func rewriteValuePPC64_OpPPC64MOVBZreg(v *Value) bool {
7144 v_0 := v.Args[0]
7145 b := v.Block
7146 typ := &b.Func.Config.Types
7147
7148
7149
7150 for {
7151 y := v_0
7152 if y.Op != OpPPC64ANDconst {
7153 break
7154 }
7155 c := auxIntToInt64(y.AuxInt)
7156 if !(uint64(c) <= 0xFF) {
7157 break
7158 }
7159 v.copyOf(y)
7160 return true
7161 }
7162
7163
7164 for {
7165 if v_0.Op != OpPPC64SRWconst {
7166 break
7167 }
7168 c := auxIntToInt64(v_0.AuxInt)
7169 v_0_0 := v_0.Args[0]
7170 if v_0_0.Op != OpPPC64MOVBZreg {
7171 break
7172 }
7173 x := v_0_0.Args[0]
7174 v.reset(OpPPC64SRWconst)
7175 v.AuxInt = int64ToAuxInt(c)
7176 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
7177 v0.AddArg(x)
7178 v.AddArg(v0)
7179 return true
7180 }
7181
7182
7183
7184 for {
7185 if v_0.Op != OpPPC64SRWconst {
7186 break
7187 }
7188 c := auxIntToInt64(v_0.AuxInt)
7189 x := v_0.Args[0]
7190 if !(x.Type.Size() == 8) {
7191 break
7192 }
7193 v.reset(OpPPC64SRWconst)
7194 v.AuxInt = int64ToAuxInt(c)
7195 v.AddArg(x)
7196 return true
7197 }
7198
7199
7200
7201 for {
7202 if v_0.Op != OpPPC64SRDconst {
7203 break
7204 }
7205 c := auxIntToInt64(v_0.AuxInt)
7206 x := v_0.Args[0]
7207 if !(c >= 56) {
7208 break
7209 }
7210 v.reset(OpPPC64SRDconst)
7211 v.AuxInt = int64ToAuxInt(c)
7212 v.AddArg(x)
7213 return true
7214 }
7215
7216
7217
7218 for {
7219 if v_0.Op != OpPPC64SRWconst {
7220 break
7221 }
7222 c := auxIntToInt64(v_0.AuxInt)
7223 x := v_0.Args[0]
7224 if !(c >= 24) {
7225 break
7226 }
7227 v.reset(OpPPC64SRWconst)
7228 v.AuxInt = int64ToAuxInt(c)
7229 v.AddArg(x)
7230 return true
7231 }
7232
7233
7234 for {
7235 y := v_0
7236 if y.Op != OpPPC64MOVBZreg {
7237 break
7238 }
7239 v.copyOf(y)
7240 return true
7241 }
7242
7243
7244 for {
7245 if v_0.Op != OpPPC64MOVBreg {
7246 break
7247 }
7248 x := v_0.Args[0]
7249 v.reset(OpPPC64MOVBZreg)
7250 v.AddArg(x)
7251 return true
7252 }
7253
7254
7255
7256 for {
7257 if v_0.Op != OpPPC64SRWconst {
7258 break
7259 }
7260 s := auxIntToInt64(v_0.AuxInt)
7261 x := v_0.Args[0]
7262 if !(mergePPC64AndSrwi(0xFF, s) != 0) {
7263 break
7264 }
7265 v.reset(OpPPC64RLWINM)
7266 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(0xFF, s))
7267 v.AddArg(x)
7268 return true
7269 }
7270
7271
7272
7273 for {
7274 if v_0.Op != OpPPC64RLWINM {
7275 break
7276 }
7277 r := auxIntToInt64(v_0.AuxInt)
7278 y := v_0.Args[0]
7279 if !(mergePPC64AndRlwinm(0xFF, r) != 0) {
7280 break
7281 }
7282 v.reset(OpPPC64RLWINM)
7283 v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFF, r))
7284 v.AddArg(y)
7285 return true
7286 }
7287
7288
7289 for {
7290 if v_0.Op != OpPPC64OR {
7291 break
7292 }
7293 t := v_0.Type
7294 _ = v_0.Args[1]
7295 v_0_0 := v_0.Args[0]
7296 v_0_1 := v_0.Args[1]
7297 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7298 x := v_0_0
7299 if v_0_1.Op != OpPPC64MOVWZreg {
7300 continue
7301 }
7302 y := v_0_1.Args[0]
7303 v.reset(OpPPC64MOVBZreg)
7304 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
7305 v0.AddArg2(x, y)
7306 v.AddArg(v0)
7307 return true
7308 }
7309 break
7310 }
7311
7312
7313 for {
7314 if v_0.Op != OpPPC64XOR {
7315 break
7316 }
7317 t := v_0.Type
7318 _ = v_0.Args[1]
7319 v_0_0 := v_0.Args[0]
7320 v_0_1 := v_0.Args[1]
7321 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7322 x := v_0_0
7323 if v_0_1.Op != OpPPC64MOVWZreg {
7324 continue
7325 }
7326 y := v_0_1.Args[0]
7327 v.reset(OpPPC64MOVBZreg)
7328 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
7329 v0.AddArg2(x, y)
7330 v.AddArg(v0)
7331 return true
7332 }
7333 break
7334 }
7335
7336
7337 for {
7338 if v_0.Op != OpPPC64AND {
7339 break
7340 }
7341 t := v_0.Type
7342 _ = v_0.Args[1]
7343 v_0_0 := v_0.Args[0]
7344 v_0_1 := v_0.Args[1]
7345 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7346 x := v_0_0
7347 if v_0_1.Op != OpPPC64MOVWZreg {
7348 continue
7349 }
7350 y := v_0_1.Args[0]
7351 v.reset(OpPPC64MOVBZreg)
7352 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
7353 v0.AddArg2(x, y)
7354 v.AddArg(v0)
7355 return true
7356 }
7357 break
7358 }
7359
7360
7361 for {
7362 if v_0.Op != OpPPC64OR {
7363 break
7364 }
7365 t := v_0.Type
7366 _ = v_0.Args[1]
7367 v_0_0 := v_0.Args[0]
7368 v_0_1 := v_0.Args[1]
7369 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7370 x := v_0_0
7371 if v_0_1.Op != OpPPC64MOVHZreg {
7372 continue
7373 }
7374 y := v_0_1.Args[0]
7375 v.reset(OpPPC64MOVBZreg)
7376 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
7377 v0.AddArg2(x, y)
7378 v.AddArg(v0)
7379 return true
7380 }
7381 break
7382 }
7383
7384
7385 for {
7386 if v_0.Op != OpPPC64XOR {
7387 break
7388 }
7389 t := v_0.Type
7390 _ = v_0.Args[1]
7391 v_0_0 := v_0.Args[0]
7392 v_0_1 := v_0.Args[1]
7393 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7394 x := v_0_0
7395 if v_0_1.Op != OpPPC64MOVHZreg {
7396 continue
7397 }
7398 y := v_0_1.Args[0]
7399 v.reset(OpPPC64MOVBZreg)
7400 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
7401 v0.AddArg2(x, y)
7402 v.AddArg(v0)
7403 return true
7404 }
7405 break
7406 }
7407
7408
7409 for {
7410 if v_0.Op != OpPPC64AND {
7411 break
7412 }
7413 t := v_0.Type
7414 _ = v_0.Args[1]
7415 v_0_0 := v_0.Args[0]
7416 v_0_1 := v_0.Args[1]
7417 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7418 x := v_0_0
7419 if v_0_1.Op != OpPPC64MOVHZreg {
7420 continue
7421 }
7422 y := v_0_1.Args[0]
7423 v.reset(OpPPC64MOVBZreg)
7424 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
7425 v0.AddArg2(x, y)
7426 v.AddArg(v0)
7427 return true
7428 }
7429 break
7430 }
7431
7432
7433 for {
7434 if v_0.Op != OpPPC64OR {
7435 break
7436 }
7437 t := v_0.Type
7438 _ = v_0.Args[1]
7439 v_0_0 := v_0.Args[0]
7440 v_0_1 := v_0.Args[1]
7441 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7442 x := v_0_0
7443 if v_0_1.Op != OpPPC64MOVBZreg {
7444 continue
7445 }
7446 y := v_0_1.Args[0]
7447 v.reset(OpPPC64MOVBZreg)
7448 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
7449 v0.AddArg2(x, y)
7450 v.AddArg(v0)
7451 return true
7452 }
7453 break
7454 }
7455
7456
7457 for {
7458 if v_0.Op != OpPPC64XOR {
7459 break
7460 }
7461 t := v_0.Type
7462 _ = v_0.Args[1]
7463 v_0_0 := v_0.Args[0]
7464 v_0_1 := v_0.Args[1]
7465 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7466 x := v_0_0
7467 if v_0_1.Op != OpPPC64MOVBZreg {
7468 continue
7469 }
7470 y := v_0_1.Args[0]
7471 v.reset(OpPPC64MOVBZreg)
7472 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
7473 v0.AddArg2(x, y)
7474 v.AddArg(v0)
7475 return true
7476 }
7477 break
7478 }
7479
7480
7481 for {
7482 if v_0.Op != OpPPC64AND {
7483 break
7484 }
7485 t := v_0.Type
7486 _ = v_0.Args[1]
7487 v_0_0 := v_0.Args[0]
7488 v_0_1 := v_0.Args[1]
7489 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
7490 x := v_0_0
7491 if v_0_1.Op != OpPPC64MOVBZreg {
7492 continue
7493 }
7494 y := v_0_1.Args[0]
7495 v.reset(OpPPC64MOVBZreg)
7496 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
7497 v0.AddArg2(x, y)
7498 v.AddArg(v0)
7499 return true
7500 }
7501 break
7502 }
7503
7504
7505 for {
7506 z := v_0
7507 if z.Op != OpPPC64ANDconst {
7508 break
7509 }
7510 z_0 := z.Args[0]
7511 if z_0.Op != OpPPC64MOVBZload {
7512 break
7513 }
7514 v.copyOf(z)
7515 return true
7516 }
7517
7518
7519 for {
7520 z := v_0
7521 if z.Op != OpPPC64AND {
7522 break
7523 }
7524 _ = z.Args[1]
7525 z_0 := z.Args[0]
7526 z_1 := z.Args[1]
7527 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
7528 if z_1.Op != OpPPC64MOVBZload {
7529 continue
7530 }
7531 v.copyOf(z)
7532 return true
7533 }
7534 break
7535 }
7536
7537
7538 for {
7539 x := v_0
7540 if x.Op != OpPPC64MOVBZload {
7541 break
7542 }
7543 v.copyOf(x)
7544 return true
7545 }
7546
7547
7548 for {
7549 x := v_0
7550 if x.Op != OpPPC64MOVBZloadidx {
7551 break
7552 }
7553 v.copyOf(x)
7554 return true
7555 }
7556
7557
7558 for {
7559 x := v_0
7560 if x.Op != OpSelect0 {
7561 break
7562 }
7563 x_0 := x.Args[0]
7564 if x_0.Op != OpPPC64LoweredAtomicLoad8 {
7565 break
7566 }
7567 v.copyOf(x)
7568 return true
7569 }
7570
7571
7572
7573 for {
7574 x := v_0
7575 if x.Op != OpArg {
7576 break
7577 }
7578 t := x.Type
7579 if !(is8BitInt(t) && !t.IsSigned()) {
7580 break
7581 }
7582 v.copyOf(x)
7583 return true
7584 }
7585
7586
7587 for {
7588 if v_0.Op != OpPPC64MOVDconst {
7589 break
7590 }
7591 c := auxIntToInt64(v_0.AuxInt)
7592 v.reset(OpPPC64MOVDconst)
7593 v.AuxInt = int64ToAuxInt(int64(uint8(c)))
7594 return true
7595 }
7596 return false
7597 }
7598 func rewriteValuePPC64_OpPPC64MOVBreg(v *Value) bool {
7599 v_0 := v.Args[0]
7600 b := v.Block
7601 typ := &b.Func.Config.Types
7602
7603
7604
7605 for {
7606 y := v_0
7607 if y.Op != OpPPC64ANDconst {
7608 break
7609 }
7610 c := auxIntToInt64(y.AuxInt)
7611 if !(uint64(c) <= 0x7F) {
7612 break
7613 }
7614 v.copyOf(y)
7615 return true
7616 }
7617
7618
7619 for {
7620 if v_0.Op != OpPPC64SRAWconst {
7621 break
7622 }
7623 c := auxIntToInt64(v_0.AuxInt)
7624 v_0_0 := v_0.Args[0]
7625 if v_0_0.Op != OpPPC64MOVBreg {
7626 break
7627 }
7628 x := v_0_0.Args[0]
7629 v.reset(OpPPC64SRAWconst)
7630 v.AuxInt = int64ToAuxInt(c)
7631 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
7632 v0.AddArg(x)
7633 v.AddArg(v0)
7634 return true
7635 }
7636
7637
7638
7639 for {
7640 if v_0.Op != OpPPC64SRAWconst {
7641 break
7642 }
7643 c := auxIntToInt64(v_0.AuxInt)
7644 x := v_0.Args[0]
7645 if !(x.Type.Size() == 8) {
7646 break
7647 }
7648 v.reset(OpPPC64SRAWconst)
7649 v.AuxInt = int64ToAuxInt(c)
7650 v.AddArg(x)
7651 return true
7652 }
7653
7654
7655
7656 for {
7657 if v_0.Op != OpPPC64SRDconst {
7658 break
7659 }
7660 c := auxIntToInt64(v_0.AuxInt)
7661 x := v_0.Args[0]
7662 if !(c > 56) {
7663 break
7664 }
7665 v.reset(OpPPC64SRDconst)
7666 v.AuxInt = int64ToAuxInt(c)
7667 v.AddArg(x)
7668 return true
7669 }
7670
7671
7672
7673 for {
7674 if v_0.Op != OpPPC64SRDconst {
7675 break
7676 }
7677 c := auxIntToInt64(v_0.AuxInt)
7678 x := v_0.Args[0]
7679 if !(c == 56) {
7680 break
7681 }
7682 v.reset(OpPPC64SRADconst)
7683 v.AuxInt = int64ToAuxInt(c)
7684 v.AddArg(x)
7685 return true
7686 }
7687
7688
7689
7690 for {
7691 if v_0.Op != OpPPC64SRADconst {
7692 break
7693 }
7694 c := auxIntToInt64(v_0.AuxInt)
7695 x := v_0.Args[0]
7696 if !(c >= 56) {
7697 break
7698 }
7699 v.reset(OpPPC64SRADconst)
7700 v.AuxInt = int64ToAuxInt(c)
7701 v.AddArg(x)
7702 return true
7703 }
7704
7705
7706
7707 for {
7708 if v_0.Op != OpPPC64SRWconst {
7709 break
7710 }
7711 c := auxIntToInt64(v_0.AuxInt)
7712 x := v_0.Args[0]
7713 if !(c > 24) {
7714 break
7715 }
7716 v.reset(OpPPC64SRWconst)
7717 v.AuxInt = int64ToAuxInt(c)
7718 v.AddArg(x)
7719 return true
7720 }
7721
7722
7723
7724 for {
7725 if v_0.Op != OpPPC64SRWconst {
7726 break
7727 }
7728 c := auxIntToInt64(v_0.AuxInt)
7729 x := v_0.Args[0]
7730 if !(c == 24) {
7731 break
7732 }
7733 v.reset(OpPPC64SRAWconst)
7734 v.AuxInt = int64ToAuxInt(c)
7735 v.AddArg(x)
7736 return true
7737 }
7738
7739
7740
7741 for {
7742 if v_0.Op != OpPPC64SRAWconst {
7743 break
7744 }
7745 c := auxIntToInt64(v_0.AuxInt)
7746 x := v_0.Args[0]
7747 if !(c >= 24) {
7748 break
7749 }
7750 v.reset(OpPPC64SRAWconst)
7751 v.AuxInt = int64ToAuxInt(c)
7752 v.AddArg(x)
7753 return true
7754 }
7755
7756
7757 for {
7758 y := v_0
7759 if y.Op != OpPPC64MOVBreg {
7760 break
7761 }
7762 v.copyOf(y)
7763 return true
7764 }
7765
7766
7767 for {
7768 if v_0.Op != OpPPC64MOVBZreg {
7769 break
7770 }
7771 x := v_0.Args[0]
7772 v.reset(OpPPC64MOVBreg)
7773 v.AddArg(x)
7774 return true
7775 }
7776
7777
7778
7779 for {
7780 x := v_0
7781 if x.Op != OpArg {
7782 break
7783 }
7784 t := x.Type
7785 if !(is8BitInt(t) && t.IsSigned()) {
7786 break
7787 }
7788 v.copyOf(x)
7789 return true
7790 }
7791
7792
7793 for {
7794 if v_0.Op != OpPPC64MOVDconst {
7795 break
7796 }
7797 c := auxIntToInt64(v_0.AuxInt)
7798 v.reset(OpPPC64MOVDconst)
7799 v.AuxInt = int64ToAuxInt(int64(int8(c)))
7800 return true
7801 }
7802 return false
7803 }
7804 func rewriteValuePPC64_OpPPC64MOVBstore(v *Value) bool {
7805 v_2 := v.Args[2]
7806 v_1 := v.Args[1]
7807 v_0 := v.Args[0]
7808 b := v.Block
7809 typ := &b.Func.Config.Types
7810
7811
7812
7813 for {
7814 off1 := auxIntToInt32(v.AuxInt)
7815 sym := auxToSym(v.Aux)
7816 if v_0.Op != OpPPC64ADDconst {
7817 break
7818 }
7819 off2 := auxIntToInt64(v_0.AuxInt)
7820 x := v_0.Args[0]
7821 val := v_1
7822 mem := v_2
7823 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
7824 break
7825 }
7826 v.reset(OpPPC64MOVBstore)
7827 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
7828 v.Aux = symToAux(sym)
7829 v.AddArg3(x, val, mem)
7830 return true
7831 }
7832
7833
7834
7835 for {
7836 off1 := auxIntToInt32(v.AuxInt)
7837 sym1 := auxToSym(v.Aux)
7838 p := v_0
7839 if p.Op != OpPPC64MOVDaddr {
7840 break
7841 }
7842 off2 := auxIntToInt32(p.AuxInt)
7843 sym2 := auxToSym(p.Aux)
7844 ptr := p.Args[0]
7845 val := v_1
7846 mem := v_2
7847 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
7848 break
7849 }
7850 v.reset(OpPPC64MOVBstore)
7851 v.AuxInt = int32ToAuxInt(off1 + off2)
7852 v.Aux = symToAux(mergeSym(sym1, sym2))
7853 v.AddArg3(ptr, val, mem)
7854 return true
7855 }
7856
7857
7858 for {
7859 off := auxIntToInt32(v.AuxInt)
7860 sym := auxToSym(v.Aux)
7861 ptr := v_0
7862 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
7863 break
7864 }
7865 mem := v_2
7866 v.reset(OpPPC64MOVBstorezero)
7867 v.AuxInt = int32ToAuxInt(off)
7868 v.Aux = symToAux(sym)
7869 v.AddArg2(ptr, mem)
7870 return true
7871 }
7872
7873
7874
7875 for {
7876 if auxIntToInt32(v.AuxInt) != 0 {
7877 break
7878 }
7879 sym := auxToSym(v.Aux)
7880 p := v_0
7881 if p.Op != OpPPC64ADD {
7882 break
7883 }
7884 idx := p.Args[1]
7885 ptr := p.Args[0]
7886 val := v_1
7887 mem := v_2
7888 if !(sym == nil && p.Uses == 1) {
7889 break
7890 }
7891 v.reset(OpPPC64MOVBstoreidx)
7892 v.AddArg4(ptr, idx, val, mem)
7893 return true
7894 }
7895
7896
7897 for {
7898 off := auxIntToInt32(v.AuxInt)
7899 sym := auxToSym(v.Aux)
7900 ptr := v_0
7901 if v_1.Op != OpPPC64MOVBreg {
7902 break
7903 }
7904 x := v_1.Args[0]
7905 mem := v_2
7906 v.reset(OpPPC64MOVBstore)
7907 v.AuxInt = int32ToAuxInt(off)
7908 v.Aux = symToAux(sym)
7909 v.AddArg3(ptr, x, mem)
7910 return true
7911 }
7912
7913
7914 for {
7915 off := auxIntToInt32(v.AuxInt)
7916 sym := auxToSym(v.Aux)
7917 ptr := v_0
7918 if v_1.Op != OpPPC64MOVBZreg {
7919 break
7920 }
7921 x := v_1.Args[0]
7922 mem := v_2
7923 v.reset(OpPPC64MOVBstore)
7924 v.AuxInt = int32ToAuxInt(off)
7925 v.Aux = symToAux(sym)
7926 v.AddArg3(ptr, x, mem)
7927 return true
7928 }
7929
7930
7931 for {
7932 off := auxIntToInt32(v.AuxInt)
7933 sym := auxToSym(v.Aux)
7934 ptr := v_0
7935 if v_1.Op != OpPPC64MOVHreg {
7936 break
7937 }
7938 x := v_1.Args[0]
7939 mem := v_2
7940 v.reset(OpPPC64MOVBstore)
7941 v.AuxInt = int32ToAuxInt(off)
7942 v.Aux = symToAux(sym)
7943 v.AddArg3(ptr, x, mem)
7944 return true
7945 }
7946
7947
7948 for {
7949 off := auxIntToInt32(v.AuxInt)
7950 sym := auxToSym(v.Aux)
7951 ptr := v_0
7952 if v_1.Op != OpPPC64MOVHZreg {
7953 break
7954 }
7955 x := v_1.Args[0]
7956 mem := v_2
7957 v.reset(OpPPC64MOVBstore)
7958 v.AuxInt = int32ToAuxInt(off)
7959 v.Aux = symToAux(sym)
7960 v.AddArg3(ptr, x, mem)
7961 return true
7962 }
7963
7964
7965 for {
7966 off := auxIntToInt32(v.AuxInt)
7967 sym := auxToSym(v.Aux)
7968 ptr := v_0
7969 if v_1.Op != OpPPC64MOVWreg {
7970 break
7971 }
7972 x := v_1.Args[0]
7973 mem := v_2
7974 v.reset(OpPPC64MOVBstore)
7975 v.AuxInt = int32ToAuxInt(off)
7976 v.Aux = symToAux(sym)
7977 v.AddArg3(ptr, x, mem)
7978 return true
7979 }
7980
7981
7982 for {
7983 off := auxIntToInt32(v.AuxInt)
7984 sym := auxToSym(v.Aux)
7985 ptr := v_0
7986 if v_1.Op != OpPPC64MOVWZreg {
7987 break
7988 }
7989 x := v_1.Args[0]
7990 mem := v_2
7991 v.reset(OpPPC64MOVBstore)
7992 v.AuxInt = int32ToAuxInt(off)
7993 v.Aux = symToAux(sym)
7994 v.AddArg3(ptr, x, mem)
7995 return true
7996 }
7997
7998
7999
8000 for {
8001 off := auxIntToInt32(v.AuxInt)
8002 sym := auxToSym(v.Aux)
8003 ptr := v_0
8004 if v_1.Op != OpPPC64SRWconst {
8005 break
8006 }
8007 c := auxIntToInt64(v_1.AuxInt)
8008 v_1_0 := v_1.Args[0]
8009 if v_1_0.Op != OpPPC64MOVHreg {
8010 break
8011 }
8012 x := v_1_0.Args[0]
8013 mem := v_2
8014 if !(c <= 8) {
8015 break
8016 }
8017 v.reset(OpPPC64MOVBstore)
8018 v.AuxInt = int32ToAuxInt(off)
8019 v.Aux = symToAux(sym)
8020 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8021 v0.AuxInt = int64ToAuxInt(c)
8022 v0.AddArg(x)
8023 v.AddArg3(ptr, v0, mem)
8024 return true
8025 }
8026
8027
8028
8029 for {
8030 off := auxIntToInt32(v.AuxInt)
8031 sym := auxToSym(v.Aux)
8032 ptr := v_0
8033 if v_1.Op != OpPPC64SRWconst {
8034 break
8035 }
8036 c := auxIntToInt64(v_1.AuxInt)
8037 v_1_0 := v_1.Args[0]
8038 if v_1_0.Op != OpPPC64MOVHZreg {
8039 break
8040 }
8041 x := v_1_0.Args[0]
8042 mem := v_2
8043 if !(c <= 8) {
8044 break
8045 }
8046 v.reset(OpPPC64MOVBstore)
8047 v.AuxInt = int32ToAuxInt(off)
8048 v.Aux = symToAux(sym)
8049 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8050 v0.AuxInt = int64ToAuxInt(c)
8051 v0.AddArg(x)
8052 v.AddArg3(ptr, v0, mem)
8053 return true
8054 }
8055
8056
8057
8058 for {
8059 off := auxIntToInt32(v.AuxInt)
8060 sym := auxToSym(v.Aux)
8061 ptr := v_0
8062 if v_1.Op != OpPPC64SRWconst {
8063 break
8064 }
8065 c := auxIntToInt64(v_1.AuxInt)
8066 v_1_0 := v_1.Args[0]
8067 if v_1_0.Op != OpPPC64MOVWreg {
8068 break
8069 }
8070 x := v_1_0.Args[0]
8071 mem := v_2
8072 if !(c <= 24) {
8073 break
8074 }
8075 v.reset(OpPPC64MOVBstore)
8076 v.AuxInt = int32ToAuxInt(off)
8077 v.Aux = symToAux(sym)
8078 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8079 v0.AuxInt = int64ToAuxInt(c)
8080 v0.AddArg(x)
8081 v.AddArg3(ptr, v0, mem)
8082 return true
8083 }
8084
8085
8086
8087 for {
8088 off := auxIntToInt32(v.AuxInt)
8089 sym := auxToSym(v.Aux)
8090 ptr := v_0
8091 if v_1.Op != OpPPC64SRWconst {
8092 break
8093 }
8094 c := auxIntToInt64(v_1.AuxInt)
8095 v_1_0 := v_1.Args[0]
8096 if v_1_0.Op != OpPPC64MOVWZreg {
8097 break
8098 }
8099 x := v_1_0.Args[0]
8100 mem := v_2
8101 if !(c <= 24) {
8102 break
8103 }
8104 v.reset(OpPPC64MOVBstore)
8105 v.AuxInt = int32ToAuxInt(off)
8106 v.Aux = symToAux(sym)
8107 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8108 v0.AuxInt = int64ToAuxInt(c)
8109 v0.AddArg(x)
8110 v.AddArg3(ptr, v0, mem)
8111 return true
8112 }
8113 return false
8114 }
8115 func rewriteValuePPC64_OpPPC64MOVBstoreidx(v *Value) bool {
8116 v_3 := v.Args[3]
8117 v_2 := v.Args[2]
8118 v_1 := v.Args[1]
8119 v_0 := v.Args[0]
8120 b := v.Block
8121 typ := &b.Func.Config.Types
8122
8123
8124
8125 for {
8126 ptr := v_0
8127 if v_1.Op != OpPPC64MOVDconst {
8128 break
8129 }
8130 c := auxIntToInt64(v_1.AuxInt)
8131 val := v_2
8132 mem := v_3
8133 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8134 break
8135 }
8136 v.reset(OpPPC64MOVBstore)
8137 v.AuxInt = int32ToAuxInt(int32(c))
8138 v.AddArg3(ptr, val, mem)
8139 return true
8140 }
8141
8142
8143
8144 for {
8145 if v_0.Op != OpPPC64MOVDconst {
8146 break
8147 }
8148 c := auxIntToInt64(v_0.AuxInt)
8149 ptr := v_1
8150 val := v_2
8151 mem := v_3
8152 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8153 break
8154 }
8155 v.reset(OpPPC64MOVBstore)
8156 v.AuxInt = int32ToAuxInt(int32(c))
8157 v.AddArg3(ptr, val, mem)
8158 return true
8159 }
8160
8161
8162 for {
8163 ptr := v_0
8164 idx := v_1
8165 if v_2.Op != OpPPC64MOVBreg {
8166 break
8167 }
8168 x := v_2.Args[0]
8169 mem := v_3
8170 v.reset(OpPPC64MOVBstoreidx)
8171 v.AddArg4(ptr, idx, x, mem)
8172 return true
8173 }
8174
8175
8176 for {
8177 ptr := v_0
8178 idx := v_1
8179 if v_2.Op != OpPPC64MOVBZreg {
8180 break
8181 }
8182 x := v_2.Args[0]
8183 mem := v_3
8184 v.reset(OpPPC64MOVBstoreidx)
8185 v.AddArg4(ptr, idx, x, mem)
8186 return true
8187 }
8188
8189
8190 for {
8191 ptr := v_0
8192 idx := v_1
8193 if v_2.Op != OpPPC64MOVHreg {
8194 break
8195 }
8196 x := v_2.Args[0]
8197 mem := v_3
8198 v.reset(OpPPC64MOVBstoreidx)
8199 v.AddArg4(ptr, idx, x, mem)
8200 return true
8201 }
8202
8203
8204 for {
8205 ptr := v_0
8206 idx := v_1
8207 if v_2.Op != OpPPC64MOVHZreg {
8208 break
8209 }
8210 x := v_2.Args[0]
8211 mem := v_3
8212 v.reset(OpPPC64MOVBstoreidx)
8213 v.AddArg4(ptr, idx, x, mem)
8214 return true
8215 }
8216
8217
8218 for {
8219 ptr := v_0
8220 idx := v_1
8221 if v_2.Op != OpPPC64MOVWreg {
8222 break
8223 }
8224 x := v_2.Args[0]
8225 mem := v_3
8226 v.reset(OpPPC64MOVBstoreidx)
8227 v.AddArg4(ptr, idx, x, mem)
8228 return true
8229 }
8230
8231
8232 for {
8233 ptr := v_0
8234 idx := v_1
8235 if v_2.Op != OpPPC64MOVWZreg {
8236 break
8237 }
8238 x := v_2.Args[0]
8239 mem := v_3
8240 v.reset(OpPPC64MOVBstoreidx)
8241 v.AddArg4(ptr, idx, x, mem)
8242 return true
8243 }
8244
8245
8246
8247 for {
8248 ptr := v_0
8249 idx := v_1
8250 if v_2.Op != OpPPC64SRWconst {
8251 break
8252 }
8253 c := auxIntToInt64(v_2.AuxInt)
8254 v_2_0 := v_2.Args[0]
8255 if v_2_0.Op != OpPPC64MOVHreg {
8256 break
8257 }
8258 x := v_2_0.Args[0]
8259 mem := v_3
8260 if !(c <= 8) {
8261 break
8262 }
8263 v.reset(OpPPC64MOVBstoreidx)
8264 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8265 v0.AuxInt = int64ToAuxInt(c)
8266 v0.AddArg(x)
8267 v.AddArg4(ptr, idx, v0, mem)
8268 return true
8269 }
8270
8271
8272
8273 for {
8274 ptr := v_0
8275 idx := v_1
8276 if v_2.Op != OpPPC64SRWconst {
8277 break
8278 }
8279 c := auxIntToInt64(v_2.AuxInt)
8280 v_2_0 := v_2.Args[0]
8281 if v_2_0.Op != OpPPC64MOVHZreg {
8282 break
8283 }
8284 x := v_2_0.Args[0]
8285 mem := v_3
8286 if !(c <= 8) {
8287 break
8288 }
8289 v.reset(OpPPC64MOVBstoreidx)
8290 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8291 v0.AuxInt = int64ToAuxInt(c)
8292 v0.AddArg(x)
8293 v.AddArg4(ptr, idx, v0, mem)
8294 return true
8295 }
8296
8297
8298
8299 for {
8300 ptr := v_0
8301 idx := v_1
8302 if v_2.Op != OpPPC64SRWconst {
8303 break
8304 }
8305 c := auxIntToInt64(v_2.AuxInt)
8306 v_2_0 := v_2.Args[0]
8307 if v_2_0.Op != OpPPC64MOVWreg {
8308 break
8309 }
8310 x := v_2_0.Args[0]
8311 mem := v_3
8312 if !(c <= 24) {
8313 break
8314 }
8315 v.reset(OpPPC64MOVBstoreidx)
8316 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8317 v0.AuxInt = int64ToAuxInt(c)
8318 v0.AddArg(x)
8319 v.AddArg4(ptr, idx, v0, mem)
8320 return true
8321 }
8322
8323
8324
8325 for {
8326 ptr := v_0
8327 idx := v_1
8328 if v_2.Op != OpPPC64SRWconst {
8329 break
8330 }
8331 c := auxIntToInt64(v_2.AuxInt)
8332 v_2_0 := v_2.Args[0]
8333 if v_2_0.Op != OpPPC64MOVWZreg {
8334 break
8335 }
8336 x := v_2_0.Args[0]
8337 mem := v_3
8338 if !(c <= 24) {
8339 break
8340 }
8341 v.reset(OpPPC64MOVBstoreidx)
8342 v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
8343 v0.AuxInt = int64ToAuxInt(c)
8344 v0.AddArg(x)
8345 v.AddArg4(ptr, idx, v0, mem)
8346 return true
8347 }
8348 return false
8349 }
8350 func rewriteValuePPC64_OpPPC64MOVBstorezero(v *Value) bool {
8351 v_1 := v.Args[1]
8352 v_0 := v.Args[0]
8353
8354
8355
8356 for {
8357 off1 := auxIntToInt32(v.AuxInt)
8358 sym := auxToSym(v.Aux)
8359 if v_0.Op != OpPPC64ADDconst {
8360 break
8361 }
8362 off2 := auxIntToInt64(v_0.AuxInt)
8363 x := v_0.Args[0]
8364 mem := v_1
8365 if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
8366 break
8367 }
8368 v.reset(OpPPC64MOVBstorezero)
8369 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8370 v.Aux = symToAux(sym)
8371 v.AddArg2(x, mem)
8372 return true
8373 }
8374
8375
8376
8377 for {
8378 off1 := auxIntToInt32(v.AuxInt)
8379 sym1 := auxToSym(v.Aux)
8380 p := v_0
8381 if p.Op != OpPPC64MOVDaddr {
8382 break
8383 }
8384 off2 := auxIntToInt32(p.AuxInt)
8385 sym2 := auxToSym(p.Aux)
8386 x := p.Args[0]
8387 mem := v_1
8388 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8389 break
8390 }
8391 v.reset(OpPPC64MOVBstorezero)
8392 v.AuxInt = int32ToAuxInt(off1 + off2)
8393 v.Aux = symToAux(mergeSym(sym1, sym2))
8394 v.AddArg2(x, mem)
8395 return true
8396 }
8397 return false
8398 }
8399 func rewriteValuePPC64_OpPPC64MOVDaddr(v *Value) bool {
8400 v_0 := v.Args[0]
8401
8402
8403
8404 for {
8405 n := auxIntToInt32(v.AuxInt)
8406 sym := auxToSym(v.Aux)
8407 p := v_0
8408 if p.Op != OpPPC64ADD {
8409 break
8410 }
8411 if !(sym == nil && n == 0) {
8412 break
8413 }
8414 v.copyOf(p)
8415 return true
8416 }
8417
8418
8419
8420 for {
8421 n := auxIntToInt32(v.AuxInt)
8422 sym := auxToSym(v.Aux)
8423 ptr := v_0
8424 if !(sym == nil && n == 0 && (ptr.Op == OpArgIntReg || ptr.Op == OpPhi)) {
8425 break
8426 }
8427 v.copyOf(ptr)
8428 return true
8429 }
8430 return false
8431 }
8432 func rewriteValuePPC64_OpPPC64MOVDload(v *Value) bool {
8433 v_1 := v.Args[1]
8434 v_0 := v.Args[0]
8435
8436
8437 for {
8438 off := auxIntToInt32(v.AuxInt)
8439 sym := auxToSym(v.Aux)
8440 ptr := v_0
8441 if v_1.Op != OpPPC64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
8442 break
8443 }
8444 x := v_1.Args[1]
8445 if ptr != v_1.Args[0] {
8446 break
8447 }
8448 v.reset(OpPPC64MFVSRD)
8449 v.AddArg(x)
8450 return true
8451 }
8452
8453
8454
8455 for {
8456 off1 := auxIntToInt32(v.AuxInt)
8457 sym1 := auxToSym(v.Aux)
8458 p := v_0
8459 if p.Op != OpPPC64MOVDaddr {
8460 break
8461 }
8462 off2 := auxIntToInt32(p.AuxInt)
8463 sym2 := auxToSym(p.Aux)
8464 ptr := p.Args[0]
8465 mem := v_1
8466 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8467 break
8468 }
8469 v.reset(OpPPC64MOVDload)
8470 v.AuxInt = int32ToAuxInt(off1 + off2)
8471 v.Aux = symToAux(mergeSym(sym1, sym2))
8472 v.AddArg2(ptr, mem)
8473 return true
8474 }
8475
8476
8477
8478 for {
8479 off1 := auxIntToInt32(v.AuxInt)
8480 sym := auxToSym(v.Aux)
8481 if v_0.Op != OpPPC64ADDconst {
8482 break
8483 }
8484 off2 := auxIntToInt64(v_0.AuxInt)
8485 x := v_0.Args[0]
8486 mem := v_1
8487 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
8488 break
8489 }
8490 v.reset(OpPPC64MOVDload)
8491 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8492 v.Aux = symToAux(sym)
8493 v.AddArg2(x, mem)
8494 return true
8495 }
8496
8497
8498
8499 for {
8500 if auxIntToInt32(v.AuxInt) != 0 {
8501 break
8502 }
8503 sym := auxToSym(v.Aux)
8504 p := v_0
8505 if p.Op != OpPPC64ADD {
8506 break
8507 }
8508 idx := p.Args[1]
8509 ptr := p.Args[0]
8510 mem := v_1
8511 if !(sym == nil && p.Uses == 1) {
8512 break
8513 }
8514 v.reset(OpPPC64MOVDloadidx)
8515 v.AddArg3(ptr, idx, mem)
8516 return true
8517 }
8518 return false
8519 }
8520 func rewriteValuePPC64_OpPPC64MOVDloadidx(v *Value) bool {
8521 v_2 := v.Args[2]
8522 v_1 := v.Args[1]
8523 v_0 := v.Args[0]
8524
8525
8526
8527 for {
8528 ptr := v_0
8529 if v_1.Op != OpPPC64MOVDconst {
8530 break
8531 }
8532 c := auxIntToInt64(v_1.AuxInt)
8533 mem := v_2
8534 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8535 break
8536 }
8537 v.reset(OpPPC64MOVDload)
8538 v.AuxInt = int32ToAuxInt(int32(c))
8539 v.AddArg2(ptr, mem)
8540 return true
8541 }
8542
8543
8544
8545 for {
8546 if v_0.Op != OpPPC64MOVDconst {
8547 break
8548 }
8549 c := auxIntToInt64(v_0.AuxInt)
8550 ptr := v_1
8551 mem := v_2
8552 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8553 break
8554 }
8555 v.reset(OpPPC64MOVDload)
8556 v.AuxInt = int32ToAuxInt(int32(c))
8557 v.AddArg2(ptr, mem)
8558 return true
8559 }
8560 return false
8561 }
8562 func rewriteValuePPC64_OpPPC64MOVDstore(v *Value) bool {
8563 v_2 := v.Args[2]
8564 v_1 := v.Args[1]
8565 v_0 := v.Args[0]
8566 b := v.Block
8567
8568
8569 for {
8570 off := auxIntToInt32(v.AuxInt)
8571 sym := auxToSym(v.Aux)
8572 ptr := v_0
8573 if v_1.Op != OpPPC64MFVSRD {
8574 break
8575 }
8576 x := v_1.Args[0]
8577 mem := v_2
8578 v.reset(OpPPC64FMOVDstore)
8579 v.AuxInt = int32ToAuxInt(off)
8580 v.Aux = symToAux(sym)
8581 v.AddArg3(ptr, x, mem)
8582 return true
8583 }
8584
8585
8586
8587 for {
8588 off1 := auxIntToInt32(v.AuxInt)
8589 sym := auxToSym(v.Aux)
8590 if v_0.Op != OpPPC64ADDconst {
8591 break
8592 }
8593 off2 := auxIntToInt64(v_0.AuxInt)
8594 x := v_0.Args[0]
8595 val := v_1
8596 mem := v_2
8597 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
8598 break
8599 }
8600 v.reset(OpPPC64MOVDstore)
8601 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8602 v.Aux = symToAux(sym)
8603 v.AddArg3(x, val, mem)
8604 return true
8605 }
8606
8607
8608
8609 for {
8610 off1 := auxIntToInt32(v.AuxInt)
8611 sym1 := auxToSym(v.Aux)
8612 p := v_0
8613 if p.Op != OpPPC64MOVDaddr {
8614 break
8615 }
8616 off2 := auxIntToInt32(p.AuxInt)
8617 sym2 := auxToSym(p.Aux)
8618 ptr := p.Args[0]
8619 val := v_1
8620 mem := v_2
8621 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8622 break
8623 }
8624 v.reset(OpPPC64MOVDstore)
8625 v.AuxInt = int32ToAuxInt(off1 + off2)
8626 v.Aux = symToAux(mergeSym(sym1, sym2))
8627 v.AddArg3(ptr, val, mem)
8628 return true
8629 }
8630
8631
8632 for {
8633 off := auxIntToInt32(v.AuxInt)
8634 sym := auxToSym(v.Aux)
8635 ptr := v_0
8636 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
8637 break
8638 }
8639 mem := v_2
8640 v.reset(OpPPC64MOVDstorezero)
8641 v.AuxInt = int32ToAuxInt(off)
8642 v.Aux = symToAux(sym)
8643 v.AddArg2(ptr, mem)
8644 return true
8645 }
8646
8647
8648
8649 for {
8650 if auxIntToInt32(v.AuxInt) != 0 {
8651 break
8652 }
8653 sym := auxToSym(v.Aux)
8654 p := v_0
8655 if p.Op != OpPPC64ADD {
8656 break
8657 }
8658 idx := p.Args[1]
8659 ptr := p.Args[0]
8660 val := v_1
8661 mem := v_2
8662 if !(sym == nil && p.Uses == 1) {
8663 break
8664 }
8665 v.reset(OpPPC64MOVDstoreidx)
8666 v.AddArg4(ptr, idx, val, mem)
8667 return true
8668 }
8669
8670
8671
8672 for {
8673 off := auxIntToInt32(v.AuxInt)
8674 sym := auxToSym(v.Aux)
8675 ptr := v_0
8676 r := v_1
8677 if r.Op != OpPPC64BRD {
8678 break
8679 }
8680 val := r.Args[0]
8681 mem := v_2
8682 if !(r.Uses == 1) {
8683 break
8684 }
8685 v.reset(OpPPC64MOVDBRstore)
8686 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
8687 v0.AuxInt = int32ToAuxInt(off)
8688 v0.Aux = symToAux(sym)
8689 v0.AddArg(ptr)
8690 v.AddArg3(v0, val, mem)
8691 return true
8692 }
8693
8694
8695 for {
8696 off := auxIntToInt32(v.AuxInt)
8697 sym := auxToSym(v.Aux)
8698 ptr := v_0
8699 if v_1.Op != OpBswap64 {
8700 break
8701 }
8702 val := v_1.Args[0]
8703 mem := v_2
8704 v.reset(OpPPC64MOVDBRstore)
8705 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
8706 v0.AuxInt = int32ToAuxInt(off)
8707 v0.Aux = symToAux(sym)
8708 v0.AddArg(ptr)
8709 v.AddArg3(v0, val, mem)
8710 return true
8711 }
8712 return false
8713 }
8714 func rewriteValuePPC64_OpPPC64MOVDstoreidx(v *Value) bool {
8715 v_3 := v.Args[3]
8716 v_2 := v.Args[2]
8717 v_1 := v.Args[1]
8718 v_0 := v.Args[0]
8719
8720
8721
8722 for {
8723 ptr := v_0
8724 if v_1.Op != OpPPC64MOVDconst {
8725 break
8726 }
8727 c := auxIntToInt64(v_1.AuxInt)
8728 val := v_2
8729 mem := v_3
8730 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8731 break
8732 }
8733 v.reset(OpPPC64MOVDstore)
8734 v.AuxInt = int32ToAuxInt(int32(c))
8735 v.AddArg3(ptr, val, mem)
8736 return true
8737 }
8738
8739
8740
8741 for {
8742 if v_0.Op != OpPPC64MOVDconst {
8743 break
8744 }
8745 c := auxIntToInt64(v_0.AuxInt)
8746 ptr := v_1
8747 val := v_2
8748 mem := v_3
8749 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8750 break
8751 }
8752 v.reset(OpPPC64MOVDstore)
8753 v.AuxInt = int32ToAuxInt(int32(c))
8754 v.AddArg3(ptr, val, mem)
8755 return true
8756 }
8757
8758
8759
8760 for {
8761 ptr := v_0
8762 idx := v_1
8763 r := v_2
8764 if r.Op != OpPPC64BRD {
8765 break
8766 }
8767 val := r.Args[0]
8768 mem := v_3
8769 if !(r.Uses == 1) {
8770 break
8771 }
8772 v.reset(OpPPC64MOVDBRstoreidx)
8773 v.AddArg4(ptr, idx, val, mem)
8774 return true
8775 }
8776
8777
8778 for {
8779 ptr := v_0
8780 idx := v_1
8781 if v_2.Op != OpBswap64 {
8782 break
8783 }
8784 val := v_2.Args[0]
8785 mem := v_3
8786 v.reset(OpPPC64MOVDBRstoreidx)
8787 v.AddArg4(ptr, idx, val, mem)
8788 return true
8789 }
8790 return false
8791 }
8792 func rewriteValuePPC64_OpPPC64MOVDstorezero(v *Value) bool {
8793 v_1 := v.Args[1]
8794 v_0 := v.Args[0]
8795
8796
8797
8798 for {
8799 off1 := auxIntToInt32(v.AuxInt)
8800 sym := auxToSym(v.Aux)
8801 if v_0.Op != OpPPC64ADDconst {
8802 break
8803 }
8804 off2 := auxIntToInt64(v_0.AuxInt)
8805 x := v_0.Args[0]
8806 mem := v_1
8807 if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
8808 break
8809 }
8810 v.reset(OpPPC64MOVDstorezero)
8811 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8812 v.Aux = symToAux(sym)
8813 v.AddArg2(x, mem)
8814 return true
8815 }
8816
8817
8818
8819 for {
8820 off1 := auxIntToInt32(v.AuxInt)
8821 sym1 := auxToSym(v.Aux)
8822 p := v_0
8823 if p.Op != OpPPC64MOVDaddr {
8824 break
8825 }
8826 off2 := auxIntToInt32(p.AuxInt)
8827 sym2 := auxToSym(p.Aux)
8828 x := p.Args[0]
8829 mem := v_1
8830 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8831 break
8832 }
8833 v.reset(OpPPC64MOVDstorezero)
8834 v.AuxInt = int32ToAuxInt(off1 + off2)
8835 v.Aux = symToAux(mergeSym(sym1, sym2))
8836 v.AddArg2(x, mem)
8837 return true
8838 }
8839 return false
8840 }
8841 func rewriteValuePPC64_OpPPC64MOVHBRstore(v *Value) bool {
8842 v_2 := v.Args[2]
8843 v_1 := v.Args[1]
8844 v_0 := v.Args[0]
8845
8846
8847 for {
8848 ptr := v_0
8849 if v_1.Op != OpPPC64MOVHreg {
8850 break
8851 }
8852 x := v_1.Args[0]
8853 mem := v_2
8854 v.reset(OpPPC64MOVHBRstore)
8855 v.AddArg3(ptr, x, mem)
8856 return true
8857 }
8858
8859
8860 for {
8861 ptr := v_0
8862 if v_1.Op != OpPPC64MOVHZreg {
8863 break
8864 }
8865 x := v_1.Args[0]
8866 mem := v_2
8867 v.reset(OpPPC64MOVHBRstore)
8868 v.AddArg3(ptr, x, mem)
8869 return true
8870 }
8871
8872
8873 for {
8874 ptr := v_0
8875 if v_1.Op != OpPPC64MOVWreg {
8876 break
8877 }
8878 x := v_1.Args[0]
8879 mem := v_2
8880 v.reset(OpPPC64MOVHBRstore)
8881 v.AddArg3(ptr, x, mem)
8882 return true
8883 }
8884
8885
8886 for {
8887 ptr := v_0
8888 if v_1.Op != OpPPC64MOVWZreg {
8889 break
8890 }
8891 x := v_1.Args[0]
8892 mem := v_2
8893 v.reset(OpPPC64MOVHBRstore)
8894 v.AddArg3(ptr, x, mem)
8895 return true
8896 }
8897 return false
8898 }
8899 func rewriteValuePPC64_OpPPC64MOVHZload(v *Value) bool {
8900 v_1 := v.Args[1]
8901 v_0 := v.Args[0]
8902
8903
8904
8905 for {
8906 off1 := auxIntToInt32(v.AuxInt)
8907 sym1 := auxToSym(v.Aux)
8908 p := v_0
8909 if p.Op != OpPPC64MOVDaddr {
8910 break
8911 }
8912 off2 := auxIntToInt32(p.AuxInt)
8913 sym2 := auxToSym(p.Aux)
8914 ptr := p.Args[0]
8915 mem := v_1
8916 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
8917 break
8918 }
8919 v.reset(OpPPC64MOVHZload)
8920 v.AuxInt = int32ToAuxInt(off1 + off2)
8921 v.Aux = symToAux(mergeSym(sym1, sym2))
8922 v.AddArg2(ptr, mem)
8923 return true
8924 }
8925
8926
8927
8928 for {
8929 off1 := auxIntToInt32(v.AuxInt)
8930 sym := auxToSym(v.Aux)
8931 if v_0.Op != OpPPC64ADDconst {
8932 break
8933 }
8934 off2 := auxIntToInt64(v_0.AuxInt)
8935 x := v_0.Args[0]
8936 mem := v_1
8937 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
8938 break
8939 }
8940 v.reset(OpPPC64MOVHZload)
8941 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
8942 v.Aux = symToAux(sym)
8943 v.AddArg2(x, mem)
8944 return true
8945 }
8946
8947
8948
8949 for {
8950 if auxIntToInt32(v.AuxInt) != 0 {
8951 break
8952 }
8953 sym := auxToSym(v.Aux)
8954 p := v_0
8955 if p.Op != OpPPC64ADD {
8956 break
8957 }
8958 idx := p.Args[1]
8959 ptr := p.Args[0]
8960 mem := v_1
8961 if !(sym == nil && p.Uses == 1) {
8962 break
8963 }
8964 v.reset(OpPPC64MOVHZloadidx)
8965 v.AddArg3(ptr, idx, mem)
8966 return true
8967 }
8968 return false
8969 }
8970 func rewriteValuePPC64_OpPPC64MOVHZloadidx(v *Value) bool {
8971 v_2 := v.Args[2]
8972 v_1 := v.Args[1]
8973 v_0 := v.Args[0]
8974
8975
8976
8977 for {
8978 ptr := v_0
8979 if v_1.Op != OpPPC64MOVDconst {
8980 break
8981 }
8982 c := auxIntToInt64(v_1.AuxInt)
8983 mem := v_2
8984 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
8985 break
8986 }
8987 v.reset(OpPPC64MOVHZload)
8988 v.AuxInt = int32ToAuxInt(int32(c))
8989 v.AddArg2(ptr, mem)
8990 return true
8991 }
8992
8993
8994
8995 for {
8996 if v_0.Op != OpPPC64MOVDconst {
8997 break
8998 }
8999 c := auxIntToInt64(v_0.AuxInt)
9000 ptr := v_1
9001 mem := v_2
9002 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
9003 break
9004 }
9005 v.reset(OpPPC64MOVHZload)
9006 v.AuxInt = int32ToAuxInt(int32(c))
9007 v.AddArg2(ptr, mem)
9008 return true
9009 }
9010 return false
9011 }
9012 func rewriteValuePPC64_OpPPC64MOVHZreg(v *Value) bool {
9013 v_0 := v.Args[0]
9014 b := v.Block
9015 typ := &b.Func.Config.Types
9016
9017
9018
9019 for {
9020 y := v_0
9021 if y.Op != OpPPC64ANDconst {
9022 break
9023 }
9024 c := auxIntToInt64(y.AuxInt)
9025 if !(uint64(c) <= 0xFFFF) {
9026 break
9027 }
9028 v.copyOf(y)
9029 return true
9030 }
9031
9032
9033 for {
9034 if v_0.Op != OpPPC64SRWconst {
9035 break
9036 }
9037 c := auxIntToInt64(v_0.AuxInt)
9038 v_0_0 := v_0.Args[0]
9039 if v_0_0.Op != OpPPC64MOVBZreg {
9040 break
9041 }
9042 x := v_0_0.Args[0]
9043 v.reset(OpPPC64SRWconst)
9044 v.AuxInt = int64ToAuxInt(c)
9045 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
9046 v0.AddArg(x)
9047 v.AddArg(v0)
9048 return true
9049 }
9050
9051
9052 for {
9053 if v_0.Op != OpPPC64SRWconst {
9054 break
9055 }
9056 c := auxIntToInt64(v_0.AuxInt)
9057 v_0_0 := v_0.Args[0]
9058 if v_0_0.Op != OpPPC64MOVHZreg {
9059 break
9060 }
9061 x := v_0_0.Args[0]
9062 v.reset(OpPPC64SRWconst)
9063 v.AuxInt = int64ToAuxInt(c)
9064 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
9065 v0.AddArg(x)
9066 v.AddArg(v0)
9067 return true
9068 }
9069
9070
9071
9072 for {
9073 if v_0.Op != OpPPC64SRWconst {
9074 break
9075 }
9076 c := auxIntToInt64(v_0.AuxInt)
9077 x := v_0.Args[0]
9078 if !(x.Type.Size() <= 16) {
9079 break
9080 }
9081 v.reset(OpPPC64SRWconst)
9082 v.AuxInt = int64ToAuxInt(c)
9083 v.AddArg(x)
9084 return true
9085 }
9086
9087
9088
9089 for {
9090 if v_0.Op != OpPPC64SRDconst {
9091 break
9092 }
9093 c := auxIntToInt64(v_0.AuxInt)
9094 x := v_0.Args[0]
9095 if !(c >= 48) {
9096 break
9097 }
9098 v.reset(OpPPC64SRDconst)
9099 v.AuxInt = int64ToAuxInt(c)
9100 v.AddArg(x)
9101 return true
9102 }
9103
9104
9105
9106 for {
9107 if v_0.Op != OpPPC64SRWconst {
9108 break
9109 }
9110 c := auxIntToInt64(v_0.AuxInt)
9111 x := v_0.Args[0]
9112 if !(c >= 16) {
9113 break
9114 }
9115 v.reset(OpPPC64SRWconst)
9116 v.AuxInt = int64ToAuxInt(c)
9117 v.AddArg(x)
9118 return true
9119 }
9120
9121
9122
9123 for {
9124 if v_0.Op != OpPPC64RLWINM {
9125 break
9126 }
9127 r := auxIntToInt64(v_0.AuxInt)
9128 y := v_0.Args[0]
9129 if !(mergePPC64AndRlwinm(0xFFFF, r) != 0) {
9130 break
9131 }
9132 v.reset(OpPPC64RLWINM)
9133 v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFFFF, r))
9134 v.AddArg(y)
9135 return true
9136 }
9137
9138
9139 for {
9140 y := v_0
9141 if y.Op != OpPPC64MOVHZreg {
9142 break
9143 }
9144 v.copyOf(y)
9145 return true
9146 }
9147
9148
9149 for {
9150 y := v_0
9151 if y.Op != OpPPC64MOVBZreg {
9152 break
9153 }
9154 v.copyOf(y)
9155 return true
9156 }
9157
9158
9159 for {
9160 y := v_0
9161 if y.Op != OpPPC64MOVHBRload {
9162 break
9163 }
9164 v.copyOf(y)
9165 return true
9166 }
9167
9168
9169 for {
9170 y := v_0
9171 if y.Op != OpPPC64MOVHreg {
9172 break
9173 }
9174 x := y.Args[0]
9175 v.reset(OpPPC64MOVHZreg)
9176 v.AddArg(x)
9177 return true
9178 }
9179
9180
9181 for {
9182 if v_0.Op != OpPPC64OR {
9183 break
9184 }
9185 t := v_0.Type
9186 _ = v_0.Args[1]
9187 v_0_0 := v_0.Args[0]
9188 v_0_1 := v_0.Args[1]
9189 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9190 x := v_0_0
9191 if v_0_1.Op != OpPPC64MOVWZreg {
9192 continue
9193 }
9194 y := v_0_1.Args[0]
9195 v.reset(OpPPC64MOVHZreg)
9196 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
9197 v0.AddArg2(x, y)
9198 v.AddArg(v0)
9199 return true
9200 }
9201 break
9202 }
9203
9204
9205 for {
9206 if v_0.Op != OpPPC64XOR {
9207 break
9208 }
9209 t := v_0.Type
9210 _ = v_0.Args[1]
9211 v_0_0 := v_0.Args[0]
9212 v_0_1 := v_0.Args[1]
9213 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9214 x := v_0_0
9215 if v_0_1.Op != OpPPC64MOVWZreg {
9216 continue
9217 }
9218 y := v_0_1.Args[0]
9219 v.reset(OpPPC64MOVHZreg)
9220 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
9221 v0.AddArg2(x, y)
9222 v.AddArg(v0)
9223 return true
9224 }
9225 break
9226 }
9227
9228
9229 for {
9230 if v_0.Op != OpPPC64AND {
9231 break
9232 }
9233 t := v_0.Type
9234 _ = v_0.Args[1]
9235 v_0_0 := v_0.Args[0]
9236 v_0_1 := v_0.Args[1]
9237 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9238 x := v_0_0
9239 if v_0_1.Op != OpPPC64MOVWZreg {
9240 continue
9241 }
9242 y := v_0_1.Args[0]
9243 v.reset(OpPPC64MOVHZreg)
9244 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
9245 v0.AddArg2(x, y)
9246 v.AddArg(v0)
9247 return true
9248 }
9249 break
9250 }
9251
9252
9253 for {
9254 if v_0.Op != OpPPC64OR {
9255 break
9256 }
9257 t := v_0.Type
9258 _ = v_0.Args[1]
9259 v_0_0 := v_0.Args[0]
9260 v_0_1 := v_0.Args[1]
9261 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9262 x := v_0_0
9263 if v_0_1.Op != OpPPC64MOVHZreg {
9264 continue
9265 }
9266 y := v_0_1.Args[0]
9267 v.reset(OpPPC64MOVHZreg)
9268 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
9269 v0.AddArg2(x, y)
9270 v.AddArg(v0)
9271 return true
9272 }
9273 break
9274 }
9275
9276
9277 for {
9278 if v_0.Op != OpPPC64XOR {
9279 break
9280 }
9281 t := v_0.Type
9282 _ = v_0.Args[1]
9283 v_0_0 := v_0.Args[0]
9284 v_0_1 := v_0.Args[1]
9285 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9286 x := v_0_0
9287 if v_0_1.Op != OpPPC64MOVHZreg {
9288 continue
9289 }
9290 y := v_0_1.Args[0]
9291 v.reset(OpPPC64MOVHZreg)
9292 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
9293 v0.AddArg2(x, y)
9294 v.AddArg(v0)
9295 return true
9296 }
9297 break
9298 }
9299
9300
9301 for {
9302 if v_0.Op != OpPPC64AND {
9303 break
9304 }
9305 t := v_0.Type
9306 _ = v_0.Args[1]
9307 v_0_0 := v_0.Args[0]
9308 v_0_1 := v_0.Args[1]
9309 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
9310 x := v_0_0
9311 if v_0_1.Op != OpPPC64MOVHZreg {
9312 continue
9313 }
9314 y := v_0_1.Args[0]
9315 v.reset(OpPPC64MOVHZreg)
9316 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
9317 v0.AddArg2(x, y)
9318 v.AddArg(v0)
9319 return true
9320 }
9321 break
9322 }
9323
9324
9325 for {
9326 z := v_0
9327 if z.Op != OpPPC64ANDconst {
9328 break
9329 }
9330 z_0 := z.Args[0]
9331 if z_0.Op != OpPPC64MOVBZload {
9332 break
9333 }
9334 v.copyOf(z)
9335 return true
9336 }
9337
9338
9339 for {
9340 z := v_0
9341 if z.Op != OpPPC64AND {
9342 break
9343 }
9344 _ = z.Args[1]
9345 z_0 := z.Args[0]
9346 z_1 := z.Args[1]
9347 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
9348 if z_1.Op != OpPPC64MOVHZload {
9349 continue
9350 }
9351 v.copyOf(z)
9352 return true
9353 }
9354 break
9355 }
9356
9357
9358 for {
9359 z := v_0
9360 if z.Op != OpPPC64ANDconst {
9361 break
9362 }
9363 z_0 := z.Args[0]
9364 if z_0.Op != OpPPC64MOVHZload {
9365 break
9366 }
9367 v.copyOf(z)
9368 return true
9369 }
9370
9371
9372 for {
9373 x := v_0
9374 if x.Op != OpPPC64MOVBZload {
9375 break
9376 }
9377 v.copyOf(x)
9378 return true
9379 }
9380
9381
9382 for {
9383 x := v_0
9384 if x.Op != OpPPC64MOVBZloadidx {
9385 break
9386 }
9387 v.copyOf(x)
9388 return true
9389 }
9390
9391
9392 for {
9393 x := v_0
9394 if x.Op != OpPPC64MOVHZload {
9395 break
9396 }
9397 v.copyOf(x)
9398 return true
9399 }
9400
9401
9402 for {
9403 x := v_0
9404 if x.Op != OpPPC64MOVHZloadidx {
9405 break
9406 }
9407 v.copyOf(x)
9408 return true
9409 }
9410
9411
9412
9413 for {
9414 x := v_0
9415 if x.Op != OpArg {
9416 break
9417 }
9418 t := x.Type
9419 if !((is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()) {
9420 break
9421 }
9422 v.copyOf(x)
9423 return true
9424 }
9425
9426
9427 for {
9428 if v_0.Op != OpPPC64MOVDconst {
9429 break
9430 }
9431 c := auxIntToInt64(v_0.AuxInt)
9432 v.reset(OpPPC64MOVDconst)
9433 v.AuxInt = int64ToAuxInt(int64(uint16(c)))
9434 return true
9435 }
9436 return false
9437 }
9438 func rewriteValuePPC64_OpPPC64MOVHload(v *Value) bool {
9439 v_1 := v.Args[1]
9440 v_0 := v.Args[0]
9441
9442
9443
9444 for {
9445 off1 := auxIntToInt32(v.AuxInt)
9446 sym1 := auxToSym(v.Aux)
9447 p := v_0
9448 if p.Op != OpPPC64MOVDaddr {
9449 break
9450 }
9451 off2 := auxIntToInt32(p.AuxInt)
9452 sym2 := auxToSym(p.Aux)
9453 ptr := p.Args[0]
9454 mem := v_1
9455 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
9456 break
9457 }
9458 v.reset(OpPPC64MOVHload)
9459 v.AuxInt = int32ToAuxInt(off1 + off2)
9460 v.Aux = symToAux(mergeSym(sym1, sym2))
9461 v.AddArg2(ptr, mem)
9462 return true
9463 }
9464
9465
9466
9467 for {
9468 off1 := auxIntToInt32(v.AuxInt)
9469 sym := auxToSym(v.Aux)
9470 if v_0.Op != OpPPC64ADDconst {
9471 break
9472 }
9473 off2 := auxIntToInt64(v_0.AuxInt)
9474 x := v_0.Args[0]
9475 mem := v_1
9476 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
9477 break
9478 }
9479 v.reset(OpPPC64MOVHload)
9480 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9481 v.Aux = symToAux(sym)
9482 v.AddArg2(x, mem)
9483 return true
9484 }
9485
9486
9487
9488 for {
9489 if auxIntToInt32(v.AuxInt) != 0 {
9490 break
9491 }
9492 sym := auxToSym(v.Aux)
9493 p := v_0
9494 if p.Op != OpPPC64ADD {
9495 break
9496 }
9497 idx := p.Args[1]
9498 ptr := p.Args[0]
9499 mem := v_1
9500 if !(sym == nil && p.Uses == 1) {
9501 break
9502 }
9503 v.reset(OpPPC64MOVHloadidx)
9504 v.AddArg3(ptr, idx, mem)
9505 return true
9506 }
9507 return false
9508 }
9509 func rewriteValuePPC64_OpPPC64MOVHloadidx(v *Value) bool {
9510 v_2 := v.Args[2]
9511 v_1 := v.Args[1]
9512 v_0 := v.Args[0]
9513
9514
9515
9516 for {
9517 ptr := v_0
9518 if v_1.Op != OpPPC64MOVDconst {
9519 break
9520 }
9521 c := auxIntToInt64(v_1.AuxInt)
9522 mem := v_2
9523 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
9524 break
9525 }
9526 v.reset(OpPPC64MOVHload)
9527 v.AuxInt = int32ToAuxInt(int32(c))
9528 v.AddArg2(ptr, mem)
9529 return true
9530 }
9531
9532
9533
9534 for {
9535 if v_0.Op != OpPPC64MOVDconst {
9536 break
9537 }
9538 c := auxIntToInt64(v_0.AuxInt)
9539 ptr := v_1
9540 mem := v_2
9541 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
9542 break
9543 }
9544 v.reset(OpPPC64MOVHload)
9545 v.AuxInt = int32ToAuxInt(int32(c))
9546 v.AddArg2(ptr, mem)
9547 return true
9548 }
9549 return false
9550 }
9551 func rewriteValuePPC64_OpPPC64MOVHreg(v *Value) bool {
9552 v_0 := v.Args[0]
9553 b := v.Block
9554 typ := &b.Func.Config.Types
9555
9556
9557
9558 for {
9559 y := v_0
9560 if y.Op != OpPPC64ANDconst {
9561 break
9562 }
9563 c := auxIntToInt64(y.AuxInt)
9564 if !(uint64(c) <= 0x7FFF) {
9565 break
9566 }
9567 v.copyOf(y)
9568 return true
9569 }
9570
9571
9572 for {
9573 if v_0.Op != OpPPC64SRAWconst {
9574 break
9575 }
9576 c := auxIntToInt64(v_0.AuxInt)
9577 v_0_0 := v_0.Args[0]
9578 if v_0_0.Op != OpPPC64MOVBreg {
9579 break
9580 }
9581 x := v_0_0.Args[0]
9582 v.reset(OpPPC64SRAWconst)
9583 v.AuxInt = int64ToAuxInt(c)
9584 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
9585 v0.AddArg(x)
9586 v.AddArg(v0)
9587 return true
9588 }
9589
9590
9591 for {
9592 if v_0.Op != OpPPC64SRAWconst {
9593 break
9594 }
9595 c := auxIntToInt64(v_0.AuxInt)
9596 v_0_0 := v_0.Args[0]
9597 if v_0_0.Op != OpPPC64MOVHreg {
9598 break
9599 }
9600 x := v_0_0.Args[0]
9601 v.reset(OpPPC64SRAWconst)
9602 v.AuxInt = int64ToAuxInt(c)
9603 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
9604 v0.AddArg(x)
9605 v.AddArg(v0)
9606 return true
9607 }
9608
9609
9610
9611 for {
9612 if v_0.Op != OpPPC64SRAWconst {
9613 break
9614 }
9615 c := auxIntToInt64(v_0.AuxInt)
9616 x := v_0.Args[0]
9617 if !(x.Type.Size() <= 16) {
9618 break
9619 }
9620 v.reset(OpPPC64SRAWconst)
9621 v.AuxInt = int64ToAuxInt(c)
9622 v.AddArg(x)
9623 return true
9624 }
9625
9626
9627
9628 for {
9629 if v_0.Op != OpPPC64SRDconst {
9630 break
9631 }
9632 c := auxIntToInt64(v_0.AuxInt)
9633 x := v_0.Args[0]
9634 if !(c > 48) {
9635 break
9636 }
9637 v.reset(OpPPC64SRDconst)
9638 v.AuxInt = int64ToAuxInt(c)
9639 v.AddArg(x)
9640 return true
9641 }
9642
9643
9644
9645 for {
9646 if v_0.Op != OpPPC64SRDconst {
9647 break
9648 }
9649 c := auxIntToInt64(v_0.AuxInt)
9650 x := v_0.Args[0]
9651 if !(c == 48) {
9652 break
9653 }
9654 v.reset(OpPPC64SRADconst)
9655 v.AuxInt = int64ToAuxInt(c)
9656 v.AddArg(x)
9657 return true
9658 }
9659
9660
9661
9662 for {
9663 if v_0.Op != OpPPC64SRADconst {
9664 break
9665 }
9666 c := auxIntToInt64(v_0.AuxInt)
9667 x := v_0.Args[0]
9668 if !(c >= 48) {
9669 break
9670 }
9671 v.reset(OpPPC64SRADconst)
9672 v.AuxInt = int64ToAuxInt(c)
9673 v.AddArg(x)
9674 return true
9675 }
9676
9677
9678
9679 for {
9680 if v_0.Op != OpPPC64SRWconst {
9681 break
9682 }
9683 c := auxIntToInt64(v_0.AuxInt)
9684 x := v_0.Args[0]
9685 if !(c > 16) {
9686 break
9687 }
9688 v.reset(OpPPC64SRWconst)
9689 v.AuxInt = int64ToAuxInt(c)
9690 v.AddArg(x)
9691 return true
9692 }
9693
9694
9695
9696 for {
9697 if v_0.Op != OpPPC64SRAWconst {
9698 break
9699 }
9700 c := auxIntToInt64(v_0.AuxInt)
9701 x := v_0.Args[0]
9702 if !(c >= 16) {
9703 break
9704 }
9705 v.reset(OpPPC64SRAWconst)
9706 v.AuxInt = int64ToAuxInt(c)
9707 v.AddArg(x)
9708 return true
9709 }
9710
9711
9712
9713 for {
9714 if v_0.Op != OpPPC64SRWconst {
9715 break
9716 }
9717 c := auxIntToInt64(v_0.AuxInt)
9718 x := v_0.Args[0]
9719 if !(c == 16) {
9720 break
9721 }
9722 v.reset(OpPPC64SRAWconst)
9723 v.AuxInt = int64ToAuxInt(c)
9724 v.AddArg(x)
9725 return true
9726 }
9727
9728
9729 for {
9730 y := v_0
9731 if y.Op != OpPPC64MOVHreg {
9732 break
9733 }
9734 v.copyOf(y)
9735 return true
9736 }
9737
9738
9739 for {
9740 y := v_0
9741 if y.Op != OpPPC64MOVBreg {
9742 break
9743 }
9744 v.copyOf(y)
9745 return true
9746 }
9747
9748
9749 for {
9750 y := v_0
9751 if y.Op != OpPPC64MOVHZreg {
9752 break
9753 }
9754 x := y.Args[0]
9755 v.reset(OpPPC64MOVHreg)
9756 v.AddArg(x)
9757 return true
9758 }
9759
9760
9761 for {
9762 x := v_0
9763 if x.Op != OpPPC64MOVHload {
9764 break
9765 }
9766 v.copyOf(x)
9767 return true
9768 }
9769
9770
9771 for {
9772 x := v_0
9773 if x.Op != OpPPC64MOVHloadidx {
9774 break
9775 }
9776 v.copyOf(x)
9777 return true
9778 }
9779
9780
9781
9782 for {
9783 x := v_0
9784 if x.Op != OpArg {
9785 break
9786 }
9787 t := x.Type
9788 if !((is8BitInt(t) || is16BitInt(t)) && t.IsSigned()) {
9789 break
9790 }
9791 v.copyOf(x)
9792 return true
9793 }
9794
9795
9796 for {
9797 if v_0.Op != OpPPC64MOVDconst {
9798 break
9799 }
9800 c := auxIntToInt64(v_0.AuxInt)
9801 v.reset(OpPPC64MOVDconst)
9802 v.AuxInt = int64ToAuxInt(int64(int16(c)))
9803 return true
9804 }
9805 return false
9806 }
9807 func rewriteValuePPC64_OpPPC64MOVHstore(v *Value) bool {
9808 v_2 := v.Args[2]
9809 v_1 := v.Args[1]
9810 v_0 := v.Args[0]
9811 b := v.Block
9812
9813
9814
9815 for {
9816 off1 := auxIntToInt32(v.AuxInt)
9817 sym := auxToSym(v.Aux)
9818 if v_0.Op != OpPPC64ADDconst {
9819 break
9820 }
9821 off2 := auxIntToInt64(v_0.AuxInt)
9822 x := v_0.Args[0]
9823 val := v_1
9824 mem := v_2
9825 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
9826 break
9827 }
9828 v.reset(OpPPC64MOVHstore)
9829 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
9830 v.Aux = symToAux(sym)
9831 v.AddArg3(x, val, mem)
9832 return true
9833 }
9834
9835
9836
9837 for {
9838 off1 := auxIntToInt32(v.AuxInt)
9839 sym1 := auxToSym(v.Aux)
9840 p := v_0
9841 if p.Op != OpPPC64MOVDaddr {
9842 break
9843 }
9844 off2 := auxIntToInt32(p.AuxInt)
9845 sym2 := auxToSym(p.Aux)
9846 ptr := p.Args[0]
9847 val := v_1
9848 mem := v_2
9849 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
9850 break
9851 }
9852 v.reset(OpPPC64MOVHstore)
9853 v.AuxInt = int32ToAuxInt(off1 + off2)
9854 v.Aux = symToAux(mergeSym(sym1, sym2))
9855 v.AddArg3(ptr, val, mem)
9856 return true
9857 }
9858
9859
9860 for {
9861 off := auxIntToInt32(v.AuxInt)
9862 sym := auxToSym(v.Aux)
9863 ptr := v_0
9864 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
9865 break
9866 }
9867 mem := v_2
9868 v.reset(OpPPC64MOVHstorezero)
9869 v.AuxInt = int32ToAuxInt(off)
9870 v.Aux = symToAux(sym)
9871 v.AddArg2(ptr, mem)
9872 return true
9873 }
9874
9875
9876
9877 for {
9878 if auxIntToInt32(v.AuxInt) != 0 {
9879 break
9880 }
9881 sym := auxToSym(v.Aux)
9882 p := v_0
9883 if p.Op != OpPPC64ADD {
9884 break
9885 }
9886 idx := p.Args[1]
9887 ptr := p.Args[0]
9888 val := v_1
9889 mem := v_2
9890 if !(sym == nil && p.Uses == 1) {
9891 break
9892 }
9893 v.reset(OpPPC64MOVHstoreidx)
9894 v.AddArg4(ptr, idx, val, mem)
9895 return true
9896 }
9897
9898
9899 for {
9900 off := auxIntToInt32(v.AuxInt)
9901 sym := auxToSym(v.Aux)
9902 ptr := v_0
9903 if v_1.Op != OpPPC64MOVHreg {
9904 break
9905 }
9906 x := v_1.Args[0]
9907 mem := v_2
9908 v.reset(OpPPC64MOVHstore)
9909 v.AuxInt = int32ToAuxInt(off)
9910 v.Aux = symToAux(sym)
9911 v.AddArg3(ptr, x, mem)
9912 return true
9913 }
9914
9915
9916 for {
9917 off := auxIntToInt32(v.AuxInt)
9918 sym := auxToSym(v.Aux)
9919 ptr := v_0
9920 if v_1.Op != OpPPC64MOVHZreg {
9921 break
9922 }
9923 x := v_1.Args[0]
9924 mem := v_2
9925 v.reset(OpPPC64MOVHstore)
9926 v.AuxInt = int32ToAuxInt(off)
9927 v.Aux = symToAux(sym)
9928 v.AddArg3(ptr, x, mem)
9929 return true
9930 }
9931
9932
9933 for {
9934 off := auxIntToInt32(v.AuxInt)
9935 sym := auxToSym(v.Aux)
9936 ptr := v_0
9937 if v_1.Op != OpPPC64MOVWreg {
9938 break
9939 }
9940 x := v_1.Args[0]
9941 mem := v_2
9942 v.reset(OpPPC64MOVHstore)
9943 v.AuxInt = int32ToAuxInt(off)
9944 v.Aux = symToAux(sym)
9945 v.AddArg3(ptr, x, mem)
9946 return true
9947 }
9948
9949
9950 for {
9951 off := auxIntToInt32(v.AuxInt)
9952 sym := auxToSym(v.Aux)
9953 ptr := v_0
9954 if v_1.Op != OpPPC64MOVWZreg {
9955 break
9956 }
9957 x := v_1.Args[0]
9958 mem := v_2
9959 v.reset(OpPPC64MOVHstore)
9960 v.AuxInt = int32ToAuxInt(off)
9961 v.Aux = symToAux(sym)
9962 v.AddArg3(ptr, x, mem)
9963 return true
9964 }
9965
9966
9967
9968 for {
9969 off := auxIntToInt32(v.AuxInt)
9970 sym := auxToSym(v.Aux)
9971 ptr := v_0
9972 r := v_1
9973 if r.Op != OpPPC64BRH {
9974 break
9975 }
9976 val := r.Args[0]
9977 mem := v_2
9978 if !(r.Uses == 1) {
9979 break
9980 }
9981 v.reset(OpPPC64MOVHBRstore)
9982 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
9983 v0.AuxInt = int32ToAuxInt(off)
9984 v0.Aux = symToAux(sym)
9985 v0.AddArg(ptr)
9986 v.AddArg3(v0, val, mem)
9987 return true
9988 }
9989
9990
9991 for {
9992 off := auxIntToInt32(v.AuxInt)
9993 sym := auxToSym(v.Aux)
9994 ptr := v_0
9995 if v_1.Op != OpBswap16 {
9996 break
9997 }
9998 val := v_1.Args[0]
9999 mem := v_2
10000 v.reset(OpPPC64MOVHBRstore)
10001 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
10002 v0.AuxInt = int32ToAuxInt(off)
10003 v0.Aux = symToAux(sym)
10004 v0.AddArg(ptr)
10005 v.AddArg3(v0, val, mem)
10006 return true
10007 }
10008 return false
10009 }
10010 func rewriteValuePPC64_OpPPC64MOVHstoreidx(v *Value) bool {
10011 v_3 := v.Args[3]
10012 v_2 := v.Args[2]
10013 v_1 := v.Args[1]
10014 v_0 := v.Args[0]
10015
10016
10017
10018 for {
10019 ptr := v_0
10020 if v_1.Op != OpPPC64MOVDconst {
10021 break
10022 }
10023 c := auxIntToInt64(v_1.AuxInt)
10024 val := v_2
10025 mem := v_3
10026 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10027 break
10028 }
10029 v.reset(OpPPC64MOVHstore)
10030 v.AuxInt = int32ToAuxInt(int32(c))
10031 v.AddArg3(ptr, val, mem)
10032 return true
10033 }
10034
10035
10036
10037 for {
10038 if v_0.Op != OpPPC64MOVDconst {
10039 break
10040 }
10041 c := auxIntToInt64(v_0.AuxInt)
10042 ptr := v_1
10043 val := v_2
10044 mem := v_3
10045 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10046 break
10047 }
10048 v.reset(OpPPC64MOVHstore)
10049 v.AuxInt = int32ToAuxInt(int32(c))
10050 v.AddArg3(ptr, val, mem)
10051 return true
10052 }
10053
10054
10055 for {
10056 ptr := v_0
10057 idx := v_1
10058 if v_2.Op != OpPPC64MOVHreg {
10059 break
10060 }
10061 x := v_2.Args[0]
10062 mem := v_3
10063 v.reset(OpPPC64MOVHstoreidx)
10064 v.AddArg4(ptr, idx, x, mem)
10065 return true
10066 }
10067
10068
10069 for {
10070 ptr := v_0
10071 idx := v_1
10072 if v_2.Op != OpPPC64MOVHZreg {
10073 break
10074 }
10075 x := v_2.Args[0]
10076 mem := v_3
10077 v.reset(OpPPC64MOVHstoreidx)
10078 v.AddArg4(ptr, idx, x, mem)
10079 return true
10080 }
10081
10082
10083 for {
10084 ptr := v_0
10085 idx := v_1
10086 if v_2.Op != OpPPC64MOVWreg {
10087 break
10088 }
10089 x := v_2.Args[0]
10090 mem := v_3
10091 v.reset(OpPPC64MOVHstoreidx)
10092 v.AddArg4(ptr, idx, x, mem)
10093 return true
10094 }
10095
10096
10097 for {
10098 ptr := v_0
10099 idx := v_1
10100 if v_2.Op != OpPPC64MOVWZreg {
10101 break
10102 }
10103 x := v_2.Args[0]
10104 mem := v_3
10105 v.reset(OpPPC64MOVHstoreidx)
10106 v.AddArg4(ptr, idx, x, mem)
10107 return true
10108 }
10109
10110
10111
10112 for {
10113 ptr := v_0
10114 idx := v_1
10115 r := v_2
10116 if r.Op != OpPPC64BRH {
10117 break
10118 }
10119 val := r.Args[0]
10120 mem := v_3
10121 if !(r.Uses == 1) {
10122 break
10123 }
10124 v.reset(OpPPC64MOVHBRstoreidx)
10125 v.AddArg4(ptr, idx, val, mem)
10126 return true
10127 }
10128
10129
10130 for {
10131 ptr := v_0
10132 idx := v_1
10133 if v_2.Op != OpBswap16 {
10134 break
10135 }
10136 val := v_2.Args[0]
10137 mem := v_3
10138 v.reset(OpPPC64MOVHBRstoreidx)
10139 v.AddArg4(ptr, idx, val, mem)
10140 return true
10141 }
10142 return false
10143 }
10144 func rewriteValuePPC64_OpPPC64MOVHstorezero(v *Value) bool {
10145 v_1 := v.Args[1]
10146 v_0 := v.Args[0]
10147
10148
10149
10150 for {
10151 off1 := auxIntToInt32(v.AuxInt)
10152 sym := auxToSym(v.Aux)
10153 if v_0.Op != OpPPC64ADDconst {
10154 break
10155 }
10156 off2 := auxIntToInt64(v_0.AuxInt)
10157 x := v_0.Args[0]
10158 mem := v_1
10159 if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
10160 break
10161 }
10162 v.reset(OpPPC64MOVHstorezero)
10163 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10164 v.Aux = symToAux(sym)
10165 v.AddArg2(x, mem)
10166 return true
10167 }
10168
10169
10170
10171 for {
10172 off1 := auxIntToInt32(v.AuxInt)
10173 sym1 := auxToSym(v.Aux)
10174 p := v_0
10175 if p.Op != OpPPC64MOVDaddr {
10176 break
10177 }
10178 off2 := auxIntToInt32(p.AuxInt)
10179 sym2 := auxToSym(p.Aux)
10180 x := p.Args[0]
10181 mem := v_1
10182 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
10183 break
10184 }
10185 v.reset(OpPPC64MOVHstorezero)
10186 v.AuxInt = int32ToAuxInt(off1 + off2)
10187 v.Aux = symToAux(mergeSym(sym1, sym2))
10188 v.AddArg2(x, mem)
10189 return true
10190 }
10191 return false
10192 }
10193 func rewriteValuePPC64_OpPPC64MOVWBRstore(v *Value) bool {
10194 v_2 := v.Args[2]
10195 v_1 := v.Args[1]
10196 v_0 := v.Args[0]
10197
10198
10199 for {
10200 ptr := v_0
10201 if v_1.Op != OpPPC64MOVWreg {
10202 break
10203 }
10204 x := v_1.Args[0]
10205 mem := v_2
10206 v.reset(OpPPC64MOVWBRstore)
10207 v.AddArg3(ptr, x, mem)
10208 return true
10209 }
10210
10211
10212 for {
10213 ptr := v_0
10214 if v_1.Op != OpPPC64MOVWZreg {
10215 break
10216 }
10217 x := v_1.Args[0]
10218 mem := v_2
10219 v.reset(OpPPC64MOVWBRstore)
10220 v.AddArg3(ptr, x, mem)
10221 return true
10222 }
10223 return false
10224 }
10225 func rewriteValuePPC64_OpPPC64MOVWZload(v *Value) bool {
10226 v_1 := v.Args[1]
10227 v_0 := v.Args[0]
10228
10229
10230
10231 for {
10232 off1 := auxIntToInt32(v.AuxInt)
10233 sym1 := auxToSym(v.Aux)
10234 p := v_0
10235 if p.Op != OpPPC64MOVDaddr {
10236 break
10237 }
10238 off2 := auxIntToInt32(p.AuxInt)
10239 sym2 := auxToSym(p.Aux)
10240 ptr := p.Args[0]
10241 mem := v_1
10242 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
10243 break
10244 }
10245 v.reset(OpPPC64MOVWZload)
10246 v.AuxInt = int32ToAuxInt(off1 + off2)
10247 v.Aux = symToAux(mergeSym(sym1, sym2))
10248 v.AddArg2(ptr, mem)
10249 return true
10250 }
10251
10252
10253
10254 for {
10255 off1 := auxIntToInt32(v.AuxInt)
10256 sym := auxToSym(v.Aux)
10257 if v_0.Op != OpPPC64ADDconst {
10258 break
10259 }
10260 off2 := auxIntToInt64(v_0.AuxInt)
10261 x := v_0.Args[0]
10262 mem := v_1
10263 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
10264 break
10265 }
10266 v.reset(OpPPC64MOVWZload)
10267 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10268 v.Aux = symToAux(sym)
10269 v.AddArg2(x, mem)
10270 return true
10271 }
10272
10273
10274
10275 for {
10276 if auxIntToInt32(v.AuxInt) != 0 {
10277 break
10278 }
10279 sym := auxToSym(v.Aux)
10280 p := v_0
10281 if p.Op != OpPPC64ADD {
10282 break
10283 }
10284 idx := p.Args[1]
10285 ptr := p.Args[0]
10286 mem := v_1
10287 if !(sym == nil && p.Uses == 1) {
10288 break
10289 }
10290 v.reset(OpPPC64MOVWZloadidx)
10291 v.AddArg3(ptr, idx, mem)
10292 return true
10293 }
10294 return false
10295 }
10296 func rewriteValuePPC64_OpPPC64MOVWZloadidx(v *Value) bool {
10297 v_2 := v.Args[2]
10298 v_1 := v.Args[1]
10299 v_0 := v.Args[0]
10300
10301
10302
10303 for {
10304 ptr := v_0
10305 if v_1.Op != OpPPC64MOVDconst {
10306 break
10307 }
10308 c := auxIntToInt64(v_1.AuxInt)
10309 mem := v_2
10310 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10311 break
10312 }
10313 v.reset(OpPPC64MOVWZload)
10314 v.AuxInt = int32ToAuxInt(int32(c))
10315 v.AddArg2(ptr, mem)
10316 return true
10317 }
10318
10319
10320
10321 for {
10322 if v_0.Op != OpPPC64MOVDconst {
10323 break
10324 }
10325 c := auxIntToInt64(v_0.AuxInt)
10326 ptr := v_1
10327 mem := v_2
10328 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10329 break
10330 }
10331 v.reset(OpPPC64MOVWZload)
10332 v.AuxInt = int32ToAuxInt(int32(c))
10333 v.AddArg2(ptr, mem)
10334 return true
10335 }
10336 return false
10337 }
10338 func rewriteValuePPC64_OpPPC64MOVWZreg(v *Value) bool {
10339 v_0 := v.Args[0]
10340 b := v.Block
10341 typ := &b.Func.Config.Types
10342
10343
10344
10345 for {
10346 y := v_0
10347 if y.Op != OpPPC64ANDconst {
10348 break
10349 }
10350 c := auxIntToInt64(y.AuxInt)
10351 if !(uint64(c) <= 0xFFFFFFFF) {
10352 break
10353 }
10354 v.copyOf(y)
10355 return true
10356 }
10357
10358
10359
10360 for {
10361 y := v_0
10362 if y.Op != OpPPC64AND {
10363 break
10364 }
10365 y_0 := y.Args[0]
10366 y_1 := y.Args[1]
10367 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
10368 if y_0.Op != OpPPC64MOVDconst {
10369 continue
10370 }
10371 c := auxIntToInt64(y_0.AuxInt)
10372 if !(uint64(c) <= 0xFFFFFFFF) {
10373 continue
10374 }
10375 v.copyOf(y)
10376 return true
10377 }
10378 break
10379 }
10380
10381
10382 for {
10383 if v_0.Op != OpPPC64SRWconst {
10384 break
10385 }
10386 c := auxIntToInt64(v_0.AuxInt)
10387 v_0_0 := v_0.Args[0]
10388 if v_0_0.Op != OpPPC64MOVBZreg {
10389 break
10390 }
10391 x := v_0_0.Args[0]
10392 v.reset(OpPPC64SRWconst)
10393 v.AuxInt = int64ToAuxInt(c)
10394 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
10395 v0.AddArg(x)
10396 v.AddArg(v0)
10397 return true
10398 }
10399
10400
10401 for {
10402 if v_0.Op != OpPPC64SRWconst {
10403 break
10404 }
10405 c := auxIntToInt64(v_0.AuxInt)
10406 v_0_0 := v_0.Args[0]
10407 if v_0_0.Op != OpPPC64MOVHZreg {
10408 break
10409 }
10410 x := v_0_0.Args[0]
10411 v.reset(OpPPC64SRWconst)
10412 v.AuxInt = int64ToAuxInt(c)
10413 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
10414 v0.AddArg(x)
10415 v.AddArg(v0)
10416 return true
10417 }
10418
10419
10420 for {
10421 if v_0.Op != OpPPC64SRWconst {
10422 break
10423 }
10424 c := auxIntToInt64(v_0.AuxInt)
10425 v_0_0 := v_0.Args[0]
10426 if v_0_0.Op != OpPPC64MOVWZreg {
10427 break
10428 }
10429 x := v_0_0.Args[0]
10430 v.reset(OpPPC64SRWconst)
10431 v.AuxInt = int64ToAuxInt(c)
10432 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
10433 v0.AddArg(x)
10434 v.AddArg(v0)
10435 return true
10436 }
10437
10438
10439
10440 for {
10441 if v_0.Op != OpPPC64SRWconst {
10442 break
10443 }
10444 c := auxIntToInt64(v_0.AuxInt)
10445 x := v_0.Args[0]
10446 if !(x.Type.Size() <= 32) {
10447 break
10448 }
10449 v.reset(OpPPC64SRWconst)
10450 v.AuxInt = int64ToAuxInt(c)
10451 v.AddArg(x)
10452 return true
10453 }
10454
10455
10456
10457 for {
10458 if v_0.Op != OpPPC64SRDconst {
10459 break
10460 }
10461 c := auxIntToInt64(v_0.AuxInt)
10462 x := v_0.Args[0]
10463 if !(c >= 32) {
10464 break
10465 }
10466 v.reset(OpPPC64SRDconst)
10467 v.AuxInt = int64ToAuxInt(c)
10468 v.AddArg(x)
10469 return true
10470 }
10471
10472
10473
10474 for {
10475 if v_0.Op != OpPPC64RLWINM {
10476 break
10477 }
10478 r := auxIntToInt64(v_0.AuxInt)
10479 y := v_0.Args[0]
10480 if !(mergePPC64MovwzregRlwinm(r) != 0) {
10481 break
10482 }
10483 v.reset(OpPPC64RLWINM)
10484 v.AuxInt = int64ToAuxInt(mergePPC64MovwzregRlwinm(r))
10485 v.AddArg(y)
10486 return true
10487 }
10488
10489
10490 for {
10491 w := v_0
10492 if w.Op != OpPPC64SLWconst {
10493 break
10494 }
10495 v.copyOf(w)
10496 return true
10497 }
10498
10499
10500 for {
10501 y := v_0
10502 if y.Op != OpPPC64MOVWZreg {
10503 break
10504 }
10505 v.copyOf(y)
10506 return true
10507 }
10508
10509
10510 for {
10511 y := v_0
10512 if y.Op != OpPPC64MOVHZreg {
10513 break
10514 }
10515 v.copyOf(y)
10516 return true
10517 }
10518
10519
10520 for {
10521 y := v_0
10522 if y.Op != OpPPC64MOVBZreg {
10523 break
10524 }
10525 v.copyOf(y)
10526 return true
10527 }
10528
10529
10530 for {
10531 y := v_0
10532 if y.Op != OpPPC64MOVHBRload {
10533 break
10534 }
10535 v.copyOf(y)
10536 return true
10537 }
10538
10539
10540 for {
10541 y := v_0
10542 if y.Op != OpPPC64MOVWBRload {
10543 break
10544 }
10545 v.copyOf(y)
10546 return true
10547 }
10548
10549
10550 for {
10551 y := v_0
10552 if y.Op != OpPPC64MOVWreg {
10553 break
10554 }
10555 x := y.Args[0]
10556 v.reset(OpPPC64MOVWZreg)
10557 v.AddArg(x)
10558 return true
10559 }
10560
10561
10562 for {
10563 if v_0.Op != OpPPC64OR {
10564 break
10565 }
10566 t := v_0.Type
10567 _ = v_0.Args[1]
10568 v_0_0 := v_0.Args[0]
10569 v_0_1 := v_0.Args[1]
10570 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
10571 x := v_0_0
10572 if v_0_1.Op != OpPPC64MOVWZreg {
10573 continue
10574 }
10575 y := v_0_1.Args[0]
10576 v.reset(OpPPC64MOVWZreg)
10577 v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
10578 v0.AddArg2(x, y)
10579 v.AddArg(v0)
10580 return true
10581 }
10582 break
10583 }
10584
10585
10586 for {
10587 if v_0.Op != OpPPC64XOR {
10588 break
10589 }
10590 t := v_0.Type
10591 _ = v_0.Args[1]
10592 v_0_0 := v_0.Args[0]
10593 v_0_1 := v_0.Args[1]
10594 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
10595 x := v_0_0
10596 if v_0_1.Op != OpPPC64MOVWZreg {
10597 continue
10598 }
10599 y := v_0_1.Args[0]
10600 v.reset(OpPPC64MOVWZreg)
10601 v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
10602 v0.AddArg2(x, y)
10603 v.AddArg(v0)
10604 return true
10605 }
10606 break
10607 }
10608
10609
10610 for {
10611 if v_0.Op != OpPPC64AND {
10612 break
10613 }
10614 t := v_0.Type
10615 _ = v_0.Args[1]
10616 v_0_0 := v_0.Args[0]
10617 v_0_1 := v_0.Args[1]
10618 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
10619 x := v_0_0
10620 if v_0_1.Op != OpPPC64MOVWZreg {
10621 continue
10622 }
10623 y := v_0_1.Args[0]
10624 v.reset(OpPPC64MOVWZreg)
10625 v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
10626 v0.AddArg2(x, y)
10627 v.AddArg(v0)
10628 return true
10629 }
10630 break
10631 }
10632
10633
10634 for {
10635 z := v_0
10636 if z.Op != OpPPC64ANDconst {
10637 break
10638 }
10639 z_0 := z.Args[0]
10640 if z_0.Op != OpPPC64MOVBZload {
10641 break
10642 }
10643 v.copyOf(z)
10644 return true
10645 }
10646
10647
10648 for {
10649 z := v_0
10650 if z.Op != OpPPC64AND {
10651 break
10652 }
10653 _ = z.Args[1]
10654 z_0 := z.Args[0]
10655 z_1 := z.Args[1]
10656 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
10657 if z_1.Op != OpPPC64MOVWZload {
10658 continue
10659 }
10660 v.copyOf(z)
10661 return true
10662 }
10663 break
10664 }
10665
10666
10667 for {
10668 z := v_0
10669 if z.Op != OpPPC64ANDconst {
10670 break
10671 }
10672 z_0 := z.Args[0]
10673 if z_0.Op != OpPPC64MOVHZload {
10674 break
10675 }
10676 v.copyOf(z)
10677 return true
10678 }
10679
10680
10681 for {
10682 z := v_0
10683 if z.Op != OpPPC64ANDconst {
10684 break
10685 }
10686 z_0 := z.Args[0]
10687 if z_0.Op != OpPPC64MOVWZload {
10688 break
10689 }
10690 v.copyOf(z)
10691 return true
10692 }
10693
10694
10695 for {
10696 x := v_0
10697 if x.Op != OpPPC64MOVBZload {
10698 break
10699 }
10700 v.copyOf(x)
10701 return true
10702 }
10703
10704
10705 for {
10706 x := v_0
10707 if x.Op != OpPPC64MOVBZloadidx {
10708 break
10709 }
10710 v.copyOf(x)
10711 return true
10712 }
10713
10714
10715 for {
10716 x := v_0
10717 if x.Op != OpPPC64MOVHZload {
10718 break
10719 }
10720 v.copyOf(x)
10721 return true
10722 }
10723
10724
10725 for {
10726 x := v_0
10727 if x.Op != OpPPC64MOVHZloadidx {
10728 break
10729 }
10730 v.copyOf(x)
10731 return true
10732 }
10733
10734
10735 for {
10736 x := v_0
10737 if x.Op != OpPPC64MOVWZload {
10738 break
10739 }
10740 v.copyOf(x)
10741 return true
10742 }
10743
10744
10745 for {
10746 x := v_0
10747 if x.Op != OpPPC64MOVWZloadidx {
10748 break
10749 }
10750 v.copyOf(x)
10751 return true
10752 }
10753
10754
10755 for {
10756 x := v_0
10757 if x.Op != OpSelect0 {
10758 break
10759 }
10760 x_0 := x.Args[0]
10761 if x_0.Op != OpPPC64LoweredAtomicLoad32 {
10762 break
10763 }
10764 v.copyOf(x)
10765 return true
10766 }
10767
10768
10769
10770 for {
10771 x := v_0
10772 if x.Op != OpArg {
10773 break
10774 }
10775 t := x.Type
10776 if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()) {
10777 break
10778 }
10779 v.copyOf(x)
10780 return true
10781 }
10782
10783
10784 for {
10785 if v_0.Op != OpPPC64MOVDconst {
10786 break
10787 }
10788 c := auxIntToInt64(v_0.AuxInt)
10789 v.reset(OpPPC64MOVDconst)
10790 v.AuxInt = int64ToAuxInt(int64(uint32(c)))
10791 return true
10792 }
10793 return false
10794 }
10795 func rewriteValuePPC64_OpPPC64MOVWload(v *Value) bool {
10796 v_1 := v.Args[1]
10797 v_0 := v.Args[0]
10798
10799
10800
10801 for {
10802 off1 := auxIntToInt32(v.AuxInt)
10803 sym1 := auxToSym(v.Aux)
10804 p := v_0
10805 if p.Op != OpPPC64MOVDaddr {
10806 break
10807 }
10808 off2 := auxIntToInt32(p.AuxInt)
10809 sym2 := auxToSym(p.Aux)
10810 ptr := p.Args[0]
10811 mem := v_1
10812 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
10813 break
10814 }
10815 v.reset(OpPPC64MOVWload)
10816 v.AuxInt = int32ToAuxInt(off1 + off2)
10817 v.Aux = symToAux(mergeSym(sym1, sym2))
10818 v.AddArg2(ptr, mem)
10819 return true
10820 }
10821
10822
10823
10824 for {
10825 off1 := auxIntToInt32(v.AuxInt)
10826 sym := auxToSym(v.Aux)
10827 if v_0.Op != OpPPC64ADDconst {
10828 break
10829 }
10830 off2 := auxIntToInt64(v_0.AuxInt)
10831 x := v_0.Args[0]
10832 mem := v_1
10833 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
10834 break
10835 }
10836 v.reset(OpPPC64MOVWload)
10837 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
10838 v.Aux = symToAux(sym)
10839 v.AddArg2(x, mem)
10840 return true
10841 }
10842
10843
10844
10845 for {
10846 if auxIntToInt32(v.AuxInt) != 0 {
10847 break
10848 }
10849 sym := auxToSym(v.Aux)
10850 p := v_0
10851 if p.Op != OpPPC64ADD {
10852 break
10853 }
10854 idx := p.Args[1]
10855 ptr := p.Args[0]
10856 mem := v_1
10857 if !(sym == nil && p.Uses == 1) {
10858 break
10859 }
10860 v.reset(OpPPC64MOVWloadidx)
10861 v.AddArg3(ptr, idx, mem)
10862 return true
10863 }
10864 return false
10865 }
10866 func rewriteValuePPC64_OpPPC64MOVWloadidx(v *Value) bool {
10867 v_2 := v.Args[2]
10868 v_1 := v.Args[1]
10869 v_0 := v.Args[0]
10870
10871
10872
10873 for {
10874 ptr := v_0
10875 if v_1.Op != OpPPC64MOVDconst {
10876 break
10877 }
10878 c := auxIntToInt64(v_1.AuxInt)
10879 mem := v_2
10880 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10881 break
10882 }
10883 v.reset(OpPPC64MOVWload)
10884 v.AuxInt = int32ToAuxInt(int32(c))
10885 v.AddArg2(ptr, mem)
10886 return true
10887 }
10888
10889
10890
10891 for {
10892 if v_0.Op != OpPPC64MOVDconst {
10893 break
10894 }
10895 c := auxIntToInt64(v_0.AuxInt)
10896 ptr := v_1
10897 mem := v_2
10898 if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
10899 break
10900 }
10901 v.reset(OpPPC64MOVWload)
10902 v.AuxInt = int32ToAuxInt(int32(c))
10903 v.AddArg2(ptr, mem)
10904 return true
10905 }
10906 return false
10907 }
10908 func rewriteValuePPC64_OpPPC64MOVWreg(v *Value) bool {
10909 v_0 := v.Args[0]
10910 b := v.Block
10911 typ := &b.Func.Config.Types
10912
10913
10914
10915 for {
10916 y := v_0
10917 if y.Op != OpPPC64ANDconst {
10918 break
10919 }
10920 c := auxIntToInt64(y.AuxInt)
10921 if !(uint64(c) <= 0xFFFF) {
10922 break
10923 }
10924 v.copyOf(y)
10925 return true
10926 }
10927
10928
10929
10930 for {
10931 y := v_0
10932 if y.Op != OpPPC64AND {
10933 break
10934 }
10935 y_0 := y.Args[0]
10936 y_1 := y.Args[1]
10937 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
10938 if y_0.Op != OpPPC64MOVDconst {
10939 continue
10940 }
10941 c := auxIntToInt64(y_0.AuxInt)
10942 if !(uint64(c) <= 0x7FFFFFFF) {
10943 continue
10944 }
10945 v.copyOf(y)
10946 return true
10947 }
10948 break
10949 }
10950
10951
10952 for {
10953 if v_0.Op != OpPPC64SRAWconst {
10954 break
10955 }
10956 c := auxIntToInt64(v_0.AuxInt)
10957 v_0_0 := v_0.Args[0]
10958 if v_0_0.Op != OpPPC64MOVBreg {
10959 break
10960 }
10961 x := v_0_0.Args[0]
10962 v.reset(OpPPC64SRAWconst)
10963 v.AuxInt = int64ToAuxInt(c)
10964 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
10965 v0.AddArg(x)
10966 v.AddArg(v0)
10967 return true
10968 }
10969
10970
10971 for {
10972 if v_0.Op != OpPPC64SRAWconst {
10973 break
10974 }
10975 c := auxIntToInt64(v_0.AuxInt)
10976 v_0_0 := v_0.Args[0]
10977 if v_0_0.Op != OpPPC64MOVHreg {
10978 break
10979 }
10980 x := v_0_0.Args[0]
10981 v.reset(OpPPC64SRAWconst)
10982 v.AuxInt = int64ToAuxInt(c)
10983 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
10984 v0.AddArg(x)
10985 v.AddArg(v0)
10986 return true
10987 }
10988
10989
10990 for {
10991 if v_0.Op != OpPPC64SRAWconst {
10992 break
10993 }
10994 c := auxIntToInt64(v_0.AuxInt)
10995 v_0_0 := v_0.Args[0]
10996 if v_0_0.Op != OpPPC64MOVWreg {
10997 break
10998 }
10999 x := v_0_0.Args[0]
11000 v.reset(OpPPC64SRAWconst)
11001 v.AuxInt = int64ToAuxInt(c)
11002 v0 := b.NewValue0(v.Pos, OpPPC64MOVWreg, typ.Int64)
11003 v0.AddArg(x)
11004 v.AddArg(v0)
11005 return true
11006 }
11007
11008
11009
11010 for {
11011 if v_0.Op != OpPPC64SRAWconst {
11012 break
11013 }
11014 c := auxIntToInt64(v_0.AuxInt)
11015 x := v_0.Args[0]
11016 if !(x.Type.Size() <= 32) {
11017 break
11018 }
11019 v.reset(OpPPC64SRAWconst)
11020 v.AuxInt = int64ToAuxInt(c)
11021 v.AddArg(x)
11022 return true
11023 }
11024
11025
11026
11027 for {
11028 if v_0.Op != OpPPC64SRDconst {
11029 break
11030 }
11031 c := auxIntToInt64(v_0.AuxInt)
11032 x := v_0.Args[0]
11033 if !(c > 32) {
11034 break
11035 }
11036 v.reset(OpPPC64SRDconst)
11037 v.AuxInt = int64ToAuxInt(c)
11038 v.AddArg(x)
11039 return true
11040 }
11041
11042
11043
11044 for {
11045 if v_0.Op != OpPPC64SRADconst {
11046 break
11047 }
11048 c := auxIntToInt64(v_0.AuxInt)
11049 x := v_0.Args[0]
11050 if !(c >= 32) {
11051 break
11052 }
11053 v.reset(OpPPC64SRADconst)
11054 v.AuxInt = int64ToAuxInt(c)
11055 v.AddArg(x)
11056 return true
11057 }
11058
11059
11060
11061 for {
11062 if v_0.Op != OpPPC64SRDconst {
11063 break
11064 }
11065 c := auxIntToInt64(v_0.AuxInt)
11066 x := v_0.Args[0]
11067 if !(c == 32) {
11068 break
11069 }
11070 v.reset(OpPPC64SRADconst)
11071 v.AuxInt = int64ToAuxInt(c)
11072 v.AddArg(x)
11073 return true
11074 }
11075
11076
11077 for {
11078 y := v_0
11079 if y.Op != OpPPC64MOVWreg {
11080 break
11081 }
11082 v.copyOf(y)
11083 return true
11084 }
11085
11086
11087 for {
11088 y := v_0
11089 if y.Op != OpPPC64MOVHreg {
11090 break
11091 }
11092 v.copyOf(y)
11093 return true
11094 }
11095
11096
11097 for {
11098 y := v_0
11099 if y.Op != OpPPC64MOVBreg {
11100 break
11101 }
11102 v.copyOf(y)
11103 return true
11104 }
11105
11106
11107 for {
11108 y := v_0
11109 if y.Op != OpPPC64MOVWZreg {
11110 break
11111 }
11112 x := y.Args[0]
11113 v.reset(OpPPC64MOVWreg)
11114 v.AddArg(x)
11115 return true
11116 }
11117
11118
11119 for {
11120 x := v_0
11121 if x.Op != OpPPC64MOVHload {
11122 break
11123 }
11124 v.copyOf(x)
11125 return true
11126 }
11127
11128
11129 for {
11130 x := v_0
11131 if x.Op != OpPPC64MOVHloadidx {
11132 break
11133 }
11134 v.copyOf(x)
11135 return true
11136 }
11137
11138
11139 for {
11140 x := v_0
11141 if x.Op != OpPPC64MOVWload {
11142 break
11143 }
11144 v.copyOf(x)
11145 return true
11146 }
11147
11148
11149 for {
11150 x := v_0
11151 if x.Op != OpPPC64MOVWloadidx {
11152 break
11153 }
11154 v.copyOf(x)
11155 return true
11156 }
11157
11158
11159
11160 for {
11161 x := v_0
11162 if x.Op != OpArg {
11163 break
11164 }
11165 t := x.Type
11166 if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()) {
11167 break
11168 }
11169 v.copyOf(x)
11170 return true
11171 }
11172
11173
11174 for {
11175 if v_0.Op != OpPPC64MOVDconst {
11176 break
11177 }
11178 c := auxIntToInt64(v_0.AuxInt)
11179 v.reset(OpPPC64MOVDconst)
11180 v.AuxInt = int64ToAuxInt(int64(int32(c)))
11181 return true
11182 }
11183 return false
11184 }
11185 func rewriteValuePPC64_OpPPC64MOVWstore(v *Value) bool {
11186 v_2 := v.Args[2]
11187 v_1 := v.Args[1]
11188 v_0 := v.Args[0]
11189 b := v.Block
11190
11191
11192
11193 for {
11194 off1 := auxIntToInt32(v.AuxInt)
11195 sym := auxToSym(v.Aux)
11196 if v_0.Op != OpPPC64ADDconst {
11197 break
11198 }
11199 off2 := auxIntToInt64(v_0.AuxInt)
11200 x := v_0.Args[0]
11201 val := v_1
11202 mem := v_2
11203 if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
11204 break
11205 }
11206 v.reset(OpPPC64MOVWstore)
11207 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
11208 v.Aux = symToAux(sym)
11209 v.AddArg3(x, val, mem)
11210 return true
11211 }
11212
11213
11214
11215 for {
11216 off1 := auxIntToInt32(v.AuxInt)
11217 sym1 := auxToSym(v.Aux)
11218 p := v_0
11219 if p.Op != OpPPC64MOVDaddr {
11220 break
11221 }
11222 off2 := auxIntToInt32(p.AuxInt)
11223 sym2 := auxToSym(p.Aux)
11224 ptr := p.Args[0]
11225 val := v_1
11226 mem := v_2
11227 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
11228 break
11229 }
11230 v.reset(OpPPC64MOVWstore)
11231 v.AuxInt = int32ToAuxInt(off1 + off2)
11232 v.Aux = symToAux(mergeSym(sym1, sym2))
11233 v.AddArg3(ptr, val, mem)
11234 return true
11235 }
11236
11237
11238 for {
11239 off := auxIntToInt32(v.AuxInt)
11240 sym := auxToSym(v.Aux)
11241 ptr := v_0
11242 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
11243 break
11244 }
11245 mem := v_2
11246 v.reset(OpPPC64MOVWstorezero)
11247 v.AuxInt = int32ToAuxInt(off)
11248 v.Aux = symToAux(sym)
11249 v.AddArg2(ptr, mem)
11250 return true
11251 }
11252
11253
11254
11255 for {
11256 if auxIntToInt32(v.AuxInt) != 0 {
11257 break
11258 }
11259 sym := auxToSym(v.Aux)
11260 p := v_0
11261 if p.Op != OpPPC64ADD {
11262 break
11263 }
11264 idx := p.Args[1]
11265 ptr := p.Args[0]
11266 val := v_1
11267 mem := v_2
11268 if !(sym == nil && p.Uses == 1) {
11269 break
11270 }
11271 v.reset(OpPPC64MOVWstoreidx)
11272 v.AddArg4(ptr, idx, val, mem)
11273 return true
11274 }
11275
11276
11277 for {
11278 off := auxIntToInt32(v.AuxInt)
11279 sym := auxToSym(v.Aux)
11280 ptr := v_0
11281 if v_1.Op != OpPPC64MOVWreg {
11282 break
11283 }
11284 x := v_1.Args[0]
11285 mem := v_2
11286 v.reset(OpPPC64MOVWstore)
11287 v.AuxInt = int32ToAuxInt(off)
11288 v.Aux = symToAux(sym)
11289 v.AddArg3(ptr, x, mem)
11290 return true
11291 }
11292
11293
11294 for {
11295 off := auxIntToInt32(v.AuxInt)
11296 sym := auxToSym(v.Aux)
11297 ptr := v_0
11298 if v_1.Op != OpPPC64MOVWZreg {
11299 break
11300 }
11301 x := v_1.Args[0]
11302 mem := v_2
11303 v.reset(OpPPC64MOVWstore)
11304 v.AuxInt = int32ToAuxInt(off)
11305 v.Aux = symToAux(sym)
11306 v.AddArg3(ptr, x, mem)
11307 return true
11308 }
11309
11310
11311
11312 for {
11313 off := auxIntToInt32(v.AuxInt)
11314 sym := auxToSym(v.Aux)
11315 ptr := v_0
11316 r := v_1
11317 if r.Op != OpPPC64BRW {
11318 break
11319 }
11320 val := r.Args[0]
11321 mem := v_2
11322 if !(r.Uses == 1) {
11323 break
11324 }
11325 v.reset(OpPPC64MOVWBRstore)
11326 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
11327 v0.AuxInt = int32ToAuxInt(off)
11328 v0.Aux = symToAux(sym)
11329 v0.AddArg(ptr)
11330 v.AddArg3(v0, val, mem)
11331 return true
11332 }
11333
11334
11335 for {
11336 off := auxIntToInt32(v.AuxInt)
11337 sym := auxToSym(v.Aux)
11338 ptr := v_0
11339 if v_1.Op != OpBswap32 {
11340 break
11341 }
11342 val := v_1.Args[0]
11343 mem := v_2
11344 v.reset(OpPPC64MOVWBRstore)
11345 v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
11346 v0.AuxInt = int32ToAuxInt(off)
11347 v0.Aux = symToAux(sym)
11348 v0.AddArg(ptr)
11349 v.AddArg3(v0, val, mem)
11350 return true
11351 }
11352 return false
11353 }
11354 func rewriteValuePPC64_OpPPC64MOVWstoreidx(v *Value) bool {
11355 v_3 := v.Args[3]
11356 v_2 := v.Args[2]
11357 v_1 := v.Args[1]
11358 v_0 := v.Args[0]
11359
11360
11361
11362 for {
11363 ptr := v_0
11364 if v_1.Op != OpPPC64MOVDconst {
11365 break
11366 }
11367 c := auxIntToInt64(v_1.AuxInt)
11368 val := v_2
11369 mem := v_3
11370 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
11371 break
11372 }
11373 v.reset(OpPPC64MOVWstore)
11374 v.AuxInt = int32ToAuxInt(int32(c))
11375 v.AddArg3(ptr, val, mem)
11376 return true
11377 }
11378
11379
11380
11381 for {
11382 if v_0.Op != OpPPC64MOVDconst {
11383 break
11384 }
11385 c := auxIntToInt64(v_0.AuxInt)
11386 ptr := v_1
11387 val := v_2
11388 mem := v_3
11389 if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
11390 break
11391 }
11392 v.reset(OpPPC64MOVWstore)
11393 v.AuxInt = int32ToAuxInt(int32(c))
11394 v.AddArg3(ptr, val, mem)
11395 return true
11396 }
11397
11398
11399 for {
11400 ptr := v_0
11401 idx := v_1
11402 if v_2.Op != OpPPC64MOVWreg {
11403 break
11404 }
11405 x := v_2.Args[0]
11406 mem := v_3
11407 v.reset(OpPPC64MOVWstoreidx)
11408 v.AddArg4(ptr, idx, x, mem)
11409 return true
11410 }
11411
11412
11413 for {
11414 ptr := v_0
11415 idx := v_1
11416 if v_2.Op != OpPPC64MOVWZreg {
11417 break
11418 }
11419 x := v_2.Args[0]
11420 mem := v_3
11421 v.reset(OpPPC64MOVWstoreidx)
11422 v.AddArg4(ptr, idx, x, mem)
11423 return true
11424 }
11425
11426
11427
11428 for {
11429 ptr := v_0
11430 idx := v_1
11431 r := v_2
11432 if r.Op != OpPPC64BRW {
11433 break
11434 }
11435 val := r.Args[0]
11436 mem := v_3
11437 if !(r.Uses == 1) {
11438 break
11439 }
11440 v.reset(OpPPC64MOVWBRstoreidx)
11441 v.AddArg4(ptr, idx, val, mem)
11442 return true
11443 }
11444
11445
11446 for {
11447 ptr := v_0
11448 idx := v_1
11449 if v_2.Op != OpBswap32 {
11450 break
11451 }
11452 val := v_2.Args[0]
11453 mem := v_3
11454 v.reset(OpPPC64MOVWBRstoreidx)
11455 v.AddArg4(ptr, idx, val, mem)
11456 return true
11457 }
11458 return false
11459 }
11460 func rewriteValuePPC64_OpPPC64MOVWstorezero(v *Value) bool {
11461 v_1 := v.Args[1]
11462 v_0 := v.Args[0]
11463
11464
11465
11466 for {
11467 off1 := auxIntToInt32(v.AuxInt)
11468 sym := auxToSym(v.Aux)
11469 if v_0.Op != OpPPC64ADDconst {
11470 break
11471 }
11472 off2 := auxIntToInt64(v_0.AuxInt)
11473 x := v_0.Args[0]
11474 mem := v_1
11475 if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
11476 break
11477 }
11478 v.reset(OpPPC64MOVWstorezero)
11479 v.AuxInt = int32ToAuxInt(off1 + int32(off2))
11480 v.Aux = symToAux(sym)
11481 v.AddArg2(x, mem)
11482 return true
11483 }
11484
11485
11486
11487 for {
11488 off1 := auxIntToInt32(v.AuxInt)
11489 sym1 := auxToSym(v.Aux)
11490 p := v_0
11491 if p.Op != OpPPC64MOVDaddr {
11492 break
11493 }
11494 off2 := auxIntToInt32(p.AuxInt)
11495 sym2 := auxToSym(p.Aux)
11496 x := p.Args[0]
11497 mem := v_1
11498 if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
11499 break
11500 }
11501 v.reset(OpPPC64MOVWstorezero)
11502 v.AuxInt = int32ToAuxInt(off1 + off2)
11503 v.Aux = symToAux(mergeSym(sym1, sym2))
11504 v.AddArg2(x, mem)
11505 return true
11506 }
11507 return false
11508 }
11509 func rewriteValuePPC64_OpPPC64MTVSRD(v *Value) bool {
11510 v_0 := v.Args[0]
11511 b := v.Block
11512 typ := &b.Func.Config.Types
11513
11514
11515
11516 for {
11517 if v_0.Op != OpPPC64MOVDconst {
11518 break
11519 }
11520 c := auxIntToInt64(v_0.AuxInt)
11521 if !(!math.IsNaN(math.Float64frombits(uint64(c)))) {
11522 break
11523 }
11524 v.reset(OpPPC64FMOVDconst)
11525 v.AuxInt = float64ToAuxInt(math.Float64frombits(uint64(c)))
11526 return true
11527 }
11528
11529
11530
11531 for {
11532 x := v_0
11533 if x.Op != OpPPC64MOVDload {
11534 break
11535 }
11536 off := auxIntToInt32(x.AuxInt)
11537 sym := auxToSym(x.Aux)
11538 mem := x.Args[1]
11539 ptr := x.Args[0]
11540 if !(x.Uses == 1 && clobber(x)) {
11541 break
11542 }
11543 b = x.Block
11544 v0 := b.NewValue0(x.Pos, OpPPC64FMOVDload, typ.Float64)
11545 v.copyOf(v0)
11546 v0.AuxInt = int32ToAuxInt(off)
11547 v0.Aux = symToAux(sym)
11548 v0.AddArg2(ptr, mem)
11549 return true
11550 }
11551 return false
11552 }
11553 func rewriteValuePPC64_OpPPC64MULLD(v *Value) bool {
11554 v_1 := v.Args[1]
11555 v_0 := v.Args[0]
11556
11557
11558
11559 for {
11560 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11561 x := v_0
11562 if v_1.Op != OpPPC64MOVDconst {
11563 continue
11564 }
11565 c := auxIntToInt64(v_1.AuxInt)
11566 if !(is16Bit(c)) {
11567 continue
11568 }
11569 v.reset(OpPPC64MULLDconst)
11570 v.AuxInt = int32ToAuxInt(int32(c))
11571 v.AddArg(x)
11572 return true
11573 }
11574 break
11575 }
11576 return false
11577 }
11578 func rewriteValuePPC64_OpPPC64MULLW(v *Value) bool {
11579 v_1 := v.Args[1]
11580 v_0 := v.Args[0]
11581
11582
11583
11584 for {
11585 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11586 x := v_0
11587 if v_1.Op != OpPPC64MOVDconst {
11588 continue
11589 }
11590 c := auxIntToInt64(v_1.AuxInt)
11591 if !(is16Bit(c)) {
11592 continue
11593 }
11594 v.reset(OpPPC64MULLWconst)
11595 v.AuxInt = int32ToAuxInt(int32(c))
11596 v.AddArg(x)
11597 return true
11598 }
11599 break
11600 }
11601 return false
11602 }
11603 func rewriteValuePPC64_OpPPC64NEG(v *Value) bool {
11604 v_0 := v.Args[0]
11605
11606
11607
11608 for {
11609 if v_0.Op != OpPPC64ADDconst {
11610 break
11611 }
11612 c := auxIntToInt64(v_0.AuxInt)
11613 x := v_0.Args[0]
11614 if !(is32Bit(-c)) {
11615 break
11616 }
11617 v.reset(OpPPC64SUBFCconst)
11618 v.AuxInt = int64ToAuxInt(-c)
11619 v.AddArg(x)
11620 return true
11621 }
11622
11623
11624
11625 for {
11626 if v_0.Op != OpPPC64SUBFCconst {
11627 break
11628 }
11629 c := auxIntToInt64(v_0.AuxInt)
11630 x := v_0.Args[0]
11631 if !(is32Bit(-c)) {
11632 break
11633 }
11634 v.reset(OpPPC64ADDconst)
11635 v.AuxInt = int64ToAuxInt(-c)
11636 v.AddArg(x)
11637 return true
11638 }
11639
11640
11641 for {
11642 if v_0.Op != OpPPC64SUB {
11643 break
11644 }
11645 y := v_0.Args[1]
11646 x := v_0.Args[0]
11647 v.reset(OpPPC64SUB)
11648 v.AddArg2(y, x)
11649 return true
11650 }
11651
11652
11653 for {
11654 if v_0.Op != OpPPC64NEG {
11655 break
11656 }
11657 x := v_0.Args[0]
11658 v.copyOf(x)
11659 return true
11660 }
11661 return false
11662 }
11663 func rewriteValuePPC64_OpPPC64NOR(v *Value) bool {
11664 v_1 := v.Args[1]
11665 v_0 := v.Args[0]
11666
11667
11668 for {
11669 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11670 if v_0.Op != OpPPC64MOVDconst {
11671 continue
11672 }
11673 c := auxIntToInt64(v_0.AuxInt)
11674 if v_1.Op != OpPPC64MOVDconst {
11675 continue
11676 }
11677 d := auxIntToInt64(v_1.AuxInt)
11678 v.reset(OpPPC64MOVDconst)
11679 v.AuxInt = int64ToAuxInt(^(c | d))
11680 return true
11681 }
11682 break
11683 }
11684 return false
11685 }
11686 func rewriteValuePPC64_OpPPC64NotEqual(v *Value) bool {
11687 v_0 := v.Args[0]
11688
11689
11690 for {
11691 if v_0.Op != OpPPC64FlagEQ {
11692 break
11693 }
11694 v.reset(OpPPC64MOVDconst)
11695 v.AuxInt = int64ToAuxInt(0)
11696 return true
11697 }
11698
11699
11700 for {
11701 if v_0.Op != OpPPC64FlagLT {
11702 break
11703 }
11704 v.reset(OpPPC64MOVDconst)
11705 v.AuxInt = int64ToAuxInt(1)
11706 return true
11707 }
11708
11709
11710 for {
11711 if v_0.Op != OpPPC64FlagGT {
11712 break
11713 }
11714 v.reset(OpPPC64MOVDconst)
11715 v.AuxInt = int64ToAuxInt(1)
11716 return true
11717 }
11718
11719
11720 for {
11721 if v_0.Op != OpPPC64InvertFlags {
11722 break
11723 }
11724 x := v_0.Args[0]
11725 v.reset(OpPPC64NotEqual)
11726 v.AddArg(x)
11727 return true
11728 }
11729
11730
11731 for {
11732 cmp := v_0
11733 v.reset(OpPPC64SETBCR)
11734 v.AuxInt = int32ToAuxInt(2)
11735 v.AddArg(cmp)
11736 return true
11737 }
11738 }
11739 func rewriteValuePPC64_OpPPC64OR(v *Value) bool {
11740 v_1 := v.Args[1]
11741 v_0 := v.Args[0]
11742
11743
11744 for {
11745 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11746 x := v_0
11747 if v_1.Op != OpPPC64NOR {
11748 continue
11749 }
11750 y := v_1.Args[1]
11751 if y != v_1.Args[0] {
11752 continue
11753 }
11754 v.reset(OpPPC64ORN)
11755 v.AddArg2(x, y)
11756 return true
11757 }
11758 break
11759 }
11760
11761
11762 for {
11763 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11764 if v_0.Op != OpPPC64MOVDconst {
11765 continue
11766 }
11767 c := auxIntToInt64(v_0.AuxInt)
11768 if v_1.Op != OpPPC64MOVDconst {
11769 continue
11770 }
11771 d := auxIntToInt64(v_1.AuxInt)
11772 v.reset(OpPPC64MOVDconst)
11773 v.AuxInt = int64ToAuxInt(c | d)
11774 return true
11775 }
11776 break
11777 }
11778
11779
11780
11781 for {
11782 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
11783 x := v_0
11784 if v_1.Op != OpPPC64MOVDconst {
11785 continue
11786 }
11787 c := auxIntToInt64(v_1.AuxInt)
11788 if !(isU32Bit(c)) {
11789 continue
11790 }
11791 v.reset(OpPPC64ORconst)
11792 v.AuxInt = int64ToAuxInt(c)
11793 v.AddArg(x)
11794 return true
11795 }
11796 break
11797 }
11798 return false
11799 }
11800 func rewriteValuePPC64_OpPPC64ORN(v *Value) bool {
11801 v_1 := v.Args[1]
11802 v_0 := v.Args[0]
11803
11804
11805 for {
11806 x := v_0
11807 if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
11808 break
11809 }
11810 v.copyOf(x)
11811 return true
11812 }
11813
11814
11815 for {
11816 if v_0.Op != OpPPC64MOVDconst {
11817 break
11818 }
11819 c := auxIntToInt64(v_0.AuxInt)
11820 if v_1.Op != OpPPC64MOVDconst {
11821 break
11822 }
11823 d := auxIntToInt64(v_1.AuxInt)
11824 v.reset(OpPPC64MOVDconst)
11825 v.AuxInt = int64ToAuxInt(c | ^d)
11826 return true
11827 }
11828 return false
11829 }
11830 func rewriteValuePPC64_OpPPC64ORconst(v *Value) bool {
11831 v_0 := v.Args[0]
11832
11833
11834 for {
11835 c := auxIntToInt64(v.AuxInt)
11836 if v_0.Op != OpPPC64ORconst {
11837 break
11838 }
11839 d := auxIntToInt64(v_0.AuxInt)
11840 x := v_0.Args[0]
11841 v.reset(OpPPC64ORconst)
11842 v.AuxInt = int64ToAuxInt(c | d)
11843 v.AddArg(x)
11844 return true
11845 }
11846
11847
11848 for {
11849 if auxIntToInt64(v.AuxInt) != -1 {
11850 break
11851 }
11852 v.reset(OpPPC64MOVDconst)
11853 v.AuxInt = int64ToAuxInt(-1)
11854 return true
11855 }
11856
11857
11858 for {
11859 if auxIntToInt64(v.AuxInt) != 0 {
11860 break
11861 }
11862 x := v_0
11863 v.copyOf(x)
11864 return true
11865 }
11866 return false
11867 }
11868 func rewriteValuePPC64_OpPPC64RLWINM(v *Value) bool {
11869 v_0 := v.Args[0]
11870
11871
11872
11873 for {
11874 r := auxIntToInt64(v.AuxInt)
11875 if v_0.Op != OpPPC64MOVHZreg {
11876 break
11877 }
11878 u := v_0.Args[0]
11879 if !(mergePPC64RlwinmAnd(r, 0xFFFF) != 0) {
11880 break
11881 }
11882 v.reset(OpPPC64RLWINM)
11883 v.AuxInt = int64ToAuxInt(mergePPC64RlwinmAnd(r, 0xFFFF))
11884 v.AddArg(u)
11885 return true
11886 }
11887
11888
11889
11890 for {
11891 r := auxIntToInt64(v.AuxInt)
11892 if v_0.Op != OpPPC64ANDconst {
11893 break
11894 }
11895 a := auxIntToInt64(v_0.AuxInt)
11896 u := v_0.Args[0]
11897 if !(mergePPC64RlwinmAnd(r, uint32(a)) != 0) {
11898 break
11899 }
11900 v.reset(OpPPC64RLWINM)
11901 v.AuxInt = int64ToAuxInt(mergePPC64RlwinmAnd(r, uint32(a)))
11902 v.AddArg(u)
11903 return true
11904 }
11905 return false
11906 }
11907 func rewriteValuePPC64_OpPPC64ROTL(v *Value) bool {
11908 v_1 := v.Args[1]
11909 v_0 := v.Args[0]
11910
11911
11912 for {
11913 x := v_0
11914 if v_1.Op != OpPPC64MOVDconst {
11915 break
11916 }
11917 c := auxIntToInt64(v_1.AuxInt)
11918 v.reset(OpPPC64ROTLconst)
11919 v.AuxInt = int64ToAuxInt(c & 63)
11920 v.AddArg(x)
11921 return true
11922 }
11923 return false
11924 }
11925 func rewriteValuePPC64_OpPPC64ROTLW(v *Value) bool {
11926 v_1 := v.Args[1]
11927 v_0 := v.Args[0]
11928
11929
11930 for {
11931 x := v_0
11932 if v_1.Op != OpPPC64MOVDconst {
11933 break
11934 }
11935 c := auxIntToInt64(v_1.AuxInt)
11936 v.reset(OpPPC64ROTLWconst)
11937 v.AuxInt = int64ToAuxInt(c & 31)
11938 v.AddArg(x)
11939 return true
11940 }
11941 return false
11942 }
11943 func rewriteValuePPC64_OpPPC64ROTLWconst(v *Value) bool {
11944 v_0 := v.Args[0]
11945
11946
11947
11948 for {
11949 r := auxIntToInt64(v.AuxInt)
11950 if v_0.Op != OpPPC64AND {
11951 break
11952 }
11953 _ = v_0.Args[1]
11954 v_0_0 := v_0.Args[0]
11955 v_0_1 := v_0.Args[1]
11956 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
11957 if v_0_0.Op != OpPPC64MOVDconst {
11958 continue
11959 }
11960 m := auxIntToInt64(v_0_0.AuxInt)
11961 x := v_0_1
11962 if !(isPPC64WordRotateMask(m)) {
11963 continue
11964 }
11965 v.reset(OpPPC64RLWINM)
11966 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
11967 v.AddArg(x)
11968 return true
11969 }
11970 break
11971 }
11972
11973
11974
11975 for {
11976 r := auxIntToInt64(v.AuxInt)
11977 if v_0.Op != OpPPC64ANDconst {
11978 break
11979 }
11980 m := auxIntToInt64(v_0.AuxInt)
11981 x := v_0.Args[0]
11982 if !(isPPC64WordRotateMask(m)) {
11983 break
11984 }
11985 v.reset(OpPPC64RLWINM)
11986 v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
11987 v.AddArg(x)
11988 return true
11989 }
11990 return false
11991 }
11992 func rewriteValuePPC64_OpPPC64SETBC(v *Value) bool {
11993 v_0 := v.Args[0]
11994 b := v.Block
11995 typ := &b.Func.Config.Types
11996
11997
11998 for {
11999 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
12000 break
12001 }
12002 v.reset(OpPPC64MOVDconst)
12003 v.AuxInt = int64ToAuxInt(1)
12004 return true
12005 }
12006
12007
12008 for {
12009 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
12010 break
12011 }
12012 v.reset(OpPPC64MOVDconst)
12013 v.AuxInt = int64ToAuxInt(0)
12014 return true
12015 }
12016
12017
12018 for {
12019 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
12020 break
12021 }
12022 v.reset(OpPPC64MOVDconst)
12023 v.AuxInt = int64ToAuxInt(0)
12024 return true
12025 }
12026
12027
12028 for {
12029 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
12030 break
12031 }
12032 v.reset(OpPPC64MOVDconst)
12033 v.AuxInt = int64ToAuxInt(1)
12034 return true
12035 }
12036
12037
12038 for {
12039 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
12040 break
12041 }
12042 v.reset(OpPPC64MOVDconst)
12043 v.AuxInt = int64ToAuxInt(0)
12044 return true
12045 }
12046
12047
12048 for {
12049 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
12050 break
12051 }
12052 v.reset(OpPPC64MOVDconst)
12053 v.AuxInt = int64ToAuxInt(0)
12054 return true
12055 }
12056
12057
12058 for {
12059 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
12060 break
12061 }
12062 v.reset(OpPPC64MOVDconst)
12063 v.AuxInt = int64ToAuxInt(1)
12064 return true
12065 }
12066
12067
12068 for {
12069 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
12070 break
12071 }
12072 v.reset(OpPPC64MOVDconst)
12073 v.AuxInt = int64ToAuxInt(0)
12074 return true
12075 }
12076
12077
12078 for {
12079 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
12080 break
12081 }
12082 v.reset(OpPPC64MOVDconst)
12083 v.AuxInt = int64ToAuxInt(0)
12084 return true
12085 }
12086
12087
12088 for {
12089 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
12090 break
12091 }
12092 bool := v_0.Args[0]
12093 v.reset(OpPPC64SETBC)
12094 v.AuxInt = int32ToAuxInt(1)
12095 v.AddArg(bool)
12096 return true
12097 }
12098
12099
12100 for {
12101 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
12102 break
12103 }
12104 bool := v_0.Args[0]
12105 v.reset(OpPPC64SETBC)
12106 v.AuxInt = int32ToAuxInt(0)
12107 v.AddArg(bool)
12108 return true
12109 }
12110
12111
12112 for {
12113 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
12114 break
12115 }
12116 bool := v_0.Args[0]
12117 v.reset(OpPPC64SETBC)
12118 v.AuxInt = int32ToAuxInt(2)
12119 v.AddArg(bool)
12120 return true
12121 }
12122
12123
12124 for {
12125 n := auxIntToInt32(v.AuxInt)
12126 if v_0.Op != OpPPC64InvertFlags {
12127 break
12128 }
12129 bool := v_0.Args[0]
12130 v.reset(OpPPC64SETBCR)
12131 v.AuxInt = int32ToAuxInt(n)
12132 v.AddArg(bool)
12133 return true
12134 }
12135
12136
12137 for {
12138 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
12139 break
12140 }
12141 a := v_0.Args[0]
12142 if a.Op != OpPPC64ANDconst || auxIntToInt64(a.AuxInt) != 1 {
12143 break
12144 }
12145 v.reset(OpPPC64XORconst)
12146 v.AuxInt = int64ToAuxInt(1)
12147 v.AddArg(a)
12148 return true
12149 }
12150
12151
12152
12153 for {
12154 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
12155 break
12156 }
12157 a := v_0.Args[0]
12158 if a.Op != OpPPC64AND {
12159 break
12160 }
12161 z := a.Args[1]
12162 y := a.Args[0]
12163 if !(a.Uses == 1) {
12164 break
12165 }
12166 v.reset(OpPPC64SETBC)
12167 v.AuxInt = int32ToAuxInt(2)
12168 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12169 v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
12170 v1.AddArg2(y, z)
12171 v0.AddArg(v1)
12172 v.AddArg(v0)
12173 return true
12174 }
12175
12176
12177
12178 for {
12179 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
12180 break
12181 }
12182 o := v_0.Args[0]
12183 if o.Op != OpPPC64OR {
12184 break
12185 }
12186 z := o.Args[1]
12187 y := o.Args[0]
12188 if !(o.Uses == 1) {
12189 break
12190 }
12191 v.reset(OpPPC64SETBC)
12192 v.AuxInt = int32ToAuxInt(2)
12193 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12194 v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
12195 v1.AddArg2(y, z)
12196 v0.AddArg(v1)
12197 v.AddArg(v0)
12198 return true
12199 }
12200
12201
12202
12203 for {
12204 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
12205 break
12206 }
12207 a := v_0.Args[0]
12208 if a.Op != OpPPC64XOR {
12209 break
12210 }
12211 z := a.Args[1]
12212 y := a.Args[0]
12213 if !(a.Uses == 1) {
12214 break
12215 }
12216 v.reset(OpPPC64SETBC)
12217 v.AuxInt = int32ToAuxInt(2)
12218 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12219 v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
12220 v1.AddArg2(y, z)
12221 v0.AddArg(v1)
12222 v.AddArg(v0)
12223 return true
12224 }
12225 return false
12226 }
12227 func rewriteValuePPC64_OpPPC64SETBCR(v *Value) bool {
12228 v_0 := v.Args[0]
12229 b := v.Block
12230 typ := &b.Func.Config.Types
12231
12232
12233 for {
12234 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
12235 break
12236 }
12237 v.reset(OpPPC64MOVDconst)
12238 v.AuxInt = int64ToAuxInt(0)
12239 return true
12240 }
12241
12242
12243 for {
12244 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
12245 break
12246 }
12247 v.reset(OpPPC64MOVDconst)
12248 v.AuxInt = int64ToAuxInt(1)
12249 return true
12250 }
12251
12252
12253 for {
12254 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
12255 break
12256 }
12257 v.reset(OpPPC64MOVDconst)
12258 v.AuxInt = int64ToAuxInt(1)
12259 return true
12260 }
12261
12262
12263 for {
12264 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
12265 break
12266 }
12267 v.reset(OpPPC64MOVDconst)
12268 v.AuxInt = int64ToAuxInt(0)
12269 return true
12270 }
12271
12272
12273 for {
12274 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
12275 break
12276 }
12277 v.reset(OpPPC64MOVDconst)
12278 v.AuxInt = int64ToAuxInt(1)
12279 return true
12280 }
12281
12282
12283 for {
12284 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
12285 break
12286 }
12287 v.reset(OpPPC64MOVDconst)
12288 v.AuxInt = int64ToAuxInt(1)
12289 return true
12290 }
12291
12292
12293 for {
12294 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
12295 break
12296 }
12297 v.reset(OpPPC64MOVDconst)
12298 v.AuxInt = int64ToAuxInt(0)
12299 return true
12300 }
12301
12302
12303 for {
12304 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
12305 break
12306 }
12307 v.reset(OpPPC64MOVDconst)
12308 v.AuxInt = int64ToAuxInt(1)
12309 return true
12310 }
12311
12312
12313 for {
12314 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
12315 break
12316 }
12317 v.reset(OpPPC64MOVDconst)
12318 v.AuxInt = int64ToAuxInt(1)
12319 return true
12320 }
12321
12322
12323 for {
12324 if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
12325 break
12326 }
12327 bool := v_0.Args[0]
12328 v.reset(OpPPC64SETBCR)
12329 v.AuxInt = int32ToAuxInt(1)
12330 v.AddArg(bool)
12331 return true
12332 }
12333
12334
12335 for {
12336 if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
12337 break
12338 }
12339 bool := v_0.Args[0]
12340 v.reset(OpPPC64SETBCR)
12341 v.AuxInt = int32ToAuxInt(0)
12342 v.AddArg(bool)
12343 return true
12344 }
12345
12346
12347 for {
12348 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
12349 break
12350 }
12351 bool := v_0.Args[0]
12352 v.reset(OpPPC64SETBCR)
12353 v.AuxInt = int32ToAuxInt(2)
12354 v.AddArg(bool)
12355 return true
12356 }
12357
12358
12359 for {
12360 n := auxIntToInt32(v.AuxInt)
12361 if v_0.Op != OpPPC64InvertFlags {
12362 break
12363 }
12364 bool := v_0.Args[0]
12365 v.reset(OpPPC64SETBC)
12366 v.AuxInt = int32ToAuxInt(n)
12367 v.AddArg(bool)
12368 return true
12369 }
12370
12371
12372 for {
12373 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
12374 break
12375 }
12376 a := v_0.Args[0]
12377 if a.Op != OpPPC64ANDconst || auxIntToInt64(a.AuxInt) != 1 {
12378 break
12379 }
12380 v.copyOf(a)
12381 return true
12382 }
12383
12384
12385
12386 for {
12387 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
12388 break
12389 }
12390 a := v_0.Args[0]
12391 if a.Op != OpPPC64AND {
12392 break
12393 }
12394 z := a.Args[1]
12395 y := a.Args[0]
12396 if !(a.Uses == 1) {
12397 break
12398 }
12399 v.reset(OpPPC64SETBCR)
12400 v.AuxInt = int32ToAuxInt(2)
12401 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12402 v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
12403 v1.AddArg2(y, z)
12404 v0.AddArg(v1)
12405 v.AddArg(v0)
12406 return true
12407 }
12408
12409
12410
12411 for {
12412 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
12413 break
12414 }
12415 o := v_0.Args[0]
12416 if o.Op != OpPPC64OR {
12417 break
12418 }
12419 z := o.Args[1]
12420 y := o.Args[0]
12421 if !(o.Uses == 1) {
12422 break
12423 }
12424 v.reset(OpPPC64SETBCR)
12425 v.AuxInt = int32ToAuxInt(2)
12426 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12427 v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
12428 v1.AddArg2(y, z)
12429 v0.AddArg(v1)
12430 v.AddArg(v0)
12431 return true
12432 }
12433
12434
12435
12436 for {
12437 if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
12438 break
12439 }
12440 a := v_0.Args[0]
12441 if a.Op != OpPPC64XOR {
12442 break
12443 }
12444 z := a.Args[1]
12445 y := a.Args[0]
12446 if !(a.Uses == 1) {
12447 break
12448 }
12449 v.reset(OpPPC64SETBCR)
12450 v.AuxInt = int32ToAuxInt(2)
12451 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
12452 v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
12453 v1.AddArg2(y, z)
12454 v0.AddArg(v1)
12455 v.AddArg(v0)
12456 return true
12457 }
12458 return false
12459 }
12460 func rewriteValuePPC64_OpPPC64SLD(v *Value) bool {
12461 v_1 := v.Args[1]
12462 v_0 := v.Args[0]
12463
12464
12465 for {
12466 x := v_0
12467 if v_1.Op != OpPPC64MOVDconst {
12468 break
12469 }
12470 c := auxIntToInt64(v_1.AuxInt)
12471 v.reset(OpPPC64SLDconst)
12472 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
12473 v.AddArg(x)
12474 return true
12475 }
12476 return false
12477 }
12478 func rewriteValuePPC64_OpPPC64SLDconst(v *Value) bool {
12479 v_0 := v.Args[0]
12480
12481
12482
12483 for {
12484 l := auxIntToInt64(v.AuxInt)
12485 if v_0.Op != OpPPC64SRWconst {
12486 break
12487 }
12488 r := auxIntToInt64(v_0.AuxInt)
12489 x := v_0.Args[0]
12490 if !(mergePPC64SldiSrw(l, r) != 0) {
12491 break
12492 }
12493 v.reset(OpPPC64RLWINM)
12494 v.AuxInt = int64ToAuxInt(mergePPC64SldiSrw(l, r))
12495 v.AddArg(x)
12496 return true
12497 }
12498
12499
12500
12501 for {
12502 s := auxIntToInt64(v.AuxInt)
12503 if v_0.Op != OpPPC64RLWINM {
12504 break
12505 }
12506 r := auxIntToInt64(v_0.AuxInt)
12507 y := v_0.Args[0]
12508 if !(mergePPC64SldiRlwinm(s, r) != 0) {
12509 break
12510 }
12511 v.reset(OpPPC64RLWINM)
12512 v.AuxInt = int64ToAuxInt(mergePPC64SldiRlwinm(s, r))
12513 v.AddArg(y)
12514 return true
12515 }
12516
12517
12518
12519 for {
12520 c := auxIntToInt64(v.AuxInt)
12521 z := v_0
12522 if z.Op != OpPPC64MOVBZreg {
12523 break
12524 }
12525 x := z.Args[0]
12526 if !(c < 8 && z.Uses == 1) {
12527 break
12528 }
12529 v.reset(OpPPC64CLRLSLDI)
12530 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 56, 63, 64))
12531 v.AddArg(x)
12532 return true
12533 }
12534
12535
12536
12537 for {
12538 c := auxIntToInt64(v.AuxInt)
12539 z := v_0
12540 if z.Op != OpPPC64MOVHZreg {
12541 break
12542 }
12543 x := z.Args[0]
12544 if !(c < 16 && z.Uses == 1) {
12545 break
12546 }
12547 v.reset(OpPPC64CLRLSLDI)
12548 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 48, 63, 64))
12549 v.AddArg(x)
12550 return true
12551 }
12552
12553
12554
12555 for {
12556 c := auxIntToInt64(v.AuxInt)
12557 z := v_0
12558 if z.Op != OpPPC64MOVWZreg {
12559 break
12560 }
12561 x := z.Args[0]
12562 if !(c < 32 && z.Uses == 1) {
12563 break
12564 }
12565 v.reset(OpPPC64CLRLSLDI)
12566 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32, 63, 64))
12567 v.AddArg(x)
12568 return true
12569 }
12570
12571
12572
12573 for {
12574 c := auxIntToInt64(v.AuxInt)
12575 z := v_0
12576 if z.Op != OpPPC64ANDconst {
12577 break
12578 }
12579 d := auxIntToInt64(z.AuxInt)
12580 x := z.Args[0]
12581 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
12582 break
12583 }
12584 v.reset(OpPPC64CLRLSLDI)
12585 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
12586 v.AddArg(x)
12587 return true
12588 }
12589
12590
12591
12592 for {
12593 c := auxIntToInt64(v.AuxInt)
12594 z := v_0
12595 if z.Op != OpPPC64AND {
12596 break
12597 }
12598 _ = z.Args[1]
12599 z_0 := z.Args[0]
12600 z_1 := z.Args[1]
12601 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
12602 if z_0.Op != OpPPC64MOVDconst {
12603 continue
12604 }
12605 d := auxIntToInt64(z_0.AuxInt)
12606 x := z_1
12607 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
12608 continue
12609 }
12610 v.reset(OpPPC64CLRLSLDI)
12611 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
12612 v.AddArg(x)
12613 return true
12614 }
12615 break
12616 }
12617
12618
12619
12620 for {
12621 c := auxIntToInt64(v.AuxInt)
12622 if v_0.Op != OpPPC64ADD {
12623 break
12624 }
12625 x := v_0.Args[1]
12626 if x != v_0.Args[0] || !(c < 63) {
12627 break
12628 }
12629 v.reset(OpPPC64SLDconst)
12630 v.AuxInt = int64ToAuxInt(c + 1)
12631 v.AddArg(x)
12632 return true
12633 }
12634
12635
12636
12637 for {
12638 c := auxIntToInt64(v.AuxInt)
12639 z := v_0
12640 if z.Op != OpPPC64MOVWreg {
12641 break
12642 }
12643 x := z.Args[0]
12644 if !(c < 32 && buildcfg.GOPPC64 >= 9) {
12645 break
12646 }
12647 v.reset(OpPPC64EXTSWSLconst)
12648 v.AuxInt = int64ToAuxInt(c)
12649 v.AddArg(x)
12650 return true
12651 }
12652 return false
12653 }
12654 func rewriteValuePPC64_OpPPC64SLW(v *Value) bool {
12655 v_1 := v.Args[1]
12656 v_0 := v.Args[0]
12657
12658
12659 for {
12660 x := v_0
12661 if v_1.Op != OpPPC64MOVDconst {
12662 break
12663 }
12664 c := auxIntToInt64(v_1.AuxInt)
12665 v.reset(OpPPC64SLWconst)
12666 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
12667 v.AddArg(x)
12668 return true
12669 }
12670 return false
12671 }
12672 func rewriteValuePPC64_OpPPC64SLWconst(v *Value) bool {
12673 v_0 := v.Args[0]
12674
12675
12676 for {
12677 s := auxIntToInt64(v.AuxInt)
12678 if v_0.Op != OpPPC64MOVWZreg {
12679 break
12680 }
12681 w := v_0.Args[0]
12682 v.reset(OpPPC64SLWconst)
12683 v.AuxInt = int64ToAuxInt(s)
12684 v.AddArg(w)
12685 return true
12686 }
12687
12688
12689
12690 for {
12691 c := auxIntToInt64(v.AuxInt)
12692 z := v_0
12693 if z.Op != OpPPC64MOVBZreg {
12694 break
12695 }
12696 x := z.Args[0]
12697 if !(z.Uses == 1 && c < 8) {
12698 break
12699 }
12700 v.reset(OpPPC64CLRLSLWI)
12701 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 24, 31, 32))
12702 v.AddArg(x)
12703 return true
12704 }
12705
12706
12707
12708 for {
12709 c := auxIntToInt64(v.AuxInt)
12710 z := v_0
12711 if z.Op != OpPPC64MOVHZreg {
12712 break
12713 }
12714 x := z.Args[0]
12715 if !(z.Uses == 1 && c < 16) {
12716 break
12717 }
12718 v.reset(OpPPC64CLRLSLWI)
12719 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 16, 31, 32))
12720 v.AddArg(x)
12721 return true
12722 }
12723
12724
12725
12726 for {
12727 c := auxIntToInt64(v.AuxInt)
12728 z := v_0
12729 if z.Op != OpPPC64ANDconst {
12730 break
12731 }
12732 d := auxIntToInt64(z.AuxInt)
12733 x := z.Args[0]
12734 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
12735 break
12736 }
12737 v.reset(OpPPC64CLRLSLWI)
12738 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
12739 v.AddArg(x)
12740 return true
12741 }
12742
12743
12744
12745 for {
12746 c := auxIntToInt64(v.AuxInt)
12747 z := v_0
12748 if z.Op != OpPPC64AND {
12749 break
12750 }
12751 _ = z.Args[1]
12752 z_0 := z.Args[0]
12753 z_1 := z.Args[1]
12754 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
12755 if z_0.Op != OpPPC64MOVDconst {
12756 continue
12757 }
12758 d := auxIntToInt64(z_0.AuxInt)
12759 x := z_1
12760 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
12761 continue
12762 }
12763 v.reset(OpPPC64CLRLSLWI)
12764 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
12765 v.AddArg(x)
12766 return true
12767 }
12768 break
12769 }
12770
12771
12772
12773 for {
12774 c := auxIntToInt64(v.AuxInt)
12775 if v_0.Op != OpPPC64ADD {
12776 break
12777 }
12778 x := v_0.Args[1]
12779 if x != v_0.Args[0] || !(c < 31) {
12780 break
12781 }
12782 v.reset(OpPPC64SLWconst)
12783 v.AuxInt = int64ToAuxInt(c + 1)
12784 v.AddArg(x)
12785 return true
12786 }
12787
12788
12789
12790 for {
12791 c := auxIntToInt64(v.AuxInt)
12792 z := v_0
12793 if z.Op != OpPPC64MOVWreg {
12794 break
12795 }
12796 x := z.Args[0]
12797 if !(c < 32 && buildcfg.GOPPC64 >= 9) {
12798 break
12799 }
12800 v.reset(OpPPC64EXTSWSLconst)
12801 v.AuxInt = int64ToAuxInt(c)
12802 v.AddArg(x)
12803 return true
12804 }
12805 return false
12806 }
12807 func rewriteValuePPC64_OpPPC64SRAD(v *Value) bool {
12808 v_1 := v.Args[1]
12809 v_0 := v.Args[0]
12810
12811
12812 for {
12813 x := v_0
12814 if v_1.Op != OpPPC64MOVDconst {
12815 break
12816 }
12817 c := auxIntToInt64(v_1.AuxInt)
12818 v.reset(OpPPC64SRADconst)
12819 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
12820 v.AddArg(x)
12821 return true
12822 }
12823 return false
12824 }
12825 func rewriteValuePPC64_OpPPC64SRAW(v *Value) bool {
12826 v_1 := v.Args[1]
12827 v_0 := v.Args[0]
12828
12829
12830 for {
12831 x := v_0
12832 if v_1.Op != OpPPC64MOVDconst {
12833 break
12834 }
12835 c := auxIntToInt64(v_1.AuxInt)
12836 v.reset(OpPPC64SRAWconst)
12837 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
12838 v.AddArg(x)
12839 return true
12840 }
12841 return false
12842 }
12843 func rewriteValuePPC64_OpPPC64SRD(v *Value) bool {
12844 v_1 := v.Args[1]
12845 v_0 := v.Args[0]
12846
12847
12848 for {
12849 x := v_0
12850 if v_1.Op != OpPPC64MOVDconst {
12851 break
12852 }
12853 c := auxIntToInt64(v_1.AuxInt)
12854 v.reset(OpPPC64SRDconst)
12855 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
12856 v.AddArg(x)
12857 return true
12858 }
12859 return false
12860 }
12861 func rewriteValuePPC64_OpPPC64SRW(v *Value) bool {
12862 v_1 := v.Args[1]
12863 v_0 := v.Args[0]
12864
12865
12866 for {
12867 x := v_0
12868 if v_1.Op != OpPPC64MOVDconst {
12869 break
12870 }
12871 c := auxIntToInt64(v_1.AuxInt)
12872 v.reset(OpPPC64SRWconst)
12873 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
12874 v.AddArg(x)
12875 return true
12876 }
12877 return false
12878 }
12879 func rewriteValuePPC64_OpPPC64SRWconst(v *Value) bool {
12880 v_0 := v.Args[0]
12881
12882
12883
12884 for {
12885 s := auxIntToInt64(v.AuxInt)
12886 if v_0.Op != OpPPC64ANDconst {
12887 break
12888 }
12889 m := auxIntToInt64(v_0.AuxInt)
12890 if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
12891 break
12892 }
12893 v.reset(OpPPC64MOVDconst)
12894 v.AuxInt = int64ToAuxInt(0)
12895 return true
12896 }
12897
12898
12899
12900 for {
12901 s := auxIntToInt64(v.AuxInt)
12902 if v_0.Op != OpPPC64ANDconst {
12903 break
12904 }
12905 m := auxIntToInt64(v_0.AuxInt)
12906 x := v_0.Args[0]
12907 if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
12908 break
12909 }
12910 v.reset(OpPPC64RLWINM)
12911 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
12912 v.AddArg(x)
12913 return true
12914 }
12915
12916
12917
12918 for {
12919 s := auxIntToInt64(v.AuxInt)
12920 if v_0.Op != OpPPC64AND {
12921 break
12922 }
12923 _ = v_0.Args[1]
12924 v_0_0 := v_0.Args[0]
12925 v_0_1 := v_0.Args[1]
12926 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
12927 if v_0_0.Op != OpPPC64MOVDconst {
12928 continue
12929 }
12930 m := auxIntToInt64(v_0_0.AuxInt)
12931 if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
12932 continue
12933 }
12934 v.reset(OpPPC64MOVDconst)
12935 v.AuxInt = int64ToAuxInt(0)
12936 return true
12937 }
12938 break
12939 }
12940
12941
12942
12943 for {
12944 s := auxIntToInt64(v.AuxInt)
12945 if v_0.Op != OpPPC64AND {
12946 break
12947 }
12948 _ = v_0.Args[1]
12949 v_0_0 := v_0.Args[0]
12950 v_0_1 := v_0.Args[1]
12951 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
12952 if v_0_0.Op != OpPPC64MOVDconst {
12953 continue
12954 }
12955 m := auxIntToInt64(v_0_0.AuxInt)
12956 x := v_0_1
12957 if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
12958 continue
12959 }
12960 v.reset(OpPPC64RLWINM)
12961 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
12962 v.AddArg(x)
12963 return true
12964 }
12965 break
12966 }
12967 return false
12968 }
12969 func rewriteValuePPC64_OpPPC64SUB(v *Value) bool {
12970 v_1 := v.Args[1]
12971 v_0 := v.Args[0]
12972
12973
12974
12975 for {
12976 x := v_0
12977 if v_1.Op != OpPPC64MOVDconst {
12978 break
12979 }
12980 c := auxIntToInt64(v_1.AuxInt)
12981 if !(is32Bit(-c)) {
12982 break
12983 }
12984 v.reset(OpPPC64ADDconst)
12985 v.AuxInt = int64ToAuxInt(-c)
12986 v.AddArg(x)
12987 return true
12988 }
12989
12990
12991
12992 for {
12993 if v_0.Op != OpPPC64MOVDconst {
12994 break
12995 }
12996 c := auxIntToInt64(v_0.AuxInt)
12997 x := v_1
12998 if !(is32Bit(c)) {
12999 break
13000 }
13001 v.reset(OpPPC64SUBFCconst)
13002 v.AuxInt = int64ToAuxInt(c)
13003 v.AddArg(x)
13004 return true
13005 }
13006 return false
13007 }
13008 func rewriteValuePPC64_OpPPC64SUBE(v *Value) bool {
13009 v_2 := v.Args[2]
13010 v_1 := v.Args[1]
13011 v_0 := v.Args[0]
13012 b := v.Block
13013 typ := &b.Func.Config.Types
13014
13015
13016 for {
13017 x := v_0
13018 y := v_1
13019 if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
13020 break
13021 }
13022 v_2_0 := v_2.Args[0]
13023 if v_2_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_2_0.AuxInt) != 0 {
13024 break
13025 }
13026 v_2_0_0 := v_2_0.Args[0]
13027 if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
13028 break
13029 }
13030 v.reset(OpPPC64SUBC)
13031 v.AddArg2(x, y)
13032 return true
13033 }
13034 return false
13035 }
13036 func rewriteValuePPC64_OpPPC64SUBFCconst(v *Value) bool {
13037 v_0 := v.Args[0]
13038
13039
13040 for {
13041 c := auxIntToInt64(v.AuxInt)
13042 if v_0.Op != OpPPC64NEG {
13043 break
13044 }
13045 x := v_0.Args[0]
13046 v.reset(OpPPC64ADDconst)
13047 v.AuxInt = int64ToAuxInt(c)
13048 v.AddArg(x)
13049 return true
13050 }
13051
13052
13053
13054 for {
13055 c := auxIntToInt64(v.AuxInt)
13056 if v_0.Op != OpPPC64SUBFCconst {
13057 break
13058 }
13059 d := auxIntToInt64(v_0.AuxInt)
13060 x := v_0.Args[0]
13061 if !(is32Bit(c - d)) {
13062 break
13063 }
13064 v.reset(OpPPC64ADDconst)
13065 v.AuxInt = int64ToAuxInt(c - d)
13066 v.AddArg(x)
13067 return true
13068 }
13069
13070
13071 for {
13072 if auxIntToInt64(v.AuxInt) != 0 {
13073 break
13074 }
13075 x := v_0
13076 v.reset(OpPPC64NEG)
13077 v.AddArg(x)
13078 return true
13079 }
13080 return false
13081 }
13082 func rewriteValuePPC64_OpPPC64XOR(v *Value) bool {
13083 v_1 := v.Args[1]
13084 v_0 := v.Args[0]
13085
13086
13087 for {
13088 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13089 if v_0.Op != OpPPC64MOVDconst {
13090 continue
13091 }
13092 c := auxIntToInt64(v_0.AuxInt)
13093 if v_1.Op != OpPPC64MOVDconst {
13094 continue
13095 }
13096 d := auxIntToInt64(v_1.AuxInt)
13097 v.reset(OpPPC64MOVDconst)
13098 v.AuxInt = int64ToAuxInt(c ^ d)
13099 return true
13100 }
13101 break
13102 }
13103
13104
13105
13106 for {
13107 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13108 x := v_0
13109 if v_1.Op != OpPPC64MOVDconst {
13110 continue
13111 }
13112 c := auxIntToInt64(v_1.AuxInt)
13113 if !(isU32Bit(c)) {
13114 continue
13115 }
13116 v.reset(OpPPC64XORconst)
13117 v.AuxInt = int64ToAuxInt(c)
13118 v.AddArg(x)
13119 return true
13120 }
13121 break
13122 }
13123 return false
13124 }
13125 func rewriteValuePPC64_OpPPC64XORconst(v *Value) bool {
13126 v_0 := v.Args[0]
13127
13128
13129 for {
13130 c := auxIntToInt64(v.AuxInt)
13131 if v_0.Op != OpPPC64XORconst {
13132 break
13133 }
13134 d := auxIntToInt64(v_0.AuxInt)
13135 x := v_0.Args[0]
13136 v.reset(OpPPC64XORconst)
13137 v.AuxInt = int64ToAuxInt(c ^ d)
13138 v.AddArg(x)
13139 return true
13140 }
13141
13142
13143 for {
13144 if auxIntToInt64(v.AuxInt) != 0 {
13145 break
13146 }
13147 x := v_0
13148 v.copyOf(x)
13149 return true
13150 }
13151
13152
13153 for {
13154 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBCR {
13155 break
13156 }
13157 n := auxIntToInt32(v_0.AuxInt)
13158 cmp := v_0.Args[0]
13159 v.reset(OpPPC64SETBC)
13160 v.AuxInt = int32ToAuxInt(n)
13161 v.AddArg(cmp)
13162 return true
13163 }
13164
13165
13166 for {
13167 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBC {
13168 break
13169 }
13170 n := auxIntToInt32(v_0.AuxInt)
13171 cmp := v_0.Args[0]
13172 v.reset(OpPPC64SETBCR)
13173 v.AuxInt = int32ToAuxInt(n)
13174 v.AddArg(cmp)
13175 return true
13176 }
13177 return false
13178 }
13179 func rewriteValuePPC64_OpPopCount16(v *Value) bool {
13180 v_0 := v.Args[0]
13181 b := v.Block
13182 typ := &b.Func.Config.Types
13183
13184
13185 for {
13186 x := v_0
13187 v.reset(OpPPC64POPCNTW)
13188 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13189 v0.AddArg(x)
13190 v.AddArg(v0)
13191 return true
13192 }
13193 }
13194 func rewriteValuePPC64_OpPopCount32(v *Value) bool {
13195 v_0 := v.Args[0]
13196 b := v.Block
13197 typ := &b.Func.Config.Types
13198
13199
13200 for {
13201 x := v_0
13202 v.reset(OpPPC64POPCNTW)
13203 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
13204 v0.AddArg(x)
13205 v.AddArg(v0)
13206 return true
13207 }
13208 }
13209 func rewriteValuePPC64_OpPopCount8(v *Value) bool {
13210 v_0 := v.Args[0]
13211 b := v.Block
13212 typ := &b.Func.Config.Types
13213
13214
13215 for {
13216 x := v_0
13217 v.reset(OpPPC64POPCNTB)
13218 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
13219 v0.AddArg(x)
13220 v.AddArg(v0)
13221 return true
13222 }
13223 }
13224 func rewriteValuePPC64_OpPrefetchCache(v *Value) bool {
13225 v_1 := v.Args[1]
13226 v_0 := v.Args[0]
13227
13228
13229 for {
13230 ptr := v_0
13231 mem := v_1
13232 v.reset(OpPPC64DCBT)
13233 v.AuxInt = int64ToAuxInt(0)
13234 v.AddArg2(ptr, mem)
13235 return true
13236 }
13237 }
13238 func rewriteValuePPC64_OpPrefetchCacheStreamed(v *Value) bool {
13239 v_1 := v.Args[1]
13240 v_0 := v.Args[0]
13241
13242
13243 for {
13244 ptr := v_0
13245 mem := v_1
13246 v.reset(OpPPC64DCBT)
13247 v.AuxInt = int64ToAuxInt(16)
13248 v.AddArg2(ptr, mem)
13249 return true
13250 }
13251 }
13252 func rewriteValuePPC64_OpRotateLeft16(v *Value) bool {
13253 v_1 := v.Args[1]
13254 v_0 := v.Args[0]
13255 b := v.Block
13256 typ := &b.Func.Config.Types
13257
13258
13259 for {
13260 t := v.Type
13261 x := v_0
13262 if v_1.Op != OpPPC64MOVDconst {
13263 break
13264 }
13265 c := auxIntToInt64(v_1.AuxInt)
13266 v.reset(OpOr16)
13267 v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
13268 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13269 v1.AuxInt = int64ToAuxInt(c & 15)
13270 v0.AddArg2(x, v1)
13271 v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
13272 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13273 v3.AuxInt = int64ToAuxInt(-c & 15)
13274 v2.AddArg2(x, v3)
13275 v.AddArg2(v0, v2)
13276 return true
13277 }
13278 return false
13279 }
13280 func rewriteValuePPC64_OpRotateLeft8(v *Value) bool {
13281 v_1 := v.Args[1]
13282 v_0 := v.Args[0]
13283 b := v.Block
13284 typ := &b.Func.Config.Types
13285
13286
13287 for {
13288 t := v.Type
13289 x := v_0
13290 if v_1.Op != OpPPC64MOVDconst {
13291 break
13292 }
13293 c := auxIntToInt64(v_1.AuxInt)
13294 v.reset(OpOr8)
13295 v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
13296 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13297 v1.AuxInt = int64ToAuxInt(c & 7)
13298 v0.AddArg2(x, v1)
13299 v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
13300 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13301 v3.AuxInt = int64ToAuxInt(-c & 7)
13302 v2.AddArg2(x, v3)
13303 v.AddArg2(v0, v2)
13304 return true
13305 }
13306 return false
13307 }
13308 func rewriteValuePPC64_OpRsh16Ux16(v *Value) bool {
13309 v_1 := v.Args[1]
13310 v_0 := v.Args[0]
13311 b := v.Block
13312 typ := &b.Func.Config.Types
13313
13314
13315
13316 for {
13317 x := v_0
13318 y := v_1
13319 if !(shiftIsBounded(v)) {
13320 break
13321 }
13322 v.reset(OpPPC64SRD)
13323 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13324 v0.AddArg(x)
13325 v.AddArg2(v0, y)
13326 return true
13327 }
13328
13329
13330 for {
13331 t := v.Type
13332 x := v_0
13333 y := v_1
13334 v.reset(OpPPC64ISEL)
13335 v.AuxInt = int32ToAuxInt(2)
13336 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13337 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13338 v1.AddArg(x)
13339 v0.AddArg2(v1, y)
13340 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13341 v2.AuxInt = int64ToAuxInt(0)
13342 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13343 v3.AuxInt = int64ToAuxInt(0)
13344 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13345 v4.AuxInt = int64ToAuxInt(0xFFF0)
13346 v4.AddArg(y)
13347 v3.AddArg(v4)
13348 v.AddArg3(v0, v2, v3)
13349 return true
13350 }
13351 }
13352 func rewriteValuePPC64_OpRsh16Ux32(v *Value) bool {
13353 v_1 := v.Args[1]
13354 v_0 := v.Args[0]
13355 b := v.Block
13356 typ := &b.Func.Config.Types
13357
13358
13359
13360 for {
13361 x := v_0
13362 y := v_1
13363 if !(shiftIsBounded(v)) {
13364 break
13365 }
13366 v.reset(OpPPC64SRD)
13367 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13368 v0.AddArg(x)
13369 v.AddArg2(v0, y)
13370 return true
13371 }
13372
13373
13374 for {
13375 t := v.Type
13376 x := v_0
13377 y := v_1
13378 v.reset(OpPPC64ISEL)
13379 v.AuxInt = int32ToAuxInt(0)
13380 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13381 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13382 v1.AddArg(x)
13383 v0.AddArg2(v1, y)
13384 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13385 v2.AuxInt = int64ToAuxInt(0)
13386 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13387 v3.AuxInt = int32ToAuxInt(16)
13388 v3.AddArg(y)
13389 v.AddArg3(v0, v2, v3)
13390 return true
13391 }
13392 }
13393 func rewriteValuePPC64_OpRsh16Ux64(v *Value) bool {
13394 v_1 := v.Args[1]
13395 v_0 := v.Args[0]
13396 b := v.Block
13397 typ := &b.Func.Config.Types
13398
13399
13400
13401 for {
13402 x := v_0
13403 if v_1.Op != OpPPC64MOVDconst {
13404 break
13405 }
13406 c := auxIntToInt64(v_1.AuxInt)
13407 if !(uint64(c) < 16) {
13408 break
13409 }
13410 v.reset(OpPPC64SRWconst)
13411 v.AuxInt = int64ToAuxInt(c)
13412 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
13413 v0.AddArg(x)
13414 v.AddArg(v0)
13415 return true
13416 }
13417
13418
13419
13420 for {
13421 x := v_0
13422 y := v_1
13423 if !(shiftIsBounded(v)) {
13424 break
13425 }
13426 v.reset(OpPPC64SRD)
13427 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13428 v0.AddArg(x)
13429 v.AddArg2(v0, y)
13430 return true
13431 }
13432
13433
13434 for {
13435 t := v.Type
13436 x := v_0
13437 y := v_1
13438 v.reset(OpPPC64ISEL)
13439 v.AuxInt = int32ToAuxInt(0)
13440 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13441 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13442 v1.AddArg(x)
13443 v0.AddArg2(v1, y)
13444 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13445 v2.AuxInt = int64ToAuxInt(0)
13446 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13447 v3.AuxInt = int64ToAuxInt(16)
13448 v3.AddArg(y)
13449 v.AddArg3(v0, v2, v3)
13450 return true
13451 }
13452 }
13453 func rewriteValuePPC64_OpRsh16Ux8(v *Value) bool {
13454 v_1 := v.Args[1]
13455 v_0 := v.Args[0]
13456 b := v.Block
13457 typ := &b.Func.Config.Types
13458
13459
13460
13461 for {
13462 x := v_0
13463 y := v_1
13464 if !(shiftIsBounded(v)) {
13465 break
13466 }
13467 v.reset(OpPPC64SRD)
13468 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13469 v0.AddArg(x)
13470 v.AddArg2(v0, y)
13471 return true
13472 }
13473
13474
13475 for {
13476 t := v.Type
13477 x := v_0
13478 y := v_1
13479 v.reset(OpPPC64ISEL)
13480 v.AuxInt = int32ToAuxInt(2)
13481 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13482 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13483 v1.AddArg(x)
13484 v0.AddArg2(v1, y)
13485 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13486 v2.AuxInt = int64ToAuxInt(0)
13487 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13488 v3.AuxInt = int64ToAuxInt(0)
13489 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13490 v4.AuxInt = int64ToAuxInt(0x00F0)
13491 v4.AddArg(y)
13492 v3.AddArg(v4)
13493 v.AddArg3(v0, v2, v3)
13494 return true
13495 }
13496 }
13497 func rewriteValuePPC64_OpRsh16x16(v *Value) bool {
13498 v_1 := v.Args[1]
13499 v_0 := v.Args[0]
13500 b := v.Block
13501 typ := &b.Func.Config.Types
13502
13503
13504
13505 for {
13506 x := v_0
13507 y := v_1
13508 if !(shiftIsBounded(v)) {
13509 break
13510 }
13511 v.reset(OpPPC64SRAD)
13512 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13513 v0.AddArg(x)
13514 v.AddArg2(v0, y)
13515 return true
13516 }
13517
13518
13519 for {
13520 t := v.Type
13521 x := v_0
13522 y := v_1
13523 v.reset(OpPPC64ISEL)
13524 v.AuxInt = int32ToAuxInt(2)
13525 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13526 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13527 v1.AddArg(x)
13528 v0.AddArg2(v1, y)
13529 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13530 v2.AuxInt = int64ToAuxInt(15)
13531 v2.AddArg(v1)
13532 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13533 v3.AuxInt = int64ToAuxInt(0)
13534 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13535 v4.AuxInt = int64ToAuxInt(0xFFF0)
13536 v4.AddArg(y)
13537 v3.AddArg(v4)
13538 v.AddArg3(v0, v2, v3)
13539 return true
13540 }
13541 }
13542 func rewriteValuePPC64_OpRsh16x32(v *Value) bool {
13543 v_1 := v.Args[1]
13544 v_0 := v.Args[0]
13545 b := v.Block
13546 typ := &b.Func.Config.Types
13547
13548
13549
13550 for {
13551 x := v_0
13552 y := v_1
13553 if !(shiftIsBounded(v)) {
13554 break
13555 }
13556 v.reset(OpPPC64SRAD)
13557 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13558 v0.AddArg(x)
13559 v.AddArg2(v0, y)
13560 return true
13561 }
13562
13563
13564 for {
13565 t := v.Type
13566 x := v_0
13567 y := v_1
13568 v.reset(OpPPC64ISEL)
13569 v.AuxInt = int32ToAuxInt(0)
13570 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13571 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13572 v1.AddArg(x)
13573 v0.AddArg2(v1, y)
13574 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13575 v2.AuxInt = int64ToAuxInt(15)
13576 v2.AddArg(v1)
13577 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13578 v3.AuxInt = int32ToAuxInt(16)
13579 v3.AddArg(y)
13580 v.AddArg3(v0, v2, v3)
13581 return true
13582 }
13583 }
13584 func rewriteValuePPC64_OpRsh16x64(v *Value) bool {
13585 v_1 := v.Args[1]
13586 v_0 := v.Args[0]
13587 b := v.Block
13588 typ := &b.Func.Config.Types
13589
13590
13591
13592 for {
13593 x := v_0
13594 if v_1.Op != OpPPC64MOVDconst {
13595 break
13596 }
13597 c := auxIntToInt64(v_1.AuxInt)
13598 if !(uint64(c) >= 16) {
13599 break
13600 }
13601 v.reset(OpPPC64SRAWconst)
13602 v.AuxInt = int64ToAuxInt(63)
13603 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
13604 v0.AddArg(x)
13605 v.AddArg(v0)
13606 return true
13607 }
13608
13609
13610
13611 for {
13612 x := v_0
13613 if v_1.Op != OpPPC64MOVDconst {
13614 break
13615 }
13616 c := auxIntToInt64(v_1.AuxInt)
13617 if !(uint64(c) < 16) {
13618 break
13619 }
13620 v.reset(OpPPC64SRAWconst)
13621 v.AuxInt = int64ToAuxInt(c)
13622 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
13623 v0.AddArg(x)
13624 v.AddArg(v0)
13625 return true
13626 }
13627
13628
13629
13630 for {
13631 x := v_0
13632 y := v_1
13633 if !(shiftIsBounded(v)) {
13634 break
13635 }
13636 v.reset(OpPPC64SRAD)
13637 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13638 v0.AddArg(x)
13639 v.AddArg2(v0, y)
13640 return true
13641 }
13642
13643
13644 for {
13645 t := v.Type
13646 x := v_0
13647 y := v_1
13648 v.reset(OpPPC64ISEL)
13649 v.AuxInt = int32ToAuxInt(0)
13650 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13651 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13652 v1.AddArg(x)
13653 v0.AddArg2(v1, y)
13654 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13655 v2.AuxInt = int64ToAuxInt(15)
13656 v2.AddArg(v1)
13657 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13658 v3.AuxInt = int64ToAuxInt(16)
13659 v3.AddArg(y)
13660 v.AddArg3(v0, v2, v3)
13661 return true
13662 }
13663 }
13664 func rewriteValuePPC64_OpRsh16x8(v *Value) bool {
13665 v_1 := v.Args[1]
13666 v_0 := v.Args[0]
13667 b := v.Block
13668 typ := &b.Func.Config.Types
13669
13670
13671
13672 for {
13673 x := v_0
13674 y := v_1
13675 if !(shiftIsBounded(v)) {
13676 break
13677 }
13678 v.reset(OpPPC64SRAD)
13679 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13680 v0.AddArg(x)
13681 v.AddArg2(v0, y)
13682 return true
13683 }
13684
13685
13686 for {
13687 t := v.Type
13688 x := v_0
13689 y := v_1
13690 v.reset(OpPPC64ISEL)
13691 v.AuxInt = int32ToAuxInt(2)
13692 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13693 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13694 v1.AddArg(x)
13695 v0.AddArg2(v1, y)
13696 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13697 v2.AuxInt = int64ToAuxInt(15)
13698 v2.AddArg(v1)
13699 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13700 v3.AuxInt = int64ToAuxInt(0)
13701 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13702 v4.AuxInt = int64ToAuxInt(0x00F0)
13703 v4.AddArg(y)
13704 v3.AddArg(v4)
13705 v.AddArg3(v0, v2, v3)
13706 return true
13707 }
13708 }
13709 func rewriteValuePPC64_OpRsh32Ux16(v *Value) bool {
13710 v_1 := v.Args[1]
13711 v_0 := v.Args[0]
13712 b := v.Block
13713 typ := &b.Func.Config.Types
13714
13715
13716
13717 for {
13718 x := v_0
13719 y := v_1
13720 if !(shiftIsBounded(v)) {
13721 break
13722 }
13723 v.reset(OpPPC64SRW)
13724 v.AddArg2(x, y)
13725 return true
13726 }
13727
13728
13729 for {
13730 t := v.Type
13731 x := v_0
13732 y := v_1
13733 v.reset(OpPPC64ISEL)
13734 v.AuxInt = int32ToAuxInt(2)
13735 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13736 v0.AddArg2(x, y)
13737 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13738 v1.AuxInt = int64ToAuxInt(0)
13739 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13740 v2.AuxInt = int64ToAuxInt(0)
13741 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13742 v3.AuxInt = int64ToAuxInt(0xFFE0)
13743 v3.AddArg(y)
13744 v2.AddArg(v3)
13745 v.AddArg3(v0, v1, v2)
13746 return true
13747 }
13748 }
13749 func rewriteValuePPC64_OpRsh32Ux32(v *Value) bool {
13750 v_1 := v.Args[1]
13751 v_0 := v.Args[0]
13752 b := v.Block
13753 typ := &b.Func.Config.Types
13754
13755
13756
13757 for {
13758 x := v_0
13759 y := v_1
13760 if !(shiftIsBounded(v)) {
13761 break
13762 }
13763 v.reset(OpPPC64SRW)
13764 v.AddArg2(x, y)
13765 return true
13766 }
13767
13768
13769 for {
13770 t := v.Type
13771 x := v_0
13772 y := v_1
13773 v.reset(OpPPC64ISEL)
13774 v.AuxInt = int32ToAuxInt(0)
13775 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13776 v0.AddArg2(x, y)
13777 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13778 v1.AuxInt = int64ToAuxInt(0)
13779 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13780 v2.AuxInt = int32ToAuxInt(32)
13781 v2.AddArg(y)
13782 v.AddArg3(v0, v1, v2)
13783 return true
13784 }
13785 }
13786 func rewriteValuePPC64_OpRsh32Ux64(v *Value) bool {
13787 v_1 := v.Args[1]
13788 v_0 := v.Args[0]
13789 b := v.Block
13790 typ := &b.Func.Config.Types
13791
13792
13793
13794 for {
13795 x := v_0
13796 if v_1.Op != OpPPC64MOVDconst {
13797 break
13798 }
13799 c := auxIntToInt64(v_1.AuxInt)
13800 if !(uint64(c) < 32) {
13801 break
13802 }
13803 v.reset(OpPPC64SRWconst)
13804 v.AuxInt = int64ToAuxInt(c)
13805 v.AddArg(x)
13806 return true
13807 }
13808
13809
13810
13811 for {
13812 x := v_0
13813 y := v_1
13814 if !(shiftIsBounded(v)) {
13815 break
13816 }
13817 v.reset(OpPPC64SRW)
13818 v.AddArg2(x, y)
13819 return true
13820 }
13821
13822
13823 for {
13824 t := v.Type
13825 x := v_0
13826 y := v_1
13827 v.reset(OpPPC64ISEL)
13828 v.AuxInt = int32ToAuxInt(0)
13829 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13830 v0.AddArg2(x, y)
13831 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13832 v1.AuxInt = int64ToAuxInt(0)
13833 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13834 v2.AuxInt = int64ToAuxInt(32)
13835 v2.AddArg(y)
13836 v.AddArg3(v0, v1, v2)
13837 return true
13838 }
13839 }
13840 func rewriteValuePPC64_OpRsh32Ux8(v *Value) bool {
13841 v_1 := v.Args[1]
13842 v_0 := v.Args[0]
13843 b := v.Block
13844 typ := &b.Func.Config.Types
13845
13846
13847
13848 for {
13849 x := v_0
13850 y := v_1
13851 if !(shiftIsBounded(v)) {
13852 break
13853 }
13854 v.reset(OpPPC64SRW)
13855 v.AddArg2(x, y)
13856 return true
13857 }
13858
13859
13860 for {
13861 t := v.Type
13862 x := v_0
13863 y := v_1
13864 v.reset(OpPPC64ISEL)
13865 v.AuxInt = int32ToAuxInt(2)
13866 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13867 v0.AddArg2(x, y)
13868 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13869 v1.AuxInt = int64ToAuxInt(0)
13870 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13871 v2.AuxInt = int64ToAuxInt(0)
13872 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13873 v3.AuxInt = int64ToAuxInt(0x00E0)
13874 v3.AddArg(y)
13875 v2.AddArg(v3)
13876 v.AddArg3(v0, v1, v2)
13877 return true
13878 }
13879 }
13880 func rewriteValuePPC64_OpRsh32x16(v *Value) bool {
13881 v_1 := v.Args[1]
13882 v_0 := v.Args[0]
13883 b := v.Block
13884 typ := &b.Func.Config.Types
13885
13886
13887
13888 for {
13889 x := v_0
13890 y := v_1
13891 if !(shiftIsBounded(v)) {
13892 break
13893 }
13894 v.reset(OpPPC64SRAW)
13895 v.AddArg2(x, y)
13896 return true
13897 }
13898
13899
13900 for {
13901 t := v.Type
13902 x := v_0
13903 y := v_1
13904 v.reset(OpPPC64ISEL)
13905 v.AuxInt = int32ToAuxInt(2)
13906 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
13907 v0.AddArg2(x, y)
13908 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
13909 v1.AuxInt = int64ToAuxInt(31)
13910 v1.AddArg(x)
13911 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13912 v2.AuxInt = int64ToAuxInt(0)
13913 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13914 v3.AuxInt = int64ToAuxInt(0xFFE0)
13915 v3.AddArg(y)
13916 v2.AddArg(v3)
13917 v.AddArg3(v0, v1, v2)
13918 return true
13919 }
13920 }
13921 func rewriteValuePPC64_OpRsh32x32(v *Value) bool {
13922 v_1 := v.Args[1]
13923 v_0 := v.Args[0]
13924 b := v.Block
13925
13926
13927
13928 for {
13929 x := v_0
13930 y := v_1
13931 if !(shiftIsBounded(v)) {
13932 break
13933 }
13934 v.reset(OpPPC64SRAW)
13935 v.AddArg2(x, y)
13936 return true
13937 }
13938
13939
13940 for {
13941 t := v.Type
13942 x := v_0
13943 y := v_1
13944 v.reset(OpPPC64ISEL)
13945 v.AuxInt = int32ToAuxInt(0)
13946 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
13947 v0.AddArg2(x, y)
13948 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
13949 v1.AuxInt = int64ToAuxInt(31)
13950 v1.AddArg(x)
13951 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13952 v2.AuxInt = int32ToAuxInt(32)
13953 v2.AddArg(y)
13954 v.AddArg3(v0, v1, v2)
13955 return true
13956 }
13957 }
13958 func rewriteValuePPC64_OpRsh32x64(v *Value) bool {
13959 v_1 := v.Args[1]
13960 v_0 := v.Args[0]
13961 b := v.Block
13962
13963
13964
13965 for {
13966 x := v_0
13967 if v_1.Op != OpPPC64MOVDconst {
13968 break
13969 }
13970 c := auxIntToInt64(v_1.AuxInt)
13971 if !(uint64(c) >= 32) {
13972 break
13973 }
13974 v.reset(OpPPC64SRAWconst)
13975 v.AuxInt = int64ToAuxInt(63)
13976 v.AddArg(x)
13977 return true
13978 }
13979
13980
13981
13982 for {
13983 x := v_0
13984 if v_1.Op != OpPPC64MOVDconst {
13985 break
13986 }
13987 c := auxIntToInt64(v_1.AuxInt)
13988 if !(uint64(c) < 32) {
13989 break
13990 }
13991 v.reset(OpPPC64SRAWconst)
13992 v.AuxInt = int64ToAuxInt(c)
13993 v.AddArg(x)
13994 return true
13995 }
13996
13997
13998
13999 for {
14000 x := v_0
14001 y := v_1
14002 if !(shiftIsBounded(v)) {
14003 break
14004 }
14005 v.reset(OpPPC64SRAW)
14006 v.AddArg2(x, y)
14007 return true
14008 }
14009
14010
14011 for {
14012 t := v.Type
14013 x := v_0
14014 y := v_1
14015 v.reset(OpPPC64ISEL)
14016 v.AuxInt = int32ToAuxInt(0)
14017 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
14018 v0.AddArg2(x, y)
14019 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
14020 v1.AuxInt = int64ToAuxInt(31)
14021 v1.AddArg(x)
14022 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
14023 v2.AuxInt = int64ToAuxInt(32)
14024 v2.AddArg(y)
14025 v.AddArg3(v0, v1, v2)
14026 return true
14027 }
14028 }
14029 func rewriteValuePPC64_OpRsh32x8(v *Value) bool {
14030 v_1 := v.Args[1]
14031 v_0 := v.Args[0]
14032 b := v.Block
14033 typ := &b.Func.Config.Types
14034
14035
14036
14037 for {
14038 x := v_0
14039 y := v_1
14040 if !(shiftIsBounded(v)) {
14041 break
14042 }
14043 v.reset(OpPPC64SRAW)
14044 v.AddArg2(x, y)
14045 return true
14046 }
14047
14048
14049 for {
14050 t := v.Type
14051 x := v_0
14052 y := v_1
14053 v.reset(OpPPC64ISEL)
14054 v.AuxInt = int32ToAuxInt(2)
14055 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
14056 v0.AddArg2(x, y)
14057 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
14058 v1.AuxInt = int64ToAuxInt(31)
14059 v1.AddArg(x)
14060 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14061 v2.AuxInt = int64ToAuxInt(0)
14062 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14063 v3.AuxInt = int64ToAuxInt(0x00E0)
14064 v3.AddArg(y)
14065 v2.AddArg(v3)
14066 v.AddArg3(v0, v1, v2)
14067 return true
14068 }
14069 }
14070 func rewriteValuePPC64_OpRsh64Ux16(v *Value) bool {
14071 v_1 := v.Args[1]
14072 v_0 := v.Args[0]
14073 b := v.Block
14074 typ := &b.Func.Config.Types
14075
14076
14077
14078 for {
14079 x := v_0
14080 y := v_1
14081 if !(shiftIsBounded(v)) {
14082 break
14083 }
14084 v.reset(OpPPC64SRD)
14085 v.AddArg2(x, y)
14086 return true
14087 }
14088
14089
14090 for {
14091 t := v.Type
14092 x := v_0
14093 y := v_1
14094 v.reset(OpPPC64ISEL)
14095 v.AuxInt = int32ToAuxInt(2)
14096 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14097 v0.AddArg2(x, y)
14098 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14099 v1.AuxInt = int64ToAuxInt(0)
14100 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14101 v2.AuxInt = int64ToAuxInt(0)
14102 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14103 v3.AuxInt = int64ToAuxInt(0xFFC0)
14104 v3.AddArg(y)
14105 v2.AddArg(v3)
14106 v.AddArg3(v0, v1, v2)
14107 return true
14108 }
14109 }
14110 func rewriteValuePPC64_OpRsh64Ux32(v *Value) bool {
14111 v_1 := v.Args[1]
14112 v_0 := v.Args[0]
14113 b := v.Block
14114 typ := &b.Func.Config.Types
14115
14116
14117
14118 for {
14119 x := v_0
14120 y := v_1
14121 if !(shiftIsBounded(v)) {
14122 break
14123 }
14124 v.reset(OpPPC64SRD)
14125 v.AddArg2(x, y)
14126 return true
14127 }
14128
14129
14130 for {
14131 t := v.Type
14132 x := v_0
14133 y := v_1
14134 v.reset(OpPPC64ISEL)
14135 v.AuxInt = int32ToAuxInt(0)
14136 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14137 v0.AddArg2(x, y)
14138 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14139 v1.AuxInt = int64ToAuxInt(0)
14140 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
14141 v2.AuxInt = int32ToAuxInt(64)
14142 v2.AddArg(y)
14143 v.AddArg3(v0, v1, v2)
14144 return true
14145 }
14146 }
14147 func rewriteValuePPC64_OpRsh64Ux64(v *Value) bool {
14148 v_1 := v.Args[1]
14149 v_0 := v.Args[0]
14150 b := v.Block
14151 typ := &b.Func.Config.Types
14152
14153
14154
14155 for {
14156 x := v_0
14157 if v_1.Op != OpPPC64MOVDconst {
14158 break
14159 }
14160 c := auxIntToInt64(v_1.AuxInt)
14161 if !(uint64(c) < 64) {
14162 break
14163 }
14164 v.reset(OpPPC64SRDconst)
14165 v.AuxInt = int64ToAuxInt(c)
14166 v.AddArg(x)
14167 return true
14168 }
14169
14170
14171
14172 for {
14173 x := v_0
14174 y := v_1
14175 if !(shiftIsBounded(v)) {
14176 break
14177 }
14178 v.reset(OpPPC64SRD)
14179 v.AddArg2(x, y)
14180 return true
14181 }
14182
14183
14184 for {
14185 t := v.Type
14186 x := v_0
14187 y := v_1
14188 v.reset(OpPPC64ISEL)
14189 v.AuxInt = int32ToAuxInt(0)
14190 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14191 v0.AddArg2(x, y)
14192 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14193 v1.AuxInt = int64ToAuxInt(0)
14194 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
14195 v2.AuxInt = int64ToAuxInt(64)
14196 v2.AddArg(y)
14197 v.AddArg3(v0, v1, v2)
14198 return true
14199 }
14200 }
14201 func rewriteValuePPC64_OpRsh64Ux8(v *Value) bool {
14202 v_1 := v.Args[1]
14203 v_0 := v.Args[0]
14204 b := v.Block
14205 typ := &b.Func.Config.Types
14206
14207
14208
14209 for {
14210 x := v_0
14211 y := v_1
14212 if !(shiftIsBounded(v)) {
14213 break
14214 }
14215 v.reset(OpPPC64SRD)
14216 v.AddArg2(x, y)
14217 return true
14218 }
14219
14220
14221 for {
14222 t := v.Type
14223 x := v_0
14224 y := v_1
14225 v.reset(OpPPC64ISEL)
14226 v.AuxInt = int32ToAuxInt(2)
14227 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14228 v0.AddArg2(x, y)
14229 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14230 v1.AuxInt = int64ToAuxInt(0)
14231 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14232 v2.AuxInt = int64ToAuxInt(0)
14233 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14234 v3.AuxInt = int64ToAuxInt(0x00C0)
14235 v3.AddArg(y)
14236 v2.AddArg(v3)
14237 v.AddArg3(v0, v1, v2)
14238 return true
14239 }
14240 }
14241 func rewriteValuePPC64_OpRsh64x16(v *Value) bool {
14242 v_1 := v.Args[1]
14243 v_0 := v.Args[0]
14244 b := v.Block
14245 typ := &b.Func.Config.Types
14246
14247
14248
14249 for {
14250 x := v_0
14251 y := v_1
14252 if !(shiftIsBounded(v)) {
14253 break
14254 }
14255 v.reset(OpPPC64SRAD)
14256 v.AddArg2(x, y)
14257 return true
14258 }
14259
14260
14261 for {
14262 t := v.Type
14263 x := v_0
14264 y := v_1
14265 v.reset(OpPPC64ISEL)
14266 v.AuxInt = int32ToAuxInt(2)
14267 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14268 v0.AddArg2(x, y)
14269 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14270 v1.AuxInt = int64ToAuxInt(63)
14271 v1.AddArg(x)
14272 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14273 v2.AuxInt = int64ToAuxInt(0)
14274 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14275 v3.AuxInt = int64ToAuxInt(0xFFC0)
14276 v3.AddArg(y)
14277 v2.AddArg(v3)
14278 v.AddArg3(v0, v1, v2)
14279 return true
14280 }
14281 }
14282 func rewriteValuePPC64_OpRsh64x32(v *Value) bool {
14283 v_1 := v.Args[1]
14284 v_0 := v.Args[0]
14285 b := v.Block
14286
14287
14288
14289 for {
14290 x := v_0
14291 y := v_1
14292 if !(shiftIsBounded(v)) {
14293 break
14294 }
14295 v.reset(OpPPC64SRAD)
14296 v.AddArg2(x, y)
14297 return true
14298 }
14299
14300
14301 for {
14302 t := v.Type
14303 x := v_0
14304 y := v_1
14305 v.reset(OpPPC64ISEL)
14306 v.AuxInt = int32ToAuxInt(0)
14307 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14308 v0.AddArg2(x, y)
14309 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14310 v1.AuxInt = int64ToAuxInt(63)
14311 v1.AddArg(x)
14312 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
14313 v2.AuxInt = int32ToAuxInt(64)
14314 v2.AddArg(y)
14315 v.AddArg3(v0, v1, v2)
14316 return true
14317 }
14318 }
14319 func rewriteValuePPC64_OpRsh64x64(v *Value) bool {
14320 v_1 := v.Args[1]
14321 v_0 := v.Args[0]
14322 b := v.Block
14323
14324
14325
14326 for {
14327 x := v_0
14328 if v_1.Op != OpPPC64MOVDconst {
14329 break
14330 }
14331 c := auxIntToInt64(v_1.AuxInt)
14332 if !(uint64(c) >= 64) {
14333 break
14334 }
14335 v.reset(OpPPC64SRADconst)
14336 v.AuxInt = int64ToAuxInt(63)
14337 v.AddArg(x)
14338 return true
14339 }
14340
14341
14342
14343 for {
14344 x := v_0
14345 if v_1.Op != OpPPC64MOVDconst {
14346 break
14347 }
14348 c := auxIntToInt64(v_1.AuxInt)
14349 if !(uint64(c) < 64) {
14350 break
14351 }
14352 v.reset(OpPPC64SRADconst)
14353 v.AuxInt = int64ToAuxInt(c)
14354 v.AddArg(x)
14355 return true
14356 }
14357
14358
14359
14360 for {
14361 x := v_0
14362 y := v_1
14363 if !(shiftIsBounded(v)) {
14364 break
14365 }
14366 v.reset(OpPPC64SRAD)
14367 v.AddArg2(x, y)
14368 return true
14369 }
14370
14371
14372 for {
14373 t := v.Type
14374 x := v_0
14375 y := v_1
14376 v.reset(OpPPC64ISEL)
14377 v.AuxInt = int32ToAuxInt(0)
14378 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14379 v0.AddArg2(x, y)
14380 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14381 v1.AuxInt = int64ToAuxInt(63)
14382 v1.AddArg(x)
14383 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
14384 v2.AuxInt = int64ToAuxInt(64)
14385 v2.AddArg(y)
14386 v.AddArg3(v0, v1, v2)
14387 return true
14388 }
14389 }
14390 func rewriteValuePPC64_OpRsh64x8(v *Value) bool {
14391 v_1 := v.Args[1]
14392 v_0 := v.Args[0]
14393 b := v.Block
14394 typ := &b.Func.Config.Types
14395
14396
14397
14398 for {
14399 x := v_0
14400 y := v_1
14401 if !(shiftIsBounded(v)) {
14402 break
14403 }
14404 v.reset(OpPPC64SRAD)
14405 v.AddArg2(x, y)
14406 return true
14407 }
14408
14409
14410 for {
14411 t := v.Type
14412 x := v_0
14413 y := v_1
14414 v.reset(OpPPC64ISEL)
14415 v.AuxInt = int32ToAuxInt(2)
14416 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14417 v0.AddArg2(x, y)
14418 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14419 v1.AuxInt = int64ToAuxInt(63)
14420 v1.AddArg(x)
14421 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14422 v2.AuxInt = int64ToAuxInt(0)
14423 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14424 v3.AuxInt = int64ToAuxInt(0x00C0)
14425 v3.AddArg(y)
14426 v2.AddArg(v3)
14427 v.AddArg3(v0, v1, v2)
14428 return true
14429 }
14430 }
14431 func rewriteValuePPC64_OpRsh8Ux16(v *Value) bool {
14432 v_1 := v.Args[1]
14433 v_0 := v.Args[0]
14434 b := v.Block
14435 typ := &b.Func.Config.Types
14436
14437
14438
14439 for {
14440 x := v_0
14441 y := v_1
14442 if !(shiftIsBounded(v)) {
14443 break
14444 }
14445 v.reset(OpPPC64SRD)
14446 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14447 v0.AddArg(x)
14448 v.AddArg2(v0, y)
14449 return true
14450 }
14451
14452
14453 for {
14454 t := v.Type
14455 x := v_0
14456 y := v_1
14457 v.reset(OpPPC64ISEL)
14458 v.AuxInt = int32ToAuxInt(2)
14459 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14460 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14461 v1.AddArg(x)
14462 v0.AddArg2(v1, y)
14463 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14464 v2.AuxInt = int64ToAuxInt(0)
14465 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14466 v3.AuxInt = int64ToAuxInt(0)
14467 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14468 v4.AuxInt = int64ToAuxInt(0xFFF8)
14469 v4.AddArg(y)
14470 v3.AddArg(v4)
14471 v.AddArg3(v0, v2, v3)
14472 return true
14473 }
14474 }
14475 func rewriteValuePPC64_OpRsh8Ux32(v *Value) bool {
14476 v_1 := v.Args[1]
14477 v_0 := v.Args[0]
14478 b := v.Block
14479 typ := &b.Func.Config.Types
14480
14481
14482
14483 for {
14484 x := v_0
14485 y := v_1
14486 if !(shiftIsBounded(v)) {
14487 break
14488 }
14489 v.reset(OpPPC64SRD)
14490 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14491 v0.AddArg(x)
14492 v.AddArg2(v0, y)
14493 return true
14494 }
14495
14496
14497 for {
14498 t := v.Type
14499 x := v_0
14500 y := v_1
14501 v.reset(OpPPC64ISEL)
14502 v.AuxInt = int32ToAuxInt(0)
14503 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14504 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14505 v1.AddArg(x)
14506 v0.AddArg2(v1, y)
14507 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14508 v2.AuxInt = int64ToAuxInt(0)
14509 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
14510 v3.AuxInt = int32ToAuxInt(8)
14511 v3.AddArg(y)
14512 v.AddArg3(v0, v2, v3)
14513 return true
14514 }
14515 }
14516 func rewriteValuePPC64_OpRsh8Ux64(v *Value) bool {
14517 v_1 := v.Args[1]
14518 v_0 := v.Args[0]
14519 b := v.Block
14520 typ := &b.Func.Config.Types
14521
14522
14523
14524 for {
14525 x := v_0
14526 if v_1.Op != OpPPC64MOVDconst {
14527 break
14528 }
14529 c := auxIntToInt64(v_1.AuxInt)
14530 if !(uint64(c) < 8) {
14531 break
14532 }
14533 v.reset(OpPPC64SRWconst)
14534 v.AuxInt = int64ToAuxInt(c)
14535 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
14536 v0.AddArg(x)
14537 v.AddArg(v0)
14538 return true
14539 }
14540
14541
14542
14543 for {
14544 x := v_0
14545 y := v_1
14546 if !(shiftIsBounded(v)) {
14547 break
14548 }
14549 v.reset(OpPPC64SRD)
14550 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14551 v0.AddArg(x)
14552 v.AddArg2(v0, y)
14553 return true
14554 }
14555
14556
14557 for {
14558 t := v.Type
14559 x := v_0
14560 y := v_1
14561 v.reset(OpPPC64ISEL)
14562 v.AuxInt = int32ToAuxInt(0)
14563 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14564 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14565 v1.AddArg(x)
14566 v0.AddArg2(v1, y)
14567 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14568 v2.AuxInt = int64ToAuxInt(0)
14569 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
14570 v3.AuxInt = int64ToAuxInt(8)
14571 v3.AddArg(y)
14572 v.AddArg3(v0, v2, v3)
14573 return true
14574 }
14575 }
14576 func rewriteValuePPC64_OpRsh8Ux8(v *Value) bool {
14577 v_1 := v.Args[1]
14578 v_0 := v.Args[0]
14579 b := v.Block
14580 typ := &b.Func.Config.Types
14581
14582
14583
14584 for {
14585 x := v_0
14586 y := v_1
14587 if !(shiftIsBounded(v)) {
14588 break
14589 }
14590 v.reset(OpPPC64SRD)
14591 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14592 v0.AddArg(x)
14593 v.AddArg2(v0, y)
14594 return true
14595 }
14596
14597
14598 for {
14599 t := v.Type
14600 x := v_0
14601 y := v_1
14602 v.reset(OpPPC64ISEL)
14603 v.AuxInt = int32ToAuxInt(2)
14604 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14605 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14606 v1.AddArg(x)
14607 v0.AddArg2(v1, y)
14608 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14609 v2.AuxInt = int64ToAuxInt(0)
14610 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14611 v3.AuxInt = int64ToAuxInt(0)
14612 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14613 v4.AuxInt = int64ToAuxInt(0x00F8)
14614 v4.AddArg(y)
14615 v3.AddArg(v4)
14616 v.AddArg3(v0, v2, v3)
14617 return true
14618 }
14619 }
14620 func rewriteValuePPC64_OpRsh8x16(v *Value) bool {
14621 v_1 := v.Args[1]
14622 v_0 := v.Args[0]
14623 b := v.Block
14624 typ := &b.Func.Config.Types
14625
14626
14627
14628 for {
14629 x := v_0
14630 y := v_1
14631 if !(shiftIsBounded(v)) {
14632 break
14633 }
14634 v.reset(OpPPC64SRAD)
14635 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14636 v0.AddArg(x)
14637 v.AddArg2(v0, y)
14638 return true
14639 }
14640
14641
14642 for {
14643 t := v.Type
14644 x := v_0
14645 y := v_1
14646 v.reset(OpPPC64ISEL)
14647 v.AuxInt = int32ToAuxInt(2)
14648 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14649 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14650 v1.AddArg(x)
14651 v0.AddArg2(v1, y)
14652 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14653 v2.AuxInt = int64ToAuxInt(7)
14654 v2.AddArg(v1)
14655 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14656 v3.AuxInt = int64ToAuxInt(0)
14657 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14658 v4.AuxInt = int64ToAuxInt(0xFFF8)
14659 v4.AddArg(y)
14660 v3.AddArg(v4)
14661 v.AddArg3(v0, v2, v3)
14662 return true
14663 }
14664 }
14665 func rewriteValuePPC64_OpRsh8x32(v *Value) bool {
14666 v_1 := v.Args[1]
14667 v_0 := v.Args[0]
14668 b := v.Block
14669 typ := &b.Func.Config.Types
14670
14671
14672
14673 for {
14674 x := v_0
14675 y := v_1
14676 if !(shiftIsBounded(v)) {
14677 break
14678 }
14679 v.reset(OpPPC64SRAD)
14680 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14681 v0.AddArg(x)
14682 v.AddArg2(v0, y)
14683 return true
14684 }
14685
14686
14687 for {
14688 t := v.Type
14689 x := v_0
14690 y := v_1
14691 v.reset(OpPPC64ISEL)
14692 v.AuxInt = int32ToAuxInt(0)
14693 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14694 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14695 v1.AddArg(x)
14696 v0.AddArg2(v1, y)
14697 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14698 v2.AuxInt = int64ToAuxInt(7)
14699 v2.AddArg(v1)
14700 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
14701 v3.AuxInt = int32ToAuxInt(8)
14702 v3.AddArg(y)
14703 v.AddArg3(v0, v2, v3)
14704 return true
14705 }
14706 }
14707 func rewriteValuePPC64_OpRsh8x64(v *Value) bool {
14708 v_1 := v.Args[1]
14709 v_0 := v.Args[0]
14710 b := v.Block
14711 typ := &b.Func.Config.Types
14712
14713
14714
14715 for {
14716 x := v_0
14717 if v_1.Op != OpPPC64MOVDconst {
14718 break
14719 }
14720 c := auxIntToInt64(v_1.AuxInt)
14721 if !(uint64(c) >= 8) {
14722 break
14723 }
14724 v.reset(OpPPC64SRAWconst)
14725 v.AuxInt = int64ToAuxInt(63)
14726 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
14727 v0.AddArg(x)
14728 v.AddArg(v0)
14729 return true
14730 }
14731
14732
14733
14734 for {
14735 x := v_0
14736 if v_1.Op != OpPPC64MOVDconst {
14737 break
14738 }
14739 c := auxIntToInt64(v_1.AuxInt)
14740 if !(uint64(c) < 8) {
14741 break
14742 }
14743 v.reset(OpPPC64SRAWconst)
14744 v.AuxInt = int64ToAuxInt(c)
14745 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
14746 v0.AddArg(x)
14747 v.AddArg(v0)
14748 return true
14749 }
14750
14751
14752
14753 for {
14754 x := v_0
14755 y := v_1
14756 if !(shiftIsBounded(v)) {
14757 break
14758 }
14759 v.reset(OpPPC64SRAD)
14760 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14761 v0.AddArg(x)
14762 v.AddArg2(v0, y)
14763 return true
14764 }
14765
14766
14767 for {
14768 t := v.Type
14769 x := v_0
14770 y := v_1
14771 v.reset(OpPPC64ISEL)
14772 v.AuxInt = int32ToAuxInt(0)
14773 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14774 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14775 v1.AddArg(x)
14776 v0.AddArg2(v1, y)
14777 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14778 v2.AuxInt = int64ToAuxInt(7)
14779 v2.AddArg(v1)
14780 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
14781 v3.AuxInt = int64ToAuxInt(8)
14782 v3.AddArg(y)
14783 v.AddArg3(v0, v2, v3)
14784 return true
14785 }
14786 }
14787 func rewriteValuePPC64_OpRsh8x8(v *Value) bool {
14788 v_1 := v.Args[1]
14789 v_0 := v.Args[0]
14790 b := v.Block
14791 typ := &b.Func.Config.Types
14792
14793
14794
14795 for {
14796 x := v_0
14797 y := v_1
14798 if !(shiftIsBounded(v)) {
14799 break
14800 }
14801 v.reset(OpPPC64SRAD)
14802 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14803 v0.AddArg(x)
14804 v.AddArg2(v0, y)
14805 return true
14806 }
14807
14808
14809 for {
14810 t := v.Type
14811 x := v_0
14812 y := v_1
14813 v.reset(OpPPC64ISEL)
14814 v.AuxInt = int32ToAuxInt(2)
14815 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14816 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14817 v1.AddArg(x)
14818 v0.AddArg2(v1, y)
14819 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14820 v2.AuxInt = int64ToAuxInt(7)
14821 v2.AddArg(v1)
14822 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14823 v3.AuxInt = int64ToAuxInt(0)
14824 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14825 v4.AuxInt = int64ToAuxInt(0x00F8)
14826 v4.AddArg(y)
14827 v3.AddArg(v4)
14828 v.AddArg3(v0, v2, v3)
14829 return true
14830 }
14831 }
14832 func rewriteValuePPC64_OpSelect0(v *Value) bool {
14833 v_0 := v.Args[0]
14834 b := v.Block
14835 typ := &b.Func.Config.Types
14836
14837
14838 for {
14839 if v_0.Op != OpMul64uhilo {
14840 break
14841 }
14842 y := v_0.Args[1]
14843 x := v_0.Args[0]
14844 v.reset(OpPPC64MULHDU)
14845 v.AddArg2(x, y)
14846 return true
14847 }
14848
14849
14850 for {
14851 if v_0.Op != OpMul64uover {
14852 break
14853 }
14854 y := v_0.Args[1]
14855 x := v_0.Args[0]
14856 v.reset(OpPPC64MULLD)
14857 v.AddArg2(x, y)
14858 return true
14859 }
14860
14861
14862 for {
14863 if v_0.Op != OpAdd64carry {
14864 break
14865 }
14866 c := v_0.Args[2]
14867 x := v_0.Args[0]
14868 y := v_0.Args[1]
14869 v.reset(OpSelect0)
14870 v.Type = typ.UInt64
14871 v0 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
14872 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14873 v2 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14874 v2.AuxInt = int64ToAuxInt(-1)
14875 v2.AddArg(c)
14876 v1.AddArg(v2)
14877 v0.AddArg3(x, y, v1)
14878 v.AddArg(v0)
14879 return true
14880 }
14881
14882
14883 for {
14884 if v_0.Op != OpSub64borrow {
14885 break
14886 }
14887 c := v_0.Args[2]
14888 x := v_0.Args[0]
14889 y := v_0.Args[1]
14890 v.reset(OpSelect0)
14891 v.Type = typ.UInt64
14892 v0 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
14893 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14894 v2 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14895 v2.AuxInt = int64ToAuxInt(0)
14896 v2.AddArg(c)
14897 v1.AddArg(v2)
14898 v0.AddArg3(x, y, v1)
14899 v.AddArg(v0)
14900 return true
14901 }
14902 return false
14903 }
14904 func rewriteValuePPC64_OpSelect1(v *Value) bool {
14905 v_0 := v.Args[0]
14906 b := v.Block
14907 typ := &b.Func.Config.Types
14908
14909
14910 for {
14911 if v_0.Op != OpMul64uhilo {
14912 break
14913 }
14914 y := v_0.Args[1]
14915 x := v_0.Args[0]
14916 v.reset(OpPPC64MULLD)
14917 v.AddArg2(x, y)
14918 return true
14919 }
14920
14921
14922 for {
14923 if v_0.Op != OpMul64uover {
14924 break
14925 }
14926 y := v_0.Args[1]
14927 x := v_0.Args[0]
14928 v.reset(OpPPC64SETBCR)
14929 v.AuxInt = int32ToAuxInt(2)
14930 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14931 v0.AuxInt = int64ToAuxInt(0)
14932 v1 := b.NewValue0(v.Pos, OpPPC64MULHDU, x.Type)
14933 v1.AddArg2(x, y)
14934 v0.AddArg(v1)
14935 v.AddArg(v0)
14936 return true
14937 }
14938
14939
14940 for {
14941 if v_0.Op != OpAdd64carry {
14942 break
14943 }
14944 c := v_0.Args[2]
14945 x := v_0.Args[0]
14946 y := v_0.Args[1]
14947 v.reset(OpPPC64ADDZEzero)
14948 v0 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14949 v1 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
14950 v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14951 v3 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14952 v3.AuxInt = int64ToAuxInt(-1)
14953 v3.AddArg(c)
14954 v2.AddArg(v3)
14955 v1.AddArg3(x, y, v2)
14956 v0.AddArg(v1)
14957 v.AddArg(v0)
14958 return true
14959 }
14960
14961
14962
14963 for {
14964 if v_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_0.AuxInt) != -1 {
14965 break
14966 }
14967 n := v_0.Args[0]
14968 if n.Op != OpPPC64ADDZEzero {
14969 break
14970 }
14971 x := n.Args[0]
14972 if !(n.Uses <= 2) {
14973 break
14974 }
14975 v.copyOf(x)
14976 return true
14977 }
14978
14979
14980 for {
14981 if v_0.Op != OpSub64borrow {
14982 break
14983 }
14984 c := v_0.Args[2]
14985 x := v_0.Args[0]
14986 y := v_0.Args[1]
14987 v.reset(OpPPC64NEG)
14988 v0 := b.NewValue0(v.Pos, OpPPC64SUBZEzero, typ.UInt64)
14989 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14990 v2 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
14991 v3 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14992 v4 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14993 v4.AuxInt = int64ToAuxInt(0)
14994 v4.AddArg(c)
14995 v3.AddArg(v4)
14996 v2.AddArg3(x, y, v3)
14997 v1.AddArg(v2)
14998 v0.AddArg(v1)
14999 v.AddArg(v0)
15000 return true
15001 }
15002
15003
15004
15005 for {
15006 if v_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_0.AuxInt) != 0 {
15007 break
15008 }
15009 n := v_0.Args[0]
15010 if n.Op != OpPPC64NEG {
15011 break
15012 }
15013 n_0 := n.Args[0]
15014 if n_0.Op != OpPPC64SUBZEzero {
15015 break
15016 }
15017 x := n_0.Args[0]
15018 if !(n.Uses <= 2) {
15019 break
15020 }
15021 v.copyOf(x)
15022 return true
15023 }
15024 return false
15025 }
15026 func rewriteValuePPC64_OpSelectN(v *Value) bool {
15027 v_0 := v.Args[0]
15028 b := v.Block
15029 config := b.Func.Config
15030
15031
15032
15033 for {
15034 if auxIntToInt64(v.AuxInt) != 0 {
15035 break
15036 }
15037 call := v_0
15038 if call.Op != OpPPC64CALLstatic || len(call.Args) != 1 {
15039 break
15040 }
15041 sym := auxToCall(call.Aux)
15042 s1 := call.Args[0]
15043 if s1.Op != OpPPC64MOVDstore {
15044 break
15045 }
15046 _ = s1.Args[2]
15047 s1_1 := s1.Args[1]
15048 if s1_1.Op != OpPPC64MOVDconst {
15049 break
15050 }
15051 sz := auxIntToInt64(s1_1.AuxInt)
15052 s2 := s1.Args[2]
15053 if s2.Op != OpPPC64MOVDstore {
15054 break
15055 }
15056 _ = s2.Args[2]
15057 src := s2.Args[1]
15058 s3 := s2.Args[2]
15059 if s3.Op != OpPPC64MOVDstore {
15060 break
15061 }
15062 mem := s3.Args[2]
15063 dst := s3.Args[1]
15064 if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(s1, s2, s3, call)) {
15065 break
15066 }
15067 v.reset(OpMove)
15068 v.AuxInt = int64ToAuxInt(sz)
15069 v.AddArg3(dst, src, mem)
15070 return true
15071 }
15072
15073
15074
15075 for {
15076 if auxIntToInt64(v.AuxInt) != 0 {
15077 break
15078 }
15079 call := v_0
15080 if call.Op != OpPPC64CALLstatic || len(call.Args) != 4 {
15081 break
15082 }
15083 sym := auxToCall(call.Aux)
15084 mem := call.Args[3]
15085 dst := call.Args[0]
15086 src := call.Args[1]
15087 call_2 := call.Args[2]
15088 if call_2.Op != OpPPC64MOVDconst {
15089 break
15090 }
15091 sz := auxIntToInt64(call_2.AuxInt)
15092 if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
15093 break
15094 }
15095 v.reset(OpMove)
15096 v.AuxInt = int64ToAuxInt(sz)
15097 v.AddArg3(dst, src, mem)
15098 return true
15099 }
15100 return false
15101 }
15102 func rewriteValuePPC64_OpSlicemask(v *Value) bool {
15103 v_0 := v.Args[0]
15104 b := v.Block
15105
15106
15107 for {
15108 t := v.Type
15109 x := v_0
15110 v.reset(OpPPC64SRADconst)
15111 v.AuxInt = int64ToAuxInt(63)
15112 v0 := b.NewValue0(v.Pos, OpPPC64NEG, t)
15113 v0.AddArg(x)
15114 v.AddArg(v0)
15115 return true
15116 }
15117 }
15118 func rewriteValuePPC64_OpStore(v *Value) bool {
15119 v_2 := v.Args[2]
15120 v_1 := v.Args[1]
15121 v_0 := v.Args[0]
15122
15123
15124
15125 for {
15126 t := auxToType(v.Aux)
15127 ptr := v_0
15128 val := v_1
15129 mem := v_2
15130 if !(t.Size() == 8 && t.IsFloat()) {
15131 break
15132 }
15133 v.reset(OpPPC64FMOVDstore)
15134 v.AddArg3(ptr, val, mem)
15135 return true
15136 }
15137
15138
15139
15140 for {
15141 t := auxToType(v.Aux)
15142 ptr := v_0
15143 val := v_1
15144 mem := v_2
15145 if !(t.Size() == 4 && t.IsFloat()) {
15146 break
15147 }
15148 v.reset(OpPPC64FMOVSstore)
15149 v.AddArg3(ptr, val, mem)
15150 return true
15151 }
15152
15153
15154
15155 for {
15156 t := auxToType(v.Aux)
15157 ptr := v_0
15158 val := v_1
15159 mem := v_2
15160 if !(t.Size() == 8 && !t.IsFloat()) {
15161 break
15162 }
15163 v.reset(OpPPC64MOVDstore)
15164 v.AddArg3(ptr, val, mem)
15165 return true
15166 }
15167
15168
15169
15170 for {
15171 t := auxToType(v.Aux)
15172 ptr := v_0
15173 val := v_1
15174 mem := v_2
15175 if !(t.Size() == 4 && !t.IsFloat()) {
15176 break
15177 }
15178 v.reset(OpPPC64MOVWstore)
15179 v.AddArg3(ptr, val, mem)
15180 return true
15181 }
15182
15183
15184
15185 for {
15186 t := auxToType(v.Aux)
15187 ptr := v_0
15188 val := v_1
15189 mem := v_2
15190 if !(t.Size() == 2) {
15191 break
15192 }
15193 v.reset(OpPPC64MOVHstore)
15194 v.AddArg3(ptr, val, mem)
15195 return true
15196 }
15197
15198
15199
15200 for {
15201 t := auxToType(v.Aux)
15202 ptr := v_0
15203 val := v_1
15204 mem := v_2
15205 if !(t.Size() == 1) {
15206 break
15207 }
15208 v.reset(OpPPC64MOVBstore)
15209 v.AddArg3(ptr, val, mem)
15210 return true
15211 }
15212 return false
15213 }
15214 func rewriteValuePPC64_OpTrunc16to8(v *Value) bool {
15215 v_0 := v.Args[0]
15216
15217
15218
15219 for {
15220 t := v.Type
15221 x := v_0
15222 if !(t.IsSigned()) {
15223 break
15224 }
15225 v.reset(OpPPC64MOVBreg)
15226 v.AddArg(x)
15227 return true
15228 }
15229
15230
15231 for {
15232 x := v_0
15233 v.reset(OpPPC64MOVBZreg)
15234 v.AddArg(x)
15235 return true
15236 }
15237 }
15238 func rewriteValuePPC64_OpTrunc32to16(v *Value) bool {
15239 v_0 := v.Args[0]
15240
15241
15242
15243 for {
15244 t := v.Type
15245 x := v_0
15246 if !(t.IsSigned()) {
15247 break
15248 }
15249 v.reset(OpPPC64MOVHreg)
15250 v.AddArg(x)
15251 return true
15252 }
15253
15254
15255 for {
15256 x := v_0
15257 v.reset(OpPPC64MOVHZreg)
15258 v.AddArg(x)
15259 return true
15260 }
15261 }
15262 func rewriteValuePPC64_OpTrunc32to8(v *Value) bool {
15263 v_0 := v.Args[0]
15264
15265
15266
15267 for {
15268 t := v.Type
15269 x := v_0
15270 if !(t.IsSigned()) {
15271 break
15272 }
15273 v.reset(OpPPC64MOVBreg)
15274 v.AddArg(x)
15275 return true
15276 }
15277
15278
15279 for {
15280 x := v_0
15281 v.reset(OpPPC64MOVBZreg)
15282 v.AddArg(x)
15283 return true
15284 }
15285 }
15286 func rewriteValuePPC64_OpTrunc64to16(v *Value) bool {
15287 v_0 := v.Args[0]
15288
15289
15290
15291 for {
15292 t := v.Type
15293 x := v_0
15294 if !(t.IsSigned()) {
15295 break
15296 }
15297 v.reset(OpPPC64MOVHreg)
15298 v.AddArg(x)
15299 return true
15300 }
15301
15302
15303 for {
15304 x := v_0
15305 v.reset(OpPPC64MOVHZreg)
15306 v.AddArg(x)
15307 return true
15308 }
15309 }
15310 func rewriteValuePPC64_OpTrunc64to32(v *Value) bool {
15311 v_0 := v.Args[0]
15312
15313
15314
15315 for {
15316 t := v.Type
15317 x := v_0
15318 if !(t.IsSigned()) {
15319 break
15320 }
15321 v.reset(OpPPC64MOVWreg)
15322 v.AddArg(x)
15323 return true
15324 }
15325
15326
15327 for {
15328 x := v_0
15329 v.reset(OpPPC64MOVWZreg)
15330 v.AddArg(x)
15331 return true
15332 }
15333 }
15334 func rewriteValuePPC64_OpTrunc64to8(v *Value) bool {
15335 v_0 := v.Args[0]
15336
15337
15338
15339 for {
15340 t := v.Type
15341 x := v_0
15342 if !(t.IsSigned()) {
15343 break
15344 }
15345 v.reset(OpPPC64MOVBreg)
15346 v.AddArg(x)
15347 return true
15348 }
15349
15350
15351 for {
15352 x := v_0
15353 v.reset(OpPPC64MOVBZreg)
15354 v.AddArg(x)
15355 return true
15356 }
15357 }
15358 func rewriteValuePPC64_OpZero(v *Value) bool {
15359 v_1 := v.Args[1]
15360 v_0 := v.Args[0]
15361 b := v.Block
15362
15363
15364 for {
15365 if auxIntToInt64(v.AuxInt) != 0 {
15366 break
15367 }
15368 mem := v_1
15369 v.copyOf(mem)
15370 return true
15371 }
15372
15373
15374 for {
15375 if auxIntToInt64(v.AuxInt) != 1 {
15376 break
15377 }
15378 destptr := v_0
15379 mem := v_1
15380 v.reset(OpPPC64MOVBstorezero)
15381 v.AddArg2(destptr, mem)
15382 return true
15383 }
15384
15385
15386 for {
15387 if auxIntToInt64(v.AuxInt) != 2 {
15388 break
15389 }
15390 destptr := v_0
15391 mem := v_1
15392 v.reset(OpPPC64MOVHstorezero)
15393 v.AddArg2(destptr, mem)
15394 return true
15395 }
15396
15397
15398 for {
15399 if auxIntToInt64(v.AuxInt) != 3 {
15400 break
15401 }
15402 destptr := v_0
15403 mem := v_1
15404 v.reset(OpPPC64MOVBstorezero)
15405 v.AuxInt = int32ToAuxInt(2)
15406 v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
15407 v0.AddArg2(destptr, mem)
15408 v.AddArg2(destptr, v0)
15409 return true
15410 }
15411
15412
15413 for {
15414 if auxIntToInt64(v.AuxInt) != 4 {
15415 break
15416 }
15417 destptr := v_0
15418 mem := v_1
15419 v.reset(OpPPC64MOVWstorezero)
15420 v.AddArg2(destptr, mem)
15421 return true
15422 }
15423
15424
15425 for {
15426 if auxIntToInt64(v.AuxInt) != 5 {
15427 break
15428 }
15429 destptr := v_0
15430 mem := v_1
15431 v.reset(OpPPC64MOVBstorezero)
15432 v.AuxInt = int32ToAuxInt(4)
15433 v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
15434 v0.AddArg2(destptr, mem)
15435 v.AddArg2(destptr, v0)
15436 return true
15437 }
15438
15439
15440 for {
15441 if auxIntToInt64(v.AuxInt) != 6 {
15442 break
15443 }
15444 destptr := v_0
15445 mem := v_1
15446 v.reset(OpPPC64MOVHstorezero)
15447 v.AuxInt = int32ToAuxInt(4)
15448 v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
15449 v0.AddArg2(destptr, mem)
15450 v.AddArg2(destptr, v0)
15451 return true
15452 }
15453
15454
15455 for {
15456 if auxIntToInt64(v.AuxInt) != 7 {
15457 break
15458 }
15459 destptr := v_0
15460 mem := v_1
15461 v.reset(OpPPC64MOVBstorezero)
15462 v.AuxInt = int32ToAuxInt(6)
15463 v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
15464 v0.AuxInt = int32ToAuxInt(4)
15465 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
15466 v1.AddArg2(destptr, mem)
15467 v0.AddArg2(destptr, v1)
15468 v.AddArg2(destptr, v0)
15469 return true
15470 }
15471
15472
15473 for {
15474 if auxIntToInt64(v.AuxInt) != 8 {
15475 break
15476 }
15477 destptr := v_0
15478 mem := v_1
15479 v.reset(OpPPC64MOVDstorezero)
15480 v.AddArg2(destptr, mem)
15481 return true
15482 }
15483
15484
15485 for {
15486 if auxIntToInt64(v.AuxInt) != 12 {
15487 break
15488 }
15489 destptr := v_0
15490 mem := v_1
15491 v.reset(OpPPC64MOVWstorezero)
15492 v.AuxInt = int32ToAuxInt(8)
15493 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15494 v0.AuxInt = int32ToAuxInt(0)
15495 v0.AddArg2(destptr, mem)
15496 v.AddArg2(destptr, v0)
15497 return true
15498 }
15499
15500
15501 for {
15502 if auxIntToInt64(v.AuxInt) != 16 {
15503 break
15504 }
15505 destptr := v_0
15506 mem := v_1
15507 v.reset(OpPPC64MOVDstorezero)
15508 v.AuxInt = int32ToAuxInt(8)
15509 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15510 v0.AuxInt = int32ToAuxInt(0)
15511 v0.AddArg2(destptr, mem)
15512 v.AddArg2(destptr, v0)
15513 return true
15514 }
15515
15516
15517 for {
15518 if auxIntToInt64(v.AuxInt) != 24 {
15519 break
15520 }
15521 destptr := v_0
15522 mem := v_1
15523 v.reset(OpPPC64MOVDstorezero)
15524 v.AuxInt = int32ToAuxInt(16)
15525 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15526 v0.AuxInt = int32ToAuxInt(8)
15527 v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15528 v1.AuxInt = int32ToAuxInt(0)
15529 v1.AddArg2(destptr, mem)
15530 v0.AddArg2(destptr, v1)
15531 v.AddArg2(destptr, v0)
15532 return true
15533 }
15534
15535
15536 for {
15537 if auxIntToInt64(v.AuxInt) != 32 {
15538 break
15539 }
15540 destptr := v_0
15541 mem := v_1
15542 v.reset(OpPPC64MOVDstorezero)
15543 v.AuxInt = int32ToAuxInt(24)
15544 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15545 v0.AuxInt = int32ToAuxInt(16)
15546 v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15547 v1.AuxInt = int32ToAuxInt(8)
15548 v2 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15549 v2.AuxInt = int32ToAuxInt(0)
15550 v2.AddArg2(destptr, mem)
15551 v1.AddArg2(destptr, v2)
15552 v0.AddArg2(destptr, v1)
15553 v.AddArg2(destptr, v0)
15554 return true
15555 }
15556
15557
15558
15559 for {
15560 s := auxIntToInt64(v.AuxInt)
15561 ptr := v_0
15562 mem := v_1
15563 if !(buildcfg.GOPPC64 <= 8 && s < 64) {
15564 break
15565 }
15566 v.reset(OpPPC64LoweredZeroShort)
15567 v.AuxInt = int64ToAuxInt(s)
15568 v.AddArg2(ptr, mem)
15569 return true
15570 }
15571
15572
15573
15574 for {
15575 s := auxIntToInt64(v.AuxInt)
15576 ptr := v_0
15577 mem := v_1
15578 if !(buildcfg.GOPPC64 <= 8) {
15579 break
15580 }
15581 v.reset(OpPPC64LoweredZero)
15582 v.AuxInt = int64ToAuxInt(s)
15583 v.AddArg2(ptr, mem)
15584 return true
15585 }
15586
15587
15588
15589 for {
15590 s := auxIntToInt64(v.AuxInt)
15591 ptr := v_0
15592 mem := v_1
15593 if !(s < 128 && buildcfg.GOPPC64 >= 9) {
15594 break
15595 }
15596 v.reset(OpPPC64LoweredQuadZeroShort)
15597 v.AuxInt = int64ToAuxInt(s)
15598 v.AddArg2(ptr, mem)
15599 return true
15600 }
15601
15602
15603
15604 for {
15605 s := auxIntToInt64(v.AuxInt)
15606 ptr := v_0
15607 mem := v_1
15608 if !(buildcfg.GOPPC64 >= 9) {
15609 break
15610 }
15611 v.reset(OpPPC64LoweredQuadZero)
15612 v.AuxInt = int64ToAuxInt(s)
15613 v.AddArg2(ptr, mem)
15614 return true
15615 }
15616 return false
15617 }
15618 func rewriteBlockPPC64(b *Block) bool {
15619 typ := &b.Func.Config.Types
15620 switch b.Kind {
15621 case BlockPPC64EQ:
15622
15623
15624 for b.Controls[0].Op == OpPPC64FlagEQ {
15625 b.Reset(BlockFirst)
15626 return true
15627 }
15628
15629
15630 for b.Controls[0].Op == OpPPC64FlagLT {
15631 b.Reset(BlockFirst)
15632 b.swapSuccessors()
15633 return true
15634 }
15635
15636
15637 for b.Controls[0].Op == OpPPC64FlagGT {
15638 b.Reset(BlockFirst)
15639 b.swapSuccessors()
15640 return true
15641 }
15642
15643
15644 for b.Controls[0].Op == OpPPC64InvertFlags {
15645 v_0 := b.Controls[0]
15646 cmp := v_0.Args[0]
15647 b.resetWithControl(BlockPPC64EQ, cmp)
15648 return true
15649 }
15650
15651
15652
15653 for b.Controls[0].Op == OpPPC64CMPconst {
15654 v_0 := b.Controls[0]
15655 if auxIntToInt64(v_0.AuxInt) != 0 {
15656 break
15657 }
15658 z := v_0.Args[0]
15659 if z.Op != OpPPC64AND {
15660 break
15661 }
15662 _ = z.Args[1]
15663 z_0 := z.Args[0]
15664 z_1 := z.Args[1]
15665 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15666 x := z_0
15667 y := z_1
15668 if !(z.Uses == 1) {
15669 continue
15670 }
15671 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15672 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15673 v1.AddArg2(x, y)
15674 v0.AddArg(v1)
15675 b.resetWithControl(BlockPPC64EQ, v0)
15676 return true
15677 }
15678 break
15679 }
15680
15681
15682
15683 for b.Controls[0].Op == OpPPC64CMPconst {
15684 v_0 := b.Controls[0]
15685 if auxIntToInt64(v_0.AuxInt) != 0 {
15686 break
15687 }
15688 z := v_0.Args[0]
15689 if z.Op != OpPPC64OR {
15690 break
15691 }
15692 _ = z.Args[1]
15693 z_0 := z.Args[0]
15694 z_1 := z.Args[1]
15695 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15696 x := z_0
15697 y := z_1
15698 if !(z.Uses == 1) {
15699 continue
15700 }
15701 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15702 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
15703 v1.AddArg2(x, y)
15704 v0.AddArg(v1)
15705 b.resetWithControl(BlockPPC64EQ, v0)
15706 return true
15707 }
15708 break
15709 }
15710
15711
15712
15713 for b.Controls[0].Op == OpPPC64CMPconst {
15714 v_0 := b.Controls[0]
15715 if auxIntToInt64(v_0.AuxInt) != 0 {
15716 break
15717 }
15718 z := v_0.Args[0]
15719 if z.Op != OpPPC64XOR {
15720 break
15721 }
15722 _ = z.Args[1]
15723 z_0 := z.Args[0]
15724 z_1 := z.Args[1]
15725 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15726 x := z_0
15727 y := z_1
15728 if !(z.Uses == 1) {
15729 continue
15730 }
15731 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15732 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
15733 v1.AddArg2(x, y)
15734 v0.AddArg(v1)
15735 b.resetWithControl(BlockPPC64EQ, v0)
15736 return true
15737 }
15738 break
15739 }
15740 case BlockPPC64GE:
15741
15742
15743 for b.Controls[0].Op == OpPPC64FlagEQ {
15744 b.Reset(BlockFirst)
15745 return true
15746 }
15747
15748
15749 for b.Controls[0].Op == OpPPC64FlagLT {
15750 b.Reset(BlockFirst)
15751 b.swapSuccessors()
15752 return true
15753 }
15754
15755
15756 for b.Controls[0].Op == OpPPC64FlagGT {
15757 b.Reset(BlockFirst)
15758 return true
15759 }
15760
15761
15762 for b.Controls[0].Op == OpPPC64InvertFlags {
15763 v_0 := b.Controls[0]
15764 cmp := v_0.Args[0]
15765 b.resetWithControl(BlockPPC64LE, cmp)
15766 return true
15767 }
15768
15769
15770
15771 for b.Controls[0].Op == OpPPC64CMPconst {
15772 v_0 := b.Controls[0]
15773 if auxIntToInt64(v_0.AuxInt) != 0 {
15774 break
15775 }
15776 z := v_0.Args[0]
15777 if z.Op != OpPPC64AND {
15778 break
15779 }
15780 _ = z.Args[1]
15781 z_0 := z.Args[0]
15782 z_1 := z.Args[1]
15783 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15784 x := z_0
15785 y := z_1
15786 if !(z.Uses == 1) {
15787 continue
15788 }
15789 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15790 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15791 v1.AddArg2(x, y)
15792 v0.AddArg(v1)
15793 b.resetWithControl(BlockPPC64GE, v0)
15794 return true
15795 }
15796 break
15797 }
15798
15799
15800
15801 for b.Controls[0].Op == OpPPC64CMPconst {
15802 v_0 := b.Controls[0]
15803 if auxIntToInt64(v_0.AuxInt) != 0 {
15804 break
15805 }
15806 z := v_0.Args[0]
15807 if z.Op != OpPPC64OR {
15808 break
15809 }
15810 _ = z.Args[1]
15811 z_0 := z.Args[0]
15812 z_1 := z.Args[1]
15813 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15814 x := z_0
15815 y := z_1
15816 if !(z.Uses == 1) {
15817 continue
15818 }
15819 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15820 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
15821 v1.AddArg2(x, y)
15822 v0.AddArg(v1)
15823 b.resetWithControl(BlockPPC64GE, v0)
15824 return true
15825 }
15826 break
15827 }
15828
15829
15830
15831 for b.Controls[0].Op == OpPPC64CMPconst {
15832 v_0 := b.Controls[0]
15833 if auxIntToInt64(v_0.AuxInt) != 0 {
15834 break
15835 }
15836 z := v_0.Args[0]
15837 if z.Op != OpPPC64XOR {
15838 break
15839 }
15840 _ = z.Args[1]
15841 z_0 := z.Args[0]
15842 z_1 := z.Args[1]
15843 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15844 x := z_0
15845 y := z_1
15846 if !(z.Uses == 1) {
15847 continue
15848 }
15849 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15850 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
15851 v1.AddArg2(x, y)
15852 v0.AddArg(v1)
15853 b.resetWithControl(BlockPPC64GE, v0)
15854 return true
15855 }
15856 break
15857 }
15858 case BlockPPC64GT:
15859
15860
15861 for b.Controls[0].Op == OpPPC64FlagEQ {
15862 b.Reset(BlockFirst)
15863 b.swapSuccessors()
15864 return true
15865 }
15866
15867
15868 for b.Controls[0].Op == OpPPC64FlagLT {
15869 b.Reset(BlockFirst)
15870 b.swapSuccessors()
15871 return true
15872 }
15873
15874
15875 for b.Controls[0].Op == OpPPC64FlagGT {
15876 b.Reset(BlockFirst)
15877 return true
15878 }
15879
15880
15881 for b.Controls[0].Op == OpPPC64InvertFlags {
15882 v_0 := b.Controls[0]
15883 cmp := v_0.Args[0]
15884 b.resetWithControl(BlockPPC64LT, cmp)
15885 return true
15886 }
15887
15888
15889
15890 for b.Controls[0].Op == OpPPC64CMPconst {
15891 v_0 := b.Controls[0]
15892 if auxIntToInt64(v_0.AuxInt) != 0 {
15893 break
15894 }
15895 z := v_0.Args[0]
15896 if z.Op != OpPPC64AND {
15897 break
15898 }
15899 _ = z.Args[1]
15900 z_0 := z.Args[0]
15901 z_1 := z.Args[1]
15902 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15903 x := z_0
15904 y := z_1
15905 if !(z.Uses == 1) {
15906 continue
15907 }
15908 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15909 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15910 v1.AddArg2(x, y)
15911 v0.AddArg(v1)
15912 b.resetWithControl(BlockPPC64GT, v0)
15913 return true
15914 }
15915 break
15916 }
15917
15918
15919
15920 for b.Controls[0].Op == OpPPC64CMPconst {
15921 v_0 := b.Controls[0]
15922 if auxIntToInt64(v_0.AuxInt) != 0 {
15923 break
15924 }
15925 z := v_0.Args[0]
15926 if z.Op != OpPPC64OR {
15927 break
15928 }
15929 _ = z.Args[1]
15930 z_0 := z.Args[0]
15931 z_1 := z.Args[1]
15932 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15933 x := z_0
15934 y := z_1
15935 if !(z.Uses == 1) {
15936 continue
15937 }
15938 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15939 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
15940 v1.AddArg2(x, y)
15941 v0.AddArg(v1)
15942 b.resetWithControl(BlockPPC64GT, v0)
15943 return true
15944 }
15945 break
15946 }
15947
15948
15949
15950 for b.Controls[0].Op == OpPPC64CMPconst {
15951 v_0 := b.Controls[0]
15952 if auxIntToInt64(v_0.AuxInt) != 0 {
15953 break
15954 }
15955 z := v_0.Args[0]
15956 if z.Op != OpPPC64XOR {
15957 break
15958 }
15959 _ = z.Args[1]
15960 z_0 := z.Args[0]
15961 z_1 := z.Args[1]
15962 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15963 x := z_0
15964 y := z_1
15965 if !(z.Uses == 1) {
15966 continue
15967 }
15968 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15969 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
15970 v1.AddArg2(x, y)
15971 v0.AddArg(v1)
15972 b.resetWithControl(BlockPPC64GT, v0)
15973 return true
15974 }
15975 break
15976 }
15977 case BlockIf:
15978
15979
15980 for b.Controls[0].Op == OpPPC64Equal {
15981 v_0 := b.Controls[0]
15982 cc := v_0.Args[0]
15983 b.resetWithControl(BlockPPC64EQ, cc)
15984 return true
15985 }
15986
15987
15988 for b.Controls[0].Op == OpPPC64NotEqual {
15989 v_0 := b.Controls[0]
15990 cc := v_0.Args[0]
15991 b.resetWithControl(BlockPPC64NE, cc)
15992 return true
15993 }
15994
15995
15996 for b.Controls[0].Op == OpPPC64LessThan {
15997 v_0 := b.Controls[0]
15998 cc := v_0.Args[0]
15999 b.resetWithControl(BlockPPC64LT, cc)
16000 return true
16001 }
16002
16003
16004 for b.Controls[0].Op == OpPPC64LessEqual {
16005 v_0 := b.Controls[0]
16006 cc := v_0.Args[0]
16007 b.resetWithControl(BlockPPC64LE, cc)
16008 return true
16009 }
16010
16011
16012 for b.Controls[0].Op == OpPPC64GreaterThan {
16013 v_0 := b.Controls[0]
16014 cc := v_0.Args[0]
16015 b.resetWithControl(BlockPPC64GT, cc)
16016 return true
16017 }
16018
16019
16020 for b.Controls[0].Op == OpPPC64GreaterEqual {
16021 v_0 := b.Controls[0]
16022 cc := v_0.Args[0]
16023 b.resetWithControl(BlockPPC64GE, cc)
16024 return true
16025 }
16026
16027
16028 for b.Controls[0].Op == OpPPC64FLessThan {
16029 v_0 := b.Controls[0]
16030 cc := v_0.Args[0]
16031 b.resetWithControl(BlockPPC64FLT, cc)
16032 return true
16033 }
16034
16035
16036 for b.Controls[0].Op == OpPPC64FLessEqual {
16037 v_0 := b.Controls[0]
16038 cc := v_0.Args[0]
16039 b.resetWithControl(BlockPPC64FLE, cc)
16040 return true
16041 }
16042
16043
16044 for b.Controls[0].Op == OpPPC64FGreaterThan {
16045 v_0 := b.Controls[0]
16046 cc := v_0.Args[0]
16047 b.resetWithControl(BlockPPC64FGT, cc)
16048 return true
16049 }
16050
16051
16052 for b.Controls[0].Op == OpPPC64FGreaterEqual {
16053 v_0 := b.Controls[0]
16054 cc := v_0.Args[0]
16055 b.resetWithControl(BlockPPC64FGE, cc)
16056 return true
16057 }
16058
16059
16060 for {
16061 cond := b.Controls[0]
16062 v0 := b.NewValue0(cond.Pos, OpPPC64CMPconst, types.TypeFlags)
16063 v0.AuxInt = int64ToAuxInt(0)
16064 v1 := b.NewValue0(cond.Pos, OpPPC64ANDconst, typ.Int)
16065 v1.AuxInt = int64ToAuxInt(1)
16066 v1.AddArg(cond)
16067 v0.AddArg(v1)
16068 b.resetWithControl(BlockPPC64NE, v0)
16069 return true
16070 }
16071 case BlockPPC64LE:
16072
16073
16074 for b.Controls[0].Op == OpPPC64FlagEQ {
16075 b.Reset(BlockFirst)
16076 return true
16077 }
16078
16079
16080 for b.Controls[0].Op == OpPPC64FlagLT {
16081 b.Reset(BlockFirst)
16082 return true
16083 }
16084
16085
16086 for b.Controls[0].Op == OpPPC64FlagGT {
16087 b.Reset(BlockFirst)
16088 b.swapSuccessors()
16089 return true
16090 }
16091
16092
16093 for b.Controls[0].Op == OpPPC64InvertFlags {
16094 v_0 := b.Controls[0]
16095 cmp := v_0.Args[0]
16096 b.resetWithControl(BlockPPC64GE, cmp)
16097 return true
16098 }
16099
16100
16101
16102 for b.Controls[0].Op == OpPPC64CMPconst {
16103 v_0 := b.Controls[0]
16104 if auxIntToInt64(v_0.AuxInt) != 0 {
16105 break
16106 }
16107 z := v_0.Args[0]
16108 if z.Op != OpPPC64AND {
16109 break
16110 }
16111 _ = z.Args[1]
16112 z_0 := z.Args[0]
16113 z_1 := z.Args[1]
16114 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16115 x := z_0
16116 y := z_1
16117 if !(z.Uses == 1) {
16118 continue
16119 }
16120 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16121 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
16122 v1.AddArg2(x, y)
16123 v0.AddArg(v1)
16124 b.resetWithControl(BlockPPC64LE, v0)
16125 return true
16126 }
16127 break
16128 }
16129
16130
16131
16132 for b.Controls[0].Op == OpPPC64CMPconst {
16133 v_0 := b.Controls[0]
16134 if auxIntToInt64(v_0.AuxInt) != 0 {
16135 break
16136 }
16137 z := v_0.Args[0]
16138 if z.Op != OpPPC64OR {
16139 break
16140 }
16141 _ = z.Args[1]
16142 z_0 := z.Args[0]
16143 z_1 := z.Args[1]
16144 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16145 x := z_0
16146 y := z_1
16147 if !(z.Uses == 1) {
16148 continue
16149 }
16150 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16151 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
16152 v1.AddArg2(x, y)
16153 v0.AddArg(v1)
16154 b.resetWithControl(BlockPPC64LE, v0)
16155 return true
16156 }
16157 break
16158 }
16159
16160
16161
16162 for b.Controls[0].Op == OpPPC64CMPconst {
16163 v_0 := b.Controls[0]
16164 if auxIntToInt64(v_0.AuxInt) != 0 {
16165 break
16166 }
16167 z := v_0.Args[0]
16168 if z.Op != OpPPC64XOR {
16169 break
16170 }
16171 _ = z.Args[1]
16172 z_0 := z.Args[0]
16173 z_1 := z.Args[1]
16174 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16175 x := z_0
16176 y := z_1
16177 if !(z.Uses == 1) {
16178 continue
16179 }
16180 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16181 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
16182 v1.AddArg2(x, y)
16183 v0.AddArg(v1)
16184 b.resetWithControl(BlockPPC64LE, v0)
16185 return true
16186 }
16187 break
16188 }
16189 case BlockPPC64LT:
16190
16191
16192 for b.Controls[0].Op == OpPPC64FlagEQ {
16193 b.Reset(BlockFirst)
16194 b.swapSuccessors()
16195 return true
16196 }
16197
16198
16199 for b.Controls[0].Op == OpPPC64FlagLT {
16200 b.Reset(BlockFirst)
16201 return true
16202 }
16203
16204
16205 for b.Controls[0].Op == OpPPC64FlagGT {
16206 b.Reset(BlockFirst)
16207 b.swapSuccessors()
16208 return true
16209 }
16210
16211
16212 for b.Controls[0].Op == OpPPC64InvertFlags {
16213 v_0 := b.Controls[0]
16214 cmp := v_0.Args[0]
16215 b.resetWithControl(BlockPPC64GT, cmp)
16216 return true
16217 }
16218
16219
16220
16221 for b.Controls[0].Op == OpPPC64CMPconst {
16222 v_0 := b.Controls[0]
16223 if auxIntToInt64(v_0.AuxInt) != 0 {
16224 break
16225 }
16226 z := v_0.Args[0]
16227 if z.Op != OpPPC64AND {
16228 break
16229 }
16230 _ = z.Args[1]
16231 z_0 := z.Args[0]
16232 z_1 := z.Args[1]
16233 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16234 x := z_0
16235 y := z_1
16236 if !(z.Uses == 1) {
16237 continue
16238 }
16239 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16240 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
16241 v1.AddArg2(x, y)
16242 v0.AddArg(v1)
16243 b.resetWithControl(BlockPPC64LT, v0)
16244 return true
16245 }
16246 break
16247 }
16248
16249
16250
16251 for b.Controls[0].Op == OpPPC64CMPconst {
16252 v_0 := b.Controls[0]
16253 if auxIntToInt64(v_0.AuxInt) != 0 {
16254 break
16255 }
16256 z := v_0.Args[0]
16257 if z.Op != OpPPC64OR {
16258 break
16259 }
16260 _ = z.Args[1]
16261 z_0 := z.Args[0]
16262 z_1 := z.Args[1]
16263 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16264 x := z_0
16265 y := z_1
16266 if !(z.Uses == 1) {
16267 continue
16268 }
16269 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16270 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
16271 v1.AddArg2(x, y)
16272 v0.AddArg(v1)
16273 b.resetWithControl(BlockPPC64LT, v0)
16274 return true
16275 }
16276 break
16277 }
16278
16279
16280
16281 for b.Controls[0].Op == OpPPC64CMPconst {
16282 v_0 := b.Controls[0]
16283 if auxIntToInt64(v_0.AuxInt) != 0 {
16284 break
16285 }
16286 z := v_0.Args[0]
16287 if z.Op != OpPPC64XOR {
16288 break
16289 }
16290 _ = z.Args[1]
16291 z_0 := z.Args[0]
16292 z_1 := z.Args[1]
16293 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16294 x := z_0
16295 y := z_1
16296 if !(z.Uses == 1) {
16297 continue
16298 }
16299 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16300 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
16301 v1.AddArg2(x, y)
16302 v0.AddArg(v1)
16303 b.resetWithControl(BlockPPC64LT, v0)
16304 return true
16305 }
16306 break
16307 }
16308 case BlockPPC64NE:
16309
16310
16311 for b.Controls[0].Op == OpPPC64CMPconst {
16312 v_0 := b.Controls[0]
16313 if auxIntToInt64(v_0.AuxInt) != 0 {
16314 break
16315 }
16316 v_0_0 := v_0.Args[0]
16317 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16318 break
16319 }
16320 v_0_0_0 := v_0_0.Args[0]
16321 if v_0_0_0.Op != OpPPC64Equal {
16322 break
16323 }
16324 cc := v_0_0_0.Args[0]
16325 b.resetWithControl(BlockPPC64EQ, cc)
16326 return true
16327 }
16328
16329
16330 for b.Controls[0].Op == OpPPC64CMPconst {
16331 v_0 := b.Controls[0]
16332 if auxIntToInt64(v_0.AuxInt) != 0 {
16333 break
16334 }
16335 v_0_0 := v_0.Args[0]
16336 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16337 break
16338 }
16339 v_0_0_0 := v_0_0.Args[0]
16340 if v_0_0_0.Op != OpPPC64NotEqual {
16341 break
16342 }
16343 cc := v_0_0_0.Args[0]
16344 b.resetWithControl(BlockPPC64NE, cc)
16345 return true
16346 }
16347
16348
16349 for b.Controls[0].Op == OpPPC64CMPconst {
16350 v_0 := b.Controls[0]
16351 if auxIntToInt64(v_0.AuxInt) != 0 {
16352 break
16353 }
16354 v_0_0 := v_0.Args[0]
16355 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16356 break
16357 }
16358 v_0_0_0 := v_0_0.Args[0]
16359 if v_0_0_0.Op != OpPPC64LessThan {
16360 break
16361 }
16362 cc := v_0_0_0.Args[0]
16363 b.resetWithControl(BlockPPC64LT, cc)
16364 return true
16365 }
16366
16367
16368 for b.Controls[0].Op == OpPPC64CMPconst {
16369 v_0 := b.Controls[0]
16370 if auxIntToInt64(v_0.AuxInt) != 0 {
16371 break
16372 }
16373 v_0_0 := v_0.Args[0]
16374 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16375 break
16376 }
16377 v_0_0_0 := v_0_0.Args[0]
16378 if v_0_0_0.Op != OpPPC64LessEqual {
16379 break
16380 }
16381 cc := v_0_0_0.Args[0]
16382 b.resetWithControl(BlockPPC64LE, cc)
16383 return true
16384 }
16385
16386
16387 for b.Controls[0].Op == OpPPC64CMPconst {
16388 v_0 := b.Controls[0]
16389 if auxIntToInt64(v_0.AuxInt) != 0 {
16390 break
16391 }
16392 v_0_0 := v_0.Args[0]
16393 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16394 break
16395 }
16396 v_0_0_0 := v_0_0.Args[0]
16397 if v_0_0_0.Op != OpPPC64GreaterThan {
16398 break
16399 }
16400 cc := v_0_0_0.Args[0]
16401 b.resetWithControl(BlockPPC64GT, cc)
16402 return true
16403 }
16404
16405
16406 for b.Controls[0].Op == OpPPC64CMPconst {
16407 v_0 := b.Controls[0]
16408 if auxIntToInt64(v_0.AuxInt) != 0 {
16409 break
16410 }
16411 v_0_0 := v_0.Args[0]
16412 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16413 break
16414 }
16415 v_0_0_0 := v_0_0.Args[0]
16416 if v_0_0_0.Op != OpPPC64GreaterEqual {
16417 break
16418 }
16419 cc := v_0_0_0.Args[0]
16420 b.resetWithControl(BlockPPC64GE, cc)
16421 return true
16422 }
16423
16424
16425 for b.Controls[0].Op == OpPPC64CMPconst {
16426 v_0 := b.Controls[0]
16427 if auxIntToInt64(v_0.AuxInt) != 0 {
16428 break
16429 }
16430 v_0_0 := v_0.Args[0]
16431 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16432 break
16433 }
16434 v_0_0_0 := v_0_0.Args[0]
16435 if v_0_0_0.Op != OpPPC64FLessThan {
16436 break
16437 }
16438 cc := v_0_0_0.Args[0]
16439 b.resetWithControl(BlockPPC64FLT, cc)
16440 return true
16441 }
16442
16443
16444 for b.Controls[0].Op == OpPPC64CMPconst {
16445 v_0 := b.Controls[0]
16446 if auxIntToInt64(v_0.AuxInt) != 0 {
16447 break
16448 }
16449 v_0_0 := v_0.Args[0]
16450 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16451 break
16452 }
16453 v_0_0_0 := v_0_0.Args[0]
16454 if v_0_0_0.Op != OpPPC64FLessEqual {
16455 break
16456 }
16457 cc := v_0_0_0.Args[0]
16458 b.resetWithControl(BlockPPC64FLE, cc)
16459 return true
16460 }
16461
16462
16463 for b.Controls[0].Op == OpPPC64CMPconst {
16464 v_0 := b.Controls[0]
16465 if auxIntToInt64(v_0.AuxInt) != 0 {
16466 break
16467 }
16468 v_0_0 := v_0.Args[0]
16469 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16470 break
16471 }
16472 v_0_0_0 := v_0_0.Args[0]
16473 if v_0_0_0.Op != OpPPC64FGreaterThan {
16474 break
16475 }
16476 cc := v_0_0_0.Args[0]
16477 b.resetWithControl(BlockPPC64FGT, cc)
16478 return true
16479 }
16480
16481
16482 for b.Controls[0].Op == OpPPC64CMPconst {
16483 v_0 := b.Controls[0]
16484 if auxIntToInt64(v_0.AuxInt) != 0 {
16485 break
16486 }
16487 v_0_0 := v_0.Args[0]
16488 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16489 break
16490 }
16491 v_0_0_0 := v_0_0.Args[0]
16492 if v_0_0_0.Op != OpPPC64FGreaterEqual {
16493 break
16494 }
16495 cc := v_0_0_0.Args[0]
16496 b.resetWithControl(BlockPPC64FGE, cc)
16497 return true
16498 }
16499
16500
16501 for b.Controls[0].Op == OpPPC64FlagEQ {
16502 b.Reset(BlockFirst)
16503 b.swapSuccessors()
16504 return true
16505 }
16506
16507
16508 for b.Controls[0].Op == OpPPC64FlagLT {
16509 b.Reset(BlockFirst)
16510 return true
16511 }
16512
16513
16514 for b.Controls[0].Op == OpPPC64FlagGT {
16515 b.Reset(BlockFirst)
16516 return true
16517 }
16518
16519
16520 for b.Controls[0].Op == OpPPC64InvertFlags {
16521 v_0 := b.Controls[0]
16522 cmp := v_0.Args[0]
16523 b.resetWithControl(BlockPPC64NE, cmp)
16524 return true
16525 }
16526
16527
16528
16529 for b.Controls[0].Op == OpPPC64CMPconst {
16530 v_0 := b.Controls[0]
16531 if auxIntToInt64(v_0.AuxInt) != 0 {
16532 break
16533 }
16534 z := v_0.Args[0]
16535 if z.Op != OpPPC64AND {
16536 break
16537 }
16538 _ = z.Args[1]
16539 z_0 := z.Args[0]
16540 z_1 := z.Args[1]
16541 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16542 x := z_0
16543 y := z_1
16544 if !(z.Uses == 1) {
16545 continue
16546 }
16547 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16548 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
16549 v1.AddArg2(x, y)
16550 v0.AddArg(v1)
16551 b.resetWithControl(BlockPPC64NE, v0)
16552 return true
16553 }
16554 break
16555 }
16556
16557
16558
16559 for b.Controls[0].Op == OpPPC64CMPconst {
16560 v_0 := b.Controls[0]
16561 if auxIntToInt64(v_0.AuxInt) != 0 {
16562 break
16563 }
16564 z := v_0.Args[0]
16565 if z.Op != OpPPC64OR {
16566 break
16567 }
16568 _ = z.Args[1]
16569 z_0 := z.Args[0]
16570 z_1 := z.Args[1]
16571 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16572 x := z_0
16573 y := z_1
16574 if !(z.Uses == 1) {
16575 continue
16576 }
16577 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16578 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
16579 v1.AddArg2(x, y)
16580 v0.AddArg(v1)
16581 b.resetWithControl(BlockPPC64NE, v0)
16582 return true
16583 }
16584 break
16585 }
16586
16587
16588
16589 for b.Controls[0].Op == OpPPC64CMPconst {
16590 v_0 := b.Controls[0]
16591 if auxIntToInt64(v_0.AuxInt) != 0 {
16592 break
16593 }
16594 z := v_0.Args[0]
16595 if z.Op != OpPPC64XOR {
16596 break
16597 }
16598 _ = z.Args[1]
16599 z_0 := z.Args[0]
16600 z_1 := z.Args[1]
16601 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16602 x := z_0
16603 y := z_1
16604 if !(z.Uses == 1) {
16605 continue
16606 }
16607 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16608 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
16609 v1.AddArg2(x, y)
16610 v0.AddArg(v1)
16611 b.resetWithControl(BlockPPC64NE, v0)
16612 return true
16613 }
16614 break
16615 }
16616 }
16617 return false
16618 }
16619
View as plain text