1 // autogenerated from gen/PPC64.rules: do not edit!
2 // generated with: cd gen; go run *.go
8 var _ = math.MinInt8 // in case not otherwise used
9 func rewriteValuePPC64(v *Value, config *Config) bool {
12 return rewriteValuePPC64_OpAdd16(v, config)
14 return rewriteValuePPC64_OpAdd32(v, config)
16 return rewriteValuePPC64_OpAdd32F(v, config)
18 return rewriteValuePPC64_OpAdd64(v, config)
20 return rewriteValuePPC64_OpAdd64F(v, config)
22 return rewriteValuePPC64_OpAdd8(v, config)
24 return rewriteValuePPC64_OpAddPtr(v, config)
26 return rewriteValuePPC64_OpAddr(v, config)
28 return rewriteValuePPC64_OpAnd16(v, config)
30 return rewriteValuePPC64_OpAnd32(v, config)
32 return rewriteValuePPC64_OpAnd64(v, config)
34 return rewriteValuePPC64_OpAnd8(v, config)
36 return rewriteValuePPC64_OpAndB(v, config)
38 return rewriteValuePPC64_OpAvg64u(v, config)
40 return rewriteValuePPC64_OpClosureCall(v, config)
42 return rewriteValuePPC64_OpCom16(v, config)
44 return rewriteValuePPC64_OpCom32(v, config)
46 return rewriteValuePPC64_OpCom64(v, config)
48 return rewriteValuePPC64_OpCom8(v, config)
50 return rewriteValuePPC64_OpConst16(v, config)
52 return rewriteValuePPC64_OpConst32(v, config)
54 return rewriteValuePPC64_OpConst32F(v, config)
56 return rewriteValuePPC64_OpConst64(v, config)
58 return rewriteValuePPC64_OpConst64F(v, config)
60 return rewriteValuePPC64_OpConst8(v, config)
62 return rewriteValuePPC64_OpConstBool(v, config)
64 return rewriteValuePPC64_OpConstNil(v, config)
66 return rewriteValuePPC64_OpConvert(v, config)
68 return rewriteValuePPC64_OpCvt32Fto32(v, config)
70 return rewriteValuePPC64_OpCvt32Fto64(v, config)
72 return rewriteValuePPC64_OpCvt32Fto64F(v, config)
74 return rewriteValuePPC64_OpCvt32to32F(v, config)
76 return rewriteValuePPC64_OpCvt32to64F(v, config)
78 return rewriteValuePPC64_OpCvt64Fto32(v, config)
80 return rewriteValuePPC64_OpCvt64Fto32F(v, config)
82 return rewriteValuePPC64_OpCvt64Fto64(v, config)
84 return rewriteValuePPC64_OpCvt64to32F(v, config)
86 return rewriteValuePPC64_OpCvt64to64F(v, config)
88 return rewriteValuePPC64_OpDeferCall(v, config)
90 return rewriteValuePPC64_OpDiv16(v, config)
92 return rewriteValuePPC64_OpDiv16u(v, config)
94 return rewriteValuePPC64_OpDiv32(v, config)
96 return rewriteValuePPC64_OpDiv32F(v, config)
98 return rewriteValuePPC64_OpDiv32u(v, config)
100 return rewriteValuePPC64_OpDiv64(v, config)
102 return rewriteValuePPC64_OpDiv64F(v, config)
104 return rewriteValuePPC64_OpDiv64u(v, config)
106 return rewriteValuePPC64_OpDiv8(v, config)
108 return rewriteValuePPC64_OpDiv8u(v, config)
110 return rewriteValuePPC64_OpEq16(v, config)
112 return rewriteValuePPC64_OpEq32(v, config)
114 return rewriteValuePPC64_OpEq32F(v, config)
116 return rewriteValuePPC64_OpEq64(v, config)
118 return rewriteValuePPC64_OpEq64F(v, config)
120 return rewriteValuePPC64_OpEq8(v, config)
122 return rewriteValuePPC64_OpEqB(v, config)
124 return rewriteValuePPC64_OpEqPtr(v, config)
126 return rewriteValuePPC64_OpGeq16(v, config)
128 return rewriteValuePPC64_OpGeq16U(v, config)
130 return rewriteValuePPC64_OpGeq32(v, config)
132 return rewriteValuePPC64_OpGeq32F(v, config)
134 return rewriteValuePPC64_OpGeq32U(v, config)
136 return rewriteValuePPC64_OpGeq64(v, config)
138 return rewriteValuePPC64_OpGeq64F(v, config)
140 return rewriteValuePPC64_OpGeq64U(v, config)
142 return rewriteValuePPC64_OpGeq8(v, config)
144 return rewriteValuePPC64_OpGeq8U(v, config)
145 case OpGetClosurePtr:
146 return rewriteValuePPC64_OpGetClosurePtr(v, config)
148 return rewriteValuePPC64_OpGoCall(v, config)
150 return rewriteValuePPC64_OpGreater16(v, config)
152 return rewriteValuePPC64_OpGreater16U(v, config)
154 return rewriteValuePPC64_OpGreater32(v, config)
156 return rewriteValuePPC64_OpGreater32F(v, config)
158 return rewriteValuePPC64_OpGreater32U(v, config)
160 return rewriteValuePPC64_OpGreater64(v, config)
162 return rewriteValuePPC64_OpGreater64F(v, config)
164 return rewriteValuePPC64_OpGreater64U(v, config)
166 return rewriteValuePPC64_OpGreater8(v, config)
168 return rewriteValuePPC64_OpGreater8U(v, config)
170 return rewriteValuePPC64_OpHmul16(v, config)
172 return rewriteValuePPC64_OpHmul16u(v, config)
174 return rewriteValuePPC64_OpHmul32(v, config)
176 return rewriteValuePPC64_OpHmul32u(v, config)
178 return rewriteValuePPC64_OpHmul64(v, config)
180 return rewriteValuePPC64_OpHmul64u(v, config)
182 return rewriteValuePPC64_OpHmul8(v, config)
184 return rewriteValuePPC64_OpHmul8u(v, config)
186 return rewriteValuePPC64_OpInterCall(v, config)
188 return rewriteValuePPC64_OpIsInBounds(v, config)
190 return rewriteValuePPC64_OpIsNonNil(v, config)
191 case OpIsSliceInBounds:
192 return rewriteValuePPC64_OpIsSliceInBounds(v, config)
194 return rewriteValuePPC64_OpLeq16(v, config)
196 return rewriteValuePPC64_OpLeq16U(v, config)
198 return rewriteValuePPC64_OpLeq32(v, config)
200 return rewriteValuePPC64_OpLeq32F(v, config)
202 return rewriteValuePPC64_OpLeq32U(v, config)
204 return rewriteValuePPC64_OpLeq64(v, config)
206 return rewriteValuePPC64_OpLeq64F(v, config)
208 return rewriteValuePPC64_OpLeq64U(v, config)
210 return rewriteValuePPC64_OpLeq8(v, config)
212 return rewriteValuePPC64_OpLeq8U(v, config)
214 return rewriteValuePPC64_OpLess16(v, config)
216 return rewriteValuePPC64_OpLess16U(v, config)
218 return rewriteValuePPC64_OpLess32(v, config)
220 return rewriteValuePPC64_OpLess32F(v, config)
222 return rewriteValuePPC64_OpLess32U(v, config)
224 return rewriteValuePPC64_OpLess64(v, config)
226 return rewriteValuePPC64_OpLess64F(v, config)
228 return rewriteValuePPC64_OpLess64U(v, config)
230 return rewriteValuePPC64_OpLess8(v, config)
232 return rewriteValuePPC64_OpLess8U(v, config)
234 return rewriteValuePPC64_OpLoad(v, config)
236 return rewriteValuePPC64_OpLsh16x16(v, config)
238 return rewriteValuePPC64_OpLsh16x32(v, config)
240 return rewriteValuePPC64_OpLsh16x64(v, config)
242 return rewriteValuePPC64_OpLsh16x8(v, config)
244 return rewriteValuePPC64_OpLsh32x16(v, config)
246 return rewriteValuePPC64_OpLsh32x32(v, config)
248 return rewriteValuePPC64_OpLsh32x64(v, config)
250 return rewriteValuePPC64_OpLsh32x8(v, config)
252 return rewriteValuePPC64_OpLsh64x16(v, config)
254 return rewriteValuePPC64_OpLsh64x32(v, config)
256 return rewriteValuePPC64_OpLsh64x64(v, config)
258 return rewriteValuePPC64_OpLsh64x8(v, config)
260 return rewriteValuePPC64_OpLsh8x16(v, config)
262 return rewriteValuePPC64_OpLsh8x32(v, config)
264 return rewriteValuePPC64_OpLsh8x64(v, config)
266 return rewriteValuePPC64_OpLsh8x8(v, config)
268 return rewriteValuePPC64_OpMod16(v, config)
270 return rewriteValuePPC64_OpMod16u(v, config)
272 return rewriteValuePPC64_OpMod32(v, config)
274 return rewriteValuePPC64_OpMod32u(v, config)
276 return rewriteValuePPC64_OpMod64(v, config)
278 return rewriteValuePPC64_OpMod64u(v, config)
280 return rewriteValuePPC64_OpMod8(v, config)
282 return rewriteValuePPC64_OpMod8u(v, config)
284 return rewriteValuePPC64_OpMove(v, config)
286 return rewriteValuePPC64_OpMul16(v, config)
288 return rewriteValuePPC64_OpMul32(v, config)
290 return rewriteValuePPC64_OpMul32F(v, config)
292 return rewriteValuePPC64_OpMul64(v, config)
294 return rewriteValuePPC64_OpMul64F(v, config)
296 return rewriteValuePPC64_OpMul8(v, config)
298 return rewriteValuePPC64_OpNeg16(v, config)
300 return rewriteValuePPC64_OpNeg32(v, config)
302 return rewriteValuePPC64_OpNeg32F(v, config)
304 return rewriteValuePPC64_OpNeg64(v, config)
306 return rewriteValuePPC64_OpNeg64F(v, config)
308 return rewriteValuePPC64_OpNeg8(v, config)
310 return rewriteValuePPC64_OpNeq16(v, config)
312 return rewriteValuePPC64_OpNeq32(v, config)
314 return rewriteValuePPC64_OpNeq32F(v, config)
316 return rewriteValuePPC64_OpNeq64(v, config)
318 return rewriteValuePPC64_OpNeq64F(v, config)
320 return rewriteValuePPC64_OpNeq8(v, config)
322 return rewriteValuePPC64_OpNeqB(v, config)
324 return rewriteValuePPC64_OpNeqPtr(v, config)
326 return rewriteValuePPC64_OpNilCheck(v, config)
328 return rewriteValuePPC64_OpNot(v, config)
330 return rewriteValuePPC64_OpOffPtr(v, config)
332 return rewriteValuePPC64_OpOr16(v, config)
334 return rewriteValuePPC64_OpOr32(v, config)
336 return rewriteValuePPC64_OpOr64(v, config)
338 return rewriteValuePPC64_OpOr8(v, config)
340 return rewriteValuePPC64_OpOrB(v, config)
342 return rewriteValuePPC64_OpPPC64ADD(v, config)
343 case OpPPC64ADDconst:
344 return rewriteValuePPC64_OpPPC64ADDconst(v, config)
346 return rewriteValuePPC64_OpPPC64AND(v, config)
347 case OpPPC64ANDconst:
348 return rewriteValuePPC64_OpPPC64ANDconst(v, config)
350 return rewriteValuePPC64_OpPPC64CMP(v, config)
352 return rewriteValuePPC64_OpPPC64CMPU(v, config)
353 case OpPPC64CMPUconst:
354 return rewriteValuePPC64_OpPPC64CMPUconst(v, config)
356 return rewriteValuePPC64_OpPPC64CMPW(v, config)
358 return rewriteValuePPC64_OpPPC64CMPWU(v, config)
359 case OpPPC64CMPWUconst:
360 return rewriteValuePPC64_OpPPC64CMPWUconst(v, config)
361 case OpPPC64CMPWconst:
362 return rewriteValuePPC64_OpPPC64CMPWconst(v, config)
363 case OpPPC64CMPconst:
364 return rewriteValuePPC64_OpPPC64CMPconst(v, config)
366 return rewriteValuePPC64_OpPPC64Equal(v, config)
367 case OpPPC64FMOVDload:
368 return rewriteValuePPC64_OpPPC64FMOVDload(v, config)
369 case OpPPC64FMOVDstore:
370 return rewriteValuePPC64_OpPPC64FMOVDstore(v, config)
371 case OpPPC64FMOVSload:
372 return rewriteValuePPC64_OpPPC64FMOVSload(v, config)
373 case OpPPC64FMOVSstore:
374 return rewriteValuePPC64_OpPPC64FMOVSstore(v, config)
375 case OpPPC64GreaterEqual:
376 return rewriteValuePPC64_OpPPC64GreaterEqual(v, config)
377 case OpPPC64GreaterThan:
378 return rewriteValuePPC64_OpPPC64GreaterThan(v, config)
379 case OpPPC64LessEqual:
380 return rewriteValuePPC64_OpPPC64LessEqual(v, config)
381 case OpPPC64LessThan:
382 return rewriteValuePPC64_OpPPC64LessThan(v, config)
383 case OpPPC64MOVBZload:
384 return rewriteValuePPC64_OpPPC64MOVBZload(v, config)
385 case OpPPC64MOVBZreg:
386 return rewriteValuePPC64_OpPPC64MOVBZreg(v, config)
388 return rewriteValuePPC64_OpPPC64MOVBreg(v, config)
389 case OpPPC64MOVBstore:
390 return rewriteValuePPC64_OpPPC64MOVBstore(v, config)
391 case OpPPC64MOVBstorezero:
392 return rewriteValuePPC64_OpPPC64MOVBstorezero(v, config)
393 case OpPPC64MOVDload:
394 return rewriteValuePPC64_OpPPC64MOVDload(v, config)
395 case OpPPC64MOVDstore:
396 return rewriteValuePPC64_OpPPC64MOVDstore(v, config)
397 case OpPPC64MOVDstorezero:
398 return rewriteValuePPC64_OpPPC64MOVDstorezero(v, config)
399 case OpPPC64MOVHZload:
400 return rewriteValuePPC64_OpPPC64MOVHZload(v, config)
401 case OpPPC64MOVHZreg:
402 return rewriteValuePPC64_OpPPC64MOVHZreg(v, config)
403 case OpPPC64MOVHload:
404 return rewriteValuePPC64_OpPPC64MOVHload(v, config)
406 return rewriteValuePPC64_OpPPC64MOVHreg(v, config)
407 case OpPPC64MOVHstore:
408 return rewriteValuePPC64_OpPPC64MOVHstore(v, config)
409 case OpPPC64MOVHstorezero:
410 return rewriteValuePPC64_OpPPC64MOVHstorezero(v, config)
411 case OpPPC64MOVWZload:
412 return rewriteValuePPC64_OpPPC64MOVWZload(v, config)
413 case OpPPC64MOVWZreg:
414 return rewriteValuePPC64_OpPPC64MOVWZreg(v, config)
415 case OpPPC64MOVWload:
416 return rewriteValuePPC64_OpPPC64MOVWload(v, config)
418 return rewriteValuePPC64_OpPPC64MOVWreg(v, config)
419 case OpPPC64MOVWstore:
420 return rewriteValuePPC64_OpPPC64MOVWstore(v, config)
421 case OpPPC64MOVWstorezero:
422 return rewriteValuePPC64_OpPPC64MOVWstorezero(v, config)
423 case OpPPC64MaskIfNotCarry:
424 return rewriteValuePPC64_OpPPC64MaskIfNotCarry(v, config)
425 case OpPPC64NotEqual:
426 return rewriteValuePPC64_OpPPC64NotEqual(v, config)
428 return rewriteValuePPC64_OpPPC64OR(v, config)
430 return rewriteValuePPC64_OpPPC64ORN(v, config)
432 return rewriteValuePPC64_OpPPC64ORconst(v, config)
434 return rewriteValuePPC64_OpPPC64SUB(v, config)
436 return rewriteValuePPC64_OpPPC64XOR(v, config)
437 case OpPPC64XORconst:
438 return rewriteValuePPC64_OpPPC64XORconst(v, config)
440 return rewriteValuePPC64_OpRsh16Ux16(v, config)
442 return rewriteValuePPC64_OpRsh16Ux32(v, config)
444 return rewriteValuePPC64_OpRsh16Ux64(v, config)
446 return rewriteValuePPC64_OpRsh16Ux8(v, config)
448 return rewriteValuePPC64_OpRsh16x16(v, config)
450 return rewriteValuePPC64_OpRsh16x32(v, config)
452 return rewriteValuePPC64_OpRsh16x64(v, config)
454 return rewriteValuePPC64_OpRsh16x8(v, config)
456 return rewriteValuePPC64_OpRsh32Ux16(v, config)
458 return rewriteValuePPC64_OpRsh32Ux32(v, config)
460 return rewriteValuePPC64_OpRsh32Ux64(v, config)
462 return rewriteValuePPC64_OpRsh32Ux8(v, config)
464 return rewriteValuePPC64_OpRsh32x16(v, config)
466 return rewriteValuePPC64_OpRsh32x32(v, config)
468 return rewriteValuePPC64_OpRsh32x64(v, config)
470 return rewriteValuePPC64_OpRsh32x8(v, config)
472 return rewriteValuePPC64_OpRsh64Ux16(v, config)
474 return rewriteValuePPC64_OpRsh64Ux32(v, config)
476 return rewriteValuePPC64_OpRsh64Ux64(v, config)
478 return rewriteValuePPC64_OpRsh64Ux8(v, config)
480 return rewriteValuePPC64_OpRsh64x16(v, config)
482 return rewriteValuePPC64_OpRsh64x32(v, config)
484 return rewriteValuePPC64_OpRsh64x64(v, config)
486 return rewriteValuePPC64_OpRsh64x8(v, config)
488 return rewriteValuePPC64_OpRsh8Ux16(v, config)
490 return rewriteValuePPC64_OpRsh8Ux32(v, config)
492 return rewriteValuePPC64_OpRsh8Ux64(v, config)
494 return rewriteValuePPC64_OpRsh8Ux8(v, config)
496 return rewriteValuePPC64_OpRsh8x16(v, config)
498 return rewriteValuePPC64_OpRsh8x32(v, config)
500 return rewriteValuePPC64_OpRsh8x64(v, config)
502 return rewriteValuePPC64_OpRsh8x8(v, config)
503 case OpSignExt16to32:
504 return rewriteValuePPC64_OpSignExt16to32(v, config)
505 case OpSignExt16to64:
506 return rewriteValuePPC64_OpSignExt16to64(v, config)
507 case OpSignExt32to64:
508 return rewriteValuePPC64_OpSignExt32to64(v, config)
510 return rewriteValuePPC64_OpSignExt8to16(v, config)
512 return rewriteValuePPC64_OpSignExt8to32(v, config)
514 return rewriteValuePPC64_OpSignExt8to64(v, config)
516 return rewriteValuePPC64_OpSlicemask(v, config)
518 return rewriteValuePPC64_OpSqrt(v, config)
520 return rewriteValuePPC64_OpStaticCall(v, config)
522 return rewriteValuePPC64_OpStore(v, config)
524 return rewriteValuePPC64_OpSub16(v, config)
526 return rewriteValuePPC64_OpSub32(v, config)
528 return rewriteValuePPC64_OpSub32F(v, config)
530 return rewriteValuePPC64_OpSub64(v, config)
532 return rewriteValuePPC64_OpSub64F(v, config)
534 return rewriteValuePPC64_OpSub8(v, config)
536 return rewriteValuePPC64_OpSubPtr(v, config)
538 return rewriteValuePPC64_OpTrunc16to8(v, config)
540 return rewriteValuePPC64_OpTrunc32to16(v, config)
542 return rewriteValuePPC64_OpTrunc32to8(v, config)
544 return rewriteValuePPC64_OpTrunc64to16(v, config)
546 return rewriteValuePPC64_OpTrunc64to32(v, config)
548 return rewriteValuePPC64_OpTrunc64to8(v, config)
550 return rewriteValuePPC64_OpXor16(v, config)
552 return rewriteValuePPC64_OpXor32(v, config)
554 return rewriteValuePPC64_OpXor64(v, config)
556 return rewriteValuePPC64_OpXor8(v, config)
558 return rewriteValuePPC64_OpZero(v, config)
559 case OpZeroExt16to32:
560 return rewriteValuePPC64_OpZeroExt16to32(v, config)
561 case OpZeroExt16to64:
562 return rewriteValuePPC64_OpZeroExt16to64(v, config)
563 case OpZeroExt32to64:
564 return rewriteValuePPC64_OpZeroExt32to64(v, config)
566 return rewriteValuePPC64_OpZeroExt8to16(v, config)
568 return rewriteValuePPC64_OpZeroExt8to32(v, config)
570 return rewriteValuePPC64_OpZeroExt8to64(v, config)
574 func rewriteValuePPC64_OpAdd16(v *Value, config *Config) bool {
577 // match: (Add16 x y)
589 func rewriteValuePPC64_OpAdd32(v *Value, config *Config) bool {
592 // match: (Add32 x y)
604 func rewriteValuePPC64_OpAdd32F(v *Value, config *Config) bool {
607 // match: (Add32F x y)
609 // result: (FADDS x y)
613 v.reset(OpPPC64FADDS)
619 func rewriteValuePPC64_OpAdd64(v *Value, config *Config) bool {
622 // match: (Add64 x y)
634 func rewriteValuePPC64_OpAdd64F(v *Value, config *Config) bool {
637 // match: (Add64F x y)
639 // result: (FADD x y)
649 func rewriteValuePPC64_OpAdd8(v *Value, config *Config) bool {
664 func rewriteValuePPC64_OpAddPtr(v *Value, config *Config) bool {
667 // match: (AddPtr x y)
679 func rewriteValuePPC64_OpAddr(v *Value, config *Config) bool {
682 // match: (Addr {sym} base)
684 // result: (MOVDaddr {sym} base)
688 v.reset(OpPPC64MOVDaddr)
694 func rewriteValuePPC64_OpAnd16(v *Value, config *Config) bool {
697 // match: (And16 x y)
709 func rewriteValuePPC64_OpAnd32(v *Value, config *Config) bool {
712 // match: (And32 x y)
724 func rewriteValuePPC64_OpAnd64(v *Value, config *Config) bool {
727 // match: (And64 x y)
739 func rewriteValuePPC64_OpAnd8(v *Value, config *Config) bool {
754 func rewriteValuePPC64_OpAndB(v *Value, config *Config) bool {
769 func rewriteValuePPC64_OpAvg64u(v *Value, config *Config) bool {
772 // match: (Avg64u <t> x y)
774 // result: (ADD (ADD <t> (SRD <t> x (MOVDconst <t> [1])) (SRD <t> y (MOVDconst <t> [1]))) (ANDconst <t> (AND <t> x y) [1]))
780 v0 := b.NewValue0(v.Pos, OpPPC64ADD, t)
781 v1 := b.NewValue0(v.Pos, OpPPC64SRD, t)
783 v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, t)
787 v3 := b.NewValue0(v.Pos, OpPPC64SRD, t)
789 v4 := b.NewValue0(v.Pos, OpPPC64MOVDconst, t)
794 v5 := b.NewValue0(v.Pos, OpPPC64ANDconst, t)
796 v6 := b.NewValue0(v.Pos, OpPPC64AND, t)
804 func rewriteValuePPC64_OpClosureCall(v *Value, config *Config) bool {
807 // match: (ClosureCall [argwid] entry closure mem)
809 // result: (CALLclosure [argwid] entry closure mem)
815 v.reset(OpPPC64CALLclosure)
823 func rewriteValuePPC64_OpCom16(v *Value, config *Config) bool {
828 // result: (XORconst [-1] x)
831 v.reset(OpPPC64XORconst)
837 func rewriteValuePPC64_OpCom32(v *Value, config *Config) bool {
842 // result: (XORconst [-1] x)
845 v.reset(OpPPC64XORconst)
851 func rewriteValuePPC64_OpCom64(v *Value, config *Config) bool {
856 // result: (XORconst [-1] x)
859 v.reset(OpPPC64XORconst)
865 func rewriteValuePPC64_OpCom8(v *Value, config *Config) bool {
870 // result: (XORconst [-1] x)
873 v.reset(OpPPC64XORconst)
879 func rewriteValuePPC64_OpConst16(v *Value, config *Config) bool {
882 // match: (Const16 [val])
884 // result: (MOVDconst [val])
887 v.reset(OpPPC64MOVDconst)
892 func rewriteValuePPC64_OpConst32(v *Value, config *Config) bool {
895 // match: (Const32 [val])
897 // result: (MOVDconst [val])
900 v.reset(OpPPC64MOVDconst)
905 func rewriteValuePPC64_OpConst32F(v *Value, config *Config) bool {
908 // match: (Const32F [val])
910 // result: (FMOVSconst [val])
913 v.reset(OpPPC64FMOVSconst)
918 func rewriteValuePPC64_OpConst64(v *Value, config *Config) bool {
921 // match: (Const64 [val])
923 // result: (MOVDconst [val])
926 v.reset(OpPPC64MOVDconst)
931 func rewriteValuePPC64_OpConst64F(v *Value, config *Config) bool {
934 // match: (Const64F [val])
936 // result: (FMOVDconst [val])
939 v.reset(OpPPC64FMOVDconst)
944 func rewriteValuePPC64_OpConst8(v *Value, config *Config) bool {
947 // match: (Const8 [val])
949 // result: (MOVDconst [val])
952 v.reset(OpPPC64MOVDconst)
957 func rewriteValuePPC64_OpConstBool(v *Value, config *Config) bool {
960 // match: (ConstBool [b])
962 // result: (MOVDconst [b])
965 v.reset(OpPPC64MOVDconst)
970 func rewriteValuePPC64_OpConstNil(v *Value, config *Config) bool {
975 // result: (MOVDconst [0])
977 v.reset(OpPPC64MOVDconst)
982 func rewriteValuePPC64_OpConvert(v *Value, config *Config) bool {
985 // match: (Convert <t> x mem)
987 // result: (MOVDconvert <t> x mem)
992 v.reset(OpPPC64MOVDconvert)
999 func rewriteValuePPC64_OpCvt32Fto32(v *Value, config *Config) bool {
1002 // match: (Cvt32Fto32 x)
1004 // result: (Xf2i64 (FCTIWZ x))
1007 v.reset(OpPPC64Xf2i64)
1008 v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, config.fe.TypeFloat64())
1014 func rewriteValuePPC64_OpCvt32Fto64(v *Value, config *Config) bool {
1017 // match: (Cvt32Fto64 x)
1019 // result: (Xf2i64 (FCTIDZ x))
1022 v.reset(OpPPC64Xf2i64)
1023 v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, config.fe.TypeFloat64())
1029 func rewriteValuePPC64_OpCvt32Fto64F(v *Value, config *Config) bool {
1032 // match: (Cvt32Fto64F x)
1043 func rewriteValuePPC64_OpCvt32to32F(v *Value, config *Config) bool {
1046 // match: (Cvt32to32F x)
1048 // result: (FRSP (FCFID (Xi2f64 (SignExt32to64 x))))
1051 v.reset(OpPPC64FRSP)
1052 v0 := b.NewValue0(v.Pos, OpPPC64FCFID, config.fe.TypeFloat64())
1053 v1 := b.NewValue0(v.Pos, OpPPC64Xi2f64, config.fe.TypeFloat64())
1054 v2 := b.NewValue0(v.Pos, OpSignExt32to64, config.fe.TypeInt64())
1062 func rewriteValuePPC64_OpCvt32to64F(v *Value, config *Config) bool {
1065 // match: (Cvt32to64F x)
1067 // result: (FCFID (Xi2f64 (SignExt32to64 x)))
1070 v.reset(OpPPC64FCFID)
1071 v0 := b.NewValue0(v.Pos, OpPPC64Xi2f64, config.fe.TypeFloat64())
1072 v1 := b.NewValue0(v.Pos, OpSignExt32to64, config.fe.TypeInt64())
1079 func rewriteValuePPC64_OpCvt64Fto32(v *Value, config *Config) bool {
1082 // match: (Cvt64Fto32 x)
1084 // result: (Xf2i64 (FCTIWZ x))
1087 v.reset(OpPPC64Xf2i64)
1088 v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, config.fe.TypeFloat64())
1094 func rewriteValuePPC64_OpCvt64Fto32F(v *Value, config *Config) bool {
1097 // match: (Cvt64Fto32F x)
1102 v.reset(OpPPC64FRSP)
1107 func rewriteValuePPC64_OpCvt64Fto64(v *Value, config *Config) bool {
1110 // match: (Cvt64Fto64 x)
1112 // result: (Xf2i64 (FCTIDZ x))
1115 v.reset(OpPPC64Xf2i64)
1116 v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, config.fe.TypeFloat64())
1122 func rewriteValuePPC64_OpCvt64to32F(v *Value, config *Config) bool {
1125 // match: (Cvt64to32F x)
1127 // result: (FRSP (FCFID (Xi2f64 x)))
1130 v.reset(OpPPC64FRSP)
1131 v0 := b.NewValue0(v.Pos, OpPPC64FCFID, config.fe.TypeFloat64())
1132 v1 := b.NewValue0(v.Pos, OpPPC64Xi2f64, config.fe.TypeFloat64())
1139 func rewriteValuePPC64_OpCvt64to64F(v *Value, config *Config) bool {
1142 // match: (Cvt64to64F x)
1144 // result: (FCFID (Xi2f64 x))
1147 v.reset(OpPPC64FCFID)
1148 v0 := b.NewValue0(v.Pos, OpPPC64Xi2f64, config.fe.TypeFloat64())
1154 func rewriteValuePPC64_OpDeferCall(v *Value, config *Config) bool {
1157 // match: (DeferCall [argwid] mem)
1159 // result: (CALLdefer [argwid] mem)
1163 v.reset(OpPPC64CALLdefer)
1169 func rewriteValuePPC64_OpDiv16(v *Value, config *Config) bool {
1172 // match: (Div16 x y)
1174 // result: (DIVW (SignExt16to32 x) (SignExt16to32 y))
1178 v.reset(OpPPC64DIVW)
1179 v0 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
1182 v1 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
1188 func rewriteValuePPC64_OpDiv16u(v *Value, config *Config) bool {
1191 // match: (Div16u x y)
1193 // result: (DIVWU (ZeroExt16to32 x) (ZeroExt16to32 y))
1197 v.reset(OpPPC64DIVWU)
1198 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
1201 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
1207 func rewriteValuePPC64_OpDiv32(v *Value, config *Config) bool {
1210 // match: (Div32 x y)
1212 // result: (DIVW x y)
1216 v.reset(OpPPC64DIVW)
1222 func rewriteValuePPC64_OpDiv32F(v *Value, config *Config) bool {
1225 // match: (Div32F x y)
1227 // result: (FDIVS x y)
1231 v.reset(OpPPC64FDIVS)
1237 func rewriteValuePPC64_OpDiv32u(v *Value, config *Config) bool {
1240 // match: (Div32u x y)
1242 // result: (DIVWU x y)
1246 v.reset(OpPPC64DIVWU)
1252 func rewriteValuePPC64_OpDiv64(v *Value, config *Config) bool {
1255 // match: (Div64 x y)
1257 // result: (DIVD x y)
1261 v.reset(OpPPC64DIVD)
1267 func rewriteValuePPC64_OpDiv64F(v *Value, config *Config) bool {
1270 // match: (Div64F x y)
1272 // result: (FDIV x y)
1276 v.reset(OpPPC64FDIV)
1282 func rewriteValuePPC64_OpDiv64u(v *Value, config *Config) bool {
1285 // match: (Div64u x y)
1287 // result: (DIVDU x y)
1291 v.reset(OpPPC64DIVDU)
1297 func rewriteValuePPC64_OpDiv8(v *Value, config *Config) bool {
1300 // match: (Div8 x y)
1302 // result: (DIVW (SignExt8to32 x) (SignExt8to32 y))
1306 v.reset(OpPPC64DIVW)
1307 v0 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
1310 v1 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
1316 func rewriteValuePPC64_OpDiv8u(v *Value, config *Config) bool {
1319 // match: (Div8u x y)
1321 // result: (DIVWU (ZeroExt8to32 x) (ZeroExt8to32 y))
1325 v.reset(OpPPC64DIVWU)
1326 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
1329 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
1335 func rewriteValuePPC64_OpEq16(v *Value, config *Config) bool {
1338 // match: (Eq16 x y)
1339 // cond: isSigned(x.Type) && isSigned(y.Type)
1340 // result: (Equal (CMPW (SignExt16to32 x) (SignExt16to32 y)))
1344 if !(isSigned(x.Type) && isSigned(y.Type)) {
1347 v.reset(OpPPC64Equal)
1348 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
1349 v1 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
1352 v2 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
1358 // match: (Eq16 x y)
1360 // result: (Equal (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
1364 v.reset(OpPPC64Equal)
1365 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
1366 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
1369 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
1376 func rewriteValuePPC64_OpEq32(v *Value, config *Config) bool {
1379 // match: (Eq32 x y)
1381 // result: (Equal (CMPW x y))
1385 v.reset(OpPPC64Equal)
1386 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
1393 func rewriteValuePPC64_OpEq32F(v *Value, config *Config) bool {
1396 // match: (Eq32F x y)
1398 // result: (Equal (FCMPU x y))
1402 v.reset(OpPPC64Equal)
1403 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, TypeFlags)
1410 func rewriteValuePPC64_OpEq64(v *Value, config *Config) bool {
1413 // match: (Eq64 x y)
1415 // result: (Equal (CMP x y))
1419 v.reset(OpPPC64Equal)
1420 v0 := b.NewValue0(v.Pos, OpPPC64CMP, TypeFlags)
1427 func rewriteValuePPC64_OpEq64F(v *Value, config *Config) bool {
1430 // match: (Eq64F x y)
1432 // result: (Equal (FCMPU x y))
1436 v.reset(OpPPC64Equal)
1437 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, TypeFlags)
1444 func rewriteValuePPC64_OpEq8(v *Value, config *Config) bool {
1448 // cond: isSigned(x.Type) && isSigned(y.Type)
1449 // result: (Equal (CMPW (SignExt8to32 x) (SignExt8to32 y)))
1453 if !(isSigned(x.Type) && isSigned(y.Type)) {
1456 v.reset(OpPPC64Equal)
1457 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
1458 v1 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
1461 v2 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
1469 // result: (Equal (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
1473 v.reset(OpPPC64Equal)
1474 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
1475 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
1478 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
1485 func rewriteValuePPC64_OpEqB(v *Value, config *Config) bool {
1490 // result: (ANDconst [1] (EQV x y))
1494 v.reset(OpPPC64ANDconst)
1496 v0 := b.NewValue0(v.Pos, OpPPC64EQV, config.fe.TypeInt64())
1503 func rewriteValuePPC64_OpEqPtr(v *Value, config *Config) bool {
1506 // match: (EqPtr x y)
1508 // result: (Equal (CMP x y))
1512 v.reset(OpPPC64Equal)
1513 v0 := b.NewValue0(v.Pos, OpPPC64CMP, TypeFlags)
1520 func rewriteValuePPC64_OpGeq16(v *Value, config *Config) bool {
1523 // match: (Geq16 x y)
1525 // result: (GreaterEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
1529 v.reset(OpPPC64GreaterEqual)
1530 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
1531 v1 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
1534 v2 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
1541 func rewriteValuePPC64_OpGeq16U(v *Value, config *Config) bool {
1544 // match: (Geq16U x y)
1546 // result: (GreaterEqual (CMPU (ZeroExt16to32 x) (ZeroExt16to32 y)))
1550 v.reset(OpPPC64GreaterEqual)
1551 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, TypeFlags)
1552 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
1555 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
1562 func rewriteValuePPC64_OpGeq32(v *Value, config *Config) bool {
1565 // match: (Geq32 x y)
1567 // result: (GreaterEqual (CMPW x y))
1571 v.reset(OpPPC64GreaterEqual)
1572 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
1579 func rewriteValuePPC64_OpGeq32F(v *Value, config *Config) bool {
1582 // match: (Geq32F x y)
1584 // result: (FGreaterEqual (FCMPU x y))
1588 v.reset(OpPPC64FGreaterEqual)
1589 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, TypeFlags)
1596 func rewriteValuePPC64_OpGeq32U(v *Value, config *Config) bool {
1599 // match: (Geq32U x y)
1601 // result: (GreaterEqual (CMPU x y))
1605 v.reset(OpPPC64GreaterEqual)
1606 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, TypeFlags)
1613 func rewriteValuePPC64_OpGeq64(v *Value, config *Config) bool {
1616 // match: (Geq64 x y)
1618 // result: (GreaterEqual (CMP x y))
1622 v.reset(OpPPC64GreaterEqual)
1623 v0 := b.NewValue0(v.Pos, OpPPC64CMP, TypeFlags)
1630 func rewriteValuePPC64_OpGeq64F(v *Value, config *Config) bool {
1633 // match: (Geq64F x y)
1635 // result: (FGreaterEqual (FCMPU x y))
1639 v.reset(OpPPC64FGreaterEqual)
1640 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, TypeFlags)
1647 func rewriteValuePPC64_OpGeq64U(v *Value, config *Config) bool {
1650 // match: (Geq64U x y)
1652 // result: (GreaterEqual (CMPU x y))
1656 v.reset(OpPPC64GreaterEqual)
1657 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, TypeFlags)
1664 func rewriteValuePPC64_OpGeq8(v *Value, config *Config) bool {
1667 // match: (Geq8 x y)
1669 // result: (GreaterEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
1673 v.reset(OpPPC64GreaterEqual)
1674 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
1675 v1 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
1678 v2 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
1685 func rewriteValuePPC64_OpGeq8U(v *Value, config *Config) bool {
1688 // match: (Geq8U x y)
1690 // result: (GreaterEqual (CMPU (ZeroExt8to32 x) (ZeroExt8to32 y)))
1694 v.reset(OpPPC64GreaterEqual)
1695 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, TypeFlags)
1696 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
1699 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
1706 func rewriteValuePPC64_OpGetClosurePtr(v *Value, config *Config) bool {
1709 // match: (GetClosurePtr)
1711 // result: (LoweredGetClosurePtr)
1713 v.reset(OpPPC64LoweredGetClosurePtr)
1717 func rewriteValuePPC64_OpGoCall(v *Value, config *Config) bool {
1720 // match: (GoCall [argwid] mem)
1722 // result: (CALLgo [argwid] mem)
1726 v.reset(OpPPC64CALLgo)
1732 func rewriteValuePPC64_OpGreater16(v *Value, config *Config) bool {
1735 // match: (Greater16 x y)
1737 // result: (GreaterThan (CMPW (SignExt16to32 x) (SignExt16to32 y)))
1741 v.reset(OpPPC64GreaterThan)
1742 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
1743 v1 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
1746 v2 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
1753 func rewriteValuePPC64_OpGreater16U(v *Value, config *Config) bool {
1756 // match: (Greater16U x y)
1758 // result: (GreaterThan (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
1762 v.reset(OpPPC64GreaterThan)
1763 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, TypeFlags)
1764 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
1767 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
1774 func rewriteValuePPC64_OpGreater32(v *Value, config *Config) bool {
1777 // match: (Greater32 x y)
1779 // result: (GreaterThan (CMPW x y))
1783 v.reset(OpPPC64GreaterThan)
1784 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
1791 func rewriteValuePPC64_OpGreater32F(v *Value, config *Config) bool {
1794 // match: (Greater32F x y)
1796 // result: (FGreaterThan (FCMPU x y))
1800 v.reset(OpPPC64FGreaterThan)
1801 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, TypeFlags)
1808 func rewriteValuePPC64_OpGreater32U(v *Value, config *Config) bool {
1811 // match: (Greater32U x y)
1813 // result: (GreaterThan (CMPWU x y))
1817 v.reset(OpPPC64GreaterThan)
1818 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, TypeFlags)
1825 func rewriteValuePPC64_OpGreater64(v *Value, config *Config) bool {
1828 // match: (Greater64 x y)
1830 // result: (GreaterThan (CMP x y))
1834 v.reset(OpPPC64GreaterThan)
1835 v0 := b.NewValue0(v.Pos, OpPPC64CMP, TypeFlags)
1842 func rewriteValuePPC64_OpGreater64F(v *Value, config *Config) bool {
1845 // match: (Greater64F x y)
1847 // result: (FGreaterThan (FCMPU x y))
1851 v.reset(OpPPC64FGreaterThan)
1852 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, TypeFlags)
1859 func rewriteValuePPC64_OpGreater64U(v *Value, config *Config) bool {
1862 // match: (Greater64U x y)
1864 // result: (GreaterThan (CMPU x y))
1868 v.reset(OpPPC64GreaterThan)
1869 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, TypeFlags)
1876 func rewriteValuePPC64_OpGreater8(v *Value, config *Config) bool {
1879 // match: (Greater8 x y)
1881 // result: (GreaterThan (CMPW (SignExt8to32 x) (SignExt8to32 y)))
1885 v.reset(OpPPC64GreaterThan)
1886 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
1887 v1 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
1890 v2 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
1897 func rewriteValuePPC64_OpGreater8U(v *Value, config *Config) bool {
1900 // match: (Greater8U x y)
1902 // result: (GreaterThan (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
1906 v.reset(OpPPC64GreaterThan)
1907 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, TypeFlags)
1908 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
1911 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
1918 func rewriteValuePPC64_OpHmul16(v *Value, config *Config) bool {
1921 // match: (Hmul16 x y)
1923 // result: (SRAWconst (MULLW <config.fe.TypeInt32()> (SignExt16to32 x) (SignExt16to32 y)) [16])
1927 v.reset(OpPPC64SRAWconst)
1929 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, config.fe.TypeInt32())
1930 v1 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
1933 v2 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
1940 func rewriteValuePPC64_OpHmul16u(v *Value, config *Config) bool {
1943 // match: (Hmul16u x y)
1945 // result: (SRWconst (MULLW <config.fe.TypeUInt32()> (ZeroExt16to32 x) (ZeroExt16to32 y)) [16])
1949 v.reset(OpPPC64SRWconst)
1951 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, config.fe.TypeUInt32())
1952 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
1955 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
1962 func rewriteValuePPC64_OpHmul32(v *Value, config *Config) bool {
1965 // match: (Hmul32 x y)
1967 // result: (MULHW x y)
1971 v.reset(OpPPC64MULHW)
1977 func rewriteValuePPC64_OpHmul32u(v *Value, config *Config) bool {
1980 // match: (Hmul32u x y)
1982 // result: (MULHWU x y)
1986 v.reset(OpPPC64MULHWU)
1992 func rewriteValuePPC64_OpHmul64(v *Value, config *Config) bool {
1995 // match: (Hmul64 x y)
1997 // result: (MULHD x y)
2001 v.reset(OpPPC64MULHD)
2007 func rewriteValuePPC64_OpHmul64u(v *Value, config *Config) bool {
2010 // match: (Hmul64u x y)
2012 // result: (MULHDU x y)
2016 v.reset(OpPPC64MULHDU)
2022 func rewriteValuePPC64_OpHmul8(v *Value, config *Config) bool {
2025 // match: (Hmul8 x y)
2027 // result: (SRAWconst (MULLW <config.fe.TypeInt16()> (SignExt8to32 x) (SignExt8to32 y)) [8])
2031 v.reset(OpPPC64SRAWconst)
2033 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, config.fe.TypeInt16())
2034 v1 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
2037 v2 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
2044 func rewriteValuePPC64_OpHmul8u(v *Value, config *Config) bool {
2047 // match: (Hmul8u x y)
2049 // result: (SRWconst (MULLW <config.fe.TypeUInt16()> (ZeroExt8to32 x) (ZeroExt8to32 y)) [8])
2053 v.reset(OpPPC64SRWconst)
2055 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, config.fe.TypeUInt16())
2056 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
2059 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
2066 func rewriteValuePPC64_OpInterCall(v *Value, config *Config) bool {
2069 // match: (InterCall [argwid] entry mem)
2071 // result: (CALLinter [argwid] entry mem)
2076 v.reset(OpPPC64CALLinter)
2083 func rewriteValuePPC64_OpIsInBounds(v *Value, config *Config) bool {
2086 // match: (IsInBounds idx len)
2088 // result: (LessThan (CMPU idx len))
2092 v.reset(OpPPC64LessThan)
2093 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, TypeFlags)
2100 func rewriteValuePPC64_OpIsNonNil(v *Value, config *Config) bool {
2103 // match: (IsNonNil ptr)
2105 // result: (NotEqual (CMPconst [0] ptr))
2108 v.reset(OpPPC64NotEqual)
2109 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, TypeFlags)
2116 func rewriteValuePPC64_OpIsSliceInBounds(v *Value, config *Config) bool {
2119 // match: (IsSliceInBounds idx len)
2121 // result: (LessEqual (CMPU idx len))
2125 v.reset(OpPPC64LessEqual)
2126 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, TypeFlags)
2133 func rewriteValuePPC64_OpLeq16(v *Value, config *Config) bool {
2136 // match: (Leq16 x y)
2138 // result: (LessEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
2142 v.reset(OpPPC64LessEqual)
2143 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
2144 v1 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
2147 v2 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
2154 func rewriteValuePPC64_OpLeq16U(v *Value, config *Config) bool {
2157 // match: (Leq16U x y)
2159 // result: (LessEqual (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
2163 v.reset(OpPPC64LessEqual)
2164 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, TypeFlags)
2165 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
2168 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
2175 func rewriteValuePPC64_OpLeq32(v *Value, config *Config) bool {
2178 // match: (Leq32 x y)
2180 // result: (LessEqual (CMPW x y))
2184 v.reset(OpPPC64LessEqual)
2185 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
2192 func rewriteValuePPC64_OpLeq32F(v *Value, config *Config) bool {
2195 // match: (Leq32F x y)
2197 // result: (FLessEqual (FCMPU x y))
2201 v.reset(OpPPC64FLessEqual)
2202 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, TypeFlags)
2209 func rewriteValuePPC64_OpLeq32U(v *Value, config *Config) bool {
2212 // match: (Leq32U x y)
2214 // result: (LessEqual (CMPWU x y))
2218 v.reset(OpPPC64LessEqual)
2219 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, TypeFlags)
2226 func rewriteValuePPC64_OpLeq64(v *Value, config *Config) bool {
2229 // match: (Leq64 x y)
2231 // result: (LessEqual (CMP x y))
2235 v.reset(OpPPC64LessEqual)
2236 v0 := b.NewValue0(v.Pos, OpPPC64CMP, TypeFlags)
2243 func rewriteValuePPC64_OpLeq64F(v *Value, config *Config) bool {
2246 // match: (Leq64F x y)
2248 // result: (FLessEqual (FCMPU x y))
2252 v.reset(OpPPC64FLessEqual)
2253 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, TypeFlags)
2260 func rewriteValuePPC64_OpLeq64U(v *Value, config *Config) bool {
2263 // match: (Leq64U x y)
2265 // result: (LessEqual (CMPU x y))
2269 v.reset(OpPPC64LessEqual)
2270 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, TypeFlags)
2277 func rewriteValuePPC64_OpLeq8(v *Value, config *Config) bool {
2280 // match: (Leq8 x y)
2282 // result: (LessEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
2286 v.reset(OpPPC64LessEqual)
2287 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
2288 v1 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
2291 v2 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
2298 func rewriteValuePPC64_OpLeq8U(v *Value, config *Config) bool {
2301 // match: (Leq8U x y)
2303 // result: (LessEqual (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
2307 v.reset(OpPPC64LessEqual)
2308 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, TypeFlags)
2309 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
2312 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
2319 func rewriteValuePPC64_OpLess16(v *Value, config *Config) bool {
2322 // match: (Less16 x y)
2324 // result: (LessThan (CMPW (SignExt16to32 x) (SignExt16to32 y)))
2328 v.reset(OpPPC64LessThan)
2329 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
2330 v1 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
2333 v2 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
2340 func rewriteValuePPC64_OpLess16U(v *Value, config *Config) bool {
2343 // match: (Less16U x y)
2345 // result: (LessThan (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
2349 v.reset(OpPPC64LessThan)
2350 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, TypeFlags)
2351 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
2354 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
2361 func rewriteValuePPC64_OpLess32(v *Value, config *Config) bool {
2364 // match: (Less32 x y)
2366 // result: (LessThan (CMPW x y))
2370 v.reset(OpPPC64LessThan)
2371 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
2378 func rewriteValuePPC64_OpLess32F(v *Value, config *Config) bool {
2381 // match: (Less32F x y)
2383 // result: (FLessThan (FCMPU x y))
2387 v.reset(OpPPC64FLessThan)
2388 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, TypeFlags)
2395 func rewriteValuePPC64_OpLess32U(v *Value, config *Config) bool {
2398 // match: (Less32U x y)
2400 // result: (LessThan (CMPWU x y))
2404 v.reset(OpPPC64LessThan)
2405 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, TypeFlags)
2412 func rewriteValuePPC64_OpLess64(v *Value, config *Config) bool {
2415 // match: (Less64 x y)
2417 // result: (LessThan (CMP x y))
2421 v.reset(OpPPC64LessThan)
2422 v0 := b.NewValue0(v.Pos, OpPPC64CMP, TypeFlags)
2429 func rewriteValuePPC64_OpLess64F(v *Value, config *Config) bool {
2432 // match: (Less64F x y)
2434 // result: (FLessThan (FCMPU x y))
2438 v.reset(OpPPC64FLessThan)
2439 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, TypeFlags)
2446 func rewriteValuePPC64_OpLess64U(v *Value, config *Config) bool {
2449 // match: (Less64U x y)
2451 // result: (LessThan (CMPU x y))
2455 v.reset(OpPPC64LessThan)
2456 v0 := b.NewValue0(v.Pos, OpPPC64CMPU, TypeFlags)
2463 func rewriteValuePPC64_OpLess8(v *Value, config *Config) bool {
2466 // match: (Less8 x y)
2468 // result: (LessThan (CMPW (SignExt8to32 x) (SignExt8to32 y)))
2472 v.reset(OpPPC64LessThan)
2473 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
2474 v1 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
2477 v2 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
2484 func rewriteValuePPC64_OpLess8U(v *Value, config *Config) bool {
2487 // match: (Less8U x y)
2489 // result: (LessThan (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
2493 v.reset(OpPPC64LessThan)
2494 v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, TypeFlags)
2495 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
2498 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
2505 func rewriteValuePPC64_OpLoad(v *Value, config *Config) bool {
2508 // match: (Load <t> ptr mem)
2509 // cond: (is64BitInt(t) || isPtr(t))
2510 // result: (MOVDload ptr mem)
2515 if !(is64BitInt(t) || isPtr(t)) {
2518 v.reset(OpPPC64MOVDload)
2523 // match: (Load <t> ptr mem)
2524 // cond: is32BitInt(t) && isSigned(t)
2525 // result: (MOVWload ptr mem)
2530 if !(is32BitInt(t) && isSigned(t)) {
2533 v.reset(OpPPC64MOVWload)
2538 // match: (Load <t> ptr mem)
2539 // cond: is32BitInt(t) && !isSigned(t)
2540 // result: (MOVWZload ptr mem)
2545 if !(is32BitInt(t) && !isSigned(t)) {
2548 v.reset(OpPPC64MOVWZload)
2553 // match: (Load <t> ptr mem)
2554 // cond: is16BitInt(t) && isSigned(t)
2555 // result: (MOVHload ptr mem)
2560 if !(is16BitInt(t) && isSigned(t)) {
2563 v.reset(OpPPC64MOVHload)
2568 // match: (Load <t> ptr mem)
2569 // cond: is16BitInt(t) && !isSigned(t)
2570 // result: (MOVHZload ptr mem)
2575 if !(is16BitInt(t) && !isSigned(t)) {
2578 v.reset(OpPPC64MOVHZload)
2583 // match: (Load <t> ptr mem)
2584 // cond: t.IsBoolean()
2585 // result: (MOVBZload ptr mem)
2590 if !(t.IsBoolean()) {
2593 v.reset(OpPPC64MOVBZload)
2598 // match: (Load <t> ptr mem)
2599 // cond: is8BitInt(t) && isSigned(t)
2600 // result: (MOVBreg (MOVBZload ptr mem))
2605 if !(is8BitInt(t) && isSigned(t)) {
2608 v.reset(OpPPC64MOVBreg)
2609 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, config.fe.TypeUInt8())
2615 // match: (Load <t> ptr mem)
2616 // cond: is8BitInt(t) && !isSigned(t)
2617 // result: (MOVBZload ptr mem)
2622 if !(is8BitInt(t) && !isSigned(t)) {
2625 v.reset(OpPPC64MOVBZload)
2630 // match: (Load <t> ptr mem)
2631 // cond: is32BitFloat(t)
2632 // result: (FMOVSload ptr mem)
2637 if !(is32BitFloat(t)) {
2640 v.reset(OpPPC64FMOVSload)
2645 // match: (Load <t> ptr mem)
2646 // cond: is64BitFloat(t)
2647 // result: (FMOVDload ptr mem)
2652 if !(is64BitFloat(t)) {
2655 v.reset(OpPPC64FMOVDload)
2662 func rewriteValuePPC64_OpLsh16x16(v *Value, config *Config) bool {
2665 // match: (Lsh16x16 x y)
2667 // result: (SLW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-16] (ZeroExt16to64 y)))))
2673 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
2675 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
2676 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
2678 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
2687 func rewriteValuePPC64_OpLsh16x32(v *Value, config *Config) bool {
2690 // match: (Lsh16x32 x (Const64 [c]))
2691 // cond: uint32(c) < 16
2692 // result: (SLWconst x [c])
2696 if v_1.Op != OpConst64 {
2700 if !(uint32(c) < 16) {
2703 v.reset(OpPPC64SLWconst)
2708 // match: (Lsh16x32 x (MOVDconst [c]))
2709 // cond: uint32(c) < 16
2710 // result: (SLWconst x [c])
2714 if v_1.Op != OpPPC64MOVDconst {
2718 if !(uint32(c) < 16) {
2721 v.reset(OpPPC64SLWconst)
2726 // match: (Lsh16x32 x y)
2728 // result: (SLW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-16] (ZeroExt32to64 y)))))
2734 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
2736 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
2737 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
2739 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
2748 func rewriteValuePPC64_OpLsh16x64(v *Value, config *Config) bool {
2751 // match: (Lsh16x64 x (Const64 [c]))
2752 // cond: uint64(c) < 16
2753 // result: (SLWconst x [c])
2757 if v_1.Op != OpConst64 {
2761 if !(uint64(c) < 16) {
2764 v.reset(OpPPC64SLWconst)
2769 // match: (Lsh16x64 _ (Const64 [c]))
2770 // cond: uint64(c) >= 16
2771 // result: (MOVDconst [0])
2774 if v_1.Op != OpConst64 {
2778 if !(uint64(c) >= 16) {
2781 v.reset(OpPPC64MOVDconst)
2785 // match: (Lsh16x64 x (MOVDconst [c]))
2786 // cond: uint64(c) < 16
2787 // result: (SLWconst x [c])
2791 if v_1.Op != OpPPC64MOVDconst {
2795 if !(uint64(c) < 16) {
2798 v.reset(OpPPC64SLWconst)
2803 // match: (Lsh16x64 x y)
2805 // result: (SLW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-16] y))))
2811 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
2813 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
2814 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
2823 func rewriteValuePPC64_OpLsh16x8(v *Value, config *Config) bool {
2826 // match: (Lsh16x8 x y)
2828 // result: (SLW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-16] (ZeroExt8to64 y)))))
2834 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
2836 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
2837 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
2839 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
2848 func rewriteValuePPC64_OpLsh32x16(v *Value, config *Config) bool {
2851 // match: (Lsh32x16 x y)
2853 // result: (SLW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-32] (ZeroExt16to64 y)))))
2859 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
2861 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
2862 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
2864 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
2873 func rewriteValuePPC64_OpLsh32x32(v *Value, config *Config) bool {
2876 // match: (Lsh32x32 x (Const64 [c]))
2877 // cond: uint32(c) < 32
2878 // result: (SLWconst x [c])
2882 if v_1.Op != OpConst64 {
2886 if !(uint32(c) < 32) {
2889 v.reset(OpPPC64SLWconst)
2894 // match: (Lsh32x32 x (MOVDconst [c]))
2895 // cond: uint32(c) < 32
2896 // result: (SLWconst x [c])
2900 if v_1.Op != OpPPC64MOVDconst {
2904 if !(uint32(c) < 32) {
2907 v.reset(OpPPC64SLWconst)
2912 // match: (Lsh32x32 x y)
2914 // result: (SLW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-32] (ZeroExt32to64 y)))))
2920 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
2922 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
2923 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
2925 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
2934 func rewriteValuePPC64_OpLsh32x64(v *Value, config *Config) bool {
2937 // match: (Lsh32x64 x (Const64 [c]))
2938 // cond: uint64(c) < 32
2939 // result: (SLWconst x [c])
2943 if v_1.Op != OpConst64 {
2947 if !(uint64(c) < 32) {
2950 v.reset(OpPPC64SLWconst)
2955 // match: (Lsh32x64 _ (Const64 [c]))
2956 // cond: uint64(c) >= 32
2957 // result: (MOVDconst [0])
2960 if v_1.Op != OpConst64 {
2964 if !(uint64(c) >= 32) {
2967 v.reset(OpPPC64MOVDconst)
2971 // match: (Lsh32x64 x (MOVDconst [c]))
2972 // cond: uint64(c) < 32
2973 // result: (SLWconst x [c])
2977 if v_1.Op != OpPPC64MOVDconst {
2981 if !(uint64(c) < 32) {
2984 v.reset(OpPPC64SLWconst)
2989 // match: (Lsh32x64 x y)
2991 // result: (SLW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-32] y))))
2997 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
2999 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
3000 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
3009 func rewriteValuePPC64_OpLsh32x8(v *Value, config *Config) bool {
3012 // match: (Lsh32x8 x y)
3014 // result: (SLW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-32] (ZeroExt8to64 y)))))
3020 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
3022 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
3023 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
3025 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
3034 func rewriteValuePPC64_OpLsh64x16(v *Value, config *Config) bool {
3037 // match: (Lsh64x16 x y)
3039 // result: (SLD x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-64] (ZeroExt16to64 y)))))
3045 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
3047 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
3048 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
3050 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
3059 func rewriteValuePPC64_OpLsh64x32(v *Value, config *Config) bool {
3062 // match: (Lsh64x32 x (Const64 [c]))
3063 // cond: uint32(c) < 64
3064 // result: (SLDconst x [c])
3068 if v_1.Op != OpConst64 {
3072 if !(uint32(c) < 64) {
3075 v.reset(OpPPC64SLDconst)
3080 // match: (Lsh64x32 x (MOVDconst [c]))
3081 // cond: uint32(c) < 64
3082 // result: (SLDconst x [c])
3086 if v_1.Op != OpPPC64MOVDconst {
3090 if !(uint32(c) < 64) {
3093 v.reset(OpPPC64SLDconst)
3098 // match: (Lsh64x32 x y)
3100 // result: (SLD x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-64] (ZeroExt32to64 y)))))
3106 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
3108 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
3109 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
3111 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
3120 func rewriteValuePPC64_OpLsh64x64(v *Value, config *Config) bool {
3123 // match: (Lsh64x64 x (Const64 [c]))
3124 // cond: uint64(c) < 64
3125 // result: (SLDconst x [c])
3129 if v_1.Op != OpConst64 {
3133 if !(uint64(c) < 64) {
3136 v.reset(OpPPC64SLDconst)
3141 // match: (Lsh64x64 _ (Const64 [c]))
3142 // cond: uint64(c) >= 64
3143 // result: (MOVDconst [0])
3146 if v_1.Op != OpConst64 {
3150 if !(uint64(c) >= 64) {
3153 v.reset(OpPPC64MOVDconst)
3157 // match: (Lsh64x64 x (MOVDconst [c]))
3158 // cond: uint64(c) < 64
3159 // result: (SLDconst x [c])
3163 if v_1.Op != OpPPC64MOVDconst {
3167 if !(uint64(c) < 64) {
3170 v.reset(OpPPC64SLDconst)
3175 // match: (Lsh64x64 x y)
3177 // result: (SLD x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-64] y))))
3183 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
3185 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
3186 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
3195 func rewriteValuePPC64_OpLsh64x8(v *Value, config *Config) bool {
3198 // match: (Lsh64x8 x y)
3200 // result: (SLD x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-64] (ZeroExt8to64 y)))))
3206 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
3208 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
3209 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
3211 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
3220 func rewriteValuePPC64_OpLsh8x16(v *Value, config *Config) bool {
3223 // match: (Lsh8x16 x y)
3225 // result: (SLW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-8] (ZeroExt16to64 y)))))
3231 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
3233 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
3234 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
3236 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
3245 func rewriteValuePPC64_OpLsh8x32(v *Value, config *Config) bool {
3248 // match: (Lsh8x32 x (Const64 [c]))
3249 // cond: uint32(c) < 8
3250 // result: (SLWconst x [c])
3254 if v_1.Op != OpConst64 {
3258 if !(uint32(c) < 8) {
3261 v.reset(OpPPC64SLWconst)
3266 // match: (Lsh8x32 x (MOVDconst [c]))
3267 // cond: uint32(c) < 8
3268 // result: (SLWconst x [c])
3272 if v_1.Op != OpPPC64MOVDconst {
3276 if !(uint32(c) < 8) {
3279 v.reset(OpPPC64SLWconst)
3284 // match: (Lsh8x32 x y)
3286 // result: (SLW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-8] (ZeroExt32to64 y)))))
3292 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
3294 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
3295 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
3297 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
3306 func rewriteValuePPC64_OpLsh8x64(v *Value, config *Config) bool {
3309 // match: (Lsh8x64 x (Const64 [c]))
3310 // cond: uint64(c) < 8
3311 // result: (SLWconst x [c])
3315 if v_1.Op != OpConst64 {
3319 if !(uint64(c) < 8) {
3322 v.reset(OpPPC64SLWconst)
3327 // match: (Lsh8x64 _ (Const64 [c]))
3328 // cond: uint64(c) >= 8
3329 // result: (MOVDconst [0])
3332 if v_1.Op != OpConst64 {
3336 if !(uint64(c) >= 8) {
3339 v.reset(OpPPC64MOVDconst)
3343 // match: (Lsh8x64 x (MOVDconst [c]))
3344 // cond: uint64(c) < 8
3345 // result: (SLWconst x [c])
3349 if v_1.Op != OpPPC64MOVDconst {
3353 if !(uint64(c) < 8) {
3356 v.reset(OpPPC64SLWconst)
3361 // match: (Lsh8x64 x y)
3363 // result: (SLW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-8] y))))
3369 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
3371 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
3372 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
3381 func rewriteValuePPC64_OpLsh8x8(v *Value, config *Config) bool {
3384 // match: (Lsh8x8 x y)
3386 // result: (SLW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-8] (ZeroExt8to64 y)))))
3392 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
3394 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
3395 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
3397 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
3406 func rewriteValuePPC64_OpMod16(v *Value, config *Config) bool {
3409 // match: (Mod16 x y)
3411 // result: (Mod32 (SignExt16to32 x) (SignExt16to32 y))
3416 v0 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
3419 v1 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
3425 func rewriteValuePPC64_OpMod16u(v *Value, config *Config) bool {
3428 // match: (Mod16u x y)
3430 // result: (Mod32u (ZeroExt16to32 x) (ZeroExt16to32 y))
3435 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
3438 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
3444 func rewriteValuePPC64_OpMod32(v *Value, config *Config) bool {
3447 // match: (Mod32 x y)
3449 // result: (SUB x (MULLW y (DIVW x y)))
3455 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, config.fe.TypeInt32())
3457 v1 := b.NewValue0(v.Pos, OpPPC64DIVW, config.fe.TypeInt32())
3465 func rewriteValuePPC64_OpMod32u(v *Value, config *Config) bool {
3468 // match: (Mod32u x y)
3470 // result: (SUB x (MULLW y (DIVWU x y)))
3476 v0 := b.NewValue0(v.Pos, OpPPC64MULLW, config.fe.TypeInt32())
3478 v1 := b.NewValue0(v.Pos, OpPPC64DIVWU, config.fe.TypeInt32())
3486 func rewriteValuePPC64_OpMod64(v *Value, config *Config) bool {
3489 // match: (Mod64 x y)
3491 // result: (SUB x (MULLD y (DIVD x y)))
3497 v0 := b.NewValue0(v.Pos, OpPPC64MULLD, config.fe.TypeInt64())
3499 v1 := b.NewValue0(v.Pos, OpPPC64DIVD, config.fe.TypeInt64())
3507 func rewriteValuePPC64_OpMod64u(v *Value, config *Config) bool {
3510 // match: (Mod64u x y)
3512 // result: (SUB x (MULLD y (DIVDU x y)))
3518 v0 := b.NewValue0(v.Pos, OpPPC64MULLD, config.fe.TypeInt64())
3520 v1 := b.NewValue0(v.Pos, OpPPC64DIVDU, config.fe.TypeInt64())
3528 func rewriteValuePPC64_OpMod8(v *Value, config *Config) bool {
3531 // match: (Mod8 x y)
3533 // result: (Mod32 (SignExt8to32 x) (SignExt8to32 y))
3538 v0 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
3541 v1 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
3547 func rewriteValuePPC64_OpMod8u(v *Value, config *Config) bool {
3550 // match: (Mod8u x y)
3552 // result: (Mod32u (ZeroExt8to32 x) (ZeroExt8to32 y))
3557 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
3560 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
3566 func rewriteValuePPC64_OpMove(v *Value, config *Config) bool {
3569 // match: (Move [s] _ _ mem)
3570 // cond: SizeAndAlign(s).Size() == 0
3575 if !(SizeAndAlign(s).Size() == 0) {
3583 // match: (Move [s] dst src mem)
3584 // cond: SizeAndAlign(s).Size() == 1
3585 // result: (MOVBstore dst (MOVBZload src mem) mem)
3591 if !(SizeAndAlign(s).Size() == 1) {
3594 v.reset(OpPPC64MOVBstore)
3596 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, config.fe.TypeUInt8())
3603 // match: (Move [s] dst src mem)
3604 // cond: SizeAndAlign(s).Size() == 2 && SizeAndAlign(s).Align()%2 == 0
3605 // result: (MOVHstore dst (MOVHZload src mem) mem)
3611 if !(SizeAndAlign(s).Size() == 2 && SizeAndAlign(s).Align()%2 == 0) {
3614 v.reset(OpPPC64MOVHstore)
3616 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, config.fe.TypeUInt16())
3623 // match: (Move [s] dst src mem)
3624 // cond: SizeAndAlign(s).Size() == 2
3625 // result: (MOVBstore [1] dst (MOVBZload [1] src mem) (MOVBstore dst (MOVBZload src mem) mem))
3631 if !(SizeAndAlign(s).Size() == 2) {
3634 v.reset(OpPPC64MOVBstore)
3637 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, config.fe.TypeUInt8())
3642 v1 := b.NewValue0(v.Pos, OpPPC64MOVBstore, TypeMem)
3644 v2 := b.NewValue0(v.Pos, OpPPC64MOVBZload, config.fe.TypeUInt8())
3652 // match: (Move [s] dst src mem)
3653 // cond: SizeAndAlign(s).Size() == 4 && SizeAndAlign(s).Align()%4 == 0
3654 // result: (MOVWstore dst (MOVWload src mem) mem)
3660 if !(SizeAndAlign(s).Size() == 4 && SizeAndAlign(s).Align()%4 == 0) {
3663 v.reset(OpPPC64MOVWstore)
3665 v0 := b.NewValue0(v.Pos, OpPPC64MOVWload, config.fe.TypeInt32())
3672 // match: (Move [s] dst src mem)
3673 // cond: SizeAndAlign(s).Size() == 4 && SizeAndAlign(s).Align()%2 == 0
3674 // result: (MOVHstore [2] dst (MOVHZload [2] src mem) (MOVHstore dst (MOVHZload src mem) mem))
3680 if !(SizeAndAlign(s).Size() == 4 && SizeAndAlign(s).Align()%2 == 0) {
3683 v.reset(OpPPC64MOVHstore)
3686 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, config.fe.TypeUInt16())
3691 v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, TypeMem)
3693 v2 := b.NewValue0(v.Pos, OpPPC64MOVHZload, config.fe.TypeUInt16())
3701 // match: (Move [s] dst src mem)
3702 // cond: SizeAndAlign(s).Size() == 4
3703 // result: (MOVBstore [3] dst (MOVBZload [3] src mem) (MOVBstore [2] dst (MOVBZload [2] src mem) (MOVBstore [1] dst (MOVBZload [1] src mem) (MOVBstore dst (MOVBZload src mem) mem))))
3709 if !(SizeAndAlign(s).Size() == 4) {
3712 v.reset(OpPPC64MOVBstore)
3715 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, config.fe.TypeUInt8())
3720 v1 := b.NewValue0(v.Pos, OpPPC64MOVBstore, TypeMem)
3723 v2 := b.NewValue0(v.Pos, OpPPC64MOVBZload, config.fe.TypeUInt8())
3728 v3 := b.NewValue0(v.Pos, OpPPC64MOVBstore, TypeMem)
3731 v4 := b.NewValue0(v.Pos, OpPPC64MOVBZload, config.fe.TypeUInt8())
3736 v5 := b.NewValue0(v.Pos, OpPPC64MOVBstore, TypeMem)
3738 v6 := b.NewValue0(v.Pos, OpPPC64MOVBZload, config.fe.TypeUInt8())
3748 // match: (Move [s] dst src mem)
3749 // cond: SizeAndAlign(s).Size() == 8 && SizeAndAlign(s).Align()%8 == 0
3750 // result: (MOVDstore dst (MOVDload src mem) mem)
3756 if !(SizeAndAlign(s).Size() == 8 && SizeAndAlign(s).Align()%8 == 0) {
3759 v.reset(OpPPC64MOVDstore)
3761 v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, config.fe.TypeInt64())
3768 // match: (Move [s] dst src mem)
3769 // cond: SizeAndAlign(s).Size() == 8 && SizeAndAlign(s).Align()%4 == 0
3770 // result: (MOVWstore [4] dst (MOVWZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
3776 if !(SizeAndAlign(s).Size() == 8 && SizeAndAlign(s).Align()%4 == 0) {
3779 v.reset(OpPPC64MOVWstore)
3782 v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, config.fe.TypeUInt32())
3787 v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, TypeMem)
3789 v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, config.fe.TypeUInt32())
3797 // match: (Move [s] dst src mem)
3798 // cond: SizeAndAlign(s).Size() == 8 && SizeAndAlign(s).Align()%2 == 0
3799 // result: (MOVHstore [6] dst (MOVHZload [6] src mem) (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVHstore [2] dst (MOVHZload [2] src mem) (MOVHstore dst (MOVHZload src mem) mem))))
3805 if !(SizeAndAlign(s).Size() == 8 && SizeAndAlign(s).Align()%2 == 0) {
3808 v.reset(OpPPC64MOVHstore)
3811 v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, config.fe.TypeUInt16())
3816 v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, TypeMem)
3819 v2 := b.NewValue0(v.Pos, OpPPC64MOVHZload, config.fe.TypeUInt16())
3824 v3 := b.NewValue0(v.Pos, OpPPC64MOVHstore, TypeMem)
3827 v4 := b.NewValue0(v.Pos, OpPPC64MOVHZload, config.fe.TypeUInt16())
3832 v5 := b.NewValue0(v.Pos, OpPPC64MOVHstore, TypeMem)
3834 v6 := b.NewValue0(v.Pos, OpPPC64MOVHZload, config.fe.TypeUInt16())
3844 // match: (Move [s] dst src mem)
3845 // cond: SizeAndAlign(s).Size() == 3
3846 // result: (MOVBstore [2] dst (MOVBZload [2] src mem) (MOVBstore [1] dst (MOVBZload [1] src mem) (MOVBstore dst (MOVBZload src mem) mem)))
3852 if !(SizeAndAlign(s).Size() == 3) {
3855 v.reset(OpPPC64MOVBstore)
3858 v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, config.fe.TypeUInt8())
3863 v1 := b.NewValue0(v.Pos, OpPPC64MOVBstore, TypeMem)
3866 v2 := b.NewValue0(v.Pos, OpPPC64MOVBZload, config.fe.TypeUInt8())
3871 v3 := b.NewValue0(v.Pos, OpPPC64MOVBstore, TypeMem)
3873 v4 := b.NewValue0(v.Pos, OpPPC64MOVBZload, config.fe.TypeUInt8())
3882 // match: (Move [s] dst src mem)
3883 // cond: (SizeAndAlign(s).Size() > 512 || config.noDuffDevice) || SizeAndAlign(s).Align()%8 != 0
3884 // result: (LoweredMove [SizeAndAlign(s).Align()] dst src (ADDconst <src.Type> src [SizeAndAlign(s).Size()-moveSize(SizeAndAlign(s).Align(), config)]) mem)
3890 if !((SizeAndAlign(s).Size() > 512 || config.noDuffDevice) || SizeAndAlign(s).Align()%8 != 0) {
3893 v.reset(OpPPC64LoweredMove)
3894 v.AuxInt = SizeAndAlign(s).Align()
3897 v0 := b.NewValue0(v.Pos, OpPPC64ADDconst, src.Type)
3898 v0.AuxInt = SizeAndAlign(s).Size() - moveSize(SizeAndAlign(s).Align(), config)
3906 func rewriteValuePPC64_OpMul16(v *Value, config *Config) bool {
3909 // match: (Mul16 x y)
3911 // result: (MULLW x y)
3915 v.reset(OpPPC64MULLW)
3921 func rewriteValuePPC64_OpMul32(v *Value, config *Config) bool {
3924 // match: (Mul32 x y)
3926 // result: (MULLW x y)
3930 v.reset(OpPPC64MULLW)
3936 func rewriteValuePPC64_OpMul32F(v *Value, config *Config) bool {
3939 // match: (Mul32F x y)
3941 // result: (FMULS x y)
3945 v.reset(OpPPC64FMULS)
3951 func rewriteValuePPC64_OpMul64(v *Value, config *Config) bool {
3954 // match: (Mul64 x y)
3956 // result: (MULLD x y)
3960 v.reset(OpPPC64MULLD)
3966 func rewriteValuePPC64_OpMul64F(v *Value, config *Config) bool {
3969 // match: (Mul64F x y)
3971 // result: (FMUL x y)
3975 v.reset(OpPPC64FMUL)
3981 func rewriteValuePPC64_OpMul8(v *Value, config *Config) bool {
3984 // match: (Mul8 x y)
3986 // result: (MULLW x y)
3990 v.reset(OpPPC64MULLW)
3996 func rewriteValuePPC64_OpNeg16(v *Value, config *Config) bool {
4009 func rewriteValuePPC64_OpNeg32(v *Value, config *Config) bool {
4022 func rewriteValuePPC64_OpNeg32F(v *Value, config *Config) bool {
4025 // match: (Neg32F x)
4030 v.reset(OpPPC64FNEG)
4035 func rewriteValuePPC64_OpNeg64(v *Value, config *Config) bool {
4048 func rewriteValuePPC64_OpNeg64F(v *Value, config *Config) bool {
4051 // match: (Neg64F x)
4056 v.reset(OpPPC64FNEG)
4061 func rewriteValuePPC64_OpNeg8(v *Value, config *Config) bool {
4074 func rewriteValuePPC64_OpNeq16(v *Value, config *Config) bool {
4077 // match: (Neq16 x y)
4078 // cond: isSigned(x.Type) && isSigned(y.Type)
4079 // result: (NotEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
4083 if !(isSigned(x.Type) && isSigned(y.Type)) {
4086 v.reset(OpPPC64NotEqual)
4087 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
4088 v1 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
4091 v2 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
4097 // match: (Neq16 x y)
4099 // result: (NotEqual (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
4103 v.reset(OpPPC64NotEqual)
4104 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
4105 v1 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
4108 v2 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
4115 func rewriteValuePPC64_OpNeq32(v *Value, config *Config) bool {
4118 // match: (Neq32 x y)
4120 // result: (NotEqual (CMPW x y))
4124 v.reset(OpPPC64NotEqual)
4125 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
4132 func rewriteValuePPC64_OpNeq32F(v *Value, config *Config) bool {
4135 // match: (Neq32F x y)
4137 // result: (NotEqual (FCMPU x y))
4141 v.reset(OpPPC64NotEqual)
4142 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, TypeFlags)
4149 func rewriteValuePPC64_OpNeq64(v *Value, config *Config) bool {
4152 // match: (Neq64 x y)
4154 // result: (NotEqual (CMP x y))
4158 v.reset(OpPPC64NotEqual)
4159 v0 := b.NewValue0(v.Pos, OpPPC64CMP, TypeFlags)
4166 func rewriteValuePPC64_OpNeq64F(v *Value, config *Config) bool {
4169 // match: (Neq64F x y)
4171 // result: (NotEqual (FCMPU x y))
4175 v.reset(OpPPC64NotEqual)
4176 v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, TypeFlags)
4183 func rewriteValuePPC64_OpNeq8(v *Value, config *Config) bool {
4186 // match: (Neq8 x y)
4187 // cond: isSigned(x.Type) && isSigned(y.Type)
4188 // result: (NotEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
4192 if !(isSigned(x.Type) && isSigned(y.Type)) {
4195 v.reset(OpPPC64NotEqual)
4196 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
4197 v1 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
4200 v2 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
4206 // match: (Neq8 x y)
4208 // result: (NotEqual (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
4212 v.reset(OpPPC64NotEqual)
4213 v0 := b.NewValue0(v.Pos, OpPPC64CMPW, TypeFlags)
4214 v1 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
4217 v2 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
4224 func rewriteValuePPC64_OpNeqB(v *Value, config *Config) bool {
4227 // match: (NeqB x y)
4229 // result: (XOR x y)
4239 func rewriteValuePPC64_OpNeqPtr(v *Value, config *Config) bool {
4242 // match: (NeqPtr x y)
4244 // result: (NotEqual (CMP x y))
4248 v.reset(OpPPC64NotEqual)
4249 v0 := b.NewValue0(v.Pos, OpPPC64CMP, TypeFlags)
4256 func rewriteValuePPC64_OpNilCheck(v *Value, config *Config) bool {
4259 // match: (NilCheck ptr mem)
4261 // result: (LoweredNilCheck ptr mem)
4265 v.reset(OpPPC64LoweredNilCheck)
4271 func rewriteValuePPC64_OpNot(v *Value, config *Config) bool {
4276 // result: (XORconst [1] x)
4279 v.reset(OpPPC64XORconst)
4285 func rewriteValuePPC64_OpOffPtr(v *Value, config *Config) bool {
4288 // match: (OffPtr [off] ptr)
4290 // result: (ADD (MOVDconst <config.Frontend().TypeInt64()> [off]) ptr)
4295 v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, config.Frontend().TypeInt64())
4302 func rewriteValuePPC64_OpOr16(v *Value, config *Config) bool {
4305 // match: (Or16 x y)
4317 func rewriteValuePPC64_OpOr32(v *Value, config *Config) bool {
4320 // match: (Or32 x y)
4332 func rewriteValuePPC64_OpOr64(v *Value, config *Config) bool {
4335 // match: (Or64 x y)
4347 func rewriteValuePPC64_OpOr8(v *Value, config *Config) bool {
4362 func rewriteValuePPC64_OpOrB(v *Value, config *Config) bool {
4377 func rewriteValuePPC64_OpPPC64ADD(v *Value, config *Config) bool {
4380 // match: (ADD (MOVDconst [c]) x)
4382 // result: (ADDconst [c] x)
4385 if v_0.Op != OpPPC64MOVDconst {
4393 v.reset(OpPPC64ADDconst)
4398 // match: (ADD x (MOVDconst [c]))
4400 // result: (ADDconst [c] x)
4404 if v_1.Op != OpPPC64MOVDconst {
4411 v.reset(OpPPC64ADDconst)
4418 func rewriteValuePPC64_OpPPC64ADDconst(v *Value, config *Config) bool {
4421 // match: (ADDconst [c] (ADDconst [d] x))
4422 // cond: is32Bit(c+d)
4423 // result: (ADDconst [c+d] x)
4427 if v_0.Op != OpPPC64ADDconst {
4432 if !(is32Bit(c + d)) {
4435 v.reset(OpPPC64ADDconst)
4440 // match: (ADDconst [0] x)
4453 // match: (ADDconst [c] (MOVDaddr [d] {sym} x))
4455 // result: (MOVDaddr [c+d] {sym} x)
4459 if v_0.Op != OpPPC64MOVDaddr {
4465 v.reset(OpPPC64MOVDaddr)
4473 func rewriteValuePPC64_OpPPC64AND(v *Value, config *Config) bool {
4476 // match: (AND x (XORconst [-1] y))
4478 // result: (ANDN x y)
4482 if v_1.Op != OpPPC64XORconst {
4485 if v_1.AuxInt != -1 {
4489 v.reset(OpPPC64ANDN)
4494 // match: (AND (MOVDconst [c]) (MOVDconst [d]))
4496 // result: (MOVDconst [c&d])
4499 if v_0.Op != OpPPC64MOVDconst {
4504 if v_1.Op != OpPPC64MOVDconst {
4508 v.reset(OpPPC64MOVDconst)
4512 // match: (AND x (MOVDconst [c]))
4513 // cond: isU16Bit(c)
4514 // result: (ANDconst [c] x)
4518 if v_1.Op != OpPPC64MOVDconst {
4525 v.reset(OpPPC64ANDconst)
4530 // match: (AND (MOVDconst [c]) x)
4531 // cond: isU16Bit(c)
4532 // result: (ANDconst [c] x)
4535 if v_0.Op != OpPPC64MOVDconst {
4543 v.reset(OpPPC64ANDconst)
4548 // match: (AND (MOVDconst [c]) x:(MOVBZload _ _))
4550 // result: (ANDconst [c&0xFF] x)
4553 if v_0.Op != OpPPC64MOVDconst {
4558 if x.Op != OpPPC64MOVBZload {
4561 v.reset(OpPPC64ANDconst)
4566 // match: (AND x:(MOVBZload _ _) (MOVDconst [c]))
4568 // result: (ANDconst [c&0xFF] x)
4571 if x.Op != OpPPC64MOVBZload {
4575 if v_1.Op != OpPPC64MOVDconst {
4579 v.reset(OpPPC64ANDconst)
4586 func rewriteValuePPC64_OpPPC64ANDconst(v *Value, config *Config) bool {
4589 // match: (ANDconst [c] (ANDconst [d] x))
4591 // result: (ANDconst [c&d] x)
4595 if v_0.Op != OpPPC64ANDconst {
4600 v.reset(OpPPC64ANDconst)
4605 // match: (ANDconst [-1] x)
4618 // match: (ANDconst [0] _)
4620 // result: (MOVDconst [0])
4625 v.reset(OpPPC64MOVDconst)
4629 // match: (ANDconst [c] y:(MOVBZreg _))
4630 // cond: c&0xFF == 0xFF
4635 if y.Op != OpPPC64MOVBZreg {
4638 if !(c&0xFF == 0xFF) {
4646 // match: (ANDconst [c] y:(MOVHZreg _))
4647 // cond: c&0xFFFF == 0xFFFF
4652 if y.Op != OpPPC64MOVHZreg {
4655 if !(c&0xFFFF == 0xFFFF) {
4663 // match: (ANDconst [c] y:(MOVWZreg _))
4664 // cond: c&0xFFFFFFFF == 0xFFFFFFFF
4669 if y.Op != OpPPC64MOVWZreg {
4672 if !(c&0xFFFFFFFF == 0xFFFFFFFF) {
4680 // match: (ANDconst [c] (MOVBZreg x))
4682 // result: (ANDconst [c&0xFF] x)
4686 if v_0.Op != OpPPC64MOVBZreg {
4690 v.reset(OpPPC64ANDconst)
4695 // match: (ANDconst [c] (MOVHZreg x))
4697 // result: (ANDconst [c&0xFFFF] x)
4701 if v_0.Op != OpPPC64MOVHZreg {
4705 v.reset(OpPPC64ANDconst)
4706 v.AuxInt = c & 0xFFFF
4710 // match: (ANDconst [c] (MOVWZreg x))
4712 // result: (ANDconst [c&0xFFFFFFFF] x)
4716 if v_0.Op != OpPPC64MOVWZreg {
4720 v.reset(OpPPC64ANDconst)
4721 v.AuxInt = c & 0xFFFFFFFF
4727 func rewriteValuePPC64_OpPPC64CMP(v *Value, config *Config) bool {
4730 // match: (CMP x (MOVDconst [c]))
4732 // result: (CMPconst x [c])
4736 if v_1.Op != OpPPC64MOVDconst {
4743 v.reset(OpPPC64CMPconst)
4748 // match: (CMP (MOVDconst [c]) y)
4750 // result: (InvertFlags (CMPconst y [c]))
4753 if v_0.Op != OpPPC64MOVDconst {
4761 v.reset(OpPPC64InvertFlags)
4762 v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, TypeFlags)
4770 func rewriteValuePPC64_OpPPC64CMPU(v *Value, config *Config) bool {
4773 // match: (CMPU x (MOVDconst [c]))
4774 // cond: isU16Bit(c)
4775 // result: (CMPUconst x [c])
4779 if v_1.Op != OpPPC64MOVDconst {
4786 v.reset(OpPPC64CMPUconst)
4791 // match: (CMPU (MOVDconst [c]) y)
4792 // cond: isU16Bit(c)
4793 // result: (InvertFlags (CMPUconst y [c]))
4796 if v_0.Op != OpPPC64MOVDconst {
4804 v.reset(OpPPC64InvertFlags)
4805 v0 := b.NewValue0(v.Pos, OpPPC64CMPUconst, TypeFlags)
4813 func rewriteValuePPC64_OpPPC64CMPUconst(v *Value, config *Config) bool {
4816 // match: (CMPUconst (MOVDconst [x]) [y])
4817 // cond: int64(x)==int64(y)
4822 if v_0.Op != OpPPC64MOVDconst {
4826 if !(int64(x) == int64(y)) {
4829 v.reset(OpPPC64FlagEQ)
4832 // match: (CMPUconst (MOVDconst [x]) [y])
4833 // cond: uint64(x)<uint64(y)
4838 if v_0.Op != OpPPC64MOVDconst {
4842 if !(uint64(x) < uint64(y)) {
4845 v.reset(OpPPC64FlagLT)
4848 // match: (CMPUconst (MOVDconst [x]) [y])
4849 // cond: uint64(x)>uint64(y)
4854 if v_0.Op != OpPPC64MOVDconst {
4858 if !(uint64(x) > uint64(y)) {
4861 v.reset(OpPPC64FlagGT)
4866 func rewriteValuePPC64_OpPPC64CMPW(v *Value, config *Config) bool {
4869 // match: (CMPW x (MOVWreg y))
4871 // result: (CMPW x y)
4875 if v_1.Op != OpPPC64MOVWreg {
4879 v.reset(OpPPC64CMPW)
4884 // match: (CMPW (MOVWreg x) y)
4886 // result: (CMPW x y)
4889 if v_0.Op != OpPPC64MOVWreg {
4894 v.reset(OpPPC64CMPW)
4899 // match: (CMPW x (MOVDconst [c]))
4901 // result: (CMPWconst x [c])
4905 if v_1.Op != OpPPC64MOVDconst {
4912 v.reset(OpPPC64CMPWconst)
4917 // match: (CMPW (MOVDconst [c]) y)
4919 // result: (InvertFlags (CMPWconst y [c]))
4922 if v_0.Op != OpPPC64MOVDconst {
4930 v.reset(OpPPC64InvertFlags)
4931 v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, TypeFlags)
4939 func rewriteValuePPC64_OpPPC64CMPWU(v *Value, config *Config) bool {
4942 // match: (CMPWU x (MOVWZreg y))
4944 // result: (CMPWU x y)
4948 if v_1.Op != OpPPC64MOVWZreg {
4952 v.reset(OpPPC64CMPWU)
4957 // match: (CMPWU (MOVWZreg x) y)
4959 // result: (CMPWU x y)
4962 if v_0.Op != OpPPC64MOVWZreg {
4967 v.reset(OpPPC64CMPWU)
4972 // match: (CMPWU x (MOVDconst [c]))
4973 // cond: isU16Bit(c)
4974 // result: (CMPWUconst x [c])
4978 if v_1.Op != OpPPC64MOVDconst {
4985 v.reset(OpPPC64CMPWUconst)
4990 // match: (CMPWU (MOVDconst [c]) y)
4991 // cond: isU16Bit(c)
4992 // result: (InvertFlags (CMPWUconst y [c]))
4995 if v_0.Op != OpPPC64MOVDconst {
5003 v.reset(OpPPC64InvertFlags)
5004 v0 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, TypeFlags)
5012 func rewriteValuePPC64_OpPPC64CMPWUconst(v *Value, config *Config) bool {
5015 // match: (CMPWUconst (MOVDconst [x]) [y])
5016 // cond: int32(x)==int32(y)
5021 if v_0.Op != OpPPC64MOVDconst {
5025 if !(int32(x) == int32(y)) {
5028 v.reset(OpPPC64FlagEQ)
5031 // match: (CMPWUconst (MOVDconst [x]) [y])
5032 // cond: uint32(x)<uint32(y)
5037 if v_0.Op != OpPPC64MOVDconst {
5041 if !(uint32(x) < uint32(y)) {
5044 v.reset(OpPPC64FlagLT)
5047 // match: (CMPWUconst (MOVDconst [x]) [y])
5048 // cond: uint32(x)>uint32(y)
5053 if v_0.Op != OpPPC64MOVDconst {
5057 if !(uint32(x) > uint32(y)) {
5060 v.reset(OpPPC64FlagGT)
5065 func rewriteValuePPC64_OpPPC64CMPWconst(v *Value, config *Config) bool {
5068 // match: (CMPWconst (MOVDconst [x]) [y])
5069 // cond: int32(x)==int32(y)
5074 if v_0.Op != OpPPC64MOVDconst {
5078 if !(int32(x) == int32(y)) {
5081 v.reset(OpPPC64FlagEQ)
5084 // match: (CMPWconst (MOVDconst [x]) [y])
5085 // cond: int32(x)<int32(y)
5090 if v_0.Op != OpPPC64MOVDconst {
5094 if !(int32(x) < int32(y)) {
5097 v.reset(OpPPC64FlagLT)
5100 // match: (CMPWconst (MOVDconst [x]) [y])
5101 // cond: int32(x)>int32(y)
5106 if v_0.Op != OpPPC64MOVDconst {
5110 if !(int32(x) > int32(y)) {
5113 v.reset(OpPPC64FlagGT)
5118 func rewriteValuePPC64_OpPPC64CMPconst(v *Value, config *Config) bool {
5121 // match: (CMPconst (MOVDconst [x]) [y])
5122 // cond: int64(x)==int64(y)
5127 if v_0.Op != OpPPC64MOVDconst {
5131 if !(int64(x) == int64(y)) {
5134 v.reset(OpPPC64FlagEQ)
5137 // match: (CMPconst (MOVDconst [x]) [y])
5138 // cond: int64(x)<int64(y)
5143 if v_0.Op != OpPPC64MOVDconst {
5147 if !(int64(x) < int64(y)) {
5150 v.reset(OpPPC64FlagLT)
5153 // match: (CMPconst (MOVDconst [x]) [y])
5154 // cond: int64(x)>int64(y)
5159 if v_0.Op != OpPPC64MOVDconst {
5163 if !(int64(x) > int64(y)) {
5166 v.reset(OpPPC64FlagGT)
5171 func rewriteValuePPC64_OpPPC64Equal(v *Value, config *Config) bool {
5174 // match: (Equal (FlagEQ))
5176 // result: (MOVDconst [1])
5179 if v_0.Op != OpPPC64FlagEQ {
5182 v.reset(OpPPC64MOVDconst)
5186 // match: (Equal (FlagLT))
5188 // result: (MOVDconst [0])
5191 if v_0.Op != OpPPC64FlagLT {
5194 v.reset(OpPPC64MOVDconst)
5198 // match: (Equal (FlagGT))
5200 // result: (MOVDconst [0])
5203 if v_0.Op != OpPPC64FlagGT {
5206 v.reset(OpPPC64MOVDconst)
5210 // match: (Equal (InvertFlags x))
5212 // result: (Equal x)
5215 if v_0.Op != OpPPC64InvertFlags {
5219 v.reset(OpPPC64Equal)
5225 func rewriteValuePPC64_OpPPC64FMOVDload(v *Value, config *Config) bool {
5228 // match: (FMOVDload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
5229 // cond: canMergeSym(sym1,sym2)
5230 // result: (FMOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
5235 if v_0.Op != OpPPC64MOVDaddr {
5242 if !(canMergeSym(sym1, sym2)) {
5245 v.reset(OpPPC64FMOVDload)
5246 v.AuxInt = off1 + off2
5247 v.Aux = mergeSym(sym1, sym2)
5252 // match: (FMOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
5253 // cond: is16Bit(off1+off2)
5254 // result: (FMOVDload [off1+off2] {sym} ptr mem)
5259 if v_0.Op != OpPPC64ADDconst {
5265 if !(is16Bit(off1 + off2)) {
5268 v.reset(OpPPC64FMOVDload)
5269 v.AuxInt = off1 + off2
5277 func rewriteValuePPC64_OpPPC64FMOVDstore(v *Value, config *Config) bool {
5280 // match: (FMOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
5281 // cond: is16Bit(off1+off2)
5282 // result: (FMOVDstore [off1+off2] {sym} ptr val mem)
5287 if v_0.Op != OpPPC64ADDconst {
5294 if !(is16Bit(off1 + off2)) {
5297 v.reset(OpPPC64FMOVDstore)
5298 v.AuxInt = off1 + off2
5305 // match: (FMOVDstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
5306 // cond: canMergeSym(sym1,sym2)
5307 // result: (FMOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
5312 if v_0.Op != OpPPC64MOVDaddr {
5320 if !(canMergeSym(sym1, sym2)) {
5323 v.reset(OpPPC64FMOVDstore)
5324 v.AuxInt = off1 + off2
5325 v.Aux = mergeSym(sym1, sym2)
5333 func rewriteValuePPC64_OpPPC64FMOVSload(v *Value, config *Config) bool {
5336 // match: (FMOVSload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
5337 // cond: canMergeSym(sym1,sym2)
5338 // result: (FMOVSload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
5343 if v_0.Op != OpPPC64MOVDaddr {
5350 if !(canMergeSym(sym1, sym2)) {
5353 v.reset(OpPPC64FMOVSload)
5354 v.AuxInt = off1 + off2
5355 v.Aux = mergeSym(sym1, sym2)
5360 // match: (FMOVSload [off1] {sym} (ADDconst [off2] ptr) mem)
5361 // cond: is16Bit(off1+off2)
5362 // result: (FMOVSload [off1+off2] {sym} ptr mem)
5367 if v_0.Op != OpPPC64ADDconst {
5373 if !(is16Bit(off1 + off2)) {
5376 v.reset(OpPPC64FMOVSload)
5377 v.AuxInt = off1 + off2
5385 func rewriteValuePPC64_OpPPC64FMOVSstore(v *Value, config *Config) bool {
5388 // match: (FMOVSstore [off1] {sym} (ADDconst [off2] ptr) val mem)
5389 // cond: is16Bit(off1+off2)
5390 // result: (FMOVSstore [off1+off2] {sym} ptr val mem)
5395 if v_0.Op != OpPPC64ADDconst {
5402 if !(is16Bit(off1 + off2)) {
5405 v.reset(OpPPC64FMOVSstore)
5406 v.AuxInt = off1 + off2
5413 // match: (FMOVSstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
5414 // cond: canMergeSym(sym1,sym2)
5415 // result: (FMOVSstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
5420 if v_0.Op != OpPPC64MOVDaddr {
5428 if !(canMergeSym(sym1, sym2)) {
5431 v.reset(OpPPC64FMOVSstore)
5432 v.AuxInt = off1 + off2
5433 v.Aux = mergeSym(sym1, sym2)
5441 func rewriteValuePPC64_OpPPC64GreaterEqual(v *Value, config *Config) bool {
5444 // match: (GreaterEqual (FlagEQ))
5446 // result: (MOVDconst [1])
5449 if v_0.Op != OpPPC64FlagEQ {
5452 v.reset(OpPPC64MOVDconst)
5456 // match: (GreaterEqual (FlagLT))
5458 // result: (MOVDconst [0])
5461 if v_0.Op != OpPPC64FlagLT {
5464 v.reset(OpPPC64MOVDconst)
5468 // match: (GreaterEqual (FlagGT))
5470 // result: (MOVDconst [1])
5473 if v_0.Op != OpPPC64FlagGT {
5476 v.reset(OpPPC64MOVDconst)
5480 // match: (GreaterEqual (InvertFlags x))
5482 // result: (LessEqual x)
5485 if v_0.Op != OpPPC64InvertFlags {
5489 v.reset(OpPPC64LessEqual)
5495 func rewriteValuePPC64_OpPPC64GreaterThan(v *Value, config *Config) bool {
5498 // match: (GreaterThan (FlagEQ))
5500 // result: (MOVDconst [0])
5503 if v_0.Op != OpPPC64FlagEQ {
5506 v.reset(OpPPC64MOVDconst)
5510 // match: (GreaterThan (FlagLT))
5512 // result: (MOVDconst [0])
5515 if v_0.Op != OpPPC64FlagLT {
5518 v.reset(OpPPC64MOVDconst)
5522 // match: (GreaterThan (FlagGT))
5524 // result: (MOVDconst [1])
5527 if v_0.Op != OpPPC64FlagGT {
5530 v.reset(OpPPC64MOVDconst)
5534 // match: (GreaterThan (InvertFlags x))
5536 // result: (LessThan x)
5539 if v_0.Op != OpPPC64InvertFlags {
5543 v.reset(OpPPC64LessThan)
5549 func rewriteValuePPC64_OpPPC64LessEqual(v *Value, config *Config) bool {
5552 // match: (LessEqual (FlagEQ))
5554 // result: (MOVDconst [1])
5557 if v_0.Op != OpPPC64FlagEQ {
5560 v.reset(OpPPC64MOVDconst)
5564 // match: (LessEqual (FlagLT))
5566 // result: (MOVDconst [1])
5569 if v_0.Op != OpPPC64FlagLT {
5572 v.reset(OpPPC64MOVDconst)
5576 // match: (LessEqual (FlagGT))
5578 // result: (MOVDconst [0])
5581 if v_0.Op != OpPPC64FlagGT {
5584 v.reset(OpPPC64MOVDconst)
5588 // match: (LessEqual (InvertFlags x))
5590 // result: (GreaterEqual x)
5593 if v_0.Op != OpPPC64InvertFlags {
5597 v.reset(OpPPC64GreaterEqual)
5603 func rewriteValuePPC64_OpPPC64LessThan(v *Value, config *Config) bool {
5606 // match: (LessThan (FlagEQ))
5608 // result: (MOVDconst [0])
5611 if v_0.Op != OpPPC64FlagEQ {
5614 v.reset(OpPPC64MOVDconst)
5618 // match: (LessThan (FlagLT))
5620 // result: (MOVDconst [1])
5623 if v_0.Op != OpPPC64FlagLT {
5626 v.reset(OpPPC64MOVDconst)
5630 // match: (LessThan (FlagGT))
5632 // result: (MOVDconst [0])
5635 if v_0.Op != OpPPC64FlagGT {
5638 v.reset(OpPPC64MOVDconst)
5642 // match: (LessThan (InvertFlags x))
5644 // result: (GreaterThan x)
5647 if v_0.Op != OpPPC64InvertFlags {
5651 v.reset(OpPPC64GreaterThan)
5657 func rewriteValuePPC64_OpPPC64MOVBZload(v *Value, config *Config) bool {
5660 // match: (MOVBZload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
5661 // cond: canMergeSym(sym1,sym2)
5662 // result: (MOVBZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
5667 if v_0.Op != OpPPC64MOVDaddr {
5674 if !(canMergeSym(sym1, sym2)) {
5677 v.reset(OpPPC64MOVBZload)
5678 v.AuxInt = off1 + off2
5679 v.Aux = mergeSym(sym1, sym2)
5684 // match: (MOVBZload [off1] {sym} (ADDconst [off2] x) mem)
5685 // cond: is16Bit(off1+off2)
5686 // result: (MOVBZload [off1+off2] {sym} x mem)
5691 if v_0.Op != OpPPC64ADDconst {
5697 if !(is16Bit(off1 + off2)) {
5700 v.reset(OpPPC64MOVBZload)
5701 v.AuxInt = off1 + off2
5709 func rewriteValuePPC64_OpPPC64MOVBZreg(v *Value, config *Config) bool {
5712 // match: (MOVBZreg y:(ANDconst [c] _))
5713 // cond: uint64(c) <= 0xFF
5717 if y.Op != OpPPC64ANDconst {
5721 if !(uint64(c) <= 0xFF) {
5729 // match: (MOVBZreg y:(MOVBZreg _))
5734 if y.Op != OpPPC64MOVBZreg {
5742 // match: (MOVBZreg (MOVBreg x))
5744 // result: (MOVBZreg x)
5747 if v_0.Op != OpPPC64MOVBreg {
5751 v.reset(OpPPC64MOVBZreg)
5755 // match: (MOVBZreg x:(MOVBZload _ _))
5760 if x.Op != OpPPC64MOVBZload {
5768 // match: (MOVBZreg (MOVDconst [c]))
5770 // result: (MOVDconst [int64(uint8(c))])
5773 if v_0.Op != OpPPC64MOVDconst {
5777 v.reset(OpPPC64MOVDconst)
5778 v.AuxInt = int64(uint8(c))
5783 func rewriteValuePPC64_OpPPC64MOVBreg(v *Value, config *Config) bool {
5786 // match: (MOVBreg y:(ANDconst [c] _))
5787 // cond: uint64(c) <= 0x7F
5791 if y.Op != OpPPC64ANDconst {
5795 if !(uint64(c) <= 0x7F) {
5803 // match: (MOVBreg y:(MOVBreg _))
5808 if y.Op != OpPPC64MOVBreg {
5816 // match: (MOVBreg (MOVBZreg x))
5818 // result: (MOVBreg x)
5821 if v_0.Op != OpPPC64MOVBZreg {
5825 v.reset(OpPPC64MOVBreg)
5829 // match: (MOVBreg (MOVDconst [c]))
5831 // result: (MOVDconst [int64(int8(c))])
5834 if v_0.Op != OpPPC64MOVDconst {
5838 v.reset(OpPPC64MOVDconst)
5839 v.AuxInt = int64(int8(c))
5844 func rewriteValuePPC64_OpPPC64MOVBstore(v *Value, config *Config) bool {
5847 // match: (MOVBstore [off1] {sym} (ADDconst [off2] x) val mem)
5848 // cond: is16Bit(off1+off2)
5849 // result: (MOVBstore [off1+off2] {sym} x val mem)
5854 if v_0.Op != OpPPC64ADDconst {
5861 if !(is16Bit(off1 + off2)) {
5864 v.reset(OpPPC64MOVBstore)
5865 v.AuxInt = off1 + off2
5872 // match: (MOVBstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
5873 // cond: canMergeSym(sym1,sym2)
5874 // result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
5879 if v_0.Op != OpPPC64MOVDaddr {
5887 if !(canMergeSym(sym1, sym2)) {
5890 v.reset(OpPPC64MOVBstore)
5891 v.AuxInt = off1 + off2
5892 v.Aux = mergeSym(sym1, sym2)
5898 // match: (MOVBstore [off] {sym} ptr (MOVDconst [c]) mem)
5900 // result: (MOVBstorezero [off] {sym} ptr mem)
5906 if v_1.Op != OpPPC64MOVDconst {
5914 v.reset(OpPPC64MOVBstorezero)
5921 // match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
5923 // result: (MOVBstore [off] {sym} ptr x mem)
5929 if v_1.Op != OpPPC64MOVBreg {
5934 v.reset(OpPPC64MOVBstore)
5942 // match: (MOVBstore [off] {sym} ptr (MOVBZreg x) mem)
5944 // result: (MOVBstore [off] {sym} ptr x mem)
5950 if v_1.Op != OpPPC64MOVBZreg {
5955 v.reset(OpPPC64MOVBstore)
5965 func rewriteValuePPC64_OpPPC64MOVBstorezero(v *Value, config *Config) bool {
5968 // match: (MOVBstorezero [off1] {sym} (ADDconst [off2] x) mem)
5969 // cond: is16Bit(off1+off2)
5970 // result: (MOVBstorezero [off1+off2] {sym} x mem)
5975 if v_0.Op != OpPPC64ADDconst {
5981 if !(is16Bit(off1 + off2)) {
5984 v.reset(OpPPC64MOVBstorezero)
5985 v.AuxInt = off1 + off2
5991 // match: (MOVBstorezero [off1] {sym1} (MOVDaddr [off2] {sym2} x) mem)
5992 // cond: canMergeSym(sym1,sym2)
5993 // result: (MOVBstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
5998 if v_0.Op != OpPPC64MOVDaddr {
6005 if !(canMergeSym(sym1, sym2)) {
6008 v.reset(OpPPC64MOVBstorezero)
6009 v.AuxInt = off1 + off2
6010 v.Aux = mergeSym(sym1, sym2)
6017 func rewriteValuePPC64_OpPPC64MOVDload(v *Value, config *Config) bool {
6020 // match: (MOVDload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
6021 // cond: canMergeSym(sym1,sym2)
6022 // result: (MOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
6027 if v_0.Op != OpPPC64MOVDaddr {
6034 if !(canMergeSym(sym1, sym2)) {
6037 v.reset(OpPPC64MOVDload)
6038 v.AuxInt = off1 + off2
6039 v.Aux = mergeSym(sym1, sym2)
6044 // match: (MOVDload [off1] {sym} (ADDconst [off2] x) mem)
6045 // cond: is16Bit(off1+off2)
6046 // result: (MOVDload [off1+off2] {sym} x mem)
6051 if v_0.Op != OpPPC64ADDconst {
6057 if !(is16Bit(off1 + off2)) {
6060 v.reset(OpPPC64MOVDload)
6061 v.AuxInt = off1 + off2
6069 func rewriteValuePPC64_OpPPC64MOVDstore(v *Value, config *Config) bool {
6072 // match: (MOVDstore [off1] {sym} (ADDconst [off2] x) val mem)
6073 // cond: is16Bit(off1+off2)
6074 // result: (MOVDstore [off1+off2] {sym} x val mem)
6079 if v_0.Op != OpPPC64ADDconst {
6086 if !(is16Bit(off1 + off2)) {
6089 v.reset(OpPPC64MOVDstore)
6090 v.AuxInt = off1 + off2
6097 // match: (MOVDstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
6098 // cond: canMergeSym(sym1,sym2)
6099 // result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
6104 if v_0.Op != OpPPC64MOVDaddr {
6112 if !(canMergeSym(sym1, sym2)) {
6115 v.reset(OpPPC64MOVDstore)
6116 v.AuxInt = off1 + off2
6117 v.Aux = mergeSym(sym1, sym2)
6123 // match: (MOVDstore [off] {sym} ptr (MOVDconst [c]) mem)
6125 // result: (MOVDstorezero [off] {sym} ptr mem)
6131 if v_1.Op != OpPPC64MOVDconst {
6139 v.reset(OpPPC64MOVDstorezero)
6148 func rewriteValuePPC64_OpPPC64MOVDstorezero(v *Value, config *Config) bool {
6151 // match: (MOVDstorezero [off1] {sym} (ADDconst [off2] x) mem)
6152 // cond: is16Bit(off1+off2)
6153 // result: (MOVDstorezero [off1+off2] {sym} x mem)
6158 if v_0.Op != OpPPC64ADDconst {
6164 if !(is16Bit(off1 + off2)) {
6167 v.reset(OpPPC64MOVDstorezero)
6168 v.AuxInt = off1 + off2
6174 // match: (MOVDstorezero [off1] {sym1} (MOVDaddr [off2] {sym2} x) mem)
6175 // cond: canMergeSym(sym1,sym2)
6176 // result: (MOVDstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
6181 if v_0.Op != OpPPC64MOVDaddr {
6188 if !(canMergeSym(sym1, sym2)) {
6191 v.reset(OpPPC64MOVDstorezero)
6192 v.AuxInt = off1 + off2
6193 v.Aux = mergeSym(sym1, sym2)
6200 func rewriteValuePPC64_OpPPC64MOVHZload(v *Value, config *Config) bool {
6203 // match: (MOVHZload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
6204 // cond: canMergeSym(sym1,sym2)
6205 // result: (MOVHZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
6210 if v_0.Op != OpPPC64MOVDaddr {
6217 if !(canMergeSym(sym1, sym2)) {
6220 v.reset(OpPPC64MOVHZload)
6221 v.AuxInt = off1 + off2
6222 v.Aux = mergeSym(sym1, sym2)
6227 // match: (MOVHZload [off1] {sym} (ADDconst [off2] x) mem)
6228 // cond: is16Bit(off1+off2)
6229 // result: (MOVHZload [off1+off2] {sym} x mem)
6234 if v_0.Op != OpPPC64ADDconst {
6240 if !(is16Bit(off1 + off2)) {
6243 v.reset(OpPPC64MOVHZload)
6244 v.AuxInt = off1 + off2
6252 func rewriteValuePPC64_OpPPC64MOVHZreg(v *Value, config *Config) bool {
6255 // match: (MOVHZreg y:(ANDconst [c] _))
6256 // cond: uint64(c) <= 0xFFFF
6260 if y.Op != OpPPC64ANDconst {
6264 if !(uint64(c) <= 0xFFFF) {
6272 // match: (MOVHZreg y:(MOVHZreg _))
6277 if y.Op != OpPPC64MOVHZreg {
6285 // match: (MOVHZreg y:(MOVBZreg _))
6290 if y.Op != OpPPC64MOVBZreg {
6298 // match: (MOVHZreg y:(MOVHreg x))
6300 // result: (MOVHZreg x)
6303 if y.Op != OpPPC64MOVHreg {
6307 v.reset(OpPPC64MOVHZreg)
6311 // match: (MOVHZreg x:(MOVHZload _ _))
6316 if x.Op != OpPPC64MOVHZload {
6324 // match: (MOVHZreg (MOVDconst [c]))
6326 // result: (MOVDconst [int64(uint16(c))])
6329 if v_0.Op != OpPPC64MOVDconst {
6333 v.reset(OpPPC64MOVDconst)
6334 v.AuxInt = int64(uint16(c))
6339 func rewriteValuePPC64_OpPPC64MOVHload(v *Value, config *Config) bool {
6342 // match: (MOVHload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
6343 // cond: canMergeSym(sym1,sym2)
6344 // result: (MOVHload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
6349 if v_0.Op != OpPPC64MOVDaddr {
6356 if !(canMergeSym(sym1, sym2)) {
6359 v.reset(OpPPC64MOVHload)
6360 v.AuxInt = off1 + off2
6361 v.Aux = mergeSym(sym1, sym2)
6366 // match: (MOVHload [off1] {sym} (ADDconst [off2] x) mem)
6367 // cond: is16Bit(off1+off2)
6368 // result: (MOVHload [off1+off2] {sym} x mem)
6373 if v_0.Op != OpPPC64ADDconst {
6379 if !(is16Bit(off1 + off2)) {
6382 v.reset(OpPPC64MOVHload)
6383 v.AuxInt = off1 + off2
6391 func rewriteValuePPC64_OpPPC64MOVHreg(v *Value, config *Config) bool {
6394 // match: (MOVHreg y:(ANDconst [c] _))
6395 // cond: uint64(c) <= 0x7FFF
6399 if y.Op != OpPPC64ANDconst {
6403 if !(uint64(c) <= 0x7FFF) {
6411 // match: (MOVHreg y:(MOVHreg _))
6416 if y.Op != OpPPC64MOVHreg {
6424 // match: (MOVHreg y:(MOVBreg _))
6429 if y.Op != OpPPC64MOVBreg {
6437 // match: (MOVHreg y:(MOVHZreg x))
6439 // result: (MOVHreg x)
6442 if y.Op != OpPPC64MOVHZreg {
6446 v.reset(OpPPC64MOVHreg)
6450 // match: (MOVHreg x:(MOVHload _ _))
6455 if x.Op != OpPPC64MOVHload {
6463 // match: (MOVHreg (MOVDconst [c]))
6465 // result: (MOVDconst [int64(int16(c))])
6468 if v_0.Op != OpPPC64MOVDconst {
6472 v.reset(OpPPC64MOVDconst)
6473 v.AuxInt = int64(int16(c))
6478 func rewriteValuePPC64_OpPPC64MOVHstore(v *Value, config *Config) bool {
6481 // match: (MOVHstore [off1] {sym} (ADDconst [off2] x) val mem)
6482 // cond: is16Bit(off1+off2)
6483 // result: (MOVHstore [off1+off2] {sym} x val mem)
6488 if v_0.Op != OpPPC64ADDconst {
6495 if !(is16Bit(off1 + off2)) {
6498 v.reset(OpPPC64MOVHstore)
6499 v.AuxInt = off1 + off2
6506 // match: (MOVHstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
6507 // cond: canMergeSym(sym1,sym2)
6508 // result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
6513 if v_0.Op != OpPPC64MOVDaddr {
6521 if !(canMergeSym(sym1, sym2)) {
6524 v.reset(OpPPC64MOVHstore)
6525 v.AuxInt = off1 + off2
6526 v.Aux = mergeSym(sym1, sym2)
6532 // match: (MOVHstore [off] {sym} ptr (MOVDconst [c]) mem)
6534 // result: (MOVHstorezero [off] {sym} ptr mem)
6540 if v_1.Op != OpPPC64MOVDconst {
6548 v.reset(OpPPC64MOVHstorezero)
6555 // match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
6557 // result: (MOVHstore [off] {sym} ptr x mem)
6563 if v_1.Op != OpPPC64MOVHreg {
6568 v.reset(OpPPC64MOVHstore)
6576 // match: (MOVHstore [off] {sym} ptr (MOVHZreg x) mem)
6578 // result: (MOVHstore [off] {sym} ptr x mem)
6584 if v_1.Op != OpPPC64MOVHZreg {
6589 v.reset(OpPPC64MOVHstore)
6599 func rewriteValuePPC64_OpPPC64MOVHstorezero(v *Value, config *Config) bool {
6602 // match: (MOVHstorezero [off1] {sym} (ADDconst [off2] x) mem)
6603 // cond: is16Bit(off1+off2)
6604 // result: (MOVHstorezero [off1+off2] {sym} x mem)
6609 if v_0.Op != OpPPC64ADDconst {
6615 if !(is16Bit(off1 + off2)) {
6618 v.reset(OpPPC64MOVHstorezero)
6619 v.AuxInt = off1 + off2
6625 // match: (MOVHstorezero [off1] {sym1} (MOVDaddr [off2] {sym2} x) mem)
6626 // cond: canMergeSym(sym1,sym2)
6627 // result: (MOVHstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
6632 if v_0.Op != OpPPC64MOVDaddr {
6639 if !(canMergeSym(sym1, sym2)) {
6642 v.reset(OpPPC64MOVHstorezero)
6643 v.AuxInt = off1 + off2
6644 v.Aux = mergeSym(sym1, sym2)
6651 func rewriteValuePPC64_OpPPC64MOVWZload(v *Value, config *Config) bool {
6654 // match: (MOVWZload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
6655 // cond: canMergeSym(sym1,sym2)
6656 // result: (MOVWZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
6661 if v_0.Op != OpPPC64MOVDaddr {
6668 if !(canMergeSym(sym1, sym2)) {
6671 v.reset(OpPPC64MOVWZload)
6672 v.AuxInt = off1 + off2
6673 v.Aux = mergeSym(sym1, sym2)
6678 // match: (MOVWZload [off1] {sym} (ADDconst [off2] x) mem)
6679 // cond: is16Bit(off1+off2)
6680 // result: (MOVWZload [off1+off2] {sym} x mem)
6685 if v_0.Op != OpPPC64ADDconst {
6691 if !(is16Bit(off1 + off2)) {
6694 v.reset(OpPPC64MOVWZload)
6695 v.AuxInt = off1 + off2
6703 func rewriteValuePPC64_OpPPC64MOVWZreg(v *Value, config *Config) bool {
6706 // match: (MOVWZreg y:(ANDconst [c] _))
6707 // cond: uint64(c) <= 0xFFFFFFFF
6711 if y.Op != OpPPC64ANDconst {
6715 if !(uint64(c) <= 0xFFFFFFFF) {
6723 // match: (MOVWZreg y:(AND (MOVDconst [c]) _))
6724 // cond: uint64(c) <= 0xFFFFFFFF
6728 if y.Op != OpPPC64AND {
6732 if y_0.Op != OpPPC64MOVDconst {
6736 if !(uint64(c) <= 0xFFFFFFFF) {
6744 // match: (MOVWZreg y:(MOVWZreg _))
6749 if y.Op != OpPPC64MOVWZreg {
6757 // match: (MOVWZreg y:(MOVHZreg _))
6762 if y.Op != OpPPC64MOVHZreg {
6770 // match: (MOVWZreg y:(MOVBZreg _))
6775 if y.Op != OpPPC64MOVBZreg {
6783 // match: (MOVWZreg y:(MOVWreg x))
6785 // result: (MOVWZreg x)
6788 if y.Op != OpPPC64MOVWreg {
6792 v.reset(OpPPC64MOVWZreg)
6798 func rewriteValuePPC64_OpPPC64MOVWload(v *Value, config *Config) bool {
6801 // match: (MOVWload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
6802 // cond: canMergeSym(sym1,sym2)
6803 // result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
6808 if v_0.Op != OpPPC64MOVDaddr {
6815 if !(canMergeSym(sym1, sym2)) {
6818 v.reset(OpPPC64MOVWload)
6819 v.AuxInt = off1 + off2
6820 v.Aux = mergeSym(sym1, sym2)
6825 // match: (MOVWload [off1] {sym} (ADDconst [off2] x) mem)
6826 // cond: is16Bit(off1+off2)
6827 // result: (MOVWload [off1+off2] {sym} x mem)
6832 if v_0.Op != OpPPC64ADDconst {
6838 if !(is16Bit(off1 + off2)) {
6841 v.reset(OpPPC64MOVWload)
6842 v.AuxInt = off1 + off2
6850 func rewriteValuePPC64_OpPPC64MOVWreg(v *Value, config *Config) bool {
6853 // match: (MOVWreg y:(ANDconst [c] _))
6854 // cond: uint64(c) <= 0xFFFF
6858 if y.Op != OpPPC64ANDconst {
6862 if !(uint64(c) <= 0xFFFF) {
6870 // match: (MOVWreg y:(AND (MOVDconst [c]) _))
6871 // cond: uint64(c) <= 0x7FFFFFFF
6875 if y.Op != OpPPC64AND {
6879 if y_0.Op != OpPPC64MOVDconst {
6883 if !(uint64(c) <= 0x7FFFFFFF) {
6891 // match: (MOVWreg y:(MOVWreg _))
6896 if y.Op != OpPPC64MOVWreg {
6904 // match: (MOVWreg y:(MOVHreg _))
6909 if y.Op != OpPPC64MOVHreg {
6917 // match: (MOVWreg y:(MOVBreg _))
6922 if y.Op != OpPPC64MOVBreg {
6930 // match: (MOVWreg y:(MOVWZreg x))
6932 // result: (MOVWreg x)
6935 if y.Op != OpPPC64MOVWZreg {
6939 v.reset(OpPPC64MOVWreg)
6945 func rewriteValuePPC64_OpPPC64MOVWstore(v *Value, config *Config) bool {
6948 // match: (MOVWstore [off1] {sym} (ADDconst [off2] x) val mem)
6949 // cond: is16Bit(off1+off2)
6950 // result: (MOVWstore [off1+off2] {sym} x val mem)
6955 if v_0.Op != OpPPC64ADDconst {
6962 if !(is16Bit(off1 + off2)) {
6965 v.reset(OpPPC64MOVWstore)
6966 v.AuxInt = off1 + off2
6973 // match: (MOVWstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
6974 // cond: canMergeSym(sym1,sym2)
6975 // result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
6980 if v_0.Op != OpPPC64MOVDaddr {
6988 if !(canMergeSym(sym1, sym2)) {
6991 v.reset(OpPPC64MOVWstore)
6992 v.AuxInt = off1 + off2
6993 v.Aux = mergeSym(sym1, sym2)
6999 // match: (MOVWstore [off] {sym} ptr (MOVDconst [c]) mem)
7001 // result: (MOVWstorezero [off] {sym} ptr mem)
7007 if v_1.Op != OpPPC64MOVDconst {
7015 v.reset(OpPPC64MOVWstorezero)
7022 // match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
7024 // result: (MOVWstore [off] {sym} ptr x mem)
7030 if v_1.Op != OpPPC64MOVWreg {
7035 v.reset(OpPPC64MOVWstore)
7043 // match: (MOVWstore [off] {sym} ptr (MOVWZreg x) mem)
7045 // result: (MOVWstore [off] {sym} ptr x mem)
7051 if v_1.Op != OpPPC64MOVWZreg {
7056 v.reset(OpPPC64MOVWstore)
7066 func rewriteValuePPC64_OpPPC64MOVWstorezero(v *Value, config *Config) bool {
7069 // match: (MOVWstorezero [off1] {sym} (ADDconst [off2] x) mem)
7070 // cond: is16Bit(off1+off2)
7071 // result: (MOVWstorezero [off1+off2] {sym} x mem)
7076 if v_0.Op != OpPPC64ADDconst {
7082 if !(is16Bit(off1 + off2)) {
7085 v.reset(OpPPC64MOVWstorezero)
7086 v.AuxInt = off1 + off2
7092 // match: (MOVWstorezero [off1] {sym1} (MOVDaddr [off2] {sym2} x) mem)
7093 // cond: canMergeSym(sym1,sym2)
7094 // result: (MOVWstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
7099 if v_0.Op != OpPPC64MOVDaddr {
7106 if !(canMergeSym(sym1, sym2)) {
7109 v.reset(OpPPC64MOVWstorezero)
7110 v.AuxInt = off1 + off2
7111 v.Aux = mergeSym(sym1, sym2)
7118 func rewriteValuePPC64_OpPPC64MaskIfNotCarry(v *Value, config *Config) bool {
7121 // match: (MaskIfNotCarry (ADDconstForCarry [c] (ANDconst [d] _)))
7122 // cond: c < 0 && d > 0 && c + d < 0
7123 // result: (MOVDconst [-1])
7126 if v_0.Op != OpPPC64ADDconstForCarry {
7130 v_0_0 := v_0.Args[0]
7131 if v_0_0.Op != OpPPC64ANDconst {
7135 if !(c < 0 && d > 0 && c+d < 0) {
7138 v.reset(OpPPC64MOVDconst)
7144 func rewriteValuePPC64_OpPPC64NotEqual(v *Value, config *Config) bool {
7147 // match: (NotEqual (FlagEQ))
7149 // result: (MOVDconst [0])
7152 if v_0.Op != OpPPC64FlagEQ {
7155 v.reset(OpPPC64MOVDconst)
7159 // match: (NotEqual (FlagLT))
7161 // result: (MOVDconst [1])
7164 if v_0.Op != OpPPC64FlagLT {
7167 v.reset(OpPPC64MOVDconst)
7171 // match: (NotEqual (FlagGT))
7173 // result: (MOVDconst [1])
7176 if v_0.Op != OpPPC64FlagGT {
7179 v.reset(OpPPC64MOVDconst)
7183 // match: (NotEqual (InvertFlags x))
7185 // result: (NotEqual x)
7188 if v_0.Op != OpPPC64InvertFlags {
7192 v.reset(OpPPC64NotEqual)
7198 func rewriteValuePPC64_OpPPC64OR(v *Value, config *Config) bool {
7201 // match: (OR (MOVDconst [c]) (MOVDconst [d]))
7203 // result: (MOVDconst [c|d])
7206 if v_0.Op != OpPPC64MOVDconst {
7211 if v_1.Op != OpPPC64MOVDconst {
7215 v.reset(OpPPC64MOVDconst)
7219 // match: (OR x (MOVDconst [c]))
7220 // cond: isU32Bit(c)
7221 // result: (ORconst [c] x)
7225 if v_1.Op != OpPPC64MOVDconst {
7232 v.reset(OpPPC64ORconst)
7237 // match: (OR (MOVDconst [c]) x)
7238 // cond: isU32Bit(c)
7239 // result: (ORconst [c] x)
7242 if v_0.Op != OpPPC64MOVDconst {
7250 v.reset(OpPPC64ORconst)
7257 func rewriteValuePPC64_OpPPC64ORN(v *Value, config *Config) bool {
7260 // match: (ORN x (MOVDconst [-1]))
7266 if v_1.Op != OpPPC64MOVDconst {
7269 if v_1.AuxInt != -1 {
7279 func rewriteValuePPC64_OpPPC64ORconst(v *Value, config *Config) bool {
7282 // match: (ORconst [c] (ORconst [d] x))
7284 // result: (ORconst [c|d] x)
7288 if v_0.Op != OpPPC64ORconst {
7293 v.reset(OpPPC64ORconst)
7298 // match: (ORconst [-1] _)
7300 // result: (MOVDconst [-1])
7305 v.reset(OpPPC64MOVDconst)
7309 // match: (ORconst [0] x)
7324 func rewriteValuePPC64_OpPPC64SUB(v *Value, config *Config) bool {
7327 // match: (SUB x (MOVDconst [c]))
7328 // cond: is32Bit(-c)
7329 // result: (ADDconst [-c] x)
7333 if v_1.Op != OpPPC64MOVDconst {
7340 v.reset(OpPPC64ADDconst)
7347 func rewriteValuePPC64_OpPPC64XOR(v *Value, config *Config) bool {
7350 // match: (XOR (MOVDconst [c]) (MOVDconst [d]))
7352 // result: (MOVDconst [c^d])
7355 if v_0.Op != OpPPC64MOVDconst {
7360 if v_1.Op != OpPPC64MOVDconst {
7364 v.reset(OpPPC64MOVDconst)
7368 // match: (XOR x (MOVDconst [c]))
7369 // cond: isU32Bit(c)
7370 // result: (XORconst [c] x)
7374 if v_1.Op != OpPPC64MOVDconst {
7381 v.reset(OpPPC64XORconst)
7386 // match: (XOR (MOVDconst [c]) x)
7387 // cond: isU32Bit(c)
7388 // result: (XORconst [c] x)
7391 if v_0.Op != OpPPC64MOVDconst {
7399 v.reset(OpPPC64XORconst)
7406 func rewriteValuePPC64_OpPPC64XORconst(v *Value, config *Config) bool {
7409 // match: (XORconst [c] (XORconst [d] x))
7411 // result: (XORconst [c^d] x)
7415 if v_0.Op != OpPPC64XORconst {
7420 v.reset(OpPPC64XORconst)
7425 // match: (XORconst [0] x)
7440 func rewriteValuePPC64_OpRsh16Ux16(v *Value, config *Config) bool {
7443 // match: (Rsh16Ux16 x y)
7445 // result: (SRW (ZeroExt16to32 x) (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-16] (ZeroExt16to64 y)))))
7450 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
7453 v1 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
7455 v2 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
7456 v3 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
7458 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
7467 func rewriteValuePPC64_OpRsh16Ux32(v *Value, config *Config) bool {
7470 // match: (Rsh16Ux32 x (Const64 [c]))
7471 // cond: uint32(c) < 16
7472 // result: (SRWconst (ZeroExt16to32 x) [c])
7476 if v_1.Op != OpConst64 {
7480 if !(uint32(c) < 16) {
7483 v.reset(OpPPC64SRWconst)
7485 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
7490 // match: (Rsh16Ux32 x (MOVDconst [c]))
7491 // cond: uint32(c) < 16
7492 // result: (SRWconst (ZeroExt16to32 x) [c])
7496 if v_1.Op != OpPPC64MOVDconst {
7500 if !(uint32(c) < 16) {
7503 v.reset(OpPPC64SRWconst)
7505 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
7510 // match: (Rsh16Ux32 x y)
7512 // result: (SRW (ZeroExt16to32 x) (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-16] (ZeroExt32to64 y)))))
7517 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
7520 v1 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
7522 v2 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
7523 v3 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
7525 v4 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
7534 func rewriteValuePPC64_OpRsh16Ux64(v *Value, config *Config) bool {
7537 // match: (Rsh16Ux64 x (Const64 [c]))
7538 // cond: uint64(c) < 16
7539 // result: (SRWconst (ZeroExt16to32 x) [c])
7543 if v_1.Op != OpConst64 {
7547 if !(uint64(c) < 16) {
7550 v.reset(OpPPC64SRWconst)
7552 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
7557 // match: (Rsh16Ux64 _ (Const64 [c]))
7558 // cond: uint64(c) >= 16
7559 // result: (MOVDconst [0])
7562 if v_1.Op != OpConst64 {
7566 if !(uint64(c) >= 16) {
7569 v.reset(OpPPC64MOVDconst)
7573 // match: (Rsh16Ux64 x (MOVDconst [c]))
7574 // cond: uint64(c) < 16
7575 // result: (SRWconst (ZeroExt16to32 x) [c])
7579 if v_1.Op != OpPPC64MOVDconst {
7583 if !(uint64(c) < 16) {
7586 v.reset(OpPPC64SRWconst)
7588 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
7593 // match: (Rsh16Ux64 x y)
7595 // result: (SRW (ZeroExt16to32 x) (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-16] y))))
7600 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
7603 v1 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
7605 v2 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
7606 v3 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
7615 func rewriteValuePPC64_OpRsh16Ux8(v *Value, config *Config) bool {
7618 // match: (Rsh16Ux8 x y)
7620 // result: (SRW (ZeroExt16to32 x) (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-16] (ZeroExt8to64 y)))))
7625 v0 := b.NewValue0(v.Pos, OpZeroExt16to32, config.fe.TypeUInt32())
7628 v1 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
7630 v2 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
7631 v3 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
7633 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
7642 func rewriteValuePPC64_OpRsh16x16(v *Value, config *Config) bool {
7645 // match: (Rsh16x16 x y)
7647 // result: (SRAW (SignExt16to32 x) (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-16] (ZeroExt16to64 y)))))
7651 v.reset(OpPPC64SRAW)
7652 v0 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
7655 v1 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
7657 v2 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
7658 v3 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
7660 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
7669 func rewriteValuePPC64_OpRsh16x32(v *Value, config *Config) bool {
7672 // match: (Rsh16x32 x (Const64 [c]))
7673 // cond: uint32(c) < 16
7674 // result: (SRAWconst (SignExt16to32 x) [c])
7678 if v_1.Op != OpConst64 {
7682 if !(uint32(c) < 16) {
7685 v.reset(OpPPC64SRAWconst)
7687 v0 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
7692 // match: (Rsh16x32 x (MOVDconst [c]))
7693 // cond: uint32(c) < 16
7694 // result: (SRAWconst (SignExt16to32 x) [c])
7698 if v_1.Op != OpPPC64MOVDconst {
7702 if !(uint32(c) < 16) {
7705 v.reset(OpPPC64SRAWconst)
7707 v0 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
7712 // match: (Rsh16x32 x y)
7714 // result: (SRAW (SignExt16to32 x) (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-16] (ZeroExt32to64 y)))))
7718 v.reset(OpPPC64SRAW)
7719 v0 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
7722 v1 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
7724 v2 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
7725 v3 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
7727 v4 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
7736 func rewriteValuePPC64_OpRsh16x64(v *Value, config *Config) bool {
7739 // match: (Rsh16x64 x (Const64 [c]))
7740 // cond: uint64(c) < 16
7741 // result: (SRAWconst (SignExt16to32 x) [c])
7745 if v_1.Op != OpConst64 {
7749 if !(uint64(c) < 16) {
7752 v.reset(OpPPC64SRAWconst)
7754 v0 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
7759 // match: (Rsh16x64 x (Const64 [c]))
7760 // cond: uint64(c) >= 16
7761 // result: (SRAWconst (SignExt16to32 x) [63])
7765 if v_1.Op != OpConst64 {
7769 if !(uint64(c) >= 16) {
7772 v.reset(OpPPC64SRAWconst)
7774 v0 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
7779 // match: (Rsh16x64 x (MOVDconst [c]))
7780 // cond: uint64(c) < 16
7781 // result: (SRAWconst (SignExt16to32 x) [c])
7785 if v_1.Op != OpPPC64MOVDconst {
7789 if !(uint64(c) < 16) {
7792 v.reset(OpPPC64SRAWconst)
7794 v0 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
7799 // match: (Rsh16x64 x y)
7801 // result: (SRAW (SignExt16to32 x) (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-16] y))))
7805 v.reset(OpPPC64SRAW)
7806 v0 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
7809 v1 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
7811 v2 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
7812 v3 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
7821 func rewriteValuePPC64_OpRsh16x8(v *Value, config *Config) bool {
7824 // match: (Rsh16x8 x y)
7826 // result: (SRAW (SignExt16to32 x) (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-16] (ZeroExt8to64 y)))))
7830 v.reset(OpPPC64SRAW)
7831 v0 := b.NewValue0(v.Pos, OpSignExt16to32, config.fe.TypeInt32())
7834 v1 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
7836 v2 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
7837 v3 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
7839 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
7848 func rewriteValuePPC64_OpRsh32Ux16(v *Value, config *Config) bool {
7851 // match: (Rsh32Ux16 x y)
7853 // result: (SRW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-32] (ZeroExt16to64 y)))))
7859 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
7861 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
7862 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
7864 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
7873 func rewriteValuePPC64_OpRsh32Ux32(v *Value, config *Config) bool {
7876 // match: (Rsh32Ux32 x (Const64 [c]))
7877 // cond: uint32(c) < 32
7878 // result: (SRWconst x [c])
7882 if v_1.Op != OpConst64 {
7886 if !(uint32(c) < 32) {
7889 v.reset(OpPPC64SRWconst)
7894 // match: (Rsh32Ux32 x (MOVDconst [c]))
7895 // cond: uint32(c) < 32
7896 // result: (SRWconst x [c])
7900 if v_1.Op != OpPPC64MOVDconst {
7904 if !(uint32(c) < 32) {
7907 v.reset(OpPPC64SRWconst)
7912 // match: (Rsh32Ux32 x y)
7914 // result: (SRW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-32] (ZeroExt32to64 y)))))
7920 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
7922 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
7923 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
7925 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
7934 func rewriteValuePPC64_OpRsh32Ux64(v *Value, config *Config) bool {
7937 // match: (Rsh32Ux64 x (Const64 [c]))
7938 // cond: uint64(c) < 32
7939 // result: (SRWconst x [c])
7943 if v_1.Op != OpConst64 {
7947 if !(uint64(c) < 32) {
7950 v.reset(OpPPC64SRWconst)
7955 // match: (Rsh32Ux64 _ (Const64 [c]))
7956 // cond: uint64(c) >= 32
7957 // result: (MOVDconst [0])
7960 if v_1.Op != OpConst64 {
7964 if !(uint64(c) >= 32) {
7967 v.reset(OpPPC64MOVDconst)
7971 // match: (Rsh32Ux64 x (MOVDconst [c]))
7972 // cond: uint64(c) < 32
7973 // result: (SRWconst x [c])
7977 if v_1.Op != OpPPC64MOVDconst {
7981 if !(uint64(c) < 32) {
7984 v.reset(OpPPC64SRWconst)
7989 // match: (Rsh32Ux64 x y)
7991 // result: (SRW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-32] y))))
7997 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
7999 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8000 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8009 func rewriteValuePPC64_OpRsh32Ux8(v *Value, config *Config) bool {
8012 // match: (Rsh32Ux8 x y)
8014 // result: (SRW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-32] (ZeroExt8to64 y)))))
8020 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8022 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8023 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8025 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
8034 func rewriteValuePPC64_OpRsh32x16(v *Value, config *Config) bool {
8037 // match: (Rsh32x16 x y)
8039 // result: (SRAW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-32] (ZeroExt16to64 y)))))
8043 v.reset(OpPPC64SRAW)
8045 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8047 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8048 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8050 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
8059 func rewriteValuePPC64_OpRsh32x32(v *Value, config *Config) bool {
8062 // match: (Rsh32x32 x (Const64 [c]))
8063 // cond: uint32(c) < 32
8064 // result: (SRAWconst x [c])
8068 if v_1.Op != OpConst64 {
8072 if !(uint32(c) < 32) {
8075 v.reset(OpPPC64SRAWconst)
8080 // match: (Rsh32x32 x (MOVDconst [c]))
8081 // cond: uint32(c) < 32
8082 // result: (SRAWconst x [c])
8086 if v_1.Op != OpPPC64MOVDconst {
8090 if !(uint32(c) < 32) {
8093 v.reset(OpPPC64SRAWconst)
8098 // match: (Rsh32x32 x y)
8100 // result: (SRAW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-32] (ZeroExt32to64 y)))))
8104 v.reset(OpPPC64SRAW)
8106 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8108 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8109 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8111 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
8120 func rewriteValuePPC64_OpRsh32x64(v *Value, config *Config) bool {
8123 // match: (Rsh32x64 x (Const64 [c]))
8124 // cond: uint64(c) < 32
8125 // result: (SRAWconst x [c])
8129 if v_1.Op != OpConst64 {
8133 if !(uint64(c) < 32) {
8136 v.reset(OpPPC64SRAWconst)
8141 // match: (Rsh32x64 x (Const64 [c]))
8142 // cond: uint64(c) >= 32
8143 // result: (SRAWconst x [63])
8147 if v_1.Op != OpConst64 {
8151 if !(uint64(c) >= 32) {
8154 v.reset(OpPPC64SRAWconst)
8159 // match: (Rsh32x64 x (MOVDconst [c]))
8160 // cond: uint64(c) < 32
8161 // result: (SRAWconst x [c])
8165 if v_1.Op != OpPPC64MOVDconst {
8169 if !(uint64(c) < 32) {
8172 v.reset(OpPPC64SRAWconst)
8177 // match: (Rsh32x64 x y)
8179 // result: (SRAW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-32] y))))
8183 v.reset(OpPPC64SRAW)
8185 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8187 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8188 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8197 func rewriteValuePPC64_OpRsh32x8(v *Value, config *Config) bool {
8200 // match: (Rsh32x8 x y)
8202 // result: (SRAW x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-32] (ZeroExt8to64 y)))))
8206 v.reset(OpPPC64SRAW)
8208 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8210 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8211 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8213 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
8222 func rewriteValuePPC64_OpRsh64Ux16(v *Value, config *Config) bool {
8225 // match: (Rsh64Ux16 x y)
8227 // result: (SRD x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-64] (ZeroExt16to64 y)))))
8233 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8235 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8236 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8238 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
8247 func rewriteValuePPC64_OpRsh64Ux32(v *Value, config *Config) bool {
8250 // match: (Rsh64Ux32 x (Const64 [c]))
8251 // cond: uint32(c) < 64
8252 // result: (SRDconst x [c])
8256 if v_1.Op != OpConst64 {
8260 if !(uint32(c) < 64) {
8263 v.reset(OpPPC64SRDconst)
8268 // match: (Rsh64Ux32 x (MOVDconst [c]))
8269 // cond: uint32(c) < 64
8270 // result: (SRDconst x [c])
8274 if v_1.Op != OpPPC64MOVDconst {
8278 if !(uint32(c) < 64) {
8281 v.reset(OpPPC64SRDconst)
8286 // match: (Rsh64Ux32 x y)
8288 // result: (SRD x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-64] (ZeroExt32to64 y)))))
8294 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8296 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8297 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8299 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
8308 func rewriteValuePPC64_OpRsh64Ux64(v *Value, config *Config) bool {
8311 // match: (Rsh64Ux64 x (Const64 [c]))
8312 // cond: uint64(c) < 64
8313 // result: (SRDconst x [c])
8317 if v_1.Op != OpConst64 {
8321 if !(uint64(c) < 64) {
8324 v.reset(OpPPC64SRDconst)
8329 // match: (Rsh64Ux64 _ (Const64 [c]))
8330 // cond: uint64(c) >= 64
8331 // result: (MOVDconst [0])
8334 if v_1.Op != OpConst64 {
8338 if !(uint64(c) >= 64) {
8341 v.reset(OpPPC64MOVDconst)
8345 // match: (Rsh64Ux64 x (MOVDconst [c]))
8346 // cond: uint64(c) < 64
8347 // result: (SRDconst x [c])
8351 if v_1.Op != OpPPC64MOVDconst {
8355 if !(uint64(c) < 64) {
8358 v.reset(OpPPC64SRDconst)
8363 // match: (Rsh64Ux64 x y)
8365 // result: (SRD x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-64] y))))
8371 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8373 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8374 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8383 func rewriteValuePPC64_OpRsh64Ux8(v *Value, config *Config) bool {
8386 // match: (Rsh64Ux8 x y)
8388 // result: (SRD x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-64] (ZeroExt8to64 y)))))
8394 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8396 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8397 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8399 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
8408 func rewriteValuePPC64_OpRsh64x16(v *Value, config *Config) bool {
8411 // match: (Rsh64x16 x y)
8413 // result: (SRAD x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-64] (ZeroExt16to64 y)))))
8417 v.reset(OpPPC64SRAD)
8419 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8421 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8422 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8424 v3 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
8433 func rewriteValuePPC64_OpRsh64x32(v *Value, config *Config) bool {
8436 // match: (Rsh64x32 x (Const64 [c]))
8437 // cond: uint32(c) < 64
8438 // result: (SRADconst x [c])
8442 if v_1.Op != OpConst64 {
8446 if !(uint32(c) < 64) {
8449 v.reset(OpPPC64SRADconst)
8454 // match: (Rsh64x32 x (MOVDconst [c]))
8455 // cond: uint32(c) < 64
8456 // result: (SRADconst x [c])
8460 if v_1.Op != OpPPC64MOVDconst {
8464 if !(uint32(c) < 64) {
8467 v.reset(OpPPC64SRADconst)
8472 // match: (Rsh64x32 x y)
8474 // result: (SRAD x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-64] (ZeroExt32to64 y)))))
8478 v.reset(OpPPC64SRAD)
8480 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8482 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8483 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8485 v3 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
8494 func rewriteValuePPC64_OpRsh64x64(v *Value, config *Config) bool {
8497 // match: (Rsh64x64 x (Const64 [c]))
8498 // cond: uint64(c) < 64
8499 // result: (SRADconst x [c])
8503 if v_1.Op != OpConst64 {
8507 if !(uint64(c) < 64) {
8510 v.reset(OpPPC64SRADconst)
8515 // match: (Rsh64x64 x (Const64 [c]))
8516 // cond: uint64(c) >= 64
8517 // result: (SRADconst x [63])
8521 if v_1.Op != OpConst64 {
8525 if !(uint64(c) >= 64) {
8528 v.reset(OpPPC64SRADconst)
8533 // match: (Rsh64x64 x (MOVDconst [c]))
8534 // cond: uint64(c) < 64
8535 // result: (SRADconst x [c])
8539 if v_1.Op != OpPPC64MOVDconst {
8543 if !(uint64(c) < 64) {
8546 v.reset(OpPPC64SRADconst)
8551 // match: (Rsh64x64 x y)
8553 // result: (SRAD x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-64] y))))
8557 v.reset(OpPPC64SRAD)
8559 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8561 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8562 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8571 func rewriteValuePPC64_OpRsh64x8(v *Value, config *Config) bool {
8574 // match: (Rsh64x8 x y)
8576 // result: (SRAD x (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-64] (ZeroExt8to64 y)))))
8580 v.reset(OpPPC64SRAD)
8582 v0 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8584 v1 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8585 v2 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8587 v3 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
8596 func rewriteValuePPC64_OpRsh8Ux16(v *Value, config *Config) bool {
8599 // match: (Rsh8Ux16 x y)
8601 // result: (SRW (ZeroExt8to32 x) (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-8] (ZeroExt16to64 y)))))
8606 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
8609 v1 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8611 v2 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8612 v3 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8614 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
8623 func rewriteValuePPC64_OpRsh8Ux32(v *Value, config *Config) bool {
8626 // match: (Rsh8Ux32 x (Const64 [c]))
8627 // cond: uint32(c) < 8
8628 // result: (SRWconst (ZeroExt8to32 x) [c])
8632 if v_1.Op != OpConst64 {
8636 if !(uint32(c) < 8) {
8639 v.reset(OpPPC64SRWconst)
8641 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
8646 // match: (Rsh8Ux32 x (MOVDconst [c]))
8647 // cond: uint32(c) < 8
8648 // result: (SRWconst (ZeroExt8to32 x) [c])
8652 if v_1.Op != OpPPC64MOVDconst {
8656 if !(uint32(c) < 8) {
8659 v.reset(OpPPC64SRWconst)
8661 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
8666 // match: (Rsh8Ux32 x y)
8668 // result: (SRW (ZeroExt8to32 x) (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-8] (ZeroExt32to64 y)))))
8673 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
8676 v1 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8678 v2 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8679 v3 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8681 v4 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
8690 func rewriteValuePPC64_OpRsh8Ux64(v *Value, config *Config) bool {
8693 // match: (Rsh8Ux64 x (Const64 [c]))
8694 // cond: uint64(c) < 8
8695 // result: (SRWconst (ZeroExt8to32 x) [c])
8699 if v_1.Op != OpConst64 {
8703 if !(uint64(c) < 8) {
8706 v.reset(OpPPC64SRWconst)
8708 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
8713 // match: (Rsh8Ux64 _ (Const64 [c]))
8714 // cond: uint64(c) >= 8
8715 // result: (MOVDconst [0])
8718 if v_1.Op != OpConst64 {
8722 if !(uint64(c) >= 8) {
8725 v.reset(OpPPC64MOVDconst)
8729 // match: (Rsh8Ux64 x (MOVDconst [c]))
8730 // cond: uint64(c) < 8
8731 // result: (SRWconst (ZeroExt8to32 x) [c])
8735 if v_1.Op != OpPPC64MOVDconst {
8739 if !(uint64(c) < 8) {
8742 v.reset(OpPPC64SRWconst)
8744 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
8749 // match: (Rsh8Ux64 x y)
8751 // result: (SRW (ZeroExt8to32 x) (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-8] y))))
8756 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
8759 v1 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8761 v2 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8762 v3 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8771 func rewriteValuePPC64_OpRsh8Ux8(v *Value, config *Config) bool {
8774 // match: (Rsh8Ux8 x y)
8776 // result: (SRW (ZeroExt8to32 x) (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-8] (ZeroExt8to64 y)))))
8781 v0 := b.NewValue0(v.Pos, OpZeroExt8to32, config.fe.TypeUInt32())
8784 v1 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8786 v2 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8787 v3 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8789 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
8798 func rewriteValuePPC64_OpRsh8x16(v *Value, config *Config) bool {
8801 // match: (Rsh8x16 x y)
8803 // result: (SRAW (SignExt8to32 x) (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-8] (ZeroExt16to64 y)))))
8807 v.reset(OpPPC64SRAW)
8808 v0 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
8811 v1 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8813 v2 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8814 v3 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8816 v4 := b.NewValue0(v.Pos, OpZeroExt16to64, config.fe.TypeUInt64())
8825 func rewriteValuePPC64_OpRsh8x32(v *Value, config *Config) bool {
8828 // match: (Rsh8x32 x (Const64 [c]))
8829 // cond: uint32(c) < 8
8830 // result: (SRAWconst (SignExt8to32 x) [c])
8834 if v_1.Op != OpConst64 {
8838 if !(uint32(c) < 8) {
8841 v.reset(OpPPC64SRAWconst)
8843 v0 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
8848 // match: (Rsh8x32 x (MOVDconst [c]))
8849 // cond: uint32(c) < 8
8850 // result: (SRAWconst (SignExt8to32 x) [c])
8854 if v_1.Op != OpPPC64MOVDconst {
8858 if !(uint32(c) < 8) {
8861 v.reset(OpPPC64SRAWconst)
8863 v0 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
8868 // match: (Rsh8x32 x y)
8870 // result: (SRAW (SignExt8to32 x) (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-8] (ZeroExt32to64 y)))))
8874 v.reset(OpPPC64SRAW)
8875 v0 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
8878 v1 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8880 v2 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8881 v3 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8883 v4 := b.NewValue0(v.Pos, OpZeroExt32to64, config.fe.TypeUInt64())
8892 func rewriteValuePPC64_OpRsh8x64(v *Value, config *Config) bool {
8895 // match: (Rsh8x64 x (Const64 [c]))
8896 // cond: uint64(c) < 8
8897 // result: (SRAWconst (SignExt8to32 x) [c])
8901 if v_1.Op != OpConst64 {
8905 if !(uint64(c) < 8) {
8908 v.reset(OpPPC64SRAWconst)
8910 v0 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
8915 // match: (Rsh8x64 x (Const64 [c]))
8916 // cond: uint64(c) >= 8
8917 // result: (SRAWconst (SignExt8to32 x) [63])
8921 if v_1.Op != OpConst64 {
8925 if !(uint64(c) >= 8) {
8928 v.reset(OpPPC64SRAWconst)
8930 v0 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
8935 // match: (Rsh8x64 x (MOVDconst [c]))
8936 // cond: uint64(c) < 8
8937 // result: (SRAWconst (SignExt8to32 x) [c])
8941 if v_1.Op != OpPPC64MOVDconst {
8945 if !(uint64(c) < 8) {
8948 v.reset(OpPPC64SRAWconst)
8950 v0 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
8955 // match: (Rsh8x64 x y)
8957 // result: (SRAW (SignExt8to32 x) (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-8] y))))
8961 v.reset(OpPPC64SRAW)
8962 v0 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
8965 v1 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8967 v2 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8968 v3 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8977 func rewriteValuePPC64_OpRsh8x8(v *Value, config *Config) bool {
8980 // match: (Rsh8x8 x y)
8982 // result: (SRAW (SignExt8to32 x) (ORN y <config.fe.TypeInt64()> (MaskIfNotCarry (ADDconstForCarry [-8] (ZeroExt8to64 y)))))
8986 v.reset(OpPPC64SRAW)
8987 v0 := b.NewValue0(v.Pos, OpSignExt8to32, config.fe.TypeInt32())
8990 v1 := b.NewValue0(v.Pos, OpPPC64ORN, config.fe.TypeInt64())
8992 v2 := b.NewValue0(v.Pos, OpPPC64MaskIfNotCarry, config.fe.TypeInt64())
8993 v3 := b.NewValue0(v.Pos, OpPPC64ADDconstForCarry, TypeFlags)
8995 v4 := b.NewValue0(v.Pos, OpZeroExt8to64, config.fe.TypeUInt64())
9004 func rewriteValuePPC64_OpSignExt16to32(v *Value, config *Config) bool {
9007 // match: (SignExt16to32 x)
9009 // result: (MOVHreg x)
9012 v.reset(OpPPC64MOVHreg)
9017 func rewriteValuePPC64_OpSignExt16to64(v *Value, config *Config) bool {
9020 // match: (SignExt16to64 x)
9022 // result: (MOVHreg x)
9025 v.reset(OpPPC64MOVHreg)
9030 func rewriteValuePPC64_OpSignExt32to64(v *Value, config *Config) bool {
9033 // match: (SignExt32to64 x)
9035 // result: (MOVWreg x)
9038 v.reset(OpPPC64MOVWreg)
9043 func rewriteValuePPC64_OpSignExt8to16(v *Value, config *Config) bool {
9046 // match: (SignExt8to16 x)
9048 // result: (MOVBreg x)
9051 v.reset(OpPPC64MOVBreg)
9056 func rewriteValuePPC64_OpSignExt8to32(v *Value, config *Config) bool {
9059 // match: (SignExt8to32 x)
9061 // result: (MOVBreg x)
9064 v.reset(OpPPC64MOVBreg)
9069 func rewriteValuePPC64_OpSignExt8to64(v *Value, config *Config) bool {
9072 // match: (SignExt8to64 x)
9074 // result: (MOVBreg x)
9077 v.reset(OpPPC64MOVBreg)
9082 func rewriteValuePPC64_OpSlicemask(v *Value, config *Config) bool {
9085 // match: (Slicemask <t> x)
9087 // result: (XORconst [-1] (SRADconst <t> (ADDconst <t> x [-1]) [63]))
9091 v.reset(OpPPC64XORconst)
9093 v0 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
9095 v1 := b.NewValue0(v.Pos, OpPPC64ADDconst, t)
9103 func rewriteValuePPC64_OpSqrt(v *Value, config *Config) bool {
9108 // result: (FSQRT x)
9111 v.reset(OpPPC64FSQRT)
9116 func rewriteValuePPC64_OpStaticCall(v *Value, config *Config) bool {
9119 // match: (StaticCall [argwid] {target} mem)
9121 // result: (CALLstatic [argwid] {target} mem)
9126 v.reset(OpPPC64CALLstatic)
9133 func rewriteValuePPC64_OpStore(v *Value, config *Config) bool {
9136 // match: (Store [8] ptr val mem)
9137 // cond: is64BitFloat(val.Type)
9138 // result: (FMOVDstore ptr val mem)
9146 if !(is64BitFloat(val.Type)) {
9149 v.reset(OpPPC64FMOVDstore)
9155 // match: (Store [8] ptr val mem)
9156 // cond: is32BitFloat(val.Type)
9157 // result: (FMOVDstore ptr val mem)
9165 if !(is32BitFloat(val.Type)) {
9168 v.reset(OpPPC64FMOVDstore)
9174 // match: (Store [4] ptr val mem)
9175 // cond: is32BitFloat(val.Type)
9176 // result: (FMOVSstore ptr val mem)
9184 if !(is32BitFloat(val.Type)) {
9187 v.reset(OpPPC64FMOVSstore)
9193 // match: (Store [8] ptr val mem)
9194 // cond: (is64BitInt(val.Type) || isPtr(val.Type))
9195 // result: (MOVDstore ptr val mem)
9203 if !(is64BitInt(val.Type) || isPtr(val.Type)) {
9206 v.reset(OpPPC64MOVDstore)
9212 // match: (Store [4] ptr val mem)
9213 // cond: is32BitInt(val.Type)
9214 // result: (MOVWstore ptr val mem)
9222 if !(is32BitInt(val.Type)) {
9225 v.reset(OpPPC64MOVWstore)
9231 // match: (Store [2] ptr val mem)
9233 // result: (MOVHstore ptr val mem)
9241 v.reset(OpPPC64MOVHstore)
9247 // match: (Store [1] ptr val mem)
9249 // result: (MOVBstore ptr val mem)
9257 v.reset(OpPPC64MOVBstore)
9265 func rewriteValuePPC64_OpSub16(v *Value, config *Config) bool {
9268 // match: (Sub16 x y)
9270 // result: (SUB x y)
9280 func rewriteValuePPC64_OpSub32(v *Value, config *Config) bool {
9283 // match: (Sub32 x y)
9285 // result: (SUB x y)
9295 func rewriteValuePPC64_OpSub32F(v *Value, config *Config) bool {
9298 // match: (Sub32F x y)
9300 // result: (FSUBS x y)
9304 v.reset(OpPPC64FSUBS)
9310 func rewriteValuePPC64_OpSub64(v *Value, config *Config) bool {
9313 // match: (Sub64 x y)
9315 // result: (SUB x y)
9325 func rewriteValuePPC64_OpSub64F(v *Value, config *Config) bool {
9328 // match: (Sub64F x y)
9330 // result: (FSUB x y)
9334 v.reset(OpPPC64FSUB)
9340 func rewriteValuePPC64_OpSub8(v *Value, config *Config) bool {
9343 // match: (Sub8 x y)
9345 // result: (SUB x y)
9355 func rewriteValuePPC64_OpSubPtr(v *Value, config *Config) bool {
9358 // match: (SubPtr x y)
9360 // result: (SUB x y)
9370 func rewriteValuePPC64_OpTrunc16to8(v *Value, config *Config) bool {
9373 // match: (Trunc16to8 x)
9375 // result: (MOVBreg x)
9378 v.reset(OpPPC64MOVBreg)
9383 func rewriteValuePPC64_OpTrunc32to16(v *Value, config *Config) bool {
9386 // match: (Trunc32to16 x)
9388 // result: (MOVHreg x)
9391 v.reset(OpPPC64MOVHreg)
9396 func rewriteValuePPC64_OpTrunc32to8(v *Value, config *Config) bool {
9399 // match: (Trunc32to8 x)
9401 // result: (MOVBreg x)
9404 v.reset(OpPPC64MOVBreg)
9409 func rewriteValuePPC64_OpTrunc64to16(v *Value, config *Config) bool {
9412 // match: (Trunc64to16 x)
9414 // result: (MOVHreg x)
9417 v.reset(OpPPC64MOVHreg)
9422 func rewriteValuePPC64_OpTrunc64to32(v *Value, config *Config) bool {
9425 // match: (Trunc64to32 x)
9427 // result: (MOVWreg x)
9430 v.reset(OpPPC64MOVWreg)
9435 func rewriteValuePPC64_OpTrunc64to8(v *Value, config *Config) bool {
9438 // match: (Trunc64to8 x)
9440 // result: (MOVBreg x)
9443 v.reset(OpPPC64MOVBreg)
9448 func rewriteValuePPC64_OpXor16(v *Value, config *Config) bool {
9451 // match: (Xor16 x y)
9453 // result: (XOR x y)
9463 func rewriteValuePPC64_OpXor32(v *Value, config *Config) bool {
9466 // match: (Xor32 x y)
9468 // result: (XOR x y)
9478 func rewriteValuePPC64_OpXor64(v *Value, config *Config) bool {
9481 // match: (Xor64 x y)
9483 // result: (XOR x y)
9493 func rewriteValuePPC64_OpXor8(v *Value, config *Config) bool {
9496 // match: (Xor8 x y)
9498 // result: (XOR x y)
9508 func rewriteValuePPC64_OpZero(v *Value, config *Config) bool {
9511 // match: (Zero [s] _ mem)
9512 // cond: SizeAndAlign(s).Size() == 0
9517 if !(SizeAndAlign(s).Size() == 0) {
9525 // match: (Zero [s] destptr mem)
9526 // cond: SizeAndAlign(s).Size() == 1
9527 // result: (MOVBstorezero destptr mem)
9530 destptr := v.Args[0]
9532 if !(SizeAndAlign(s).Size() == 1) {
9535 v.reset(OpPPC64MOVBstorezero)
9540 // match: (Zero [s] destptr mem)
9541 // cond: SizeAndAlign(s).Size() == 2 && SizeAndAlign(s).Align()%2 == 0
9542 // result: (MOVHstorezero destptr mem)
9545 destptr := v.Args[0]
9547 if !(SizeAndAlign(s).Size() == 2 && SizeAndAlign(s).Align()%2 == 0) {
9550 v.reset(OpPPC64MOVHstorezero)
9555 // match: (Zero [s] destptr mem)
9556 // cond: SizeAndAlign(s).Size() == 2
9557 // result: (MOVBstorezero [1] destptr (MOVBstorezero [0] destptr mem))
9560 destptr := v.Args[0]
9562 if !(SizeAndAlign(s).Size() == 2) {
9565 v.reset(OpPPC64MOVBstorezero)
9568 v0 := b.NewValue0(v.Pos, OpPPC64MOVBstorezero, TypeMem)
9575 // match: (Zero [s] destptr mem)
9576 // cond: SizeAndAlign(s).Size() == 4 && SizeAndAlign(s).Align()%4 == 0
9577 // result: (MOVWstorezero destptr mem)
9580 destptr := v.Args[0]
9582 if !(SizeAndAlign(s).Size() == 4 && SizeAndAlign(s).Align()%4 == 0) {
9585 v.reset(OpPPC64MOVWstorezero)
9590 // match: (Zero [s] destptr mem)
9591 // cond: SizeAndAlign(s).Size() == 4 && SizeAndAlign(s).Align()%2 == 0
9592 // result: (MOVHstorezero [2] destptr (MOVHstorezero [0] destptr mem))
9595 destptr := v.Args[0]
9597 if !(SizeAndAlign(s).Size() == 4 && SizeAndAlign(s).Align()%2 == 0) {
9600 v.reset(OpPPC64MOVHstorezero)
9603 v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, TypeMem)
9610 // match: (Zero [s] destptr mem)
9611 // cond: SizeAndAlign(s).Size() == 4
9612 // result: (MOVBstorezero [3] destptr (MOVBstorezero [2] destptr (MOVBstorezero [1] destptr (MOVBstorezero [0] destptr mem))))
9615 destptr := v.Args[0]
9617 if !(SizeAndAlign(s).Size() == 4) {
9620 v.reset(OpPPC64MOVBstorezero)
9623 v0 := b.NewValue0(v.Pos, OpPPC64MOVBstorezero, TypeMem)
9626 v1 := b.NewValue0(v.Pos, OpPPC64MOVBstorezero, TypeMem)
9629 v2 := b.NewValue0(v.Pos, OpPPC64MOVBstorezero, TypeMem)
9638 // match: (Zero [s] destptr mem)
9639 // cond: SizeAndAlign(s).Size() == 8 && SizeAndAlign(s).Align()%8 == 0
9640 // result: (MOVDstorezero [0] destptr mem)
9643 destptr := v.Args[0]
9645 if !(SizeAndAlign(s).Size() == 8 && SizeAndAlign(s).Align()%8 == 0) {
9648 v.reset(OpPPC64MOVDstorezero)
9654 // match: (Zero [s] destptr mem)
9655 // cond: SizeAndAlign(s).Size() == 8 && SizeAndAlign(s).Align()%4 == 0
9656 // result: (MOVWstorezero [4] destptr (MOVWstorezero [0] destptr mem))
9659 destptr := v.Args[0]
9661 if !(SizeAndAlign(s).Size() == 8 && SizeAndAlign(s).Align()%4 == 0) {
9664 v.reset(OpPPC64MOVWstorezero)
9667 v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, TypeMem)
9674 // match: (Zero [s] destptr mem)
9675 // cond: SizeAndAlign(s).Size() == 8 && SizeAndAlign(s).Align()%2 == 0
9676 // result: (MOVHstorezero [6] destptr (MOVHstorezero [4] destptr (MOVHstorezero [2] destptr (MOVHstorezero [0] destptr mem))))
9679 destptr := v.Args[0]
9681 if !(SizeAndAlign(s).Size() == 8 && SizeAndAlign(s).Align()%2 == 0) {
9684 v.reset(OpPPC64MOVHstorezero)
9687 v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, TypeMem)
9690 v1 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, TypeMem)
9693 v2 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, TypeMem)
9702 // match: (Zero [s] destptr mem)
9703 // cond: SizeAndAlign(s).Size() == 3
9704 // result: (MOVBstorezero [2] destptr (MOVBstorezero [1] destptr (MOVBstorezero [0] destptr mem)))
9707 destptr := v.Args[0]
9709 if !(SizeAndAlign(s).Size() == 3) {
9712 v.reset(OpPPC64MOVBstorezero)
9715 v0 := b.NewValue0(v.Pos, OpPPC64MOVBstorezero, TypeMem)
9718 v1 := b.NewValue0(v.Pos, OpPPC64MOVBstorezero, TypeMem)
9726 // match: (Zero [s] destptr mem)
9727 // cond: SizeAndAlign(s).Size() == 16 && SizeAndAlign(s).Align()%8 == 0
9728 // result: (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))
9731 destptr := v.Args[0]
9733 if !(SizeAndAlign(s).Size() == 16 && SizeAndAlign(s).Align()%8 == 0) {
9736 v.reset(OpPPC64MOVDstorezero)
9739 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, TypeMem)
9746 // match: (Zero [s] destptr mem)
9747 // cond: SizeAndAlign(s).Size() == 24 && SizeAndAlign(s).Align()%8 == 0
9748 // result: (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem)))
9751 destptr := v.Args[0]
9753 if !(SizeAndAlign(s).Size() == 24 && SizeAndAlign(s).Align()%8 == 0) {
9756 v.reset(OpPPC64MOVDstorezero)
9759 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, TypeMem)
9762 v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, TypeMem)
9770 // match: (Zero [s] destptr mem)
9771 // cond: SizeAndAlign(s).Size() == 32 && SizeAndAlign(s).Align()%8 == 0
9772 // result: (MOVDstorezero [24] destptr (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))))
9775 destptr := v.Args[0]
9777 if !(SizeAndAlign(s).Size() == 32 && SizeAndAlign(s).Align()%8 == 0) {
9780 v.reset(OpPPC64MOVDstorezero)
9783 v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, TypeMem)
9786 v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, TypeMem)
9789 v2 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, TypeMem)
9798 // match: (Zero [s] ptr mem)
9799 // cond: (SizeAndAlign(s).Size() > 512 || config.noDuffDevice) || SizeAndAlign(s).Align()%8 != 0
9800 // result: (LoweredZero [SizeAndAlign(s).Align()] ptr (ADDconst <ptr.Type> ptr [SizeAndAlign(s).Size()-moveSize(SizeAndAlign(s).Align(), config)]) mem)
9805 if !((SizeAndAlign(s).Size() > 512 || config.noDuffDevice) || SizeAndAlign(s).Align()%8 != 0) {
9808 v.reset(OpPPC64LoweredZero)
9809 v.AuxInt = SizeAndAlign(s).Align()
9811 v0 := b.NewValue0(v.Pos, OpPPC64ADDconst, ptr.Type)
9812 v0.AuxInt = SizeAndAlign(s).Size() - moveSize(SizeAndAlign(s).Align(), config)
9820 func rewriteValuePPC64_OpZeroExt16to32(v *Value, config *Config) bool {
9823 // match: (ZeroExt16to32 x)
9825 // result: (MOVHZreg x)
9828 v.reset(OpPPC64MOVHZreg)
9833 func rewriteValuePPC64_OpZeroExt16to64(v *Value, config *Config) bool {
9836 // match: (ZeroExt16to64 x)
9838 // result: (MOVHZreg x)
9841 v.reset(OpPPC64MOVHZreg)
9846 func rewriteValuePPC64_OpZeroExt32to64(v *Value, config *Config) bool {
9849 // match: (ZeroExt32to64 x)
9851 // result: (MOVWZreg x)
9854 v.reset(OpPPC64MOVWZreg)
9859 func rewriteValuePPC64_OpZeroExt8to16(v *Value, config *Config) bool {
9862 // match: (ZeroExt8to16 x)
9864 // result: (MOVBZreg x)
9867 v.reset(OpPPC64MOVBZreg)
9872 func rewriteValuePPC64_OpZeroExt8to32(v *Value, config *Config) bool {
9875 // match: (ZeroExt8to32 x)
9877 // result: (MOVBZreg x)
9880 v.reset(OpPPC64MOVBZreg)
9885 func rewriteValuePPC64_OpZeroExt8to64(v *Value, config *Config) bool {
9888 // match: (ZeroExt8to64 x)
9890 // result: (MOVBZreg x)
9893 v.reset(OpPPC64MOVBZreg)
9898 func rewriteBlockPPC64(b *Block, config *Config) bool {
9901 // match: (EQ (CMPconst [0] (ANDconst [c] x)) yes no)
9903 // result: (EQ (ANDCCconst [c] x) yes no)
9906 if v.Op != OpPPC64CMPconst {
9913 if v_0.Op != OpPPC64ANDconst {
9920 b.Kind = BlockPPC64EQ
9921 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, TypeFlags)
9929 // match: (EQ (CMPWconst [0] (ANDconst [c] x)) yes no)
9931 // result: (EQ (ANDCCconst [c] x) yes no)
9934 if v.Op != OpPPC64CMPWconst {
9941 if v_0.Op != OpPPC64ANDconst {
9948 b.Kind = BlockPPC64EQ
9949 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, TypeFlags)
9957 // match: (EQ (FlagEQ) yes no)
9959 // result: (First nil yes no)
9962 if v.Op != OpPPC64FlagEQ {
9973 // match: (EQ (FlagLT) yes no)
9975 // result: (First nil no yes)
9978 if v.Op != OpPPC64FlagLT {
9990 // match: (EQ (FlagGT) yes no)
9992 // result: (First nil no yes)
9995 if v.Op != OpPPC64FlagGT {
10000 b.Kind = BlockFirst
10007 // match: (EQ (InvertFlags cmp) yes no)
10009 // result: (EQ cmp yes no)
10012 if v.Op != OpPPC64InvertFlags {
10018 b.Kind = BlockPPC64EQ
10025 // match: (GE (FlagEQ) yes no)
10027 // result: (First nil yes no)
10030 if v.Op != OpPPC64FlagEQ {
10035 b.Kind = BlockFirst
10041 // match: (GE (FlagLT) yes no)
10043 // result: (First nil no yes)
10046 if v.Op != OpPPC64FlagLT {
10051 b.Kind = BlockFirst
10058 // match: (GE (FlagGT) yes no)
10060 // result: (First nil yes no)
10063 if v.Op != OpPPC64FlagGT {
10068 b.Kind = BlockFirst
10074 // match: (GE (InvertFlags cmp) yes no)
10076 // result: (LE cmp yes no)
10079 if v.Op != OpPPC64InvertFlags {
10085 b.Kind = BlockPPC64LE
10092 // match: (GT (FlagEQ) yes no)
10094 // result: (First nil no yes)
10097 if v.Op != OpPPC64FlagEQ {
10102 b.Kind = BlockFirst
10109 // match: (GT (FlagLT) yes no)
10111 // result: (First nil no yes)
10114 if v.Op != OpPPC64FlagLT {
10119 b.Kind = BlockFirst
10126 // match: (GT (FlagGT) yes no)
10128 // result: (First nil yes no)
10131 if v.Op != OpPPC64FlagGT {
10136 b.Kind = BlockFirst
10142 // match: (GT (InvertFlags cmp) yes no)
10144 // result: (LT cmp yes no)
10147 if v.Op != OpPPC64InvertFlags {
10153 b.Kind = BlockPPC64LT
10160 // match: (If (Equal cc) yes no)
10162 // result: (EQ cc yes no)
10165 if v.Op != OpPPC64Equal {
10171 b.Kind = BlockPPC64EQ
10177 // match: (If (NotEqual cc) yes no)
10179 // result: (NE cc yes no)
10182 if v.Op != OpPPC64NotEqual {
10188 b.Kind = BlockPPC64NE
10194 // match: (If (LessThan cc) yes no)
10196 // result: (LT cc yes no)
10199 if v.Op != OpPPC64LessThan {
10205 b.Kind = BlockPPC64LT
10211 // match: (If (LessEqual cc) yes no)
10213 // result: (LE cc yes no)
10216 if v.Op != OpPPC64LessEqual {
10222 b.Kind = BlockPPC64LE
10228 // match: (If (GreaterThan cc) yes no)
10230 // result: (GT cc yes no)
10233 if v.Op != OpPPC64GreaterThan {
10239 b.Kind = BlockPPC64GT
10245 // match: (If (GreaterEqual cc) yes no)
10247 // result: (GE cc yes no)
10250 if v.Op != OpPPC64GreaterEqual {
10256 b.Kind = BlockPPC64GE
10262 // match: (If (FLessThan cc) yes no)
10264 // result: (FLT cc yes no)
10267 if v.Op != OpPPC64FLessThan {
10273 b.Kind = BlockPPC64FLT
10279 // match: (If (FLessEqual cc) yes no)
10281 // result: (FLE cc yes no)
10284 if v.Op != OpPPC64FLessEqual {
10290 b.Kind = BlockPPC64FLE
10296 // match: (If (FGreaterThan cc) yes no)
10298 // result: (FGT cc yes no)
10301 if v.Op != OpPPC64FGreaterThan {
10307 b.Kind = BlockPPC64FGT
10313 // match: (If (FGreaterEqual cc) yes no)
10315 // result: (FGE cc yes no)
10318 if v.Op != OpPPC64FGreaterEqual {
10324 b.Kind = BlockPPC64FGE
10330 // match: (If cond yes no)
10332 // result: (NE (CMPWconst [0] cond) yes no)
10339 b.Kind = BlockPPC64NE
10340 v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, TypeFlags)
10349 // match: (LE (FlagEQ) yes no)
10351 // result: (First nil yes no)
10354 if v.Op != OpPPC64FlagEQ {
10359 b.Kind = BlockFirst
10365 // match: (LE (FlagLT) yes no)
10367 // result: (First nil yes no)
10370 if v.Op != OpPPC64FlagLT {
10375 b.Kind = BlockFirst
10381 // match: (LE (FlagGT) yes no)
10383 // result: (First nil no yes)
10386 if v.Op != OpPPC64FlagGT {
10391 b.Kind = BlockFirst
10398 // match: (LE (InvertFlags cmp) yes no)
10400 // result: (GE cmp yes no)
10403 if v.Op != OpPPC64InvertFlags {
10409 b.Kind = BlockPPC64GE
10416 // match: (LT (FlagEQ) yes no)
10418 // result: (First nil no yes)
10421 if v.Op != OpPPC64FlagEQ {
10426 b.Kind = BlockFirst
10433 // match: (LT (FlagLT) yes no)
10435 // result: (First nil yes no)
10438 if v.Op != OpPPC64FlagLT {
10443 b.Kind = BlockFirst
10449 // match: (LT (FlagGT) yes no)
10451 // result: (First nil no yes)
10454 if v.Op != OpPPC64FlagGT {
10459 b.Kind = BlockFirst
10466 // match: (LT (InvertFlags cmp) yes no)
10468 // result: (GT cmp yes no)
10471 if v.Op != OpPPC64InvertFlags {
10477 b.Kind = BlockPPC64GT
10484 // match: (NE (CMPWconst [0] (Equal cc)) yes no)
10486 // result: (EQ cc yes no)
10489 if v.Op != OpPPC64CMPWconst {
10496 if v_0.Op != OpPPC64Equal {
10502 b.Kind = BlockPPC64EQ
10508 // match: (NE (CMPWconst [0] (NotEqual cc)) yes no)
10510 // result: (NE cc yes no)
10513 if v.Op != OpPPC64CMPWconst {
10520 if v_0.Op != OpPPC64NotEqual {
10526 b.Kind = BlockPPC64NE
10532 // match: (NE (CMPWconst [0] (LessThan cc)) yes no)
10534 // result: (LT cc yes no)
10537 if v.Op != OpPPC64CMPWconst {
10544 if v_0.Op != OpPPC64LessThan {
10550 b.Kind = BlockPPC64LT
10556 // match: (NE (CMPWconst [0] (LessEqual cc)) yes no)
10558 // result: (LE cc yes no)
10561 if v.Op != OpPPC64CMPWconst {
10568 if v_0.Op != OpPPC64LessEqual {
10574 b.Kind = BlockPPC64LE
10580 // match: (NE (CMPWconst [0] (GreaterThan cc)) yes no)
10582 // result: (GT cc yes no)
10585 if v.Op != OpPPC64CMPWconst {
10592 if v_0.Op != OpPPC64GreaterThan {
10598 b.Kind = BlockPPC64GT
10604 // match: (NE (CMPWconst [0] (GreaterEqual cc)) yes no)
10606 // result: (GE cc yes no)
10609 if v.Op != OpPPC64CMPWconst {
10616 if v_0.Op != OpPPC64GreaterEqual {
10622 b.Kind = BlockPPC64GE
10628 // match: (NE (CMPWconst [0] (FLessThan cc)) yes no)
10630 // result: (FLT cc yes no)
10633 if v.Op != OpPPC64CMPWconst {
10640 if v_0.Op != OpPPC64FLessThan {
10646 b.Kind = BlockPPC64FLT
10652 // match: (NE (CMPWconst [0] (FLessEqual cc)) yes no)
10654 // result: (FLE cc yes no)
10657 if v.Op != OpPPC64CMPWconst {
10664 if v_0.Op != OpPPC64FLessEqual {
10670 b.Kind = BlockPPC64FLE
10676 // match: (NE (CMPWconst [0] (FGreaterThan cc)) yes no)
10678 // result: (FGT cc yes no)
10681 if v.Op != OpPPC64CMPWconst {
10688 if v_0.Op != OpPPC64FGreaterThan {
10694 b.Kind = BlockPPC64FGT
10700 // match: (NE (CMPWconst [0] (FGreaterEqual cc)) yes no)
10702 // result: (FGE cc yes no)
10705 if v.Op != OpPPC64CMPWconst {
10712 if v_0.Op != OpPPC64FGreaterEqual {
10718 b.Kind = BlockPPC64FGE
10724 // match: (NE (CMPconst [0] (ANDconst [c] x)) yes no)
10726 // result: (NE (ANDCCconst [c] x) yes no)
10729 if v.Op != OpPPC64CMPconst {
10736 if v_0.Op != OpPPC64ANDconst {
10743 b.Kind = BlockPPC64NE
10744 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, TypeFlags)
10752 // match: (NE (CMPWconst [0] (ANDconst [c] x)) yes no)
10754 // result: (NE (ANDCCconst [c] x) yes no)
10757 if v.Op != OpPPC64CMPWconst {
10764 if v_0.Op != OpPPC64ANDconst {
10771 b.Kind = BlockPPC64NE
10772 v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, TypeFlags)
10780 // match: (NE (FlagEQ) yes no)
10782 // result: (First nil no yes)
10785 if v.Op != OpPPC64FlagEQ {
10790 b.Kind = BlockFirst
10797 // match: (NE (FlagLT) yes no)
10799 // result: (First nil yes no)
10802 if v.Op != OpPPC64FlagLT {
10807 b.Kind = BlockFirst
10813 // match: (NE (FlagGT) yes no)
10815 // result: (First nil yes no)
10818 if v.Op != OpPPC64FlagGT {
10823 b.Kind = BlockFirst
10829 // match: (NE (InvertFlags cmp) yes no)
10831 // result: (NE cmp yes no)
10834 if v.Op != OpPPC64InvertFlags {
10840 b.Kind = BlockPPC64NE