/
rewritePPC64.go
16667 lines (16663 loc) · 376 KB
/
rewritePPC64.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated from _gen/PPC64.rules using 'go generate'; DO NOT EDIT.
package ssa
import (
"math"
"github.com/go-asm/go/buildcfg"
"github.com/go-asm/go/cmd/compile/types"
)
func rewriteValuePPC64(v *Value) bool {
switch v.Op {
case OpAbs:
v.Op = OpPPC64FABS
return true
case OpAdd16:
v.Op = OpPPC64ADD
return true
case OpAdd32:
v.Op = OpPPC64ADD
return true
case OpAdd32F:
v.Op = OpPPC64FADDS
return true
case OpAdd64:
v.Op = OpPPC64ADD
return true
case OpAdd64F:
v.Op = OpPPC64FADD
return true
case OpAdd8:
v.Op = OpPPC64ADD
return true
case OpAddPtr:
v.Op = OpPPC64ADD
return true
case OpAddr:
return rewriteValuePPC64_OpAddr(v)
case OpAnd16:
v.Op = OpPPC64AND
return true
case OpAnd32:
v.Op = OpPPC64AND
return true
case OpAnd64:
v.Op = OpPPC64AND
return true
case OpAnd8:
v.Op = OpPPC64AND
return true
case OpAndB:
v.Op = OpPPC64AND
return true
case OpAtomicAdd32:
v.Op = OpPPC64LoweredAtomicAdd32
return true
case OpAtomicAdd64:
v.Op = OpPPC64LoweredAtomicAdd64
return true
case OpAtomicAnd32:
v.Op = OpPPC64LoweredAtomicAnd32
return true
case OpAtomicAnd8:
v.Op = OpPPC64LoweredAtomicAnd8
return true
case OpAtomicCompareAndSwap32:
return rewriteValuePPC64_OpAtomicCompareAndSwap32(v)
case OpAtomicCompareAndSwap64:
return rewriteValuePPC64_OpAtomicCompareAndSwap64(v)
case OpAtomicCompareAndSwapRel32:
return rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v)
case OpAtomicExchange32:
v.Op = OpPPC64LoweredAtomicExchange32
return true
case OpAtomicExchange64:
v.Op = OpPPC64LoweredAtomicExchange64
return true
case OpAtomicLoad32:
return rewriteValuePPC64_OpAtomicLoad32(v)
case OpAtomicLoad64:
return rewriteValuePPC64_OpAtomicLoad64(v)
case OpAtomicLoad8:
return rewriteValuePPC64_OpAtomicLoad8(v)
case OpAtomicLoadAcq32:
return rewriteValuePPC64_OpAtomicLoadAcq32(v)
case OpAtomicLoadAcq64:
return rewriteValuePPC64_OpAtomicLoadAcq64(v)
case OpAtomicLoadPtr:
return rewriteValuePPC64_OpAtomicLoadPtr(v)
case OpAtomicOr32:
v.Op = OpPPC64LoweredAtomicOr32
return true
case OpAtomicOr8:
v.Op = OpPPC64LoweredAtomicOr8
return true
case OpAtomicStore32:
return rewriteValuePPC64_OpAtomicStore32(v)
case OpAtomicStore64:
return rewriteValuePPC64_OpAtomicStore64(v)
case OpAtomicStore8:
return rewriteValuePPC64_OpAtomicStore8(v)
case OpAtomicStoreRel32:
return rewriteValuePPC64_OpAtomicStoreRel32(v)
case OpAtomicStoreRel64:
return rewriteValuePPC64_OpAtomicStoreRel64(v)
case OpAvg64u:
return rewriteValuePPC64_OpAvg64u(v)
case OpBitLen32:
return rewriteValuePPC64_OpBitLen32(v)
case OpBitLen64:
return rewriteValuePPC64_OpBitLen64(v)
case OpBswap16:
return rewriteValuePPC64_OpBswap16(v)
case OpBswap32:
return rewriteValuePPC64_OpBswap32(v)
case OpBswap64:
return rewriteValuePPC64_OpBswap64(v)
case OpCeil:
v.Op = OpPPC64FCEIL
return true
case OpClosureCall:
v.Op = OpPPC64CALLclosure
return true
case OpCom16:
return rewriteValuePPC64_OpCom16(v)
case OpCom32:
return rewriteValuePPC64_OpCom32(v)
case OpCom64:
return rewriteValuePPC64_OpCom64(v)
case OpCom8:
return rewriteValuePPC64_OpCom8(v)
case OpCondSelect:
return rewriteValuePPC64_OpCondSelect(v)
case OpConst16:
return rewriteValuePPC64_OpConst16(v)
case OpConst32:
return rewriteValuePPC64_OpConst32(v)
case OpConst32F:
v.Op = OpPPC64FMOVSconst
return true
case OpConst64:
return rewriteValuePPC64_OpConst64(v)
case OpConst64F:
v.Op = OpPPC64FMOVDconst
return true
case OpConst8:
return rewriteValuePPC64_OpConst8(v)
case OpConstBool:
return rewriteValuePPC64_OpConstBool(v)
case OpConstNil:
return rewriteValuePPC64_OpConstNil(v)
case OpCopysign:
return rewriteValuePPC64_OpCopysign(v)
case OpCtz16:
return rewriteValuePPC64_OpCtz16(v)
case OpCtz32:
return rewriteValuePPC64_OpCtz32(v)
case OpCtz32NonZero:
v.Op = OpCtz32
return true
case OpCtz64:
return rewriteValuePPC64_OpCtz64(v)
case OpCtz64NonZero:
v.Op = OpCtz64
return true
case OpCtz8:
return rewriteValuePPC64_OpCtz8(v)
case OpCvt32Fto32:
return rewriteValuePPC64_OpCvt32Fto32(v)
case OpCvt32Fto64:
return rewriteValuePPC64_OpCvt32Fto64(v)
case OpCvt32Fto64F:
v.Op = OpCopy
return true
case OpCvt32to32F:
return rewriteValuePPC64_OpCvt32to32F(v)
case OpCvt32to64F:
return rewriteValuePPC64_OpCvt32to64F(v)
case OpCvt64Fto32:
return rewriteValuePPC64_OpCvt64Fto32(v)
case OpCvt64Fto32F:
v.Op = OpPPC64FRSP
return true
case OpCvt64Fto64:
return rewriteValuePPC64_OpCvt64Fto64(v)
case OpCvt64to32F:
return rewriteValuePPC64_OpCvt64to32F(v)
case OpCvt64to64F:
return rewriteValuePPC64_OpCvt64to64F(v)
case OpCvtBoolToUint8:
v.Op = OpCopy
return true
case OpDiv16:
return rewriteValuePPC64_OpDiv16(v)
case OpDiv16u:
return rewriteValuePPC64_OpDiv16u(v)
case OpDiv32:
return rewriteValuePPC64_OpDiv32(v)
case OpDiv32F:
v.Op = OpPPC64FDIVS
return true
case OpDiv32u:
v.Op = OpPPC64DIVWU
return true
case OpDiv64:
return rewriteValuePPC64_OpDiv64(v)
case OpDiv64F:
v.Op = OpPPC64FDIV
return true
case OpDiv64u:
v.Op = OpPPC64DIVDU
return true
case OpDiv8:
return rewriteValuePPC64_OpDiv8(v)
case OpDiv8u:
return rewriteValuePPC64_OpDiv8u(v)
case OpEq16:
return rewriteValuePPC64_OpEq16(v)
case OpEq32:
return rewriteValuePPC64_OpEq32(v)
case OpEq32F:
return rewriteValuePPC64_OpEq32F(v)
case OpEq64:
return rewriteValuePPC64_OpEq64(v)
case OpEq64F:
return rewriteValuePPC64_OpEq64F(v)
case OpEq8:
return rewriteValuePPC64_OpEq8(v)
case OpEqB:
return rewriteValuePPC64_OpEqB(v)
case OpEqPtr:
return rewriteValuePPC64_OpEqPtr(v)
case OpFMA:
v.Op = OpPPC64FMADD
return true
case OpFloor:
v.Op = OpPPC64FFLOOR
return true
case OpGetCallerPC:
v.Op = OpPPC64LoweredGetCallerPC
return true
case OpGetCallerSP:
v.Op = OpPPC64LoweredGetCallerSP
return true
case OpGetClosurePtr:
v.Op = OpPPC64LoweredGetClosurePtr
return true
case OpHmul32:
v.Op = OpPPC64MULHW
return true
case OpHmul32u:
v.Op = OpPPC64MULHWU
return true
case OpHmul64:
v.Op = OpPPC64MULHD
return true
case OpHmul64u:
v.Op = OpPPC64MULHDU
return true
case OpInterCall:
v.Op = OpPPC64CALLinter
return true
case OpIsInBounds:
return rewriteValuePPC64_OpIsInBounds(v)
case OpIsNonNil:
return rewriteValuePPC64_OpIsNonNil(v)
case OpIsSliceInBounds:
return rewriteValuePPC64_OpIsSliceInBounds(v)
case OpLeq16:
return rewriteValuePPC64_OpLeq16(v)
case OpLeq16U:
return rewriteValuePPC64_OpLeq16U(v)
case OpLeq32:
return rewriteValuePPC64_OpLeq32(v)
case OpLeq32F:
return rewriteValuePPC64_OpLeq32F(v)
case OpLeq32U:
return rewriteValuePPC64_OpLeq32U(v)
case OpLeq64:
return rewriteValuePPC64_OpLeq64(v)
case OpLeq64F:
return rewriteValuePPC64_OpLeq64F(v)
case OpLeq64U:
return rewriteValuePPC64_OpLeq64U(v)
case OpLeq8:
return rewriteValuePPC64_OpLeq8(v)
case OpLeq8U:
return rewriteValuePPC64_OpLeq8U(v)
case OpLess16:
return rewriteValuePPC64_OpLess16(v)
case OpLess16U:
return rewriteValuePPC64_OpLess16U(v)
case OpLess32:
return rewriteValuePPC64_OpLess32(v)
case OpLess32F:
return rewriteValuePPC64_OpLess32F(v)
case OpLess32U:
return rewriteValuePPC64_OpLess32U(v)
case OpLess64:
return rewriteValuePPC64_OpLess64(v)
case OpLess64F:
return rewriteValuePPC64_OpLess64F(v)
case OpLess64U:
return rewriteValuePPC64_OpLess64U(v)
case OpLess8:
return rewriteValuePPC64_OpLess8(v)
case OpLess8U:
return rewriteValuePPC64_OpLess8U(v)
case OpLoad:
return rewriteValuePPC64_OpLoad(v)
case OpLocalAddr:
return rewriteValuePPC64_OpLocalAddr(v)
case OpLsh16x16:
return rewriteValuePPC64_OpLsh16x16(v)
case OpLsh16x32:
return rewriteValuePPC64_OpLsh16x32(v)
case OpLsh16x64:
return rewriteValuePPC64_OpLsh16x64(v)
case OpLsh16x8:
return rewriteValuePPC64_OpLsh16x8(v)
case OpLsh32x16:
return rewriteValuePPC64_OpLsh32x16(v)
case OpLsh32x32:
return rewriteValuePPC64_OpLsh32x32(v)
case OpLsh32x64:
return rewriteValuePPC64_OpLsh32x64(v)
case OpLsh32x8:
return rewriteValuePPC64_OpLsh32x8(v)
case OpLsh64x16:
return rewriteValuePPC64_OpLsh64x16(v)
case OpLsh64x32:
return rewriteValuePPC64_OpLsh64x32(v)
case OpLsh64x64:
return rewriteValuePPC64_OpLsh64x64(v)
case OpLsh64x8:
return rewriteValuePPC64_OpLsh64x8(v)
case OpLsh8x16:
return rewriteValuePPC64_OpLsh8x16(v)
case OpLsh8x32:
return rewriteValuePPC64_OpLsh8x32(v)
case OpLsh8x64:
return rewriteValuePPC64_OpLsh8x64(v)
case OpLsh8x8:
return rewriteValuePPC64_OpLsh8x8(v)
case OpMod16:
return rewriteValuePPC64_OpMod16(v)
case OpMod16u:
return rewriteValuePPC64_OpMod16u(v)
case OpMod32:
return rewriteValuePPC64_OpMod32(v)
case OpMod32u:
return rewriteValuePPC64_OpMod32u(v)
case OpMod64:
return rewriteValuePPC64_OpMod64(v)
case OpMod64u:
return rewriteValuePPC64_OpMod64u(v)
case OpMod8:
return rewriteValuePPC64_OpMod8(v)
case OpMod8u:
return rewriteValuePPC64_OpMod8u(v)
case OpMove:
return rewriteValuePPC64_OpMove(v)
case OpMul16:
v.Op = OpPPC64MULLW
return true
case OpMul32:
v.Op = OpPPC64MULLW
return true
case OpMul32F:
v.Op = OpPPC64FMULS
return true
case OpMul64:
v.Op = OpPPC64MULLD
return true
case OpMul64F:
v.Op = OpPPC64FMUL
return true
case OpMul8:
v.Op = OpPPC64MULLW
return true
case OpNeg16:
v.Op = OpPPC64NEG
return true
case OpNeg32:
v.Op = OpPPC64NEG
return true
case OpNeg32F:
v.Op = OpPPC64FNEG
return true
case OpNeg64:
v.Op = OpPPC64NEG
return true
case OpNeg64F:
v.Op = OpPPC64FNEG
return true
case OpNeg8:
v.Op = OpPPC64NEG
return true
case OpNeq16:
return rewriteValuePPC64_OpNeq16(v)
case OpNeq32:
return rewriteValuePPC64_OpNeq32(v)
case OpNeq32F:
return rewriteValuePPC64_OpNeq32F(v)
case OpNeq64:
return rewriteValuePPC64_OpNeq64(v)
case OpNeq64F:
return rewriteValuePPC64_OpNeq64F(v)
case OpNeq8:
return rewriteValuePPC64_OpNeq8(v)
case OpNeqB:
v.Op = OpPPC64XOR
return true
case OpNeqPtr:
return rewriteValuePPC64_OpNeqPtr(v)
case OpNilCheck:
v.Op = OpPPC64LoweredNilCheck
return true
case OpNot:
return rewriteValuePPC64_OpNot(v)
case OpOffPtr:
return rewriteValuePPC64_OpOffPtr(v)
case OpOr16:
v.Op = OpPPC64OR
return true
case OpOr32:
v.Op = OpPPC64OR
return true
case OpOr64:
v.Op = OpPPC64OR
return true
case OpOr8:
v.Op = OpPPC64OR
return true
case OpOrB:
v.Op = OpPPC64OR
return true
case OpPPC64ADD:
return rewriteValuePPC64_OpPPC64ADD(v)
case OpPPC64ADDE:
return rewriteValuePPC64_OpPPC64ADDE(v)
case OpPPC64ADDconst:
return rewriteValuePPC64_OpPPC64ADDconst(v)
case OpPPC64AND:
return rewriteValuePPC64_OpPPC64AND(v)
case OpPPC64ANDCCconst:
return rewriteValuePPC64_OpPPC64ANDCCconst(v)
case OpPPC64ANDN:
return rewriteValuePPC64_OpPPC64ANDN(v)
case OpPPC64BRD:
return rewriteValuePPC64_OpPPC64BRD(v)
case OpPPC64BRH:
return rewriteValuePPC64_OpPPC64BRH(v)
case OpPPC64BRW:
return rewriteValuePPC64_OpPPC64BRW(v)
case OpPPC64CLRLSLDI:
return rewriteValuePPC64_OpPPC64CLRLSLDI(v)
case OpPPC64CMP:
return rewriteValuePPC64_OpPPC64CMP(v)
case OpPPC64CMPU:
return rewriteValuePPC64_OpPPC64CMPU(v)
case OpPPC64CMPUconst:
return rewriteValuePPC64_OpPPC64CMPUconst(v)
case OpPPC64CMPW:
return rewriteValuePPC64_OpPPC64CMPW(v)
case OpPPC64CMPWU:
return rewriteValuePPC64_OpPPC64CMPWU(v)
case OpPPC64CMPWUconst:
return rewriteValuePPC64_OpPPC64CMPWUconst(v)
case OpPPC64CMPWconst:
return rewriteValuePPC64_OpPPC64CMPWconst(v)
case OpPPC64CMPconst:
return rewriteValuePPC64_OpPPC64CMPconst(v)
case OpPPC64Equal:
return rewriteValuePPC64_OpPPC64Equal(v)
case OpPPC64FABS:
return rewriteValuePPC64_OpPPC64FABS(v)
case OpPPC64FADD:
return rewriteValuePPC64_OpPPC64FADD(v)
case OpPPC64FADDS:
return rewriteValuePPC64_OpPPC64FADDS(v)
case OpPPC64FCEIL:
return rewriteValuePPC64_OpPPC64FCEIL(v)
case OpPPC64FFLOOR:
return rewriteValuePPC64_OpPPC64FFLOOR(v)
case OpPPC64FGreaterEqual:
return rewriteValuePPC64_OpPPC64FGreaterEqual(v)
case OpPPC64FGreaterThan:
return rewriteValuePPC64_OpPPC64FGreaterThan(v)
case OpPPC64FLessEqual:
return rewriteValuePPC64_OpPPC64FLessEqual(v)
case OpPPC64FLessThan:
return rewriteValuePPC64_OpPPC64FLessThan(v)
case OpPPC64FMOVDload:
return rewriteValuePPC64_OpPPC64FMOVDload(v)
case OpPPC64FMOVDstore:
return rewriteValuePPC64_OpPPC64FMOVDstore(v)
case OpPPC64FMOVSload:
return rewriteValuePPC64_OpPPC64FMOVSload(v)
case OpPPC64FMOVSstore:
return rewriteValuePPC64_OpPPC64FMOVSstore(v)
case OpPPC64FNEG:
return rewriteValuePPC64_OpPPC64FNEG(v)
case OpPPC64FSQRT:
return rewriteValuePPC64_OpPPC64FSQRT(v)
case OpPPC64FSUB:
return rewriteValuePPC64_OpPPC64FSUB(v)
case OpPPC64FSUBS:
return rewriteValuePPC64_OpPPC64FSUBS(v)
case OpPPC64FTRUNC:
return rewriteValuePPC64_OpPPC64FTRUNC(v)
case OpPPC64GreaterEqual:
return rewriteValuePPC64_OpPPC64GreaterEqual(v)
case OpPPC64GreaterThan:
return rewriteValuePPC64_OpPPC64GreaterThan(v)
case OpPPC64ISEL:
return rewriteValuePPC64_OpPPC64ISEL(v)
case OpPPC64LessEqual:
return rewriteValuePPC64_OpPPC64LessEqual(v)
case OpPPC64LessThan:
return rewriteValuePPC64_OpPPC64LessThan(v)
case OpPPC64MFVSRD:
return rewriteValuePPC64_OpPPC64MFVSRD(v)
case OpPPC64MOVBZload:
return rewriteValuePPC64_OpPPC64MOVBZload(v)
case OpPPC64MOVBZloadidx:
return rewriteValuePPC64_OpPPC64MOVBZloadidx(v)
case OpPPC64MOVBZreg:
return rewriteValuePPC64_OpPPC64MOVBZreg(v)
case OpPPC64MOVBreg:
return rewriteValuePPC64_OpPPC64MOVBreg(v)
case OpPPC64MOVBstore:
return rewriteValuePPC64_OpPPC64MOVBstore(v)
case OpPPC64MOVBstoreidx:
return rewriteValuePPC64_OpPPC64MOVBstoreidx(v)
case OpPPC64MOVBstorezero:
return rewriteValuePPC64_OpPPC64MOVBstorezero(v)
case OpPPC64MOVDload:
return rewriteValuePPC64_OpPPC64MOVDload(v)
case OpPPC64MOVDloadidx:
return rewriteValuePPC64_OpPPC64MOVDloadidx(v)
case OpPPC64MOVDstore:
return rewriteValuePPC64_OpPPC64MOVDstore(v)
case OpPPC64MOVDstoreidx:
return rewriteValuePPC64_OpPPC64MOVDstoreidx(v)
case OpPPC64MOVDstorezero:
return rewriteValuePPC64_OpPPC64MOVDstorezero(v)
case OpPPC64MOVHBRstore:
return rewriteValuePPC64_OpPPC64MOVHBRstore(v)
case OpPPC64MOVHZload:
return rewriteValuePPC64_OpPPC64MOVHZload(v)
case OpPPC64MOVHZloadidx:
return rewriteValuePPC64_OpPPC64MOVHZloadidx(v)
case OpPPC64MOVHZreg:
return rewriteValuePPC64_OpPPC64MOVHZreg(v)
case OpPPC64MOVHload:
return rewriteValuePPC64_OpPPC64MOVHload(v)
case OpPPC64MOVHloadidx:
return rewriteValuePPC64_OpPPC64MOVHloadidx(v)
case OpPPC64MOVHreg:
return rewriteValuePPC64_OpPPC64MOVHreg(v)
case OpPPC64MOVHstore:
return rewriteValuePPC64_OpPPC64MOVHstore(v)
case OpPPC64MOVHstoreidx:
return rewriteValuePPC64_OpPPC64MOVHstoreidx(v)
case OpPPC64MOVHstorezero:
return rewriteValuePPC64_OpPPC64MOVHstorezero(v)
case OpPPC64MOVWBRstore:
return rewriteValuePPC64_OpPPC64MOVWBRstore(v)
case OpPPC64MOVWZload:
return rewriteValuePPC64_OpPPC64MOVWZload(v)
case OpPPC64MOVWZloadidx:
return rewriteValuePPC64_OpPPC64MOVWZloadidx(v)
case OpPPC64MOVWZreg:
return rewriteValuePPC64_OpPPC64MOVWZreg(v)
case OpPPC64MOVWload:
return rewriteValuePPC64_OpPPC64MOVWload(v)
case OpPPC64MOVWloadidx:
return rewriteValuePPC64_OpPPC64MOVWloadidx(v)
case OpPPC64MOVWreg:
return rewriteValuePPC64_OpPPC64MOVWreg(v)
case OpPPC64MOVWstore:
return rewriteValuePPC64_OpPPC64MOVWstore(v)
case OpPPC64MOVWstoreidx:
return rewriteValuePPC64_OpPPC64MOVWstoreidx(v)
case OpPPC64MOVWstorezero:
return rewriteValuePPC64_OpPPC64MOVWstorezero(v)
case OpPPC64MTVSRD:
return rewriteValuePPC64_OpPPC64MTVSRD(v)
case OpPPC64MULLD:
return rewriteValuePPC64_OpPPC64MULLD(v)
case OpPPC64MULLW:
return rewriteValuePPC64_OpPPC64MULLW(v)
case OpPPC64NEG:
return rewriteValuePPC64_OpPPC64NEG(v)
case OpPPC64NOR:
return rewriteValuePPC64_OpPPC64NOR(v)
case OpPPC64NotEqual:
return rewriteValuePPC64_OpPPC64NotEqual(v)
case OpPPC64OR:
return rewriteValuePPC64_OpPPC64OR(v)
case OpPPC64ORN:
return rewriteValuePPC64_OpPPC64ORN(v)
case OpPPC64ORconst:
return rewriteValuePPC64_OpPPC64ORconst(v)
case OpPPC64ROTL:
return rewriteValuePPC64_OpPPC64ROTL(v)
case OpPPC64ROTLW:
return rewriteValuePPC64_OpPPC64ROTLW(v)
case OpPPC64ROTLWconst:
return rewriteValuePPC64_OpPPC64ROTLWconst(v)
case OpPPC64SETBC:
return rewriteValuePPC64_OpPPC64SETBC(v)
case OpPPC64SETBCR:
return rewriteValuePPC64_OpPPC64SETBCR(v)
case OpPPC64SLD:
return rewriteValuePPC64_OpPPC64SLD(v)
case OpPPC64SLDconst:
return rewriteValuePPC64_OpPPC64SLDconst(v)
case OpPPC64SLW:
return rewriteValuePPC64_OpPPC64SLW(v)
case OpPPC64SLWconst:
return rewriteValuePPC64_OpPPC64SLWconst(v)
case OpPPC64SRAD:
return rewriteValuePPC64_OpPPC64SRAD(v)
case OpPPC64SRAW:
return rewriteValuePPC64_OpPPC64SRAW(v)
case OpPPC64SRD:
return rewriteValuePPC64_OpPPC64SRD(v)
case OpPPC64SRW:
return rewriteValuePPC64_OpPPC64SRW(v)
case OpPPC64SRWconst:
return rewriteValuePPC64_OpPPC64SRWconst(v)
case OpPPC64SUB:
return rewriteValuePPC64_OpPPC64SUB(v)
case OpPPC64SUBE:
return rewriteValuePPC64_OpPPC64SUBE(v)
case OpPPC64SUBFCconst:
return rewriteValuePPC64_OpPPC64SUBFCconst(v)
case OpPPC64XOR:
return rewriteValuePPC64_OpPPC64XOR(v)
case OpPPC64XORconst:
return rewriteValuePPC64_OpPPC64XORconst(v)
case OpPanicBounds:
return rewriteValuePPC64_OpPanicBounds(v)
case OpPopCount16:
return rewriteValuePPC64_OpPopCount16(v)
case OpPopCount32:
return rewriteValuePPC64_OpPopCount32(v)
case OpPopCount64:
v.Op = OpPPC64POPCNTD
return true
case OpPopCount8:
return rewriteValuePPC64_OpPopCount8(v)
case OpPrefetchCache:
return rewriteValuePPC64_OpPrefetchCache(v)
case OpPrefetchCacheStreamed:
return rewriteValuePPC64_OpPrefetchCacheStreamed(v)
case OpPubBarrier:
v.Op = OpPPC64LoweredPubBarrier
return true
case OpRotateLeft16:
return rewriteValuePPC64_OpRotateLeft16(v)
case OpRotateLeft32:
v.Op = OpPPC64ROTLW
return true
case OpRotateLeft64:
v.Op = OpPPC64ROTL
return true
case OpRotateLeft8:
return rewriteValuePPC64_OpRotateLeft8(v)
case OpRound:
v.Op = OpPPC64FROUND
return true
case OpRound32F:
v.Op = OpPPC64LoweredRound32F
return true
case OpRound64F:
v.Op = OpPPC64LoweredRound64F
return true
case OpRsh16Ux16:
return rewriteValuePPC64_OpRsh16Ux16(v)
case OpRsh16Ux32:
return rewriteValuePPC64_OpRsh16Ux32(v)
case OpRsh16Ux64:
return rewriteValuePPC64_OpRsh16Ux64(v)
case OpRsh16Ux8:
return rewriteValuePPC64_OpRsh16Ux8(v)
case OpRsh16x16:
return rewriteValuePPC64_OpRsh16x16(v)
case OpRsh16x32:
return rewriteValuePPC64_OpRsh16x32(v)
case OpRsh16x64:
return rewriteValuePPC64_OpRsh16x64(v)
case OpRsh16x8:
return rewriteValuePPC64_OpRsh16x8(v)
case OpRsh32Ux16:
return rewriteValuePPC64_OpRsh32Ux16(v)
case OpRsh32Ux32:
return rewriteValuePPC64_OpRsh32Ux32(v)
case OpRsh32Ux64:
return rewriteValuePPC64_OpRsh32Ux64(v)
case OpRsh32Ux8:
return rewriteValuePPC64_OpRsh32Ux8(v)
case OpRsh32x16:
return rewriteValuePPC64_OpRsh32x16(v)
case OpRsh32x32:
return rewriteValuePPC64_OpRsh32x32(v)
case OpRsh32x64:
return rewriteValuePPC64_OpRsh32x64(v)
case OpRsh32x8:
return rewriteValuePPC64_OpRsh32x8(v)
case OpRsh64Ux16:
return rewriteValuePPC64_OpRsh64Ux16(v)
case OpRsh64Ux32:
return rewriteValuePPC64_OpRsh64Ux32(v)
case OpRsh64Ux64:
return rewriteValuePPC64_OpRsh64Ux64(v)
case OpRsh64Ux8:
return rewriteValuePPC64_OpRsh64Ux8(v)
case OpRsh64x16:
return rewriteValuePPC64_OpRsh64x16(v)
case OpRsh64x32:
return rewriteValuePPC64_OpRsh64x32(v)
case OpRsh64x64:
return rewriteValuePPC64_OpRsh64x64(v)
case OpRsh64x8:
return rewriteValuePPC64_OpRsh64x8(v)
case OpRsh8Ux16:
return rewriteValuePPC64_OpRsh8Ux16(v)
case OpRsh8Ux32:
return rewriteValuePPC64_OpRsh8Ux32(v)
case OpRsh8Ux64:
return rewriteValuePPC64_OpRsh8Ux64(v)
case OpRsh8Ux8:
return rewriteValuePPC64_OpRsh8Ux8(v)
case OpRsh8x16:
return rewriteValuePPC64_OpRsh8x16(v)
case OpRsh8x32:
return rewriteValuePPC64_OpRsh8x32(v)
case OpRsh8x64:
return rewriteValuePPC64_OpRsh8x64(v)
case OpRsh8x8:
return rewriteValuePPC64_OpRsh8x8(v)
case OpSelect0:
return rewriteValuePPC64_OpSelect0(v)
case OpSelect1:
return rewriteValuePPC64_OpSelect1(v)
case OpSelectN:
return rewriteValuePPC64_OpSelectN(v)
case OpSignExt16to32:
v.Op = OpPPC64MOVHreg
return true
case OpSignExt16to64:
v.Op = OpPPC64MOVHreg
return true
case OpSignExt32to64:
v.Op = OpPPC64MOVWreg
return true
case OpSignExt8to16:
v.Op = OpPPC64MOVBreg
return true
case OpSignExt8to32:
v.Op = OpPPC64MOVBreg
return true
case OpSignExt8to64:
v.Op = OpPPC64MOVBreg
return true
case OpSlicemask:
return rewriteValuePPC64_OpSlicemask(v)
case OpSqrt:
v.Op = OpPPC64FSQRT
return true
case OpSqrt32:
v.Op = OpPPC64FSQRTS
return true
case OpStaticCall:
v.Op = OpPPC64CALLstatic
return true
case OpStore:
return rewriteValuePPC64_OpStore(v)
case OpSub16:
v.Op = OpPPC64SUB
return true
case OpSub32:
v.Op = OpPPC64SUB
return true
case OpSub32F:
v.Op = OpPPC64FSUBS
return true
case OpSub64:
v.Op = OpPPC64SUB
return true
case OpSub64F:
v.Op = OpPPC64FSUB
return true
case OpSub8:
v.Op = OpPPC64SUB
return true
case OpSubPtr:
v.Op = OpPPC64SUB
return true
case OpTailCall:
v.Op = OpPPC64CALLtail
return true
case OpTrunc:
v.Op = OpPPC64FTRUNC
return true
case OpTrunc16to8:
return rewriteValuePPC64_OpTrunc16to8(v)
case OpTrunc32to16:
return rewriteValuePPC64_OpTrunc32to16(v)
case OpTrunc32to8:
return rewriteValuePPC64_OpTrunc32to8(v)
case OpTrunc64to16:
return rewriteValuePPC64_OpTrunc64to16(v)
case OpTrunc64to32:
return rewriteValuePPC64_OpTrunc64to32(v)
case OpTrunc64to8:
return rewriteValuePPC64_OpTrunc64to8(v)
case OpWB:
v.Op = OpPPC64LoweredWB
return true
case OpXor16:
v.Op = OpPPC64XOR
return true
case OpXor32:
v.Op = OpPPC64XOR
return true
case OpXor64:
v.Op = OpPPC64XOR
return true
case OpXor8:
v.Op = OpPPC64XOR
return true
case OpZero:
return rewriteValuePPC64_OpZero(v)
case OpZeroExt16to32:
v.Op = OpPPC64MOVHZreg
return true
case OpZeroExt16to64:
v.Op = OpPPC64MOVHZreg
return true
case OpZeroExt32to64:
v.Op = OpPPC64MOVWZreg
return true
case OpZeroExt8to16:
v.Op = OpPPC64MOVBZreg
return true
case OpZeroExt8to32:
v.Op = OpPPC64MOVBZreg
return true
case OpZeroExt8to64:
v.Op = OpPPC64MOVBZreg
return true
}
return false
}
func rewriteValuePPC64_OpAddr(v *Value) bool {
v_0 := v.Args[0]
// match: (Addr {sym} base)
// result: (MOVDaddr {sym} [0] base)
for {
sym := auxToSym(v.Aux)
base := v_0
v.reset(OpPPC64MOVDaddr)
v.AuxInt = int32ToAuxInt(0)
v.Aux = symToAux(sym)
v.AddArg(base)
return true
}
}
func rewriteValuePPC64_OpAtomicCompareAndSwap32(v *Value) bool {
v_3 := v.Args[3]
v_2 := v.Args[2]
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicCompareAndSwap32 ptr old new_ mem)
// result: (LoweredAtomicCas32 [1] ptr old new_ mem)
for {
ptr := v_0
old := v_1
new_ := v_2
mem := v_3
v.reset(OpPPC64LoweredAtomicCas32)
v.AuxInt = int64ToAuxInt(1)
v.AddArg4(ptr, old, new_, mem)
return true
}
}
func rewriteValuePPC64_OpAtomicCompareAndSwap64(v *Value) bool {
v_3 := v.Args[3]
v_2 := v.Args[2]
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicCompareAndSwap64 ptr old new_ mem)
// result: (LoweredAtomicCas64 [1] ptr old new_ mem)
for {
ptr := v_0
old := v_1
new_ := v_2
mem := v_3
v.reset(OpPPC64LoweredAtomicCas64)
v.AuxInt = int64ToAuxInt(1)
v.AddArg4(ptr, old, new_, mem)
return true
}
}
func rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v *Value) bool {
v_3 := v.Args[3]
v_2 := v.Args[2]
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicCompareAndSwapRel32 ptr old new_ mem)
// result: (LoweredAtomicCas32 [0] ptr old new_ mem)
for {
ptr := v_0
old := v_1
new_ := v_2
mem := v_3
v.reset(OpPPC64LoweredAtomicCas32)
v.AuxInt = int64ToAuxInt(0)
v.AddArg4(ptr, old, new_, mem)
return true
}
}
func rewriteValuePPC64_OpAtomicLoad32(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicLoad32 ptr mem)
// result: (LoweredAtomicLoad32 [1] ptr mem)
for {
ptr := v_0
mem := v_1
v.reset(OpPPC64LoweredAtomicLoad32)
v.AuxInt = int64ToAuxInt(1)
v.AddArg2(ptr, mem)
return true
}
}
func rewriteValuePPC64_OpAtomicLoad64(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicLoad64 ptr mem)
// result: (LoweredAtomicLoad64 [1] ptr mem)
for {
ptr := v_0
mem := v_1
v.reset(OpPPC64LoweredAtomicLoad64)
v.AuxInt = int64ToAuxInt(1)
v.AddArg2(ptr, mem)
return true
}
}
func rewriteValuePPC64_OpAtomicLoad8(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicLoad8 ptr mem)
// result: (LoweredAtomicLoad8 [1] ptr mem)
for {
ptr := v_0
mem := v_1
v.reset(OpPPC64LoweredAtomicLoad8)
v.AuxInt = int64ToAuxInt(1)
v.AddArg2(ptr, mem)
return true
}
}
func rewriteValuePPC64_OpAtomicLoadAcq32(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicLoadAcq32 ptr mem)
// result: (LoweredAtomicLoad32 [0] ptr mem)
for {
ptr := v_0
mem := v_1
v.reset(OpPPC64LoweredAtomicLoad32)
v.AuxInt = int64ToAuxInt(0)
v.AddArg2(ptr, mem)
return true
}
}
func rewriteValuePPC64_OpAtomicLoadAcq64(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicLoadAcq64 ptr mem)
// result: (LoweredAtomicLoad64 [0] ptr mem)
for {
ptr := v_0
mem := v_1
v.reset(OpPPC64LoweredAtomicLoad64)
v.AuxInt = int64ToAuxInt(0)
v.AddArg2(ptr, mem)
return true
}
}
func rewriteValuePPC64_OpAtomicLoadPtr(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]