1 // Code generated from gen/386.rules; DO NOT EDIT.
2 // generated with: cd gen; go run *.go
7 import "cmd/compile/internal/types"
9 func rewriteValue386(v *Value) bool {
12 return rewriteValue386_Op386ADCL(v)
14 return rewriteValue386_Op386ADDL(v)
16 return rewriteValue386_Op386ADDLcarry(v)
18 return rewriteValue386_Op386ADDLconst(v)
19 case Op386ADDLconstmodify:
20 return rewriteValue386_Op386ADDLconstmodify(v)
22 return rewriteValue386_Op386ADDLload(v)
24 return rewriteValue386_Op386ADDLmodify(v)
26 return rewriteValue386_Op386ADDSD(v)
28 return rewriteValue386_Op386ADDSDload(v)
30 return rewriteValue386_Op386ADDSS(v)
32 return rewriteValue386_Op386ADDSSload(v)
34 return rewriteValue386_Op386ANDL(v)
36 return rewriteValue386_Op386ANDLconst(v)
37 case Op386ANDLconstmodify:
38 return rewriteValue386_Op386ANDLconstmodify(v)
40 return rewriteValue386_Op386ANDLload(v)
42 return rewriteValue386_Op386ANDLmodify(v)
44 return rewriteValue386_Op386CMPB(v)
46 return rewriteValue386_Op386CMPBconst(v)
48 return rewriteValue386_Op386CMPBload(v)
50 return rewriteValue386_Op386CMPL(v)
52 return rewriteValue386_Op386CMPLconst(v)
54 return rewriteValue386_Op386CMPLload(v)
56 return rewriteValue386_Op386CMPW(v)
58 return rewriteValue386_Op386CMPWconst(v)
60 return rewriteValue386_Op386CMPWload(v)
62 return rewriteValue386_Op386DIVSD(v)
64 return rewriteValue386_Op386DIVSDload(v)
66 return rewriteValue386_Op386DIVSS(v)
68 return rewriteValue386_Op386DIVSSload(v)
70 return rewriteValue386_Op386LEAL(v)
72 return rewriteValue386_Op386LEAL1(v)
74 return rewriteValue386_Op386LEAL2(v)
76 return rewriteValue386_Op386LEAL4(v)
78 return rewriteValue386_Op386LEAL8(v)
80 return rewriteValue386_Op386MOVBLSX(v)
81 case Op386MOVBLSXload:
82 return rewriteValue386_Op386MOVBLSXload(v)
84 return rewriteValue386_Op386MOVBLZX(v)
86 return rewriteValue386_Op386MOVBload(v)
88 return rewriteValue386_Op386MOVBstore(v)
89 case Op386MOVBstoreconst:
90 return rewriteValue386_Op386MOVBstoreconst(v)
92 return rewriteValue386_Op386MOVLload(v)
94 return rewriteValue386_Op386MOVLstore(v)
95 case Op386MOVLstoreconst:
96 return rewriteValue386_Op386MOVLstoreconst(v)
98 return rewriteValue386_Op386MOVSDconst(v)
100 return rewriteValue386_Op386MOVSDload(v)
101 case Op386MOVSDstore:
102 return rewriteValue386_Op386MOVSDstore(v)
103 case Op386MOVSSconst:
104 return rewriteValue386_Op386MOVSSconst(v)
106 return rewriteValue386_Op386MOVSSload(v)
107 case Op386MOVSSstore:
108 return rewriteValue386_Op386MOVSSstore(v)
110 return rewriteValue386_Op386MOVWLSX(v)
111 case Op386MOVWLSXload:
112 return rewriteValue386_Op386MOVWLSXload(v)
114 return rewriteValue386_Op386MOVWLZX(v)
116 return rewriteValue386_Op386MOVWload(v)
118 return rewriteValue386_Op386MOVWstore(v)
119 case Op386MOVWstoreconst:
120 return rewriteValue386_Op386MOVWstoreconst(v)
122 return rewriteValue386_Op386MULL(v)
124 return rewriteValue386_Op386MULLconst(v)
126 return rewriteValue386_Op386MULLload(v)
128 return rewriteValue386_Op386MULSD(v)
130 return rewriteValue386_Op386MULSDload(v)
132 return rewriteValue386_Op386MULSS(v)
134 return rewriteValue386_Op386MULSSload(v)
136 return rewriteValue386_Op386NEGL(v)
138 return rewriteValue386_Op386NOTL(v)
140 return rewriteValue386_Op386ORL(v)
142 return rewriteValue386_Op386ORLconst(v)
143 case Op386ORLconstmodify:
144 return rewriteValue386_Op386ORLconstmodify(v)
146 return rewriteValue386_Op386ORLload(v)
148 return rewriteValue386_Op386ORLmodify(v)
150 return rewriteValue386_Op386ROLBconst(v)
152 return rewriteValue386_Op386ROLLconst(v)
154 return rewriteValue386_Op386ROLWconst(v)
156 return rewriteValue386_Op386SARB(v)
158 return rewriteValue386_Op386SARBconst(v)
160 return rewriteValue386_Op386SARL(v)
162 return rewriteValue386_Op386SARLconst(v)
164 return rewriteValue386_Op386SARW(v)
166 return rewriteValue386_Op386SARWconst(v)
168 return rewriteValue386_Op386SBBL(v)
169 case Op386SBBLcarrymask:
170 return rewriteValue386_Op386SBBLcarrymask(v)
172 return rewriteValue386_Op386SETA(v)
174 return rewriteValue386_Op386SETAE(v)
176 return rewriteValue386_Op386SETB(v)
178 return rewriteValue386_Op386SETBE(v)
180 return rewriteValue386_Op386SETEQ(v)
182 return rewriteValue386_Op386SETG(v)
184 return rewriteValue386_Op386SETGE(v)
186 return rewriteValue386_Op386SETL(v)
188 return rewriteValue386_Op386SETLE(v)
190 return rewriteValue386_Op386SETNE(v)
192 return rewriteValue386_Op386SHLL(v)
194 return rewriteValue386_Op386SHLLconst(v)
196 return rewriteValue386_Op386SHRB(v)
198 return rewriteValue386_Op386SHRBconst(v)
200 return rewriteValue386_Op386SHRL(v)
202 return rewriteValue386_Op386SHRLconst(v)
204 return rewriteValue386_Op386SHRW(v)
206 return rewriteValue386_Op386SHRWconst(v)
208 return rewriteValue386_Op386SUBL(v)
210 return rewriteValue386_Op386SUBLcarry(v)
212 return rewriteValue386_Op386SUBLconst(v)
214 return rewriteValue386_Op386SUBLload(v)
215 case Op386SUBLmodify:
216 return rewriteValue386_Op386SUBLmodify(v)
218 return rewriteValue386_Op386SUBSD(v)
220 return rewriteValue386_Op386SUBSDload(v)
222 return rewriteValue386_Op386SUBSS(v)
224 return rewriteValue386_Op386SUBSSload(v)
226 return rewriteValue386_Op386XORL(v)
228 return rewriteValue386_Op386XORLconst(v)
229 case Op386XORLconstmodify:
230 return rewriteValue386_Op386XORLconstmodify(v)
232 return rewriteValue386_Op386XORLload(v)
233 case Op386XORLmodify:
234 return rewriteValue386_Op386XORLmodify(v)
245 v.Op = Op386ADDLcarry
247 case OpAdd32withcarry:
260 return rewriteValue386_OpAddr(v)
280 v.Op = Op386CALLclosure
292 return rewriteValue386_OpConst16(v)
294 v.Op = Op386MOVLconst
297 v.Op = Op386MOVSSconst
300 v.Op = Op386MOVSDconst
303 return rewriteValue386_OpConst8(v)
305 return rewriteValue386_OpConstBool(v)
307 return rewriteValue386_OpConstNil(v)
309 return rewriteValue386_OpCtz16(v)
314 v.Op = Op386CVTTSS2SL
326 v.Op = Op386CVTTSD2SL
331 case OpCvtBoolToUint8:
353 return rewriteValue386_OpDiv8(v)
355 return rewriteValue386_OpDiv8u(v)
357 return rewriteValue386_OpEq16(v)
359 return rewriteValue386_OpEq32(v)
361 return rewriteValue386_OpEq32F(v)
363 return rewriteValue386_OpEq64F(v)
365 return rewriteValue386_OpEq8(v)
367 return rewriteValue386_OpEqB(v)
369 return rewriteValue386_OpEqPtr(v)
371 v.Op = Op386LoweredGetCallerPC
374 v.Op = Op386LoweredGetCallerSP
376 case OpGetClosurePtr:
377 v.Op = Op386LoweredGetClosurePtr
380 v.Op = Op386LoweredGetG
389 v.Op = Op386CALLinter
392 return rewriteValue386_OpIsInBounds(v)
394 return rewriteValue386_OpIsNonNil(v)
395 case OpIsSliceInBounds:
396 return rewriteValue386_OpIsSliceInBounds(v)
398 return rewriteValue386_OpLeq16(v)
400 return rewriteValue386_OpLeq16U(v)
402 return rewriteValue386_OpLeq32(v)
404 return rewriteValue386_OpLeq32F(v)
406 return rewriteValue386_OpLeq32U(v)
408 return rewriteValue386_OpLeq64F(v)
410 return rewriteValue386_OpLeq8(v)
412 return rewriteValue386_OpLeq8U(v)
414 return rewriteValue386_OpLess16(v)
416 return rewriteValue386_OpLess16U(v)
418 return rewriteValue386_OpLess32(v)
420 return rewriteValue386_OpLess32F(v)
422 return rewriteValue386_OpLess32U(v)
424 return rewriteValue386_OpLess64F(v)
426 return rewriteValue386_OpLess8(v)
428 return rewriteValue386_OpLess8U(v)
430 return rewriteValue386_OpLoad(v)
432 return rewriteValue386_OpLocalAddr(v)
434 return rewriteValue386_OpLsh16x16(v)
436 return rewriteValue386_OpLsh16x32(v)
438 return rewriteValue386_OpLsh16x64(v)
440 return rewriteValue386_OpLsh16x8(v)
442 return rewriteValue386_OpLsh32x16(v)
444 return rewriteValue386_OpLsh32x32(v)
446 return rewriteValue386_OpLsh32x64(v)
448 return rewriteValue386_OpLsh32x8(v)
450 return rewriteValue386_OpLsh8x16(v)
452 return rewriteValue386_OpLsh8x32(v)
454 return rewriteValue386_OpLsh8x64(v)
456 return rewriteValue386_OpLsh8x8(v)
470 return rewriteValue386_OpMod8(v)
472 return rewriteValue386_OpMod8u(v)
474 return rewriteValue386_OpMove(v)
500 return rewriteValue386_OpNeg32F(v)
502 return rewriteValue386_OpNeg64F(v)
507 return rewriteValue386_OpNeq16(v)
509 return rewriteValue386_OpNeq32(v)
511 return rewriteValue386_OpNeq32F(v)
513 return rewriteValue386_OpNeq64F(v)
515 return rewriteValue386_OpNeq8(v)
517 return rewriteValue386_OpNeqB(v)
519 return rewriteValue386_OpNeqPtr(v)
521 v.Op = Op386LoweredNilCheck
524 return rewriteValue386_OpNot(v)
526 return rewriteValue386_OpOffPtr(v)
540 return rewriteValue386_OpPanicBounds(v)
542 return rewriteValue386_OpPanicExtend(v)
544 return rewriteValue386_OpRotateLeft16(v)
546 return rewriteValue386_OpRotateLeft32(v)
548 return rewriteValue386_OpRotateLeft8(v)
556 return rewriteValue386_OpRsh16Ux16(v)
558 return rewriteValue386_OpRsh16Ux32(v)
560 return rewriteValue386_OpRsh16Ux64(v)
562 return rewriteValue386_OpRsh16Ux8(v)
564 return rewriteValue386_OpRsh16x16(v)
566 return rewriteValue386_OpRsh16x32(v)
568 return rewriteValue386_OpRsh16x64(v)
570 return rewriteValue386_OpRsh16x8(v)
572 return rewriteValue386_OpRsh32Ux16(v)
574 return rewriteValue386_OpRsh32Ux32(v)
576 return rewriteValue386_OpRsh32Ux64(v)
578 return rewriteValue386_OpRsh32Ux8(v)
580 return rewriteValue386_OpRsh32x16(v)
582 return rewriteValue386_OpRsh32x32(v)
584 return rewriteValue386_OpRsh32x64(v)
586 return rewriteValue386_OpRsh32x8(v)
588 return rewriteValue386_OpRsh8Ux16(v)
590 return rewriteValue386_OpRsh8Ux32(v)
592 return rewriteValue386_OpRsh8Ux64(v)
594 return rewriteValue386_OpRsh8Ux8(v)
596 return rewriteValue386_OpRsh8x16(v)
598 return rewriteValue386_OpRsh8x32(v)
600 return rewriteValue386_OpRsh8x64(v)
602 return rewriteValue386_OpRsh8x8(v)
604 return rewriteValue386_OpSelect0(v)
606 return rewriteValue386_OpSelect1(v)
607 case OpSignExt16to32:
617 return rewriteValue386_OpSignmask(v)
619 return rewriteValue386_OpSlicemask(v)
627 v.Op = Op386CALLstatic
630 return rewriteValue386_OpStore(v)
641 v.Op = Op386SUBLcarry
643 case OpSub32withcarry:
665 v.Op = Op386LoweredWB
677 return rewriteValue386_OpZero(v)
678 case OpZeroExt16to32:
688 return rewriteValue386_OpZeromask(v)
692 func rewriteValue386_Op386ADCL(v *Value) bool {
696 // match: (ADCL x (MOVLconst [c]) f)
697 // result: (ADCLconst [c] x f)
699 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
701 if v_1.Op != Op386MOVLconst {
704 c := auxIntToInt32(v_1.AuxInt)
706 v.reset(Op386ADCLconst)
707 v.AuxInt = int32ToAuxInt(c)
715 func rewriteValue386_Op386ADDL(v *Value) bool {
718 // match: (ADDL x (MOVLconst [c]))
719 // result: (ADDLconst [c] x)
721 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
723 if v_1.Op != Op386MOVLconst {
726 c := auxIntToInt32(v_1.AuxInt)
727 v.reset(Op386ADDLconst)
728 v.AuxInt = int32ToAuxInt(c)
734 // match: (ADDL (SHLLconst [c] x) (SHRLconst [d] x))
736 // result: (ROLLconst [c] x)
738 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
739 if v_0.Op != Op386SHLLconst {
742 c := auxIntToInt32(v_0.AuxInt)
744 if v_1.Op != Op386SHRLconst {
747 d := auxIntToInt32(v_1.AuxInt)
748 if x != v_1.Args[0] || !(d == 32-c) {
751 v.reset(Op386ROLLconst)
752 v.AuxInt = int32ToAuxInt(c)
758 // match: (ADDL <t> (SHLLconst x [c]) (SHRWconst x [d]))
759 // cond: c < 16 && d == int16(16-c) && t.Size() == 2
760 // result: (ROLWconst x [int16(c)])
763 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
764 if v_0.Op != Op386SHLLconst {
767 c := auxIntToInt32(v_0.AuxInt)
769 if v_1.Op != Op386SHRWconst {
772 d := auxIntToInt16(v_1.AuxInt)
773 if x != v_1.Args[0] || !(c < 16 && d == int16(16-c) && t.Size() == 2) {
776 v.reset(Op386ROLWconst)
777 v.AuxInt = int16ToAuxInt(int16(c))
783 // match: (ADDL <t> (SHLLconst x [c]) (SHRBconst x [d]))
784 // cond: c < 8 && d == int8(8-c) && t.Size() == 1
785 // result: (ROLBconst x [int8(c)])
788 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
789 if v_0.Op != Op386SHLLconst {
792 c := auxIntToInt32(v_0.AuxInt)
794 if v_1.Op != Op386SHRBconst {
797 d := auxIntToInt8(v_1.AuxInt)
798 if x != v_1.Args[0] || !(c < 8 && d == int8(8-c) && t.Size() == 1) {
801 v.reset(Op386ROLBconst)
802 v.AuxInt = int8ToAuxInt(int8(c))
808 // match: (ADDL x (SHLLconst [3] y))
809 // result: (LEAL8 x y)
811 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
813 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 3 {
823 // match: (ADDL x (SHLLconst [2] y))
824 // result: (LEAL4 x y)
826 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
828 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 2 {
838 // match: (ADDL x (SHLLconst [1] y))
839 // result: (LEAL2 x y)
841 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
843 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 1 {
853 // match: (ADDL x (ADDL y y))
854 // result: (LEAL2 x y)
856 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
858 if v_1.Op != Op386ADDL {
862 if y != v_1.Args[0] {
871 // match: (ADDL x (ADDL x y))
872 // result: (LEAL2 y x)
874 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
876 if v_1.Op != Op386ADDL {
882 for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
894 // match: (ADDL (ADDLconst [c] x) y)
895 // result: (LEAL1 [c] x y)
897 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
898 if v_0.Op != Op386ADDLconst {
901 c := auxIntToInt32(v_0.AuxInt)
905 v.AuxInt = int32ToAuxInt(c)
911 // match: (ADDL x (LEAL [c] {s} y))
912 // cond: x.Op != OpSB && y.Op != OpSB
913 // result: (LEAL1 [c] {s} x y)
915 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
917 if v_1.Op != Op386LEAL {
920 c := auxIntToInt32(v_1.AuxInt)
921 s := auxToSym(v_1.Aux)
923 if !(x.Op != OpSB && y.Op != OpSB) {
927 v.AuxInt = int32ToAuxInt(c)
934 // match: (ADDL x l:(MOVLload [off] {sym} ptr mem))
935 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
936 // result: (ADDLload x [off] {sym} ptr mem)
938 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
941 if l.Op != Op386MOVLload {
944 off := auxIntToInt32(l.AuxInt)
945 sym := auxToSym(l.Aux)
948 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
951 v.reset(Op386ADDLload)
952 v.AuxInt = int32ToAuxInt(off)
953 v.Aux = symToAux(sym)
954 v.AddArg3(x, ptr, mem)
959 // match: (ADDL x (NEGL y))
960 // result: (SUBL x y)
962 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
964 if v_1.Op != Op386NEGL {
976 func rewriteValue386_Op386ADDLcarry(v *Value) bool {
979 // match: (ADDLcarry x (MOVLconst [c]))
980 // result: (ADDLconstcarry [c] x)
982 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
984 if v_1.Op != Op386MOVLconst {
987 c := auxIntToInt32(v_1.AuxInt)
988 v.reset(Op386ADDLconstcarry)
989 v.AuxInt = int32ToAuxInt(c)
997 func rewriteValue386_Op386ADDLconst(v *Value) bool {
999 // match: (ADDLconst [c] (ADDL x y))
1000 // result: (LEAL1 [c] x y)
1002 c := auxIntToInt32(v.AuxInt)
1003 if v_0.Op != Op386ADDL {
1009 v.AuxInt = int32ToAuxInt(c)
1013 // match: (ADDLconst [c] (LEAL [d] {s} x))
1014 // cond: is32Bit(int64(c)+int64(d))
1015 // result: (LEAL [c+d] {s} x)
1017 c := auxIntToInt32(v.AuxInt)
1018 if v_0.Op != Op386LEAL {
1021 d := auxIntToInt32(v_0.AuxInt)
1022 s := auxToSym(v_0.Aux)
1024 if !(is32Bit(int64(c) + int64(d))) {
1028 v.AuxInt = int32ToAuxInt(c + d)
1033 // match: (ADDLconst [c] x:(SP))
1034 // result: (LEAL [c] x)
1036 c := auxIntToInt32(v.AuxInt)
1042 v.AuxInt = int32ToAuxInt(c)
1046 // match: (ADDLconst [c] (LEAL1 [d] {s} x y))
1047 // cond: is32Bit(int64(c)+int64(d))
1048 // result: (LEAL1 [c+d] {s} x y)
1050 c := auxIntToInt32(v.AuxInt)
1051 if v_0.Op != Op386LEAL1 {
1054 d := auxIntToInt32(v_0.AuxInt)
1055 s := auxToSym(v_0.Aux)
1058 if !(is32Bit(int64(c) + int64(d))) {
1062 v.AuxInt = int32ToAuxInt(c + d)
1067 // match: (ADDLconst [c] (LEAL2 [d] {s} x y))
1068 // cond: is32Bit(int64(c)+int64(d))
1069 // result: (LEAL2 [c+d] {s} x y)
1071 c := auxIntToInt32(v.AuxInt)
1072 if v_0.Op != Op386LEAL2 {
1075 d := auxIntToInt32(v_0.AuxInt)
1076 s := auxToSym(v_0.Aux)
1079 if !(is32Bit(int64(c) + int64(d))) {
1083 v.AuxInt = int32ToAuxInt(c + d)
1088 // match: (ADDLconst [c] (LEAL4 [d] {s} x y))
1089 // cond: is32Bit(int64(c)+int64(d))
1090 // result: (LEAL4 [c+d] {s} x y)
1092 c := auxIntToInt32(v.AuxInt)
1093 if v_0.Op != Op386LEAL4 {
1096 d := auxIntToInt32(v_0.AuxInt)
1097 s := auxToSym(v_0.Aux)
1100 if !(is32Bit(int64(c) + int64(d))) {
1104 v.AuxInt = int32ToAuxInt(c + d)
1109 // match: (ADDLconst [c] (LEAL8 [d] {s} x y))
1110 // cond: is32Bit(int64(c)+int64(d))
1111 // result: (LEAL8 [c+d] {s} x y)
1113 c := auxIntToInt32(v.AuxInt)
1114 if v_0.Op != Op386LEAL8 {
1117 d := auxIntToInt32(v_0.AuxInt)
1118 s := auxToSym(v_0.Aux)
1121 if !(is32Bit(int64(c) + int64(d))) {
1125 v.AuxInt = int32ToAuxInt(c + d)
1130 // match: (ADDLconst [c] x)
1134 c := auxIntToInt32(v.AuxInt)
1142 // match: (ADDLconst [c] (MOVLconst [d]))
1143 // result: (MOVLconst [c+d])
1145 c := auxIntToInt32(v.AuxInt)
1146 if v_0.Op != Op386MOVLconst {
1149 d := auxIntToInt32(v_0.AuxInt)
1150 v.reset(Op386MOVLconst)
1151 v.AuxInt = int32ToAuxInt(c + d)
1154 // match: (ADDLconst [c] (ADDLconst [d] x))
1155 // result: (ADDLconst [c+d] x)
1157 c := auxIntToInt32(v.AuxInt)
1158 if v_0.Op != Op386ADDLconst {
1161 d := auxIntToInt32(v_0.AuxInt)
1163 v.reset(Op386ADDLconst)
1164 v.AuxInt = int32ToAuxInt(c + d)
1170 func rewriteValue386_Op386ADDLconstmodify(v *Value) bool {
1174 config := b.Func.Config
1175 // match: (ADDLconstmodify [valoff1] {sym} (ADDLconst [off2] base) mem)
1176 // cond: valoff1.canAdd32(off2)
1177 // result: (ADDLconstmodify [valoff1.addOffset32(off2)] {sym} base mem)
1179 valoff1 := auxIntToValAndOff(v.AuxInt)
1180 sym := auxToSym(v.Aux)
1181 if v_0.Op != Op386ADDLconst {
1184 off2 := auxIntToInt32(v_0.AuxInt)
1187 if !(valoff1.canAdd32(off2)) {
1190 v.reset(Op386ADDLconstmodify)
1191 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
1192 v.Aux = symToAux(sym)
1193 v.AddArg2(base, mem)
1196 // match: (ADDLconstmodify [valoff1] {sym1} (LEAL [off2] {sym2} base) mem)
1197 // cond: valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
1198 // result: (ADDLconstmodify [valoff1.addOffset32(off2)] {mergeSym(sym1,sym2)} base mem)
1200 valoff1 := auxIntToValAndOff(v.AuxInt)
1201 sym1 := auxToSym(v.Aux)
1202 if v_0.Op != Op386LEAL {
1205 off2 := auxIntToInt32(v_0.AuxInt)
1206 sym2 := auxToSym(v_0.Aux)
1209 if !(valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1212 v.reset(Op386ADDLconstmodify)
1213 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
1214 v.Aux = symToAux(mergeSym(sym1, sym2))
1215 v.AddArg2(base, mem)
1220 func rewriteValue386_Op386ADDLload(v *Value) bool {
1225 config := b.Func.Config
1226 // match: (ADDLload [off1] {sym} val (ADDLconst [off2] base) mem)
1227 // cond: is32Bit(int64(off1)+int64(off2))
1228 // result: (ADDLload [off1+off2] {sym} val base mem)
1230 off1 := auxIntToInt32(v.AuxInt)
1231 sym := auxToSym(v.Aux)
1233 if v_1.Op != Op386ADDLconst {
1236 off2 := auxIntToInt32(v_1.AuxInt)
1239 if !(is32Bit(int64(off1) + int64(off2))) {
1242 v.reset(Op386ADDLload)
1243 v.AuxInt = int32ToAuxInt(off1 + off2)
1244 v.Aux = symToAux(sym)
1245 v.AddArg3(val, base, mem)
1248 // match: (ADDLload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
1249 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
1250 // result: (ADDLload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
1252 off1 := auxIntToInt32(v.AuxInt)
1253 sym1 := auxToSym(v.Aux)
1255 if v_1.Op != Op386LEAL {
1258 off2 := auxIntToInt32(v_1.AuxInt)
1259 sym2 := auxToSym(v_1.Aux)
1262 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1265 v.reset(Op386ADDLload)
1266 v.AuxInt = int32ToAuxInt(off1 + off2)
1267 v.Aux = symToAux(mergeSym(sym1, sym2))
1268 v.AddArg3(val, base, mem)
1273 func rewriteValue386_Op386ADDLmodify(v *Value) bool {
1278 config := b.Func.Config
1279 // match: (ADDLmodify [off1] {sym} (ADDLconst [off2] base) val mem)
1280 // cond: is32Bit(int64(off1)+int64(off2))
1281 // result: (ADDLmodify [off1+off2] {sym} base val mem)
1283 off1 := auxIntToInt32(v.AuxInt)
1284 sym := auxToSym(v.Aux)
1285 if v_0.Op != Op386ADDLconst {
1288 off2 := auxIntToInt32(v_0.AuxInt)
1292 if !(is32Bit(int64(off1) + int64(off2))) {
1295 v.reset(Op386ADDLmodify)
1296 v.AuxInt = int32ToAuxInt(off1 + off2)
1297 v.Aux = symToAux(sym)
1298 v.AddArg3(base, val, mem)
1301 // match: (ADDLmodify [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
1302 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
1303 // result: (ADDLmodify [off1+off2] {mergeSym(sym1,sym2)} base val mem)
1305 off1 := auxIntToInt32(v.AuxInt)
1306 sym1 := auxToSym(v.Aux)
1307 if v_0.Op != Op386LEAL {
1310 off2 := auxIntToInt32(v_0.AuxInt)
1311 sym2 := auxToSym(v_0.Aux)
1315 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1318 v.reset(Op386ADDLmodify)
1319 v.AuxInt = int32ToAuxInt(off1 + off2)
1320 v.Aux = symToAux(mergeSym(sym1, sym2))
1321 v.AddArg3(base, val, mem)
1326 func rewriteValue386_Op386ADDSD(v *Value) bool {
1329 // match: (ADDSD x l:(MOVSDload [off] {sym} ptr mem))
1330 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
1331 // result: (ADDSDload x [off] {sym} ptr mem)
1333 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1336 if l.Op != Op386MOVSDload {
1339 off := auxIntToInt32(l.AuxInt)
1340 sym := auxToSym(l.Aux)
1343 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
1346 v.reset(Op386ADDSDload)
1347 v.AuxInt = int32ToAuxInt(off)
1348 v.Aux = symToAux(sym)
1349 v.AddArg3(x, ptr, mem)
1356 func rewriteValue386_Op386ADDSDload(v *Value) bool {
1361 config := b.Func.Config
1362 // match: (ADDSDload [off1] {sym} val (ADDLconst [off2] base) mem)
1363 // cond: is32Bit(int64(off1)+int64(off2))
1364 // result: (ADDSDload [off1+off2] {sym} val base mem)
1366 off1 := auxIntToInt32(v.AuxInt)
1367 sym := auxToSym(v.Aux)
1369 if v_1.Op != Op386ADDLconst {
1372 off2 := auxIntToInt32(v_1.AuxInt)
1375 if !(is32Bit(int64(off1) + int64(off2))) {
1378 v.reset(Op386ADDSDload)
1379 v.AuxInt = int32ToAuxInt(off1 + off2)
1380 v.Aux = symToAux(sym)
1381 v.AddArg3(val, base, mem)
1384 // match: (ADDSDload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
1385 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
1386 // result: (ADDSDload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
1388 off1 := auxIntToInt32(v.AuxInt)
1389 sym1 := auxToSym(v.Aux)
1391 if v_1.Op != Op386LEAL {
1394 off2 := auxIntToInt32(v_1.AuxInt)
1395 sym2 := auxToSym(v_1.Aux)
1398 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1401 v.reset(Op386ADDSDload)
1402 v.AuxInt = int32ToAuxInt(off1 + off2)
1403 v.Aux = symToAux(mergeSym(sym1, sym2))
1404 v.AddArg3(val, base, mem)
1409 func rewriteValue386_Op386ADDSS(v *Value) bool {
1412 // match: (ADDSS x l:(MOVSSload [off] {sym} ptr mem))
1413 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
1414 // result: (ADDSSload x [off] {sym} ptr mem)
1416 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1419 if l.Op != Op386MOVSSload {
1422 off := auxIntToInt32(l.AuxInt)
1423 sym := auxToSym(l.Aux)
1426 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
1429 v.reset(Op386ADDSSload)
1430 v.AuxInt = int32ToAuxInt(off)
1431 v.Aux = symToAux(sym)
1432 v.AddArg3(x, ptr, mem)
1439 func rewriteValue386_Op386ADDSSload(v *Value) bool {
1444 config := b.Func.Config
1445 // match: (ADDSSload [off1] {sym} val (ADDLconst [off2] base) mem)
1446 // cond: is32Bit(int64(off1)+int64(off2))
1447 // result: (ADDSSload [off1+off2] {sym} val base mem)
1449 off1 := auxIntToInt32(v.AuxInt)
1450 sym := auxToSym(v.Aux)
1452 if v_1.Op != Op386ADDLconst {
1455 off2 := auxIntToInt32(v_1.AuxInt)
1458 if !(is32Bit(int64(off1) + int64(off2))) {
1461 v.reset(Op386ADDSSload)
1462 v.AuxInt = int32ToAuxInt(off1 + off2)
1463 v.Aux = symToAux(sym)
1464 v.AddArg3(val, base, mem)
1467 // match: (ADDSSload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
1468 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
1469 // result: (ADDSSload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
1471 off1 := auxIntToInt32(v.AuxInt)
1472 sym1 := auxToSym(v.Aux)
1474 if v_1.Op != Op386LEAL {
1477 off2 := auxIntToInt32(v_1.AuxInt)
1478 sym2 := auxToSym(v_1.Aux)
1481 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1484 v.reset(Op386ADDSSload)
1485 v.AuxInt = int32ToAuxInt(off1 + off2)
1486 v.Aux = symToAux(mergeSym(sym1, sym2))
1487 v.AddArg3(val, base, mem)
1492 func rewriteValue386_Op386ANDL(v *Value) bool {
1495 // match: (ANDL x (MOVLconst [c]))
1496 // result: (ANDLconst [c] x)
1498 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1500 if v_1.Op != Op386MOVLconst {
1503 c := auxIntToInt32(v_1.AuxInt)
1504 v.reset(Op386ANDLconst)
1505 v.AuxInt = int32ToAuxInt(c)
1511 // match: (ANDL x l:(MOVLload [off] {sym} ptr mem))
1512 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
1513 // result: (ANDLload x [off] {sym} ptr mem)
1515 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
1518 if l.Op != Op386MOVLload {
1521 off := auxIntToInt32(l.AuxInt)
1522 sym := auxToSym(l.Aux)
1525 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
1528 v.reset(Op386ANDLload)
1529 v.AuxInt = int32ToAuxInt(off)
1530 v.Aux = symToAux(sym)
1531 v.AddArg3(x, ptr, mem)
1536 // match: (ANDL x x)
1548 func rewriteValue386_Op386ANDLconst(v *Value) bool {
1550 // match: (ANDLconst [c] (ANDLconst [d] x))
1551 // result: (ANDLconst [c & d] x)
1553 c := auxIntToInt32(v.AuxInt)
1554 if v_0.Op != Op386ANDLconst {
1557 d := auxIntToInt32(v_0.AuxInt)
1559 v.reset(Op386ANDLconst)
1560 v.AuxInt = int32ToAuxInt(c & d)
1564 // match: (ANDLconst [c] _)
1566 // result: (MOVLconst [0])
1568 c := auxIntToInt32(v.AuxInt)
1572 v.reset(Op386MOVLconst)
1573 v.AuxInt = int32ToAuxInt(0)
1576 // match: (ANDLconst [c] x)
1580 c := auxIntToInt32(v.AuxInt)
1588 // match: (ANDLconst [c] (MOVLconst [d]))
1589 // result: (MOVLconst [c&d])
1591 c := auxIntToInt32(v.AuxInt)
1592 if v_0.Op != Op386MOVLconst {
1595 d := auxIntToInt32(v_0.AuxInt)
1596 v.reset(Op386MOVLconst)
1597 v.AuxInt = int32ToAuxInt(c & d)
1602 func rewriteValue386_Op386ANDLconstmodify(v *Value) bool {
1606 config := b.Func.Config
1607 // match: (ANDLconstmodify [valoff1] {sym} (ADDLconst [off2] base) mem)
1608 // cond: valoff1.canAdd32(off2)
1609 // result: (ANDLconstmodify [valoff1.addOffset32(off2)] {sym} base mem)
1611 valoff1 := auxIntToValAndOff(v.AuxInt)
1612 sym := auxToSym(v.Aux)
1613 if v_0.Op != Op386ADDLconst {
1616 off2 := auxIntToInt32(v_0.AuxInt)
1619 if !(valoff1.canAdd32(off2)) {
1622 v.reset(Op386ANDLconstmodify)
1623 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
1624 v.Aux = symToAux(sym)
1625 v.AddArg2(base, mem)
1628 // match: (ANDLconstmodify [valoff1] {sym1} (LEAL [off2] {sym2} base) mem)
1629 // cond: valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
1630 // result: (ANDLconstmodify [valoff1.addOffset32(off2)] {mergeSym(sym1,sym2)} base mem)
1632 valoff1 := auxIntToValAndOff(v.AuxInt)
1633 sym1 := auxToSym(v.Aux)
1634 if v_0.Op != Op386LEAL {
1637 off2 := auxIntToInt32(v_0.AuxInt)
1638 sym2 := auxToSym(v_0.Aux)
1641 if !(valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1644 v.reset(Op386ANDLconstmodify)
1645 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
1646 v.Aux = symToAux(mergeSym(sym1, sym2))
1647 v.AddArg2(base, mem)
1652 func rewriteValue386_Op386ANDLload(v *Value) bool {
1657 config := b.Func.Config
1658 // match: (ANDLload [off1] {sym} val (ADDLconst [off2] base) mem)
1659 // cond: is32Bit(int64(off1)+int64(off2))
1660 // result: (ANDLload [off1+off2] {sym} val base mem)
1662 off1 := auxIntToInt32(v.AuxInt)
1663 sym := auxToSym(v.Aux)
1665 if v_1.Op != Op386ADDLconst {
1668 off2 := auxIntToInt32(v_1.AuxInt)
1671 if !(is32Bit(int64(off1) + int64(off2))) {
1674 v.reset(Op386ANDLload)
1675 v.AuxInt = int32ToAuxInt(off1 + off2)
1676 v.Aux = symToAux(sym)
1677 v.AddArg3(val, base, mem)
1680 // match: (ANDLload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
1681 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
1682 // result: (ANDLload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
1684 off1 := auxIntToInt32(v.AuxInt)
1685 sym1 := auxToSym(v.Aux)
1687 if v_1.Op != Op386LEAL {
1690 off2 := auxIntToInt32(v_1.AuxInt)
1691 sym2 := auxToSym(v_1.Aux)
1694 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1697 v.reset(Op386ANDLload)
1698 v.AuxInt = int32ToAuxInt(off1 + off2)
1699 v.Aux = symToAux(mergeSym(sym1, sym2))
1700 v.AddArg3(val, base, mem)
1705 func rewriteValue386_Op386ANDLmodify(v *Value) bool {
1710 config := b.Func.Config
1711 // match: (ANDLmodify [off1] {sym} (ADDLconst [off2] base) val mem)
1712 // cond: is32Bit(int64(off1)+int64(off2))
1713 // result: (ANDLmodify [off1+off2] {sym} base val mem)
1715 off1 := auxIntToInt32(v.AuxInt)
1716 sym := auxToSym(v.Aux)
1717 if v_0.Op != Op386ADDLconst {
1720 off2 := auxIntToInt32(v_0.AuxInt)
1724 if !(is32Bit(int64(off1) + int64(off2))) {
1727 v.reset(Op386ANDLmodify)
1728 v.AuxInt = int32ToAuxInt(off1 + off2)
1729 v.Aux = symToAux(sym)
1730 v.AddArg3(base, val, mem)
1733 // match: (ANDLmodify [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
1734 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
1735 // result: (ANDLmodify [off1+off2] {mergeSym(sym1,sym2)} base val mem)
1737 off1 := auxIntToInt32(v.AuxInt)
1738 sym1 := auxToSym(v.Aux)
1739 if v_0.Op != Op386LEAL {
1742 off2 := auxIntToInt32(v_0.AuxInt)
1743 sym2 := auxToSym(v_0.Aux)
1747 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
1750 v.reset(Op386ANDLmodify)
1751 v.AuxInt = int32ToAuxInt(off1 + off2)
1752 v.Aux = symToAux(mergeSym(sym1, sym2))
1753 v.AddArg3(base, val, mem)
1758 func rewriteValue386_Op386CMPB(v *Value) bool {
1762 // match: (CMPB x (MOVLconst [c]))
1763 // result: (CMPBconst x [int8(c)])
1766 if v_1.Op != Op386MOVLconst {
1769 c := auxIntToInt32(v_1.AuxInt)
1770 v.reset(Op386CMPBconst)
1771 v.AuxInt = int8ToAuxInt(int8(c))
1775 // match: (CMPB (MOVLconst [c]) x)
1776 // result: (InvertFlags (CMPBconst x [int8(c)]))
1778 if v_0.Op != Op386MOVLconst {
1781 c := auxIntToInt32(v_0.AuxInt)
1783 v.reset(Op386InvertFlags)
1784 v0 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
1785 v0.AuxInt = int8ToAuxInt(int8(c))
1790 // match: (CMPB x y)
1791 // cond: canonLessThan(x,y)
1792 // result: (InvertFlags (CMPB y x))
1796 if !(canonLessThan(x, y)) {
1799 v.reset(Op386InvertFlags)
1800 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
1805 // match: (CMPB l:(MOVBload {sym} [off] ptr mem) x)
1806 // cond: canMergeLoad(v, l) && clobber(l)
1807 // result: (CMPBload {sym} [off] ptr x mem)
1810 if l.Op != Op386MOVBload {
1813 off := auxIntToInt32(l.AuxInt)
1814 sym := auxToSym(l.Aux)
1818 if !(canMergeLoad(v, l) && clobber(l)) {
1821 v.reset(Op386CMPBload)
1822 v.AuxInt = int32ToAuxInt(off)
1823 v.Aux = symToAux(sym)
1824 v.AddArg3(ptr, x, mem)
1827 // match: (CMPB x l:(MOVBload {sym} [off] ptr mem))
1828 // cond: canMergeLoad(v, l) && clobber(l)
1829 // result: (InvertFlags (CMPBload {sym} [off] ptr x mem))
1833 if l.Op != Op386MOVBload {
1836 off := auxIntToInt32(l.AuxInt)
1837 sym := auxToSym(l.Aux)
1840 if !(canMergeLoad(v, l) && clobber(l)) {
1843 v.reset(Op386InvertFlags)
1844 v0 := b.NewValue0(l.Pos, Op386CMPBload, types.TypeFlags)
1845 v0.AuxInt = int32ToAuxInt(off)
1846 v0.Aux = symToAux(sym)
1847 v0.AddArg3(ptr, x, mem)
1853 func rewriteValue386_Op386CMPBconst(v *Value) bool {
1856 // match: (CMPBconst (MOVLconst [x]) [y])
1860 y := auxIntToInt8(v.AuxInt)
1861 if v_0.Op != Op386MOVLconst {
1864 x := auxIntToInt32(v_0.AuxInt)
1865 if !(int8(x) == y) {
1868 v.reset(Op386FlagEQ)
1871 // match: (CMPBconst (MOVLconst [x]) [y])
1872 // cond: int8(x)<y && uint8(x)<uint8(y)
1873 // result: (FlagLT_ULT)
1875 y := auxIntToInt8(v.AuxInt)
1876 if v_0.Op != Op386MOVLconst {
1879 x := auxIntToInt32(v_0.AuxInt)
1880 if !(int8(x) < y && uint8(x) < uint8(y)) {
1883 v.reset(Op386FlagLT_ULT)
1886 // match: (CMPBconst (MOVLconst [x]) [y])
1887 // cond: int8(x)<y && uint8(x)>uint8(y)
1888 // result: (FlagLT_UGT)
1890 y := auxIntToInt8(v.AuxInt)
1891 if v_0.Op != Op386MOVLconst {
1894 x := auxIntToInt32(v_0.AuxInt)
1895 if !(int8(x) < y && uint8(x) > uint8(y)) {
1898 v.reset(Op386FlagLT_UGT)
1901 // match: (CMPBconst (MOVLconst [x]) [y])
1902 // cond: int8(x)>y && uint8(x)<uint8(y)
1903 // result: (FlagGT_ULT)
1905 y := auxIntToInt8(v.AuxInt)
1906 if v_0.Op != Op386MOVLconst {
1909 x := auxIntToInt32(v_0.AuxInt)
1910 if !(int8(x) > y && uint8(x) < uint8(y)) {
1913 v.reset(Op386FlagGT_ULT)
1916 // match: (CMPBconst (MOVLconst [x]) [y])
1917 // cond: int8(x)>y && uint8(x)>uint8(y)
1918 // result: (FlagGT_UGT)
1920 y := auxIntToInt8(v.AuxInt)
1921 if v_0.Op != Op386MOVLconst {
1924 x := auxIntToInt32(v_0.AuxInt)
1925 if !(int8(x) > y && uint8(x) > uint8(y)) {
1928 v.reset(Op386FlagGT_UGT)
1931 // match: (CMPBconst (ANDLconst _ [m]) [n])
1932 // cond: 0 <= int8(m) && int8(m) < n
1933 // result: (FlagLT_ULT)
1935 n := auxIntToInt8(v.AuxInt)
1936 if v_0.Op != Op386ANDLconst {
1939 m := auxIntToInt32(v_0.AuxInt)
1940 if !(0 <= int8(m) && int8(m) < n) {
1943 v.reset(Op386FlagLT_ULT)
1946 // match: (CMPBconst l:(ANDL x y) [0])
1948 // result: (TESTB x y)
1950 if auxIntToInt8(v.AuxInt) != 0 {
1954 if l.Op != Op386ANDL {
1966 // match: (CMPBconst l:(ANDLconst [c] x) [0])
1968 // result: (TESTBconst [int8(c)] x)
1970 if auxIntToInt8(v.AuxInt) != 0 {
1974 if l.Op != Op386ANDLconst {
1977 c := auxIntToInt32(l.AuxInt)
1982 v.reset(Op386TESTBconst)
1983 v.AuxInt = int8ToAuxInt(int8(c))
1987 // match: (CMPBconst x [0])
1988 // result: (TESTB x x)
1990 if auxIntToInt8(v.AuxInt) != 0 {
1998 // match: (CMPBconst l:(MOVBload {sym} [off] ptr mem) [c])
1999 // cond: l.Uses == 1 && clobber(l)
2000 // result: @l.Block (CMPBconstload {sym} [makeValAndOff(int32(c),off)] ptr mem)
2002 c := auxIntToInt8(v.AuxInt)
2004 if l.Op != Op386MOVBload {
2007 off := auxIntToInt32(l.AuxInt)
2008 sym := auxToSym(l.Aux)
2011 if !(l.Uses == 1 && clobber(l)) {
2015 v0 := b.NewValue0(l.Pos, Op386CMPBconstload, types.TypeFlags)
2017 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(int32(c), off))
2018 v0.Aux = symToAux(sym)
2019 v0.AddArg2(ptr, mem)
2024 func rewriteValue386_Op386CMPBload(v *Value) bool {
2028 // match: (CMPBload {sym} [off] ptr (MOVLconst [c]) mem)
2029 // result: (CMPBconstload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
2031 off := auxIntToInt32(v.AuxInt)
2032 sym := auxToSym(v.Aux)
2034 if v_1.Op != Op386MOVLconst {
2037 c := auxIntToInt32(v_1.AuxInt)
2039 v.reset(Op386CMPBconstload)
2040 v.AuxInt = valAndOffToAuxInt(makeValAndOff(int32(int8(c)), off))
2041 v.Aux = symToAux(sym)
2047 func rewriteValue386_Op386CMPL(v *Value) bool {
2051 // match: (CMPL x (MOVLconst [c]))
2052 // result: (CMPLconst x [c])
2055 if v_1.Op != Op386MOVLconst {
2058 c := auxIntToInt32(v_1.AuxInt)
2059 v.reset(Op386CMPLconst)
2060 v.AuxInt = int32ToAuxInt(c)
2064 // match: (CMPL (MOVLconst [c]) x)
2065 // result: (InvertFlags (CMPLconst x [c]))
2067 if v_0.Op != Op386MOVLconst {
2070 c := auxIntToInt32(v_0.AuxInt)
2072 v.reset(Op386InvertFlags)
2073 v0 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
2074 v0.AuxInt = int32ToAuxInt(c)
2079 // match: (CMPL x y)
2080 // cond: canonLessThan(x,y)
2081 // result: (InvertFlags (CMPL y x))
2085 if !(canonLessThan(x, y)) {
2088 v.reset(Op386InvertFlags)
2089 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
2094 // match: (CMPL l:(MOVLload {sym} [off] ptr mem) x)
2095 // cond: canMergeLoad(v, l) && clobber(l)
2096 // result: (CMPLload {sym} [off] ptr x mem)
2099 if l.Op != Op386MOVLload {
2102 off := auxIntToInt32(l.AuxInt)
2103 sym := auxToSym(l.Aux)
2107 if !(canMergeLoad(v, l) && clobber(l)) {
2110 v.reset(Op386CMPLload)
2111 v.AuxInt = int32ToAuxInt(off)
2112 v.Aux = symToAux(sym)
2113 v.AddArg3(ptr, x, mem)
2116 // match: (CMPL x l:(MOVLload {sym} [off] ptr mem))
2117 // cond: canMergeLoad(v, l) && clobber(l)
2118 // result: (InvertFlags (CMPLload {sym} [off] ptr x mem))
2122 if l.Op != Op386MOVLload {
2125 off := auxIntToInt32(l.AuxInt)
2126 sym := auxToSym(l.Aux)
2129 if !(canMergeLoad(v, l) && clobber(l)) {
2132 v.reset(Op386InvertFlags)
2133 v0 := b.NewValue0(l.Pos, Op386CMPLload, types.TypeFlags)
2134 v0.AuxInt = int32ToAuxInt(off)
2135 v0.Aux = symToAux(sym)
2136 v0.AddArg3(ptr, x, mem)
2142 func rewriteValue386_Op386CMPLconst(v *Value) bool {
2145 // match: (CMPLconst (MOVLconst [x]) [y])
2149 y := auxIntToInt32(v.AuxInt)
2150 if v_0.Op != Op386MOVLconst {
2153 x := auxIntToInt32(v_0.AuxInt)
2157 v.reset(Op386FlagEQ)
2160 // match: (CMPLconst (MOVLconst [x]) [y])
2161 // cond: x<y && uint32(x)<uint32(y)
2162 // result: (FlagLT_ULT)
2164 y := auxIntToInt32(v.AuxInt)
2165 if v_0.Op != Op386MOVLconst {
2168 x := auxIntToInt32(v_0.AuxInt)
2169 if !(x < y && uint32(x) < uint32(y)) {
2172 v.reset(Op386FlagLT_ULT)
2175 // match: (CMPLconst (MOVLconst [x]) [y])
2176 // cond: x<y && uint32(x)>uint32(y)
2177 // result: (FlagLT_UGT)
2179 y := auxIntToInt32(v.AuxInt)
2180 if v_0.Op != Op386MOVLconst {
2183 x := auxIntToInt32(v_0.AuxInt)
2184 if !(x < y && uint32(x) > uint32(y)) {
2187 v.reset(Op386FlagLT_UGT)
2190 // match: (CMPLconst (MOVLconst [x]) [y])
2191 // cond: x>y && uint32(x)<uint32(y)
2192 // result: (FlagGT_ULT)
2194 y := auxIntToInt32(v.AuxInt)
2195 if v_0.Op != Op386MOVLconst {
2198 x := auxIntToInt32(v_0.AuxInt)
2199 if !(x > y && uint32(x) < uint32(y)) {
2202 v.reset(Op386FlagGT_ULT)
2205 // match: (CMPLconst (MOVLconst [x]) [y])
2206 // cond: x>y && uint32(x)>uint32(y)
2207 // result: (FlagGT_UGT)
2209 y := auxIntToInt32(v.AuxInt)
2210 if v_0.Op != Op386MOVLconst {
2213 x := auxIntToInt32(v_0.AuxInt)
2214 if !(x > y && uint32(x) > uint32(y)) {
2217 v.reset(Op386FlagGT_UGT)
2220 // match: (CMPLconst (SHRLconst _ [c]) [n])
2221 // cond: 0 <= n && 0 < c && c <= 32 && (1<<uint64(32-c)) <= uint64(n)
2222 // result: (FlagLT_ULT)
2224 n := auxIntToInt32(v.AuxInt)
2225 if v_0.Op != Op386SHRLconst {
2228 c := auxIntToInt32(v_0.AuxInt)
2229 if !(0 <= n && 0 < c && c <= 32 && (1<<uint64(32-c)) <= uint64(n)) {
2232 v.reset(Op386FlagLT_ULT)
2235 // match: (CMPLconst (ANDLconst _ [m]) [n])
2236 // cond: 0 <= m && m < n
2237 // result: (FlagLT_ULT)
2239 n := auxIntToInt32(v.AuxInt)
2240 if v_0.Op != Op386ANDLconst {
2243 m := auxIntToInt32(v_0.AuxInt)
2244 if !(0 <= m && m < n) {
2247 v.reset(Op386FlagLT_ULT)
2250 // match: (CMPLconst l:(ANDL x y) [0])
2252 // result: (TESTL x y)
2254 if auxIntToInt32(v.AuxInt) != 0 {
2258 if l.Op != Op386ANDL {
2270 // match: (CMPLconst l:(ANDLconst [c] x) [0])
2272 // result: (TESTLconst [c] x)
2274 if auxIntToInt32(v.AuxInt) != 0 {
2278 if l.Op != Op386ANDLconst {
2281 c := auxIntToInt32(l.AuxInt)
2286 v.reset(Op386TESTLconst)
2287 v.AuxInt = int32ToAuxInt(c)
2291 // match: (CMPLconst x [0])
2292 // result: (TESTL x x)
2294 if auxIntToInt32(v.AuxInt) != 0 {
2302 // match: (CMPLconst l:(MOVLload {sym} [off] ptr mem) [c])
2303 // cond: l.Uses == 1 && clobber(l)
2304 // result: @l.Block (CMPLconstload {sym} [makeValAndOff(int32(c),off)] ptr mem)
2306 c := auxIntToInt32(v.AuxInt)
2308 if l.Op != Op386MOVLload {
2311 off := auxIntToInt32(l.AuxInt)
2312 sym := auxToSym(l.Aux)
2315 if !(l.Uses == 1 && clobber(l)) {
2319 v0 := b.NewValue0(l.Pos, Op386CMPLconstload, types.TypeFlags)
2321 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(int32(c), off))
2322 v0.Aux = symToAux(sym)
2323 v0.AddArg2(ptr, mem)
2328 func rewriteValue386_Op386CMPLload(v *Value) bool {
2332 // match: (CMPLload {sym} [off] ptr (MOVLconst [c]) mem)
2333 // result: (CMPLconstload {sym} [makeValAndOff(c,off)] ptr mem)
2335 off := auxIntToInt32(v.AuxInt)
2336 sym := auxToSym(v.Aux)
2338 if v_1.Op != Op386MOVLconst {
2341 c := auxIntToInt32(v_1.AuxInt)
2343 v.reset(Op386CMPLconstload)
2344 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
2345 v.Aux = symToAux(sym)
2351 func rewriteValue386_Op386CMPW(v *Value) bool {
2355 // match: (CMPW x (MOVLconst [c]))
2356 // result: (CMPWconst x [int16(c)])
2359 if v_1.Op != Op386MOVLconst {
2362 c := auxIntToInt32(v_1.AuxInt)
2363 v.reset(Op386CMPWconst)
2364 v.AuxInt = int16ToAuxInt(int16(c))
2368 // match: (CMPW (MOVLconst [c]) x)
2369 // result: (InvertFlags (CMPWconst x [int16(c)]))
2371 if v_0.Op != Op386MOVLconst {
2374 c := auxIntToInt32(v_0.AuxInt)
2376 v.reset(Op386InvertFlags)
2377 v0 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
2378 v0.AuxInt = int16ToAuxInt(int16(c))
2383 // match: (CMPW x y)
2384 // cond: canonLessThan(x,y)
2385 // result: (InvertFlags (CMPW y x))
2389 if !(canonLessThan(x, y)) {
2392 v.reset(Op386InvertFlags)
2393 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
2398 // match: (CMPW l:(MOVWload {sym} [off] ptr mem) x)
2399 // cond: canMergeLoad(v, l) && clobber(l)
2400 // result: (CMPWload {sym} [off] ptr x mem)
2403 if l.Op != Op386MOVWload {
2406 off := auxIntToInt32(l.AuxInt)
2407 sym := auxToSym(l.Aux)
2411 if !(canMergeLoad(v, l) && clobber(l)) {
2414 v.reset(Op386CMPWload)
2415 v.AuxInt = int32ToAuxInt(off)
2416 v.Aux = symToAux(sym)
2417 v.AddArg3(ptr, x, mem)
2420 // match: (CMPW x l:(MOVWload {sym} [off] ptr mem))
2421 // cond: canMergeLoad(v, l) && clobber(l)
2422 // result: (InvertFlags (CMPWload {sym} [off] ptr x mem))
2426 if l.Op != Op386MOVWload {
2429 off := auxIntToInt32(l.AuxInt)
2430 sym := auxToSym(l.Aux)
2433 if !(canMergeLoad(v, l) && clobber(l)) {
2436 v.reset(Op386InvertFlags)
2437 v0 := b.NewValue0(l.Pos, Op386CMPWload, types.TypeFlags)
2438 v0.AuxInt = int32ToAuxInt(off)
2439 v0.Aux = symToAux(sym)
2440 v0.AddArg3(ptr, x, mem)
2446 func rewriteValue386_Op386CMPWconst(v *Value) bool {
2449 // match: (CMPWconst (MOVLconst [x]) [y])
2450 // cond: int16(x)==y
2453 y := auxIntToInt16(v.AuxInt)
2454 if v_0.Op != Op386MOVLconst {
2457 x := auxIntToInt32(v_0.AuxInt)
2458 if !(int16(x) == y) {
2461 v.reset(Op386FlagEQ)
2464 // match: (CMPWconst (MOVLconst [x]) [y])
2465 // cond: int16(x)<y && uint16(x)<uint16(y)
2466 // result: (FlagLT_ULT)
2468 y := auxIntToInt16(v.AuxInt)
2469 if v_0.Op != Op386MOVLconst {
2472 x := auxIntToInt32(v_0.AuxInt)
2473 if !(int16(x) < y && uint16(x) < uint16(y)) {
2476 v.reset(Op386FlagLT_ULT)
2479 // match: (CMPWconst (MOVLconst [x]) [y])
2480 // cond: int16(x)<y && uint16(x)>uint16(y)
2481 // result: (FlagLT_UGT)
2483 y := auxIntToInt16(v.AuxInt)
2484 if v_0.Op != Op386MOVLconst {
2487 x := auxIntToInt32(v_0.AuxInt)
2488 if !(int16(x) < y && uint16(x) > uint16(y)) {
2491 v.reset(Op386FlagLT_UGT)
2494 // match: (CMPWconst (MOVLconst [x]) [y])
2495 // cond: int16(x)>y && uint16(x)<uint16(y)
2496 // result: (FlagGT_ULT)
2498 y := auxIntToInt16(v.AuxInt)
2499 if v_0.Op != Op386MOVLconst {
2502 x := auxIntToInt32(v_0.AuxInt)
2503 if !(int16(x) > y && uint16(x) < uint16(y)) {
2506 v.reset(Op386FlagGT_ULT)
2509 // match: (CMPWconst (MOVLconst [x]) [y])
2510 // cond: int16(x)>y && uint16(x)>uint16(y)
2511 // result: (FlagGT_UGT)
2513 y := auxIntToInt16(v.AuxInt)
2514 if v_0.Op != Op386MOVLconst {
2517 x := auxIntToInt32(v_0.AuxInt)
2518 if !(int16(x) > y && uint16(x) > uint16(y)) {
2521 v.reset(Op386FlagGT_UGT)
2524 // match: (CMPWconst (ANDLconst _ [m]) [n])
2525 // cond: 0 <= int16(m) && int16(m) < n
2526 // result: (FlagLT_ULT)
2528 n := auxIntToInt16(v.AuxInt)
2529 if v_0.Op != Op386ANDLconst {
2532 m := auxIntToInt32(v_0.AuxInt)
2533 if !(0 <= int16(m) && int16(m) < n) {
2536 v.reset(Op386FlagLT_ULT)
2539 // match: (CMPWconst l:(ANDL x y) [0])
2541 // result: (TESTW x y)
2543 if auxIntToInt16(v.AuxInt) != 0 {
2547 if l.Op != Op386ANDL {
2559 // match: (CMPWconst l:(ANDLconst [c] x) [0])
2561 // result: (TESTWconst [int16(c)] x)
2563 if auxIntToInt16(v.AuxInt) != 0 {
2567 if l.Op != Op386ANDLconst {
2570 c := auxIntToInt32(l.AuxInt)
2575 v.reset(Op386TESTWconst)
2576 v.AuxInt = int16ToAuxInt(int16(c))
2580 // match: (CMPWconst x [0])
2581 // result: (TESTW x x)
2583 if auxIntToInt16(v.AuxInt) != 0 {
2591 // match: (CMPWconst l:(MOVWload {sym} [off] ptr mem) [c])
2592 // cond: l.Uses == 1 && clobber(l)
2593 // result: @l.Block (CMPWconstload {sym} [makeValAndOff(int32(c),off)] ptr mem)
2595 c := auxIntToInt16(v.AuxInt)
2597 if l.Op != Op386MOVWload {
2600 off := auxIntToInt32(l.AuxInt)
2601 sym := auxToSym(l.Aux)
2604 if !(l.Uses == 1 && clobber(l)) {
2608 v0 := b.NewValue0(l.Pos, Op386CMPWconstload, types.TypeFlags)
2610 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(int32(c), off))
2611 v0.Aux = symToAux(sym)
2612 v0.AddArg2(ptr, mem)
2617 func rewriteValue386_Op386CMPWload(v *Value) bool {
2621 // match: (CMPWload {sym} [off] ptr (MOVLconst [c]) mem)
2622 // result: (CMPWconstload {sym} [makeValAndOff(int32(int16(c)),off)] ptr mem)
2624 off := auxIntToInt32(v.AuxInt)
2625 sym := auxToSym(v.Aux)
2627 if v_1.Op != Op386MOVLconst {
2630 c := auxIntToInt32(v_1.AuxInt)
2632 v.reset(Op386CMPWconstload)
2633 v.AuxInt = valAndOffToAuxInt(makeValAndOff(int32(int16(c)), off))
2634 v.Aux = symToAux(sym)
2640 func rewriteValue386_Op386DIVSD(v *Value) bool {
2643 // match: (DIVSD x l:(MOVSDload [off] {sym} ptr mem))
2644 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
2645 // result: (DIVSDload x [off] {sym} ptr mem)
2649 if l.Op != Op386MOVSDload {
2652 off := auxIntToInt32(l.AuxInt)
2653 sym := auxToSym(l.Aux)
2656 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
2659 v.reset(Op386DIVSDload)
2660 v.AuxInt = int32ToAuxInt(off)
2661 v.Aux = symToAux(sym)
2662 v.AddArg3(x, ptr, mem)
2667 func rewriteValue386_Op386DIVSDload(v *Value) bool {
2672 config := b.Func.Config
2673 // match: (DIVSDload [off1] {sym} val (ADDLconst [off2] base) mem)
2674 // cond: is32Bit(int64(off1)+int64(off2))
2675 // result: (DIVSDload [off1+off2] {sym} val base mem)
2677 off1 := auxIntToInt32(v.AuxInt)
2678 sym := auxToSym(v.Aux)
2680 if v_1.Op != Op386ADDLconst {
2683 off2 := auxIntToInt32(v_1.AuxInt)
2686 if !(is32Bit(int64(off1) + int64(off2))) {
2689 v.reset(Op386DIVSDload)
2690 v.AuxInt = int32ToAuxInt(off1 + off2)
2691 v.Aux = symToAux(sym)
2692 v.AddArg3(val, base, mem)
2695 // match: (DIVSDload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
2696 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
2697 // result: (DIVSDload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
2699 off1 := auxIntToInt32(v.AuxInt)
2700 sym1 := auxToSym(v.Aux)
2702 if v_1.Op != Op386LEAL {
2705 off2 := auxIntToInt32(v_1.AuxInt)
2706 sym2 := auxToSym(v_1.Aux)
2709 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
2712 v.reset(Op386DIVSDload)
2713 v.AuxInt = int32ToAuxInt(off1 + off2)
2714 v.Aux = symToAux(mergeSym(sym1, sym2))
2715 v.AddArg3(val, base, mem)
2720 func rewriteValue386_Op386DIVSS(v *Value) bool {
2723 // match: (DIVSS x l:(MOVSSload [off] {sym} ptr mem))
2724 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
2725 // result: (DIVSSload x [off] {sym} ptr mem)
2729 if l.Op != Op386MOVSSload {
2732 off := auxIntToInt32(l.AuxInt)
2733 sym := auxToSym(l.Aux)
2736 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
2739 v.reset(Op386DIVSSload)
2740 v.AuxInt = int32ToAuxInt(off)
2741 v.Aux = symToAux(sym)
2742 v.AddArg3(x, ptr, mem)
2747 func rewriteValue386_Op386DIVSSload(v *Value) bool {
2752 config := b.Func.Config
2753 // match: (DIVSSload [off1] {sym} val (ADDLconst [off2] base) mem)
2754 // cond: is32Bit(int64(off1)+int64(off2))
2755 // result: (DIVSSload [off1+off2] {sym} val base mem)
2757 off1 := auxIntToInt32(v.AuxInt)
2758 sym := auxToSym(v.Aux)
2760 if v_1.Op != Op386ADDLconst {
2763 off2 := auxIntToInt32(v_1.AuxInt)
2766 if !(is32Bit(int64(off1) + int64(off2))) {
2769 v.reset(Op386DIVSSload)
2770 v.AuxInt = int32ToAuxInt(off1 + off2)
2771 v.Aux = symToAux(sym)
2772 v.AddArg3(val, base, mem)
2775 // match: (DIVSSload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
2776 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
2777 // result: (DIVSSload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
2779 off1 := auxIntToInt32(v.AuxInt)
2780 sym1 := auxToSym(v.Aux)
2782 if v_1.Op != Op386LEAL {
2785 off2 := auxIntToInt32(v_1.AuxInt)
2786 sym2 := auxToSym(v_1.Aux)
2789 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
2792 v.reset(Op386DIVSSload)
2793 v.AuxInt = int32ToAuxInt(off1 + off2)
2794 v.Aux = symToAux(mergeSym(sym1, sym2))
2795 v.AddArg3(val, base, mem)
2800 func rewriteValue386_Op386LEAL(v *Value) bool {
2802 // match: (LEAL [c] {s} (ADDLconst [d] x))
2803 // cond: is32Bit(int64(c)+int64(d))
2804 // result: (LEAL [c+d] {s} x)
2806 c := auxIntToInt32(v.AuxInt)
2807 s := auxToSym(v.Aux)
2808 if v_0.Op != Op386ADDLconst {
2811 d := auxIntToInt32(v_0.AuxInt)
2813 if !(is32Bit(int64(c) + int64(d))) {
2817 v.AuxInt = int32ToAuxInt(c + d)
2822 // match: (LEAL [c] {s} (ADDL x y))
2823 // cond: x.Op != OpSB && y.Op != OpSB
2824 // result: (LEAL1 [c] {s} x y)
2826 c := auxIntToInt32(v.AuxInt)
2827 s := auxToSym(v.Aux)
2828 if v_0.Op != Op386ADDL {
2832 v_0_0 := v_0.Args[0]
2833 v_0_1 := v_0.Args[1]
2834 for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
2837 if !(x.Op != OpSB && y.Op != OpSB) {
2841 v.AuxInt = int32ToAuxInt(c)
2848 // match: (LEAL [off1] {sym1} (LEAL [off2] {sym2} x))
2849 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)
2850 // result: (LEAL [off1+off2] {mergeSym(sym1,sym2)} x)
2852 off1 := auxIntToInt32(v.AuxInt)
2853 sym1 := auxToSym(v.Aux)
2854 if v_0.Op != Op386LEAL {
2857 off2 := auxIntToInt32(v_0.AuxInt)
2858 sym2 := auxToSym(v_0.Aux)
2860 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
2864 v.AuxInt = int32ToAuxInt(off1 + off2)
2865 v.Aux = symToAux(mergeSym(sym1, sym2))
2869 // match: (LEAL [off1] {sym1} (LEAL1 [off2] {sym2} x y))
2870 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)
2871 // result: (LEAL1 [off1+off2] {mergeSym(sym1,sym2)} x y)
2873 off1 := auxIntToInt32(v.AuxInt)
2874 sym1 := auxToSym(v.Aux)
2875 if v_0.Op != Op386LEAL1 {
2878 off2 := auxIntToInt32(v_0.AuxInt)
2879 sym2 := auxToSym(v_0.Aux)
2882 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
2886 v.AuxInt = int32ToAuxInt(off1 + off2)
2887 v.Aux = symToAux(mergeSym(sym1, sym2))
2891 // match: (LEAL [off1] {sym1} (LEAL2 [off2] {sym2} x y))
2892 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)
2893 // result: (LEAL2 [off1+off2] {mergeSym(sym1,sym2)} x y)
2895 off1 := auxIntToInt32(v.AuxInt)
2896 sym1 := auxToSym(v.Aux)
2897 if v_0.Op != Op386LEAL2 {
2900 off2 := auxIntToInt32(v_0.AuxInt)
2901 sym2 := auxToSym(v_0.Aux)
2904 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
2908 v.AuxInt = int32ToAuxInt(off1 + off2)
2909 v.Aux = symToAux(mergeSym(sym1, sym2))
2913 // match: (LEAL [off1] {sym1} (LEAL4 [off2] {sym2} x y))
2914 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)
2915 // result: (LEAL4 [off1+off2] {mergeSym(sym1,sym2)} x y)
2917 off1 := auxIntToInt32(v.AuxInt)
2918 sym1 := auxToSym(v.Aux)
2919 if v_0.Op != Op386LEAL4 {
2922 off2 := auxIntToInt32(v_0.AuxInt)
2923 sym2 := auxToSym(v_0.Aux)
2926 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
2930 v.AuxInt = int32ToAuxInt(off1 + off2)
2931 v.Aux = symToAux(mergeSym(sym1, sym2))
2935 // match: (LEAL [off1] {sym1} (LEAL8 [off2] {sym2} x y))
2936 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)
2937 // result: (LEAL8 [off1+off2] {mergeSym(sym1,sym2)} x y)
2939 off1 := auxIntToInt32(v.AuxInt)
2940 sym1 := auxToSym(v.Aux)
2941 if v_0.Op != Op386LEAL8 {
2944 off2 := auxIntToInt32(v_0.AuxInt)
2945 sym2 := auxToSym(v_0.Aux)
2948 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
2952 v.AuxInt = int32ToAuxInt(off1 + off2)
2953 v.Aux = symToAux(mergeSym(sym1, sym2))
2959 func rewriteValue386_Op386LEAL1(v *Value) bool {
2962 // match: (LEAL1 [c] {s} (ADDLconst [d] x) y)
2963 // cond: is32Bit(int64(c)+int64(d)) && x.Op != OpSB
2964 // result: (LEAL1 [c+d] {s} x y)
2966 c := auxIntToInt32(v.AuxInt)
2967 s := auxToSym(v.Aux)
2968 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2969 if v_0.Op != Op386ADDLconst {
2972 d := auxIntToInt32(v_0.AuxInt)
2975 if !(is32Bit(int64(c)+int64(d)) && x.Op != OpSB) {
2979 v.AuxInt = int32ToAuxInt(c + d)
2986 // match: (LEAL1 [c] {s} x (SHLLconst [1] y))
2987 // result: (LEAL2 [c] {s} x y)
2989 c := auxIntToInt32(v.AuxInt)
2990 s := auxToSym(v.Aux)
2991 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
2993 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 1 {
2998 v.AuxInt = int32ToAuxInt(c)
3005 // match: (LEAL1 [c] {s} x (SHLLconst [2] y))
3006 // result: (LEAL4 [c] {s} x y)
3008 c := auxIntToInt32(v.AuxInt)
3009 s := auxToSym(v.Aux)
3010 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3012 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 2 {
3017 v.AuxInt = int32ToAuxInt(c)
3024 // match: (LEAL1 [c] {s} x (SHLLconst [3] y))
3025 // result: (LEAL8 [c] {s} x y)
3027 c := auxIntToInt32(v.AuxInt)
3028 s := auxToSym(v.Aux)
3029 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3031 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 3 {
3036 v.AuxInt = int32ToAuxInt(c)
3043 // match: (LEAL1 [off1] {sym1} (LEAL [off2] {sym2} x) y)
3044 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB
3045 // result: (LEAL1 [off1+off2] {mergeSym(sym1,sym2)} x y)
3047 off1 := auxIntToInt32(v.AuxInt)
3048 sym1 := auxToSym(v.Aux)
3049 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3050 if v_0.Op != Op386LEAL {
3053 off2 := auxIntToInt32(v_0.AuxInt)
3054 sym2 := auxToSym(v_0.Aux)
3057 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB) {
3061 v.AuxInt = int32ToAuxInt(off1 + off2)
3062 v.Aux = symToAux(mergeSym(sym1, sym2))
3068 // match: (LEAL1 [off1] {sym1} x (LEAL1 [off2] {sym2} y y))
3069 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)
3070 // result: (LEAL2 [off1+off2] {mergeSym(sym1, sym2)} x y)
3072 off1 := auxIntToInt32(v.AuxInt)
3073 sym1 := auxToSym(v.Aux)
3074 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3076 if v_1.Op != Op386LEAL1 {
3079 off2 := auxIntToInt32(v_1.AuxInt)
3080 sym2 := auxToSym(v_1.Aux)
3082 if y != v_1.Args[0] || !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
3086 v.AuxInt = int32ToAuxInt(off1 + off2)
3087 v.Aux = symToAux(mergeSym(sym1, sym2))
3093 // match: (LEAL1 [off1] {sym1} x (LEAL1 [off2] {sym2} x y))
3094 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)
3095 // result: (LEAL2 [off1+off2] {mergeSym(sym1, sym2)} y x)
3097 off1 := auxIntToInt32(v.AuxInt)
3098 sym1 := auxToSym(v.Aux)
3099 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
3101 if v_1.Op != Op386LEAL1 {
3104 off2 := auxIntToInt32(v_1.AuxInt)
3105 sym2 := auxToSym(v_1.Aux)
3107 v_1_0 := v_1.Args[0]
3108 v_1_1 := v_1.Args[1]
3109 for _i1 := 0; _i1 <= 1; _i1, v_1_0, v_1_1 = _i1+1, v_1_1, v_1_0 {
3114 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2)) {
3118 v.AuxInt = int32ToAuxInt(off1 + off2)
3119 v.Aux = symToAux(mergeSym(sym1, sym2))
3126 // match: (LEAL1 [0] {nil} x y)
3127 // result: (ADDL x y)
3129 if auxIntToInt32(v.AuxInt) != 0 || auxToSym(v.Aux) != nil {
3140 func rewriteValue386_Op386LEAL2(v *Value) bool {
3143 // match: (LEAL2 [c] {s} (ADDLconst [d] x) y)
3144 // cond: is32Bit(int64(c)+int64(d)) && x.Op != OpSB
3145 // result: (LEAL2 [c+d] {s} x y)
3147 c := auxIntToInt32(v.AuxInt)
3148 s := auxToSym(v.Aux)
3149 if v_0.Op != Op386ADDLconst {
3152 d := auxIntToInt32(v_0.AuxInt)
3155 if !(is32Bit(int64(c)+int64(d)) && x.Op != OpSB) {
3159 v.AuxInt = int32ToAuxInt(c + d)
3164 // match: (LEAL2 [c] {s} x (ADDLconst [d] y))
3165 // cond: is32Bit(int64(c)+2*int64(d)) && y.Op != OpSB
3166 // result: (LEAL2 [c+2*d] {s} x y)
3168 c := auxIntToInt32(v.AuxInt)
3169 s := auxToSym(v.Aux)
3171 if v_1.Op != Op386ADDLconst {
3174 d := auxIntToInt32(v_1.AuxInt)
3176 if !(is32Bit(int64(c)+2*int64(d)) && y.Op != OpSB) {
3180 v.AuxInt = int32ToAuxInt(c + 2*d)
3185 // match: (LEAL2 [c] {s} x (SHLLconst [1] y))
3186 // result: (LEAL4 [c] {s} x y)
3188 c := auxIntToInt32(v.AuxInt)
3189 s := auxToSym(v.Aux)
3191 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 1 {
3196 v.AuxInt = int32ToAuxInt(c)
3201 // match: (LEAL2 [c] {s} x (SHLLconst [2] y))
3202 // result: (LEAL8 [c] {s} x y)
3204 c := auxIntToInt32(v.AuxInt)
3205 s := auxToSym(v.Aux)
3207 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 2 {
3212 v.AuxInt = int32ToAuxInt(c)
3217 // match: (LEAL2 [off1] {sym1} (LEAL [off2] {sym2} x) y)
3218 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB
3219 // result: (LEAL2 [off1+off2] {mergeSym(sym1,sym2)} x y)
3221 off1 := auxIntToInt32(v.AuxInt)
3222 sym1 := auxToSym(v.Aux)
3223 if v_0.Op != Op386LEAL {
3226 off2 := auxIntToInt32(v_0.AuxInt)
3227 sym2 := auxToSym(v_0.Aux)
3230 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB) {
3234 v.AuxInt = int32ToAuxInt(off1 + off2)
3235 v.Aux = symToAux(mergeSym(sym1, sym2))
3239 // match: (LEAL2 [off1] {sym} x (LEAL1 [off2] {nil} y y))
3240 // cond: is32Bit(int64(off1)+2*int64(off2))
3241 // result: (LEAL4 [off1+2*off2] {sym} x y)
3243 off1 := auxIntToInt32(v.AuxInt)
3244 sym := auxToSym(v.Aux)
3246 if v_1.Op != Op386LEAL1 {
3249 off2 := auxIntToInt32(v_1.AuxInt)
3250 if auxToSym(v_1.Aux) != nil {
3254 if y != v_1.Args[0] || !(is32Bit(int64(off1) + 2*int64(off2))) {
3258 v.AuxInt = int32ToAuxInt(off1 + 2*off2)
3259 v.Aux = symToAux(sym)
3265 func rewriteValue386_Op386LEAL4(v *Value) bool {
3268 // match: (LEAL4 [c] {s} (ADDLconst [d] x) y)
3269 // cond: is32Bit(int64(c)+int64(d)) && x.Op != OpSB
3270 // result: (LEAL4 [c+d] {s} x y)
3272 c := auxIntToInt32(v.AuxInt)
3273 s := auxToSym(v.Aux)
3274 if v_0.Op != Op386ADDLconst {
3277 d := auxIntToInt32(v_0.AuxInt)
3280 if !(is32Bit(int64(c)+int64(d)) && x.Op != OpSB) {
3284 v.AuxInt = int32ToAuxInt(c + d)
3289 // match: (LEAL4 [c] {s} x (ADDLconst [d] y))
3290 // cond: is32Bit(int64(c)+4*int64(d)) && y.Op != OpSB
3291 // result: (LEAL4 [c+4*d] {s} x y)
3293 c := auxIntToInt32(v.AuxInt)
3294 s := auxToSym(v.Aux)
3296 if v_1.Op != Op386ADDLconst {
3299 d := auxIntToInt32(v_1.AuxInt)
3301 if !(is32Bit(int64(c)+4*int64(d)) && y.Op != OpSB) {
3305 v.AuxInt = int32ToAuxInt(c + 4*d)
3310 // match: (LEAL4 [c] {s} x (SHLLconst [1] y))
3311 // result: (LEAL8 [c] {s} x y)
3313 c := auxIntToInt32(v.AuxInt)
3314 s := auxToSym(v.Aux)
3316 if v_1.Op != Op386SHLLconst || auxIntToInt32(v_1.AuxInt) != 1 {
3321 v.AuxInt = int32ToAuxInt(c)
3326 // match: (LEAL4 [off1] {sym1} (LEAL [off2] {sym2} x) y)
3327 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB
3328 // result: (LEAL4 [off1+off2] {mergeSym(sym1,sym2)} x y)
3330 off1 := auxIntToInt32(v.AuxInt)
3331 sym1 := auxToSym(v.Aux)
3332 if v_0.Op != Op386LEAL {
3335 off2 := auxIntToInt32(v_0.AuxInt)
3336 sym2 := auxToSym(v_0.Aux)
3339 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB) {
3343 v.AuxInt = int32ToAuxInt(off1 + off2)
3344 v.Aux = symToAux(mergeSym(sym1, sym2))
3348 // match: (LEAL4 [off1] {sym} x (LEAL1 [off2] {nil} y y))
3349 // cond: is32Bit(int64(off1)+4*int64(off2))
3350 // result: (LEAL8 [off1+4*off2] {sym} x y)
3352 off1 := auxIntToInt32(v.AuxInt)
3353 sym := auxToSym(v.Aux)
3355 if v_1.Op != Op386LEAL1 {
3358 off2 := auxIntToInt32(v_1.AuxInt)
3359 if auxToSym(v_1.Aux) != nil {
3363 if y != v_1.Args[0] || !(is32Bit(int64(off1) + 4*int64(off2))) {
3367 v.AuxInt = int32ToAuxInt(off1 + 4*off2)
3368 v.Aux = symToAux(sym)
3374 func rewriteValue386_Op386LEAL8(v *Value) bool {
3377 // match: (LEAL8 [c] {s} (ADDLconst [d] x) y)
3378 // cond: is32Bit(int64(c)+int64(d)) && x.Op != OpSB
3379 // result: (LEAL8 [c+d] {s} x y)
3381 c := auxIntToInt32(v.AuxInt)
3382 s := auxToSym(v.Aux)
3383 if v_0.Op != Op386ADDLconst {
3386 d := auxIntToInt32(v_0.AuxInt)
3389 if !(is32Bit(int64(c)+int64(d)) && x.Op != OpSB) {
3393 v.AuxInt = int32ToAuxInt(c + d)
3398 // match: (LEAL8 [c] {s} x (ADDLconst [d] y))
3399 // cond: is32Bit(int64(c)+8*int64(d)) && y.Op != OpSB
3400 // result: (LEAL8 [c+8*d] {s} x y)
3402 c := auxIntToInt32(v.AuxInt)
3403 s := auxToSym(v.Aux)
3405 if v_1.Op != Op386ADDLconst {
3408 d := auxIntToInt32(v_1.AuxInt)
3410 if !(is32Bit(int64(c)+8*int64(d)) && y.Op != OpSB) {
3414 v.AuxInt = int32ToAuxInt(c + 8*d)
3419 // match: (LEAL8 [off1] {sym1} (LEAL [off2] {sym2} x) y)
3420 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB
3421 // result: (LEAL8 [off1+off2] {mergeSym(sym1,sym2)} x y)
3423 off1 := auxIntToInt32(v.AuxInt)
3424 sym1 := auxToSym(v.Aux)
3425 if v_0.Op != Op386LEAL {
3428 off2 := auxIntToInt32(v_0.AuxInt)
3429 sym2 := auxToSym(v_0.Aux)
3432 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && x.Op != OpSB) {
3436 v.AuxInt = int32ToAuxInt(off1 + off2)
3437 v.Aux = symToAux(mergeSym(sym1, sym2))
3443 func rewriteValue386_Op386MOVBLSX(v *Value) bool {
3446 // match: (MOVBLSX x:(MOVBload [off] {sym} ptr mem))
3447 // cond: x.Uses == 1 && clobber(x)
3448 // result: @x.Block (MOVBLSXload <v.Type> [off] {sym} ptr mem)
3451 if x.Op != Op386MOVBload {
3454 off := auxIntToInt32(x.AuxInt)
3455 sym := auxToSym(x.Aux)
3458 if !(x.Uses == 1 && clobber(x)) {
3462 v0 := b.NewValue0(x.Pos, Op386MOVBLSXload, v.Type)
3464 v0.AuxInt = int32ToAuxInt(off)
3465 v0.Aux = symToAux(sym)
3466 v0.AddArg2(ptr, mem)
3469 // match: (MOVBLSX (ANDLconst [c] x))
3470 // cond: c & 0x80 == 0
3471 // result: (ANDLconst [c & 0x7f] x)
3473 if v_0.Op != Op386ANDLconst {
3476 c := auxIntToInt32(v_0.AuxInt)
3481 v.reset(Op386ANDLconst)
3482 v.AuxInt = int32ToAuxInt(c & 0x7f)
3488 func rewriteValue386_Op386MOVBLSXload(v *Value) bool {
3492 config := b.Func.Config
3493 // match: (MOVBLSXload [off] {sym} ptr (MOVBstore [off2] {sym2} ptr2 x _))
3494 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
3495 // result: (MOVBLSX x)
3497 off := auxIntToInt32(v.AuxInt)
3498 sym := auxToSym(v.Aux)
3500 if v_1.Op != Op386MOVBstore {
3503 off2 := auxIntToInt32(v_1.AuxInt)
3504 sym2 := auxToSym(v_1.Aux)
3507 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
3510 v.reset(Op386MOVBLSX)
3514 // match: (MOVBLSXload [off1] {sym1} (LEAL [off2] {sym2} base) mem)
3515 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
3516 // result: (MOVBLSXload [off1+off2] {mergeSym(sym1,sym2)} base mem)
3518 off1 := auxIntToInt32(v.AuxInt)
3519 sym1 := auxToSym(v.Aux)
3520 if v_0.Op != Op386LEAL {
3523 off2 := auxIntToInt32(v_0.AuxInt)
3524 sym2 := auxToSym(v_0.Aux)
3527 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
3530 v.reset(Op386MOVBLSXload)
3531 v.AuxInt = int32ToAuxInt(off1 + off2)
3532 v.Aux = symToAux(mergeSym(sym1, sym2))
3533 v.AddArg2(base, mem)
3538 func rewriteValue386_Op386MOVBLZX(v *Value) bool {
3541 // match: (MOVBLZX x:(MOVBload [off] {sym} ptr mem))
3542 // cond: x.Uses == 1 && clobber(x)
3543 // result: @x.Block (MOVBload <v.Type> [off] {sym} ptr mem)
3546 if x.Op != Op386MOVBload {
3549 off := auxIntToInt32(x.AuxInt)
3550 sym := auxToSym(x.Aux)
3553 if !(x.Uses == 1 && clobber(x)) {
3557 v0 := b.NewValue0(x.Pos, Op386MOVBload, v.Type)
3559 v0.AuxInt = int32ToAuxInt(off)
3560 v0.Aux = symToAux(sym)
3561 v0.AddArg2(ptr, mem)
3564 // match: (MOVBLZX (ANDLconst [c] x))
3565 // result: (ANDLconst [c & 0xff] x)
3567 if v_0.Op != Op386ANDLconst {
3570 c := auxIntToInt32(v_0.AuxInt)
3572 v.reset(Op386ANDLconst)
3573 v.AuxInt = int32ToAuxInt(c & 0xff)
3579 func rewriteValue386_Op386MOVBload(v *Value) bool {
3583 config := b.Func.Config
3584 // match: (MOVBload [off] {sym} ptr (MOVBstore [off2] {sym2} ptr2 x _))
3585 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
3586 // result: (MOVBLZX x)
3588 off := auxIntToInt32(v.AuxInt)
3589 sym := auxToSym(v.Aux)
3591 if v_1.Op != Op386MOVBstore {
3594 off2 := auxIntToInt32(v_1.AuxInt)
3595 sym2 := auxToSym(v_1.Aux)
3598 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
3601 v.reset(Op386MOVBLZX)
3605 // match: (MOVBload [off1] {sym} (ADDLconst [off2] ptr) mem)
3606 // cond: is32Bit(int64(off1)+int64(off2))
3607 // result: (MOVBload [off1+off2] {sym} ptr mem)
3609 off1 := auxIntToInt32(v.AuxInt)
3610 sym := auxToSym(v.Aux)
3611 if v_0.Op != Op386ADDLconst {
3614 off2 := auxIntToInt32(v_0.AuxInt)
3617 if !(is32Bit(int64(off1) + int64(off2))) {
3620 v.reset(Op386MOVBload)
3621 v.AuxInt = int32ToAuxInt(off1 + off2)
3622 v.Aux = symToAux(sym)
3626 // match: (MOVBload [off1] {sym1} (LEAL [off2] {sym2} base) mem)
3627 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
3628 // result: (MOVBload [off1+off2] {mergeSym(sym1,sym2)} base mem)
3630 off1 := auxIntToInt32(v.AuxInt)
3631 sym1 := auxToSym(v.Aux)
3632 if v_0.Op != Op386LEAL {
3635 off2 := auxIntToInt32(v_0.AuxInt)
3636 sym2 := auxToSym(v_0.Aux)
3639 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
3642 v.reset(Op386MOVBload)
3643 v.AuxInt = int32ToAuxInt(off1 + off2)
3644 v.Aux = symToAux(mergeSym(sym1, sym2))
3645 v.AddArg2(base, mem)
3648 // match: (MOVBload [off] {sym} (SB) _)
3649 // cond: symIsRO(sym)
3650 // result: (MOVLconst [int32(read8(sym, int64(off)))])
3652 off := auxIntToInt32(v.AuxInt)
3653 sym := auxToSym(v.Aux)
3654 if v_0.Op != OpSB || !(symIsRO(sym)) {
3657 v.reset(Op386MOVLconst)
3658 v.AuxInt = int32ToAuxInt(int32(read8(sym, int64(off))))
3663 func rewriteValue386_Op386MOVBstore(v *Value) bool {
3668 config := b.Func.Config
3669 // match: (MOVBstore [off] {sym} ptr (MOVBLSX x) mem)
3670 // result: (MOVBstore [off] {sym} ptr x mem)
3672 off := auxIntToInt32(v.AuxInt)
3673 sym := auxToSym(v.Aux)
3675 if v_1.Op != Op386MOVBLSX {
3680 v.reset(Op386MOVBstore)
3681 v.AuxInt = int32ToAuxInt(off)
3682 v.Aux = symToAux(sym)
3683 v.AddArg3(ptr, x, mem)
3686 // match: (MOVBstore [off] {sym} ptr (MOVBLZX x) mem)
3687 // result: (MOVBstore [off] {sym} ptr x mem)
3689 off := auxIntToInt32(v.AuxInt)
3690 sym := auxToSym(v.Aux)
3692 if v_1.Op != Op386MOVBLZX {
3697 v.reset(Op386MOVBstore)
3698 v.AuxInt = int32ToAuxInt(off)
3699 v.Aux = symToAux(sym)
3700 v.AddArg3(ptr, x, mem)
3703 // match: (MOVBstore [off1] {sym} (ADDLconst [off2] ptr) val mem)
3704 // cond: is32Bit(int64(off1)+int64(off2))
3705 // result: (MOVBstore [off1+off2] {sym} ptr val mem)
3707 off1 := auxIntToInt32(v.AuxInt)
3708 sym := auxToSym(v.Aux)
3709 if v_0.Op != Op386ADDLconst {
3712 off2 := auxIntToInt32(v_0.AuxInt)
3716 if !(is32Bit(int64(off1) + int64(off2))) {
3719 v.reset(Op386MOVBstore)
3720 v.AuxInt = int32ToAuxInt(off1 + off2)
3721 v.Aux = symToAux(sym)
3722 v.AddArg3(ptr, val, mem)
3725 // match: (MOVBstore [off] {sym} ptr (MOVLconst [c]) mem)
3726 // result: (MOVBstoreconst [makeValAndOff(c,off)] {sym} ptr mem)
3728 off := auxIntToInt32(v.AuxInt)
3729 sym := auxToSym(v.Aux)
3731 if v_1.Op != Op386MOVLconst {
3734 c := auxIntToInt32(v_1.AuxInt)
3736 v.reset(Op386MOVBstoreconst)
3737 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
3738 v.Aux = symToAux(sym)
3742 // match: (MOVBstore [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
3743 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
3744 // result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} base val mem)
3746 off1 := auxIntToInt32(v.AuxInt)
3747 sym1 := auxToSym(v.Aux)
3748 if v_0.Op != Op386LEAL {
3751 off2 := auxIntToInt32(v_0.AuxInt)
3752 sym2 := auxToSym(v_0.Aux)
3756 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
3759 v.reset(Op386MOVBstore)
3760 v.AuxInt = int32ToAuxInt(off1 + off2)
3761 v.Aux = symToAux(mergeSym(sym1, sym2))
3762 v.AddArg3(base, val, mem)
3765 // match: (MOVBstore [i] {s} p (SHRWconst [8] w) x:(MOVBstore [i-1] {s} p w mem))
3766 // cond: x.Uses == 1 && clobber(x)
3767 // result: (MOVWstore [i-1] {s} p w mem)
3769 i := auxIntToInt32(v.AuxInt)
3770 s := auxToSym(v.Aux)
3772 if v_1.Op != Op386SHRWconst || auxIntToInt16(v_1.AuxInt) != 8 {
3777 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i-1 || auxToSym(x.Aux) != s {
3781 if p != x.Args[0] || w != x.Args[1] || !(x.Uses == 1 && clobber(x)) {
3784 v.reset(Op386MOVWstore)
3785 v.AuxInt = int32ToAuxInt(i - 1)
3787 v.AddArg3(p, w, mem)
3790 // match: (MOVBstore [i] {s} p (SHRLconst [8] w) x:(MOVBstore [i-1] {s} p w mem))
3791 // cond: x.Uses == 1 && clobber(x)
3792 // result: (MOVWstore [i-1] {s} p w mem)
3794 i := auxIntToInt32(v.AuxInt)
3795 s := auxToSym(v.Aux)
3797 if v_1.Op != Op386SHRLconst || auxIntToInt32(v_1.AuxInt) != 8 {
3802 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i-1 || auxToSym(x.Aux) != s {
3806 if p != x.Args[0] || w != x.Args[1] || !(x.Uses == 1 && clobber(x)) {
3809 v.reset(Op386MOVWstore)
3810 v.AuxInt = int32ToAuxInt(i - 1)
3812 v.AddArg3(p, w, mem)
3815 // match: (MOVBstore [i] {s} p w x:(MOVBstore {s} [i+1] p (SHRWconst [8] w) mem))
3816 // cond: x.Uses == 1 && clobber(x)
3817 // result: (MOVWstore [i] {s} p w mem)
3819 i := auxIntToInt32(v.AuxInt)
3820 s := auxToSym(v.Aux)
3824 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i+1 || auxToSym(x.Aux) != s {
3832 if x_1.Op != Op386SHRWconst || auxIntToInt16(x_1.AuxInt) != 8 || w != x_1.Args[0] || !(x.Uses == 1 && clobber(x)) {
3835 v.reset(Op386MOVWstore)
3836 v.AuxInt = int32ToAuxInt(i)
3838 v.AddArg3(p, w, mem)
3841 // match: (MOVBstore [i] {s} p w x:(MOVBstore {s} [i+1] p (SHRLconst [8] w) mem))
3842 // cond: x.Uses == 1 && clobber(x)
3843 // result: (MOVWstore [i] {s} p w mem)
3845 i := auxIntToInt32(v.AuxInt)
3846 s := auxToSym(v.Aux)
3850 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i+1 || auxToSym(x.Aux) != s {
3858 if x_1.Op != Op386SHRLconst || auxIntToInt32(x_1.AuxInt) != 8 || w != x_1.Args[0] || !(x.Uses == 1 && clobber(x)) {
3861 v.reset(Op386MOVWstore)
3862 v.AuxInt = int32ToAuxInt(i)
3864 v.AddArg3(p, w, mem)
3867 // match: (MOVBstore [i] {s} p (SHRLconst [j] w) x:(MOVBstore [i-1] {s} p w0:(SHRLconst [j-8] w) mem))
3868 // cond: x.Uses == 1 && clobber(x)
3869 // result: (MOVWstore [i-1] {s} p w0 mem)
3871 i := auxIntToInt32(v.AuxInt)
3872 s := auxToSym(v.Aux)
3874 if v_1.Op != Op386SHRLconst {
3877 j := auxIntToInt32(v_1.AuxInt)
3880 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i-1 || auxToSym(x.Aux) != s {
3888 if w0.Op != Op386SHRLconst || auxIntToInt32(w0.AuxInt) != j-8 || w != w0.Args[0] || !(x.Uses == 1 && clobber(x)) {
3891 v.reset(Op386MOVWstore)
3892 v.AuxInt = int32ToAuxInt(i - 1)
3894 v.AddArg3(p, w0, mem)
3897 // match: (MOVBstore [i] {s} p1 (SHRWconst [8] w) x:(MOVBstore [i] {s} p0 w mem))
3898 // cond: x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)
3899 // result: (MOVWstore [i] {s} p0 w mem)
3901 i := auxIntToInt32(v.AuxInt)
3902 s := auxToSym(v.Aux)
3904 if v_1.Op != Op386SHRWconst || auxIntToInt16(v_1.AuxInt) != 8 {
3909 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
3914 if w != x.Args[1] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)) {
3917 v.reset(Op386MOVWstore)
3918 v.AuxInt = int32ToAuxInt(i)
3920 v.AddArg3(p0, w, mem)
3923 // match: (MOVBstore [i] {s} p1 (SHRLconst [8] w) x:(MOVBstore [i] {s} p0 w mem))
3924 // cond: x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)
3925 // result: (MOVWstore [i] {s} p0 w mem)
3927 i := auxIntToInt32(v.AuxInt)
3928 s := auxToSym(v.Aux)
3930 if v_1.Op != Op386SHRLconst || auxIntToInt32(v_1.AuxInt) != 8 {
3935 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
3940 if w != x.Args[1] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)) {
3943 v.reset(Op386MOVWstore)
3944 v.AuxInt = int32ToAuxInt(i)
3946 v.AddArg3(p0, w, mem)
3949 // match: (MOVBstore [i] {s} p0 w x:(MOVBstore {s} [i] p1 (SHRWconst [8] w) mem))
3950 // cond: x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)
3951 // result: (MOVWstore [i] {s} p0 w mem)
3953 i := auxIntToInt32(v.AuxInt)
3954 s := auxToSym(v.Aux)
3958 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
3964 if x_1.Op != Op386SHRWconst || auxIntToInt16(x_1.AuxInt) != 8 || w != x_1.Args[0] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)) {
3967 v.reset(Op386MOVWstore)
3968 v.AuxInt = int32ToAuxInt(i)
3970 v.AddArg3(p0, w, mem)
3973 // match: (MOVBstore [i] {s} p0 w x:(MOVBstore {s} [i] p1 (SHRLconst [8] w) mem))
3974 // cond: x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)
3975 // result: (MOVWstore [i] {s} p0 w mem)
3977 i := auxIntToInt32(v.AuxInt)
3978 s := auxToSym(v.Aux)
3982 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
3988 if x_1.Op != Op386SHRLconst || auxIntToInt32(x_1.AuxInt) != 8 || w != x_1.Args[0] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)) {
3991 v.reset(Op386MOVWstore)
3992 v.AuxInt = int32ToAuxInt(i)
3994 v.AddArg3(p0, w, mem)
3997 // match: (MOVBstore [i] {s} p1 (SHRLconst [j] w) x:(MOVBstore [i] {s} p0 w0:(SHRLconst [j-8] w) mem))
3998 // cond: x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)
3999 // result: (MOVWstore [i] {s} p0 w0 mem)
4001 i := auxIntToInt32(v.AuxInt)
4002 s := auxToSym(v.Aux)
4004 if v_1.Op != Op386SHRLconst {
4007 j := auxIntToInt32(v_1.AuxInt)
4010 if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
4016 if w0.Op != Op386SHRLconst || auxIntToInt32(w0.AuxInt) != j-8 || w != w0.Args[0] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)) {
4019 v.reset(Op386MOVWstore)
4020 v.AuxInt = int32ToAuxInt(i)
4022 v.AddArg3(p0, w0, mem)
4027 func rewriteValue386_Op386MOVBstoreconst(v *Value) bool {
4031 config := b.Func.Config
4032 // match: (MOVBstoreconst [sc] {s} (ADDLconst [off] ptr) mem)
4033 // cond: sc.canAdd32(off)
4034 // result: (MOVBstoreconst [sc.addOffset32(off)] {s} ptr mem)
4036 sc := auxIntToValAndOff(v.AuxInt)
4037 s := auxToSym(v.Aux)
4038 if v_0.Op != Op386ADDLconst {
4041 off := auxIntToInt32(v_0.AuxInt)
4044 if !(sc.canAdd32(off)) {
4047 v.reset(Op386MOVBstoreconst)
4048 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
4053 // match: (MOVBstoreconst [sc] {sym1} (LEAL [off] {sym2} ptr) mem)
4054 // cond: canMergeSym(sym1, sym2) && sc.canAdd32(off) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
4055 // result: (MOVBstoreconst [sc.addOffset32(off)] {mergeSym(sym1, sym2)} ptr mem)
4057 sc := auxIntToValAndOff(v.AuxInt)
4058 sym1 := auxToSym(v.Aux)
4059 if v_0.Op != Op386LEAL {
4062 off := auxIntToInt32(v_0.AuxInt)
4063 sym2 := auxToSym(v_0.Aux)
4066 if !(canMergeSym(sym1, sym2) && sc.canAdd32(off) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4069 v.reset(Op386MOVBstoreconst)
4070 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
4071 v.Aux = symToAux(mergeSym(sym1, sym2))
4075 // match: (MOVBstoreconst [c] {s} p x:(MOVBstoreconst [a] {s} p mem))
4076 // cond: x.Uses == 1 && a.Off() + 1 == c.Off() && clobber(x)
4077 // result: (MOVWstoreconst [makeValAndOff(a.Val()&0xff | c.Val()<<8, a.Off())] {s} p mem)
4079 c := auxIntToValAndOff(v.AuxInt)
4080 s := auxToSym(v.Aux)
4083 if x.Op != Op386MOVBstoreconst {
4086 a := auxIntToValAndOff(x.AuxInt)
4087 if auxToSym(x.Aux) != s {
4091 if p != x.Args[0] || !(x.Uses == 1 && a.Off()+1 == c.Off() && clobber(x)) {
4094 v.reset(Op386MOVWstoreconst)
4095 v.AuxInt = valAndOffToAuxInt(makeValAndOff(a.Val()&0xff|c.Val()<<8, a.Off()))
4100 // match: (MOVBstoreconst [a] {s} p x:(MOVBstoreconst [c] {s} p mem))
4101 // cond: x.Uses == 1 && a.Off() + 1 == c.Off() && clobber(x)
4102 // result: (MOVWstoreconst [makeValAndOff(a.Val()&0xff | c.Val()<<8, a.Off())] {s} p mem)
4104 a := auxIntToValAndOff(v.AuxInt)
4105 s := auxToSym(v.Aux)
4108 if x.Op != Op386MOVBstoreconst {
4111 c := auxIntToValAndOff(x.AuxInt)
4112 if auxToSym(x.Aux) != s {
4116 if p != x.Args[0] || !(x.Uses == 1 && a.Off()+1 == c.Off() && clobber(x)) {
4119 v.reset(Op386MOVWstoreconst)
4120 v.AuxInt = valAndOffToAuxInt(makeValAndOff(a.Val()&0xff|c.Val()<<8, a.Off()))
4125 // match: (MOVBstoreconst [c] {s} p1 x:(MOVBstoreconst [a] {s} p0 mem))
4126 // cond: x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 1) && clobber(x)
4127 // result: (MOVWstoreconst [makeValAndOff(a.Val()&0xff | c.Val()<<8, a.Off())] {s} p0 mem)
4129 c := auxIntToValAndOff(v.AuxInt)
4130 s := auxToSym(v.Aux)
4133 if x.Op != Op386MOVBstoreconst {
4136 a := auxIntToValAndOff(x.AuxInt)
4137 if auxToSym(x.Aux) != s {
4142 if !(x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 1) && clobber(x)) {
4145 v.reset(Op386MOVWstoreconst)
4146 v.AuxInt = valAndOffToAuxInt(makeValAndOff(a.Val()&0xff|c.Val()<<8, a.Off()))
4151 // match: (MOVBstoreconst [a] {s} p0 x:(MOVBstoreconst [c] {s} p1 mem))
4152 // cond: x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 1) && clobber(x)
4153 // result: (MOVWstoreconst [makeValAndOff(a.Val()&0xff | c.Val()<<8, a.Off())] {s} p0 mem)
4155 a := auxIntToValAndOff(v.AuxInt)
4156 s := auxToSym(v.Aux)
4159 if x.Op != Op386MOVBstoreconst {
4162 c := auxIntToValAndOff(x.AuxInt)
4163 if auxToSym(x.Aux) != s {
4168 if !(x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 1) && clobber(x)) {
4171 v.reset(Op386MOVWstoreconst)
4172 v.AuxInt = valAndOffToAuxInt(makeValAndOff(a.Val()&0xff|c.Val()<<8, a.Off()))
4179 func rewriteValue386_Op386MOVLload(v *Value) bool {
4183 config := b.Func.Config
4184 // match: (MOVLload [off] {sym} ptr (MOVLstore [off2] {sym2} ptr2 x _))
4185 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
4188 off := auxIntToInt32(v.AuxInt)
4189 sym := auxToSym(v.Aux)
4191 if v_1.Op != Op386MOVLstore {
4194 off2 := auxIntToInt32(v_1.AuxInt)
4195 sym2 := auxToSym(v_1.Aux)
4198 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
4204 // match: (MOVLload [off1] {sym} (ADDLconst [off2] ptr) mem)
4205 // cond: is32Bit(int64(off1)+int64(off2))
4206 // result: (MOVLload [off1+off2] {sym} ptr mem)
4208 off1 := auxIntToInt32(v.AuxInt)
4209 sym := auxToSym(v.Aux)
4210 if v_0.Op != Op386ADDLconst {
4213 off2 := auxIntToInt32(v_0.AuxInt)
4216 if !(is32Bit(int64(off1) + int64(off2))) {
4219 v.reset(Op386MOVLload)
4220 v.AuxInt = int32ToAuxInt(off1 + off2)
4221 v.Aux = symToAux(sym)
4225 // match: (MOVLload [off1] {sym1} (LEAL [off2] {sym2} base) mem)
4226 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
4227 // result: (MOVLload [off1+off2] {mergeSym(sym1,sym2)} base mem)
4229 off1 := auxIntToInt32(v.AuxInt)
4230 sym1 := auxToSym(v.Aux)
4231 if v_0.Op != Op386LEAL {
4234 off2 := auxIntToInt32(v_0.AuxInt)
4235 sym2 := auxToSym(v_0.Aux)
4238 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4241 v.reset(Op386MOVLload)
4242 v.AuxInt = int32ToAuxInt(off1 + off2)
4243 v.Aux = symToAux(mergeSym(sym1, sym2))
4244 v.AddArg2(base, mem)
4247 // match: (MOVLload [off] {sym} (SB) _)
4248 // cond: symIsRO(sym)
4249 // result: (MOVLconst [int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))])
4251 off := auxIntToInt32(v.AuxInt)
4252 sym := auxToSym(v.Aux)
4253 if v_0.Op != OpSB || !(symIsRO(sym)) {
4256 v.reset(Op386MOVLconst)
4257 v.AuxInt = int32ToAuxInt(int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))
4262 func rewriteValue386_Op386MOVLstore(v *Value) bool {
4267 config := b.Func.Config
4268 // match: (MOVLstore [off1] {sym} (ADDLconst [off2] ptr) val mem)
4269 // cond: is32Bit(int64(off1)+int64(off2))
4270 // result: (MOVLstore [off1+off2] {sym} ptr val mem)
4272 off1 := auxIntToInt32(v.AuxInt)
4273 sym := auxToSym(v.Aux)
4274 if v_0.Op != Op386ADDLconst {
4277 off2 := auxIntToInt32(v_0.AuxInt)
4281 if !(is32Bit(int64(off1) + int64(off2))) {
4284 v.reset(Op386MOVLstore)
4285 v.AuxInt = int32ToAuxInt(off1 + off2)
4286 v.Aux = symToAux(sym)
4287 v.AddArg3(ptr, val, mem)
4290 // match: (MOVLstore [off] {sym} ptr (MOVLconst [c]) mem)
4291 // result: (MOVLstoreconst [makeValAndOff(c,off)] {sym} ptr mem)
4293 off := auxIntToInt32(v.AuxInt)
4294 sym := auxToSym(v.Aux)
4296 if v_1.Op != Op386MOVLconst {
4299 c := auxIntToInt32(v_1.AuxInt)
4301 v.reset(Op386MOVLstoreconst)
4302 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
4303 v.Aux = symToAux(sym)
4307 // match: (MOVLstore [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
4308 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
4309 // result: (MOVLstore [off1+off2] {mergeSym(sym1,sym2)} base val mem)
4311 off1 := auxIntToInt32(v.AuxInt)
4312 sym1 := auxToSym(v.Aux)
4313 if v_0.Op != Op386LEAL {
4316 off2 := auxIntToInt32(v_0.AuxInt)
4317 sym2 := auxToSym(v_0.Aux)
4321 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4324 v.reset(Op386MOVLstore)
4325 v.AuxInt = int32ToAuxInt(off1 + off2)
4326 v.Aux = symToAux(mergeSym(sym1, sym2))
4327 v.AddArg3(base, val, mem)
4330 // match: (MOVLstore {sym} [off] ptr y:(ADDLload x [off] {sym} ptr mem) mem)
4331 // cond: y.Uses==1 && clobber(y)
4332 // result: (ADDLmodify [off] {sym} ptr x mem)
4334 off := auxIntToInt32(v.AuxInt)
4335 sym := auxToSym(v.Aux)
4338 if y.Op != Op386ADDLload || auxIntToInt32(y.AuxInt) != off || auxToSym(y.Aux) != sym {
4343 if ptr != y.Args[1] || mem != v_2 || !(y.Uses == 1 && clobber(y)) {
4346 v.reset(Op386ADDLmodify)
4347 v.AuxInt = int32ToAuxInt(off)
4348 v.Aux = symToAux(sym)
4349 v.AddArg3(ptr, x, mem)
4352 // match: (MOVLstore {sym} [off] ptr y:(ANDLload x [off] {sym} ptr mem) mem)
4353 // cond: y.Uses==1 && clobber(y)
4354 // result: (ANDLmodify [off] {sym} ptr x mem)
4356 off := auxIntToInt32(v.AuxInt)
4357 sym := auxToSym(v.Aux)
4360 if y.Op != Op386ANDLload || auxIntToInt32(y.AuxInt) != off || auxToSym(y.Aux) != sym {
4365 if ptr != y.Args[1] || mem != v_2 || !(y.Uses == 1 && clobber(y)) {
4368 v.reset(Op386ANDLmodify)
4369 v.AuxInt = int32ToAuxInt(off)
4370 v.Aux = symToAux(sym)
4371 v.AddArg3(ptr, x, mem)
4374 // match: (MOVLstore {sym} [off] ptr y:(ORLload x [off] {sym} ptr mem) mem)
4375 // cond: y.Uses==1 && clobber(y)
4376 // result: (ORLmodify [off] {sym} ptr x mem)
4378 off := auxIntToInt32(v.AuxInt)
4379 sym := auxToSym(v.Aux)
4382 if y.Op != Op386ORLload || auxIntToInt32(y.AuxInt) != off || auxToSym(y.Aux) != sym {
4387 if ptr != y.Args[1] || mem != v_2 || !(y.Uses == 1 && clobber(y)) {
4390 v.reset(Op386ORLmodify)
4391 v.AuxInt = int32ToAuxInt(off)
4392 v.Aux = symToAux(sym)
4393 v.AddArg3(ptr, x, mem)
4396 // match: (MOVLstore {sym} [off] ptr y:(XORLload x [off] {sym} ptr mem) mem)
4397 // cond: y.Uses==1 && clobber(y)
4398 // result: (XORLmodify [off] {sym} ptr x mem)
4400 off := auxIntToInt32(v.AuxInt)
4401 sym := auxToSym(v.Aux)
4404 if y.Op != Op386XORLload || auxIntToInt32(y.AuxInt) != off || auxToSym(y.Aux) != sym {
4409 if ptr != y.Args[1] || mem != v_2 || !(y.Uses == 1 && clobber(y)) {
4412 v.reset(Op386XORLmodify)
4413 v.AuxInt = int32ToAuxInt(off)
4414 v.Aux = symToAux(sym)
4415 v.AddArg3(ptr, x, mem)
4418 // match: (MOVLstore {sym} [off] ptr y:(ADDL l:(MOVLload [off] {sym} ptr mem) x) mem)
4419 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4420 // result: (ADDLmodify [off] {sym} ptr x mem)
4422 off := auxIntToInt32(v.AuxInt)
4423 sym := auxToSym(v.Aux)
4426 if y.Op != Op386ADDL {
4432 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
4434 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4438 if ptr != l.Args[0] {
4442 if mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4445 v.reset(Op386ADDLmodify)
4446 v.AuxInt = int32ToAuxInt(off)
4447 v.Aux = symToAux(sym)
4448 v.AddArg3(ptr, x, mem)
4453 // match: (MOVLstore {sym} [off] ptr y:(SUBL l:(MOVLload [off] {sym} ptr mem) x) mem)
4454 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4455 // result: (SUBLmodify [off] {sym} ptr x mem)
4457 off := auxIntToInt32(v.AuxInt)
4458 sym := auxToSym(v.Aux)
4461 if y.Op != Op386SUBL {
4466 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4470 if ptr != l.Args[0] || mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4473 v.reset(Op386SUBLmodify)
4474 v.AuxInt = int32ToAuxInt(off)
4475 v.Aux = symToAux(sym)
4476 v.AddArg3(ptr, x, mem)
4479 // match: (MOVLstore {sym} [off] ptr y:(ANDL l:(MOVLload [off] {sym} ptr mem) x) mem)
4480 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4481 // result: (ANDLmodify [off] {sym} ptr x mem)
4483 off := auxIntToInt32(v.AuxInt)
4484 sym := auxToSym(v.Aux)
4487 if y.Op != Op386ANDL {
4493 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
4495 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4499 if ptr != l.Args[0] {
4503 if mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4506 v.reset(Op386ANDLmodify)
4507 v.AuxInt = int32ToAuxInt(off)
4508 v.Aux = symToAux(sym)
4509 v.AddArg3(ptr, x, mem)
4514 // match: (MOVLstore {sym} [off] ptr y:(ORL l:(MOVLload [off] {sym} ptr mem) x) mem)
4515 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4516 // result: (ORLmodify [off] {sym} ptr x mem)
4518 off := auxIntToInt32(v.AuxInt)
4519 sym := auxToSym(v.Aux)
4522 if y.Op != Op386ORL {
4528 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
4530 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4534 if ptr != l.Args[0] {
4538 if mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4541 v.reset(Op386ORLmodify)
4542 v.AuxInt = int32ToAuxInt(off)
4543 v.Aux = symToAux(sym)
4544 v.AddArg3(ptr, x, mem)
4549 // match: (MOVLstore {sym} [off] ptr y:(XORL l:(MOVLload [off] {sym} ptr mem) x) mem)
4550 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4551 // result: (XORLmodify [off] {sym} ptr x mem)
4553 off := auxIntToInt32(v.AuxInt)
4554 sym := auxToSym(v.Aux)
4557 if y.Op != Op386XORL {
4563 for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
4565 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4569 if ptr != l.Args[0] {
4573 if mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4576 v.reset(Op386XORLmodify)
4577 v.AuxInt = int32ToAuxInt(off)
4578 v.Aux = symToAux(sym)
4579 v.AddArg3(ptr, x, mem)
4584 // match: (MOVLstore {sym} [off] ptr y:(ADDLconst [c] l:(MOVLload [off] {sym} ptr mem)) mem)
4585 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4586 // result: (ADDLconstmodify [makeValAndOff(c,off)] {sym} ptr mem)
4588 off := auxIntToInt32(v.AuxInt)
4589 sym := auxToSym(v.Aux)
4592 if y.Op != Op386ADDLconst {
4595 c := auxIntToInt32(y.AuxInt)
4597 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4601 if ptr != l.Args[0] || mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4604 v.reset(Op386ADDLconstmodify)
4605 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
4606 v.Aux = symToAux(sym)
4610 // match: (MOVLstore {sym} [off] ptr y:(ANDLconst [c] l:(MOVLload [off] {sym} ptr mem)) mem)
4611 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4612 // result: (ANDLconstmodify [makeValAndOff(c,off)] {sym} ptr mem)
4614 off := auxIntToInt32(v.AuxInt)
4615 sym := auxToSym(v.Aux)
4618 if y.Op != Op386ANDLconst {
4621 c := auxIntToInt32(y.AuxInt)
4623 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4627 if ptr != l.Args[0] || mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4630 v.reset(Op386ANDLconstmodify)
4631 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
4632 v.Aux = symToAux(sym)
4636 // match: (MOVLstore {sym} [off] ptr y:(ORLconst [c] l:(MOVLload [off] {sym} ptr mem)) mem)
4637 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4638 // result: (ORLconstmodify [makeValAndOff(c,off)] {sym} ptr mem)
4640 off := auxIntToInt32(v.AuxInt)
4641 sym := auxToSym(v.Aux)
4644 if y.Op != Op386ORLconst {
4647 c := auxIntToInt32(y.AuxInt)
4649 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4653 if ptr != l.Args[0] || mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4656 v.reset(Op386ORLconstmodify)
4657 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
4658 v.Aux = symToAux(sym)
4662 // match: (MOVLstore {sym} [off] ptr y:(XORLconst [c] l:(MOVLload [off] {sym} ptr mem)) mem)
4663 // cond: y.Uses==1 && l.Uses==1 && clobber(y, l)
4664 // result: (XORLconstmodify [makeValAndOff(c,off)] {sym} ptr mem)
4666 off := auxIntToInt32(v.AuxInt)
4667 sym := auxToSym(v.Aux)
4670 if y.Op != Op386XORLconst {
4673 c := auxIntToInt32(y.AuxInt)
4675 if l.Op != Op386MOVLload || auxIntToInt32(l.AuxInt) != off || auxToSym(l.Aux) != sym {
4679 if ptr != l.Args[0] || mem != v_2 || !(y.Uses == 1 && l.Uses == 1 && clobber(y, l)) {
4682 v.reset(Op386XORLconstmodify)
4683 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
4684 v.Aux = symToAux(sym)
4690 func rewriteValue386_Op386MOVLstoreconst(v *Value) bool {
4694 config := b.Func.Config
4695 // match: (MOVLstoreconst [sc] {s} (ADDLconst [off] ptr) mem)
4696 // cond: sc.canAdd32(off)
4697 // result: (MOVLstoreconst [sc.addOffset32(off)] {s} ptr mem)
4699 sc := auxIntToValAndOff(v.AuxInt)
4700 s := auxToSym(v.Aux)
4701 if v_0.Op != Op386ADDLconst {
4704 off := auxIntToInt32(v_0.AuxInt)
4707 if !(sc.canAdd32(off)) {
4710 v.reset(Op386MOVLstoreconst)
4711 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
4716 // match: (MOVLstoreconst [sc] {sym1} (LEAL [off] {sym2} ptr) mem)
4717 // cond: canMergeSym(sym1, sym2) && sc.canAdd32(off) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
4718 // result: (MOVLstoreconst [sc.addOffset32(off)] {mergeSym(sym1, sym2)} ptr mem)
4720 sc := auxIntToValAndOff(v.AuxInt)
4721 sym1 := auxToSym(v.Aux)
4722 if v_0.Op != Op386LEAL {
4725 off := auxIntToInt32(v_0.AuxInt)
4726 sym2 := auxToSym(v_0.Aux)
4729 if !(canMergeSym(sym1, sym2) && sc.canAdd32(off) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
4732 v.reset(Op386MOVLstoreconst)
4733 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
4734 v.Aux = symToAux(mergeSym(sym1, sym2))
4740 func rewriteValue386_Op386MOVSDconst(v *Value) bool {
4742 config := b.Func.Config
4743 typ := &b.Func.Config.Types
4744 // match: (MOVSDconst [c])
4745 // cond: config.ctxt.Flag_shared
4746 // result: (MOVSDconst2 (MOVSDconst1 [c]))
4748 c := auxIntToFloat64(v.AuxInt)
4749 if !(config.ctxt.Flag_shared) {
4752 v.reset(Op386MOVSDconst2)
4753 v0 := b.NewValue0(v.Pos, Op386MOVSDconst1, typ.UInt32)
4754 v0.AuxInt = float64ToAuxInt(c)
4760 func rewriteValue386_Op386MOVSDload(v *Value) bool {
4764 config := b.Func.Config
4765 // match: (MOVSDload [off1] {sym} (ADDLconst [off2] ptr) mem)
4766 // cond: is32Bit(int64(off1)+int64(off2))
4767 // result: (MOVSDload [off1+off2] {sym} ptr mem)
4769 off1 := auxIntToInt32(v.AuxInt)
4770 sym := auxToSym(v.Aux)
4771 if v_0.Op != Op386ADDLconst {
4774 off2 := auxIntToInt32(v_0.AuxInt)
4777 if !(is32Bit(int64(off1) + int64(off2))) {
4780 v.reset(Op386MOVSDload)
4781 v.AuxInt = int32ToAuxInt(off1 + off2)
4782 v.Aux = symToAux(sym)
4786 // match: (MOVSDload [off1] {sym1} (LEAL [off2] {sym2} base) mem)
4787 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
4788 // result: (MOVSDload [off1+off2] {mergeSym(sym1,sym2)} base mem)
4790 off1 := auxIntToInt32(v.AuxInt)
4791 sym1 := auxToSym(v.Aux)
4792 if v_0.Op != Op386LEAL {
4795 off2 := auxIntToInt32(v_0.AuxInt)
4796 sym2 := auxToSym(v_0.Aux)
4799 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4802 v.reset(Op386MOVSDload)
4803 v.AuxInt = int32ToAuxInt(off1 + off2)
4804 v.Aux = symToAux(mergeSym(sym1, sym2))
4805 v.AddArg2(base, mem)
4810 func rewriteValue386_Op386MOVSDstore(v *Value) bool {
4815 config := b.Func.Config
4816 // match: (MOVSDstore [off1] {sym} (ADDLconst [off2] ptr) val mem)
4817 // cond: is32Bit(int64(off1)+int64(off2))
4818 // result: (MOVSDstore [off1+off2] {sym} ptr val mem)
4820 off1 := auxIntToInt32(v.AuxInt)
4821 sym := auxToSym(v.Aux)
4822 if v_0.Op != Op386ADDLconst {
4825 off2 := auxIntToInt32(v_0.AuxInt)
4829 if !(is32Bit(int64(off1) + int64(off2))) {
4832 v.reset(Op386MOVSDstore)
4833 v.AuxInt = int32ToAuxInt(off1 + off2)
4834 v.Aux = symToAux(sym)
4835 v.AddArg3(ptr, val, mem)
4838 // match: (MOVSDstore [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
4839 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
4840 // result: (MOVSDstore [off1+off2] {mergeSym(sym1,sym2)} base val mem)
4842 off1 := auxIntToInt32(v.AuxInt)
4843 sym1 := auxToSym(v.Aux)
4844 if v_0.Op != Op386LEAL {
4847 off2 := auxIntToInt32(v_0.AuxInt)
4848 sym2 := auxToSym(v_0.Aux)
4852 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4855 v.reset(Op386MOVSDstore)
4856 v.AuxInt = int32ToAuxInt(off1 + off2)
4857 v.Aux = symToAux(mergeSym(sym1, sym2))
4858 v.AddArg3(base, val, mem)
4863 func rewriteValue386_Op386MOVSSconst(v *Value) bool {
4865 config := b.Func.Config
4866 typ := &b.Func.Config.Types
4867 // match: (MOVSSconst [c])
4868 // cond: config.ctxt.Flag_shared
4869 // result: (MOVSSconst2 (MOVSSconst1 [c]))
4871 c := auxIntToFloat32(v.AuxInt)
4872 if !(config.ctxt.Flag_shared) {
4875 v.reset(Op386MOVSSconst2)
4876 v0 := b.NewValue0(v.Pos, Op386MOVSSconst1, typ.UInt32)
4877 v0.AuxInt = float32ToAuxInt(c)
4883 func rewriteValue386_Op386MOVSSload(v *Value) bool {
4887 config := b.Func.Config
4888 // match: (MOVSSload [off1] {sym} (ADDLconst [off2] ptr) mem)
4889 // cond: is32Bit(int64(off1)+int64(off2))
4890 // result: (MOVSSload [off1+off2] {sym} ptr mem)
4892 off1 := auxIntToInt32(v.AuxInt)
4893 sym := auxToSym(v.Aux)
4894 if v_0.Op != Op386ADDLconst {
4897 off2 := auxIntToInt32(v_0.AuxInt)
4900 if !(is32Bit(int64(off1) + int64(off2))) {
4903 v.reset(Op386MOVSSload)
4904 v.AuxInt = int32ToAuxInt(off1 + off2)
4905 v.Aux = symToAux(sym)
4909 // match: (MOVSSload [off1] {sym1} (LEAL [off2] {sym2} base) mem)
4910 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
4911 // result: (MOVSSload [off1+off2] {mergeSym(sym1,sym2)} base mem)
4913 off1 := auxIntToInt32(v.AuxInt)
4914 sym1 := auxToSym(v.Aux)
4915 if v_0.Op != Op386LEAL {
4918 off2 := auxIntToInt32(v_0.AuxInt)
4919 sym2 := auxToSym(v_0.Aux)
4922 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4925 v.reset(Op386MOVSSload)
4926 v.AuxInt = int32ToAuxInt(off1 + off2)
4927 v.Aux = symToAux(mergeSym(sym1, sym2))
4928 v.AddArg2(base, mem)
4933 func rewriteValue386_Op386MOVSSstore(v *Value) bool {
4938 config := b.Func.Config
4939 // match: (MOVSSstore [off1] {sym} (ADDLconst [off2] ptr) val mem)
4940 // cond: is32Bit(int64(off1)+int64(off2))
4941 // result: (MOVSSstore [off1+off2] {sym} ptr val mem)
4943 off1 := auxIntToInt32(v.AuxInt)
4944 sym := auxToSym(v.Aux)
4945 if v_0.Op != Op386ADDLconst {
4948 off2 := auxIntToInt32(v_0.AuxInt)
4952 if !(is32Bit(int64(off1) + int64(off2))) {
4955 v.reset(Op386MOVSSstore)
4956 v.AuxInt = int32ToAuxInt(off1 + off2)
4957 v.Aux = symToAux(sym)
4958 v.AddArg3(ptr, val, mem)
4961 // match: (MOVSSstore [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
4962 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
4963 // result: (MOVSSstore [off1+off2] {mergeSym(sym1,sym2)} base val mem)
4965 off1 := auxIntToInt32(v.AuxInt)
4966 sym1 := auxToSym(v.Aux)
4967 if v_0.Op != Op386LEAL {
4970 off2 := auxIntToInt32(v_0.AuxInt)
4971 sym2 := auxToSym(v_0.Aux)
4975 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
4978 v.reset(Op386MOVSSstore)
4979 v.AuxInt = int32ToAuxInt(off1 + off2)
4980 v.Aux = symToAux(mergeSym(sym1, sym2))
4981 v.AddArg3(base, val, mem)
4986 func rewriteValue386_Op386MOVWLSX(v *Value) bool {
4989 // match: (MOVWLSX x:(MOVWload [off] {sym} ptr mem))
4990 // cond: x.Uses == 1 && clobber(x)
4991 // result: @x.Block (MOVWLSXload <v.Type> [off] {sym} ptr mem)
4994 if x.Op != Op386MOVWload {
4997 off := auxIntToInt32(x.AuxInt)
4998 sym := auxToSym(x.Aux)
5001 if !(x.Uses == 1 && clobber(x)) {
5005 v0 := b.NewValue0(x.Pos, Op386MOVWLSXload, v.Type)
5007 v0.AuxInt = int32ToAuxInt(off)
5008 v0.Aux = symToAux(sym)
5009 v0.AddArg2(ptr, mem)
5012 // match: (MOVWLSX (ANDLconst [c] x))
5013 // cond: c & 0x8000 == 0
5014 // result: (ANDLconst [c & 0x7fff] x)
5016 if v_0.Op != Op386ANDLconst {
5019 c := auxIntToInt32(v_0.AuxInt)
5021 if !(c&0x8000 == 0) {
5024 v.reset(Op386ANDLconst)
5025 v.AuxInt = int32ToAuxInt(c & 0x7fff)
5031 func rewriteValue386_Op386MOVWLSXload(v *Value) bool {
5035 config := b.Func.Config
5036 // match: (MOVWLSXload [off] {sym} ptr (MOVWstore [off2] {sym2} ptr2 x _))
5037 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
5038 // result: (MOVWLSX x)
5040 off := auxIntToInt32(v.AuxInt)
5041 sym := auxToSym(v.Aux)
5043 if v_1.Op != Op386MOVWstore {
5046 off2 := auxIntToInt32(v_1.AuxInt)
5047 sym2 := auxToSym(v_1.Aux)
5050 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
5053 v.reset(Op386MOVWLSX)
5057 // match: (MOVWLSXload [off1] {sym1} (LEAL [off2] {sym2} base) mem)
5058 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
5059 // result: (MOVWLSXload [off1+off2] {mergeSym(sym1,sym2)} base mem)
5061 off1 := auxIntToInt32(v.AuxInt)
5062 sym1 := auxToSym(v.Aux)
5063 if v_0.Op != Op386LEAL {
5066 off2 := auxIntToInt32(v_0.AuxInt)
5067 sym2 := auxToSym(v_0.Aux)
5070 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
5073 v.reset(Op386MOVWLSXload)
5074 v.AuxInt = int32ToAuxInt(off1 + off2)
5075 v.Aux = symToAux(mergeSym(sym1, sym2))
5076 v.AddArg2(base, mem)
5081 func rewriteValue386_Op386MOVWLZX(v *Value) bool {
5084 // match: (MOVWLZX x:(MOVWload [off] {sym} ptr mem))
5085 // cond: x.Uses == 1 && clobber(x)
5086 // result: @x.Block (MOVWload <v.Type> [off] {sym} ptr mem)
5089 if x.Op != Op386MOVWload {
5092 off := auxIntToInt32(x.AuxInt)
5093 sym := auxToSym(x.Aux)
5096 if !(x.Uses == 1 && clobber(x)) {
5100 v0 := b.NewValue0(x.Pos, Op386MOVWload, v.Type)
5102 v0.AuxInt = int32ToAuxInt(off)
5103 v0.Aux = symToAux(sym)
5104 v0.AddArg2(ptr, mem)
5107 // match: (MOVWLZX (ANDLconst [c] x))
5108 // result: (ANDLconst [c & 0xffff] x)
5110 if v_0.Op != Op386ANDLconst {
5113 c := auxIntToInt32(v_0.AuxInt)
5115 v.reset(Op386ANDLconst)
5116 v.AuxInt = int32ToAuxInt(c & 0xffff)
5122 func rewriteValue386_Op386MOVWload(v *Value) bool {
5126 config := b.Func.Config
5127 // match: (MOVWload [off] {sym} ptr (MOVWstore [off2] {sym2} ptr2 x _))
5128 // cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
5129 // result: (MOVWLZX x)
5131 off := auxIntToInt32(v.AuxInt)
5132 sym := auxToSym(v.Aux)
5134 if v_1.Op != Op386MOVWstore {
5137 off2 := auxIntToInt32(v_1.AuxInt)
5138 sym2 := auxToSym(v_1.Aux)
5141 if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
5144 v.reset(Op386MOVWLZX)
5148 // match: (MOVWload [off1] {sym} (ADDLconst [off2] ptr) mem)
5149 // cond: is32Bit(int64(off1)+int64(off2))
5150 // result: (MOVWload [off1+off2] {sym} ptr mem)
5152 off1 := auxIntToInt32(v.AuxInt)
5153 sym := auxToSym(v.Aux)
5154 if v_0.Op != Op386ADDLconst {
5157 off2 := auxIntToInt32(v_0.AuxInt)
5160 if !(is32Bit(int64(off1) + int64(off2))) {
5163 v.reset(Op386MOVWload)
5164 v.AuxInt = int32ToAuxInt(off1 + off2)
5165 v.Aux = symToAux(sym)
5169 // match: (MOVWload [off1] {sym1} (LEAL [off2] {sym2} base) mem)
5170 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
5171 // result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} base mem)
5173 off1 := auxIntToInt32(v.AuxInt)
5174 sym1 := auxToSym(v.Aux)
5175 if v_0.Op != Op386LEAL {
5178 off2 := auxIntToInt32(v_0.AuxInt)
5179 sym2 := auxToSym(v_0.Aux)
5182 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
5185 v.reset(Op386MOVWload)
5186 v.AuxInt = int32ToAuxInt(off1 + off2)
5187 v.Aux = symToAux(mergeSym(sym1, sym2))
5188 v.AddArg2(base, mem)
5191 // match: (MOVWload [off] {sym} (SB) _)
5192 // cond: symIsRO(sym)
5193 // result: (MOVLconst [int32(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))])
5195 off := auxIntToInt32(v.AuxInt)
5196 sym := auxToSym(v.Aux)
5197 if v_0.Op != OpSB || !(symIsRO(sym)) {
5200 v.reset(Op386MOVLconst)
5201 v.AuxInt = int32ToAuxInt(int32(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))
5206 func rewriteValue386_Op386MOVWstore(v *Value) bool {
5211 config := b.Func.Config
5212 // match: (MOVWstore [off] {sym} ptr (MOVWLSX x) mem)
5213 // result: (MOVWstore [off] {sym} ptr x mem)
5215 off := auxIntToInt32(v.AuxInt)
5216 sym := auxToSym(v.Aux)
5218 if v_1.Op != Op386MOVWLSX {
5223 v.reset(Op386MOVWstore)
5224 v.AuxInt = int32ToAuxInt(off)
5225 v.Aux = symToAux(sym)
5226 v.AddArg3(ptr, x, mem)
5229 // match: (MOVWstore [off] {sym} ptr (MOVWLZX x) mem)
5230 // result: (MOVWstore [off] {sym} ptr x mem)
5232 off := auxIntToInt32(v.AuxInt)
5233 sym := auxToSym(v.Aux)
5235 if v_1.Op != Op386MOVWLZX {
5240 v.reset(Op386MOVWstore)
5241 v.AuxInt = int32ToAuxInt(off)
5242 v.Aux = symToAux(sym)
5243 v.AddArg3(ptr, x, mem)
5246 // match: (MOVWstore [off1] {sym} (ADDLconst [off2] ptr) val mem)
5247 // cond: is32Bit(int64(off1)+int64(off2))
5248 // result: (MOVWstore [off1+off2] {sym} ptr val mem)
5250 off1 := auxIntToInt32(v.AuxInt)
5251 sym := auxToSym(v.Aux)
5252 if v_0.Op != Op386ADDLconst {
5255 off2 := auxIntToInt32(v_0.AuxInt)
5259 if !(is32Bit(int64(off1) + int64(off2))) {
5262 v.reset(Op386MOVWstore)
5263 v.AuxInt = int32ToAuxInt(off1 + off2)
5264 v.Aux = symToAux(sym)
5265 v.AddArg3(ptr, val, mem)
5268 // match: (MOVWstore [off] {sym} ptr (MOVLconst [c]) mem)
5269 // result: (MOVWstoreconst [makeValAndOff(c,off)] {sym} ptr mem)
5271 off := auxIntToInt32(v.AuxInt)
5272 sym := auxToSym(v.Aux)
5274 if v_1.Op != Op386MOVLconst {
5277 c := auxIntToInt32(v_1.AuxInt)
5279 v.reset(Op386MOVWstoreconst)
5280 v.AuxInt = valAndOffToAuxInt(makeValAndOff(c, off))
5281 v.Aux = symToAux(sym)
5285 // match: (MOVWstore [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
5286 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
5287 // result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} base val mem)
5289 off1 := auxIntToInt32(v.AuxInt)
5290 sym1 := auxToSym(v.Aux)
5291 if v_0.Op != Op386LEAL {
5294 off2 := auxIntToInt32(v_0.AuxInt)
5295 sym2 := auxToSym(v_0.Aux)
5299 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
5302 v.reset(Op386MOVWstore)
5303 v.AuxInt = int32ToAuxInt(off1 + off2)
5304 v.Aux = symToAux(mergeSym(sym1, sym2))
5305 v.AddArg3(base, val, mem)
5308 // match: (MOVWstore [i] {s} p (SHRLconst [16] w) x:(MOVWstore [i-2] {s} p w mem))
5309 // cond: x.Uses == 1 && clobber(x)
5310 // result: (MOVLstore [i-2] {s} p w mem)
5312 i := auxIntToInt32(v.AuxInt)
5313 s := auxToSym(v.Aux)
5315 if v_1.Op != Op386SHRLconst || auxIntToInt32(v_1.AuxInt) != 16 {
5320 if x.Op != Op386MOVWstore || auxIntToInt32(x.AuxInt) != i-2 || auxToSym(x.Aux) != s {
5324 if p != x.Args[0] || w != x.Args[1] || !(x.Uses == 1 && clobber(x)) {
5327 v.reset(Op386MOVLstore)
5328 v.AuxInt = int32ToAuxInt(i - 2)
5330 v.AddArg3(p, w, mem)
5333 // match: (MOVWstore [i] {s} p (SHRLconst [j] w) x:(MOVWstore [i-2] {s} p w0:(SHRLconst [j-16] w) mem))
5334 // cond: x.Uses == 1 && clobber(x)
5335 // result: (MOVLstore [i-2] {s} p w0 mem)
5337 i := auxIntToInt32(v.AuxInt)
5338 s := auxToSym(v.Aux)
5340 if v_1.Op != Op386SHRLconst {
5343 j := auxIntToInt32(v_1.AuxInt)
5346 if x.Op != Op386MOVWstore || auxIntToInt32(x.AuxInt) != i-2 || auxToSym(x.Aux) != s {
5354 if w0.Op != Op386SHRLconst || auxIntToInt32(w0.AuxInt) != j-16 || w != w0.Args[0] || !(x.Uses == 1 && clobber(x)) {
5357 v.reset(Op386MOVLstore)
5358 v.AuxInt = int32ToAuxInt(i - 2)
5360 v.AddArg3(p, w0, mem)
5363 // match: (MOVWstore [i] {s} p1 (SHRLconst [16] w) x:(MOVWstore [i] {s} p0 w mem))
5364 // cond: x.Uses == 1 && sequentialAddresses(p0, p1, 2) && clobber(x)
5365 // result: (MOVLstore [i] {s} p0 w mem)
5367 i := auxIntToInt32(v.AuxInt)
5368 s := auxToSym(v.Aux)
5370 if v_1.Op != Op386SHRLconst || auxIntToInt32(v_1.AuxInt) != 16 {
5375 if x.Op != Op386MOVWstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
5380 if w != x.Args[1] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 2) && clobber(x)) {
5383 v.reset(Op386MOVLstore)
5384 v.AuxInt = int32ToAuxInt(i)
5386 v.AddArg3(p0, w, mem)
5389 // match: (MOVWstore [i] {s} p1 (SHRLconst [j] w) x:(MOVWstore [i] {s} p0 w0:(SHRLconst [j-16] w) mem))
5390 // cond: x.Uses == 1 && sequentialAddresses(p0, p1, 2) && clobber(x)
5391 // result: (MOVLstore [i] {s} p0 w0 mem)
5393 i := auxIntToInt32(v.AuxInt)
5394 s := auxToSym(v.Aux)
5396 if v_1.Op != Op386SHRLconst {
5399 j := auxIntToInt32(v_1.AuxInt)
5402 if x.Op != Op386MOVWstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
5408 if w0.Op != Op386SHRLconst || auxIntToInt32(w0.AuxInt) != j-16 || w != w0.Args[0] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 2) && clobber(x)) {
5411 v.reset(Op386MOVLstore)
5412 v.AuxInt = int32ToAuxInt(i)
5414 v.AddArg3(p0, w0, mem)
5419 func rewriteValue386_Op386MOVWstoreconst(v *Value) bool {
5423 config := b.Func.Config
5424 // match: (MOVWstoreconst [sc] {s} (ADDLconst [off] ptr) mem)
5425 // cond: sc.canAdd32(off)
5426 // result: (MOVWstoreconst [sc.addOffset32(off)] {s} ptr mem)
5428 sc := auxIntToValAndOff(v.AuxInt)
5429 s := auxToSym(v.Aux)
5430 if v_0.Op != Op386ADDLconst {
5433 off := auxIntToInt32(v_0.AuxInt)
5436 if !(sc.canAdd32(off)) {
5439 v.reset(Op386MOVWstoreconst)
5440 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
5445 // match: (MOVWstoreconst [sc] {sym1} (LEAL [off] {sym2} ptr) mem)
5446 // cond: canMergeSym(sym1, sym2) && sc.canAdd32(off) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)
5447 // result: (MOVWstoreconst [sc.addOffset32(off)] {mergeSym(sym1, sym2)} ptr mem)
5449 sc := auxIntToValAndOff(v.AuxInt)
5450 sym1 := auxToSym(v.Aux)
5451 if v_0.Op != Op386LEAL {
5454 off := auxIntToInt32(v_0.AuxInt)
5455 sym2 := auxToSym(v_0.Aux)
5458 if !(canMergeSym(sym1, sym2) && sc.canAdd32(off) && (ptr.Op != OpSB || !config.ctxt.Flag_shared)) {
5461 v.reset(Op386MOVWstoreconst)
5462 v.AuxInt = valAndOffToAuxInt(sc.addOffset32(off))
5463 v.Aux = symToAux(mergeSym(sym1, sym2))
5467 // match: (MOVWstoreconst [c] {s} p x:(MOVWstoreconst [a] {s} p mem))
5468 // cond: x.Uses == 1 && a.Off() + 2 == c.Off() && clobber(x)
5469 // result: (MOVLstoreconst [makeValAndOff(a.Val()&0xffff | c.Val()<<16, a.Off())] {s} p mem)
5471 c := auxIntToValAndOff(v.AuxInt)
5472 s := auxToSym(v.Aux)
5475 if x.Op != Op386MOVWstoreconst {
5478 a := auxIntToValAndOff(x.AuxInt)
5479 if auxToSym(x.Aux) != s {
5483 if p != x.Args[0] || !(x.Uses == 1 && a.Off()+2 == c.Off() && clobber(x)) {
5486 v.reset(Op386MOVLstoreconst)
5487 v.AuxInt = valAndOffToAuxInt(makeValAndOff(a.Val()&0xffff|c.Val()<<16, a.Off()))
5492 // match: (MOVWstoreconst [a] {s} p x:(MOVWstoreconst [c] {s} p mem))
5493 // cond: x.Uses == 1 && ValAndOff(a).Off() + 2 == ValAndOff(c).Off() && clobber(x)
5494 // result: (MOVLstoreconst [makeValAndOff(a.Val()&0xffff | c.Val()<<16, a.Off())] {s} p mem)
5496 a := auxIntToValAndOff(v.AuxInt)
5497 s := auxToSym(v.Aux)
5500 if x.Op != Op386MOVWstoreconst {
5503 c := auxIntToValAndOff(x.AuxInt)
5504 if auxToSym(x.Aux) != s {
5508 if p != x.Args[0] || !(x.Uses == 1 && ValAndOff(a).Off()+2 == ValAndOff(c).Off() && clobber(x)) {
5511 v.reset(Op386MOVLstoreconst)
5512 v.AuxInt = valAndOffToAuxInt(makeValAndOff(a.Val()&0xffff|c.Val()<<16, a.Off()))
5517 // match: (MOVWstoreconst [c] {s} p1 x:(MOVWstoreconst [a] {s} p0 mem))
5518 // cond: x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 2) && clobber(x)
5519 // result: (MOVLstoreconst [makeValAndOff(a.Val()&0xffff | c.Val()<<16, a.Off())] {s} p0 mem)
5521 c := auxIntToValAndOff(v.AuxInt)
5522 s := auxToSym(v.Aux)
5525 if x.Op != Op386MOVWstoreconst {
5528 a := auxIntToValAndOff(x.AuxInt)
5529 if auxToSym(x.Aux) != s {
5534 if !(x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 2) && clobber(x)) {
5537 v.reset(Op386MOVLstoreconst)
5538 v.AuxInt = valAndOffToAuxInt(makeValAndOff(a.Val()&0xffff|c.Val()<<16, a.Off()))
5543 // match: (MOVWstoreconst [a] {s} p0 x:(MOVWstoreconst [c] {s} p1 mem))
5544 // cond: x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 2) && clobber(x)
5545 // result: (MOVLstoreconst [makeValAndOff(a.Val()&0xffff | c.Val()<<16, a.Off())] {s} p0 mem)
5547 a := auxIntToValAndOff(v.AuxInt)
5548 s := auxToSym(v.Aux)
5551 if x.Op != Op386MOVWstoreconst {
5554 c := auxIntToValAndOff(x.AuxInt)
5555 if auxToSym(x.Aux) != s {
5560 if !(x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 2) && clobber(x)) {
5563 v.reset(Op386MOVLstoreconst)
5564 v.AuxInt = valAndOffToAuxInt(makeValAndOff(a.Val()&0xffff|c.Val()<<16, a.Off()))
5571 func rewriteValue386_Op386MULL(v *Value) bool {
5574 // match: (MULL x (MOVLconst [c]))
5575 // result: (MULLconst [c] x)
5577 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5579 if v_1.Op != Op386MOVLconst {
5582 c := auxIntToInt32(v_1.AuxInt)
5583 v.reset(Op386MULLconst)
5584 v.AuxInt = int32ToAuxInt(c)
5590 // match: (MULL x l:(MOVLload [off] {sym} ptr mem))
5591 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
5592 // result: (MULLload x [off] {sym} ptr mem)
5594 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
5597 if l.Op != Op386MOVLload {
5600 off := auxIntToInt32(l.AuxInt)
5601 sym := auxToSym(l.Aux)
5604 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
5607 v.reset(Op386MULLload)
5608 v.AuxInt = int32ToAuxInt(off)
5609 v.Aux = symToAux(sym)
5610 v.AddArg3(x, ptr, mem)
5617 func rewriteValue386_Op386MULLconst(v *Value) bool {
5620 // match: (MULLconst [c] (MULLconst [d] x))
5621 // result: (MULLconst [c * d] x)
5623 c := auxIntToInt32(v.AuxInt)
5624 if v_0.Op != Op386MULLconst {
5627 d := auxIntToInt32(v_0.AuxInt)
5629 v.reset(Op386MULLconst)
5630 v.AuxInt = int32ToAuxInt(c * d)
5634 // match: (MULLconst [-9] x)
5635 // result: (NEGL (LEAL8 <v.Type> x x))
5637 if auxIntToInt32(v.AuxInt) != -9 {
5642 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
5647 // match: (MULLconst [-5] x)
5648 // result: (NEGL (LEAL4 <v.Type> x x))
5650 if auxIntToInt32(v.AuxInt) != -5 {
5655 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
5660 // match: (MULLconst [-3] x)
5661 // result: (NEGL (LEAL2 <v.Type> x x))
5663 if auxIntToInt32(v.AuxInt) != -3 {
5668 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5673 // match: (MULLconst [-1] x)
5676 if auxIntToInt32(v.AuxInt) != -1 {
5684 // match: (MULLconst [0] _)
5685 // result: (MOVLconst [0])
5687 if auxIntToInt32(v.AuxInt) != 0 {
5690 v.reset(Op386MOVLconst)
5691 v.AuxInt = int32ToAuxInt(0)
5694 // match: (MULLconst [1] x)
5697 if auxIntToInt32(v.AuxInt) != 1 {
5704 // match: (MULLconst [3] x)
5705 // result: (LEAL2 x x)
5707 if auxIntToInt32(v.AuxInt) != 3 {
5715 // match: (MULLconst [5] x)
5716 // result: (LEAL4 x x)
5718 if auxIntToInt32(v.AuxInt) != 5 {
5726 // match: (MULLconst [7] x)
5727 // result: (LEAL2 x (LEAL2 <v.Type> x x))
5729 if auxIntToInt32(v.AuxInt) != 7 {
5734 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5739 // match: (MULLconst [9] x)
5740 // result: (LEAL8 x x)
5742 if auxIntToInt32(v.AuxInt) != 9 {
5750 // match: (MULLconst [11] x)
5751 // result: (LEAL2 x (LEAL4 <v.Type> x x))
5753 if auxIntToInt32(v.AuxInt) != 11 {
5758 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
5763 // match: (MULLconst [13] x)
5764 // result: (LEAL4 x (LEAL2 <v.Type> x x))
5766 if auxIntToInt32(v.AuxInt) != 13 {
5771 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5776 // match: (MULLconst [19] x)
5777 // result: (LEAL2 x (LEAL8 <v.Type> x x))
5779 if auxIntToInt32(v.AuxInt) != 19 {
5784 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
5789 // match: (MULLconst [21] x)
5790 // result: (LEAL4 x (LEAL4 <v.Type> x x))
5792 if auxIntToInt32(v.AuxInt) != 21 {
5797 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
5802 // match: (MULLconst [25] x)
5803 // result: (LEAL8 x (LEAL2 <v.Type> x x))
5805 if auxIntToInt32(v.AuxInt) != 25 {
5810 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5815 // match: (MULLconst [27] x)
5816 // result: (LEAL8 (LEAL2 <v.Type> x x) (LEAL2 <v.Type> x x))
5818 if auxIntToInt32(v.AuxInt) != 27 {
5823 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5828 // match: (MULLconst [37] x)
5829 // result: (LEAL4 x (LEAL8 <v.Type> x x))
5831 if auxIntToInt32(v.AuxInt) != 37 {
5836 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
5841 // match: (MULLconst [41] x)
5842 // result: (LEAL8 x (LEAL4 <v.Type> x x))
5844 if auxIntToInt32(v.AuxInt) != 41 {
5849 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
5854 // match: (MULLconst [45] x)
5855 // result: (LEAL8 (LEAL4 <v.Type> x x) (LEAL4 <v.Type> x x))
5857 if auxIntToInt32(v.AuxInt) != 45 {
5862 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
5867 // match: (MULLconst [73] x)
5868 // result: (LEAL8 x (LEAL8 <v.Type> x x))
5870 if auxIntToInt32(v.AuxInt) != 73 {
5875 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
5880 // match: (MULLconst [81] x)
5881 // result: (LEAL8 (LEAL8 <v.Type> x x) (LEAL8 <v.Type> x x))
5883 if auxIntToInt32(v.AuxInt) != 81 {
5888 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
5893 // match: (MULLconst [c] x)
5894 // cond: isPowerOfTwo32(c+1) && c >= 15
5895 // result: (SUBL (SHLLconst <v.Type> [int32(log32(c+1))] x) x)
5897 c := auxIntToInt32(v.AuxInt)
5899 if !(isPowerOfTwo32(c+1) && c >= 15) {
5903 v0 := b.NewValue0(v.Pos, Op386SHLLconst, v.Type)
5904 v0.AuxInt = int32ToAuxInt(int32(log32(c + 1)))
5909 // match: (MULLconst [c] x)
5910 // cond: isPowerOfTwo32(c-1) && c >= 17
5911 // result: (LEAL1 (SHLLconst <v.Type> [int32(log32(c-1))] x) x)
5913 c := auxIntToInt32(v.AuxInt)
5915 if !(isPowerOfTwo32(c-1) && c >= 17) {
5919 v0 := b.NewValue0(v.Pos, Op386SHLLconst, v.Type)
5920 v0.AuxInt = int32ToAuxInt(int32(log32(c - 1)))
5925 // match: (MULLconst [c] x)
5926 // cond: isPowerOfTwo32(c-2) && c >= 34
5927 // result: (LEAL2 (SHLLconst <v.Type> [int32(log32(c-2))] x) x)
5929 c := auxIntToInt32(v.AuxInt)
5931 if !(isPowerOfTwo32(c-2) && c >= 34) {
5935 v0 := b.NewValue0(v.Pos, Op386SHLLconst, v.Type)
5936 v0.AuxInt = int32ToAuxInt(int32(log32(c - 2)))
5941 // match: (MULLconst [c] x)
5942 // cond: isPowerOfTwo32(c-4) && c >= 68
5943 // result: (LEAL4 (SHLLconst <v.Type> [int32(log32(c-4))] x) x)
5945 c := auxIntToInt32(v.AuxInt)
5947 if !(isPowerOfTwo32(c-4) && c >= 68) {
5951 v0 := b.NewValue0(v.Pos, Op386SHLLconst, v.Type)
5952 v0.AuxInt = int32ToAuxInt(int32(log32(c - 4)))
5957 // match: (MULLconst [c] x)
5958 // cond: isPowerOfTwo32(c-8) && c >= 136
5959 // result: (LEAL8 (SHLLconst <v.Type> [int32(log32(c-8))] x) x)
5961 c := auxIntToInt32(v.AuxInt)
5963 if !(isPowerOfTwo32(c-8) && c >= 136) {
5967 v0 := b.NewValue0(v.Pos, Op386SHLLconst, v.Type)
5968 v0.AuxInt = int32ToAuxInt(int32(log32(c - 8)))
5973 // match: (MULLconst [c] x)
5974 // cond: c%3 == 0 && isPowerOfTwo32(c/3)
5975 // result: (SHLLconst [int32(log32(c/3))] (LEAL2 <v.Type> x x))
5977 c := auxIntToInt32(v.AuxInt)
5979 if !(c%3 == 0 && isPowerOfTwo32(c/3)) {
5982 v.reset(Op386SHLLconst)
5983 v.AuxInt = int32ToAuxInt(int32(log32(c / 3)))
5984 v0 := b.NewValue0(v.Pos, Op386LEAL2, v.Type)
5989 // match: (MULLconst [c] x)
5990 // cond: c%5 == 0 && isPowerOfTwo32(c/5)
5991 // result: (SHLLconst [int32(log32(c/5))] (LEAL4 <v.Type> x x))
5993 c := auxIntToInt32(v.AuxInt)
5995 if !(c%5 == 0 && isPowerOfTwo32(c/5)) {
5998 v.reset(Op386SHLLconst)
5999 v.AuxInt = int32ToAuxInt(int32(log32(c / 5)))
6000 v0 := b.NewValue0(v.Pos, Op386LEAL4, v.Type)
6005 // match: (MULLconst [c] x)
6006 // cond: c%9 == 0 && isPowerOfTwo32(c/9)
6007 // result: (SHLLconst [int32(log32(c/9))] (LEAL8 <v.Type> x x))
6009 c := auxIntToInt32(v.AuxInt)
6011 if !(c%9 == 0 && isPowerOfTwo32(c/9)) {
6014 v.reset(Op386SHLLconst)
6015 v.AuxInt = int32ToAuxInt(int32(log32(c / 9)))
6016 v0 := b.NewValue0(v.Pos, Op386LEAL8, v.Type)
6021 // match: (MULLconst [c] (MOVLconst [d]))
6022 // result: (MOVLconst [c*d])
6024 c := auxIntToInt32(v.AuxInt)
6025 if v_0.Op != Op386MOVLconst {
6028 d := auxIntToInt32(v_0.AuxInt)
6029 v.reset(Op386MOVLconst)
6030 v.AuxInt = int32ToAuxInt(c * d)
6035 func rewriteValue386_Op386MULLload(v *Value) bool {
6040 config := b.Func.Config
6041 // match: (MULLload [off1] {sym} val (ADDLconst [off2] base) mem)
6042 // cond: is32Bit(int64(off1)+int64(off2))
6043 // result: (MULLload [off1+off2] {sym} val base mem)
6045 off1 := auxIntToInt32(v.AuxInt)
6046 sym := auxToSym(v.Aux)
6048 if v_1.Op != Op386ADDLconst {
6051 off2 := auxIntToInt32(v_1.AuxInt)
6054 if !(is32Bit(int64(off1) + int64(off2))) {
6057 v.reset(Op386MULLload)
6058 v.AuxInt = int32ToAuxInt(off1 + off2)
6059 v.Aux = symToAux(sym)
6060 v.AddArg3(val, base, mem)
6063 // match: (MULLload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
6064 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
6065 // result: (MULLload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
6067 off1 := auxIntToInt32(v.AuxInt)
6068 sym1 := auxToSym(v.Aux)
6070 if v_1.Op != Op386LEAL {
6073 off2 := auxIntToInt32(v_1.AuxInt)
6074 sym2 := auxToSym(v_1.Aux)
6077 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
6080 v.reset(Op386MULLload)
6081 v.AuxInt = int32ToAuxInt(off1 + off2)
6082 v.Aux = symToAux(mergeSym(sym1, sym2))
6083 v.AddArg3(val, base, mem)
6088 func rewriteValue386_Op386MULSD(v *Value) bool {
6091 // match: (MULSD x l:(MOVSDload [off] {sym} ptr mem))
6092 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
6093 // result: (MULSDload x [off] {sym} ptr mem)
6095 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6098 if l.Op != Op386MOVSDload {
6101 off := auxIntToInt32(l.AuxInt)
6102 sym := auxToSym(l.Aux)
6105 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
6108 v.reset(Op386MULSDload)
6109 v.AuxInt = int32ToAuxInt(off)
6110 v.Aux = symToAux(sym)
6111 v.AddArg3(x, ptr, mem)
6118 func rewriteValue386_Op386MULSDload(v *Value) bool {
6123 config := b.Func.Config
6124 // match: (MULSDload [off1] {sym} val (ADDLconst [off2] base) mem)
6125 // cond: is32Bit(int64(off1)+int64(off2))
6126 // result: (MULSDload [off1+off2] {sym} val base mem)
6128 off1 := auxIntToInt32(v.AuxInt)
6129 sym := auxToSym(v.Aux)
6131 if v_1.Op != Op386ADDLconst {
6134 off2 := auxIntToInt32(v_1.AuxInt)
6137 if !(is32Bit(int64(off1) + int64(off2))) {
6140 v.reset(Op386MULSDload)
6141 v.AuxInt = int32ToAuxInt(off1 + off2)
6142 v.Aux = symToAux(sym)
6143 v.AddArg3(val, base, mem)
6146 // match: (MULSDload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
6147 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
6148 // result: (MULSDload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
6150 off1 := auxIntToInt32(v.AuxInt)
6151 sym1 := auxToSym(v.Aux)
6153 if v_1.Op != Op386LEAL {
6156 off2 := auxIntToInt32(v_1.AuxInt)
6157 sym2 := auxToSym(v_1.Aux)
6160 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
6163 v.reset(Op386MULSDload)
6164 v.AuxInt = int32ToAuxInt(off1 + off2)
6165 v.Aux = symToAux(mergeSym(sym1, sym2))
6166 v.AddArg3(val, base, mem)
6171 func rewriteValue386_Op386MULSS(v *Value) bool {
6174 // match: (MULSS x l:(MOVSSload [off] {sym} ptr mem))
6175 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
6176 // result: (MULSSload x [off] {sym} ptr mem)
6178 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6181 if l.Op != Op386MOVSSload {
6184 off := auxIntToInt32(l.AuxInt)
6185 sym := auxToSym(l.Aux)
6188 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
6191 v.reset(Op386MULSSload)
6192 v.AuxInt = int32ToAuxInt(off)
6193 v.Aux = symToAux(sym)
6194 v.AddArg3(x, ptr, mem)
6201 func rewriteValue386_Op386MULSSload(v *Value) bool {
6206 config := b.Func.Config
6207 // match: (MULSSload [off1] {sym} val (ADDLconst [off2] base) mem)
6208 // cond: is32Bit(int64(off1)+int64(off2))
6209 // result: (MULSSload [off1+off2] {sym} val base mem)
6211 off1 := auxIntToInt32(v.AuxInt)
6212 sym := auxToSym(v.Aux)
6214 if v_1.Op != Op386ADDLconst {
6217 off2 := auxIntToInt32(v_1.AuxInt)
6220 if !(is32Bit(int64(off1) + int64(off2))) {
6223 v.reset(Op386MULSSload)
6224 v.AuxInt = int32ToAuxInt(off1 + off2)
6225 v.Aux = symToAux(sym)
6226 v.AddArg3(val, base, mem)
6229 // match: (MULSSload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
6230 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
6231 // result: (MULSSload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
6233 off1 := auxIntToInt32(v.AuxInt)
6234 sym1 := auxToSym(v.Aux)
6236 if v_1.Op != Op386LEAL {
6239 off2 := auxIntToInt32(v_1.AuxInt)
6240 sym2 := auxToSym(v_1.Aux)
6243 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
6246 v.reset(Op386MULSSload)
6247 v.AuxInt = int32ToAuxInt(off1 + off2)
6248 v.Aux = symToAux(mergeSym(sym1, sym2))
6249 v.AddArg3(val, base, mem)
6254 func rewriteValue386_Op386NEGL(v *Value) bool {
6256 // match: (NEGL (MOVLconst [c]))
6257 // result: (MOVLconst [-c])
6259 if v_0.Op != Op386MOVLconst {
6262 c := auxIntToInt32(v_0.AuxInt)
6263 v.reset(Op386MOVLconst)
6264 v.AuxInt = int32ToAuxInt(-c)
6269 func rewriteValue386_Op386NOTL(v *Value) bool {
6271 // match: (NOTL (MOVLconst [c]))
6272 // result: (MOVLconst [^c])
6274 if v_0.Op != Op386MOVLconst {
6277 c := auxIntToInt32(v_0.AuxInt)
6278 v.reset(Op386MOVLconst)
6279 v.AuxInt = int32ToAuxInt(^c)
6284 func rewriteValue386_Op386ORL(v *Value) bool {
6288 typ := &b.Func.Config.Types
6289 // match: (ORL x (MOVLconst [c]))
6290 // result: (ORLconst [c] x)
6292 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6294 if v_1.Op != Op386MOVLconst {
6297 c := auxIntToInt32(v_1.AuxInt)
6298 v.reset(Op386ORLconst)
6299 v.AuxInt = int32ToAuxInt(c)
6305 // match: ( ORL (SHLLconst [c] x) (SHRLconst [d] x))
6307 // result: (ROLLconst [c] x)
6309 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6310 if v_0.Op != Op386SHLLconst {
6313 c := auxIntToInt32(v_0.AuxInt)
6315 if v_1.Op != Op386SHRLconst {
6318 d := auxIntToInt32(v_1.AuxInt)
6319 if x != v_1.Args[0] || !(d == 32-c) {
6322 v.reset(Op386ROLLconst)
6323 v.AuxInt = int32ToAuxInt(c)
6329 // match: ( ORL <t> (SHLLconst x [c]) (SHRWconst x [d]))
6330 // cond: c < 16 && d == int16(16-c) && t.Size() == 2
6331 // result: (ROLWconst x [int16(c)])
6334 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6335 if v_0.Op != Op386SHLLconst {
6338 c := auxIntToInt32(v_0.AuxInt)
6340 if v_1.Op != Op386SHRWconst {
6343 d := auxIntToInt16(v_1.AuxInt)
6344 if x != v_1.Args[0] || !(c < 16 && d == int16(16-c) && t.Size() == 2) {
6347 v.reset(Op386ROLWconst)
6348 v.AuxInt = int16ToAuxInt(int16(c))
6354 // match: ( ORL <t> (SHLLconst x [c]) (SHRBconst x [d]))
6355 // cond: c < 8 && d == int8(8-c) && t.Size() == 1
6356 // result: (ROLBconst x [int8(c)])
6359 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6360 if v_0.Op != Op386SHLLconst {
6363 c := auxIntToInt32(v_0.AuxInt)
6365 if v_1.Op != Op386SHRBconst {
6368 d := auxIntToInt8(v_1.AuxInt)
6369 if x != v_1.Args[0] || !(c < 8 && d == int8(8-c) && t.Size() == 1) {
6372 v.reset(Op386ROLBconst)
6373 v.AuxInt = int8ToAuxInt(int8(c))
6379 // match: (ORL x l:(MOVLload [off] {sym} ptr mem))
6380 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
6381 // result: (ORLload x [off] {sym} ptr mem)
6383 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6386 if l.Op != Op386MOVLload {
6389 off := auxIntToInt32(l.AuxInt)
6390 sym := auxToSym(l.Aux)
6393 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
6396 v.reset(Op386ORLload)
6397 v.AuxInt = int32ToAuxInt(off)
6398 v.Aux = symToAux(sym)
6399 v.AddArg3(x, ptr, mem)
6414 // match: (ORL x0:(MOVBload [i0] {s} p mem) s0:(SHLLconst [8] x1:(MOVBload [i1] {s} p mem)))
6415 // cond: i1 == i0+1 && x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && mergePoint(b,x0,x1) != nil && clobber(x0, x1, s0)
6416 // result: @mergePoint(b,x0,x1) (MOVWload [i0] {s} p mem)
6418 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6420 if x0.Op != Op386MOVBload {
6423 i0 := auxIntToInt32(x0.AuxInt)
6424 s := auxToSym(x0.Aux)
6428 if s0.Op != Op386SHLLconst || auxIntToInt32(s0.AuxInt) != 8 {
6432 if x1.Op != Op386MOVBload {
6435 i1 := auxIntToInt32(x1.AuxInt)
6436 if auxToSym(x1.Aux) != s {
6440 if p != x1.Args[0] || mem != x1.Args[1] || !(i1 == i0+1 && x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && mergePoint(b, x0, x1) != nil && clobber(x0, x1, s0)) {
6443 b = mergePoint(b, x0, x1)
6444 v0 := b.NewValue0(x1.Pos, Op386MOVWload, typ.UInt16)
6446 v0.AuxInt = int32ToAuxInt(i0)
6447 v0.Aux = symToAux(s)
6453 // match: (ORL x0:(MOVBload [i] {s} p0 mem) s0:(SHLLconst [8] x1:(MOVBload [i] {s} p1 mem)))
6454 // cond: x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && sequentialAddresses(p0, p1, 1) && mergePoint(b,x0,x1) != nil && clobber(x0, x1, s0)
6455 // result: @mergePoint(b,x0,x1) (MOVWload [i] {s} p0 mem)
6457 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6459 if x0.Op != Op386MOVBload {
6462 i := auxIntToInt32(x0.AuxInt)
6463 s := auxToSym(x0.Aux)
6467 if s0.Op != Op386SHLLconst || auxIntToInt32(s0.AuxInt) != 8 {
6471 if x1.Op != Op386MOVBload || auxIntToInt32(x1.AuxInt) != i || auxToSym(x1.Aux) != s {
6476 if mem != x1.Args[1] || !(x0.Uses == 1 && x1.Uses == 1 && s0.Uses == 1 && sequentialAddresses(p0, p1, 1) && mergePoint(b, x0, x1) != nil && clobber(x0, x1, s0)) {
6479 b = mergePoint(b, x0, x1)
6480 v0 := b.NewValue0(x1.Pos, Op386MOVWload, typ.UInt16)
6482 v0.AuxInt = int32ToAuxInt(i)
6483 v0.Aux = symToAux(s)
6489 // match: (ORL o0:(ORL x0:(MOVWload [i0] {s} p mem) s0:(SHLLconst [16] x1:(MOVBload [i2] {s} p mem))) s1:(SHLLconst [24] x2:(MOVBload [i3] {s} p mem)))
6490 // cond: i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && o0.Uses == 1 && mergePoint(b,x0,x1,x2) != nil && clobber(x0, x1, x2, s0, s1, o0)
6491 // result: @mergePoint(b,x0,x1,x2) (MOVLload [i0] {s} p mem)
6493 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6495 if o0.Op != Op386ORL {
6501 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
6503 if x0.Op != Op386MOVWload {
6506 i0 := auxIntToInt32(x0.AuxInt)
6507 s := auxToSym(x0.Aux)
6511 if s0.Op != Op386SHLLconst || auxIntToInt32(s0.AuxInt) != 16 {
6515 if x1.Op != Op386MOVBload {
6518 i2 := auxIntToInt32(x1.AuxInt)
6519 if auxToSym(x1.Aux) != s {
6523 if p != x1.Args[0] || mem != x1.Args[1] {
6527 if s1.Op != Op386SHLLconst || auxIntToInt32(s1.AuxInt) != 24 {
6531 if x2.Op != Op386MOVBload {
6534 i3 := auxIntToInt32(x2.AuxInt)
6535 if auxToSym(x2.Aux) != s {
6539 if p != x2.Args[0] || mem != x2.Args[1] || !(i2 == i0+2 && i3 == i0+3 && x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && o0.Uses == 1 && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) {
6542 b = mergePoint(b, x0, x1, x2)
6543 v0 := b.NewValue0(x2.Pos, Op386MOVLload, typ.UInt32)
6545 v0.AuxInt = int32ToAuxInt(i0)
6546 v0.Aux = symToAux(s)
6553 // match: (ORL o0:(ORL x0:(MOVWload [i] {s} p0 mem) s0:(SHLLconst [16] x1:(MOVBload [i] {s} p1 mem))) s1:(SHLLconst [24] x2:(MOVBload [i] {s} p2 mem)))
6554 // cond: x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && o0.Uses == 1 && sequentialAddresses(p0, p1, 2) && sequentialAddresses(p1, p2, 1) && mergePoint(b,x0,x1,x2) != nil && clobber(x0, x1, x2, s0, s1, o0)
6555 // result: @mergePoint(b,x0,x1,x2) (MOVLload [i] {s} p0 mem)
6557 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
6559 if o0.Op != Op386ORL {
6565 for _i1 := 0; _i1 <= 1; _i1, o0_0, o0_1 = _i1+1, o0_1, o0_0 {
6567 if x0.Op != Op386MOVWload {
6570 i := auxIntToInt32(x0.AuxInt)
6571 s := auxToSym(x0.Aux)
6575 if s0.Op != Op386SHLLconst || auxIntToInt32(s0.AuxInt) != 16 {
6579 if x1.Op != Op386MOVBload || auxIntToInt32(x1.AuxInt) != i || auxToSym(x1.Aux) != s {
6584 if mem != x1.Args[1] {
6588 if s1.Op != Op386SHLLconst || auxIntToInt32(s1.AuxInt) != 24 {
6592 if x2.Op != Op386MOVBload || auxIntToInt32(x2.AuxInt) != i || auxToSym(x2.Aux) != s {
6597 if mem != x2.Args[1] || !(x0.Uses == 1 && x1.Uses == 1 && x2.Uses == 1 && s0.Uses == 1 && s1.Uses == 1 && o0.Uses == 1 && sequentialAddresses(p0, p1, 2) && sequentialAddresses(p1, p2, 1) && mergePoint(b, x0, x1, x2) != nil && clobber(x0, x1, x2, s0, s1, o0)) {
6600 b = mergePoint(b, x0, x1, x2)
6601 v0 := b.NewValue0(x2.Pos, Op386MOVLload, typ.UInt32)
6603 v0.AuxInt = int32ToAuxInt(i)
6604 v0.Aux = symToAux(s)
6613 func rewriteValue386_Op386ORLconst(v *Value) bool {
6615 // match: (ORLconst [c] x)
6619 c := auxIntToInt32(v.AuxInt)
6627 // match: (ORLconst [c] _)
6629 // result: (MOVLconst [-1])
6631 c := auxIntToInt32(v.AuxInt)
6635 v.reset(Op386MOVLconst)
6636 v.AuxInt = int32ToAuxInt(-1)
6639 // match: (ORLconst [c] (MOVLconst [d]))
6640 // result: (MOVLconst [c|d])
6642 c := auxIntToInt32(v.AuxInt)
6643 if v_0.Op != Op386MOVLconst {
6646 d := auxIntToInt32(v_0.AuxInt)
6647 v.reset(Op386MOVLconst)
6648 v.AuxInt = int32ToAuxInt(c | d)
6653 func rewriteValue386_Op386ORLconstmodify(v *Value) bool {
6657 config := b.Func.Config
6658 // match: (ORLconstmodify [valoff1] {sym} (ADDLconst [off2] base) mem)
6659 // cond: valoff1.canAdd32(off2)
6660 // result: (ORLconstmodify [valoff1.addOffset32(off2)] {sym} base mem)
6662 valoff1 := auxIntToValAndOff(v.AuxInt)
6663 sym := auxToSym(v.Aux)
6664 if v_0.Op != Op386ADDLconst {
6667 off2 := auxIntToInt32(v_0.AuxInt)
6670 if !(valoff1.canAdd32(off2)) {
6673 v.reset(Op386ORLconstmodify)
6674 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
6675 v.Aux = symToAux(sym)
6676 v.AddArg2(base, mem)
6679 // match: (ORLconstmodify [valoff1] {sym1} (LEAL [off2] {sym2} base) mem)
6680 // cond: valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
6681 // result: (ORLconstmodify [valoff1.addOffset32(off2)] {mergeSym(sym1,sym2)} base mem)
6683 valoff1 := auxIntToValAndOff(v.AuxInt)
6684 sym1 := auxToSym(v.Aux)
6685 if v_0.Op != Op386LEAL {
6688 off2 := auxIntToInt32(v_0.AuxInt)
6689 sym2 := auxToSym(v_0.Aux)
6692 if !(valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
6695 v.reset(Op386ORLconstmodify)
6696 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
6697 v.Aux = symToAux(mergeSym(sym1, sym2))
6698 v.AddArg2(base, mem)
6703 func rewriteValue386_Op386ORLload(v *Value) bool {
6708 config := b.Func.Config
6709 // match: (ORLload [off1] {sym} val (ADDLconst [off2] base) mem)
6710 // cond: is32Bit(int64(off1)+int64(off2))
6711 // result: (ORLload [off1+off2] {sym} val base mem)
6713 off1 := auxIntToInt32(v.AuxInt)
6714 sym := auxToSym(v.Aux)
6716 if v_1.Op != Op386ADDLconst {
6719 off2 := auxIntToInt32(v_1.AuxInt)
6722 if !(is32Bit(int64(off1) + int64(off2))) {
6725 v.reset(Op386ORLload)
6726 v.AuxInt = int32ToAuxInt(off1 + off2)
6727 v.Aux = symToAux(sym)
6728 v.AddArg3(val, base, mem)
6731 // match: (ORLload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
6732 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
6733 // result: (ORLload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
6735 off1 := auxIntToInt32(v.AuxInt)
6736 sym1 := auxToSym(v.Aux)
6738 if v_1.Op != Op386LEAL {
6741 off2 := auxIntToInt32(v_1.AuxInt)
6742 sym2 := auxToSym(v_1.Aux)
6745 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
6748 v.reset(Op386ORLload)
6749 v.AuxInt = int32ToAuxInt(off1 + off2)
6750 v.Aux = symToAux(mergeSym(sym1, sym2))
6751 v.AddArg3(val, base, mem)
6756 func rewriteValue386_Op386ORLmodify(v *Value) bool {
6761 config := b.Func.Config
6762 // match: (ORLmodify [off1] {sym} (ADDLconst [off2] base) val mem)
6763 // cond: is32Bit(int64(off1)+int64(off2))
6764 // result: (ORLmodify [off1+off2] {sym} base val mem)
6766 off1 := auxIntToInt32(v.AuxInt)
6767 sym := auxToSym(v.Aux)
6768 if v_0.Op != Op386ADDLconst {
6771 off2 := auxIntToInt32(v_0.AuxInt)
6775 if !(is32Bit(int64(off1) + int64(off2))) {
6778 v.reset(Op386ORLmodify)
6779 v.AuxInt = int32ToAuxInt(off1 + off2)
6780 v.Aux = symToAux(sym)
6781 v.AddArg3(base, val, mem)
6784 // match: (ORLmodify [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
6785 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
6786 // result: (ORLmodify [off1+off2] {mergeSym(sym1,sym2)} base val mem)
6788 off1 := auxIntToInt32(v.AuxInt)
6789 sym1 := auxToSym(v.Aux)
6790 if v_0.Op != Op386LEAL {
6793 off2 := auxIntToInt32(v_0.AuxInt)
6794 sym2 := auxToSym(v_0.Aux)
6798 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
6801 v.reset(Op386ORLmodify)
6802 v.AuxInt = int32ToAuxInt(off1 + off2)
6803 v.Aux = symToAux(mergeSym(sym1, sym2))
6804 v.AddArg3(base, val, mem)
6809 func rewriteValue386_Op386ROLBconst(v *Value) bool {
6811 // match: (ROLBconst [c] (ROLBconst [d] x))
6812 // result: (ROLBconst [(c+d)& 7] x)
6814 c := auxIntToInt8(v.AuxInt)
6815 if v_0.Op != Op386ROLBconst {
6818 d := auxIntToInt8(v_0.AuxInt)
6820 v.reset(Op386ROLBconst)
6821 v.AuxInt = int8ToAuxInt((c + d) & 7)
6825 // match: (ROLBconst [0] x)
6828 if auxIntToInt8(v.AuxInt) != 0 {
6837 func rewriteValue386_Op386ROLLconst(v *Value) bool {
6839 // match: (ROLLconst [c] (ROLLconst [d] x))
6840 // result: (ROLLconst [(c+d)&31] x)
6842 c := auxIntToInt32(v.AuxInt)
6843 if v_0.Op != Op386ROLLconst {
6846 d := auxIntToInt32(v_0.AuxInt)
6848 v.reset(Op386ROLLconst)
6849 v.AuxInt = int32ToAuxInt((c + d) & 31)
6853 // match: (ROLLconst [0] x)
6856 if auxIntToInt32(v.AuxInt) != 0 {
6865 func rewriteValue386_Op386ROLWconst(v *Value) bool {
6867 // match: (ROLWconst [c] (ROLWconst [d] x))
6868 // result: (ROLWconst [(c+d)&15] x)
6870 c := auxIntToInt16(v.AuxInt)
6871 if v_0.Op != Op386ROLWconst {
6874 d := auxIntToInt16(v_0.AuxInt)
6876 v.reset(Op386ROLWconst)
6877 v.AuxInt = int16ToAuxInt((c + d) & 15)
6881 // match: (ROLWconst [0] x)
6884 if auxIntToInt16(v.AuxInt) != 0 {
6893 func rewriteValue386_Op386SARB(v *Value) bool {
6896 // match: (SARB x (MOVLconst [c]))
6897 // result: (SARBconst [int8(min(int64(c&31),7))] x)
6900 if v_1.Op != Op386MOVLconst {
6903 c := auxIntToInt32(v_1.AuxInt)
6904 v.reset(Op386SARBconst)
6905 v.AuxInt = int8ToAuxInt(int8(min(int64(c&31), 7)))
6911 func rewriteValue386_Op386SARBconst(v *Value) bool {
6913 // match: (SARBconst x [0])
6916 if auxIntToInt8(v.AuxInt) != 0 {
6923 // match: (SARBconst [c] (MOVLconst [d]))
6924 // result: (MOVLconst [d>>uint64(c)])
6926 c := auxIntToInt8(v.AuxInt)
6927 if v_0.Op != Op386MOVLconst {
6930 d := auxIntToInt32(v_0.AuxInt)
6931 v.reset(Op386MOVLconst)
6932 v.AuxInt = int32ToAuxInt(d >> uint64(c))
6937 func rewriteValue386_Op386SARL(v *Value) bool {
6940 // match: (SARL x (MOVLconst [c]))
6941 // result: (SARLconst [c&31] x)
6944 if v_1.Op != Op386MOVLconst {
6947 c := auxIntToInt32(v_1.AuxInt)
6948 v.reset(Op386SARLconst)
6949 v.AuxInt = int32ToAuxInt(c & 31)
6953 // match: (SARL x (ANDLconst [31] y))
6954 // result: (SARL x y)
6957 if v_1.Op != Op386ANDLconst || auxIntToInt32(v_1.AuxInt) != 31 {
6967 func rewriteValue386_Op386SARLconst(v *Value) bool {
6969 // match: (SARLconst x [0])
6972 if auxIntToInt32(v.AuxInt) != 0 {
6979 // match: (SARLconst [c] (MOVLconst [d]))
6980 // result: (MOVLconst [d>>uint64(c)])
6982 c := auxIntToInt32(v.AuxInt)
6983 if v_0.Op != Op386MOVLconst {
6986 d := auxIntToInt32(v_0.AuxInt)
6987 v.reset(Op386MOVLconst)
6988 v.AuxInt = int32ToAuxInt(d >> uint64(c))
6993 func rewriteValue386_Op386SARW(v *Value) bool {
6996 // match: (SARW x (MOVLconst [c]))
6997 // result: (SARWconst [int16(min(int64(c&31),15))] x)
7000 if v_1.Op != Op386MOVLconst {
7003 c := auxIntToInt32(v_1.AuxInt)
7004 v.reset(Op386SARWconst)
7005 v.AuxInt = int16ToAuxInt(int16(min(int64(c&31), 15)))
7011 func rewriteValue386_Op386SARWconst(v *Value) bool {
7013 // match: (SARWconst x [0])
7016 if auxIntToInt16(v.AuxInt) != 0 {
7023 // match: (SARWconst [c] (MOVLconst [d]))
7024 // result: (MOVLconst [d>>uint64(c)])
7026 c := auxIntToInt16(v.AuxInt)
7027 if v_0.Op != Op386MOVLconst {
7030 d := auxIntToInt32(v_0.AuxInt)
7031 v.reset(Op386MOVLconst)
7032 v.AuxInt = int32ToAuxInt(d >> uint64(c))
7037 func rewriteValue386_Op386SBBL(v *Value) bool {
7041 // match: (SBBL x (MOVLconst [c]) f)
7042 // result: (SBBLconst [c] x f)
7045 if v_1.Op != Op386MOVLconst {
7048 c := auxIntToInt32(v_1.AuxInt)
7050 v.reset(Op386SBBLconst)
7051 v.AuxInt = int32ToAuxInt(c)
7057 func rewriteValue386_Op386SBBLcarrymask(v *Value) bool {
7059 // match: (SBBLcarrymask (FlagEQ))
7060 // result: (MOVLconst [0])
7062 if v_0.Op != Op386FlagEQ {
7065 v.reset(Op386MOVLconst)
7066 v.AuxInt = int32ToAuxInt(0)
7069 // match: (SBBLcarrymask (FlagLT_ULT))
7070 // result: (MOVLconst [-1])
7072 if v_0.Op != Op386FlagLT_ULT {
7075 v.reset(Op386MOVLconst)
7076 v.AuxInt = int32ToAuxInt(-1)
7079 // match: (SBBLcarrymask (FlagLT_UGT))
7080 // result: (MOVLconst [0])
7082 if v_0.Op != Op386FlagLT_UGT {
7085 v.reset(Op386MOVLconst)
7086 v.AuxInt = int32ToAuxInt(0)
7089 // match: (SBBLcarrymask (FlagGT_ULT))
7090 // result: (MOVLconst [-1])
7092 if v_0.Op != Op386FlagGT_ULT {
7095 v.reset(Op386MOVLconst)
7096 v.AuxInt = int32ToAuxInt(-1)
7099 // match: (SBBLcarrymask (FlagGT_UGT))
7100 // result: (MOVLconst [0])
7102 if v_0.Op != Op386FlagGT_UGT {
7105 v.reset(Op386MOVLconst)
7106 v.AuxInt = int32ToAuxInt(0)
7111 func rewriteValue386_Op386SETA(v *Value) bool {
7113 // match: (SETA (InvertFlags x))
7116 if v_0.Op != Op386InvertFlags {
7124 // match: (SETA (FlagEQ))
7125 // result: (MOVLconst [0])
7127 if v_0.Op != Op386FlagEQ {
7130 v.reset(Op386MOVLconst)
7131 v.AuxInt = int32ToAuxInt(0)
7134 // match: (SETA (FlagLT_ULT))
7135 // result: (MOVLconst [0])
7137 if v_0.Op != Op386FlagLT_ULT {
7140 v.reset(Op386MOVLconst)
7141 v.AuxInt = int32ToAuxInt(0)
7144 // match: (SETA (FlagLT_UGT))
7145 // result: (MOVLconst [1])
7147 if v_0.Op != Op386FlagLT_UGT {
7150 v.reset(Op386MOVLconst)
7151 v.AuxInt = int32ToAuxInt(1)
7154 // match: (SETA (FlagGT_ULT))
7155 // result: (MOVLconst [0])
7157 if v_0.Op != Op386FlagGT_ULT {
7160 v.reset(Op386MOVLconst)
7161 v.AuxInt = int32ToAuxInt(0)
7164 // match: (SETA (FlagGT_UGT))
7165 // result: (MOVLconst [1])
7167 if v_0.Op != Op386FlagGT_UGT {
7170 v.reset(Op386MOVLconst)
7171 v.AuxInt = int32ToAuxInt(1)
7176 func rewriteValue386_Op386SETAE(v *Value) bool {
7178 // match: (SETAE (InvertFlags x))
7179 // result: (SETBE x)
7181 if v_0.Op != Op386InvertFlags {
7189 // match: (SETAE (FlagEQ))
7190 // result: (MOVLconst [1])
7192 if v_0.Op != Op386FlagEQ {
7195 v.reset(Op386MOVLconst)
7196 v.AuxInt = int32ToAuxInt(1)
7199 // match: (SETAE (FlagLT_ULT))
7200 // result: (MOVLconst [0])
7202 if v_0.Op != Op386FlagLT_ULT {
7205 v.reset(Op386MOVLconst)
7206 v.AuxInt = int32ToAuxInt(0)
7209 // match: (SETAE (FlagLT_UGT))
7210 // result: (MOVLconst [1])
7212 if v_0.Op != Op386FlagLT_UGT {
7215 v.reset(Op386MOVLconst)
7216 v.AuxInt = int32ToAuxInt(1)
7219 // match: (SETAE (FlagGT_ULT))
7220 // result: (MOVLconst [0])
7222 if v_0.Op != Op386FlagGT_ULT {
7225 v.reset(Op386MOVLconst)
7226 v.AuxInt = int32ToAuxInt(0)
7229 // match: (SETAE (FlagGT_UGT))
7230 // result: (MOVLconst [1])
7232 if v_0.Op != Op386FlagGT_UGT {
7235 v.reset(Op386MOVLconst)
7236 v.AuxInt = int32ToAuxInt(1)
7241 func rewriteValue386_Op386SETB(v *Value) bool {
7243 // match: (SETB (InvertFlags x))
7246 if v_0.Op != Op386InvertFlags {
7254 // match: (SETB (FlagEQ))
7255 // result: (MOVLconst [0])
7257 if v_0.Op != Op386FlagEQ {
7260 v.reset(Op386MOVLconst)
7261 v.AuxInt = int32ToAuxInt(0)
7264 // match: (SETB (FlagLT_ULT))
7265 // result: (MOVLconst [1])
7267 if v_0.Op != Op386FlagLT_ULT {
7270 v.reset(Op386MOVLconst)
7271 v.AuxInt = int32ToAuxInt(1)
7274 // match: (SETB (FlagLT_UGT))
7275 // result: (MOVLconst [0])
7277 if v_0.Op != Op386FlagLT_UGT {
7280 v.reset(Op386MOVLconst)
7281 v.AuxInt = int32ToAuxInt(0)
7284 // match: (SETB (FlagGT_ULT))
7285 // result: (MOVLconst [1])
7287 if v_0.Op != Op386FlagGT_ULT {
7290 v.reset(Op386MOVLconst)
7291 v.AuxInt = int32ToAuxInt(1)
7294 // match: (SETB (FlagGT_UGT))
7295 // result: (MOVLconst [0])
7297 if v_0.Op != Op386FlagGT_UGT {
7300 v.reset(Op386MOVLconst)
7301 v.AuxInt = int32ToAuxInt(0)
7306 func rewriteValue386_Op386SETBE(v *Value) bool {
7308 // match: (SETBE (InvertFlags x))
7309 // result: (SETAE x)
7311 if v_0.Op != Op386InvertFlags {
7319 // match: (SETBE (FlagEQ))
7320 // result: (MOVLconst [1])
7322 if v_0.Op != Op386FlagEQ {
7325 v.reset(Op386MOVLconst)
7326 v.AuxInt = int32ToAuxInt(1)
7329 // match: (SETBE (FlagLT_ULT))
7330 // result: (MOVLconst [1])
7332 if v_0.Op != Op386FlagLT_ULT {
7335 v.reset(Op386MOVLconst)
7336 v.AuxInt = int32ToAuxInt(1)
7339 // match: (SETBE (FlagLT_UGT))
7340 // result: (MOVLconst [0])
7342 if v_0.Op != Op386FlagLT_UGT {
7345 v.reset(Op386MOVLconst)
7346 v.AuxInt = int32ToAuxInt(0)
7349 // match: (SETBE (FlagGT_ULT))
7350 // result: (MOVLconst [1])
7352 if v_0.Op != Op386FlagGT_ULT {
7355 v.reset(Op386MOVLconst)
7356 v.AuxInt = int32ToAuxInt(1)
7359 // match: (SETBE (FlagGT_UGT))
7360 // result: (MOVLconst [0])
7362 if v_0.Op != Op386FlagGT_UGT {
7365 v.reset(Op386MOVLconst)
7366 v.AuxInt = int32ToAuxInt(0)
7371 func rewriteValue386_Op386SETEQ(v *Value) bool {
7373 // match: (SETEQ (InvertFlags x))
7374 // result: (SETEQ x)
7376 if v_0.Op != Op386InvertFlags {
7384 // match: (SETEQ (FlagEQ))
7385 // result: (MOVLconst [1])
7387 if v_0.Op != Op386FlagEQ {
7390 v.reset(Op386MOVLconst)
7391 v.AuxInt = int32ToAuxInt(1)
7394 // match: (SETEQ (FlagLT_ULT))
7395 // result: (MOVLconst [0])
7397 if v_0.Op != Op386FlagLT_ULT {
7400 v.reset(Op386MOVLconst)
7401 v.AuxInt = int32ToAuxInt(0)
7404 // match: (SETEQ (FlagLT_UGT))
7405 // result: (MOVLconst [0])
7407 if v_0.Op != Op386FlagLT_UGT {
7410 v.reset(Op386MOVLconst)
7411 v.AuxInt = int32ToAuxInt(0)
7414 // match: (SETEQ (FlagGT_ULT))
7415 // result: (MOVLconst [0])
7417 if v_0.Op != Op386FlagGT_ULT {
7420 v.reset(Op386MOVLconst)
7421 v.AuxInt = int32ToAuxInt(0)
7424 // match: (SETEQ (FlagGT_UGT))
7425 // result: (MOVLconst [0])
7427 if v_0.Op != Op386FlagGT_UGT {
7430 v.reset(Op386MOVLconst)
7431 v.AuxInt = int32ToAuxInt(0)
7436 func rewriteValue386_Op386SETG(v *Value) bool {
7438 // match: (SETG (InvertFlags x))
7441 if v_0.Op != Op386InvertFlags {
7449 // match: (SETG (FlagEQ))
7450 // result: (MOVLconst [0])
7452 if v_0.Op != Op386FlagEQ {
7455 v.reset(Op386MOVLconst)
7456 v.AuxInt = int32ToAuxInt(0)
7459 // match: (SETG (FlagLT_ULT))
7460 // result: (MOVLconst [0])
7462 if v_0.Op != Op386FlagLT_ULT {
7465 v.reset(Op386MOVLconst)
7466 v.AuxInt = int32ToAuxInt(0)
7469 // match: (SETG (FlagLT_UGT))
7470 // result: (MOVLconst [0])
7472 if v_0.Op != Op386FlagLT_UGT {
7475 v.reset(Op386MOVLconst)
7476 v.AuxInt = int32ToAuxInt(0)
7479 // match: (SETG (FlagGT_ULT))
7480 // result: (MOVLconst [1])
7482 if v_0.Op != Op386FlagGT_ULT {
7485 v.reset(Op386MOVLconst)
7486 v.AuxInt = int32ToAuxInt(1)
7489 // match: (SETG (FlagGT_UGT))
7490 // result: (MOVLconst [1])
7492 if v_0.Op != Op386FlagGT_UGT {
7495 v.reset(Op386MOVLconst)
7496 v.AuxInt = int32ToAuxInt(1)
7501 func rewriteValue386_Op386SETGE(v *Value) bool {
7503 // match: (SETGE (InvertFlags x))
7504 // result: (SETLE x)
7506 if v_0.Op != Op386InvertFlags {
7514 // match: (SETGE (FlagEQ))
7515 // result: (MOVLconst [1])
7517 if v_0.Op != Op386FlagEQ {
7520 v.reset(Op386MOVLconst)
7521 v.AuxInt = int32ToAuxInt(1)
7524 // match: (SETGE (FlagLT_ULT))
7525 // result: (MOVLconst [0])
7527 if v_0.Op != Op386FlagLT_ULT {
7530 v.reset(Op386MOVLconst)
7531 v.AuxInt = int32ToAuxInt(0)
7534 // match: (SETGE (FlagLT_UGT))
7535 // result: (MOVLconst [0])
7537 if v_0.Op != Op386FlagLT_UGT {
7540 v.reset(Op386MOVLconst)
7541 v.AuxInt = int32ToAuxInt(0)
7544 // match: (SETGE (FlagGT_ULT))
7545 // result: (MOVLconst [1])
7547 if v_0.Op != Op386FlagGT_ULT {
7550 v.reset(Op386MOVLconst)
7551 v.AuxInt = int32ToAuxInt(1)
7554 // match: (SETGE (FlagGT_UGT))
7555 // result: (MOVLconst [1])
7557 if v_0.Op != Op386FlagGT_UGT {
7560 v.reset(Op386MOVLconst)
7561 v.AuxInt = int32ToAuxInt(1)
7566 func rewriteValue386_Op386SETL(v *Value) bool {
7568 // match: (SETL (InvertFlags x))
7571 if v_0.Op != Op386InvertFlags {
7579 // match: (SETL (FlagEQ))
7580 // result: (MOVLconst [0])
7582 if v_0.Op != Op386FlagEQ {
7585 v.reset(Op386MOVLconst)
7586 v.AuxInt = int32ToAuxInt(0)
7589 // match: (SETL (FlagLT_ULT))
7590 // result: (MOVLconst [1])
7592 if v_0.Op != Op386FlagLT_ULT {
7595 v.reset(Op386MOVLconst)
7596 v.AuxInt = int32ToAuxInt(1)
7599 // match: (SETL (FlagLT_UGT))
7600 // result: (MOVLconst [1])
7602 if v_0.Op != Op386FlagLT_UGT {
7605 v.reset(Op386MOVLconst)
7606 v.AuxInt = int32ToAuxInt(1)
7609 // match: (SETL (FlagGT_ULT))
7610 // result: (MOVLconst [0])
7612 if v_0.Op != Op386FlagGT_ULT {
7615 v.reset(Op386MOVLconst)
7616 v.AuxInt = int32ToAuxInt(0)
7619 // match: (SETL (FlagGT_UGT))
7620 // result: (MOVLconst [0])
7622 if v_0.Op != Op386FlagGT_UGT {
7625 v.reset(Op386MOVLconst)
7626 v.AuxInt = int32ToAuxInt(0)
7631 func rewriteValue386_Op386SETLE(v *Value) bool {
7633 // match: (SETLE (InvertFlags x))
7634 // result: (SETGE x)
7636 if v_0.Op != Op386InvertFlags {
7644 // match: (SETLE (FlagEQ))
7645 // result: (MOVLconst [1])
7647 if v_0.Op != Op386FlagEQ {
7650 v.reset(Op386MOVLconst)
7651 v.AuxInt = int32ToAuxInt(1)
7654 // match: (SETLE (FlagLT_ULT))
7655 // result: (MOVLconst [1])
7657 if v_0.Op != Op386FlagLT_ULT {
7660 v.reset(Op386MOVLconst)
7661 v.AuxInt = int32ToAuxInt(1)
7664 // match: (SETLE (FlagLT_UGT))
7665 // result: (MOVLconst [1])
7667 if v_0.Op != Op386FlagLT_UGT {
7670 v.reset(Op386MOVLconst)
7671 v.AuxInt = int32ToAuxInt(1)
7674 // match: (SETLE (FlagGT_ULT))
7675 // result: (MOVLconst [0])
7677 if v_0.Op != Op386FlagGT_ULT {
7680 v.reset(Op386MOVLconst)
7681 v.AuxInt = int32ToAuxInt(0)
7684 // match: (SETLE (FlagGT_UGT))
7685 // result: (MOVLconst [0])
7687 if v_0.Op != Op386FlagGT_UGT {
7690 v.reset(Op386MOVLconst)
7691 v.AuxInt = int32ToAuxInt(0)
7696 func rewriteValue386_Op386SETNE(v *Value) bool {
7698 // match: (SETNE (InvertFlags x))
7699 // result: (SETNE x)
7701 if v_0.Op != Op386InvertFlags {
7709 // match: (SETNE (FlagEQ))
7710 // result: (MOVLconst [0])
7712 if v_0.Op != Op386FlagEQ {
7715 v.reset(Op386MOVLconst)
7716 v.AuxInt = int32ToAuxInt(0)
7719 // match: (SETNE (FlagLT_ULT))
7720 // result: (MOVLconst [1])
7722 if v_0.Op != Op386FlagLT_ULT {
7725 v.reset(Op386MOVLconst)
7726 v.AuxInt = int32ToAuxInt(1)
7729 // match: (SETNE (FlagLT_UGT))
7730 // result: (MOVLconst [1])
7732 if v_0.Op != Op386FlagLT_UGT {
7735 v.reset(Op386MOVLconst)
7736 v.AuxInt = int32ToAuxInt(1)
7739 // match: (SETNE (FlagGT_ULT))
7740 // result: (MOVLconst [1])
7742 if v_0.Op != Op386FlagGT_ULT {
7745 v.reset(Op386MOVLconst)
7746 v.AuxInt = int32ToAuxInt(1)
7749 // match: (SETNE (FlagGT_UGT))
7750 // result: (MOVLconst [1])
7752 if v_0.Op != Op386FlagGT_UGT {
7755 v.reset(Op386MOVLconst)
7756 v.AuxInt = int32ToAuxInt(1)
7761 func rewriteValue386_Op386SHLL(v *Value) bool {
7764 // match: (SHLL x (MOVLconst [c]))
7765 // result: (SHLLconst [c&31] x)
7768 if v_1.Op != Op386MOVLconst {
7771 c := auxIntToInt32(v_1.AuxInt)
7772 v.reset(Op386SHLLconst)
7773 v.AuxInt = int32ToAuxInt(c & 31)
7777 // match: (SHLL x (ANDLconst [31] y))
7778 // result: (SHLL x y)
7781 if v_1.Op != Op386ANDLconst || auxIntToInt32(v_1.AuxInt) != 31 {
7791 func rewriteValue386_Op386SHLLconst(v *Value) bool {
7793 // match: (SHLLconst x [0])
7796 if auxIntToInt32(v.AuxInt) != 0 {
7805 func rewriteValue386_Op386SHRB(v *Value) bool {
7808 // match: (SHRB x (MOVLconst [c]))
7810 // result: (SHRBconst [int8(c&31)] x)
7813 if v_1.Op != Op386MOVLconst {
7816 c := auxIntToInt32(v_1.AuxInt)
7820 v.reset(Op386SHRBconst)
7821 v.AuxInt = int8ToAuxInt(int8(c & 31))
7825 // match: (SHRB _ (MOVLconst [c]))
7827 // result: (MOVLconst [0])
7829 if v_1.Op != Op386MOVLconst {
7832 c := auxIntToInt32(v_1.AuxInt)
7836 v.reset(Op386MOVLconst)
7837 v.AuxInt = int32ToAuxInt(0)
7842 func rewriteValue386_Op386SHRBconst(v *Value) bool {
7844 // match: (SHRBconst x [0])
7847 if auxIntToInt8(v.AuxInt) != 0 {
7856 func rewriteValue386_Op386SHRL(v *Value) bool {
7859 // match: (SHRL x (MOVLconst [c]))
7860 // result: (SHRLconst [c&31] x)
7863 if v_1.Op != Op386MOVLconst {
7866 c := auxIntToInt32(v_1.AuxInt)
7867 v.reset(Op386SHRLconst)
7868 v.AuxInt = int32ToAuxInt(c & 31)
7872 // match: (SHRL x (ANDLconst [31] y))
7873 // result: (SHRL x y)
7876 if v_1.Op != Op386ANDLconst || auxIntToInt32(v_1.AuxInt) != 31 {
7886 func rewriteValue386_Op386SHRLconst(v *Value) bool {
7888 // match: (SHRLconst x [0])
7891 if auxIntToInt32(v.AuxInt) != 0 {
7900 func rewriteValue386_Op386SHRW(v *Value) bool {
7903 // match: (SHRW x (MOVLconst [c]))
7905 // result: (SHRWconst [int16(c&31)] x)
7908 if v_1.Op != Op386MOVLconst {
7911 c := auxIntToInt32(v_1.AuxInt)
7915 v.reset(Op386SHRWconst)
7916 v.AuxInt = int16ToAuxInt(int16(c & 31))
7920 // match: (SHRW _ (MOVLconst [c]))
7922 // result: (MOVLconst [0])
7924 if v_1.Op != Op386MOVLconst {
7927 c := auxIntToInt32(v_1.AuxInt)
7931 v.reset(Op386MOVLconst)
7932 v.AuxInt = int32ToAuxInt(0)
7937 func rewriteValue386_Op386SHRWconst(v *Value) bool {
7939 // match: (SHRWconst x [0])
7942 if auxIntToInt16(v.AuxInt) != 0 {
7951 func rewriteValue386_Op386SUBL(v *Value) bool {
7955 // match: (SUBL x (MOVLconst [c]))
7956 // result: (SUBLconst x [c])
7959 if v_1.Op != Op386MOVLconst {
7962 c := auxIntToInt32(v_1.AuxInt)
7963 v.reset(Op386SUBLconst)
7964 v.AuxInt = int32ToAuxInt(c)
7968 // match: (SUBL (MOVLconst [c]) x)
7969 // result: (NEGL (SUBLconst <v.Type> x [c]))
7971 if v_0.Op != Op386MOVLconst {
7974 c := auxIntToInt32(v_0.AuxInt)
7977 v0 := b.NewValue0(v.Pos, Op386SUBLconst, v.Type)
7978 v0.AuxInt = int32ToAuxInt(c)
7983 // match: (SUBL x l:(MOVLload [off] {sym} ptr mem))
7984 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
7985 // result: (SUBLload x [off] {sym} ptr mem)
7989 if l.Op != Op386MOVLload {
7992 off := auxIntToInt32(l.AuxInt)
7993 sym := auxToSym(l.Aux)
7996 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
7999 v.reset(Op386SUBLload)
8000 v.AuxInt = int32ToAuxInt(off)
8001 v.Aux = symToAux(sym)
8002 v.AddArg3(x, ptr, mem)
8005 // match: (SUBL x x)
8006 // result: (MOVLconst [0])
8012 v.reset(Op386MOVLconst)
8013 v.AuxInt = int32ToAuxInt(0)
8018 func rewriteValue386_Op386SUBLcarry(v *Value) bool {
8021 // match: (SUBLcarry x (MOVLconst [c]))
8022 // result: (SUBLconstcarry [c] x)
8025 if v_1.Op != Op386MOVLconst {
8028 c := auxIntToInt32(v_1.AuxInt)
8029 v.reset(Op386SUBLconstcarry)
8030 v.AuxInt = int32ToAuxInt(c)
8036 func rewriteValue386_Op386SUBLconst(v *Value) bool {
8038 // match: (SUBLconst [c] x)
8042 c := auxIntToInt32(v.AuxInt)
8050 // match: (SUBLconst [c] x)
8051 // result: (ADDLconst [-c] x)
8053 c := auxIntToInt32(v.AuxInt)
8055 v.reset(Op386ADDLconst)
8056 v.AuxInt = int32ToAuxInt(-c)
8061 func rewriteValue386_Op386SUBLload(v *Value) bool {
8066 config := b.Func.Config
8067 // match: (SUBLload [off1] {sym} val (ADDLconst [off2] base) mem)
8068 // cond: is32Bit(int64(off1)+int64(off2))
8069 // result: (SUBLload [off1+off2] {sym} val base mem)
8071 off1 := auxIntToInt32(v.AuxInt)
8072 sym := auxToSym(v.Aux)
8074 if v_1.Op != Op386ADDLconst {
8077 off2 := auxIntToInt32(v_1.AuxInt)
8080 if !(is32Bit(int64(off1) + int64(off2))) {
8083 v.reset(Op386SUBLload)
8084 v.AuxInt = int32ToAuxInt(off1 + off2)
8085 v.Aux = symToAux(sym)
8086 v.AddArg3(val, base, mem)
8089 // match: (SUBLload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
8090 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
8091 // result: (SUBLload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
8093 off1 := auxIntToInt32(v.AuxInt)
8094 sym1 := auxToSym(v.Aux)
8096 if v_1.Op != Op386LEAL {
8099 off2 := auxIntToInt32(v_1.AuxInt)
8100 sym2 := auxToSym(v_1.Aux)
8103 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
8106 v.reset(Op386SUBLload)
8107 v.AuxInt = int32ToAuxInt(off1 + off2)
8108 v.Aux = symToAux(mergeSym(sym1, sym2))
8109 v.AddArg3(val, base, mem)
8114 func rewriteValue386_Op386SUBLmodify(v *Value) bool {
8119 config := b.Func.Config
8120 // match: (SUBLmodify [off1] {sym} (ADDLconst [off2] base) val mem)
8121 // cond: is32Bit(int64(off1)+int64(off2))
8122 // result: (SUBLmodify [off1+off2] {sym} base val mem)
8124 off1 := auxIntToInt32(v.AuxInt)
8125 sym := auxToSym(v.Aux)
8126 if v_0.Op != Op386ADDLconst {
8129 off2 := auxIntToInt32(v_0.AuxInt)
8133 if !(is32Bit(int64(off1) + int64(off2))) {
8136 v.reset(Op386SUBLmodify)
8137 v.AuxInt = int32ToAuxInt(off1 + off2)
8138 v.Aux = symToAux(sym)
8139 v.AddArg3(base, val, mem)
8142 // match: (SUBLmodify [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
8143 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
8144 // result: (SUBLmodify [off1+off2] {mergeSym(sym1,sym2)} base val mem)
8146 off1 := auxIntToInt32(v.AuxInt)
8147 sym1 := auxToSym(v.Aux)
8148 if v_0.Op != Op386LEAL {
8151 off2 := auxIntToInt32(v_0.AuxInt)
8152 sym2 := auxToSym(v_0.Aux)
8156 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
8159 v.reset(Op386SUBLmodify)
8160 v.AuxInt = int32ToAuxInt(off1 + off2)
8161 v.Aux = symToAux(mergeSym(sym1, sym2))
8162 v.AddArg3(base, val, mem)
8167 func rewriteValue386_Op386SUBSD(v *Value) bool {
8170 // match: (SUBSD x l:(MOVSDload [off] {sym} ptr mem))
8171 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
8172 // result: (SUBSDload x [off] {sym} ptr mem)
8176 if l.Op != Op386MOVSDload {
8179 off := auxIntToInt32(l.AuxInt)
8180 sym := auxToSym(l.Aux)
8183 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
8186 v.reset(Op386SUBSDload)
8187 v.AuxInt = int32ToAuxInt(off)
8188 v.Aux = symToAux(sym)
8189 v.AddArg3(x, ptr, mem)
8194 func rewriteValue386_Op386SUBSDload(v *Value) bool {
8199 config := b.Func.Config
8200 // match: (SUBSDload [off1] {sym} val (ADDLconst [off2] base) mem)
8201 // cond: is32Bit(int64(off1)+int64(off2))
8202 // result: (SUBSDload [off1+off2] {sym} val base mem)
8204 off1 := auxIntToInt32(v.AuxInt)
8205 sym := auxToSym(v.Aux)
8207 if v_1.Op != Op386ADDLconst {
8210 off2 := auxIntToInt32(v_1.AuxInt)
8213 if !(is32Bit(int64(off1) + int64(off2))) {
8216 v.reset(Op386SUBSDload)
8217 v.AuxInt = int32ToAuxInt(off1 + off2)
8218 v.Aux = symToAux(sym)
8219 v.AddArg3(val, base, mem)
8222 // match: (SUBSDload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
8223 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
8224 // result: (SUBSDload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
8226 off1 := auxIntToInt32(v.AuxInt)
8227 sym1 := auxToSym(v.Aux)
8229 if v_1.Op != Op386LEAL {
8232 off2 := auxIntToInt32(v_1.AuxInt)
8233 sym2 := auxToSym(v_1.Aux)
8236 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
8239 v.reset(Op386SUBSDload)
8240 v.AuxInt = int32ToAuxInt(off1 + off2)
8241 v.Aux = symToAux(mergeSym(sym1, sym2))
8242 v.AddArg3(val, base, mem)
8247 func rewriteValue386_Op386SUBSS(v *Value) bool {
8250 // match: (SUBSS x l:(MOVSSload [off] {sym} ptr mem))
8251 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
8252 // result: (SUBSSload x [off] {sym} ptr mem)
8256 if l.Op != Op386MOVSSload {
8259 off := auxIntToInt32(l.AuxInt)
8260 sym := auxToSym(l.Aux)
8263 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
8266 v.reset(Op386SUBSSload)
8267 v.AuxInt = int32ToAuxInt(off)
8268 v.Aux = symToAux(sym)
8269 v.AddArg3(x, ptr, mem)
8274 func rewriteValue386_Op386SUBSSload(v *Value) bool {
8279 config := b.Func.Config
8280 // match: (SUBSSload [off1] {sym} val (ADDLconst [off2] base) mem)
8281 // cond: is32Bit(int64(off1)+int64(off2))
8282 // result: (SUBSSload [off1+off2] {sym} val base mem)
8284 off1 := auxIntToInt32(v.AuxInt)
8285 sym := auxToSym(v.Aux)
8287 if v_1.Op != Op386ADDLconst {
8290 off2 := auxIntToInt32(v_1.AuxInt)
8293 if !(is32Bit(int64(off1) + int64(off2))) {
8296 v.reset(Op386SUBSSload)
8297 v.AuxInt = int32ToAuxInt(off1 + off2)
8298 v.Aux = symToAux(sym)
8299 v.AddArg3(val, base, mem)
8302 // match: (SUBSSload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
8303 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
8304 // result: (SUBSSload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
8306 off1 := auxIntToInt32(v.AuxInt)
8307 sym1 := auxToSym(v.Aux)
8309 if v_1.Op != Op386LEAL {
8312 off2 := auxIntToInt32(v_1.AuxInt)
8313 sym2 := auxToSym(v_1.Aux)
8316 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
8319 v.reset(Op386SUBSSload)
8320 v.AuxInt = int32ToAuxInt(off1 + off2)
8321 v.Aux = symToAux(mergeSym(sym1, sym2))
8322 v.AddArg3(val, base, mem)
8327 func rewriteValue386_Op386XORL(v *Value) bool {
8330 // match: (XORL x (MOVLconst [c]))
8331 // result: (XORLconst [c] x)
8333 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8335 if v_1.Op != Op386MOVLconst {
8338 c := auxIntToInt32(v_1.AuxInt)
8339 v.reset(Op386XORLconst)
8340 v.AuxInt = int32ToAuxInt(c)
8346 // match: (XORL (SHLLconst [c] x) (SHRLconst [d] x))
8348 // result: (ROLLconst [c] x)
8350 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8351 if v_0.Op != Op386SHLLconst {
8354 c := auxIntToInt32(v_0.AuxInt)
8356 if v_1.Op != Op386SHRLconst {
8359 d := auxIntToInt32(v_1.AuxInt)
8360 if x != v_1.Args[0] || !(d == 32-c) {
8363 v.reset(Op386ROLLconst)
8364 v.AuxInt = int32ToAuxInt(c)
8370 // match: (XORL <t> (SHLLconst x [c]) (SHRWconst x [d]))
8371 // cond: c < 16 && d == int16(16-c) && t.Size() == 2
8372 // result: (ROLWconst x [int16(c)])
8375 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8376 if v_0.Op != Op386SHLLconst {
8379 c := auxIntToInt32(v_0.AuxInt)
8381 if v_1.Op != Op386SHRWconst {
8384 d := auxIntToInt16(v_1.AuxInt)
8385 if x != v_1.Args[0] || !(c < 16 && d == int16(16-c) && t.Size() == 2) {
8388 v.reset(Op386ROLWconst)
8389 v.AuxInt = int16ToAuxInt(int16(c))
8395 // match: (XORL <t> (SHLLconst x [c]) (SHRBconst x [d]))
8396 // cond: c < 8 && d == int8(8-c) && t.Size() == 1
8397 // result: (ROLBconst x [int8(c)])
8400 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8401 if v_0.Op != Op386SHLLconst {
8404 c := auxIntToInt32(v_0.AuxInt)
8406 if v_1.Op != Op386SHRBconst {
8409 d := auxIntToInt8(v_1.AuxInt)
8410 if x != v_1.Args[0] || !(c < 8 && d == int8(8-c) && t.Size() == 1) {
8413 v.reset(Op386ROLBconst)
8414 v.AuxInt = int8ToAuxInt(int8(c))
8420 // match: (XORL x l:(MOVLload [off] {sym} ptr mem))
8421 // cond: canMergeLoadClobber(v, l, x) && clobber(l)
8422 // result: (XORLload x [off] {sym} ptr mem)
8424 for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
8427 if l.Op != Op386MOVLload {
8430 off := auxIntToInt32(l.AuxInt)
8431 sym := auxToSym(l.Aux)
8434 if !(canMergeLoadClobber(v, l, x) && clobber(l)) {
8437 v.reset(Op386XORLload)
8438 v.AuxInt = int32ToAuxInt(off)
8439 v.Aux = symToAux(sym)
8440 v.AddArg3(x, ptr, mem)
8445 // match: (XORL x x)
8446 // result: (MOVLconst [0])
8452 v.reset(Op386MOVLconst)
8453 v.AuxInt = int32ToAuxInt(0)
8458 func rewriteValue386_Op386XORLconst(v *Value) bool {
8460 // match: (XORLconst [c] (XORLconst [d] x))
8461 // result: (XORLconst [c ^ d] x)
8463 c := auxIntToInt32(v.AuxInt)
8464 if v_0.Op != Op386XORLconst {
8467 d := auxIntToInt32(v_0.AuxInt)
8469 v.reset(Op386XORLconst)
8470 v.AuxInt = int32ToAuxInt(c ^ d)
8474 // match: (XORLconst [c] x)
8478 c := auxIntToInt32(v.AuxInt)
8486 // match: (XORLconst [c] (MOVLconst [d]))
8487 // result: (MOVLconst [c^d])
8489 c := auxIntToInt32(v.AuxInt)
8490 if v_0.Op != Op386MOVLconst {
8493 d := auxIntToInt32(v_0.AuxInt)
8494 v.reset(Op386MOVLconst)
8495 v.AuxInt = int32ToAuxInt(c ^ d)
8500 func rewriteValue386_Op386XORLconstmodify(v *Value) bool {
8504 config := b.Func.Config
8505 // match: (XORLconstmodify [valoff1] {sym} (ADDLconst [off2] base) mem)
8506 // cond: valoff1.canAdd32(off2)
8507 // result: (XORLconstmodify [valoff1.addOffset32(off2)] {sym} base mem)
8509 valoff1 := auxIntToValAndOff(v.AuxInt)
8510 sym := auxToSym(v.Aux)
8511 if v_0.Op != Op386ADDLconst {
8514 off2 := auxIntToInt32(v_0.AuxInt)
8517 if !(valoff1.canAdd32(off2)) {
8520 v.reset(Op386XORLconstmodify)
8521 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
8522 v.Aux = symToAux(sym)
8523 v.AddArg2(base, mem)
8526 // match: (XORLconstmodify [valoff1] {sym1} (LEAL [off2] {sym2} base) mem)
8527 // cond: valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
8528 // result: (XORLconstmodify [valoff1.addOffset32(off2)] {mergeSym(sym1,sym2)} base mem)
8530 valoff1 := auxIntToValAndOff(v.AuxInt)
8531 sym1 := auxToSym(v.Aux)
8532 if v_0.Op != Op386LEAL {
8535 off2 := auxIntToInt32(v_0.AuxInt)
8536 sym2 := auxToSym(v_0.Aux)
8539 if !(valoff1.canAdd32(off2) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
8542 v.reset(Op386XORLconstmodify)
8543 v.AuxInt = valAndOffToAuxInt(valoff1.addOffset32(off2))
8544 v.Aux = symToAux(mergeSym(sym1, sym2))
8545 v.AddArg2(base, mem)
8550 func rewriteValue386_Op386XORLload(v *Value) bool {
8555 config := b.Func.Config
8556 // match: (XORLload [off1] {sym} val (ADDLconst [off2] base) mem)
8557 // cond: is32Bit(int64(off1)+int64(off2))
8558 // result: (XORLload [off1+off2] {sym} val base mem)
8560 off1 := auxIntToInt32(v.AuxInt)
8561 sym := auxToSym(v.Aux)
8563 if v_1.Op != Op386ADDLconst {
8566 off2 := auxIntToInt32(v_1.AuxInt)
8569 if !(is32Bit(int64(off1) + int64(off2))) {
8572 v.reset(Op386XORLload)
8573 v.AuxInt = int32ToAuxInt(off1 + off2)
8574 v.Aux = symToAux(sym)
8575 v.AddArg3(val, base, mem)
8578 // match: (XORLload [off1] {sym1} val (LEAL [off2] {sym2} base) mem)
8579 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
8580 // result: (XORLload [off1+off2] {mergeSym(sym1,sym2)} val base mem)
8582 off1 := auxIntToInt32(v.AuxInt)
8583 sym1 := auxToSym(v.Aux)
8585 if v_1.Op != Op386LEAL {
8588 off2 := auxIntToInt32(v_1.AuxInt)
8589 sym2 := auxToSym(v_1.Aux)
8592 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
8595 v.reset(Op386XORLload)
8596 v.AuxInt = int32ToAuxInt(off1 + off2)
8597 v.Aux = symToAux(mergeSym(sym1, sym2))
8598 v.AddArg3(val, base, mem)
8603 func rewriteValue386_Op386XORLmodify(v *Value) bool {
8608 config := b.Func.Config
8609 // match: (XORLmodify [off1] {sym} (ADDLconst [off2] base) val mem)
8610 // cond: is32Bit(int64(off1)+int64(off2))
8611 // result: (XORLmodify [off1+off2] {sym} base val mem)
8613 off1 := auxIntToInt32(v.AuxInt)
8614 sym := auxToSym(v.Aux)
8615 if v_0.Op != Op386ADDLconst {
8618 off2 := auxIntToInt32(v_0.AuxInt)
8622 if !(is32Bit(int64(off1) + int64(off2))) {
8625 v.reset(Op386XORLmodify)
8626 v.AuxInt = int32ToAuxInt(off1 + off2)
8627 v.Aux = symToAux(sym)
8628 v.AddArg3(base, val, mem)
8631 // match: (XORLmodify [off1] {sym1} (LEAL [off2] {sym2} base) val mem)
8632 // cond: is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)
8633 // result: (XORLmodify [off1+off2] {mergeSym(sym1,sym2)} base val mem)
8635 off1 := auxIntToInt32(v.AuxInt)
8636 sym1 := auxToSym(v.Aux)
8637 if v_0.Op != Op386LEAL {
8640 off2 := auxIntToInt32(v_0.AuxInt)
8641 sym2 := auxToSym(v_0.Aux)
8645 if !(is32Bit(int64(off1)+int64(off2)) && canMergeSym(sym1, sym2) && (base.Op != OpSB || !config.ctxt.Flag_shared)) {
8648 v.reset(Op386XORLmodify)
8649 v.AuxInt = int32ToAuxInt(off1 + off2)
8650 v.Aux = symToAux(mergeSym(sym1, sym2))
8651 v.AddArg3(base, val, mem)
8656 func rewriteValue386_OpAddr(v *Value) bool {
8658 // match: (Addr {sym} base)
8659 // result: (LEAL {sym} base)
8661 sym := auxToSym(v.Aux)
8664 v.Aux = symToAux(sym)
8669 func rewriteValue386_OpConst16(v *Value) bool {
8670 // match: (Const16 [c])
8671 // result: (MOVLconst [int32(c)])
8673 c := auxIntToInt16(v.AuxInt)
8674 v.reset(Op386MOVLconst)
8675 v.AuxInt = int32ToAuxInt(int32(c))
8679 func rewriteValue386_OpConst8(v *Value) bool {
8680 // match: (Const8 [c])
8681 // result: (MOVLconst [int32(c)])
8683 c := auxIntToInt8(v.AuxInt)
8684 v.reset(Op386MOVLconst)
8685 v.AuxInt = int32ToAuxInt(int32(c))
8689 func rewriteValue386_OpConstBool(v *Value) bool {
8690 // match: (ConstBool [c])
8691 // result: (MOVLconst [b2i32(c)])
8693 c := auxIntToBool(v.AuxInt)
8694 v.reset(Op386MOVLconst)
8695 v.AuxInt = int32ToAuxInt(b2i32(c))
8699 func rewriteValue386_OpConstNil(v *Value) bool {
8700 // match: (ConstNil)
8701 // result: (MOVLconst [0])
8703 v.reset(Op386MOVLconst)
8704 v.AuxInt = int32ToAuxInt(0)
8708 func rewriteValue386_OpCtz16(v *Value) bool {
8711 typ := &b.Func.Config.Types
8713 // result: (BSFL (ORLconst <typ.UInt32> [0x10000] x))
8717 v0 := b.NewValue0(v.Pos, Op386ORLconst, typ.UInt32)
8718 v0.AuxInt = int32ToAuxInt(0x10000)
8724 func rewriteValue386_OpDiv8(v *Value) bool {
8728 typ := &b.Func.Config.Types
8729 // match: (Div8 x y)
8730 // result: (DIVW (SignExt8to16 x) (SignExt8to16 y))
8735 v0 := b.NewValue0(v.Pos, OpSignExt8to16, typ.Int16)
8737 v1 := b.NewValue0(v.Pos, OpSignExt8to16, typ.Int16)
8743 func rewriteValue386_OpDiv8u(v *Value) bool {
8747 typ := &b.Func.Config.Types
8748 // match: (Div8u x y)
8749 // result: (DIVWU (ZeroExt8to16 x) (ZeroExt8to16 y))
8754 v0 := b.NewValue0(v.Pos, OpZeroExt8to16, typ.UInt16)
8756 v1 := b.NewValue0(v.Pos, OpZeroExt8to16, typ.UInt16)
8762 func rewriteValue386_OpEq16(v *Value) bool {
8766 // match: (Eq16 x y)
8767 // result: (SETEQ (CMPW x y))
8772 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
8778 func rewriteValue386_OpEq32(v *Value) bool {
8782 // match: (Eq32 x y)
8783 // result: (SETEQ (CMPL x y))
8788 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
8794 func rewriteValue386_OpEq32F(v *Value) bool {
8798 // match: (Eq32F x y)
8799 // result: (SETEQF (UCOMISS x y))
8803 v.reset(Op386SETEQF)
8804 v0 := b.NewValue0(v.Pos, Op386UCOMISS, types.TypeFlags)
8810 func rewriteValue386_OpEq64F(v *Value) bool {
8814 // match: (Eq64F x y)
8815 // result: (SETEQF (UCOMISD x y))
8819 v.reset(Op386SETEQF)
8820 v0 := b.NewValue0(v.Pos, Op386UCOMISD, types.TypeFlags)
8826 func rewriteValue386_OpEq8(v *Value) bool {
8831 // result: (SETEQ (CMPB x y))
8836 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
8842 func rewriteValue386_OpEqB(v *Value) bool {
8847 // result: (SETEQ (CMPB x y))
8852 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
8858 func rewriteValue386_OpEqPtr(v *Value) bool {
8862 // match: (EqPtr x y)
8863 // result: (SETEQ (CMPL x y))
8868 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
8874 func rewriteValue386_OpIsInBounds(v *Value) bool {
8878 // match: (IsInBounds idx len)
8879 // result: (SETB (CMPL idx len))
8884 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
8885 v0.AddArg2(idx, len)
8890 func rewriteValue386_OpIsNonNil(v *Value) bool {
8893 // match: (IsNonNil p)
8894 // result: (SETNE (TESTL p p))
8898 v0 := b.NewValue0(v.Pos, Op386TESTL, types.TypeFlags)
8904 func rewriteValue386_OpIsSliceInBounds(v *Value) bool {
8908 // match: (IsSliceInBounds idx len)
8909 // result: (SETBE (CMPL idx len))
8914 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
8915 v0.AddArg2(idx, len)
8920 func rewriteValue386_OpLeq16(v *Value) bool {
8924 // match: (Leq16 x y)
8925 // result: (SETLE (CMPW x y))
8930 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
8936 func rewriteValue386_OpLeq16U(v *Value) bool {
8940 // match: (Leq16U x y)
8941 // result: (SETBE (CMPW x y))
8946 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
8952 func rewriteValue386_OpLeq32(v *Value) bool {
8956 // match: (Leq32 x y)
8957 // result: (SETLE (CMPL x y))
8962 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
8968 func rewriteValue386_OpLeq32F(v *Value) bool {
8972 // match: (Leq32F x y)
8973 // result: (SETGEF (UCOMISS y x))
8977 v.reset(Op386SETGEF)
8978 v0 := b.NewValue0(v.Pos, Op386UCOMISS, types.TypeFlags)
8984 func rewriteValue386_OpLeq32U(v *Value) bool {
8988 // match: (Leq32U x y)
8989 // result: (SETBE (CMPL x y))
8994 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
9000 func rewriteValue386_OpLeq64F(v *Value) bool {
9004 // match: (Leq64F x y)
9005 // result: (SETGEF (UCOMISD y x))
9009 v.reset(Op386SETGEF)
9010 v0 := b.NewValue0(v.Pos, Op386UCOMISD, types.TypeFlags)
9016 func rewriteValue386_OpLeq8(v *Value) bool {
9020 // match: (Leq8 x y)
9021 // result: (SETLE (CMPB x y))
9026 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
9032 func rewriteValue386_OpLeq8U(v *Value) bool {
9036 // match: (Leq8U x y)
9037 // result: (SETBE (CMPB x y))
9042 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
9048 func rewriteValue386_OpLess16(v *Value) bool {
9052 // match: (Less16 x y)
9053 // result: (SETL (CMPW x y))
9058 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
9064 func rewriteValue386_OpLess16U(v *Value) bool {
9068 // match: (Less16U x y)
9069 // result: (SETB (CMPW x y))
9074 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
9080 func rewriteValue386_OpLess32(v *Value) bool {
9084 // match: (Less32 x y)
9085 // result: (SETL (CMPL x y))
9090 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
9096 func rewriteValue386_OpLess32F(v *Value) bool {
9100 // match: (Less32F x y)
9101 // result: (SETGF (UCOMISS y x))
9106 v0 := b.NewValue0(v.Pos, Op386UCOMISS, types.TypeFlags)
9112 func rewriteValue386_OpLess32U(v *Value) bool {
9116 // match: (Less32U x y)
9117 // result: (SETB (CMPL x y))
9122 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
9128 func rewriteValue386_OpLess64F(v *Value) bool {
9132 // match: (Less64F x y)
9133 // result: (SETGF (UCOMISD y x))
9138 v0 := b.NewValue0(v.Pos, Op386UCOMISD, types.TypeFlags)
9144 func rewriteValue386_OpLess8(v *Value) bool {
9148 // match: (Less8 x y)
9149 // result: (SETL (CMPB x y))
9154 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
9160 func rewriteValue386_OpLess8U(v *Value) bool {
9164 // match: (Less8U x y)
9165 // result: (SETB (CMPB x y))
9170 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
9176 func rewriteValue386_OpLoad(v *Value) bool {
9179 // match: (Load <t> ptr mem)
9180 // cond: (is32BitInt(t) || isPtr(t))
9181 // result: (MOVLload ptr mem)
9186 if !(is32BitInt(t) || isPtr(t)) {
9189 v.reset(Op386MOVLload)
9193 // match: (Load <t> ptr mem)
9194 // cond: is16BitInt(t)
9195 // result: (MOVWload ptr mem)
9200 if !(is16BitInt(t)) {
9203 v.reset(Op386MOVWload)
9207 // match: (Load <t> ptr mem)
9208 // cond: (t.IsBoolean() || is8BitInt(t))
9209 // result: (MOVBload ptr mem)
9214 if !(t.IsBoolean() || is8BitInt(t)) {
9217 v.reset(Op386MOVBload)
9221 // match: (Load <t> ptr mem)
9222 // cond: is32BitFloat(t)
9223 // result: (MOVSSload ptr mem)
9228 if !(is32BitFloat(t)) {
9231 v.reset(Op386MOVSSload)
9235 // match: (Load <t> ptr mem)
9236 // cond: is64BitFloat(t)
9237 // result: (MOVSDload ptr mem)
9242 if !(is64BitFloat(t)) {
9245 v.reset(Op386MOVSDload)
9251 func rewriteValue386_OpLocalAddr(v *Value) bool {
9253 // match: (LocalAddr {sym} base _)
9254 // result: (LEAL {sym} base)
9256 sym := auxToSym(v.Aux)
9259 v.Aux = symToAux(sym)
9264 func rewriteValue386_OpLsh16x16(v *Value) bool {
9268 // match: (Lsh16x16 <t> x y)
9269 // cond: !shiftIsBounded(v)
9270 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPWconst y [32])))
9275 if !(!shiftIsBounded(v)) {
9279 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9281 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9282 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
9283 v2.AuxInt = int16ToAuxInt(32)
9289 // match: (Lsh16x16 <t> x y)
9290 // cond: shiftIsBounded(v)
9291 // result: (SHLL <t> x y)
9296 if !(shiftIsBounded(v)) {
9306 func rewriteValue386_OpLsh16x32(v *Value) bool {
9310 // match: (Lsh16x32 <t> x y)
9311 // cond: !shiftIsBounded(v)
9312 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPLconst y [32])))
9317 if !(!shiftIsBounded(v)) {
9321 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9323 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9324 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
9325 v2.AuxInt = int32ToAuxInt(32)
9331 // match: (Lsh16x32 <t> x y)
9332 // cond: shiftIsBounded(v)
9333 // result: (SHLL <t> x y)
9338 if !(shiftIsBounded(v)) {
9348 func rewriteValue386_OpLsh16x64(v *Value) bool {
9351 // match: (Lsh16x64 x (Const64 [c]))
9352 // cond: uint64(c) < 16
9353 // result: (SHLLconst x [int32(c)])
9356 if v_1.Op != OpConst64 {
9359 c := auxIntToInt64(v_1.AuxInt)
9360 if !(uint64(c) < 16) {
9363 v.reset(Op386SHLLconst)
9364 v.AuxInt = int32ToAuxInt(int32(c))
9368 // match: (Lsh16x64 _ (Const64 [c]))
9369 // cond: uint64(c) >= 16
9370 // result: (Const16 [0])
9372 if v_1.Op != OpConst64 {
9375 c := auxIntToInt64(v_1.AuxInt)
9376 if !(uint64(c) >= 16) {
9380 v.AuxInt = int16ToAuxInt(0)
9385 func rewriteValue386_OpLsh16x8(v *Value) bool {
9389 // match: (Lsh16x8 <t> x y)
9390 // cond: !shiftIsBounded(v)
9391 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPBconst y [32])))
9396 if !(!shiftIsBounded(v)) {
9400 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9402 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9403 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
9404 v2.AuxInt = int8ToAuxInt(32)
9410 // match: (Lsh16x8 <t> x y)
9411 // cond: shiftIsBounded(v)
9412 // result: (SHLL <t> x y)
9417 if !(shiftIsBounded(v)) {
9427 func rewriteValue386_OpLsh32x16(v *Value) bool {
9431 // match: (Lsh32x16 <t> x y)
9432 // cond: !shiftIsBounded(v)
9433 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPWconst y [32])))
9438 if !(!shiftIsBounded(v)) {
9442 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9444 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9445 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
9446 v2.AuxInt = int16ToAuxInt(32)
9452 // match: (Lsh32x16 <t> x y)
9453 // cond: shiftIsBounded(v)
9454 // result: (SHLL <t> x y)
9459 if !(shiftIsBounded(v)) {
9469 func rewriteValue386_OpLsh32x32(v *Value) bool {
9473 // match: (Lsh32x32 <t> x y)
9474 // cond: !shiftIsBounded(v)
9475 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPLconst y [32])))
9480 if !(!shiftIsBounded(v)) {
9484 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9486 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9487 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
9488 v2.AuxInt = int32ToAuxInt(32)
9494 // match: (Lsh32x32 <t> x y)
9495 // cond: shiftIsBounded(v)
9496 // result: (SHLL <t> x y)
9501 if !(shiftIsBounded(v)) {
9511 func rewriteValue386_OpLsh32x64(v *Value) bool {
9514 // match: (Lsh32x64 x (Const64 [c]))
9515 // cond: uint64(c) < 32
9516 // result: (SHLLconst x [int32(c)])
9519 if v_1.Op != OpConst64 {
9522 c := auxIntToInt64(v_1.AuxInt)
9523 if !(uint64(c) < 32) {
9526 v.reset(Op386SHLLconst)
9527 v.AuxInt = int32ToAuxInt(int32(c))
9531 // match: (Lsh32x64 _ (Const64 [c]))
9532 // cond: uint64(c) >= 32
9533 // result: (Const32 [0])
9535 if v_1.Op != OpConst64 {
9538 c := auxIntToInt64(v_1.AuxInt)
9539 if !(uint64(c) >= 32) {
9543 v.AuxInt = int32ToAuxInt(0)
9548 func rewriteValue386_OpLsh32x8(v *Value) bool {
9552 // match: (Lsh32x8 <t> x y)
9553 // cond: !shiftIsBounded(v)
9554 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPBconst y [32])))
9559 if !(!shiftIsBounded(v)) {
9563 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9565 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9566 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
9567 v2.AuxInt = int8ToAuxInt(32)
9573 // match: (Lsh32x8 <t> x y)
9574 // cond: shiftIsBounded(v)
9575 // result: (SHLL <t> x y)
9580 if !(shiftIsBounded(v)) {
9590 func rewriteValue386_OpLsh8x16(v *Value) bool {
9594 // match: (Lsh8x16 <t> x y)
9595 // cond: !shiftIsBounded(v)
9596 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPWconst y [32])))
9601 if !(!shiftIsBounded(v)) {
9605 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9607 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9608 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
9609 v2.AuxInt = int16ToAuxInt(32)
9615 // match: (Lsh8x16 <t> x y)
9616 // cond: shiftIsBounded(v)
9617 // result: (SHLL <t> x y)
9622 if !(shiftIsBounded(v)) {
9632 func rewriteValue386_OpLsh8x32(v *Value) bool {
9636 // match: (Lsh8x32 <t> x y)
9637 // cond: !shiftIsBounded(v)
9638 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPLconst y [32])))
9643 if !(!shiftIsBounded(v)) {
9647 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9649 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9650 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
9651 v2.AuxInt = int32ToAuxInt(32)
9657 // match: (Lsh8x32 <t> x y)
9658 // cond: shiftIsBounded(v)
9659 // result: (SHLL <t> x y)
9664 if !(shiftIsBounded(v)) {
9674 func rewriteValue386_OpLsh8x64(v *Value) bool {
9677 // match: (Lsh8x64 x (Const64 [c]))
9678 // cond: uint64(c) < 8
9679 // result: (SHLLconst x [int32(c)])
9682 if v_1.Op != OpConst64 {
9685 c := auxIntToInt64(v_1.AuxInt)
9686 if !(uint64(c) < 8) {
9689 v.reset(Op386SHLLconst)
9690 v.AuxInt = int32ToAuxInt(int32(c))
9694 // match: (Lsh8x64 _ (Const64 [c]))
9695 // cond: uint64(c) >= 8
9696 // result: (Const8 [0])
9698 if v_1.Op != OpConst64 {
9701 c := auxIntToInt64(v_1.AuxInt)
9702 if !(uint64(c) >= 8) {
9706 v.AuxInt = int8ToAuxInt(0)
9711 func rewriteValue386_OpLsh8x8(v *Value) bool {
9715 // match: (Lsh8x8 <t> x y)
9716 // cond: !shiftIsBounded(v)
9717 // result: (ANDL (SHLL <t> x y) (SBBLcarrymask <t> (CMPBconst y [32])))
9722 if !(!shiftIsBounded(v)) {
9726 v0 := b.NewValue0(v.Pos, Op386SHLL, t)
9728 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
9729 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
9730 v2.AuxInt = int8ToAuxInt(32)
9736 // match: (Lsh8x8 <t> x y)
9737 // cond: shiftIsBounded(v)
9738 // result: (SHLL <t> x y)
9743 if !(shiftIsBounded(v)) {
9753 func rewriteValue386_OpMod8(v *Value) bool {
9757 typ := &b.Func.Config.Types
9758 // match: (Mod8 x y)
9759 // result: (MODW (SignExt8to16 x) (SignExt8to16 y))
9764 v0 := b.NewValue0(v.Pos, OpSignExt8to16, typ.Int16)
9766 v1 := b.NewValue0(v.Pos, OpSignExt8to16, typ.Int16)
9772 func rewriteValue386_OpMod8u(v *Value) bool {
9776 typ := &b.Func.Config.Types
9777 // match: (Mod8u x y)
9778 // result: (MODWU (ZeroExt8to16 x) (ZeroExt8to16 y))
9783 v0 := b.NewValue0(v.Pos, OpZeroExt8to16, typ.UInt16)
9785 v1 := b.NewValue0(v.Pos, OpZeroExt8to16, typ.UInt16)
9791 func rewriteValue386_OpMove(v *Value) bool {
9796 config := b.Func.Config
9797 typ := &b.Func.Config.Types
9798 // match: (Move [0] _ _ mem)
9801 if auxIntToInt64(v.AuxInt) != 0 {
9808 // match: (Move [1] dst src mem)
9809 // result: (MOVBstore dst (MOVBload src mem) mem)
9811 if auxIntToInt64(v.AuxInt) != 1 {
9817 v.reset(Op386MOVBstore)
9818 v0 := b.NewValue0(v.Pos, Op386MOVBload, typ.UInt8)
9819 v0.AddArg2(src, mem)
9820 v.AddArg3(dst, v0, mem)
9823 // match: (Move [2] dst src mem)
9824 // result: (MOVWstore dst (MOVWload src mem) mem)
9826 if auxIntToInt64(v.AuxInt) != 2 {
9832 v.reset(Op386MOVWstore)
9833 v0 := b.NewValue0(v.Pos, Op386MOVWload, typ.UInt16)
9834 v0.AddArg2(src, mem)
9835 v.AddArg3(dst, v0, mem)
9838 // match: (Move [4] dst src mem)
9839 // result: (MOVLstore dst (MOVLload src mem) mem)
9841 if auxIntToInt64(v.AuxInt) != 4 {
9847 v.reset(Op386MOVLstore)
9848 v0 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9849 v0.AddArg2(src, mem)
9850 v.AddArg3(dst, v0, mem)
9853 // match: (Move [3] dst src mem)
9854 // result: (MOVBstore [2] dst (MOVBload [2] src mem) (MOVWstore dst (MOVWload src mem) mem))
9856 if auxIntToInt64(v.AuxInt) != 3 {
9862 v.reset(Op386MOVBstore)
9863 v.AuxInt = int32ToAuxInt(2)
9864 v0 := b.NewValue0(v.Pos, Op386MOVBload, typ.UInt8)
9865 v0.AuxInt = int32ToAuxInt(2)
9866 v0.AddArg2(src, mem)
9867 v1 := b.NewValue0(v.Pos, Op386MOVWstore, types.TypeMem)
9868 v2 := b.NewValue0(v.Pos, Op386MOVWload, typ.UInt16)
9869 v2.AddArg2(src, mem)
9870 v1.AddArg3(dst, v2, mem)
9871 v.AddArg3(dst, v0, v1)
9874 // match: (Move [5] dst src mem)
9875 // result: (MOVBstore [4] dst (MOVBload [4] src mem) (MOVLstore dst (MOVLload src mem) mem))
9877 if auxIntToInt64(v.AuxInt) != 5 {
9883 v.reset(Op386MOVBstore)
9884 v.AuxInt = int32ToAuxInt(4)
9885 v0 := b.NewValue0(v.Pos, Op386MOVBload, typ.UInt8)
9886 v0.AuxInt = int32ToAuxInt(4)
9887 v0.AddArg2(src, mem)
9888 v1 := b.NewValue0(v.Pos, Op386MOVLstore, types.TypeMem)
9889 v2 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9890 v2.AddArg2(src, mem)
9891 v1.AddArg3(dst, v2, mem)
9892 v.AddArg3(dst, v0, v1)
9895 // match: (Move [6] dst src mem)
9896 // result: (MOVWstore [4] dst (MOVWload [4] src mem) (MOVLstore dst (MOVLload src mem) mem))
9898 if auxIntToInt64(v.AuxInt) != 6 {
9904 v.reset(Op386MOVWstore)
9905 v.AuxInt = int32ToAuxInt(4)
9906 v0 := b.NewValue0(v.Pos, Op386MOVWload, typ.UInt16)
9907 v0.AuxInt = int32ToAuxInt(4)
9908 v0.AddArg2(src, mem)
9909 v1 := b.NewValue0(v.Pos, Op386MOVLstore, types.TypeMem)
9910 v2 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9911 v2.AddArg2(src, mem)
9912 v1.AddArg3(dst, v2, mem)
9913 v.AddArg3(dst, v0, v1)
9916 // match: (Move [7] dst src mem)
9917 // result: (MOVLstore [3] dst (MOVLload [3] src mem) (MOVLstore dst (MOVLload src mem) mem))
9919 if auxIntToInt64(v.AuxInt) != 7 {
9925 v.reset(Op386MOVLstore)
9926 v.AuxInt = int32ToAuxInt(3)
9927 v0 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9928 v0.AuxInt = int32ToAuxInt(3)
9929 v0.AddArg2(src, mem)
9930 v1 := b.NewValue0(v.Pos, Op386MOVLstore, types.TypeMem)
9931 v2 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9932 v2.AddArg2(src, mem)
9933 v1.AddArg3(dst, v2, mem)
9934 v.AddArg3(dst, v0, v1)
9937 // match: (Move [8] dst src mem)
9938 // result: (MOVLstore [4] dst (MOVLload [4] src mem) (MOVLstore dst (MOVLload src mem) mem))
9940 if auxIntToInt64(v.AuxInt) != 8 {
9946 v.reset(Op386MOVLstore)
9947 v.AuxInt = int32ToAuxInt(4)
9948 v0 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9949 v0.AuxInt = int32ToAuxInt(4)
9950 v0.AddArg2(src, mem)
9951 v1 := b.NewValue0(v.Pos, Op386MOVLstore, types.TypeMem)
9952 v2 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9953 v2.AddArg2(src, mem)
9954 v1.AddArg3(dst, v2, mem)
9955 v.AddArg3(dst, v0, v1)
9958 // match: (Move [s] dst src mem)
9959 // cond: s > 8 && s%4 != 0
9960 // result: (Move [s-s%4] (ADDLconst <dst.Type> dst [int32(s%4)]) (ADDLconst <src.Type> src [int32(s%4)]) (MOVLstore dst (MOVLload src mem) mem))
9962 s := auxIntToInt64(v.AuxInt)
9966 if !(s > 8 && s%4 != 0) {
9970 v.AuxInt = int64ToAuxInt(s - s%4)
9971 v0 := b.NewValue0(v.Pos, Op386ADDLconst, dst.Type)
9972 v0.AuxInt = int32ToAuxInt(int32(s % 4))
9974 v1 := b.NewValue0(v.Pos, Op386ADDLconst, src.Type)
9975 v1.AuxInt = int32ToAuxInt(int32(s % 4))
9977 v2 := b.NewValue0(v.Pos, Op386MOVLstore, types.TypeMem)
9978 v3 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32)
9979 v3.AddArg2(src, mem)
9980 v2.AddArg3(dst, v3, mem)
9981 v.AddArg3(v0, v1, v2)
9984 // match: (Move [s] dst src mem)
9985 // cond: s > 8 && s <= 4*128 && s%4 == 0 && !config.noDuffDevice && logLargeCopy(v, s)
9986 // result: (DUFFCOPY [10*(128-s/4)] dst src mem)
9988 s := auxIntToInt64(v.AuxInt)
9992 if !(s > 8 && s <= 4*128 && s%4 == 0 && !config.noDuffDevice && logLargeCopy(v, s)) {
9995 v.reset(Op386DUFFCOPY)
9996 v.AuxInt = int64ToAuxInt(10 * (128 - s/4))
9997 v.AddArg3(dst, src, mem)
10000 // match: (Move [s] dst src mem)
10001 // cond: (s > 4*128 || config.noDuffDevice) && s%4 == 0 && logLargeCopy(v, s)
10002 // result: (REPMOVSL dst src (MOVLconst [int32(s/4)]) mem)
10004 s := auxIntToInt64(v.AuxInt)
10008 if !((s > 4*128 || config.noDuffDevice) && s%4 == 0 && logLargeCopy(v, s)) {
10011 v.reset(Op386REPMOVSL)
10012 v0 := b.NewValue0(v.Pos, Op386MOVLconst, typ.UInt32)
10013 v0.AuxInt = int32ToAuxInt(int32(s / 4))
10014 v.AddArg4(dst, src, v0, mem)
10019 func rewriteValue386_OpNeg32F(v *Value) bool {
10022 typ := &b.Func.Config.Types
10023 // match: (Neg32F x)
10024 // result: (PXOR x (MOVSSconst <typ.Float32> [float32(math.Copysign(0, -1))]))
10028 v0 := b.NewValue0(v.Pos, Op386MOVSSconst, typ.Float32)
10029 v0.AuxInt = float32ToAuxInt(float32(math.Copysign(0, -1)))
10034 func rewriteValue386_OpNeg64F(v *Value) bool {
10037 typ := &b.Func.Config.Types
10038 // match: (Neg64F x)
10039 // result: (PXOR x (MOVSDconst <typ.Float64> [math.Copysign(0, -1)]))
10043 v0 := b.NewValue0(v.Pos, Op386MOVSDconst, typ.Float64)
10044 v0.AuxInt = float64ToAuxInt(math.Copysign(0, -1))
10049 func rewriteValue386_OpNeq16(v *Value) bool {
10053 // match: (Neq16 x y)
10054 // result: (SETNE (CMPW x y))
10058 v.reset(Op386SETNE)
10059 v0 := b.NewValue0(v.Pos, Op386CMPW, types.TypeFlags)
10065 func rewriteValue386_OpNeq32(v *Value) bool {
10069 // match: (Neq32 x y)
10070 // result: (SETNE (CMPL x y))
10074 v.reset(Op386SETNE)
10075 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
10081 func rewriteValue386_OpNeq32F(v *Value) bool {
10085 // match: (Neq32F x y)
10086 // result: (SETNEF (UCOMISS x y))
10090 v.reset(Op386SETNEF)
10091 v0 := b.NewValue0(v.Pos, Op386UCOMISS, types.TypeFlags)
10097 func rewriteValue386_OpNeq64F(v *Value) bool {
10101 // match: (Neq64F x y)
10102 // result: (SETNEF (UCOMISD x y))
10106 v.reset(Op386SETNEF)
10107 v0 := b.NewValue0(v.Pos, Op386UCOMISD, types.TypeFlags)
10113 func rewriteValue386_OpNeq8(v *Value) bool {
10117 // match: (Neq8 x y)
10118 // result: (SETNE (CMPB x y))
10122 v.reset(Op386SETNE)
10123 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
10129 func rewriteValue386_OpNeqB(v *Value) bool {
10133 // match: (NeqB x y)
10134 // result: (SETNE (CMPB x y))
10138 v.reset(Op386SETNE)
10139 v0 := b.NewValue0(v.Pos, Op386CMPB, types.TypeFlags)
10145 func rewriteValue386_OpNeqPtr(v *Value) bool {
10149 // match: (NeqPtr x y)
10150 // result: (SETNE (CMPL x y))
10154 v.reset(Op386SETNE)
10155 v0 := b.NewValue0(v.Pos, Op386CMPL, types.TypeFlags)
10161 func rewriteValue386_OpNot(v *Value) bool {
10164 // result: (XORLconst [1] x)
10167 v.reset(Op386XORLconst)
10168 v.AuxInt = int32ToAuxInt(1)
10173 func rewriteValue386_OpOffPtr(v *Value) bool {
10175 // match: (OffPtr [off] ptr)
10176 // result: (ADDLconst [int32(off)] ptr)
10178 off := auxIntToInt64(v.AuxInt)
10180 v.reset(Op386ADDLconst)
10181 v.AuxInt = int32ToAuxInt(int32(off))
10186 func rewriteValue386_OpPanicBounds(v *Value) bool {
10190 // match: (PanicBounds [kind] x y mem)
10191 // cond: boundsABI(kind) == 0
10192 // result: (LoweredPanicBoundsA [kind] x y mem)
10194 kind := auxIntToInt64(v.AuxInt)
10198 if !(boundsABI(kind) == 0) {
10201 v.reset(Op386LoweredPanicBoundsA)
10202 v.AuxInt = int64ToAuxInt(kind)
10203 v.AddArg3(x, y, mem)
10206 // match: (PanicBounds [kind] x y mem)
10207 // cond: boundsABI(kind) == 1
10208 // result: (LoweredPanicBoundsB [kind] x y mem)
10210 kind := auxIntToInt64(v.AuxInt)
10214 if !(boundsABI(kind) == 1) {
10217 v.reset(Op386LoweredPanicBoundsB)
10218 v.AuxInt = int64ToAuxInt(kind)
10219 v.AddArg3(x, y, mem)
10222 // match: (PanicBounds [kind] x y mem)
10223 // cond: boundsABI(kind) == 2
10224 // result: (LoweredPanicBoundsC [kind] x y mem)
10226 kind := auxIntToInt64(v.AuxInt)
10230 if !(boundsABI(kind) == 2) {
10233 v.reset(Op386LoweredPanicBoundsC)
10234 v.AuxInt = int64ToAuxInt(kind)
10235 v.AddArg3(x, y, mem)
10240 func rewriteValue386_OpPanicExtend(v *Value) bool {
10245 // match: (PanicExtend [kind] hi lo y mem)
10246 // cond: boundsABI(kind) == 0
10247 // result: (LoweredPanicExtendA [kind] hi lo y mem)
10249 kind := auxIntToInt64(v.AuxInt)
10254 if !(boundsABI(kind) == 0) {
10257 v.reset(Op386LoweredPanicExtendA)
10258 v.AuxInt = int64ToAuxInt(kind)
10259 v.AddArg4(hi, lo, y, mem)
10262 // match: (PanicExtend [kind] hi lo y mem)
10263 // cond: boundsABI(kind) == 1
10264 // result: (LoweredPanicExtendB [kind] hi lo y mem)
10266 kind := auxIntToInt64(v.AuxInt)
10271 if !(boundsABI(kind) == 1) {
10274 v.reset(Op386LoweredPanicExtendB)
10275 v.AuxInt = int64ToAuxInt(kind)
10276 v.AddArg4(hi, lo, y, mem)
10279 // match: (PanicExtend [kind] hi lo y mem)
10280 // cond: boundsABI(kind) == 2
10281 // result: (LoweredPanicExtendC [kind] hi lo y mem)
10283 kind := auxIntToInt64(v.AuxInt)
10288 if !(boundsABI(kind) == 2) {
10291 v.reset(Op386LoweredPanicExtendC)
10292 v.AuxInt = int64ToAuxInt(kind)
10293 v.AddArg4(hi, lo, y, mem)
10298 func rewriteValue386_OpRotateLeft16(v *Value) bool {
10301 // match: (RotateLeft16 x (MOVLconst [c]))
10302 // result: (ROLWconst [int16(c&15)] x)
10305 if v_1.Op != Op386MOVLconst {
10308 c := auxIntToInt32(v_1.AuxInt)
10309 v.reset(Op386ROLWconst)
10310 v.AuxInt = int16ToAuxInt(int16(c & 15))
10316 func rewriteValue386_OpRotateLeft32(v *Value) bool {
10319 // match: (RotateLeft32 x (MOVLconst [c]))
10320 // result: (ROLLconst [c&31] x)
10323 if v_1.Op != Op386MOVLconst {
10326 c := auxIntToInt32(v_1.AuxInt)
10327 v.reset(Op386ROLLconst)
10328 v.AuxInt = int32ToAuxInt(c & 31)
10334 func rewriteValue386_OpRotateLeft8(v *Value) bool {
10337 // match: (RotateLeft8 x (MOVLconst [c]))
10338 // result: (ROLBconst [int8(c&7)] x)
10341 if v_1.Op != Op386MOVLconst {
10344 c := auxIntToInt32(v_1.AuxInt)
10345 v.reset(Op386ROLBconst)
10346 v.AuxInt = int8ToAuxInt(int8(c & 7))
10352 func rewriteValue386_OpRsh16Ux16(v *Value) bool {
10356 // match: (Rsh16Ux16 <t> x y)
10357 // cond: !shiftIsBounded(v)
10358 // result: (ANDL (SHRW <t> x y) (SBBLcarrymask <t> (CMPWconst y [16])))
10363 if !(!shiftIsBounded(v)) {
10367 v0 := b.NewValue0(v.Pos, Op386SHRW, t)
10369 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
10370 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
10371 v2.AuxInt = int16ToAuxInt(16)
10377 // match: (Rsh16Ux16 <t> x y)
10378 // cond: shiftIsBounded(v)
10379 // result: (SHRW <t> x y)
10384 if !(shiftIsBounded(v)) {
10394 func rewriteValue386_OpRsh16Ux32(v *Value) bool {
10398 // match: (Rsh16Ux32 <t> x y)
10399 // cond: !shiftIsBounded(v)
10400 // result: (ANDL (SHRW <t> x y) (SBBLcarrymask <t> (CMPLconst y [16])))
10405 if !(!shiftIsBounded(v)) {
10409 v0 := b.NewValue0(v.Pos, Op386SHRW, t)
10411 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
10412 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
10413 v2.AuxInt = int32ToAuxInt(16)
10419 // match: (Rsh16Ux32 <t> x y)
10420 // cond: shiftIsBounded(v)
10421 // result: (SHRW <t> x y)
10426 if !(shiftIsBounded(v)) {
10436 func rewriteValue386_OpRsh16Ux64(v *Value) bool {
10439 // match: (Rsh16Ux64 x (Const64 [c]))
10440 // cond: uint64(c) < 16
10441 // result: (SHRWconst x [int16(c)])
10444 if v_1.Op != OpConst64 {
10447 c := auxIntToInt64(v_1.AuxInt)
10448 if !(uint64(c) < 16) {
10451 v.reset(Op386SHRWconst)
10452 v.AuxInt = int16ToAuxInt(int16(c))
10456 // match: (Rsh16Ux64 _ (Const64 [c]))
10457 // cond: uint64(c) >= 16
10458 // result: (Const16 [0])
10460 if v_1.Op != OpConst64 {
10463 c := auxIntToInt64(v_1.AuxInt)
10464 if !(uint64(c) >= 16) {
10468 v.AuxInt = int16ToAuxInt(0)
10473 func rewriteValue386_OpRsh16Ux8(v *Value) bool {
10477 // match: (Rsh16Ux8 <t> x y)
10478 // cond: !shiftIsBounded(v)
10479 // result: (ANDL (SHRW <t> x y) (SBBLcarrymask <t> (CMPBconst y [16])))
10484 if !(!shiftIsBounded(v)) {
10488 v0 := b.NewValue0(v.Pos, Op386SHRW, t)
10490 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
10491 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
10492 v2.AuxInt = int8ToAuxInt(16)
10498 // match: (Rsh16Ux8 <t> x y)
10499 // cond: shiftIsBounded(v)
10500 // result: (SHRW <t> x y)
10505 if !(shiftIsBounded(v)) {
10515 func rewriteValue386_OpRsh16x16(v *Value) bool {
10519 // match: (Rsh16x16 <t> x y)
10520 // cond: !shiftIsBounded(v)
10521 // result: (SARW <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPWconst y [16])))))
10526 if !(!shiftIsBounded(v)) {
10531 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
10532 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
10533 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
10534 v3 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
10535 v3.AuxInt = int16ToAuxInt(16)
10543 // match: (Rsh16x16 <t> x y)
10544 // cond: shiftIsBounded(v)
10545 // result: (SARW x y)
10549 if !(shiftIsBounded(v)) {
10558 func rewriteValue386_OpRsh16x32(v *Value) bool {
10562 // match: (Rsh16x32 <t> x y)
10563 // cond: !shiftIsBounded(v)
10564 // result: (SARW <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPLconst y [16])))))
10569 if !(!shiftIsBounded(v)) {
10574 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
10575 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
10576 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
10577 v3 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
10578 v3.AuxInt = int32ToAuxInt(16)
10586 // match: (Rsh16x32 <t> x y)
10587 // cond: shiftIsBounded(v)
10588 // result: (SARW x y)
10592 if !(shiftIsBounded(v)) {
10601 func rewriteValue386_OpRsh16x64(v *Value) bool {
10604 // match: (Rsh16x64 x (Const64 [c]))
10605 // cond: uint64(c) < 16
10606 // result: (SARWconst x [int16(c)])
10609 if v_1.Op != OpConst64 {
10612 c := auxIntToInt64(v_1.AuxInt)
10613 if !(uint64(c) < 16) {
10616 v.reset(Op386SARWconst)
10617 v.AuxInt = int16ToAuxInt(int16(c))
10621 // match: (Rsh16x64 x (Const64 [c]))
10622 // cond: uint64(c) >= 16
10623 // result: (SARWconst x [15])
10626 if v_1.Op != OpConst64 {
10629 c := auxIntToInt64(v_1.AuxInt)
10630 if !(uint64(c) >= 16) {
10633 v.reset(Op386SARWconst)
10634 v.AuxInt = int16ToAuxInt(15)
10640 func rewriteValue386_OpRsh16x8(v *Value) bool {
10644 // match: (Rsh16x8 <t> x y)
10645 // cond: !shiftIsBounded(v)
10646 // result: (SARW <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPBconst y [16])))))
10651 if !(!shiftIsBounded(v)) {
10656 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
10657 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
10658 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
10659 v3 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
10660 v3.AuxInt = int8ToAuxInt(16)
10668 // match: (Rsh16x8 <t> x y)
10669 // cond: shiftIsBounded(v)
10670 // result: (SARW x y)
10674 if !(shiftIsBounded(v)) {
10683 func rewriteValue386_OpRsh32Ux16(v *Value) bool {
10687 // match: (Rsh32Ux16 <t> x y)
10688 // cond: !shiftIsBounded(v)
10689 // result: (ANDL (SHRL <t> x y) (SBBLcarrymask <t> (CMPWconst y [32])))
10694 if !(!shiftIsBounded(v)) {
10698 v0 := b.NewValue0(v.Pos, Op386SHRL, t)
10700 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
10701 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
10702 v2.AuxInt = int16ToAuxInt(32)
10708 // match: (Rsh32Ux16 <t> x y)
10709 // cond: shiftIsBounded(v)
10710 // result: (SHRL <t> x y)
10715 if !(shiftIsBounded(v)) {
10725 func rewriteValue386_OpRsh32Ux32(v *Value) bool {
10729 // match: (Rsh32Ux32 <t> x y)
10730 // cond: !shiftIsBounded(v)
10731 // result: (ANDL (SHRL <t> x y) (SBBLcarrymask <t> (CMPLconst y [32])))
10736 if !(!shiftIsBounded(v)) {
10740 v0 := b.NewValue0(v.Pos, Op386SHRL, t)
10742 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
10743 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
10744 v2.AuxInt = int32ToAuxInt(32)
10750 // match: (Rsh32Ux32 <t> x y)
10751 // cond: shiftIsBounded(v)
10752 // result: (SHRL <t> x y)
10757 if !(shiftIsBounded(v)) {
10767 func rewriteValue386_OpRsh32Ux64(v *Value) bool {
10770 // match: (Rsh32Ux64 x (Const64 [c]))
10771 // cond: uint64(c) < 32
10772 // result: (SHRLconst x [int32(c)])
10775 if v_1.Op != OpConst64 {
10778 c := auxIntToInt64(v_1.AuxInt)
10779 if !(uint64(c) < 32) {
10782 v.reset(Op386SHRLconst)
10783 v.AuxInt = int32ToAuxInt(int32(c))
10787 // match: (Rsh32Ux64 _ (Const64 [c]))
10788 // cond: uint64(c) >= 32
10789 // result: (Const32 [0])
10791 if v_1.Op != OpConst64 {
10794 c := auxIntToInt64(v_1.AuxInt)
10795 if !(uint64(c) >= 32) {
10799 v.AuxInt = int32ToAuxInt(0)
10804 func rewriteValue386_OpRsh32Ux8(v *Value) bool {
10808 // match: (Rsh32Ux8 <t> x y)
10809 // cond: !shiftIsBounded(v)
10810 // result: (ANDL (SHRL <t> x y) (SBBLcarrymask <t> (CMPBconst y [32])))
10815 if !(!shiftIsBounded(v)) {
10819 v0 := b.NewValue0(v.Pos, Op386SHRL, t)
10821 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
10822 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
10823 v2.AuxInt = int8ToAuxInt(32)
10829 // match: (Rsh32Ux8 <t> x y)
10830 // cond: shiftIsBounded(v)
10831 // result: (SHRL <t> x y)
10836 if !(shiftIsBounded(v)) {
10846 func rewriteValue386_OpRsh32x16(v *Value) bool {
10850 // match: (Rsh32x16 <t> x y)
10851 // cond: !shiftIsBounded(v)
10852 // result: (SARL <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPWconst y [32])))))
10857 if !(!shiftIsBounded(v)) {
10862 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
10863 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
10864 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
10865 v3 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
10866 v3.AuxInt = int16ToAuxInt(32)
10874 // match: (Rsh32x16 <t> x y)
10875 // cond: shiftIsBounded(v)
10876 // result: (SARL x y)
10880 if !(shiftIsBounded(v)) {
10889 func rewriteValue386_OpRsh32x32(v *Value) bool {
10893 // match: (Rsh32x32 <t> x y)
10894 // cond: !shiftIsBounded(v)
10895 // result: (SARL <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPLconst y [32])))))
10900 if !(!shiftIsBounded(v)) {
10905 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
10906 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
10907 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
10908 v3 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
10909 v3.AuxInt = int32ToAuxInt(32)
10917 // match: (Rsh32x32 <t> x y)
10918 // cond: shiftIsBounded(v)
10919 // result: (SARL x y)
10923 if !(shiftIsBounded(v)) {
10932 func rewriteValue386_OpRsh32x64(v *Value) bool {
10935 // match: (Rsh32x64 x (Const64 [c]))
10936 // cond: uint64(c) < 32
10937 // result: (SARLconst x [int32(c)])
10940 if v_1.Op != OpConst64 {
10943 c := auxIntToInt64(v_1.AuxInt)
10944 if !(uint64(c) < 32) {
10947 v.reset(Op386SARLconst)
10948 v.AuxInt = int32ToAuxInt(int32(c))
10952 // match: (Rsh32x64 x (Const64 [c]))
10953 // cond: uint64(c) >= 32
10954 // result: (SARLconst x [31])
10957 if v_1.Op != OpConst64 {
10960 c := auxIntToInt64(v_1.AuxInt)
10961 if !(uint64(c) >= 32) {
10964 v.reset(Op386SARLconst)
10965 v.AuxInt = int32ToAuxInt(31)
10971 func rewriteValue386_OpRsh32x8(v *Value) bool {
10975 // match: (Rsh32x8 <t> x y)
10976 // cond: !shiftIsBounded(v)
10977 // result: (SARL <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPBconst y [32])))))
10982 if !(!shiftIsBounded(v)) {
10987 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
10988 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
10989 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
10990 v3 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
10991 v3.AuxInt = int8ToAuxInt(32)
10999 // match: (Rsh32x8 <t> x y)
11000 // cond: shiftIsBounded(v)
11001 // result: (SARL x y)
11005 if !(shiftIsBounded(v)) {
11014 func rewriteValue386_OpRsh8Ux16(v *Value) bool {
11018 // match: (Rsh8Ux16 <t> x y)
11019 // cond: !shiftIsBounded(v)
11020 // result: (ANDL (SHRB <t> x y) (SBBLcarrymask <t> (CMPWconst y [8])))
11025 if !(!shiftIsBounded(v)) {
11029 v0 := b.NewValue0(v.Pos, Op386SHRB, t)
11031 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
11032 v2 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
11033 v2.AuxInt = int16ToAuxInt(8)
11039 // match: (Rsh8Ux16 <t> x y)
11040 // cond: shiftIsBounded(v)
11041 // result: (SHRB <t> x y)
11046 if !(shiftIsBounded(v)) {
11056 func rewriteValue386_OpRsh8Ux32(v *Value) bool {
11060 // match: (Rsh8Ux32 <t> x y)
11061 // cond: !shiftIsBounded(v)
11062 // result: (ANDL (SHRB <t> x y) (SBBLcarrymask <t> (CMPLconst y [8])))
11067 if !(!shiftIsBounded(v)) {
11071 v0 := b.NewValue0(v.Pos, Op386SHRB, t)
11073 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
11074 v2 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
11075 v2.AuxInt = int32ToAuxInt(8)
11081 // match: (Rsh8Ux32 <t> x y)
11082 // cond: shiftIsBounded(v)
11083 // result: (SHRB <t> x y)
11088 if !(shiftIsBounded(v)) {
11098 func rewriteValue386_OpRsh8Ux64(v *Value) bool {
11101 // match: (Rsh8Ux64 x (Const64 [c]))
11102 // cond: uint64(c) < 8
11103 // result: (SHRBconst x [int8(c)])
11106 if v_1.Op != OpConst64 {
11109 c := auxIntToInt64(v_1.AuxInt)
11110 if !(uint64(c) < 8) {
11113 v.reset(Op386SHRBconst)
11114 v.AuxInt = int8ToAuxInt(int8(c))
11118 // match: (Rsh8Ux64 _ (Const64 [c]))
11119 // cond: uint64(c) >= 8
11120 // result: (Const8 [0])
11122 if v_1.Op != OpConst64 {
11125 c := auxIntToInt64(v_1.AuxInt)
11126 if !(uint64(c) >= 8) {
11130 v.AuxInt = int8ToAuxInt(0)
11135 func rewriteValue386_OpRsh8Ux8(v *Value) bool {
11139 // match: (Rsh8Ux8 <t> x y)
11140 // cond: !shiftIsBounded(v)
11141 // result: (ANDL (SHRB <t> x y) (SBBLcarrymask <t> (CMPBconst y [8])))
11146 if !(!shiftIsBounded(v)) {
11150 v0 := b.NewValue0(v.Pos, Op386SHRB, t)
11152 v1 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
11153 v2 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
11154 v2.AuxInt = int8ToAuxInt(8)
11160 // match: (Rsh8Ux8 <t> x y)
11161 // cond: shiftIsBounded(v)
11162 // result: (SHRB <t> x y)
11167 if !(shiftIsBounded(v)) {
11177 func rewriteValue386_OpRsh8x16(v *Value) bool {
11181 // match: (Rsh8x16 <t> x y)
11182 // cond: !shiftIsBounded(v)
11183 // result: (SARB <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPWconst y [8])))))
11188 if !(!shiftIsBounded(v)) {
11193 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
11194 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
11195 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
11196 v3 := b.NewValue0(v.Pos, Op386CMPWconst, types.TypeFlags)
11197 v3.AuxInt = int16ToAuxInt(8)
11205 // match: (Rsh8x16 <t> x y)
11206 // cond: shiftIsBounded(v)
11207 // result: (SARB x y)
11211 if !(shiftIsBounded(v)) {
11220 func rewriteValue386_OpRsh8x32(v *Value) bool {
11224 // match: (Rsh8x32 <t> x y)
11225 // cond: !shiftIsBounded(v)
11226 // result: (SARB <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPLconst y [8])))))
11231 if !(!shiftIsBounded(v)) {
11236 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
11237 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
11238 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
11239 v3 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
11240 v3.AuxInt = int32ToAuxInt(8)
11248 // match: (Rsh8x32 <t> x y)
11249 // cond: shiftIsBounded(v)
11250 // result: (SARB x y)
11254 if !(shiftIsBounded(v)) {
11263 func rewriteValue386_OpRsh8x64(v *Value) bool {
11266 // match: (Rsh8x64 x (Const64 [c]))
11267 // cond: uint64(c) < 8
11268 // result: (SARBconst x [int8(c)])
11271 if v_1.Op != OpConst64 {
11274 c := auxIntToInt64(v_1.AuxInt)
11275 if !(uint64(c) < 8) {
11278 v.reset(Op386SARBconst)
11279 v.AuxInt = int8ToAuxInt(int8(c))
11283 // match: (Rsh8x64 x (Const64 [c]))
11284 // cond: uint64(c) >= 8
11285 // result: (SARBconst x [7])
11288 if v_1.Op != OpConst64 {
11291 c := auxIntToInt64(v_1.AuxInt)
11292 if !(uint64(c) >= 8) {
11295 v.reset(Op386SARBconst)
11296 v.AuxInt = int8ToAuxInt(7)
11302 func rewriteValue386_OpRsh8x8(v *Value) bool {
11306 // match: (Rsh8x8 <t> x y)
11307 // cond: !shiftIsBounded(v)
11308 // result: (SARB <t> x (ORL <y.Type> y (NOTL <y.Type> (SBBLcarrymask <y.Type> (CMPBconst y [8])))))
11313 if !(!shiftIsBounded(v)) {
11318 v0 := b.NewValue0(v.Pos, Op386ORL, y.Type)
11319 v1 := b.NewValue0(v.Pos, Op386NOTL, y.Type)
11320 v2 := b.NewValue0(v.Pos, Op386SBBLcarrymask, y.Type)
11321 v3 := b.NewValue0(v.Pos, Op386CMPBconst, types.TypeFlags)
11322 v3.AuxInt = int8ToAuxInt(8)
11330 // match: (Rsh8x8 <t> x y)
11331 // cond: shiftIsBounded(v)
11332 // result: (SARB x y)
11336 if !(shiftIsBounded(v)) {
11345 func rewriteValue386_OpSelect0(v *Value) bool {
11348 typ := &b.Func.Config.Types
11349 // match: (Select0 (Mul32uover x y))
11350 // result: (Select0 <typ.UInt32> (MULLU x y))
11352 if v_0.Op != OpMul32uover {
11358 v.Type = typ.UInt32
11359 v0 := b.NewValue0(v.Pos, Op386MULLU, types.NewTuple(typ.UInt32, types.TypeFlags))
11366 func rewriteValue386_OpSelect1(v *Value) bool {
11369 typ := &b.Func.Config.Types
11370 // match: (Select1 (Mul32uover x y))
11371 // result: (SETO (Select1 <types.TypeFlags> (MULLU x y)))
11373 if v_0.Op != OpMul32uover {
11379 v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
11380 v1 := b.NewValue0(v.Pos, Op386MULLU, types.NewTuple(typ.UInt32, types.TypeFlags))
11388 func rewriteValue386_OpSignmask(v *Value) bool {
11390 // match: (Signmask x)
11391 // result: (SARLconst x [31])
11394 v.reset(Op386SARLconst)
11395 v.AuxInt = int32ToAuxInt(31)
11400 func rewriteValue386_OpSlicemask(v *Value) bool {
11403 // match: (Slicemask <t> x)
11404 // result: (SARLconst (NEGL <t> x) [31])
11408 v.reset(Op386SARLconst)
11409 v.AuxInt = int32ToAuxInt(31)
11410 v0 := b.NewValue0(v.Pos, Op386NEGL, t)
11416 func rewriteValue386_OpStore(v *Value) bool {
11420 // match: (Store {t} ptr val mem)
11421 // cond: t.Size() == 8 && is64BitFloat(val.Type)
11422 // result: (MOVSDstore ptr val mem)
11424 t := auxToType(v.Aux)
11428 if !(t.Size() == 8 && is64BitFloat(val.Type)) {
11431 v.reset(Op386MOVSDstore)
11432 v.AddArg3(ptr, val, mem)
11435 // match: (Store {t} ptr val mem)
11436 // cond: t.Size() == 4 && is32BitFloat(val.Type)
11437 // result: (MOVSSstore ptr val mem)
11439 t := auxToType(v.Aux)
11443 if !(t.Size() == 4 && is32BitFloat(val.Type)) {
11446 v.reset(Op386MOVSSstore)
11447 v.AddArg3(ptr, val, mem)
11450 // match: (Store {t} ptr val mem)
11451 // cond: t.Size() == 4
11452 // result: (MOVLstore ptr val mem)
11454 t := auxToType(v.Aux)
11458 if !(t.Size() == 4) {
11461 v.reset(Op386MOVLstore)
11462 v.AddArg3(ptr, val, mem)
11465 // match: (Store {t} ptr val mem)
11466 // cond: t.Size() == 2
11467 // result: (MOVWstore ptr val mem)
11469 t := auxToType(v.Aux)
11473 if !(t.Size() == 2) {
11476 v.reset(Op386MOVWstore)
11477 v.AddArg3(ptr, val, mem)
11480 // match: (Store {t} ptr val mem)
11481 // cond: t.Size() == 1
11482 // result: (MOVBstore ptr val mem)
11484 t := auxToType(v.Aux)
11488 if !(t.Size() == 1) {
11491 v.reset(Op386MOVBstore)
11492 v.AddArg3(ptr, val, mem)
11497 func rewriteValue386_OpZero(v *Value) bool {
11501 config := b.Func.Config
11502 typ := &b.Func.Config.Types
11503 // match: (Zero [0] _ mem)
11506 if auxIntToInt64(v.AuxInt) != 0 {
11513 // match: (Zero [1] destptr mem)
11514 // result: (MOVBstoreconst [0] destptr mem)
11516 if auxIntToInt64(v.AuxInt) != 1 {
11521 v.reset(Op386MOVBstoreconst)
11522 v.AuxInt = valAndOffToAuxInt(0)
11523 v.AddArg2(destptr, mem)
11526 // match: (Zero [2] destptr mem)
11527 // result: (MOVWstoreconst [0] destptr mem)
11529 if auxIntToInt64(v.AuxInt) != 2 {
11534 v.reset(Op386MOVWstoreconst)
11535 v.AuxInt = valAndOffToAuxInt(0)
11536 v.AddArg2(destptr, mem)
11539 // match: (Zero [4] destptr mem)
11540 // result: (MOVLstoreconst [0] destptr mem)
11542 if auxIntToInt64(v.AuxInt) != 4 {
11547 v.reset(Op386MOVLstoreconst)
11548 v.AuxInt = valAndOffToAuxInt(0)
11549 v.AddArg2(destptr, mem)
11552 // match: (Zero [3] destptr mem)
11553 // result: (MOVBstoreconst [makeValAndOff(0,2)] destptr (MOVWstoreconst [makeValAndOff(0,0)] destptr mem))
11555 if auxIntToInt64(v.AuxInt) != 3 {
11560 v.reset(Op386MOVBstoreconst)
11561 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 2))
11562 v0 := b.NewValue0(v.Pos, Op386MOVWstoreconst, types.TypeMem)
11563 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
11564 v0.AddArg2(destptr, mem)
11565 v.AddArg2(destptr, v0)
11568 // match: (Zero [5] destptr mem)
11569 // result: (MOVBstoreconst [makeValAndOff(0,4)] destptr (MOVLstoreconst [makeValAndOff(0,0)] destptr mem))
11571 if auxIntToInt64(v.AuxInt) != 5 {
11576 v.reset(Op386MOVBstoreconst)
11577 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 4))
11578 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11579 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
11580 v0.AddArg2(destptr, mem)
11581 v.AddArg2(destptr, v0)
11584 // match: (Zero [6] destptr mem)
11585 // result: (MOVWstoreconst [makeValAndOff(0,4)] destptr (MOVLstoreconst [makeValAndOff(0,0)] destptr mem))
11587 if auxIntToInt64(v.AuxInt) != 6 {
11592 v.reset(Op386MOVWstoreconst)
11593 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 4))
11594 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11595 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
11596 v0.AddArg2(destptr, mem)
11597 v.AddArg2(destptr, v0)
11600 // match: (Zero [7] destptr mem)
11601 // result: (MOVLstoreconst [makeValAndOff(0,3)] destptr (MOVLstoreconst [makeValAndOff(0,0)] destptr mem))
11603 if auxIntToInt64(v.AuxInt) != 7 {
11608 v.reset(Op386MOVLstoreconst)
11609 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 3))
11610 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11611 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
11612 v0.AddArg2(destptr, mem)
11613 v.AddArg2(destptr, v0)
11616 // match: (Zero [s] destptr mem)
11617 // cond: s%4 != 0 && s > 4
11618 // result: (Zero [s-s%4] (ADDLconst destptr [int32(s%4)]) (MOVLstoreconst [0] destptr mem))
11620 s := auxIntToInt64(v.AuxInt)
11623 if !(s%4 != 0 && s > 4) {
11627 v.AuxInt = int64ToAuxInt(s - s%4)
11628 v0 := b.NewValue0(v.Pos, Op386ADDLconst, typ.UInt32)
11629 v0.AuxInt = int32ToAuxInt(int32(s % 4))
11631 v1 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11632 v1.AuxInt = valAndOffToAuxInt(0)
11633 v1.AddArg2(destptr, mem)
11637 // match: (Zero [8] destptr mem)
11638 // result: (MOVLstoreconst [makeValAndOff(0,4)] destptr (MOVLstoreconst [makeValAndOff(0,0)] destptr mem))
11640 if auxIntToInt64(v.AuxInt) != 8 {
11645 v.reset(Op386MOVLstoreconst)
11646 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 4))
11647 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11648 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
11649 v0.AddArg2(destptr, mem)
11650 v.AddArg2(destptr, v0)
11653 // match: (Zero [12] destptr mem)
11654 // result: (MOVLstoreconst [makeValAndOff(0,8)] destptr (MOVLstoreconst [makeValAndOff(0,4)] destptr (MOVLstoreconst [makeValAndOff(0,0)] destptr mem)))
11656 if auxIntToInt64(v.AuxInt) != 12 {
11661 v.reset(Op386MOVLstoreconst)
11662 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 8))
11663 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11664 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 4))
11665 v1 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11666 v1.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
11667 v1.AddArg2(destptr, mem)
11668 v0.AddArg2(destptr, v1)
11669 v.AddArg2(destptr, v0)
11672 // match: (Zero [16] destptr mem)
11673 // result: (MOVLstoreconst [makeValAndOff(0,12)] destptr (MOVLstoreconst [makeValAndOff(0,8)] destptr (MOVLstoreconst [makeValAndOff(0,4)] destptr (MOVLstoreconst [makeValAndOff(0,0)] destptr mem))))
11675 if auxIntToInt64(v.AuxInt) != 16 {
11680 v.reset(Op386MOVLstoreconst)
11681 v.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 12))
11682 v0 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11683 v0.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 8))
11684 v1 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11685 v1.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 4))
11686 v2 := b.NewValue0(v.Pos, Op386MOVLstoreconst, types.TypeMem)
11687 v2.AuxInt = valAndOffToAuxInt(makeValAndOff(0, 0))
11688 v2.AddArg2(destptr, mem)
11689 v1.AddArg2(destptr, v2)
11690 v0.AddArg2(destptr, v1)
11691 v.AddArg2(destptr, v0)
11694 // match: (Zero [s] destptr mem)
11695 // cond: s > 16 && s <= 4*128 && s%4 == 0 && !config.noDuffDevice
11696 // result: (DUFFZERO [1*(128-s/4)] destptr (MOVLconst [0]) mem)
11698 s := auxIntToInt64(v.AuxInt)
11701 if !(s > 16 && s <= 4*128 && s%4 == 0 && !config.noDuffDevice) {
11704 v.reset(Op386DUFFZERO)
11705 v.AuxInt = int64ToAuxInt(1 * (128 - s/4))
11706 v0 := b.NewValue0(v.Pos, Op386MOVLconst, typ.UInt32)
11707 v0.AuxInt = int32ToAuxInt(0)
11708 v.AddArg3(destptr, v0, mem)
11711 // match: (Zero [s] destptr mem)
11712 // cond: (s > 4*128 || (config.noDuffDevice && s > 16)) && s%4 == 0
11713 // result: (REPSTOSL destptr (MOVLconst [int32(s/4)]) (MOVLconst [0]) mem)
11715 s := auxIntToInt64(v.AuxInt)
11718 if !((s > 4*128 || (config.noDuffDevice && s > 16)) && s%4 == 0) {
11721 v.reset(Op386REPSTOSL)
11722 v0 := b.NewValue0(v.Pos, Op386MOVLconst, typ.UInt32)
11723 v0.AuxInt = int32ToAuxInt(int32(s / 4))
11724 v1 := b.NewValue0(v.Pos, Op386MOVLconst, typ.UInt32)
11725 v1.AuxInt = int32ToAuxInt(0)
11726 v.AddArg4(destptr, v0, v1, mem)
11731 func rewriteValue386_OpZeromask(v *Value) bool {
11734 // match: (Zeromask <t> x)
11735 // result: (XORLconst [-1] (SBBLcarrymask <t> (CMPLconst x [1])))
11739 v.reset(Op386XORLconst)
11740 v.AuxInt = int32ToAuxInt(-1)
11741 v0 := b.NewValue0(v.Pos, Op386SBBLcarrymask, t)
11742 v1 := b.NewValue0(v.Pos, Op386CMPLconst, types.TypeFlags)
11743 v1.AuxInt = int32ToAuxInt(1)
11750 func rewriteBlock386(b *Block) bool {
11753 // match: (EQ (InvertFlags cmp) yes no)
11754 // result: (EQ cmp yes no)
11755 for b.Controls[0].Op == Op386InvertFlags {
11756 v_0 := b.Controls[0]
11758 b.resetWithControl(Block386EQ, cmp)
11761 // match: (EQ (FlagEQ) yes no)
11762 // result: (First yes no)
11763 for b.Controls[0].Op == Op386FlagEQ {
11764 b.Reset(BlockFirst)
11767 // match: (EQ (FlagLT_ULT) yes no)
11768 // result: (First no yes)
11769 for b.Controls[0].Op == Op386FlagLT_ULT {
11770 b.Reset(BlockFirst)
11774 // match: (EQ (FlagLT_UGT) yes no)
11775 // result: (First no yes)
11776 for b.Controls[0].Op == Op386FlagLT_UGT {
11777 b.Reset(BlockFirst)
11781 // match: (EQ (FlagGT_ULT) yes no)
11782 // result: (First no yes)
11783 for b.Controls[0].Op == Op386FlagGT_ULT {
11784 b.Reset(BlockFirst)
11788 // match: (EQ (FlagGT_UGT) yes no)
11789 // result: (First no yes)
11790 for b.Controls[0].Op == Op386FlagGT_UGT {
11791 b.Reset(BlockFirst)
11796 // match: (GE (InvertFlags cmp) yes no)
11797 // result: (LE cmp yes no)
11798 for b.Controls[0].Op == Op386InvertFlags {
11799 v_0 := b.Controls[0]
11801 b.resetWithControl(Block386LE, cmp)
11804 // match: (GE (FlagEQ) yes no)
11805 // result: (First yes no)
11806 for b.Controls[0].Op == Op386FlagEQ {
11807 b.Reset(BlockFirst)
11810 // match: (GE (FlagLT_ULT) yes no)
11811 // result: (First no yes)
11812 for b.Controls[0].Op == Op386FlagLT_ULT {
11813 b.Reset(BlockFirst)
11817 // match: (GE (FlagLT_UGT) yes no)
11818 // result: (First no yes)
11819 for b.Controls[0].Op == Op386FlagLT_UGT {
11820 b.Reset(BlockFirst)
11824 // match: (GE (FlagGT_ULT) yes no)
11825 // result: (First yes no)
11826 for b.Controls[0].Op == Op386FlagGT_ULT {
11827 b.Reset(BlockFirst)
11830 // match: (GE (FlagGT_UGT) yes no)
11831 // result: (First yes no)
11832 for b.Controls[0].Op == Op386FlagGT_UGT {
11833 b.Reset(BlockFirst)
11837 // match: (GT (InvertFlags cmp) yes no)
11838 // result: (LT cmp yes no)
11839 for b.Controls[0].Op == Op386InvertFlags {
11840 v_0 := b.Controls[0]
11842 b.resetWithControl(Block386LT, cmp)
11845 // match: (GT (FlagEQ) yes no)
11846 // result: (First no yes)
11847 for b.Controls[0].Op == Op386FlagEQ {
11848 b.Reset(BlockFirst)
11852 // match: (GT (FlagLT_ULT) yes no)
11853 // result: (First no yes)
11854 for b.Controls[0].Op == Op386FlagLT_ULT {
11855 b.Reset(BlockFirst)
11859 // match: (GT (FlagLT_UGT) yes no)
11860 // result: (First no yes)
11861 for b.Controls[0].Op == Op386FlagLT_UGT {
11862 b.Reset(BlockFirst)
11866 // match: (GT (FlagGT_ULT) yes no)
11867 // result: (First yes no)
11868 for b.Controls[0].Op == Op386FlagGT_ULT {
11869 b.Reset(BlockFirst)
11872 // match: (GT (FlagGT_UGT) yes no)
11873 // result: (First yes no)
11874 for b.Controls[0].Op == Op386FlagGT_UGT {
11875 b.Reset(BlockFirst)
11879 // match: (If (SETL cmp) yes no)
11880 // result: (LT cmp yes no)
11881 for b.Controls[0].Op == Op386SETL {
11882 v_0 := b.Controls[0]
11884 b.resetWithControl(Block386LT, cmp)
11887 // match: (If (SETLE cmp) yes no)
11888 // result: (LE cmp yes no)
11889 for b.Controls[0].Op == Op386SETLE {
11890 v_0 := b.Controls[0]
11892 b.resetWithControl(Block386LE, cmp)
11895 // match: (If (SETG cmp) yes no)
11896 // result: (GT cmp yes no)
11897 for b.Controls[0].Op == Op386SETG {
11898 v_0 := b.Controls[0]
11900 b.resetWithControl(Block386GT, cmp)
11903 // match: (If (SETGE cmp) yes no)
11904 // result: (GE cmp yes no)
11905 for b.Controls[0].Op == Op386SETGE {
11906 v_0 := b.Controls[0]
11908 b.resetWithControl(Block386GE, cmp)
11911 // match: (If (SETEQ cmp) yes no)
11912 // result: (EQ cmp yes no)
11913 for b.Controls[0].Op == Op386SETEQ {
11914 v_0 := b.Controls[0]
11916 b.resetWithControl(Block386EQ, cmp)
11919 // match: (If (SETNE cmp) yes no)
11920 // result: (NE cmp yes no)
11921 for b.Controls[0].Op == Op386SETNE {
11922 v_0 := b.Controls[0]
11924 b.resetWithControl(Block386NE, cmp)
11927 // match: (If (SETB cmp) yes no)
11928 // result: (ULT cmp yes no)
11929 for b.Controls[0].Op == Op386SETB {
11930 v_0 := b.Controls[0]
11932 b.resetWithControl(Block386ULT, cmp)
11935 // match: (If (SETBE cmp) yes no)
11936 // result: (ULE cmp yes no)
11937 for b.Controls[0].Op == Op386SETBE {
11938 v_0 := b.Controls[0]
11940 b.resetWithControl(Block386ULE, cmp)
11943 // match: (If (SETA cmp) yes no)
11944 // result: (UGT cmp yes no)
11945 for b.Controls[0].Op == Op386SETA {
11946 v_0 := b.Controls[0]
11948 b.resetWithControl(Block386UGT, cmp)
11951 // match: (If (SETAE cmp) yes no)
11952 // result: (UGE cmp yes no)
11953 for b.Controls[0].Op == Op386SETAE {
11954 v_0 := b.Controls[0]
11956 b.resetWithControl(Block386UGE, cmp)
11959 // match: (If (SETO cmp) yes no)
11960 // result: (OS cmp yes no)
11961 for b.Controls[0].Op == Op386SETO {
11962 v_0 := b.Controls[0]
11964 b.resetWithControl(Block386OS, cmp)
11967 // match: (If (SETGF cmp) yes no)
11968 // result: (UGT cmp yes no)
11969 for b.Controls[0].Op == Op386SETGF {
11970 v_0 := b.Controls[0]
11972 b.resetWithControl(Block386UGT, cmp)
11975 // match: (If (SETGEF cmp) yes no)
11976 // result: (UGE cmp yes no)
11977 for b.Controls[0].Op == Op386SETGEF {
11978 v_0 := b.Controls[0]
11980 b.resetWithControl(Block386UGE, cmp)
11983 // match: (If (SETEQF cmp) yes no)
11984 // result: (EQF cmp yes no)
11985 for b.Controls[0].Op == Op386SETEQF {
11986 v_0 := b.Controls[0]
11988 b.resetWithControl(Block386EQF, cmp)
11991 // match: (If (SETNEF cmp) yes no)
11992 // result: (NEF cmp yes no)
11993 for b.Controls[0].Op == Op386SETNEF {
11994 v_0 := b.Controls[0]
11996 b.resetWithControl(Block386NEF, cmp)
11999 // match: (If cond yes no)
12000 // result: (NE (TESTB cond cond) yes no)
12002 cond := b.Controls[0]
12003 v0 := b.NewValue0(cond.Pos, Op386TESTB, types.TypeFlags)
12004 v0.AddArg2(cond, cond)
12005 b.resetWithControl(Block386NE, v0)
12009 // match: (LE (InvertFlags cmp) yes no)
12010 // result: (GE cmp yes no)
12011 for b.Controls[0].Op == Op386InvertFlags {
12012 v_0 := b.Controls[0]
12014 b.resetWithControl(Block386GE, cmp)
12017 // match: (LE (FlagEQ) yes no)
12018 // result: (First yes no)
12019 for b.Controls[0].Op == Op386FlagEQ {
12020 b.Reset(BlockFirst)
12023 // match: (LE (FlagLT_ULT) yes no)
12024 // result: (First yes no)
12025 for b.Controls[0].Op == Op386FlagLT_ULT {
12026 b.Reset(BlockFirst)
12029 // match: (LE (FlagLT_UGT) yes no)
12030 // result: (First yes no)
12031 for b.Controls[0].Op == Op386FlagLT_UGT {
12032 b.Reset(BlockFirst)
12035 // match: (LE (FlagGT_ULT) yes no)
12036 // result: (First no yes)
12037 for b.Controls[0].Op == Op386FlagGT_ULT {
12038 b.Reset(BlockFirst)
12042 // match: (LE (FlagGT_UGT) yes no)
12043 // result: (First no yes)
12044 for b.Controls[0].Op == Op386FlagGT_UGT {
12045 b.Reset(BlockFirst)
12050 // match: (LT (InvertFlags cmp) yes no)
12051 // result: (GT cmp yes no)
12052 for b.Controls[0].Op == Op386InvertFlags {
12053 v_0 := b.Controls[0]
12055 b.resetWithControl(Block386GT, cmp)
12058 // match: (LT (FlagEQ) yes no)
12059 // result: (First no yes)
12060 for b.Controls[0].Op == Op386FlagEQ {
12061 b.Reset(BlockFirst)
12065 // match: (LT (FlagLT_ULT) yes no)
12066 // result: (First yes no)
12067 for b.Controls[0].Op == Op386FlagLT_ULT {
12068 b.Reset(BlockFirst)
12071 // match: (LT (FlagLT_UGT) yes no)
12072 // result: (First yes no)
12073 for b.Controls[0].Op == Op386FlagLT_UGT {
12074 b.Reset(BlockFirst)
12077 // match: (LT (FlagGT_ULT) yes no)
12078 // result: (First no yes)
12079 for b.Controls[0].Op == Op386FlagGT_ULT {
12080 b.Reset(BlockFirst)
12084 // match: (LT (FlagGT_UGT) yes no)
12085 // result: (First no yes)
12086 for b.Controls[0].Op == Op386FlagGT_UGT {
12087 b.Reset(BlockFirst)
12092 // match: (NE (TESTB (SETL cmp) (SETL cmp)) yes no)
12093 // result: (LT cmp yes no)
12094 for b.Controls[0].Op == Op386TESTB {
12095 v_0 := b.Controls[0]
12097 v_0_0 := v_0.Args[0]
12098 if v_0_0.Op != Op386SETL {
12101 cmp := v_0_0.Args[0]
12102 v_0_1 := v_0.Args[1]
12103 if v_0_1.Op != Op386SETL || cmp != v_0_1.Args[0] {
12106 b.resetWithControl(Block386LT, cmp)
12109 // match: (NE (TESTB (SETLE cmp) (SETLE cmp)) yes no)
12110 // result: (LE cmp yes no)
12111 for b.Controls[0].Op == Op386TESTB {
12112 v_0 := b.Controls[0]
12114 v_0_0 := v_0.Args[0]
12115 if v_0_0.Op != Op386SETLE {
12118 cmp := v_0_0.Args[0]
12119 v_0_1 := v_0.Args[1]
12120 if v_0_1.Op != Op386SETLE || cmp != v_0_1.Args[0] {
12123 b.resetWithControl(Block386LE, cmp)
12126 // match: (NE (TESTB (SETG cmp) (SETG cmp)) yes no)
12127 // result: (GT cmp yes no)
12128 for b.Controls[0].Op == Op386TESTB {
12129 v_0 := b.Controls[0]
12131 v_0_0 := v_0.Args[0]
12132 if v_0_0.Op != Op386SETG {
12135 cmp := v_0_0.Args[0]
12136 v_0_1 := v_0.Args[1]
12137 if v_0_1.Op != Op386SETG || cmp != v_0_1.Args[0] {
12140 b.resetWithControl(Block386GT, cmp)
12143 // match: (NE (TESTB (SETGE cmp) (SETGE cmp)) yes no)
12144 // result: (GE cmp yes no)
12145 for b.Controls[0].Op == Op386TESTB {
12146 v_0 := b.Controls[0]
12148 v_0_0 := v_0.Args[0]
12149 if v_0_0.Op != Op386SETGE {
12152 cmp := v_0_0.Args[0]
12153 v_0_1 := v_0.Args[1]
12154 if v_0_1.Op != Op386SETGE || cmp != v_0_1.Args[0] {
12157 b.resetWithControl(Block386GE, cmp)
12160 // match: (NE (TESTB (SETEQ cmp) (SETEQ cmp)) yes no)
12161 // result: (EQ cmp yes no)
12162 for b.Controls[0].Op == Op386TESTB {
12163 v_0 := b.Controls[0]
12165 v_0_0 := v_0.Args[0]
12166 if v_0_0.Op != Op386SETEQ {
12169 cmp := v_0_0.Args[0]
12170 v_0_1 := v_0.Args[1]
12171 if v_0_1.Op != Op386SETEQ || cmp != v_0_1.Args[0] {
12174 b.resetWithControl(Block386EQ, cmp)
12177 // match: (NE (TESTB (SETNE cmp) (SETNE cmp)) yes no)
12178 // result: (NE cmp yes no)
12179 for b.Controls[0].Op == Op386TESTB {
12180 v_0 := b.Controls[0]
12182 v_0_0 := v_0.Args[0]
12183 if v_0_0.Op != Op386SETNE {
12186 cmp := v_0_0.Args[0]
12187 v_0_1 := v_0.Args[1]
12188 if v_0_1.Op != Op386SETNE || cmp != v_0_1.Args[0] {
12191 b.resetWithControl(Block386NE, cmp)
12194 // match: (NE (TESTB (SETB cmp) (SETB cmp)) yes no)
12195 // result: (ULT cmp yes no)
12196 for b.Controls[0].Op == Op386TESTB {
12197 v_0 := b.Controls[0]
12199 v_0_0 := v_0.Args[0]
12200 if v_0_0.Op != Op386SETB {
12203 cmp := v_0_0.Args[0]
12204 v_0_1 := v_0.Args[1]
12205 if v_0_1.Op != Op386SETB || cmp != v_0_1.Args[0] {
12208 b.resetWithControl(Block386ULT, cmp)
12211 // match: (NE (TESTB (SETBE cmp) (SETBE cmp)) yes no)
12212 // result: (ULE cmp yes no)
12213 for b.Controls[0].Op == Op386TESTB {
12214 v_0 := b.Controls[0]
12216 v_0_0 := v_0.Args[0]
12217 if v_0_0.Op != Op386SETBE {
12220 cmp := v_0_0.Args[0]
12221 v_0_1 := v_0.Args[1]
12222 if v_0_1.Op != Op386SETBE || cmp != v_0_1.Args[0] {
12225 b.resetWithControl(Block386ULE, cmp)
12228 // match: (NE (TESTB (SETA cmp) (SETA cmp)) yes no)
12229 // result: (UGT cmp yes no)
12230 for b.Controls[0].Op == Op386TESTB {
12231 v_0 := b.Controls[0]
12233 v_0_0 := v_0.Args[0]
12234 if v_0_0.Op != Op386SETA {
12237 cmp := v_0_0.Args[0]
12238 v_0_1 := v_0.Args[1]
12239 if v_0_1.Op != Op386SETA || cmp != v_0_1.Args[0] {
12242 b.resetWithControl(Block386UGT, cmp)
12245 // match: (NE (TESTB (SETAE cmp) (SETAE cmp)) yes no)
12246 // result: (UGE cmp yes no)
12247 for b.Controls[0].Op == Op386TESTB {
12248 v_0 := b.Controls[0]
12250 v_0_0 := v_0.Args[0]
12251 if v_0_0.Op != Op386SETAE {
12254 cmp := v_0_0.Args[0]
12255 v_0_1 := v_0.Args[1]
12256 if v_0_1.Op != Op386SETAE || cmp != v_0_1.Args[0] {
12259 b.resetWithControl(Block386UGE, cmp)
12262 // match: (NE (TESTB (SETO cmp) (SETO cmp)) yes no)
12263 // result: (OS cmp yes no)
12264 for b.Controls[0].Op == Op386TESTB {
12265 v_0 := b.Controls[0]
12267 v_0_0 := v_0.Args[0]
12268 if v_0_0.Op != Op386SETO {
12271 cmp := v_0_0.Args[0]
12272 v_0_1 := v_0.Args[1]
12273 if v_0_1.Op != Op386SETO || cmp != v_0_1.Args[0] {
12276 b.resetWithControl(Block386OS, cmp)
12279 // match: (NE (TESTB (SETGF cmp) (SETGF cmp)) yes no)
12280 // result: (UGT cmp yes no)
12281 for b.Controls[0].Op == Op386TESTB {
12282 v_0 := b.Controls[0]
12284 v_0_0 := v_0.Args[0]
12285 if v_0_0.Op != Op386SETGF {
12288 cmp := v_0_0.Args[0]
12289 v_0_1 := v_0.Args[1]
12290 if v_0_1.Op != Op386SETGF || cmp != v_0_1.Args[0] {
12293 b.resetWithControl(Block386UGT, cmp)
12296 // match: (NE (TESTB (SETGEF cmp) (SETGEF cmp)) yes no)
12297 // result: (UGE cmp yes no)
12298 for b.Controls[0].Op == Op386TESTB {
12299 v_0 := b.Controls[0]
12301 v_0_0 := v_0.Args[0]
12302 if v_0_0.Op != Op386SETGEF {
12305 cmp := v_0_0.Args[0]
12306 v_0_1 := v_0.Args[1]
12307 if v_0_1.Op != Op386SETGEF || cmp != v_0_1.Args[0] {
12310 b.resetWithControl(Block386UGE, cmp)
12313 // match: (NE (TESTB (SETEQF cmp) (SETEQF cmp)) yes no)
12314 // result: (EQF cmp yes no)
12315 for b.Controls[0].Op == Op386TESTB {
12316 v_0 := b.Controls[0]
12318 v_0_0 := v_0.Args[0]
12319 if v_0_0.Op != Op386SETEQF {
12322 cmp := v_0_0.Args[0]
12323 v_0_1 := v_0.Args[1]
12324 if v_0_1.Op != Op386SETEQF || cmp != v_0_1.Args[0] {
12327 b.resetWithControl(Block386EQF, cmp)
12330 // match: (NE (TESTB (SETNEF cmp) (SETNEF cmp)) yes no)
12331 // result: (NEF cmp yes no)
12332 for b.Controls[0].Op == Op386TESTB {
12333 v_0 := b.Controls[0]
12335 v_0_0 := v_0.Args[0]
12336 if v_0_0.Op != Op386SETNEF {
12339 cmp := v_0_0.Args[0]
12340 v_0_1 := v_0.Args[1]
12341 if v_0_1.Op != Op386SETNEF || cmp != v_0_1.Args[0] {
12344 b.resetWithControl(Block386NEF, cmp)
12347 // match: (NE (InvertFlags cmp) yes no)
12348 // result: (NE cmp yes no)
12349 for b.Controls[0].Op == Op386InvertFlags {
12350 v_0 := b.Controls[0]
12352 b.resetWithControl(Block386NE, cmp)
12355 // match: (NE (FlagEQ) yes no)
12356 // result: (First no yes)
12357 for b.Controls[0].Op == Op386FlagEQ {
12358 b.Reset(BlockFirst)
12362 // match: (NE (FlagLT_ULT) yes no)
12363 // result: (First yes no)
12364 for b.Controls[0].Op == Op386FlagLT_ULT {
12365 b.Reset(BlockFirst)
12368 // match: (NE (FlagLT_UGT) yes no)
12369 // result: (First yes no)
12370 for b.Controls[0].Op == Op386FlagLT_UGT {
12371 b.Reset(BlockFirst)
12374 // match: (NE (FlagGT_ULT) yes no)
12375 // result: (First yes no)
12376 for b.Controls[0].Op == Op386FlagGT_ULT {
12377 b.Reset(BlockFirst)
12380 // match: (NE (FlagGT_UGT) yes no)
12381 // result: (First yes no)
12382 for b.Controls[0].Op == Op386FlagGT_UGT {
12383 b.Reset(BlockFirst)
12387 // match: (UGE (InvertFlags cmp) yes no)
12388 // result: (ULE cmp yes no)
12389 for b.Controls[0].Op == Op386InvertFlags {
12390 v_0 := b.Controls[0]
12392 b.resetWithControl(Block386ULE, cmp)
12395 // match: (UGE (FlagEQ) yes no)
12396 // result: (First yes no)
12397 for b.Controls[0].Op == Op386FlagEQ {
12398 b.Reset(BlockFirst)
12401 // match: (UGE (FlagLT_ULT) yes no)
12402 // result: (First no yes)
12403 for b.Controls[0].Op == Op386FlagLT_ULT {
12404 b.Reset(BlockFirst)
12408 // match: (UGE (FlagLT_UGT) yes no)
12409 // result: (First yes no)
12410 for b.Controls[0].Op == Op386FlagLT_UGT {
12411 b.Reset(BlockFirst)
12414 // match: (UGE (FlagGT_ULT) yes no)
12415 // result: (First no yes)
12416 for b.Controls[0].Op == Op386FlagGT_ULT {
12417 b.Reset(BlockFirst)
12421 // match: (UGE (FlagGT_UGT) yes no)
12422 // result: (First yes no)
12423 for b.Controls[0].Op == Op386FlagGT_UGT {
12424 b.Reset(BlockFirst)
12428 // match: (UGT (InvertFlags cmp) yes no)
12429 // result: (ULT cmp yes no)
12430 for b.Controls[0].Op == Op386InvertFlags {
12431 v_0 := b.Controls[0]
12433 b.resetWithControl(Block386ULT, cmp)
12436 // match: (UGT (FlagEQ) yes no)
12437 // result: (First no yes)
12438 for b.Controls[0].Op == Op386FlagEQ {
12439 b.Reset(BlockFirst)
12443 // match: (UGT (FlagLT_ULT) yes no)
12444 // result: (First no yes)
12445 for b.Controls[0].Op == Op386FlagLT_ULT {
12446 b.Reset(BlockFirst)
12450 // match: (UGT (FlagLT_UGT) yes no)
12451 // result: (First yes no)
12452 for b.Controls[0].Op == Op386FlagLT_UGT {
12453 b.Reset(BlockFirst)
12456 // match: (UGT (FlagGT_ULT) yes no)
12457 // result: (First no yes)
12458 for b.Controls[0].Op == Op386FlagGT_ULT {
12459 b.Reset(BlockFirst)
12463 // match: (UGT (FlagGT_UGT) yes no)
12464 // result: (First yes no)
12465 for b.Controls[0].Op == Op386FlagGT_UGT {
12466 b.Reset(BlockFirst)
12470 // match: (ULE (InvertFlags cmp) yes no)
12471 // result: (UGE cmp yes no)
12472 for b.Controls[0].Op == Op386InvertFlags {
12473 v_0 := b.Controls[0]
12475 b.resetWithControl(Block386UGE, cmp)
12478 // match: (ULE (FlagEQ) yes no)
12479 // result: (First yes no)
12480 for b.Controls[0].Op == Op386FlagEQ {
12481 b.Reset(BlockFirst)
12484 // match: (ULE (FlagLT_ULT) yes no)
12485 // result: (First yes no)
12486 for b.Controls[0].Op == Op386FlagLT_ULT {
12487 b.Reset(BlockFirst)
12490 // match: (ULE (FlagLT_UGT) yes no)
12491 // result: (First no yes)
12492 for b.Controls[0].Op == Op386FlagLT_UGT {
12493 b.Reset(BlockFirst)
12497 // match: (ULE (FlagGT_ULT) yes no)
12498 // result: (First yes no)
12499 for b.Controls[0].Op == Op386FlagGT_ULT {
12500 b.Reset(BlockFirst)
12503 // match: (ULE (FlagGT_UGT) yes no)
12504 // result: (First no yes)
12505 for b.Controls[0].Op == Op386FlagGT_UGT {
12506 b.Reset(BlockFirst)
12511 // match: (ULT (InvertFlags cmp) yes no)
12512 // result: (UGT cmp yes no)
12513 for b.Controls[0].Op == Op386InvertFlags {
12514 v_0 := b.Controls[0]
12516 b.resetWithControl(Block386UGT, cmp)
12519 // match: (ULT (FlagEQ) yes no)
12520 // result: (First no yes)
12521 for b.Controls[0].Op == Op386FlagEQ {
12522 b.Reset(BlockFirst)
12526 // match: (ULT (FlagLT_ULT) yes no)
12527 // result: (First yes no)
12528 for b.Controls[0].Op == Op386FlagLT_ULT {
12529 b.Reset(BlockFirst)
12532 // match: (ULT (FlagLT_UGT) yes no)
12533 // result: (First no yes)
12534 for b.Controls[0].Op == Op386FlagLT_UGT {
12535 b.Reset(BlockFirst)
12539 // match: (ULT (FlagGT_ULT) yes no)
12540 // result: (First yes no)
12541 for b.Controls[0].Op == Op386FlagGT_ULT {
12542 b.Reset(BlockFirst)
12545 // match: (ULT (FlagGT_UGT) yes no)
12546 // result: (First no yes)
12547 for b.Controls[0].Op == Op386FlagGT_UGT {
12548 b.Reset(BlockFirst)