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 z := v_0
12623 if z.Op != OpPPC64MOVWreg {
12624 break
12625 }
12626 x := z.Args[0]
12627 if !(c < 32 && buildcfg.GOPPC64 >= 9) {
12628 break
12629 }
12630 v.reset(OpPPC64EXTSWSLconst)
12631 v.AuxInt = int64ToAuxInt(c)
12632 v.AddArg(x)
12633 return true
12634 }
12635 return false
12636 }
12637 func rewriteValuePPC64_OpPPC64SLW(v *Value) bool {
12638 v_1 := v.Args[1]
12639 v_0 := v.Args[0]
12640
12641
12642 for {
12643 x := v_0
12644 if v_1.Op != OpPPC64MOVDconst {
12645 break
12646 }
12647 c := auxIntToInt64(v_1.AuxInt)
12648 v.reset(OpPPC64SLWconst)
12649 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
12650 v.AddArg(x)
12651 return true
12652 }
12653 return false
12654 }
12655 func rewriteValuePPC64_OpPPC64SLWconst(v *Value) bool {
12656 v_0 := v.Args[0]
12657
12658
12659 for {
12660 s := auxIntToInt64(v.AuxInt)
12661 if v_0.Op != OpPPC64MOVWZreg {
12662 break
12663 }
12664 w := v_0.Args[0]
12665 v.reset(OpPPC64SLWconst)
12666 v.AuxInt = int64ToAuxInt(s)
12667 v.AddArg(w)
12668 return true
12669 }
12670
12671
12672
12673 for {
12674 c := auxIntToInt64(v.AuxInt)
12675 z := v_0
12676 if z.Op != OpPPC64MOVBZreg {
12677 break
12678 }
12679 x := z.Args[0]
12680 if !(z.Uses == 1 && c < 8) {
12681 break
12682 }
12683 v.reset(OpPPC64CLRLSLWI)
12684 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 24, 31, 32))
12685 v.AddArg(x)
12686 return true
12687 }
12688
12689
12690
12691 for {
12692 c := auxIntToInt64(v.AuxInt)
12693 z := v_0
12694 if z.Op != OpPPC64MOVHZreg {
12695 break
12696 }
12697 x := z.Args[0]
12698 if !(z.Uses == 1 && c < 16) {
12699 break
12700 }
12701 v.reset(OpPPC64CLRLSLWI)
12702 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 16, 31, 32))
12703 v.AddArg(x)
12704 return true
12705 }
12706
12707
12708
12709 for {
12710 c := auxIntToInt64(v.AuxInt)
12711 z := v_0
12712 if z.Op != OpPPC64ANDconst {
12713 break
12714 }
12715 d := auxIntToInt64(z.AuxInt)
12716 x := z.Args[0]
12717 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
12718 break
12719 }
12720 v.reset(OpPPC64CLRLSLWI)
12721 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
12722 v.AddArg(x)
12723 return true
12724 }
12725
12726
12727
12728 for {
12729 c := auxIntToInt64(v.AuxInt)
12730 z := v_0
12731 if z.Op != OpPPC64AND {
12732 break
12733 }
12734 _ = z.Args[1]
12735 z_0 := z.Args[0]
12736 z_1 := z.Args[1]
12737 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
12738 if z_0.Op != OpPPC64MOVDconst {
12739 continue
12740 }
12741 d := auxIntToInt64(z_0.AuxInt)
12742 x := z_1
12743 if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
12744 continue
12745 }
12746 v.reset(OpPPC64CLRLSLWI)
12747 v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
12748 v.AddArg(x)
12749 return true
12750 }
12751 break
12752 }
12753
12754
12755
12756 for {
12757 c := auxIntToInt64(v.AuxInt)
12758 z := v_0
12759 if z.Op != OpPPC64MOVWreg {
12760 break
12761 }
12762 x := z.Args[0]
12763 if !(c < 32 && buildcfg.GOPPC64 >= 9) {
12764 break
12765 }
12766 v.reset(OpPPC64EXTSWSLconst)
12767 v.AuxInt = int64ToAuxInt(c)
12768 v.AddArg(x)
12769 return true
12770 }
12771 return false
12772 }
12773 func rewriteValuePPC64_OpPPC64SRAD(v *Value) bool {
12774 v_1 := v.Args[1]
12775 v_0 := v.Args[0]
12776
12777
12778 for {
12779 x := v_0
12780 if v_1.Op != OpPPC64MOVDconst {
12781 break
12782 }
12783 c := auxIntToInt64(v_1.AuxInt)
12784 v.reset(OpPPC64SRADconst)
12785 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
12786 v.AddArg(x)
12787 return true
12788 }
12789 return false
12790 }
12791 func rewriteValuePPC64_OpPPC64SRAW(v *Value) bool {
12792 v_1 := v.Args[1]
12793 v_0 := v.Args[0]
12794
12795
12796 for {
12797 x := v_0
12798 if v_1.Op != OpPPC64MOVDconst {
12799 break
12800 }
12801 c := auxIntToInt64(v_1.AuxInt)
12802 v.reset(OpPPC64SRAWconst)
12803 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
12804 v.AddArg(x)
12805 return true
12806 }
12807 return false
12808 }
12809 func rewriteValuePPC64_OpPPC64SRD(v *Value) bool {
12810 v_1 := v.Args[1]
12811 v_0 := v.Args[0]
12812
12813
12814 for {
12815 x := v_0
12816 if v_1.Op != OpPPC64MOVDconst {
12817 break
12818 }
12819 c := auxIntToInt64(v_1.AuxInt)
12820 v.reset(OpPPC64SRDconst)
12821 v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
12822 v.AddArg(x)
12823 return true
12824 }
12825 return false
12826 }
12827 func rewriteValuePPC64_OpPPC64SRW(v *Value) bool {
12828 v_1 := v.Args[1]
12829 v_0 := v.Args[0]
12830
12831
12832 for {
12833 x := v_0
12834 if v_1.Op != OpPPC64MOVDconst {
12835 break
12836 }
12837 c := auxIntToInt64(v_1.AuxInt)
12838 v.reset(OpPPC64SRWconst)
12839 v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
12840 v.AddArg(x)
12841 return true
12842 }
12843 return false
12844 }
12845 func rewriteValuePPC64_OpPPC64SRWconst(v *Value) bool {
12846 v_0 := v.Args[0]
12847
12848
12849
12850 for {
12851 s := auxIntToInt64(v.AuxInt)
12852 if v_0.Op != OpPPC64ANDconst {
12853 break
12854 }
12855 m := auxIntToInt64(v_0.AuxInt)
12856 if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
12857 break
12858 }
12859 v.reset(OpPPC64MOVDconst)
12860 v.AuxInt = int64ToAuxInt(0)
12861 return true
12862 }
12863
12864
12865
12866 for {
12867 s := auxIntToInt64(v.AuxInt)
12868 if v_0.Op != OpPPC64ANDconst {
12869 break
12870 }
12871 m := auxIntToInt64(v_0.AuxInt)
12872 x := v_0.Args[0]
12873 if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
12874 break
12875 }
12876 v.reset(OpPPC64RLWINM)
12877 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
12878 v.AddArg(x)
12879 return true
12880 }
12881
12882
12883
12884 for {
12885 s := auxIntToInt64(v.AuxInt)
12886 if v_0.Op != OpPPC64AND {
12887 break
12888 }
12889 _ = v_0.Args[1]
12890 v_0_0 := v_0.Args[0]
12891 v_0_1 := v_0.Args[1]
12892 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
12893 if v_0_0.Op != OpPPC64MOVDconst {
12894 continue
12895 }
12896 m := auxIntToInt64(v_0_0.AuxInt)
12897 if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
12898 continue
12899 }
12900 v.reset(OpPPC64MOVDconst)
12901 v.AuxInt = int64ToAuxInt(0)
12902 return true
12903 }
12904 break
12905 }
12906
12907
12908
12909 for {
12910 s := auxIntToInt64(v.AuxInt)
12911 if v_0.Op != OpPPC64AND {
12912 break
12913 }
12914 _ = v_0.Args[1]
12915 v_0_0 := v_0.Args[0]
12916 v_0_1 := v_0.Args[1]
12917 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
12918 if v_0_0.Op != OpPPC64MOVDconst {
12919 continue
12920 }
12921 m := auxIntToInt64(v_0_0.AuxInt)
12922 x := v_0_1
12923 if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
12924 continue
12925 }
12926 v.reset(OpPPC64RLWINM)
12927 v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
12928 v.AddArg(x)
12929 return true
12930 }
12931 break
12932 }
12933 return false
12934 }
12935 func rewriteValuePPC64_OpPPC64SUB(v *Value) bool {
12936 v_1 := v.Args[1]
12937 v_0 := v.Args[0]
12938
12939
12940
12941 for {
12942 x := v_0
12943 if v_1.Op != OpPPC64MOVDconst {
12944 break
12945 }
12946 c := auxIntToInt64(v_1.AuxInt)
12947 if !(is32Bit(-c)) {
12948 break
12949 }
12950 v.reset(OpPPC64ADDconst)
12951 v.AuxInt = int64ToAuxInt(-c)
12952 v.AddArg(x)
12953 return true
12954 }
12955
12956
12957
12958 for {
12959 if v_0.Op != OpPPC64MOVDconst {
12960 break
12961 }
12962 c := auxIntToInt64(v_0.AuxInt)
12963 x := v_1
12964 if !(is32Bit(c)) {
12965 break
12966 }
12967 v.reset(OpPPC64SUBFCconst)
12968 v.AuxInt = int64ToAuxInt(c)
12969 v.AddArg(x)
12970 return true
12971 }
12972 return false
12973 }
12974 func rewriteValuePPC64_OpPPC64SUBE(v *Value) bool {
12975 v_2 := v.Args[2]
12976 v_1 := v.Args[1]
12977 v_0 := v.Args[0]
12978 b := v.Block
12979 typ := &b.Func.Config.Types
12980
12981
12982 for {
12983 x := v_0
12984 y := v_1
12985 if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
12986 break
12987 }
12988 v_2_0 := v_2.Args[0]
12989 if v_2_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_2_0.AuxInt) != 0 {
12990 break
12991 }
12992 v_2_0_0 := v_2_0.Args[0]
12993 if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
12994 break
12995 }
12996 v.reset(OpPPC64SUBC)
12997 v.AddArg2(x, y)
12998 return true
12999 }
13000 return false
13001 }
13002 func rewriteValuePPC64_OpPPC64SUBFCconst(v *Value) bool {
13003 v_0 := v.Args[0]
13004
13005
13006 for {
13007 c := auxIntToInt64(v.AuxInt)
13008 if v_0.Op != OpPPC64NEG {
13009 break
13010 }
13011 x := v_0.Args[0]
13012 v.reset(OpPPC64ADDconst)
13013 v.AuxInt = int64ToAuxInt(c)
13014 v.AddArg(x)
13015 return true
13016 }
13017
13018
13019
13020 for {
13021 c := auxIntToInt64(v.AuxInt)
13022 if v_0.Op != OpPPC64SUBFCconst {
13023 break
13024 }
13025 d := auxIntToInt64(v_0.AuxInt)
13026 x := v_0.Args[0]
13027 if !(is32Bit(c - d)) {
13028 break
13029 }
13030 v.reset(OpPPC64ADDconst)
13031 v.AuxInt = int64ToAuxInt(c - d)
13032 v.AddArg(x)
13033 return true
13034 }
13035
13036
13037 for {
13038 if auxIntToInt64(v.AuxInt) != 0 {
13039 break
13040 }
13041 x := v_0
13042 v.reset(OpPPC64NEG)
13043 v.AddArg(x)
13044 return true
13045 }
13046 return false
13047 }
13048 func rewriteValuePPC64_OpPPC64XOR(v *Value) bool {
13049 v_1 := v.Args[1]
13050 v_0 := v.Args[0]
13051
13052
13053 for {
13054 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13055 if v_0.Op != OpPPC64MOVDconst {
13056 continue
13057 }
13058 c := auxIntToInt64(v_0.AuxInt)
13059 if v_1.Op != OpPPC64MOVDconst {
13060 continue
13061 }
13062 d := auxIntToInt64(v_1.AuxInt)
13063 v.reset(OpPPC64MOVDconst)
13064 v.AuxInt = int64ToAuxInt(c ^ d)
13065 return true
13066 }
13067 break
13068 }
13069
13070
13071
13072 for {
13073 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
13074 x := v_0
13075 if v_1.Op != OpPPC64MOVDconst {
13076 continue
13077 }
13078 c := auxIntToInt64(v_1.AuxInt)
13079 if !(isU32Bit(c)) {
13080 continue
13081 }
13082 v.reset(OpPPC64XORconst)
13083 v.AuxInt = int64ToAuxInt(c)
13084 v.AddArg(x)
13085 return true
13086 }
13087 break
13088 }
13089 return false
13090 }
13091 func rewriteValuePPC64_OpPPC64XORconst(v *Value) bool {
13092 v_0 := v.Args[0]
13093
13094
13095 for {
13096 c := auxIntToInt64(v.AuxInt)
13097 if v_0.Op != OpPPC64XORconst {
13098 break
13099 }
13100 d := auxIntToInt64(v_0.AuxInt)
13101 x := v_0.Args[0]
13102 v.reset(OpPPC64XORconst)
13103 v.AuxInt = int64ToAuxInt(c ^ d)
13104 v.AddArg(x)
13105 return true
13106 }
13107
13108
13109 for {
13110 if auxIntToInt64(v.AuxInt) != 0 {
13111 break
13112 }
13113 x := v_0
13114 v.copyOf(x)
13115 return true
13116 }
13117
13118
13119 for {
13120 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBCR {
13121 break
13122 }
13123 n := auxIntToInt32(v_0.AuxInt)
13124 cmp := v_0.Args[0]
13125 v.reset(OpPPC64SETBC)
13126 v.AuxInt = int32ToAuxInt(n)
13127 v.AddArg(cmp)
13128 return true
13129 }
13130
13131
13132 for {
13133 if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBC {
13134 break
13135 }
13136 n := auxIntToInt32(v_0.AuxInt)
13137 cmp := v_0.Args[0]
13138 v.reset(OpPPC64SETBCR)
13139 v.AuxInt = int32ToAuxInt(n)
13140 v.AddArg(cmp)
13141 return true
13142 }
13143 return false
13144 }
13145 func rewriteValuePPC64_OpPopCount16(v *Value) bool {
13146 v_0 := v.Args[0]
13147 b := v.Block
13148 typ := &b.Func.Config.Types
13149
13150
13151 for {
13152 x := v_0
13153 v.reset(OpPPC64POPCNTW)
13154 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13155 v0.AddArg(x)
13156 v.AddArg(v0)
13157 return true
13158 }
13159 }
13160 func rewriteValuePPC64_OpPopCount32(v *Value) bool {
13161 v_0 := v.Args[0]
13162 b := v.Block
13163 typ := &b.Func.Config.Types
13164
13165
13166 for {
13167 x := v_0
13168 v.reset(OpPPC64POPCNTW)
13169 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
13170 v0.AddArg(x)
13171 v.AddArg(v0)
13172 return true
13173 }
13174 }
13175 func rewriteValuePPC64_OpPopCount8(v *Value) bool {
13176 v_0 := v.Args[0]
13177 b := v.Block
13178 typ := &b.Func.Config.Types
13179
13180
13181 for {
13182 x := v_0
13183 v.reset(OpPPC64POPCNTB)
13184 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
13185 v0.AddArg(x)
13186 v.AddArg(v0)
13187 return true
13188 }
13189 }
13190 func rewriteValuePPC64_OpPrefetchCache(v *Value) bool {
13191 v_1 := v.Args[1]
13192 v_0 := v.Args[0]
13193
13194
13195 for {
13196 ptr := v_0
13197 mem := v_1
13198 v.reset(OpPPC64DCBT)
13199 v.AuxInt = int64ToAuxInt(0)
13200 v.AddArg2(ptr, mem)
13201 return true
13202 }
13203 }
13204 func rewriteValuePPC64_OpPrefetchCacheStreamed(v *Value) bool {
13205 v_1 := v.Args[1]
13206 v_0 := v.Args[0]
13207
13208
13209 for {
13210 ptr := v_0
13211 mem := v_1
13212 v.reset(OpPPC64DCBT)
13213 v.AuxInt = int64ToAuxInt(16)
13214 v.AddArg2(ptr, mem)
13215 return true
13216 }
13217 }
13218 func rewriteValuePPC64_OpRotateLeft16(v *Value) bool {
13219 v_1 := v.Args[1]
13220 v_0 := v.Args[0]
13221 b := v.Block
13222 typ := &b.Func.Config.Types
13223
13224
13225 for {
13226 t := v.Type
13227 x := v_0
13228 if v_1.Op != OpPPC64MOVDconst {
13229 break
13230 }
13231 c := auxIntToInt64(v_1.AuxInt)
13232 v.reset(OpOr16)
13233 v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
13234 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13235 v1.AuxInt = int64ToAuxInt(c & 15)
13236 v0.AddArg2(x, v1)
13237 v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
13238 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13239 v3.AuxInt = int64ToAuxInt(-c & 15)
13240 v2.AddArg2(x, v3)
13241 v.AddArg2(v0, v2)
13242 return true
13243 }
13244 return false
13245 }
13246 func rewriteValuePPC64_OpRotateLeft8(v *Value) bool {
13247 v_1 := v.Args[1]
13248 v_0 := v.Args[0]
13249 b := v.Block
13250 typ := &b.Func.Config.Types
13251
13252
13253 for {
13254 t := v.Type
13255 x := v_0
13256 if v_1.Op != OpPPC64MOVDconst {
13257 break
13258 }
13259 c := auxIntToInt64(v_1.AuxInt)
13260 v.reset(OpOr8)
13261 v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
13262 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13263 v1.AuxInt = int64ToAuxInt(c & 7)
13264 v0.AddArg2(x, v1)
13265 v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
13266 v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13267 v3.AuxInt = int64ToAuxInt(-c & 7)
13268 v2.AddArg2(x, v3)
13269 v.AddArg2(v0, v2)
13270 return true
13271 }
13272 return false
13273 }
13274 func rewriteValuePPC64_OpRsh16Ux16(v *Value) bool {
13275 v_1 := v.Args[1]
13276 v_0 := v.Args[0]
13277 b := v.Block
13278 typ := &b.Func.Config.Types
13279
13280
13281
13282 for {
13283 x := v_0
13284 y := v_1
13285 if !(shiftIsBounded(v)) {
13286 break
13287 }
13288 v.reset(OpPPC64SRD)
13289 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13290 v0.AddArg(x)
13291 v.AddArg2(v0, y)
13292 return true
13293 }
13294
13295
13296 for {
13297 t := v.Type
13298 x := v_0
13299 y := v_1
13300 v.reset(OpPPC64ISEL)
13301 v.AuxInt = int32ToAuxInt(2)
13302 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13303 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13304 v1.AddArg(x)
13305 v0.AddArg2(v1, y)
13306 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13307 v2.AuxInt = int64ToAuxInt(0)
13308 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13309 v3.AuxInt = int64ToAuxInt(0)
13310 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13311 v4.AuxInt = int64ToAuxInt(0xFFF0)
13312 v4.AddArg(y)
13313 v3.AddArg(v4)
13314 v.AddArg3(v0, v2, v3)
13315 return true
13316 }
13317 }
13318 func rewriteValuePPC64_OpRsh16Ux32(v *Value) bool {
13319 v_1 := v.Args[1]
13320 v_0 := v.Args[0]
13321 b := v.Block
13322 typ := &b.Func.Config.Types
13323
13324
13325
13326 for {
13327 x := v_0
13328 y := v_1
13329 if !(shiftIsBounded(v)) {
13330 break
13331 }
13332 v.reset(OpPPC64SRD)
13333 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13334 v0.AddArg(x)
13335 v.AddArg2(v0, y)
13336 return true
13337 }
13338
13339
13340 for {
13341 t := v.Type
13342 x := v_0
13343 y := v_1
13344 v.reset(OpPPC64ISEL)
13345 v.AuxInt = int32ToAuxInt(0)
13346 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13347 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13348 v1.AddArg(x)
13349 v0.AddArg2(v1, y)
13350 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13351 v2.AuxInt = int64ToAuxInt(0)
13352 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13353 v3.AuxInt = int32ToAuxInt(16)
13354 v3.AddArg(y)
13355 v.AddArg3(v0, v2, v3)
13356 return true
13357 }
13358 }
13359 func rewriteValuePPC64_OpRsh16Ux64(v *Value) bool {
13360 v_1 := v.Args[1]
13361 v_0 := v.Args[0]
13362 b := v.Block
13363 typ := &b.Func.Config.Types
13364
13365
13366
13367 for {
13368 x := v_0
13369 if v_1.Op != OpPPC64MOVDconst {
13370 break
13371 }
13372 c := auxIntToInt64(v_1.AuxInt)
13373 if !(uint64(c) < 16) {
13374 break
13375 }
13376 v.reset(OpPPC64SRWconst)
13377 v.AuxInt = int64ToAuxInt(c)
13378 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
13379 v0.AddArg(x)
13380 v.AddArg(v0)
13381 return true
13382 }
13383
13384
13385
13386 for {
13387 x := v_0
13388 y := v_1
13389 if !(shiftIsBounded(v)) {
13390 break
13391 }
13392 v.reset(OpPPC64SRD)
13393 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13394 v0.AddArg(x)
13395 v.AddArg2(v0, y)
13396 return true
13397 }
13398
13399
13400 for {
13401 t := v.Type
13402 x := v_0
13403 y := v_1
13404 v.reset(OpPPC64ISEL)
13405 v.AuxInt = int32ToAuxInt(0)
13406 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13407 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13408 v1.AddArg(x)
13409 v0.AddArg2(v1, y)
13410 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13411 v2.AuxInt = int64ToAuxInt(0)
13412 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13413 v3.AuxInt = int64ToAuxInt(16)
13414 v3.AddArg(y)
13415 v.AddArg3(v0, v2, v3)
13416 return true
13417 }
13418 }
13419 func rewriteValuePPC64_OpRsh16Ux8(v *Value) bool {
13420 v_1 := v.Args[1]
13421 v_0 := v.Args[0]
13422 b := v.Block
13423 typ := &b.Func.Config.Types
13424
13425
13426
13427 for {
13428 x := v_0
13429 y := v_1
13430 if !(shiftIsBounded(v)) {
13431 break
13432 }
13433 v.reset(OpPPC64SRD)
13434 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13435 v0.AddArg(x)
13436 v.AddArg2(v0, y)
13437 return true
13438 }
13439
13440
13441 for {
13442 t := v.Type
13443 x := v_0
13444 y := v_1
13445 v.reset(OpPPC64ISEL)
13446 v.AuxInt = int32ToAuxInt(2)
13447 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
13448 v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
13449 v1.AddArg(x)
13450 v0.AddArg2(v1, y)
13451 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13452 v2.AuxInt = int64ToAuxInt(0)
13453 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13454 v3.AuxInt = int64ToAuxInt(0)
13455 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13456 v4.AuxInt = int64ToAuxInt(0x00F0)
13457 v4.AddArg(y)
13458 v3.AddArg(v4)
13459 v.AddArg3(v0, v2, v3)
13460 return true
13461 }
13462 }
13463 func rewriteValuePPC64_OpRsh16x16(v *Value) bool {
13464 v_1 := v.Args[1]
13465 v_0 := v.Args[0]
13466 b := v.Block
13467 typ := &b.Func.Config.Types
13468
13469
13470
13471 for {
13472 x := v_0
13473 y := v_1
13474 if !(shiftIsBounded(v)) {
13475 break
13476 }
13477 v.reset(OpPPC64SRAD)
13478 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13479 v0.AddArg(x)
13480 v.AddArg2(v0, y)
13481 return true
13482 }
13483
13484
13485 for {
13486 t := v.Type
13487 x := v_0
13488 y := v_1
13489 v.reset(OpPPC64ISEL)
13490 v.AuxInt = int32ToAuxInt(2)
13491 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13492 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13493 v1.AddArg(x)
13494 v0.AddArg2(v1, y)
13495 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13496 v2.AuxInt = int64ToAuxInt(15)
13497 v2.AddArg(v1)
13498 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13499 v3.AuxInt = int64ToAuxInt(0)
13500 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13501 v4.AuxInt = int64ToAuxInt(0xFFF0)
13502 v4.AddArg(y)
13503 v3.AddArg(v4)
13504 v.AddArg3(v0, v2, v3)
13505 return true
13506 }
13507 }
13508 func rewriteValuePPC64_OpRsh16x32(v *Value) bool {
13509 v_1 := v.Args[1]
13510 v_0 := v.Args[0]
13511 b := v.Block
13512 typ := &b.Func.Config.Types
13513
13514
13515
13516 for {
13517 x := v_0
13518 y := v_1
13519 if !(shiftIsBounded(v)) {
13520 break
13521 }
13522 v.reset(OpPPC64SRAD)
13523 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13524 v0.AddArg(x)
13525 v.AddArg2(v0, y)
13526 return true
13527 }
13528
13529
13530 for {
13531 t := v.Type
13532 x := v_0
13533 y := v_1
13534 v.reset(OpPPC64ISEL)
13535 v.AuxInt = int32ToAuxInt(0)
13536 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13537 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13538 v1.AddArg(x)
13539 v0.AddArg2(v1, y)
13540 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13541 v2.AuxInt = int64ToAuxInt(15)
13542 v2.AddArg(v1)
13543 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13544 v3.AuxInt = int32ToAuxInt(16)
13545 v3.AddArg(y)
13546 v.AddArg3(v0, v2, v3)
13547 return true
13548 }
13549 }
13550 func rewriteValuePPC64_OpRsh16x64(v *Value) bool {
13551 v_1 := v.Args[1]
13552 v_0 := v.Args[0]
13553 b := v.Block
13554 typ := &b.Func.Config.Types
13555
13556
13557
13558 for {
13559 x := v_0
13560 if v_1.Op != OpPPC64MOVDconst {
13561 break
13562 }
13563 c := auxIntToInt64(v_1.AuxInt)
13564 if !(uint64(c) >= 16) {
13565 break
13566 }
13567 v.reset(OpPPC64SRAWconst)
13568 v.AuxInt = int64ToAuxInt(63)
13569 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
13570 v0.AddArg(x)
13571 v.AddArg(v0)
13572 return true
13573 }
13574
13575
13576
13577 for {
13578 x := v_0
13579 if v_1.Op != OpPPC64MOVDconst {
13580 break
13581 }
13582 c := auxIntToInt64(v_1.AuxInt)
13583 if !(uint64(c) < 16) {
13584 break
13585 }
13586 v.reset(OpPPC64SRAWconst)
13587 v.AuxInt = int64ToAuxInt(c)
13588 v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
13589 v0.AddArg(x)
13590 v.AddArg(v0)
13591 return true
13592 }
13593
13594
13595
13596 for {
13597 x := v_0
13598 y := v_1
13599 if !(shiftIsBounded(v)) {
13600 break
13601 }
13602 v.reset(OpPPC64SRAD)
13603 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13604 v0.AddArg(x)
13605 v.AddArg2(v0, y)
13606 return true
13607 }
13608
13609
13610 for {
13611 t := v.Type
13612 x := v_0
13613 y := v_1
13614 v.reset(OpPPC64ISEL)
13615 v.AuxInt = int32ToAuxInt(0)
13616 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13617 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13618 v1.AddArg(x)
13619 v0.AddArg2(v1, y)
13620 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13621 v2.AuxInt = int64ToAuxInt(15)
13622 v2.AddArg(v1)
13623 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13624 v3.AuxInt = int64ToAuxInt(16)
13625 v3.AddArg(y)
13626 v.AddArg3(v0, v2, v3)
13627 return true
13628 }
13629 }
13630 func rewriteValuePPC64_OpRsh16x8(v *Value) bool {
13631 v_1 := v.Args[1]
13632 v_0 := v.Args[0]
13633 b := v.Block
13634 typ := &b.Func.Config.Types
13635
13636
13637
13638 for {
13639 x := v_0
13640 y := v_1
13641 if !(shiftIsBounded(v)) {
13642 break
13643 }
13644 v.reset(OpPPC64SRAD)
13645 v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13646 v0.AddArg(x)
13647 v.AddArg2(v0, y)
13648 return true
13649 }
13650
13651
13652 for {
13653 t := v.Type
13654 x := v_0
13655 y := v_1
13656 v.reset(OpPPC64ISEL)
13657 v.AuxInt = int32ToAuxInt(2)
13658 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
13659 v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
13660 v1.AddArg(x)
13661 v0.AddArg2(v1, y)
13662 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
13663 v2.AuxInt = int64ToAuxInt(15)
13664 v2.AddArg(v1)
13665 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13666 v3.AuxInt = int64ToAuxInt(0)
13667 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13668 v4.AuxInt = int64ToAuxInt(0x00F0)
13669 v4.AddArg(y)
13670 v3.AddArg(v4)
13671 v.AddArg3(v0, v2, v3)
13672 return true
13673 }
13674 }
13675 func rewriteValuePPC64_OpRsh32Ux16(v *Value) bool {
13676 v_1 := v.Args[1]
13677 v_0 := v.Args[0]
13678 b := v.Block
13679 typ := &b.Func.Config.Types
13680
13681
13682
13683 for {
13684 x := v_0
13685 y := v_1
13686 if !(shiftIsBounded(v)) {
13687 break
13688 }
13689 v.reset(OpPPC64SRW)
13690 v.AddArg2(x, y)
13691 return true
13692 }
13693
13694
13695 for {
13696 t := v.Type
13697 x := v_0
13698 y := v_1
13699 v.reset(OpPPC64ISEL)
13700 v.AuxInt = int32ToAuxInt(2)
13701 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13702 v0.AddArg2(x, y)
13703 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13704 v1.AuxInt = int64ToAuxInt(0)
13705 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13706 v2.AuxInt = int64ToAuxInt(0)
13707 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13708 v3.AuxInt = int64ToAuxInt(0xFFE0)
13709 v3.AddArg(y)
13710 v2.AddArg(v3)
13711 v.AddArg3(v0, v1, v2)
13712 return true
13713 }
13714 }
13715 func rewriteValuePPC64_OpRsh32Ux32(v *Value) bool {
13716 v_1 := v.Args[1]
13717 v_0 := v.Args[0]
13718 b := v.Block
13719 typ := &b.Func.Config.Types
13720
13721
13722
13723 for {
13724 x := v_0
13725 y := v_1
13726 if !(shiftIsBounded(v)) {
13727 break
13728 }
13729 v.reset(OpPPC64SRW)
13730 v.AddArg2(x, y)
13731 return true
13732 }
13733
13734
13735 for {
13736 t := v.Type
13737 x := v_0
13738 y := v_1
13739 v.reset(OpPPC64ISEL)
13740 v.AuxInt = int32ToAuxInt(0)
13741 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13742 v0.AddArg2(x, y)
13743 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13744 v1.AuxInt = int64ToAuxInt(0)
13745 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13746 v2.AuxInt = int32ToAuxInt(32)
13747 v2.AddArg(y)
13748 v.AddArg3(v0, v1, v2)
13749 return true
13750 }
13751 }
13752 func rewriteValuePPC64_OpRsh32Ux64(v *Value) bool {
13753 v_1 := v.Args[1]
13754 v_0 := v.Args[0]
13755 b := v.Block
13756 typ := &b.Func.Config.Types
13757
13758
13759
13760 for {
13761 x := v_0
13762 if v_1.Op != OpPPC64MOVDconst {
13763 break
13764 }
13765 c := auxIntToInt64(v_1.AuxInt)
13766 if !(uint64(c) < 32) {
13767 break
13768 }
13769 v.reset(OpPPC64SRWconst)
13770 v.AuxInt = int64ToAuxInt(c)
13771 v.AddArg(x)
13772 return true
13773 }
13774
13775
13776
13777 for {
13778 x := v_0
13779 y := v_1
13780 if !(shiftIsBounded(v)) {
13781 break
13782 }
13783 v.reset(OpPPC64SRW)
13784 v.AddArg2(x, y)
13785 return true
13786 }
13787
13788
13789 for {
13790 t := v.Type
13791 x := v_0
13792 y := v_1
13793 v.reset(OpPPC64ISEL)
13794 v.AuxInt = int32ToAuxInt(0)
13795 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13796 v0.AddArg2(x, y)
13797 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13798 v1.AuxInt = int64ToAuxInt(0)
13799 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13800 v2.AuxInt = int64ToAuxInt(32)
13801 v2.AddArg(y)
13802 v.AddArg3(v0, v1, v2)
13803 return true
13804 }
13805 }
13806 func rewriteValuePPC64_OpRsh32Ux8(v *Value) bool {
13807 v_1 := v.Args[1]
13808 v_0 := v.Args[0]
13809 b := v.Block
13810 typ := &b.Func.Config.Types
13811
13812
13813
13814 for {
13815 x := v_0
13816 y := v_1
13817 if !(shiftIsBounded(v)) {
13818 break
13819 }
13820 v.reset(OpPPC64SRW)
13821 v.AddArg2(x, y)
13822 return true
13823 }
13824
13825
13826 for {
13827 t := v.Type
13828 x := v_0
13829 y := v_1
13830 v.reset(OpPPC64ISEL)
13831 v.AuxInt = int32ToAuxInt(2)
13832 v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
13833 v0.AddArg2(x, y)
13834 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
13835 v1.AuxInt = int64ToAuxInt(0)
13836 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13837 v2.AuxInt = int64ToAuxInt(0)
13838 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13839 v3.AuxInt = int64ToAuxInt(0x00E0)
13840 v3.AddArg(y)
13841 v2.AddArg(v3)
13842 v.AddArg3(v0, v1, v2)
13843 return true
13844 }
13845 }
13846 func rewriteValuePPC64_OpRsh32x16(v *Value) bool {
13847 v_1 := v.Args[1]
13848 v_0 := v.Args[0]
13849 b := v.Block
13850 typ := &b.Func.Config.Types
13851
13852
13853
13854 for {
13855 x := v_0
13856 y := v_1
13857 if !(shiftIsBounded(v)) {
13858 break
13859 }
13860 v.reset(OpPPC64SRAW)
13861 v.AddArg2(x, y)
13862 return true
13863 }
13864
13865
13866 for {
13867 t := v.Type
13868 x := v_0
13869 y := v_1
13870 v.reset(OpPPC64ISEL)
13871 v.AuxInt = int32ToAuxInt(2)
13872 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
13873 v0.AddArg2(x, y)
13874 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
13875 v1.AuxInt = int64ToAuxInt(31)
13876 v1.AddArg(x)
13877 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
13878 v2.AuxInt = int64ToAuxInt(0)
13879 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
13880 v3.AuxInt = int64ToAuxInt(0xFFE0)
13881 v3.AddArg(y)
13882 v2.AddArg(v3)
13883 v.AddArg3(v0, v1, v2)
13884 return true
13885 }
13886 }
13887 func rewriteValuePPC64_OpRsh32x32(v *Value) bool {
13888 v_1 := v.Args[1]
13889 v_0 := v.Args[0]
13890 b := v.Block
13891
13892
13893
13894 for {
13895 x := v_0
13896 y := v_1
13897 if !(shiftIsBounded(v)) {
13898 break
13899 }
13900 v.reset(OpPPC64SRAW)
13901 v.AddArg2(x, y)
13902 return true
13903 }
13904
13905
13906 for {
13907 t := v.Type
13908 x := v_0
13909 y := v_1
13910 v.reset(OpPPC64ISEL)
13911 v.AuxInt = int32ToAuxInt(0)
13912 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
13913 v0.AddArg2(x, y)
13914 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
13915 v1.AuxInt = int64ToAuxInt(31)
13916 v1.AddArg(x)
13917 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
13918 v2.AuxInt = int32ToAuxInt(32)
13919 v2.AddArg(y)
13920 v.AddArg3(v0, v1, v2)
13921 return true
13922 }
13923 }
13924 func rewriteValuePPC64_OpRsh32x64(v *Value) bool {
13925 v_1 := v.Args[1]
13926 v_0 := v.Args[0]
13927 b := v.Block
13928
13929
13930
13931 for {
13932 x := v_0
13933 if v_1.Op != OpPPC64MOVDconst {
13934 break
13935 }
13936 c := auxIntToInt64(v_1.AuxInt)
13937 if !(uint64(c) >= 32) {
13938 break
13939 }
13940 v.reset(OpPPC64SRAWconst)
13941 v.AuxInt = int64ToAuxInt(63)
13942 v.AddArg(x)
13943 return true
13944 }
13945
13946
13947
13948 for {
13949 x := v_0
13950 if v_1.Op != OpPPC64MOVDconst {
13951 break
13952 }
13953 c := auxIntToInt64(v_1.AuxInt)
13954 if !(uint64(c) < 32) {
13955 break
13956 }
13957 v.reset(OpPPC64SRAWconst)
13958 v.AuxInt = int64ToAuxInt(c)
13959 v.AddArg(x)
13960 return true
13961 }
13962
13963
13964
13965 for {
13966 x := v_0
13967 y := v_1
13968 if !(shiftIsBounded(v)) {
13969 break
13970 }
13971 v.reset(OpPPC64SRAW)
13972 v.AddArg2(x, y)
13973 return true
13974 }
13975
13976
13977 for {
13978 t := v.Type
13979 x := v_0
13980 y := v_1
13981 v.reset(OpPPC64ISEL)
13982 v.AuxInt = int32ToAuxInt(0)
13983 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
13984 v0.AddArg2(x, y)
13985 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
13986 v1.AuxInt = int64ToAuxInt(31)
13987 v1.AddArg(x)
13988 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
13989 v2.AuxInt = int64ToAuxInt(32)
13990 v2.AddArg(y)
13991 v.AddArg3(v0, v1, v2)
13992 return true
13993 }
13994 }
13995 func rewriteValuePPC64_OpRsh32x8(v *Value) bool {
13996 v_1 := v.Args[1]
13997 v_0 := v.Args[0]
13998 b := v.Block
13999 typ := &b.Func.Config.Types
14000
14001
14002
14003 for {
14004 x := v_0
14005 y := v_1
14006 if !(shiftIsBounded(v)) {
14007 break
14008 }
14009 v.reset(OpPPC64SRAW)
14010 v.AddArg2(x, y)
14011 return true
14012 }
14013
14014
14015 for {
14016 t := v.Type
14017 x := v_0
14018 y := v_1
14019 v.reset(OpPPC64ISEL)
14020 v.AuxInt = int32ToAuxInt(2)
14021 v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
14022 v0.AddArg2(x, y)
14023 v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
14024 v1.AuxInt = int64ToAuxInt(31)
14025 v1.AddArg(x)
14026 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14027 v2.AuxInt = int64ToAuxInt(0)
14028 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14029 v3.AuxInt = int64ToAuxInt(0x00E0)
14030 v3.AddArg(y)
14031 v2.AddArg(v3)
14032 v.AddArg3(v0, v1, v2)
14033 return true
14034 }
14035 }
14036 func rewriteValuePPC64_OpRsh64Ux16(v *Value) bool {
14037 v_1 := v.Args[1]
14038 v_0 := v.Args[0]
14039 b := v.Block
14040 typ := &b.Func.Config.Types
14041
14042
14043
14044 for {
14045 x := v_0
14046 y := v_1
14047 if !(shiftIsBounded(v)) {
14048 break
14049 }
14050 v.reset(OpPPC64SRD)
14051 v.AddArg2(x, y)
14052 return true
14053 }
14054
14055
14056 for {
14057 t := v.Type
14058 x := v_0
14059 y := v_1
14060 v.reset(OpPPC64ISEL)
14061 v.AuxInt = int32ToAuxInt(2)
14062 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14063 v0.AddArg2(x, y)
14064 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14065 v1.AuxInt = int64ToAuxInt(0)
14066 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14067 v2.AuxInt = int64ToAuxInt(0)
14068 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14069 v3.AuxInt = int64ToAuxInt(0xFFC0)
14070 v3.AddArg(y)
14071 v2.AddArg(v3)
14072 v.AddArg3(v0, v1, v2)
14073 return true
14074 }
14075 }
14076 func rewriteValuePPC64_OpRsh64Ux32(v *Value) bool {
14077 v_1 := v.Args[1]
14078 v_0 := v.Args[0]
14079 b := v.Block
14080 typ := &b.Func.Config.Types
14081
14082
14083
14084 for {
14085 x := v_0
14086 y := v_1
14087 if !(shiftIsBounded(v)) {
14088 break
14089 }
14090 v.reset(OpPPC64SRD)
14091 v.AddArg2(x, y)
14092 return true
14093 }
14094
14095
14096 for {
14097 t := v.Type
14098 x := v_0
14099 y := v_1
14100 v.reset(OpPPC64ISEL)
14101 v.AuxInt = int32ToAuxInt(0)
14102 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14103 v0.AddArg2(x, y)
14104 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14105 v1.AuxInt = int64ToAuxInt(0)
14106 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
14107 v2.AuxInt = int32ToAuxInt(64)
14108 v2.AddArg(y)
14109 v.AddArg3(v0, v1, v2)
14110 return true
14111 }
14112 }
14113 func rewriteValuePPC64_OpRsh64Ux64(v *Value) bool {
14114 v_1 := v.Args[1]
14115 v_0 := v.Args[0]
14116 b := v.Block
14117 typ := &b.Func.Config.Types
14118
14119
14120
14121 for {
14122 x := v_0
14123 if v_1.Op != OpPPC64MOVDconst {
14124 break
14125 }
14126 c := auxIntToInt64(v_1.AuxInt)
14127 if !(uint64(c) < 64) {
14128 break
14129 }
14130 v.reset(OpPPC64SRDconst)
14131 v.AuxInt = int64ToAuxInt(c)
14132 v.AddArg(x)
14133 return true
14134 }
14135
14136
14137
14138 for {
14139 x := v_0
14140 y := v_1
14141 if !(shiftIsBounded(v)) {
14142 break
14143 }
14144 v.reset(OpPPC64SRD)
14145 v.AddArg2(x, y)
14146 return true
14147 }
14148
14149
14150 for {
14151 t := v.Type
14152 x := v_0
14153 y := v_1
14154 v.reset(OpPPC64ISEL)
14155 v.AuxInt = int32ToAuxInt(0)
14156 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14157 v0.AddArg2(x, y)
14158 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14159 v1.AuxInt = int64ToAuxInt(0)
14160 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
14161 v2.AuxInt = int64ToAuxInt(64)
14162 v2.AddArg(y)
14163 v.AddArg3(v0, v1, v2)
14164 return true
14165 }
14166 }
14167 func rewriteValuePPC64_OpRsh64Ux8(v *Value) bool {
14168 v_1 := v.Args[1]
14169 v_0 := v.Args[0]
14170 b := v.Block
14171 typ := &b.Func.Config.Types
14172
14173
14174
14175 for {
14176 x := v_0
14177 y := v_1
14178 if !(shiftIsBounded(v)) {
14179 break
14180 }
14181 v.reset(OpPPC64SRD)
14182 v.AddArg2(x, y)
14183 return true
14184 }
14185
14186
14187 for {
14188 t := v.Type
14189 x := v_0
14190 y := v_1
14191 v.reset(OpPPC64ISEL)
14192 v.AuxInt = int32ToAuxInt(2)
14193 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14194 v0.AddArg2(x, y)
14195 v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14196 v1.AuxInt = int64ToAuxInt(0)
14197 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14198 v2.AuxInt = int64ToAuxInt(0)
14199 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14200 v3.AuxInt = int64ToAuxInt(0x00C0)
14201 v3.AddArg(y)
14202 v2.AddArg(v3)
14203 v.AddArg3(v0, v1, v2)
14204 return true
14205 }
14206 }
14207 func rewriteValuePPC64_OpRsh64x16(v *Value) bool {
14208 v_1 := v.Args[1]
14209 v_0 := v.Args[0]
14210 b := v.Block
14211 typ := &b.Func.Config.Types
14212
14213
14214
14215 for {
14216 x := v_0
14217 y := v_1
14218 if !(shiftIsBounded(v)) {
14219 break
14220 }
14221 v.reset(OpPPC64SRAD)
14222 v.AddArg2(x, y)
14223 return true
14224 }
14225
14226
14227 for {
14228 t := v.Type
14229 x := v_0
14230 y := v_1
14231 v.reset(OpPPC64ISEL)
14232 v.AuxInt = int32ToAuxInt(2)
14233 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14234 v0.AddArg2(x, y)
14235 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14236 v1.AuxInt = int64ToAuxInt(63)
14237 v1.AddArg(x)
14238 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14239 v2.AuxInt = int64ToAuxInt(0)
14240 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14241 v3.AuxInt = int64ToAuxInt(0xFFC0)
14242 v3.AddArg(y)
14243 v2.AddArg(v3)
14244 v.AddArg3(v0, v1, v2)
14245 return true
14246 }
14247 }
14248 func rewriteValuePPC64_OpRsh64x32(v *Value) bool {
14249 v_1 := v.Args[1]
14250 v_0 := v.Args[0]
14251 b := v.Block
14252
14253
14254
14255 for {
14256 x := v_0
14257 y := v_1
14258 if !(shiftIsBounded(v)) {
14259 break
14260 }
14261 v.reset(OpPPC64SRAD)
14262 v.AddArg2(x, y)
14263 return true
14264 }
14265
14266
14267 for {
14268 t := v.Type
14269 x := v_0
14270 y := v_1
14271 v.reset(OpPPC64ISEL)
14272 v.AuxInt = int32ToAuxInt(0)
14273 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14274 v0.AddArg2(x, y)
14275 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14276 v1.AuxInt = int64ToAuxInt(63)
14277 v1.AddArg(x)
14278 v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
14279 v2.AuxInt = int32ToAuxInt(64)
14280 v2.AddArg(y)
14281 v.AddArg3(v0, v1, v2)
14282 return true
14283 }
14284 }
14285 func rewriteValuePPC64_OpRsh64x64(v *Value) bool {
14286 v_1 := v.Args[1]
14287 v_0 := v.Args[0]
14288 b := v.Block
14289
14290
14291
14292 for {
14293 x := v_0
14294 if v_1.Op != OpPPC64MOVDconst {
14295 break
14296 }
14297 c := auxIntToInt64(v_1.AuxInt)
14298 if !(uint64(c) >= 64) {
14299 break
14300 }
14301 v.reset(OpPPC64SRADconst)
14302 v.AuxInt = int64ToAuxInt(63)
14303 v.AddArg(x)
14304 return true
14305 }
14306
14307
14308
14309 for {
14310 x := v_0
14311 if v_1.Op != OpPPC64MOVDconst {
14312 break
14313 }
14314 c := auxIntToInt64(v_1.AuxInt)
14315 if !(uint64(c) < 64) {
14316 break
14317 }
14318 v.reset(OpPPC64SRADconst)
14319 v.AuxInt = int64ToAuxInt(c)
14320 v.AddArg(x)
14321 return true
14322 }
14323
14324
14325
14326 for {
14327 x := v_0
14328 y := v_1
14329 if !(shiftIsBounded(v)) {
14330 break
14331 }
14332 v.reset(OpPPC64SRAD)
14333 v.AddArg2(x, y)
14334 return true
14335 }
14336
14337
14338 for {
14339 t := v.Type
14340 x := v_0
14341 y := v_1
14342 v.reset(OpPPC64ISEL)
14343 v.AuxInt = int32ToAuxInt(0)
14344 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14345 v0.AddArg2(x, y)
14346 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14347 v1.AuxInt = int64ToAuxInt(63)
14348 v1.AddArg(x)
14349 v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
14350 v2.AuxInt = int64ToAuxInt(64)
14351 v2.AddArg(y)
14352 v.AddArg3(v0, v1, v2)
14353 return true
14354 }
14355 }
14356 func rewriteValuePPC64_OpRsh64x8(v *Value) bool {
14357 v_1 := v.Args[1]
14358 v_0 := v.Args[0]
14359 b := v.Block
14360 typ := &b.Func.Config.Types
14361
14362
14363
14364 for {
14365 x := v_0
14366 y := v_1
14367 if !(shiftIsBounded(v)) {
14368 break
14369 }
14370 v.reset(OpPPC64SRAD)
14371 v.AddArg2(x, y)
14372 return true
14373 }
14374
14375
14376 for {
14377 t := v.Type
14378 x := v_0
14379 y := v_1
14380 v.reset(OpPPC64ISEL)
14381 v.AuxInt = int32ToAuxInt(2)
14382 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14383 v0.AddArg2(x, y)
14384 v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14385 v1.AuxInt = int64ToAuxInt(63)
14386 v1.AddArg(x)
14387 v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14388 v2.AuxInt = int64ToAuxInt(0)
14389 v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14390 v3.AuxInt = int64ToAuxInt(0x00C0)
14391 v3.AddArg(y)
14392 v2.AddArg(v3)
14393 v.AddArg3(v0, v1, v2)
14394 return true
14395 }
14396 }
14397 func rewriteValuePPC64_OpRsh8Ux16(v *Value) bool {
14398 v_1 := v.Args[1]
14399 v_0 := v.Args[0]
14400 b := v.Block
14401 typ := &b.Func.Config.Types
14402
14403
14404
14405 for {
14406 x := v_0
14407 y := v_1
14408 if !(shiftIsBounded(v)) {
14409 break
14410 }
14411 v.reset(OpPPC64SRD)
14412 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14413 v0.AddArg(x)
14414 v.AddArg2(v0, y)
14415 return true
14416 }
14417
14418
14419 for {
14420 t := v.Type
14421 x := v_0
14422 y := v_1
14423 v.reset(OpPPC64ISEL)
14424 v.AuxInt = int32ToAuxInt(2)
14425 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14426 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14427 v1.AddArg(x)
14428 v0.AddArg2(v1, y)
14429 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14430 v2.AuxInt = int64ToAuxInt(0)
14431 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14432 v3.AuxInt = int64ToAuxInt(0)
14433 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14434 v4.AuxInt = int64ToAuxInt(0xFFF8)
14435 v4.AddArg(y)
14436 v3.AddArg(v4)
14437 v.AddArg3(v0, v2, v3)
14438 return true
14439 }
14440 }
14441 func rewriteValuePPC64_OpRsh8Ux32(v *Value) bool {
14442 v_1 := v.Args[1]
14443 v_0 := v.Args[0]
14444 b := v.Block
14445 typ := &b.Func.Config.Types
14446
14447
14448
14449 for {
14450 x := v_0
14451 y := v_1
14452 if !(shiftIsBounded(v)) {
14453 break
14454 }
14455 v.reset(OpPPC64SRD)
14456 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14457 v0.AddArg(x)
14458 v.AddArg2(v0, y)
14459 return true
14460 }
14461
14462
14463 for {
14464 t := v.Type
14465 x := v_0
14466 y := v_1
14467 v.reset(OpPPC64ISEL)
14468 v.AuxInt = int32ToAuxInt(0)
14469 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14470 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14471 v1.AddArg(x)
14472 v0.AddArg2(v1, y)
14473 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14474 v2.AuxInt = int64ToAuxInt(0)
14475 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
14476 v3.AuxInt = int32ToAuxInt(8)
14477 v3.AddArg(y)
14478 v.AddArg3(v0, v2, v3)
14479 return true
14480 }
14481 }
14482 func rewriteValuePPC64_OpRsh8Ux64(v *Value) bool {
14483 v_1 := v.Args[1]
14484 v_0 := v.Args[0]
14485 b := v.Block
14486 typ := &b.Func.Config.Types
14487
14488
14489
14490 for {
14491 x := v_0
14492 if v_1.Op != OpPPC64MOVDconst {
14493 break
14494 }
14495 c := auxIntToInt64(v_1.AuxInt)
14496 if !(uint64(c) < 8) {
14497 break
14498 }
14499 v.reset(OpPPC64SRWconst)
14500 v.AuxInt = int64ToAuxInt(c)
14501 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
14502 v0.AddArg(x)
14503 v.AddArg(v0)
14504 return true
14505 }
14506
14507
14508
14509 for {
14510 x := v_0
14511 y := v_1
14512 if !(shiftIsBounded(v)) {
14513 break
14514 }
14515 v.reset(OpPPC64SRD)
14516 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14517 v0.AddArg(x)
14518 v.AddArg2(v0, y)
14519 return true
14520 }
14521
14522
14523 for {
14524 t := v.Type
14525 x := v_0
14526 y := v_1
14527 v.reset(OpPPC64ISEL)
14528 v.AuxInt = int32ToAuxInt(0)
14529 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14530 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14531 v1.AddArg(x)
14532 v0.AddArg2(v1, y)
14533 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14534 v2.AuxInt = int64ToAuxInt(0)
14535 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
14536 v3.AuxInt = int64ToAuxInt(8)
14537 v3.AddArg(y)
14538 v.AddArg3(v0, v2, v3)
14539 return true
14540 }
14541 }
14542 func rewriteValuePPC64_OpRsh8Ux8(v *Value) bool {
14543 v_1 := v.Args[1]
14544 v_0 := v.Args[0]
14545 b := v.Block
14546 typ := &b.Func.Config.Types
14547
14548
14549
14550 for {
14551 x := v_0
14552 y := v_1
14553 if !(shiftIsBounded(v)) {
14554 break
14555 }
14556 v.reset(OpPPC64SRD)
14557 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14558 v0.AddArg(x)
14559 v.AddArg2(v0, y)
14560 return true
14561 }
14562
14563
14564 for {
14565 t := v.Type
14566 x := v_0
14567 y := v_1
14568 v.reset(OpPPC64ISEL)
14569 v.AuxInt = int32ToAuxInt(2)
14570 v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
14571 v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
14572 v1.AddArg(x)
14573 v0.AddArg2(v1, y)
14574 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
14575 v2.AuxInt = int64ToAuxInt(0)
14576 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14577 v3.AuxInt = int64ToAuxInt(0)
14578 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14579 v4.AuxInt = int64ToAuxInt(0x00F8)
14580 v4.AddArg(y)
14581 v3.AddArg(v4)
14582 v.AddArg3(v0, v2, v3)
14583 return true
14584 }
14585 }
14586 func rewriteValuePPC64_OpRsh8x16(v *Value) bool {
14587 v_1 := v.Args[1]
14588 v_0 := v.Args[0]
14589 b := v.Block
14590 typ := &b.Func.Config.Types
14591
14592
14593
14594 for {
14595 x := v_0
14596 y := v_1
14597 if !(shiftIsBounded(v)) {
14598 break
14599 }
14600 v.reset(OpPPC64SRAD)
14601 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14602 v0.AddArg(x)
14603 v.AddArg2(v0, y)
14604 return true
14605 }
14606
14607
14608 for {
14609 t := v.Type
14610 x := v_0
14611 y := v_1
14612 v.reset(OpPPC64ISEL)
14613 v.AuxInt = int32ToAuxInt(2)
14614 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14615 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14616 v1.AddArg(x)
14617 v0.AddArg2(v1, y)
14618 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14619 v2.AuxInt = int64ToAuxInt(7)
14620 v2.AddArg(v1)
14621 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14622 v3.AuxInt = int64ToAuxInt(0)
14623 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14624 v4.AuxInt = int64ToAuxInt(0xFFF8)
14625 v4.AddArg(y)
14626 v3.AddArg(v4)
14627 v.AddArg3(v0, v2, v3)
14628 return true
14629 }
14630 }
14631 func rewriteValuePPC64_OpRsh8x32(v *Value) bool {
14632 v_1 := v.Args[1]
14633 v_0 := v.Args[0]
14634 b := v.Block
14635 typ := &b.Func.Config.Types
14636
14637
14638
14639 for {
14640 x := v_0
14641 y := v_1
14642 if !(shiftIsBounded(v)) {
14643 break
14644 }
14645 v.reset(OpPPC64SRAD)
14646 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14647 v0.AddArg(x)
14648 v.AddArg2(v0, y)
14649 return true
14650 }
14651
14652
14653 for {
14654 t := v.Type
14655 x := v_0
14656 y := v_1
14657 v.reset(OpPPC64ISEL)
14658 v.AuxInt = int32ToAuxInt(0)
14659 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14660 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14661 v1.AddArg(x)
14662 v0.AddArg2(v1, y)
14663 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14664 v2.AuxInt = int64ToAuxInt(7)
14665 v2.AddArg(v1)
14666 v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
14667 v3.AuxInt = int32ToAuxInt(8)
14668 v3.AddArg(y)
14669 v.AddArg3(v0, v2, v3)
14670 return true
14671 }
14672 }
14673 func rewriteValuePPC64_OpRsh8x64(v *Value) bool {
14674 v_1 := v.Args[1]
14675 v_0 := v.Args[0]
14676 b := v.Block
14677 typ := &b.Func.Config.Types
14678
14679
14680
14681 for {
14682 x := v_0
14683 if v_1.Op != OpPPC64MOVDconst {
14684 break
14685 }
14686 c := auxIntToInt64(v_1.AuxInt)
14687 if !(uint64(c) >= 8) {
14688 break
14689 }
14690 v.reset(OpPPC64SRAWconst)
14691 v.AuxInt = int64ToAuxInt(63)
14692 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
14693 v0.AddArg(x)
14694 v.AddArg(v0)
14695 return true
14696 }
14697
14698
14699
14700 for {
14701 x := v_0
14702 if v_1.Op != OpPPC64MOVDconst {
14703 break
14704 }
14705 c := auxIntToInt64(v_1.AuxInt)
14706 if !(uint64(c) < 8) {
14707 break
14708 }
14709 v.reset(OpPPC64SRAWconst)
14710 v.AuxInt = int64ToAuxInt(c)
14711 v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
14712 v0.AddArg(x)
14713 v.AddArg(v0)
14714 return true
14715 }
14716
14717
14718
14719 for {
14720 x := v_0
14721 y := v_1
14722 if !(shiftIsBounded(v)) {
14723 break
14724 }
14725 v.reset(OpPPC64SRAD)
14726 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14727 v0.AddArg(x)
14728 v.AddArg2(v0, y)
14729 return true
14730 }
14731
14732
14733 for {
14734 t := v.Type
14735 x := v_0
14736 y := v_1
14737 v.reset(OpPPC64ISEL)
14738 v.AuxInt = int32ToAuxInt(0)
14739 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14740 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14741 v1.AddArg(x)
14742 v0.AddArg2(v1, y)
14743 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14744 v2.AuxInt = int64ToAuxInt(7)
14745 v2.AddArg(v1)
14746 v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
14747 v3.AuxInt = int64ToAuxInt(8)
14748 v3.AddArg(y)
14749 v.AddArg3(v0, v2, v3)
14750 return true
14751 }
14752 }
14753 func rewriteValuePPC64_OpRsh8x8(v *Value) bool {
14754 v_1 := v.Args[1]
14755 v_0 := v.Args[0]
14756 b := v.Block
14757 typ := &b.Func.Config.Types
14758
14759
14760
14761 for {
14762 x := v_0
14763 y := v_1
14764 if !(shiftIsBounded(v)) {
14765 break
14766 }
14767 v.reset(OpPPC64SRAD)
14768 v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14769 v0.AddArg(x)
14770 v.AddArg2(v0, y)
14771 return true
14772 }
14773
14774
14775 for {
14776 t := v.Type
14777 x := v_0
14778 y := v_1
14779 v.reset(OpPPC64ISEL)
14780 v.AuxInt = int32ToAuxInt(2)
14781 v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
14782 v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
14783 v1.AddArg(x)
14784 v0.AddArg2(v1, y)
14785 v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
14786 v2.AuxInt = int64ToAuxInt(7)
14787 v2.AddArg(v1)
14788 v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14789 v3.AuxInt = int64ToAuxInt(0)
14790 v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
14791 v4.AuxInt = int64ToAuxInt(0x00F8)
14792 v4.AddArg(y)
14793 v3.AddArg(v4)
14794 v.AddArg3(v0, v2, v3)
14795 return true
14796 }
14797 }
14798 func rewriteValuePPC64_OpSelect0(v *Value) bool {
14799 v_0 := v.Args[0]
14800 b := v.Block
14801 typ := &b.Func.Config.Types
14802
14803
14804 for {
14805 if v_0.Op != OpMul64uhilo {
14806 break
14807 }
14808 y := v_0.Args[1]
14809 x := v_0.Args[0]
14810 v.reset(OpPPC64MULHDU)
14811 v.AddArg2(x, y)
14812 return true
14813 }
14814
14815
14816 for {
14817 if v_0.Op != OpMul64uover {
14818 break
14819 }
14820 y := v_0.Args[1]
14821 x := v_0.Args[0]
14822 v.reset(OpPPC64MULLD)
14823 v.AddArg2(x, y)
14824 return true
14825 }
14826
14827
14828 for {
14829 if v_0.Op != OpAdd64carry {
14830 break
14831 }
14832 c := v_0.Args[2]
14833 x := v_0.Args[0]
14834 y := v_0.Args[1]
14835 v.reset(OpSelect0)
14836 v.Type = typ.UInt64
14837 v0 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
14838 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14839 v2 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14840 v2.AuxInt = int64ToAuxInt(-1)
14841 v2.AddArg(c)
14842 v1.AddArg(v2)
14843 v0.AddArg3(x, y, v1)
14844 v.AddArg(v0)
14845 return true
14846 }
14847
14848
14849 for {
14850 if v_0.Op != OpSub64borrow {
14851 break
14852 }
14853 c := v_0.Args[2]
14854 x := v_0.Args[0]
14855 y := v_0.Args[1]
14856 v.reset(OpSelect0)
14857 v.Type = typ.UInt64
14858 v0 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
14859 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14860 v2 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14861 v2.AuxInt = int64ToAuxInt(0)
14862 v2.AddArg(c)
14863 v1.AddArg(v2)
14864 v0.AddArg3(x, y, v1)
14865 v.AddArg(v0)
14866 return true
14867 }
14868 return false
14869 }
14870 func rewriteValuePPC64_OpSelect1(v *Value) bool {
14871 v_0 := v.Args[0]
14872 b := v.Block
14873 typ := &b.Func.Config.Types
14874
14875
14876 for {
14877 if v_0.Op != OpMul64uhilo {
14878 break
14879 }
14880 y := v_0.Args[1]
14881 x := v_0.Args[0]
14882 v.reset(OpPPC64MULLD)
14883 v.AddArg2(x, y)
14884 return true
14885 }
14886
14887
14888 for {
14889 if v_0.Op != OpMul64uover {
14890 break
14891 }
14892 y := v_0.Args[1]
14893 x := v_0.Args[0]
14894 v.reset(OpPPC64SETBCR)
14895 v.AuxInt = int32ToAuxInt(2)
14896 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
14897 v0.AuxInt = int64ToAuxInt(0)
14898 v1 := b.NewValue0(v.Pos, OpPPC64MULHDU, x.Type)
14899 v1.AddArg2(x, y)
14900 v0.AddArg(v1)
14901 v.AddArg(v0)
14902 return true
14903 }
14904
14905
14906 for {
14907 if v_0.Op != OpAdd64carry {
14908 break
14909 }
14910 c := v_0.Args[2]
14911 x := v_0.Args[0]
14912 y := v_0.Args[1]
14913 v.reset(OpPPC64ADDZEzero)
14914 v0 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14915 v1 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
14916 v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14917 v3 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14918 v3.AuxInt = int64ToAuxInt(-1)
14919 v3.AddArg(c)
14920 v2.AddArg(v3)
14921 v1.AddArg3(x, y, v2)
14922 v0.AddArg(v1)
14923 v.AddArg(v0)
14924 return true
14925 }
14926
14927
14928
14929 for {
14930 if v_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_0.AuxInt) != -1 {
14931 break
14932 }
14933 n := v_0.Args[0]
14934 if n.Op != OpPPC64ADDZEzero {
14935 break
14936 }
14937 x := n.Args[0]
14938 if !(n.Uses <= 2) {
14939 break
14940 }
14941 v.copyOf(x)
14942 return true
14943 }
14944
14945
14946 for {
14947 if v_0.Op != OpSub64borrow {
14948 break
14949 }
14950 c := v_0.Args[2]
14951 x := v_0.Args[0]
14952 y := v_0.Args[1]
14953 v.reset(OpPPC64NEG)
14954 v0 := b.NewValue0(v.Pos, OpPPC64SUBZEzero, typ.UInt64)
14955 v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14956 v2 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
14957 v3 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
14958 v4 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
14959 v4.AuxInt = int64ToAuxInt(0)
14960 v4.AddArg(c)
14961 v3.AddArg(v4)
14962 v2.AddArg3(x, y, v3)
14963 v1.AddArg(v2)
14964 v0.AddArg(v1)
14965 v.AddArg(v0)
14966 return true
14967 }
14968
14969
14970
14971 for {
14972 if v_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_0.AuxInt) != 0 {
14973 break
14974 }
14975 n := v_0.Args[0]
14976 if n.Op != OpPPC64NEG {
14977 break
14978 }
14979 n_0 := n.Args[0]
14980 if n_0.Op != OpPPC64SUBZEzero {
14981 break
14982 }
14983 x := n_0.Args[0]
14984 if !(n.Uses <= 2) {
14985 break
14986 }
14987 v.copyOf(x)
14988 return true
14989 }
14990 return false
14991 }
14992 func rewriteValuePPC64_OpSelectN(v *Value) bool {
14993 v_0 := v.Args[0]
14994 b := v.Block
14995 config := b.Func.Config
14996
14997
14998
14999 for {
15000 if auxIntToInt64(v.AuxInt) != 0 {
15001 break
15002 }
15003 call := v_0
15004 if call.Op != OpPPC64CALLstatic || len(call.Args) != 1 {
15005 break
15006 }
15007 sym := auxToCall(call.Aux)
15008 s1 := call.Args[0]
15009 if s1.Op != OpPPC64MOVDstore {
15010 break
15011 }
15012 _ = s1.Args[2]
15013 s1_1 := s1.Args[1]
15014 if s1_1.Op != OpPPC64MOVDconst {
15015 break
15016 }
15017 sz := auxIntToInt64(s1_1.AuxInt)
15018 s2 := s1.Args[2]
15019 if s2.Op != OpPPC64MOVDstore {
15020 break
15021 }
15022 _ = s2.Args[2]
15023 src := s2.Args[1]
15024 s3 := s2.Args[2]
15025 if s3.Op != OpPPC64MOVDstore {
15026 break
15027 }
15028 mem := s3.Args[2]
15029 dst := s3.Args[1]
15030 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)) {
15031 break
15032 }
15033 v.reset(OpMove)
15034 v.AuxInt = int64ToAuxInt(sz)
15035 v.AddArg3(dst, src, mem)
15036 return true
15037 }
15038
15039
15040
15041 for {
15042 if auxIntToInt64(v.AuxInt) != 0 {
15043 break
15044 }
15045 call := v_0
15046 if call.Op != OpPPC64CALLstatic || len(call.Args) != 4 {
15047 break
15048 }
15049 sym := auxToCall(call.Aux)
15050 mem := call.Args[3]
15051 dst := call.Args[0]
15052 src := call.Args[1]
15053 call_2 := call.Args[2]
15054 if call_2.Op != OpPPC64MOVDconst {
15055 break
15056 }
15057 sz := auxIntToInt64(call_2.AuxInt)
15058 if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
15059 break
15060 }
15061 v.reset(OpMove)
15062 v.AuxInt = int64ToAuxInt(sz)
15063 v.AddArg3(dst, src, mem)
15064 return true
15065 }
15066 return false
15067 }
15068 func rewriteValuePPC64_OpSlicemask(v *Value) bool {
15069 v_0 := v.Args[0]
15070 b := v.Block
15071
15072
15073 for {
15074 t := v.Type
15075 x := v_0
15076 v.reset(OpPPC64SRADconst)
15077 v.AuxInt = int64ToAuxInt(63)
15078 v0 := b.NewValue0(v.Pos, OpPPC64NEG, t)
15079 v0.AddArg(x)
15080 v.AddArg(v0)
15081 return true
15082 }
15083 }
15084 func rewriteValuePPC64_OpStore(v *Value) bool {
15085 v_2 := v.Args[2]
15086 v_1 := v.Args[1]
15087 v_0 := v.Args[0]
15088
15089
15090
15091 for {
15092 t := auxToType(v.Aux)
15093 ptr := v_0
15094 val := v_1
15095 mem := v_2
15096 if !(t.Size() == 8 && t.IsFloat()) {
15097 break
15098 }
15099 v.reset(OpPPC64FMOVDstore)
15100 v.AddArg3(ptr, val, mem)
15101 return true
15102 }
15103
15104
15105
15106 for {
15107 t := auxToType(v.Aux)
15108 ptr := v_0
15109 val := v_1
15110 mem := v_2
15111 if !(t.Size() == 4 && t.IsFloat()) {
15112 break
15113 }
15114 v.reset(OpPPC64FMOVSstore)
15115 v.AddArg3(ptr, val, mem)
15116 return true
15117 }
15118
15119
15120
15121 for {
15122 t := auxToType(v.Aux)
15123 ptr := v_0
15124 val := v_1
15125 mem := v_2
15126 if !(t.Size() == 8 && !t.IsFloat()) {
15127 break
15128 }
15129 v.reset(OpPPC64MOVDstore)
15130 v.AddArg3(ptr, val, mem)
15131 return true
15132 }
15133
15134
15135
15136 for {
15137 t := auxToType(v.Aux)
15138 ptr := v_0
15139 val := v_1
15140 mem := v_2
15141 if !(t.Size() == 4 && !t.IsFloat()) {
15142 break
15143 }
15144 v.reset(OpPPC64MOVWstore)
15145 v.AddArg3(ptr, val, mem)
15146 return true
15147 }
15148
15149
15150
15151 for {
15152 t := auxToType(v.Aux)
15153 ptr := v_0
15154 val := v_1
15155 mem := v_2
15156 if !(t.Size() == 2) {
15157 break
15158 }
15159 v.reset(OpPPC64MOVHstore)
15160 v.AddArg3(ptr, val, mem)
15161 return true
15162 }
15163
15164
15165
15166 for {
15167 t := auxToType(v.Aux)
15168 ptr := v_0
15169 val := v_1
15170 mem := v_2
15171 if !(t.Size() == 1) {
15172 break
15173 }
15174 v.reset(OpPPC64MOVBstore)
15175 v.AddArg3(ptr, val, mem)
15176 return true
15177 }
15178 return false
15179 }
15180 func rewriteValuePPC64_OpTrunc16to8(v *Value) bool {
15181 v_0 := v.Args[0]
15182
15183
15184
15185 for {
15186 t := v.Type
15187 x := v_0
15188 if !(t.IsSigned()) {
15189 break
15190 }
15191 v.reset(OpPPC64MOVBreg)
15192 v.AddArg(x)
15193 return true
15194 }
15195
15196
15197 for {
15198 x := v_0
15199 v.reset(OpPPC64MOVBZreg)
15200 v.AddArg(x)
15201 return true
15202 }
15203 }
15204 func rewriteValuePPC64_OpTrunc32to16(v *Value) bool {
15205 v_0 := v.Args[0]
15206
15207
15208
15209 for {
15210 t := v.Type
15211 x := v_0
15212 if !(t.IsSigned()) {
15213 break
15214 }
15215 v.reset(OpPPC64MOVHreg)
15216 v.AddArg(x)
15217 return true
15218 }
15219
15220
15221 for {
15222 x := v_0
15223 v.reset(OpPPC64MOVHZreg)
15224 v.AddArg(x)
15225 return true
15226 }
15227 }
15228 func rewriteValuePPC64_OpTrunc32to8(v *Value) bool {
15229 v_0 := v.Args[0]
15230
15231
15232
15233 for {
15234 t := v.Type
15235 x := v_0
15236 if !(t.IsSigned()) {
15237 break
15238 }
15239 v.reset(OpPPC64MOVBreg)
15240 v.AddArg(x)
15241 return true
15242 }
15243
15244
15245 for {
15246 x := v_0
15247 v.reset(OpPPC64MOVBZreg)
15248 v.AddArg(x)
15249 return true
15250 }
15251 }
15252 func rewriteValuePPC64_OpTrunc64to16(v *Value) bool {
15253 v_0 := v.Args[0]
15254
15255
15256
15257 for {
15258 t := v.Type
15259 x := v_0
15260 if !(t.IsSigned()) {
15261 break
15262 }
15263 v.reset(OpPPC64MOVHreg)
15264 v.AddArg(x)
15265 return true
15266 }
15267
15268
15269 for {
15270 x := v_0
15271 v.reset(OpPPC64MOVHZreg)
15272 v.AddArg(x)
15273 return true
15274 }
15275 }
15276 func rewriteValuePPC64_OpTrunc64to32(v *Value) bool {
15277 v_0 := v.Args[0]
15278
15279
15280
15281 for {
15282 t := v.Type
15283 x := v_0
15284 if !(t.IsSigned()) {
15285 break
15286 }
15287 v.reset(OpPPC64MOVWreg)
15288 v.AddArg(x)
15289 return true
15290 }
15291
15292
15293 for {
15294 x := v_0
15295 v.reset(OpPPC64MOVWZreg)
15296 v.AddArg(x)
15297 return true
15298 }
15299 }
15300 func rewriteValuePPC64_OpTrunc64to8(v *Value) bool {
15301 v_0 := v.Args[0]
15302
15303
15304
15305 for {
15306 t := v.Type
15307 x := v_0
15308 if !(t.IsSigned()) {
15309 break
15310 }
15311 v.reset(OpPPC64MOVBreg)
15312 v.AddArg(x)
15313 return true
15314 }
15315
15316
15317 for {
15318 x := v_0
15319 v.reset(OpPPC64MOVBZreg)
15320 v.AddArg(x)
15321 return true
15322 }
15323 }
15324 func rewriteValuePPC64_OpZero(v *Value) bool {
15325 v_1 := v.Args[1]
15326 v_0 := v.Args[0]
15327 b := v.Block
15328
15329
15330 for {
15331 if auxIntToInt64(v.AuxInt) != 0 {
15332 break
15333 }
15334 mem := v_1
15335 v.copyOf(mem)
15336 return true
15337 }
15338
15339
15340 for {
15341 if auxIntToInt64(v.AuxInt) != 1 {
15342 break
15343 }
15344 destptr := v_0
15345 mem := v_1
15346 v.reset(OpPPC64MOVBstorezero)
15347 v.AddArg2(destptr, mem)
15348 return true
15349 }
15350
15351
15352 for {
15353 if auxIntToInt64(v.AuxInt) != 2 {
15354 break
15355 }
15356 destptr := v_0
15357 mem := v_1
15358 v.reset(OpPPC64MOVHstorezero)
15359 v.AddArg2(destptr, mem)
15360 return true
15361 }
15362
15363
15364 for {
15365 if auxIntToInt64(v.AuxInt) != 3 {
15366 break
15367 }
15368 destptr := v_0
15369 mem := v_1
15370 v.reset(OpPPC64MOVBstorezero)
15371 v.AuxInt = int32ToAuxInt(2)
15372 v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
15373 v0.AddArg2(destptr, mem)
15374 v.AddArg2(destptr, v0)
15375 return true
15376 }
15377
15378
15379 for {
15380 if auxIntToInt64(v.AuxInt) != 4 {
15381 break
15382 }
15383 destptr := v_0
15384 mem := v_1
15385 v.reset(OpPPC64MOVWstorezero)
15386 v.AddArg2(destptr, mem)
15387 return true
15388 }
15389
15390
15391 for {
15392 if auxIntToInt64(v.AuxInt) != 5 {
15393 break
15394 }
15395 destptr := v_0
15396 mem := v_1
15397 v.reset(OpPPC64MOVBstorezero)
15398 v.AuxInt = int32ToAuxInt(4)
15399 v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
15400 v0.AddArg2(destptr, mem)
15401 v.AddArg2(destptr, v0)
15402 return true
15403 }
15404
15405
15406 for {
15407 if auxIntToInt64(v.AuxInt) != 6 {
15408 break
15409 }
15410 destptr := v_0
15411 mem := v_1
15412 v.reset(OpPPC64MOVHstorezero)
15413 v.AuxInt = int32ToAuxInt(4)
15414 v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
15415 v0.AddArg2(destptr, mem)
15416 v.AddArg2(destptr, v0)
15417 return true
15418 }
15419
15420
15421 for {
15422 if auxIntToInt64(v.AuxInt) != 7 {
15423 break
15424 }
15425 destptr := v_0
15426 mem := v_1
15427 v.reset(OpPPC64MOVBstorezero)
15428 v.AuxInt = int32ToAuxInt(6)
15429 v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
15430 v0.AuxInt = int32ToAuxInt(4)
15431 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
15432 v1.AddArg2(destptr, mem)
15433 v0.AddArg2(destptr, v1)
15434 v.AddArg2(destptr, v0)
15435 return true
15436 }
15437
15438
15439 for {
15440 if auxIntToInt64(v.AuxInt) != 8 {
15441 break
15442 }
15443 destptr := v_0
15444 mem := v_1
15445 v.reset(OpPPC64MOVDstorezero)
15446 v.AddArg2(destptr, mem)
15447 return true
15448 }
15449
15450
15451 for {
15452 if auxIntToInt64(v.AuxInt) != 12 {
15453 break
15454 }
15455 destptr := v_0
15456 mem := v_1
15457 v.reset(OpPPC64MOVWstorezero)
15458 v.AuxInt = int32ToAuxInt(8)
15459 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15460 v0.AuxInt = int32ToAuxInt(0)
15461 v0.AddArg2(destptr, mem)
15462 v.AddArg2(destptr, v0)
15463 return true
15464 }
15465
15466
15467 for {
15468 if auxIntToInt64(v.AuxInt) != 16 {
15469 break
15470 }
15471 destptr := v_0
15472 mem := v_1
15473 v.reset(OpPPC64MOVDstorezero)
15474 v.AuxInt = int32ToAuxInt(8)
15475 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15476 v0.AuxInt = int32ToAuxInt(0)
15477 v0.AddArg2(destptr, mem)
15478 v.AddArg2(destptr, v0)
15479 return true
15480 }
15481
15482
15483 for {
15484 if auxIntToInt64(v.AuxInt) != 24 {
15485 break
15486 }
15487 destptr := v_0
15488 mem := v_1
15489 v.reset(OpPPC64MOVDstorezero)
15490 v.AuxInt = int32ToAuxInt(16)
15491 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15492 v0.AuxInt = int32ToAuxInt(8)
15493 v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15494 v1.AuxInt = int32ToAuxInt(0)
15495 v1.AddArg2(destptr, mem)
15496 v0.AddArg2(destptr, v1)
15497 v.AddArg2(destptr, v0)
15498 return true
15499 }
15500
15501
15502 for {
15503 if auxIntToInt64(v.AuxInt) != 32 {
15504 break
15505 }
15506 destptr := v_0
15507 mem := v_1
15508 v.reset(OpPPC64MOVDstorezero)
15509 v.AuxInt = int32ToAuxInt(24)
15510 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15511 v0.AuxInt = int32ToAuxInt(16)
15512 v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15513 v1.AuxInt = int32ToAuxInt(8)
15514 v2 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
15515 v2.AuxInt = int32ToAuxInt(0)
15516 v2.AddArg2(destptr, mem)
15517 v1.AddArg2(destptr, v2)
15518 v0.AddArg2(destptr, v1)
15519 v.AddArg2(destptr, v0)
15520 return true
15521 }
15522
15523
15524
15525 for {
15526 s := auxIntToInt64(v.AuxInt)
15527 ptr := v_0
15528 mem := v_1
15529 if !(buildcfg.GOPPC64 <= 8 && s < 64) {
15530 break
15531 }
15532 v.reset(OpPPC64LoweredZeroShort)
15533 v.AuxInt = int64ToAuxInt(s)
15534 v.AddArg2(ptr, mem)
15535 return true
15536 }
15537
15538
15539
15540 for {
15541 s := auxIntToInt64(v.AuxInt)
15542 ptr := v_0
15543 mem := v_1
15544 if !(buildcfg.GOPPC64 <= 8) {
15545 break
15546 }
15547 v.reset(OpPPC64LoweredZero)
15548 v.AuxInt = int64ToAuxInt(s)
15549 v.AddArg2(ptr, mem)
15550 return true
15551 }
15552
15553
15554
15555 for {
15556 s := auxIntToInt64(v.AuxInt)
15557 ptr := v_0
15558 mem := v_1
15559 if !(s < 128 && buildcfg.GOPPC64 >= 9) {
15560 break
15561 }
15562 v.reset(OpPPC64LoweredQuadZeroShort)
15563 v.AuxInt = int64ToAuxInt(s)
15564 v.AddArg2(ptr, mem)
15565 return true
15566 }
15567
15568
15569
15570 for {
15571 s := auxIntToInt64(v.AuxInt)
15572 ptr := v_0
15573 mem := v_1
15574 if !(buildcfg.GOPPC64 >= 9) {
15575 break
15576 }
15577 v.reset(OpPPC64LoweredQuadZero)
15578 v.AuxInt = int64ToAuxInt(s)
15579 v.AddArg2(ptr, mem)
15580 return true
15581 }
15582 return false
15583 }
15584 func rewriteBlockPPC64(b *Block) bool {
15585 typ := &b.Func.Config.Types
15586 switch b.Kind {
15587 case BlockPPC64EQ:
15588
15589
15590 for b.Controls[0].Op == OpPPC64FlagEQ {
15591 b.Reset(BlockFirst)
15592 return true
15593 }
15594
15595
15596 for b.Controls[0].Op == OpPPC64FlagLT {
15597 b.Reset(BlockFirst)
15598 b.swapSuccessors()
15599 return true
15600 }
15601
15602
15603 for b.Controls[0].Op == OpPPC64FlagGT {
15604 b.Reset(BlockFirst)
15605 b.swapSuccessors()
15606 return true
15607 }
15608
15609
15610 for b.Controls[0].Op == OpPPC64InvertFlags {
15611 v_0 := b.Controls[0]
15612 cmp := v_0.Args[0]
15613 b.resetWithControl(BlockPPC64EQ, cmp)
15614 return true
15615 }
15616
15617
15618
15619 for b.Controls[0].Op == OpPPC64CMPconst {
15620 v_0 := b.Controls[0]
15621 if auxIntToInt64(v_0.AuxInt) != 0 {
15622 break
15623 }
15624 z := v_0.Args[0]
15625 if z.Op != OpPPC64AND {
15626 break
15627 }
15628 _ = z.Args[1]
15629 z_0 := z.Args[0]
15630 z_1 := z.Args[1]
15631 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15632 x := z_0
15633 y := z_1
15634 if !(z.Uses == 1) {
15635 continue
15636 }
15637 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15638 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15639 v1.AddArg2(x, y)
15640 v0.AddArg(v1)
15641 b.resetWithControl(BlockPPC64EQ, v0)
15642 return true
15643 }
15644 break
15645 }
15646
15647
15648
15649 for b.Controls[0].Op == OpPPC64CMPconst {
15650 v_0 := b.Controls[0]
15651 if auxIntToInt64(v_0.AuxInt) != 0 {
15652 break
15653 }
15654 z := v_0.Args[0]
15655 if z.Op != OpPPC64OR {
15656 break
15657 }
15658 _ = z.Args[1]
15659 z_0 := z.Args[0]
15660 z_1 := z.Args[1]
15661 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15662 x := z_0
15663 y := z_1
15664 if !(z.Uses == 1) {
15665 continue
15666 }
15667 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15668 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
15669 v1.AddArg2(x, y)
15670 v0.AddArg(v1)
15671 b.resetWithControl(BlockPPC64EQ, v0)
15672 return true
15673 }
15674 break
15675 }
15676
15677
15678
15679 for b.Controls[0].Op == OpPPC64CMPconst {
15680 v_0 := b.Controls[0]
15681 if auxIntToInt64(v_0.AuxInt) != 0 {
15682 break
15683 }
15684 z := v_0.Args[0]
15685 if z.Op != OpPPC64XOR {
15686 break
15687 }
15688 _ = z.Args[1]
15689 z_0 := z.Args[0]
15690 z_1 := z.Args[1]
15691 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15692 x := z_0
15693 y := z_1
15694 if !(z.Uses == 1) {
15695 continue
15696 }
15697 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15698 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
15699 v1.AddArg2(x, y)
15700 v0.AddArg(v1)
15701 b.resetWithControl(BlockPPC64EQ, v0)
15702 return true
15703 }
15704 break
15705 }
15706 case BlockPPC64GE:
15707
15708
15709 for b.Controls[0].Op == OpPPC64FlagEQ {
15710 b.Reset(BlockFirst)
15711 return true
15712 }
15713
15714
15715 for b.Controls[0].Op == OpPPC64FlagLT {
15716 b.Reset(BlockFirst)
15717 b.swapSuccessors()
15718 return true
15719 }
15720
15721
15722 for b.Controls[0].Op == OpPPC64FlagGT {
15723 b.Reset(BlockFirst)
15724 return true
15725 }
15726
15727
15728 for b.Controls[0].Op == OpPPC64InvertFlags {
15729 v_0 := b.Controls[0]
15730 cmp := v_0.Args[0]
15731 b.resetWithControl(BlockPPC64LE, cmp)
15732 return true
15733 }
15734
15735
15736
15737 for b.Controls[0].Op == OpPPC64CMPconst {
15738 v_0 := b.Controls[0]
15739 if auxIntToInt64(v_0.AuxInt) != 0 {
15740 break
15741 }
15742 z := v_0.Args[0]
15743 if z.Op != OpPPC64AND {
15744 break
15745 }
15746 _ = z.Args[1]
15747 z_0 := z.Args[0]
15748 z_1 := z.Args[1]
15749 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15750 x := z_0
15751 y := z_1
15752 if !(z.Uses == 1) {
15753 continue
15754 }
15755 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15756 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15757 v1.AddArg2(x, y)
15758 v0.AddArg(v1)
15759 b.resetWithControl(BlockPPC64GE, v0)
15760 return true
15761 }
15762 break
15763 }
15764
15765
15766
15767 for b.Controls[0].Op == OpPPC64CMPconst {
15768 v_0 := b.Controls[0]
15769 if auxIntToInt64(v_0.AuxInt) != 0 {
15770 break
15771 }
15772 z := v_0.Args[0]
15773 if z.Op != OpPPC64OR {
15774 break
15775 }
15776 _ = z.Args[1]
15777 z_0 := z.Args[0]
15778 z_1 := z.Args[1]
15779 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15780 x := z_0
15781 y := z_1
15782 if !(z.Uses == 1) {
15783 continue
15784 }
15785 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15786 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
15787 v1.AddArg2(x, y)
15788 v0.AddArg(v1)
15789 b.resetWithControl(BlockPPC64GE, v0)
15790 return true
15791 }
15792 break
15793 }
15794
15795
15796
15797 for b.Controls[0].Op == OpPPC64CMPconst {
15798 v_0 := b.Controls[0]
15799 if auxIntToInt64(v_0.AuxInt) != 0 {
15800 break
15801 }
15802 z := v_0.Args[0]
15803 if z.Op != OpPPC64XOR {
15804 break
15805 }
15806 _ = z.Args[1]
15807 z_0 := z.Args[0]
15808 z_1 := z.Args[1]
15809 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15810 x := z_0
15811 y := z_1
15812 if !(z.Uses == 1) {
15813 continue
15814 }
15815 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15816 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
15817 v1.AddArg2(x, y)
15818 v0.AddArg(v1)
15819 b.resetWithControl(BlockPPC64GE, v0)
15820 return true
15821 }
15822 break
15823 }
15824 case BlockPPC64GT:
15825
15826
15827 for b.Controls[0].Op == OpPPC64FlagEQ {
15828 b.Reset(BlockFirst)
15829 b.swapSuccessors()
15830 return true
15831 }
15832
15833
15834 for b.Controls[0].Op == OpPPC64FlagLT {
15835 b.Reset(BlockFirst)
15836 b.swapSuccessors()
15837 return true
15838 }
15839
15840
15841 for b.Controls[0].Op == OpPPC64FlagGT {
15842 b.Reset(BlockFirst)
15843 return true
15844 }
15845
15846
15847 for b.Controls[0].Op == OpPPC64InvertFlags {
15848 v_0 := b.Controls[0]
15849 cmp := v_0.Args[0]
15850 b.resetWithControl(BlockPPC64LT, cmp)
15851 return true
15852 }
15853
15854
15855
15856 for b.Controls[0].Op == OpPPC64CMPconst {
15857 v_0 := b.Controls[0]
15858 if auxIntToInt64(v_0.AuxInt) != 0 {
15859 break
15860 }
15861 z := v_0.Args[0]
15862 if z.Op != OpPPC64AND {
15863 break
15864 }
15865 _ = z.Args[1]
15866 z_0 := z.Args[0]
15867 z_1 := z.Args[1]
15868 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15869 x := z_0
15870 y := z_1
15871 if !(z.Uses == 1) {
15872 continue
15873 }
15874 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15875 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
15876 v1.AddArg2(x, y)
15877 v0.AddArg(v1)
15878 b.resetWithControl(BlockPPC64GT, v0)
15879 return true
15880 }
15881 break
15882 }
15883
15884
15885
15886 for b.Controls[0].Op == OpPPC64CMPconst {
15887 v_0 := b.Controls[0]
15888 if auxIntToInt64(v_0.AuxInt) != 0 {
15889 break
15890 }
15891 z := v_0.Args[0]
15892 if z.Op != OpPPC64OR {
15893 break
15894 }
15895 _ = z.Args[1]
15896 z_0 := z.Args[0]
15897 z_1 := z.Args[1]
15898 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15899 x := z_0
15900 y := z_1
15901 if !(z.Uses == 1) {
15902 continue
15903 }
15904 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15905 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
15906 v1.AddArg2(x, y)
15907 v0.AddArg(v1)
15908 b.resetWithControl(BlockPPC64GT, v0)
15909 return true
15910 }
15911 break
15912 }
15913
15914
15915
15916 for b.Controls[0].Op == OpPPC64CMPconst {
15917 v_0 := b.Controls[0]
15918 if auxIntToInt64(v_0.AuxInt) != 0 {
15919 break
15920 }
15921 z := v_0.Args[0]
15922 if z.Op != OpPPC64XOR {
15923 break
15924 }
15925 _ = z.Args[1]
15926 z_0 := z.Args[0]
15927 z_1 := z.Args[1]
15928 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
15929 x := z_0
15930 y := z_1
15931 if !(z.Uses == 1) {
15932 continue
15933 }
15934 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
15935 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
15936 v1.AddArg2(x, y)
15937 v0.AddArg(v1)
15938 b.resetWithControl(BlockPPC64GT, v0)
15939 return true
15940 }
15941 break
15942 }
15943 case BlockIf:
15944
15945
15946 for b.Controls[0].Op == OpPPC64Equal {
15947 v_0 := b.Controls[0]
15948 cc := v_0.Args[0]
15949 b.resetWithControl(BlockPPC64EQ, cc)
15950 return true
15951 }
15952
15953
15954 for b.Controls[0].Op == OpPPC64NotEqual {
15955 v_0 := b.Controls[0]
15956 cc := v_0.Args[0]
15957 b.resetWithControl(BlockPPC64NE, cc)
15958 return true
15959 }
15960
15961
15962 for b.Controls[0].Op == OpPPC64LessThan {
15963 v_0 := b.Controls[0]
15964 cc := v_0.Args[0]
15965 b.resetWithControl(BlockPPC64LT, cc)
15966 return true
15967 }
15968
15969
15970 for b.Controls[0].Op == OpPPC64LessEqual {
15971 v_0 := b.Controls[0]
15972 cc := v_0.Args[0]
15973 b.resetWithControl(BlockPPC64LE, cc)
15974 return true
15975 }
15976
15977
15978 for b.Controls[0].Op == OpPPC64GreaterThan {
15979 v_0 := b.Controls[0]
15980 cc := v_0.Args[0]
15981 b.resetWithControl(BlockPPC64GT, cc)
15982 return true
15983 }
15984
15985
15986 for b.Controls[0].Op == OpPPC64GreaterEqual {
15987 v_0 := b.Controls[0]
15988 cc := v_0.Args[0]
15989 b.resetWithControl(BlockPPC64GE, cc)
15990 return true
15991 }
15992
15993
15994 for b.Controls[0].Op == OpPPC64FLessThan {
15995 v_0 := b.Controls[0]
15996 cc := v_0.Args[0]
15997 b.resetWithControl(BlockPPC64FLT, cc)
15998 return true
15999 }
16000
16001
16002 for b.Controls[0].Op == OpPPC64FLessEqual {
16003 v_0 := b.Controls[0]
16004 cc := v_0.Args[0]
16005 b.resetWithControl(BlockPPC64FLE, cc)
16006 return true
16007 }
16008
16009
16010 for b.Controls[0].Op == OpPPC64FGreaterThan {
16011 v_0 := b.Controls[0]
16012 cc := v_0.Args[0]
16013 b.resetWithControl(BlockPPC64FGT, cc)
16014 return true
16015 }
16016
16017
16018 for b.Controls[0].Op == OpPPC64FGreaterEqual {
16019 v_0 := b.Controls[0]
16020 cc := v_0.Args[0]
16021 b.resetWithControl(BlockPPC64FGE, cc)
16022 return true
16023 }
16024
16025
16026 for {
16027 cond := b.Controls[0]
16028 v0 := b.NewValue0(cond.Pos, OpPPC64CMPconst, types.TypeFlags)
16029 v0.AuxInt = int64ToAuxInt(0)
16030 v1 := b.NewValue0(cond.Pos, OpPPC64ANDconst, typ.Int)
16031 v1.AuxInt = int64ToAuxInt(1)
16032 v1.AddArg(cond)
16033 v0.AddArg(v1)
16034 b.resetWithControl(BlockPPC64NE, v0)
16035 return true
16036 }
16037 case BlockPPC64LE:
16038
16039
16040 for b.Controls[0].Op == OpPPC64FlagEQ {
16041 b.Reset(BlockFirst)
16042 return true
16043 }
16044
16045
16046 for b.Controls[0].Op == OpPPC64FlagLT {
16047 b.Reset(BlockFirst)
16048 return true
16049 }
16050
16051
16052 for b.Controls[0].Op == OpPPC64FlagGT {
16053 b.Reset(BlockFirst)
16054 b.swapSuccessors()
16055 return true
16056 }
16057
16058
16059 for b.Controls[0].Op == OpPPC64InvertFlags {
16060 v_0 := b.Controls[0]
16061 cmp := v_0.Args[0]
16062 b.resetWithControl(BlockPPC64GE, cmp)
16063 return true
16064 }
16065
16066
16067
16068 for b.Controls[0].Op == OpPPC64CMPconst {
16069 v_0 := b.Controls[0]
16070 if auxIntToInt64(v_0.AuxInt) != 0 {
16071 break
16072 }
16073 z := v_0.Args[0]
16074 if z.Op != OpPPC64AND {
16075 break
16076 }
16077 _ = z.Args[1]
16078 z_0 := z.Args[0]
16079 z_1 := z.Args[1]
16080 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16081 x := z_0
16082 y := z_1
16083 if !(z.Uses == 1) {
16084 continue
16085 }
16086 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16087 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
16088 v1.AddArg2(x, y)
16089 v0.AddArg(v1)
16090 b.resetWithControl(BlockPPC64LE, v0)
16091 return true
16092 }
16093 break
16094 }
16095
16096
16097
16098 for b.Controls[0].Op == OpPPC64CMPconst {
16099 v_0 := b.Controls[0]
16100 if auxIntToInt64(v_0.AuxInt) != 0 {
16101 break
16102 }
16103 z := v_0.Args[0]
16104 if z.Op != OpPPC64OR {
16105 break
16106 }
16107 _ = z.Args[1]
16108 z_0 := z.Args[0]
16109 z_1 := z.Args[1]
16110 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16111 x := z_0
16112 y := z_1
16113 if !(z.Uses == 1) {
16114 continue
16115 }
16116 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16117 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
16118 v1.AddArg2(x, y)
16119 v0.AddArg(v1)
16120 b.resetWithControl(BlockPPC64LE, v0)
16121 return true
16122 }
16123 break
16124 }
16125
16126
16127
16128 for b.Controls[0].Op == OpPPC64CMPconst {
16129 v_0 := b.Controls[0]
16130 if auxIntToInt64(v_0.AuxInt) != 0 {
16131 break
16132 }
16133 z := v_0.Args[0]
16134 if z.Op != OpPPC64XOR {
16135 break
16136 }
16137 _ = z.Args[1]
16138 z_0 := z.Args[0]
16139 z_1 := z.Args[1]
16140 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16141 x := z_0
16142 y := z_1
16143 if !(z.Uses == 1) {
16144 continue
16145 }
16146 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16147 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
16148 v1.AddArg2(x, y)
16149 v0.AddArg(v1)
16150 b.resetWithControl(BlockPPC64LE, v0)
16151 return true
16152 }
16153 break
16154 }
16155 case BlockPPC64LT:
16156
16157
16158 for b.Controls[0].Op == OpPPC64FlagEQ {
16159 b.Reset(BlockFirst)
16160 b.swapSuccessors()
16161 return true
16162 }
16163
16164
16165 for b.Controls[0].Op == OpPPC64FlagLT {
16166 b.Reset(BlockFirst)
16167 return true
16168 }
16169
16170
16171 for b.Controls[0].Op == OpPPC64FlagGT {
16172 b.Reset(BlockFirst)
16173 b.swapSuccessors()
16174 return true
16175 }
16176
16177
16178 for b.Controls[0].Op == OpPPC64InvertFlags {
16179 v_0 := b.Controls[0]
16180 cmp := v_0.Args[0]
16181 b.resetWithControl(BlockPPC64GT, cmp)
16182 return true
16183 }
16184
16185
16186
16187 for b.Controls[0].Op == OpPPC64CMPconst {
16188 v_0 := b.Controls[0]
16189 if auxIntToInt64(v_0.AuxInt) != 0 {
16190 break
16191 }
16192 z := v_0.Args[0]
16193 if z.Op != OpPPC64AND {
16194 break
16195 }
16196 _ = z.Args[1]
16197 z_0 := z.Args[0]
16198 z_1 := z.Args[1]
16199 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16200 x := z_0
16201 y := z_1
16202 if !(z.Uses == 1) {
16203 continue
16204 }
16205 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16206 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
16207 v1.AddArg2(x, y)
16208 v0.AddArg(v1)
16209 b.resetWithControl(BlockPPC64LT, v0)
16210 return true
16211 }
16212 break
16213 }
16214
16215
16216
16217 for b.Controls[0].Op == OpPPC64CMPconst {
16218 v_0 := b.Controls[0]
16219 if auxIntToInt64(v_0.AuxInt) != 0 {
16220 break
16221 }
16222 z := v_0.Args[0]
16223 if z.Op != OpPPC64OR {
16224 break
16225 }
16226 _ = z.Args[1]
16227 z_0 := z.Args[0]
16228 z_1 := z.Args[1]
16229 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16230 x := z_0
16231 y := z_1
16232 if !(z.Uses == 1) {
16233 continue
16234 }
16235 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16236 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
16237 v1.AddArg2(x, y)
16238 v0.AddArg(v1)
16239 b.resetWithControl(BlockPPC64LT, v0)
16240 return true
16241 }
16242 break
16243 }
16244
16245
16246
16247 for b.Controls[0].Op == OpPPC64CMPconst {
16248 v_0 := b.Controls[0]
16249 if auxIntToInt64(v_0.AuxInt) != 0 {
16250 break
16251 }
16252 z := v_0.Args[0]
16253 if z.Op != OpPPC64XOR {
16254 break
16255 }
16256 _ = z.Args[1]
16257 z_0 := z.Args[0]
16258 z_1 := z.Args[1]
16259 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16260 x := z_0
16261 y := z_1
16262 if !(z.Uses == 1) {
16263 continue
16264 }
16265 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16266 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
16267 v1.AddArg2(x, y)
16268 v0.AddArg(v1)
16269 b.resetWithControl(BlockPPC64LT, v0)
16270 return true
16271 }
16272 break
16273 }
16274 case BlockPPC64NE:
16275
16276
16277 for b.Controls[0].Op == OpPPC64CMPconst {
16278 v_0 := b.Controls[0]
16279 if auxIntToInt64(v_0.AuxInt) != 0 {
16280 break
16281 }
16282 v_0_0 := v_0.Args[0]
16283 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16284 break
16285 }
16286 v_0_0_0 := v_0_0.Args[0]
16287 if v_0_0_0.Op != OpPPC64Equal {
16288 break
16289 }
16290 cc := v_0_0_0.Args[0]
16291 b.resetWithControl(BlockPPC64EQ, cc)
16292 return true
16293 }
16294
16295
16296 for b.Controls[0].Op == OpPPC64CMPconst {
16297 v_0 := b.Controls[0]
16298 if auxIntToInt64(v_0.AuxInt) != 0 {
16299 break
16300 }
16301 v_0_0 := v_0.Args[0]
16302 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16303 break
16304 }
16305 v_0_0_0 := v_0_0.Args[0]
16306 if v_0_0_0.Op != OpPPC64NotEqual {
16307 break
16308 }
16309 cc := v_0_0_0.Args[0]
16310 b.resetWithControl(BlockPPC64NE, cc)
16311 return true
16312 }
16313
16314
16315 for b.Controls[0].Op == OpPPC64CMPconst {
16316 v_0 := b.Controls[0]
16317 if auxIntToInt64(v_0.AuxInt) != 0 {
16318 break
16319 }
16320 v_0_0 := v_0.Args[0]
16321 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16322 break
16323 }
16324 v_0_0_0 := v_0_0.Args[0]
16325 if v_0_0_0.Op != OpPPC64LessThan {
16326 break
16327 }
16328 cc := v_0_0_0.Args[0]
16329 b.resetWithControl(BlockPPC64LT, cc)
16330 return true
16331 }
16332
16333
16334 for b.Controls[0].Op == OpPPC64CMPconst {
16335 v_0 := b.Controls[0]
16336 if auxIntToInt64(v_0.AuxInt) != 0 {
16337 break
16338 }
16339 v_0_0 := v_0.Args[0]
16340 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16341 break
16342 }
16343 v_0_0_0 := v_0_0.Args[0]
16344 if v_0_0_0.Op != OpPPC64LessEqual {
16345 break
16346 }
16347 cc := v_0_0_0.Args[0]
16348 b.resetWithControl(BlockPPC64LE, cc)
16349 return true
16350 }
16351
16352
16353 for b.Controls[0].Op == OpPPC64CMPconst {
16354 v_0 := b.Controls[0]
16355 if auxIntToInt64(v_0.AuxInt) != 0 {
16356 break
16357 }
16358 v_0_0 := v_0.Args[0]
16359 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16360 break
16361 }
16362 v_0_0_0 := v_0_0.Args[0]
16363 if v_0_0_0.Op != OpPPC64GreaterThan {
16364 break
16365 }
16366 cc := v_0_0_0.Args[0]
16367 b.resetWithControl(BlockPPC64GT, cc)
16368 return true
16369 }
16370
16371
16372 for b.Controls[0].Op == OpPPC64CMPconst {
16373 v_0 := b.Controls[0]
16374 if auxIntToInt64(v_0.AuxInt) != 0 {
16375 break
16376 }
16377 v_0_0 := v_0.Args[0]
16378 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16379 break
16380 }
16381 v_0_0_0 := v_0_0.Args[0]
16382 if v_0_0_0.Op != OpPPC64GreaterEqual {
16383 break
16384 }
16385 cc := v_0_0_0.Args[0]
16386 b.resetWithControl(BlockPPC64GE, cc)
16387 return true
16388 }
16389
16390
16391 for b.Controls[0].Op == OpPPC64CMPconst {
16392 v_0 := b.Controls[0]
16393 if auxIntToInt64(v_0.AuxInt) != 0 {
16394 break
16395 }
16396 v_0_0 := v_0.Args[0]
16397 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16398 break
16399 }
16400 v_0_0_0 := v_0_0.Args[0]
16401 if v_0_0_0.Op != OpPPC64FLessThan {
16402 break
16403 }
16404 cc := v_0_0_0.Args[0]
16405 b.resetWithControl(BlockPPC64FLT, cc)
16406 return true
16407 }
16408
16409
16410 for b.Controls[0].Op == OpPPC64CMPconst {
16411 v_0 := b.Controls[0]
16412 if auxIntToInt64(v_0.AuxInt) != 0 {
16413 break
16414 }
16415 v_0_0 := v_0.Args[0]
16416 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16417 break
16418 }
16419 v_0_0_0 := v_0_0.Args[0]
16420 if v_0_0_0.Op != OpPPC64FLessEqual {
16421 break
16422 }
16423 cc := v_0_0_0.Args[0]
16424 b.resetWithControl(BlockPPC64FLE, cc)
16425 return true
16426 }
16427
16428
16429 for b.Controls[0].Op == OpPPC64CMPconst {
16430 v_0 := b.Controls[0]
16431 if auxIntToInt64(v_0.AuxInt) != 0 {
16432 break
16433 }
16434 v_0_0 := v_0.Args[0]
16435 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16436 break
16437 }
16438 v_0_0_0 := v_0_0.Args[0]
16439 if v_0_0_0.Op != OpPPC64FGreaterThan {
16440 break
16441 }
16442 cc := v_0_0_0.Args[0]
16443 b.resetWithControl(BlockPPC64FGT, cc)
16444 return true
16445 }
16446
16447
16448 for b.Controls[0].Op == OpPPC64CMPconst {
16449 v_0 := b.Controls[0]
16450 if auxIntToInt64(v_0.AuxInt) != 0 {
16451 break
16452 }
16453 v_0_0 := v_0.Args[0]
16454 if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
16455 break
16456 }
16457 v_0_0_0 := v_0_0.Args[0]
16458 if v_0_0_0.Op != OpPPC64FGreaterEqual {
16459 break
16460 }
16461 cc := v_0_0_0.Args[0]
16462 b.resetWithControl(BlockPPC64FGE, cc)
16463 return true
16464 }
16465
16466
16467 for b.Controls[0].Op == OpPPC64FlagEQ {
16468 b.Reset(BlockFirst)
16469 b.swapSuccessors()
16470 return true
16471 }
16472
16473
16474 for b.Controls[0].Op == OpPPC64FlagLT {
16475 b.Reset(BlockFirst)
16476 return true
16477 }
16478
16479
16480 for b.Controls[0].Op == OpPPC64FlagGT {
16481 b.Reset(BlockFirst)
16482 return true
16483 }
16484
16485
16486 for b.Controls[0].Op == OpPPC64InvertFlags {
16487 v_0 := b.Controls[0]
16488 cmp := v_0.Args[0]
16489 b.resetWithControl(BlockPPC64NE, cmp)
16490 return true
16491 }
16492
16493
16494
16495 for b.Controls[0].Op == OpPPC64CMPconst {
16496 v_0 := b.Controls[0]
16497 if auxIntToInt64(v_0.AuxInt) != 0 {
16498 break
16499 }
16500 z := v_0.Args[0]
16501 if z.Op != OpPPC64AND {
16502 break
16503 }
16504 _ = z.Args[1]
16505 z_0 := z.Args[0]
16506 z_1 := z.Args[1]
16507 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16508 x := z_0
16509 y := z_1
16510 if !(z.Uses == 1) {
16511 continue
16512 }
16513 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16514 v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
16515 v1.AddArg2(x, y)
16516 v0.AddArg(v1)
16517 b.resetWithControl(BlockPPC64NE, v0)
16518 return true
16519 }
16520 break
16521 }
16522
16523
16524
16525 for b.Controls[0].Op == OpPPC64CMPconst {
16526 v_0 := b.Controls[0]
16527 if auxIntToInt64(v_0.AuxInt) != 0 {
16528 break
16529 }
16530 z := v_0.Args[0]
16531 if z.Op != OpPPC64OR {
16532 break
16533 }
16534 _ = z.Args[1]
16535 z_0 := z.Args[0]
16536 z_1 := z.Args[1]
16537 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16538 x := z_0
16539 y := z_1
16540 if !(z.Uses == 1) {
16541 continue
16542 }
16543 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16544 v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
16545 v1.AddArg2(x, y)
16546 v0.AddArg(v1)
16547 b.resetWithControl(BlockPPC64NE, v0)
16548 return true
16549 }
16550 break
16551 }
16552
16553
16554
16555 for b.Controls[0].Op == OpPPC64CMPconst {
16556 v_0 := b.Controls[0]
16557 if auxIntToInt64(v_0.AuxInt) != 0 {
16558 break
16559 }
16560 z := v_0.Args[0]
16561 if z.Op != OpPPC64XOR {
16562 break
16563 }
16564 _ = z.Args[1]
16565 z_0 := z.Args[0]
16566 z_1 := z.Args[1]
16567 for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
16568 x := z_0
16569 y := z_1
16570 if !(z.Uses == 1) {
16571 continue
16572 }
16573 v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
16574 v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
16575 v1.AddArg2(x, y)
16576 v0.AddArg(v1)
16577 b.resetWithControl(BlockPPC64NE, v0)
16578 return true
16579 }
16580 break
16581 }
16582 }
16583 return false
16584 }
16585
View as plain text